peachsim 0.1.2611 → 0.1.2613

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 (130) hide show
  1. package/dist-lib/agent-daemon-client.cjs +1 -1
  2. package/dist-lib/agent-events.cjs +1 -1
  3. package/dist-lib/attached-projects.cjs +1 -1
  4. package/dist-lib/auth/shared-session.cjs +1 -1
  5. package/dist-lib/backend-origin.cjs +1 -1
  6. package/dist-lib/beta.cjs +1 -1
  7. package/dist-lib/beta.mjs +2 -2
  8. package/dist-lib/bridge-constants.cjs +1 -1
  9. package/dist-lib/bridge-contract-input.cjs +1 -1
  10. package/dist-lib/bridge-contract-input.mjs +5 -5
  11. package/dist-lib/bridge-contract.cjs +1 -1
  12. package/dist-lib/bridge-contract.mjs +3 -3
  13. package/dist-lib/bundle-channel.cjs +1218 -737
  14. package/dist-lib/capture-contract.cjs +1 -1
  15. package/dist-lib/capture-contract.mjs +3 -3
  16. package/dist-lib/cloud-contract.cjs +1 -1
  17. package/dist-lib/cloud-contract.mjs +3 -3
  18. package/dist-lib/cloud-test-args.cjs +1 -1
  19. package/dist-lib/cloud-test-args.mjs +2 -2
  20. package/dist-lib/cloud.cjs +1 -1
  21. package/dist-lib/cloud.mjs +7 -7
  22. package/dist-lib/config.cjs +1 -1
  23. package/dist-lib/config.mjs +5 -5
  24. package/dist-lib/detox/index.cjs +1 -1
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/esm-chunks/{acorn-BKODFARF.mjs → acorn-ACYPRRES.mjs} +3 -3
  27. package/dist-lib/esm-chunks/{chunk-7L5LUPZA.mjs → chunk-4737IGWN.mjs} +1 -1
  28. package/dist-lib/esm-chunks/{chunk-J6N5KKMZ.mjs → chunk-4KMXTJK7.mjs} +6 -6
  29. package/dist-lib/esm-chunks/{chunk-LNZNCA7M.mjs → chunk-5PYWWIEV.mjs} +1 -1
  30. package/dist-lib/esm-chunks/{chunk-HWMD7II5.mjs → chunk-ALQTIMJN.mjs} +2 -2
  31. package/dist-lib/esm-chunks/{chunk-3JA6XLP4.mjs → chunk-EHBHTMJD.mjs} +1 -1
  32. package/dist-lib/esm-chunks/{chunk-C4BW35N7.mjs → chunk-FI6ANCVK.mjs} +1 -1
  33. package/dist-lib/esm-chunks/{chunk-NUISME6Y.mjs → chunk-FKR3M3SE.mjs} +1 -1
  34. package/dist-lib/esm-chunks/{chunk-4C3LKD3A.mjs → chunk-HABUBD7F.mjs} +1 -1
  35. package/dist-lib/esm-chunks/{chunk-CAFNSCPD.mjs → chunk-HMBNKM6Z.mjs} +12 -55
  36. package/dist-lib/esm-chunks/{chunk-SFDNE5S2.mjs → chunk-HXFNAJK2.mjs} +1 -1
  37. package/dist-lib/esm-chunks/{chunk-A6GNAMLP.mjs → chunk-JA2VWD36.mjs} +1 -1
  38. package/dist-lib/esm-chunks/{chunk-JWA5AIJM.mjs → chunk-JZN72POJ.mjs} +1 -1
  39. package/dist-lib/esm-chunks/{chunk-45CENTIY.mjs → chunk-LKZBPKR7.mjs} +1 -1
  40. package/dist-lib/esm-chunks/{chunk-SNMPI3I2.mjs → chunk-LOG546WG.mjs} +1 -1
  41. package/dist-lib/esm-chunks/{chunk-KOT7HREP.mjs → chunk-MYDEA4KG.mjs} +6 -6
  42. package/dist-lib/esm-chunks/{chunk-4CJMDUKF.mjs → chunk-N4OAK5F2.mjs} +14 -14
  43. package/dist-lib/esm-chunks/{chunk-XSRZQWH5.mjs → chunk-OAXXQLLD.mjs} +5 -5
  44. package/dist-lib/esm-chunks/{chunk-H2JPB73X.mjs → chunk-RAWOUEDK.mjs} +1 -1
  45. package/dist-lib/esm-chunks/{chunk-LDV2MZFL.mjs → chunk-S6YGE7GH.mjs} +1 -1
  46. package/dist-lib/esm-chunks/{chunk-52XQJZ6O.mjs → chunk-TELXLVVV.mjs} +3 -3
  47. package/dist-lib/esm-chunks/{chunk-CWLKT7TD.mjs → chunk-VCFIXUE4.mjs} +1 -1
  48. package/dist-lib/esm-chunks/{chunk-YFSTB4CX.mjs → chunk-WHRUBPSD.mjs} +4 -4
  49. package/dist-lib/esm-chunks/{chunk-FWUDTM5Y.mjs → chunk-WN7ZU4KM.mjs} +1 -1
  50. package/dist-lib/esm-chunks/{chunk-SKW2UNWS.mjs → chunk-WYHRRW33.mjs} +1 -1
  51. package/dist-lib/esm-chunks/{metro-layout-parser-BMN3E2RD.mjs → metro-layout-parser-E7PUOWFM.mjs} +3 -3
  52. package/dist-lib/esm-chunks/{swift-package-prebuilt-VMBB763C.mjs → swift-package-prebuilt-I2HAKHB3.mjs} +12 -12
  53. package/dist-lib/esm-chunks/{swift-sdk-app-module-SJ6OZAVA.mjs → swift-sdk-app-module-KLRMLTO2.mjs} +16 -16
  54. package/dist-lib/esm-chunks/{swift-sdk-image-U53EKCZW.mjs → swift-sdk-image-GYAVDPQT.mjs} +16 -16
  55. package/dist-lib/esm-chunks/{swift-sdk-image-producer-TQQ33C3G.mjs → swift-sdk-image-producer-4XVU6GKS.mjs} +5 -5
  56. package/dist-lib/expo-swift-bundle.cjs +15 -58
  57. package/dist-lib/expo-swift-metadata.cjs +1 -1
  58. package/dist-lib/expo-swift-metadata.mjs +7 -7
  59. package/dist-lib/home-paths.cjs +1 -1
  60. package/dist-lib/host/bridge-host.cjs +1613 -1076
  61. package/dist-lib/host/fetch-proxy-handler.cjs +3 -3
  62. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  63. package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
  64. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  65. package/dist-lib/host/websocket-proxy.cjs +1 -1
  66. package/dist-lib/index.cjs +1 -1
  67. package/dist-lib/kotlin-host.cjs +676 -171
  68. package/dist-lib/menu.cjs +1 -1
  69. package/dist-lib/menu.mjs +3 -3
  70. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  71. package/dist-lib/metro-fingerprint-registry.mjs +3 -3
  72. package/dist-lib/metro-production-bundle.cjs +1 -1
  73. package/dist-lib/metro-production-bundle.mjs +4 -4
  74. package/dist-lib/native-app-identity-project.cjs +12 -55
  75. package/dist-lib/native-app-identity-project.mjs +15 -15
  76. package/dist-lib/native-app-identity.cjs +1 -1
  77. package/dist-lib/native-app-identity.mjs +6 -6
  78. package/dist-lib/native-firebase-metadata.cjs +1 -1
  79. package/dist-lib/native-firebase-metadata.mjs +3 -3
  80. package/dist-lib/pdfium-raster.cjs +1 -1
  81. package/dist-lib/pdfium-raster.mjs +2 -2
  82. package/dist-lib/plist.cjs +12 -55
  83. package/dist-lib/plist.mjs +3 -3
  84. package/dist-lib/profiles.cjs +1 -1
  85. package/dist-lib/public-brand.cjs +1 -1
  86. package/dist-lib/public-origins-lib-esm.json +85 -85
  87. package/dist-lib/public-origins-lib.json +76 -65
  88. package/dist-lib/react-native-host-modules.cjs +1 -1
  89. package/dist-lib/react-native-host-modules.mjs +2 -2
  90. package/dist-lib/reap-browser.cjs +1 -1
  91. package/dist-lib/scripts/dev-server-scanner.cjs +11 -10
  92. package/dist-lib/sdk.cjs +1 -1
  93. package/dist-lib/sdk.mjs +8 -8
  94. package/dist-lib/skills.cjs +2169 -1693
  95. package/dist-lib/swift-compile.cjs +1 -1
  96. package/dist-lib/swift-compile.mjs +12 -12
  97. package/dist-lib/swift-package.cjs +1 -1
  98. package/dist-lib/swift-package.mjs +3 -3
  99. package/dist-lib/swift-submit.cjs +1 -1
  100. package/dist-lib/swift-submit.mjs +6 -6
  101. package/dist-lib/swift-svg-raster.cjs +1 -1
  102. package/dist-lib/swift-svg-raster.mjs +2 -2
  103. package/dist-lib/swift-toolchain.cjs +1 -1
  104. package/dist-lib/swift.cjs +1 -1
  105. package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
  106. package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
  107. package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
  108. package/dist-lib/vendor/acorn.cjs +1 -1
  109. package/dist-lib/vendor/magic-string.cjs +1 -1
  110. package/dist-lib/vendor/stream-json.cjs +1 -1
  111. package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
  112. package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
  113. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
  114. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
  115. package/dist-lib/vendor/sucrase.cjs +1 -1
  116. package/dist-lib/vendor/terser.cjs +1 -1
  117. package/dist-lib/vendor/valibot.cjs +1 -1
  118. package/dist-lib/vendor/ws.cjs +1 -1
  119. package/dist-lib/vendor/zod.cjs +1 -1
  120. package/dist-lib/worklet-executable.cjs +1 -1
  121. package/dist-lib/worklet-executable.mjs +3 -3
  122. package/package.json +1 -1
  123. package/src/android-gradle-sources.ts +97 -2
  124. package/src/androidGradleContract.ts +11 -0
  125. package/src/gitignore.ts +1 -1
  126. package/src/kotlin-app.ts +37 -4
  127. package/src/kotlin-gradle-library-plan.ts +142 -0
  128. package/src/kotlin-host.ts +32 -3
  129. package/src/kotlin-maven-sources.ts +0 -7
  130. package/src/plist.ts +13 -56
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2611 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2613 | (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;
@@ -273,8 +273,8 @@ function getDefaultPortForProtocol(protocol) {
273
273
  return protocol === "https:" ? 443 : 80;
274
274
  }
275
275
  function isBaseServerUrl(url) {
276
- const path140 = url.pathname || "/";
277
- return (path140 === "/" || path140 === "") && !url.search && !url.hash;
276
+ const path143 = url.pathname || "/";
277
+ return (path143 === "/" || path143 === "") && !url.search && !url.hash;
278
278
  }
279
279
  async function resolvePortViaServerScan(port) {
280
280
  try {
@@ -4687,10 +4687,10 @@ function* nativePackageVersionsWalk(projectRoot) {
4687
4687
  const manifest = yield* readManifest(import_path2.default.join(appRoot, "package.json"));
4688
4688
  if (!manifest) throw new Error("app package.json must contain an object");
4689
4689
  const readInstalledPackage = createInstalledPackageReader();
4690
- const pending = [{ root: appRoot, manifest }];
4690
+ const pending2 = [{ root: appRoot, manifest }];
4691
4691
  const visited = /* @__PURE__ */ new Set();
4692
4692
  const needed = /* @__PURE__ */ new Map();
4693
- for (let next = pending.pop(); next; next = pending.pop()) {
4693
+ for (let next = pending2.pop(); next; next = pending2.pop()) {
4694
4694
  const root = yield* realpath(next.root);
4695
4695
  if (visited.has(root)) continue;
4696
4696
  visited.add(root);
@@ -4710,7 +4710,7 @@ function* nativePackageVersionsWalk(projectRoot) {
4710
4710
  if (!installed) continue;
4711
4711
  if (nativeNames.has(name3) && !needed.has(name3))
4712
4712
  needed.set(name3, (yield* readInstalledPackage(appRoot, name3)) ?? installed);
4713
- pending.push(installed);
4713
+ pending2.push(installed);
4714
4714
  }
4715
4715
  }
4716
4716
  }
@@ -5768,13 +5768,13 @@ function detectPackageManager(root, files2 = nodeRepoFileReader) {
5768
5768
  }
5769
5769
  function scanRepository(root) {
5770
5770
  const directories = [];
5771
- const pending = [{ dir: root, depth: 0 }];
5771
+ const pending2 = [{ dir: root, depth: 0 }];
5772
5772
  let entries2 = 0;
5773
5773
  let cursor = 0;
5774
5774
  let truncated = false;
5775
5775
  let unreadable = 0;
5776
- while (cursor < pending.length && entries2 < 2e5 && directories.length < 1e4) {
5777
- const next = pending[cursor++];
5776
+ while (cursor < pending2.length && entries2 < 2e5 && directories.length < 1e4) {
5777
+ const next = pending2[cursor++];
5778
5778
  if (!next) break;
5779
5779
  directories.push(next.dir);
5780
5780
  let handle;
@@ -5794,7 +5794,7 @@ function scanRepository(root) {
5794
5794
  truncated = true;
5795
5795
  continue;
5796
5796
  }
5797
- pending.push({ dir: (0, import_node_path8.join)(next.dir, entry.name), depth: next.depth + 1 });
5797
+ pending2.push({ dir: (0, import_node_path8.join)(next.dir, entry.name), depth: next.depth + 1 });
5798
5798
  }
5799
5799
  } finally {
5800
5800
  handle.closeSync();
@@ -5802,7 +5802,7 @@ function scanRepository(root) {
5802
5802
  }
5803
5803
  return {
5804
5804
  directories: directories.sort(),
5805
- truncated: truncated || cursor < pending.length || entries2 >= 2e5,
5805
+ truncated: truncated || cursor < pending2.length || entries2 >= 2e5,
5806
5806
  unreadable
5807
5807
  };
5808
5808
  }
@@ -5813,8 +5813,8 @@ function metadataValue(value, key2) {
5813
5813
  if (!value || typeof value !== "object") return void 0;
5814
5814
  return Object.getOwnPropertyDescriptor(value, key2)?.value;
5815
5815
  }
5816
- function readProjectJson(path140, files2 = nodeRepoFileReader) {
5817
- const text7 = readProjectMetadata(path140, files2);
5816
+ function readProjectJson(path143, files2 = nodeRepoFileReader) {
5817
+ const text7 = readProjectMetadata(path143, files2);
5818
5818
  if (text7 === null) return null;
5819
5819
  try {
5820
5820
  const value = JSON.parse(text7);
@@ -5995,7 +5995,7 @@ function globToRegexSource(pattern) {
5995
5995
  if (j < pattern.length) {
5996
5996
  let body = pattern.slice(i + 1, j);
5997
5997
  if (body.startsWith("!")) body = `^${body.slice(1)}`;
5998
- out += `[${body}]`;
5998
+ out += `(?!/)[${body}]`;
5999
5999
  i = j + 1;
6000
6000
  continue;
6001
6001
  }
@@ -6071,16 +6071,16 @@ function createGitignoreMatcher() {
6071
6071
  return matcher;
6072
6072
  },
6073
6073
  test(relativePath2) {
6074
- const { path: path140, isDirectory: isDirectory5 } = normalizePath(relativePath2);
6075
- if (!path140) return { ignored: false, unignored: false };
6076
- const parts = path140.split("/");
6074
+ const { path: path143, isDirectory: isDirectory5 } = normalizePath(relativePath2);
6075
+ if (!path143) return { ignored: false, unignored: false };
6076
+ const parts = path143.split("/");
6077
6077
  let prefix = "";
6078
6078
  for (let i = 0; i < parts.length - 1; i++) {
6079
6079
  prefix = prefix ? `${prefix}/${parts[i]}` : parts[i];
6080
6080
  const parent = matchSingle(prefix, true);
6081
6081
  if (parent.ignored) return { ignored: true, unignored: false };
6082
6082
  }
6083
- return matchSingle(path140, isDirectory5);
6083
+ return matchSingle(path143, isDirectory5);
6084
6084
  },
6085
6085
  ignores(relativePath2) {
6086
6086
  return matcher.test(relativePath2).ignored;
@@ -10620,8 +10620,8 @@ export *
10620
10620
  }`;
10621
10621
  }
10622
10622
  function swiftPackageIdentity(url) {
10623
- const path140 = url.endsWith("/") ? url.slice(0, -1) : url;
10624
- return (path140.split("/").pop() ?? path140).replace(/\.git$/, "").toLowerCase();
10623
+ const path143 = url.endsWith("/") ? url.slice(0, -1) : url;
10624
+ return (path143.split("/").pop() ?? path143).replace(/\.git$/, "").toLowerCase();
10625
10625
  }
10626
10626
  function clangSettingEntries(settings, tool) {
10627
10627
  return (settings ?? []).flatMap(
@@ -11267,10 +11267,10 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs2) {
11267
11267
  const enclosing = scopes.length > 0 ? scopes[scopes.length - 1].prefix : [];
11268
11268
  if (scope2?.[3] === "enum" && opens > 0 && /(^|\s)(public|open)\s/.test(scope2[2] ?? "") && !/\bwhere\b/.test(first.masked) && first.masked[scope2.index + scope2[0].length] !== "<") {
11269
11269
  const name3 = scope2[4];
11270
- const path140 = scopeOf(name3, enclosing, false);
11271
- if (!byPath.has(path140.join(".")) && (path140.length === 1 || byPath.has(path140.slice(0, -1).join(".")))) {
11270
+ const path143 = scopeOf(name3, enclosing, false);
11271
+ if (!byPath.has(path143.join(".")) && (path143.length === 1 || byPath.has(path143.slice(0, -1).join(".")))) {
11272
11272
  const keptAttrs = [...(scope2[1] ?? "").matchAll(/@\w+(?:\([^)]*\))?/g)].map((attr) => attr[0]).filter((attr) => !attr.startsWith("@objc"));
11273
- const id = `s:peach-synthesized-${module2}-${path140.join(".")}`;
11273
+ const id = `s:peach-synthesized-${module2}-${path143.join(".")}`;
11274
11274
  const body = [];
11275
11275
  let inner = 1;
11276
11276
  let closed = false;
@@ -11325,15 +11325,15 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs2) {
11325
11325
  symbols.push({
11326
11326
  kind: { identifier: "swift.enum" },
11327
11327
  identifier: { precise: id },
11328
- pathComponents: path140,
11328
+ pathComponents: path143,
11329
11329
  declarationFragments: fragments,
11330
11330
  accessLevel: "public"
11331
11331
  });
11332
- if (path140.length > 1)
11332
+ if (path143.length > 1)
11333
11333
  relationships.push({
11334
11334
  kind: "memberOf",
11335
11335
  source: id,
11336
- target: byPath.get(path140.slice(0, -1).join("."))
11336
+ target: byPath.get(path143.slice(0, -1).join("."))
11337
11337
  });
11338
11338
  for (const kase of cases) {
11339
11339
  const memberId = `${id}-${kase.leaf}`;
@@ -11342,7 +11342,7 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs2) {
11342
11342
  symbols.push({
11343
11343
  kind: { identifier: "swift.enum.case" },
11344
11344
  identifier: { precise: memberId },
11345
- pathComponents: [...path140, kase.leaf],
11345
+ pathComponents: [...path143, kase.leaf],
11346
11346
  declarationFragments: [
11347
11347
  { kind: "keyword", spelling: "case" },
11348
11348
  { kind: "text", spelling: " " },
@@ -11358,7 +11358,7 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs2) {
11358
11358
  symbols.push({
11359
11359
  kind: { identifier: "swift.init" },
11360
11360
  identifier: { precise: initId },
11361
- pathComponents: [...path140, "init(rawValue:)"],
11361
+ pathComponents: [...path143, "init(rawValue:)"],
11362
11362
  declarationFragments: [
11363
11363
  { kind: "keyword", spelling: "init" },
11364
11364
  { kind: "text", spelling: "?(" },
@@ -11437,7 +11437,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
11437
11437
  })
11438
11438
  )
11439
11439
  );
11440
- const trap = (path140) => `fatalError("${path140} is ${options2.placeholder === void 0 ? "a binary framework" : "a placeholder"} peach cannot run")`;
11440
+ const trap = (path143) => `fatalError("${path143} is ${options2.placeholder === void 0 ? "a binary framework" : "a placeholder"} peach cannot run")`;
11441
11441
  const skipped = [];
11442
11442
  const behavior = options2.behavior ?? /* @__PURE__ */ new Map();
11443
11443
  const used = /* @__PURE__ */ new Set();
@@ -11788,34 +11788,34 @@ function emitSwiftStandin(sourceGraphs, options2) {
11788
11788
  lines.push(...physical);
11789
11789
  owners.push(...physical.map(() => current2));
11790
11790
  };
11791
- const emitAt = (path140, line) => {
11792
- if (omit.has(path140)) return;
11791
+ const emitAt = (path143, line) => {
11792
+ if (omit.has(path143)) return;
11793
11793
  const previous = current2;
11794
- current2 = path140;
11794
+ current2 = path143;
11795
11795
  emit(line);
11796
11796
  current2 = previous;
11797
11797
  };
11798
11798
  const emitInertState = (id, indent2, build2) => {
11799
- const path140 = pathOf(byId.get(id));
11799
+ const path143 = pathOf(byId.get(id));
11800
11800
  emitAt(hiddenInit(id), `${indent2}init(_peachInert: Void) { ${build2} }`);
11801
11801
  const list2 = conforms.get(id) ?? [];
11802
11802
  const has = (name3) => (children.get(id) ?? []).some((member) => leaf(member) === name3);
11803
11803
  if (list2.includes("Encodable") && !has("encode(to:)"))
11804
11804
  emitAt(
11805
- `${path140}.encode(to:)`,
11805
+ `${path143}.encode(to:)`,
11806
11806
  `${indent2}public func encode(to encoder: Encoder) throws {}`
11807
11807
  );
11808
11808
  if (list2.includes("Decodable") && !has("init(from:)"))
11809
11809
  emitAt(
11810
- `${path140}.init(from:)`,
11810
+ `${path143}.init(from:)`,
11811
11811
  `${indent2}public init(from decoder: Decoder) throws { self.init(_peachInert: ()) }`
11812
11812
  );
11813
11813
  };
11814
11814
  const scoped = (body) => (symbol2, ...rest) => {
11815
- const path140 = pathOf(symbol2);
11816
- if (omit.has(path140)) return void skipped.push({ path: path140, reason: omit.get(path140) });
11815
+ const path143 = pathOf(symbol2);
11816
+ if (omit.has(path143)) return void skipped.push({ path: path143, reason: omit.get(path143) });
11817
11817
  const previous = current2;
11818
- current2 = path140;
11818
+ current2 = path143;
11819
11819
  try {
11820
11820
  body(symbol2, ...rest);
11821
11821
  } finally {
@@ -11847,7 +11847,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
11847
11847
  };
11848
11848
  const emitMember = scoped(
11849
11849
  (member, indent2, context) => {
11850
- const path140 = pathOf(member);
11850
+ const path143 = pathOf(member);
11851
11851
  if (TYPE_KINDS.has(member.kind.identifier)) {
11852
11852
  const origin = origins.get(member.identifier.precise)?.split(".")[0];
11853
11853
  const parent = owner.get(member.identifier.precise);
@@ -11864,7 +11864,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
11864
11864
  ))
11865
11865
  return;
11866
11866
  if (!MEMBER_KINDS.has(member.kind.identifier)) {
11867
- skipped.push({ path: path140, reason: `unhandled ${member.kind.identifier}` });
11867
+ skipped.push({ path: path143, reason: `unhandled ${member.kind.identifier}` });
11868
11868
  return;
11869
11869
  }
11870
11870
  const { 1: spelledAttrs, 2: rest } = LEADING_ATTRS.exec(text(member));
@@ -11875,15 +11875,15 @@ function emitSwiftStandin(sourceGraphs, options2) {
11875
11875
  const selector = context.inClass && !options2.inert && member.kind.identifier === "swift.type.method" && !/\basync\b/.test(rest) ? /^c:objc\(cs\)\w+\(cm\)([A-Za-z_][A-Za-z_0-9:]*)$/.exec(
11876
11876
  member.identifier.precise
11877
11877
  )?.[1] : void 0;
11878
- const attrs = options2.unobjc?.has(path140) ? wrapped.replace(/@objc(?:\([^)]*\))?\s*/g, "") : `${wrapped}${selector ? `@objc(${selector}) ` : ""}`;
11878
+ const attrs = options2.unobjc?.has(path143) ? wrapped.replace(/@objc(?:\([^)]*\))?\s*/g, "") : `${wrapped}${selector ? `@objc(${selector}) ` : ""}`;
11879
11879
  const modifiers = /^((?:(?:required|final|override|convenience|unowned(?:\(\w+\))?|weak|lazy|nonisolated|mutating|nonmutating) )*)(.*)$/s.exec(
11880
11880
  rest
11881
11881
  );
11882
11882
  const flags = new Set(
11883
11883
  modifiers[1].trim().split(/\s+/).filter(Boolean).map((flag) => flag.replace(/\(.*/, ""))
11884
11884
  );
11885
- const requiredInit = context.inClass && !!options2.requiredInits?.has(path140);
11886
- const restatesRequired = context.inClass && path140.endsWith(".init()") && [...superChain(owner.get(member.identifier.precise) ?? "")].some(
11885
+ const requiredInit = context.inClass && !!options2.requiredInits?.has(path143);
11886
+ const restatesRequired = context.inClass && path143.endsWith(".init()") && [...superChain(owner.get(member.identifier.precise) ?? "")].some(
11887
11887
  (at) => options2.requiredInits?.has(`${pathOf(byId.get(at))}.init()`)
11888
11888
  );
11889
11889
  const protocolInit = member.kind.identifier === "swift.init" && /^c:objc\(pl\)\w+\(im\).*::SYNTHESIZED::c:objc\(cs\)/.test(
@@ -11893,7 +11893,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
11893
11893
  const final = context.inClass && flags.has("final") ? "final " : "";
11894
11894
  const mutating = flags.has("mutating") ? "mutating " : flags.has("nonmutating") ? "nonmutating " : "";
11895
11895
  let core = `${flags.has("convenience") ? "convenience " : ""}${modifiers[2]}`;
11896
- for (const type of options2.unwrappedParameters?.get(path140) ?? [])
11896
+ for (const type of options2.unwrappedParameters?.get(path143) ?? [])
11897
11897
  core = core.replace(
11898
11898
  new RegExp(
11899
11899
  `(:\\s*(?:\\w+\\.)*${type.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})(?=\\s*[,)])`,
@@ -11901,12 +11901,12 @@ function emitSwiftStandin(sourceGraphs, options2) {
11901
11901
  ),
11902
11902
  "$1!"
11903
11903
  );
11904
- const override = context.inClass && !options2.plain?.has(path140) && !restatesRequired && (flags.has("override") || overrides.has(member.identifier.precise) || options2.forcedOverride?.has(path140) || isObjC(member) && path140.endsWith(".init()")) ? "override " : "";
11904
+ const override = context.inClass && !options2.plain?.has(path143) && !restatesRequired && (flags.has("override") || overrides.has(member.identifier.precise) || options2.forcedOverride?.has(path143) || isObjC(member) && path143.endsWith(".init()")) ? "override " : "";
11905
11905
  const head = `${indent2}${attrs}${access(member, context.openOwner)} ${required ? "required " : ""}${final}${override}${mutating}`;
11906
- const measured = behavior.get(path140);
11907
- if (measured) used.add(path140);
11906
+ const measured = behavior.get(path143);
11907
+ if (measured) used.add(path143);
11908
11908
  const overloadBody = /\basync\b/.test(core) ? measured?.asyncBody : /\bResult</.test(core) ? measured?.resultBody : void 0;
11909
- const body = overloadBody ?? measured?.body ?? (options2.inert ? inertBody(member) : trap(path140));
11909
+ const body = overloadBody ?? measured?.body ?? (options2.inert ? inertBody(member) : trap(path143));
11910
11910
  switch (member.kind.identifier) {
11911
11911
  case "swift.property":
11912
11912
  case "swift.type.property":
@@ -11919,13 +11919,13 @@ function emitSwiftStandin(sourceGraphs, options2) {
11919
11919
  const parameter = !measured && !options2.inert && !settable && /:\s*some\s/.test(decl) ? opaqueParameter(member) : void 0;
11920
11920
  const getter = parameter ? `return ({ () -> ${parameter} in ${body} })()` : body;
11921
11921
  const computed = decl.replace(/^((?:static |class )*)let /, "$1var ");
11922
- const wrapper = options2.projections?.get(path140);
11922
+ const wrapper = options2.projections?.get(path143);
11923
11923
  if (wrapper) {
11924
11924
  const type = /^var\s+`?\w+`?\s*:\s*(.+)$/s.exec(computed)?.[1];
11925
- const initial = type && inertValue(type, /* @__PURE__ */ new Set(), [path140]);
11925
+ const initial = type && inertValue(type, /* @__PURE__ */ new Set(), [path143]);
11926
11926
  if (!initial)
11927
11927
  return void skipped.push({
11928
- path: path140,
11928
+ path: path143,
11929
11929
  reason: `wrapped by ${wrapper} with no inert initial value`
11930
11930
  });
11931
11931
  const own2 = new RegExp(
@@ -11946,7 +11946,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
11946
11946
  return;
11947
11947
  }
11948
11948
  emit(
11949
- `${head.replace(/@NSCopying\b\s*/g, "")}${computed} { get${effects} { ${getter} }${settable && !effects ? ` ${parsed2.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? (options2.inert ? "" : trap(path140))} }` : ""} }`
11949
+ `${head.replace(/@NSCopying\b\s*/g, "")}${computed} { get${effects} { ${getter} }${settable && !effects ? ` ${parsed2.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? (options2.inert ? "" : trap(path143))} }` : ""} }`
11950
11950
  );
11951
11951
  return;
11952
11952
  }
@@ -12005,7 +12005,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
12005
12005
  };
12006
12006
  const emitType = scoped(
12007
12007
  (symbol2, indent2) => {
12008
- const path140 = pathOf(symbol2);
12008
+ const path143 = pathOf(symbol2);
12009
12009
  const id = symbol2.identifier.precise;
12010
12010
  const inner = `${indent2} `;
12011
12011
  switch (symbol2.kind.identifier) {
@@ -12022,10 +12022,10 @@ function emitSwiftStandin(sourceGraphs, options2) {
12022
12022
  case "swift.class": {
12023
12023
  const shape = header(symbol2, "class", indent2);
12024
12024
  if (!shape)
12025
- return void skipped.push({ path: path140, reason: `unparsed class ${text(symbol2)}` });
12026
- const parent = options2.superclasses?.get(path140) ?? superclass.get(id);
12025
+ return void skipped.push({ path: path143, reason: `unparsed class ${text(symbol2)}` });
12026
+ const parent = options2.superclasses?.get(path143) ?? superclass.get(id);
12027
12027
  const blocked = classBlocked(id);
12028
- if (blocked) return void skipped.push({ path: path140, reason: blocked });
12028
+ if (blocked) return void skipped.push({ path: path143, reason: blocked });
12029
12029
  const ancestors = /* @__PURE__ */ new Set();
12030
12030
  const inherited = /* @__PURE__ */ new Set();
12031
12031
  for (let at = superId.get(id); at; at = superId.get(at)) {
@@ -12041,7 +12041,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
12041
12041
  "Equatable",
12042
12042
  "CustomStringConvertible",
12043
12043
  "CustomDebugStringConvertible"
12044
- ].includes(name3)) && !(name3 === nsObjectProtocol && externalRoot(id) === nsObject) && !options2.unconformed?.get(path140)?.has(name3.split(/::|\./).pop()) && !options2.unconformed?.get(path140)?.has(name3)
12044
+ ].includes(name3)) && !(name3 === nsObjectProtocol && externalRoot(id) === nsObject) && !options2.unconformed?.get(path143)?.has(name3.split(/::|\./).pop()) && !options2.unconformed?.get(path143)?.has(name3)
12045
12045
  )
12046
12046
  ].filter((name3, at, all2) => all2.indexOf(name3) === at);
12047
12047
  const parentSymbol = superId.has(id) ? byId.get(superId.get(id)) : void 0;
@@ -12053,9 +12053,9 @@ function emitSwiftStandin(sourceGraphs, options2) {
12053
12053
  `${indent2}${shape.attrs}${objcName ? `@objc(${objcName}) ` : ""}${shape.final}${open ? "open" : "public"} class ${shape.name}${shape.generics}${list2.length ? `: ${list2.join(", ")}` : ""}${selfConforming(shape.where)} {`
12054
12054
  );
12055
12055
  const members2 = membersOf(id);
12056
- const extra = options2.behavior?.get(path140)?.members;
12056
+ const extra = options2.behavior?.get(path143)?.members;
12057
12057
  if (extra) {
12058
- used.add(path140);
12058
+ used.add(path143);
12059
12059
  emit(`${inner}${extra}`);
12060
12060
  }
12061
12061
  for (const member of members2)
@@ -12111,11 +12111,11 @@ function emitSwiftStandin(sourceGraphs, options2) {
12111
12111
  if (protocol && member.kind.identifier === "swift.method" && leaf(member).endsWith("()") && have.has(`instance|leaf|${leaf(member).slice(0, -2)}`))
12112
12112
  propertyWitnesses.push({
12113
12113
  owner: current2,
12114
- head: `extension ${pathOf(protocol)} where Self: ${path140} {`,
12114
+ head: `extension ${pathOf(protocol)} where Self: ${path143} {`,
12115
12115
  member,
12116
- path: path140
12116
+ path: path143
12117
12117
  });
12118
- else emitWitness(member, inner, path140, open && isObjC(member));
12118
+ else emitWitness(member, inner, path143, open && isObjC(member));
12119
12119
  }
12120
12120
  }
12121
12121
  if (options2.inert && designated2 && classBuild(id) === "hidden")
@@ -12123,13 +12123,13 @@ function emitSwiftStandin(sourceGraphs, options2) {
12123
12123
  const coder = members2.some((member) => leaf(member) === "init(coder:)");
12124
12124
  if (designated2 && !coder && externalRoot(id) !== "NSObject" && externalRoot(id) !== null)
12125
12125
  emit(
12126
- `${inner}public required init${options2.coderNonfailable?.has(path140) ? "" : "?"}(coder: NSCoder) { ${options2.inert && !options2.coderNonfailable?.has(path140) ? "return nil" : trap(`${path140}.init(coder:)`)} }`
12126
+ `${inner}public required init${options2.coderNonfailable?.has(path143) ? "" : "?"}(coder: NSCoder) { ${options2.inert && !options2.coderNonfailable?.has(path143) ? "return nil" : trap(`${path143}.init(coder:)`)} }`
12127
12127
  );
12128
12128
  if (designated2 && !members2.some((member) => leaf(member) === "init()") && [...superChain(id)].some(
12129
12129
  (at) => options2.requiredInits?.has(`${pathOf(byId.get(at))}.init()`)
12130
12130
  ))
12131
12131
  emit(
12132
- `${inner}public required init() { ${options2.inert ? superInit(id) : trap(`${path140}.init()`)} }`
12132
+ `${inner}public required init() { ${options2.inert ? superInit(id) : trap(`${path143}.init()`)} }`
12133
12133
  );
12134
12134
  emit(`${indent2}}`);
12135
12135
  return;
@@ -12137,7 +12137,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
12137
12137
  case "swift.struct": {
12138
12138
  const shape = header(symbol2, "struct", indent2);
12139
12139
  if (!shape)
12140
- return void skipped.push({ path: path140, reason: `unparsed struct ${text(symbol2)}` });
12140
+ return void skipped.push({ path: path143, reason: `unparsed struct ${text(symbol2)}` });
12141
12141
  const members2 = membersOf(id);
12142
12142
  const raw2 = rawType(members2);
12143
12143
  const list2 = inheritance(id);
@@ -12177,7 +12177,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
12177
12177
  emitInertState(
12178
12178
  id,
12179
12179
  inner,
12180
- raw2 ? `self.rawValue = ${inertValue(raw2, /* @__PURE__ */ new Set(), [path140]) ?? "0"}` : ""
12180
+ raw2 ? `self.rawValue = ${inertValue(raw2, /* @__PURE__ */ new Set(), [path143]) ?? "0"}` : ""
12181
12181
  );
12182
12182
  emit(`${indent2}}`);
12183
12183
  return;
@@ -12185,7 +12185,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
12185
12185
  case "swift.enum": {
12186
12186
  const shape = header(symbol2, "enum", indent2);
12187
12187
  if (!shape)
12188
- return void skipped.push({ path: path140, reason: `unparsed enum ${text(symbol2)}` });
12188
+ return void skipped.push({ path: path143, reason: `unparsed enum ${text(symbol2)}` });
12189
12189
  const members2 = membersOf(id);
12190
12190
  const cases = members2.filter(
12191
12191
  (member) => member.kind.identifier === "swift.enum.case"
@@ -12195,7 +12195,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
12195
12195
  const missing2 = raw2 ? cases.filter((member) => !values.has(member.identifier.precise)) : [];
12196
12196
  if (raw2 && (isObjC(symbol2) || /^c:@C?M@[^@]+@E@/.test(id)) && missing2.length > 0)
12197
12197
  return void skipped.push({
12198
- path: path140,
12198
+ path: path143,
12199
12199
  reason: `no header value for ${missing2.map(leaf).join(", ")}`
12200
12200
  });
12201
12201
  const list2 = inheritance(id, raw2 ?? void 0).filter(
@@ -12234,8 +12234,8 @@ function emitSwiftStandin(sourceGraphs, options2) {
12234
12234
  });
12235
12235
  }
12236
12236
  if (options2.inert) {
12237
- const value = options2.trapped?.has(hiddenInit(id)) ? null : inertValue(path140, /* @__PURE__ */ new Set(), []);
12238
- emitInertState(id, inner, value === null ? trap(path140) : `self = ${value}`);
12237
+ const value = options2.trapped?.has(hiddenInit(id)) ? null : inertValue(path143, /* @__PURE__ */ new Set(), []);
12238
+ emitInertState(id, inner, value === null ? trap(path143) : `self = ${value}`);
12239
12239
  }
12240
12240
  emit(`${indent2}}`);
12241
12241
  return;
@@ -12244,14 +12244,14 @@ function emitSwiftStandin(sourceGraphs, options2) {
12244
12244
  const shape = header(symbol2, "protocol", indent2);
12245
12245
  if (!shape)
12246
12246
  return void skipped.push({
12247
- path: path140,
12247
+ path: path143,
12248
12248
  reason: `unparsed protocol ${text(symbol2)}`
12249
12249
  });
12250
12250
  const native = nativeObjcProtocols.has(id);
12251
12251
  const objcName = native ? /^c:objc\(pl\)(\w+)$/.exec(id)?.[1] : void 0;
12252
12252
  if (native && !objcName)
12253
12253
  return void skipped.push({
12254
- path: path140,
12254
+ path: path143,
12255
12255
  reason: `unknown Objective-C protocol identity ${id}`
12256
12256
  });
12257
12257
  const list2 = [
@@ -12279,7 +12279,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
12279
12279
  }
12280
12280
  emit(`${indent2}}`);
12281
12281
  if (defaults.length > 0) {
12282
- emit(`${indent2}extension ${path140} {`);
12282
+ emit(`${indent2}extension ${path143} {`);
12283
12283
  for (const member of defaults) {
12284
12284
  const decl = text(member);
12285
12285
  if (optional3.has(member.identifier.precise) && member.kind.identifier === "swift.method" && !decl.replace(/\([^)]*\)/g, "").includes("->") && !/ async\b/.test(decl))
@@ -12373,7 +12373,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
12373
12373
  return null;
12374
12374
  };
12375
12375
  const emitGlobal = scoped((symbol2) => {
12376
- const path140 = pathOf(symbol2);
12376
+ const path143 = pathOf(symbol2);
12377
12377
  const kind = symbol2.kind.identifier;
12378
12378
  if (kind === "swift.func" || kind === "swift.func.op" || kind === "swift.method" || kind === "swift.type.method") {
12379
12379
  const { 1: attrs, 2: rest } = LEADING_ATTRS.exec(text(symbol2));
@@ -12382,20 +12382,20 @@ function emitSwiftStandin(sourceGraphs, options2) {
12382
12382
  if (leaf(symbol2).endsWith("(_:)") && !/^(?:prefix|infix|postfix)\b/.test(spelled2))
12383
12383
  spelled2 = `prefix ${spelled2}`;
12384
12384
  }
12385
- const measured = behavior.get(path140);
12386
- if (measured) used.add(path140);
12385
+ const measured = behavior.get(path143);
12386
+ if (measured) used.add(path143);
12387
12387
  const overloadBody = /\basync\b/.test(spelled2) ? measured?.asyncBody : /\bResult</.test(spelled2) ? measured?.resultBody : void 0;
12388
12388
  emit(
12389
- `${attrs}public ${spelled2} { ${overloadBody ?? measured?.body ?? (options2.inert ? inertBody(symbol2) : trap(path140))} }`
12389
+ `${attrs}public ${spelled2} { ${overloadBody ?? measured?.body ?? (options2.inert ? inertBody(symbol2) : trap(path143))} }`
12390
12390
  );
12391
12391
  } else if (kind === "swift.var") {
12392
12392
  const parsed2 = splitAccessors(text(symbol2).replace(/^let /, "var "));
12393
- const measured = behavior.get(path140);
12394
- if (measured) used.add(path140);
12393
+ const measured = behavior.get(path143);
12394
+ if (measured) used.add(path143);
12395
12395
  emit(
12396
- `public ${parsed2.decl} { ${measured?.body ?? (options2.inert ? inertBody(symbol2) : trap(path140))} }`
12396
+ `public ${parsed2.decl} { ${measured?.body ?? (options2.inert ? inertBody(symbol2) : trap(path143))} }`
12397
12397
  );
12398
- } else skipped.push({ path: path140, reason: `unhandled top-level ${kind}` });
12398
+ } else skipped.push({ path: path143, reason: `unhandled top-level ${kind}` });
12399
12399
  });
12400
12400
  const cExports = new Set(
12401
12401
  [...byId.values()].flatMap((symbol2) => {
@@ -12412,7 +12412,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
12412
12412
  return !name3 || !cExports.has(`${name3}|${text(symbol2)}`);
12413
12413
  }).sort((a, b) => pathOf(a).localeCompare(pathOf(b)));
12414
12414
  for (const symbol2 of roots) {
12415
- const path140 = pathOf(symbol2);
12415
+ const path143 = pathOf(symbol2);
12416
12416
  if (TYPE_KINDS.has(symbol2.kind.identifier)) emitType(symbol2, "");
12417
12417
  else emitGlobal(symbol2);
12418
12418
  }
@@ -12492,9 +12492,9 @@ function emitSwiftStandin(sourceGraphs, options2) {
12492
12492
  "#endif",
12493
12493
  ""
12494
12494
  ];
12495
- for (const path140 of behavior.keys())
12496
- if (!used.has(path140))
12497
- skipped.push({ path: path140, reason: "behavior names no emitted declaration" });
12495
+ for (const path143 of behavior.keys())
12496
+ if (!used.has(path143))
12497
+ skipped.push({ path: path143, reason: "behavior names no emitted declaration" });
12498
12498
  return {
12499
12499
  source: `${[...banner, ...lines].join("\n")}
12500
12500
  `,
@@ -14785,9 +14785,9 @@ function originalColumn(line, column) {
14785
14785
  }
14786
14786
  function designTimeDiagnostic(output, files2) {
14787
14787
  const rewritten = /* @__PURE__ */ new Map();
14788
- const linesOf = (path140) => {
14788
+ const linesOf = (path143) => {
14789
14789
  const file = Object.keys(files2).find(
14790
- (name3) => name3.endsWith(".swift") && (path140 === name3 || path140.endsWith(`/${name3}`))
14790
+ (name3) => name3.endsWith(".swift") && (path143 === name3 || path143.endsWith(`/${name3}`))
14791
14791
  );
14792
14792
  if (file === void 0) return null;
14793
14793
  let lines = rewritten.get(file);
@@ -16136,18 +16136,18 @@ function* guestLinkLines(file) {
16136
16136
  try {
16137
16137
  const decoder = new import_node_string_decoder.StringDecoder("utf8");
16138
16138
  const buffer = Buffer.allocUnsafe(64 * 1024);
16139
- let pending = "";
16139
+ let pending2 = "";
16140
16140
  let count;
16141
16141
  while ((count = (0, import_node_fs28.readSync)(input, buffer, 0, buffer.length, null)) > 0) {
16142
- const text7 = pending + decoder.write(buffer.subarray(0, count));
16142
+ const text7 = pending2 + decoder.write(buffer.subarray(0, count));
16143
16143
  let start = 0;
16144
16144
  for (let end = text7.indexOf("\n"); end !== -1; end = text7.indexOf("\n", start)) {
16145
16145
  yield text7.slice(start, end);
16146
16146
  start = end + 1;
16147
16147
  }
16148
- pending = text7.slice(start);
16148
+ pending2 = text7.slice(start);
16149
16149
  }
16150
- yield pending + decoder.end();
16150
+ yield pending2 + decoder.end();
16151
16151
  } finally {
16152
16152
  (0, import_node_fs28.closeSync)(input);
16153
16153
  }
@@ -20126,25 +20126,25 @@ function vectorSection(id, count, parts) {
20126
20126
  }
20127
20127
  function rewriteSections(bytes, sections, changes) {
20128
20128
  const out = [bytes.subarray(0, 8)];
20129
- const pending = new Map(changes);
20129
+ const pending2 = new Map(changes);
20130
20130
  const flushBefore = (id) => {
20131
- for (const [missing2, section2] of pending) {
20131
+ for (const [missing2, section2] of pending2) {
20132
20132
  if (SECTION_ORDER.indexOf(missing2) >= SECTION_ORDER.indexOf(id)) continue;
20133
20133
  if (section2) out.push(section2);
20134
- pending.delete(missing2);
20134
+ pending2.delete(missing2);
20135
20135
  }
20136
20136
  };
20137
20137
  for (const s of sections) {
20138
20138
  if (s.id !== 0) flushBefore(s.id);
20139
- if (!pending.has(s.id)) {
20139
+ if (!pending2.has(s.id)) {
20140
20140
  out.push(bytes.subarray(s.offset, s.end));
20141
20141
  continue;
20142
20142
  }
20143
- const section2 = pending.get(s.id);
20144
- pending.delete(s.id);
20143
+ const section2 = pending2.get(s.id);
20144
+ pending2.delete(s.id);
20145
20145
  if (section2) out.push(section2);
20146
20146
  }
20147
- for (const section2 of pending.values()) if (section2) out.push(section2);
20147
+ for (const section2 of pending2.values()) if (section2) out.push(section2);
20148
20148
  return Buffer.concat(out);
20149
20149
  }
20150
20150
  function entries(bytes, section2, entry) {
@@ -25773,15 +25773,15 @@ function projectOutputFile(root, file, user) {
25773
25773
  return real;
25774
25774
  }
25775
25775
  function removeProjectLinks(root) {
25776
- const pending = [root];
25777
- for (let directory2 = pending.pop(); directory2; directory2 = pending.pop()) {
25776
+ const pending2 = [root];
25777
+ for (let directory2 = pending2.pop(); directory2; directory2 = pending2.pop()) {
25778
25778
  for (const entry of (0, import_node_fs36.readdirSync)(directory2, { withFileTypes: true })) {
25779
25779
  const full = import_node_path34.default.join(directory2, entry.name);
25780
25780
  if (directory2 === root && entry.name === ".build") continue;
25781
25781
  if (directory2 === root && entry.name.startsWith(".peach-modules-")) {
25782
25782
  (0, import_node_fs36.rmSync)(full, { recursive: true, force: true });
25783
25783
  } else if (entry.isSymbolicLink()) (0, import_node_fs36.rmSync)(full);
25784
- else if (entry.isDirectory()) pending.push(full);
25784
+ else if (entry.isDirectory()) pending2.push(full);
25785
25785
  }
25786
25786
  }
25787
25787
  }
@@ -25901,13 +25901,13 @@ function swiftSdkGuestLookups(moduleRoot, sdkRoot, objects) {
25901
25901
  const shared = /* @__PURE__ */ new Set();
25902
25902
  const sdkWeakReferences = /* @__PURE__ */ new Map();
25903
25903
  for (const objects2 of groups.values())
25904
- for (const { path: path140, bytes } of objects2) {
25904
+ for (const { path: path143, bytes } of objects2) {
25905
25905
  const defined = guestWasmSymbols(bytes);
25906
25906
  for (const name3 of defined.defined) symbols.add(name3);
25907
25907
  for (const name3 of defined.tags) shared.add(name3);
25908
25908
  for (const name3 of defined.globals) shared.add(name3);
25909
25909
  if (defined.weakUndefined.length)
25910
- sdkWeakReferences.set(path140, new Set(defined.weakUndefined));
25910
+ sdkWeakReferences.set(path143, new Set(defined.weakUndefined));
25911
25911
  }
25912
25912
  return createGuestImageLedger({
25913
25913
  images,
@@ -29396,7 +29396,7 @@ function dumpInputs(dir, xcode) {
29396
29396
  swiftCodeScan(source).lineStarts,
29397
29397
  (line) => line.replace(
29398
29398
  MANIFEST_HOST_OS,
29399
- (match, os24) => (os24 === "macOS" ? "true" : "false").padEnd(match.length)
29399
+ (match, os25) => (os25 === "macOS" ? "true" : "false").padEnd(match.length)
29400
29400
  )
29401
29401
  );
29402
29402
  if (projected !== source) overlays.push({ name: name3, source: projected });
@@ -29468,8 +29468,8 @@ async function prepareSwiftPackageManifest(dir, xcode) {
29468
29468
  await prepareSwiftManifestToolchain();
29469
29469
  const { command, env, key: key2, overlays, cached: cached2 } = dumpInputs(dir, xcode);
29470
29470
  if (import_node_fs41.default.existsSync(cached2)) return;
29471
- const pending = manifestPreparations.get(key2);
29472
- if (pending) return pending;
29471
+ const pending2 = manifestPreparations.get(key2);
29472
+ if (pending2) return pending2;
29473
29473
  const work = (async () => {
29474
29474
  import_node_fs41.default.mkdirSync(cacheDir2, { recursive: true });
29475
29475
  const scratch2 = import_node_fs41.default.mkdtempSync(import_node_path39.default.join(cacheDir2, `${key2}-`));
@@ -29536,12 +29536,12 @@ function defaultTraits(manifest) {
29536
29536
  ])
29537
29537
  );
29538
29538
  const enabled = /* @__PURE__ */ new Set();
29539
- const pending = [...traits.get("default") ?? []];
29540
- while (pending.length > 0) {
29541
- const name3 = pending.pop();
29539
+ const pending2 = [...traits.get("default") ?? []];
29540
+ while (pending2.length > 0) {
29541
+ const name3 = pending2.pop();
29542
29542
  if (enabled.has(name3)) continue;
29543
29543
  enabled.add(name3);
29544
- pending.push(...traits.get(name3) ?? []);
29544
+ pending2.push(...traits.get(name3) ?? []);
29545
29545
  }
29546
29546
  return enabled;
29547
29547
  }
@@ -30025,9 +30025,9 @@ async function swiftDistributionRoot(signal) {
30025
30025
  "swift-distributions",
30026
30026
  `${lock.id}-${host2}-${lock.hosts[host2].sha256}`
30027
30027
  );
30028
- let pending = installs.get(dir);
30029
- if (pending?.controller.signal.aborted) pending = void 0;
30030
- if (!pending) {
30028
+ let pending2 = installs.get(dir);
30029
+ if (pending2?.controller.signal.aborted) pending2 = void 0;
30030
+ if (!pending2) {
30031
30031
  const controller = new AbortController();
30032
30032
  const promise = (async () => {
30033
30033
  if (!import_node_fs42.default.existsSync(import_node_path40.default.join(dir, SWIFT_DISTRIBUTION_MANIFEST))) {
@@ -30056,10 +30056,10 @@ async function swiftDistributionRoot(signal) {
30056
30056
  })().finally(() => {
30057
30057
  if (installs.get(dir)?.controller === controller) installs.delete(dir);
30058
30058
  });
30059
- pending = { promise, controller, clients: 0 };
30060
- installs.set(dir, pending);
30059
+ pending2 = { promise, controller, clients: 0 };
30060
+ installs.set(dir, pending2);
30061
30061
  }
30062
- const current2 = pending;
30062
+ const current2 = pending2;
30063
30063
  current2.clients++;
30064
30064
  let released = false;
30065
30065
  const release = () => {
@@ -30389,13 +30389,13 @@ function lockDirectoryFor(root) {
30389
30389
  function acquireSwiftRootReadHold(root) {
30390
30390
  const directory2 = lockDirectoryFor(root);
30391
30391
  const token = (0, import_node_crypto26.randomUUID)();
30392
- const pending = import_node_path41.default.join(directory2, `pending.reader.${token}`);
30392
+ const pending2 = import_node_path41.default.join(directory2, `pending.reader.${token}`);
30393
30393
  const reader = import_node_path41.default.join(directory2, `reader.${token}`);
30394
- (0, import_node_fs43.writeFileSync)(pending, JSON.stringify(ownIdentity(process.pid)));
30394
+ (0, import_node_fs43.writeFileSync)(pending2, JSON.stringify(ownIdentity(process.pid)));
30395
30395
  try {
30396
- (0, import_node_fs43.linkSync)(pending, reader);
30396
+ (0, import_node_fs43.linkSync)(pending2, reader);
30397
30397
  } finally {
30398
- (0, import_node_fs43.rmSync)(pending, { force: true });
30398
+ (0, import_node_fs43.rmSync)(pending2, { force: true });
30399
30399
  }
30400
30400
  let released = false;
30401
30401
  return {
@@ -30446,7 +30446,7 @@ async function withSwiftRootLock(root, work, signal, wait = true) {
30446
30446
  );
30447
30447
  if (!ownRow) throw new Error(`swift root lock cannot find process ${process.pid}`);
30448
30448
  const owner = JSON.stringify({ pid: process.pid, start: ownRow.start });
30449
- const pending = import_node_path41.default.join(directory2, `pending.${token}`);
30449
+ const pending2 = import_node_path41.default.join(directory2, `pending.${token}`);
30450
30450
  let held = 0;
30451
30451
  let announced = 0;
30452
30452
  let current2 = null;
@@ -30485,14 +30485,14 @@ async function withSwiftRootLock(root, work, signal, wait = true) {
30485
30485
  }
30486
30486
  }
30487
30487
  }
30488
- (0, import_node_fs43.writeFileSync)(pending, owner);
30488
+ (0, import_node_fs43.writeFileSync)(pending2, owner);
30489
30489
  try {
30490
- (0, import_node_fs43.linkSync)(pending, import_node_path41.default.join(directory2, name(newest + 1, "owner")));
30490
+ (0, import_node_fs43.linkSync)(pending2, import_node_path41.default.join(directory2, name(newest + 1, "owner")));
30491
30491
  } catch (error) {
30492
30492
  if (errorCode(error) === "EEXIST") continue;
30493
30493
  throw error;
30494
30494
  } finally {
30495
- (0, import_node_fs43.rmSync)(pending, { force: true });
30495
+ (0, import_node_fs43.rmSync)(pending2, { force: true });
30496
30496
  }
30497
30497
  const numbers = generationNumbers(directory2);
30498
30498
  if (numbers.at(-1) !== newest + 1) {
@@ -30513,7 +30513,7 @@ async function withSwiftRootLock(root, work, signal, wait = true) {
30513
30513
  register(child) {
30514
30514
  const index = children.push(child);
30515
30515
  if (child.pid === void 0) throw new Error("could not register compiler process");
30516
- const childPending = `${pending}.child.${index}`;
30516
+ const childPending = `${pending2}.child.${index}`;
30517
30517
  try {
30518
30518
  (0, import_node_fs43.writeFileSync)(childPending, JSON.stringify(ownIdentity(child.pid)));
30519
30519
  (0, import_node_fs43.linkSync)(childPending, import_node_path41.default.join(directory2, name(held, `child.${index}`)));
@@ -33316,7 +33316,7 @@ async function compileGuestLink(options2) {
33316
33316
  let lazyFunctions = [];
33317
33317
  let dyldSymbols = [];
33318
33318
  const bundlePaths = new Map(
33319
- options2.resourceBundles.map(({ target, path: path140 }) => [target, path140])
33319
+ options2.resourceBundles.map(({ target, path: path143 }) => [target, path143])
33320
33320
  );
33321
33321
  const imageMetadata = (products) => {
33322
33322
  const source = sourceImages.map((image) => {
@@ -34580,8 +34580,8 @@ function sourceEntryPath() {
34580
34580
  return null;
34581
34581
  }
34582
34582
  }
34583
- function isCliEntry(path140) {
34584
- const name3 = (0, import_node_path49.basename)(path140);
34583
+ function isCliEntry(path143) {
34584
+ const name3 = (0, import_node_path49.basename)(path143);
34585
34585
  return name3 === "bin.ts" || name3 === "bin.js";
34586
34586
  }
34587
34587
  function rnxSelfInvocation() {
@@ -34737,16 +34737,16 @@ function collectSwiftSourceClosure(files2, roots, swiftCodeMask2, extensionMembe
34737
34737
  sources.set(file, references);
34738
34738
  }
34739
34739
  const included = /* @__PURE__ */ new Set();
34740
- const pending = [...roots];
34740
+ const pending2 = [...roots];
34741
34741
  const seen = /* @__PURE__ */ new Set();
34742
- while (pending.length) {
34743
- const name3 = pending.pop();
34742
+ while (pending2.length) {
34743
+ const name3 = pending2.pop();
34744
34744
  if (seen.has(name3)) continue;
34745
34745
  seen.add(name3);
34746
34746
  for (const file of owners.get(name3) ?? []) {
34747
34747
  if (included.has(file)) continue;
34748
34748
  included.add(file);
34749
- for (const reference of sources.get(file)) pending.push(reference);
34749
+ for (const reference of sources.get(file)) pending2.push(reference);
34750
34750
  }
34751
34751
  }
34752
34752
  return Object.fromEntries(Object.entries(files2).filter(([file]) => included.has(file)));
@@ -35539,7 +35539,7 @@ function swiftTargetDependencies(files2, targets, frameworks = OPTIONAL_FRAMEWOR
35539
35539
  );
35540
35540
  const names = /* @__PURE__ */ new Set([...frameworks, ...targets.map((target) => target.name)]);
35541
35541
  const entriesByPrefix = new Map(
35542
- targets.map(({ path: path140 }) => [path140 === "." ? "" : `${path140}/`, []])
35542
+ targets.map(({ path: path143 }) => [path143 === "." ? "" : `${path143}/`, []])
35543
35543
  );
35544
35544
  const targetByPrefix = /* @__PURE__ */ new Map();
35545
35545
  for (const target of targets) {
@@ -38813,14 +38813,14 @@ function readCompiledArtifact(directory2, hash) {
38813
38813
  function saveCompiledArtifact(root, artifact) {
38814
38814
  const directory2 = import_node_path55.default.join(root, "artifact");
38815
38815
  (0, import_node_fs55.mkdirSync)(directory2, { recursive: true });
38816
- const pending = (0, import_node_fs55.mkdtempSync)(import_node_path55.default.join(root, ".artifact-"));
38816
+ const pending2 = (0, import_node_fs55.mkdtempSync)(import_node_path55.default.join(root, ".artifact-"));
38817
38817
  try {
38818
- (0, import_node_fs55.writeFileSync)(import_node_path55.default.join(pending, "app.wasm"), artifact.bytes);
38819
- (0, import_node_fs55.writeFileSync)(import_node_path55.default.join(pending, "icu.gz"), artifact.icu.gzip);
38818
+ (0, import_node_fs55.writeFileSync)(import_node_path55.default.join(pending2, "app.wasm"), artifact.bytes);
38819
+ (0, import_node_fs55.writeFileSync)(import_node_path55.default.join(pending2, "icu.gz"), artifact.icu.gzip);
38820
38820
  if (artifact.sdk)
38821
- (0, import_node_fs55.writeFileSync)(import_node_path55.default.join(pending, "sdk-binding.bin"), artifact.sdk.binding.bytes);
38821
+ (0, import_node_fs55.writeFileSync)(import_node_path55.default.join(pending2, "sdk-binding.bin"), artifact.sdk.binding.bytes);
38822
38822
  (0, import_node_fs55.writeFileSync)(
38823
- import_node_path55.default.join(pending, "artifact.json"),
38823
+ import_node_path55.default.join(pending2, "artifact.json"),
38824
38824
  JSON.stringify({
38825
38825
  hash: artifact.hash,
38826
38826
  wasm: (0, import_node_crypto34.createHash)("sha256").update(artifact.bytes).digest("hex"),
@@ -38835,10 +38835,10 @@ function saveCompiledArtifact(root, artifact) {
38835
38835
  const outputs = ["app.wasm", "icu.gz"];
38836
38836
  if (artifact.sdk) outputs.push("sdk-binding.bin");
38837
38837
  for (const file of [...outputs, "artifact.json"]) {
38838
- (0, import_node_fs55.renameSync)(import_node_path55.default.join(pending, file), import_node_path55.default.join(directory2, file));
38838
+ (0, import_node_fs55.renameSync)(import_node_path55.default.join(pending2, file), import_node_path55.default.join(directory2, file));
38839
38839
  }
38840
38840
  } finally {
38841
- (0, import_node_fs55.rmSync)(pending, { recursive: true, force: true });
38841
+ (0, import_node_fs55.rmSync)(pending2, { recursive: true, force: true });
38842
38842
  }
38843
38843
  }
38844
38844
  function vanished(error) {
@@ -39037,7 +39037,7 @@ function frameworkLinkClosure(scratch2, roots) {
39037
39037
  const dependencies = /* @__PURE__ */ new Map();
39038
39038
  const moduleMaps = /* @__PURE__ */ new Map();
39039
39039
  const objcHeaders = /* @__PURE__ */ new Map();
39040
- let pending = null;
39040
+ let pending2 = null;
39041
39041
  let compiling = null;
39042
39042
  for (const line of (0, import_node_fs55.readFileSync)(import_node_path55.default.join(scratch2, "release.yaml"), "utf8").split(
39043
39043
  "\n"
@@ -39045,12 +39045,12 @@ function frameworkLinkClosure(scratch2, roots) {
39045
39045
  const phony = phonyHeader.exec(line);
39046
39046
  const shell = shellHeader.exec(line);
39047
39047
  if (phony) {
39048
- pending = { kind: "phony", name: phony[1] };
39048
+ pending2 = { kind: "phony", name: phony[1] };
39049
39049
  compiling = null;
39050
39050
  continue;
39051
39051
  }
39052
39052
  if (shell) {
39053
- pending = { kind: "shell", name: shell[1] };
39053
+ pending2 = { kind: "shell", name: shell[1] };
39054
39054
  compiling = shell[1];
39055
39055
  continue;
39056
39056
  }
@@ -39065,12 +39065,12 @@ function frameworkLinkClosure(scratch2, roots) {
39065
39065
  if (objcHeader) objcHeaders.set(compiling, JSON.parse(objcHeader));
39066
39066
  compiling = null;
39067
39067
  }
39068
- if (!pending) continue;
39068
+ if (!pending2) continue;
39069
39069
  if (line.startsWith(" inputs:")) {
39070
39070
  const paths = [...line.matchAll(/"([^"]*)"/g)].map((match) => match[1]);
39071
- if (pending.kind === "phony") {
39071
+ if (pending2.kind === "phony") {
39072
39072
  objects.set(
39073
- pending.name,
39073
+ pending2.name,
39074
39074
  paths.filter((file) => file.endsWith(".o"))
39075
39075
  );
39076
39076
  } else {
@@ -39079,12 +39079,12 @@ function frameworkLinkClosure(scratch2, roots) {
39079
39079
  const module2 = /\/Modules\/([^/]+)\.swiftmodule$/.exec(file);
39080
39080
  const object8 = /\/release\/([^/]+)\.build\/.+\.o$/.exec(file);
39081
39081
  if (module2) deps.add(module2[1]);
39082
- else if (object8 && object8[1] !== pending.name) deps.add(object8[1]);
39082
+ else if (object8 && object8[1] !== pending2.name) deps.add(object8[1]);
39083
39083
  }
39084
- dependencies.set(pending.name, deps);
39084
+ dependencies.set(pending2.name, deps);
39085
39085
  }
39086
- pending = null;
39087
- } else if (!line.startsWith(" ") && line.trim() !== "") pending = null;
39086
+ pending2 = null;
39087
+ } else if (!line.startsWith(" ") && line.trim() !== "") pending2 = null;
39088
39088
  }
39089
39089
  const modules = /* @__PURE__ */ new Set();
39090
39090
  const stack = [...roots];
@@ -41565,17 +41565,17 @@ function visit(node, visitor) {
41565
41565
  } else
41566
41566
  visit_(null, node, visitor_, Object.freeze([]));
41567
41567
  }
41568
- function visit_(key2, node, visitor, path140) {
41569
- const ctrl = callVisitor(key2, node, visitor, path140);
41568
+ function visit_(key2, node, visitor, path143) {
41569
+ const ctrl = callVisitor(key2, node, visitor, path143);
41570
41570
  if (isNode(ctrl) || isPair(ctrl)) {
41571
- replaceNode(key2, path140, ctrl);
41572
- return visit_(key2, ctrl, visitor, path140);
41571
+ replaceNode(key2, path143, ctrl);
41572
+ return visit_(key2, ctrl, visitor, path143);
41573
41573
  }
41574
41574
  if (typeof ctrl !== "symbol") {
41575
41575
  if (isCollection(node)) {
41576
- path140 = Object.freeze(path140.concat(node));
41576
+ path143 = Object.freeze(path143.concat(node));
41577
41577
  for (let i = 0; i < node.items.length; ++i) {
41578
- const ci = visit_(i, node.items[i], visitor, path140);
41578
+ const ci = visit_(i, node.items[i], visitor, path143);
41579
41579
  if (typeof ci === "number")
41580
41580
  i = ci - 1;
41581
41581
  else if (ci === BREAK)
@@ -41586,13 +41586,13 @@ function visit_(key2, node, visitor, path140) {
41586
41586
  }
41587
41587
  }
41588
41588
  } else if (isPair(node)) {
41589
- path140 = Object.freeze(path140.concat(node));
41590
- const ck = visit_("key", node.key, visitor, path140);
41589
+ path143 = Object.freeze(path143.concat(node));
41590
+ const ck = visit_("key", node.key, visitor, path143);
41591
41591
  if (ck === BREAK)
41592
41592
  return BREAK;
41593
41593
  else if (ck === REMOVE)
41594
41594
  node.key = null;
41595
- const cv = visit_("value", node.value, visitor, path140);
41595
+ const cv = visit_("value", node.value, visitor, path143);
41596
41596
  if (cv === BREAK)
41597
41597
  return BREAK;
41598
41598
  else if (cv === REMOVE)
@@ -41610,17 +41610,17 @@ async function visitAsync(node, visitor) {
41610
41610
  } else
41611
41611
  await visitAsync_(null, node, visitor_, Object.freeze([]));
41612
41612
  }
41613
- async function visitAsync_(key2, node, visitor, path140) {
41614
- const ctrl = await callVisitor(key2, node, visitor, path140);
41613
+ async function visitAsync_(key2, node, visitor, path143) {
41614
+ const ctrl = await callVisitor(key2, node, visitor, path143);
41615
41615
  if (isNode(ctrl) || isPair(ctrl)) {
41616
- replaceNode(key2, path140, ctrl);
41617
- return visitAsync_(key2, ctrl, visitor, path140);
41616
+ replaceNode(key2, path143, ctrl);
41617
+ return visitAsync_(key2, ctrl, visitor, path143);
41618
41618
  }
41619
41619
  if (typeof ctrl !== "symbol") {
41620
41620
  if (isCollection(node)) {
41621
- path140 = Object.freeze(path140.concat(node));
41621
+ path143 = Object.freeze(path143.concat(node));
41622
41622
  for (let i = 0; i < node.items.length; ++i) {
41623
- const ci = await visitAsync_(i, node.items[i], visitor, path140);
41623
+ const ci = await visitAsync_(i, node.items[i], visitor, path143);
41624
41624
  if (typeof ci === "number")
41625
41625
  i = ci - 1;
41626
41626
  else if (ci === BREAK)
@@ -41631,13 +41631,13 @@ async function visitAsync_(key2, node, visitor, path140) {
41631
41631
  }
41632
41632
  }
41633
41633
  } else if (isPair(node)) {
41634
- path140 = Object.freeze(path140.concat(node));
41635
- const ck = await visitAsync_("key", node.key, visitor, path140);
41634
+ path143 = Object.freeze(path143.concat(node));
41635
+ const ck = await visitAsync_("key", node.key, visitor, path143);
41636
41636
  if (ck === BREAK)
41637
41637
  return BREAK;
41638
41638
  else if (ck === REMOVE)
41639
41639
  node.key = null;
41640
- const cv = await visitAsync_("value", node.value, visitor, path140);
41640
+ const cv = await visitAsync_("value", node.value, visitor, path143);
41641
41641
  if (cv === BREAK)
41642
41642
  return BREAK;
41643
41643
  else if (cv === REMOVE)
@@ -41664,23 +41664,23 @@ function initVisitor(visitor) {
41664
41664
  }
41665
41665
  return visitor;
41666
41666
  }
41667
- function callVisitor(key2, node, visitor, path140) {
41667
+ function callVisitor(key2, node, visitor, path143) {
41668
41668
  if (typeof visitor === "function")
41669
- return visitor(key2, node, path140);
41669
+ return visitor(key2, node, path143);
41670
41670
  if (isMap(node))
41671
- return visitor.Map?.(key2, node, path140);
41671
+ return visitor.Map?.(key2, node, path143);
41672
41672
  if (isSeq(node))
41673
- return visitor.Seq?.(key2, node, path140);
41673
+ return visitor.Seq?.(key2, node, path143);
41674
41674
  if (isPair(node))
41675
- return visitor.Pair?.(key2, node, path140);
41675
+ return visitor.Pair?.(key2, node, path143);
41676
41676
  if (isScalar(node))
41677
- return visitor.Scalar?.(key2, node, path140);
41677
+ return visitor.Scalar?.(key2, node, path143);
41678
41678
  if (isAlias(node))
41679
- return visitor.Alias?.(key2, node, path140);
41679
+ return visitor.Alias?.(key2, node, path143);
41680
41680
  return void 0;
41681
41681
  }
41682
- function replaceNode(key2, path140, node) {
41683
- const parent = path140[path140.length - 1];
41682
+ function replaceNode(key2, path143, node) {
41683
+ const parent = path143[path143.length - 1];
41684
41684
  if (isCollection(parent)) {
41685
41685
  parent.items[key2] = node;
41686
41686
  } else if (isPair(parent)) {
@@ -42280,10 +42280,10 @@ var init_createNode = __esm({
42280
42280
  });
42281
42281
 
42282
42282
  // ../../node_modules/yaml/browser/dist/nodes/Collection.js
42283
- function collectionFromPath(schema4, path140, value) {
42283
+ function collectionFromPath(schema4, path143, value) {
42284
42284
  let v9 = value;
42285
- for (let i = path140.length - 1; i >= 0; --i) {
42286
- const k = path140[i];
42285
+ for (let i = path143.length - 1; i >= 0; --i) {
42286
+ const k = path143[i];
42287
42287
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
42288
42288
  const a = [];
42289
42289
  a[k] = v9;
@@ -42308,7 +42308,7 @@ var init_Collection = __esm({
42308
42308
  init_createNode();
42309
42309
  init_identity();
42310
42310
  init_Node();
42311
- isEmptyPath = (path140) => path140 == null || typeof path140 === "object" && !!path140[Symbol.iterator]().next().done;
42311
+ isEmptyPath = (path143) => path143 == null || typeof path143 === "object" && !!path143[Symbol.iterator]().next().done;
42312
42312
  Collection = class extends NodeBase {
42313
42313
  constructor(type, schema4) {
42314
42314
  super(type);
@@ -42338,11 +42338,11 @@ var init_Collection = __esm({
42338
42338
  * be a Pair instance or a `{ key, value }` object, which may not have a key
42339
42339
  * that already exists in the map.
42340
42340
  */
42341
- addIn(path140, value) {
42342
- if (isEmptyPath(path140))
42341
+ addIn(path143, value) {
42342
+ if (isEmptyPath(path143))
42343
42343
  this.add(value);
42344
42344
  else {
42345
- const [key2, ...rest] = path140;
42345
+ const [key2, ...rest] = path143;
42346
42346
  const node = this.get(key2, true);
42347
42347
  if (isCollection(node))
42348
42348
  node.addIn(rest, value);
@@ -42356,8 +42356,8 @@ var init_Collection = __esm({
42356
42356
  * Removes a value from the collection.
42357
42357
  * @returns `true` if the item was found and removed.
42358
42358
  */
42359
- deleteIn(path140) {
42360
- const [key2, ...rest] = path140;
42359
+ deleteIn(path143) {
42360
+ const [key2, ...rest] = path143;
42361
42361
  if (rest.length === 0)
42362
42362
  return this.delete(key2);
42363
42363
  const node = this.get(key2, true);
@@ -42371,8 +42371,8 @@ var init_Collection = __esm({
42371
42371
  * scalar values from their surrounding node; to disable set `keepScalar` to
42372
42372
  * `true` (collections are always returned intact).
42373
42373
  */
42374
- getIn(path140, keepScalar) {
42375
- const [key2, ...rest] = path140;
42374
+ getIn(path143, keepScalar) {
42375
+ const [key2, ...rest] = path143;
42376
42376
  const node = this.get(key2, true);
42377
42377
  if (rest.length === 0)
42378
42378
  return !keepScalar && isScalar(node) ? node.value : node;
@@ -42390,8 +42390,8 @@ var init_Collection = __esm({
42390
42390
  /**
42391
42391
  * Checks if the collection includes a value with the key `key`.
42392
42392
  */
42393
- hasIn(path140) {
42394
- const [key2, ...rest] = path140;
42393
+ hasIn(path143) {
42394
+ const [key2, ...rest] = path143;
42395
42395
  if (rest.length === 0)
42396
42396
  return this.has(key2);
42397
42397
  const node = this.get(key2, true);
@@ -42401,8 +42401,8 @@ var init_Collection = __esm({
42401
42401
  * Sets a value in this collection. For `!!set`, `value` needs to be a
42402
42402
  * boolean to add/remove the item from the set.
42403
42403
  */
42404
- setIn(path140, value) {
42405
- const [key2, ...rest] = path140;
42404
+ setIn(path143, value) {
42405
+ const [key2, ...rest] = path143;
42406
42406
  if (rest.length === 0) {
42407
42407
  this.set(key2, value);
42408
42408
  } else {
@@ -44836,9 +44836,9 @@ var init_Document = __esm({
44836
44836
  this.contents.add(value);
44837
44837
  }
44838
44838
  /** Adds a value to the document. */
44839
- addIn(path140, value) {
44839
+ addIn(path143, value) {
44840
44840
  if (assertCollection(this.contents))
44841
- this.contents.addIn(path140, value);
44841
+ this.contents.addIn(path143, value);
44842
44842
  }
44843
44843
  /**
44844
44844
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -44913,14 +44913,14 @@ var init_Document = __esm({
44913
44913
  * Removes a value from the document.
44914
44914
  * @returns `true` if the item was found and removed.
44915
44915
  */
44916
- deleteIn(path140) {
44917
- if (isEmptyPath(path140)) {
44916
+ deleteIn(path143) {
44917
+ if (isEmptyPath(path143)) {
44918
44918
  if (this.contents == null)
44919
44919
  return false;
44920
44920
  this.contents = null;
44921
44921
  return true;
44922
44922
  }
44923
- return assertCollection(this.contents) ? this.contents.deleteIn(path140) : false;
44923
+ return assertCollection(this.contents) ? this.contents.deleteIn(path143) : false;
44924
44924
  }
44925
44925
  /**
44926
44926
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -44935,10 +44935,10 @@ var init_Document = __esm({
44935
44935
  * scalar values from their surrounding node; to disable set `keepScalar` to
44936
44936
  * `true` (collections are always returned intact).
44937
44937
  */
44938
- getIn(path140, keepScalar) {
44939
- if (isEmptyPath(path140))
44938
+ getIn(path143, keepScalar) {
44939
+ if (isEmptyPath(path143))
44940
44940
  return !keepScalar && isScalar(this.contents) ? this.contents.value : this.contents;
44941
- return isCollection(this.contents) ? this.contents.getIn(path140, keepScalar) : void 0;
44941
+ return isCollection(this.contents) ? this.contents.getIn(path143, keepScalar) : void 0;
44942
44942
  }
44943
44943
  /**
44944
44944
  * Checks if the document includes a value with the key `key`.
@@ -44949,10 +44949,10 @@ var init_Document = __esm({
44949
44949
  /**
44950
44950
  * Checks if the document includes a value at `path`.
44951
44951
  */
44952
- hasIn(path140) {
44953
- if (isEmptyPath(path140))
44952
+ hasIn(path143) {
44953
+ if (isEmptyPath(path143))
44954
44954
  return this.contents !== void 0;
44955
- return isCollection(this.contents) ? this.contents.hasIn(path140) : false;
44955
+ return isCollection(this.contents) ? this.contents.hasIn(path143) : false;
44956
44956
  }
44957
44957
  /**
44958
44958
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -44969,13 +44969,13 @@ var init_Document = __esm({
44969
44969
  * Sets a value in this document. For `!!set`, `value` needs to be a
44970
44970
  * boolean to add/remove the item from the set.
44971
44971
  */
44972
- setIn(path140, value) {
44973
- if (isEmptyPath(path140)) {
44972
+ setIn(path143, value) {
44973
+ if (isEmptyPath(path143)) {
44974
44974
  this.contents = value;
44975
44975
  } else if (this.contents == null) {
44976
- this.contents = collectionFromPath(this.schema, Array.from(path140), value);
44976
+ this.contents = collectionFromPath(this.schema, Array.from(path143), value);
44977
44977
  } else if (assertCollection(this.contents)) {
44978
- this.contents.setIn(path140, value);
44978
+ this.contents.setIn(path143, value);
44979
44979
  }
44980
44980
  }
44981
44981
  /**
@@ -46880,15 +46880,15 @@ function visit2(cst, visitor) {
46880
46880
  cst = { start: cst.start, value: cst.value };
46881
46881
  _visit(Object.freeze([]), cst, visitor);
46882
46882
  }
46883
- function _visit(path140, item, visitor) {
46884
- let ctrl = visitor(item, path140);
46883
+ function _visit(path143, item, visitor) {
46884
+ let ctrl = visitor(item, path143);
46885
46885
  if (typeof ctrl === "symbol")
46886
46886
  return ctrl;
46887
46887
  for (const field of ["key", "value"]) {
46888
46888
  const token = item[field];
46889
46889
  if (token && "items" in token) {
46890
46890
  for (let i = 0; i < token.items.length; ++i) {
46891
- const ci = _visit(Object.freeze(path140.concat([[field, i]])), token.items[i], visitor);
46891
+ const ci = _visit(Object.freeze(path143.concat([[field, i]])), token.items[i], visitor);
46892
46892
  if (typeof ci === "number")
46893
46893
  i = ci - 1;
46894
46894
  else if (ci === BREAK2)
@@ -46899,10 +46899,10 @@ function _visit(path140, item, visitor) {
46899
46899
  }
46900
46900
  }
46901
46901
  if (typeof ctrl === "function" && field === "key")
46902
- ctrl = ctrl(item, path140);
46902
+ ctrl = ctrl(item, path143);
46903
46903
  }
46904
46904
  }
46905
- return typeof ctrl === "function" ? ctrl(item, path140) : ctrl;
46905
+ return typeof ctrl === "function" ? ctrl(item, path143) : ctrl;
46906
46906
  }
46907
46907
  var BREAK2, SKIP2, REMOVE2;
46908
46908
  var init_cst_visit = __esm({
@@ -46913,9 +46913,9 @@ var init_cst_visit = __esm({
46913
46913
  visit2.BREAK = BREAK2;
46914
46914
  visit2.SKIP = SKIP2;
46915
46915
  visit2.REMOVE = REMOVE2;
46916
- visit2.itemAtPath = (cst, path140) => {
46916
+ visit2.itemAtPath = (cst, path143) => {
46917
46917
  let item = cst;
46918
- for (const [field, index] of path140) {
46918
+ for (const [field, index] of path143) {
46919
46919
  const tok = item?.[field];
46920
46920
  if (tok && "items" in tok) {
46921
46921
  item = tok.items[index];
@@ -46924,9 +46924,9 @@ var init_cst_visit = __esm({
46924
46924
  }
46925
46925
  return item;
46926
46926
  };
46927
- visit2.parentCollection = (cst, path140) => {
46928
- const parent = visit2.itemAtPath(cst, path140.slice(0, -1));
46929
- const field = path140[path140.length - 1][0];
46927
+ visit2.parentCollection = (cst, path143) => {
46928
+ const parent = visit2.itemAtPath(cst, path143.slice(0, -1));
46929
+ const field = path143[path143.length - 1][0];
46930
46930
  const coll = parent?.[field];
46931
46931
  if (coll && "items" in coll)
46932
46932
  return coll;
@@ -48229,14 +48229,14 @@ var init_parser = __esm({
48229
48229
  case "scalar":
48230
48230
  case "single-quoted-scalar":
48231
48231
  case "double-quoted-scalar": {
48232
- const fs103 = this.flowScalar(this.type);
48232
+ const fs106 = this.flowScalar(this.type);
48233
48233
  if (atNextItem || it.value) {
48234
- map2.items.push({ start, key: fs103, sep: [] });
48234
+ map2.items.push({ start, key: fs106, sep: [] });
48235
48235
  this.onKeyLine = true;
48236
48236
  } else if (it.sep) {
48237
- this.stack.push(fs103);
48237
+ this.stack.push(fs106);
48238
48238
  } else {
48239
- Object.assign(it, { key: fs103, sep: [] });
48239
+ Object.assign(it, { key: fs106, sep: [] });
48240
48240
  this.onKeyLine = true;
48241
48241
  }
48242
48242
  return;
@@ -48364,13 +48364,13 @@ var init_parser = __esm({
48364
48364
  case "scalar":
48365
48365
  case "single-quoted-scalar":
48366
48366
  case "double-quoted-scalar": {
48367
- const fs103 = this.flowScalar(this.type);
48367
+ const fs106 = this.flowScalar(this.type);
48368
48368
  if (!it || it.value)
48369
- fc.items.push({ start: [], key: fs103, sep: [] });
48369
+ fc.items.push({ start: [], key: fs106, sep: [] });
48370
48370
  else if (it.sep)
48371
- this.stack.push(fs103);
48371
+ this.stack.push(fs106);
48372
48372
  else
48373
- Object.assign(it, { key: fs103, sep: [] });
48373
+ Object.assign(it, { key: fs106, sep: [] });
48374
48374
  return;
48375
48375
  }
48376
48376
  case "flow-map-end":
@@ -52179,9 +52179,9 @@ var init_podspec_ruby = __esm({
52179
52179
  }
52180
52180
  // ---- errors
52181
52181
  exceptionClass(name3) {
52182
- const path140 = name3.split("::");
52182
+ const path143 = name3.split("::");
52183
52183
  let module2 = this.object;
52184
- for (const part of path140) {
52184
+ for (const part of path143) {
52185
52185
  const next = module2.consts.get(part);
52186
52186
  if (!(next instanceof RModule))
52187
52187
  throw new UnsupportedRuby(`no exception class ${name3}`);
@@ -58419,10 +58419,6 @@ function parseXmlPlist(source, options2 = {}) {
58419
58419
  if (root.tag !== "plist") {
58420
58420
  throw new Error(`expected <plist> root element, got <${root.tag}>`);
58421
58421
  }
58422
- if (root.children.length === 0) {
58423
- if (options2.strict) throw new Error("<plist> element has no root value");
58424
- return void 0;
58425
- }
58426
58422
  if (options2.strict && root.children.length !== 1) {
58427
58423
  throw new Error("<plist> element must contain exactly one root value");
58428
58424
  }
@@ -58435,18 +58431,23 @@ function parseXmlPlist(source, options2 = {}) {
58435
58431
  const visit3 = (node) => {
58436
58432
  switch (node.tag) {
58437
58433
  case "dict": {
58438
- const result = {};
58434
+ const entries2 = [];
58439
58435
  if (options2.strict && node.children.length % 2 !== 0) {
58440
58436
  throw new Error("<dict> must contain key/value pairs");
58441
58437
  }
58442
- for (let i = 0; i + 1 < node.children.length; i += 2) {
58438
+ for (let i = 0; i < node.children.length; i += 2) {
58443
58439
  const keyNode = node.children[i];
58444
58440
  if (keyNode.tag !== "key") {
58445
58441
  throw new Error(`expected <key> in <dict>, got <${keyNode.tag}>`);
58446
58442
  }
58447
- result[leafText(keyNode)] = visit3(node.children[i + 1]);
58443
+ const key2 = leafText(keyNode);
58444
+ if (!options2.strict && key2 === "__proto__") {
58445
+ throw new Error("unsupported plist dictionary key __proto__");
58446
+ }
58447
+ const value = node.children[i + 1];
58448
+ entries2.push([key2, value ? visit3(value) : ""]);
58448
58449
  }
58449
- return result;
58450
+ return Object.fromEntries(entries2);
58450
58451
  }
58451
58452
  case "array":
58452
58453
  return node.children.map(visit3);
@@ -58476,54 +58477,10 @@ function parseXmlPlist(source, options2 = {}) {
58476
58477
  throw new Error(`unsupported plist element ${node.tag}`);
58477
58478
  }
58478
58479
  };
58479
- return visit3(root.children[0]);
58480
+ return root.children.length === 1 ? visit3(root.children[0]) : root.children.map(visit3);
58480
58481
  }
58481
58482
  function parsePlist(source) {
58482
- const root = parseXmlDocument(source);
58483
- if (root.tag !== "plist") {
58484
- throw new Error(`expected <plist> root element, got <${root.tag}>`);
58485
- }
58486
- if (root.children.length === 0) return {};
58487
- const visit3 = (node) => {
58488
- switch (node.tag) {
58489
- case "dict": {
58490
- const result = {};
58491
- for (let i = 0; i + 1 < node.children.length; i += 2) {
58492
- const keyNode = node.children[i];
58493
- if (keyNode.tag !== "key") {
58494
- throw new Error(`expected <key> in <dict>, got <${keyNode.tag}>`);
58495
- }
58496
- result[keyNode.text] = visit3(node.children[i + 1]);
58497
- }
58498
- return result;
58499
- }
58500
- case "array":
58501
- return node.children.map(visit3);
58502
- case "string":
58503
- return node.text;
58504
- case "integer": {
58505
- const raw2 = node.text.trim();
58506
- if (!raw2) throw new Error("empty <integer> element");
58507
- return Number.parseInt(raw2, 10);
58508
- }
58509
- case "real": {
58510
- const raw2 = node.text.trim();
58511
- if (!raw2) throw new Error("empty <real> element");
58512
- return Number.parseFloat(raw2);
58513
- }
58514
- case "true":
58515
- return true;
58516
- case "false":
58517
- return false;
58518
- case "data":
58519
- return Buffer.from(node.text.replace(/\s+/g, ""), "base64");
58520
- case "date":
58521
- return new Date(node.text.trim());
58522
- default:
58523
- throw new Error(`unsupported plist element ${node.tag}`);
58524
- }
58525
- };
58526
- return visit3(root.children[0]);
58483
+ return parseXmlPlist(source);
58527
58484
  }
58528
58485
  function parsePlistSource(source) {
58529
58486
  return parseXmlPlist(source);
@@ -59005,16 +58962,16 @@ var init_pods_files = __esm({
59005
58962
  };
59006
58963
  unique = (values) => [...new Set(values)];
59007
58964
  XCFramework = class {
59008
- constructor(targetName, path140) {
58965
+ constructor(targetName, path143) {
59009
58966
  this.targetName = targetName;
59010
- this.path = path140;
59011
- const plist2 = parsePlistBytes(import_node_fs65.default.readFileSync(`${path140}/Info.plist`));
58967
+ this.path = path143;
58968
+ const plist2 = parsePlistBytes(import_node_fs65.default.readFileSync(`${path143}/Info.plist`));
59012
58969
  if (!isRecord(plist2) || !Array.isArray(plist2.AvailableLibraries))
59013
- throw new Error(`${path140}/Info.plist declares no AvailableLibraries`);
58970
+ throw new Error(`${path143}/Info.plist declares no AvailableLibraries`);
59014
58971
  this.slices = plist2.AvailableLibraries.map((library) => {
59015
58972
  if (!isRecord(library) || typeof library.LibraryIdentifier !== "string" || typeof library.LibraryPath !== "string" || typeof library.SupportedPlatform !== "string")
59016
- throw new Error(`${path140}/Info.plist has an invalid library entry`);
59017
- const root = `${path140}/${library.LibraryIdentifier}`;
58973
+ throw new Error(`${path143}/Info.plist has an invalid library entry`);
58974
+ const root = `${path143}/${library.LibraryIdentifier}`;
59018
58975
  const slicePath = `${root}/${library.LibraryPath}`;
59019
58976
  const extension = slicePath.slice(slicePath.lastIndexOf("."));
59020
58977
  const packaging = extension === ".framework" ? "framework" : extension === ".a" || extension === ".dylib" ? "library" : null;
@@ -59036,7 +58993,7 @@ var init_pods_files = __esm({
59036
58993
  }).sort((a, b) => byBytes2(a.identifier, b.identifier));
59037
58994
  if (this.slices.length === 0)
59038
58995
  throw new Error(
59039
- `XCFramework at ${path140} does not contain any frameworks or libraries.`
58996
+ `XCFramework at ${path143} does not contain any frameworks or libraries.`
59040
58997
  );
59041
58998
  }
59042
58999
  slices;
@@ -60890,9 +60847,9 @@ echo "SUCCESS" > "\${SCRIPT_OUTPUT_FILE_0}"
60890
60847
  DEFAULT_SHELL_SCRIPT = "# Type a script or drag a script file from your workspace to insert its path.\n";
60891
60848
  stringList2 = (value) => Array.isArray(value) && value.every((item) => typeof item === "string") ? value : null;
60892
60849
  UserProject = class {
60893
- constructor(table, path140, objectVersion) {
60850
+ constructor(table, path143, objectVersion) {
60894
60851
  this.table = table;
60895
- this.path = path140;
60852
+ this.path = path143;
60896
60853
  this.objectVersion = objectVersion;
60897
60854
  }
60898
60855
  get projectDir() {
@@ -67983,14 +67940,14 @@ function addAsset(into, asset) {
67983
67940
  function checkStack(dir, type, devices2) {
67984
67941
  const sets = (parent, allowed) => (0, import_node_fs76.readdirSync)(parent, { withFileTypes: true }).flatMap((entry) => {
67985
67942
  if (entry.name.startsWith(".") || entry.isFile()) return [];
67986
- const path140 = (0, import_node_path76.join)(parent, entry.name);
67943
+ const path143 = (0, import_node_path76.join)(parent, entry.name);
67987
67944
  const extension = (0, import_node_path76.extname)(entry.name);
67988
67945
  if (!entry.isDirectory() || !allowed.includes(extension))
67989
67946
  return refuse(
67990
- path140,
67947
+ path143,
67991
67948
  `image stack content other than ${allowed.join(", ")} is unproven`
67992
67949
  );
67993
- return [{ path: path140, extension }];
67950
+ return [{ path: path143, extension }];
67994
67951
  });
67995
67952
  for (const layer of sets(dir, [`.${type}layer`, ".imageset", ".colorset"])) {
67996
67953
  if (layer.extension !== `.${type}layer`) continue;
@@ -68002,37 +67959,37 @@ function checkStack(dir, type, devices2) {
68002
67959
  function walk2(dir, into, devices2, extensions) {
68003
67960
  for (const entry of (0, import_node_fs76.readdirSync)(dir, { withFileTypes: true })) {
68004
67961
  if (entry.name.startsWith(".") || entry.isFile()) continue;
68005
- const path140 = (0, import_node_path76.join)(dir, entry.name);
68006
- if (!entry.isDirectory()) return refuse(path140, "it is neither a file nor a directory");
67962
+ const path143 = (0, import_node_path76.join)(dir, entry.name);
67963
+ if (!entry.isDirectory()) return refuse(path143, "it is neither a file nor a directory");
68007
67964
  const extension = (0, import_node_path76.extname)(entry.name).slice(1);
68008
67965
  const type = extension.toLowerCase();
68009
67966
  const base2 = entry.name.slice(0, entry.name.length - extension.length - 1);
68010
67967
  if (type !== extension && knownTypes.has(type))
68011
- return refuse(path140, "its type extension is not lowercase");
67968
+ return refuse(path143, "its type extension is not lowercase");
68012
67969
  if (type === "colorset" || type === "imageset" || type === "symbolset") {
68013
67970
  addAsset(into, {
68014
67971
  kind: type === "colorset" ? "color" : "image",
68015
67972
  name: base2,
68016
- ...assetState(path140, type, devices2),
67973
+ ...assetState(path143, type, devices2),
68017
67974
  extensions,
68018
- source: path140
67975
+ source: path143
68019
67976
  });
68020
67977
  continue;
68021
67978
  }
68022
67979
  if (silentTypes.has(type)) continue;
68023
67980
  if (stackTypes.has(type)) {
68024
- checkStack(path140, type, devices2);
67981
+ checkStack(path143, type, devices2);
68025
67982
  continue;
68026
67983
  }
68027
- if (unprovenTypes.has(type)) return refuse(path140, `${type} assets are unproven`);
67984
+ if (unprovenTypes.has(type)) return refuse(path143, `${type} assets are unproven`);
68028
67985
  const name3 = type === "spriteatlas" ? base2 : entry.name;
68029
- if (!folderProperties((0, import_node_path76.join)(path140, "Contents.json")).namespace) {
68030
- walk2(path140, into, devices2, extensions);
67986
+ if (!folderProperties((0, import_node_path76.join)(path143, "Contents.json")).namespace) {
67987
+ walk2(path143, into, devices2, extensions);
68031
67988
  continue;
68032
67989
  }
68033
- const child = into.namespaces.get(name3) ?? scope(path140);
67990
+ const child = into.namespaces.get(name3) ?? scope(path143);
68034
67991
  into.namespaces.set(name3, child);
68035
- walk2(path140, child, devices2, extensions);
67992
+ walk2(path143, child, devices2, extensions);
68036
67993
  }
68037
67994
  }
68038
67995
  function words(name3) {
@@ -68079,11 +68036,11 @@ function members(into, kind, prefix, extensions) {
68079
68036
  const assets2 = /* @__PURE__ */ new Set();
68080
68037
  const out = [];
68081
68038
  for (const entry of entries2) {
68082
- const path140 = `${prefix}${entry.name}`;
68039
+ const path143 = `${prefix}${entry.name}`;
68083
68040
  const source = entry.child ? entry.child.source : entry.asset.source;
68084
68041
  if (Array.from(entry.name).some((char) => char.charCodeAt(0) > 127))
68085
68042
  refuse(source, "its name is not ASCII");
68086
- const named = (text8) => `The \\"${escape(path140)}\\" ${text8}`;
68043
+ const named = (text8) => `The \\"${escape(path143)}\\" ${text8}`;
68087
68044
  if (entry.child) {
68088
68045
  const text8 = symbol(entry.name, true);
68089
68046
  if (!text8)
@@ -68106,9 +68063,9 @@ function members(into, kind, prefix, extensions) {
68106
68063
  namespaces.add(text8);
68107
68064
  out.push({
68108
68065
  type: "namespace",
68109
- path: path140,
68066
+ path: path143,
68110
68067
  symbol: spelled(text8),
68111
- members: members(entry.child, kind, `${path140}/`, extensions)
68068
+ members: members(entry.child, kind, `${path143}/`, extensions)
68112
68069
  });
68113
68070
  }
68114
68071
  continue;
@@ -68135,7 +68092,7 @@ function members(into, kind, prefix, extensions) {
68135
68092
  else if (!omitted)
68136
68093
  out.push({
68137
68094
  type: "asset",
68138
- path: path140,
68095
+ path: path143,
68139
68096
  name: entry.name,
68140
68097
  symbol: spelled(text7),
68141
68098
  thinnable: asset.thinnable,
@@ -68416,8 +68373,8 @@ var init_xcode_asset_symbols = __esm({
68416
68373
  import_node_path76 = require("node:path");
68417
68374
  Refusal = class extends Error {
68418
68375
  };
68419
- refuse = (path140, reason) => {
68420
- throw new Refusal(`Generated asset symbols are unproven for ${path140}: ${reason}`);
68376
+ refuse = (path143, reason) => {
68377
+ throw new Refusal(`Generated asset symbols are unproven for ${path143}: ${reason}`);
68421
68378
  };
68422
68379
  isRecord5 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
68423
68380
  scope = (source) => ({
@@ -68863,11 +68820,11 @@ function catalogDigest(directory2) {
68863
68820
  for (const entry of (0, import_node_fs77.readdirSync)(dir, { withFileTypes: true }).sort(
68864
68821
  (a, b) => a.name.localeCompare(b.name)
68865
68822
  )) {
68866
- const path140 = (0, import_node_path77.join)(dir, entry.name);
68867
- if (entry.isDirectory()) walk4(path140);
68868
- else if (entry.isFile() && (0, import_node_fs77.statSync)(path140).size <= 64 * 1024 * 1024)
68869
- hashes.push([(0, import_node_path77.relative)(directory2, path140), sha2562((0, import_node_fs77.readFileSync)(path140))]);
68870
- else throw new Error(`Unsupported asset catalog entry: ${path140}`);
68823
+ const path143 = (0, import_node_path77.join)(dir, entry.name);
68824
+ if (entry.isDirectory()) walk4(path143);
68825
+ else if (entry.isFile() && (0, import_node_fs77.statSync)(path143).size <= 64 * 1024 * 1024)
68826
+ hashes.push([(0, import_node_path77.relative)(directory2, path143), sha2562((0, import_node_fs77.readFileSync)(path143))]);
68827
+ else throw new Error(`Unsupported asset catalog entry: ${path143}`);
68871
68828
  }
68872
68829
  };
68873
68830
  walk4(directory2);
@@ -68878,7 +68835,7 @@ function symbolSource(plan, root) {
68878
68835
  const known = symbolTexts.get(key2);
68879
68836
  if (known !== void 0) return { status: "source", text: known };
68880
68837
  const source = assetSymbolSource(
68881
- plan.catalogs.map(({ path: path140 }) => (0, import_node_path77.join)(root, path140)),
68838
+ plan.catalogs.map(({ path: path143 }) => (0, import_node_path77.join)(root, path143)),
68882
68839
  plan.settings
68883
68840
  );
68884
68841
  if (source.status === "source") symbolTexts.set(key2, source.text);
@@ -68937,9 +68894,9 @@ function planAssetSymbols(resources, root, settings) {
68937
68894
  `Generated asset symbols are proven only for TARGETED_DEVICE_FAMILY 1, 2, 1,2, 1,7, 1,3,7, 1,2,6 or 1,2,7; this target resolves to "${families}".`
68938
68895
  );
68939
68896
  const plan = {
68940
- catalogs: catalogs.map((path140) => ({
68941
- path: path140,
68942
- sha256: catalogDigest((0, import_node_path77.join)(root, path140))
68897
+ catalogs: catalogs.map((path143) => ({
68898
+ path: path143,
68899
+ sha256: catalogDigest((0, import_node_path77.join)(root, path143))
68943
68900
  })),
68944
68901
  settings: { deployment: target, devices: devices2, extensions: extensions === "YES" }
68945
68902
  };
@@ -73171,10 +73128,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
73171
73128
  if (!isDict(entry)) return [];
73172
73129
  if (entry.isa === "PBXFileSystemSynchronizedRootGroup") {
73173
73130
  const folder = project2.resolvePath(id);
73174
- const pending = folder ? [folder] : [];
73131
+ const pending2 = folder ? [folder] : [];
73175
73132
  const packages = [];
73176
- while (pending.length > 0) {
73177
- const dir = pending.pop();
73133
+ while (pending2.length > 0) {
73134
+ const dir = pending2.pop();
73178
73135
  if (import_node_fs79.default.existsSync(import_node_path80.default.join(dir, "Package.swift"))) {
73179
73136
  packages.push(dir);
73180
73137
  continue;
@@ -73182,7 +73139,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
73182
73139
  if (!isDirectory3(dir)) continue;
73183
73140
  for (const child of import_node_fs79.default.readdirSync(dir, { withFileTypes: true }))
73184
73141
  if (child.isDirectory() && !child.name.startsWith("."))
73185
- pending.push(import_node_path80.default.join(dir, child.name));
73142
+ pending2.push(import_node_path80.default.join(dir, child.name));
73186
73143
  }
73187
73144
  return packages;
73188
73145
  }
@@ -73673,14 +73630,14 @@ function localPackageDirectories(root, app) {
73673
73630
  }
73674
73631
  async function hashWorkspaceInputs(app, everyByte, signal, sourceOnly = false, podsEnvironment = reactNativePodsEnvironment()) {
73675
73632
  const key2 = JSON.stringify([app, everyByte, sourceOnly, podsEnvironment]);
73676
- let pending = hashing.get(key2);
73677
- if (!pending) {
73678
- pending = walkWorkspaceInputs(app, everyByte, sourceOnly, podsEnvironment).finally(
73633
+ let pending2 = hashing.get(key2);
73634
+ if (!pending2) {
73635
+ pending2 = walkWorkspaceInputs(app, everyByte, sourceOnly, podsEnvironment).finally(
73679
73636
  () => hashing.delete(key2)
73680
73637
  );
73681
- hashing.set(key2, pending);
73638
+ hashing.set(key2, pending2);
73682
73639
  }
73683
- const inputs2 = await pending;
73640
+ const inputs2 = await pending2;
73684
73641
  signal?.throwIfAborted();
73685
73642
  return inputs2;
73686
73643
  }
@@ -74834,8 +74791,8 @@ async function ensureCompose(toolchain) {
74834
74791
  }
74835
74792
  function ensureToolchain(toolchain) {
74836
74793
  const key2 = JSON.stringify(toolchain);
74837
- const pending = toolchains.get(key2);
74838
- if (pending) return pending;
74794
+ const pending2 = toolchains.get(key2);
74795
+ if (pending2) return pending2;
74839
74796
  const ready = (async () => {
74840
74797
  const dir = import_node_path83.default.join(kotlinHome(), toolchain.compiler.version);
74841
74798
  const compilerDir = import_node_path83.default.join(dir, `compiler-${toolchain.compiler.sha256}`);
@@ -77308,13 +77265,13 @@ function packageNativeRequests(dir) {
77308
77265
  }
77309
77266
  function dependencyNativeOwners(appDir, manifest) {
77310
77267
  const owners = /* @__PURE__ */ new Map();
77311
- const pending = Object.keys({
77268
+ const pending2 = Object.keys({
77312
77269
  ...manifest?.devDependencies,
77313
77270
  ...manifest?.dependencies
77314
77271
  }).map((name3) => ({ from: appDir, name: name3 }));
77315
77272
  const visited = /* @__PURE__ */ new Set();
77316
- for (let index = 0; index < pending.length; index++) {
77317
- const { from, name: name3 } = pending[index];
77273
+ for (let index = 0; index < pending2.length; index++) {
77274
+ const { from, name: name3 } = pending2[index];
77318
77275
  const dir = installedPackageDir(from, name3);
77319
77276
  if (!dir || visited.has(dir)) continue;
77320
77277
  visited.add(dir);
@@ -77329,7 +77286,7 @@ function dependencyNativeOwners(appDir, manifest) {
77329
77286
  ...dependency?.dependencies,
77330
77287
  ...isRecord(optional3) ? optional3 : {}
77331
77288
  }))
77332
- pending.push({ from: dir, name: child });
77289
+ pending2.push({ from: dir, name: child });
77333
77290
  }
77334
77291
  return owners;
77335
77292
  }
@@ -77504,7 +77461,7 @@ function scanLocalNative(appDir, pkg, answered, platform2, knownPackages = /* @_
77504
77461
  expoModule: moduleDir ? (0, import_node_path88.relative)(appDir, moduleDir) || "." : null,
77505
77462
  optional: optional3,
77506
77463
  swift: moduleDir ? (nativeFilesByModule.get(moduleDir) ?? []).some(
77507
- (path140) => path140.endsWith(".swift") && [...(readSmallFile(path140) ?? "").matchAll(/\bName\(\s*"(\w+)"\s*\)/g)].some(
77464
+ (path143) => path143.endsWith(".swift") && [...(readSmallFile(path143) ?? "").matchAll(/\bName\(\s*"(\w+)"\s*\)/g)].some(
77508
77465
  (match) => match[1] === name3
77509
77466
  )
77510
77467
  ) : false,
@@ -79597,26 +79554,26 @@ var init_native_preparation = __esm({
79597
79554
  const token = params.get(NATIVE_PREPARE_QUERY_PARAM);
79598
79555
  const inputs2 = token ? watchNativeInputs(root) : void 0;
79599
79556
  const key2 = inputs2 ? `${owner}\0${resolveActiveRuntimeRoot() ?? ""}` : owner;
79600
- let pending = this.compiling;
79557
+ let pending2 = this.compiling;
79601
79558
  if (inputs2) {
79602
79559
  const prepared = this.prepared.get(inputs2);
79603
- if (prepared) pending = prepared;
79560
+ if (prepared) pending2 = prepared;
79604
79561
  else {
79605
- pending = /* @__PURE__ */ new Map();
79606
- this.prepared.set(inputs2, pending);
79562
+ pending2 = /* @__PURE__ */ new Map();
79563
+ this.prepared.set(inputs2, pending2);
79607
79564
  }
79608
79565
  }
79609
- let preparation = pending.get(key2);
79566
+ let preparation = pending2.get(key2);
79610
79567
  if (!preparation || preparation.ready && !reusable(preparation.ready.value)) {
79611
79568
  const next = { result: Promise.resolve().then(compile2) };
79612
79569
  preparation = next;
79613
- pending.set(key2, next);
79570
+ pending2.set(key2, next);
79614
79571
  void next.result.then(
79615
79572
  (value2) => {
79616
- if (!inputs2 || !reusable(value2)) pending.delete(key2);
79573
+ if (!inputs2 || !reusable(value2)) pending2.delete(key2);
79617
79574
  else next.ready = { value: value2 };
79618
79575
  },
79619
- () => pending.delete(key2)
79576
+ () => pending2.delete(key2)
79620
79577
  );
79621
79578
  }
79622
79579
  const value = await preparation.result;
@@ -80489,12 +80446,12 @@ function installedNativeLibraries(providers, projectRoot, moduleRoot, iosTarget,
80489
80446
  function installedPodBinaries(directory2) {
80490
80447
  if (!import_node_fs93.default.existsSync(directory2)) return [];
80491
80448
  const binaries = [];
80492
- const pending = [directory2];
80493
- for (let current2 = pending.pop(); current2; current2 = pending.pop())
80449
+ const pending2 = [directory2];
80450
+ for (let current2 = pending2.pop(); current2; current2 = pending2.pop())
80494
80451
  for (const entry of import_node_fs93.default.readdirSync(current2, { withFileTypes: true })) {
80495
80452
  const file = import_node_path95.default.join(current2, entry.name);
80496
80453
  if (entry.isDirectory() && BINARY_BUNDLE.test(entry.name)) binaries.push(file);
80497
- else if (entry.isDirectory()) pending.push(file);
80454
+ else if (entry.isDirectory()) pending2.push(file);
80498
80455
  else if (entry.name.endsWith(".a")) binaries.push(file);
80499
80456
  else if (SOURCE.test(entry.name)) return [];
80500
80457
  }
@@ -80749,10 +80706,10 @@ var require_path_parse = __commonJS({
80749
80706
  code === 45 || /* - */
80750
80707
  code === 46;
80751
80708
  }
80752
- function State(path140) {
80709
+ function State(path143) {
80753
80710
  this.index = 0;
80754
- this.path = path140;
80755
- this.max = path140.length;
80711
+ this.path = path143;
80712
+ this.max = path143.length;
80756
80713
  this.result = [];
80757
80714
  this.param = 0;
80758
80715
  this.err = "";
@@ -81126,7 +81083,7 @@ var require_a2c = __commonJS({
81126
81083
  }
81127
81084
  return sign * Math.acos(dot);
81128
81085
  }
81129
- function get_arc_center(x1, y1, x2, y2, fa, fs103, rx, ry, sin_phi, cos_phi) {
81086
+ function get_arc_center(x1, y1, x2, y2, fa, fs106, rx, ry, sin_phi, cos_phi) {
81130
81087
  var x1p = cos_phi * (x1 - x2) / 2 + sin_phi * (y1 - y2) / 2;
81131
81088
  var y1p = -sin_phi * (x1 - x2) / 2 + cos_phi * (y1 - y2) / 2;
81132
81089
  var rx_sq = rx * rx;
@@ -81138,7 +81095,7 @@ var require_a2c = __commonJS({
81138
81095
  radicant = 0;
81139
81096
  }
81140
81097
  radicant /= rx_sq * y1p_sq + ry_sq * x1p_sq;
81141
- radicant = Math.sqrt(radicant) * (fa === fs103 ? -1 : 1);
81098
+ radicant = Math.sqrt(radicant) * (fa === fs106 ? -1 : 1);
81142
81099
  var cxp = radicant * rx / ry * y1p;
81143
81100
  var cyp = radicant * -ry / rx * x1p;
81144
81101
  var cx = cos_phi * cxp - sin_phi * cyp + (x1 + x2) / 2;
@@ -81149,10 +81106,10 @@ var require_a2c = __commonJS({
81149
81106
  var v2y = (-y1p - cyp) / ry;
81150
81107
  var theta1 = unit_vector_angle(1, 0, v1x, v1y);
81151
81108
  var delta_theta = unit_vector_angle(v1x, v1y, v2x, v2y);
81152
- if (fs103 === 0 && delta_theta > 0) {
81109
+ if (fs106 === 0 && delta_theta > 0) {
81153
81110
  delta_theta -= TAU;
81154
81111
  }
81155
- if (fs103 === 1 && delta_theta < 0) {
81112
+ if (fs106 === 1 && delta_theta < 0) {
81156
81113
  delta_theta += TAU;
81157
81114
  }
81158
81115
  return [cx, cy, theta1, delta_theta];
@@ -81165,7 +81122,7 @@ var require_a2c = __commonJS({
81165
81122
  var y2 = Math.sin(theta1 + delta_theta);
81166
81123
  return [x1, y1, x1 - y1 * alpha, y1 + x1 * alpha, x2 + y2 * alpha, y2 - x2 * alpha, x2, y2];
81167
81124
  }
81168
- module2.exports = function a2c(x1, y1, x2, y2, fa, fs103, rx, ry, phi) {
81125
+ module2.exports = function a2c(x1, y1, x2, y2, fa, fs106, rx, ry, phi) {
81169
81126
  var sin_phi = Math.sin(phi * TAU / 360);
81170
81127
  var cos_phi = Math.cos(phi * TAU / 360);
81171
81128
  var x1p = cos_phi * (x1 - x2) / 2 + sin_phi * (y1 - y2) / 2;
@@ -81183,7 +81140,7 @@ var require_a2c = __commonJS({
81183
81140
  rx *= Math.sqrt(lambda);
81184
81141
  ry *= Math.sqrt(lambda);
81185
81142
  }
81186
- var cc = get_arc_center(x1, y1, x2, y2, fa, fs103, rx, ry, sin_phi, cos_phi);
81143
+ var cc = get_arc_center(x1, y1, x2, y2, fa, fs106, rx, ry, sin_phi, cos_phi);
81187
81144
  var result = [];
81188
81145
  var theta1 = cc[2];
81189
81146
  var delta_theta = cc[3];
@@ -81272,11 +81229,11 @@ var require_svgpath = __commonJS({
81272
81229
  var matrix = require_matrix();
81273
81230
  var a2c = require_a2c();
81274
81231
  var ellipse = require_ellipse();
81275
- function SvgPath(path140) {
81232
+ function SvgPath(path143) {
81276
81233
  if (!(this instanceof SvgPath)) {
81277
- return new SvgPath(path140);
81234
+ return new SvgPath(path143);
81278
81235
  }
81279
- var pstate = pathParse(path140);
81236
+ var pstate = pathParse(path143);
81280
81237
  this.segments = pstate.segments;
81281
81238
  this.err = pstate.err;
81282
81239
  this.__stack = [];
@@ -81759,8 +81716,8 @@ function imagesetFiles(images) {
81759
81716
  function bundleImageRenditionKey(file, scale) {
81760
81717
  return extOf(file) === ".svg" ? `${file}/${scale}x.png` : file;
81761
81718
  }
81762
- function flatScale(path140) {
81763
- const match = /@([23])x\.[^./]+$/.exec(path140);
81719
+ function flatScale(path143) {
81720
+ const match = /@([23])x\.[^./]+$/.exec(path143);
81764
81721
  return match ? Number(match[1]) : 1;
81765
81722
  }
81766
81723
  function providesNamespace(text7) {
@@ -81787,8 +81744,8 @@ function catalogEntryName(contentsPath, kind, readText2) {
81787
81744
  }
81788
81745
  return segments.join("/");
81789
81746
  }
81790
- function isFlatResourceImage(path140) {
81791
- return path140.split("/").includes("Resources") && RASTER_EXTENSIONS.has(extOf(path140));
81747
+ function isFlatResourceImage(path143) {
81748
+ return path143.split("/").includes("Resources") && RASTER_EXTENSIONS.has(extOf(path143));
81792
81749
  }
81793
81750
  function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
81794
81751
  const table = [];
@@ -81801,7 +81758,7 @@ function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
81801
81758
  seen.set(bundlePath, names);
81802
81759
  return { bundlePath, names };
81803
81760
  };
81804
- const catalogs = paths.filter((path140) => baseOf(path140) === "Contents.json");
81761
+ const catalogs = paths.filter((path143) => baseOf(path143) === "Contents.json");
81805
81762
  for (const contentsPath of catalogs) {
81806
81763
  const name3 = catalogEntryName(contentsPath, ".imageset", readText2);
81807
81764
  if (name3 === null) continue;
@@ -81834,16 +81791,16 @@ function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
81834
81791
  ...intent === "template" || intent === "original" ? { renderingMode: intent } : {}
81835
81792
  });
81836
81793
  }
81837
- for (const path140 of paths) {
81838
- if (!isFlatResourceImage(path140)) continue;
81839
- const filename = baseOf(path140);
81794
+ for (const path143 of paths) {
81795
+ if (!isFlatResourceImage(path143)) continue;
81796
+ const filename = baseOf(path143);
81840
81797
  const name3 = filename.slice(0, -extOf(filename).length);
81841
- const { bundlePath, names } = namesFor(path140);
81798
+ const { bundlePath, names } = namesFor(path143);
81842
81799
  if (name3 === "" || names.has(name3)) continue;
81843
81800
  names.add(name3);
81844
81801
  const scaledFilename = filename.replace(/@[23]x(?=\.[^./]+$)/, "");
81845
81802
  const fileNames = (scaledFilename === filename ? [filename] : [filename, scaledFilename]).filter((lookup2) => !names.has(lookup2));
81846
- table.push({ name: name3, file: path140, scale: flatScale(path140), bundlePath, fileNames });
81803
+ table.push({ name: name3, file: path143, scale: flatScale(path143), bundlePath, fileNames });
81847
81804
  }
81848
81805
  return table;
81849
81806
  }
@@ -81878,7 +81835,7 @@ function colorsetValue(color) {
81878
81835
  }
81879
81836
  function enumerateBundleColors(paths, readText2) {
81880
81837
  const table = {};
81881
- for (const contentsPath of paths.filter((path140) => baseOf(path140) === "Contents.json")) {
81838
+ for (const contentsPath of paths.filter((path143) => baseOf(path143) === "Contents.json")) {
81882
81839
  const name3 = catalogEntryName(contentsPath, ".colorset", readText2);
81883
81840
  if (name3 === null || name3 in table) continue;
81884
81841
  let colors;
@@ -81942,8 +81899,8 @@ function axisExtremes(points) {
81942
81899
  function pathBounds(d) {
81943
81900
  const xs = [];
81944
81901
  const ys = [];
81945
- for (const path140 of d)
81946
- (0, import_svgpath.default)(path140).abs().unshort().unarc().iterate((segment3, _index, x, y) => {
81902
+ for (const path143 of d)
81903
+ (0, import_svgpath.default)(path143).abs().unshort().unarc().iterate((segment3, _index, x, y) => {
81947
81904
  const [command, ...args] = segment3;
81948
81905
  if (command === "M" || command === "L") {
81949
81906
  xs.push(Number(args[0]));
@@ -82009,7 +81966,7 @@ function guide(elements, id, axis) {
82009
81966
  }
82010
81967
  function enumerateBundleSymbols(paths, readText2, bundleForFile) {
82011
81968
  const table = {};
82012
- for (const contentsPath of paths.filter((path140) => baseOf(path140) === "Contents.json")) {
81969
+ for (const contentsPath of paths.filter((path143) => baseOf(path143) === "Contents.json")) {
82013
81970
  const name3 = catalogEntryName(contentsPath, ".symbolset", readText2);
82014
81971
  if (name3 === null) continue;
82015
81972
  const bundle = bundleForFile(contentsPath);
@@ -82075,8 +82032,8 @@ function enumerateBundleSymbols(paths, readText2, bundleForFile) {
82075
82032
  advance,
82076
82033
  box: [12 - wide2 / 2, 12 - tall / 2, wide2, tall],
82077
82034
  ...bearings ? { customLayout: { bearings, verticalOutset, descent } } : {},
82078
- layers: d.map((path140) => ({
82079
- d: (0, import_svgpath.default)(path140).abs().scale(em).translate(translateX, translateY).round(3).toString()
82035
+ layers: d.map((path143) => ({
82036
+ d: (0, import_svgpath.default)(path143).abs().scale(em).translate(translateX, translateY).round(3).toString()
82080
82037
  }))
82081
82038
  };
82082
82039
  table[vectorKey] = vector;
@@ -82087,13 +82044,13 @@ function enumerateBundleSymbols(paths, readText2, bundleForFile) {
82087
82044
  }
82088
82045
  return table;
82089
82046
  }
82090
- function isCopiedResource(path140, copiedBundle, copyLooseRasters) {
82091
- const segments = path140.split("/");
82047
+ function isCopiedResource(path143, copiedBundle, copyLooseRasters) {
82048
+ const segments = path143.split("/");
82092
82049
  if (segments.some((segment3) => /\.(atlasc|bundle|storyboardc|nib|momd)$/.test(segment3)))
82093
82050
  return true;
82094
82051
  if (segments.some((segment3) => /\.xcdatamodeld?$/.test(segment3))) return false;
82095
82052
  if (copiedBundle) return true;
82096
- const ext = extOf(path140);
82053
+ const ext = extOf(path143);
82097
82054
  if (ext === ".json" || ext === ".xcstrings") return true;
82098
82055
  return !COMPILED_EXTENSIONS.has(ext) && (copyLooseRasters || !RASTER_EXTENSIONS.has(ext)) && !segments.some((segment3) => segment3.endsWith(".xcassets"));
82099
82056
  }
@@ -82101,7 +82058,7 @@ function enumerateBundleResources(paths, { copiedBundle = false, copyLooseRaster
82101
82058
  const found = [];
82102
82059
  const seen = /* @__PURE__ */ new Set();
82103
82060
  const ordered = [...paths].filter(
82104
- (path140) => path140.split("/").includes("Resources") && path140.split("/").every((segment3) => segment3 !== "" && segment3 !== "..") && isCopiedResource(path140, copiedBundle, copyLooseRasters)
82061
+ (path143) => path143.split("/").includes("Resources") && path143.split("/").every((segment3) => segment3 !== "" && segment3 !== "..") && isCopiedResource(path143, copiedBundle, copyLooseRasters)
82105
82062
  ).sort((a, b) => {
82106
82063
  const aDepth = a.split("/").length;
82107
82064
  const bDepth = b.split("/").length;
@@ -82249,31 +82206,31 @@ function tokens(text7) {
82249
82206
  }
82250
82207
  return result;
82251
82208
  }
82252
- function qualified(language, key2, path140) {
82253
- return `(${language}: ${key2}${path140 === "" ? "" : "|==|" + path140})`;
82209
+ function qualified(language, key2, path143) {
82210
+ return `(${language}: ${key2}${path143 === "" ? "" : "|==|" + path143})`;
82254
82211
  }
82255
- function requiresNumber(language, key2, path140) {
82212
+ function requiresNumber(language, key2, path143) {
82256
82213
  return Error(
82257
- "Plural variation requires referencing the number in the string. To maintain grammatical correctness for strings that do not reference the number of items, use separate top-level strings for one and greater than one. " + qualified(language, key2, path140)
82214
+ "Plural variation requires referencing the number in the string. To maintain grammatical correctness for strings that do not reference the number of items, use separate top-level strings for one and greater than one. " + qualified(language, key2, path143)
82258
82215
  );
82259
82216
  }
82260
- function moreThanOne(language, key2, path140) {
82217
+ function moreThanOne(language, key2, path143) {
82261
82218
  return Error(
82262
- "Cannot infer format specifier for string group because more than one numerical specifier was found " + qualified(language, key2, path140)
82219
+ "Cannot infer format specifier for string group because more than one numerical specifier was found " + qualified(language, key2, path143)
82263
82220
  );
82264
82221
  }
82265
82222
  function schemaPath(segments) {
82266
82223
  return segments.map((segment3) => `'${segment3}'`).join(" -> ");
82267
82224
  }
82268
- function checkUnitShape(node, path140) {
82225
+ function checkUnitShape(node, path143) {
82269
82226
  const raw2 = node.stringUnit;
82270
82227
  if (raw2 === void 0)
82271
- throw Error(`Missing required key 'stringUnit' inside ${schemaPath(path140)}`);
82228
+ throw Error(`Missing required key 'stringUnit' inside ${schemaPath(path143)}`);
82272
82229
  if (raw2 === null)
82273
- throw Error(`Missing required value for key 'stringUnit' inside ${schemaPath(path140)}`);
82230
+ throw Error(`Missing required value for key 'stringUnit' inside ${schemaPath(path143)}`);
82274
82231
  if (!isRecord6(raw2))
82275
- throw Error(`Expected dictionary for key 'stringUnit' inside ${schemaPath(path140)}`);
82276
- const unitPath = [...path140, "stringUnit"];
82232
+ throw Error(`Expected dictionary for key 'stringUnit' inside ${schemaPath(path143)}`);
82233
+ const unitPath = [...path143, "stringUnit"];
82277
82234
  if (!Object.hasOwn(raw2, "state"))
82278
82235
  throw Error(`Missing required key 'state' inside ${schemaPath(unitPath)}`);
82279
82236
  const state = raw2.state;
@@ -82290,38 +82247,38 @@ function checkUnitShape(node, path140) {
82290
82247
  throw Error(`Expected string for key 'value' inside ${schemaPath(unitPath)}`);
82291
82248
  return value;
82292
82249
  }
82293
- function checkPluralShape(node, path140) {
82250
+ function checkPluralShape(node, path143) {
82294
82251
  for (const [category, raw2] of Object.entries(node)) {
82295
- const categoryPath = [...path140, category];
82252
+ const categoryPath = [...path143, category];
82296
82253
  if (raw2 === null)
82297
82254
  throw Error(
82298
- `Missing required value for key '${category}' inside ${schemaPath(path140)}`
82255
+ `Missing required value for key '${category}' inside ${schemaPath(path143)}`
82299
82256
  );
82300
82257
  if (!isRecord6(raw2))
82301
- throw Error(`Expected dictionary for key '${category}' inside ${schemaPath(path140)}`);
82258
+ throw Error(`Expected dictionary for key '${category}' inside ${schemaPath(path143)}`);
82302
82259
  checkUnitShape(raw2, categoryPath);
82303
82260
  }
82304
82261
  }
82305
- function checkLocalizationShape(node, path140, deviceValue = false) {
82262
+ function checkLocalizationShape(node, path143, deviceValue = false) {
82306
82263
  if (node === null)
82307
82264
  throw Error(
82308
- `Missing required value for key '${path140[path140.length - 1]}' inside ${schemaPath(path140.slice(0, -1))}`
82265
+ `Missing required value for key '${path143[path143.length - 1]}' inside ${schemaPath(path143.slice(0, -1))}`
82309
82266
  );
82310
82267
  if (!isRecord6(node))
82311
82268
  throw Error(
82312
- `Expected dictionary for key '${path140[path140.length - 1]}' inside ${schemaPath(path140.slice(0, -1))}`
82269
+ `Expected dictionary for key '${path143[path143.length - 1]}' inside ${schemaPath(path143.slice(0, -1))}`
82313
82270
  );
82314
- if (Object.hasOwn(node, "variations")) checkVariationsShape(node.variations, path140);
82271
+ if (Object.hasOwn(node, "variations")) checkVariationsShape(node.variations, path143);
82315
82272
  if (!deviceValue && Object.hasOwn(node, "substitutions"))
82316
- checkSubstitutionsShape(node.substitutions, path140);
82317
- if (!Object.hasOwn(node, "variations")) checkUnitShape(node, path140);
82273
+ checkSubstitutionsShape(node.substitutions, path143);
82274
+ if (!Object.hasOwn(node, "variations")) checkUnitShape(node, path143);
82318
82275
  }
82319
- function checkVariationsShape(variations, path140) {
82276
+ function checkVariationsShape(variations, path143) {
82320
82277
  if (variations === null)
82321
- throw Error(`Missing required value for key 'variations' inside ${schemaPath(path140)}`);
82278
+ throw Error(`Missing required value for key 'variations' inside ${schemaPath(path143)}`);
82322
82279
  if (!isRecord6(variations))
82323
- throw Error(`Expected dictionary for key 'variations' inside ${schemaPath(path140)}`);
82324
- const variationsPath = [...path140, "variations"];
82280
+ throw Error(`Expected dictionary for key 'variations' inside ${schemaPath(path143)}`);
82281
+ const variationsPath = [...path143, "variations"];
82325
82282
  for (const [type, raw2] of Object.entries(variations)) {
82326
82283
  if (raw2 === null)
82327
82284
  throw Error(
@@ -82347,11 +82304,11 @@ function checkVariationsShape(variations, path140) {
82347
82304
  }
82348
82305
  }
82349
82306
  }
82350
- function checkSubstitutionsShape(substitutions, path140) {
82307
+ function checkSubstitutionsShape(substitutions, path143) {
82351
82308
  if (substitutions === null) return;
82352
82309
  if (!isRecord6(substitutions))
82353
- throw Error(`Expected dictionary for key 'substitutions' inside ${schemaPath(path140)}`);
82354
- const substitutionsPath = [...path140, "substitutions"];
82310
+ throw Error(`Expected dictionary for key 'substitutions' inside ${schemaPath(path143)}`);
82311
+ const substitutionsPath = [...path143, "substitutions"];
82355
82312
  for (const [name3, raw2] of Object.entries(substitutions)) {
82356
82313
  const subPath = [...substitutionsPath, name3];
82357
82314
  if (raw2 === null)
@@ -82393,10 +82350,10 @@ function scanSpecs(forms) {
82393
82350
  }
82394
82351
  return specs;
82395
82352
  }
82396
- function inferPlural(forms, language, key2, path140) {
82353
+ function inferPlural(forms, language, key2, path143) {
82397
82354
  const specs = scanSpecs(forms);
82398
- if (specs.size === 0) throw requiresNumber(language, key2, path140);
82399
- if (specs.size > 1) throw moreThanOne(language, key2, path140);
82355
+ if (specs.size === 0) throw requiresNumber(language, key2, path143);
82356
+ if (specs.size > 1) throw moreThanOne(language, key2, path143);
82400
82357
  return [...specs.values()][0] ?? { specifier: "", argument: 0 };
82401
82358
  }
82402
82359
  function unit(value) {
@@ -82552,13 +82509,13 @@ function substitutionRules(format, subs, resolver, language, refPath) {
82552
82509
  );
82553
82510
  const reaches = (from, target) => {
82554
82511
  const seen = /* @__PURE__ */ new Set();
82555
- const pending = [...edges.get(from) ?? []];
82556
- while (pending.length > 0) {
82557
- const name3 = pending.pop() ?? "";
82512
+ const pending2 = [...edges.get(from) ?? []];
82513
+ while (pending2.length > 0) {
82514
+ const name3 = pending2.pop() ?? "";
82558
82515
  if (name3 === target) return true;
82559
82516
  if (seen.has(name3)) continue;
82560
82517
  seen.add(name3);
82561
- pending.push(...edges.get(name3) ?? []);
82518
+ pending2.push(...edges.get(name3) ?? []);
82562
82519
  }
82563
82520
  return false;
82564
82521
  };
@@ -82865,8 +82822,8 @@ function plist(value, depth) {
82865
82822
  }
82866
82823
  function compileStringCatalog(source, name3) {
82867
82824
  return Object.fromEntries(
82868
- Object.entries(compileCatalogTables(source, name3)).map(([path140, table]) => [
82869
- path140,
82825
+ Object.entries(compileCatalogTables(source, name3)).map(([path143, table]) => [
82826
+ path143,
82870
82827
  '<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n<plist version="1.0">\n' + plist(table, 0) + "</plist>\n"
82871
82828
  ])
82872
82829
  );
@@ -86471,7 +86428,7 @@ var init_swift_standin_digest = __esm({
86471
86428
  ];
86472
86429
  RUNTIME_IMPORT = /(?:^|[;\n])[ \t]*(?:import|export)\s+(?!type(?:\s|\{))([\s\S]*?)\s+from\s*['"]([^'"]+)['"]|(?:^|[;\n])[ \t]*import\s+['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
86473
86430
  standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS, STANDIN_DIGEST_EXCLUDED_FILES);
86474
- STANDIN_SOURCE_DIGEST = true ? "50a5456d1d027c009c10792b85618252cc788b290b745d16463d26584bfc163f" : standinSourceDigest();
86431
+ STANDIN_SOURCE_DIGEST = true ? "434280be603d7288671556bd3927e00632cd94beab9d58010000add5587f959b" : standinSourceDigest();
86475
86432
  }
86476
86433
  });
86477
86434
 
@@ -88432,8 +88389,8 @@ function withBuiltinStandinBehavior(behavior) {
88432
88389
  for (const [module2, members2] of Object.entries(BUILTIN_STANDIN_BEHAVIOR))
88433
88390
  merged[module2] = {
88434
88391
  ...Object.fromEntries(
88435
- Object.entries(members2).map(([path140, entry]) => [
88436
- path140,
88392
+ Object.entries(members2).map(([path143, entry]) => [
88393
+ path143,
88437
88394
  { ...entry, builtin: true }
88438
88395
  ])
88439
88396
  ),
@@ -88946,8 +88903,8 @@ function binaryHeaderSearchPaths(binary2, root, workspaceRoot2, declaredFramewor
88946
88903
  );
88947
88904
  const revision = import_node_path110.default.join(staging, "revisions", STANDIN_SOURCE_DIGEST.slice(0, 32));
88948
88905
  const stageTree = () => {
88949
- const pending = import_node_path110.default.join(staging, `pending.${process.pid}`);
88950
- import_node_fs108.default.rmSync(pending, { recursive: true, force: true });
88906
+ const pending2 = import_node_path110.default.join(staging, `pending.${process.pid}`);
88907
+ import_node_fs108.default.rmSync(pending2, { recursive: true, force: true });
88951
88908
  for (const framework of frameworks) {
88952
88909
  const swift = declared.get(framework);
88953
88910
  if (swift) {
@@ -88956,7 +88913,7 @@ function binaryHeaderSearchPaths(binary2, root, workspaceRoot2, declaredFramewor
88956
88913
  swift.declared,
88957
88914
  swift.imports,
88958
88915
  swift.sdkHeader,
88959
- pending
88916
+ pending2
88960
88917
  );
88961
88918
  continue;
88962
88919
  }
@@ -88964,7 +88921,7 @@ function binaryHeaderSearchPaths(binary2, root, workspaceRoot2, declaredFramewor
88964
88921
  if (import_node_fs108.default.existsSync(import_node_path110.default.join(framework, part)))
88965
88922
  import_node_fs108.default.cpSync(
88966
88923
  import_node_path110.default.join(framework, part),
88967
- import_node_path110.default.join(pending, "frameworks", import_node_path110.default.basename(framework), part),
88924
+ import_node_path110.default.join(pending2, "frameworks", import_node_path110.default.basename(framework), part),
88968
88925
  {
88969
88926
  recursive: true,
88970
88927
  dereference: true,
@@ -88976,7 +88933,7 @@ function binaryHeaderSearchPaths(binary2, root, workspaceRoot2, declaredFramewor
88976
88933
  );
88977
88934
  if (surface && "modulemap" in surface) {
88978
88935
  const modules = import_node_path110.default.join(
88979
- pending,
88936
+ pending2,
88980
88937
  "frameworks",
88981
88938
  import_node_path110.default.basename(framework),
88982
88939
  "Modules"
@@ -88988,7 +88945,7 @@ function binaryHeaderSearchPaths(binary2, root, workspaceRoot2, declaredFramewor
88988
88945
  }
88989
88946
  }
88990
88947
  for (const [index, directory2] of headers.entries()) {
88991
- import_node_fs108.default.cpSync(directory2, import_node_path110.default.join(pending, "headers", String(index)), {
88948
+ import_node_fs108.default.cpSync(directory2, import_node_path110.default.join(pending2, "headers", String(index)), {
88992
88949
  recursive: true,
88993
88950
  dereference: true,
88994
88951
  ...standalone ? {
@@ -88999,7 +88956,7 @@ function binaryHeaderSearchPaths(binary2, root, workspaceRoot2, declaredFramewor
88999
88956
  (item) => "headers" in item && item.headers === directory2
89000
88957
  );
89001
88958
  if (surface && "modulemap" in surface) {
89002
- const modulemap = import_node_path110.default.join(pending, "headers", String(index), "module.modulemap");
88959
+ const modulemap = import_node_path110.default.join(pending2, "headers", String(index), "module.modulemap");
89003
88960
  import_node_fs108.default.rmSync(modulemap, { force: true });
89004
88961
  import_node_fs108.default.copyFileSync(surface.modulemap, modulemap);
89005
88962
  }
@@ -89007,7 +88964,7 @@ function binaryHeaderSearchPaths(binary2, root, workspaceRoot2, declaredFramewor
89007
88964
  const contents2 = (0, import_node_crypto64.createHash)("sha256");
89008
88965
  for (const framework of providedFrameworks.filter((item) => !declared.has(item))) {
89009
88966
  const modulemap = import_node_path110.default.join(
89010
- pending,
88967
+ pending2,
89011
88968
  "frameworks",
89012
88969
  import_node_path110.default.basename(framework),
89013
88970
  "Modules/module.modulemap"
@@ -89023,16 +88980,16 @@ function binaryHeaderSearchPaths(binary2, root, workspaceRoot2, declaredFramewor
89023
88980
  )
89024
88981
  );
89025
88982
  }
89026
- for (const relative4 of import_node_fs108.default.readdirSync(pending, { recursive: true, encoding: "utf8" }).sort()) {
89027
- const file = import_node_path110.default.join(pending, relative4);
88983
+ for (const relative4 of import_node_fs108.default.readdirSync(pending2, { recursive: true, encoding: "utf8" }).sort()) {
88984
+ const file = import_node_path110.default.join(pending2, relative4);
89028
88985
  contents2.update(`${relative4}\0`);
89029
88986
  if (import_node_fs108.default.statSync(file).isFile()) contents2.update(import_node_fs108.default.readFileSync(file));
89030
88987
  }
89031
88988
  const name3 = contents2.digest("hex").slice(0, 32);
89032
88989
  try {
89033
- import_node_fs108.default.renameSync(pending, import_node_path110.default.join(staging, name3));
88990
+ import_node_fs108.default.renameSync(pending2, import_node_path110.default.join(staging, name3));
89034
88991
  } catch (error) {
89035
- import_node_fs108.default.rmSync(pending, { recursive: true, force: true });
88992
+ import_node_fs108.default.rmSync(pending2, { recursive: true, force: true });
89036
88993
  if (!import_node_fs108.default.existsSync(import_node_path110.default.join(staging, name3))) throw error;
89037
88994
  }
89038
88995
  import_node_fs108.default.mkdirSync(import_node_path110.default.dirname(revision), { recursive: true });
@@ -89185,9 +89142,9 @@ function generatedModuleMap(text7, framework) {
89185
89142
  import_node_fs108.default.mkdirSync(dir, { recursive: true });
89186
89143
  const file = import_node_path110.default.join(dir, "module.modulemap");
89187
89144
  if (!import_node_fs108.default.existsSync(file)) {
89188
- const pending = `${file}.${process.pid}.tmp`;
89189
- import_node_fs108.default.writeFileSync(pending, text7);
89190
- import_node_fs108.default.renameSync(pending, file);
89145
+ const pending2 = `${file}.${process.pid}.tmp`;
89146
+ import_node_fs108.default.writeFileSync(pending2, text7);
89147
+ import_node_fs108.default.renameSync(pending2, file);
89191
89148
  }
89192
89149
  return file;
89193
89150
  }
@@ -90773,9 +90730,9 @@ async function sourceStandins(binaries, toolchain, provided, behavior) {
90773
90730
  for (const [target, reason] of gaps) result.gaps.set(target, reason);
90774
90731
  if (result.gaps.size === 0 && isRecord(receipt)) {
90775
90732
  import_node_fs108.default.mkdirSync(import_node_path110.default.dirname(cached2), { recursive: true });
90776
- const pending = `${cached2}.${process.pid}.tmp`;
90777
- import_node_fs108.default.writeFileSync(pending, JSON.stringify({ ...receipt, generation }));
90778
- import_node_fs108.default.renameSync(pending, cached2);
90733
+ const pending2 = `${cached2}.${process.pid}.tmp`;
90734
+ import_node_fs108.default.writeFileSync(pending2, JSON.stringify({ ...receipt, generation }));
90735
+ import_node_fs108.default.renameSync(pending2, cached2);
90779
90736
  }
90780
90737
  return result;
90781
90738
  } finally {
@@ -91024,9 +90981,9 @@ ${roots.map((file) => ` header "${file}"`).join("\n")}
91024
90981
  }
91025
90982
  const publish2 = (value) => {
91026
90983
  import_node_fs108.default.mkdirSync(import_node_path110.default.dirname(cached2), { recursive: true });
91027
- const pending = `${cached2}.${process.pid}.tmp`;
91028
- import_node_fs108.default.writeFileSync(pending, JSON.stringify(value));
91029
- import_node_fs108.default.renameSync(pending, cached2);
90984
+ const pending2 = `${cached2}.${process.pid}.tmp`;
90985
+ import_node_fs108.default.writeFileSync(pending2, JSON.stringify(value));
90986
+ import_node_fs108.default.renameSync(pending2, cached2);
91030
90987
  built.set(id, value);
91031
90988
  };
91032
90989
  let result;
@@ -91124,7 +91081,7 @@ function standinDependencies(binaries, packages, provided) {
91124
91081
  for (const candidate of packages.moduleSources)
91125
91082
  byModule.set(swiftTargetModuleName(candidate.target), candidate);
91126
91083
  const shipped = /* @__PURE__ */ new Set();
91127
- const pending = [];
91084
+ const pending2 = [];
91128
91085
  const read = (dir, sources) => sources.flatMap(
91129
91086
  (source) => swiftImportNames(import_node_fs108.default.readFileSync(import_node_path110.default.join(dir, source), "utf8"))
91130
91087
  );
@@ -91138,21 +91095,21 @@ function standinDependencies(binaries, packages, provided) {
91138
91095
  for (const binary2 of binaries) {
91139
91096
  if (binary2.placeholder !== void 0) {
91140
91097
  shipped.add(swiftTargetModuleName(binary2.target));
91141
- pending.push(...read(binary2.dir, binary2.placeholder.sources));
91098
+ pending2.push(...read(binary2.dir, binary2.placeholder.sources));
91142
91099
  continue;
91143
91100
  }
91144
91101
  if (binary2.publicHeaders !== void 0) continue;
91145
91102
  for (const surface of binarySurfaces(binary2)) {
91146
91103
  shipped.add(surface.module);
91147
- pending.push(...surfaceImports(surface));
91104
+ pending2.push(...surfaceImports(surface));
91148
91105
  }
91149
91106
  }
91150
91107
  const selected = /* @__PURE__ */ new Map();
91151
- for (let module2 = pending.pop(); module2 !== void 0; module2 = pending.pop()) {
91108
+ for (let module2 = pending2.pop(); module2 !== void 0; module2 = pending2.pop()) {
91152
91109
  const candidate = byModule.get(module2);
91153
91110
  if (!candidate || shipped.has(module2) || selected.has(module2)) continue;
91154
91111
  selected.set(module2, candidate);
91155
- pending.push(
91112
+ pending2.push(
91156
91113
  ...candidate.moduleSources ? read(candidate.dir, candidate.moduleSources.sources) : binarySurfaces(candidate).flatMap(surfaceImports)
91157
91114
  );
91158
91115
  }
@@ -91722,7 +91679,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
91722
91679
  const generated = new Map(
91723
91680
  products?.files.map(({ path: declared, file }) => [declared, file])
91724
91681
  );
91725
- const pending = new Set(
91682
+ const pending2 = new Set(
91726
91683
  app.frameworks.flatMap((target) => {
91727
91684
  const compatibility = target.swift?.compatibility;
91728
91685
  return compatibility ? [
@@ -91738,7 +91695,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
91738
91695
  sources.set(file, import_node_fs109.default.readFileSync(generatedFile));
91739
91696
  return;
91740
91697
  }
91741
- if (pending.has(file)) return;
91698
+ if (pending2.has(file)) return;
91742
91699
  if (sources.has(file)) return;
91743
91700
  const resolved = header ? import_node_fs109.default.realpathSync.native(file) : file;
91744
91701
  if (resolved !== file) links[file] = resolved;
@@ -91927,7 +91884,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
91927
91884
  if (moduleMap2) {
91928
91885
  const requested = import_node_path111.default.resolve(app.rootDir, moduleMap2);
91929
91886
  const file = products ? requested : app.moduleMapSources?.[requested] ?? requested;
91930
- if (generated.has(file) || !pending.has(file) && import_node_fs109.default.existsSync(file))
91887
+ if (generated.has(file) || !pending2.has(file) && import_node_fs109.default.existsSync(file))
91931
91888
  queue.push({ file });
91932
91889
  }
91933
91890
  const directory2 = ["-I", "-F", "-iquote", "-isystem", "-iframework"].includes(
@@ -91957,7 +91914,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
91957
91914
  const availableHeader = (candidate) => {
91958
91915
  const source = productHeaders[candidate] ?? candidate;
91959
91916
  if (generated.has(source)) return source;
91960
- if (pending.has(source)) return null;
91917
+ if (pending2.has(source)) return null;
91961
91918
  let regular = regularFiles.get(source);
91962
91919
  if (regular === void 0) {
91963
91920
  const parent = import_node_path111.default.dirname(source);
@@ -93790,7 +93747,7 @@ function resolveSwiftPackages(options2) {
93790
93747
  headers.set(name3, import_node_path113.default.relative(binary2.dir, dir));
93791
93748
  };
93792
93749
  visit3(pkg, binary2.target);
93793
- binary2.headerDependencies = [...headers].map(([module2, path140]) => ({ module: module2, path: path140 }));
93750
+ binary2.headerDependencies = [...headers].map(([module2, path143]) => ({ module: module2, path: path143 }));
93794
93751
  }
93795
93752
  for (const owner of options2.owners ?? []) {
93796
93753
  const found = productClosure(owner.products);
@@ -94258,7 +94215,7 @@ var init_swift_cxx_reachable = __esm({
94258
94215
  // src/swift-pdf-raster.ts
94259
94216
  function rasterizePdfFiles(inputs2, { imageBytes, imageTotalBytes } = { imageBytes: Infinity, imageTotalBytes: Infinity }) {
94260
94217
  const rendered = /* @__PURE__ */ new Map();
94261
- const pending = /* @__PURE__ */ new Map();
94218
+ const pending2 = /* @__PURE__ */ new Map();
94262
94219
  const renderer = process.platform === "darwin" ? "30774891a9db216d" : "pdfium-1";
94263
94220
  const cache = cacheDir();
94264
94221
  const cached2 = (sha2565) => import_node_path115.default.join(cache, `swift-pdf-png-${renderer}-${sha2565}.png`);
@@ -94272,22 +94229,22 @@ function rasterizePdfFiles(inputs2, { imageBytes, imageTotalBytes } = { imageByt
94272
94229
  rendered.set(sha2565, bytes);
94273
94230
  };
94274
94231
  for (const input of inputs2) {
94275
- if (rendered.has(input.sha256) || pending.has(input.sha256)) continue;
94232
+ if (rendered.has(input.sha256) || pending2.has(input.sha256)) continue;
94276
94233
  let bytes;
94277
94234
  try {
94278
94235
  bytes = import_node_fs113.default.readFileSync(cached2(input.sha256));
94279
94236
  } catch {
94280
- pending.set(input.sha256, input);
94237
+ pending2.set(input.sha256, input);
94281
94238
  continue;
94282
94239
  }
94283
94240
  record5(input, bytes);
94284
94241
  }
94285
- if (!pending.size) return rendered;
94242
+ if (!pending2.size) return rendered;
94286
94243
  const work = import_node_fs113.default.mkdtempSync(import_node_path115.default.join(import_node_os23.default.tmpdir(), "swift-pdf-png-"));
94287
94244
  let cacheWork;
94288
94245
  let writeCache = true;
94289
94246
  try {
94290
- const requests = [...pending.values()].map((input, index) => ({
94247
+ const requests = [...pending2.values()].map((input, index) => ({
94291
94248
  ...input,
94292
94249
  file: import_node_path115.default.resolve(input.file),
94293
94250
  output: import_node_path115.default.join(work, `${index}.png`)
@@ -94821,7 +94778,7 @@ async function buildXcodeLayout(root) {
94821
94778
  });
94822
94779
  if (framework.moduleName !== module2 || framework.allSources.length === 0)
94823
94780
  throw new Error(`${project2}: ${target} did not produce source module ${module2}`);
94824
- if (framework.linkedProducts.length > 0 || framework.binaryFrameworks.some(({ path: path140 }) => path140))
94781
+ if (framework.linkedProducts.length > 0 || framework.binaryFrameworks.some(({ path: path143 }) => path143))
94825
94782
  throw new Error(
94826
94783
  `${project2}: ${target} has external dependencies outside the source framework build`
94827
94784
  );
@@ -97828,11 +97785,11 @@ function stringList3(value) {
97828
97785
  function externalSpecMembers(root, requested) {
97829
97786
  const children = (spec) => Array.isArray(spec.subspecs) ? spec.subspecs.filter(object7) : [];
97830
97787
  const chains = /* @__PURE__ */ new Map();
97831
- const select = (path140) => {
97832
- const key2 = path140.join("/");
97788
+ const select = (path143) => {
97789
+ const key2 = path143.join("/");
97833
97790
  if (chains.has(key2)) return;
97834
97791
  const chain = [root];
97835
- for (const part of path140) {
97792
+ for (const part of path143) {
97836
97793
  const child = children(chain.at(-1)).find((sub) => sub.name === part);
97837
97794
  if (!child) throw new Error(`${String(root.name)} has no subspec ${key2}`);
97838
97795
  chain.push(child);
@@ -97841,7 +97798,7 @@ function externalSpecMembers(root, requested) {
97841
97798
  const spec = chain.at(-1);
97842
97799
  const defaults = stringList3(spec.default_subspecs ?? spec.default_subspec);
97843
97800
  const activated = defaults[0] === "none" ? [] : defaults.length > 0 ? defaults : children(spec).map((sub) => String(sub.name));
97844
- for (const name3 of activated) select([...path140, ...name3.split("/")]);
97801
+ for (const name3 of activated) select([...path143, ...name3.split("/")]);
97845
97802
  for (const member of chain)
97846
97803
  for (const dependencies of [member.dependencies, iosOf(member)?.dependencies])
97847
97804
  for (const dependency of object7(dependencies) ? Object.keys(dependencies) : []) {
@@ -98483,10 +98440,10 @@ async function collectTurboSources(options2) {
98483
98440
  throw new Error(`TurboModule source is not UTF-8: ${disk}`);
98484
98441
  add(key2, text7);
98485
98442
  result.sources.push({ file: key2, source: disk, sha256: sha2564(bytes) });
98486
- pending.push({ key: key2, targetName, label, root, relative: relative4 });
98443
+ pending2.push({ key: key2, targetName, label, root, relative: relative4 });
98487
98444
  return key2;
98488
98445
  };
98489
- const pending = [];
98446
+ const pending2 = [];
98490
98447
  const pendingCodegen = [];
98491
98448
  const dependencyHeader = nitroDependencyReader(reactNative.version, reactNative.root);
98492
98449
  const dependencyTrees = /* @__PURE__ */ new Set();
@@ -99606,7 +99563,7 @@ async function collectTurboSources(options2) {
99606
99563
  );
99607
99564
  }
99608
99565
  for (; ; ) {
99609
- for (let next = pending.shift(); next; next = pending.shift())
99566
+ for (let next = pending2.shift(); next; next = pending2.shift())
99610
99567
  scanText(next, result.files[next.key]);
99611
99568
  let addedDep = false;
99612
99569
  for (let i = deferredDepUnits.length - 1; i >= 0; i--) {
@@ -99626,7 +99583,7 @@ async function collectTurboSources(options2) {
99626
99583
  if (pendingCodegen.length) {
99627
99584
  codegen ??= (await runInstalledTurboCodegen(options2.appRoot, options2.codegenDir)).generatedRoot;
99628
99585
  for (const { from, include, quoted: quoted2 } of pendingCodegen) resolve4(from, include, quoted2);
99629
- for (let next = pending.shift(); next; next = pending.shift())
99586
+ for (let next = pending2.shift(); next; next = pending2.shift())
99630
99587
  scanText(next, result.files[next.key]);
99631
99588
  }
99632
99589
  for (const file of textualSources) {
@@ -102931,17 +102888,17 @@ async function prebuiltReactNativeCore(project2, reactNativeRoot, moduleRoot, mo
102931
102888
  const entry = reactNativeCoreEntry(reactNativeRoot, moduleRoot, mode);
102932
102889
  let dir = fetchNativeEntry("react-native", entry.name, entry.key);
102933
102890
  if (!dir) {
102934
- let pending = building.get(entry.key);
102935
- if (!pending) {
102891
+ let pending2 = building.get(entry.key);
102892
+ if (!pending2) {
102936
102893
  console.error(
102937
102894
  `[peach] no published React Native ${entry.name} core at ${NATIVE_PREBUILT_ORIGIN}/${nativeEntryPrefix("react-native", entry.name, entry.key)}; building it locally`
102938
102895
  );
102939
- pending = Promise.resolve().then(() => (init_react_native_core_build(), react_native_core_build_exports)).then(
102896
+ pending2 = Promise.resolve().then(() => (init_react_native_core_build(), react_native_core_build_exports)).then(
102940
102897
  ({ buildReactNativeCore: buildReactNativeCore2 }) => buildReactNativeCore2(project2, reactNativeRoot, mode, moduleRoot)
102941
102898
  ).finally(() => building.delete(entry.key));
102942
- building.set(entry.key, pending);
102899
+ building.set(entry.key, pending2);
102943
102900
  }
102944
- dir = await pending;
102901
+ dir = await pending2;
102945
102902
  }
102946
102903
  const file = import_node_path123.default.join(dir, "core.json");
102947
102904
  const descriptor = JSON.parse(
@@ -104078,9 +104035,9 @@ function hashPackageTree(root, options2) {
104078
104035
  (a, b) => options2.compareNames(a.name, b.name)
104079
104036
  )) {
104080
104037
  if (entry.name === "node_modules") continue;
104081
- const path140 = `${relative4}${entry.name}`;
104082
- if (entry.isDirectory()) walk4((0, import_node_path127.join)(directory2, entry.name), `${path140}/`);
104083
- else if (entry.isFile() && !options2.skipFile?.(entry.name)) files2.push(path140);
104038
+ const path143 = `${relative4}${entry.name}`;
104039
+ if (entry.isDirectory()) walk4((0, import_node_path127.join)(directory2, entry.name), `${path143}/`);
104040
+ else if (entry.isFile() && !options2.skipFile?.(entry.name)) files2.push(path143);
104084
104041
  }
104085
104042
  };
104086
104043
  walk4(root, "");
@@ -104242,19 +104199,19 @@ var init_nitro_superset = __esm({
104242
104199
  init_nitroContract();
104243
104200
  init_swift_standin_digest();
104244
104201
  NITRO_SUPERSET_ENTRY_NAME = "superset";
104245
- NITRO_COMPILER_DIGEST = true ? "19f03b97f03b43275e353b2fb063de51fcbb8c70ef872cea0fb76dea29c9a243" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
104202
+ NITRO_COMPILER_DIGEST = true ? "20494153d445fedffb1b95f0fdf3d1eeee4ccb3c6f749f5263fd4af39497d19c" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
104246
104203
  nitroSupersetLock = parseLock(nitro_superset_lock_default);
104247
104204
  nitroSupersetKey = (inputs2) => nativeEntryKey({ ...inputs2, compiler: NITRO_COMPILER_DIGEST });
104248
104205
  published = /* @__PURE__ */ new Map();
104249
104206
  publishedMetadata = (url) => {
104250
- let pending = published.get(url);
104251
- if (!pending) {
104252
- pending = fetch(url).then(
104207
+ let pending2 = published.get(url);
104208
+ if (!pending2) {
104209
+ pending2 = fetch(url).then(
104253
104210
  async (response) => response.ok ? readNitroMetadata(await response.json()) : null
104254
104211
  ).catch(() => null);
104255
- published.set(url, pending);
104212
+ published.set(url, pending2);
104256
104213
  }
104257
- return pending;
104214
+ return pending2;
104258
104215
  };
104259
104216
  }
104260
104217
  });
@@ -104816,7 +104773,7 @@ function shardOneSDKBindingSource(name3, source, shardCount = ONE_SDK_BINDING_SH
104816
104773
  `;
104817
104774
  const chunks = [];
104818
104775
  let depth = 0;
104819
- let pending = [];
104776
+ let pending2 = [];
104820
104777
  let hadBrace = false;
104821
104778
  let activeEnum = null;
104822
104779
  let memberLines = [];
@@ -104835,29 +104792,29 @@ function shardOneSDKBindingSource(name3, source, shardCount = ONE_SDK_BINDING_SH
104835
104792
  if (depth === 0 && !hadBrace && /^\s*(?:@\w+(?:\([^)]*\))?\s+)*private\b/.test(maskedLine)) {
104836
104793
  return [[name3, source]];
104837
104794
  }
104838
- const enumMatch = depth === 0 && !hadBrace && pending.every((item) => item.trim() === "" || item.trim().startsWith("//")) ? /^enum (OneSDK_\w+)\s*\{\s*$/.exec(maskedLine) : null;
104795
+ const enumMatch = depth === 0 && !hadBrace && pending2.every((item) => item.trim() === "" || item.trim().startsWith("//")) ? /^enum (OneSDK_\w+)\s*\{\s*$/.exec(maskedLine) : null;
104839
104796
  if (enumMatch && delta === 1) {
104840
104797
  const enumName = enumMatch[1];
104841
- const prefix = pending.filter((item) => item.trim() !== "");
104798
+ const prefix = pending2.filter((item) => item.trim() !== "");
104842
104799
  chunks.push({
104843
104800
  kind: "top",
104844
104801
  text: [...prefix, `enum ${enumName} {}`].join("\n")
104845
104802
  });
104846
- pending = [];
104803
+ pending2 = [];
104847
104804
  activeEnum = enumName;
104848
104805
  depth = 1;
104849
104806
  continue;
104850
104807
  }
104851
- if (depth === 0 && !hadBrace && line.trim() === "" && pending.length === 0) {
104808
+ if (depth === 0 && !hadBrace && line.trim() === "" && pending2.length === 0) {
104852
104809
  continue;
104853
104810
  }
104854
- pending.push(line);
104811
+ pending2.push(line);
104855
104812
  if (delta !== 0 || depth > 0) hadBrace = true;
104856
104813
  depth += delta;
104857
104814
  if (depth < 0) return [[name3, source]];
104858
104815
  if (hadBrace && depth === 0) {
104859
- chunks.push({ kind: "top", text: pending.join("\n") });
104860
- pending = [];
104816
+ chunks.push({ kind: "top", text: pending2.join("\n") });
104817
+ pending2 = [];
104861
104818
  hadBrace = false;
104862
104819
  }
104863
104820
  } else {
@@ -104898,7 +104855,7 @@ function shardOneSDKBindingSource(name3, source, shardCount = ONE_SDK_BINDING_SH
104898
104855
  }
104899
104856
  }
104900
104857
  }
104901
- if (depth !== 0 || activeEnum !== null || pending.some((item) => item.trim() !== "" && !item.trim().startsWith("//")) || chunks.length < shardCount) {
104858
+ if (depth !== 0 || activeEnum !== null || pending2.some((item) => item.trim() !== "" && !item.trim().startsWith("//")) || chunks.length < shardCount) {
104902
104859
  return [[name3, source]];
104903
104860
  }
104904
104861
  const totalChars = chunks.reduce((sum, chunk) => sum + chunk.text.length, 0);
@@ -105110,7 +105067,7 @@ var init_expo_eager_seam_contract = __esm({
105110
105067
 
105111
105068
  // src/expo-native-compiler-digest.ts
105112
105069
  function expoNativeCompilerDigestValue() {
105113
- return true ? "587abe71f8ffa4c9a9681563b49d62ef0c8e41df27f31054748faca214f30400" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
105070
+ return true ? "d219d4f0d8c36c633e2f30b94c1aad4765274d4af80c31b77198ed3841aa1d76" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
105114
105071
  }
105115
105072
  var import_node_crypto78;
105116
105073
  var init_expo_native_compiler_digest = __esm({
@@ -105843,14 +105800,14 @@ async function lookup(appRoot) {
105843
105800
  const app = await expoNativeInputs(appRoot);
105844
105801
  if (!app) return null;
105845
105802
  const url = expoNativeEntryUrl(nativeEntryKey(app.inputs), "metadata.json");
105846
- let pending = published2.get(url);
105847
- if (!pending) {
105848
- pending = fetch(url).then(
105803
+ let pending2 = published2.get(url);
105804
+ if (!pending2) {
105805
+ pending2 = fetch(url).then(
105849
105806
  async (response) => response.ok ? readExpoNativeEntry(await response.json()) : null
105850
105807
  ).catch(() => null);
105851
- published2.set(url, pending);
105808
+ published2.set(url, pending2);
105852
105809
  }
105853
- const entry = await pending;
105810
+ const entry = await pending2;
105854
105811
  if (!entry) return null;
105855
105812
  const digests2 = await expoNativePackageDigests(app.packages);
105856
105813
  return (0, import_node_util17.isDeepStrictEqual)(digests2, entry.packages) ? entry : null;
@@ -105858,12 +105815,12 @@ async function lookup(appRoot) {
105858
105815
  function prebuiltExpoNative(appRoot, iosTarget) {
105859
105816
  if (iosTarget !== void 0) return Promise.resolve(null);
105860
105817
  const root = import_node_fs131.default.realpathSync(appRoot);
105861
- let pending = lookups.get(root);
105862
- if (!pending) {
105863
- pending = answer(root).finally(() => lookups.delete(root));
105864
- lookups.set(root, pending);
105818
+ let pending2 = lookups.get(root);
105819
+ if (!pending2) {
105820
+ pending2 = answer(root).finally(() => lookups.delete(root));
105821
+ lookups.set(root, pending2);
105865
105822
  }
105866
- return pending;
105823
+ return pending2;
105867
105824
  }
105868
105825
  async function prebuiltAppTarget(appRoot, signal, dependencies = "lockfile") {
105869
105826
  const prepared = await prepareExpoNativeProject(
@@ -107275,7 +107232,7 @@ ${source}`;
107275
107232
  const name3 = moduleMapName(text7);
107276
107233
  return name3 && provided.has(name3) && /\bumbrella\s+header\s+"[^"]+"/.test(text7) ? [{ file, text: text7, name: name3, reached: /* @__PURE__ */ new Set() }] : [];
107277
107234
  });
107278
- const pending = [
107235
+ const pending2 = [
107279
107236
  ...units.flatMap((unit2) => Object.entries(unit2.files)),
107280
107237
  ...units.flatMap(
107281
107238
  (unit2) => (unit2.nativeTargets ?? []).flatMap(
@@ -107291,8 +107248,8 @@ ${source}`;
107291
107248
  )
107292
107249
  ];
107293
107250
  const visited = /* @__PURE__ */ new Set();
107294
- while (pending.length) {
107295
- const [file, source] = pending.pop();
107251
+ while (pending2.length) {
107252
+ const [file, source] = pending2.pop();
107296
107253
  if (visited.has(file)) continue;
107297
107254
  visited.add(file);
107298
107255
  for (const match of source.matchAll(/#\s*(?:import|include)\s*[<"]([^>"]+)[>"]/g)) {
@@ -107303,12 +107260,12 @@ ${source}`;
107303
107260
  const candidate = import_node_path136.default.posix.join(import_node_path136.default.posix.dirname(map3.file), include);
107304
107261
  if (support[candidate] === void 0) continue;
107305
107262
  map3.reached.add(header);
107306
- pending.push([candidate, support[candidate]]);
107263
+ pending2.push([candidate, support[candidate]]);
107307
107264
  }
107308
107265
  const relative4 = import_node_path136.default.posix.normalize(
107309
107266
  import_node_path136.default.posix.join(import_node_path136.default.posix.dirname(file), include)
107310
107267
  );
107311
- if (support[relative4] !== void 0) pending.push([relative4, support[relative4]]);
107268
+ if (support[relative4] !== void 0) pending2.push([relative4, support[relative4]]);
107312
107269
  }
107313
107270
  }
107314
107271
  for (const map3 of maps) {
@@ -109255,12 +109212,12 @@ async function resolveExpoAndroidAutolinking(appRoot) {
109255
109212
  const root = import_node_fs135.default.realpathSync(appRoot);
109256
109213
  const existing = resolving.get(root);
109257
109214
  if (existing) return existing;
109258
- const pending = resolveAndroidModules(root);
109259
- resolving.set(root, pending);
109215
+ const pending2 = resolveAndroidModules(root);
109216
+ resolving.set(root, pending2);
109260
109217
  try {
109261
- return await pending;
109218
+ return await pending2;
109262
109219
  } finally {
109263
- if (resolving.get(root) === pending) resolving.delete(root);
109220
+ if (resolving.get(root) === pending2) resolving.delete(root);
109264
109221
  }
109265
109222
  }
109266
109223
  async function resolveAndroidModules(appRoot) {
@@ -109438,6 +109395,7 @@ async function resolveAndroidGradleSources(request) {
109438
109395
  }
109439
109396
  );
109440
109397
  const dependencySources = includeDependencySources ? readDependencySources(value.dependencySources) : void 0;
109398
+ const dependencyGraph = includeDependencySources ? readDependencyGraph(value.dependencyGraph) : void 0;
109441
109399
  return {
109442
109400
  projectDir,
109443
109401
  projectPath: value.projectPath,
@@ -109455,13 +109413,43 @@ async function resolveAndroidGradleSources(request) {
109455
109413
  linkedResourcePackage: linkedResource("linkedResourcePackage")
109456
109414
  } : {},
109457
109415
  dependencies,
109458
- ...dependencySources ? { dependencySources } : {}
109416
+ ...dependencySources ? { dependencySources, dependencyGraph } : {}
109459
109417
  };
109460
109418
  });
109461
109419
  } finally {
109462
109420
  import_node_fs136.default.rmSync(work, { recursive: true, force: true });
109463
109421
  }
109464
109422
  }
109423
+ function readDependencyGraph(value) {
109424
+ if (!isRecord(value) || !Array.isArray(value.javaClasspath) || !value.javaClasspath.every(
109425
+ (file) => typeof file === "string" && import_node_path139.default.isAbsolute(file)
109426
+ )) {
109427
+ throw new Error("Gradle printed invalid module graphs");
109428
+ }
109429
+ return {
109430
+ compile: readModules(value.compile),
109431
+ runtime: readModules(value.runtime),
109432
+ javaClasspath: value.javaClasspath.map(String)
109433
+ };
109434
+ }
109435
+ function readModules(value) {
109436
+ if (!Array.isArray(value)) throw new Error("Gradle printed an invalid module graph");
109437
+ const modules = value.map((entry) => {
109438
+ if (!isRecord(entry) || typeof entry.coordinate !== "string" || !/^[^:]+:[^:]+:[^:]+$/.test(entry.coordinate) || !Array.isArray(entry.dependencies) || !entry.dependencies.every((coordinate) => typeof coordinate === "string") || !Array.isArray(entry.jars) || !entry.jars.every((file) => typeof file === "string" && import_node_path139.default.isAbsolute(file)))
109439
+ throw new Error("Gradle printed an invalid module");
109440
+ return {
109441
+ coordinate: entry.coordinate,
109442
+ dependencies: entry.dependencies.map(String),
109443
+ jars: entry.jars.map(String)
109444
+ };
109445
+ });
109446
+ const coordinates = new Set(modules.map(({ coordinate }) => coordinate));
109447
+ if (coordinates.size !== modules.length || modules.some(
109448
+ ({ dependencies }) => dependencies.some((dependency) => !coordinates.has(dependency))
109449
+ ))
109450
+ throw new Error("Gradle printed duplicate modules or unresolved module edges");
109451
+ return modules;
109452
+ }
109465
109453
  function readDependencySources(value) {
109466
109454
  if (!Array.isArray(value)) throw new Error("Gradle printed invalid dependency sources");
109467
109455
  const coordinates = /* @__PURE__ */ new Set();
@@ -109523,6 +109511,42 @@ def resolveDependencySources = { project, configurations ->
109523
109511
  }
109524
109512
  }.sort { it.group + ':' + it.name + ':' + it.version }
109525
109513
  }
109514
+ def moduleCoordinate = { id -> id.group + ':' + id.module + ':' + id.version }
109515
+ def resolveModuleGraph = { configuration ->
109516
+ def classArtifacts = configuration.incoming.artifactView { view ->
109517
+ view.attributes.attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, 'android-classes-jar')
109518
+ }.artifacts.artifacts.findAll { it.id.componentIdentifier instanceof ModuleComponentIdentifier }
109519
+ def classJars = classArtifacts.groupBy { moduleCoordinate(it.id.componentIdentifier) }
109520
+ def resolution = configuration.incoming.resolutionResult
109521
+ def byCoordinate = [:]
109522
+ def seen = [] as Set
109523
+ def visit
109524
+ visit = { component, selectedVariant ->
109525
+ if (!seen.add([component.id, selectedVariant])) return
109526
+ def edges = component.getDependenciesForVariant(selectedVariant).findAll { edge ->
109527
+ if (edge.constraint) return false
109528
+ if (!(edge instanceof ResolvedDependencyResult)) {
109529
+ throw new GradleException('Unresolved Android dependency: ' + edge.requested, edge.failure)
109530
+ }
109531
+ def category = edge.resolvedVariant.attributes.getAttribute(Category.CATEGORY_ATTRIBUTE)?.name
109532
+ category != Category.REGULAR_PLATFORM && category != Category.ENFORCED_PLATFORM
109533
+ }
109534
+ if (component.id instanceof ModuleComponentIdentifier) {
109535
+ def coordinate = moduleCoordinate(component.id)
109536
+ def entry = byCoordinate.get(coordinate, [coordinate:coordinate, dependencies:[] as Set,
109537
+ jars:classJars.get(coordinate, []).collect { it.file.absolutePath }.unique().sort()])
109538
+ edges.findAll { it.selected.id instanceof ModuleComponentIdentifier }.each { edge ->
109539
+ entry.dependencies.add(moduleCoordinate(edge.selected.id))
109540
+ }
109541
+ }
109542
+ edges.each { edge -> visit(edge.selected, edge.resolvedVariant) }
109543
+ }
109544
+ visit(resolution.rootComponent.get(), resolution.rootVariant.get())
109545
+ def modules = byCoordinate.values().collect { entry ->
109546
+ [coordinate:entry.coordinate, dependencies:entry.dependencies.toList().sort(), jars:entry.jars]
109547
+ }.sort { it.coordinate }
109548
+ [modules:modules, classpath:classArtifacts.collect { it.file.absolutePath }.unique()]
109549
+ }
109526
109550
  gradle.beforeProject { project ->
109527
109551
  def directory = project.projectDir.canonicalPath
109528
109552
  if (project.rootProject.projectDir.canonicalPath != request.root || !request.projects.contains(directory)) return
@@ -109626,10 +109650,17 @@ gradle.projectsEvaluated {
109626
109650
  linkedResourcePackage = packages[0].outputFile
109627
109651
  }
109628
109652
  def bootClasspath = []
109629
- if (request.includeJavaClasspath || runtimeClasses != null) {
109653
+ if (request.includeJavaClasspath || runtimeClasses != null || request.includeDependencySources) {
109630
109654
  def sdk = project.extensions.getByName('androidComponents').sdkComponents
109631
109655
  bootClasspath = sdk.bootClasspath.get().collect { it.asFile }
109632
109656
  }
109657
+ def dependencyGraph = null
109658
+ if (request.includeDependencySources) {
109659
+ def compile = resolveModuleGraph(configurations[0])
109660
+ def runtime = resolveModuleGraph(configurations[1])
109661
+ dependencyGraph = [compile:compile.modules, runtime:runtime.modules,
109662
+ javaClasspath:(bootClasspath.collect { it.absolutePath } + compile.classpath).unique()]
109663
+ }
109633
109664
  new File(request.output, index.toString() + '.json').text = JsonOutput.toJson([
109634
109665
  projectDir:project.projectDir.canonicalPath,
109635
109666
  projectPath:project.path,
@@ -109643,6 +109674,7 @@ gradle.projectsEvaluated {
109643
109674
  dependencies:dependencies,
109644
109675
  dependencySources:request.includeDependencySources
109645
109676
  ? resolveDependencySources(project, configurations) : null,
109677
+ dependencyGraph:dependencyGraph,
109646
109678
  javaClasspath:request.includeJavaClasspath
109647
109679
  ? (bootClasspath + javac.classpath.files.findAll { it.exists() }).unique().collect { it.absolutePath } : null,
109648
109680
  runtimeJavaClasspath:runtimeClasses != null
@@ -110187,21 +110219,21 @@ function peachKotlinModuleRoot() {
110187
110219
  const root = import_node_path144.default.join(parent, digest3);
110188
110220
  import_node_fs141.default.mkdirSync(parent, { recursive: true });
110189
110221
  if (!import_node_fs141.default.existsSync(root)) {
110190
- const pending = import_node_fs141.default.mkdtempSync(import_node_path144.default.join(parent, ".install-"));
110222
+ const pending2 = import_node_fs141.default.mkdtempSync(import_node_path144.default.join(parent, ".install-"));
110191
110223
  try {
110192
110224
  for (const [name3, contents2] of Object.entries(files2)) {
110193
- const file = import_node_path144.default.join(pending, name3);
110225
+ const file = import_node_path144.default.join(pending2, name3);
110194
110226
  import_node_fs141.default.mkdirSync(import_node_path144.default.dirname(file), { recursive: true });
110195
110227
  import_node_fs141.default.writeFileSync(file, Buffer.from(contents2, "base64"));
110196
110228
  }
110197
110229
  try {
110198
- import_node_fs141.default.renameSync(pending, root);
110230
+ import_node_fs141.default.renameSync(pending2, root);
110199
110231
  } catch (error) {
110200
110232
  if (!isRecord(error) || error.code !== "EEXIST" && error.code !== "ENOTEMPTY")
110201
110233
  throw error;
110202
110234
  }
110203
110235
  } finally {
110204
- import_node_fs141.default.rmSync(pending, { recursive: true, force: true });
110236
+ import_node_fs141.default.rmSync(pending2, { recursive: true, force: true });
110205
110237
  }
110206
110238
  }
110207
110239
  for (const [name3, contents2] of Object.entries(files2)) {
@@ -110278,6 +110310,430 @@ var init_kotlin_browser_seams = __esm({
110278
110310
  }
110279
110311
  });
110280
110312
 
110313
+ // src/kotlin-library-sources.ts
110314
+ function runCompiler2(file, args, options2, operation) {
110315
+ return new Promise((resolve4, reject) => {
110316
+ const child = (0, import_node_child_process69.spawn)(file, args, options2);
110317
+ child.once("error", reject);
110318
+ child.once("close", (code, signal) => {
110319
+ if (code === 0) resolve4();
110320
+ else reject(new Error(operation + " stopped with " + (code ?? signal)));
110321
+ });
110322
+ });
110323
+ }
110324
+ function kotlinFragmentFlags(filename, kotlinSources2, translatedSources) {
110325
+ const input = JSON.parse(import_node_fs142.default.readFileSync(filename, "utf8"));
110326
+ if (!Array.isArray(input) || !input.length)
110327
+ throw new Error("Kotlin fragments must be a nonempty array");
110328
+ const fragments = input.map(
110329
+ (fragment) => {
110330
+ if (!isRecord(fragment) || typeof fragment.name !== "string" || !/^[a-zA-Z][a-zA-Z0-9_]*$/.test(fragment.name) || !Array.isArray(fragment.sources) || !fragment.sources.every((source) => typeof source === "string") || !Array.isArray(fragment.refines) || !fragment.refines.every((parent) => typeof parent === "string") || fragment.java !== void 0 && typeof fragment.java !== "boolean")
110331
+ throw new Error(
110332
+ "Each Kotlin fragment needs a name, source paths and refined fragments"
110333
+ );
110334
+ return {
110335
+ name: fragment.name,
110336
+ sources: fragment.sources.map((source) => import_node_path145.default.resolve(source)),
110337
+ refines: fragment.refines,
110338
+ java: fragment.java === true
110339
+ };
110340
+ }
110341
+ );
110342
+ const names = new Set(fragments.map(({ name: name3 }) => name3));
110343
+ const refined = new Set(fragments.flatMap(({ refines }) => refines));
110344
+ const [platform2, ...otherPlatforms] = [...names].filter((name3) => !refined.has(name3));
110345
+ const javaFragments = fragments.filter(({ java }) => java);
110346
+ if (names.size !== fragments.length || [...refined].some((name3) => !names.has(name3)) || !platform2 || otherPlatforms.length || javaFragments.length > 1)
110347
+ throw new Error(
110348
+ "Kotlin fragments need unique names, known parents, one platform fragment and at most one Java source fragment"
110349
+ );
110350
+ const sources = fragments.flatMap(({ sources: sources2 }) => sources2);
110351
+ const selected = new Set(kotlinSources2);
110352
+ if (sources.length !== selected.size || new Set(sources).size !== sources.length || sources.some((source) => !selected.has(source)) || [...sources, ...translatedSources].some((source) => source.includes(",")))
110353
+ throw new Error("Each Kotlin library source must belong to exactly one fragment");
110354
+ const mappings = fragments.flatMap(
110355
+ ({ name: name3, sources: sources2 }) => sources2.map((source) => `${name3}:${source}`)
110356
+ );
110357
+ const javaFragment = javaFragments[0]?.name ?? platform2;
110358
+ mappings.push(...translatedSources.map((source) => `${javaFragment}:${source}`));
110359
+ const edges = fragments.flatMap(
110360
+ ({ name: name3, refines }) => refines.map((parent) => `${name3}:${parent}`)
110361
+ );
110362
+ return [
110363
+ "-Xmulti-platform",
110364
+ `-Xfragments=${[...names].join(",")}`,
110365
+ ...edges.length ? [`-Xfragment-refines=${edges.join(",")}`] : [],
110366
+ `-Xfragment-sources=${mappings.join(",")}`
110367
+ ];
110368
+ }
110369
+ async function compileKotlinLibrarySources(input) {
110370
+ const output = import_node_path145.default.resolve(input.output);
110371
+ const name3 = import_node_path145.default.basename(output, ".klib");
110372
+ if (!name3 || !output.endsWith(".klib") || input.source.kind === "files" && !input.source.java.length && !input.source.kotlin.length)
110373
+ throw new Error("Android library compilation requires sources and a KLIB output");
110374
+ const { ready, sdkRoot, libraries } = input;
110375
+ const parent = import_node_path145.default.dirname(output);
110376
+ import_node_fs142.default.mkdirSync(parent, { recursive: true });
110377
+ const work = import_node_fs142.default.mkdtempSync(import_node_path145.default.join(parent, ".android-library-"));
110378
+ try {
110379
+ const compileLibraries = [...libraries, ...input.dependencies];
110380
+ let javaSources;
110381
+ if (input.source.kind === "resources") {
110382
+ const generated = import_node_path145.default.join(work, "resources");
110383
+ await runKotlinTool(
110384
+ ready,
110385
+ sdkRoot,
110386
+ "dev.peach.tools.platform.AndroidResourceClassesKt",
110387
+ [import_node_path145.default.resolve(input.source.archive), generated]
110388
+ );
110389
+ javaSources = import_node_fs142.default.readdirSync(generated, { recursive: true, encoding: "utf8" }).filter((file) => file.endsWith(".java")).sort().map((file) => import_node_path145.default.join(generated, file));
110390
+ } else {
110391
+ javaSources = input.source.java;
110392
+ }
110393
+ const kotlinSources2 = input.source.kind === "files" ? input.source.kotlin.map((file) => import_node_path145.default.resolve(file)) : [];
110394
+ const commonSources = (input.commonSources ?? []).map((file) => import_node_path145.default.resolve(file));
110395
+ if (commonSources.length && input.kotlinFragments)
110396
+ throw new Error("Choose common sources or a Kotlin fragment graph");
110397
+ if (commonSources.some((file) => file.includes(",") || !kotlinSources2.includes(file)))
110398
+ throw new Error("Common Kotlin sources must be included in the library source list");
110399
+ const kotlinJvmAbi = input.kotlinJvmAbi && import_node_path145.default.resolve(input.kotlinJvmAbi);
110400
+ if (kotlinJvmAbi && (!javaSources.length || !kotlinSources2.length || !kotlinJvmAbi.endsWith(".jar") || !input.javaClasspath.some((file) => import_node_path145.default.resolve(file) === kotlinJvmAbi)))
110401
+ throw new Error(
110402
+ "The Kotlin JVM ABI must be a JAR on the mixed library\u2019s Java classpath"
110403
+ );
110404
+ const dependencyAbiFlags = [];
110405
+ if (input.dependencyJvmAbi) {
110406
+ const dependencyPaths = new Set(
110407
+ input.dependencies.map((file) => import_node_path145.default.resolve(file))
110408
+ );
110409
+ const classpathPaths = new Set(
110410
+ input.javaClasspath.map((file) => import_node_path145.default.resolve(file))
110411
+ );
110412
+ const value = JSON.parse(import_node_fs142.default.readFileSync(input.dependencyJvmAbi, "utf8"));
110413
+ if (!Array.isArray(value) || !value.length || !javaSources.length)
110414
+ throw new Error(
110415
+ "Dependency JVM ABIs require Java sources and a nonempty array of KLIB/JAR pairs"
110416
+ );
110417
+ for (const pair of value) {
110418
+ if (!isRecord(pair) || typeof pair.klib !== "string" || typeof pair.jar !== "string")
110419
+ throw new Error("Each dependency JVM ABI requires a klib and a jar path");
110420
+ const klib = import_node_path145.default.resolve(pair.klib);
110421
+ const jar = import_node_path145.default.resolve(pair.jar);
110422
+ if (!klib.endsWith(".klib") || !dependencyPaths.has(klib) || !jar.endsWith(".jar") || !classpathPaths.has(jar) || jar === kotlinJvmAbi)
110423
+ throw new Error(
110424
+ "Dependency JVM ABI pairs must refer to a dependency KLIB and its Java classpath JAR"
110425
+ );
110426
+ dependencyAbiFlags.push("--dependency-jvm-abi", klib, jar);
110427
+ }
110428
+ }
110429
+ let translatedSources = [];
110430
+ if (javaSources.length) {
110431
+ const platform2 = import_node_path145.default.join(work, "platform.txt");
110432
+ const members2 = kotlinToolCommand(
110433
+ ready,
110434
+ sdkRoot,
110435
+ "dev.peach.tools.platform.KlibClassesKt",
110436
+ [
110437
+ ...compileLibraries.map((file) => import_node_path145.default.resolve(file)),
110438
+ ...kotlinJvmAbi ? ["--same-library-jvm-abi", kotlinJvmAbi] : [],
110439
+ ...dependencyAbiFlags
110440
+ ]
110441
+ );
110442
+ const fd = import_node_fs142.default.openSync(platform2, "w");
110443
+ try {
110444
+ await runCompiler2(
110445
+ members2.file,
110446
+ members2.args,
110447
+ { stdio: ["ignore", fd, "inherit"] },
110448
+ "Android library " + name3 + " metadata read"
110449
+ );
110450
+ } finally {
110451
+ import_node_fs142.default.closeSync(fd);
110452
+ }
110453
+ const sourceList = import_node_path145.default.join(work, "sources.txt");
110454
+ import_node_fs142.default.writeFileSync(
110455
+ sourceList,
110456
+ javaSources.map((file) => import_node_path145.default.resolve(file)).join("\n")
110457
+ );
110458
+ const translated = import_node_path145.default.join(work, "translated");
110459
+ const diagnostics = await runKotlinTool(
110460
+ ready,
110461
+ sdkRoot,
110462
+ "dev.peach.tools.java.JavaTranslatorKt",
110463
+ [
110464
+ "--target",
110465
+ "wasm",
110466
+ "--release",
110467
+ input.release,
110468
+ "--classpath",
110469
+ input.javaClasspath.map((file) => import_node_path145.default.resolve(file)).join(import_node_path145.default.delimiter),
110470
+ "--platform",
110471
+ platform2,
110472
+ ...input.processorPath ? ["--processorpath", input.processorPath] : [],
110473
+ "--out",
110474
+ translated,
110475
+ `@${sourceList}`
110476
+ ]
110477
+ );
110478
+ if (/^refuses /m.test(diagnostics))
110479
+ throw new Error(
110480
+ `Android library ${name3} requires unsupported platform members:
110481
+ ${diagnostics.trimEnd()}`
110482
+ );
110483
+ translatedSources = input.kotlinFragments ? import_node_fs142.default.readdirSync(translated, { recursive: true, encoding: "utf8" }).filter((file) => file.endsWith(".kt")).sort().map((file) => import_node_path145.default.join(translated, file)) : [translated];
110484
+ }
110485
+ const multiplatform = input.kotlinFragments ? kotlinFragmentFlags(input.kotlinFragments, kotlinSources2, translatedSources) : commonSources.length ? ["-Xmulti-platform", `-Xcommon-sources=${commonSources.join(",")}`] : [];
110486
+ const language = input.kotlinLanguage ?? "2.1";
110487
+ const raw2 = import_node_path145.default.join(work, "raw");
110488
+ await runCompiler2(
110489
+ ready.kotlinc,
110490
+ [
110491
+ "-J-Xmx4g",
110492
+ "-Xwasm-target=js",
110493
+ "-nowarn",
110494
+ `-Xplugin=${import_node_path145.default.join(sdkRoot, "plugin.jar")}`,
110495
+ "-P",
110496
+ "plugin:dev.peach.jni:android=true",
110497
+ "-language-version",
110498
+ language,
110499
+ "-api-version",
110500
+ language,
110501
+ ...(input.kotlinOptIns ?? []).map((marker) => `-opt-in=${marker}`),
110502
+ ...multiplatform,
110503
+ "-libraries",
110504
+ compileLibraries.join(import_node_path145.default.delimiter),
110505
+ "-ir-output-dir",
110506
+ raw2,
110507
+ "-ir-output-name",
110508
+ name3,
110509
+ ...kotlinSources2,
110510
+ ...translatedSources
110511
+ ],
110512
+ { stdio: "inherit", env: { ...process.env, JAVA_HOME: ready.javaHome } },
110513
+ "Android library " + name3 + " compilation"
110514
+ );
110515
+ const compiled = import_node_path145.default.join(raw2, `${name3}.klib`);
110516
+ if (!javaSources.length) {
110517
+ import_node_fs142.default.renameSync(compiled, output);
110518
+ return;
110519
+ }
110520
+ const normalized = import_node_path145.default.join(work, "normalized.klib");
110521
+ await runKotlinTool(ready, sdkRoot, "dev.peach.tools.platform.JavaPlatformTypesKt", [
110522
+ compiled,
110523
+ normalized,
110524
+ "--java-classes"
110525
+ ]);
110526
+ import_node_fs142.default.renameSync(normalized, output);
110527
+ } finally {
110528
+ import_node_fs142.default.rmSync(work, { recursive: true, force: true });
110529
+ }
110530
+ }
110531
+ var import_node_child_process69, import_node_fs142, import_node_path145;
110532
+ var init_kotlin_library_sources = __esm({
110533
+ "src/kotlin-library-sources.ts"() {
110534
+ "use strict";
110535
+ import_node_child_process69 = require("node:child_process");
110536
+ import_node_fs142 = __toESM(require("node:fs"), 1);
110537
+ import_node_path145 = __toESM(require("node:path"), 1);
110538
+ init_is_record();
110539
+ init_kotlin_toolchain();
110540
+ }
110541
+ });
110542
+
110543
+ // src/kotlin-maven-sources.ts
110544
+ function zipSources(bytes, where) {
110545
+ let end = -1;
110546
+ const earliest = Math.max(0, bytes.length - 22 - 65535);
110547
+ for (let index = bytes.length - 22; index >= earliest; index--) {
110548
+ if (bytes.readUInt32LE(index) === 101010256) {
110549
+ end = index;
110550
+ break;
110551
+ }
110552
+ }
110553
+ if (end < 0) throw new Error(`${where}: sources jar is not a zip`);
110554
+ const count = bytes.readUInt16LE(end + 8);
110555
+ if (count !== bytes.readUInt16LE(end + 10))
110556
+ throw new Error(`${where}: sources jar spans zip disks`);
110557
+ let offset = bytes.readUInt32LE(end + 16);
110558
+ if (offset === 4294967295) throw new Error(`${where}: sources jar is zip64`);
110559
+ const entries2 = [];
110560
+ let totalExtractedBytes = 0;
110561
+ for (let index = 0; index < count; index++) {
110562
+ if (bytes.readUInt32LE(offset) !== 33639248)
110563
+ throw new Error(`${where}: sources jar has a broken central directory`);
110564
+ const flags = bytes.readUInt16LE(offset + 8);
110565
+ const method = bytes.readUInt16LE(offset + 10);
110566
+ const compressed = bytes.readUInt32LE(offset + 20);
110567
+ const uncompressed = bytes.readUInt32LE(offset + 24);
110568
+ const nameLength = bytes.readUInt16LE(offset + 28);
110569
+ const extraLength = bytes.readUInt16LE(offset + 30);
110570
+ const commentLength = bytes.readUInt16LE(offset + 32);
110571
+ const localOffset = bytes.readUInt32LE(offset + 42);
110572
+ const name3 = bytes.toString("utf8", offset + 46, offset + 46 + nameLength);
110573
+ offset += 46 + nameLength + extraLength + commentLength;
110574
+ if (name3.endsWith("/")) continue;
110575
+ if (flags & 1) throw new Error(`${where}: ${name3} is encrypted`);
110576
+ if (name3.includes("\0") || name3.includes("\\") || name3.includes("\n") || name3.includes("\r") || name3.startsWith("/") || name3.split("/").includes(".."))
110577
+ throw new Error(`${where}: ${name3} escapes the sources jar`);
110578
+ if (!name3.endsWith(".kt") && !name3.endsWith(".java")) continue;
110579
+ if (uncompressed > MAX_SOURCE_ENTRY_BYTES || totalExtractedBytes + uncompressed > MAX_TOTAL_EXTRACTED_BYTES) {
110580
+ throw new Error(`${where}: ${name3} exceeds sources jar extraction budget`);
110581
+ }
110582
+ if (bytes.readUInt32LE(localOffset) !== 67324752)
110583
+ throw new Error(`${where}: ${name3} has no local header`);
110584
+ const localName = bytes.readUInt16LE(localOffset + 26);
110585
+ const localExtra = bytes.readUInt16LE(localOffset + 28);
110586
+ const start = localOffset + 30 + localName + localExtra;
110587
+ if (start + compressed > bytes.byteLength)
110588
+ throw new Error(`${where}: ${name3} exceeds sources jar bounds`);
110589
+ const remainingBudget = Math.min(
110590
+ MAX_SOURCE_ENTRY_BYTES,
110591
+ MAX_TOTAL_EXTRACTED_BYTES - totalExtractedBytes
110592
+ );
110593
+ const payload = bytes.subarray(start, start + compressed);
110594
+ let data = null;
110595
+ if (method === 0) {
110596
+ if (payload.byteLength > remainingBudget) {
110597
+ throw new Error(`${where}: ${name3} exceeds sources jar extraction budget`);
110598
+ }
110599
+ data = Buffer.from(payload);
110600
+ } else if (method === 8) {
110601
+ data = (0, import_node_zlib9.inflateRawSync)(payload, { maxOutputLength: remainingBudget });
110602
+ }
110603
+ if (!data) throw new Error(`${where}: ${name3} uses zip method ${method}`);
110604
+ totalExtractedBytes += data.byteLength;
110605
+ if (totalExtractedBytes > MAX_TOTAL_EXTRACTED_BYTES) {
110606
+ throw new Error(`${where}: sources jar exceeds extraction budget`);
110607
+ }
110608
+ entries2.push({ name: name3, data });
110609
+ }
110610
+ return entries2;
110611
+ }
110612
+ function extract(bytes, where) {
110613
+ const key2 = (0, import_node_crypto87.createHash)("sha256").update(bytes).digest("hex");
110614
+ const cached2 = pending.get(key2);
110615
+ if (cached2) return cached2;
110616
+ const request = (async () => {
110617
+ const dest = import_node_path146.default.join(import_node_os29.default.tmpdir(), "peach-maven-sources", key2);
110618
+ const marker = import_node_path146.default.join(dest, ".complete");
110619
+ if (!import_node_fs143.default.existsSync(marker)) {
110620
+ const sources = zipSources(bytes, where);
110621
+ const staging = `${dest}.partial-${process.pid}`;
110622
+ import_node_fs143.default.rmSync(staging, { recursive: true, force: true });
110623
+ const stagingRoot = import_node_path146.default.resolve(staging);
110624
+ import_node_fs143.default.mkdirSync(stagingRoot, { recursive: true });
110625
+ for (const entry of sources) {
110626
+ const file = import_node_path146.default.resolve(stagingRoot, entry.name);
110627
+ if (!file.startsWith(`${stagingRoot}${import_node_path146.default.sep}`)) {
110628
+ throw new Error(`${where}: ${entry.name} escapes the sources jar`);
110629
+ }
110630
+ import_node_fs143.default.mkdirSync(import_node_path146.default.dirname(file), { recursive: true });
110631
+ import_node_fs143.default.writeFileSync(file, entry.data);
110632
+ }
110633
+ import_node_fs143.default.writeFileSync(import_node_path146.default.join(staging, ".complete"), "");
110634
+ try {
110635
+ import_node_fs143.default.renameSync(staging, dest);
110636
+ } catch (error) {
110637
+ import_node_fs143.default.rmSync(staging, { recursive: true, force: true });
110638
+ if (!import_node_fs143.default.existsSync(marker)) throw error;
110639
+ }
110640
+ }
110641
+ const files2 = import_node_fs143.default.readdirSync(dest, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => import_node_path146.default.join(entry.parentPath, entry.name)).sort();
110642
+ return {
110643
+ directory: dest,
110644
+ java: files2.filter((file) => file.endsWith(".java")),
110645
+ kotlin: files2.filter((file) => file.endsWith(".kt"))
110646
+ };
110647
+ })().catch((error) => {
110648
+ pending.delete(key2);
110649
+ throw error;
110650
+ });
110651
+ pending.set(key2, request);
110652
+ return request;
110653
+ }
110654
+ function readSourcesJar(archive, where) {
110655
+ if (import_node_fs143.default.statSync(archive).size > MAX_SOURCES_JAR_BYTES)
110656
+ throw new Error(`${where}: ${archive} exceeds sources jar size limit`);
110657
+ return import_node_fs143.default.readFileSync(archive);
110658
+ }
110659
+ function readMavenSourcesArchive(archive) {
110660
+ return extract(readSourcesJar(archive, archive), archive);
110661
+ }
110662
+ var import_node_crypto87, import_node_fs143, import_node_os29, import_node_path146, import_node_zlib9, pending, MAX_SOURCES_JAR_BYTES, MAX_SOURCE_ENTRY_BYTES, MAX_TOTAL_EXTRACTED_BYTES;
110663
+ var init_kotlin_maven_sources = __esm({
110664
+ "src/kotlin-maven-sources.ts"() {
110665
+ "use strict";
110666
+ import_node_crypto87 = require("node:crypto");
110667
+ import_node_fs143 = __toESM(require("node:fs"), 1);
110668
+ import_node_os29 = __toESM(require("node:os"), 1);
110669
+ import_node_path146 = __toESM(require("node:path"), 1);
110670
+ import_node_zlib9 = require("node:zlib");
110671
+ pending = /* @__PURE__ */ new Map();
110672
+ MAX_SOURCES_JAR_BYTES = 64 * 1024 * 1024;
110673
+ MAX_SOURCE_ENTRY_BYTES = 16 * 1024 * 1024;
110674
+ MAX_TOTAL_EXTRACTED_BYTES = 64 * 1024 * 1024;
110675
+ }
110676
+ });
110677
+
110678
+ // src/kotlin-gradle-library-plan.ts
110679
+ async function compileKotlinGradleLibraries(input) {
110680
+ const compiled = /* @__PURE__ */ new Map();
110681
+ for (const library of input.plan.libraries) {
110682
+ const { java: archiveJava, kotlin } = await readMavenSourcesArchive(library.archive);
110683
+ const java = archiveJava.filter((file) => import_node_path147.default.basename(file) !== "module-info.java");
110684
+ const dependencies = library.dependencies.map((name4) => {
110685
+ const dependency = compiled.get(name4);
110686
+ if (!dependency) throw new Error(`${library.coordinate} depends on missing ${name4}`);
110687
+ return dependency;
110688
+ });
110689
+ const classpath = [
110690
+ .../* @__PURE__ */ new Set([
110691
+ ...library.jars,
110692
+ ...dependencies.flatMap(({ jars }) => jars),
110693
+ ...input.plan.classpath
110694
+ ])
110695
+ ];
110696
+ const name3 = library.coordinate.replace(/[^a-zA-Z0-9._-]/g, "-");
110697
+ const suffix = (0, import_node_crypto88.createHash)("sha256").update(library.coordinate).digest("hex").slice(0, 12);
110698
+ const klib = import_node_path147.default.join(input.output, `${name3}-${suffix}.klib`);
110699
+ const kotlinJvmAbi = java.length && kotlin.length && library.jars.length === 1 ? library.jars[0] : void 0;
110700
+ const abiPairs = java.length ? dependencies.flatMap(
110701
+ ({ klib: klib2, jars }) => jars.length === 1 ? [{ klib: klib2, jar: jars[0] }] : []
110702
+ ) : [];
110703
+ const dependencyJvmAbi = abiPairs.length ? `${klib}.json` : void 0;
110704
+ if (dependencyJvmAbi) {
110705
+ import_node_fs144.default.mkdirSync(input.output, { recursive: true });
110706
+ import_node_fs144.default.writeFileSync(dependencyJvmAbi, JSON.stringify(abiPairs));
110707
+ }
110708
+ await compileKotlinLibrarySources({
110709
+ ready: input.ready,
110710
+ sdkRoot: input.sdkRoot,
110711
+ libraries: input.libraries,
110712
+ source: { kind: "files", java, kotlin },
110713
+ javaClasspath: classpath,
110714
+ release: "17",
110715
+ kotlinJvmAbi,
110716
+ dependencyJvmAbi,
110717
+ kotlinLanguage: input.language,
110718
+ dependencies: dependencies.map(({ klib: klib2 }) => klib2),
110719
+ output: klib
110720
+ });
110721
+ compiled.set(library.coordinate, { klib, jars: library.jars });
110722
+ }
110723
+ return [...compiled.values()].map(({ klib }) => klib);
110724
+ }
110725
+ var import_node_crypto88, import_node_fs144, import_node_path147;
110726
+ var init_kotlin_gradle_library_plan = __esm({
110727
+ "src/kotlin-gradle-library-plan.ts"() {
110728
+ "use strict";
110729
+ import_node_crypto88 = require("node:crypto");
110730
+ import_node_fs144 = __toESM(require("node:fs"), 1);
110731
+ import_node_path147 = __toESM(require("node:path"), 1);
110732
+ init_kotlin_library_sources();
110733
+ init_kotlin_maven_sources();
110734
+ }
110735
+ });
110736
+
110281
110737
  // src/kotlin-instance-source.ts
110282
110738
  function bindingNames(pattern) {
110283
110739
  if (pattern.type === "Identifier") return [pattern.name];
@@ -110412,7 +110868,7 @@ var init_kotlin_instance_source = __esm({
110412
110868
 
110413
110869
  // src/kotlin-skiko-source.ts
110414
110870
  function kotlinSkikoSource(loader) {
110415
- const upstream = (0, import_acorn4.parse)((0, import_node_zlib9.gunzipSync)(loader).toString("utf8"), {
110871
+ const upstream = (0, import_acorn4.parse)((0, import_node_zlib10.gunzipSync)(loader).toString("utf8"), {
110416
110872
  ecmaVersion: "latest",
110417
110873
  sourceType: "module"
110418
110874
  });
@@ -110440,11 +110896,11 @@ function kotlinSkikoSource(loader) {
110440
110896
  ""
110441
110897
  ].join("\n");
110442
110898
  }
110443
- var import_node_zlib9, import_acorn4;
110899
+ var import_node_zlib10, import_acorn4;
110444
110900
  var init_kotlin_skiko_source = __esm({
110445
110901
  "src/kotlin-skiko-source.ts"() {
110446
110902
  "use strict";
110447
- import_node_zlib9 = require("node:zlib");
110903
+ import_node_zlib10 = require("node:zlib");
110448
110904
  import_acorn4 = require("peachsim/vendor/acorn");
110449
110905
  }
110450
110906
  });
@@ -110546,16 +111002,16 @@ __export(kotlin_host_exports, {
110546
111002
  });
110547
111003
  function loadKotlinSdk(moduleRoot, toolchain) {
110548
111004
  return installKotlinSdkArchive(
110549
- import_node_fs142.default.readFileSync(import_node_path145.default.join(moduleRoot, "sdk.tar.gz")),
111005
+ import_node_fs145.default.readFileSync(import_node_path148.default.join(moduleRoot, "sdk.tar.gz")),
110550
111006
  toolchain.compiler
110551
111007
  );
110552
111008
  }
110553
111009
  function appKotlinLanguage(root) {
110554
- const reactNative = import_node_path145.default.dirname(
110555
- (0, import_node_module23.createRequire)(import_node_path145.default.join(root, "package.json")).resolve("react-native/package.json")
111010
+ const reactNative = import_node_path148.default.dirname(
111011
+ (0, import_node_module23.createRequire)(import_node_path148.default.join(root, "package.json")).resolve("react-native/package.json")
110556
111012
  );
110557
- const versions = import_node_fs142.default.readFileSync(
110558
- import_node_path145.default.join(reactNative, "gradle", "libs.versions.toml"),
111013
+ const versions = import_node_fs145.default.readFileSync(
111014
+ import_node_path148.default.join(reactNative, "gradle", "libs.versions.toml"),
110559
111015
  "utf8"
110560
111016
  );
110561
111017
  const match = /^kotlin\s*=\s*"(\d+)\.(\d+)/m.exec(versions);
@@ -110566,9 +111022,9 @@ function appKotlinLanguage(root) {
110566
111022
  function kotlinSources(root, skip = SKIP_DIRS) {
110567
111023
  const sources = [];
110568
111024
  const walk4 = (dir) => {
110569
- for (const entry of import_node_fs142.default.readdirSync(dir, { withFileTypes: true })) {
111025
+ for (const entry of import_node_fs145.default.readdirSync(dir, { withFileTypes: true })) {
110570
111026
  if (entry.name.startsWith(".") || skip.has(entry.name)) continue;
110571
- const full = import_node_path145.default.join(dir, entry.name);
111027
+ const full = import_node_path148.default.join(dir, entry.name);
110572
111028
  if (entry.isDirectory()) walk4(full);
110573
111029
  else if (entry.isFile() && entry.name.endsWith(".kt")) sources.push(full);
110574
111030
  }
@@ -110625,7 +111081,7 @@ function entrySource(ids) {
110625
111081
  ].join("\n");
110626
111082
  }
110627
111083
  function buildsDir() {
110628
- return import_node_path145.default.join(kotlinHome(), "builds");
111084
+ return import_node_path148.default.join(kotlinHome(), "builds");
110629
111085
  }
110630
111086
  async function kotlinArtifact(root, moduleRoot, origin, target = "app") {
110631
111087
  const { kotlinSourceId, nativeSourceContract, renderKotlinSourceGlue } = await import("vxrn/native-source-contract");
@@ -110638,7 +111094,7 @@ async function kotlinArtifact(root, moduleRoot, origin, target = "app") {
110638
111094
  const viewIds = [];
110639
111095
  let usesCompose = false;
110640
111096
  for (const file of sources) {
110641
- const source = import_node_fs142.default.readFileSync(file, "utf8");
111097
+ const source = import_node_fs145.default.readFileSync(file, "utf8");
110642
111098
  if (/\bandroidx\.compose\./.test(source)) usesCompose = true;
110643
111099
  const contract = nativeSourceContract(file, source);
110644
111100
  if (contract.modules.length === 0 && contract.views.length === 0) continue;
@@ -110727,11 +111183,11 @@ function readExpoTypes(output) {
110727
111183
  });
110728
111184
  }
110729
111185
  async function scanSources(tool, parse16, toolchain, moduleRoot, files2) {
110730
- const digest3 = (0, import_node_crypto87.createHash)("sha256").update(JSON.stringify(toolchain.compiler));
111186
+ const digest3 = (0, import_node_crypto89.createHash)("sha256").update(JSON.stringify(toolchain.compiler));
110731
111187
  const sdk2 = await loadKotlinSdk(moduleRoot, toolchain);
110732
- digest3.update(import_node_fs142.default.readFileSync(import_node_path145.default.join(moduleRoot, "sdk.tar.gz")));
111188
+ digest3.update(import_node_fs145.default.readFileSync(import_node_path148.default.join(moduleRoot, "sdk.tar.gz")));
110733
111189
  digest3.update(tool);
110734
- for (const file of files2) digest3.update(`${file}\0${import_node_fs142.default.readFileSync(file, "utf8")}\0`);
111190
+ for (const file of files2) digest3.update(`${file}\0${import_node_fs145.default.readFileSync(file, "utf8")}\0`);
110735
111191
  const key2 = digest3.digest("hex");
110736
111192
  let scan3 = toolScans.get(key2);
110737
111193
  if (!scan3) {
@@ -110746,7 +111202,7 @@ async function scanSources(tool, parse16, toolchain, moduleRoot, files2) {
110746
111202
  async function scanExpoTypes(toolchain, moduleRoot, sources) {
110747
111203
  const candidates = sources.filter(
110748
111204
  (file) => /\bRecord\b|\benum\s+class\b|\bExpoComposeView\b|\bExpoView\b|\bComposeProps\b|:\s*(?:[A-Za-z0-9_.]+\.)?(?:View|FrameLayout|LinearLayout|ViewGroup)\b/.test(
110749
- import_node_fs142.default.readFileSync(file, "utf8")
111205
+ import_node_fs145.default.readFileSync(file, "utf8")
110750
111206
  )
110751
111207
  );
110752
111208
  if (candidates.length === 0) return [];
@@ -110890,7 +111346,7 @@ function expoTypeSources(files2) {
110890
111346
  )
110891
111347
  ];
110892
111348
  if (edits.length > 0 || views.length > 0) {
110893
- let text7 = import_node_fs142.default.readFileSync(file.file, "utf8").replaceAll("\r\n", "\n");
111349
+ let text7 = import_node_fs145.default.readFileSync(file.file, "utf8").replaceAll("\r\n", "\n");
110894
111350
  for (const { range: range3, owner, field } of edits.sort((a, b) => b.range[0] - a.range[0]))
110895
111351
  text7 = `${text7.slice(0, range3[0])}dev.peach.expo.PeachExpoTypes.initial(${owner}::class, ${literal2(field.key)}, ${field.required}) { ${text7.slice(range3[0], range3[1])} }${text7.slice(range3[1])}`;
110896
111352
  if (views.length > 0) {
@@ -110906,7 +111362,7 @@ function expoTypeSources(files2) {
110906
111362
  `${file.package ? `${file.package}.` : ""}peachExpoViews${index}()`
110907
111363
  );
110908
111364
  }
110909
- const name3 = `PeachExpoSource_${index}_${import_node_path145.default.basename(file.file)}`;
111365
+ const name3 = `PeachExpoSource_${index}_${import_node_path148.default.basename(file.file)}`;
110910
111366
  generated[name3] = text7;
110911
111367
  origins[name3] = file.file;
110912
111368
  }
@@ -110948,7 +111404,7 @@ async function expoKotlinArtifact(root, moduleRoot, origin, modules) {
110948
111404
  const language = appKotlinLanguage(root);
110949
111405
  const scanned = await scanExpoTypes(toolchain, moduleRoot, modules.sources);
110950
111406
  const usesCompose = scanned.some((file) => file.views.length > 0) || modules.sources.some(
110951
- (file) => /\bandroidx\.compose\./.test(import_node_fs142.default.readFileSync(file, "utf8"))
111407
+ (file) => /\bandroidx\.compose\./.test(import_node_fs145.default.readFileSync(file, "utf8"))
110952
111408
  );
110953
111409
  const types2 = expoTypeSources(scanned);
110954
111410
  const rewritten = new Set(Object.values(types2.origins));
@@ -111114,6 +111570,7 @@ async function kotlinAppArtifact(app, moduleRoot, origin) {
111114
111570
  kotlinOptIns: app.kotlinOptIns,
111115
111571
  sources: app.sources,
111116
111572
  javaSpecs: app.javaSources,
111573
+ gradleLibraries: app.gradleLibraries,
111117
111574
  generated,
111118
111575
  sdkProfile: "app",
111119
111576
  usesCompose: true,
@@ -111166,7 +111623,7 @@ function appResourceSources(app) {
111166
111623
  entries: app.drawables.map((drawable) => ({
111167
111624
  name: drawable.name,
111168
111625
  init: `listOf(
111169
- ${drawable.files.map((file) => drawableInit(file, import_node_path145.default.relative(app.moduleDir, file.file))).join(",\n")}
111626
+ ${drawable.files.map((file) => drawableInit(file, import_node_path148.default.relative(app.moduleDir, file.file))).join(",\n")}
111170
111627
  )`
111171
111628
  }))
111172
111629
  },
@@ -111290,7 +111747,7 @@ function drawableInit(drawable, file) {
111290
111747
  if (drawable.kind === "xml") return `PeachDrawable.Xml(${where})`;
111291
111748
  if (drawable.kind === "bitmap")
111292
111749
  return `PeachDrawable.Bitmap(${where}, ${drawable.ninePatch}, ${literal2(
111293
- import_node_fs142.default.readFileSync(drawable.file).toString("base64")
111750
+ import_node_fs145.default.readFileSync(drawable.file).toString("base64")
111294
111751
  )})`;
111295
111752
  const vector = drawable.vector;
111296
111753
  const float3 = (value) => `${value}f`;
@@ -111352,11 +111809,12 @@ async function compileKotlin(input, origin) {
111352
111809
  usesCompose,
111353
111810
  usesSerialization = false,
111354
111811
  viewModels,
111355
- javaSpecs = []
111812
+ javaSpecs = [],
111813
+ gradleLibraries
111356
111814
  } = input;
111357
111815
  const sdk2 = await loadKotlinSdk(moduleRoot, toolchain);
111358
- const plugin = import_node_path145.default.join(sdk2.root, "plugin.jar");
111359
- const sdkLibrary = import_node_path145.default.join(sdk2.root, `${sdkProfile}.klib`);
111816
+ const plugin = import_node_path148.default.join(sdk2.root, "plugin.jar");
111817
+ const sdkLibrary = import_node_path148.default.join(sdk2.root, `${sdkProfile}.klib`);
111360
111818
  const javaRead = javaSpecs.length ? await readJavaModuleSpecs(javaSpecs, sdk2.root, await ensureToolchain(toolchain)) : null;
111361
111819
  const java = javaRead && javaRead.specs.some((spec) => !spec.application) ? { ...javaRead, specs: javaRead.specs.filter((spec) => !spec.application) } : null;
111362
111820
  const applicationJava = javaRead?.specs.filter((spec) => spec.application) ?? [];
@@ -111384,10 +111842,10 @@ async function compileKotlin(input, origin) {
111384
111842
  };
111385
111843
  const inputs2 = sources.map((file) => ({
111386
111844
  file,
111387
- bytes: import_node_fs142.default.readFileSync(file)
111845
+ bytes: import_node_fs145.default.readFileSync(file)
111388
111846
  }));
111389
111847
  const { composeArchive, ...compilerInputs } = toolchain;
111390
- const digest3 = (0, import_node_crypto87.createHash)("sha256");
111848
+ const digest3 = (0, import_node_crypto89.createHash)("sha256");
111391
111849
  digest3.update(
111392
111850
  JSON.stringify({
111393
111851
  format: BUILD_FORMAT,
@@ -111401,7 +111859,17 @@ async function compileKotlin(input, origin) {
111401
111859
  })
111402
111860
  );
111403
111861
  for (const { file, bytes } of inputs2)
111404
- digest3.update(import_node_path145.default.relative(root, file)).update("\0").update(bytes).update("\0");
111862
+ digest3.update(import_node_path148.default.relative(root, file)).update("\0").update(bytes).update("\0");
111863
+ if (gradleLibraries) {
111864
+ digest3.update(JSON.stringify(gradleLibraries));
111865
+ const files2 = /* @__PURE__ */ new Set([
111866
+ ...gradleLibraries.classpath,
111867
+ ...gradleLibraries.libraries.flatMap(({ archive, jars }) => [archive, ...jars])
111868
+ ]);
111869
+ for (const file of files2) {
111870
+ digest3.update((0, import_node_crypto89.createHash)("sha256").update(import_node_fs145.default.readFileSync(file)).digest());
111871
+ }
111872
+ }
111405
111873
  if (viewModels) digest3.update(viewModels.toolClass);
111406
111874
  for (const [name3, text7] of Object.entries(generated))
111407
111875
  digest3.update(`${name3}\0${text7}\0`);
@@ -111410,49 +111878,49 @@ async function compileKotlin(input, origin) {
111410
111878
  url: `${origin}${KOTLIN_ARTIFACT_PREFIX}${hash}/app.mjs`,
111411
111879
  hash
111412
111880
  };
111413
- const out = import_node_path145.default.join(buildsDir(), hash);
111414
- if (import_node_fs142.default.existsSync(import_node_path145.default.join(out, "js", "app.wasm"))) return artifact;
111415
- const pending = builds.get(hash);
111416
- if (pending) return pending;
111881
+ const out = import_node_path148.default.join(buildsDir(), hash);
111882
+ if (import_node_fs145.default.existsSync(import_node_path148.default.join(out, "js", "app.wasm"))) return artifact;
111883
+ const pending2 = builds.get(hash);
111884
+ if (pending2) return pending2;
111417
111885
  const build2 = (async () => {
111418
111886
  const ready = await ensureToolchain(toolchain);
111419
111887
  const { kotlinc } = ready;
111420
- const libraries = [...ready.libraries, sdkLibrary, import_node_path145.default.join(sdk2.root, "java.klib")];
111888
+ const libraries = [...ready.libraries, sdkLibrary, import_node_path148.default.join(sdk2.root, "java.klib")];
111421
111889
  const compose = usesCompose ? await ensureCompose(toolchain) : null;
111422
111890
  if (compose) libraries.push(...compose.libraries);
111423
- import_node_fs142.default.mkdirSync(buildsDir(), { recursive: true });
111424
- const work = import_node_fs142.default.mkdtempSync(import_node_path145.default.join(buildsDir(), `${hash}-`));
111425
- const javaLibrary = java ? import_node_path145.default.join(work, "java-abi", "java-abi.klib") : null;
111891
+ import_node_fs145.default.mkdirSync(buildsDir(), { recursive: true });
111892
+ const work = import_node_fs145.default.mkdtempSync(import_node_path148.default.join(buildsDir(), `${hash}-`));
111893
+ const javaLibrary = java ? import_node_path148.default.join(work, "java-abi", "java-abi.klib") : null;
111426
111894
  if (javaLibrary) libraries.push(javaLibrary);
111427
- const generatedDir = import_node_path145.default.join(work, "generated");
111428
- import_node_fs142.default.mkdirSync(generatedDir);
111895
+ const generatedDir = import_node_path148.default.join(work, "generated");
111896
+ import_node_fs145.default.mkdirSync(generatedDir);
111429
111897
  for (const [name3, text7] of Object.entries(generated))
111430
- import_node_fs142.default.writeFileSync(import_node_path145.default.join(generatedDir, name3), text7);
111898
+ import_node_fs145.default.writeFileSync(import_node_path148.default.join(generatedDir, name3), text7);
111431
111899
  const compiledSources = inputs2.map(({ file, bytes }, index) => {
111432
- const target = import_node_path145.default.join(work, "sources", String(index), import_node_path145.default.basename(file));
111433
- import_node_fs142.default.mkdirSync(import_node_path145.default.dirname(target), { recursive: true });
111434
- import_node_fs142.default.writeFileSync(target, bytes);
111900
+ const target = import_node_path148.default.join(work, "sources", String(index), import_node_path148.default.basename(file));
111901
+ import_node_fs145.default.mkdirSync(import_node_path148.default.dirname(target), { recursive: true });
111902
+ import_node_fs145.default.writeFileSync(target, bytes);
111435
111903
  return { file, target };
111436
111904
  });
111437
- const common2 = [
111905
+ const common2 = () => [
111438
111906
  // the full upstream Compose graph exceeds kotlinc's 512 mib default heap.
111439
111907
  "-J-Xmx2g",
111440
111908
  "-Xallow-kotlin-package",
111441
111909
  "-Xwasm-target=js",
111442
111910
  "-libraries",
111443
- libraries.join(import_node_path145.default.delimiter)
111911
+ libraries.join(import_node_path148.default.delimiter)
111444
111912
  ];
111445
111913
  const compileKlib = (outputDir) => run15(
111446
111914
  kotlinc,
111447
111915
  [
111448
- ...common2,
111916
+ ...common2(),
111449
111917
  `-Xplugin=${plugin}`,
111450
- `-Xfriend-modules=${[sdkLibrary, ...javaLibrary ? [javaLibrary] : []].join(import_node_path145.default.delimiter)}`,
111918
+ `-Xfriend-modules=${[sdkLibrary, ...javaLibrary ? [javaLibrary] : []].join(import_node_path148.default.delimiter)}`,
111451
111919
  ...usesCompose ? [
111452
- `-Xplugin=${import_node_path145.default.resolve(import_node_path145.default.dirname(kotlinc), "../lib/compose-compiler-plugin.jar")}`
111920
+ `-Xplugin=${import_node_path148.default.resolve(import_node_path148.default.dirname(kotlinc), "../lib/compose-compiler-plugin.jar")}`
111453
111921
  ] : [],
111454
111922
  ...usesSerialization ? [
111455
- `-Xplugin=${import_node_path145.default.resolve(import_node_path145.default.dirname(kotlinc), "../lib/kotlinx-serialization-compiler-plugin.jar")}`
111923
+ `-Xplugin=${import_node_path148.default.resolve(import_node_path148.default.dirname(kotlinc), "../lib/kotlinx-serialization-compiler-plugin.jar")}`
111456
111924
  ] : [],
111457
111925
  "-language-version",
111458
111926
  language,
@@ -111466,11 +111934,23 @@ async function compileKotlin(input, origin) {
111466
111934
  "-ir-output-name",
111467
111935
  "app",
111468
111936
  ...compiledSources.map(({ target }) => target),
111469
- ...Object.keys(generated).map((name3) => import_node_path145.default.join(generatedDir, name3))
111937
+ ...Object.keys(generated).map((name3) => import_node_path148.default.join(generatedDir, name3))
111470
111938
  ],
111471
111939
  { maxBuffer: 16 * 1024 * 1024 }
111472
111940
  );
111473
111941
  try {
111942
+ if (gradleLibraries) {
111943
+ libraries.push(
111944
+ ...await compileKotlinGradleLibraries({
111945
+ plan: gradleLibraries,
111946
+ ready,
111947
+ sdkRoot: sdk2.root,
111948
+ libraries: libraries.filter((library) => library !== javaLibrary),
111949
+ language,
111950
+ output: import_node_path148.default.join(work, "gradle-libraries")
111951
+ })
111952
+ );
111953
+ }
111474
111954
  if (java)
111475
111955
  await compileJavaModuleAbi({
111476
111956
  specs: java,
@@ -111485,49 +111965,49 @@ async function compileKotlin(input, origin) {
111485
111965
  if (viewModels && inputs2.some(
111486
111966
  ({ file, bytes }) => sources.includes(file) && bytes.includes("ViewModel")
111487
111967
  )) {
111488
- await compileKlib(import_node_path145.default.join(work, "abi"));
111968
+ await compileKlib(import_node_path148.default.join(work, "abi"));
111489
111969
  const stdout = await runKotlinTool(
111490
111970
  ready,
111491
111971
  sdk2.root,
111492
111972
  viewModels.toolClass,
111493
- [import_node_path145.default.join(work, "abi")],
111973
+ [import_node_path148.default.join(work, "abi")],
111494
111974
  64 * 1024 * 1024
111495
111975
  );
111496
- import_node_fs142.default.writeFileSync(
111497
- import_node_path145.default.join(generatedDir, viewModels.file),
111976
+ import_node_fs145.default.writeFileSync(
111977
+ import_node_path148.default.join(generatedDir, viewModels.file),
111498
111978
  viewModels.render(viewModelClasses(readAbiClasses(stdout)))
111499
111979
  );
111500
111980
  }
111501
- await compileKlib(import_node_path145.default.join(work, "klib"));
111981
+ await compileKlib(import_node_path148.default.join(work, "klib"));
111502
111982
  await run15(
111503
111983
  kotlinc,
111504
111984
  [
111505
- ...common2,
111985
+ ...common2(),
111506
111986
  "-nowarn",
111507
111987
  "-Xpartial-linkage-loglevel=error",
111508
- `-Xinclude=${import_node_path145.default.join(work, "klib")}`,
111988
+ `-Xinclude=${import_node_path148.default.join(work, "klib")}`,
111509
111989
  "-Xir-produce-js",
111510
111990
  "-Xir-dce",
111511
111991
  "-ir-output-dir",
111512
- import_node_path145.default.join(work, "js"),
111992
+ import_node_path148.default.join(work, "js"),
111513
111993
  "-ir-output-name",
111514
111994
  "app"
111515
111995
  ],
111516
111996
  { maxBuffer: 16 * 1024 * 1024 }
111517
111997
  );
111518
111998
  if (compose) {
111519
- import_node_fs142.default.writeFileSync(
111520
- import_node_path145.default.join(work, "js", "skiko.mjs"),
111521
- kotlinSkikoSource(import_node_fs142.default.readFileSync(compose.loader))
111999
+ import_node_fs145.default.writeFileSync(
112000
+ import_node_path148.default.join(work, "js", "skiko.mjs"),
112001
+ kotlinSkikoSource(import_node_fs145.default.readFileSync(compose.loader))
111522
112002
  );
111523
112003
  }
111524
112004
  if (usesCompose) {
111525
112005
  for (const library of toolchain.composeJsLibraries) {
111526
112006
  let imported = false;
111527
- for (const file of import_node_fs142.default.readdirSync(import_node_path145.default.join(work, "js"))) {
112007
+ for (const file of import_node_fs145.default.readdirSync(import_node_path148.default.join(work, "js"))) {
111528
112008
  if (!file.endsWith(".mjs")) continue;
111529
- const target = import_node_path145.default.join(work, "js", file);
111530
- const source = import_node_fs142.default.readFileSync(target, "utf8");
112009
+ const target = import_node_path148.default.join(work, "js", file);
112010
+ const source = import_node_fs145.default.readFileSync(target, "utf8");
111531
112011
  let next = source;
111532
112012
  for (const quote3 of ["'", '"'])
111533
112013
  next = next.replaceAll(
@@ -111535,11 +112015,11 @@ async function compileKotlin(input, origin) {
111535
112015
  `from ${quote3}./${library.file}${quote3}`
111536
112016
  );
111537
112017
  if (next === source) continue;
111538
- import_node_fs142.default.writeFileSync(target, next);
112018
+ import_node_fs145.default.writeFileSync(target, next);
111539
112019
  imported = true;
111540
112020
  }
111541
112021
  if (!imported) continue;
111542
- const archive = import_node_path145.default.join(
112022
+ const archive = import_node_path148.default.join(
111543
112023
  kotlinHome(),
111544
112024
  toolchain.compiler.version,
111545
112025
  library.name
@@ -111548,24 +112028,24 @@ async function compileKotlin(input, origin) {
111548
112028
  const { stdout } = await run15("tar", ["-xOf", archive, library.archiveEntry], {
111549
112029
  maxBuffer: 16 * 1024 * 1024
111550
112030
  });
111551
- import_node_fs142.default.writeFileSync(import_node_path145.default.join(work, "js", library.file), stdout);
112031
+ import_node_fs145.default.writeFileSync(import_node_path148.default.join(work, "js", library.file), stdout);
111552
112032
  }
111553
112033
  }
111554
112034
  } catch (error) {
111555
- import_node_fs142.default.rmSync(work, { recursive: true, force: true });
112035
+ import_node_fs145.default.rmSync(work, { recursive: true, force: true });
111556
112036
  let output = isRecord(error) ? `${String(error.stderr ?? "")}${String(error.stdout ?? "")}` : "";
111557
112037
  for (const [name3, source] of Object.entries(origins))
111558
- output = output.replaceAll(import_node_path145.default.join(generatedDir, name3), source);
112038
+ output = output.replaceAll(import_node_path148.default.join(generatedDir, name3), source);
111559
112039
  for (const [index, spec] of applicationJava.entries())
111560
112040
  output = output.replaceAll(
111561
- import_node_path145.default.join(generatedDir, `JavaApplication${index}.kt`),
112041
+ import_node_path148.default.join(generatedDir, `JavaApplication${index}.kt`),
111562
112042
  spec.file
111563
112043
  );
111564
112044
  for (const { file, target } of compiledSources)
111565
- output = output.replaceAll(target, file).replaceAll(import_node_path145.default.relative(process.cwd(), target), file);
112045
+ output = output.replaceAll(target, file).replaceAll(import_node_path148.default.relative(process.cwd(), target), file);
111566
112046
  for (const [index, spec] of (java?.specs ?? []).entries())
111567
112047
  output = output.replaceAll(
111568
- import_node_path145.default.join(work, "java-abi", `Spec${index}.kt`),
112048
+ import_node_path148.default.join(work, "java-abi", `Spec${index}.kt`),
111569
112049
  spec.file
111570
112050
  );
111571
112051
  output = output.replace(
@@ -111578,20 +112058,20 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
111578
112058
  );
111579
112059
  }
111580
112060
  const seams = [kotlinNodeDetection];
111581
- const js = import_node_fs142.default.readdirSync(import_node_path145.default.join(work, "js")).filter((file) => file.endsWith(".mjs"));
112061
+ const js = import_node_fs145.default.readdirSync(import_node_path148.default.join(work, "js")).filter((file) => file.endsWith(".mjs"));
111582
112062
  if (js.some(
111583
- (file) => import_node_fs142.default.readFileSync(import_node_path145.default.join(work, "js", file), "utf8").includes("'kotlinx.coroutines.")
112063
+ (file) => import_node_fs145.default.readFileSync(import_node_path148.default.join(work, "js", file), "utf8").includes("'kotlinx.coroutines.")
111584
112064
  ))
111585
112065
  seams.push(kotlinCoroutineDispatcher);
111586
112066
  for (const [from, to] of seams) {
111587
112067
  let patched = 0;
111588
112068
  for (const file of js) {
111589
- const target = import_node_path145.default.join(work, "js", file);
111590
- const text7 = import_node_fs142.default.readFileSync(target, "utf8");
112069
+ const target = import_node_path148.default.join(work, "js", file);
112070
+ const text7 = import_node_fs145.default.readFileSync(target, "utf8");
111591
112071
  const next = text7.replaceAll(from, to);
111592
112072
  if (next !== text7) {
111593
112073
  patched++;
111594
- import_node_fs142.default.writeFileSync(target, next);
112074
+ import_node_fs145.default.writeFileSync(target, next);
111595
112075
  }
111596
112076
  }
111597
112077
  if (patched === 0)
@@ -111599,11 +112079,11 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
111599
112079
  `kotlin output no longer contains ${from}; recheck how it detects its host in Peach`
111600
112080
  );
111601
112081
  }
111602
- const entry = import_node_path145.default.join(work, "js/app.mjs");
111603
- const entrySource2 = import_node_fs142.default.readFileSync(entry, "utf8");
111604
- const importsPath = import_node_path145.default.join(work, "js/app.import-object.mjs");
112082
+ const entry = import_node_path148.default.join(work, "js/app.mjs");
112083
+ const entrySource2 = import_node_fs145.default.readFileSync(entry, "utf8");
112084
+ const importsPath = import_node_path148.default.join(work, "js/app.import-object.mjs");
111605
112085
  const importsFactory = kotlinInstanceSource(
111606
- import_node_fs142.default.readFileSync(importsPath, "utf8"),
112086
+ import_node_fs145.default.readFileSync(importsPath, "utf8"),
111607
112087
  "createKotlinImportObject"
111608
112088
  );
111609
112089
  const runtimeFactory = kotlinInstanceSource(
@@ -111611,9 +112091,9 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
111611
112091
  "createKotlinInstance",
111612
112092
  /* @__PURE__ */ new Map([["./app.import-object.mjs", "createKotlinImportObject"]])
111613
112093
  );
111614
- import_node_fs142.default.writeFileSync(importsPath, importsFactory.source);
111615
- import_node_fs142.default.writeFileSync(import_node_path145.default.join(work, "js/app-runtime.mjs"), runtimeFactory.source);
111616
- import_node_fs142.default.writeFileSync(
112094
+ import_node_fs145.default.writeFileSync(importsPath, importsFactory.source);
112095
+ import_node_fs145.default.writeFileSync(import_node_path148.default.join(work, "js/app-runtime.mjs"), runtimeFactory.source);
112096
+ import_node_fs145.default.writeFileSync(
111617
112097
  entry,
111618
112098
  [
111619
112099
  "import { createKotlinInstance } from './app-runtime.mjs';",
@@ -111626,10 +112106,10 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
111626
112106
  ].join("\n")
111627
112107
  );
111628
112108
  try {
111629
- import_node_fs142.default.renameSync(work, out);
112109
+ import_node_fs145.default.renameSync(work, out);
111630
112110
  } catch (error) {
111631
- if (!import_node_fs142.default.existsSync(import_node_path145.default.join(out, "js", "app.wasm"))) throw error;
111632
- import_node_fs142.default.rmSync(work, { recursive: true, force: true });
112111
+ if (!import_node_fs145.default.existsSync(import_node_path148.default.join(out, "js", "app.wasm"))) throw error;
112112
+ import_node_fs145.default.rmSync(work, { recursive: true, force: true });
111633
112113
  }
111634
112114
  return artifact;
111635
112115
  })().finally(() => builds.delete(hash));
@@ -111637,24 +112117,24 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
111637
112117
  return build2;
111638
112118
  }
111639
112119
  function kotlinArtifactFiles(hash) {
111640
- const dir = import_node_path145.default.join(buildsDir(), hash, "js");
111641
- return import_node_fs142.default.readdirSync(dir).sort().map((name3) => {
111642
- const contentType = CONTENT_TYPES[import_node_path145.default.extname(name3)];
112120
+ const dir = import_node_path148.default.join(buildsDir(), hash, "js");
112121
+ return import_node_fs145.default.readdirSync(dir).sort().map((name3) => {
112122
+ const contentType = CONTENT_TYPES[import_node_path148.default.extname(name3)];
111643
112123
  if (!contentType) throw new Error(`unexpected kotlin artifact file ${name3}`);
111644
- return { name: name3, bytes: import_node_fs142.default.readFileSync(import_node_path145.default.join(dir, name3)), contentType };
112124
+ return { name: name3, bytes: import_node_fs145.default.readFileSync(import_node_path148.default.join(dir, name3)), contentType };
111645
112125
  });
111646
112126
  }
111647
112127
  function serveKotlinArtifact(pathname, res) {
111648
112128
  if (!pathname.startsWith(KOTLIN_ARTIFACT_PREFIX)) return false;
111649
112129
  const [hash, file, ...rest] = pathname.slice(KOTLIN_ARTIFACT_PREFIX.length).split("/");
111650
- const type = file ? CONTENT_TYPES[import_node_path145.default.extname(file)] : void 0;
112130
+ const type = file ? CONTENT_TYPES[import_node_path148.default.extname(file)] : void 0;
111651
112131
  if (!hash || !/^[0-9a-f]+$/.test(hash) || !file || rest.length > 0 || !type || file.includes("..")) {
111652
112132
  res.statusCode = 404;
111653
112133
  res.end("not a kotlin artifact");
111654
112134
  return true;
111655
112135
  }
111656
- const target = import_node_path145.default.join(buildsDir(), hash, "js", file);
111657
- if (!import_node_fs142.default.existsSync(target)) {
112136
+ const target = import_node_path148.default.join(buildsDir(), hash, "js", file);
112137
+ if (!import_node_fs145.default.existsSync(target)) {
111658
112138
  res.statusCode = 404;
111659
112139
  res.end(`kotlin artifact ${hash}/${file} was not built`);
111660
112140
  return true;
@@ -111662,7 +112142,7 @@ function serveKotlinArtifact(pathname, res) {
111662
112142
  res.setHeader("access-control-allow-origin", "*");
111663
112143
  res.setHeader("content-type", type);
111664
112144
  res.setHeader("cache-control", "public, max-age=31536000, immutable");
111665
- res.end(import_node_fs142.default.readFileSync(target));
112145
+ res.end(import_node_fs145.default.readFileSync(target));
111666
112146
  return true;
111667
112147
  }
111668
112148
  async function serveKotlinRequest(pathname, res, app) {
@@ -111679,15 +112159,15 @@ async function serveKotlinRequest(pathname, res, app) {
111679
112159
  }
111680
112160
  return true;
111681
112161
  }
111682
- var import_node_child_process69, import_node_crypto87, import_node_fs142, import_node_module23, import_node_path145, import_node_util22, run15, KOTLIN_ARTIFACT_PREFIX, SKIP_DIRS, configureDeviceSource, BUILD_FORMAT, builds, toolScans, BRIDGE_PARAMETERS, BRIDGE_CASTS, BRIDGE_RETURNS, bridgeType, JAVA_CLASSES, argb, escapes2, literal2, CONTENT_TYPES;
112162
+ var import_node_child_process70, import_node_crypto89, import_node_fs145, import_node_module23, import_node_path148, import_node_util22, run15, KOTLIN_ARTIFACT_PREFIX, SKIP_DIRS, configureDeviceSource, BUILD_FORMAT, builds, toolScans, BRIDGE_PARAMETERS, BRIDGE_CASTS, BRIDGE_RETURNS, bridgeType, JAVA_CLASSES, argb, escapes2, literal2, CONTENT_TYPES;
111683
112163
  var init_kotlin_host = __esm({
111684
112164
  "src/kotlin-host.ts"() {
111685
112165
  "use strict";
111686
- import_node_child_process69 = require("node:child_process");
111687
- import_node_crypto87 = require("node:crypto");
111688
- import_node_fs142 = __toESM(require("node:fs"), 1);
112166
+ import_node_child_process70 = require("node:child_process");
112167
+ import_node_crypto89 = require("node:crypto");
112168
+ import_node_fs145 = __toESM(require("node:fs"), 1);
111689
112169
  import_node_module23 = require("node:module");
111690
- import_node_path145 = __toESM(require("node:path"), 1);
112170
+ import_node_path148 = __toESM(require("node:path"), 1);
111691
112171
  import_node_util22 = require("node:util");
111692
112172
  init_kotlinDiscoveryContract();
111693
112173
  init_android_bridge_packages();
@@ -111695,13 +112175,14 @@ var init_kotlin_host = __esm({
111695
112175
  init_is_record();
111696
112176
  init_java_module_abi();
111697
112177
  init_kotlin_browser_seams();
112178
+ init_kotlin_gradle_library_plan();
111698
112179
  init_kotlin_instance_source();
111699
112180
  init_kotlin_sdk();
111700
112181
  init_kotlin_skiko_source();
111701
112182
  init_kotlin_toolchain();
111702
112183
  init_kotlin_view_models();
111703
112184
  init_kotlin_module();
111704
- run15 = (0, import_node_util22.promisify)(import_node_child_process69.execFile);
112185
+ run15 = (0, import_node_util22.promisify)(import_node_child_process70.execFile);
111705
112186
  KOTLIN_ARTIFACT_PREFIX = "/__peach/kotlin-artifact/";
111706
112187
  SKIP_DIRS = /* @__PURE__ */ new Set([
111707
112188
  "node_modules",
@@ -111805,8 +112286,8 @@ async function collectExpoKotlinModules(appRoot) {
111805
112286
  for (const project2 of entry.projects) {
111806
112287
  if (!isRecord(project2) || typeof project2.sourceDir !== "string" || !Array.isArray(project2.modules))
111807
112288
  throw new Error("invalid Expo Android project");
111808
- const sourceDir = import_node_fs143.default.realpathSync(project2.sourceDir);
111809
- const installed = sourceDir.split(import_node_path146.default.sep).includes("node_modules");
112289
+ const sourceDir = import_node_fs146.default.realpathSync(project2.sourceDir);
112290
+ const installed = sourceDir.split(import_node_path149.default.sep).includes("node_modules");
111810
112291
  if (installed) {
111811
112292
  if (typeof entry.packageName !== "string") continue;
111812
112293
  if (peachAnsweredNativePackages().has(entry.packageName)) {
@@ -111834,9 +112315,9 @@ async function collectExpoKotlinModules(appRoot) {
111834
112315
  group.unsupported ??= reason;
111835
112316
  };
111836
112317
  const walk4 = (dir) => {
111837
- if (!import_node_fs143.default.existsSync(dir)) return;
111838
- for (const child of import_node_fs143.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
111839
- const file = import_node_path146.default.join(dir, child.name);
112318
+ if (!import_node_fs146.default.existsSync(dir)) return;
112319
+ for (const child of import_node_fs146.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
112320
+ const file = import_node_path149.default.join(dir, child.name);
111840
112321
  if (child.isSymbolicLink()) reject(`Expo Kotlin source is a symlink: ${file}`);
111841
112322
  else if (child.isDirectory()) walk4(file);
111842
112323
  else if (child.name.endsWith(".java"))
@@ -111844,8 +112325,8 @@ async function collectExpoKotlinModules(appRoot) {
111844
112325
  else if (child.name.endsWith(".kt")) group.sources.push(file);
111845
112326
  }
111846
112327
  };
111847
- walk4(import_node_path146.default.join(sourceDir, "src", "main", "java"));
111848
- walk4(import_node_path146.default.join(sourceDir, "src", "main", "kotlin"));
112328
+ walk4(import_node_path149.default.join(sourceDir, "src", "main", "java"));
112329
+ walk4(import_node_path149.default.join(sourceDir, "src", "main", "kotlin"));
111849
112330
  result.push(group);
111850
112331
  }
111851
112332
  }
@@ -111858,7 +112339,7 @@ async function collectBridgePackages(appRoot) {
111858
112339
  );
111859
112340
  const app = androidAppSources(appRoot);
111860
112341
  if (!app || !app.kotlin.some(
111861
- (file) => /\b(?:Base|Turbo)?ReactPackage\b/.test(import_node_fs143.default.readFileSync(file, "utf8"))
112342
+ (file) => /\b(?:Base|Turbo)?ReactPackage\b/.test(import_node_fs146.default.readFileSync(file, "utf8"))
111862
112343
  ))
111863
112344
  return dependencies;
111864
112345
  const { scanBridgeFiles: scanBridgeFiles2 } = await Promise.resolve().then(() => (init_kotlin_host(), kotlin_host_exports));
@@ -111949,12 +112430,12 @@ async function compileExpoKotlinModules(root, origin) {
111949
112430
  }
111950
112431
  }
111951
112432
  }
111952
- var import_node_fs143, import_node_path146;
112433
+ var import_node_fs146, import_node_path149;
111953
112434
  var init_expo_kotlin_host = __esm({
111954
112435
  "src/expo-kotlin-host.ts"() {
111955
112436
  "use strict";
111956
- import_node_fs143 = __toESM(require("node:fs"), 1);
111957
- import_node_path146 = __toESM(require("node:path"), 1);
112437
+ import_node_fs146 = __toESM(require("node:fs"), 1);
112438
+ import_node_path149 = __toESM(require("node:path"), 1);
111958
112439
  init_android_autolinking();
111959
112440
  init_android_bridge_dependencies();
111960
112441
  init_android_bridge_packages();
@@ -112376,16 +112857,16 @@ var init_replacementModule = __esm({
112376
112857
 
112377
112858
  // src/host/replacement-module-handler.ts
112378
112859
  function resolveReplacementModuleFile(fromFile, specifier) {
112379
- const base2 = import_node_path151.default.resolve(import_node_path151.default.dirname(fromFile), specifier);
112860
+ const base2 = import_node_path154.default.resolve(import_node_path154.default.dirname(fromFile), specifier);
112380
112861
  const candidates = [
112381
112862
  ...REPLACEMENT_MODULE_EXTENSIONS.some(
112382
- (ext) => ext === import_node_path151.default.extname(base2).toLowerCase()
112863
+ (ext) => ext === import_node_path154.default.extname(base2).toLowerCase()
112383
112864
  ) ? [base2] : [],
112384
112865
  ...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => base2 + ext),
112385
- ...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => import_node_path151.default.join(base2, `index${ext}`))
112866
+ ...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => import_node_path154.default.join(base2, `index${ext}`))
112386
112867
  ];
112387
112868
  const found = candidates.find(
112388
- (candidate) => (0, import_node_fs147.statSync)(candidate, { throwIfNoEntry: false })?.isFile()
112869
+ (candidate) => (0, import_node_fs150.statSync)(candidate, { throwIfNoEntry: false })?.isFile()
112389
112870
  );
112390
112871
  if (!found) {
112391
112872
  throw new Error(
@@ -112394,13 +112875,13 @@ function resolveReplacementModuleFile(fromFile, specifier) {
112394
112875
  }
112395
112876
  return found;
112396
112877
  }
112397
- var import_node_fs147, import_promises12, import_node_path151;
112878
+ var import_node_fs150, import_promises12, import_node_path154;
112398
112879
  var init_replacement_module_handler = __esm({
112399
112880
  "src/host/replacement-module-handler.ts"() {
112400
112881
  "use strict";
112401
- import_node_fs147 = require("node:fs");
112882
+ import_node_fs150 = require("node:fs");
112402
112883
  import_promises12 = __toESM(require("node:fs/promises"), 1);
112403
- import_node_path151 = __toESM(require("node:path"), 1);
112884
+ import_node_path154 = __toESM(require("node:path"), 1);
112404
112885
  init_replacementModule();
112405
112886
  init_backend_origin();
112406
112887
  }
@@ -112430,14 +112911,14 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
112430
112911
  const neededPackages = /* @__PURE__ */ new Set();
112431
112912
  const factories = [];
112432
112913
  const visit3 = (filePath) => {
112433
- const real = import_node_fs148.default.realpathSync(filePath);
112914
+ const real = import_node_fs151.default.realpathSync(filePath);
112434
112915
  const previous = files2.get(real);
112435
112916
  if (previous !== void 0) return previous;
112436
112917
  const id = "peach-config-file:" + files2.size;
112437
112918
  files2.set(real, id);
112438
112919
  const compiled = compileReplacementModule({
112439
112920
  filePath: real,
112440
- source: import_node_fs148.default.readFileSync(real, "utf8"),
112921
+ source: import_node_fs151.default.readFileSync(real, "utf8"),
112441
112922
  runtimePackages,
112442
112923
  localModuleUrl: (specifier) => visit3(resolveReplacementModuleFile(real, specifier))
112443
112924
  });
@@ -112461,7 +112942,7 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
112461
112942
  if (!entries2 || typeof entries2 !== "object") continue;
112462
112943
  for (const resolution2 of Object.values(entries2)) {
112463
112944
  if (resolution2 && typeof resolution2 === "object" && "file" in resolution2 && typeof resolution2.file === "string") {
112464
- resolution2.file = visit3(import_node_path152.default.resolve(resolution2.file));
112945
+ resolution2.file = visit3(import_node_path155.default.resolve(resolution2.file));
112465
112946
  }
112466
112947
  }
112467
112948
  }
@@ -112485,12 +112966,12 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
112485
112966
  const identityStart = findBundleFooter(source, "globalThis.__sootsimModulePaths=");
112486
112967
  return prefix + (identityStart < 0 ? source + footer : source.slice(0, identityStart) + footer + source.slice(identityStart));
112487
112968
  }
112488
- var import_node_fs148, import_node_path152, import_sucrase5, import_terser, PREFIX_START, PREFIX_END;
112969
+ var import_node_fs151, import_node_path155, import_sucrase5, import_terser, PREFIX_START, PREFIX_END;
112489
112970
  var init_configured_bundle_producer = __esm({
112490
112971
  "src/configured-bundle-producer.ts"() {
112491
112972
  "use strict";
112492
- import_node_fs148 = __toESM(require("node:fs"), 1);
112493
- import_node_path152 = __toESM(require("node:path"), 1);
112973
+ import_node_fs151 = __toESM(require("node:fs"), 1);
112974
+ import_node_path155 = __toESM(require("node:path"), 1);
112494
112975
  init_bundle_global_footer();
112495
112976
  import_sucrase5 = require("peachsim/vendor/sucrase");
112496
112977
  import_terser = require("peachsim/vendor/terser");
@@ -112513,11 +112994,11 @@ __export(bundle_channel_exports, {
112513
112994
  snapshotOneProductionBundle: () => snapshotOneProductionBundle
112514
112995
  });
112515
112996
  module.exports = __toCommonJS(bundle_channel_exports);
112516
- var import_node_crypto89 = require("node:crypto");
112517
- var import_node_fs149 = require("node:fs");
112518
- var import_node_path153 = require("node:path");
112997
+ var import_node_crypto91 = require("node:crypto");
112998
+ var import_node_fs152 = require("node:fs");
112999
+ var import_node_path156 = require("node:path");
112519
113000
  var import_node_vm = require("node:vm");
112520
- var import_node_zlib10 = require("node:zlib");
113001
+ var import_node_zlib11 = require("node:zlib");
112521
113002
  init_backend_origin();
112522
113003
  init_dev_bundle_resolution();
112523
113004
  init_home_paths();
@@ -112682,16 +113163,16 @@ init_package_versions();
112682
113163
  init_process_group();
112683
113164
 
112684
113165
  // cli/app-catalog.ts
112685
- var import_node_fs146 = __toESM(require("node:fs"), 1);
112686
- var import_node_path150 = __toESM(require("node:path"), 1);
113166
+ var import_node_fs149 = __toESM(require("node:fs"), 1);
113167
+ var import_node_path153 = __toESM(require("node:path"), 1);
112687
113168
  init_bundleAssets();
112688
113169
  init_expo_native_workspace();
112689
113170
 
112690
113171
  // src/host/staged-host-files.ts
112691
113172
  var import_node_async_hooks4 = require("node:async_hooks");
112692
- var import_node_crypto88 = require("node:crypto");
112693
- var import_node_fs144 = __toESM(require("node:fs"), 1);
112694
- var import_node_path147 = __toESM(require("node:path"), 1);
113173
+ var import_node_crypto90 = require("node:crypto");
113174
+ var import_node_fs147 = __toESM(require("node:fs"), 1);
113175
+ var import_node_path150 = __toESM(require("node:path"), 1);
112695
113176
 
112696
113177
  // ../peach-kit/src/uttype-mime.ts
112697
113178
  var MIME_BY_EXTENSION = {
@@ -112766,17 +113247,17 @@ async function captureStagedHostFiles(prepare3) {
112766
113247
  const value = await stagedCapture.run(names, prepare3);
112767
113248
  return {
112768
113249
  value,
112769
- files: new Map([...names].map((name3) => [name3, import_node_path147.default.join(stagedDir(), name3)]))
113250
+ files: new Map([...names].map((name3) => [name3, import_node_path150.default.join(stagedDir(), name3)]))
112770
113251
  };
112771
113252
  }
112772
113253
  var STAGED_PREFIX = "/__peach/staged/";
112773
113254
  var STAGED_NAME = /^([a-f0-9]{64})(\.[a-z0-9]{1,10})?$/;
112774
113255
  var STAGED_RETENTION_MS = 30 * 24 * 60 * 60 * 1e3;
112775
113256
  function stagedDir() {
112776
- return import_node_path147.default.join(cacheDir(), "staged");
113257
+ return import_node_path150.default.join(cacheDir(), "staged");
112777
113258
  }
112778
113259
  function stageHostFile(filePath, origin) {
112779
- return stageHostBytes(import_node_fs144.default.readFileSync(filePath), origin, import_node_path147.default.extname(filePath));
113260
+ return stageHostBytes(import_node_fs147.default.readFileSync(filePath), origin, import_node_path150.default.extname(filePath));
112780
113261
  }
112781
113262
  function stageHostBytes(bytes, origin, extension = "") {
112782
113263
  const directory2 = prepareStagedDirectory();
@@ -112784,72 +113265,72 @@ function stageHostBytes(bytes, origin, extension = "") {
112784
113265
  }
112785
113266
  async function stageHostDerivedBytes(input, producer, origin, extension, derive) {
112786
113267
  const directory2 = prepareStagedDirectory();
112787
- const inputDigest = (0, import_node_crypto88.createHash)("sha256").update(input).digest("hex");
112788
- const index = import_node_path147.default.join(
113268
+ const inputDigest = (0, import_node_crypto90.createHash)("sha256").update(input).digest("hex");
113269
+ const index = import_node_path150.default.join(
112789
113270
  directory2,
112790
- `derived-${(0, import_node_crypto88.createHash)("sha256").update(`${producer}\0${inputDigest}`).digest("hex")}`
113271
+ `derived-${(0, import_node_crypto90.createHash)("sha256").update(`${producer}\0${inputDigest}`).digest("hex")}`
112791
113272
  );
112792
- const recorded = import_node_fs144.default.existsSync(index) ? import_node_fs144.default.readFileSync(index, "utf8") : "";
112793
- if (STAGED_NAME.test(recorded) && import_node_fs144.default.existsSync(import_node_path147.default.join(directory2, recorded))) {
113273
+ const recorded = import_node_fs147.default.existsSync(index) ? import_node_fs147.default.readFileSync(index, "utf8") : "";
113274
+ if (STAGED_NAME.test(recorded) && import_node_fs147.default.existsSync(import_node_path150.default.join(directory2, recorded))) {
112794
113275
  const now = /* @__PURE__ */ new Date();
112795
- import_node_fs144.default.utimesSync(index, now, now);
112796
- import_node_fs144.default.utimesSync(import_node_path147.default.join(directory2, recorded), now, now);
113276
+ import_node_fs147.default.utimesSync(index, now, now);
113277
+ import_node_fs147.default.utimesSync(import_node_path150.default.join(directory2, recorded), now, now);
112797
113278
  stagedCapture.getStore()?.add(recorded);
112798
113279
  return new URL(STAGED_PREFIX + recorded, origin).toString();
112799
113280
  }
112800
113281
  const staged = writeStagedBytes(await derive(), origin, extension, directory2);
112801
- const temporary = import_node_path147.default.join(directory2, (0, import_node_crypto88.randomUUID)());
113282
+ const temporary = import_node_path150.default.join(directory2, (0, import_node_crypto90.randomUUID)());
112802
113283
  try {
112803
- import_node_fs144.default.writeFileSync(temporary, new URL(staged).pathname.slice(STAGED_PREFIX.length), {
113284
+ import_node_fs147.default.writeFileSync(temporary, new URL(staged).pathname.slice(STAGED_PREFIX.length), {
112804
113285
  flag: "wx"
112805
113286
  });
112806
- import_node_fs144.default.renameSync(temporary, index);
113287
+ import_node_fs147.default.renameSync(temporary, index);
112807
113288
  } finally {
112808
- import_node_fs144.default.rmSync(temporary, { force: true });
113289
+ import_node_fs147.default.rmSync(temporary, { force: true });
112809
113290
  }
112810
113291
  return staged;
112811
113292
  }
112812
113293
  function prepareStagedDirectory() {
112813
113294
  const directory2 = stagedDir();
112814
- import_node_fs144.default.mkdirSync(directory2, { recursive: true });
113295
+ import_node_fs147.default.mkdirSync(directory2, { recursive: true });
112815
113296
  const now = Date.now();
112816
- for (const entry of import_node_fs144.default.readdirSync(directory2, { withFileTypes: true })) {
113297
+ for (const entry of import_node_fs147.default.readdirSync(directory2, { withFileTypes: true })) {
112817
113298
  if (!entry.isFile()) continue;
112818
- const stale = import_node_path147.default.join(directory2, entry.name);
112819
- const stat = import_node_fs144.default.statSync(stale, { throwIfNoEntry: false });
113299
+ const stale = import_node_path150.default.join(directory2, entry.name);
113300
+ const stat = import_node_fs147.default.statSync(stale, { throwIfNoEntry: false });
112820
113301
  if (stat && now - stat.mtimeMs > STAGED_RETENTION_MS)
112821
- import_node_fs144.default.rmSync(stale, { force: true });
113302
+ import_node_fs147.default.rmSync(stale, { force: true });
112822
113303
  }
112823
113304
  return directory2;
112824
113305
  }
112825
113306
  function writeStagedBytes(bytes, origin, extension, directory2) {
112826
- const digest3 = (0, import_node_crypto88.createHash)("sha256").update(bytes).digest("hex");
113307
+ const digest3 = (0, import_node_crypto90.createHash)("sha256").update(bytes).digest("hex");
112827
113308
  extension = extension.toLowerCase();
112828
113309
  const name3 = STAGED_NAME.test(digest3 + extension) ? digest3 + extension : digest3;
112829
113310
  stagedCapture.getStore()?.add(name3);
112830
- const destination = import_node_path147.default.join(directory2, name3);
113311
+ const destination = import_node_path150.default.join(directory2, name3);
112831
113312
  const now = Date.now();
112832
- if (import_node_fs144.default.existsSync(destination)) {
112833
- import_node_fs144.default.utimesSync(destination, new Date(now), new Date(now));
113313
+ if (import_node_fs147.default.existsSync(destination)) {
113314
+ import_node_fs147.default.utimesSync(destination, new Date(now), new Date(now));
112834
113315
  } else {
112835
- const temporary = import_node_path147.default.join(directory2, (0, import_node_crypto88.randomUUID)());
113316
+ const temporary = import_node_path150.default.join(directory2, (0, import_node_crypto90.randomUUID)());
112836
113317
  try {
112837
- import_node_fs144.default.writeFileSync(temporary, bytes, { flag: "wx" });
112838
- import_node_fs144.default.renameSync(temporary, destination);
113318
+ import_node_fs147.default.writeFileSync(temporary, bytes, { flag: "wx" });
113319
+ import_node_fs147.default.renameSync(temporary, destination);
112839
113320
  } finally {
112840
- import_node_fs144.default.rmSync(temporary, { force: true });
113321
+ import_node_fs147.default.rmSync(temporary, { force: true });
112841
113322
  }
112842
113323
  }
112843
113324
  return new URL(STAGED_PREFIX + name3, origin).toString();
112844
113325
  }
112845
113326
 
112846
113327
  // src/one-native-app-catalog.ts
112847
- var import_node_path149 = __toESM(require("node:path"), 1);
113328
+ var import_node_path152 = __toESM(require("node:path"), 1);
112848
113329
  init_is_record();
112849
113330
 
112850
113331
  // src/one-native-app-config.ts
112851
- var import_node_fs145 = __toESM(require("node:fs"), 1);
112852
- var import_node_path148 = __toESM(require("node:path"), 1);
113332
+ var import_node_fs148 = __toESM(require("node:fs"), 1);
113333
+ var import_node_path151 = __toESM(require("node:path"), 1);
112853
113334
  var import_acorn5 = require("peachsim/vendor/acorn");
112854
113335
  var import_sucrase4 = require("peachsim/vendor/sucrase");
112855
113336
  init_estree_walk();
@@ -112872,13 +113353,13 @@ var MODULE_EXTENSIONS = [
112872
113353
  ];
112873
113354
  function oneConfigPath(root) {
112874
113355
  for (const name3 of CONFIG_FILES) {
112875
- const file = import_node_path148.default.join(root, name3);
112876
- if (import_node_fs145.default.existsSync(file)) return file;
113356
+ const file = import_node_path151.default.join(root, name3);
113357
+ if (import_node_fs148.default.existsSync(file)) return file;
112877
113358
  }
112878
113359
  return null;
112879
113360
  }
112880
113361
  function readModule2(file) {
112881
- const { code } = (0, import_sucrase4.transform)(import_node_fs145.default.readFileSync(file, "utf8"), {
113362
+ const { code } = (0, import_sucrase4.transform)(import_node_fs148.default.readFileSync(file, "utf8"), {
112882
113363
  transforms: /\.[cm]?tsx?$/.test(file) ? ["typescript"] : [],
112883
113364
  disableESTransforms: true
112884
113365
  });
@@ -112902,9 +113383,9 @@ function resolveName(module2, name3, seen) {
112902
113383
  if (!source.startsWith(".")) continue;
112903
113384
  for (const specifier of statement.specifiers) {
112904
113385
  if (specifier.type !== "ImportSpecifier" || specifier.local.name !== name3) continue;
112905
- const base2 = import_node_path148.default.resolve(import_node_path148.default.dirname(module2.file), source);
113386
+ const base2 = import_node_path151.default.resolve(import_node_path151.default.dirname(module2.file), source);
112906
113387
  const target = MODULE_EXTENSIONS.map((ext) => base2 + ext).find(
112907
- (file) => import_node_fs145.default.existsSync(file) && import_node_fs145.default.statSync(file).isFile()
113388
+ (file) => import_node_fs148.default.existsSync(file) && import_node_fs148.default.statSync(file).isFile()
112908
113389
  );
112909
113390
  if (!target) return NOT_STATIC;
112910
113391
  const imported = specifier.imported.type === "Identifier" ? specifier.imported.name : String(specifier.imported.value);
@@ -112988,7 +113469,7 @@ function readOneNativeAppCatalog(root) {
112988
113469
  const ios = readOneNativeApp(root)?.ios;
112989
113470
  if (!isRecord(ios)) return null;
112990
113471
  const accentColor = parseAccent(ios.accentColor);
112991
- const assetCatalog = typeof ios.assetCatalog === "string" ? import_node_path149.default.resolve(root, ios.assetCatalog) : null;
113472
+ const assetCatalog = typeof ios.assetCatalog === "string" ? import_node_path152.default.resolve(root, ios.assetCatalog) : null;
112992
113473
  return accentColor || assetCatalog ? { accentColor, assetCatalog } : null;
112993
113474
  }
112994
113475
 
@@ -112998,21 +113479,21 @@ var ACCENT_BUILD_SETTING = /ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = "?(
112998
113479
  var PLIST_ACCENT = /<key>NSAccentColorName<\/key>\s*<string>([^<]+)<\/string>/;
112999
113480
  function listDir2(dir) {
113000
113481
  try {
113001
- return import_node_fs146.default.readdirSync(dir, { withFileTypes: true });
113482
+ return import_node_fs149.default.readdirSync(dir, { withFileTypes: true });
113002
113483
  } catch {
113003
113484
  return [];
113004
113485
  }
113005
113486
  }
113006
113487
  function readText(file) {
113007
113488
  try {
113008
- return import_node_fs146.default.readFileSync(file, "utf8");
113489
+ return import_node_fs149.default.readFileSync(file, "utf8");
113009
113490
  } catch {
113010
113491
  return null;
113011
113492
  }
113012
113493
  }
113013
113494
  function catalogFiles(dir, found) {
113014
113495
  for (const entry of listDir2(dir)) {
113015
- const full = import_node_path150.default.join(dir, entry.name);
113496
+ const full = import_node_path153.default.join(dir, entry.name);
113016
113497
  if (entry.isDirectory()) catalogFiles(full, found);
113017
113498
  else if (entry.name === "Contents.json") found.push(full);
113018
113499
  }
@@ -113060,38 +113541,38 @@ async function stageCatalogSvg(file, scale, origin, bytes) {
113060
113541
  );
113061
113542
  }
113062
113543
  function stageCatalogImage(file, scale, origin) {
113063
- if (import_node_path150.default.extname(file).toLowerCase() === ".svg")
113064
- return stageCatalogSvg(file, scale, origin, import_node_fs146.default.readFileSync(file));
113544
+ if (import_node_path153.default.extname(file).toLowerCase() === ".svg")
113545
+ return stageCatalogSvg(file, scale, origin, import_node_fs149.default.readFileSync(file));
113065
113546
  return stageHostFile(file, origin);
113066
113547
  }
113067
113548
  async function discoverAppCatalog(appDir, assetOrigin) {
113068
- if (!import_node_fs146.default.existsSync(import_node_path150.default.join(appDir, "ios")) && findExpoAppConfig(appDir)) {
113069
- const packageJson = readText(import_node_path150.default.join(appDir, "package.json"));
113549
+ if (!import_node_fs149.default.existsSync(import_node_path153.default.join(appDir, "ios")) && findExpoAppConfig(appDir)) {
113550
+ const packageJson = readText(import_node_path153.default.join(appDir, "package.json"));
113070
113551
  if (packageJson) {
113071
113552
  const manifest = JSON.parse(packageJson);
113072
113553
  if (declaresNativeDependency(manifest, "expo") || declaresNativeDependency(manifest, "one"))
113073
113554
  appDir = (await prepareExpoNativeProject(appDir)).app;
113074
113555
  }
113075
113556
  }
113076
- const iosDir = import_node_path150.default.join(appDir, "ios");
113557
+ const iosDir = import_node_path153.default.join(appDir, "ios");
113077
113558
  const target = listDir2(iosDir).find(
113078
- (entry) => entry.isDirectory() && entry.name !== "Pods" && listDir2(import_node_path150.default.join(iosDir, entry.name)).some(
113559
+ (entry) => entry.isDirectory() && entry.name !== "Pods" && listDir2(import_node_path153.default.join(iosDir, entry.name)).some(
113079
113560
  (file) => /^AppDelegate\.(swift|mm|m)$/.test(file.name)
113080
113561
  )
113081
113562
  );
113082
113563
  if (!target) return null;
113083
- const targetDir = import_node_path150.default.join(iosDir, target.name);
113564
+ const targetDir = import_node_path153.default.join(iosDir, target.name);
113084
113565
  const files2 = [];
113085
113566
  for (const entry of listDir2(targetDir)) {
113086
113567
  if (entry.isDirectory() && entry.name.endsWith(".xcassets"))
113087
- catalogFiles(import_node_path150.default.join(targetDir, entry.name), files2);
113568
+ catalogFiles(import_node_path153.default.join(targetDir, entry.name), files2);
113088
113569
  }
113089
113570
  const relative4 = files2.map(
113090
- (file) => import_node_path150.default.relative(targetDir, file).split(import_node_path150.default.sep).join(import_node_path150.default.posix.sep)
113571
+ (file) => import_node_path153.default.relative(targetDir, file).split(import_node_path153.default.sep).join(import_node_path153.default.posix.sep)
113091
113572
  );
113092
- const readContents2 = (candidate) => readText(import_node_path150.default.join(targetDir, candidate));
113573
+ const readContents2 = (candidate) => readText(import_node_path153.default.join(targetDir, candidate));
113093
113574
  const pbxproj = listDir2(iosDir).find((entry) => entry.name.endsWith(".xcodeproj"));
113094
- const accentName = readText(import_node_path150.default.join(targetDir, "Info.plist"))?.match(PLIST_ACCENT)?.[1] ?? (pbxproj ? readText(import_node_path150.default.join(iosDir, pbxproj.name, "project.pbxproj"))?.match(
113575
+ const accentName = readText(import_node_path153.default.join(targetDir, "Info.plist"))?.match(PLIST_ACCENT)?.[1] ?? (pbxproj ? readText(import_node_path153.default.join(iosDir, pbxproj.name, "project.pbxproj"))?.match(
113095
113576
  ACCENT_BUILD_SETTING
113096
113577
  )?.[1] : void 0) ?? null;
113097
113578
  return readAssetCatalog(
@@ -113104,7 +113585,7 @@ async function discoverAppCatalog(appDir, assetOrigin) {
113104
113585
  );
113105
113586
  return null;
113106
113587
  }
113107
- return stageCatalogImage(import_node_path150.default.join(targetDir, file), scale, assetOrigin);
113588
+ return stageCatalogImage(import_node_path153.default.join(targetDir, file), scale, assetOrigin);
113108
113589
  },
113109
113590
  accentName
113110
113591
  );
@@ -113129,7 +113610,7 @@ async function discoverProjectOneNativeAppCatalog(projectRoot, assetOrigin) {
113129
113610
  }
113130
113611
 
113131
113612
  // src/bundle-channel.mjs
113132
- var digest2 = (bytes) => (0, import_node_crypto89.createHash)("sha256").update(bytes).digest("hex");
113613
+ var digest2 = (bytes) => (0, import_node_crypto91.createHash)("sha256").update(bytes).digest("hex");
113133
113614
  var segment2 = /^[a-zA-Z0-9._-]+$/;
113134
113615
  function packagedAssetDirectory(location) {
113135
113616
  const parsed2 = new URL(location, "https://packaged.invalid");
@@ -113235,11 +113716,11 @@ async function prepareChannel({
113235
113716
  files2.set(asset.path, asset.bytes);
113236
113717
  }
113237
113718
  }
113238
- const identity2 = (0, import_node_crypto89.createHash)("sha256").update(bundle).update(icon);
113239
- for (const [path140, bytes] of [...files2].sort(
113719
+ const identity2 = (0, import_node_crypto91.createHash)("sha256").update(bundle).update(icon);
113720
+ for (const [path143, bytes] of [...files2].sort(
113240
113721
  ([a], [b]) => a < b ? -1 : a > b ? 1 : 0
113241
113722
  )) {
113242
- identity2.update(JSON.stringify([path140, digest2(bytes)]));
113723
+ identity2.update(JSON.stringify([path143, digest2(bytes)]));
113243
113724
  }
113244
113725
  if (native) identity2.update(JSON.stringify(native.metadata));
113245
113726
  if (oneSDK) identity2.update(JSON.stringify(oneSDK.metadata));
@@ -113249,7 +113730,7 @@ async function prepareChannel({
113249
113730
  const releaseKey = `${prefix}/peach/releases/${identity2.digest("hex")}`;
113250
113731
  const assetBaseUrl = `${origin.origin}/${releaseKey}/`;
113251
113732
  const directories = new Set(
113252
- [...files2.keys()].map((path140) => path140.slice(0, path140.lastIndexOf("/")))
113733
+ [...files2.keys()].map((path143) => path143.slice(0, path143.lastIndexOf("/")))
113253
113734
  );
113254
113735
  let locations = 0;
113255
113736
  const { stripRolldownBundleInventoryFooter, attachRolldownBundleInventory } = (await loadCliRuntime()).rolldown_bundle_inventory;
@@ -113263,12 +113744,12 @@ async function prepareChannel({
113263
113744
  /("?httpServerLocation"?\s*:\s*)(?:"((?:[^"\\]|\\.)*)"|`([^`\\$]*)`)/g,
113264
113745
  (match, property, quoted2, template) => {
113265
113746
  const location = quoted2 === void 0 ? template : JSON.parse(`"${quoted2}"`);
113266
- const path140 = packagedAssetDirectory(location);
113267
- if (!directories.has(path140)) {
113747
+ const path143 = packagedAssetDirectory(location);
113748
+ if (!directories.has(path143)) {
113268
113749
  throw new Error(`bundle asset location has no packaged files: ${location}`);
113269
113750
  }
113270
113751
  locations++;
113271
- return `${property}${JSON.stringify(new URL(path140, assetBaseUrl).href)}`;
113752
+ return `${property}${JSON.stringify(new URL(path143, assetBaseUrl).href)}`;
113272
113753
  }
113273
113754
  );
113274
113755
  if (assets2.some((asset) => !asset.path.startsWith("assets/native-catalog/")) && !locations)
@@ -113276,7 +113757,7 @@ async function prepareChannel({
113276
113757
  const attached = insertNativeBundleFooters(
113277
113758
  source,
113278
113759
  { oneSDK, expoSwift, expoKotlin, nitro, turbo },
113279
- (path140) => new URL(path140, assetBaseUrl).href
113760
+ (path143) => new URL(path143, assetBaseUrl).href
113280
113761
  );
113281
113762
  source = attached.source;
113282
113763
  if (appCatalog) {
@@ -113314,10 +113795,10 @@ async function prepareChannel({
113314
113795
  contentType: "application/javascript"
113315
113796
  },
113316
113797
  { key: `${releaseKey}/icon.png`, bytes: icon, contentType: "image/png" },
113317
- ...[...files2].map(([path140, bytes]) => ({
113318
- key: `${releaseKey}/${path140}`,
113798
+ ...[...files2].map(([path143, bytes]) => ({
113799
+ key: `${releaseKey}/${path143}`,
113319
113800
  bytes,
113320
- contentType: nativeAssets.get(path140)?.contentType ?? {
113801
+ contentType: nativeAssets.get(path143)?.contentType ?? {
113321
113802
  png: "image/png",
113322
113803
  jpg: "image/jpeg",
113323
113804
  jpeg: "image/jpeg",
@@ -113326,23 +113807,23 @@ async function prepareChannel({
113326
113807
  ttf: "font/ttf",
113327
113808
  otf: "font/otf",
113328
113809
  wav: "audio/wav"
113329
- }[path140.split(".").pop()] ?? "application/octet-stream"
113810
+ }[path143.split(".").pop()] ?? "application/octet-stream"
113330
113811
  }))
113331
113812
  ];
113332
113813
  return { platform: platform2, key: `${prefix}/${channelKey(platform2)}`, metadata, objects };
113333
113814
  }
113334
113815
  function brotliCompressCached(bytes) {
113335
- const file = (0, import_node_path153.join)(cacheDir(), "bundle-channel-brotli", `${digest2(bytes)}-q11-w24.br`);
113336
- if ((0, import_node_fs149.existsSync)(file)) return (0, import_node_fs149.readFileSync)(file);
113337
- const compressed = (0, import_node_zlib10.brotliCompressSync)(bytes, {
113816
+ const file = (0, import_node_path156.join)(cacheDir(), "bundle-channel-brotli", `${digest2(bytes)}-q11-w24.br`);
113817
+ if ((0, import_node_fs152.existsSync)(file)) return (0, import_node_fs152.readFileSync)(file);
113818
+ const compressed = (0, import_node_zlib11.brotliCompressSync)(bytes, {
113338
113819
  params: {
113339
- [import_node_zlib10.constants.BROTLI_PARAM_QUALITY]: 11,
113340
- [import_node_zlib10.constants.BROTLI_PARAM_LGWIN]: 24
113820
+ [import_node_zlib11.constants.BROTLI_PARAM_QUALITY]: 11,
113821
+ [import_node_zlib11.constants.BROTLI_PARAM_LGWIN]: 24
113341
113822
  }
113342
113823
  });
113343
- (0, import_node_fs149.mkdirSync)((0, import_node_path153.dirname)(file), { recursive: true });
113344
- (0, import_node_fs149.writeFileSync)(`${file}.${process.pid}`, compressed);
113345
- (0, import_node_fs149.renameSync)(`${file}.${process.pid}`, file);
113824
+ (0, import_node_fs152.mkdirSync)((0, import_node_path156.dirname)(file), { recursive: true });
113825
+ (0, import_node_fs152.writeFileSync)(`${file}.${process.pid}`, compressed);
113826
+ (0, import_node_fs152.renameSync)(`${file}.${process.pid}`, file);
113346
113827
  return compressed;
113347
113828
  }
113348
113829
  async function publishBundleChannel(release, { put, fetchObject = fetch }) {
@@ -113393,15 +113874,15 @@ async function packagePlatformBundle(projectRoot, platform2, bundle, { config, v
113393
113874
  const directory2 = packagedAssetDirectory(asset.httpServerLocation);
113394
113875
  if (asset.files) {
113395
113876
  for (const file of asset.files) {
113396
- const path140 = `${directory2}/${(0, import_node_path153.basename)(file)}`;
113397
- if (!assets2.has(path140)) assets2.set(path140, (0, import_node_fs149.readFileSync)(file));
113877
+ const path143 = `${directory2}/${(0, import_node_path156.basename)(file)}`;
113878
+ if (!assets2.has(path143)) assets2.set(path143, (0, import_node_fs152.readFileSync)(file));
113398
113879
  }
113399
113880
  continue;
113400
113881
  }
113401
113882
  for (const scale of asset.scales) {
113402
113883
  const file = `${asset.name}${scale === 1 ? "" : `@${scale}x`}.${asset.type}`;
113403
- const path140 = `${directory2}/${file}`;
113404
- if (!assets2.has(path140)) assets2.set(path140, await readAssetFile(asset, file));
113884
+ const path143 = `${directory2}/${file}`;
113885
+ if (!assets2.has(path143)) assets2.set(path143, await readAssetFile(asset, file));
113405
113886
  }
113406
113887
  }
113407
113888
  let appCatalog = null;
@@ -113415,11 +113896,11 @@ async function packagePlatformBundle(projectRoot, platform2, bundle, { config, v
113415
113896
  images: Object.fromEntries(Object.entries(captured.value.images).map(([name3, variants]) => [
113416
113897
  name3,
113417
113898
  variants.map((image) => {
113418
- const file = (0, import_node_path153.basename)(new URL(image.uri).pathname);
113899
+ const file = (0, import_node_path156.basename)(new URL(image.uri).pathname);
113419
113900
  const staged = captured.files.get(file);
113420
113901
  if (!staged) throw new Error("app catalog image was not staged");
113421
113902
  const resource = `assets/native-catalog/${file}`;
113422
- assets2.set(resource, (0, import_node_fs149.readFileSync)(staged));
113903
+ assets2.set(resource, (0, import_node_fs152.readFileSync)(staged));
113423
113904
  return { ...image, uri: resource };
113424
113905
  })
113425
113906
  ]))
@@ -113440,7 +113921,7 @@ async function packagePlatformBundle(projectRoot, platform2, bundle, { config, v
113440
113921
  versions
113441
113922
  )
113442
113923
  ),
113443
- assets: [...assets2].map(([path140, bytes]) => ({ path: path140, bytes })),
113924
+ assets: [...assets2].map(([path143, bytes]) => ({ path: path143, bytes })),
113444
113925
  ...await buildNativeBundles(projectRoot, platform2, configuration)
113445
113926
  };
113446
113927
  }
@@ -113520,12 +114001,12 @@ async function snapshotOneProductionBundle(projectRoot, entryFile, env = {}, { r
113520
114001
  const inputs2 = await readPackagingInputs(projectRoot);
113521
114002
  const snapshots = [];
113522
114003
  for (const platform2 of platforms2) {
113523
- const out = await mkdtemp((0, import_node_path153.join)(tmpdir3(), "peach-production-bundle-"));
114004
+ const out = await mkdtemp((0, import_node_path156.join)(tmpdir3(), "peach-production-bundle-"));
113524
114005
  try {
113525
114006
  await promisify21(execFile22)(
113526
114007
  runtimeExecutable,
113527
114008
  [
113528
- (0, import_node_path153.join)(projectRoot, "node_modules/.bin/react-native"),
114009
+ (0, import_node_path156.join)(projectRoot, "node_modules/.bin/react-native"),
113529
114010
  "bundle",
113530
114011
  "--platform",
113531
114012
  platform2,
@@ -113536,19 +114017,19 @@ async function snapshotOneProductionBundle(projectRoot, entryFile, env = {}, { r
113536
114017
  "--entry-file",
113537
114018
  entryFile,
113538
114019
  "--bundle-output",
113539
- (0, import_node_path153.join)(out, "bundle.js"),
114020
+ (0, import_node_path156.join)(out, "bundle.js"),
113540
114021
  "--assets-dest",
113541
- (0, import_node_path153.join)(out, "assets"),
114022
+ (0, import_node_path156.join)(out, "assets"),
113542
114023
  "--sourcemap-output",
113543
- (0, import_node_path153.join)(out, "bundle.js.map")
114024
+ (0, import_node_path156.join)(out, "bundle.js.map")
113544
114025
  ],
113545
114026
  { cwd: projectRoot, env: { ...process.env, ...env, NODE_ENV: "production" } }
113546
114027
  );
113547
114028
  snapshots.push(
113548
- await packagePlatformBundle(projectRoot, platform2, await readFile4((0, import_node_path153.join)(out, "bundle.js")), {
114029
+ await packagePlatformBundle(projectRoot, platform2, await readFile4((0, import_node_path156.join)(out, "bundle.js")), {
113549
114030
  ...inputs2,
113550
114031
  configuration: "Release",
113551
- readAssetFile: (asset, file) => readFile4((0, import_node_path153.join)(out, asset.httpServerLocation, file))
114032
+ readAssetFile: (asset, file) => readFile4((0, import_node_path156.join)(out, asset.httpServerLocation, file))
113552
114033
  })
113553
114034
  );
113554
114035
  } finally {
@@ -113558,15 +114039,15 @@ async function snapshotOneProductionBundle(projectRoot, entryFile, env = {}, { r
113558
114039
  return { platforms: snapshots };
113559
114040
  }
113560
114041
  async function snapshotOneDevBundle(projectRoot, env = {}, { runtimeExecutable = process.execPath, platforms: platforms2 = ["ios", "android"] } = {}) {
113561
- const { spawn: spawn13 } = await import("node:child_process");
114042
+ const { spawn: spawn14 } = await import("node:child_process");
113562
114043
  const { createServer: createServer2 } = await import("node:net");
113563
114044
  const { createRequire: createRequire24 } = await import("node:module");
113564
- const onePackage = createRequire24((0, import_node_path153.join)(projectRoot, "package.json")).resolve(
114045
+ const onePackage = createRequire24((0, import_node_path156.join)(projectRoot, "package.json")).resolve(
113565
114046
  "one/package.json"
113566
114047
  );
113567
- const oneBin = (0, import_node_path153.join)(
113568
- (0, import_node_path153.dirname)(onePackage),
113569
- JSON.parse((0, import_node_fs149.readFileSync)(onePackage, "utf8")).bin.one
114048
+ const oneBin = (0, import_node_path156.join)(
114049
+ (0, import_node_path156.dirname)(onePackage),
114050
+ JSON.parse((0, import_node_fs152.readFileSync)(onePackage, "utf8")).bin.one
113570
114051
  );
113571
114052
  const port = await new Promise((resolve4, reject) => {
113572
114053
  const server = createServer2().listen(0, "127.0.0.1", () => {
@@ -113574,7 +114055,7 @@ async function snapshotOneDevBundle(projectRoot, env = {}, { runtimeExecutable =
113574
114055
  server.close(() => resolve4(port2));
113575
114056
  }).on("error", reject);
113576
114057
  });
113577
- const child = spawn13(runtimeExecutable, [oneBin, "dev", "--port", String(port)], {
114058
+ const child = spawn14(runtimeExecutable, [oneBin, "dev", "--port", String(port)], {
113578
114059
  cwd: projectRoot,
113579
114060
  env: { ...process.env, ...env, CI: "1", PEACH_NO_OPEN: "1" },
113580
114061
  stdio: ["ignore", "inherit", "inherit"],