peachsim 0.1.2210 → 0.1.2213

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/cli/command-registry.ts +1 -0
  2. package/cli/commands/inspect/settling.ts +1 -1
  3. package/cli/commands/map.ts +576 -0
  4. package/cli/commands/runtime.ts +1 -1
  5. package/cli/main.ts +6 -0
  6. package/cli/outbound-endpoints.ts +11 -0
  7. package/dist-lib/agent-daemon-client.cjs +1 -1
  8. package/dist-lib/agent-events.cjs +1 -1
  9. package/dist-lib/attached-projects.cjs +1 -1
  10. package/dist-lib/auth/shared-session.cjs +1 -1
  11. package/dist-lib/backend-origin.cjs +1 -1
  12. package/dist-lib/beta.cjs +1 -1
  13. package/dist-lib/beta.mjs +1 -1
  14. package/dist-lib/bridge-constants.cjs +1 -1
  15. package/dist-lib/bridge-contract-input.cjs +1 -1
  16. package/dist-lib/bridge-contract-input.mjs +1 -1
  17. package/dist-lib/bridge-contract.cjs +1 -1
  18. package/dist-lib/bridge-contract.mjs +1 -1
  19. package/dist-lib/bundle-channel.cjs +16 -7
  20. package/dist-lib/capture-contract.cjs +1 -1
  21. package/dist-lib/capture-contract.mjs +1 -1
  22. package/dist-lib/cloud-contract.cjs +1 -1
  23. package/dist-lib/cloud-contract.mjs +1 -1
  24. package/dist-lib/cloud-test-args.cjs +1 -1
  25. package/dist-lib/cloud-test-args.mjs +1 -1
  26. package/dist-lib/cloud.cjs +1 -1
  27. package/dist-lib/cloud.mjs +1 -1
  28. package/dist-lib/config.cjs +1 -1
  29. package/dist-lib/config.mjs +1 -1
  30. package/dist-lib/detox/index.cjs +6 -3
  31. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  32. package/dist-lib/expo-swift-bundle.cjs +14 -5
  33. package/dist-lib/expo-swift-metadata.cjs +1 -1
  34. package/dist-lib/expo-swift-metadata.mjs +1 -1
  35. package/dist-lib/home-paths.cjs +1 -1
  36. package/dist-lib/host/bridge-host.cjs +999 -811
  37. package/dist-lib/host/fetch-proxy-handler.cjs +8 -5
  38. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  39. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  40. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  41. package/dist-lib/host/websocket-proxy.cjs +1 -1
  42. package/dist-lib/index.cjs +1953 -752
  43. package/dist-lib/jump-to-source-babel.cjs +1 -1
  44. package/dist-lib/jump-to-source-native.cjs +1 -1
  45. package/dist-lib/kotlin-host.cjs +1 -1
  46. package/dist-lib/menu.cjs +1 -1
  47. package/dist-lib/menu.mjs +1 -1
  48. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  49. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  50. package/dist-lib/metro-production-bundle.cjs +1 -1
  51. package/dist-lib/metro-production-bundle.mjs +1 -1
  52. package/dist-lib/metro.cjs +1793 -593
  53. package/dist-lib/native-app-identity-project.cjs +6 -3
  54. package/dist-lib/native-app-identity-project.mjs +6 -3
  55. package/dist-lib/native-app-identity.cjs +1 -1
  56. package/dist-lib/native-app-identity.mjs +1 -1
  57. package/dist-lib/native-firebase-metadata.cjs +1 -1
  58. package/dist-lib/native-firebase-metadata.mjs +1 -1
  59. package/dist-lib/pdfium-raster.cjs +1 -1
  60. package/dist-lib/pdfium-raster.mjs +1 -1
  61. package/dist-lib/plist.cjs +1 -1
  62. package/dist-lib/plist.mjs +1 -1
  63. package/dist-lib/profiles.cjs +1 -1
  64. package/dist-lib/public-brand.cjs +1 -1
  65. package/dist-lib/public-origins-lib-esm.json +25 -24
  66. package/dist-lib/public-origins-lib.json +73 -53
  67. package/dist-lib/react-native-host-modules.cjs +1 -1
  68. package/dist-lib/react-native-host-modules.mjs +1 -1
  69. package/dist-lib/reap-browser.cjs +1 -1
  70. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  71. package/dist-lib/sdk.cjs +2 -2
  72. package/dist-lib/sdk.mjs +2 -2
  73. package/dist-lib/skills.cjs +1535 -1289
  74. package/dist-lib/swift-compile.cjs +2 -2
  75. package/dist-lib/swift-compile.mjs +2 -2
  76. package/dist-lib/swift-package.cjs +1 -1
  77. package/dist-lib/swift-package.mjs +1 -1
  78. package/dist-lib/swift-submit.cjs +1 -1
  79. package/dist-lib/swift-submit.mjs +1 -1
  80. package/dist-lib/swift-toolchain.cjs +1 -1
  81. package/dist-lib/swift.cjs +1 -1
  82. package/dist-lib/vite-swift.cjs +7 -4
  83. package/dist-lib/vite.cjs +1517 -303
  84. package/dist-lib/worklet-executable.cjs +1 -1
  85. package/dist-lib/worklet-executable.mjs +1 -1
  86. package/dist-types/packages/peach-engine/src/engine/font-config.d.ts +1 -1
  87. package/dist-types/packages/peach-engine/src/engine/node.d.ts +1 -0
  88. package/kotlin/sdk.tar.gz +0 -0
  89. package/package.json +1 -1
  90. package/runtime-companion.json +1 -1
  91. package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes +35 -0
  92. package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/CoreData.h +8 -0
  93. package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSAttributeDescription.h +30 -0
  94. package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSEntityDescription.h +14 -0
  95. package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSExpressionDescription.h +10 -0
  96. package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSFetchIndexDescription.h +13 -0
  97. package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSFetchIndexElementDescription.h +18 -0
  98. package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObject.h +11 -0
  99. package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObjectContext.h +19 -0
  100. package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObjectID.h +2 -0
  101. package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObjectModel.h +3 -0
  102. package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSMergePolicy.h +17 -0
  103. package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentStore.h +8 -0
  104. package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentStoreCoordinator.h +6 -0
  105. package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSPropertyDescription.h +13 -0
  106. package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSRelationshipDescription.h +21 -0
  107. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIImage.h +1 -10
  108. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UINibLoading.h +1 -1
  109. package/sdk/ios/System/Library/Frameworks/UIKitTypes.framework/Headers/UIKitTypes.h +11 -0
  110. package/skills/contrast/SKILL.md +1 -0
  111. package/src/home-paths.ts +1 -1
  112. package/src/host/bridge-host.ts +101 -97
  113. package/src/metro-plugin.ts +4 -1
  114. package/src/react-native-coverage/native-source-ranges-file.ts +1 -1
  115. package/src/runtime-assets.ts +0 -1
  116. package/src/runtime-delivery.ts +1 -1
  117. package/src/runtime-packs.ts +212 -0
  118. package/src/swift-shipped-binaries.ts +1 -1
  119. package/src/swift-standin-config.ts +4 -2
  120. package/src/vite-plugin-one.ts +4 -1
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2210 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2213 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -39,7 +39,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
39
39
  var define_SWIFT_COVERAGE_SOURCE_DIGESTS_default;
40
40
  var init_define_SWIFT_COVERAGE_SOURCE_DIGESTS = __esm({
41
41
  "<define:__SWIFT_COVERAGE_SOURCE_DIGESTS__>"() {
42
- define_SWIFT_COVERAGE_SOURCE_DIGESTS_default = { "swift-coverage/indexdump.ts": "0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412", "swift-coverage/indexing.ts": "633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272", "swift-coverage/types.ts": "bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1", "swift-coverage/source.ts": "c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee", "swift-coverage/package.ts": "1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b", "swift-coverage/xcode.ts": "65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa", "swift-coverage/xcode-assets.ts": "99e03b74c961d2449afd58c2cbc415ba91d1d469a4f89e461c137fd6c305b27c", "swift-coverage/xcode-asset-symbols.ts": "1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671", "swift-coverage/xcode-bridging.ts": "33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11", "swift-coverage/xcode-packages.ts": "8e6020d17d24474150a5a50d042aca6261819ef75c79680a287a66f395909915", "swift-coverage/xcode-strings.ts": "f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c", "swift-coverage/reader.ts": "da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c", "swift-coverage/provenance.ts": "eb3b41ae8b58b48f6758f084800f188dfb1edb227e483abdd6b80cde66e849b9", "swift-package-manifest.ts": "4b7d4a715cdaf57468ead23f2ff9dce76d02c6a888d73d144d4baa2ae571ba3c", "swift-package.ts": "338cfef9a34a930206ac2e1a8a90b85c8d61f776d9a41e6445dc18e0c5385cdb", "swift-source-file.ts": "93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94", "swift-toolchain.ts": "25505683ca29a0b380413bf2a5026d4967eacf886e35bc11ece6e15317e5bb02", "home-paths.ts": "673205c02bbc8e342a9b43585a3a1b5f6b64eb5fb474e1a8647e9d2c2e62e67d", "xcode-header-search.ts": "f8c3d557b4eca5ddad32907545353eb7ad53b2ebd0969d9ed8f7275e109a13b1", "xcode-project.ts": "86f79e98323ec065e0e5195324c75ca608f490efbd95dcc25c53d5aa0b9aecc9", "xcode-target-members.ts": "ad7589132bffab265e8a10b64e24484fe88b4a2b1cc0ee19a97f151a002eca77", "xcode-json-project.ts": "41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6", "openstep-plist.ts": "74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3" };
42
+ define_SWIFT_COVERAGE_SOURCE_DIGESTS_default = { "swift-coverage/indexdump.ts": "0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412", "swift-coverage/indexing.ts": "633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272", "swift-coverage/types.ts": "bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1", "swift-coverage/source.ts": "c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee", "swift-coverage/package.ts": "1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b", "swift-coverage/xcode.ts": "65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa", "swift-coverage/xcode-assets.ts": "99e03b74c961d2449afd58c2cbc415ba91d1d469a4f89e461c137fd6c305b27c", "swift-coverage/xcode-asset-symbols.ts": "1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671", "swift-coverage/xcode-bridging.ts": "33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11", "swift-coverage/xcode-packages.ts": "8e6020d17d24474150a5a50d042aca6261819ef75c79680a287a66f395909915", "swift-coverage/xcode-strings.ts": "f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c", "swift-coverage/reader.ts": "da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c", "swift-coverage/provenance.ts": "eb3b41ae8b58b48f6758f084800f188dfb1edb227e483abdd6b80cde66e849b9", "swift-package-manifest.ts": "4b7d4a715cdaf57468ead23f2ff9dce76d02c6a888d73d144d4baa2ae571ba3c", "swift-package.ts": "338cfef9a34a930206ac2e1a8a90b85c8d61f776d9a41e6445dc18e0c5385cdb", "swift-source-file.ts": "93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94", "swift-toolchain.ts": "25505683ca29a0b380413bf2a5026d4967eacf886e35bc11ece6e15317e5bb02", "home-paths.ts": "d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd", "xcode-header-search.ts": "f8c3d557b4eca5ddad32907545353eb7ad53b2ebd0969d9ed8f7275e109a13b1", "xcode-project.ts": "86f79e98323ec065e0e5195324c75ca608f490efbd95dcc25c53d5aa0b9aecc9", "xcode-target-members.ts": "ad7589132bffab265e8a10b64e24484fe88b4a2b1cc0ee19a97f151a002eca77", "xcode-json-project.ts": "41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6", "openstep-plist.ts": "74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3" };
43
43
  }
44
44
  });
45
45
 
@@ -335,42 +335,64 @@ var init_version = __esm({
335
335
 
336
336
  // src/home-paths.ts
337
337
  function ambientHomeDir() {
338
- return import_node_path5.default.join((0, import_node_os.homedir)(), ".peach");
338
+ return import_node_path8.default.join((0, import_node_os4.homedir)(), ".peach");
339
339
  }
340
340
  function rnxHomeDir() {
341
341
  const override = process.env[PEACH_HOME_ENV];
342
- return override && override.length > 0 ? import_node_path5.default.resolve(override) : ambientHomeDir();
342
+ return override && override.length > 0 ? import_node_path8.default.resolve(override) : ambientHomeDir();
343
343
  }
344
344
  function runtimesDir() {
345
- return import_node_path5.default.join(rnxHomeDir(), "runtimes");
345
+ return import_node_path8.default.join(rnxHomeDir(), "runtimes");
346
346
  }
347
347
  function runtimeDir(version) {
348
- return import_node_path5.default.join(runtimesDir(), version);
348
+ return import_node_path8.default.join(runtimesDir(), version);
349
349
  }
350
350
  function activeRuntimeFile() {
351
- return import_node_path5.default.join(runtimesDir(), ACTIVE_RUNTIME_FILE);
351
+ return import_node_path8.default.join(runtimesDir(), ACTIVE_RUNTIME_FILE);
352
+ }
353
+ function electronDir() {
354
+ return import_node_path8.default.join(rnxHomeDir(), "electron");
355
+ }
356
+ function profilesDir() {
357
+ return import_node_path8.default.join(rnxHomeDir(), "profiles");
352
358
  }
353
359
  function cacheDir() {
354
- return import_node_path5.default.join(rnxHomeDir(), "cache");
360
+ return import_node_path8.default.join(rnxHomeDir(), "cache");
361
+ }
362
+ function configFilePath() {
363
+ return import_node_path8.default.join(rnxHomeDir(), CONFIG_FILE);
364
+ }
365
+ function ensureRnxHome() {
366
+ import_node_fs10.default.mkdirSync(rnxHomeDir(), { recursive: true });
367
+ import_node_fs10.default.mkdirSync(runtimesDir(), { recursive: true });
368
+ import_node_fs10.default.mkdirSync(electronDir(), { recursive: true });
369
+ import_node_fs10.default.mkdirSync(profilesDir(), { recursive: true });
370
+ import_node_fs10.default.mkdirSync(cacheDir(), { recursive: true });
355
371
  }
356
372
  function readActiveRuntime() {
357
373
  try {
358
- const value = import_node_fs6.default.readFileSync(activeRuntimeFile(), "utf8").trim();
374
+ const value = import_node_fs10.default.readFileSync(activeRuntimeFile(), "utf8").trim();
359
375
  return value.length > 0 ? value : null;
360
376
  } catch {
361
377
  return null;
362
378
  }
363
379
  }
364
- var import_node_fs6, import_node_os, import_node_path5, PEACH_HOME_ENV, ACTIVE_RUNTIME_FILE, DAEMON_LOCKFILE_MAX_BYTES;
380
+ function writeActiveRuntime(version) {
381
+ import_node_fs10.default.mkdirSync(runtimesDir(), { recursive: true });
382
+ import_node_fs10.default.writeFileSync(activeRuntimeFile(), `${version}
383
+ `, "utf8");
384
+ }
385
+ var import_node_fs10, import_node_os4, import_node_path8, PEACH_HOME_ENV, ACTIVE_RUNTIME_FILE, CONFIG_FILE, DAEMON_LOCKFILE_MAX_BYTES;
365
386
  var init_home_paths = __esm({
366
387
  "src/home-paths.ts"() {
367
388
  "use strict";
368
389
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
369
- import_node_fs6 = __toESM(require("node:fs"), 1);
370
- import_node_os = require("node:os");
371
- import_node_path5 = __toESM(require("node:path"), 1);
390
+ import_node_fs10 = __toESM(require("node:fs"), 1);
391
+ import_node_os4 = require("node:os");
392
+ import_node_path8 = __toESM(require("node:path"), 1);
372
393
  PEACH_HOME_ENV = "PEACH_HOME";
373
394
  ACTIVE_RUNTIME_FILE = "active";
395
+ CONFIG_FILE = "config.json";
374
396
  DAEMON_LOCKFILE_MAX_BYTES = 16 * 1024;
375
397
  }
376
398
  });
@@ -1544,17 +1566,17 @@ function visit(node, visitor) {
1544
1566
  } else
1545
1567
  visit_(null, node, visitor_, Object.freeze([]));
1546
1568
  }
1547
- function visit_(key, node, visitor, path26) {
1548
- const ctrl = callVisitor(key, node, visitor, path26);
1569
+ function visit_(key, node, visitor, path29) {
1570
+ const ctrl = callVisitor(key, node, visitor, path29);
1549
1571
  if (isNode(ctrl) || isPair(ctrl)) {
1550
- replaceNode(key, path26, ctrl);
1551
- return visit_(key, ctrl, visitor, path26);
1572
+ replaceNode(key, path29, ctrl);
1573
+ return visit_(key, ctrl, visitor, path29);
1552
1574
  }
1553
1575
  if (typeof ctrl !== "symbol") {
1554
1576
  if (isCollection(node)) {
1555
- path26 = Object.freeze(path26.concat(node));
1577
+ path29 = Object.freeze(path29.concat(node));
1556
1578
  for (let i = 0; i < node.items.length; ++i) {
1557
- const ci = visit_(i, node.items[i], visitor, path26);
1579
+ const ci = visit_(i, node.items[i], visitor, path29);
1558
1580
  if (typeof ci === "number")
1559
1581
  i = ci - 1;
1560
1582
  else if (ci === BREAK)
@@ -1565,13 +1587,13 @@ function visit_(key, node, visitor, path26) {
1565
1587
  }
1566
1588
  }
1567
1589
  } else if (isPair(node)) {
1568
- path26 = Object.freeze(path26.concat(node));
1569
- const ck = visit_("key", node.key, visitor, path26);
1590
+ path29 = Object.freeze(path29.concat(node));
1591
+ const ck = visit_("key", node.key, visitor, path29);
1570
1592
  if (ck === BREAK)
1571
1593
  return BREAK;
1572
1594
  else if (ck === REMOVE)
1573
1595
  node.key = null;
1574
- const cv = visit_("value", node.value, visitor, path26);
1596
+ const cv = visit_("value", node.value, visitor, path29);
1575
1597
  if (cv === BREAK)
1576
1598
  return BREAK;
1577
1599
  else if (cv === REMOVE)
@@ -1589,17 +1611,17 @@ async function visitAsync(node, visitor) {
1589
1611
  } else
1590
1612
  await visitAsync_(null, node, visitor_, Object.freeze([]));
1591
1613
  }
1592
- async function visitAsync_(key, node, visitor, path26) {
1593
- const ctrl = await callVisitor(key, node, visitor, path26);
1614
+ async function visitAsync_(key, node, visitor, path29) {
1615
+ const ctrl = await callVisitor(key, node, visitor, path29);
1594
1616
  if (isNode(ctrl) || isPair(ctrl)) {
1595
- replaceNode(key, path26, ctrl);
1596
- return visitAsync_(key, ctrl, visitor, path26);
1617
+ replaceNode(key, path29, ctrl);
1618
+ return visitAsync_(key, ctrl, visitor, path29);
1597
1619
  }
1598
1620
  if (typeof ctrl !== "symbol") {
1599
1621
  if (isCollection(node)) {
1600
- path26 = Object.freeze(path26.concat(node));
1622
+ path29 = Object.freeze(path29.concat(node));
1601
1623
  for (let i = 0; i < node.items.length; ++i) {
1602
- const ci = await visitAsync_(i, node.items[i], visitor, path26);
1624
+ const ci = await visitAsync_(i, node.items[i], visitor, path29);
1603
1625
  if (typeof ci === "number")
1604
1626
  i = ci - 1;
1605
1627
  else if (ci === BREAK)
@@ -1610,13 +1632,13 @@ async function visitAsync_(key, node, visitor, path26) {
1610
1632
  }
1611
1633
  }
1612
1634
  } else if (isPair(node)) {
1613
- path26 = Object.freeze(path26.concat(node));
1614
- const ck = await visitAsync_("key", node.key, visitor, path26);
1635
+ path29 = Object.freeze(path29.concat(node));
1636
+ const ck = await visitAsync_("key", node.key, visitor, path29);
1615
1637
  if (ck === BREAK)
1616
1638
  return BREAK;
1617
1639
  else if (ck === REMOVE)
1618
1640
  node.key = null;
1619
- const cv = await visitAsync_("value", node.value, visitor, path26);
1641
+ const cv = await visitAsync_("value", node.value, visitor, path29);
1620
1642
  if (cv === BREAK)
1621
1643
  return BREAK;
1622
1644
  else if (cv === REMOVE)
@@ -1643,23 +1665,23 @@ function initVisitor(visitor) {
1643
1665
  }
1644
1666
  return visitor;
1645
1667
  }
1646
- function callVisitor(key, node, visitor, path26) {
1668
+ function callVisitor(key, node, visitor, path29) {
1647
1669
  if (typeof visitor === "function")
1648
- return visitor(key, node, path26);
1670
+ return visitor(key, node, path29);
1649
1671
  if (isMap(node))
1650
- return visitor.Map?.(key, node, path26);
1672
+ return visitor.Map?.(key, node, path29);
1651
1673
  if (isSeq(node))
1652
- return visitor.Seq?.(key, node, path26);
1674
+ return visitor.Seq?.(key, node, path29);
1653
1675
  if (isPair(node))
1654
- return visitor.Pair?.(key, node, path26);
1676
+ return visitor.Pair?.(key, node, path29);
1655
1677
  if (isScalar(node))
1656
- return visitor.Scalar?.(key, node, path26);
1678
+ return visitor.Scalar?.(key, node, path29);
1657
1679
  if (isAlias(node))
1658
- return visitor.Alias?.(key, node, path26);
1680
+ return visitor.Alias?.(key, node, path29);
1659
1681
  return void 0;
1660
1682
  }
1661
- function replaceNode(key, path26, node) {
1662
- const parent = path26[path26.length - 1];
1683
+ function replaceNode(key, path29, node) {
1684
+ const parent = path29[path29.length - 1];
1663
1685
  if (isCollection(parent)) {
1664
1686
  parent.items[key] = node;
1665
1687
  } else if (isPair(parent)) {
@@ -2219,10 +2241,10 @@ var init_createNode = __esm({
2219
2241
  });
2220
2242
 
2221
2243
  // ../../node_modules/yaml/browser/dist/nodes/Collection.js
2222
- function collectionFromPath(schema4, path26, value) {
2244
+ function collectionFromPath(schema4, path29, value) {
2223
2245
  let v6 = value;
2224
- for (let i = path26.length - 1; i >= 0; --i) {
2225
- const k = path26[i];
2246
+ for (let i = path29.length - 1; i >= 0; --i) {
2247
+ const k = path29[i];
2226
2248
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
2227
2249
  const a = [];
2228
2250
  a[k] = v6;
@@ -2248,7 +2270,7 @@ var init_Collection = __esm({
2248
2270
  init_createNode();
2249
2271
  init_identity();
2250
2272
  init_Node();
2251
- isEmptyPath = (path26) => path26 == null || typeof path26 === "object" && !!path26[Symbol.iterator]().next().done;
2273
+ isEmptyPath = (path29) => path29 == null || typeof path29 === "object" && !!path29[Symbol.iterator]().next().done;
2252
2274
  Collection = class extends NodeBase {
2253
2275
  constructor(type, schema4) {
2254
2276
  super(type);
@@ -2278,11 +2300,11 @@ var init_Collection = __esm({
2278
2300
  * be a Pair instance or a `{ key, value }` object, which may not have a key
2279
2301
  * that already exists in the map.
2280
2302
  */
2281
- addIn(path26, value) {
2282
- if (isEmptyPath(path26))
2303
+ addIn(path29, value) {
2304
+ if (isEmptyPath(path29))
2283
2305
  this.add(value);
2284
2306
  else {
2285
- const [key, ...rest] = path26;
2307
+ const [key, ...rest] = path29;
2286
2308
  const node = this.get(key, true);
2287
2309
  if (isCollection(node))
2288
2310
  node.addIn(rest, value);
@@ -2296,8 +2318,8 @@ var init_Collection = __esm({
2296
2318
  * Removes a value from the collection.
2297
2319
  * @returns `true` if the item was found and removed.
2298
2320
  */
2299
- deleteIn(path26) {
2300
- const [key, ...rest] = path26;
2321
+ deleteIn(path29) {
2322
+ const [key, ...rest] = path29;
2301
2323
  if (rest.length === 0)
2302
2324
  return this.delete(key);
2303
2325
  const node = this.get(key, true);
@@ -2311,8 +2333,8 @@ var init_Collection = __esm({
2311
2333
  * scalar values from their surrounding node; to disable set `keepScalar` to
2312
2334
  * `true` (collections are always returned intact).
2313
2335
  */
2314
- getIn(path26, keepScalar) {
2315
- const [key, ...rest] = path26;
2336
+ getIn(path29, keepScalar) {
2337
+ const [key, ...rest] = path29;
2316
2338
  const node = this.get(key, true);
2317
2339
  if (rest.length === 0)
2318
2340
  return !keepScalar && isScalar(node) ? node.value : node;
@@ -2330,8 +2352,8 @@ var init_Collection = __esm({
2330
2352
  /**
2331
2353
  * Checks if the collection includes a value with the key `key`.
2332
2354
  */
2333
- hasIn(path26) {
2334
- const [key, ...rest] = path26;
2355
+ hasIn(path29) {
2356
+ const [key, ...rest] = path29;
2335
2357
  if (rest.length === 0)
2336
2358
  return this.has(key);
2337
2359
  const node = this.get(key, true);
@@ -2341,8 +2363,8 @@ var init_Collection = __esm({
2341
2363
  * Sets a value in this collection. For `!!set`, `value` needs to be a
2342
2364
  * boolean to add/remove the item from the set.
2343
2365
  */
2344
- setIn(path26, value) {
2345
- const [key, ...rest] = path26;
2366
+ setIn(path29, value) {
2367
+ const [key, ...rest] = path29;
2346
2368
  if (rest.length === 0) {
2347
2369
  this.set(key, value);
2348
2370
  } else {
@@ -4315,15 +4337,15 @@ function visit2(cst, visitor) {
4315
4337
  cst = { start: cst.start, value: cst.value };
4316
4338
  _visit(Object.freeze([]), cst, visitor);
4317
4339
  }
4318
- function _visit(path26, item, visitor) {
4319
- let ctrl = visitor(item, path26);
4340
+ function _visit(path29, item, visitor) {
4341
+ let ctrl = visitor(item, path29);
4320
4342
  if (typeof ctrl === "symbol")
4321
4343
  return ctrl;
4322
4344
  for (const field of ["key", "value"]) {
4323
4345
  const token = item[field];
4324
4346
  if (token && "items" in token) {
4325
4347
  for (let i = 0; i < token.items.length; ++i) {
4326
- const ci = _visit(Object.freeze(path26.concat([[field, i]])), token.items[i], visitor);
4348
+ const ci = _visit(Object.freeze(path29.concat([[field, i]])), token.items[i], visitor);
4327
4349
  if (typeof ci === "number")
4328
4350
  i = ci - 1;
4329
4351
  else if (ci === BREAK2)
@@ -4334,10 +4356,10 @@ function _visit(path26, item, visitor) {
4334
4356
  }
4335
4357
  }
4336
4358
  if (typeof ctrl === "function" && field === "key")
4337
- ctrl = ctrl(item, path26);
4359
+ ctrl = ctrl(item, path29);
4338
4360
  }
4339
4361
  }
4340
- return typeof ctrl === "function" ? ctrl(item, path26) : ctrl;
4362
+ return typeof ctrl === "function" ? ctrl(item, path29) : ctrl;
4341
4363
  }
4342
4364
  var BREAK2, SKIP2, REMOVE2;
4343
4365
  var init_cst_visit = __esm({
@@ -4349,9 +4371,9 @@ var init_cst_visit = __esm({
4349
4371
  visit2.BREAK = BREAK2;
4350
4372
  visit2.SKIP = SKIP2;
4351
4373
  visit2.REMOVE = REMOVE2;
4352
- visit2.itemAtPath = (cst, path26) => {
4374
+ visit2.itemAtPath = (cst, path29) => {
4353
4375
  let item = cst;
4354
- for (const [field, index] of path26) {
4376
+ for (const [field, index] of path29) {
4355
4377
  const tok = item?.[field];
4356
4378
  if (tok && "items" in tok) {
4357
4379
  item = tok.items[index];
@@ -4360,9 +4382,9 @@ var init_cst_visit = __esm({
4360
4382
  }
4361
4383
  return item;
4362
4384
  };
4363
- visit2.parentCollection = (cst, path26) => {
4364
- const parent = visit2.itemAtPath(cst, path26.slice(0, -1));
4365
- const field = path26[path26.length - 1][0];
4385
+ visit2.parentCollection = (cst, path29) => {
4386
+ const parent = visit2.itemAtPath(cst, path29.slice(0, -1));
4387
+ const field = path29[path29.length - 1][0];
4366
4388
  const coll = parent?.[field];
4367
4389
  if (coll && "items" in coll)
4368
4390
  return coll;
@@ -4457,25 +4479,25 @@ var init_browser = __esm({
4457
4479
  });
4458
4480
 
4459
4481
  // cli/commands/nodeRepoFileReader.ts
4460
- var import_node_fs8, nodeRepoFileReader;
4482
+ var import_node_fs12, nodeRepoFileReader;
4461
4483
  var init_nodeRepoFileReader = __esm({
4462
4484
  "cli/commands/nodeRepoFileReader.ts"() {
4463
4485
  "use strict";
4464
4486
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
4465
- import_node_fs8 = require("node:fs");
4487
+ import_node_fs12 = require("node:fs");
4466
4488
  nodeRepoFileReader = {
4467
- exists: import_node_fs8.existsSync,
4468
- readText: (filePath) => (0, import_node_fs8.readFileSync)(filePath, "utf8"),
4469
- entries: (directory) => (0, import_node_fs8.readdirSync)(directory, { withFileTypes: true }).map((entry) => ({
4489
+ exists: import_node_fs12.existsSync,
4490
+ readText: (filePath) => (0, import_node_fs12.readFileSync)(filePath, "utf8"),
4491
+ entries: (directory) => (0, import_node_fs12.readdirSync)(directory, { withFileTypes: true }).map((entry) => ({
4470
4492
  name: entry.name,
4471
4493
  directory: entry.isDirectory()
4472
4494
  })),
4473
- isDirectory: (filePath) => (0, import_node_fs8.statSync)(filePath).isDirectory(),
4495
+ isDirectory: (filePath) => (0, import_node_fs12.statSync)(filePath).isDirectory(),
4474
4496
  readMetadata(filePath) {
4475
4497
  try {
4476
- const info = (0, import_node_fs8.lstatSync)(filePath);
4498
+ const info = (0, import_node_fs12.lstatSync)(filePath);
4477
4499
  if (!info.isFile() || info.size > 4 * 1024 * 1024) return null;
4478
- return (0, import_node_fs8.readFileSync)(filePath, "utf8");
4500
+ return (0, import_node_fs12.readFileSync)(filePath, "utf8");
4479
4501
  } catch {
4480
4502
  return null;
4481
4503
  }
@@ -4498,7 +4520,7 @@ function scanRepository(root) {
4498
4520
  directories.push(next.dir);
4499
4521
  let handle;
4500
4522
  try {
4501
- handle = (0, import_node_fs9.opendirSync)(next.dir);
4523
+ handle = (0, import_node_fs13.opendirSync)(next.dir);
4502
4524
  } catch {
4503
4525
  unreadable++;
4504
4526
  continue;
@@ -4513,7 +4535,7 @@ function scanRepository(root) {
4513
4535
  truncated = true;
4514
4536
  continue;
4515
4537
  }
4516
- pending.push({ dir: (0, import_node_path7.join)(next.dir, entry.name), depth: next.depth + 1 });
4538
+ pending.push({ dir: (0, import_node_path10.join)(next.dir, entry.name), depth: next.depth + 1 });
4517
4539
  }
4518
4540
  } finally {
4519
4541
  handle.closeSync();
@@ -4532,8 +4554,8 @@ function metadataValue(value, key) {
4532
4554
  if (!value || typeof value !== "object") return void 0;
4533
4555
  return Object.getOwnPropertyDescriptor(value, key)?.value;
4534
4556
  }
4535
- function readProjectJson(path26, files = nodeRepoFileReader) {
4536
- const text2 = readProjectMetadata(path26, files);
4557
+ function readProjectJson(path29, files = nodeRepoFileReader) {
4558
+ const text2 = readProjectMetadata(path29, files);
4537
4559
  if (text2 === null) return null;
4538
4560
  try {
4539
4561
  const value = JSON.parse(text2);
@@ -4543,7 +4565,7 @@ function readProjectJson(path26, files = nodeRepoFileReader) {
4543
4565
  }
4544
4566
  }
4545
4567
  function readProjectManifest(dir, files = nodeRepoFileReader) {
4546
- const parsed = readProjectJson((0, import_node_path7.join)(dir, "package.json"), files);
4568
+ const parsed = readProjectJson((0, import_node_path10.join)(dir, "package.json"), files);
4547
4569
  if (!parsed || typeof parsed !== "object") return null;
4548
4570
  const record = (value) => {
4549
4571
  if (!value || typeof value !== "object") return {};
@@ -4560,13 +4582,13 @@ function readProjectManifest(dir, files = nodeRepoFileReader) {
4560
4582
  devDependencies: record(metadataValue(parsed, "devDependencies"))
4561
4583
  };
4562
4584
  }
4563
- var import_node_fs9, import_node_path7, import_json5, REPORT_SKIP_DIRS, PODFILE_NEW_ARCH_MARK, PODFILE_NEW_ARCH_RUBY;
4585
+ var import_node_fs13, import_node_path10, import_json5, REPORT_SKIP_DIRS, PODFILE_NEW_ARCH_MARK, PODFILE_NEW_ARCH_RUBY;
4564
4586
  var init_detect = __esm({
4565
4587
  "cli/commands/detect.ts"() {
4566
4588
  "use strict";
4567
4589
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
4568
- import_node_fs9 = require("node:fs");
4569
- import_node_path7 = require("node:path");
4590
+ import_node_fs13 = require("node:fs");
4591
+ import_node_path10 = require("node:path");
4570
4592
  import_json5 = __toESM(require_lib(), 1);
4571
4593
  init_browser();
4572
4594
  init_nodeRepoFileReader();
@@ -4631,37 +4653,37 @@ var init_swiftContract = __esm({
4631
4653
  });
4632
4654
 
4633
4655
  // src/kotlin-toolchain.ts
4634
- var import_node_child_process8, import_node_util6, run5;
4656
+ var import_node_child_process11, import_node_util6, run5;
4635
4657
  var init_kotlin_toolchain = __esm({
4636
4658
  "src/kotlin-toolchain.ts"() {
4637
4659
  "use strict";
4638
4660
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
4639
- import_node_child_process8 = require("node:child_process");
4661
+ import_node_child_process11 = require("node:child_process");
4640
4662
  import_node_util6 = require("node:util");
4641
4663
  init_home_paths();
4642
4664
  init_is_record();
4643
- run5 = (0, import_node_util6.promisify)(import_node_child_process8.execFile);
4665
+ run5 = (0, import_node_util6.promisify)(import_node_child_process11.execFile);
4644
4666
  }
4645
4667
  });
4646
4668
 
4647
4669
  // src/swift-source-file.ts
4648
4670
  function relativeInside(root, file) {
4649
- const relative3 = import_node_path17.default.relative(root, file);
4650
- return relative3 === ".." || relative3.startsWith(`..${import_node_path17.default.sep}`) || import_node_path17.default.isAbsolute(relative3) ? null : relative3;
4671
+ const relative3 = import_node_path20.default.relative(root, file);
4672
+ return relative3 === ".." || relative3.startsWith(`..${import_node_path20.default.sep}`) || import_node_path20.default.isAbsolute(relative3) ? null : relative3;
4651
4673
  }
4652
4674
  function packageInputPath(canonicalRoot, file) {
4653
- const canonicalFile = import_node_fs16.default.realpathSync(file);
4675
+ const canonicalFile = import_node_fs20.default.realpathSync(file);
4654
4676
  if (relativeInside(canonicalRoot, canonicalFile) === null) {
4655
4677
  throw new Error(`swift input escapes the selected package: ${file}`);
4656
4678
  }
4657
4679
  return canonicalFile;
4658
4680
  }
4659
4681
  function readPackageFile(root, file, maxBytes) {
4660
- const canonicalFile = packageInputPath(import_node_fs16.default.realpathSync(root), file);
4661
- const expected = import_node_fs16.default.statSync(canonicalFile);
4662
- const fd = import_node_fs16.default.openSync(canonicalFile, import_node_fs16.default.constants.O_RDONLY | import_node_fs16.default.constants.O_NOFOLLOW);
4682
+ const canonicalFile = packageInputPath(import_node_fs20.default.realpathSync(root), file);
4683
+ const expected = import_node_fs20.default.statSync(canonicalFile);
4684
+ const fd = import_node_fs20.default.openSync(canonicalFile, import_node_fs20.default.constants.O_RDONLY | import_node_fs20.default.constants.O_NOFOLLOW);
4663
4685
  try {
4664
- const stat = import_node_fs16.default.fstatSync(fd);
4686
+ const stat = import_node_fs20.default.fstatSync(fd);
4665
4687
  if (stat.dev !== expected.dev || stat.ino !== expected.ino) {
4666
4688
  throw new Error(`swift input changed while opening: ${file}`);
4667
4689
  }
@@ -4671,25 +4693,25 @@ function readPackageFile(root, file, maxBytes) {
4671
4693
  const bytes = Buffer.alloc(stat.size + 1);
4672
4694
  let offset = 0;
4673
4695
  while (offset < bytes.length) {
4674
- const count = import_node_fs16.default.readSync(fd, bytes, offset, bytes.length - offset, null);
4696
+ const count = import_node_fs20.default.readSync(fd, bytes, offset, bytes.length - offset, null);
4675
4697
  if (count === 0) break;
4676
4698
  offset += count;
4677
4699
  }
4678
- if (offset !== stat.size || import_node_fs16.default.fstatSync(fd).size !== stat.size) {
4700
+ if (offset !== stat.size || import_node_fs20.default.fstatSync(fd).size !== stat.size) {
4679
4701
  throw new Error(`swift input changed while reading: ${file}`);
4680
4702
  }
4681
4703
  return bytes.subarray(0, offset);
4682
4704
  } finally {
4683
- import_node_fs16.default.closeSync(fd);
4705
+ import_node_fs20.default.closeSync(fd);
4684
4706
  }
4685
4707
  }
4686
- var import_node_fs16, import_node_path17;
4708
+ var import_node_fs20, import_node_path20;
4687
4709
  var init_swift_source_file = __esm({
4688
4710
  "src/swift-source-file.ts"() {
4689
4711
  "use strict";
4690
4712
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
4691
- import_node_fs16 = __toESM(require("node:fs"), 1);
4692
- import_node_path17 = __toESM(require("node:path"), 1);
4713
+ import_node_fs20 = __toESM(require("node:fs"), 1);
4714
+ import_node_path20 = __toESM(require("node:path"), 1);
4693
4715
  }
4694
4716
  });
4695
4717
 
@@ -4714,19 +4736,19 @@ var init_swift_submit = __esm({
4714
4736
  });
4715
4737
 
4716
4738
  // src/nitro-dependencies.ts
4717
- var import_node_child_process9, import_node_util7, run6, DOUBLE_CONVERSION_WASM32_BACKPORT, RN_SHARED_DEPENDENCIES, RN_FMT_11_DEPENDENCIES, RN_FAST_FLOAT_6_DEPENDENCIES, RN_FMT_12_DEPENDENCIES;
4739
+ var import_node_child_process12, import_node_util7, run6, DOUBLE_CONVERSION_WASM32_BACKPORT, RN_SHARED_DEPENDENCIES, RN_FMT_11_DEPENDENCIES, RN_FAST_FLOAT_6_DEPENDENCIES, RN_FMT_12_DEPENDENCIES;
4718
4740
  var init_nitro_dependencies = __esm({
4719
4741
  "src/nitro-dependencies.ts"() {
4720
4742
  "use strict";
4721
4743
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
4722
- import_node_child_process9 = require("node:child_process");
4744
+ import_node_child_process12 = require("node:child_process");
4723
4745
  import_node_util7 = require("node:util");
4724
4746
  init_home_paths();
4725
4747
  init_is_record();
4726
4748
  init_kotlin_toolchain();
4727
4749
  init_swift_source_file();
4728
4750
  init_swift_submit();
4729
- run6 = (0, import_node_util7.promisify)(import_node_child_process9.execFile);
4751
+ run6 = (0, import_node_util7.promisify)(import_node_child_process12.execFile);
4730
4752
  DOUBLE_CONVERSION_WASM32_BACKPORT = {
4731
4753
  upstreamCommit: "8857767d5b2f5a035321e3712e8cd0008840ba6b",
4732
4754
  originalSha256: "b495b11f7b61693486894f747add5b454894b8b3ca41aa1610d370ba16407ab7",
@@ -4812,19 +4834,19 @@ function readJson(root, relative3) {
4812
4834
  return JSON.parse(
4813
4835
  readPackageFile(
4814
4836
  root,
4815
- import_node_path18.default.join(root, relative3),
4837
+ import_node_path21.default.join(root, relative3),
4816
4838
  MAX_SWIFT_COMPILE_SOURCE_BYTES
4817
4839
  ).toString("utf8")
4818
4840
  );
4819
4841
  }
4820
4842
  function registrations(root) {
4821
- const directory = import_node_path18.default.join(root, "nitrogen/generated/ios");
4822
- const initializers = import_node_fs17.default.readdirSync(directory).filter((file) => file.endsWith("Autolinking.mm"));
4843
+ const directory = import_node_path21.default.join(root, "nitrogen/generated/ios");
4844
+ const initializers = import_node_fs21.default.readdirSync(directory).filter((file) => file.endsWith("Autolinking.mm"));
4823
4845
  if (initializers.length !== 1)
4824
4846
  throw new Error(`${root}: expected one generated Nitro iOS initializer`);
4825
4847
  const source = readPackageFile(
4826
4848
  root,
4827
- import_node_path18.default.join(directory, initializers[0]),
4849
+ import_node_path21.default.join(directory, initializers[0]),
4828
4850
  MAX_SWIFT_COMPILE_SOURCE_BYTES
4829
4851
  ).toString("utf8");
4830
4852
  const namespaces = [
@@ -4887,18 +4909,18 @@ function registrations(root) {
4887
4909
  if (new Set(classes.map(({ name: name2 }) => name2)).size !== classes.length)
4888
4910
  throw new Error(`${root}: duplicate generated Nitro iOS registration`);
4889
4911
  classes.sort((a, b) => a.name.localeCompare(b.name));
4890
- const ios = import_node_path18.default.join(root, "ios");
4891
- if (swiftModule === null && import_node_fs17.default.existsSync(ios) && import_node_fs17.default.readdirSync(ios, { recursive: true, encoding: "utf8" }).some((file) => file.endsWith(".swift") && !file.startsWith("Tests")))
4912
+ const ios = import_node_path21.default.join(root, "ios");
4913
+ if (swiftModule === null && import_node_fs21.default.existsSync(ios) && import_node_fs21.default.readdirSync(ios, { recursive: true, encoding: "utf8" }).some((file) => file.endsWith(".swift") && !file.startsWith("Tests")))
4892
4914
  swiftModule = initializers[0].slice(0, -"Autolinking.mm".length);
4893
4915
  return { namespace, swiftModule, classes, views: viewNames(root, classes) };
4894
4916
  }
4895
4917
  function viewNames(root, classes) {
4896
- const directory = import_node_path18.default.join(root, "nitrogen/generated/shared/json");
4897
- if (!import_node_fs17.default.existsSync(directory)) return /* @__PURE__ */ new Set();
4918
+ const directory = import_node_path21.default.join(root, "nitrogen/generated/shared/json");
4919
+ if (!import_node_fs21.default.existsSync(directory)) return /* @__PURE__ */ new Set();
4898
4920
  const views = /* @__PURE__ */ new Set();
4899
- for (const file of import_node_fs17.default.readdirSync(directory)) {
4921
+ for (const file of import_node_fs21.default.readdirSync(directory)) {
4900
4922
  if (!file.endsWith("Config.json")) continue;
4901
- const config = readJson(root, import_node_path18.default.join("nitrogen/generated/shared/json", file));
4923
+ const config = readJson(root, import_node_path21.default.join("nitrogen/generated/shared/json", file));
4902
4924
  const name2 = object3(config) ? config.uiViewClassName : void 0;
4903
4925
  if (typeof name2 === "string" && classes.some((entry) => entry.name === name2))
4904
4926
  views.add(name2);
@@ -4906,21 +4928,21 @@ function viewNames(root, classes) {
4906
4928
  return views;
4907
4929
  }
4908
4930
  function hasNitroIosInitializer(root) {
4909
- const generated = import_node_path18.default.join(root, "nitrogen/generated/ios");
4910
- return import_node_fs17.default.existsSync(generated) && import_node_fs17.default.readdirSync(generated).some((file) => file.endsWith("Autolinking.mm"));
4931
+ const generated = import_node_path21.default.join(root, "nitrogen/generated/ios");
4932
+ return import_node_fs21.default.existsSync(generated) && import_node_fs21.default.readdirSync(generated).some((file) => file.endsWith("Autolinking.mm"));
4911
4933
  }
4912
4934
  function nitroRegisteredNames(root) {
4913
4935
  if (!hasNitroIosInitializer(root)) return null;
4914
4936
  const { classes, views } = registrations(root);
4915
4937
  return { names: classes.map(({ name: name2 }) => name2), views: [...views].sort() };
4916
4938
  }
4917
- var import_node_fs17, import_node_path18;
4939
+ var import_node_fs21, import_node_path21;
4918
4940
  var init_nitro_source = __esm({
4919
4941
  "src/nitro-source.ts"() {
4920
4942
  "use strict";
4921
4943
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
4922
- import_node_fs17 = __toESM(require("node:fs"), 1);
4923
- import_node_path18 = __toESM(require("node:path"), 1);
4944
+ import_node_fs21 = __toESM(require("node:fs"), 1);
4945
+ import_node_path21 = __toESM(require("node:path"), 1);
4924
4946
  init_nitro_dependencies();
4925
4947
  init_react_native_autolinking();
4926
4948
  init_swift_source_file();
@@ -5403,13 +5425,13 @@ function nodeHttpFetch(url, init = {}, redirects = 0) {
5403
5425
  if (codings.every((coding) => DECODABLE_CODINGS.has(coding))) {
5404
5426
  for (const coding of codings.reverse()) {
5405
5427
  let decoder;
5406
- if (coding === "br") decoder = import_node_zlib2.default.createBrotliDecompress();
5428
+ if (coding === "br") decoder = import_node_zlib3.default.createBrotliDecompress();
5407
5429
  else if (coding === "deflate") {
5408
5430
  let inner;
5409
- decoder = new import_node_stream.Transform({
5431
+ decoder = new import_node_stream3.Transform({
5410
5432
  transform(chunk, _encoding, done) {
5411
5433
  if (!inner) {
5412
- inner = (chunk[0] & 15) === 8 ? import_node_zlib2.default.createInflate(TRUNCATION_TOLERANT) : import_node_zlib2.default.createInflateRaw(TRUNCATION_TOLERANT);
5434
+ inner = (chunk[0] & 15) === 8 ? import_node_zlib3.default.createInflate(TRUNCATION_TOLERANT) : import_node_zlib3.default.createInflateRaw(TRUNCATION_TOLERANT);
5413
5435
  inner.on("data", (data) => decoder.push(data));
5414
5436
  inner.on("error", (error) => decoder.destroy(error));
5415
5437
  }
@@ -5425,8 +5447,8 @@ function nodeHttpFetch(url, init = {}, redirects = 0) {
5425
5447
  done(error);
5426
5448
  }
5427
5449
  });
5428
- } else decoder = import_node_zlib2.default.createGunzip(TRUNCATION_TOLERANT);
5429
- source = (0, import_node_stream.pipeline)(source, decoder, () => {
5450
+ } else decoder = import_node_zlib3.default.createGunzip(TRUNCATION_TOLERANT);
5451
+ source = (0, import_node_stream3.pipeline)(source, decoder, () => {
5430
5452
  });
5431
5453
  }
5432
5454
  }
@@ -5454,17 +5476,17 @@ function nodeHttpFetch(url, init = {}, redirects = 0) {
5454
5476
  req.end();
5455
5477
  });
5456
5478
  }
5457
- var import_node_http, import_node_https, import_node_stream, import_node_zlib2, BODYLESS_STATUS, TRUNCATION_TOLERANT, MAX_REDIRECTS, DECODABLE_CODINGS;
5479
+ var import_node_http, import_node_https, import_node_stream3, import_node_zlib3, BODYLESS_STATUS, TRUNCATION_TOLERANT, MAX_REDIRECTS, DECODABLE_CODINGS;
5458
5480
  var init_node_http_fetch = __esm({
5459
5481
  "src/node-http-fetch.ts"() {
5460
5482
  "use strict";
5461
5483
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
5462
5484
  import_node_http = __toESM(require("node:http"), 1);
5463
5485
  import_node_https = __toESM(require("node:https"), 1);
5464
- import_node_stream = require("node:stream");
5465
- import_node_zlib2 = __toESM(require("node:zlib"), 1);
5486
+ import_node_stream3 = require("node:stream");
5487
+ import_node_zlib3 = __toESM(require("node:zlib"), 1);
5466
5488
  BODYLESS_STATUS = /* @__PURE__ */ new Set([101, 204, 205, 304]);
5467
- TRUNCATION_TOLERANT = { finishFlush: import_node_zlib2.default.constants.Z_SYNC_FLUSH };
5489
+ TRUNCATION_TOLERANT = { finishFlush: import_node_zlib3.default.constants.Z_SYNC_FLUSH };
5468
5490
  MAX_REDIRECTS = 5;
5469
5491
  DECODABLE_CODINGS = /* @__PURE__ */ new Set(["gzip", "x-gzip", "deflate", "br"]);
5470
5492
  }
@@ -5500,7 +5522,7 @@ function normalize(p) {
5500
5522
  if (trailingSlash) joined += "/";
5501
5523
  return absolute ? "/" + joined : joined;
5502
5524
  }
5503
- function join5(...parts) {
5525
+ function join6(...parts) {
5504
5526
  const present = parts.filter((part) => part.length > 0);
5505
5527
  if (present.length === 0) return ".";
5506
5528
  return normalize(present.join("/"));
@@ -5564,7 +5586,7 @@ var init_posixPath = __esm({
5564
5586
  delimiter,
5565
5587
  isAbsolute: isAbsolute2,
5566
5588
  normalize,
5567
- join: join5,
5589
+ join: join6,
5568
5590
  resolve: resolve2,
5569
5591
  dirname: dirname2,
5570
5592
  basename: basename2,
@@ -5807,16 +5829,16 @@ function sendJavaScript(req, res, source) {
5807
5829
  res.end(req.method === "HEAD" ? void 0 : source);
5808
5830
  }
5809
5831
  function resolveReplacementModuleFile(fromFile, specifier) {
5810
- const base = import_node_path24.default.resolve(import_node_path24.default.dirname(fromFile), specifier);
5832
+ const base = import_node_path27.default.resolve(import_node_path27.default.dirname(fromFile), specifier);
5811
5833
  const candidates = [
5812
5834
  ...REPLACEMENT_MODULE_EXTENSIONS.some(
5813
- (ext) => ext === import_node_path24.default.extname(base).toLowerCase()
5835
+ (ext) => ext === import_node_path27.default.extname(base).toLowerCase()
5814
5836
  ) ? [base] : [],
5815
5837
  ...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => base + ext),
5816
- ...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => import_node_path24.default.join(base, `index${ext}`))
5838
+ ...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => import_node_path27.default.join(base, `index${ext}`))
5817
5839
  ];
5818
5840
  const found = candidates.find(
5819
- (candidate) => (0, import_node_fs22.statSync)(candidate, { throwIfNoEntry: false })?.isFile()
5841
+ (candidate) => (0, import_node_fs26.statSync)(candidate, { throwIfNoEntry: false })?.isFile()
5820
5842
  );
5821
5843
  if (!found) {
5822
5844
  throw new Error(
@@ -5827,8 +5849,8 @@ function resolveReplacementModuleFile(fromFile, specifier) {
5827
5849
  }
5828
5850
  function isInsideAny(roots, file) {
5829
5851
  return roots.some((root) => {
5830
- const relative3 = import_node_path24.default.relative(root, file);
5831
- return !relative3.startsWith("..") && !import_node_path24.default.isAbsolute(relative3);
5852
+ const relative3 = import_node_path27.default.relative(root, file);
5853
+ return !relative3.startsWith("..") && !import_node_path27.default.isAbsolute(relative3);
5832
5854
  });
5833
5855
  }
5834
5856
  function isReplacementModuleRequestUrl(rawUrl) {
@@ -5877,19 +5899,19 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
5877
5899
  res.end("missing path param");
5878
5900
  return true;
5879
5901
  }
5880
- const extension = import_node_path24.default.extname(targetPath).toLowerCase();
5902
+ const extension = import_node_path27.default.extname(targetPath).toLowerCase();
5881
5903
  if (!REPLACEMENT_MODULE_EXTENSIONS.some((allowed) => allowed === extension)) {
5882
5904
  res.writeHead(400, { "Content-Type": "text/plain; charset=utf-8" });
5883
5905
  res.end(`replacement files must be ${REPLACEMENT_MODULE_EXTENSIONS.join(", ")}`);
5884
5906
  return true;
5885
5907
  }
5886
- if (!import_node_path24.default.isAbsolute(targetPath)) {
5908
+ if (!import_node_path27.default.isAbsolute(targetPath)) {
5887
5909
  res.writeHead(400, { "Content-Type": "text/plain; charset=utf-8" });
5888
5910
  res.end("replacement file path must be absolute");
5889
5911
  return true;
5890
5912
  }
5891
5913
  const runtimePackages = new Set(url.searchParams.getAll("runtimePackage"));
5892
- const servedRoots = options.servedRoots?.map((root) => import_node_path24.default.resolve(root));
5914
+ const servedRoots = options.servedRoots?.map((root) => import_node_path27.default.resolve(root));
5893
5915
  if (servedRoots && !isInsideAny(servedRoots, targetPath)) {
5894
5916
  res.writeHead(403, { "Content-Type": "text/plain; charset=utf-8" });
5895
5917
  res.end("replacement file must be inside a folder the bundler serves");
@@ -5897,7 +5919,7 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
5897
5919
  }
5898
5920
  let resolvedTargetPath;
5899
5921
  try {
5900
- resolvedTargetPath = await import_promises5.default.realpath(targetPath);
5922
+ resolvedTargetPath = await import_promises7.default.realpath(targetPath);
5901
5923
  } catch (error) {
5902
5924
  const message = error instanceof Error ? error.message : String(error);
5903
5925
  res.writeHead(404, { "Content-Type": "text/plain; charset=utf-8" });
@@ -5905,7 +5927,7 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
5905
5927
  return true;
5906
5928
  }
5907
5929
  if (servedRoots) {
5908
- const realRoots = (await Promise.all(servedRoots.map((root) => import_promises5.default.realpath(root).catch(() => null)))).filter((root) => root !== null);
5930
+ const realRoots = (await Promise.all(servedRoots.map((root) => import_promises7.default.realpath(root).catch(() => null)))).filter((root) => root !== null);
5909
5931
  if (!isInsideAny(realRoots, resolvedTargetPath)) {
5910
5932
  res.writeHead(403, { "Content-Type": "text/plain; charset=utf-8" });
5911
5933
  res.end("replacement file must be inside a folder the bundler serves");
@@ -5915,7 +5937,7 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
5915
5937
  try {
5916
5938
  const compiled = compileReplacementModule({
5917
5939
  filePath: resolvedTargetPath,
5918
- source: await import_promises5.default.readFile(resolvedTargetPath, "utf8"),
5940
+ source: await import_promises7.default.readFile(resolvedTargetPath, "utf8"),
5919
5941
  runtimePackages,
5920
5942
  // the imported file's url is this request's with only its path changed,
5921
5943
  // so the token, cache key and runtime packages carry over.
@@ -5941,14 +5963,14 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
5941
5963
  }
5942
5964
  return true;
5943
5965
  }
5944
- var import_node_fs22, import_promises5, import_node_path24, REPLACEMENT_MODULE_ROUTE;
5966
+ var import_node_fs26, import_promises7, import_node_path27, REPLACEMENT_MODULE_ROUTE;
5945
5967
  var init_replacement_module_handler = __esm({
5946
5968
  "src/host/replacement-module-handler.ts"() {
5947
5969
  "use strict";
5948
5970
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
5949
- import_node_fs22 = require("node:fs");
5950
- import_promises5 = __toESM(require("node:fs/promises"), 1);
5951
- import_node_path24 = __toESM(require("node:path"), 1);
5971
+ import_node_fs26 = require("node:fs");
5972
+ import_promises7 = __toESM(require("node:fs/promises"), 1);
5973
+ import_node_path27 = __toESM(require("node:path"), 1);
5952
5974
  init_replacementModule();
5953
5975
  init_backend_origin();
5954
5976
  REPLACEMENT_MODULE_ROUTE = "/__sootsim-replacement-module";
@@ -6090,7 +6112,7 @@ function resolveAppStubs(appDir, config, configDir) {
6090
6112
  const { modules, views, hybridObjects } = expandStubs(appDir, source);
6091
6113
  assertRegisteredHybridObjects(appDir, source, hybridObjects);
6092
6114
  for (const [name2, answer] of Object.entries(hybridObjects))
6093
- nativeHybridObjects[name2] = answer === "unsupported" ? answer : { file: (0, import_node_path25.resolve)(source.baseDir, answer) };
6115
+ nativeHybridObjects[name2] = answer === "unsupported" ? answer : { file: (0, import_node_path29.resolve)(source.baseDir, answer) };
6094
6116
  for (const [name2, stub] of Object.entries(modules))
6095
6117
  nativeModules[name2] = lowerStub(stub, source.baseDir);
6096
6118
  for (const [name2, stub] of Object.entries(views))
@@ -6155,10 +6177,10 @@ function assertRegisteredHybridObjects(appDir, source, hybridObjects) {
6155
6177
  );
6156
6178
  }
6157
6179
  function lowerStub(stub, baseDir) {
6158
- return stub === "noop" ? stub : { file: (0, import_node_path25.resolve)(baseDir, stub) };
6180
+ return stub === "noop" ? stub : { file: (0, import_node_path29.resolve)(baseDir, stub) };
6159
6181
  }
6160
6182
  function readPackageJson(dir) {
6161
- const text2 = readSmallFile((0, import_node_path25.join)(dir, "package.json"));
6183
+ const text2 = readSmallFile((0, import_node_path29.join)(dir, "package.json"));
6162
6184
  if (!text2) return null;
6163
6185
  try {
6164
6186
  const parsed = JSON.parse(text2);
@@ -6170,9 +6192,9 @@ function readPackageJson(dir) {
6170
6192
  function installedPackageDir(appDir, name2) {
6171
6193
  let current = appDir;
6172
6194
  while (true) {
6173
- const dir = (0, import_node_path25.join)(current, "node_modules", name2);
6174
- if ((0, import_node_fs23.existsSync)((0, import_node_path25.join)(dir, "package.json"))) return (0, import_node_fs23.realpathSync)(dir);
6175
- const parent = (0, import_node_path25.dirname)(current);
6195
+ const dir = (0, import_node_path29.join)(current, "node_modules", name2);
6196
+ if ((0, import_node_fs28.existsSync)((0, import_node_path29.join)(dir, "package.json"))) return (0, import_node_fs28.realpathSync)(dir);
6197
+ const parent = (0, import_node_path29.dirname)(current);
6176
6198
  if (parent === current) return null;
6177
6199
  current = parent;
6178
6200
  }
@@ -6276,7 +6298,7 @@ function mergeRequests(previous, next) {
6276
6298
  function packageNativeRequests(dir) {
6277
6299
  const found = /* @__PURE__ */ new Map();
6278
6300
  const directories = scanRepository(dir).directories.filter((sub) => {
6279
- const segments = (0, import_node_path25.relative)(dir, sub).split("/");
6301
+ const segments = (0, import_node_path29.relative)(dir, sub).split("/");
6280
6302
  return !NATIVE_SOURCE_DIRS.has(segments[0]) && !segments.some((segment) => PACKAGE_SKIP_DIRS.has(segment));
6281
6303
  });
6282
6304
  let files = 0;
@@ -6284,7 +6306,7 @@ function packageNativeRequests(dir) {
6284
6306
  for (const name2 of listDir(sub)) {
6285
6307
  if (!SOURCE_FILE.test(name2) || name2.endsWith(".d.ts") || files >= 2e3) continue;
6286
6308
  files++;
6287
- const file = (0, import_node_path25.join)(sub, name2);
6309
+ const file = (0, import_node_path29.join)(sub, name2);
6288
6310
  const text2 = readSmallFile(file);
6289
6311
  if (!text2) continue;
6290
6312
  for (const { line: _line, ...request } of sourceNativeRequests(file, text2, true)) {
@@ -6402,27 +6424,27 @@ function wireSlotMigration(appDir, configPath, wire, kept = []) {
6402
6424
  }
6403
6425
  function listDir(dir) {
6404
6426
  try {
6405
- return (0, import_node_fs23.readdirSync)(dir);
6427
+ return (0, import_node_fs28.readdirSync)(dir);
6406
6428
  } catch {
6407
6429
  return [];
6408
6430
  }
6409
6431
  }
6410
6432
  function readSmallFile(file) {
6411
6433
  try {
6412
- return (0, import_node_fs23.statSync)(file).size <= 1024 * 1024 ? (0, import_node_fs23.readFileSync)(file, "utf8") : null;
6434
+ return (0, import_node_fs28.statSync)(file).size <= 1024 * 1024 ? (0, import_node_fs28.readFileSync)(file, "utf8") : null;
6413
6435
  } catch {
6414
6436
  return null;
6415
6437
  }
6416
6438
  }
6417
6439
  function hasNativeCode(dir, platform) {
6418
- const expoConfig = (0, import_node_path25.join)(dir, "expo-module.config.json");
6440
+ const expoConfig = (0, import_node_path29.join)(dir, "expo-module.config.json");
6419
6441
  const platforms = metadataValue(readProjectJson(expoConfig), "platforms");
6420
6442
  if (Array.isArray(platforms))
6421
6443
  return platforms.includes(platform) || platform === "ios" && platforms.includes("apple");
6422
- if ([platform, "expo-module.config.json"].some((entry) => (0, import_node_fs23.existsSync)((0, import_node_path25.join)(dir, entry))))
6444
+ if ([platform, "expo-module.config.json"].some((entry) => (0, import_node_fs28.existsSync)((0, import_node_path29.join)(dir, entry))))
6423
6445
  return true;
6424
6446
  if (listDir(dir).some((name2) => name2.endsWith(".podspec"))) return true;
6425
- const manifest = readSmallFile((0, import_node_path25.join)(dir, "package.json"));
6447
+ const manifest = readSmallFile((0, import_node_path29.join)(dir, "package.json"));
6426
6448
  return manifest !== null && manifest.includes('"codegenConfig"');
6427
6449
  }
6428
6450
  function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__PURE__ */ new Set(), includeLegacy = false, providers) {
@@ -6435,7 +6457,7 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
6435
6457
  (excluded) => dir === excluded || dir.startsWith(`${excluded}/`)
6436
6458
  ))
6437
6459
  continue;
6438
- if ((0, import_node_fs23.existsSync)((0, import_node_path25.join)(dir, "expo-module.config.json"))) {
6460
+ if ((0, import_node_fs28.existsSync)((0, import_node_path29.join)(dir, "expo-module.config.json"))) {
6439
6461
  if (platform && !hasNativeCode(dir, platform)) {
6440
6462
  excludedModuleDirs.push(dir);
6441
6463
  continue;
@@ -6444,7 +6466,7 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
6444
6466
  }
6445
6467
  for (const name2 of listDir(dir)) {
6446
6468
  if (SOURCE_FILE.test(name2) && !name2.endsWith(".d.ts"))
6447
- sourceFiles.push((0, import_node_path25.join)(dir, name2));
6469
+ sourceFiles.push((0, import_node_path29.join)(dir, name2));
6448
6470
  }
6449
6471
  }
6450
6472
  }
@@ -6454,7 +6476,7 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
6454
6476
  scanRepository(dir).directories.flatMap(
6455
6477
  (sub) => listDir(sub).filter(
6456
6478
  (name2) => NATIVE_SOURCE_FILE.test(name2) && (!platform || (platform === "ios" ? name2.endsWith(".swift") : name2.endsWith(".kt")))
6457
- ).map((name2) => (0, import_node_path25.join)(sub, name2))
6479
+ ).map((name2) => (0, import_node_path29.join)(sub, name2))
6458
6480
  )
6459
6481
  ])
6460
6482
  );
@@ -6463,7 +6485,7 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
6463
6485
  const known = owners.get(dir);
6464
6486
  if (known) return known;
6465
6487
  const name2 = readPackageJson(dir)?.name;
6466
- const parent = (0, import_node_path25.dirname)(dir);
6488
+ const parent = (0, import_node_path29.dirname)(dir);
6467
6489
  const result = typeof name2 === "string" ? name2 : parent === dir ? pkg.name ?? "app" : owner(parent);
6468
6490
  owners.set(dir, result);
6469
6491
  return result;
@@ -6477,25 +6499,25 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
6477
6499
  else {
6478
6500
  const moduleDir2 = expoModuleDirs.find((dir) => file.startsWith(`${dir}/`));
6479
6501
  if (moduleDir2 && (file.endsWith(".swift") || !known.expoModule)) {
6480
- known.expoModule = (0, import_node_path25.relative)(appDir, moduleDir2) || ".";
6502
+ known.expoModule = (0, import_node_path29.relative)(appDir, moduleDir2) || ".";
6481
6503
  known.swift = file.endsWith(".swift");
6482
6504
  }
6483
6505
  }
6484
6506
  return;
6485
6507
  }
6486
6508
  providers ??= dependencyNativeOwners(appDir, pkg);
6487
- const packageName = providers.get(key) ?? owner((0, import_node_path25.dirname)(file));
6509
+ const packageName = providers.get(key) ?? owner((0, import_node_path29.dirname)(file));
6488
6510
  if (knownPackages.has(packageName)) return;
6489
6511
  const moduleDir = expoModuleDirs.find((dir) => file.startsWith(`${dir}/`)) ?? null;
6490
6512
  found.set(key, {
6491
6513
  kind,
6492
6514
  name: name2,
6493
6515
  package: packageName,
6494
- path: `${(0, import_node_path25.relative)(appDir, file)}:${line}`,
6495
- expoModule: moduleDir ? (0, import_node_path25.relative)(appDir, moduleDir) || "." : null,
6516
+ path: `${(0, import_node_path29.relative)(appDir, file)}:${line}`,
6517
+ expoModule: moduleDir ? (0, import_node_path29.relative)(appDir, moduleDir) || "." : null,
6496
6518
  optional: optional3,
6497
6519
  swift: moduleDir ? (nativeFilesByModule.get(moduleDir) ?? []).some(
6498
- (path26) => path26.endsWith(".swift") && [...(readSmallFile(path26) ?? "").matchAll(/\bName\(\s*"(\w+)"\s*\)/g)].some(
6520
+ (path29) => path29.endsWith(".swift") && [...(readSmallFile(path29) ?? "").matchAll(/\bName\(\s*"(\w+)"\s*\)/g)].some(
6499
6521
  (match) => match[1] === name2
6500
6522
  )
6501
6523
  ) : false,
@@ -6543,30 +6565,30 @@ function workspacePackageDirs(appDir, pkg) {
6543
6565
  for (const name2 of Object.keys({ ...pkg.dependencies, ...pkg.devDependencies })) {
6544
6566
  let current = appDir;
6545
6567
  while (true) {
6546
- const link = (0, import_node_path25.join)(current, "node_modules", name2);
6547
- if ((0, import_node_fs23.existsSync)(link)) {
6548
- if ((0, import_node_fs23.lstatSync)(link).isSymbolicLink()) {
6549
- const target = (0, import_node_fs23.realpathSync)(link);
6568
+ const link = (0, import_node_path29.join)(current, "node_modules", name2);
6569
+ if ((0, import_node_fs28.existsSync)(link)) {
6570
+ if ((0, import_node_fs28.lstatSync)(link).isSymbolicLink()) {
6571
+ const target = (0, import_node_fs28.realpathSync)(link);
6550
6572
  if (!target.split("/").includes("node_modules") && !target.startsWith(`${appDir}/`)) {
6551
6573
  dirs.add(target);
6552
6574
  }
6553
6575
  }
6554
6576
  break;
6555
6577
  }
6556
- const parent = (0, import_node_path25.dirname)(current);
6578
+ const parent = (0, import_node_path29.dirname)(current);
6557
6579
  if (parent === current) break;
6558
6580
  current = parent;
6559
6581
  }
6560
6582
  }
6561
6583
  return [...dirs];
6562
6584
  }
6563
- var import_node_fs23, import_node_path25, import_oxc_parser2, import_sucrase, SOURCE_FILE, NATIVE_LOOKUP, NATIVE_SOURCE_DIRS, PACKAGE_SKIP_DIRS, NATIVE_SOURCE_FILE;
6585
+ var import_node_fs28, import_node_path29, import_oxc_parser2, import_sucrase, SOURCE_FILE, NATIVE_LOOKUP, NATIVE_SOURCE_DIRS, PACKAGE_SKIP_DIRS, NATIVE_SOURCE_FILE;
6564
6586
  var init_app_stubs = __esm({
6565
6587
  "cli/app-stubs.ts"() {
6566
6588
  "use strict";
6567
6589
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
6568
- import_node_fs23 = require("node:fs");
6569
- import_node_path25 = require("node:path");
6590
+ import_node_fs28 = require("node:fs");
6591
+ import_node_path29 = require("node:path");
6570
6592
  init_version_range();
6571
6593
  import_oxc_parser2 = require("oxc-parser");
6572
6594
  import_sucrase = require("sucrase");
@@ -6602,12 +6624,12 @@ function resolveFileEntries(entries, configDir) {
6602
6624
  return Object.fromEntries(
6603
6625
  Object.entries(entries).map(([name2, resolution]) => [
6604
6626
  name2,
6605
- resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string" ? { ...resolution, file: import_node_path26.default.resolve(configDir, resolution.file) } : resolution
6627
+ resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string" ? { ...resolution, file: import_node_path30.default.resolve(configDir, resolution.file) } : resolution
6606
6628
  ])
6607
6629
  );
6608
6630
  }
6609
6631
  function resolveConfigReplacementFiles(config, configPath) {
6610
- const configDir = import_node_path26.default.dirname(configPath);
6632
+ const configDir = import_node_path30.default.dirname(configPath);
6611
6633
  return {
6612
6634
  ...config,
6613
6635
  modules: resolveFileEntries(config.modules, configDir)
@@ -6623,7 +6645,7 @@ async function loadRNXAppStubs(project) {
6623
6645
  return resolveAppStubs(
6624
6646
  project.appDir,
6625
6647
  config,
6626
- project.configPath ? import_node_path26.default.dirname(project.configPath) : project.appDir
6648
+ project.configPath ? import_node_path30.default.dirname(project.configPath) : project.appDir
6627
6649
  );
6628
6650
  } catch (error) {
6629
6651
  const message = error instanceof Error ? error.message : String(error);
@@ -6642,7 +6664,7 @@ async function loadConfigFile(project) {
6642
6664
  [`${rnxPublicBrand.packageName}/config`]: config_exports
6643
6665
  }
6644
6666
  });
6645
- const loaded3 = project.configPath.endsWith(".json") ? JSON.parse((0, import_node_fs24.readFileSync)(project.configPath, "utf8")) : await jiti.import(project.configPath, { default: true });
6667
+ const loaded3 = project.configPath.endsWith(".json") ? JSON.parse((0, import_node_fs29.readFileSync)(project.configPath, "utf8")) : await jiti.import(project.configPath, { default: true });
6646
6668
  if (!isPeachConfig(loaded3)) {
6647
6669
  throw new Error("the default export must be a peach config object");
6648
6670
  }
@@ -6678,13 +6700,13 @@ async function resolveRNXAppConfig(startDir = process.cwd()) {
6678
6700
  const project = resolveAppProject(startDir);
6679
6701
  return { project, ...await loadRNXAppStubs(project) };
6680
6702
  }
6681
- var import_node_fs24, import_node_path26, import_jiti, WIRE_SLOTS;
6703
+ var import_node_fs29, import_node_path30, import_jiti, WIRE_SLOTS;
6682
6704
  var init_app_config = __esm({
6683
6705
  "cli/app-config.ts"() {
6684
6706
  "use strict";
6685
6707
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
6686
- import_node_fs24 = require("node:fs");
6687
- import_node_path26 = __toESM(require("node:path"), 1);
6708
+ import_node_fs29 = require("node:fs");
6709
+ import_node_path30 = __toESM(require("node:path"), 1);
6688
6710
  import_jiti = require("jiti");
6689
6711
  init_config();
6690
6712
  init_config();
@@ -6784,14 +6806,14 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
6784
6806
  const neededPackages = /* @__PURE__ */ new Set();
6785
6807
  const factories = [];
6786
6808
  const visit3 = (filePath) => {
6787
- const real = import_node_fs25.default.realpathSync(filePath);
6809
+ const real = import_node_fs30.default.realpathSync(filePath);
6788
6810
  const previous = files.get(real);
6789
6811
  if (previous !== void 0) return previous;
6790
6812
  const id = "peach-config-file:" + files.size;
6791
6813
  files.set(real, id);
6792
6814
  const compiled = compileReplacementModule({
6793
6815
  filePath: real,
6794
- source: import_node_fs25.default.readFileSync(real, "utf8"),
6816
+ source: import_node_fs30.default.readFileSync(real, "utf8"),
6795
6817
  runtimePackages,
6796
6818
  localModuleUrl: (specifier) => visit3(resolveReplacementModuleFile(real, specifier))
6797
6819
  });
@@ -6815,7 +6837,7 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
6815
6837
  if (!entries || typeof entries !== "object") continue;
6816
6838
  for (const resolution of Object.values(entries)) {
6817
6839
  if (resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string") {
6818
- resolution.file = visit3(import_node_path27.default.resolve(resolution.file));
6840
+ resolution.file = visit3(import_node_path31.default.resolve(resolution.file));
6819
6841
  }
6820
6842
  }
6821
6843
  }
@@ -6839,13 +6861,13 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
6839
6861
  const identityStart = findBundleFooter(source, "globalThis.__sootsimModulePaths=");
6840
6862
  return prefix2 + (identityStart < 0 ? source + footer : source.slice(0, identityStart) + footer + source.slice(identityStart));
6841
6863
  }
6842
- var import_node_fs25, import_node_path27, import_sucrase2, import_terser, PREFIX_START, PREFIX_END;
6864
+ var import_node_fs30, import_node_path31, import_sucrase2, import_terser, PREFIX_START, PREFIX_END;
6843
6865
  var init_configured_bundle_producer = __esm({
6844
6866
  "src/configured-bundle-producer.ts"() {
6845
6867
  "use strict";
6846
6868
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
6847
- import_node_fs25 = __toESM(require("node:fs"), 1);
6848
- import_node_path27 = __toESM(require("node:path"), 1);
6869
+ import_node_fs30 = __toESM(require("node:fs"), 1);
6870
+ import_node_path31 = __toESM(require("node:path"), 1);
6849
6871
  init_bundle_global_footer();
6850
6872
  import_sucrase2 = require("sucrase");
6851
6873
  import_terser = require("terser");
@@ -6870,7 +6892,7 @@ module.exports = __toCommonJS(metro_plugin_exports);
6870
6892
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
6871
6893
  var import_fs4 = __toESM(require("fs"), 1);
6872
6894
  var import_module = require("module");
6873
- var import_node_crypto7 = require("node:crypto");
6895
+ var import_node_crypto8 = require("node:crypto");
6874
6896
  var import_path4 = __toESM(require("path"), 1);
6875
6897
 
6876
6898
  // ../peach-globals/src/package-versions.ts
@@ -7223,7 +7245,7 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
7223
7245
  var import_http = __toESM(require("http"), 1);
7224
7246
  var import_https = __toESM(require("https"), 1);
7225
7247
  var import_node_http2 = require("node:http2");
7226
- var import_promises4 = require("stream/promises");
7248
+ var import_promises6 = require("stream/promises");
7227
7249
  init_backend_origin();
7228
7250
 
7229
7251
  // src/host/dev-server-package-versions.ts
@@ -7245,16 +7267,981 @@ var import_url = require("url");
7245
7267
 
7246
7268
  // ../contrast-runtime-delivery/src/index.ts
7247
7269
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
7270
+ var import_node_child_process5 = require("node:child_process");
7271
+ var import_node_crypto2 = __toESM(require("node:crypto"), 1);
7272
+ var import_node_fs9 = __toESM(require("node:fs"), 1);
7273
+ var import_node_os3 = __toESM(require("node:os"), 1);
7274
+ var import_node_path7 = __toESM(require("node:path"), 1);
7275
+ var import_node_stream2 = require("node:stream");
7276
+ var import_promises2 = require("node:stream/promises");
7277
+ var import_node_zlib = __toESM(require("node:zlib"), 1);
7248
7278
 
7249
7279
  // src/process-group.ts
7250
7280
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
7281
+ var import_node_child_process4 = require("node:child_process");
7282
+ var import_node_fs7 = require("node:fs");
7283
+ var import_node_os2 = require("node:os");
7284
+ var import_node_path5 = require("node:path");
7285
+ var import_node_stream = require("node:stream");
7286
+ var import_promises = require("node:timers/promises");
7251
7287
 
7252
7288
  // src/process-table.ts
7253
7289
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
7290
+ var import_node_child_process3 = require("node:child_process");
7291
+ var import_node_fs6 = require("node:fs");
7292
+ var import_node_os = require("node:os");
7293
+ function linuxClockTicks() {
7294
+ const auxv = (0, import_node_fs6.readFileSync)("/proc/self/auxv");
7295
+ const word = (offset) => (0, import_node_os.endianness)() === "LE" ? auxv.readBigUInt64LE(offset) : auxv.readBigUInt64BE(offset);
7296
+ for (let offset = 0; offset + 16 <= auxv.length; offset += 16) {
7297
+ if (word(offset) !== 17n) continue;
7298
+ const ticks = Number(word(offset + 8));
7299
+ if (!Number.isSafeInteger(ticks) || ticks <= 0)
7300
+ throw new Error("unreadable process clock tick rate");
7301
+ return ticks;
7302
+ }
7303
+ throw new Error("missing process clock tick rate");
7304
+ }
7305
+ var clockTicks;
7306
+ function readProcessTable(timeoutMs = 1e4, pid) {
7307
+ if (process.platform === "linux") {
7308
+ clockTicks ??= linuxClockTicks();
7309
+ const boot = /^btime (\d+)$/m.exec((0, import_node_fs6.readFileSync)("/proc/stat", "utf8"));
7310
+ if (!boot) throw new Error("unreadable process boot time");
7311
+ const bootMs = Number(boot[1]) * 1e3;
7312
+ const deadline = Date.now() + timeoutMs;
7313
+ const rows2 = [];
7314
+ const names = pid === void 0 ? (0, import_node_fs6.readdirSync)("/proc") : [String(pid)];
7315
+ for (const name2 of names) {
7316
+ if (!/^\d+$/.test(name2)) continue;
7317
+ if (Date.now() >= deadline)
7318
+ throw new Error("process inspection exceeded its deadline");
7319
+ let stat;
7320
+ try {
7321
+ stat = (0, import_node_fs6.readFileSync)(`/proc/${name2}/stat`, "utf8");
7322
+ } catch (error) {
7323
+ if (error instanceof Error && "code" in error && error.code === "ENOENT") continue;
7324
+ throw error;
7325
+ }
7326
+ const fields = stat.slice(stat.lastIndexOf(")") + 2).trim().split(/\s+/);
7327
+ const pgid = Number(fields[2]);
7328
+ const ticks = Number(fields[19]);
7329
+ if (!fields[0] || !Number.isSafeInteger(pgid) || !Number.isSafeInteger(ticks))
7330
+ throw new Error(`unreadable process table row for ${name2}`);
7331
+ rows2.push({
7332
+ pid: Number(name2),
7333
+ pgid,
7334
+ zombie: fields[0] === "Z" || fields[0] === "X",
7335
+ start: bootMs + ticks * 1e3 / clockTicks
7336
+ });
7337
+ }
7338
+ return rows2;
7339
+ }
7340
+ const result = (0, import_node_child_process3.spawnSync)(
7341
+ "ps",
7342
+ [
7343
+ ...pid === void 0 ? ["-A"] : ["-p", String(pid)],
7344
+ "-o",
7345
+ "pid=,pgid=,stat=,lstart="
7346
+ ],
7347
+ {
7348
+ encoding: "utf8",
7349
+ env: { ...process.env, LC_ALL: "C", TZ: "UTC" },
7350
+ stdio: ["ignore", "pipe", "pipe"],
7351
+ timeout: timeoutMs,
7352
+ killSignal: "SIGKILL"
7353
+ }
7354
+ );
7355
+ if (!result.error && pid !== void 0 && result.status === 1 && !result.stdout.trim() && !result.stderr.trim())
7356
+ return [];
7357
+ if (result.error || result.status !== 0)
7358
+ throw new Error(
7359
+ result.error?.message || result.stderr.trim() || `ps exited ${result.status}`
7360
+ );
7361
+ const rows = result.stdout.split("\n").filter((line) => line.trim()).map((line) => {
7362
+ const match = /^\s*(\d+)\s+(\d+)\s+(\S+)\s+(.+?)\s*$/.exec(line);
7363
+ if (!match) throw new Error(`unreadable process table row: ${line}`);
7364
+ const start = Date.parse(`${match[4]} UTC`);
7365
+ if (Number.isNaN(start))
7366
+ throw new Error(`unreadable process start time "${match[4]}"`);
7367
+ return {
7368
+ pid: Number(match[1]),
7369
+ pgid: Number(match[2]),
7370
+ zombie: match[3].startsWith("Z"),
7371
+ start
7372
+ };
7373
+ });
7374
+ return pid === void 0 ? rows : rows.filter((row) => row.pid === pid);
7375
+ }
7376
+
7377
+ // src/process-group.ts
7378
+ var GRACEFUL_TIMEOUT_MS = 3e3;
7379
+ var FORCED_EXIT_TIMEOUT_MS = 1e3;
7380
+ var FREEZE_GUARD_NAME = "process-freeze-guard";
7381
+ function listProcessChildren(parents, timeoutMs = 3e3) {
7382
+ if (parents.some((pid) => !Number.isInteger(pid) || pid <= 1))
7383
+ throw new Error("process inspection requires valid parent pids");
7384
+ if (parents.length === 0) return [];
7385
+ const deadline = Date.now() + timeoutMs;
7386
+ let children;
7387
+ if (process.platform === "linux") {
7388
+ const lists = [];
7389
+ for (const parent of parents) {
7390
+ try {
7391
+ const tasks = `/proc/${parent}/task`;
7392
+ for (const thread of (0, import_node_fs7.readdirSync)(tasks)) {
7393
+ if (Date.now() >= deadline)
7394
+ throw new Error("process descendant inspection exceeded its deadline");
7395
+ try {
7396
+ lists.push((0, import_node_fs7.readFileSync)(`${tasks}/${thread}/children`, "utf8"));
7397
+ } catch (error) {
7398
+ if (!(error instanceof Error && "code" in error && error.code === "ENOENT"))
7399
+ throw error;
7400
+ }
7401
+ }
7402
+ } catch (error) {
7403
+ if (!(error instanceof Error && "code" in error && error.code === "ENOENT"))
7404
+ throw error;
7405
+ }
7406
+ }
7407
+ children = lists.join(" ");
7408
+ } else {
7409
+ const result = (0, import_node_child_process4.spawnSync)("pgrep", ["-P", parents.join(",")], {
7410
+ encoding: "utf8",
7411
+ stdio: ["ignore", "pipe", "pipe"],
7412
+ timeout: Math.max(1, timeoutMs),
7413
+ killSignal: "SIGKILL"
7414
+ });
7415
+ if (result.error || result.status !== 0 && result.status !== 1) {
7416
+ throw new Error(
7417
+ `could not inspect descendants of processes ${parents.join(",")}: ${result.error?.message || result.stderr.trim() || `pgrep exited ${result.status}`}`
7418
+ );
7419
+ }
7420
+ children = result.stdout;
7421
+ }
7422
+ return [...new Set(children.trim().split(/\s+/).map(Number))].filter(
7423
+ (pid) => Number.isInteger(pid) && pid > 1 && !parents.includes(pid)
7424
+ );
7425
+ }
7426
+ function signalProcessGroup(child, signal) {
7427
+ if (!child.pid) return;
7428
+ try {
7429
+ process.kill(-child.pid, signal);
7430
+ } catch {
7431
+ try {
7432
+ process.kill(child.pid, signal);
7433
+ } catch {
7434
+ }
7435
+ }
7436
+ }
7437
+ async function protectProcessFreeze(rootPid) {
7438
+ const directory = (0, import_node_fs7.mkdtempSync)((0, import_node_path5.join)((0, import_node_os2.tmpdir)(), "peach-process-freeze-"));
7439
+ const journal = (0, import_node_path5.join)(directory, "targets");
7440
+ (0, import_node_fs7.writeFileSync)(journal, `group ${rootPid}
7441
+ pid ${rootPid}
7442
+ `, { mode: 384 });
7443
+ const guard = (0, import_node_child_process4.spawn)(
7444
+ "/bin/sh",
7445
+ [
7446
+ "-c",
7447
+ `
7448
+ (
7449
+ journal=$1
7450
+ cleanup() {
7451
+ trap '' HUP INT TERM
7452
+ while read -r kind pid; do
7453
+ case $kind in
7454
+ group) target=-$pid ;;
7455
+ pid) target=$pid ;;
7456
+ *) continue ;;
7457
+ esac
7458
+ kill -TERM "$target" 2>/dev/null || :
7459
+ kill -CONT "$target" 2>/dev/null || :
7460
+ done < "$journal"
7461
+ }
7462
+ trap 'cleanup; exit 0' HUP INT TERM
7463
+ trap 'rm -f "$journal"; rmdir "\${journal%/*}"' EXIT
7464
+ printf 'ready
7465
+ '
7466
+ if ! IFS= read -r command <&3 || [ "$command" != disarm ]; then cleanup; fi
7467
+ ) &
7468
+ `,
7469
+ FREEZE_GUARD_NAME,
7470
+ journal
7471
+ ],
7472
+ {
7473
+ detached: true,
7474
+ // the launcher exits before capture, reparenting the guard outside any
7475
+ // nested target tree. fd 3 survives that exit, unlike child.stdin.
7476
+ stdio: ["ignore", "pipe", "ignore", "pipe"]
7477
+ }
7478
+ );
7479
+ let guardClosed = false;
7480
+ const closed = new Promise(
7481
+ (resolveClose) => guard.once("close", () => {
7482
+ guardClosed = true;
7483
+ resolveClose();
7484
+ })
7485
+ );
7486
+ const control = guard.stdio[3];
7487
+ const output2 = guard.stdout;
7488
+ if (!(control instanceof import_node_stream.Duplex) || !output2) {
7489
+ guard.kill();
7490
+ await closed;
7491
+ (0, import_node_fs7.rmSync)(directory, { recursive: true, force: true });
7492
+ throw new Error("process freeze guard control pipe is unavailable");
7493
+ }
7494
+ control.on("error", () => {
7495
+ });
7496
+ try {
7497
+ await new Promise((resolveReady, reject) => {
7498
+ let readyOutput = "";
7499
+ let launcherExited = false;
7500
+ const ready = () => {
7501
+ if (launcherExited && readyOutput.includes("ready\n")) resolveReady();
7502
+ };
7503
+ output2.on("data", (bytes) => {
7504
+ readyOutput += bytes.toString();
7505
+ ready();
7506
+ });
7507
+ guard.once("exit", (code, signal) => {
7508
+ if (code !== 0 || signal !== null) {
7509
+ reject(new Error("process freeze guard launcher failed"));
7510
+ return;
7511
+ }
7512
+ launcherExited = true;
7513
+ ready();
7514
+ });
7515
+ guard.once("error", reject);
7516
+ guard.once(
7517
+ "close",
7518
+ () => reject(new Error("process freeze guard exited before readiness"))
7519
+ );
7520
+ });
7521
+ } catch (error) {
7522
+ control.destroy();
7523
+ await closed;
7524
+ (0, import_node_fs7.rmSync)(directory, { recursive: true, force: true });
7525
+ throw error;
7526
+ }
7527
+ return {
7528
+ record(pid) {
7529
+ if (guardClosed || control.destroyed)
7530
+ throw new Error("process freeze guard exited during capture");
7531
+ (0, import_node_fs7.appendFileSync)(journal, `pid ${pid}
7532
+ `);
7533
+ },
7534
+ async release(disarm) {
7535
+ control.end(disarm ? "disarm\n" : void 0);
7536
+ await closed;
7537
+ (0, import_node_fs7.rmSync)(directory, { recursive: true, force: true });
7538
+ }
7539
+ };
7540
+ }
7541
+ function processesHaveExited(pids, pgid) {
7542
+ const mayExist = [-pgid, ...pids].some((target) => {
7543
+ try {
7544
+ process.kill(target, 0);
7545
+ return true;
7546
+ } catch (error) {
7547
+ return !(error instanceof Error && "code" in error && error.code === "ESRCH");
7548
+ }
7549
+ });
7550
+ if (!mayExist) return true;
7551
+ const knownPids = new Set(pids);
7552
+ try {
7553
+ return !readProcessTable(FORCED_EXIT_TIMEOUT_MS).some(
7554
+ (row) => (row.pgid === pgid || knownPids.has(row.pid)) && !row.zombie
7555
+ );
7556
+ } catch {
7557
+ return false;
7558
+ }
7559
+ }
7560
+ function groupIsEmpty(pgid) {
7561
+ return processesHaveExited([], pgid);
7562
+ }
7563
+ async function waitForExit(pids, pgid, timeoutMs) {
7564
+ const deadline = Date.now() + timeoutMs;
7565
+ const gone = () => processesHaveExited(pids, pgid);
7566
+ while (Date.now() < deadline) {
7567
+ if (gone()) return true;
7568
+ await (0, import_promises.setTimeout)(50);
7569
+ }
7570
+ return gone();
7571
+ }
7572
+ async function terminateProcessGroup(child, signal = "SIGTERM", gracefulTimeoutMs = GRACEFUL_TIMEOUT_MS) {
7573
+ if (!child.pid) {
7574
+ try {
7575
+ child.kill(signal);
7576
+ } catch {
7577
+ }
7578
+ return;
7579
+ }
7580
+ if (child.exitCode !== null || child.signalCode !== null) {
7581
+ if (groupIsEmpty(child.pid)) return;
7582
+ }
7583
+ const freeze = await protectProcessFreeze(child.pid);
7584
+ const descendants = /* @__PURE__ */ new Set();
7585
+ let inspectionError = null;
7586
+ let signaled = false;
7587
+ let gracefulDeadline = 0;
7588
+ try {
7589
+ signalProcessGroup(child, "SIGSTOP");
7590
+ let parents = [child.pid];
7591
+ const inspectionDeadline = Date.now() + GRACEFUL_TIMEOUT_MS;
7592
+ while (parents.length > 0) {
7593
+ const remaining = inspectionDeadline - Date.now();
7594
+ if (remaining <= 0) {
7595
+ inspectionError = new Error("process descendant inspection exceeded its deadline");
7596
+ break;
7597
+ }
7598
+ let children;
7599
+ try {
7600
+ children = listProcessChildren(parents, remaining);
7601
+ } catch (error) {
7602
+ inspectionError = new Error(`could not inspect descendants: ${String(error)}`);
7603
+ break;
7604
+ }
7605
+ const next = [];
7606
+ for (const descendantPid of children) {
7607
+ if (!descendants.has(descendantPid)) {
7608
+ freeze.record(descendantPid);
7609
+ descendants.add(descendantPid);
7610
+ next.push(descendantPid);
7611
+ try {
7612
+ process.kill(descendantPid, "SIGSTOP");
7613
+ } catch {
7614
+ }
7615
+ }
7616
+ }
7617
+ parents = next;
7618
+ }
7619
+ gracefulDeadline = Date.now() + gracefulTimeoutMs;
7620
+ try {
7621
+ process.kill(child.pid, signal);
7622
+ } catch {
7623
+ }
7624
+ signaled = true;
7625
+ } finally {
7626
+ signalProcessGroup(child, "SIGCONT");
7627
+ for (const pid of descendants) {
7628
+ try {
7629
+ process.kill(pid, "SIGCONT");
7630
+ } catch {
7631
+ }
7632
+ }
7633
+ await freeze.release(signaled);
7634
+ }
7635
+ const pids = [child.pid, ...descendants];
7636
+ let rootExited = child.exitCode !== null || child.signalCode !== null;
7637
+ if (!rootExited) {
7638
+ rootExited = await new Promise((resolveExit) => {
7639
+ const onExit = () => {
7640
+ clearTimeout(deadlineTimer);
7641
+ resolveExit(true);
7642
+ };
7643
+ const deadlineTimer = setTimeout(
7644
+ () => {
7645
+ child.removeListener("exit", onExit);
7646
+ resolveExit(false);
7647
+ },
7648
+ Math.max(0, gracefulDeadline - Date.now())
7649
+ );
7650
+ child.once("exit", onExit);
7651
+ if (child.exitCode !== null || child.signalCode !== null) {
7652
+ child.removeListener("exit", onExit);
7653
+ onExit();
7654
+ }
7655
+ });
7656
+ }
7657
+ if (rootExited) {
7658
+ signalProcessGroup(child, signal);
7659
+ for (const pid of descendants) {
7660
+ try {
7661
+ process.kill(pid, signal);
7662
+ } catch {
7663
+ }
7664
+ }
7665
+ }
7666
+ if (await waitForExit(pids, child.pid, Math.max(0, gracefulDeadline - Date.now()))) {
7667
+ if (inspectionError) throw inspectionError;
7668
+ return;
7669
+ }
7670
+ for (const pid of pids) {
7671
+ try {
7672
+ process.kill(pid, "SIGKILL");
7673
+ } catch {
7674
+ }
7675
+ }
7676
+ signalProcessGroup(child, "SIGKILL");
7677
+ const gone = await waitForExit(pids, child.pid, FORCED_EXIT_TIMEOUT_MS);
7678
+ if (!gone) {
7679
+ const survivors = new Error(
7680
+ `process group ${child.pid} exit could not be confirmed after SIGKILL`
7681
+ );
7682
+ if (!inspectionError) throw survivors;
7683
+ throw new Error(`${inspectionError.message}; ${survivors.message}`);
7684
+ }
7685
+ if (inspectionError) throw inspectionError;
7686
+ }
7254
7687
 
7255
7688
  // ../contrast-runtime-delivery/src/product.ts
7256
7689
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
7690
+ var import_node_fs8 = __toESM(require("node:fs"), 1);
7691
+ var import_node_path6 = __toESM(require("node:path"), 1);
7257
7692
  init_version();
7693
+ function listInstalledRuntimes(product) {
7694
+ try {
7695
+ return import_node_fs8.default.readdirSync(product.runtimesDir(), { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name).sort(compareSemver);
7696
+ } catch {
7697
+ return [];
7698
+ }
7699
+ }
7700
+ function runtimeTarballCacheName(product, version) {
7701
+ return import_node_path6.default.posix.basename(product.tarballPath(version));
7702
+ }
7703
+ function compareSemver(a, b) {
7704
+ const parse8 = (v6) => {
7705
+ const hyphen = v6.indexOf("-");
7706
+ const core = hyphen >= 0 ? v6.slice(0, hyphen) : v6;
7707
+ const pre = hyphen >= 0 ? v6.slice(hyphen + 1) : "";
7708
+ const parts = core.split(".").map((n) => Number.parseInt(n, 10));
7709
+ if (parts.some((n) => !Number.isFinite(n))) return [[Number.POSITIVE_INFINITY], v6];
7710
+ return [parts, pre];
7711
+ };
7712
+ const [an, ap] = parse8(a);
7713
+ const [bn, bp] = parse8(b);
7714
+ for (let i = 0; i < Math.max(an.length, bn.length); i++) {
7715
+ const av = an[i] ?? 0;
7716
+ const bv = bn[i] ?? 0;
7717
+ if (av !== bv) return av - bv;
7718
+ }
7719
+ if (ap === bp) return 0;
7720
+ if (!ap) return 1;
7721
+ if (!bp) return -1;
7722
+ return ap < bp ? -1 : 1;
7723
+ }
7724
+
7725
+ // ../contrast-runtime-delivery/src/packs.ts
7726
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
7727
+ var RUNTIME_PACKS_FILE = "packs.json";
7728
+ var RUNTIME_PACK_MARKER = ".pack";
7729
+ var RUNTIME_PACK_PREFIXES = [
7730
+ "engine/fonts/emoji/",
7731
+ "engine/fonts/lang/",
7732
+ "engine/fonts/named/",
7733
+ "engine/fonts/vector-icons/",
7734
+ "engine/fonts/webview/",
7735
+ "engine/kotlin/",
7736
+ "engine/material-symbols/",
7737
+ "engine/pdfjs/",
7738
+ "three-mode/"
7739
+ ];
7740
+ var RUNTIME_MERGE_PACK_DIR = "engine-tenant/";
7741
+ var RUNTIME_MERGE_PACK_INSTALL = ".pack-prod";
7742
+ var RUNTIME_MERGE_PACK_MERGED = ".merged";
7743
+
7744
+ // ../contrast-runtime-delivery/src/index.ts
7745
+ var DEFAULT_LOCAL_RUNTIME_RETENTION_COUNT = 2;
7746
+ function createRuntimeDelivery(product) {
7747
+ function readConfig() {
7748
+ try {
7749
+ const parsed = JSON.parse(
7750
+ import_node_fs9.default.readFileSync(product.configFile(), "utf8")
7751
+ );
7752
+ return parsed && typeof parsed === "object" ? parsed : {};
7753
+ } catch {
7754
+ return {};
7755
+ }
7756
+ }
7757
+ function resolveCdnOrigin(input) {
7758
+ const config = readConfig();
7759
+ const value = input || process.env[product.env.cdnOrigin] || config.cdnOrigin || product.defaultCdnOrigin;
7760
+ return value.replace(/\/+$/, "");
7761
+ }
7762
+ function resolveChannel(input) {
7763
+ const config = readConfig();
7764
+ return input || process.env[product.env.channel] || config.runtimeChannel || product.defaultChannel || "stable";
7765
+ }
7766
+ function resolvePin() {
7767
+ if (!product.env.pin) return null;
7768
+ const env = process.env[product.env.pin];
7769
+ if (env && env.trim()) return env.trim();
7770
+ const config = readConfig();
7771
+ return typeof config.runtimeVersion === "string" && config.runtimeVersion.trim() ? config.runtimeVersion.trim() : null;
7772
+ }
7773
+ function manifestUrl(cdnOrigin) {
7774
+ const url = new URL(`${resolveCdnOrigin(cdnOrigin)}${product.manifestPath}`);
7775
+ url.searchParams.set("t", String(Date.now()));
7776
+ return url.toString();
7777
+ }
7778
+ function tarballUrl(version, cdnOrigin) {
7779
+ return `${resolveCdnOrigin(cdnOrigin)}${product.tarballPath(version)}`;
7780
+ }
7781
+ const UP_TO_DATE_CHECK_TIMEOUT_MS = 2e3;
7782
+ async function fetchManifest(cdnOrigin, timeoutMs) {
7783
+ const url = manifestUrl(cdnOrigin);
7784
+ const res = await fetch(url, {
7785
+ headers: { Accept: "application/json" },
7786
+ // an install is allowed to wait; a best-effort check is not. see
7787
+ // UP_TO_DATE_CHECK_TIMEOUT_MS.
7788
+ ...timeoutMs ? { signal: AbortSignal.timeout(timeoutMs) } : {}
7789
+ });
7790
+ if (!res.ok) {
7791
+ throw new Error(`manifest fetch failed: ${res.status} ${res.statusText} (${url})`);
7792
+ }
7793
+ return await res.json();
7794
+ }
7795
+ function resolveVersion(manifest, opts = {}) {
7796
+ const channel = resolveChannel(opts.channel);
7797
+ const version = opts.version || resolvePin() || manifest.channels[channel]?.latest;
7798
+ if (!version) {
7799
+ throw new Error(
7800
+ `no version specified and channel '${channel}' has no latest entry in the manifest`
7801
+ );
7802
+ }
7803
+ if (!isValidRuntimeVersion(version)) {
7804
+ throw new Error(`invalid runtime version: ${version}`);
7805
+ }
7806
+ const entry = manifest.versions[version];
7807
+ if (!entry) {
7808
+ throw new Error(
7809
+ `version ${version} not found in manifest; available: ${Object.keys(manifest.versions).slice(-10).join(", ") || "(none)"}`
7810
+ );
7811
+ }
7812
+ return { version, channel, entry };
7813
+ }
7814
+ async function isVerifiedInstall(dir) {
7815
+ if (!import_node_fs9.default.existsSync(import_node_path7.default.join(dir, product.installedMarker))) return false;
7816
+ try {
7817
+ await product.verifyInstall?.(dir);
7818
+ return true;
7819
+ } catch {
7820
+ return false;
7821
+ }
7822
+ }
7823
+ async function install(opts = {}) {
7824
+ product.ensureHome();
7825
+ const cdnOrigin = resolveCdnOrigin(opts.cdnOrigin);
7826
+ const manifest = await fetchManifest(cdnOrigin);
7827
+ const { version, channel, entry } = resolveVersion(manifest, opts);
7828
+ const destDir = product.runtimeDir(version);
7829
+ const setActive = opts.setActive !== false;
7830
+ const protectVersions = [version, ...opts.protectVersions ?? []];
7831
+ pruneLocalRetention({ protectVersions });
7832
+ if (!opts.force && await isVerifiedInstall(destDir)) {
7833
+ if (setActive) product.writeActiveRuntime(version);
7834
+ pruneLocalRetention({ protectVersions });
7835
+ return {
7836
+ version,
7837
+ channel,
7838
+ cdnOrigin,
7839
+ runtimeDir: destDir,
7840
+ installed: false,
7841
+ activated: setActive,
7842
+ manifest
7843
+ };
7844
+ }
7845
+ if (!opts.quiet)
7846
+ process.stderr.write(`${product.id}: downloading runtime ${version}\u2026
7847
+ `);
7848
+ await installVerifiedTarball({
7849
+ url: entry.tarball || tarballUrl(version, cdnOrigin),
7850
+ digest: { algorithm: "sha256", encoding: "hex", value: entry.sha256 },
7851
+ destDir,
7852
+ installedMarker: product.installedMarker,
7853
+ verify: product.verifyInstall,
7854
+ label: `runtime ${version}`
7855
+ });
7856
+ if (setActive) product.writeActiveRuntime(version);
7857
+ pruneLocalRetention({ protectVersions });
7858
+ return {
7859
+ version,
7860
+ channel,
7861
+ cdnOrigin,
7862
+ runtimeDir: destDir,
7863
+ installed: true,
7864
+ activated: setActive,
7865
+ manifest
7866
+ };
7867
+ }
7868
+ async function updateToLatest(opts = {}) {
7869
+ product.ensureHome();
7870
+ pruneLocalRetention({ protectVersions: opts.protectVersions });
7871
+ const cdnOrigin = resolveCdnOrigin(opts.cdnOrigin);
7872
+ const channel = resolveChannel(opts.channel);
7873
+ const pin = resolvePin();
7874
+ if (pin) {
7875
+ const activeVersion2 = product.readActiveRuntime();
7876
+ const pinInstalled = await isVerifiedInstall(product.runtimeDir(pin));
7877
+ if (activeVersion2 === pin && pinInstalled) {
7878
+ return {
7879
+ checked: true,
7880
+ updated: false,
7881
+ reason: `runtime is pinned to ${pin}`,
7882
+ activeVersion: activeVersion2,
7883
+ latestVersion: pin
7884
+ };
7885
+ }
7886
+ const installed2 = await install({
7887
+ version: pin,
7888
+ channel,
7889
+ cdnOrigin,
7890
+ setActive: false,
7891
+ protectVersions: opts.protectVersions
7892
+ });
7893
+ return {
7894
+ checked: true,
7895
+ updated: true,
7896
+ reason: `runtime is pinned to ${pin}`,
7897
+ activeVersion: pin,
7898
+ latestVersion: pin,
7899
+ install: installed2
7900
+ };
7901
+ }
7902
+ const manifest = await fetchManifest(cdnOrigin);
7903
+ const latestVersion = manifest.channels[channel]?.latest;
7904
+ if (!latestVersion) {
7905
+ return {
7906
+ checked: true,
7907
+ updated: false,
7908
+ reason: `channel '${channel}' has no latest runtime`,
7909
+ activeVersion: product.readActiveRuntime()
7910
+ };
7911
+ }
7912
+ const entry = manifest.versions[latestVersion];
7913
+ if (!entry) {
7914
+ return {
7915
+ checked: true,
7916
+ updated: false,
7917
+ reason: `manifest is missing version ${latestVersion}`,
7918
+ activeVersion: product.readActiveRuntime(),
7919
+ latestVersion
7920
+ };
7921
+ }
7922
+ const activeVersion = product.readActiveRuntime();
7923
+ const activeDir = activeVersion ? product.runtimeDir(activeVersion) : null;
7924
+ const activeInstalled = activeDir ? await isVerifiedInstall(activeDir) : false;
7925
+ const shouldInstall = !activeVersion || !activeInstalled || compareSemver(latestVersion, activeVersion) > 0;
7926
+ if (!shouldInstall) {
7927
+ return {
7928
+ checked: true,
7929
+ updated: false,
7930
+ reason: "active runtime is current",
7931
+ activeVersion,
7932
+ latestVersion
7933
+ };
7934
+ }
7935
+ const installed = await install({
7936
+ version: latestVersion,
7937
+ channel,
7938
+ cdnOrigin,
7939
+ setActive: false,
7940
+ protectVersions: opts.protectVersions
7941
+ });
7942
+ return {
7943
+ checked: true,
7944
+ updated: true,
7945
+ activeVersion: latestVersion,
7946
+ latestVersion,
7947
+ install: installed
7948
+ };
7949
+ }
7950
+ async function checkUpToDate(opts = {}) {
7951
+ const active = product.readActiveRuntime();
7952
+ const pinned = resolvePin();
7953
+ if (pinned) {
7954
+ return { active, latest: pinned, pinned, outdated: active !== pinned };
7955
+ }
7956
+ try {
7957
+ const manifest = await fetchManifest(
7958
+ resolveCdnOrigin(opts.cdnOrigin),
7959
+ UP_TO_DATE_CHECK_TIMEOUT_MS
7960
+ );
7961
+ const channel = resolveChannel(opts.channel);
7962
+ const latest = manifest.channels[channel]?.latest ?? null;
7963
+ const outdated = !!(latest && (!active || compareSemver(latest, active) > 0));
7964
+ return { active, latest, pinned: null, outdated };
7965
+ } catch {
7966
+ return { active, latest: null, pinned: null, outdated: false };
7967
+ }
7968
+ }
7969
+ function planLocalRetention(opts = {}) {
7970
+ product.ensureHome();
7971
+ const retainVersions = Math.max(
7972
+ 1,
7973
+ Math.floor(opts.retainVersions ?? DEFAULT_LOCAL_RUNTIME_RETENTION_COUNT)
7974
+ );
7975
+ const installed = listInstalledRuntimes(product);
7976
+ const installedSet = new Set(installed);
7977
+ const activeVersion = product.readActiveRuntime();
7978
+ const pinnedVersion = resolvePin();
7979
+ const keep = /* @__PURE__ */ new Set();
7980
+ for (const version of [
7981
+ activeVersion,
7982
+ pinnedVersion,
7983
+ ...opts.protectVersions ?? []
7984
+ ]) {
7985
+ if (version && installedSet.has(version)) keep.add(version);
7986
+ }
7987
+ for (const version of [...installed].reverse()) {
7988
+ if (keep.size >= retainVersions) break;
7989
+ keep.add(version);
7990
+ }
7991
+ const cacheTemplateMarker = "__RUNTIME_VERSION__";
7992
+ const cacheTemplate = runtimeTarballCacheName(product, cacheTemplateMarker);
7993
+ const markerOffset = cacheTemplate.indexOf(cacheTemplateMarker);
7994
+ const cachePrefix = cacheTemplate.slice(0, markerOffset);
7995
+ const cacheSuffix = cacheTemplate.slice(markerOffset + cacheTemplateMarker.length);
7996
+ let removeCacheFiles = [];
7997
+ if (markerOffset >= 0) {
7998
+ try {
7999
+ removeCacheFiles = import_node_fs9.default.readdirSync(product.cacheDir(), { withFileTypes: true }).filter((entry) => {
8000
+ if (!entry.isFile()) return false;
8001
+ const complete = entry.name.startsWith(cachePrefix) && entry.name.endsWith(cacheSuffix);
8002
+ const partial = entry.name.startsWith(cachePrefix) && entry.name.endsWith(`${cacheSuffix}.partial`);
8003
+ return complete || partial;
8004
+ }).map((entry) => import_node_path7.default.join(product.cacheDir(), entry.name)).sort();
8005
+ } catch {
8006
+ }
8007
+ }
8008
+ return {
8009
+ activeVersion,
8010
+ pinnedVersion,
8011
+ keepVersions: installed.filter((version) => keep.has(version)),
8012
+ removeVersions: installed.filter((version) => !keep.has(version)),
8013
+ removeCacheFiles
8014
+ };
8015
+ }
8016
+ function pruneLocalRetention(opts = {}) {
8017
+ const plan = planLocalRetention(opts);
8018
+ for (const version of plan.removeVersions) {
8019
+ import_node_fs9.default.rmSync(product.runtimeDir(version), { recursive: true, force: true });
8020
+ }
8021
+ for (const cacheFile of plan.removeCacheFiles) {
8022
+ import_node_fs9.default.rmSync(cacheFile, { force: true });
8023
+ }
8024
+ return plan;
8025
+ }
8026
+ return {
8027
+ product,
8028
+ resolveCdnOrigin,
8029
+ resolveChannel,
8030
+ resolvePin,
8031
+ manifestUrl,
8032
+ tarballUrl,
8033
+ fetchManifest,
8034
+ resolveVersion,
8035
+ install,
8036
+ updateToLatest,
8037
+ checkUpToDate,
8038
+ planLocalRetention,
8039
+ pruneLocalRetention,
8040
+ listInstalled: () => listInstalledRuntimes(product)
8041
+ };
8042
+ }
8043
+ async function installVerifiedTarball(tarball) {
8044
+ const { destDir, installedMarker, signal } = tarball;
8045
+ import_node_fs9.default.mkdirSync(import_node_path7.default.dirname(destDir), { recursive: true });
8046
+ const presentAtStart = import_node_fs9.default.existsSync(import_node_path7.default.join(destDir, installedMarker));
8047
+ const lock = `${destDir}.lock`;
8048
+ for (; ; ) {
8049
+ signal?.throwIfAborted();
8050
+ try {
8051
+ import_node_fs9.default.writeFileSync(lock, String(process.pid), { flag: "wx" });
8052
+ break;
8053
+ } catch (err) {
8054
+ if (!isErrnoCode(err, "EEXIST")) throw err;
8055
+ if (lockOwnerGone(lock)) import_node_fs9.default.rmSync(lock, { force: true });
8056
+ else await new Promise((resolve4) => setTimeout(resolve4, 250));
8057
+ }
8058
+ }
8059
+ try {
8060
+ if (!presentAtStart && import_node_fs9.default.existsSync(import_node_path7.default.join(destDir, installedMarker))) {
8061
+ await tarball.verify?.(destDir);
8062
+ return;
8063
+ }
8064
+ await installVerifiedTarballLocked(tarball, presentAtStart);
8065
+ } finally {
8066
+ import_node_fs9.default.rmSync(lock, { force: true });
8067
+ }
8068
+ }
8069
+ function lockOwnerGone(lock) {
8070
+ try {
8071
+ process.kill(Number(import_node_fs9.default.readFileSync(lock, "utf8")), 0);
8072
+ return false;
8073
+ } catch (err) {
8074
+ return !isErrnoCode(err, "EPERM", "ENOENT");
8075
+ }
8076
+ }
8077
+ async function installVerifiedTarballLocked(tarball, presentAtStart) {
8078
+ const { url, digest, destDir, installedMarker, label, signal } = tarball;
8079
+ signal?.throwIfAborted();
8080
+ const downloadDir = import_node_fs9.default.mkdtempSync(import_node_path7.default.join(import_node_os3.default.tmpdir(), "runtime-delivery-download-"));
8081
+ const archivePath = import_node_path7.default.join(downloadDir, "archive");
8082
+ const tmpDir = import_node_fs9.default.mkdtempSync(
8083
+ import_node_path7.default.join(import_node_path7.default.dirname(destDir), `.installing-${import_node_path7.default.basename(destDir)}-`)
8084
+ );
8085
+ try {
8086
+ await downloadToFile(url, archivePath, signal);
8087
+ const actual = await digestFile(
8088
+ archivePath,
8089
+ digest.algorithm,
8090
+ digest.encoding,
8091
+ signal
8092
+ );
8093
+ if (actual !== digest.value) {
8094
+ throw new Error(
8095
+ `${digest.algorithm} mismatch for ${label}: expected ${digest.value}, actual ${actual}`
8096
+ );
8097
+ }
8098
+ const { pathname } = new URL(url);
8099
+ if (pathname.endsWith(".zip")) await extractZip(archivePath, tmpDir, signal);
8100
+ else
8101
+ await extractTarball(
8102
+ archivePath,
8103
+ pathname.endsWith(".tar.zst"),
8104
+ tmpDir,
8105
+ tarball.stripComponents ?? 0,
8106
+ signal
8107
+ );
8108
+ signal?.throwIfAborted();
8109
+ if (!import_node_fs9.default.existsSync(import_node_path7.default.join(tmpDir, installedMarker))) {
8110
+ throw new Error(`extracted tarball for ${label} is missing ${installedMarker}`);
8111
+ }
8112
+ await tarball.verify?.(tmpDir);
8113
+ signal?.throwIfAborted();
8114
+ try {
8115
+ import_node_fs9.default.renameSync(tmpDir, destDir);
8116
+ } catch (err) {
8117
+ if (!isErrnoCode(err, "ENOTEMPTY", "EEXIST")) throw err;
8118
+ if (!presentAtStart && import_node_fs9.default.existsSync(import_node_path7.default.join(destDir, installedMarker))) {
8119
+ await tarball.verify?.(destDir);
8120
+ return;
8121
+ }
8122
+ const aside = `${tmpDir}-replaced`;
8123
+ try {
8124
+ import_node_fs9.default.renameSync(destDir, aside);
8125
+ } catch (moveErr) {
8126
+ if (!isErrnoCode(moveErr, "ENOENT")) throw moveErr;
8127
+ }
8128
+ try {
8129
+ import_node_fs9.default.renameSync(tmpDir, destDir);
8130
+ } catch (landErr) {
8131
+ if (!isErrnoCode(landErr, "ENOTEMPTY", "EEXIST") || !import_node_fs9.default.existsSync(import_node_path7.default.join(destDir, installedMarker))) {
8132
+ throw landErr;
8133
+ }
8134
+ await tarball.verify?.(destDir);
8135
+ } finally {
8136
+ import_node_fs9.default.rmSync(aside, { recursive: true, force: true });
8137
+ }
8138
+ }
8139
+ } finally {
8140
+ import_node_fs9.default.rmSync(tmpDir, { recursive: true, force: true });
8141
+ import_node_fs9.default.rmSync(downloadDir, { recursive: true, force: true });
8142
+ }
8143
+ }
8144
+ function isErrnoCode(err, ...codes) {
8145
+ return err instanceof Error && "code" in err && codes.includes(String(err.code));
8146
+ }
8147
+ async function downloadToFile(url, destPath, signal) {
8148
+ const res = await fetch(url, { signal });
8149
+ if (!res.ok || !res.body) {
8150
+ throw new Error(`download failed: ${res.status} ${res.statusText} (${url})`);
8151
+ }
8152
+ import_node_fs9.default.mkdirSync(import_node_path7.default.dirname(destPath), { recursive: true });
8153
+ const tmp = `${destPath}.partial`;
8154
+ try {
8155
+ await (0, import_promises2.pipeline)(
8156
+ import_node_stream2.Readable.fromWeb(res.body),
8157
+ import_node_fs9.default.createWriteStream(tmp),
8158
+ { signal }
8159
+ );
8160
+ signal?.throwIfAborted();
8161
+ import_node_fs9.default.renameSync(tmp, destPath);
8162
+ } catch (err) {
8163
+ try {
8164
+ import_node_fs9.default.unlinkSync(tmp);
8165
+ } catch {
8166
+ }
8167
+ throw err;
8168
+ }
8169
+ }
8170
+ async function digestFile(filePath, algorithm, encoding, signal) {
8171
+ const hash = import_node_crypto2.default.createHash(algorithm);
8172
+ await (0, import_promises2.pipeline)(import_node_fs9.default.createReadStream(filePath), hash, { signal });
8173
+ return hash.digest(encoding);
8174
+ }
8175
+ function extractZip(zipPath, destDir, signal) {
8176
+ return runExtractor("ditto", ["-x", "-k", zipPath, destDir], signal);
8177
+ }
8178
+ async function extractTarball(tarPath, zstd, destDir, stripComponents, signal) {
8179
+ const args = [zstd ? "-xf" : "-xzf", "-"];
8180
+ if (stripComponents > 0) args.push(`--strip-components=${stripComponents}`);
8181
+ if (zstd) {
8182
+ const decoder = import_node_zlib.default.createZstdDecompress({
8183
+ params: { [import_node_zlib.default.constants.ZSTD_d_windowLogMax]: 30 }
8184
+ });
8185
+ await runExtractor("tar", args, signal, {
8186
+ cwd: destDir,
8187
+ stdin: (stdin) => (0, import_promises2.pipeline)(import_node_fs9.default.createReadStream(tarPath), decoder, stdin, { signal })
8188
+ });
8189
+ return;
8190
+ }
8191
+ const archive = import_node_fs9.default.openSync(tarPath, "r");
8192
+ try {
8193
+ await runExtractor("tar", args, signal, { cwd: destDir, stdin: archive });
8194
+ } finally {
8195
+ import_node_fs9.default.closeSync(archive);
8196
+ }
8197
+ }
8198
+ async function runExtractor(command, args, signal, input) {
8199
+ signal?.throwIfAborted();
8200
+ const stdin = input?.stdin;
8201
+ const stdio = [
8202
+ typeof stdin === "function" ? "pipe" : stdin ?? "ignore",
8203
+ "inherit",
8204
+ "inherit"
8205
+ ];
8206
+ const child = (0, import_node_child_process5.spawn)(command, args, {
8207
+ cwd: input?.cwd,
8208
+ stdio,
8209
+ detached: process.platform !== "win32"
8210
+ });
8211
+ const fed = typeof stdin === "function" && child.stdin ? stdin(child.stdin) : void 0;
8212
+ void fed?.catch(() => {
8213
+ });
8214
+ let stopping;
8215
+ const abort = () => {
8216
+ stopping ??= terminateProcessGroup(child, "SIGKILL", 0);
8217
+ void stopping.catch(() => {
8218
+ });
8219
+ };
8220
+ try {
8221
+ await new Promise((resolve4, reject) => {
8222
+ let failure;
8223
+ child.on("error", (error) => {
8224
+ failure = error;
8225
+ });
8226
+ child.on("close", (code) => {
8227
+ if (signal?.aborted) {
8228
+ const reason = signal.reason;
8229
+ reject(
8230
+ reason instanceof Error ? reason : new Error("Extraction canceled", { cause: reason })
8231
+ );
8232
+ } else if (failure) reject(failure);
8233
+ else if (code === 0) resolve4();
8234
+ else reject(new Error(`${command} exited with code ${code}`));
8235
+ });
8236
+ signal?.addEventListener("abort", abort, { once: true });
8237
+ if (signal?.aborted) abort();
8238
+ });
8239
+ await fed;
8240
+ } finally {
8241
+ signal?.removeEventListener("abort", abort);
8242
+ await stopping;
8243
+ }
8244
+ }
7258
8245
 
7259
8246
  // src/runtime-assets.ts
7260
8247
  init_home_paths();
@@ -7320,7 +8307,6 @@ var ROOT_RUNTIME_PATHS = [
7320
8307
  "/fonts/",
7321
8308
  "/icons/",
7322
8309
  "/sounds/",
7323
- "/spike/",
7324
8310
  "/test-wallpaper.jpg",
7325
8311
  "/preview-sw.js",
7326
8312
  "/preview/guest-bridge-host.js",
@@ -7471,10 +8457,10 @@ function peachRuntimeRoot() {
7471
8457
 
7472
8458
  // src/expo-autolinking.ts
7473
8459
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
7474
- var import_node_child_process3 = require("node:child_process");
8460
+ var import_node_child_process6 = require("node:child_process");
7475
8461
  var import_node_util3 = require("node:util");
7476
8462
  init_forked_script_contract();
7477
- var run3 = (0, import_node_util3.promisify)(import_node_child_process3.execFile);
8463
+ var run3 = (0, import_node_util3.promisify)(import_node_child_process6.execFile);
7478
8464
 
7479
8465
  // src/expo-native-prebuilt.ts
7480
8466
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -7491,21 +8477,21 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
7491
8477
 
7492
8478
  // src/swift-objc-sdk-tree.ts
7493
8479
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
7494
- var import_node_fs7 = require("node:fs");
7495
- var import_node_path6 = __toESM(require("node:path"), 1);
8480
+ var import_node_fs11 = require("node:fs");
8481
+ var import_node_path9 = __toESM(require("node:path"), 1);
7496
8482
  function readIosSdkTree(root) {
7497
- return (0, import_node_fs7.readdirSync)(root, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => {
7498
- const file = import_node_path6.default.join(entry.parentPath, entry.name);
8483
+ return (0, import_node_fs11.readdirSync)(root, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => {
8484
+ const file = import_node_path9.default.join(entry.parentPath, entry.name);
7499
8485
  return [
7500
- import_node_path6.default.relative(root, file).split(import_node_path6.default.sep).join("/"),
7501
- (0, import_node_fs7.readFileSync)(file, "utf8")
8486
+ import_node_path9.default.relative(root, file).split(import_node_path9.default.sep).join("/"),
8487
+ (0, import_node_fs11.readFileSync)(file, "utf8")
7502
8488
  ];
7503
8489
  }).sort(([a], [b]) => a < b ? -1 : 1);
7504
8490
  }
7505
8491
 
7506
8492
  // src/swift-standin-digest.ts
7507
8493
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
7508
- var STANDIN_SOURCE_DIGEST = true ? "9adf53d6f1cfece1b7a3e23bad712630278818d71b5b718384cf640144349600" : standinSourceDigest();
8494
+ var STANDIN_SOURCE_DIGEST = true ? "f077081111b09ca27482cd53be422dae6cd1bd3a5fd2b2bdef48a83a9c0d6ca8" : standinSourceDigest();
7509
8495
 
7510
8496
  // src/expo-native-workspace.ts
7511
8497
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -7549,10 +8535,10 @@ init_is_record();
7549
8535
 
7550
8536
  // src/native-firebase-config.ts
7551
8537
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
7552
- var import_node_child_process7 = require("node:child_process");
7553
- var import_node_fs15 = __toESM(require("node:fs"), 1);
7554
- var import_node_os2 = __toESM(require("node:os"), 1);
7555
- var import_node_path16 = __toESM(require("node:path"), 1);
8538
+ var import_node_child_process10 = require("node:child_process");
8539
+ var import_node_fs19 = __toESM(require("node:fs"), 1);
8540
+ var import_node_os5 = __toESM(require("node:os"), 1);
8541
+ var import_node_path19 = __toESM(require("node:path"), 1);
7556
8542
  init_is_record();
7557
8543
 
7558
8544
  // src/plist.ts
@@ -7564,10 +8550,10 @@ function parsePlistSource(source) {
7564
8550
 
7565
8551
  // src/xcode-project.ts
7566
8552
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
7567
- var import_node_child_process6 = require("node:child_process");
7568
- var import_node_crypto5 = require("node:crypto");
7569
- var import_node_fs14 = __toESM(require("node:fs"), 1);
7570
- var import_node_path15 = __toESM(require("node:path"), 1);
8553
+ var import_node_child_process9 = require("node:child_process");
8554
+ var import_node_crypto6 = require("node:crypto");
8555
+ var import_node_fs18 = __toESM(require("node:fs"), 1);
8556
+ var import_node_path18 = __toESM(require("node:path"), 1);
7571
8557
  var import_plist2 = __toESM(require("plist"), 1);
7572
8558
  init_is_record();
7573
8559
 
@@ -7918,7 +8904,7 @@ function parseOpenStepPlist(text2) {
7918
8904
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
7919
8905
  var NEVER_MEMBER = /(?:^|\/)(?:Info\.plist|[^/]+\.entitlements|[^/]+\.xcconfig|\.DS_Store)$/;
7920
8906
  var BUNDLE_DIR = /\.(xcassets|bundle|lproj|xcdatamodeld|scnassets|spriteatlas|rcproject|storyboardc|icon)$/;
7921
- function xcodePathResolver(objects, projectDir, join7, sourceTreeRoot) {
8907
+ function xcodePathResolver(objects, projectDir, join8, sourceTreeRoot) {
7922
8908
  const parents = /* @__PURE__ */ new Map();
7923
8909
  for (const [id, entry] of Object.entries(objects)) {
7924
8910
  if (!isDict(entry)) continue;
@@ -7936,14 +8922,14 @@ function xcodePathResolver(objects, projectDir, join7, sourceTreeRoot) {
7936
8922
  const own = str(entry.path) ?? "";
7937
8923
  const tree2 = str(entry.sourceTree) ?? "<group>";
7938
8924
  if (tree2 === "<absolute>") result = own;
7939
- else if (tree2 === "SOURCE_ROOT") result = join7(projectDir, own);
8925
+ else if (tree2 === "SOURCE_ROOT") result = join8(projectDir, own);
7940
8926
  else if (tree2 === "<group>") {
7941
8927
  const parent = parents.get(id);
7942
8928
  const base = parent ? resolve4(parent) : projectDir;
7943
- if (base !== null) result = join7(base, own);
8929
+ if (base !== null) result = join8(base, own);
7944
8930
  } else {
7945
8931
  const base = sourceTreeRoot?.(tree2);
7946
- if (base) result = join7(base, own);
8932
+ if (base) result = join8(base, own);
7947
8933
  }
7948
8934
  }
7949
8935
  paths.set(id, result);
@@ -7965,7 +8951,7 @@ function xcodeTargetMemberVisitor(objects) {
7965
8951
  if (isDict(group) && group.isa === "PBXFileSystemSynchronizedRootGroup")
7966
8952
  synchronizedGroups.push({ id, group });
7967
8953
  }
7968
- return (targetId, resolvePath, filesUnder, join7, visit3) => {
8954
+ return (targetId, resolvePath, filesUnder, join8, visit3) => {
7969
8955
  const target = objects[targetId];
7970
8956
  if (!isDict(target)) return;
7971
8957
  for (const phaseId of list(target.buildPhases)) {
@@ -8000,7 +8986,7 @@ function xcodeTargetMemberVisitor(objects) {
8000
8986
  for (const relative3 of list(exception.membershipExceptions))
8001
8987
  exceptions.add(relative3);
8002
8988
  }
8003
- const members = owned.has(groupId) ? filesUnder(folder) : [...exceptions].flatMap((relative3) => filesUnder(join7(folder, relative3)));
8989
+ const members = owned.has(groupId) ? filesUnder(folder) : [...exceptions].flatMap((relative3) => filesUnder(join8(folder, relative3)));
8004
8990
  for (const file of members) {
8005
8991
  const relative3 = file.slice(prefix2.length);
8006
8992
  const excepted = [...exceptions].some(
@@ -8170,10 +9156,10 @@ function appTargetReleaseSettings(pbxproj, targetName, infoPlistRelativePath) {
8170
9156
  var APP_DELEGATE_PATH_RE = /(?:^|\/)(?:ios\/)?([^/]+)\/AppDelegate\.(?:swift|mm|m)$/;
8171
9157
  function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri) {
8172
9158
  const pbxprojPath = Object.keys(files).find(
8173
- (path26) => /(?:^|\/)ios\/[^/]+\.xcodeproj\/project\.pbxproj$/.test(path26)
9159
+ (path29) => /(?:^|\/)ios\/[^/]+\.xcodeproj\/project\.pbxproj$/.test(path29)
8174
9160
  ) ?? Object.keys(files).find(
8175
- (path26) => /(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/.test(path26)
8176
- ) ?? Object.keys(files).find((path26) => /(?:^|\/)project\.pbxproj$/.test(path26));
9161
+ (path29) => /(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/.test(path29)
9162
+ ) ?? Object.keys(files).find((path29) => /(?:^|\/)project\.pbxproj$/.test(path29));
8177
9163
  if (!pbxprojPath) return null;
8178
9164
  const pbxproj = files[pbxprojPath];
8179
9165
  let objects = {};
@@ -8215,7 +9201,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
8215
9201
  } else if (applicationTargetNames.size === 1) {
8216
9202
  targetName = [...applicationTargetNames][0];
8217
9203
  } else if (applicationTargetNames.size > 1) {
8218
- const delegateTargets = Object.keys(files).filter((path26) => !path26.includes("/Pods/")).map((path26) => path26.match(APP_DELEGATE_PATH_RE)?.[1]).filter(
9204
+ const delegateTargets = Object.keys(files).filter((path29) => !path29.includes("/Pods/")).map((path29) => path29.match(APP_DELEGATE_PATH_RE)?.[1]).filter(
8219
9205
  (name2) => typeof name2 === "string" && applicationTargetNames.has(name2)
8220
9206
  );
8221
9207
  if (delegateTargets.length === 1) {
@@ -8431,7 +9417,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
8431
9417
  if (resourceUri) {
8432
9418
  if (!selectedTarget)
8433
9419
  throw new Error("native app icon target membership is unresolved");
8434
- const join7 = (base, own) => {
9420
+ const join8 = (base, own) => {
8435
9421
  const segments = [];
8436
9422
  for (const segment of `${base}/${own}`.split("/")) {
8437
9423
  if (segment === "" || segment === ".") continue;
@@ -8444,22 +9430,22 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
8444
9430
  const project = Object.values(objects).find(
8445
9431
  (object4) => isRecord(object4) && object4.isa === "PBXProject"
8446
9432
  );
8447
- const projectDir = join7(
9433
+ const projectDir = join8(
8448
9434
  pbxprojPath.replace(/(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/, ""),
8449
9435
  isRecord(project) && typeof project.projectDirPath === "string" ? project.projectDirPath : ""
8450
9436
  );
8451
9437
  const paths = Object.keys(files);
8452
9438
  xcodeTargetMemberVisitor(objects)(
8453
9439
  selectedTarget.id,
8454
- xcodePathResolver(objects, projectDir, join7),
9440
+ xcodePathResolver(objects, projectDir, join8),
8455
9441
  (file) => {
8456
9442
  if (Object.hasOwn(files, file)) return [file];
8457
9443
  const prefix2 = file === "" ? "" : `${file.replace(/\/$/, "")}/`;
8458
9444
  return paths.filter(
8459
- (path26) => path26.startsWith(prefix2) && !/(?:^|\/)\./.test(path26.slice(prefix2.length))
9445
+ (path29) => path29.startsWith(prefix2) && !/(?:^|\/)\./.test(path29.slice(prefix2.length))
8460
9446
  );
8461
9447
  },
8462
- join7,
9448
+ join8,
8463
9449
  (file, kind) => {
8464
9450
  if (kind === "resource") resources.add(file);
8465
9451
  }
@@ -8467,7 +9453,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
8467
9453
  }
8468
9454
  const rootModuleName = readRootModuleName(
8469
9455
  Object.entries(files).filter(
8470
- ([path26]) => !path26.includes("/Pods/") && (/(?:^|\/)(?:ios\/)?AppDelegate\.(?:swift|mm|m)$/.test(path26) || path26.match(APP_DELEGATE_PATH_RE)?.[1] === targetName)
9456
+ ([path29]) => !path29.includes("/Pods/") && (/(?:^|\/)(?:ios\/)?AppDelegate\.(?:swift|mm|m)$/.test(path29) || path29.match(APP_DELEGATE_PATH_RE)?.[1] === targetName)
8471
9457
  ).map(([, source]) => source)
8472
9458
  );
8473
9459
  return {
@@ -8560,26 +9546,26 @@ function extractNativeAppIdentityFromFiles(files, platform, parseInfoPlist, iosT
8560
9546
 
8561
9547
  // src/prepared-xcode-phases.ts
8562
9548
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
8563
- var import_node_crypto2 = require("node:crypto");
8564
- var import_node_fs10 = __toESM(require("node:fs"), 1);
8565
- var import_node_path8 = __toESM(require("node:path"), 1);
9549
+ var import_node_crypto3 = require("node:crypto");
9550
+ var import_node_fs14 = __toESM(require("node:fs"), 1);
9551
+ var import_node_path11 = __toESM(require("node:path"), 1);
8566
9552
  var workspaces = /* @__PURE__ */ new Map();
8567
9553
  var recording;
8568
9554
  function relativeFile(root, file) {
8569
- const relative3 = import_node_path8.default.relative(root, file);
8570
- if (!relative3 || relative3 === ".." || relative3.startsWith(`..${import_node_path8.default.sep}`) || import_node_path8.default.isAbsolute(relative3))
9555
+ const relative3 = import_node_path11.default.relative(root, file);
9556
+ if (!relative3 || relative3 === ".." || relative3.startsWith(`..${import_node_path11.default.sep}`) || import_node_path11.default.isAbsolute(relative3))
8571
9557
  throw new Error(`prepared Xcode output is outside its workspace: ${file}`);
8572
- return relative3.split(import_node_path8.default.sep).join("/");
9558
+ return relative3.split(import_node_path11.default.sep).join("/");
8573
9559
  }
8574
9560
  function output(root, file) {
8575
9561
  const relative3 = relativeFile(root, file);
8576
- const stat = import_node_fs10.default.statSync(file, { throwIfNoEntry: false });
9562
+ const stat = import_node_fs14.default.statSync(file, { throwIfNoEntry: false });
8577
9563
  if (!stat) return { path: relative3, sha256: null };
8578
9564
  if (!stat.isFile()) throw new Error(`prepared Xcode output is not a file: ${file}`);
8579
- relativeFile(root, import_node_fs10.default.realpathSync(file));
8580
- const bytes = import_node_fs10.default.readFileSync(file);
9565
+ relativeFile(root, import_node_fs14.default.realpathSync(file));
9566
+ const bytes = import_node_fs14.default.readFileSync(file);
8581
9567
  const prefix2 = Buffer.from(root);
8582
- const hash = (0, import_node_crypto2.createHash)("sha256");
9568
+ const hash = (0, import_node_crypto3.createHash)("sha256");
8583
9569
  let offset = 0;
8584
9570
  for (let index = bytes.indexOf(prefix2); index !== -1; index = bytes.indexOf(prefix2, offset)) {
8585
9571
  hash.update(bytes.subarray(offset, index)).update("\0workspace\0");
@@ -8593,8 +9579,8 @@ function output(root, file) {
8593
9579
  }
8594
9580
  function preparedXcodePhase(project, target, phase, configuration, outputs, recorded) {
8595
9581
  const root = recording?.root ?? [...workspaces.keys()].find((root2) => {
8596
- const relative3 = import_node_path8.default.relative(root2, project);
8597
- return relative3 !== ".." && !relative3.startsWith(`..${import_node_path8.default.sep}`) && !import_node_path8.default.isAbsolute(relative3);
9582
+ const relative3 = import_node_path11.default.relative(root2, project);
9583
+ return relative3 !== ".." && !relative3.startsWith(`..${import_node_path11.default.sep}`) && !import_node_path11.default.isAbsolute(relative3);
8598
9584
  });
8599
9585
  if (!root) return false;
8600
9586
  const entry = {
@@ -8630,8 +9616,8 @@ function preparedXcodePhase(project, target, phase, configuration, outputs, reco
8630
9616
 
8631
9617
  // src/swift-binary-modules.ts
8632
9618
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
8633
- var import_node_fs11 = __toESM(require("node:fs"), 1);
8634
- var import_node_path9 = __toESM(require("node:path"), 1);
9619
+ var import_node_fs15 = __toESM(require("node:fs"), 1);
9620
+ var import_node_path12 = __toESM(require("node:path"), 1);
8635
9621
  init_home_paths();
8636
9622
 
8637
9623
  // src/swift-package.ts
@@ -8676,7 +9662,7 @@ function moduleMapName(text2) {
8676
9662
  }
8677
9663
 
8678
9664
  // src/swift-binary-modules.ts
8679
- var cacheDir2 = import_node_path9.default.join(cacheDir(), "swift-binary-modules");
9665
+ var cacheDir2 = import_node_path12.default.join(cacheDir(), "swift-binary-modules");
8680
9666
  function frameworkModules(paths) {
8681
9667
  const modules = /* @__PURE__ */ new Set();
8682
9668
  for (const file of paths) {
@@ -8686,21 +9672,21 @@ function frameworkModules(paths) {
8686
9672
  return [...modules].sort();
8687
9673
  }
8688
9674
  function localSwiftBinaryModules(dir) {
8689
- if (!import_node_fs11.default.existsSync(dir)) return [];
8690
- const slices = import_node_fs11.default.readdirSync(dir, { withFileTypes: true }).filter((slice) => slice.isDirectory());
9675
+ if (!import_node_fs15.default.existsSync(dir)) return [];
9676
+ const slices = import_node_fs15.default.readdirSync(dir, { withFileTypes: true }).filter((slice) => slice.isDirectory());
8691
9677
  const frameworks = frameworkModules(
8692
9678
  slices.flatMap(
8693
- (slice) => import_node_fs11.default.readdirSync(import_node_path9.default.join(dir, slice.name)).map((entry) => `${slice.name}/${entry}`)
9679
+ (slice) => import_node_fs15.default.readdirSync(import_node_path12.default.join(dir, slice.name)).map((entry) => `${slice.name}/${entry}`)
8694
9680
  )
8695
9681
  );
8696
9682
  if (frameworks.length > 0) return frameworks;
8697
9683
  const modules = /* @__PURE__ */ new Set();
8698
9684
  for (const slice of slices) {
8699
- const headers = import_node_path9.default.join(dir, slice.name, "Headers");
8700
- if (!import_node_fs11.default.existsSync(headers)) continue;
8701
- for (const file of import_node_fs11.default.readdirSync(headers, { recursive: true, encoding: "utf8" })) {
8702
- if (import_node_path9.default.basename(file) !== "module.modulemap") continue;
8703
- const module2 = moduleMapName(import_node_fs11.default.readFileSync(import_node_path9.default.join(headers, file), "utf8"));
9685
+ const headers = import_node_path12.default.join(dir, slice.name, "Headers");
9686
+ if (!import_node_fs15.default.existsSync(headers)) continue;
9687
+ for (const file of import_node_fs15.default.readdirSync(headers, { recursive: true, encoding: "utf8" })) {
9688
+ if (import_node_path12.default.basename(file) !== "module.modulemap") continue;
9689
+ const module2 = moduleMapName(import_node_fs15.default.readFileSync(import_node_path12.default.join(headers, file), "utf8"));
8704
9690
  if (module2) modules.add(module2);
8705
9691
  }
8706
9692
  }
@@ -8712,9 +9698,9 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
8712
9698
 
8713
9699
  // src/swift-coverage/provenance.ts
8714
9700
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
8715
- var import_node_crypto3 = require("node:crypto");
8716
- var import_node_fs12 = require("node:fs");
8717
- var import_node_path10 = require("node:path");
9701
+ var import_node_crypto4 = require("node:crypto");
9702
+ var import_node_fs16 = require("node:fs");
9703
+ var import_node_path13 = require("node:path");
8718
9704
  var SWIFT_COVERAGE_DIGEST_SOURCES = [
8719
9705
  "swift-coverage/indexdump.ts",
8720
9706
  "swift-coverage/indexing.ts",
@@ -8744,11 +9730,11 @@ function swiftCoverageSourceDigests(srcDir) {
8744
9730
  return Object.fromEntries(
8745
9731
  SWIFT_COVERAGE_DIGEST_SOURCES.map((file) => [
8746
9732
  file,
8747
- (0, import_node_crypto3.createHash)("sha256").update((0, import_node_fs12.readFileSync)((0, import_node_path10.join)(srcDir, file))).digest("hex")
9733
+ (0, import_node_crypto4.createHash)("sha256").update((0, import_node_fs16.readFileSync)((0, import_node_path13.join)(srcDir, file))).digest("hex")
8748
9734
  ])
8749
9735
  );
8750
9736
  }
8751
- var swiftCoverageProvenance = typeof define_SWIFT_COVERAGE_SOURCE_DIGESTS_default === "object" ? define_SWIFT_COVERAGE_SOURCE_DIGESTS_default : swiftCoverageSourceDigests((0, import_node_path10.join)(__sootsim_import_meta_dirname, ".."));
9737
+ var swiftCoverageProvenance = typeof define_SWIFT_COVERAGE_SOURCE_DIGESTS_default === "object" ? define_SWIFT_COVERAGE_SOURCE_DIGESTS_default : swiftCoverageSourceDigests((0, import_node_path13.join)(__sootsim_import_meta_dirname, ".."));
8752
9738
 
8753
9739
  // src/swift-coverage/xcode-asset-symbols.ts
8754
9740
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -8934,8 +9920,8 @@ var assetSymbolSettingKeys = [
8934
9920
 
8935
9921
  // src/swift-package-manifest.ts
8936
9922
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
8937
- var import_node_child_process5 = require("node:child_process");
8938
- var import_node_path13 = __toESM(require("node:path"), 1);
9923
+ var import_node_child_process8 = require("node:child_process");
9924
+ var import_node_path16 = __toESM(require("node:path"), 1);
8939
9925
  var import_node_util5 = require("node:util");
8940
9926
  init_home_paths();
8941
9927
 
@@ -8971,12 +9957,12 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
8971
9957
 
8972
9958
  // src/swift-toolchain.ts
8973
9959
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
8974
- var import_node_fs13 = __toESM(require("node:fs"), 1);
8975
- var import_node_path11 = __toESM(require("node:path"), 1);
9960
+ var import_node_fs17 = __toESM(require("node:fs"), 1);
9961
+ var import_node_path14 = __toESM(require("node:path"), 1);
8976
9962
  function peachsimPackageRoot() {
8977
9963
  let dir = __sootsim_import_meta_dirname;
8978
- while (!import_node_fs13.default.existsSync(import_node_path11.default.join(dir, "package.json")) && dir !== import_node_path11.default.dirname(dir))
8979
- dir = import_node_path11.default.dirname(dir);
9964
+ while (!import_node_fs17.default.existsSync(import_node_path14.default.join(dir, "package.json")) && dir !== import_node_path14.default.dirname(dir))
9965
+ dir = import_node_path14.default.dirname(dir);
8980
9966
  return dir;
8981
9967
  }
8982
9968
  var SWIFT_HOST_COMPILER_RELEASE = "swift-6.4.0-RELEASE-custom-81b2c791c27276bf";
@@ -9205,7 +10191,7 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
9205
10191
 
9206
10192
  // src/swift-objc-standin.ts
9207
10193
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
9208
- var import_node_crypto4 = require("node:crypto");
10194
+ var import_node_crypto5 = require("node:crypto");
9209
10195
  init_is_record();
9210
10196
 
9211
10197
  // src/swift-interface-bodies.ts
@@ -9213,10 +10199,10 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
9213
10199
 
9214
10200
  // src/swift-objc-sdk.ts
9215
10201
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
9216
- var import_node_path12 = __toESM(require("node:path"), 1);
10202
+ var import_node_path15 = __toESM(require("node:path"), 1);
9217
10203
  var IOS_SDK_TARGET = "arm64-apple-ios16.0-simulator";
9218
10204
  var OVERLAY_PATH = /^usr\/lib\/swift\/([^/]+)\.swiftmodule\/arm64-apple-ios-simulator\.swiftinterface$/;
9219
- var tree = typeof __PEACH_BUNDLED_IOS_SDK__ === "undefined" ? readIosSdkTree(import_node_path12.default.join(peachsimPackageRoot(), "sdk", "ios")) : Object.entries(__PEACH_BUNDLED_IOS_SDK__).sort(([a], [b]) => a < b ? -1 : 1);
10205
+ var tree = typeof __PEACH_BUNDLED_IOS_SDK__ === "undefined" ? readIosSdkTree(import_node_path15.default.join(peachsimPackageRoot(), "sdk", "ios")) : Object.entries(__PEACH_BUNDLED_IOS_SDK__).sort(([a], [b]) => a < b ? -1 : 1);
9220
10206
  var IOS_SDK_HEADERS = {};
9221
10207
  var IOS_SDK_OVERLAYS = {};
9222
10208
  for (const [file, text2] of tree) {
@@ -9251,7 +10237,7 @@ var NATIVE_GRAPH_INPUTS = {
9251
10237
  compiler: "Apple Swift version 6.4 (swiftlang-6.4.0.34.1 clang-2100.3.34.1)",
9252
10238
  target: IOS_SDK_TARGET
9253
10239
  };
9254
- var NATIVE_GRAPH_ID = (0, import_node_crypto4.createHash)("sha256").update(JSON.stringify(NATIVE_GRAPH_INPUTS)).digest("hex");
10240
+ var NATIVE_GRAPH_ID = (0, import_node_crypto5.createHash)("sha256").update(JSON.stringify(NATIVE_GRAPH_INPUTS)).digest("hex");
9255
10241
 
9256
10242
  // src/swift-shared-sdk.ts
9257
10243
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -9502,9 +10488,9 @@ var WASM_OPTIMIZE_IDENTITY = `wasm-opt ${import_wasm_opt.BINARYEN_VERSION} -Oz $
9502
10488
 
9503
10489
  // src/swift-icu.ts
9504
10490
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
9505
- var import_node_child_process4 = require("node:child_process");
10491
+ var import_node_child_process7 = require("node:child_process");
9506
10492
  var import_node_util4 = require("node:util");
9507
- var import_node_zlib = require("node:zlib");
10493
+ var import_node_zlib2 = require("node:zlib");
9508
10494
 
9509
10495
  // ../sootsim-swift/src/icuData.ts
9510
10496
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -9518,10 +10504,10 @@ var VERSION = 1;
9518
10504
  var SWIFT_ICU_PACKED = `picu${VERSION}`;
9519
10505
 
9520
10506
  // src/swift-icu.ts
9521
- var run4 = (0, import_node_util4.promisify)(import_node_child_process4.execFile);
9522
- var deflate = (0, import_node_util4.promisify)(import_node_zlib.gzip);
9523
- var compressBrotli = (0, import_node_util4.promisify)(import_node_zlib.brotliCompress);
9524
- var inflateGzip = (0, import_node_util4.promisify)(import_node_zlib.gunzip);
10507
+ var run4 = (0, import_node_util4.promisify)(import_node_child_process7.execFile);
10508
+ var deflate = (0, import_node_util4.promisify)(import_node_zlib2.gzip);
10509
+ var compressBrotli = (0, import_node_util4.promisify)(import_node_zlib2.brotliCompress);
10510
+ var inflateGzip = (0, import_node_util4.promisify)(import_node_zlib2.gunzip);
9525
10511
 
9526
10512
  // src/swift-link-roots.ts
9527
10513
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -9624,7 +10610,7 @@ var FOUNDATION_IMPLICIT_MODULES = [
9624
10610
  var FOUNDATION_IMPLICIT_FLAGS = FOUNDATION_IMPLICIT_MODULES.map(
9625
10611
  (module2) => `, "-Xfrontend", "-import-module", "-Xfrontend", "${module2}"`
9626
10612
  ).join("");
9627
- var compilerSourceDigest = true ? "4fa3e84f8c3b585bc8e864c92f0682e6f02757d455de1ce784f0d40ba9df875a" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
10613
+ var compilerSourceDigest = true ? "4646bbe2e0cd2e48e498f51fd3d0d5ea29ecd5e6163fdf3afe8d64d4368022d7" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
9628
10614
  var CORE_FOUNDATION_HANDLE_IMPORTS = [
9629
10615
  "CFAllocator",
9630
10616
  "CFArray",
@@ -9674,12 +10660,12 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
9674
10660
  init_is_record();
9675
10661
 
9676
10662
  // src/swift-package-manifest.ts
9677
- var cacheDir3 = import_node_path13.default.join(cacheDir(), "swift-manifests");
9678
- var execFileAsync = (0, import_node_util5.promisify)(import_node_child_process5.execFile);
10663
+ var cacheDir3 = import_node_path16.default.join(cacheDir(), "swift-manifests");
10664
+ var execFileAsync = (0, import_node_util5.promisify)(import_node_child_process8.execFile);
9679
10665
 
9680
10666
  // src/xcode-json-project.ts
9681
10667
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
9682
- var import_node_path14 = __toESM(require("node:path"), 1);
10668
+ var import_node_path17 = __toESM(require("node:path"), 1);
9683
10669
  var import_json52 = __toESM(require_lib(), 1);
9684
10670
  var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
9685
10671
  var text = (value) => typeof value === "string" ? value : void 0;
@@ -9737,7 +10723,7 @@ var PHASE_ISA = {
9737
10723
  function readXcodeJsonProject(xcodeproj, source) {
9738
10724
  const json = import_json52.default.parse(source);
9739
10725
  if (!isJsonObject(json)) throw new Error(`${xcodeproj}/project.xcproj is not an object`);
9740
- const projectDir = import_node_path14.default.dirname(xcodeproj);
10726
+ const projectDir = import_node_path17.default.dirname(xcodeproj);
9741
10727
  const objects = {};
9742
10728
  let next = 0;
9743
10729
  const add = (entry, id) => {
@@ -9750,7 +10736,7 @@ function readXcodeJsonProject(xcodeproj, source) {
9750
10736
  const base = /^<([A-Z]+)>\/(.*)$/.exec(raw);
9751
10737
  if (base) {
9752
10738
  if (base[1] === "PROJECT")
9753
- return { sourceTree: "<absolute>", path: import_node_path14.default.join(projectDir, base[2]) };
10739
+ return { sourceTree: "<absolute>", path: import_node_path17.default.join(projectDir, base[2]) };
9754
10740
  if (base[1] === "PRODUCTS")
9755
10741
  return { sourceTree: "BUILT_PRODUCTS_DIR", path: base[2] };
9756
10742
  return null;
@@ -9758,7 +10744,7 @@ function readXcodeJsonProject(xcodeproj, source) {
9758
10744
  const unescaped = raw.replaceAll("\\<", "<");
9759
10745
  if (unescaped.startsWith("/")) return { sourceTree: "<absolute>", path: unescaped };
9760
10746
  if (unescaped.startsWith("~")) return null;
9761
- return groupDir === null ? null : { sourceTree: "<absolute>", path: import_node_path14.default.join(groupDir, unescaped) };
10747
+ return groupDir === null ? null : { sourceTree: "<absolute>", path: import_node_path17.default.join(groupDir, unescaped) };
9762
10748
  };
9763
10749
  const memberships = [];
9764
10750
  const folders = [];
@@ -9769,7 +10755,7 @@ function readXcodeJsonProject(xcodeproj, source) {
9769
10755
  const kind = text(entry.kind) ?? "file-reference";
9770
10756
  const raw = text(entry.path) ?? "";
9771
10757
  const located = raw === "" ? null : locate(raw, parent.dir);
9772
- const name2 = text(entry.name) ?? import_node_path14.default.basename(raw);
10758
+ const name2 = text(entry.name) ?? import_node_path17.default.basename(raw);
9773
10759
  const node = { id: "", name: name2, dir: null, parent, children: [] };
9774
10760
  if (kind === "group" || kind === "variant-group" || kind === "version-group") {
9775
10761
  node.dir = raw === "" ? parent.dir : located?.sourceTree === "<absolute>" ? located.path : null;
@@ -9890,7 +10876,7 @@ function readXcodeJsonProject(xcodeproj, source) {
9890
10876
  if (!isObject(entry)) continue;
9891
10877
  const repository = text(entry.repository);
9892
10878
  const local = text(entry.path);
9893
- const name2 = local !== void 0 ? import_node_path14.default.basename(import_node_path14.default.resolve(import_node_path14.default.dirname(xcodeproj), local)) : import_node_path14.default.basename(repository ?? "").replace(/\.git$/, "");
10879
+ const name2 = local !== void 0 ? import_node_path17.default.basename(import_node_path17.default.resolve(import_node_path17.default.dirname(xcodeproj), local)) : import_node_path17.default.basename(repository ?? "").replace(/\.git$/, "");
9894
10880
  const id = text(entry.kind) === "local" && local !== void 0 ? add({ isa: "XCLocalSwiftPackageReference", relativePath: local }) : add({
9895
10881
  isa: "XCRemoteSwiftPackageReference",
9896
10882
  repositoryURL: repository ?? "",
@@ -10110,28 +11096,28 @@ var CONDITIONS = {
10110
11096
  variant: "normal"
10111
11097
  };
10112
11098
  function walkFiles(dir) {
10113
- if (!import_node_fs14.default.existsSync(dir)) return [];
11099
+ if (!import_node_fs18.default.existsSync(dir)) return [];
10114
11100
  const out = [];
10115
- for (const entry of import_node_fs14.default.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
11101
+ for (const entry of import_node_fs18.default.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
10116
11102
  if (entry.name.startsWith(".")) continue;
10117
- const full = import_node_path15.default.join(dir, entry.name);
11103
+ const full = import_node_path18.default.join(dir, entry.name);
10118
11104
  if (entry.isDirectory()) out.push(...walkFiles(full));
10119
11105
  else if (entry.isFile()) out.push(full);
10120
11106
  }
10121
11107
  return out;
10122
11108
  }
10123
- var isDirectory = (dir) => import_node_fs14.default.existsSync(dir) && import_node_fs14.default.statSync(dir).isDirectory();
11109
+ var isDirectory = (dir) => import_node_fs18.default.existsSync(dir) && import_node_fs18.default.statSync(dir).isDirectory();
10124
11110
  function readXcconfig(file, read) {
10125
- if (read.includes(file) || !import_node_fs14.default.existsSync(file)) return {};
11111
+ if (read.includes(file) || !import_node_fs18.default.existsSync(file)) return {};
10126
11112
  read.push(file);
10127
11113
  const settings = {};
10128
- for (const raw of import_node_fs14.default.readFileSync(file, "utf8").split("\n")) {
11114
+ for (const raw of import_node_fs18.default.readFileSync(file, "utf8").split("\n")) {
10129
11115
  const line = raw.replace(/\/\/.*$/, "").trim();
10130
11116
  const include = /^#include\??\s+"([^"]+)"/.exec(line);
10131
11117
  if (include) {
10132
11118
  Object.assign(
10133
11119
  settings,
10134
- readXcconfig(import_node_path15.default.resolve(import_node_path15.default.dirname(file), include[1]), read)
11120
+ readXcconfig(import_node_path18.default.resolve(import_node_path18.default.dirname(file), include[1]), read)
10135
11121
  );
10136
11122
  continue;
10137
11123
  }
@@ -10181,22 +11167,22 @@ function decodeXml(text2) {
10181
11167
  return text2.replaceAll("&quot;", '"').replaceAll("&apos;", "'").replaceAll("&lt;", "<").replaceAll("&gt;", ">").replaceAll("&amp;", "&");
10182
11168
  }
10183
11169
  function workspaceReferences(workspace) {
10184
- const data = import_node_path15.default.join(workspace, "contents.xcworkspacedata");
10185
- if (!import_node_fs14.default.existsSync(data))
11170
+ const data = import_node_path18.default.join(workspace, "contents.xcworkspacedata");
11171
+ if (!import_node_fs18.default.existsSync(data))
10186
11172
  throw new Error(`${workspace} has no contents.xcworkspacedata`);
10187
- const container = import_node_path15.default.dirname(workspace);
11173
+ const container = import_node_path18.default.dirname(workspace);
10188
11174
  const locate = (location, base) => {
10189
11175
  const colon = location.indexOf(":");
10190
11176
  const kind = location.slice(0, colon);
10191
11177
  const rest = location.slice(colon + 1);
10192
- if (kind === "group") return import_node_path15.default.resolve(base, rest);
10193
- if (kind === "container" || kind === "self") return import_node_path15.default.resolve(container, rest);
10194
- if (kind === "absolute") return import_node_path15.default.resolve(rest);
10195
- throw new Error(`${import_node_path15.default.basename(workspace)} has an unsupported location ${location}`);
11178
+ if (kind === "group") return import_node_path18.default.resolve(base, rest);
11179
+ if (kind === "container" || kind === "self") return import_node_path18.default.resolve(container, rest);
11180
+ if (kind === "absolute") return import_node_path18.default.resolve(rest);
11181
+ throw new Error(`${import_node_path18.default.basename(workspace)} has an unsupported location ${location}`);
10196
11182
  };
10197
11183
  const groups = [container];
10198
11184
  const references = [];
10199
- for (const [, closing, tag, attributes, selfClosing] of import_node_fs14.default.readFileSync(data, "utf8").matchAll(/<(\/?)(Group|FileRef)\b([^>]*?)(\/?)>/g)) {
11185
+ for (const [, closing, tag, attributes, selfClosing] of import_node_fs18.default.readFileSync(data, "utf8").matchAll(/<(\/?)(Group|FileRef)\b([^>]*?)(\/?)>/g)) {
10200
11186
  if (closing) {
10201
11187
  if (tag === "Group") groups.pop();
10202
11188
  continue;
@@ -10247,8 +11233,8 @@ function remotePackageRequirements(projects) {
10247
11233
  var loaded = /* @__PURE__ */ new Map();
10248
11234
  function xcodeProjectFile(xcodeproj) {
10249
11235
  for (const name2 of ["project.pbxproj", "project.xcproj"]) {
10250
- const file = import_node_path15.default.join(xcodeproj, name2);
10251
- if (import_node_fs14.default.existsSync(file)) return file;
11236
+ const file = import_node_path18.default.join(xcodeproj, name2);
11237
+ if (import_node_fs18.default.existsSync(file)) return file;
10252
11238
  }
10253
11239
  return null;
10254
11240
  }
@@ -10256,8 +11242,8 @@ function loadProject(xcodeproj) {
10256
11242
  const projectFile = xcodeProjectFile(xcodeproj);
10257
11243
  if (!projectFile)
10258
11244
  throw new Error(`${xcodeproj} has no project.pbxproj or project.xcproj`);
10259
- const source = import_node_fs14.default.readFileSync(projectFile, "utf8");
10260
- const digest = (0, import_node_crypto5.createHash)("sha256").update(source).digest("hex");
11245
+ const source = import_node_fs18.default.readFileSync(projectFile, "utf8");
11246
+ const digest = (0, import_node_crypto6.createHash)("sha256").update(source).digest("hex");
10261
11247
  const cached = loaded.get(projectFile);
10262
11248
  if (cached?.digest === digest) return cached.project;
10263
11249
  const root = projectFile.endsWith(".xcproj") ? readXcodeJsonProject(xcodeproj, source) : parseOpenStepPlist(source);
@@ -10273,10 +11259,10 @@ function loadProject(xcodeproj) {
10273
11259
  if (!project || project.isa !== "PBXProject") {
10274
11260
  throw new Error(`${projectFile} has no PBXProject root`);
10275
11261
  }
10276
- const projectDir = import_node_fs14.default.realpathSync.native(
10277
- import_node_path15.default.resolve(import_node_path15.default.dirname(xcodeproj), str(project.projectDirPath) ?? "")
11262
+ const projectDir = import_node_fs18.default.realpathSync.native(
11263
+ import_node_path18.default.resolve(import_node_path18.default.dirname(xcodeproj), str(project.projectDirPath) ?? "")
10278
11264
  );
10279
- const resolvePath = xcodePathResolver(objects, projectDir, import_node_path15.default.join);
11265
+ const resolvePath = xcodePathResolver(objects, projectDir, import_node_path18.default.join);
10280
11266
  const result = {
10281
11267
  xcodeproj,
10282
11268
  projectFile,
@@ -10313,8 +11299,8 @@ function targetSettings(ref, configuration, builtins, options = {}, overrides =
10313
11299
  const relative3 = str(config.baseConfigurationReferenceRelativePath);
10314
11300
  const own = isDict(config.buildSettings) ? config.buildSettings : {};
10315
11301
  const directory = anchor ? project.resolvePath(anchor) : null;
10316
- const baseFile = base ? project.resolvePath(base) : directory && relative3 ? import_node_path15.default.resolve(directory, relative3) : null;
10317
- if (options.requireSources !== false && (base || anchor || relative3) && (!baseFile || !import_node_fs14.default.existsSync(baseFile)))
11302
+ const baseFile = base ? project.resolvePath(base) : directory && relative3 ? import_node_path18.default.resolve(directory, relative3) : null;
11303
+ if (options.requireSources !== false && (base || anchor || relative3) && (!baseFile || !import_node_fs18.default.existsSync(baseFile)))
10318
11304
  throw new Error(
10319
11305
  `Unable to open base configuration reference file '${baseFile ?? base ?? relative3 ?? anchor}'`
10320
11306
  );
@@ -10360,7 +11346,7 @@ function targetSettings(ref, configuration, builtins, options = {}, overrides =
10360
11346
  const derivedSettings = {
10361
11347
  DEVELOPER_DIR: () => options.environment?.DEVELOPER_DIR ?? process.env.DEVELOPER_DIR ?? (developerDir ??= process.platform === "darwin" ? (
10362
11348
  // runner-toolchain-platform: darwin
10363
- (0, import_node_child_process6.execFileSync)("xcode-select", ["-p"], {
11349
+ (0, import_node_child_process9.execFileSync)("xcode-select", ["-p"], {
10364
11350
  encoding: "utf8",
10365
11351
  stdio: ["ignore", "pipe", "pipe"]
10366
11352
  }).trim()
@@ -10412,26 +11398,26 @@ function scriptCommand(shell, script) {
10412
11398
  return [executable, ...args, "-c", script];
10413
11399
  }
10414
11400
  function expandSearchPath(directory, rules2) {
10415
- if (import_node_path15.default.basename(directory) !== "**") return [directory];
11401
+ if (import_node_path18.default.basename(directory) !== "**") return [directory];
10416
11402
  const expanded = [];
10417
11403
  const seen = /* @__PURE__ */ new Set();
10418
- const queue = [import_node_path15.default.dirname(directory)];
11404
+ const queue = [import_node_path18.default.dirname(directory)];
10419
11405
  for (let at = 0; at < queue.length; at++) {
10420
11406
  const current = queue[at];
10421
11407
  let real;
10422
11408
  try {
10423
- real = import_node_fs14.default.realpathSync.native(current);
11409
+ real = import_node_fs18.default.realpathSync.native(current);
10424
11410
  } catch {
10425
11411
  continue;
10426
11412
  }
10427
- if (!import_node_fs14.default.statSync(real).isDirectory() || seen.has(real)) continue;
11413
+ if (!import_node_fs18.default.statSync(real).isDirectory() || seen.has(real)) continue;
10428
11414
  seen.add(real);
10429
11415
  expanded.push(current);
10430
- for (const entry of import_node_fs14.default.readdirSync(real, { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
11416
+ for (const entry of import_node_fs18.default.readdirSync(real, { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
10431
11417
  if (entry.isSymbolicLink() ? !rules2.followLinks : !entry.isDirectory()) continue;
10432
11418
  if (rules2.excluded.some((pattern) => pattern.test(entry.name)) && !rules2.included.some((pattern) => pattern.test(entry.name)))
10433
11419
  continue;
10434
- queue.push(import_node_path15.default.join(current, entry.name));
11420
+ queue.push(import_node_path18.default.join(current, entry.name));
10435
11421
  }
10436
11422
  }
10437
11423
  return expanded;
@@ -10502,7 +11488,7 @@ function shellAssetCatalogs(script, settings, projectDir) {
10502
11488
  for (const token of tokens) {
10503
11489
  if (token.startsWith("-")) break;
10504
11490
  const file = resolve4(token);
10505
- if (file?.endsWith(".xcassets")) catalogs.push(import_node_path15.default.resolve(projectDir, file));
11491
+ if (file?.endsWith(".xcassets")) catalogs.push(import_node_path18.default.resolve(projectDir, file));
10506
11492
  }
10507
11493
  }
10508
11494
  return catalogs;
@@ -10547,14 +11533,14 @@ function shellCopies(script, settings, projectDir) {
10547
11533
  if (operands.length !== 2 || operands.some((operand) => operand.startsWith("-")))
10548
11534
  return [];
10549
11535
  copies.push({
10550
- from: import_node_path15.default.resolve(projectDir, operands[0]),
10551
- to: import_node_path15.default.resolve(projectDir, operands[1])
11536
+ from: import_node_path18.default.resolve(projectDir, operands[0]),
11537
+ to: import_node_path18.default.resolve(projectDir, operands[1])
10552
11538
  });
10553
11539
  }
10554
11540
  return copies;
10555
11541
  }
10556
11542
  function fileListEntries(file, absolute) {
10557
- return import_node_fs14.default.readFileSync(file, "utf8").split(/\r?\n/).map((line) => line.trim()).filter((line) => line !== "" && !line.startsWith("#")).map(absolute);
11543
+ return import_node_fs18.default.readFileSync(file, "utf8").split(/\r?\n/).map((line) => line.trim()).filter((line) => line !== "" && !line.startsWith("#")).map(absolute);
10558
11544
  }
10559
11545
  function targetMembers(ref, settings, options, settingKeys, projectInputs) {
10560
11546
  const { project, target, id: targetId } = ref;
@@ -10567,7 +11553,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
10567
11553
  const copiedFiles = [];
10568
11554
  let generatedInfoPlist = false;
10569
11555
  const declaredInfoPlist = settings("INFOPLIST_FILE");
10570
- const infoPlistOutput = declaredInfoPlist ? import_node_path15.default.resolve(project.projectDir, declaredInfoPlist) : null;
11556
+ const infoPlistOutput = declaredInfoPlist ? import_node_path18.default.resolve(project.projectDir, declaredInfoPlist) : null;
10571
11557
  const isPreparedOutput = (file) => file === infoPlistOutput || options.requireSources !== false && file.endsWith(".swift");
10572
11558
  for (const phaseId of list(target.buildPhases)) {
10573
11559
  const phase = project.object(phaseId);
@@ -10582,7 +11568,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
10582
11568
  copiedFiles.push(
10583
11569
  ...shellCopies(str(phase.shellScript) ?? "", settings, project.projectDir)
10584
11570
  );
10585
- const absolute = (raw) => import_node_path15.default.resolve(project.projectDir, expand(raw, settings));
11571
+ const absolute = (raw) => import_node_path18.default.resolve(project.projectDir, expand(raw, settings));
10586
11572
  const inputs = list(phase.inputPaths).map(absolute);
10587
11573
  const outputs = list(phase.outputPaths).map(absolute);
10588
11574
  const fileLists = /* @__PURE__ */ new Map();
@@ -10591,7 +11577,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
10591
11577
  kind === "INPUT" ? phase.inputFileListPaths : phase.outputFileListPaths
10592
11578
  ).map((raw) => {
10593
11579
  const file = absolute(raw);
10594
- if (!import_node_fs14.default.existsSync(file)) {
11580
+ if (!import_node_fs18.default.existsSync(file)) {
10595
11581
  return { file, entries: [] };
10596
11582
  }
10597
11583
  return { file, entries: fileListEntries(file, absolute) };
@@ -10612,7 +11598,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
10612
11598
  ...fileLists.get("OUTPUT").map((item) => item.file)
10613
11599
  ];
10614
11600
  if (allOutputs.some((file) => file.endsWith(".swift") || file === infoPlistOutput)) {
10615
- for (const file of inputFiles) if (import_node_fs14.default.existsSync(file)) projectInputs.add(file);
11601
+ for (const file of inputFiles) if (import_node_fs18.default.existsSync(file)) projectInputs.add(file);
10616
11602
  }
10617
11603
  if (options.prepareGeneratedSources === true && allOutputs.some(isPreparedOutput)) {
10618
11604
  const configuration = settings("CONFIGURATION");
@@ -10625,10 +11611,10 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
10625
11611
  false
10626
11612
  ))
10627
11613
  continue;
10628
- const phaseDir = import_node_path15.default.join(settings("TARGET_TEMP_DIR"), `Script-${phaseId}`);
11614
+ const phaseDir = import_node_path18.default.join(settings("TARGET_TEMP_DIR"), `Script-${phaseId}`);
10629
11615
  for (const lists of fileLists.values())
10630
11616
  for (const { file } of lists)
10631
- if (!import_node_fs14.default.existsSync(file))
11617
+ if (!import_node_fs18.default.existsSync(file))
10632
11618
  throw new Error(
10633
11619
  `${targetName}: Run Script "${script}" missing file list ${file}`
10634
11620
  );
@@ -10647,25 +11633,25 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
10647
11633
  const lists = fileLists.get(kind);
10648
11634
  env[`SCRIPT_${kind}_FILE_LIST_COUNT`] = String(lists.length);
10649
11635
  lists.forEach((_item, index) => {
10650
- env[`SCRIPT_${kind}_FILE_LIST_${index}`] = import_node_path15.default.join(
11636
+ env[`SCRIPT_${kind}_FILE_LIST_${index}`] = import_node_path18.default.join(
10651
11637
  phaseDir,
10652
11638
  `${kind}-${index}.xcfilelist`
10653
11639
  );
10654
11640
  });
10655
11641
  }
10656
- const signature = (0, import_node_crypto5.createHash)("sha256").update(
11642
+ const signature = (0, import_node_crypto6.createHash)("sha256").update(
10657
11643
  JSON.stringify([phase, [...settingKeys].map((key2) => [key2, settings(key2)])])
10658
11644
  );
10659
11645
  for (const file of inputFiles) {
10660
11646
  signature.update(file);
10661
- if (import_node_fs14.default.existsSync(file)) {
10662
- const stat = import_node_fs14.default.statSync(file);
11647
+ if (import_node_fs18.default.existsSync(file)) {
11648
+ const stat = import_node_fs18.default.statSync(file);
10663
11649
  signature.update(`${stat.mtimeMs}:${stat.ctimeMs}:${stat.size}`);
10664
11650
  } else signature.update("missing");
10665
11651
  }
10666
11652
  const stamp = signature.digest("hex");
10667
11653
  const key = `${project.projectFile}:${targetId}:${phaseId}:${settings("CONFIGURATION")}`;
10668
- if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) => import_node_fs14.default.existsSync(file))) {
11654
+ if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) => import_node_fs18.default.existsSync(file))) {
10669
11655
  preparedXcodePhase(
10670
11656
  project.projectFile,
10671
11657
  targetId,
@@ -10676,14 +11662,14 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
10676
11662
  );
10677
11663
  continue;
10678
11664
  }
10679
- import_node_fs14.default.mkdirSync(phaseDir, { recursive: true });
10680
- import_node_fs14.default.mkdirSync(settings("BUILT_PRODUCTS_DIR"), { recursive: true });
10681
- import_node_fs14.default.mkdirSync(settings("DERIVED_FILE_DIR"), { recursive: true });
11665
+ import_node_fs18.default.mkdirSync(phaseDir, { recursive: true });
11666
+ import_node_fs18.default.mkdirSync(settings("BUILT_PRODUCTS_DIR"), { recursive: true });
11667
+ import_node_fs18.default.mkdirSync(settings("DERIVED_FILE_DIR"), { recursive: true });
10682
11668
  for (const output2 of allOutputs)
10683
- import_node_fs14.default.mkdirSync(import_node_path15.default.dirname(output2), { recursive: true });
11669
+ import_node_fs18.default.mkdirSync(import_node_path18.default.dirname(output2), { recursive: true });
10684
11670
  for (const [kind, lists] of fileLists)
10685
11671
  lists.forEach((item, index) => {
10686
- import_node_fs14.default.writeFileSync(
11672
+ import_node_fs18.default.writeFileSync(
10687
11673
  env[`SCRIPT_${kind}_FILE_LIST_${index}`],
10688
11674
  `${item.entries.join("\n")}
10689
11675
  `
@@ -10694,7 +11680,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
10694
11680
  str(phase.shellPath) ?? "/bin/sh",
10695
11681
  str(phase.shellScript) ?? ""
10696
11682
  );
10697
- (0, import_node_child_process6.execFileSync)(shell, args, {
11683
+ (0, import_node_child_process9.execFileSync)(shell, args, {
10698
11684
  cwd: project.projectDir,
10699
11685
  env,
10700
11686
  stdio: ["ignore", "pipe", "pipe"],
@@ -10710,7 +11696,7 @@ ${output2}`
10710
11696
  );
10711
11697
  }
10712
11698
  const missing2 = allOutputs.filter(
10713
- (file) => file === infoPlistOutput && !import_node_fs14.default.existsSync(file)
11699
+ (file) => file === infoPlistOutput && !import_node_fs18.default.existsSync(file)
10714
11700
  );
10715
11701
  if (missing2.length > 0)
10716
11702
  throw new Error(
@@ -10729,9 +11715,9 @@ ${output2}`
10729
11715
  }
10730
11716
  project.visitMembers(
10731
11717
  targetId,
10732
- xcodePathResolver(project.objects, project.projectDir, import_node_path15.default.join, settings),
10733
- (file) => isDirectory(file) ? walkFiles(file) : import_node_fs14.default.existsSync(file) ? [file] : [],
10734
- import_node_path15.default.join,
11718
+ xcodePathResolver(project.objects, project.projectDir, import_node_path18.default.join, settings),
11719
+ (file) => isDirectory(file) ? walkFiles(file) : import_node_fs18.default.existsSync(file) ? [file] : [],
11720
+ import_node_path18.default.join,
10735
11721
  (file, kind) => {
10736
11722
  if (kind === "header") {
10737
11723
  headers.add(file);
@@ -10741,9 +11727,9 @@ ${output2}`
10741
11727
  resources.add(file);
10742
11728
  return;
10743
11729
  }
10744
- if (!import_node_fs14.default.existsSync(file)) {
11730
+ if (!import_node_fs18.default.existsSync(file)) {
10745
11731
  if (options.requireSources === false) return;
10746
- const script = scriptForOutput.get(import_node_path15.default.normalize(file));
11732
+ const script = scriptForOutput.get(import_node_path18.default.normalize(file));
10747
11733
  throw new Error(
10748
11734
  script ? `${targetName}: missing generated source ${file} (Run Script "${script}" declares it in outputPaths; run the script or check in its output)` : `${targetName}: missing source ${file}`
10749
11735
  );
@@ -10754,17 +11740,17 @@ ${output2}`
10754
11740
  );
10755
11741
  if (options.prepareGeneratedSources && options.requireSources !== false) {
10756
11742
  const interfaceFiles = [...resources].filter(
10757
- (file) => /\.(storyboard|xib)$/.test(file) && !file.split(import_node_path15.default.sep).some((part) => part.endsWith(".bundle"))
11743
+ (file) => /\.(storyboard|xib)$/.test(file) && !file.split(import_node_path18.default.sep).some((part) => part.endsWith(".bundle"))
10758
11744
  );
10759
11745
  if (process.platform !== "darwin") {
10760
11746
  let launchName = settings("INFOPLIST_KEY_UILaunchStoryboardName");
10761
- if (!launchName && infoPlistOutput && import_node_fs14.default.existsSync(infoPlistOutput)) {
10762
- const info = import_plist2.default.parse(import_node_fs14.default.readFileSync(infoPlistOutput, "utf8"));
11747
+ if (!launchName && infoPlistOutput && import_node_fs18.default.existsSync(infoPlistOutput)) {
11748
+ const info = import_plist2.default.parse(import_node_fs18.default.readFileSync(infoPlistOutput, "utf8"));
10763
11749
  const declared = isRecord(info) ? info.UILaunchStoryboardName : void 0;
10764
11750
  if (typeof declared === "string") launchName = expand(declared, settings);
10765
11751
  }
10766
11752
  const runtimeInterfaceFiles = interfaceFiles.filter(
10767
- (file) => import_node_path15.default.basename(file, import_node_path15.default.extname(file)) !== launchName
11753
+ (file) => import_node_path18.default.basename(file, import_node_path18.default.extname(file)) !== launchName
10768
11754
  );
10769
11755
  if (runtimeInterfaceFiles.length > 0)
10770
11756
  throw new Error(
@@ -10775,19 +11761,19 @@ ${output2}`
10775
11761
  }
10776
11762
  const interfaceOutputs = /* @__PURE__ */ new Set();
10777
11763
  for (const file of interfaceFiles) {
10778
- const localization = file.split(import_node_path15.default.sep).findLast((part) => part.endsWith(".lproj")) ?? "";
11764
+ const localization = file.split(import_node_path18.default.sep).findLast((part) => part.endsWith(".lproj")) ?? "";
10779
11765
  const extension = file.endsWith(".storyboard") ? ".storyboardc" : ".nib";
10780
- const output2 = import_node_path15.default.join(
11766
+ const output2 = import_node_path18.default.join(
10781
11767
  settings("DERIVED_FILE_DIR"),
10782
11768
  "InterfaceBuilder",
10783
11769
  localization,
10784
- import_node_path15.default.basename(file, import_node_path15.default.extname(file)) + extension
11770
+ import_node_path18.default.basename(file, import_node_path18.default.extname(file)) + extension
10785
11771
  );
10786
11772
  if (interfaceOutputs.has(output2))
10787
11773
  throw new Error(`${targetName}: duplicate Interface Builder output ${output2}`);
10788
11774
  interfaceOutputs.add(output2);
10789
- import_node_fs14.default.rmSync(output2, { recursive: true, force: true });
10790
- import_node_fs14.default.mkdirSync(import_node_path15.default.dirname(output2), { recursive: true });
11775
+ import_node_fs18.default.rmSync(output2, { recursive: true, force: true });
11776
+ import_node_fs18.default.mkdirSync(import_node_path18.default.dirname(output2), { recursive: true });
10791
11777
  const args = [
10792
11778
  "ibtool",
10793
11779
  "--compile",
@@ -10801,7 +11787,7 @@ ${output2}`
10801
11787
  const families = settings("TARGETED_DEVICE_FAMILY").split(",").map((value) => value.trim());
10802
11788
  if (families.includes("1")) args.push("--target-device", "iphone");
10803
11789
  if (families.includes("2")) args.push("--target-device", "ipad");
10804
- (0, import_node_child_process6.execFileSync)("xcrun", args, {
11790
+ (0, import_node_child_process9.execFileSync)("xcrun", args, {
10805
11791
  cwd: project.projectDir,
10806
11792
  stdio: ["ignore", "pipe", "pipe"],
10807
11793
  timeout: runScriptTimeoutMs
@@ -10821,13 +11807,13 @@ ${output2}`
10821
11807
  for (const definition of definitions) {
10822
11808
  const configuredLanguage = settings("INTENTS_CODEGEN_LANGUAGE");
10823
11809
  const language = !configuredLanguage || configuredLanguage === "Automatic" ? sources.size > 0 ? "Swift" : "Objective-C" : configuredLanguage;
10824
- const output2 = import_node_path15.default.join(
11810
+ const output2 = import_node_path18.default.join(
10825
11811
  settings("DERIVED_FILE_DIR"),
10826
11812
  "IntentDefinitionGenerated",
10827
- import_node_path15.default.basename(definition, ".intentdefinition")
11813
+ import_node_path18.default.basename(definition, ".intentdefinition")
10828
11814
  );
10829
- import_node_fs14.default.rmSync(output2, { recursive: true, force: true });
10830
- import_node_fs14.default.mkdirSync(output2, { recursive: true });
11815
+ import_node_fs18.default.rmSync(output2, { recursive: true, force: true });
11816
+ import_node_fs18.default.mkdirSync(output2, { recursive: true });
10831
11817
  const args = [
10832
11818
  "intentbuilderc",
10833
11819
  "generate",
@@ -10846,7 +11832,7 @@ ${output2}`
10846
11832
  args.push("-swiftVersion", settings("SWIFT_VERSION") || "5.0");
10847
11833
  if (settings("DEFINES_MODULE") === "YES")
10848
11834
  args.push("-moduleName", settings("PRODUCT_MODULE_NAME"));
10849
- (0, import_node_child_process6.execFileSync)("xcrun", args, {
11835
+ (0, import_node_child_process9.execFileSync)("xcrun", args, {
10850
11836
  cwd: project.projectDir,
10851
11837
  stdio: ["ignore", "pipe", "pipe"],
10852
11838
  timeout: runScriptTimeoutMs
@@ -10871,37 +11857,37 @@ ${output2}`
10871
11857
  function commonAncestor(dirs) {
10872
11858
  let common = dirs[0];
10873
11859
  for (const dir of dirs) {
10874
- while (common !== import_node_path15.default.dirname(common) && import_node_path15.default.relative(common, dir).startsWith(".."))
10875
- common = import_node_path15.default.dirname(common);
11860
+ while (common !== import_node_path18.default.dirname(common) && import_node_path18.default.relative(common, dir).startsWith(".."))
11861
+ common = import_node_path18.default.dirname(common);
10876
11862
  }
10877
11863
  return common;
10878
11864
  }
10879
- var isPodsProject = (xcodeproj) => import_node_path15.default.basename(xcodeproj) === "Pods.xcodeproj" && import_node_path15.default.basename(import_node_path15.default.dirname(xcodeproj)) === "Pods";
11865
+ var isPodsProject = (xcodeproj) => import_node_path18.default.basename(xcodeproj) === "Pods.xcodeproj" && import_node_path18.default.basename(import_node_path18.default.dirname(xcodeproj)) === "Pods";
10880
11866
  function installedPodsSandbox(pods) {
10881
- const podfileLock = import_node_path15.default.join(import_node_path15.default.dirname(pods), "Podfile.lock");
10882
- const manifestLock = import_node_path15.default.join(pods, "Manifest.lock");
10883
- if (!import_node_fs14.default.existsSync(podfileLock))
11867
+ const podfileLock = import_node_path18.default.join(import_node_path18.default.dirname(pods), "Podfile.lock");
11868
+ const manifestLock = import_node_path18.default.join(pods, "Manifest.lock");
11869
+ if (!import_node_fs18.default.existsSync(podfileLock))
10884
11870
  throw new Error(
10885
- `${pods} has no ${podfileLock}: run \`pod install\` in ${import_node_path15.default.dirname(pods)}`
11871
+ `${pods} has no ${podfileLock}: run \`pod install\` in ${import_node_path18.default.dirname(pods)}`
10886
11872
  );
10887
- if (!import_node_fs14.default.existsSync(manifestLock) || !import_node_fs14.default.readFileSync(manifestLock).equals(import_node_fs14.default.readFileSync(podfileLock)))
11873
+ if (!import_node_fs18.default.existsSync(manifestLock) || !import_node_fs18.default.readFileSync(manifestLock).equals(import_node_fs18.default.readFileSync(podfileLock)))
10888
11874
  throw new Error(
10889
- `The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${import_node_path15.default.dirname(pods)}`
11875
+ `The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${import_node_path18.default.dirname(pods)}`
10890
11876
  );
10891
11877
  const specChecksums = {};
10892
- const lines = import_node_fs14.default.readFileSync(manifestLock, "utf8").split("\n");
11878
+ const lines = import_node_fs18.default.readFileSync(manifestLock, "utf8").split("\n");
10893
11879
  const start = lines.indexOf("SPEC CHECKSUMS:");
10894
11880
  for (const line of start === -1 ? [] : lines.slice(start + 1)) {
10895
11881
  const entry = /^ {2}"?([^":]+)"?: ([0-9a-f]+)$/.exec(line);
10896
11882
  if (!entry) break;
10897
11883
  specChecksums[entry[1]] = entry[2];
10898
11884
  }
10899
- const specs = import_node_path15.default.join(pods, "Local Podspecs");
11885
+ const specs = import_node_path18.default.join(pods, "Local Podspecs");
10900
11886
  return {
10901
11887
  podfileLock,
10902
11888
  manifestLock,
10903
11889
  specChecksums,
10904
- localPodspecs: isDirectory(specs) ? import_node_fs14.default.readdirSync(specs).filter((name2) => name2.endsWith(".podspec.json")).sort().map((name2) => import_node_path15.default.join(specs, name2)) : []
11890
+ localPodspecs: isDirectory(specs) ? import_node_fs18.default.readdirSync(specs).filter((name2) => name2.endsWith(".podspec.json")).sort().map((name2) => import_node_path18.default.join(specs, name2)) : []
10905
11891
  };
10906
11892
  }
10907
11893
  function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
@@ -10913,14 +11899,14 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
10913
11899
  if (!xcodeProjectFile(xcodeproj)) {
10914
11900
  if (installedPods && isPodsProject(xcodeproj))
10915
11901
  throw new Error(
10916
- `${import_node_path15.default.basename(xcodeprojOrWorkspace)} builds ${xcodeproj}, which is not installed: run \`pod install\` in ${import_node_path15.default.dirname(import_node_path15.default.dirname(xcodeproj))}`
11902
+ `${import_node_path18.default.basename(xcodeprojOrWorkspace)} builds ${xcodeproj}, which is not installed: run \`pod install\` in ${import_node_path18.default.dirname(import_node_path18.default.dirname(xcodeproj))}`
10917
11903
  );
10918
11904
  return;
10919
11905
  }
10920
- const key = import_node_fs14.default.realpathSync.native(xcodeproj);
10921
- if (projectAt.has(key) || !installedPods && key.split(import_node_path15.default.sep).includes("Pods"))
11906
+ const key = import_node_fs18.default.realpathSync.native(xcodeproj);
11907
+ if (projectAt.has(key) || !installedPods && key.split(import_node_path18.default.sep).includes("Pods"))
10922
11908
  return;
10923
- if (isPodsProject(key)) cocoapods = installedPodsSandbox(import_node_path15.default.dirname(key));
11909
+ if (isPodsProject(key)) cocoapods = installedPodsSandbox(import_node_path18.default.dirname(key));
10924
11910
  const project = loadProject(key);
10925
11911
  projectAt.set(key, project);
10926
11912
  projects.push(project);
@@ -10936,12 +11922,12 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
10936
11922
  for (const reference of listed)
10937
11923
  if (reference.endsWith(".xcodeproj")) addProject(reference);
10938
11924
  if (projects.length === 0) {
10939
- throw new Error(`${import_node_path15.default.basename(xcodeprojOrWorkspace)} lists no Xcode project`);
11925
+ throw new Error(`${import_node_path18.default.basename(xcodeprojOrWorkspace)} lists no Xcode project`);
10940
11926
  }
10941
- const podfile = import_node_path15.default.join(import_node_path15.default.dirname(xcodeprojOrWorkspace), "Podfile");
10942
- if (installedPods && !cocoapods && import_node_fs14.default.existsSync(podfile))
11927
+ const podfile = import_node_path18.default.join(import_node_path18.default.dirname(xcodeprojOrWorkspace), "Podfile");
11928
+ if (installedPods && !cocoapods && import_node_fs18.default.existsSync(podfile))
10943
11929
  throw new Error(
10944
- `${podfile} is not installed into ${import_node_path15.default.basename(xcodeprojOrWorkspace)}: run \`pod install\` in ${import_node_path15.default.dirname(podfile)} and open the workspace it writes`
11930
+ `${podfile} is not installed into ${import_node_path18.default.basename(xcodeprojOrWorkspace)}: run \`pod install\` in ${import_node_path18.default.dirname(podfile)} and open the workspace it writes`
10945
11931
  );
10946
11932
  return { listed, projects, projectAt, cocoapods };
10947
11933
  }
@@ -10979,7 +11965,7 @@ function listXcodeAppTargets(xcodeprojOrWorkspace, options = {}) {
10979
11965
  return workspaceProjects(xcodeprojOrWorkspace).projects.flatMap(projectTargets).filter((ref) => isIosAppTarget(ref, options)).map((ref) => str(ref.target.name) ?? ref.id);
10980
11966
  }
10981
11967
  function defaultXcodeAppTarget(xcodeproj) {
10982
- const project = loadProject(import_node_fs14.default.realpathSync.native(xcodeproj));
11968
+ const project = loadProject(import_node_fs18.default.realpathSync.native(xcodeproj));
10983
11969
  for (const [id, target] of Object.entries(project.objects)) {
10984
11970
  if (!isDict(target) || target.isa !== "PBXNativeTarget") continue;
10985
11971
  if (isIosAppTarget({ project, id, target }, { requireSources: false }))
@@ -10987,30 +11973,30 @@ function defaultXcodeAppTarget(xcodeproj) {
10987
11973
  }
10988
11974
  }
10989
11975
  function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
10990
- const container = import_node_fs14.default.realpathSync.native(xcodeprojOrWorkspace);
11976
+ const container = import_node_fs18.default.realpathSync.native(xcodeprojOrWorkspace);
10991
11977
  const { projects } = workspaceProjects(container);
10992
11978
  const containers = [
10993
11979
  .../* @__PURE__ */ new Set([container, ...projects.map((project2) => project2.xcodeproj)])
10994
11980
  ];
10995
11981
  const found = containers.flatMap(
10996
11982
  (dir) => [
10997
- import_node_path15.default.join(dir, "xcshareddata"),
10998
- ...isDirectory(import_node_path15.default.join(dir, "xcuserdata")) ? import_node_fs14.default.readdirSync(import_node_path15.default.join(dir, "xcuserdata")).sort().map((user) => import_node_path15.default.join(dir, "xcuserdata", user)) : []
11983
+ import_node_path18.default.join(dir, "xcshareddata"),
11984
+ ...isDirectory(import_node_path18.default.join(dir, "xcuserdata")) ? import_node_fs18.default.readdirSync(import_node_path18.default.join(dir, "xcuserdata")).sort().map((user) => import_node_path18.default.join(dir, "xcuserdata", user)) : []
10999
11985
  ].map((data) => ({
11000
11986
  dir,
11001
- file: import_node_path15.default.join(data, "xcschemes", `${scheme}.xcscheme`)
11987
+ file: import_node_path18.default.join(data, "xcschemes", `${scheme}.xcscheme`)
11002
11988
  }))
11003
- ).find((candidate) => import_node_fs14.default.existsSync(candidate.file));
11989
+ ).find((candidate) => import_node_fs18.default.existsSync(candidate.file));
11004
11990
  if (!found) {
11005
11991
  const known = containers.flatMap(
11006
- (dir) => import_node_fs14.default.existsSync(import_node_path15.default.join(dir, "xcshareddata", "xcschemes")) ? import_node_fs14.default.readdirSync(import_node_path15.default.join(dir, "xcshareddata", "xcschemes")).filter((name3) => name3.endsWith(".xcscheme")).map((name3) => name3.slice(0, -".xcscheme".length)).sort() : []
11992
+ (dir) => import_node_fs18.default.existsSync(import_node_path18.default.join(dir, "xcshareddata", "xcschemes")) ? import_node_fs18.default.readdirSync(import_node_path18.default.join(dir, "xcshareddata", "xcschemes")).filter((name3) => name3.endsWith(".xcscheme")).map((name3) => name3.slice(0, -".xcscheme".length)).sort() : []
11007
11993
  );
11008
11994
  throw new Error(
11009
- `${import_node_path15.default.basename(container)} has no scheme ${scheme}; it shares ${known.join(", ") || "none"}`
11995
+ `${import_node_path18.default.basename(container)} has no scheme ${scheme}; it shares ${known.join(", ") || "none"}`
11010
11996
  );
11011
11997
  }
11012
11998
  const launch = /<LaunchAction\b([^>]*)>([\s\S]*?)<\/LaunchAction>/.exec(
11013
- import_node_fs14.default.readFileSync(found.file, "utf8")
11999
+ import_node_fs18.default.readFileSync(found.file, "utf8")
11014
12000
  );
11015
12001
  const attribute = (text2, name3) => {
11016
12002
  const value = new RegExp(`\\b${name3}\\s*=\\s*"([^"]*)"`).exec(text2)?.[1];
@@ -11023,12 +12009,12 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
11023
12009
  if (!configuration || !blueprint || !referenced?.startsWith("container:")) {
11024
12010
  throw new Error(`scheme ${scheme} runs no application target`);
11025
12011
  }
11026
- const projectPath = import_node_path15.default.resolve(
11027
- import_node_path15.default.dirname(found.dir),
12012
+ const projectPath = import_node_path18.default.resolve(
12013
+ import_node_path18.default.dirname(found.dir),
11028
12014
  referenced.slice("container:".length)
11029
12015
  );
11030
12016
  const project = projects.find(
11031
- (candidate) => import_node_fs14.default.existsSync(projectPath) && candidate.xcodeproj === import_node_fs14.default.realpathSync.native(projectPath)
12017
+ (candidate) => import_node_fs18.default.existsSync(projectPath) && candidate.xcodeproj === import_node_fs18.default.realpathSync.native(projectPath)
11032
12018
  );
11033
12019
  const target = project && projectTargets(project).find((ref) => ref.id === blueprint);
11034
12020
  const name2 = target && str(target.target.name);
@@ -11048,26 +12034,26 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
11048
12034
  var NativeAppTargetSelectionError = class extends Error {
11049
12035
  };
11050
12036
  function selectIosAppTarget(projectRoot, iosTarget) {
11051
- const nested = import_node_path15.default.join(projectRoot, "ios");
11052
- const iosRoot = import_node_fs14.default.existsSync(nested) ? nested : projectRoot;
11053
- const entries = import_node_fs14.default.readdirSync(iosRoot, { withFileTypes: true });
12037
+ const nested = import_node_path18.default.join(projectRoot, "ios");
12038
+ const iosRoot = import_node_fs18.default.existsSync(nested) ? nested : projectRoot;
12039
+ const entries = import_node_fs18.default.readdirSync(iosRoot, { withFileTypes: true });
11054
12040
  const projects = (entries.some((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj")) ? entries.filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj")).map((entry) => ({
11055
- xcodeproj: import_node_path15.default.join(iosRoot, entry.name),
12041
+ xcodeproj: import_node_path18.default.join(iosRoot, entry.name),
11056
12042
  workspace: null
11057
12043
  })) : entries.filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcworkspace")).flatMap((entry) => {
11058
- const workspace = import_node_path15.default.join(iosRoot, entry.name);
12044
+ const workspace = import_node_path18.default.join(iosRoot, entry.name);
11059
12045
  return workspaceReferences(workspace).map((xcodeproj2) => ({
11060
12046
  xcodeproj: xcodeproj2,
11061
12047
  workspace
11062
12048
  }));
11063
12049
  }).filter(
11064
- ({ xcodeproj: xcodeproj2 }) => xcodeproj2.endsWith(".xcodeproj") && !xcodeproj2.split(import_node_path15.default.sep).includes("Pods") && import_node_fs14.default.existsSync(xcodeproj2)
12050
+ ({ xcodeproj: xcodeproj2 }) => xcodeproj2.endsWith(".xcodeproj") && !xcodeproj2.split(import_node_path18.default.sep).includes("Pods") && import_node_fs18.default.existsSync(xcodeproj2)
11065
12051
  ).filter(
11066
12052
  ({ xcodeproj: xcodeproj2 }) => listXcodeAppTargets(xcodeproj2, { requireSources: false }).length > 0
11067
12053
  )).map(({ xcodeproj: xcodeproj2, workspace }) => ({
11068
12054
  xcodeproj: xcodeproj2,
11069
12055
  workspace,
11070
- name: import_node_path15.default.basename(xcodeproj2)
12056
+ name: import_node_path18.default.basename(xcodeproj2)
11071
12057
  }));
11072
12058
  if (projects.length === 0) return null;
11073
12059
  if (projects.length > 1 && !iosTarget) {
@@ -11106,13 +12092,13 @@ function selectIosAppTarget(projectRoot, iosTarget) {
11106
12092
  if (!target) throw new Error("native app identity has no iOS application target");
11107
12093
  if (!iosTarget) {
11108
12094
  const workspace = xcodeproj.replace(/\.xcodeproj$/, ".xcworkspace");
11109
- const container = import_node_fs14.default.existsSync(workspace) ? workspace : xcodeproj;
12095
+ const container = import_node_fs18.default.existsSync(workspace) ? workspace : xcodeproj;
11110
12096
  const hasScheme = [container, xcodeproj].some((dir) => {
11111
- if (import_node_fs14.default.existsSync(import_node_path15.default.join(dir, "xcshareddata", "xcschemes", `${target}.xcscheme`)))
12097
+ if (import_node_fs18.default.existsSync(import_node_path18.default.join(dir, "xcshareddata", "xcschemes", `${target}.xcscheme`)))
11112
12098
  return true;
11113
- const users = import_node_path15.default.join(dir, "xcuserdata");
11114
- return import_node_fs14.default.existsSync(users) && import_node_fs14.default.readdirSync(users).some(
11115
- (user) => import_node_fs14.default.existsSync(import_node_path15.default.join(users, user, "xcschemes", `${target}.xcscheme`))
12099
+ const users = import_node_path18.default.join(dir, "xcuserdata");
12100
+ return import_node_fs18.default.existsSync(users) && import_node_fs18.default.readdirSync(users).some(
12101
+ (user) => import_node_fs18.default.existsSync(import_node_path18.default.join(users, user, "xcschemes", `${target}.xcscheme`))
11116
12102
  );
11117
12103
  });
11118
12104
  if (hasScheme) target = readXcodeScheme(container, target).target;
@@ -11123,8 +12109,8 @@ function selectIosAppTarget(projectRoot, iosTarget) {
11123
12109
  );
11124
12110
  return { xcodeproj, target, workspace: project.workspace };
11125
12111
  }
11126
- var workspaceResolvedFile = (xcodeprojOrWorkspace) => import_node_path15.default.join(
11127
- xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : import_node_path15.default.join(xcodeprojOrWorkspace, "project.xcworkspace"),
12112
+ var workspaceResolvedFile = (xcodeprojOrWorkspace) => import_node_path18.default.join(
12113
+ xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : import_node_path18.default.join(xcodeprojOrWorkspace, "project.xcworkspace"),
11128
12114
  "xcshareddata",
11129
12115
  "swiftpm",
11130
12116
  "Package.resolved"
@@ -11139,7 +12125,7 @@ var SwiftPackageResolutionRequired = class extends Error {
11139
12125
  }
11140
12126
  };
11141
12127
  function readXcodeAppTarget(input, targetName, configurationName, options = {}) {
11142
- const xcodeprojOrWorkspace = import_node_fs14.default.realpathSync.native(input);
12128
+ const xcodeprojOrWorkspace = import_node_fs18.default.realpathSync.native(input);
11143
12129
  const workspace = xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : null;
11144
12130
  const { listed, projects, projectAt, cocoapods } = workspaceProjects(
11145
12131
  xcodeprojOrWorkspace,
@@ -11148,7 +12134,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11148
12134
  const allTargets = projects.flatMap(projectTargets);
11149
12135
  const appTargets = allTargets.filter((ref) => isIosAppTarget(ref, options));
11150
12136
  const appTargetNames = appTargets.map((ref) => str(ref.target.name) ?? ref.id);
11151
- const container = import_node_path15.default.basename(xcodeprojOrWorkspace);
12137
+ const container = import_node_path18.default.basename(xcodeprojOrWorkspace);
11152
12138
  const named = targetName ? appTargets.filter((ref) => ref.target.name === targetName) : appTargets;
11153
12139
  if (named.length !== 1) {
11154
12140
  if (appTargets.length === 0)
@@ -11169,15 +12155,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11169
12155
  for (const ref of allTargets) {
11170
12156
  const product = ref.project.object(str(ref.target.productReference));
11171
12157
  const file = str(product?.path);
11172
- if (file && !byProduct.has(import_node_path15.default.basename(file)))
11173
- byProduct.set(import_node_path15.default.basename(file), ref);
12158
+ if (file && !byProduct.has(import_node_path18.default.basename(file)))
12159
+ byProduct.set(import_node_path18.default.basename(file), ref);
11174
12160
  }
11175
12161
  const proxied = (project, proxyId) => {
11176
12162
  const proxy = project.object(proxyId);
11177
12163
  if (proxy?.isa !== "PBXContainerItemProxy") return void 0;
11178
12164
  const portal = str(proxy.containerPortal);
11179
12165
  const portalPath = project.resolvePath(portal ?? "");
11180
- const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath && import_node_fs14.default.existsSync(portalPath) ? projectAt.get(import_node_fs14.default.realpathSync.native(portalPath)) : void 0;
12166
+ const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath && import_node_fs18.default.existsSync(portalPath) ? projectAt.get(import_node_fs18.default.realpathSync.native(portalPath)) : void 0;
11181
12167
  const remote = str(proxy.remoteGlobalIDString);
11182
12168
  if (!owner || !remote) return void 0;
11183
12169
  return projectTargets(owner).find(
@@ -11194,7 +12180,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11194
12180
  const buildFile = project.object(buildFileId);
11195
12181
  if (!buildFile || !xcodeBuildFileBuildsForIos(buildFile)) continue;
11196
12182
  const file = project.object(str(buildFile.fileRef));
11197
- const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(import_node_path15.default.basename(str(file.path) ?? "")) : void 0;
12183
+ const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(import_node_path18.default.basename(str(file.path) ?? "")) : void 0;
11198
12184
  if (resolved)
11199
12185
  found.push({
11200
12186
  target: resolved,
@@ -11278,8 +12264,8 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11278
12264
  ref.project.visitMembers(
11279
12265
  ref.id,
11280
12266
  ref.project.resolvePath,
11281
- (file) => isDirectory(file) ? walkFiles(file) : import_node_fs14.default.existsSync(file) ? [file] : [],
11282
- import_node_path15.default.join,
12267
+ (file) => isDirectory(file) ? walkFiles(file) : import_node_fs18.default.existsSync(file) ? [file] : [],
12268
+ import_node_path18.default.join,
11283
12269
  (file, kind) => {
11284
12270
  if (kind === "header") found.push(file);
11285
12271
  }
@@ -11295,12 +12281,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11295
12281
  for (const ref of projectTargets(project)) {
11296
12282
  const product = productName(ref);
11297
12283
  for (const { file, visibility } of headerPhase(ref)) {
11298
- const name2 = import_node_path15.default.basename(file);
12284
+ const name2 = import_node_path18.default.basename(file);
11299
12285
  if (!entries.has(name2))
11300
12286
  entries.set(name2, visibility !== "Project" ? `${product}/${name2}` : file);
11301
12287
  }
11302
12288
  for (const file of synchronizedHeaders(ref)) {
11303
- const name2 = import_node_path15.default.basename(file);
12289
+ const name2 = import_node_path18.default.basename(file);
11304
12290
  if (!entries.has(name2)) entries.set(name2, file);
11305
12291
  }
11306
12292
  }
@@ -11310,7 +12296,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11310
12296
  if (folder === null) continue;
11311
12297
  for (const file of walkFiles(folder)) {
11312
12298
  if (!HEADER_FILE.test(file)) continue;
11313
- const name2 = import_node_path15.default.basename(file);
12299
+ const name2 = import_node_path18.default.basename(file);
11314
12300
  if (!entries.has(name2)) entries.set(name2, file);
11315
12301
  }
11316
12302
  }
@@ -11318,18 +12304,18 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11318
12304
  for (const id of Object.keys(project.objects)) {
11319
12305
  if (project.object(id)?.isa !== "PBXFileReference") continue;
11320
12306
  const file = project.resolvePath(id);
11321
- if (file && HEADER_FILE.test(file) && !entries.has(import_node_path15.default.basename(file)))
11322
- entries.set(import_node_path15.default.basename(file), file);
12307
+ if (file && HEADER_FILE.test(file) && !entries.has(import_node_path18.default.basename(file)))
12308
+ entries.set(import_node_path18.default.basename(file), file);
11323
12309
  }
11324
12310
  const map2 = [...entries];
11325
12311
  projectHeaderMaps.set(project, map2);
11326
12312
  return map2;
11327
12313
  };
11328
12314
  const xcconfigs = /* @__PURE__ */ new Set();
11329
- const buildDir = (project) => import_node_path15.default.join(project.projectDir, ".build/peach-xcode/Build");
12315
+ const buildDir = (project) => import_node_path18.default.join(project.projectDir, ".build/peach-xcode/Build");
11330
12316
  const workspaceBuild = {
11331
- SYMROOT: import_node_path15.default.join(buildDir(app.project), "Products"),
11332
- OBJROOT: import_node_path15.default.join(buildDir(app.project), "Intermediates.noindex")
12317
+ SYMROOT: import_node_path18.default.join(buildDir(app.project), "Products"),
12318
+ OBJROOT: import_node_path18.default.join(buildDir(app.project), "Intermediates.noindex")
11333
12319
  };
11334
12320
  const moduleTarget = (ref) => {
11335
12321
  const name2 = str(ref.target.name) ?? ref.id;
@@ -11344,16 +12330,16 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11344
12330
  TARGET_NAME: name2,
11345
12331
  TARGETNAME: "$(TARGET_NAME)",
11346
12332
  PROJECT: "$(PROJECT_NAME)",
11347
- PROJECT_NAME: import_node_path15.default.basename(ref.project.xcodeproj, ".xcodeproj"),
12333
+ PROJECT_NAME: import_node_path18.default.basename(ref.project.xcodeproj, ".xcodeproj"),
11348
12334
  PROJECT_CLASS_PREFIX: isDict(ref.project.project.attributes) ? str(ref.project.project.attributes.CLASSPREFIX) ?? "" : "",
11349
12335
  PROJECT_FILE_PATH: ref.project.xcodeproj,
11350
12336
  SRCROOT: ref.project.projectDir,
11351
12337
  SOURCE_ROOT: ref.project.projectDir,
11352
12338
  PROJECT_DIR: ref.project.projectDir,
11353
- SYMROOT: import_node_path15.default.join(buildDir(ref.project), "Products"),
12339
+ SYMROOT: import_node_path18.default.join(buildDir(ref.project), "Products"),
11354
12340
  BUILD_DIR: "$(SYMROOT)",
11355
12341
  BUILD_ROOT: "$(SYMROOT)",
11356
- OBJROOT: import_node_path15.default.join(buildDir(ref.project), "Intermediates.noindex"),
12342
+ OBJROOT: import_node_path18.default.join(buildDir(ref.project), "Intermediates.noindex"),
11357
12343
  CONFIGURATION_BUILD_DIR: "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)",
11358
12344
  BUILT_PRODUCTS_DIR: "$(CONFIGURATION_BUILD_DIR)",
11359
12345
  TARGET_BUILD_DIR: "$(CONFIGURATION_BUILD_DIR)",
@@ -11395,7 +12381,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11395
12381
  xcconfigs
11396
12382
  );
11397
12383
  const searchRules = recursiveSearchRules(settings2);
11398
- const absolute = (file) => import_node_path15.default.resolve(ref.project.projectDir, file);
12384
+ const absolute = (file) => import_node_path18.default.resolve(ref.project.projectDir, file);
11399
12385
  const framework = FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "");
11400
12386
  const product = settings2("PRODUCT_NAME");
11401
12387
  const moduleName = applyOperator(settings2("PRODUCT_MODULE_NAME"), "c99extidentifier");
@@ -11426,7 +12412,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11426
12412
  `${name2}: Swift compatibility header phase has no Swift producer sources`
11427
12413
  );
11428
12414
  const building = options.prepareGeneratedSources && options.requireSources !== false;
11429
- const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ? import_node_path15.default.join(settings2("DERIVED_FILE_DIR"), `${product}_vers.c`) : null;
12415
+ const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ? import_node_path18.default.join(settings2("DERIVED_FILE_DIR"), `${product}_vers.c`) : null;
11430
12416
  if (versioning) {
11431
12417
  const version = settings2("CURRENT_PROJECT_VERSION");
11432
12418
  const custom = [
@@ -11439,7 +12425,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11439
12425
  ].filter((key) => settings2(key));
11440
12426
  if (custom.length)
11441
12427
  throw new Error(
11442
- `${name2}: Xcode generates ${import_node_path15.default.basename(versioning)} with ${custom.join(", ")}; peach does not model VERSION_INFO_* overrides`
12428
+ `${name2}: Xcode generates ${import_node_path18.default.basename(versioning)} with ${custom.join(", ")}; peach does not model VERSION_INFO_* overrides`
11443
12429
  );
11444
12430
  const symbol = product.replace(/^[^A-Za-z_]/, "_").replace(/[^A-Za-z0-9_]/g, "_");
11445
12431
  const [major, minor] = version.split(".");
@@ -11452,9 +12438,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11452
12438
  ` const double ${symbol}VersionNumber __attribute__ ((used)) = (double)${number2};`,
11453
12439
  ""
11454
12440
  ].join("\n");
11455
- if (!import_node_fs14.default.existsSync(versioning) || import_node_fs14.default.readFileSync(versioning, "utf8") !== unit) {
11456
- import_node_fs14.default.mkdirSync(import_node_path15.default.dirname(versioning), { recursive: true });
11457
- import_node_fs14.default.writeFileSync(versioning, unit);
12441
+ if (!import_node_fs18.default.existsSync(versioning) || import_node_fs18.default.readFileSync(versioning, "utf8") !== unit) {
12442
+ import_node_fs18.default.mkdirSync(import_node_path18.default.dirname(versioning), { recursive: true });
12443
+ import_node_fs18.default.writeFileSync(versioning, unit);
11458
12444
  }
11459
12445
  allSources.push(versioning);
11460
12446
  }
@@ -11473,7 +12459,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11473
12459
  const headerFiles = headerPhase(ref);
11474
12460
  const ownHeaders = /* @__PURE__ */ new Map();
11475
12461
  for (const { file, visibility } of headerFiles) {
11476
- const name3 = import_node_path15.default.basename(file);
12462
+ const name3 = import_node_path18.default.basename(file);
11477
12463
  const published = visibility !== "Project";
11478
12464
  if (!ownHeaders.has(name3))
11479
12465
  ownHeaders.set(name3, published ? `${product}/${name3}` : file);
@@ -11481,7 +12467,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11481
12467
  ownHeaders.set(`${product}/${name3}`, file);
11482
12468
  }
11483
12469
  for (const file of synchronizedHeaders(ref)) {
11484
- const name3 = import_node_path15.default.basename(file);
12470
+ const name3 = import_node_path18.default.basename(file);
11485
12471
  if (ownHeaders.has(name3)) continue;
11486
12472
  ownHeaders.set(name3, file);
11487
12473
  const qualified = `${product}/${name3}`;
@@ -11493,24 +12479,24 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11493
12479
  const otherProduct = productName(other);
11494
12480
  for (const { file, visibility } of headerPhase(other)) {
11495
12481
  if (visibility === "Project") continue;
11496
- const key = `${otherProduct}/${import_node_path15.default.basename(file)}`;
12482
+ const key = `${otherProduct}/${import_node_path18.default.basename(file)}`;
11497
12483
  if (!nonFrameworkHeaders.has(key)) nonFrameworkHeaders.set(key, file);
11498
12484
  }
11499
12485
  }
11500
- const wrapper = import_node_path15.default.join(settings2("BUILT_PRODUCTS_DIR"), `${product}.framework`);
12486
+ const wrapper = import_node_path18.default.join(settings2("BUILT_PRODUCTS_DIR"), `${product}.framework`);
11501
12487
  const moduleMap = (settings2("DEFINES_MODULE") === "YES" || !framework) && settings2("MODULEMAP_FILE") ? absolute(settings2("MODULEMAP_FILE")) : null;
11502
- const frameworkUmbrella = !compatibility && framework && members.sources.length > 0 && moduleMap ? import_node_path15.default.join(import_node_path15.default.dirname(moduleMap), `${moduleName}-umbrella.h`) : null;
11503
- const frameworkCompatibility = frameworkUmbrella && moduleMap && import_node_fs14.default.existsSync(moduleMap) && import_node_fs14.default.existsSync(frameworkUmbrella) ? {
12488
+ const frameworkUmbrella = !compatibility && framework && members.sources.length > 0 && moduleMap ? import_node_path18.default.join(import_node_path18.default.dirname(moduleMap), `${moduleName}-umbrella.h`) : null;
12489
+ const frameworkCompatibility = frameworkUmbrella && moduleMap && import_node_fs18.default.existsSync(moduleMap) && import_node_fs18.default.existsSync(frameworkUmbrella) ? {
11504
12490
  framework: true,
11505
12491
  moduleMap,
11506
12492
  umbrella: frameworkUmbrella,
11507
- outputModuleMap: import_node_path15.default.join(wrapper, "Modules", "module.modulemap"),
11508
- outputUmbrella: import_node_path15.default.join(
12493
+ outputModuleMap: import_node_path18.default.join(wrapper, "Modules", "module.modulemap"),
12494
+ outputUmbrella: import_node_path18.default.join(
11509
12495
  wrapper,
11510
12496
  "Headers",
11511
- import_node_path15.default.basename(frameworkUmbrella)
12497
+ import_node_path18.default.basename(frameworkUmbrella)
11512
12498
  ),
11513
- outputHeader: import_node_path15.default.join(
12499
+ outputHeader: import_node_path18.default.join(
11514
12500
  wrapper,
11515
12501
  "Headers",
11516
12502
  settings2("SWIFT_OBJC_INTERFACE_HEADER_NAME") || `${moduleName}-Swift.h`
@@ -11524,10 +12510,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11524
12510
  outputUmbrella: compatibility.outputUmbrella,
11525
12511
  outputHeader: compatibility.outputHeader
11526
12512
  } : frameworkCompatibility;
11527
- const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap && import_node_path15.default.relative(import_node_path15.default.join(ref.project.projectDir, "Headers", "Public"), moduleMap).split(import_node_path15.default.sep)[0] !== ".." && import_node_fs14.default.existsSync(moduleMap) ? import_node_fs14.default.readdirSync(import_node_path15.default.dirname(moduleMap)).flatMap((entry) => {
12513
+ const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap && import_node_path18.default.relative(import_node_path18.default.join(ref.project.projectDir, "Headers", "Public"), moduleMap).split(import_node_path18.default.sep)[0] !== ".." && import_node_fs18.default.existsSync(moduleMap) ? import_node_fs18.default.readdirSync(import_node_path18.default.dirname(moduleMap)).flatMap((entry) => {
11528
12514
  if (!/\.(h|hh|hpp|hxx|modulemap)$/.test(entry)) return [];
11529
- const file = import_node_path15.default.join(import_node_path15.default.dirname(moduleMap), entry);
11530
- return import_node_fs14.default.existsSync(file) ? [file] : [];
12515
+ const file = import_node_path18.default.join(import_node_path18.default.dirname(moduleMap), entry);
12516
+ return import_node_fs18.default.existsSync(file) ? [file] : [];
11531
12517
  }) : [];
11532
12518
  const fileFlags = {};
11533
12519
  for (const phaseId of list(ref.target.buildPhases)) {
@@ -11602,15 +12588,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11602
12588
  // xcode searches its products' include directory before
11603
12589
  // HEADER_SEARCH_PATHS and the target's derived sources after.
11604
12590
  headerSearchPaths: [
11605
- import_node_path15.default.join(settings2("BUILT_PRODUCTS_DIR"), "include"),
12591
+ import_node_path18.default.join(settings2("BUILT_PRODUCTS_DIR"), "include"),
11606
12592
  ...settingList(settings2("HEADER_SEARCH_PATHS")).flatMap(
11607
12593
  (raw) => expandSearchPath(absolute(raw), searchRules)
11608
12594
  ),
11609
- import_node_path15.default.join(
12595
+ import_node_path18.default.join(
11610
12596
  `${settings2("DERIVED_FILE_DIR")}-normal`,
11611
12597
  settings2("CURRENT_ARCH")
11612
12598
  ),
11613
- import_node_path15.default.join(settings2("DERIVED_FILE_DIR"), settings2("CURRENT_ARCH")),
12599
+ import_node_path18.default.join(settings2("DERIVED_FILE_DIR"), settings2("CURRENT_ARCH")),
11614
12600
  settings2("DERIVED_FILE_DIR")
11615
12601
  ],
11616
12602
  userHeaderSearchPaths: settingList(
@@ -11660,10 +12646,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11660
12646
  ...headerFiles.flatMap(
11661
12647
  ({ file, visibility }) => visibility === "Project" ? [] : [
11662
12648
  [
11663
- import_node_path15.default.join(
12649
+ import_node_path18.default.join(
11664
12650
  wrapper,
11665
12651
  visibility === "Public" ? "Headers" : "PrivateHeaders",
11666
- import_node_path15.default.basename(file)
12652
+ import_node_path18.default.basename(file)
11667
12653
  ),
11668
12654
  file
11669
12655
  ]
@@ -11677,7 +12663,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11677
12663
  return [];
11678
12664
  const destination = expand(
11679
12665
  str(phase.dstPath) ?? "",
11680
- (name3) => name3 === "PUBLIC_HEADERS_FOLDER_PATH" ? import_node_path15.default.join(wrapper, "Headers") : name3 === "PRIVATE_HEADERS_FOLDER_PATH" ? import_node_path15.default.join(wrapper, "PrivateHeaders") : settings2(name3)
12666
+ (name3) => name3 === "PUBLIC_HEADERS_FOLDER_PATH" ? import_node_path18.default.join(wrapper, "Headers") : name3 === "PRIVATE_HEADERS_FOLDER_PATH" ? import_node_path18.default.join(wrapper, "PrivateHeaders") : settings2(name3)
11681
12667
  );
11682
12668
  return list(phase.files).flatMap((id) => {
11683
12669
  const file = ref.project.resolvePath(
@@ -11685,17 +12671,17 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11685
12671
  );
11686
12672
  return file && HEADER_FILE.test(file) ? [
11687
12673
  [
11688
- import_node_path15.default.resolve(
12674
+ import_node_path18.default.resolve(
11689
12675
  settings2("BUILT_PRODUCTS_DIR"),
11690
12676
  destination,
11691
- import_node_path15.default.basename(file)
12677
+ import_node_path18.default.basename(file)
11692
12678
  ),
11693
12679
  file
11694
12680
  ]
11695
12681
  ] : [];
11696
12682
  });
11697
12683
  }),
11698
- ...moduleMap ? [[import_node_path15.default.join(wrapper, "Modules", "module.modulemap"), moduleMap]] : []
12684
+ ...moduleMap ? [[import_node_path18.default.join(wrapper, "Modules", "module.modulemap"), moduleMap]] : []
11699
12685
  ]) : Object.fromEntries([
11700
12686
  ...podHeaders.map((file) => [file, file]),
11701
12687
  ...moduleMap ? [[moduleMap, moduleMap]] : []
@@ -11727,7 +12713,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11727
12713
  const frameworkTargets = selectedTargets.filter((target) => target !== builtTargets.at(-1)).filter(({ ref }) => MODULE_PRODUCTS.has(str(ref.target.productType) ?? "")).map(({ ref, module: module3 }) => ({ ref, framework: module3 }));
11728
12714
  const frameworks = frameworkTargets.map(({ framework }) => framework);
11729
12715
  const podSourceDirs = builtTargets.slice(0, -1).flatMap(
11730
- ({ ref, module: module3 }) => isPodsProject(ref.project.xcodeproj) ? [...module3.allSources, ...module3.objc?.headers ?? []].map((file) => import_node_path15.default.dirname(file)).filter((dir) => import_node_fs14.default.existsSync(dir)) : []
12716
+ ({ ref, module: module3 }) => isPodsProject(ref.project.xcodeproj) ? [...module3.allSources, ...module3.objc?.headers ?? []].map((file) => import_node_path18.default.dirname(file)).filter((dir) => import_node_fs18.default.existsSync(dir)) : []
11731
12717
  );
11732
12718
  const expandValue = (value, settings2) => {
11733
12719
  if (typeof value === "string") return expand(value, settings2);
@@ -11748,7 +12734,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11748
12734
  const phase = owner.ref.project.object(phaseId);
11749
12735
  if (phase?.isa !== "PBXShellScriptBuildPhase" || str(phase.name) !== "[CP] Copy Pods Resources")
11750
12736
  continue;
11751
- const absolute = (raw) => import_node_path15.default.resolve(owner.ref.project.projectDir, expand(raw, owner.settings));
12737
+ const absolute = (raw) => import_node_path18.default.resolve(owner.ref.project.projectDir, expand(raw, owner.settings));
11752
12738
  const entries = (paths) => paths.flatMap((raw) => {
11753
12739
  const file = absolute(raw);
11754
12740
  xcconfigs.add(file);
@@ -11764,7 +12750,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11764
12750
  ].filter((file) => file.endsWith(".bundle"));
11765
12751
  if (inputs.length !== outputs.length)
11766
12752
  throw new Error(`${owner.module.name}: resource bundle copy lists differ`);
11767
- const destinationRoot = import_node_path15.default.join(
12753
+ const destinationRoot = import_node_path18.default.join(
11768
12754
  owner.settings("TARGET_BUILD_DIR"),
11769
12755
  owner.settings("UNLOCALIZED_RESOURCES_FOLDER_PATH")
11770
12756
  );
@@ -11773,24 +12759,24 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11773
12759
  const file = str(
11774
12760
  target.ref.project.object(str(target.ref.target.productReference))?.path
11775
12761
  );
11776
- return file && import_node_path15.default.join(target.settings("TARGET_BUILD_DIR"), file) === input2;
12762
+ return file && import_node_path18.default.join(target.settings("TARGET_BUILD_DIR"), file) === input2;
11777
12763
  });
11778
12764
  if (!product && !isDirectory(input2))
11779
12765
  throw new Error(
11780
12766
  `${owner.module.name}: resource bundle input has no selected producer: ${input2}`
11781
12767
  );
11782
- const destination = import_node_path15.default.relative(destinationRoot, outputs[index]);
11783
- if (destination === ".." || destination.startsWith(`..${import_node_path15.default.sep}`) || import_node_path15.default.isAbsolute(destination) || import_node_path15.default.basename(input2) !== import_node_path15.default.basename(destination))
12768
+ const destination = import_node_path18.default.relative(destinationRoot, outputs[index]);
12769
+ if (destination === ".." || destination.startsWith(`..${import_node_path18.default.sep}`) || import_node_path18.default.isAbsolute(destination) || import_node_path18.default.basename(input2) !== import_node_path18.default.basename(destination))
11784
12770
  throw new Error(
11785
12771
  `${owner.module.name}: invalid resource bundle copy destination`
11786
12772
  );
11787
- const infoFile = product ? import_node_path15.default.resolve(
12773
+ const infoFile = product ? import_node_path18.default.resolve(
11788
12774
  product.ref.project.projectDir,
11789
12775
  product.settings("INFOPLIST_FILE")
11790
12776
  ) : null;
11791
12777
  if (infoFile) xcconfigs.add(infoFile);
11792
12778
  const prefix2 = owner.ref === app ? "" : `Frameworks/${owner.module.moduleName}.framework/`;
11793
- const bundlePath = prefix2 + destination.split(import_node_path15.default.sep).join("/");
12779
+ const bundlePath = prefix2 + destination.split(import_node_path18.default.sep).join("/");
11794
12780
  if (resourceProducts.some((resource) => resource.path === bundlePath))
11795
12781
  throw new Error(
11796
12782
  `${owner.module.name}: duplicate resource bundle destination ${bundlePath}`
@@ -11801,22 +12787,22 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11801
12787
  resources: product.module.resources,
11802
12788
  infoPlist: import_plist2.default.build(
11803
12789
  expandValue(
11804
- import_plist2.default.parse(import_node_fs14.default.readFileSync(infoFile, "utf8")),
12790
+ import_plist2.default.parse(import_node_fs18.default.readFileSync(infoFile, "utf8")),
11805
12791
  product.settings
11806
12792
  )
11807
12793
  )
11808
12794
  } : {
11809
- resources: import_node_fs14.default.readdirSync(input2, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => import_node_path15.default.join(entry.parentPath, entry.name)).sort(),
12795
+ resources: import_node_fs18.default.readdirSync(input2, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => import_node_path18.default.join(entry.parentPath, entry.name)).sort(),
11810
12796
  sourceRoot: input2
11811
12797
  }
11812
12798
  });
11813
12799
  }
11814
12800
  }
11815
12801
  }
11816
- const infoPlistFile = settings("INFOPLIST_FILE") ? import_node_path15.default.resolve(app.project.projectDir, settings("INFOPLIST_FILE")) : null;
11817
- const entitlementsFile = settings("CODE_SIGN_ENTITLEMENTS") ? import_node_path15.default.resolve(app.project.projectDir, settings("CODE_SIGN_ENTITLEMENTS")) : null;
12802
+ const infoPlistFile = settings("INFOPLIST_FILE") ? import_node_path18.default.resolve(app.project.projectDir, settings("INFOPLIST_FILE")) : null;
12803
+ const entitlementsFile = settings("CODE_SIGN_ENTITLEMENTS") ? import_node_path18.default.resolve(app.project.projectDir, settings("CODE_SIGN_ENTITLEMENTS")) : null;
11818
12804
  const infoPlistPending = module2.generatedInfoPlist && !options.prepareGeneratedSources;
11819
- const sourceInfo = infoPlistFile && !infoPlistPending ? import_plist2.default.parse(import_node_fs14.default.readFileSync(infoPlistFile, "utf8")) : {};
12805
+ const sourceInfo = infoPlistFile && !infoPlistPending ? import_plist2.default.parse(import_node_fs18.default.readFileSync(infoPlistFile, "utf8")) : {};
11820
12806
  if (!sourceInfo || typeof sourceInfo !== "object" || Array.isArray(sourceInfo) || sourceInfo instanceof Date || Buffer.isBuffer(sourceInfo)) {
11821
12807
  throw new Error(`${module2.name} Info.plist must contain a dictionary`);
11822
12808
  }
@@ -11840,7 +12826,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11840
12826
  }
11841
12827
  const bundleIdentifier = settings("PRODUCT_BUNDLE_IDENTIFIER") || (typeof info.CFBundleIdentifier === "string" ? info.CFBundleIdentifier : "");
11842
12828
  const keychainAccessGroups = entitlementsFile ? readKeychainAccessGroups(
11843
- import_plist2.default.parse(import_node_fs14.default.readFileSync(entitlementsFile, "utf8")),
12829
+ import_plist2.default.parse(import_node_fs18.default.readFileSync(entitlementsFile, "utf8")),
11844
12830
  (value) => expand(value, (key) => {
11845
12831
  if (key === "AppIdentifierPrefix") return "FAKETEAMID.";
11846
12832
  if (key === "TeamIdentifierPrefix") return "";
@@ -11876,7 +12862,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11876
12862
  };
11877
12863
  }
11878
12864
  const localPackageDirs = [
11879
- ...listed.filter((reference) => import_node_fs14.default.existsSync(import_node_path15.default.join(reference, "Package.swift"))),
12865
+ ...listed.filter((reference) => import_node_fs18.default.existsSync(import_node_path18.default.join(reference, "Package.swift"))),
11880
12866
  ...projects.flatMap(
11881
12867
  (project) => Object.entries(project.objects).flatMap(([id, entry]) => {
11882
12868
  if (!isDict(entry)) return [];
@@ -11886,19 +12872,19 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11886
12872
  const packages = [];
11887
12873
  while (pending.length > 0) {
11888
12874
  const dir = pending.pop();
11889
- if (import_node_fs14.default.existsSync(import_node_path15.default.join(dir, "Package.swift"))) {
12875
+ if (import_node_fs18.default.existsSync(import_node_path18.default.join(dir, "Package.swift"))) {
11890
12876
  packages.push(dir);
11891
12877
  continue;
11892
12878
  }
11893
12879
  if (!isDirectory(dir)) continue;
11894
- for (const child of import_node_fs14.default.readdirSync(dir, { withFileTypes: true }))
12880
+ for (const child of import_node_fs18.default.readdirSync(dir, { withFileTypes: true }))
11895
12881
  if (child.isDirectory() && !child.name.startsWith("."))
11896
- pending.push(import_node_path15.default.join(dir, child.name));
12882
+ pending.push(import_node_path18.default.join(dir, child.name));
11897
12883
  }
11898
12884
  return packages;
11899
12885
  }
11900
- const candidate = entry.isa === "XCLocalSwiftPackageReference" ? import_node_path15.default.resolve(project.projectDir, str(entry.relativePath) ?? "") : entry.isa === "PBXFileReference" ? project.resolvePath(id) : null;
11901
- return candidate && import_node_fs14.default.existsSync(import_node_path15.default.join(candidate, "Package.swift")) ? [candidate] : [];
12886
+ const candidate = entry.isa === "XCLocalSwiftPackageReference" ? import_node_path18.default.resolve(project.projectDir, str(entry.relativePath) ?? "") : entry.isa === "PBXFileReference" ? project.resolvePath(id) : null;
12887
+ return candidate && import_node_fs18.default.existsSync(import_node_path18.default.join(candidate, "Package.swift")) ? [candidate] : [];
11902
12888
  })
11903
12889
  )
11904
12890
  ];
@@ -11928,7 +12914,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11928
12914
  if ((flag === "-framework" || flag === "-weak_framework") && name2)
11929
12915
  sdkFrameworks.add(name2);
11930
12916
  });
11931
- const absolute = (raw) => import_node_path15.default.resolve(ref.project.projectDir, expand(raw, settings2));
12917
+ const absolute = (raw) => import_node_path18.default.resolve(ref.project.projectDir, expand(raw, settings2));
11932
12918
  const requested = options.nativeModules;
11933
12919
  const includeBinary = (name2, dir) => {
11934
12920
  if (!requested || nativeTargets.has(ref) || requested.includes(name2) || dir.endsWith(".xcframework") && localSwiftBinaryModules(dir).some((module3) => requested.includes(module3)))
@@ -11940,14 +12926,14 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11940
12926
  for (const directory of expandSearchPath(absolute(raw), searchRules)) {
11941
12927
  if (frameworkSearchDirectories.has(directory)) continue;
11942
12928
  frameworkSearchDirectories.add(directory);
11943
- if (!import_node_fs14.default.statSync(directory, { throwIfNoEntry: false })?.isDirectory() || /\.sdk\/(?:System|Developer)\/Library\/Frameworks\/?$/.test(directory))
12929
+ if (!import_node_fs18.default.statSync(directory, { throwIfNoEntry: false })?.isDirectory() || /\.sdk\/(?:System|Developer)\/Library\/Frameworks\/?$/.test(directory))
11944
12930
  continue;
11945
- for (const entry of import_node_fs14.default.readdirSync(directory, { withFileTypes: true })) {
12931
+ for (const entry of import_node_fs18.default.readdirSync(directory, { withFileTypes: true })) {
11946
12932
  const name2 = /^(.+)\.framework$/.exec(entry.name)?.[1];
11947
12933
  if (!name2 || byProduct.has(entry.name) || searchedFrameworks.has(name2))
11948
12934
  continue;
11949
- const file = import_node_path15.default.join(directory, entry.name);
11950
- if (import_node_fs14.default.statSync(file, { throwIfNoEntry: false })?.isDirectory())
12935
+ const file = import_node_path18.default.join(directory, entry.name);
12936
+ if (import_node_fs18.default.statSync(file, { throwIfNoEntry: false })?.isDirectory())
11951
12937
  searchedFrameworks.set(name2, file);
11952
12938
  }
11953
12939
  }
@@ -11955,9 +12941,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11955
12941
  }
11956
12942
  for (const raw of settingList(settings2("SWIFT_INCLUDE_PATHS"))) {
11957
12943
  const dir = absolute(raw);
11958
- const modulemap = import_node_path15.default.join(dir, "module.modulemap");
11959
- if (!import_node_fs14.default.existsSync(modulemap)) continue;
11960
- const name2 = moduleMapName(import_node_fs14.default.readFileSync(modulemap, "utf8"));
12944
+ const modulemap = import_node_path18.default.join(dir, "module.modulemap");
12945
+ if (!import_node_fs18.default.existsSync(modulemap)) continue;
12946
+ const name2 = moduleMapName(import_node_fs18.default.readFileSync(modulemap, "utf8"));
11961
12947
  if (name2 && !binaryFrameworks.has(name2)) includeBinary(name2, dir);
11962
12948
  }
11963
12949
  for (const phaseId of list(ref.target.buildPhases)) {
@@ -11966,7 +12952,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
11966
12952
  const inputs = list(phase.inputPaths).map(absolute);
11967
12953
  for (const raw of list(phase.inputFileListPaths)) {
11968
12954
  const file = absolute(raw);
11969
- if (!import_node_fs14.default.existsSync(file)) continue;
12955
+ if (!import_node_fs18.default.existsSync(file)) continue;
11970
12956
  xcconfigs.add(file);
11971
12957
  inputs.push(...fileListEntries(file, absolute));
11972
12958
  }
@@ -12031,7 +13017,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
12031
13017
  ...productAttributes.get(dependencyId)?.length ? { attributes: productAttributes.get(dependencyId) } : {},
12032
13018
  source: reference?.isa === "XCRemoteSwiftPackageReference" ? { kind: "remote", url: str(reference.repositoryURL) ?? "" } : reference?.isa === "XCLocalSwiftPackageReference" ? {
12033
13019
  kind: "local",
12034
- dir: import_node_path15.default.resolve(
13020
+ dir: import_node_path18.default.resolve(
12035
13021
  project.projectDir,
12036
13022
  str(reference.relativePath) ?? ""
12037
13023
  )
@@ -12065,10 +13051,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
12065
13051
  continue;
12066
13052
  }
12067
13053
  if (tree2 === "BUILT_PRODUCTS_DIR" || tree2 === "DEVELOPER_DIR" || // a target in the workspace builds it, so it exists only after that build
12068
- byProduct.has(import_node_path15.default.basename(rawPath)))
13054
+ byProduct.has(import_node_path18.default.basename(rawPath)))
12069
13055
  continue;
12070
13056
  const resolved = fileId ? project.resolvePath(fileId) : null;
12071
- if (fileId && resolved !== null && !import_node_fs14.default.existsSync(resolved))
13057
+ if (fileId && resolved !== null && !import_node_fs18.default.existsSync(resolved))
12072
13058
  throw new Error(
12073
13059
  `${str(target.name) ?? "target"}: linked framework ${name2} (${fileId}) points at missing ${resolved} in ${project.projectFile}`
12074
13060
  );
@@ -12091,7 +13077,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
12091
13077
  ({ product }) => !options.nativeModules || nativeTargets.has(built.ref) || options.nativeModules.includes(product)
12092
13078
  );
12093
13079
  const resolvedFile = workspaceResolvedFile(xcodeprojOrWorkspace);
12094
- let packageResolved = import_node_fs14.default.existsSync(resolvedFile) ? [import_node_fs14.default.realpathSync.native(resolvedFile)] : [...new Set(localPackageDirs.map((dir) => import_node_path15.default.join(dir, "Package.resolved")))].filter((file) => import_node_fs14.default.existsSync(file)).map((file) => import_node_fs14.default.realpathSync.native(file)).sort();
13080
+ let packageResolved = import_node_fs18.default.existsSync(resolvedFile) ? [import_node_fs18.default.realpathSync.native(resolvedFile)] : [...new Set(localPackageDirs.map((dir) => import_node_path18.default.join(dir, "Package.resolved")))].filter((file) => import_node_fs18.default.existsSync(file)).map((file) => import_node_fs18.default.realpathSync.native(file)).sort();
12095
13081
  if (packageResolved.length === 0) {
12096
13082
  const requirements = remotePackageRequirements(projects);
12097
13083
  if (requirements.length > 0) {
@@ -12142,14 +13128,14 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
12142
13128
  } : {},
12143
13129
  rootDir: commonAncestor(
12144
13130
  [
12145
- workspace ? import_node_path15.default.dirname(workspace) : app.project.projectDir,
13131
+ workspace ? import_node_path18.default.dirname(workspace) : app.project.projectDir,
12146
13132
  ...used.map((project) => project.projectDir),
12147
13133
  ...localPackageDirs,
12148
13134
  ...linkedProducts.flatMap(
12149
- ({ source }) => source.kind === "local" && import_node_fs14.default.existsSync(source.dir) ? [source.dir] : []
13135
+ ({ source }) => source.kind === "local" && import_node_fs18.default.existsSync(source.dir) ? [source.dir] : []
12150
13136
  ),
12151
13137
  ...new Set(podSourceDirs)
12152
- ].map((dir) => import_node_fs14.default.realpathSync.native(dir))
13138
+ ].map((dir) => import_node_fs18.default.realpathSync.native(dir))
12153
13139
  ),
12154
13140
  projectFiles: [
12155
13141
  .../* @__PURE__ */ new Set([
@@ -12170,7 +13156,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
12170
13156
  resourceProducts,
12171
13157
  linkedProducts,
12172
13158
  localPackageDirs: [
12173
- ...new Set(localPackageDirs.map((dir) => import_node_fs14.default.realpathSync.native(dir)))
13159
+ ...new Set(localPackageDirs.map((dir) => import_node_fs18.default.realpathSync.native(dir)))
12174
13160
  ].sort(),
12175
13161
  binaryFrameworks: [...binaryFrameworks].map(([name2, file]) => ({ name: name2, path: file })).sort((left, right) => left.name.localeCompare(right.name)),
12176
13162
  sdkFrameworks: [...sdkFrameworks].filter(
@@ -12202,13 +13188,13 @@ const result = JSON.stringify(getConfig(root, { skipSDKVersionRequirement: true
12202
13188
  if (Buffer.byteLength(result) > 1024 * 1024) throw new Error('Expo native configuration exceeds 1 MiB.');
12203
13189
  writeFileSync(process.argv[2], result, { mode: 0o600 });`;
12204
13190
  function hasExpoConfig(projectRoot) {
12205
- const appJsonPath = import_node_path16.default.join(projectRoot, "app.json");
12206
- const appJson = import_node_fs15.default.existsSync(appJsonPath) ? JSON.parse(import_node_fs15.default.readFileSync(appJsonPath, "utf8")) : null;
13191
+ const appJsonPath = import_node_path19.default.join(projectRoot, "app.json");
13192
+ const appJson = import_node_fs19.default.existsSync(appJsonPath) ? JSON.parse(import_node_fs19.default.readFileSync(appJsonPath, "utf8")) : null;
12207
13193
  const staticExpo = isRecord(appJson) && (isRecord(appJson.expo) || [appJson.ios, appJson.android].some(
12208
13194
  (value) => isRecord(value) && typeof value.googleServicesFile === "string"
12209
13195
  ));
12210
13196
  return staticExpo || ["app.config.js", "app.config.ts", "app.config.cjs", "app.config.mjs"].some(
12211
- (name2) => import_node_fs15.default.existsSync(import_node_path16.default.join(projectRoot, name2))
13197
+ (name2) => import_node_fs19.default.existsSync(import_node_path19.default.join(projectRoot, name2))
12212
13198
  );
12213
13199
  }
12214
13200
  function expoConfigArgs(projectRoot, resultPath) {
@@ -12216,7 +13202,7 @@ function expoConfigArgs(projectRoot, resultPath) {
12216
13202
  "--input-type=commonjs",
12217
13203
  "-e",
12218
13204
  EXPO_CONFIG_SCRIPT,
12219
- import_node_path16.default.resolve(projectRoot),
13205
+ import_node_path19.default.resolve(projectRoot),
12220
13206
  resultPath
12221
13207
  ];
12222
13208
  }
@@ -12230,17 +13216,17 @@ function readExpoConfigResult(resultPath, status, signal, stderr) {
12230
13216
  throw new Error(
12231
13217
  stderr || (signal ? `Expo native configuration evaluation was killed by ${signal}.` : "Expo native configuration evaluation failed.")
12232
13218
  );
12233
- const resolved = JSON.parse(import_node_fs15.default.readFileSync(resultPath, "utf8"));
13219
+ const resolved = JSON.parse(import_node_fs19.default.readFileSync(resultPath, "utf8"));
12234
13220
  if (!isRecord(resolved)) throw new Error("Expo native configuration is unavailable.");
12235
13221
  return resolved;
12236
13222
  }
12237
- var resultDirectory = () => import_node_fs15.default.mkdtempSync(import_node_path16.default.join(import_node_os2.default.tmpdir(), "peach-expo-config-"));
13223
+ var resultDirectory = () => import_node_fs19.default.mkdtempSync(import_node_path19.default.join(import_node_os5.default.tmpdir(), "peach-expo-config-"));
12238
13224
  function readExpoConfig(projectRoot) {
12239
13225
  if (!hasExpoConfig(projectRoot)) return {};
12240
13226
  const directory = resultDirectory();
12241
- const resultPath = import_node_path16.default.join(directory, "config.json");
13227
+ const resultPath = import_node_path19.default.join(directory, "config.json");
12242
13228
  try {
12243
- const child = (0, import_node_child_process7.spawnSync)("node", expoConfigArgs(projectRoot, resultPath), {
13229
+ const child = (0, import_node_child_process10.spawnSync)("node", expoConfigArgs(projectRoot, resultPath), {
12244
13230
  cwd: projectRoot,
12245
13231
  encoding: "utf8",
12246
13232
  stdio: ["ignore", "ignore", "pipe"],
@@ -12250,7 +13236,7 @@ function readExpoConfig(projectRoot) {
12250
13236
  if (child.error) throw child.error;
12251
13237
  return readExpoConfigResult(resultPath, child.status, child.signal, child.stderr);
12252
13238
  } finally {
12253
- import_node_fs15.default.rmSync(directory, { recursive: true, force: true });
13239
+ import_node_fs19.default.rmSync(directory, { recursive: true, force: true });
12254
13240
  }
12255
13241
  }
12256
13242
  var HELPER_DEPTH = 3;
@@ -12298,7 +13284,7 @@ function splitClauses(condition) {
12298
13284
  function findHelper(type, name2, label, sources) {
12299
13285
  const found = [];
12300
13286
  for (const file of sources) {
12301
- const raw = import_node_fs15.default.readFileSync(file, "utf8");
13287
+ const raw = import_node_fs19.default.readFileSync(file, "utf8");
12302
13288
  const blank = blankSwiftObjcLiterals(raw);
12303
13289
  if (file.endsWith(".swift") && label === void 0) {
12304
13290
  const owners = type ? [
@@ -12384,7 +13370,7 @@ function evaluateSwiftBody(body, scope, depth) {
12384
13370
  }
12385
13371
  function evaluateObjcBody(body, bundle, constants, scope) {
12386
13372
  const plists = scope.resources.filter(
12387
- (file) => import_node_path16.default.basename(file) === "GoogleService-Info.plist"
13373
+ (file) => import_node_path19.default.basename(file) === "GoogleService-Info.plist"
12388
13374
  );
12389
13375
  const variables = /* @__PURE__ */ new Map();
12390
13376
  const literal2 = (text2) => {
@@ -12427,7 +13413,7 @@ function evaluateObjcBody(body, bundle, constants, scope) {
12427
13413
  variables.set(name2, plists.length === 1 ? plists[0] : void 0);
12428
13414
  } else if (dictionary && variables.has(dictionary[1])) {
12429
13415
  const file = variables.get(dictionary[1]);
12430
- const parsed = typeof file === "string" ? parsePlistSource(import_node_fs15.default.readFileSync(file, "utf8")) : void 0;
13416
+ const parsed = typeof file === "string" ? parsePlistSource(import_node_fs19.default.readFileSync(file, "utf8")) : void 0;
12431
13417
  variables.set(name2, isRecord(parsed) ? parsed : void 0);
12432
13418
  } else if (entry && variables.has(entry[1])) {
12433
13419
  const key = literal2(entry[2]);
@@ -12440,7 +13426,7 @@ function evaluateObjcBody(body, bundle, constants, scope) {
12440
13426
  }
12441
13427
  function evaluateClauses(clauses, scope, bound, depth) {
12442
13428
  const sources = scope.resources.filter(
12443
- (file) => import_node_path16.default.basename(file) === "GoogleService-Info.plist"
13429
+ (file) => import_node_path19.default.basename(file) === "GoogleService-Info.plist"
12444
13430
  );
12445
13431
  for (const clause of clauses) {
12446
13432
  if (clause === "true") continue;
@@ -12457,7 +13443,7 @@ function evaluateClauses(clauses, scope, bound, depth) {
12457
13443
  const dictionary = /^let\s+(\w+)\s*=\s*NSDictionary\s*\(\s*contentsOfFile:\s*(\w+)\s*\)$/.exec(clause);
12458
13444
  if (dictionary && typeof bound.get(dictionary[2]) === "string") {
12459
13445
  const parsed = parsePlistSource(
12460
- import_node_fs15.default.readFileSync(String(bound.get(dictionary[2])), "utf8")
13446
+ import_node_fs19.default.readFileSync(String(bound.get(dictionary[2])), "utf8")
12461
13447
  );
12462
13448
  if (!isRecord(parsed)) return false;
12463
13449
  bound.set(dictionary[1], parsed);
@@ -12546,7 +13532,7 @@ function findDefaultConfigureCall(body, sources) {
12546
13532
  const [, type, name2] = call;
12547
13533
  for (const file of sources) {
12548
13534
  if (!file.endsWith(".swift")) continue;
12549
- const source = blankSwiftObjcLiterals(import_node_fs15.default.readFileSync(file, "utf8"));
13535
+ const source = blankSwiftObjcLiterals(import_node_fs19.default.readFileSync(file, "utf8"));
12550
13536
  const declaration = new RegExp(
12551
13537
  `\\b(?:enum|struct|class)\\s+${type}\\b[^{]*\\{`
12552
13538
  ).exec(source);
@@ -12568,10 +13554,10 @@ function readTargetGoogleServicesFile(projectRoot, container, target, prepareGen
12568
13554
  prepareGeneratedSources
12569
13555
  });
12570
13556
  const delegates = app.allSources.filter(
12571
- (file) => /^AppDelegate\.(swift|mm|m)$/.test(import_node_path16.default.basename(file))
13557
+ (file) => /^AppDelegate\.(swift|mm|m)$/.test(import_node_path19.default.basename(file))
12572
13558
  );
12573
13559
  const defaultConfigured = delegates.some((file) => {
12574
- const raw = import_node_fs15.default.readFileSync(file, "utf8");
13560
+ const raw = import_node_fs19.default.readFileSync(file, "utf8");
12575
13561
  const source = blankSwiftObjcLiterals(raw);
12576
13562
  const launch = /(?:\bfunc\s+application\s*\([\s\S]*?didFinishLaunchingWithOptions[\s\S]*?\)\s*->\s*Bool|^-\s*\(BOOL\)\s*application\s*:[\s\S]*?didFinishLaunchingWithOptions[^{]*)\s*\{/m.exec(
12577
13563
  source
@@ -12642,17 +13628,17 @@ function readTargetGoogleServicesFile(projectRoot, container, target, prepareGen
12642
13628
  return guarded;
12643
13629
  });
12644
13630
  if (!defaultConfigured) return null;
12645
- const bundle = import_node_path16.default.join(
13631
+ const bundle = import_node_path19.default.join(
12646
13632
  app.settings("BUILT_PRODUCTS_DIR"),
12647
13633
  app.settings("WRAPPER_NAME") || `${app.settings("PRODUCT_NAME")}.app`
12648
13634
  );
12649
13635
  const staged = app.copiedFiles.filter(
12650
- ({ from, to }) => to === import_node_path16.default.join(bundle, "GoogleService-Info.plist") && import_node_fs15.default.existsSync(from)
12651
- ).map(({ from }) => import_node_fs15.default.realpathSync(from));
13636
+ ({ from, to }) => to === import_node_path19.default.join(bundle, "GoogleService-Info.plist") && import_node_fs19.default.existsSync(from)
13637
+ ).map(({ from }) => import_node_fs19.default.realpathSync(from));
12652
13638
  const resources = [
12653
13639
  .../* @__PURE__ */ new Set([
12654
13640
  ...app.resources.filter(
12655
- (file) => /^GoogleService-Info\.plist$/.test(import_node_path16.default.basename(file))
13641
+ (file) => /^GoogleService-Info\.plist$/.test(import_node_path19.default.basename(file))
12656
13642
  ),
12657
13643
  ...staged
12658
13644
  ])
@@ -12661,7 +13647,7 @@ function readTargetGoogleServicesFile(projectRoot, container, target, prepareGen
12661
13647
  throw new Error(
12662
13648
  "native Firebase default initialization requires one GoogleService-Info.plist build resource"
12663
13649
  );
12664
- return import_node_path16.default.relative(import_node_fs15.default.realpathSync(projectRoot), resources[0]);
13650
+ return import_node_path19.default.relative(import_node_fs19.default.realpathSync(projectRoot), resources[0]);
12665
13651
  }
12666
13652
  function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"], iosTarget, config = readExpoConfig(projectRoot), prepareGeneratedSources = false) {
12667
13653
  const result = {};
@@ -12682,8 +13668,8 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"], i
12682
13668
  const native = config[platform];
12683
13669
  if (!isRecord(native) || typeof native.googleServicesFile !== "string") continue;
12684
13670
  try {
12685
- const source = import_node_fs15.default.readFileSync(
12686
- import_node_path16.default.resolve(projectRoot, native.googleServicesFile),
13671
+ const source = import_node_fs19.default.readFileSync(
13672
+ import_node_path19.default.resolve(projectRoot, native.googleServicesFile),
12687
13673
  "utf8"
12688
13674
  );
12689
13675
  const parsed = platform === "ios" ? parsePlistSource(source) : JSON.parse(source);
@@ -12763,9 +13749,9 @@ init_is_record();
12763
13749
 
12764
13750
  // src/native-app-identity-project.ts
12765
13751
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
12766
- var import_node_fs18 = __toESM(require("node:fs"), 1);
13752
+ var import_node_fs22 = __toESM(require("node:fs"), 1);
12767
13753
  var import_node_module3 = require("node:module");
12768
- var import_node_path19 = __toESM(require("node:path"), 1);
13754
+ var import_node_path22 = __toESM(require("node:path"), 1);
12769
13755
  init_is_record();
12770
13756
  function nonEmptyString2(value) {
12771
13757
  return typeof value === "string" && value.length > 0 ? value : void 0;
@@ -12853,7 +13839,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
12853
13839
  const rtcAppGroupIdentifier = nonEmptyString2(dictionary.RTCAppGroupIdentifier);
12854
13840
  const screenShareExtensionBundleId = typeof dictionary.ScreenShareExtensionBundleId === "string" ? dictionary.ScreenShareExtensionBundleId : void 0;
12855
13841
  const rootModuleName = readRootModuleName(
12856
- app.allSources.filter((file) => /Delegate\.(?:swift|mm|m)$/.test(file) && import_node_fs18.default.existsSync(file)).map((file) => import_node_fs18.default.readFileSync(file, "utf8"))
13842
+ app.allSources.filter((file) => /Delegate\.(?:swift|mm|m)$/.test(file) && import_node_fs22.default.existsSync(file)).map((file) => import_node_fs22.default.readFileSync(file, "utf8"))
12857
13843
  );
12858
13844
  return stampNativeBuildSdk({
12859
13845
  ...app.keychainAccessGroups === void 0 ? {} : { keychainAccessGroups: app.keychainAccessGroups },
@@ -12875,7 +13861,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
12875
13861
  googleSignIn: readGoogleSignInConfiguration(
12876
13862
  dictionary,
12877
13863
  Object.fromEntries(
12878
- app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parseInfoPlist(import_node_fs18.default.readFileSync(file, "utf8"))])
13864
+ app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parseInfoPlist(import_node_fs22.default.readFileSync(file, "utf8"))])
12879
13865
  )
12880
13866
  ),
12881
13867
  supportedInterfaceOrientations,
@@ -12885,11 +13871,11 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
12885
13871
  bundleIcons: resolveNativeBundleIcons(icons, catalogAlternateNames, (value) => value),
12886
13872
  appIconArtwork: resolveNativeAppIconArtwork(
12887
13873
  app.resources,
12888
- (file) => import_node_fs18.default.readFileSync(file, "utf8"),
13874
+ (file) => import_node_fs22.default.readFileSync(file, "utf8"),
12889
13875
  (file) => {
12890
- const extension = import_node_path19.default.extname(file).toLowerCase();
13876
+ const extension = import_node_path22.default.extname(file).toLowerCase();
12891
13877
  const contentType = extension === ".jpg" || extension === ".jpeg" ? "image/jpeg" : extension === ".webp" ? "image/webp" : "image/png";
12892
- return `data:${contentType};base64,${import_node_fs18.default.readFileSync(file).toString("base64")}`;
13878
+ return `data:${contentType};base64,${import_node_fs22.default.readFileSync(file).toString("base64")}`;
12893
13879
  },
12894
13880
  icons,
12895
13881
  app.appIconName,
@@ -12919,11 +13905,11 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
12919
13905
  const read = selectNativeAppIdentityReader(platform, {
12920
13906
  android: () => null,
12921
13907
  ios: () => {
12922
- const nested = import_node_path19.default.join(projectRoot, "ios");
12923
- const iosRoot = import_node_fs18.default.existsSync(nested) ? nested : projectRoot;
13908
+ const nested = import_node_path22.default.join(projectRoot, "ios");
13909
+ const iosRoot = import_node_fs22.default.existsSync(nested) ? nested : projectRoot;
12924
13910
  const prefix2 = iosRoot === nested ? "ios/" : "";
12925
13911
  const files = {};
12926
- for (const entry of import_node_fs18.default.readdirSync(iosRoot, { withFileTypes: true })) {
13912
+ for (const entry of import_node_fs22.default.readdirSync(iosRoot, { withFileTypes: true })) {
12927
13913
  if (entry.name === "Pods") continue;
12928
13914
  if (entry.isDirectory()) {
12929
13915
  const names = entry.name.endsWith(".xcodeproj") ? ["project.pbxproj"] : [
@@ -12931,17 +13917,17 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
12931
13917
  "AppDelegate.swift",
12932
13918
  "AppDelegate.mm",
12933
13919
  "AppDelegate.m",
12934
- ...import_node_fs18.default.readdirSync(import_node_path19.default.join(iosRoot, entry.name)).filter((name2) => name2.endsWith(".entitlements"))
13920
+ ...import_node_fs22.default.readdirSync(import_node_path22.default.join(iosRoot, entry.name)).filter((name2) => name2.endsWith(".entitlements"))
12935
13921
  ];
12936
13922
  for (const name2 of names) {
12937
13923
  const relative3 = `${prefix2}${entry.name}/${name2}`;
12938
- const file = import_node_path19.default.join(projectRoot, relative3);
12939
- if (import_node_fs18.default.existsSync(file)) files[relative3] = import_node_fs18.default.readFileSync(file, "utf8");
13924
+ const file = import_node_path22.default.join(projectRoot, relative3);
13925
+ if (import_node_fs22.default.existsSync(file)) files[relative3] = import_node_fs22.default.readFileSync(file, "utf8");
12940
13926
  }
12941
13927
  } else if (/AppDelegate\.(?:swift|mm|m)$|\.entitlements$/.test(entry.name)) {
12942
13928
  const relative3 = `${prefix2}${entry.name}`;
12943
- const file = import_node_path19.default.join(projectRoot, relative3);
12944
- if (import_node_fs18.default.existsSync(file)) files[relative3] = import_node_fs18.default.readFileSync(file, "utf8");
13929
+ const file = import_node_path22.default.join(projectRoot, relative3);
13930
+ if (import_node_fs22.default.existsSync(file)) files[relative3] = import_node_fs22.default.readFileSync(file, "utf8");
12945
13931
  }
12946
13932
  }
12947
13933
  const identity = extractNativeAppIdentityFromFiles(
@@ -12958,41 +13944,41 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
12958
13944
  function readAndroidNativeAppIdentity(projectRoot, androidMergedManifest) {
12959
13945
  const files = {};
12960
13946
  if (androidMergedManifest) {
12961
- const file = import_node_path19.default.resolve(projectRoot, androidMergedManifest);
12962
- if (!import_node_fs18.default.existsSync(file)) return null;
12963
- files[androidMergedManifest] = import_node_fs18.default.readFileSync(file, "utf8");
13947
+ const file = import_node_path22.default.resolve(projectRoot, androidMergedManifest);
13948
+ if (!import_node_fs22.default.existsSync(file)) return null;
13949
+ files[androidMergedManifest] = import_node_fs22.default.readFileSync(file, "utf8");
12964
13950
  } else {
12965
- const androidRoot = import_node_path19.default.join(projectRoot, "android");
12966
- if (!import_node_fs18.default.existsSync(androidRoot)) return null;
13951
+ const androidRoot = import_node_path22.default.join(projectRoot, "android");
13952
+ if (!import_node_fs22.default.existsSync(androidRoot)) return null;
12967
13953
  const collect = (directory) => {
12968
- for (const entry of import_node_fs18.default.readdirSync(directory, { withFileTypes: true })) {
12969
- const file = import_node_path19.default.join(directory, entry.name);
13954
+ for (const entry of import_node_fs22.default.readdirSync(directory, { withFileTypes: true })) {
13955
+ const file = import_node_path22.default.join(directory, entry.name);
12970
13956
  if (entry.isDirectory()) collect(file);
12971
13957
  else if (entry.isFile() && entry.name === "AndroidManifest.xml")
12972
- files[import_node_path19.default.relative(projectRoot, file).split(import_node_path19.default.sep).join("/")] = import_node_fs18.default.readFileSync(file, "utf8");
13958
+ files[import_node_path22.default.relative(projectRoot, file).split(import_node_path22.default.sep).join("/")] = import_node_fs22.default.readFileSync(file, "utf8");
12973
13959
  }
12974
13960
  };
12975
- for (const module2 of import_node_fs18.default.readdirSync(androidRoot, { withFileTypes: true })) {
13961
+ for (const module2 of import_node_fs22.default.readdirSync(androidRoot, { withFileTypes: true })) {
12976
13962
  if (!module2.isDirectory()) continue;
12977
- const outputs = import_node_path19.default.join(
13963
+ const outputs = import_node_path22.default.join(
12978
13964
  androidRoot,
12979
13965
  module2.name,
12980
13966
  "build/intermediates/merged_manifests"
12981
13967
  );
12982
- if (import_node_fs18.default.existsSync(outputs)) collect(outputs);
13968
+ if (import_node_fs22.default.existsSync(outputs)) collect(outputs);
12983
13969
  }
12984
13970
  }
12985
13971
  for (const manifest of Object.keys(files)) {
12986
13972
  const resourceDirectory = androidMergedResourceValuesDirectory(manifest);
12987
13973
  if (!resourceDirectory) continue;
12988
- const absolute = import_node_path19.default.resolve(projectRoot, resourceDirectory);
12989
- if (!import_node_fs18.default.existsSync(absolute)) continue;
12990
- for (const entry of import_node_fs18.default.readdirSync(absolute, { withFileTypes: true })) {
13974
+ const absolute = import_node_path22.default.resolve(projectRoot, resourceDirectory);
13975
+ if (!import_node_fs22.default.existsSync(absolute)) continue;
13976
+ for (const entry of import_node_fs22.default.readdirSync(absolute, { withFileTypes: true })) {
12991
13977
  if (!entry.isDirectory() || !/^values(?:-|$)/.test(entry.name)) continue;
12992
- for (const resource of import_node_fs18.default.readdirSync(import_node_path19.default.join(absolute, entry.name))) {
13978
+ for (const resource of import_node_fs22.default.readdirSync(import_node_path22.default.join(absolute, entry.name))) {
12993
13979
  if (!resource.endsWith(".xml")) continue;
12994
13980
  const file = `${resourceDirectory}/${entry.name}/${resource}`;
12995
- files[file] = import_node_fs18.default.readFileSync(import_node_path19.default.resolve(projectRoot, file), "utf8");
13981
+ files[file] = import_node_fs22.default.readFileSync(import_node_path22.default.resolve(projectRoot, file), "utf8");
12996
13982
  }
12997
13983
  }
12998
13984
  }
@@ -13009,7 +13995,7 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
13009
13995
  const app = readIosAppTarget(projectRoot, iosTarget, environment);
13010
13996
  if (!app) return null;
13011
13997
  const identity = readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist);
13012
- const projectManifestPath = import_node_path19.default.join(projectRoot, "package.json");
13998
+ const projectManifestPath = import_node_path22.default.join(projectRoot, "package.json");
13013
13999
  const projectRequire = (0, import_node_module3.createRequire)(projectManifestPath);
13014
14000
  let reanimatedManifestPath;
13015
14001
  try {
@@ -13023,22 +14009,22 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
13023
14009
  throw error;
13024
14010
  }
13025
14011
  const installedManifest = JSON.parse(
13026
- import_node_fs18.default.readFileSync(reanimatedManifestPath, "utf8")
14012
+ import_node_fs22.default.readFileSync(reanimatedManifestPath, "utf8")
13027
14013
  );
13028
14014
  const installedVersion = isRecord(installedManifest) ? nonEmptyString2(installedManifest.version) : void 0;
13029
14015
  if (!installedVersion) throw new Error("Reanimated package version is malformed");
13030
14016
  if (Number.parseInt(installedVersion, 10) < 4) return identity;
13031
14017
  const defaults = JSON.parse(
13032
- import_node_fs18.default.readFileSync(
13033
- import_node_path19.default.join(
13034
- import_node_path19.default.dirname(reanimatedManifestPath),
14018
+ import_node_fs22.default.readFileSync(
14019
+ import_node_path22.default.join(
14020
+ import_node_path22.default.dirname(reanimatedManifestPath),
13035
14021
  "src/featureFlags/staticFlags.json"
13036
14022
  ),
13037
14023
  "utf8"
13038
14024
  )
13039
14025
  );
13040
14026
  if (!isRecord(defaults)) throw new Error("Reanimated static flags are malformed");
13041
- const manifest = JSON.parse(import_node_fs18.default.readFileSync(projectManifestPath, "utf8"));
14027
+ const manifest = JSON.parse(import_node_fs22.default.readFileSync(projectManifestPath, "utf8"));
13042
14028
  const reanimated = isRecord(manifest) ? manifest.reanimated : void 0;
13043
14029
  const overrides = isRecord(reanimated) ? reanimated.staticFeatureFlags : void 0;
13044
14030
  if (overrides !== void 0 && !isRecord(overrides)) {
@@ -15919,8 +16905,8 @@ var COMPAT_STUBS = {
15919
16905
 
15920
16906
  // src/installed-native-build-options.ts
15921
16907
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
15922
- var import_node_fs19 = __toESM(require("node:fs"), 1);
15923
- var import_node_path20 = __toESM(require("node:path"), 1);
16908
+ var import_node_fs23 = __toESM(require("node:fs"), 1);
16909
+ var import_node_path23 = __toESM(require("node:path"), 1);
15924
16910
  init_version_range();
15925
16911
  var RIVE_PACKAGE = "@rive-app/react-native";
15926
16912
  var RIVE_05 = [">=0.5.0 <0.6.0"];
@@ -15929,10 +16915,10 @@ function missing(error) {
15929
16915
  }
15930
16916
  function answerSync(step) {
15931
16917
  try {
15932
- if (step.type === "realpath") return import_node_fs19.default.realpathSync(step.path);
15933
- if (step.type === "read") return import_node_fs19.default.readFileSync(step.path, "utf8");
15934
- if (step.type === "isDirectory") return import_node_fs19.default.statSync(step.path).isDirectory();
15935
- return import_node_fs19.default.readdirSync(step.path, { withFileTypes: true }).map((entry) => ({
16918
+ if (step.type === "realpath") return import_node_fs23.default.realpathSync(step.path);
16919
+ if (step.type === "read") return import_node_fs23.default.readFileSync(step.path, "utf8");
16920
+ if (step.type === "isDirectory") return import_node_fs23.default.statSync(step.path).isDirectory();
16921
+ return import_node_fs23.default.readdirSync(step.path, { withFileTypes: true }).map((entry) => ({
15936
16922
  name: entry.name,
15937
16923
  directory: entry.isDirectory(),
15938
16924
  symbolicLink: entry.isSymbolicLink()
@@ -15944,11 +16930,11 @@ function answerSync(step) {
15944
16930
  }
15945
16931
  async function answerAsync(step) {
15946
16932
  try {
15947
- if (step.type === "realpath") return await import_node_fs19.default.promises.realpath(step.path);
15948
- if (step.type === "read") return await import_node_fs19.default.promises.readFile(step.path, "utf8");
16933
+ if (step.type === "realpath") return await import_node_fs23.default.promises.realpath(step.path);
16934
+ if (step.type === "read") return await import_node_fs23.default.promises.readFile(step.path, "utf8");
15949
16935
  if (step.type === "isDirectory")
15950
- return (await import_node_fs19.default.promises.stat(step.path)).isDirectory();
15951
- return (await import_node_fs19.default.promises.readdir(step.path, { withFileTypes: true })).map(
16936
+ return (await import_node_fs23.default.promises.stat(step.path)).isDirectory();
16937
+ return (await import_node_fs23.default.promises.readdir(step.path, { withFileTypes: true })).map(
15952
16938
  (entry) => ({
15953
16939
  name: entry.name,
15954
16940
  directory: entry.isDirectory(),
@@ -15981,7 +16967,7 @@ function* rubyFiles(directory, seen, iosRoot = false) {
15981
16967
  const files = [];
15982
16968
  for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
15983
16969
  if (iosRoot && (entry.name === "Pods" || entry.name === "build")) continue;
15984
- const target = import_node_path20.default.join(directory, entry.name);
16970
+ const target = import_node_path23.default.join(directory, entry.name);
15985
16971
  let isDirectory2 = entry.directory;
15986
16972
  if (entry.symbolicLink)
15987
16973
  isDirectory2 = (yield { type: "isDirectory", path: target }) === true;
@@ -15994,7 +16980,7 @@ function* nativeBuildOptionsWalk(projectRoot, versions, environment) {
15994
16980
  let sensorOptions = {};
15995
16981
  const sensors = versions["expo-sensors"];
15996
16982
  if (sensors && resolveCompatVersionRange([">=58.0.4 <59.0.0"], sensors).status === "matched") {
15997
- const file = import_node_path20.default.join(projectRoot, "ios", "Podfile.properties.json");
16983
+ const file = import_node_path23.default.join(projectRoot, "ios", "Podfile.properties.json");
15998
16984
  const source = yield { type: "read", path: file };
15999
16985
  if (source !== null && typeof source !== "string")
16000
16986
  throw new Error(`cannot inspect ${file}`);
@@ -16010,8 +16996,8 @@ function* nativeBuildOptionsWalk(projectRoot, versions, environment) {
16010
16996
  if (!needsRiveOptions(versions)) return sensorOptions;
16011
16997
  if (environment.USE_RIVE_LEGACY === "1" || environment.USE_RIVE_LEGACY === "true")
16012
16998
  return { ...sensorOptions, [RIVE_PACKAGE]: { USE_RIVE_LEGACY: true } };
16013
- const ios = import_node_path20.default.join(projectRoot, "ios");
16014
- const podfile = import_node_path20.default.join(ios, "Podfile");
16999
+ const ios = import_node_path23.default.join(projectRoot, "ios");
17000
+ const podfile = import_node_path23.default.join(ios, "Podfile");
16015
17001
  const files = [podfile, ...yield* rubyFiles(ios, /* @__PURE__ */ new Set(), true)];
16016
17002
  let value = false;
16017
17003
  let assigned = false;
@@ -16276,10 +17262,10 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
16276
17262
  // scripts/dev-server-scanner.ts
16277
17263
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
16278
17264
  var import_child_process = require("child_process");
16279
- var import_promises = require("fs/promises");
16280
- var import_node_fs20 = require("node:fs");
16281
- var import_node_os3 = require("node:os");
16282
- var import_node_path21 = require("node:path");
17265
+ var import_promises3 = require("fs/promises");
17266
+ var import_node_fs24 = require("node:fs");
17267
+ var import_node_os6 = require("node:os");
17268
+ var import_node_path24 = require("node:path");
16283
17269
  init_backend_origin();
16284
17270
  init_config();
16285
17271
 
@@ -16419,11 +17405,11 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
16419
17405
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
16420
17406
 
16421
17407
  // scripts/dev-server-scanner.ts
16422
- var LISTENER_LOCK_PATH = (0, import_node_path21.join)((0, import_node_os3.tmpdir)(), "peach-listener-scan.lock");
16423
- var LISTENER_RESULT_PATH = (0, import_node_path21.join)((0, import_node_os3.tmpdir)(), "peach-listener-scan.result");
17408
+ var LISTENER_LOCK_PATH = (0, import_node_path24.join)((0, import_node_os6.tmpdir)(), "peach-listener-scan.lock");
17409
+ var LISTENER_RESULT_PATH = (0, import_node_path24.join)((0, import_node_os6.tmpdir)(), "peach-listener-scan.result");
16424
17410
  var LISTENER_LOCK_STALE_MS = 25e3;
16425
17411
  var LISTENER_LOCK_WAIT_MS = 8e3;
16426
- function sleep(ms) {
17412
+ function sleep2(ms) {
16427
17413
  return new Promise((resolve4) => setTimeout(resolve4, ms));
16428
17414
  }
16429
17415
  function pidIsAlive(pid) {
@@ -16438,8 +17424,8 @@ function pidIsAlive(pid) {
16438
17424
  }
16439
17425
  function readLockOwner() {
16440
17426
  try {
16441
- const raw = (0, import_node_fs20.readFileSync)(LISTENER_LOCK_PATH, "utf8");
16442
- const mtimeMs = (0, import_node_fs20.statSync)(LISTENER_LOCK_PATH).mtimeMs;
17427
+ const raw = (0, import_node_fs24.readFileSync)(LISTENER_LOCK_PATH, "utf8");
17428
+ const mtimeMs = (0, import_node_fs24.statSync)(LISTENER_LOCK_PATH).mtimeMs;
16443
17429
  const pid = Number(raw.split("-")[0]);
16444
17430
  return { raw, pid: Number.isInteger(pid) ? pid : -1, mtimeMs };
16445
17431
  } catch {
@@ -16452,15 +17438,15 @@ function lockIsAbandoned(owner) {
16452
17438
  }
16453
17439
  function clearLock(raw) {
16454
17440
  try {
16455
- if ((0, import_node_fs20.readFileSync)(LISTENER_LOCK_PATH, "utf8") !== raw) return;
16456
- (0, import_node_fs20.unlinkSync)(LISTENER_LOCK_PATH);
17441
+ if ((0, import_node_fs24.readFileSync)(LISTENER_LOCK_PATH, "utf8") !== raw) return;
17442
+ (0, import_node_fs24.unlinkSync)(LISTENER_LOCK_PATH);
16457
17443
  } catch {
16458
17444
  }
16459
17445
  }
16460
17446
  function readResult() {
16461
17447
  try {
16462
17448
  const parsed = JSON.parse(
16463
- (0, import_node_fs20.readFileSync)(LISTENER_RESULT_PATH, "utf8")
17449
+ (0, import_node_fs24.readFileSync)(LISTENER_RESULT_PATH, "utf8")
16464
17450
  );
16465
17451
  if (!parsed || typeof parsed.token !== "string" || typeof parsed.key !== "string")
16466
17452
  return null;
@@ -16471,8 +17457,8 @@ function readResult() {
16471
17457
  }
16472
17458
  function publishResult(payload) {
16473
17459
  const tmp = `${LISTENER_RESULT_PATH}.${process.pid}.tmp`;
16474
- (0, import_node_fs20.writeFileSync)(tmp, JSON.stringify(payload));
16475
- (0, import_node_fs20.renameSync)(tmp, LISTENER_RESULT_PATH);
17460
+ (0, import_node_fs24.writeFileSync)(tmp, JSON.stringify(payload));
17461
+ (0, import_node_fs24.renameSync)(tmp, LISTENER_RESULT_PATH);
16476
17462
  }
16477
17463
  function throwPublished(payload) {
16478
17464
  throw Object.assign(new Error(payload.message || "listener scan failed"), {
@@ -16503,7 +17489,7 @@ async function waitForSharedResult(owner, key) {
16503
17489
  clearLock(latest.raw);
16504
17490
  return { kind: "retry" };
16505
17491
  }
16506
- await sleep(25);
17492
+ await sleep2(25);
16507
17493
  }
16508
17494
  throw Object.assign(new Error("listener scan lock was held past the wait"), {
16509
17495
  killed: true
@@ -16515,7 +17501,7 @@ async function withListenerLock(key, body) {
16515
17501
  for (; ; ) {
16516
17502
  let fd = null;
16517
17503
  try {
16518
- fd = (0, import_node_fs20.openSync)(LISTENER_LOCK_PATH, "wx");
17504
+ fd = (0, import_node_fs24.openSync)(LISTENER_LOCK_PATH, "wx");
16519
17505
  } catch (error) {
16520
17506
  const code = error instanceof Error && "code" in error ? error.code : "";
16521
17507
  if (code !== "EEXIST") throw error;
@@ -16524,7 +17510,7 @@ async function withListenerLock(key, body) {
16524
17510
  if (owner) clearLock(owner.raw);
16525
17511
  else {
16526
17512
  try {
16527
- (0, import_node_fs20.unlinkSync)(LISTENER_LOCK_PATH);
17513
+ (0, import_node_fs24.unlinkSync)(LISTENER_LOCK_PATH);
16528
17514
  } catch {
16529
17515
  }
16530
17516
  }
@@ -16535,12 +17521,12 @@ async function withListenerLock(key, body) {
16535
17521
  if (shared.kind === "value") return shared.value;
16536
17522
  continue;
16537
17523
  }
16538
- await sleep(25);
17524
+ await sleep2(25);
16539
17525
  continue;
16540
17526
  }
16541
17527
  if (fd === null) continue;
16542
17528
  try {
16543
- (0, import_node_fs20.writeSync)(fd, token);
17529
+ (0, import_node_fs24.writeSync)(fd, token);
16544
17530
  try {
16545
17531
  const value = await body();
16546
17532
  publishResult({ token, key, ok: true, value });
@@ -16557,7 +17543,7 @@ async function withListenerLock(key, body) {
16557
17543
  }
16558
17544
  } finally {
16559
17545
  try {
16560
- (0, import_node_fs20.closeSync)(fd);
17546
+ (0, import_node_fs24.closeSync)(fd);
16561
17547
  } catch {
16562
17548
  }
16563
17549
  clearLock(token);
@@ -16806,7 +17792,7 @@ async function flushCwdQueue() {
16806
17792
  const needLsof = [];
16807
17793
  for (const pid of pending) {
16808
17794
  try {
16809
- const cwd = await (0, import_promises.readlink)(`/proc/${pid}/cwd`);
17795
+ const cwd = await (0, import_promises3.readlink)(`/proc/${pid}/cwd`);
16810
17796
  if (cwd) {
16811
17797
  cwdByPid.set(pid, cwd);
16812
17798
  continue;
@@ -17042,7 +18028,7 @@ function nodeRequestHeaderEntries(headers) {
17042
18028
 
17043
18029
  // src/host/hostname-resolver.ts
17044
18030
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
17045
- var import_promises2 = require("node:dns/promises");
18031
+ var import_promises4 = require("node:dns/promises");
17046
18032
 
17047
18033
  // src/dns-over-https.ts
17048
18034
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -17084,7 +18070,7 @@ function parseIpv6(text2) {
17084
18070
 
17085
18071
  // src/host/network-policy.ts
17086
18072
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
17087
- var import_node_path22 = require("node:path");
18073
+ var import_node_path25 = require("node:path");
17088
18074
  var import_node_url = require("node:url");
17089
18075
  var NETWORK_POLICY_TIMEOUT_MS = 1e4;
17090
18076
  var NetworkPolicyDeniedError = class extends Error {
@@ -17137,7 +18123,7 @@ function createNetworkAuthorizer(policy) {
17137
18123
  };
17138
18124
  }
17139
18125
  async function loadNetworkPolicy(file) {
17140
- if (!(0, import_node_path22.isAbsolute)(file)) {
18126
+ if (!(0, import_node_path25.isAbsolute)(file)) {
17141
18127
  throw new Error(`PEACH_NETWORK_POLICY must be an absolute path: ${file}`);
17142
18128
  }
17143
18129
  const loaded3 = await import(
@@ -17173,7 +18159,7 @@ async function handleHostnameResolutionRequest(req, res) {
17173
18159
  }
17174
18160
  let addresses;
17175
18161
  try {
17176
- addresses = (await (0, import_promises2.lookup)(host2, { all: true })).map(({ address }) => {
18162
+ addresses = (await (0, import_promises4.lookup)(host2, { all: true })).map(({ address }) => {
17177
18163
  const bytes = parseIpLiteral(address);
17178
18164
  if (!bytes) throw new Error("system resolver returned an invalid address");
17179
18165
  return bytes;
@@ -17226,17 +18212,17 @@ function projectLoopbackUrl(value) {
17226
18212
  // src/host/rolldown-bundle-forward.ts
17227
18213
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
17228
18214
  var import_stream = require("stream");
17229
- var import_promises3 = require("stream/promises");
18215
+ var import_promises5 = require("stream/promises");
17230
18216
 
17231
18217
  // src/cli-runtime.ts
17232
18218
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
17233
- var import_node_crypto6 = require("node:crypto");
17234
- var import_node_fs21 = require("node:fs");
18219
+ var import_node_crypto7 = require("node:crypto");
18220
+ var import_node_fs25 = require("node:fs");
17235
18221
  var import_node_module4 = require("node:module");
17236
- var import_node_path23 = require("node:path");
18222
+ var import_node_path26 = require("node:path");
17237
18223
 
17238
18224
  // runtime-companion.json
17239
- var runtime_companion_default = { abi: 1, sha256: "8d817e4a68a084ba50456a80439f20c8aa11c055d42c9cf1c7de017062bfd4a2", file: "node/cli-8d817e4a68a084ba50456a80439f20c8aa11c055d42c9cf1c7de017062bfd4a2.cjs" };
18225
+ var runtime_companion_default = { abi: 1, sha256: "1c15d055a3e1e68a17d3f735cd1c592fdc418c85e781e44abf4f4aa0b1215b52", file: "node/cli-1c15d055a3e1e68a17d3f735cd1c592fdc418c85e781e44abf4f4aa0b1215b52.cjs" };
17240
18226
 
17241
18227
  // src/cli-runtime.ts
17242
18228
  var CLI_COMPANION_ABI = 1;
@@ -17244,12 +18230,12 @@ function cliCompanionPath() {
17244
18230
  return `node/cli-${runtime_companion_default.sha256}.cjs`;
17245
18231
  }
17246
18232
  function verifyCliCompanion(root) {
17247
- verifyCompanionFile((0, import_node_path23.join)(root, cliCompanionPath()));
18233
+ verifyCompanionFile((0, import_node_path26.join)(root, cliCompanionPath()));
17248
18234
  }
17249
18235
  function verifyCompanionFile(file) {
17250
18236
  let bytes;
17251
18237
  try {
17252
- bytes = (0, import_node_fs21.readFileSync)(file);
18238
+ bytes = (0, import_node_fs25.readFileSync)(file);
17253
18239
  } catch (error) {
17254
18240
  if (error instanceof Error) {
17255
18241
  const missing2 = "code" in error && error.code === "ENOENT" ? `; run \`peach runtime install\`, which fetches the companion this CLI published${process.platform === "win32" ? ", and check Windows Security protection history if it repeats" : ""}` : "";
@@ -17257,20 +18243,41 @@ function verifyCompanionFile(file) {
17257
18243
  }
17258
18244
  throw error;
17259
18245
  }
17260
- const hash = (0, import_node_crypto6.createHash)("sha256").update(bytes).digest("hex");
18246
+ const hash = (0, import_node_crypto7.createHash)("sha256").update(bytes).digest("hex");
17261
18247
  if (hash !== runtime_companion_default.sha256) {
17262
18248
  throw new Error(
17263
18249
  "Peach runtime companion does not match this CLI; run `peach runtime install`"
17264
18250
  );
17265
18251
  }
17266
18252
  }
18253
+ async function ensureCliCompanion(root) {
18254
+ const file = (0, import_node_path26.join)(root, cliCompanionPath());
18255
+ try {
18256
+ verifyCompanionFile(file);
18257
+ return;
18258
+ } catch (error) {
18259
+ if (!(error instanceof Error && "code" in error && error.code === "ENOENT"))
18260
+ throw error;
18261
+ }
18262
+ const staged = `${file}.${process.pid}`;
18263
+ try {
18264
+ await downloadToFile(
18265
+ `https://r2.rnxsim.com/rnx-cli/companions/cli-${runtime_companion_default.sha256}.cjs`,
18266
+ staged
18267
+ );
18268
+ verifyCompanionFile(staged);
18269
+ (0, import_node_fs25.renameSync)(staged, file);
18270
+ } finally {
18271
+ (0, import_node_fs25.rmSync)(staged, { force: true });
18272
+ }
18273
+ }
17267
18274
  var loaded2;
17268
18275
  function getCliRuntime() {
17269
18276
  if (loaded2) return loaded2.runtime;
17270
18277
  const root = peachRuntimeRoot();
17271
18278
  verifyCliCompanion(root);
17272
18279
  const require2 = (0, import_node_module4.createRequire)(__sootsim_import_meta_url);
17273
- const runtime = require2((0, import_node_path23.join)(root, cliCompanionPath()));
18280
+ const runtime = require2((0, import_node_path26.join)(root, cliCompanionPath()));
17274
18281
  if (runtime.cliCompanionAbi !== CLI_COMPANION_ABI) {
17275
18282
  throw new Error(
17276
18283
  "Incompatible Peach runtime companion ABI; run `peach runtime install`"
@@ -17285,7 +18292,7 @@ var ROLLDOWN_INVENTORY_HEADER = "x-peach-rolldown-inventory";
17285
18292
  async function forwardRolldownBundleResponse(upstream, res) {
17286
18293
  res.setHeader(ROLLDOWN_INVENTORY_HEADER, "1");
17287
18294
  if (upstream.headers[ROLLDOWN_INVENTORY_HEADER] === "1") {
17288
- await (0, import_promises3.pipeline)(upstream, res);
18295
+ await (0, import_promises5.pipeline)(upstream, res);
17289
18296
  return;
17290
18297
  }
17291
18298
  const contentType = typeof upstream.headers["content-type"] === "string" ? upstream.headers["content-type"] : "";
@@ -17327,7 +18334,7 @@ async function forwardRolldownBundleResponse(upstream, res) {
17327
18334
  }
17328
18335
  yield Buffer.from(annotated.slice(sent), "utf8");
17329
18336
  };
17330
- await (0, import_promises3.pipeline)(import_stream.Readable.from(annotate(), { objectMode: false }), res);
18337
+ await (0, import_promises5.pipeline)(import_stream.Readable.from(annotate(), { objectMode: false }), res);
17331
18338
  }
17332
18339
 
17333
18340
  // src/host/fetch-proxy-handler.ts
@@ -17658,7 +18665,7 @@ async function proxyUpstream(req, res, upstreamUrl, reportFailure, route) {
17658
18665
  await route.respond(proxyRes, hopCookies);
17659
18666
  if (isNativeCookieRedirect(hop)) res.removeHeader("location");
17660
18667
  res.statusCode = isNativeCookieRedirect(hop) ? 200 : status;
17661
- await (0, import_promises4.pipeline)(proxyRes, res);
18668
+ await (0, import_promises6.pipeline)(proxyRes, res);
17662
18669
  return;
17663
18670
  }
17664
18671
  if (location && (status === 301 || status === 302 || status === 303 || status === 307 || status === 308)) {
@@ -17669,7 +18676,7 @@ async function proxyUpstream(req, res, upstreamUrl, reportFailure, route) {
17669
18676
  const switchToGet = (status === 301 || status === 302) && method === "POST" || status === 303 && method !== "GET" && method !== "HEAD";
17670
18677
  const redirectUrl = resolveRedirectUrl(location, targetUrl);
17671
18678
  proxyRes.resume();
17672
- await (0, import_promises4.finished)(proxyRes);
18679
+ await (0, import_promises6.finished)(proxyRes);
17673
18680
  await proxy(
17674
18681
  redirectUrl,
17675
18682
  switchToGet ? "GET" : method,
@@ -17686,7 +18693,7 @@ async function proxyUpstream(req, res, upstreamUrl, reportFailure, route) {
17686
18693
  await forwardRolldownBundleResponse(proxyRes, res);
17687
18694
  return;
17688
18695
  }
17689
- await (0, import_promises4.pipeline)(proxyRes, res);
18696
+ await (0, import_promises6.pipeline)(proxyRes, res);
17690
18697
  };
17691
18698
  let upstreamAnswered = false;
17692
18699
  let body;
@@ -17865,6 +18872,198 @@ function insertNativeFirebaseFooter(source, config) {
17865
18872
  return start < 0 ? detached + footer : detached.slice(0, start) + footer + detached.slice(start);
17866
18873
  }
17867
18874
 
18875
+ // src/runtime-packs.ts
18876
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
18877
+ var import_node_fs27 = __toESM(require("node:fs"), 1);
18878
+ var import_node_path28 = __toESM(require("node:path"), 1);
18879
+ var import_node_timers = require("node:timers");
18880
+
18881
+ // src/runtime-delivery.ts
18882
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
18883
+ init_home_paths();
18884
+ init_public_brand();
18885
+ var DEFAULT_RUNTIME_CDN_ORIGIN = peachPublicBrand.origin;
18886
+ var RNX_CHANGELOG_URL = `${peachPublicBrand.origin}/changelog`;
18887
+ var RNX_CHANGELOG_API_URL = `${peachPublicBrand.origin}/api/changelog/sootsim`;
18888
+ var RNX_RUNTIME_PRODUCT = {
18889
+ id: "peach",
18890
+ defaultCdnOrigin: DEFAULT_RUNTIME_CDN_ORIGIN,
18891
+ manifestPath: "/runtimes/manifest.json",
18892
+ tarballPath: (version) => `/runtimes/sootsim-runtime-${version}.tar.zst`,
18893
+ // the engine runtime is a static SPA: shell at the root, engine/ and
18894
+ // engine-tenant/ beneath it. index.html is what the daemon and the
18895
+ // vite/metro plugins serve, so its absence means the tarball is not one.
18896
+ installedMarker: "index.html",
18897
+ verifyInstall: ensureCliCompanion,
18898
+ env: {
18899
+ cdnOrigin: "PEACH_CDN_ORIGIN",
18900
+ channel: "PEACH_RUNTIME_CHANNEL"
18901
+ },
18902
+ ensureHome: ensureRnxHome,
18903
+ configFile: configFilePath,
18904
+ runtimesDir,
18905
+ runtimeDir,
18906
+ cacheDir,
18907
+ readActiveRuntime,
18908
+ writeActiveRuntime
18909
+ };
18910
+ var rnxRuntime = createRuntimeDelivery(RNX_RUNTIME_PRODUCT);
18911
+
18912
+ // src/runtime-packs.ts
18913
+ var inflight = /* @__PURE__ */ new Map();
18914
+ var packsByRoot = /* @__PURE__ */ new Map();
18915
+ var listedByRoot = /* @__PURE__ */ new Map();
18916
+ function listedFiles(runtimeRoot) {
18917
+ let listed = listedByRoot.get(runtimeRoot);
18918
+ if (listed) return listed;
18919
+ listed = /* @__PURE__ */ new Map();
18920
+ for (const [pack, entry] of Object.entries(readPacks(runtimeRoot) ?? {}))
18921
+ for (const file of entry.files ?? []) {
18922
+ const name2 = import_node_path28.default.posix.basename(file);
18923
+ listed.set(name2, [...listed.get(name2) ?? [], { file, pack }]);
18924
+ }
18925
+ listedByRoot.set(runtimeRoot, listed);
18926
+ return listed;
18927
+ }
18928
+ function readPacks(runtimeRoot) {
18929
+ const cached = packsByRoot.get(runtimeRoot);
18930
+ if (cached !== void 0) return cached;
18931
+ const file = import_node_path28.default.join(runtimeRoot, RUNTIME_PACKS_FILE);
18932
+ if (!import_node_fs27.default.existsSync(file)) {
18933
+ packsByRoot.set(runtimeRoot, null);
18934
+ return null;
18935
+ }
18936
+ const parsed = JSON.parse(import_node_fs27.default.readFileSync(file, "utf8"));
18937
+ const packs = {};
18938
+ if (typeof parsed !== "object" || parsed === null)
18939
+ throw new Error(`${file} is not an object`);
18940
+ for (const [prefix2, entry] of Object.entries(parsed)) {
18941
+ if (typeof entry?.file !== "string" || typeof entry?.sha256 !== "string")
18942
+ throw new Error(`${file} entry ${prefix2} lacks file and sha256`);
18943
+ const files = entry.files;
18944
+ if (files !== void 0 && !(Array.isArray(files) && files.every((f) => typeof f === "string")))
18945
+ throw new Error(`${file} entry ${prefix2} has files that are not paths`);
18946
+ packs[prefix2] = {
18947
+ file: entry.file,
18948
+ sha256: entry.sha256,
18949
+ ...files ? { files } : {}
18950
+ };
18951
+ }
18952
+ packsByRoot.set(runtimeRoot, packs);
18953
+ return packs;
18954
+ }
18955
+ async function ensureRuntimePackFor(runtimeRoot, pathname) {
18956
+ warmRuntimePacks(runtimeRoot);
18957
+ const prefix2 = RUNTIME_PACK_PREFIXES.find(
18958
+ (candidate) => pathname.includes(`/${candidate}`)
18959
+ );
18960
+ if (prefix2) {
18961
+ await installNamedPack(runtimeRoot, prefix2);
18962
+ return;
18963
+ }
18964
+ const listed = listedFiles(runtimeRoot).get(import_node_path28.default.posix.basename(pathname))?.find(({ file }) => pathname.endsWith(`/${file}`));
18965
+ if (listed) {
18966
+ if (!import_node_fs27.default.existsSync(import_node_path28.default.join(runtimeRoot, listed.file)))
18967
+ await installNamedPack(runtimeRoot, listed.pack);
18968
+ return;
18969
+ }
18970
+ const at = pathname.indexOf(`/${RUNTIME_MERGE_PACK_DIR}`);
18971
+ if (at === -1) return;
18972
+ const tenantDir = import_node_path28.default.join(runtimeRoot, RUNTIME_MERGE_PACK_DIR);
18973
+ const rel = pathname.slice(at + RUNTIME_MERGE_PACK_DIR.length + 1);
18974
+ if (!/\.m?js$/.test(rel) || import_node_fs27.default.existsSync(import_node_path28.default.join(tenantDir, rel))) return;
18975
+ await installNamedPack(runtimeRoot, RUNTIME_MERGE_PACK_DIR);
18976
+ }
18977
+ function installNamedPack(runtimeRoot, name2) {
18978
+ if (name2 === RUNTIME_MERGE_PACK_DIR) {
18979
+ const tenantDir = import_node_path28.default.join(runtimeRoot, RUNTIME_MERGE_PACK_DIR);
18980
+ return mergePack(
18981
+ runtimeRoot,
18982
+ name2,
18983
+ import_node_path28.default.join(tenantDir, RUNTIME_MERGE_PACK_INSTALL),
18984
+ tenantDir
18985
+ );
18986
+ }
18987
+ if (readPacks(runtimeRoot)?.[name2]?.files)
18988
+ return mergePack(
18989
+ runtimeRoot,
18990
+ name2,
18991
+ import_node_path28.default.join(runtimeRoot, `.pack-${name2}`),
18992
+ runtimeRoot
18993
+ );
18994
+ return installPack(runtimeRoot, name2, import_node_path28.default.join(runtimeRoot, name2.slice(0, -1)));
18995
+ }
18996
+ var WARM_DELAY_MS = 3e4;
18997
+ var warming = /* @__PURE__ */ new Set();
18998
+ function warmRuntimePacks(runtimeRoot) {
18999
+ if (warming.has(runtimeRoot)) return;
19000
+ warming.add(runtimeRoot);
19001
+ const warm = async () => {
19002
+ for (const name2 of Object.keys(readPacks(runtimeRoot) ?? {}))
19003
+ if (!await installNamedPack(runtimeRoot, name2)) return;
19004
+ };
19005
+ const schedule = import_node_timers.setTimeout;
19006
+ schedule(() => void warm(), WARM_DELAY_MS).unref();
19007
+ }
19008
+ async function mergePack(runtimeRoot, name2, installDir, targetDir) {
19009
+ if (import_node_fs27.default.existsSync(import_node_path28.default.join(installDir, RUNTIME_MERGE_PACK_MERGED))) return true;
19010
+ if (!await installPack(runtimeRoot, name2, installDir)) return false;
19011
+ const link = (sub) => {
19012
+ for (const entry of import_node_fs27.default.readdirSync(import_node_path28.default.join(installDir, sub), {
19013
+ withFileTypes: true
19014
+ })) {
19015
+ const child = import_node_path28.default.join(sub, entry.name);
19016
+ if (entry.isDirectory()) {
19017
+ import_node_fs27.default.mkdirSync(import_node_path28.default.join(targetDir, child), { recursive: true });
19018
+ link(child);
19019
+ } else if (entry.name !== RUNTIME_PACK_MARKER) {
19020
+ try {
19021
+ import_node_fs27.default.linkSync(import_node_path28.default.join(installDir, child), import_node_path28.default.join(targetDir, child));
19022
+ } catch (error) {
19023
+ if (!(error instanceof Error && "code" in error && error.code === "EEXIST"))
19024
+ throw error;
19025
+ }
19026
+ }
19027
+ }
19028
+ };
19029
+ try {
19030
+ link("");
19031
+ import_node_fs27.default.writeFileSync(import_node_path28.default.join(installDir, RUNTIME_MERGE_PACK_MERGED), "");
19032
+ return true;
19033
+ } catch (error) {
19034
+ console.error(
19035
+ `[peach] ${name2} pack merge failed: ${error instanceof Error ? error.message : String(error)}`
19036
+ );
19037
+ return false;
19038
+ }
19039
+ }
19040
+ async function installPack(runtimeRoot, prefix2, destDir) {
19041
+ const marker = import_node_path28.default.join(destDir, RUNTIME_PACK_MARKER);
19042
+ if (import_node_fs27.default.existsSync(marker)) return true;
19043
+ const pack = readPacks(runtimeRoot)?.[prefix2];
19044
+ if (!pack) return true;
19045
+ let install = inflight.get(destDir);
19046
+ if (!install) {
19047
+ const version = import_node_path28.default.basename(runtimeRoot);
19048
+ const url = new URL(pack.file, rnxRuntime.tarballUrl(version));
19049
+ url.searchParams.set("sha256", pack.sha256);
19050
+ install = installVerifiedTarball({
19051
+ url: url.toString(),
19052
+ digest: { algorithm: "sha256", encoding: "hex", value: pack.sha256 },
19053
+ destDir,
19054
+ installedMarker: RUNTIME_PACK_MARKER,
19055
+ label: `peach runtime ${version} pack ${prefix2}`
19056
+ }).catch((error) => {
19057
+ console.error(
19058
+ `[peach] ${prefix2} pack download failed: ${error instanceof Error ? error.message : String(error)}`
19059
+ );
19060
+ }).finally(() => inflight.delete(destDir));
19061
+ inflight.set(destDir, install);
19062
+ }
19063
+ await install;
19064
+ return import_node_fs27.default.existsSync(marker);
19065
+ }
19066
+
17868
19067
  // src/runtimePlatformContract.ts
17869
19068
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
17870
19069
  var IOS_ADAPTER = Object.freeze({
@@ -18000,7 +19199,7 @@ function withPeach(config, options = {}) {
18000
19199
  const configuredBundleUrl = "/index.bundle?platform=ios&dev=true&hot=true&minify=false";
18001
19200
  const cfgServer = config.server;
18002
19201
  const port = resolveMetroPort(cfgServer);
18003
- const metroServerId = (0, import_node_crypto7.randomUUID)();
19202
+ const metroServerId = (0, import_node_crypto8.randomUUID)();
18004
19203
  const bundleUrl = tagRnxBundleForPlugin(
18005
19204
  configuredBundleUrl,
18006
19205
  `http://localhost:${port}`,
@@ -18131,7 +19330,7 @@ function withPeach(config, options = {}) {
18131
19330
  return middleware;
18132
19331
  }
18133
19332
  const server = connect();
18134
- server.use((req, res, next) => {
19333
+ server.use(async (req, res, next) => {
18135
19334
  if (isReplacementModuleRequestUrl(req.url)) {
18136
19335
  void handleReplacementModuleRequest(req, res, {
18137
19336
  servedRoots: [cfgProjectRoot, ...cfgWatchFolders],
@@ -18175,6 +19374,7 @@ function withPeach(config, options = {}) {
18175
19374
  next();
18176
19375
  return;
18177
19376
  }
19377
+ await ensureRuntimePackFor(runtimeRoot, pathname);
18178
19378
  if (isRootRuntimeAssetPath(pathname)) {
18179
19379
  const fullPath = resolveRuntimeFilePath(runtimeRoot, pathname);
18180
19380
  if (fullPath) {