@wix/himalaya-cli 0.1643.0 → 0.1645.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +6 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/validator.d.ts +3 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +3 -1
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +3 -1
  5. package/dist/browser-plane/assets.json +5 -5
  6. package/dist/browser-plane/preview-deferred/{3361f61ce6b490c8b7b252658ea67f733d88c6e9f95906d0e31eea4827141df3.bin → 155f61519885c85d61a39fa595197071a3ca07680da56055ccb1dcff2e709cd1.bin} +1 -1
  7. package/dist/browser-plane/sw.js +6 -6
  8. package/dist/cli.mjs +1040 -707
  9. package/dist/preview-assets.generated.bin +0 -0
  10. package/guides/component-reference.json +1 -1
  11. package/guides/component-reference.md +6 -0
  12. package/guides/designing-himi-screens.md +18 -0
  13. package/guides/offline-reading.md +1 -1
  14. package/guides/one-app-to-himi-app.md +13 -2
  15. package/guides/recipe-four-state.md +17 -0
  16. package/guides/release-notes.md +21 -0
  17. package/guides/sdk-reference.json +1 -1
  18. package/package.json +2 -2
  19. package/templates/beauty-salon/tier5-src/_shared/iap-presentation.ts +5 -2
  20. package/templates/beauty-salon/tier5-src/himi-store-product/index.ts +6 -3
  21. package/templates/branded-lite/tier5-src/_shared/iap-presentation.ts +5 -2
  22. package/templates/branded-lite/tier5-src/himi-store-product/index.ts +7 -3
  23. package/templates/community-club/tier5-src/_shared/iap-presentation.ts +5 -2
  24. package/templates/events-meetups/tier5-src/_shared/iap-presentation.ts +5 -2
  25. package/templates/gym-fitness/tier5-src/_shared/iap-presentation.ts +5 -2
  26. package/templates/gym-fitness/tier5-src/himi-store-product/index.ts +6 -3
  27. package/templates/nonprofit-cause/tier5-src/_shared/iap-presentation.ts +5 -2
  28. package/templates/podcast-creator/tier5-src/_shared/iap-presentation.ts +5 -2
  29. package/templates/portfolio-creative/tier5-src/_shared/iap-presentation.ts +5 -2
  30. package/templates/portfolio-creative/tier5-src/himi-store-product/index.ts +6 -3
  31. package/templates/restaurant/tier5-src/_shared/iap-presentation.ts +5 -2
  32. package/templates/retail-store/tier5-src/_shared/iap-presentation.ts +5 -2
  33. package/templates/retail-store/tier5-src/himi-store-product/index.ts +7 -3
  34. package/templates/yoga-studio/tier5-src/_shared/iap-presentation.ts +5 -2
package/dist/cli.mjs CHANGED
@@ -1354,8 +1354,8 @@ function primaryCtaStructureGap(text15) {
1354
1354
  }
1355
1355
  const data = ctaTables.flatMap(({ table }) => table.data);
1356
1356
  const flat = (value2) => value2.toLowerCase().replace(/[^a-z0-9]+/g, " ").trim();
1357
- const rowText = data.map((row2) => flat(row2.join(" ")));
1358
- const missing3 = declaredStates(text15).filter((state) => !rowText.some((row2) => row2.includes(flat(state))));
1357
+ const rowText2 = data.map((row2) => flat(row2.join(" ")));
1358
+ const missing3 = declaredStates(text15).filter((state) => !rowText2.some((row2) => row2.includes(flat(state))));
1359
1359
  if (missing3.length) return `The acceptance table has no row for the declared state(s): ${missing3.join(", ")}.`;
1360
1360
  return null;
1361
1361
  }
@@ -1731,9 +1731,9 @@ function applyBase44AppId(dir, appId2, tenantUrl) {
1731
1731
  const config = join2(dir, "config.ts");
1732
1732
  if (!existsSync(config)) return false;
1733
1733
  const body = readFileSync2(config, "utf8");
1734
- const literal = `"${BASE44_APP_ID_PLACEHOLDER}"`;
1735
- if (!body.includes(literal)) return false;
1736
- let configured = body.replaceAll(literal, `"${appId2}"`);
1734
+ const literal2 = `"${BASE44_APP_ID_PLACEHOLDER}"`;
1735
+ if (!body.includes(literal2)) return false;
1736
+ let configured = body.replaceAll(literal2, `"${appId2}"`);
1737
1737
  if (tenantUrl !== void 0) {
1738
1738
  const host = base44TenantUrl(tenantUrl).hostname;
1739
1739
  if (!/^\s*base44:\s*\{/m.test(configured) || /\bappLinkHosts\s*:/.test(configured)) {
@@ -5168,16 +5168,16 @@ import { AsyncLocalStorage } from "node:async_hooks";
5168
5168
  function referenceCache() {
5169
5169
  return referenceScope.getStore() ?? new CatalogCache({ cliVersion: bundledVersion });
5170
5170
  }
5171
- function withReferenceCache(cache2, fn2) {
5172
- return referenceScope.run(cache2, fn2);
5171
+ function withReferenceCache(cache3, fn2) {
5172
+ return referenceScope.run(cache3, fn2);
5173
5173
  }
5174
5174
  function referenceIdentity() {
5175
5175
  const s2 = referenceCache().status();
5176
5176
  return { source: s2.source, ...s2.source === "cache" && s2.installed ? { contentVersion: s2.installed.contentVersion, releaseDigest: s2.installed.releaseDigest } : {} };
5177
5177
  }
5178
5178
  function readReference(path2) {
5179
- const cache2 = referenceCache();
5180
- if (cache2.status().source === "cache") return cache2.read(`guides/${path2}`);
5179
+ const cache3 = referenceCache();
5180
+ if (cache3.status().source === "cache") return cache3.read(`guides/${path2}`);
5181
5181
  ensureCheckoutAuthoring();
5182
5182
  try {
5183
5183
  return readFileSync7(join8(GUIDES_DIR, path2), "utf8");
@@ -5743,8 +5743,8 @@ function isStaticInitializer(expr) {
5743
5743
  }
5744
5744
  return false;
5745
5745
  }
5746
- function collectPaths(obj12, prefix, out2) {
5747
- for (const p2 of obj12.properties) {
5746
+ function collectPaths(obj13, prefix, out2) {
5747
+ for (const p2 of obj13.properties) {
5748
5748
  let key3;
5749
5749
  if (ts.isPropertyAssignment(p2)) key3 = propName(p2.name);
5750
5750
  else if (ts.isShorthandPropertyAssignment(p2)) key3 = p2.name.text;
@@ -5972,20 +5972,20 @@ function analyzeController(source, file2, profile, diagnostics) {
5972
5972
  error(object15, "initialState and handlers must be object literals.");
5973
5973
  return;
5974
5974
  }
5975
- function literal(n2) {
5976
- if (ts2.isAsExpression(n2) || ts2.isSatisfiesExpression(n2) || ts2.isParenthesizedExpression(n2)) return literal(n2.expression);
5975
+ function literal2(n2) {
5976
+ if (ts2.isAsExpression(n2) || ts2.isSatisfiesExpression(n2) || ts2.isParenthesizedExpression(n2)) return literal2(n2.expression);
5977
5977
  if (ts2.isStringLiteral(n2) || ts2.isNoSubstitutionTemplateLiteral(n2)) return n2.text;
5978
5978
  if (ts2.isNumericLiteral(n2)) return Number(n2.text);
5979
5979
  if (n2.kind === ts2.SyntaxKind.TrueKeyword) return true;
5980
5980
  if (n2.kind === ts2.SyntaxKind.FalseKeyword) return false;
5981
5981
  if (n2.kind === ts2.SyntaxKind.NullKeyword) return null;
5982
5982
  if (ts2.isPrefixUnaryExpression(n2) && n2.operator === ts2.SyntaxKind.MinusToken && ts2.isNumericLiteral(n2.operand)) return -Number(n2.operand.text);
5983
- if (ts2.isArrayLiteralExpression(n2)) return n2.elements.map((e2) => literal(e2));
5983
+ if (ts2.isArrayLiteralExpression(n2)) return n2.elements.map((e2) => literal2(e2));
5984
5984
  if (ts2.isObjectLiteralExpression(n2)) return Object.fromEntries(n2.properties.map((p2) => {
5985
5985
  if (!ts2.isPropertyAssignment(p2) || ts2.isComputedPropertyName(p2.name)) throw new Error("State must contain JSON literals; no spreads, calls, or computed keys.");
5986
5986
  const key3 = p2.name.getText(sf2).replace(/^["']|["']$/g, "");
5987
5987
  if (unsafe.has(key3) || key3.startsWith("__hhp")) throw new Error(`Unsafe or reserved state key ${key3}.`);
5988
- return [key3, literal(p2.initializer)];
5988
+ return [key3, literal2(p2.initializer)];
5989
5989
  }));
5990
5990
  throw new Error("State must contain JSON literals; no spreads, calls, or computed keys.");
5991
5991
  }
@@ -5997,7 +5997,7 @@ function analyzeController(source, file2, profile, diagnostics) {
5997
5997
  if (v2 && typeof v2 === "object" && !Array.isArray(v2)) collect2(v2, path2);
5998
5998
  }
5999
5999
  };
6000
- const initial = literal(state.initializer);
6000
+ const initial = literal2(state.initializer);
6001
6001
  if (!initial || typeof initial !== "object" || Array.isArray(initial)) throw new Error("initialState must be a JSON object.");
6002
6002
  const paths2 = /* @__PURE__ */ new Map();
6003
6003
  collect2(initial);
@@ -9771,8 +9771,8 @@ function tsExtResolvePlugin() {
9771
9771
  setup(b2) {
9772
9772
  b2.onResolve({ filter: /\.js$/ }, (args) => {
9773
9773
  if (args.kind === "entry-point" || !args.path.startsWith(".")) return void 0;
9774
- const ts20 = resolve10(args.resolveDir, args.path.replace(/\.js$/, ".ts"));
9775
- return existsSync11(ts20) ? { path: ts20 } : void 0;
9774
+ const ts21 = resolve10(args.resolveDir, args.path.replace(/\.js$/, ".ts"));
9775
+ return existsSync11(ts21) ? { path: ts21 } : void 0;
9776
9776
  });
9777
9777
  }
9778
9778
  };
@@ -10528,7 +10528,7 @@ function bundleFor(file2) {
10528
10528
  const match = /^tier5-src\/([^/]+)\//.exec(file2);
10529
10529
  return match?.[1] ?? "_shared";
10530
10530
  }
10531
- function toIssue(ts20, contentDir2, diagnostic) {
10531
+ function toIssue(ts21, contentDir2, diagnostic) {
10532
10532
  const file2 = diagnostic.file ? relativeFile(contentDir2, diagnostic.file.fileName) : void 0;
10533
10533
  const position = diagnostic.file && diagnostic.start !== void 0 ? diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start) : void 0;
10534
10534
  return {
@@ -10536,13 +10536,13 @@ function toIssue(ts20, contentDir2, diagnostic) {
10536
10536
  ...file2 ? { file: file2 } : {},
10537
10537
  ...position ? { line: position.line + 1, column: position.character + 1 } : {},
10538
10538
  code: `TS${diagnostic.code}`,
10539
- message: ts20.flattenDiagnosticMessageText(diagnostic.messageText, "\n")
10539
+ message: ts21.flattenDiagnosticMessageText(diagnostic.messageText, "\n")
10540
10540
  };
10541
10541
  }
10542
- function confinedHost(ts20, contentDir2, options) {
10542
+ function confinedHost(ts21, contentDir2, options) {
10543
10543
  if (!buildConfinementRequired()) return void 0;
10544
- const host = ts20.createCompilerHost(options);
10545
- const libDir = resolve12(ts20.getDefaultLibFilePath(options), "..");
10544
+ const host = ts21.createCompilerHost(options);
10545
+ const libDir = resolve12(ts21.getDefaultLibFilePath(options), "..");
10546
10546
  const allows = confinementMatcher(contentDir2, [libDir]);
10547
10547
  const getSourceFile = host.getSourceFile.bind(host);
10548
10548
  const readFile3 = host.readFile.bind(host);
@@ -10571,7 +10571,7 @@ function confinedHost(ts20, contentDir2, options) {
10571
10571
  }
10572
10572
  async function typecheckContentWorkers(contentDir2, options) {
10573
10573
  if (!existsSync12(resolve12(contentDir2, "tier5-src"))) return [];
10574
- const ts20 = await compiler2();
10574
+ const ts21 = await compiler2();
10575
10575
  const config = {
10576
10576
  compilerOptions: {
10577
10577
  ...CONTENT_WORKER_COMPILER_OPTIONS,
@@ -10580,18 +10580,18 @@ async function typecheckContentWorkers(contentDir2, options) {
10580
10580
  // The deployed authoring runtime stages TypeScript 6, which requires an explicit
10581
10581
  // acknowledgement for this compatibility `baseUrl`; the repository's TypeScript 5 lane
10582
10582
  // rejects that 6.0 value, so keep it specific to the compiler that needs it.
10583
- ...Number.parseInt(ts20.versionMajorMinor, 10) >= 6 ? { ignoreDeprecations: "6.0" } : {}
10583
+ ...Number.parseInt(ts21.versionMajorMinor, 10) >= 6 ? { ignoreDeprecations: "6.0" } : {}
10584
10584
  },
10585
10585
  include: ["tier5-src/*/index.ts", "tier5-src/_shared/**/*.ts"]
10586
10586
  };
10587
- const parsed = ts20.parseJsonConfigFileContent(config, ts20.sys, contentDir2);
10587
+ const parsed = ts21.parseJsonConfigFileContent(config, ts21.sys, contentDir2);
10588
10588
  if (parsed.fileNames.length === 0) return [];
10589
- const program = ts20.createProgram({
10589
+ const program = ts21.createProgram({
10590
10590
  rootNames: parsed.fileNames,
10591
10591
  options: parsed.options,
10592
- host: confinedHost(ts20, contentDir2, parsed.options)
10592
+ host: confinedHost(ts21, contentDir2, parsed.options)
10593
10593
  });
10594
- return [...parsed.errors, ...ts20.getPreEmitDiagnostics(program)].filter((diagnostic) => diagnostic.category === ts20.DiagnosticCategory.Error && belongsToContentWorkers(contentDir2, diagnostic)).map((diagnostic) => toIssue(ts20, contentDir2, diagnostic));
10594
+ return [...parsed.errors, ...ts21.getPreEmitDiagnostics(program)].filter((diagnostic) => diagnostic.category === ts21.DiagnosticCategory.Error && belongsToContentWorkers(contentDir2, diagnostic)).map((diagnostic) => toIssue(ts21, contentDir2, diagnostic));
10595
10595
  }
10596
10596
  var compilerPromise;
10597
10597
  var init_tier5_typecheck = __esm({
@@ -13264,13 +13264,13 @@ function walk(node3, registry2, path2, out2) {
13264
13264
  node3.forEach((item, i2) => walk(item, registry2, `${path2}[${i2}]`, out2));
13265
13265
  return;
13266
13266
  }
13267
- const obj12 = node3;
13268
- const bg = obj12.background;
13267
+ const obj13 = node3;
13268
+ const bg = obj13.background;
13269
13269
  if (bg && typeof bg.token === "string" && !registry2.colors.has(bg.token)) {
13270
13270
  out2.push({ path: `${path2}.background.token`, kind: "color", name: bg.token });
13271
13271
  }
13272
- if (obj12.type === "Text") {
13273
- const props2 = obj12.props;
13272
+ if (obj13.type === "Text") {
13273
+ const props2 = obj13.props;
13274
13274
  if (props2 && typeof props2.style === "string" && !registry2.typography.has(props2.style)) {
13275
13275
  out2.push({
13276
13276
  path: `${path2}.props.style`,
@@ -13286,11 +13286,11 @@ function walk(node3, registry2, path2, out2) {
13286
13286
  });
13287
13287
  }
13288
13288
  }
13289
- const type2 = typeof obj12.type === "string" ? obj12.type : "";
13289
+ const type2 = typeof obj13.type === "string" ? obj13.type : "";
13290
13290
  const colorProps = Object.prototype.hasOwnProperty.call(COLOR_TOKEN_PROPS, type2) ? COLOR_TOKEN_PROPS[type2] : void 0;
13291
13291
  const typoProps = Object.prototype.hasOwnProperty.call(TYPOGRAPHY_TOKEN_PROPS, type2) ? TYPOGRAPHY_TOKEN_PROPS[type2] : void 0;
13292
- if ((colorProps || typoProps) && obj12.props && typeof obj12.props === "object") {
13293
- const props2 = obj12.props;
13292
+ if ((colorProps || typoProps) && obj13.props && typeof obj13.props === "object") {
13293
+ const props2 = obj13.props;
13294
13294
  const check = (spec, kind) => {
13295
13295
  const [arrayKey, leaf] = spec.includes("[].") ? spec.split("[].") : [void 0, spec];
13296
13296
  const sites = arrayKey ? (Array.isArray(props2[arrayKey]) ? props2[arrayKey] : []).map((el2, i2) => [`${path2}.props.${arrayKey}[${i2}].${leaf}`, el2 && typeof el2 === "object" ? el2[leaf] : void 0]) : [[`${path2}.props.${leaf}`, props2[leaf]]];
@@ -13304,7 +13304,7 @@ function walk(node3, registry2, path2, out2) {
13304
13304
  for (const spec of colorProps ?? []) check(spec, "color");
13305
13305
  for (const spec of typoProps ?? []) check(spec, "typography");
13306
13306
  }
13307
- for (const [key3, value2] of Object.entries(obj12)) {
13307
+ for (const [key3, value2] of Object.entries(obj13)) {
13308
13308
  walk(value2, registry2, `${path2}.${key3}`, out2);
13309
13309
  }
13310
13310
  }
@@ -13380,15 +13380,15 @@ function findUnknownComponents(node3, allowed2, path2 = "$", out2 = []) {
13380
13380
  );
13381
13381
  return out2;
13382
13382
  }
13383
- const obj12 = node3;
13384
- const body = obj12.body;
13383
+ const obj13 = node3;
13384
+ const body = obj13.body;
13385
13385
  if (body && typeof body.package === "string" && typeof body.type === "string") {
13386
13386
  const key3 = `${body.package}.${body.type}`;
13387
13387
  if (!allowed2.has(key3)) {
13388
13388
  out2.push({ path: path2, package: body.package, type: body.type });
13389
13389
  }
13390
13390
  }
13391
- for (const [key3, value2] of Object.entries(obj12)) {
13391
+ for (const [key3, value2] of Object.entries(obj13)) {
13392
13392
  findUnknownComponents(value2, allowed2, `${path2}.${key3}`, out2);
13393
13393
  }
13394
13394
  return out2;
@@ -13457,8 +13457,8 @@ function scanWidgetPayload(node3, family, path2, bindings, disallowed, timeRefs,
13457
13457
  return;
13458
13458
  }
13459
13459
  if (node3 === null || typeof node3 !== "object") return;
13460
- const obj12 = node3;
13461
- const body = obj12.body;
13460
+ const obj13 = node3;
13461
+ const body = obj13.body;
13462
13462
  if (body && typeof body.package === "string" && typeof body.type === "string") {
13463
13463
  const key3 = `${body.package}.${body.type}`;
13464
13464
  if (family && !isComponentAllowedForFamily(key3, family)) {
@@ -13474,7 +13474,7 @@ function scanWidgetPayload(node3, family, path2, bindings, disallowed, timeRefs,
13474
13474
  intents.push({ path: `${path2}.body.props.intent`, reason: "widget Button commands use the required `action` field" });
13475
13475
  }
13476
13476
  validateWidgetActionRef(button.action, `${path2}.body.props.action`, intents);
13477
- const componentId = obj12.id;
13477
+ const componentId = obj13.id;
13478
13478
  if (typeof componentId !== "string" || !WIDGET_ACTION_IDENTIFIER.test(componentId)) {
13479
13479
  intents.push({
13480
13480
  path: `${path2}.id`,
@@ -13485,8 +13485,8 @@ function scanWidgetPayload(node3, family, path2, bindings, disallowed, timeRefs,
13485
13485
  }
13486
13486
  }
13487
13487
  }
13488
- if (obj12.timeRef !== void 0 && obj12.timeRef !== null) {
13489
- const tr2 = obj12.timeRef;
13488
+ if (obj13.timeRef !== void 0 && obj13.timeRef !== null) {
13489
+ const tr2 = obj13.timeRef;
13490
13490
  if (typeof tr2 !== "object" || Array.isArray(tr2)) {
13491
13491
  timeRefs.push({ path: `${path2}.timeRef`, reason: "must be an object { at, style? }" });
13492
13492
  } else {
@@ -13500,7 +13500,7 @@ function scanWidgetPayload(node3, family, path2, bindings, disallowed, timeRefs,
13500
13500
  }
13501
13501
  }
13502
13502
  }
13503
- for (const [k2, v2] of Object.entries(obj12)) {
13503
+ for (const [k2, v2] of Object.entries(obj13)) {
13504
13504
  scanWidgetPayload(v2, family, `${path2}.${k2}`, bindings, disallowed, timeRefs, intents, actionSites2);
13505
13505
  }
13506
13506
  }
@@ -13697,7 +13697,9 @@ var init_validator = __esm({
13697
13697
  intervalMs: { type: "integer", minimum: 1 },
13698
13698
  action: { type: "string" }
13699
13699
  }
13700
- }
13700
+ },
13701
+ // The worker's boot state (`{ serviceName: initialState }`), for the first frame.
13702
+ bootState: { type: "object" }
13701
13703
  }
13702
13704
  }
13703
13705
  },
@@ -15380,8 +15382,8 @@ function collectDescriptorStrings(descriptor, options = {}) {
15380
15382
  return;
15381
15383
  }
15382
15384
  if (!node3 || typeof node3 !== "object") return;
15383
- const obj12 = node3;
15384
- const body = obj12.body;
15385
+ const obj13 = node3;
15386
+ const body = obj13.body;
15385
15387
  const type2 = typeof body?.type === "string" ? body.type : null;
15386
15388
  const props2 = body?.props;
15387
15389
  if (type2 && props2 && typeof props2 === "object") {
@@ -15407,14 +15409,15 @@ function collectDescriptorStrings(descriptor, options = {}) {
15407
15409
  });
15408
15410
  }
15409
15411
  }
15410
- for (const [k2, v2] of Object.entries(obj12)) {
15412
+ for (const [k2, v2] of Object.entries(obj13)) {
15411
15413
  if (k2 === "body") continue;
15412
15414
  if (typeof v2 === "string" && SECONDARY_FIELDS.has(k2) && !BINDING_SIGIL.test(v2) && isCopy2(v2)) {
15413
15415
  push({ value: v2, bucket: "reachable", type: type2, prop: k2, path: `${path2}.${k2}` });
15414
15416
  }
15415
15417
  }
15416
- for (const [k2, v2] of Object.entries(obj12)) {
15418
+ for (const [k2, v2] of Object.entries(obj13)) {
15417
15419
  if (path2 === "" && k2 === "input" && v2 !== null && typeof v2 === "object") continue;
15420
+ if (path2 === "logicBundle" && k2 === "bootState") continue;
15418
15421
  if (v2 && typeof v2 === "object") visit(v2, path2 ? `${path2}.${k2}` : k2);
15419
15422
  }
15420
15423
  };
@@ -16967,6 +16970,7 @@ __export(validate_descriptor_core_exports, {
16967
16970
  appServicesVerdictOf: () => appServicesVerdictOf,
16968
16971
  bareNestedClass: () => bareNestedClass,
16969
16972
  bootBundleWorker: () => bootBundleWorker,
16973
+ bundleNameFromUrl: () => bundleNameFromUrl,
16970
16974
  collectServiceBindings: () => collectServiceBindings,
16971
16975
  componentPropFindings: () => componentPropFindings,
16972
16976
  depthBudgetFindings: () => depthBudgetFindings,
@@ -16987,6 +16991,7 @@ __export(validate_descriptor_core_exports, {
16987
16991
  loadBundleServicesLive: () => loadBundleServicesLive,
16988
16992
  nativeRequiredFindings: () => nativeRequiredFindings,
16989
16993
  nondeterministicServices: () => nondeterministicServices,
16994
+ nondeterministicServicesOrNull: () => nondeterministicServicesOrNull,
16990
16995
  pathCrossesOpaqueAuthorJson: () => pathCrossesOpaqueAuthorJson,
16991
16996
  pathValue: () => pathValue,
16992
16997
  pinnedIntrinsicsSource: () => pinnedIntrinsicsSource,
@@ -17006,6 +17011,7 @@ __export(validate_descriptor_core_exports, {
17006
17011
  validateScreenDescriptor: () => validateScreenDescriptor,
17007
17012
  validateTabBarVisibility: () => validateTabBarVisibility,
17008
17013
  webViewEmbeddedIssues: () => webViewEmbeddedIssues,
17014
+ withoutBootState: () => withoutBootState,
17009
17015
  workerSubtreeAllowed: () => workerSubtreeAllowed
17010
17016
  });
17011
17017
  function makeInert() {
@@ -17061,6 +17067,9 @@ function withWorkerConsole(base, capture, now) {
17061
17067
  function pinnedNow(clock) {
17062
17068
  return clock === void 0 ? void 0 : () => Number(clock);
17063
17069
  }
17070
+ function hostStorage(store) {
17071
+ return { get: (k2) => store.getItem(k2) ?? "", set: (k2, v2) => store.setItem(k2, v2), getItem: (k2) => store.getItem(k2), setItem: (k2, v2) => store.setItem(k2, v2) };
17072
+ }
17064
17073
  function runBundleSandbox(bundleJs, opts) {
17065
17074
  const services = {};
17066
17075
  const actions = {};
@@ -17070,6 +17079,7 @@ function runBundleSandbox(bundleJs, opts) {
17070
17079
  const himalayaTarget = {
17071
17080
  readLifecycleVersion: 1,
17072
17081
  connectivity: { current: () => ({ online: true }) },
17082
+ ...opts.storage ? { storage: hostStorage(opts.storage) } : {},
17073
17083
  // #537 — `input` is REAL DATA, not a capability. The host injects the descriptor's
17074
17084
  // `input` (merged with nav params) as a plain object before the worker evaluates,
17075
17085
  // and workers read it synchronously in load() (`himalaya.input.id` on a detail
@@ -17154,6 +17164,7 @@ function runBundleSandbox(bundleJs, opts) {
17154
17164
  timeoutMs: opts.timeoutMs ?? BOOT_EVAL_TIMEOUT_MS,
17155
17165
  filename: "himi-bundle.js",
17156
17166
  captureConsole: Boolean(opts.captureConsole),
17167
+ ...opts.storage ? { storage: opts.storage } : {},
17157
17168
  ...opts.clock === void 0 ? {} : { clock: opts.clock },
17158
17169
  ...opts.seed === void 0 ? {} : { seed: opts.seed },
17159
17170
  ...opts.mirrorRandom ? { mirrorRandom: true } : {}
@@ -17171,6 +17182,11 @@ function safeStringify(v2) {
17171
17182
  return String(v2);
17172
17183
  }
17173
17184
  }
17185
+ function bundleNameFromUrl(url) {
17186
+ if (typeof url !== "string") return null;
17187
+ const m2 = /\/v1\/bundles\/([a-z0-9_-]+)/i.exec(url);
17188
+ return m2 ? m2[1] : null;
17189
+ }
17174
17190
  function extractBundleServices(bundleJs, opts = {}) {
17175
17191
  return runBundleSandbox(bundleJs, { rethrow: true, ...opts }).services;
17176
17192
  }
@@ -17235,6 +17251,13 @@ function nondeterministicServices(bundleJs, opts = {}) {
17235
17251
  if (threw > 0) return names2.sort();
17236
17252
  return names2.filter((name) => safeStringify(a2[name]) !== safeStringify(b2[name])).sort();
17237
17253
  }
17254
+ function nondeterministicServicesOrNull(bundleJs, opts = {}) {
17255
+ const boots = DRIFT_PROBES.map((probe2) => runBundleSandbox(bundleJs, { rethrow: false, ...opts, ...probe2 }));
17256
+ if (boots.some((boot) => boot.threw !== null)) return null;
17257
+ const [a2, b2] = boots.map((boot) => boot.services);
17258
+ const names2 = [.../* @__PURE__ */ new Set([...Object.keys(a2), ...Object.keys(b2)])];
17259
+ return names2.filter((name) => safeStringify(a2[name]) !== safeStringify(b2[name])).sort();
17260
+ }
17238
17261
  function deviceParityWithheldFrom(root) {
17239
17262
  const names2 = new Set(DEVICE_PARITY_CANDIDATES);
17240
17263
  for (let o2 = root; o2 && o2 !== Object.prototype; o2 = Object.getPrototypeOf(o2)) {
@@ -17359,7 +17382,7 @@ async function bootBundleWorker(bundleJs, opts) {
17359
17382
  ...opts.capabilities ? { capabilities: [...opts.capabilities] } : {},
17360
17383
  wixApi,
17361
17384
  // v1 best-effort stubs — a visitor-scoped load() reads Wix, not device-local state.
17362
- storage: opts.storage ? { get: (k2) => opts.storage.getItem(k2) ?? "", set: (k2, v2) => opts.storage.setItem(k2, v2), getItem: (k2) => opts.storage.getItem(k2), setItem: (k2, v2) => opts.storage.setItem(k2, v2) } : { get: () => "", set: () => {
17385
+ storage: opts.storage ? hostStorage(opts.storage) : { get: () => "", set: () => {
17363
17386
  }, getItem: () => null, setItem: () => {
17364
17387
  } },
17365
17388
  dispatch: dispatchHost,
@@ -18250,13 +18273,13 @@ function enumFieldNames(schema2 = screenDescriptorSchema) {
18250
18273
  const names2 = /* @__PURE__ */ new Set();
18251
18274
  const visit = (node3, propName7) => {
18252
18275
  if (!node3 || typeof node3 !== "object") return;
18253
- const obj12 = node3;
18254
- if (propName7 && Array.isArray(obj12.enum)) names2.add(propName7);
18255
- if (obj12.properties && typeof obj12.properties === "object") {
18256
- for (const [k2, v2] of Object.entries(obj12.properties)) visit(v2, k2);
18276
+ const obj13 = node3;
18277
+ if (propName7 && Array.isArray(obj13.enum)) names2.add(propName7);
18278
+ if (obj13.properties && typeof obj13.properties === "object") {
18279
+ for (const [k2, v2] of Object.entries(obj13.properties)) visit(v2, k2);
18257
18280
  }
18258
18281
  for (const key3 of ["items", "additionalProperties", "anyOf", "oneOf", "allOf", "definitions", "$defs"]) {
18259
- const v2 = obj12[key3];
18282
+ const v2 = obj13[key3];
18260
18283
  if (Array.isArray(v2)) v2.forEach((x2) => visit(x2, propName7));
18261
18284
  else if (v2 && typeof v2 === "object") {
18262
18285
  if (key3 === "definitions" || key3 === "$defs") {
@@ -18505,8 +18528,8 @@ function richContentFindings(descriptor) {
18505
18528
  if (body?.package === "himalaya" && body.type === "RichContent") {
18506
18529
  const props2 = body.props ?? {};
18507
18530
  const docPath = typeof props2.documentJsonPath === "string" && props2.documentJsonPath !== "" ? props2.documentJsonPath : void 0;
18508
- const literal = typeof props2.documentJson === "string" ? props2.documentJson : void 0;
18509
- if (docPath === void 0 === (literal === void 0)) {
18531
+ const literal2 = typeof props2.documentJson === "string" ? props2.documentJson : void 0;
18532
+ if (docPath === void 0 === (literal2 === void 0)) {
18510
18533
  out2.push({ path: path2, message: "RichContent needs exactly one of documentJsonPath and documentJson" });
18511
18534
  }
18512
18535
  if (docPath !== void 0 && !docPath.startsWith("$service:") && !docPath.startsWith("$item.")) {
@@ -18514,8 +18537,8 @@ function richContentFindings(descriptor) {
18514
18537
  } else if (docPath?.startsWith("$item.") && !/^\$item\.[A-Za-z0-9_]+$/.test(docPath)) {
18515
18538
  out2.push({ path: path2, message: `RichContent.documentJsonPath "${docPath}" must name one row field: "$item.<letters, digits, _>"` });
18516
18539
  }
18517
- if (literal !== void 0) {
18518
- const laid = layoutRichContent(literal);
18540
+ if (literal2 !== void 0) {
18541
+ const laid = layoutRichContent(literal2);
18519
18542
  if ("rejected" in laid) {
18520
18543
  out2.push({ path: path2, message: `RichContent.documentJson is rejected by the renderers (${laid.rejected}) \u2014 every surface would show the fallback` });
18521
18544
  }
@@ -18543,13 +18566,13 @@ function richContentEditorFindings(descriptor) {
18543
18566
  if (isHimalaya && body.type === "RichContentEditor") {
18544
18567
  const p2 = body.props ?? {};
18545
18568
  const docPath = typeof p2.documentPath === "string" && p2.documentPath !== "" ? p2.documentPath : void 0;
18546
- const literal = typeof p2.documentJson === "string" ? p2.documentJson : void 0;
18547
- if (docPath !== void 0 && literal !== void 0) out2.push({ path: path2, message: "RichContentEditor takes at most one of documentPath and documentJson" });
18569
+ const literal2 = typeof p2.documentJson === "string" ? p2.documentJson : void 0;
18570
+ if (docPath !== void 0 && literal2 !== void 0) out2.push({ path: path2, message: "RichContentEditor takes at most one of documentPath and documentJson" });
18548
18571
  if (docPath !== void 0 && !docPath.startsWith("$service:")) out2.push({ path: path2, message: `RichContentEditor.documentPath must be a "$service:" binding, got "${docPath}"` });
18549
- if (literal !== void 0) {
18572
+ if (literal2 !== void 0) {
18550
18573
  let doc;
18551
18574
  try {
18552
- doc = JSON.parse(literal);
18575
+ doc = JSON.parse(literal2);
18553
18576
  } catch {
18554
18577
  doc = void 0;
18555
18578
  }
@@ -19018,6 +19041,12 @@ function renderedWixMediaReferences(descriptor) {
19018
19041
  regions.forEach((region) => collectWixMediaReferences(region.value, region.path, found, false, false, "", region.atRoot));
19019
19042
  return found;
19020
19043
  }
19044
+ function withoutBootState(descriptor) {
19045
+ const lb = descriptor?.logicBundle;
19046
+ if (!lb || typeof lb !== "object" || !("bootState" in lb)) return descriptor;
19047
+ const { bootState: _bootState, ...logicBundle } = lb;
19048
+ return { ...descriptor, logicBundle };
19049
+ }
19021
19050
  function unknownTokenMessage(kind, name, registry2) {
19022
19051
  const base = `unknown ${kind} token "${name}" (not in tokens.json)`;
19023
19052
  const group = registry2 ? { color: registry2.colors, typography: registry2.typography, spacing: registry2.spacing, radius: registry2.radius }[kind] : void 0;
@@ -19027,8 +19056,19 @@ function unknownTokenMessage(kind, name, registry2) {
19027
19056
  const list2 = all.length > 14 ? `${all.slice(0, 14).join(", ")}, \u2026 (${all.length})` : all.join(", ");
19028
19057
  return `${base}${near.length ? ` \u2014 did you mean ${near.map((n2) => `"${n2}"`).join(" or ")}?` : ""} Defined ${kind} tokens: ${list2}`;
19029
19058
  }
19030
- function validateScreenDescriptor(screenId, descriptor, opts = {}) {
19059
+ function validateScreenDescriptor(screenId, served, opts = {}) {
19060
+ const descriptor = withoutBootState(served);
19031
19061
  const issues = [];
19062
+ const bootState = served?.logicBundle?.bootState;
19063
+ if (bootState !== void 0 && bootState !== null && (typeof bootState !== "object" || Array.isArray(bootState))) {
19064
+ issues.push({
19065
+ severity: "error",
19066
+ pass: "schema",
19067
+ path: "/logicBundle/bootState",
19068
+ nativeDecode: true,
19069
+ message: "logicBundle.bootState must be an object of service states \u2014 native decode rejects anything else and drops the whole screen"
19070
+ });
19071
+ }
19032
19072
  const strict = opts.strict ?? false;
19033
19073
  const hygiene = strict ? "error" : "warning";
19034
19074
  const depthFindings = screenDepthFindings(descriptor);
@@ -19636,13 +19676,13 @@ function validateScreenDescriptor(screenId, descriptor, opts = {}) {
19636
19676
  return;
19637
19677
  }
19638
19678
  if (!node3 || typeof node3 !== "object") return;
19639
- const obj12 = node3;
19640
- const body = obj12.body;
19679
+ const obj13 = node3;
19680
+ const body = obj13.body;
19641
19681
  const iconName = body?.type === "Icon" ? body.props?.name : void 0;
19642
19682
  if (iconName != null && typeof iconName !== "string") {
19643
19683
  flagNonString("name", iconName, at2 ? `${at2}.body.props.name` : "props.name");
19644
19684
  }
19645
- for (const [k2, v3] of Object.entries(obj12)) {
19685
+ for (const [k2, v3] of Object.entries(obj13)) {
19646
19686
  if (isOpaqueAuthorJson(k2, v3, at2 === "")) continue;
19647
19687
  if (NAMED_ICON_PROPS.has(k2) && v3 != null && typeof v3 !== "string") {
19648
19688
  flagNonString(k2, v3, at2 ? `${at2}.${k2}` : k2);
@@ -19672,12 +19712,12 @@ function validateScreenDescriptor(screenId, descriptor, opts = {}) {
19672
19712
  return;
19673
19713
  }
19674
19714
  if (!node3 || typeof node3 !== "object") return;
19675
- const obj12 = node3;
19676
- const body = obj12.body;
19715
+ const obj13 = node3;
19716
+ const body = obj13.body;
19677
19717
  if (body && body.type === "Icon" && judgeable(body.props?.name)) {
19678
19718
  flagIcon(body.props.name, at2 ? `${at2}.body.props.name` : "props.name");
19679
19719
  }
19680
- for (const [k2, v3] of Object.entries(obj12)) {
19720
+ for (const [k2, v3] of Object.entries(obj13)) {
19681
19721
  if (isOpaqueAuthorJson(k2, v3, at2 === "")) continue;
19682
19722
  if (ICON_NAME_PROPS.has(k2) && judgeable(v3)) flagIcon(v3, at2 ? `${at2}.${k2}` : k2);
19683
19723
  if (v3 && typeof v3 === "object") scanIcons(v3, at2 ? `${at2}.${k2}` : k2);
@@ -23526,22 +23566,22 @@ var init_pixels = __esm({
23526
23566
  });
23527
23567
 
23528
23568
  // ../../core/dev-server/src/declared-navigation-ast.ts
23529
- function fixedNavigations(bundleJs, ts20) {
23530
- literalTargets(bundleJs, ts20);
23569
+ function fixedNavigations(bundleJs, ts21) {
23570
+ literalTargets(bundleJs, ts21);
23531
23571
  return fixedCache.get(bundleJs) ?? /* @__PURE__ */ new Map();
23532
23572
  }
23533
- function literalTargets(bundleJs, ts20) {
23534
- const name = (n2) => n2 && (ts20.isIdentifier(n2) || ts20.isStringLiteral(n2) || ts20.isNoSubstitutionTemplateLiteral(n2)) ? n2.text : void 0;
23573
+ function literalTargets(bundleJs, ts21) {
23574
+ const name = (n2) => n2 && (ts21.isIdentifier(n2) || ts21.isStringLiteral(n2) || ts21.isNoSubstitutionTemplateLiteral(n2)) ? n2.text : void 0;
23535
23575
  const object15 = (n2) => {
23536
- while (n2 && ts20.isParenthesizedExpression(n2)) n2 = n2.expression;
23537
- return n2 && ts20.isObjectLiteralExpression(n2) ? n2 : void 0;
23576
+ while (n2 && ts21.isParenthesizedExpression(n2)) n2 = n2.expression;
23577
+ return n2 && ts21.isObjectLiteralExpression(n2) ? n2 : void 0;
23538
23578
  };
23539
23579
  const property2 = (o2, key3) => o2?.properties.find((p2) => name(p2.name) === key3);
23540
- const initializer = (p2) => p2 && ts20.isPropertyAssignment(p2) ? p2.initializer : void 0;
23541
- const callable = (n2) => !!n2 && (ts20.isArrowFunction(n2) || ts20.isFunctionExpression(n2) || ts20.isFunctionDeclaration(n2) || ts20.isMethodDeclaration(n2));
23580
+ const initializer = (p2) => p2 && ts21.isPropertyAssignment(p2) ? p2.initializer : void 0;
23581
+ const callable = (n2) => !!n2 && (ts21.isArrowFunction(n2) || ts21.isFunctionExpression(n2) || ts21.isFunctionDeclaration(n2) || ts21.isMethodDeclaration(n2));
23542
23582
  const cached3 = cache.get(bundleJs);
23543
23583
  if (cached3) return cached3;
23544
- const file2 = ts20.createSourceFile("himi-bundle.js", bundleJs, ts20.ScriptTarget.Latest, true, ts20.ScriptKind.JS);
23584
+ const file2 = ts21.createSourceFile("himi-bundle.js", bundleJs, ts21.ScriptTarget.Latest, true, ts21.ScriptKind.JS);
23545
23585
  const symbols = /* @__PURE__ */ new Map();
23546
23586
  const note = (key3, fn2) => {
23547
23587
  if (!key3) return;
@@ -23549,16 +23589,16 @@ function literalTargets(bundleJs, ts20) {
23549
23589
  symbols.set(key3, { count: (prior?.count ?? 0) + 1, fn: fn2 });
23550
23590
  };
23551
23591
  const declarations = (node3) => {
23552
- if (ts20.isFunctionDeclaration(node3)) note(name(node3.name), node3);
23553
- else if (ts20.isVariableDeclaration(node3)) note(name(node3.name), callable(node3.initializer) ? node3.initializer : void 0);
23554
- else if (ts20.isParameter(node3)) note(name(node3.name));
23555
- else if (ts20.isBindingElement(node3)) note(name(node3.name));
23556
- ts20.forEachChild(node3, declarations);
23592
+ if (ts21.isFunctionDeclaration(node3)) note(name(node3.name), node3);
23593
+ else if (ts21.isVariableDeclaration(node3)) note(name(node3.name), callable(node3.initializer) ? node3.initializer : void 0);
23594
+ else if (ts21.isParameter(node3)) note(name(node3.name));
23595
+ else if (ts21.isBindingElement(node3)) note(name(node3.name));
23596
+ ts21.forEachChild(node3, declarations);
23557
23597
  };
23558
23598
  declarations(file2);
23559
23599
  const resolve98 = (node3) => {
23560
23600
  if (callable(node3)) return node3;
23561
- if (node3 && ts20.isIdentifier(node3)) {
23601
+ if (node3 && ts21.isIdentifier(node3)) {
23562
23602
  const symbol = symbols.get(node3.text);
23563
23603
  if (symbol?.count === 1) return symbol.fn;
23564
23604
  }
@@ -23572,9 +23612,9 @@ function literalTargets(bundleJs, ts20) {
23572
23612
  const nav = {};
23573
23613
  for (const p2 of o2.properties) {
23574
23614
  const key3 = name(p2.name);
23575
- if (!ts20.isPropertyAssignment(p2) || !key3 || !NAV_KEYS.has(key3)) return void 0;
23576
- if (ts20.isStringLiteralLike(p2.initializer) && p2.initializer.text) nav[key3] = p2.initializer.text;
23577
- else if (key3 === "reset" && p2.initializer.kind === ts20.SyntaxKind.TrueKeyword) nav[key3] = true;
23615
+ if (!ts21.isPropertyAssignment(p2) || !key3 || !NAV_KEYS.has(key3)) return void 0;
23616
+ if (ts21.isStringLiteralLike(p2.initializer) && p2.initializer.text) nav[key3] = p2.initializer.text;
23617
+ else if (key3 === "reset" && p2.initializer.kind === ts21.SyntaxKind.TrueKeyword) nav[key3] = true;
23578
23618
  else return void 0;
23579
23619
  }
23580
23620
  const { screenId, presentation, tab, reset } = nav;
@@ -23585,75 +23625,75 @@ function literalTargets(bundleJs, ts20) {
23585
23625
  };
23586
23626
  const assigned = /* @__PURE__ */ new Set();
23587
23627
  const assignedNames = (n2) => {
23588
- if (ts20.isIdentifier(n2)) assigned.add(n2.text);
23589
- else ts20.forEachChild(n2, assignedNames);
23628
+ if (ts21.isIdentifier(n2)) assigned.add(n2.text);
23629
+ else ts21.forEachChild(n2, assignedNames);
23590
23630
  };
23591
23631
  const assignments = (n2) => {
23592
- if (ts20.isBinaryExpression(n2) && n2.operatorToken.kind >= ts20.SyntaxKind.FirstAssignment && n2.operatorToken.kind <= ts20.SyntaxKind.LastAssignment) assignedNames(n2.left);
23593
- else if ((ts20.isPrefixUnaryExpression(n2) || ts20.isPostfixUnaryExpression(n2)) && (n2.operator === ts20.SyntaxKind.PlusPlusToken || n2.operator === ts20.SyntaxKind.MinusMinusToken)) assignedNames(n2.operand);
23594
- else if ((ts20.isForOfStatement(n2) || ts20.isForInStatement(n2)) && !ts20.isVariableDeclarationList(n2.initializer)) assignedNames(n2.initializer);
23595
- ts20.forEachChild(n2, assignments);
23632
+ if (ts21.isBinaryExpression(n2) && n2.operatorToken.kind >= ts21.SyntaxKind.FirstAssignment && n2.operatorToken.kind <= ts21.SyntaxKind.LastAssignment) assignedNames(n2.left);
23633
+ else if ((ts21.isPrefixUnaryExpression(n2) || ts21.isPostfixUnaryExpression(n2)) && (n2.operator === ts21.SyntaxKind.PlusPlusToken || n2.operator === ts21.SyntaxKind.MinusMinusToken)) assignedNames(n2.operand);
23634
+ else if ((ts21.isForOfStatement(n2) || ts21.isForInStatement(n2)) && !ts21.isVariableDeclarationList(n2.initializer)) assignedNames(n2.initializer);
23635
+ ts21.forEachChild(n2, assignments);
23596
23636
  };
23597
23637
  assignments(file2);
23598
23638
  const plain2 = (fn2) => {
23599
- const modifiers = ts20.canHaveModifiers(fn2) ? ts20.getModifiers(fn2) ?? [] : [];
23600
- return !fn2.asteriskToken && !modifiers.some((m2) => m2.kind === ts20.SyntaxKind.AsyncKeyword);
23639
+ const modifiers = ts21.canHaveModifiers(fn2) ? ts21.getModifiers(fn2) ?? [] : [];
23640
+ return !fn2.asteriskToken && !modifiers.some((m2) => m2.kind === ts21.SyntaxKind.AsyncKeyword);
23601
23641
  };
23602
23642
  const plainParams = (fn2) => {
23603
23643
  const names2 = /* @__PURE__ */ new Set();
23604
23644
  for (const p2 of fn2.parameters) {
23605
- if (!ts20.isIdentifier(p2.name) || p2.initializer || p2.dotDotDotToken) return void 0;
23645
+ if (!ts21.isIdentifier(p2.name) || p2.initializer || p2.dotDotDotToken) return void 0;
23606
23646
  names2.add(p2.name.text);
23607
23647
  }
23608
23648
  return names2;
23609
23649
  };
23610
23650
  const provenSafe = (expr, params) => {
23611
- while (ts20.isParenthesizedExpression(expr)) expr = expr.expression;
23612
- if (ts20.isStringLiteral(expr) || ts20.isNoSubstitutionTemplateLiteral(expr) || ts20.isNumericLiteral(expr)) return true;
23613
- if (expr.kind === ts20.SyntaxKind.TrueKeyword || expr.kind === ts20.SyntaxKind.FalseKeyword || expr.kind === ts20.SyntaxKind.NullKeyword) return true;
23614
- if (ts20.isIdentifier(expr)) return params.has(expr.text);
23615
- if (ts20.isArrayLiteralExpression(expr)) {
23616
- return expr.elements.every((e2) => !ts20.isSpreadElement(e2) && !ts20.isOmittedExpression(e2) && provenSafe(e2, params));
23617
- }
23618
- if (ts20.isObjectLiteralExpression(expr)) return expr.properties.every((p2) => safeProperty(p2, params));
23651
+ while (ts21.isParenthesizedExpression(expr)) expr = expr.expression;
23652
+ if (ts21.isStringLiteral(expr) || ts21.isNoSubstitutionTemplateLiteral(expr) || ts21.isNumericLiteral(expr)) return true;
23653
+ if (expr.kind === ts21.SyntaxKind.TrueKeyword || expr.kind === ts21.SyntaxKind.FalseKeyword || expr.kind === ts21.SyntaxKind.NullKeyword) return true;
23654
+ if (ts21.isIdentifier(expr)) return params.has(expr.text);
23655
+ if (ts21.isArrayLiteralExpression(expr)) {
23656
+ return expr.elements.every((e2) => !ts21.isSpreadElement(e2) && !ts21.isOmittedExpression(e2) && provenSafe(e2, params));
23657
+ }
23658
+ if (ts21.isObjectLiteralExpression(expr)) return expr.properties.every((p2) => safeProperty(p2, params));
23619
23659
  return false;
23620
23660
  };
23621
23661
  const safeProperty = (p2, params) => {
23622
- if (ts20.isSpreadAssignment(p2)) return provenSafe(p2.expression, params);
23623
- if (ts20.isPropertyAssignment(p2)) return !ts20.isComputedPropertyName(p2.name) && provenSafe(p2.initializer, params);
23624
- if (ts20.isShorthandPropertyAssignment(p2)) return params.has(p2.name.text) && !p2.objectAssignmentInitializer;
23662
+ if (ts21.isSpreadAssignment(p2)) return provenSafe(p2.expression, params);
23663
+ if (ts21.isPropertyAssignment(p2)) return !ts21.isComputedPropertyName(p2.name) && provenSafe(p2.initializer, params);
23664
+ if (ts21.isShorthandPropertyAssignment(p2)) return params.has(p2.name.text) && !p2.objectAssignmentInitializer;
23625
23665
  return false;
23626
23666
  };
23627
23667
  const isNavigateHelper = (callee) => {
23628
- if (!ts20.isIdentifier(callee) || !/^navigate[0-9]*$/.test(callee.text) || assigned.has(callee.text)) return false;
23668
+ if (!ts21.isIdentifier(callee) || !/^navigate[0-9]*$/.test(callee.text) || assigned.has(callee.text)) return false;
23629
23669
  const symbol = symbols.get(callee.text);
23630
23670
  const helper = symbol?.count === 1 ? symbol.fn : void 0;
23631
23671
  if (!helper?.body || !plain2(helper) || helper.parameters.length !== 2 || !plainParams(helper)) return false;
23632
23672
  const [stateParam, navParam] = helper.parameters.map((p2) => name(p2.name));
23633
- const body = ts20.isBlock(helper.body) ? helper.body.statements.length === 1 && ts20.isReturnStatement(helper.body.statements[0]) ? helper.body.statements[0].expression : void 0 : helper.body;
23673
+ const body = ts21.isBlock(helper.body) ? helper.body.statements.length === 1 && ts21.isReturnStatement(helper.body.statements[0]) ? helper.body.statements[0].expression : void 0 : helper.body;
23634
23674
  const o2 = object15(body);
23635
23675
  if (!o2 || o2.properties.length !== 2 || !stateParam || !navParam) return false;
23636
23676
  const [spread, nav] = o2.properties;
23637
- return ts20.isSpreadAssignment(spread) && ts20.isIdentifier(spread.expression) && spread.expression.text === stateParam && ts20.isPropertyAssignment(nav) && name(nav.name) === "_nav" && ts20.isIdentifier(nav.initializer) && nav.initializer.text === navParam;
23677
+ return ts21.isSpreadAssignment(spread) && ts21.isIdentifier(spread.expression) && spread.expression.text === stateParam && ts21.isPropertyAssignment(nav) && name(nav.name) === "_nav" && ts21.isIdentifier(nav.initializer) && nav.initializer.text === navParam;
23638
23678
  };
23639
23679
  const fixedOf = (fn2) => {
23640
23680
  const params = plainParams(fn2);
23641
23681
  if (!fn2.body || !plain2(fn2) || !params) return void 0;
23642
23682
  let result = void 0;
23643
- if (ts20.isBlock(fn2.body)) {
23683
+ if (ts21.isBlock(fn2.body)) {
23644
23684
  const [only, ...rest] = fn2.body.statements;
23645
- if (!only || rest.length > 0 || !ts20.isReturnStatement(only)) return void 0;
23685
+ if (!only || rest.length > 0 || !ts21.isReturnStatement(only)) return void 0;
23646
23686
  result = only.expression;
23647
23687
  } else result = fn2.body;
23648
- while (result && ts20.isParenthesizedExpression(result)) result = result.expression;
23688
+ while (result && ts21.isParenthesizedExpression(result)) result = result.expression;
23649
23689
  let navNode;
23650
- if (result && ts20.isObjectLiteralExpression(result)) {
23690
+ if (result && ts21.isObjectLiteralExpression(result)) {
23651
23691
  const props2 = result.properties;
23652
23692
  const lastProp = props2[props2.length - 1];
23653
- if (!lastProp || !ts20.isPropertyAssignment(lastProp) || ts20.isComputedPropertyName(lastProp.name) || name(lastProp.name) !== "_nav") return void 0;
23693
+ if (!lastProp || !ts21.isPropertyAssignment(lastProp) || ts21.isComputedPropertyName(lastProp.name) || name(lastProp.name) !== "_nav") return void 0;
23654
23694
  if (!props2.slice(0, -1).every((p2) => safeProperty(p2, params))) return void 0;
23655
23695
  navNode = lastProp.initializer;
23656
- } else if (result && ts20.isCallExpression(result) && result.arguments.length === 2 && isNavigateHelper(result.expression)) {
23696
+ } else if (result && ts21.isCallExpression(result) && result.arguments.length === 2 && isNavigateHelper(result.expression)) {
23657
23697
  if (!provenSafe(result.arguments[0], params)) return void 0;
23658
23698
  navNode = result.arguments[1];
23659
23699
  }
@@ -23663,58 +23703,58 @@ function literalTargets(bundleJs, ts20) {
23663
23703
  return { nav, line: position.line + 1, column: position.character };
23664
23704
  };
23665
23705
  const visit = (node3) => {
23666
- if (ts20.isCallExpression(node3)) {
23667
- const callee = ts20.isPropertyAccessExpression(node3.expression) ? node3.expression.name.text : name(node3.expression);
23706
+ if (ts21.isCallExpression(node3)) {
23707
+ const callee = ts21.isPropertyAccessExpression(node3.expression) ? node3.expression.name.text : name(node3.expression);
23668
23708
  const service = node3.arguments[0];
23669
- if (callee && /^defineService[0-9]*$/.test(callee) && service && ts20.isStringLiteralLike(service)) {
23709
+ if (callee && /^defineService[0-9]*$/.test(callee) && service && ts21.isStringLiteralLike(service)) {
23670
23710
  const actions = object15(initializer(property2(object15(node3.arguments[1]), "actions")));
23671
23711
  for (const member of actions?.properties ?? []) {
23672
23712
  const action = name(member.name);
23673
- const fn2 = ts20.isMethodDeclaration(member) ? member : resolve98(ts20.isShorthandPropertyAssignment(member) ? member.name : initializer(member));
23713
+ const fn2 = ts21.isMethodDeclaration(member) ? member : resolve98(ts21.isShorthandPropertyAssignment(member) ? member.name : initializer(member));
23674
23714
  if (!action || !fn2?.body) continue;
23675
23715
  const targets = [];
23676
23716
  const target = (expr) => {
23677
23717
  const sid = initializer(property2(object15(expr), "screenId"));
23678
- if (!sid || !ts20.isStringLiteralLike(sid)) return;
23718
+ if (!sid || !ts21.isStringLiteralLike(sid)) return;
23679
23719
  const position = file2.getLineAndCharacterOfPosition(sid.getStart(file2));
23680
23720
  targets.push({ screenId: sid.text, line: position.line + 1, column: position.character });
23681
23721
  };
23682
23722
  const returned = (expr) => {
23683
23723
  if (!expr) return;
23684
- if (ts20.isParenthesizedExpression(expr) || ts20.isAwaitExpression(expr)) {
23724
+ if (ts21.isParenthesizedExpression(expr) || ts21.isAwaitExpression(expr)) {
23685
23725
  returned(expr.expression);
23686
23726
  return;
23687
23727
  }
23688
- if (ts20.isConditionalExpression(expr)) {
23728
+ if (ts21.isConditionalExpression(expr)) {
23689
23729
  returned(expr.whenTrue);
23690
23730
  returned(expr.whenFalse);
23691
23731
  return;
23692
23732
  }
23693
- if (ts20.isObjectLiteralExpression(expr)) {
23733
+ if (ts21.isObjectLiteralExpression(expr)) {
23694
23734
  target(initializer(property2(expr, "_nav")));
23695
23735
  return;
23696
23736
  }
23697
- if (ts20.isCallExpression(expr)) {
23698
- const called = ts20.isPropertyAccessExpression(expr.expression) ? expr.expression.name.text : name(expr.expression);
23737
+ if (ts21.isCallExpression(expr)) {
23738
+ const called = ts21.isPropertyAccessExpression(expr.expression) ? expr.expression.name.text : name(expr.expression);
23699
23739
  if (called && /^navigate[0-9]*$/.test(called)) target(expr.arguments[1]);
23700
23740
  }
23701
23741
  };
23702
- if (ts20.isBlock(fn2.body)) {
23742
+ if (ts21.isBlock(fn2.body)) {
23703
23743
  const returns = (part4) => {
23704
23744
  if (callable(part4)) return;
23705
- if (ts20.isReturnStatement(part4)) returned(part4.expression);
23706
- else ts20.forEachChild(part4, returns);
23745
+ if (ts21.isReturnStatement(part4)) returned(part4.expression);
23746
+ else ts21.forEachChild(part4, returns);
23707
23747
  };
23708
23748
  returns(fn2.body);
23709
23749
  } else returned(fn2.body);
23710
23750
  results.set("tier5." + service.text + "." + action, targets);
23711
- const ref = ts20.isShorthandPropertyAssignment(member) ? member.name : initializer(member);
23712
- const always = ref && ts20.isIdentifier(ref) && assigned.has(ref.text) ? void 0 : fixedOf(fn2);
23751
+ const ref = ts21.isShorthandPropertyAssignment(member) ? member.name : initializer(member);
23752
+ const always = ref && ts21.isIdentifier(ref) && assigned.has(ref.text) ? void 0 : fixedOf(fn2);
23713
23753
  if (always) fixed.set("tier5." + service.text + "." + action, always);
23714
23754
  }
23715
23755
  }
23716
23756
  }
23717
- ts20.forEachChild(node3, visit);
23757
+ ts21.forEachChild(node3, visit);
23718
23758
  };
23719
23759
  visit(file2);
23720
23760
  cache.set(bundleJs, results);
@@ -23986,11 +24026,11 @@ function appIconBadgeSourcesErrors(value2) {
23986
24026
  function validateOverlayPatch(patch) {
23987
24027
  const errs = [];
23988
24028
  if (!patch || typeof patch !== "object" || Array.isArray(patch)) return ["overlay must be a JSON object"];
23989
- const obj12 = patch;
23990
- for (const k2 of Object.keys(obj12)) {
24029
+ const obj13 = patch;
24030
+ for (const k2 of Object.keys(obj13)) {
23991
24031
  if (STRUCTURAL_KEYS.has(k2)) errs.push(`"${k2}" is structural \u2014 edit it in source (deriveNavigationConfig), not the overlay`);
23992
24032
  else if (!OPERATIONAL_OVERLAY_KEYS.has(k2)) errs.push(`"${k2}" is not an allowed operational overlay key`);
23993
- else if (k2 === "appIconBadgeSources") errs.push(...appIconBadgeSourcesErrors(obj12[k2]));
24033
+ else if (k2 === "appIconBadgeSources") errs.push(...appIconBadgeSourcesErrors(obj13[k2]));
23994
24034
  }
23995
24035
  return errs;
23996
24036
  }
@@ -24181,6 +24221,7 @@ __export(validate_descriptor_exports, {
24181
24221
  navLogicBundleUrl: () => navLogicBundleUrl,
24182
24222
  nodeVmEvaluator: () => nodeVmEvaluator,
24183
24223
  nondeterministicServices: () => nondeterministicServices,
24224
+ nondeterministicServicesOrNull: () => nondeterministicServicesOrNull,
24184
24225
  pathCrossesOpaqueAuthorJson: () => pathCrossesOpaqueAuthorJson,
24185
24226
  pathValue: () => pathValue,
24186
24227
  pinnedIntrinsicsSource: () => pinnedIntrinsicsSource,
@@ -24203,6 +24244,7 @@ __export(validate_descriptor_exports, {
24203
24244
  validateScreenDescriptor: () => validateScreenDescriptor,
24204
24245
  validateTabBarVisibility: () => validateTabBarVisibility,
24205
24246
  webViewEmbeddedIssues: () => webViewEmbeddedIssues,
24247
+ withoutBootState: () => withoutBootState,
24206
24248
  workerSubtreeAllowed: () => workerSubtreeAllowed
24207
24249
  });
24208
24250
  import { readFileSync as readFileSync21, existsSync as existsSync19, readdirSync as readdirSync14 } from "node:fs";
@@ -24226,11 +24268,6 @@ function readBuiltBundle(tier5Root, bundleName) {
24226
24268
  const p2 = resolve20(tier5Root, `${bundleName}.bundle.js`);
24227
24269
  return existsSync19(p2) ? readFileSync21(p2, "utf8") : void 0;
24228
24270
  }
24229
- function bundleNameFromUrl(url) {
24230
- if (typeof url !== "string") return null;
24231
- const m2 = /\/v1\/bundles\/([a-z0-9_-]+)/i.exec(url);
24232
- return m2 ? m2[1] : null;
24233
- }
24234
24271
  function navLogicBundleUrl(config) {
24235
24272
  const cfg = config;
24236
24273
  const url = cfg?.app?.logicBundle?.url ?? cfg?.navigation?.navLogicBundle?.url ?? cfg?.navLogicBundle?.url;
@@ -25469,10 +25506,10 @@ function inferScreenDisplayName(screenId) {
25469
25506
  return `${words || screenId}${opaque2 ? ` (${opaque2[1]})` : ""}`;
25470
25507
  }
25471
25508
  function screenDisplayName(screenId, displayName3, title, navigationLabel) {
25472
- const literal = (value2) => typeof value2 === "string" && !!value2.trim() && !value2.trim().startsWith("$") && !/^__[A-Z0-9_]+__$/.test(value2.trim());
25473
- if (literal(displayName3)) return displayName3.trim();
25474
- if (literal(title) && title.trim() !== screenId) return title.trim();
25475
- if (literal(navigationLabel)) return navigationLabel.trim();
25509
+ const literal2 = (value2) => typeof value2 === "string" && !!value2.trim() && !value2.trim().startsWith("$") && !/^__[A-Z0-9_]+__$/.test(value2.trim());
25510
+ if (literal2(displayName3)) return displayName3.trim();
25511
+ if (literal2(title) && title.trim() !== screenId) return title.trim();
25512
+ if (literal2(navigationLabel)) return navigationLabel.trim();
25476
25513
  return inferScreenDisplayName(screenId);
25477
25514
  }
25478
25515
  var ScreenViewValidationError, ID, object;
@@ -27790,14 +27827,14 @@ function pickLocale(acceptLanguage) {
27790
27827
  function translate(node3, tag) {
27791
27828
  const map2 = loadCatalog(tag);
27792
27829
  if (map2.size === 0) return node3;
27793
- function visit(n2, atRoot = false) {
27830
+ function visit(n2, atRoot = false, inLogicBundle = false) {
27794
27831
  if (Array.isArray(n2)) {
27795
27832
  for (const c2 of n2) visit(c2);
27796
27833
  return;
27797
27834
  }
27798
27835
  if (typeof n2 !== "object" || n2 === null) return;
27799
- const obj12 = n2;
27800
- const body = obj12.body;
27836
+ const obj13 = n2;
27837
+ const body = obj13.body;
27801
27838
  if (body && typeof body.type === "string" && body.props) {
27802
27839
  const fields = STRING_FIELDS_BY_TYPE[body.type] ?? [];
27803
27840
  for (const f2 of fields) {
@@ -27821,13 +27858,14 @@ function translate(node3, tag) {
27821
27858
  if (t2) templ.template = t2;
27822
27859
  }
27823
27860
  }
27824
- for (const [k2, v2] of Object.entries(obj12)) {
27861
+ for (const [k2, v2] of Object.entries(obj13)) {
27825
27862
  if (atRoot && k2 === "input" && v2 !== null && typeof v2 === "object") continue;
27863
+ if (inLogicBundle && k2 === "bootState") continue;
27826
27864
  if (typeof v2 === "string" && SECONDARY_FIELDS.has(k2)) {
27827
27865
  const t2 = map2.get(v2);
27828
- if (t2) obj12[k2] = t2;
27866
+ if (t2) obj13[k2] = t2;
27829
27867
  } else {
27830
- visit(v2);
27868
+ visit(v2, false, atRoot && k2 === "logicBundle");
27831
27869
  }
27832
27870
  }
27833
27871
  }
@@ -29891,15 +29929,15 @@ function authored(overlays, name) {
29891
29929
  function selectIdiomOverlay(doc, ctx = {}) {
29892
29930
  const policy = doc.idiomPolicy;
29893
29931
  const overlays = doc.idiom;
29894
- const isRecord4 = (v2) => !!v2 && typeof v2 === "object" && !Array.isArray(v2);
29895
- if (!isRecord4(policy) || !isRecord4(overlays)) return void 0;
29932
+ const isRecord5 = (v2) => !!v2 && typeof v2 === "object" && !Array.isArray(v2);
29933
+ if (!isRecord5(policy) || !isRecord5(overlays)) return void 0;
29896
29934
  const kind = policy.policy ?? "follow-surface";
29897
29935
  if (kind === "none") return void 0;
29898
29936
  if (kind === "pinned") return authored(overlays, policy.pin) ? policy.pin : void 0;
29899
29937
  if (kind !== "follow-surface") return void 0;
29900
29938
  const surfaces = policy.surfaces;
29901
29939
  const candidates = [
29902
- ctx.surface !== void 0 && isRecord4(surfaces) && Object.hasOwn(surfaces, ctx.surface) ? surfaces[ctx.surface] : void 0,
29940
+ ctx.surface !== void 0 && isRecord5(surfaces) && Object.hasOwn(surfaces, ctx.surface) ? surfaces[ctx.surface] : void 0,
29903
29941
  ...ctx.native ?? [],
29904
29942
  policy.fallback
29905
29943
  ];
@@ -35680,8 +35718,8 @@ async function readBody(req) {
35680
35718
  for await (const c2 of req) chunks.push(c2);
35681
35719
  return Buffer.concat(chunks).toString("utf-8");
35682
35720
  }
35683
- function json(res, status, obj12) {
35684
- const body = JSON.stringify(obj12);
35721
+ function json(res, status, obj13) {
35722
+ const body = JSON.stringify(obj13);
35685
35723
  res.statusCode = status;
35686
35724
  res.setHeader("content-type", "application/json; charset=utf-8");
35687
35725
  res.end(body);
@@ -37879,14 +37917,14 @@ function validateParams(schema2, params) {
37879
37917
  if (!schema2 || !schema2.type && !schema2.properties && !schema2.required && !schema2.enum) {
37880
37918
  return issues;
37881
37919
  }
37882
- const obj12 = params ?? {};
37920
+ const obj13 = params ?? {};
37883
37921
  for (const key3 of schema2.required ?? []) {
37884
- if (obj12[key3] === void 0 || obj12[key3] === null) {
37922
+ if (obj13[key3] === void 0 || obj13[key3] === null) {
37885
37923
  issues.push({ path: key3, message: `required field "${key3}" is missing` });
37886
37924
  }
37887
37925
  }
37888
37926
  for (const [key3, sub] of Object.entries(schema2.properties ?? {})) {
37889
- const val = obj12[key3];
37927
+ const val = obj13[key3];
37890
37928
  if (val === void 0 || val === null) continue;
37891
37929
  if (sub.type && typeOf3(val) !== sub.type) {
37892
37930
  issues.push({ path: key3, message: `"${key3}" must be ${sub.type}, got ${typeOf3(val)}` });
@@ -42372,7 +42410,7 @@ var init_controls = __esm({
42372
42410
  e2.preventDefault();
42373
42411
  commit(nv);
42374
42412
  };
42375
- const valueAt2 = (e2) => {
42413
+ const valueAt3 = (e2) => {
42376
42414
  const r3 = e2.currentTarget.getBoundingClientRect();
42377
42415
  if (!(r3.width > 0)) return void 0;
42378
42416
  const f2 = Math.max(0, Math.min(1, (e2.clientX - r3.left) / r3.width));
@@ -42382,7 +42420,7 @@ var init_controls = __esm({
42382
42420
  };
42383
42421
  const onPointerDown = (e2) => {
42384
42422
  if (props2.disabled) return;
42385
- const nv = valueAt2(e2);
42423
+ const nv = valueAt3(e2);
42386
42424
  if (nv === void 0) return;
42387
42425
  dragging.current = true;
42388
42426
  e2.currentTarget.setPointerCapture?.(e2.pointerId);
@@ -42391,7 +42429,7 @@ var init_controls = __esm({
42391
42429
  };
42392
42430
  const onPointerMove = (e2) => {
42393
42431
  if (!dragging.current) return;
42394
- const nv = valueAt2(e2);
42432
+ const nv = valueAt3(e2);
42395
42433
  if (nv === void 0) return;
42396
42434
  latestValue.current = nv;
42397
42435
  setVal(nv);
@@ -42406,7 +42444,7 @@ var init_controls = __esm({
42406
42444
  if (!dragging.current) return;
42407
42445
  dragging.current = false;
42408
42446
  lastEmit.current = void 0;
42409
- commit(valueAt2(e2) ?? latestValue.current);
42447
+ commit(valueAt3(e2) ?? latestValue.current);
42410
42448
  };
42411
42449
  const endDragWithoutRelease = () => {
42412
42450
  if (!dragging.current) return;
@@ -44096,7 +44134,7 @@ function pdfObjectSyntax(text15) {
44096
44134
  return out2.join("");
44097
44135
  }
44098
44136
  function pdfRootPageCount(syntax) {
44099
- const obj12 = (n3, g2) => {
44137
+ const obj13 = (n3, g2) => {
44100
44138
  const all = [...syntax.matchAll(new RegExp(`(?:^|[^0-9])${n3}\\s+${g2}\\s+obj\\b`, "g"))];
44101
44139
  const at2 = all[all.length - 1];
44102
44140
  if (!at2) return null;
@@ -44106,10 +44144,10 @@ function pdfRootPageCount(syntax) {
44106
44144
  const trailers = [...syntax.matchAll(/trailer\s*<<([\s\S]*?)>>/g)];
44107
44145
  const root = trailers.length ? /\/Root\s+(\d+)\s+(\d+)\s+R/.exec(trailers[trailers.length - 1][1]) : null;
44108
44146
  if (!root) return null;
44109
- const catalog4 = obj12(root[1], root[2]);
44147
+ const catalog4 = obj13(root[1], root[2]);
44110
44148
  const pagesRef = catalog4 ? /\/Pages\s+(\d+)\s+(\d+)\s+R/.exec(catalog4) : null;
44111
44149
  if (!pagesRef) return null;
44112
- const pages2 = obj12(pagesRef[1], pagesRef[2]);
44150
+ const pages2 = obj13(pagesRef[1], pagesRef[2]);
44113
44151
  const c2 = pages2 ? /\/Count\s+(\d+)/.exec(pages2) : null;
44114
44152
  const n2 = c2 ? Number(c2[1]) : NaN;
44115
44153
  return Number.isFinite(n2) && n2 > 0 ? n2 : null;
@@ -44803,8 +44841,8 @@ function updateUrlHash(url, hash3, allowRel = false) {
44803
44841
  function stripPath(str13) {
44804
44842
  return str13.substring(str13.lastIndexOf("/") + 1);
44805
44843
  }
44806
- function shadow(obj12, prop2, value2, nonSerializable2 = false) {
44807
- Object.defineProperty(obj12, prop2, {
44844
+ function shadow(obj13, prop2, value2, nonSerializable2 = false) {
44845
+ Object.defineProperty(obj13, prop2, {
44808
44846
  value: value2,
44809
44847
  enumerable: !nonSerializable2,
44810
44848
  configurable: true,
@@ -45319,9 +45357,9 @@ function makePathFromDrawOPS(data) {
45319
45357
  }
45320
45358
  return path2;
45321
45359
  }
45322
- function bindEvents(obj12, element, names2) {
45360
+ function bindEvents(obj13, element, names2) {
45323
45361
  for (const name of names2) {
45324
- element.addEventListener(name, obj12[name].bind(obj12));
45362
+ element.addEventListener(name, obj13[name].bind(obj13));
45325
45363
  }
45326
45364
  }
45327
45365
  function preventDefault(evt) {
@@ -47222,10 +47260,10 @@ var init_pdf = __esm({
47222
47260
  },
47223
47261
  /***/
47224
47262
  1767(module) {
47225
- module.exports = function(obj12) {
47263
+ module.exports = function(obj13) {
47226
47264
  return {
47227
- iterator: obj12,
47228
- next: obj12.next,
47265
+ iterator: obj13,
47266
+ next: obj13.next,
47229
47267
  done: false
47230
47268
  };
47231
47269
  };
@@ -47236,10 +47274,10 @@ var init_pdf = __esm({
47236
47274
  var anObject = __webpack_require__3(8551);
47237
47275
  var getIteratorDirect = __webpack_require__3(1767);
47238
47276
  var getIteratorMethod = __webpack_require__3(3085);
47239
- module.exports = function(obj12, stringHandling) {
47240
- if (!stringHandling || typeof obj12 !== "string") anObject(obj12);
47241
- var method = getIteratorMethod(obj12);
47242
- return getIteratorDirect(anObject(method !== void 0 ? call(method, obj12) : obj12));
47277
+ module.exports = function(obj13, stringHandling) {
47278
+ if (!stringHandling || typeof obj13 !== "string") anObject(obj13);
47279
+ var method = getIteratorMethod(obj13);
47280
+ return getIteratorDirect(anObject(method !== void 0 ? call(method, obj13) : obj13));
47243
47281
  };
47244
47282
  },
47245
47283
  /***/
@@ -47302,13 +47340,13 @@ var init_pdf = __esm({
47302
47340
  return call(this.has, this.set, it2);
47303
47341
  }
47304
47342
  };
47305
- module.exports = function(obj12) {
47306
- anObject(obj12);
47307
- var numSize = +obj12.size;
47343
+ module.exports = function(obj13) {
47344
+ anObject(obj13);
47345
+ var numSize = +obj13.size;
47308
47346
  if (numSize !== numSize) throw new $TypeError(INVALID_SIZE);
47309
47347
  var intSize = toIntegerOrInfinity(numSize);
47310
47348
  if (intSize < 0) throw new $RangeError(INVALID_SIZE);
47311
- return new SetRecord(obj12, intSize);
47349
+ return new SetRecord(obj13, intSize);
47312
47350
  };
47313
47351
  },
47314
47352
  /***/
@@ -47855,8 +47893,8 @@ var init_pdf = __esm({
47855
47893
  /***/
47856
47894
  6198(module, __unused_webpack_exports, __webpack_require__3) {
47857
47895
  var toLength = __webpack_require__3(8014);
47858
- module.exports = function(obj12) {
47859
- return toLength(obj12.length);
47896
+ module.exports = function(obj13) {
47897
+ return toLength(obj13.length);
47860
47898
  };
47861
47899
  },
47862
47900
  /***/
@@ -50661,7 +50699,7 @@ var init_pdf = __esm({
50661
50699
  };
50662
50700
  })();
50663
50701
  (() => {
50664
- __webpack_require__.o = (obj12, prop2) => Object.prototype.hasOwnProperty.call(obj12, prop2);
50702
+ __webpack_require__.o = (obj13, prop2) => Object.prototype.hasOwnProperty.call(obj13, prop2);
50665
50703
  })();
50666
50704
  es_array_includes = __webpack_require__(4423);
50667
50705
  es_array_push = __webpack_require__(4114);
@@ -56856,13 +56894,13 @@ var init_pdf = __esm({
56856
56894
  this.onAnnotationEditor?.(null);
56857
56895
  }
56858
56896
  setValue(key3, value2) {
56859
- const obj12 = this.#storage.get(key3);
56897
+ const obj13 = this.#storage.get(key3);
56860
56898
  let modified = false;
56861
- if (obj12 !== void 0) {
56899
+ if (obj13 !== void 0) {
56862
56900
  for (const [entry, val] of Object.entries(value2)) {
56863
- if (obj12[entry] !== val) {
56901
+ if (obj13[entry] !== val) {
56864
56902
  modified = true;
56865
- obj12[entry] = val;
56903
+ obj13[entry] = val;
56866
56904
  }
56867
56905
  }
56868
56906
  } else {
@@ -58521,9 +58559,9 @@ var init_pdf = __esm({
58521
58559
  LoopbackPort = class {
58522
58560
  #listeners = /* @__PURE__ */ new Map();
58523
58561
  #deferred = Promise.resolve();
58524
- postMessage(obj12, transfer) {
58562
+ postMessage(obj13, transfer) {
58525
58563
  const event = {
58526
- data: structuredClone(obj12, transfer ? {
58564
+ data: structuredClone(obj13, transfer ? {
58527
58565
  transfer
58528
58566
  } : null)
58529
58567
  };
@@ -60422,13 +60460,13 @@ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
60422
60460
  this.#knockoutElementDepth = 0;
60423
60461
  this.#knockoutGroupLevel = 0;
60424
60462
  this.cachedPatterns.clear();
60425
- for (const cache2 of this._cachedBitmapsMap.values()) {
60426
- for (const canvas of cache2.values()) {
60463
+ for (const cache3 of this._cachedBitmapsMap.values()) {
60464
+ for (const canvas of cache3.values()) {
60427
60465
  if (typeof HTMLCanvasElement !== "undefined" && canvas instanceof HTMLCanvasElement) {
60428
60466
  canvas.width = canvas.height = 0;
60429
60467
  }
60430
60468
  }
60431
- cache2.clear();
60469
+ cache3.clear();
60432
60470
  }
60433
60471
  this._cachedBitmapsMap.clear();
60434
60472
  this.#drawFilter();
@@ -60522,12 +60560,12 @@ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
60522
60560
  const fillColor = this.current.fillColor;
60523
60561
  const isPatternFill = this.current.patternFill;
60524
60562
  const currentTransform = getCurrentTransform(ctx);
60525
- let cache2, cacheKey, scaled, maskCanvas;
60563
+ let cache3, cacheKey, scaled, maskCanvas;
60526
60564
  if ((img.bitmap || img.data) && img.count > 1) {
60527
60565
  const mainKey = img.bitmap || img.data.buffer;
60528
60566
  cacheKey = JSON.stringify(isPatternFill ? currentTransform : [currentTransform.slice(0, 4), fillColor]);
60529
- cache2 = this._cachedBitmapsMap.getOrInsertComputed(mainKey, makeMap);
60530
- const cachedImage = cache2.get(cacheKey);
60567
+ cache3 = this._cachedBitmapsMap.getOrInsertComputed(mainKey, makeMap);
60568
+ const cachedImage = cache3.get(cacheKey);
60531
60569
  if (cachedImage && !isPatternFill) {
60532
60570
  const offsetX2 = Math.round(Math.min(currentTransform[0], currentTransform[2]) + currentTransform[4]);
60533
60571
  const offsetY2 = Math.round(Math.min(currentTransform[1], currentTransform[3]) + currentTransform[5]);
@@ -60566,8 +60604,8 @@ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
60566
60604
  this.canvasFactory.destroy(maskCanvas);
60567
60605
  maskCanvas = null;
60568
60606
  }
60569
- if (cache2 && isPatternFill) {
60570
- cache2.set(cacheKey, scaled);
60607
+ if (cache3 && isPatternFill) {
60608
+ cache3.set(cacheKey, scaled);
60571
60609
  scaledEntry = null;
60572
60610
  maskCanvas = null;
60573
60611
  }
@@ -60584,13 +60622,13 @@ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
60584
60622
  const inverse = Util.transform(getCurrentTransformInverse(fillCtx), [1, 0, 0, 1, -offsetX, -offsetY]);
60585
60623
  fillCtx.fillStyle = isPatternFill ? fillColor.getPattern(ctx, this, inverse, PathType.FILL, opIdx) : fillColor;
60586
60624
  fillCtx.fillRect(0, 0, width, height);
60587
- if (cache2 && !isPatternFill) {
60588
- cache2.set(cacheKey, fillCanvas.canvas);
60625
+ if (cache3 && !isPatternFill) {
60626
+ cache3.set(cacheKey, fillCanvas.canvas);
60589
60627
  }
60590
60628
  this.dependencyTracker?.recordDependencies(opIdx, Dependencies.transformAndFill);
60591
60629
  return {
60592
60630
  canvas: fillCanvas.canvas,
60593
- canvasEntry: cache2 && !isPatternFill ? null : fillCanvas,
60631
+ canvasEntry: cache3 && !isPatternFill ? null : fillCanvas,
60594
60632
  offsetX: Math.round(offsetX),
60595
60633
  offsetY: Math.round(offsetY)
60596
60634
  };
@@ -63999,35 +64037,35 @@ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
63999
64037
  #objs = /* @__PURE__ */ new Map();
64000
64038
  get(objId, callback = null) {
64001
64039
  if (callback) {
64002
- const obj13 = this.#objs.getOrInsertComputed(objId, dataObj);
64003
- obj13.promise.then(() => callback(obj13.data));
64040
+ const obj14 = this.#objs.getOrInsertComputed(objId, dataObj);
64041
+ obj14.promise.then(() => callback(obj14.data));
64004
64042
  return null;
64005
64043
  }
64006
- const obj12 = this.#objs.get(objId);
64007
- if (!obj12 || obj12.data === INITIAL_DATA) {
64044
+ const obj13 = this.#objs.get(objId);
64045
+ if (!obj13 || obj13.data === INITIAL_DATA) {
64008
64046
  throw new Error(`Requesting object that isn't resolved yet ${objId}.`);
64009
64047
  }
64010
- return obj12.data;
64048
+ return obj13.data;
64011
64049
  }
64012
64050
  has(objId) {
64013
- const obj12 = this.#objs.get(objId);
64014
- return !!obj12 && obj12.data !== INITIAL_DATA;
64051
+ const obj13 = this.#objs.get(objId);
64052
+ return !!obj13 && obj13.data !== INITIAL_DATA;
64015
64053
  }
64016
64054
  delete(objId) {
64017
- const obj12 = this.#objs.get(objId);
64018
- if (!obj12 || obj12.data === INITIAL_DATA) {
64055
+ const obj13 = this.#objs.get(objId);
64056
+ if (!obj13 || obj13.data === INITIAL_DATA) {
64019
64057
  return false;
64020
64058
  }
64021
64059
  this.#objs.delete(objId);
64022
64060
  return true;
64023
64061
  }
64024
64062
  resolve(objId, data = null) {
64025
- const obj12 = this.#objs.getOrInsertComputed(objId, dataObj);
64026
- if (obj12.data !== INITIAL_DATA) {
64063
+ const obj13 = this.#objs.getOrInsertComputed(objId, dataObj);
64064
+ if (obj13.data !== INITIAL_DATA) {
64027
64065
  throw new Error(`Object already resolved ${objId}.`);
64028
64066
  }
64029
- obj12.data = data;
64030
- obj12.resolve();
64067
+ obj13.data = data;
64068
+ obj13.resolve();
64031
64069
  }
64032
64070
  clear() {
64033
64071
  for (const {
@@ -126257,6 +126295,9 @@ function hiddenBool(v2) {
126257
126295
  }
126258
126296
  return false;
126259
126297
  }
126298
+ function gateHidden(v2, unresolvedHidden) {
126299
+ return v2 === void 0 || v2 === null ? unresolvedHidden : hiddenBool(v2);
126300
+ }
126260
126301
  function exitSpecFor(modifiers, ctx) {
126261
126302
  const tr2 = modifiers?.transition;
126262
126303
  if (!tr2 || typeof tr2 !== "object") return null;
@@ -127751,10 +127792,11 @@ function renderNodeInner(node3, ctx) {
127751
127792
  }
127752
127793
  }
127753
127794
  const hp = node3?.modifiers?.hiddenPath ?? node3?.modifiers?.hidden_path;
127795
+ const liveGate = typeof hp === "string" && !isEnvExpr(hp) && isBinding(hp) && isStateBinding(hp) && !!ctx.provider;
127754
127796
  {
127755
127797
  const lit = typeof hp === "string" ? hp.trim().toLowerCase() : void 0;
127756
127798
  const litPath = lit === "true" || lit === "1" || lit === "false" || lit === "0";
127757
- const hasLiteral = typeof node3?.modifiers?.hidden === "boolean" || litPath;
127799
+ const hasLiteral = typeof node3?.modifiers?.hidden === "boolean" && !liveGate || litPath;
127758
127800
  const exit = hasLiteral ? exitSpecFor(node3.modifiers, ctx) : null;
127759
127801
  if (exit) {
127760
127802
  const hiddenNow = node3.modifiers.hidden === true || lit === "true" || lit === "1";
@@ -127762,7 +127804,7 @@ function renderNodeInner(node3, ctx) {
127762
127804
  return /* @__PURE__ */ jsx12(ExitPresence, { hidden: hiddenNow, exit, children: renderNode(bare, ctx) });
127763
127805
  }
127764
127806
  }
127765
- if (node3?.modifiers?.hidden === true) return null;
127807
+ if (node3?.modifiers?.hidden === true && !liveGate) return null;
127766
127808
  if (typeof hp === "string" && hp) {
127767
127809
  const low = hp.trim().toLowerCase();
127768
127810
  if (low === "true" || low === "1") return null;
@@ -127779,8 +127821,8 @@ function renderNodeInner(node3, ctx) {
127779
127821
  if (hiddenBool(resolveScalarStatic(hp, ctx))) return null;
127780
127822
  } else if (isStateBinding(hp)) {
127781
127823
  if (ctx.provider) {
127782
- const bare = { ...node3, modifiers: { ...node3.modifiers, hiddenPath: void 0, hidden_path: void 0 } };
127783
- return /* @__PURE__ */ jsx12(HiddenGate, { ctx, binding: hp, exit: exitSpecFor(node3.modifiers, ctx), children: renderNode(bare, ctx) });
127824
+ const bare = { ...node3, modifiers: { ...node3.modifiers, hidden: void 0, hiddenPath: void 0, hidden_path: void 0 } };
127825
+ return /* @__PURE__ */ jsx12(HiddenGate, { ctx, binding: hp, unresolvedHidden: node3.modifiers?.hidden === true, exit: exitSpecFor(node3.modifiers, ctx), children: renderNode(bare, ctx) });
127784
127826
  }
127785
127827
  if (ctx.runtimeDegraded) return null;
127786
127828
  }
@@ -129447,9 +129489,9 @@ var init_renderNode = __esm({
129447
129489
  const rendered = renderNodeInner(node3, ctx);
129448
129490
  return /* @__PURE__ */ jsx12(Fragment4, { children: style ? withRootStyle(rendered, style) : rendered });
129449
129491
  };
129450
- HiddenGate = ({ ctx, binding: binding2, exit, children }) => {
129492
+ HiddenGate = ({ ctx, binding: binding2, unresolvedHidden = false, exit, children }) => {
129451
129493
  const v2 = useBoundValue(ctx, binding2);
129452
- return /* @__PURE__ */ jsx12(ExitPresence, { hidden: hiddenBool(v2), exit: exit ?? null, children });
129494
+ return /* @__PURE__ */ jsx12(ExitPresence, { hidden: gateHidden(v2, unresolvedHidden), exit: exit ?? null, children });
129453
129495
  };
129454
129496
  ExitPresence = ({ hidden, exit, children }) => {
129455
129497
  const [prevHidden, setPrevHidden] = React17.useState(hidden);
@@ -131618,8 +131660,8 @@ var init_renderNode = __esm({
131618
131660
  let countAttrs;
131619
131661
  let countContent;
131620
131662
  if (props2.animateValue === true && !ctx.reduceMotion()) {
131621
- const literal = typeof props2.text === "string" && !isBinding(props2.text) ? props2.text : void 0;
131622
- const parsed = literal != null ? parseCountUp(literal) : null;
131663
+ const literal2 = typeof props2.text === "string" && !isBinding(props2.text) ? props2.text : void 0;
131664
+ const parsed = literal2 != null ? parseCountUp(literal2) : null;
131623
131665
  if (parsed) {
131624
131666
  ensureCountUpRuntime();
131625
131667
  countAttrs = {
@@ -131818,9 +131860,10 @@ var init_renderNode = __esm({
131818
131860
  const contentDescription = useResolvedScalar(props2.contentDescription, ctx);
131819
131861
  const described = contentDescription != null && String(contentDescription).trim() !== "";
131820
131862
  const a11y = described ? { role: "img", "aria-label": String(contentDescription), [SELF_RENDERED_LEAF]: true } : { "aria-hidden": "true", [INFERRED_DECORATIVE]: true, [SELF_RENDERED_LEAF]: true, [ROLE_WHEN_NAMED]: "img" };
131821
- const glyph = iconSvg(iconName, { size, color: C2(resolveScalarStatic(props2.tint, ctx) ?? "textPrimary", "#636b78") });
131822
131863
  const swap = useIconSwap(iconName, ctx);
131823
- const animatedGlyph = Object.keys(effectStyle).length || swap.key > 0 ? React17.cloneElement(glyph, { style: { ...glyph.props.style, ...swap.style, ...effectStyle }, key: swap.key }) : glyph;
131864
+ const unpublished = isBinding(props2.name) && iconName === "";
131865
+ const glyph = iconSvg(iconName, { size, color: C2(resolveScalarStatic(props2.tint, ctx) ?? "textPrimary", "#636b78") });
131866
+ const animatedGlyph = unpublished ? null : Object.keys(effectStyle).length || swap.key > 0 ? React17.cloneElement(glyph, { style: { ...glyph.props.style, ...swap.style, ...effectStyle }, key: swap.key }) : glyph;
131824
131867
  return /* @__PURE__ */ jsx12("span", { ...a11y, style: { display: "inline-grid", placeItems: "center", width: size + 6, height: size + 6, lineHeight: 1, flex: "none", ...wrap }, children: animatedGlyph });
131825
131868
  });
131826
131869
  EMPTY_STATE_SPACING = {
@@ -132859,7 +132902,7 @@ var init_renderNode = __esm({
132859
132902
  const gated2 = props2.presentedPath != null || props2.presented != null;
132860
132903
  const gate = props2.presentedPath != null ? bound2 : props2.presented;
132861
132904
  const gateOpen = gate === true || gate === "true";
132862
- const literal = props2.presentedPath == null && props2.presented != null;
132905
+ const literal2 = props2.presentedPath == null && props2.presented != null;
132863
132906
  const identity = { path: props2.presentedPath, presented: props2.presented, provider: ctx.provider };
132864
132907
  const [local, setLocal] = React17.useState({ ...identity, opened: false, dismissed: false });
132865
132908
  const sameGate = local.path === identity.path && local.presented === identity.presented && local.provider === identity.provider;
@@ -132912,7 +132955,7 @@ var init_renderNode = __esm({
132912
132955
  }, [gated2, shown2, props2.presentedPath, props2.presented, ctx.provider]);
132913
132956
  const floating = gated2 ? { position: "absolute", zIndex: 40, ...overlayEdgeStyle(placed, 6), translate: `${placement.x}px ${placement.y}px` } : {};
132914
132957
  const inline = gated2 ? null : inlineEdgeFlex(resolveOverlayEdge("Popover", props2.edge));
132915
- const openFromAnchor = literal ? () => {
132958
+ const openFromAnchor = literal2 ? () => {
132916
132959
  if (shown2) return;
132917
132960
  setLocal({ ...identity, opened: true, dismissed: false });
132918
132961
  } : void 0;
@@ -132920,9 +132963,9 @@ var init_renderNode = __esm({
132920
132963
  const [needsSeparateOpener, setNeedsSeparateOpener] = React17.useState(false);
132921
132964
  useIsomorphicLayoutEffect(() => {
132922
132965
  const el2 = anchorRef.current;
132923
- const want = literal && el2 != null && !hasTabStop(el2);
132966
+ const want = literal2 && el2 != null && !hasTabStop(el2);
132924
132967
  if (want !== anchorIsButton) setAnchorIsButton(want);
132925
- const needsOpener = literal && el2 != null && Array.from(el2.querySelectorAll(NATIVELY_TABBABLE)).some((control) => control.tabIndex >= 0 && !control.disabled && !control.matches('button,a[href],area[href],summary,input[type="button"],input[type="submit"],input[type="reset"],input[type="checkbox"],input[type="radio"],[role="button"],[role="link"]'));
132968
+ const needsOpener = literal2 && el2 != null && Array.from(el2.querySelectorAll(NATIVELY_TABBABLE)).some((control) => control.tabIndex >= 0 && !control.disabled && !control.matches('button,a[href],area[href],summary,input[type="button"],input[type="submit"],input[type="reset"],input[type="checkbox"],input[type="radio"],[role="button"],[role="link"]'));
132926
132969
  if (needsOpener !== needsSeparateOpener) setNeedsSeparateOpener(needsOpener);
132927
132970
  });
132928
132971
  const anchorButtonProps = anchorIsButton ? {
@@ -133523,8 +133566,8 @@ var init_renderNode = __esm({
133523
133566
  const boundState = useResolvedScalar(props2.statePath, ctx);
133524
133567
  const boundDelivery = useResolvedScalar(props2.deliveryPath, ctx);
133525
133568
  const boundRate = useResolvedScalar(props2.ratePath, ctx);
133526
- const num4 = (bound2, literal, dflt) => {
133527
- const v2 = bound2 !== void 0 && bound2 !== null ? bound2 : literal;
133569
+ const num4 = (bound2, literal2, dflt) => {
133570
+ const v2 = bound2 !== void 0 && bound2 !== null ? bound2 : literal2;
133528
133571
  const n2 = typeof v2 === "number" ? v2 : typeof v2 === "string" ? Number(v2) : NaN;
133529
133572
  return Number.isFinite(n2) ? n2 : dflt;
133530
133573
  };
@@ -135734,16 +135777,16 @@ __export(render_descriptor_exports, {
135734
135777
  });
135735
135778
  function a11ySemantics(type2, props2, modifiers, ancestorHidden, resolve98) {
135736
135779
  if (!A11Y_MODIFIER_KEYS.some((k2) => modifiers[k2] !== void 0)) return void 0;
135737
- const literal = (v2) => typeof v2 === "string" && v2.trim() !== "" && !isDynamicValue(v2) ? v2 : void 0;
135780
+ const literal2 = (v2) => typeof v2 === "string" && v2.trim() !== "" && !isDynamicValue(v2) ? v2 : void 0;
135738
135781
  const spoken = (v2) => {
135739
- const lit = literal(v2);
135782
+ const lit = literal2(v2);
135740
135783
  if (lit !== void 0 || !resolve98 || typeof v2 !== "string" || !isDynamicValue(v2)) return lit;
135741
135784
  const r3 = resolve98(v2);
135742
135785
  if (r3 === v2) return void 0;
135743
135786
  return typeof r3 === "string" && r3.trim() !== "" ? r3 : typeof r3 === "number" ? String(r3) : void 0;
135744
135787
  };
135745
135788
  const exposure = ancestorHidden ? "hidden" : atExposureOf({ ...props2, modifiers });
135746
- const declared = literal(modifiers.accessibilityRole);
135789
+ const declared = literal2(modifiers.accessibilityRole);
135747
135790
  const inferred = (typeof modifiers.headingLevel === "number" ? "heading" : void 0) ?? (type2 === "SelectionControl" && props2.kind === "radio" ? "radio" : void 0) ?? (type2 === "BottomSheet" ? props2.modal === false ? "region" : "dialog" : void 0) ?? A11Y_CONTRACT[type2]?.role ?? "unspecified";
135748
135791
  const role = declared === "decorative" && isInteractive({ ...props2, modifiers }) ? "button" : declared ?? inferred;
135749
135792
  if (exposure === "hidden") return { role, exposure };
@@ -135766,9 +135809,9 @@ function a11ySemantics(type2, props2, modifiers, ancestorHidden, resolve98) {
135766
135809
  if (announce && typeof announce === "object" && !Array.isArray(announce)) {
135767
135810
  const a2 = announce;
135768
135811
  out2.live = {
135769
- politeness: literal(a2.politeness) ?? "polite",
135770
- trigger: literal(a2.trigger) ?? "on_change",
135771
- ...literal(a2.text) !== void 0 ? { text: literal(a2.text) } : {}
135812
+ politeness: literal2(a2.politeness) ?? "polite",
135813
+ trigger: literal2(a2.trigger) ?? "on_change",
135814
+ ...literal2(a2.text) !== void 0 ? { text: literal2(a2.text) } : {}
135772
135815
  };
135773
135816
  }
135774
135817
  return out2;
@@ -135812,15 +135855,18 @@ function clientEnvFor(scheme, width, isRTL2) {
135812
135855
  };
135813
135856
  }
135814
135857
  function nodeHidden(modifiers, provider, itemScope, env) {
135815
- if (modifiers.hidden === true) return true;
135816
135858
  const hp = modifiers.hiddenPath ?? modifiers.hidden_path;
135859
+ const literal2 = modifiers.hidden === true;
135860
+ const stateGate = typeof hp === "string" && (hp.startsWith("$service:") || hp.startsWith("$app:"));
135861
+ if (literal2 && !stateGate) return true;
135817
135862
  if (typeof hp !== "string" || !hp) return false;
135818
135863
  const low = hp.trim().toLowerCase();
135819
135864
  if (low === "true" || low === "1") return true;
135820
135865
  if (low === "false" || low === "0") return false;
135821
135866
  if (isEnvExpr(hp)) return env ? envHidden(hp, env) === true : false;
135822
- if (hp.startsWith("$item") || hp.startsWith("$service:")) {
135823
- return hiddenBool2(resolveTreeScalar(hp, provider, itemScope));
135867
+ if (hp.startsWith("$item") || stateGate) {
135868
+ const v2 = hp.startsWith("$app:") ? provider.value(hp) ?? void 0 : resolveTreeScalar(hp, provider, itemScope);
135869
+ return literal2 && (v2 === void 0 || v2 === null) ? true : hiddenBool2(v2);
135824
135870
  }
135825
135871
  return false;
135826
135872
  }
@@ -135879,14 +135925,14 @@ function collectNativeOnly(node3) {
135879
135925
  }
135880
135926
  function buildRenderTree(node3, path2 = "$", provider = null, itemScope = void 0, includeRawProps = false, env = null, a11yHiddenAbove = false) {
135881
135927
  if (!node3 || typeof node3 !== "object") return null;
135882
- const obj12 = node3;
135883
- const body = obj12.body ?? {};
135928
+ const obj13 = node3;
135929
+ const body = obj13.body ?? {};
135884
135930
  const type2 = typeof body.type === "string" ? body.type : "Unknown";
135885
- const id = typeof obj12.id === "string" && obj12.id ? obj12.id : path2;
135931
+ const id = typeof obj13.id === "string" && obj13.id ? obj13.id : path2;
135886
135932
  const out2 = { id, type: type2 };
135887
135933
  if (typeof body.package === "string") out2.package = body.package;
135888
135934
  const props2 = body.props ?? {};
135889
- const modifiers = obj12.modifiers ?? {};
135935
+ const modifiers = obj13.modifiers ?? {};
135890
135936
  if (includeRawProps) {
135891
135937
  const raw = {};
135892
135938
  for (const [key3, value2] of Object.entries(props2)) {
@@ -136535,7 +136581,7 @@ async function faceBytes(face, catalog4, opts) {
136535
136581
  }
136536
136582
  }
136537
136583
  async function pngFontFaceCss(tokens2, opts = {}) {
136538
- const cache2 = opts.source || opts.fetchFace ? void 0 : encoded;
136584
+ const cache3 = opts.source || opts.fetchFace ? void 0 : encoded;
136539
136585
  let catalog4;
136540
136586
  try {
136541
136587
  catalog4 = opts.catalog ?? loadCatalog2();
@@ -136565,12 +136611,12 @@ async function pngFontFaceCss(tokens2, opts = {}) {
136565
136611
  }
136566
136612
  const data = await Promise.all(
136567
136613
  wanted.map(async ({ face }) => {
136568
- const hit = cache2?.get(face.sha256);
136614
+ const hit = cache3?.get(face.sha256);
136569
136615
  if (hit !== void 0) return hit;
136570
136616
  const bytes2 = await faceBytes(face, catalog4, opts);
136571
136617
  if (!bytes2) return null;
136572
136618
  const b64 = bytes2.toString("base64");
136573
- cache2?.set(face.sha256, b64);
136619
+ cache3?.set(face.sha256, b64);
136574
136620
  return b64;
136575
136621
  })
136576
136622
  );
@@ -136887,46 +136933,46 @@ function realmProduceCache(evaluator) {
136887
136933
  }
136888
136934
  return existing;
136889
136935
  }
136890
- function dropEntry(cache2, key3) {
136891
- const entry = cache2.entries.get(key3);
136936
+ function dropEntry(cache3, key3) {
136937
+ const entry = cache3.entries.get(key3);
136892
136938
  if (!entry) return;
136893
- cache2.entries.delete(key3);
136894
- cache2.bytes -= entry.bytes;
136939
+ cache3.entries.delete(key3);
136940
+ cache3.bytes -= entry.bytes;
136895
136941
  }
136896
136942
  function produceCacheKey(bundleJs, timeoutMs, clock) {
136897
136943
  const digest2 = createHash15("sha256").update(bundleJs).digest("base64");
136898
136944
  return `${timeoutMs}|${clock === void 0 ? "live" : Math.trunc(clock)}|${digest2}`;
136899
136945
  }
136900
136946
  function cachedProduce(evaluator, key3) {
136901
- const cache2 = realmProduceCache(evaluator);
136902
- const hit = cache2.entries.get(key3);
136947
+ const cache3 = realmProduceCache(evaluator);
136948
+ const hit = cache3.entries.get(key3);
136903
136949
  if (!hit) return void 0;
136904
136950
  if (Date.now() >= hit.expiresAt) {
136905
- dropEntry(cache2, key3);
136951
+ dropEntry(cache3, key3);
136906
136952
  return void 0;
136907
136953
  }
136908
- cache2.entries.delete(key3);
136909
- cache2.entries.set(key3, hit);
136954
+ cache3.entries.delete(key3);
136955
+ cache3.entries.set(key3, hit);
136910
136956
  return { services: JSON.parse(hit.servicesJson), envelope: hit.envelope };
136911
136957
  }
136912
136958
  function rememberProduce(evaluator, key3, servicesJson, envelope, expiresAt) {
136913
136959
  const bytes2 = envelope.length + servicesJson.length;
136914
136960
  if (bytes2 > MAX_PRODUCE_ENTRY_BYTES) return;
136915
- const cache2 = realmProduceCache(evaluator);
136916
- dropEntry(cache2, key3);
136917
- cache2.entries.set(key3, { servicesJson, envelope, expiresAt, bytes: bytes2 });
136918
- cache2.bytes += bytes2;
136919
- const over = () => cache2.entries.size > MAX_PRODUCE_CACHE_ENTRIES || cache2.bytes > MAX_PRODUCE_CACHE_BYTES;
136961
+ const cache3 = realmProduceCache(evaluator);
136962
+ dropEntry(cache3, key3);
136963
+ cache3.entries.set(key3, { servicesJson, envelope, expiresAt, bytes: bytes2 });
136964
+ cache3.bytes += bytes2;
136965
+ const over = () => cache3.entries.size > MAX_PRODUCE_CACHE_ENTRIES || cache3.bytes > MAX_PRODUCE_CACHE_BYTES;
136920
136966
  if (!over()) return;
136921
136967
  const now = Date.now();
136922
- for (const [k2, entry] of [...cache2.entries]) {
136968
+ for (const [k2, entry] of [...cache3.entries]) {
136923
136969
  if (!over()) break;
136924
- if (k2 !== key3 && now >= entry.expiresAt) dropEntry(cache2, k2);
136970
+ if (k2 !== key3 && now >= entry.expiresAt) dropEntry(cache3, k2);
136925
136971
  }
136926
136972
  while (over()) {
136927
- const oldest = cache2.entries.keys().next();
136973
+ const oldest = cache3.entries.keys().next();
136928
136974
  if (oldest.done || oldest.value === key3) break;
136929
- dropEntry(cache2, oldest.value);
136975
+ dropEntry(cache3, oldest.value);
136930
136976
  }
136931
136977
  }
136932
136978
  function reuseWindowMs(parsed) {
@@ -137583,6 +137629,162 @@ var init_widgets = __esm({
137583
137629
  }
137584
137630
  });
137585
137631
 
137632
+ // ../../core/dev-server/src/boot-state.ts
137633
+ var boot_state_exports = {};
137634
+ __export(boot_state_exports, {
137635
+ BOOT_STATE_CACHE_MAX: () => BOOT_STATE_CACHE_MAX,
137636
+ BOOT_STATE_MAX_BYTES: () => BOOT_STATE_MAX_BYTES,
137637
+ BOOT_STATE_STORAGE_KEYS: () => BOOT_STATE_STORAGE_KEYS,
137638
+ attachBootState: () => attachBootState,
137639
+ bakeBootState: () => bakeBootState,
137640
+ bindsOmittedPath: () => bindsOmittedPath,
137641
+ bootStateCacheSize: () => bootStateCacheSize,
137642
+ computeBootState: () => computeBootState,
137643
+ gatesUnbakedPath: () => gatesUnbakedPath
137644
+ });
137645
+ function bootStateCacheSize() {
137646
+ return cache2.size;
137647
+ }
137648
+ function bakeBootState(bundleJs, input) {
137649
+ let services;
137650
+ let probed;
137651
+ let drifting;
137652
+ const read = /* @__PURE__ */ new Set();
137653
+ const storage = { getItem: (key3) => (read.add(String(key3)), null), setItem: () => {
137654
+ } };
137655
+ try {
137656
+ services = extractBundleServices(bundleJs, { input: { ...input, ...UNHOSTED_INPUT }, storage });
137657
+ probed = extractBundleServices(bundleJs, { input: { ...input, ...UNHOSTED_INPUT, ...NAV_INPUT_PROBE }, storage });
137658
+ drifting = nondeterministicServicesOrNull(bundleJs, { input: { ...input, ...UNHOSTED_INPUT }, storage });
137659
+ } catch {
137660
+ return null;
137661
+ }
137662
+ if (drifting === null) return null;
137663
+ const kept = {};
137664
+ const omitted = [];
137665
+ for (const [name, state] of Object.entries(services)) {
137666
+ const probe2 = probed[name];
137667
+ if (name === BOOT_STATE_STORAGE_KEYS || drifting.includes(name) || !isRecord4(state) || !isRecord4(probe2)) {
137668
+ omitted.push(name);
137669
+ continue;
137670
+ }
137671
+ const steady = steadyPart(state, probe2, name, omitted);
137672
+ if (Object.keys(steady).length > 0) kept[name] = steady;
137673
+ }
137674
+ const defined = Object.keys(services);
137675
+ if (Object.keys(kept).length === 0) return { state: null, omitted, services: defined };
137676
+ if (read.size > 0) kept[BOOT_STATE_STORAGE_KEYS] = [...new Set([...read].map((key3) => key3.includes(PROBE) ? `${key3.slice(0, key3.indexOf(PROBE))}*` : key3))].sort();
137677
+ let json9;
137678
+ try {
137679
+ json9 = JSON.stringify(kept);
137680
+ } catch {
137681
+ return { state: null, omitted, services: defined };
137682
+ }
137683
+ if (new TextEncoder().encode(json9).length > BOOT_STATE_MAX_BYTES) return { state: null, omitted, services: defined };
137684
+ return { state: JSON.parse(json9), omitted, services: defined };
137685
+ }
137686
+ function computeBootState(bundleJs, input) {
137687
+ return bakeBootState(bundleJs, input)?.state ?? null;
137688
+ }
137689
+ function steadyPart(state, probe2, at2, omitted) {
137690
+ const steady = {};
137691
+ for (const [key3, value2] of Object.entries(state)) {
137692
+ const other = probe2[key3];
137693
+ if (sameJson2(value2, other)) steady[key3] = value2;
137694
+ else if (isRecord4(value2) && isRecord4(other)) {
137695
+ const part4 = steadyPart(value2, other, `${at2}.${key3}`, omitted);
137696
+ if (Object.keys(part4).length > 0) steady[key3] = part4;
137697
+ } else omitted.push(`${at2}.${key3}`);
137698
+ }
137699
+ for (const key3 of Object.keys(probe2)) if (!(key3 in state)) omitted.push(`${at2}.${key3}`);
137700
+ return steady;
137701
+ }
137702
+ function bindsOmittedPath(descriptor, omitted, state = {}) {
137703
+ if (omitted.length === 0) return false;
137704
+ return collectServiceBindings(withoutClosedSheets(descriptor, state)).some(({ svc, path: path2 }) => {
137705
+ const bound2 = `${svc}.${path2}`;
137706
+ return omitted.some((o2) => bound2 === o2 || bound2.startsWith(`${o2}.`) || bound2.startsWith(`${o2}[`) || o2.startsWith(`${bound2}.`));
137707
+ });
137708
+ }
137709
+ function gatesUnbakedPath(descriptor, state, services) {
137710
+ return collectServiceBindings(withoutClosedSheets(descriptor, state)).some(({ svc, path: path2, at: at2 }) => /\.(hiddenPath|hidden_path)$/.test(at2) && services.includes(svc) && valueAt2(state[svc], path2) == null);
137711
+ }
137712
+ function withoutClosedSheets(node3, state) {
137713
+ if (Array.isArray(node3)) return node3.map((v2) => withoutClosedSheets(v2, state));
137714
+ if (!isRecord4(node3)) return node3;
137715
+ const body = node3.body;
137716
+ if (isRecord4(body) && body.type === "BottomSheet" && isRecord4(body.props) && typeof body.props.presentedPath === "string") {
137717
+ const m2 = /^\$service:([A-Za-z0-9_-]+)\.(.+)$/.exec(body.props.presentedPath);
137718
+ if (m2 && valueAt2(state[m2[1]], m2[2]) === false) {
137719
+ const { content: _closed, ...props2 } = body.props;
137720
+ return { ...node3, body: { ...body, props: props2 } };
137721
+ }
137722
+ }
137723
+ return Object.fromEntries(Object.entries(node3).map(([k2, v2]) => [k2, withoutClosedSheets(v2, state)]));
137724
+ }
137725
+ function valueAt2(root, path2) {
137726
+ let v2 = root;
137727
+ for (const part4 of path2.split(/\.|\[(\d+)\]/).filter((p2) => p2 !== void 0 && p2 !== "")) {
137728
+ if (v2 === null || typeof v2 !== "object") return void 0;
137729
+ v2 = v2[part4];
137730
+ }
137731
+ return v2;
137732
+ }
137733
+ function isRecord4(v2) {
137734
+ return v2 !== null && typeof v2 === "object" && !Array.isArray(v2);
137735
+ }
137736
+ function sameJson2(a2, b2) {
137737
+ try {
137738
+ return JSON.stringify(a2) === JSON.stringify(b2);
137739
+ } catch {
137740
+ return false;
137741
+ }
137742
+ }
137743
+ async function attachBootState(descriptor, readBundle) {
137744
+ const lb = descriptor?.logicBundle;
137745
+ if (!lb || typeof lb !== "object" || lb.bootState !== void 0) return;
137746
+ const name = bundleNameFromUrl(lb.url);
137747
+ if (!name) return;
137748
+ const loaded2 = await readBundle(name);
137749
+ if (!loaded2) return;
137750
+ const input = descriptor.input && typeof descriptor.input === "object" ? descriptor.input : void 0;
137751
+ const key3 = `${loaded2.integrity}
137752
+ ${input ? JSON.stringify(input) : ""}`;
137753
+ let bake = cache2.get(key3);
137754
+ if (bake === void 0) {
137755
+ const js2 = new TextDecoder().decode(loaded2.bytes);
137756
+ const fresh = bakeBootState(js2, input) ?? bakeBootState(js2, input);
137757
+ if (!fresh) {
137758
+ console.warn(`[boot-state] ${name}: the bundle did not boot here; this descriptor is served without a boot state`);
137759
+ return;
137760
+ }
137761
+ if (cache2.size >= BOOT_STATE_CACHE_MAX) cache2.delete(cache2.keys().next().value);
137762
+ cache2.set(key3, fresh);
137763
+ bake = fresh;
137764
+ }
137765
+ if (!bake.state || bindsOmittedPath(descriptor, bake.omitted, bake.state) || gatesUnbakedPath(descriptor, bake.state, bake.services)) return;
137766
+ descriptor.logicBundle = { ...lb, bootState: bake.state };
137767
+ }
137768
+ var BOOT_STATE_MAX_BYTES, cache2, BOOT_STATE_CACHE_MAX, PROBE, NAV_INPUT_PROBE, UNHOSTED_INPUT, BOOT_STATE_STORAGE_KEYS;
137769
+ var init_boot_state = __esm({
137770
+ "../../core/dev-server/src/boot-state.ts"() {
137771
+ init_define_HHP_CATALOG();
137772
+ init_validate_descriptor_core();
137773
+ BOOT_STATE_MAX_BYTES = 16 * 1024;
137774
+ cache2 = /* @__PURE__ */ new Map();
137775
+ BOOT_STATE_CACHE_MAX = 256;
137776
+ PROBE = "__himi_boot_state_probe__";
137777
+ NAV_INPUT_PROBE = {
137778
+ id: PROBE,
137779
+ screenId: PROBE,
137780
+ __himiPreferenceAccount: PROBE,
137781
+ __himiPreferenceBusiness: PROBE
137782
+ };
137783
+ UNHOSTED_INPUT = { __himiHostSite: "" };
137784
+ BOOT_STATE_STORAGE_KEYS = "__himiStorageKeys";
137785
+ }
137786
+ });
137787
+
137586
137788
  // ../../core/dev-server/src/index.ts
137587
137789
  import { createServer as createServer2 } from "node:http";
137588
137790
  import { readFile, stat } from "node:fs/promises";
@@ -137590,6 +137792,10 @@ import { readFileSync as readFileSync38, existsSync as existsSync34, watch, mkdi
137590
137792
  import { basename as basename11, dirname as dirname25, extname as extname2, join as join28, relative as relative8, resolve as resolve33, normalize as normalize4, sep as sep11 } from "node:path";
137591
137793
  import { createHash as createHash16, randomUUID as randomUUID6 } from "node:crypto";
137592
137794
  import { fileURLToPath as fileURLToPath25, pathToFileURL as pathToFileURL5 } from "node:url";
137795
+ async function loadBootStateBaker() {
137796
+ await Promise.resolve().then(() => (init_validate_descriptor(), validate_descriptor_exports));
137797
+ return (await Promise.resolve().then(() => (init_boot_state(), boot_state_exports))).attachBootState;
137798
+ }
137593
137799
  function readLogicBundle(read, tier5Dir, name) {
137594
137800
  return read(tier5Dir ?? TIER5_ROOT2, name) ?? (tier5Dir && tier5Dir !== TIER5_ROOT2 ? read(TIER5_ROOT2, name) : void 0);
137595
137801
  }
@@ -137616,8 +137822,8 @@ function send(res, status, body, headers2 = {}) {
137616
137822
  }
137617
137823
  res.end(body);
137618
137824
  }
137619
- function sendJson(res, status, obj12, headers2 = {}) {
137620
- send(res, status, JSON.stringify(obj12), {
137825
+ function sendJson(res, status, obj13, headers2 = {}) {
137826
+ send(res, status, JSON.stringify(obj13), {
137621
137827
  "content-type": "application/json; charset=utf-8",
137622
137828
  ...headers2
137623
137829
  });
@@ -137895,6 +138101,10 @@ async function handleBootRequest(req, res, state) {
137895
138101
  homeScreenRefusal = { error: "depth_budget_exceeded", screenId: err.screenId, finding: err.finding };
137896
138102
  }
137897
138103
  if (descriptor && typeof descriptor === "object") {
138104
+ if (descriptor.logicBundle) {
138105
+ const attachBootState2 = await loadBootStateBaker();
138106
+ await attachBootState2(descriptor, (name) => readBundleFile(name, reqState.tier5Dir));
138107
+ }
137898
138108
  assignStableIds(descriptor);
137899
138109
  const acceptLanguage = req.headers["accept-language"];
137900
138110
  const locale = pickLocale(typeof acceptLanguage === "string" ? acceptLanguage : null);
@@ -138222,6 +138432,10 @@ async function handleScreenRequest(req, res, state) {
138222
138432
  ]
138223
138433
  });
138224
138434
  }
138435
+ if (descriptor.logicBundle) {
138436
+ const attachBootState2 = await loadBootStateBaker();
138437
+ await attachBootState2(descriptor, (name) => readBundleFile(name, reqState.tier5Dir));
138438
+ }
138225
138439
  assignStableIds(descriptor);
138226
138440
  const localized = locale ? translate(JSON.parse(JSON.stringify(descriptor)), locale) : descriptor;
138227
138441
  const body = JSON.stringify({ ...localized, etag: void 0 });
@@ -138894,11 +139108,11 @@ async function handleWebWix(req, res, state) {
138894
139108
  return {};
138895
139109
  }
138896
139110
  };
138897
- const reply = (status, obj12) => {
139111
+ const reply = (status, obj13) => {
138898
139112
  res.statusCode = status;
138899
139113
  res.setHeader("content-type", "application/json; charset=utf-8");
138900
139114
  res.setHeader("access-control-allow-origin", "*");
138901
- res.end(JSON.stringify(obj12));
139115
+ res.end(JSON.stringify(obj13));
138902
139116
  };
138903
139117
  if (path2 === "/v1/__webwix/stream" && req.method === "POST") {
138904
139118
  const b2 = await readJson12();
@@ -142000,9 +142214,9 @@ function hasRowBinding(props2) {
142000
142214
  });
142001
142215
  }
142002
142216
  function declaredOptionIds(props2, resolve98) {
142003
- const literal = props2.options ?? props2.tabs ?? props2.chips;
142217
+ const literal2 = props2.options ?? props2.tabs ?? props2.chips;
142004
142218
  const bound2 = props2.optionsPath !== void 0 ? resolved(props2.optionsPath, resolve98) : void 0;
142005
- const raw = Array.isArray(bound2) ? bound2 : literal;
142219
+ const raw = Array.isArray(bound2) ? bound2 : literal2;
142006
142220
  if (!Array.isArray(raw)) return [];
142007
142221
  const out2 = [];
142008
142222
  for (const o2 of raw) {
@@ -142070,8 +142284,8 @@ function synthesizeInput(control, resolve98, tokens2) {
142070
142284
  if (!acceptsWords(props2) || !acceptsWords(control.wrapper ?? {})) return null;
142071
142285
  const binding2 = typeof props2.valuePath === "string" ? props2.valuePath : typeof props2.value === "string" && props2.value.startsWith("$service:") ? props2.value : void 0;
142072
142286
  const bound2 = binding2 === void 0 ? void 0 : resolve98(binding2);
142073
- const literal = typeof props2.value === "string" && !props2.value.startsWith("$") ? props2.value : void 0;
142074
- const current = typeof bound2 === "string" ? bound2 : typeof bound2 === "number" ? String(bound2) : literal ?? "";
142287
+ const literal2 = typeof props2.value === "string" && !props2.value.startsWith("$") ? props2.value : void 0;
142288
+ const current = typeof bound2 === "string" ? bound2 : typeof bound2 === "number" ? String(bound2) : literal2 ?? "";
142075
142289
  const max = typeof props2.maxLength === "number" && props2.maxLength > 0 ? props2.maxLength : void 0;
142076
142290
  const pick3 = tokens2().find((t2) => t2 !== current && (max === void 0 || t2.length <= max));
142077
142291
  if (pick3 === void 0) return null;
@@ -142543,11 +142757,11 @@ function localDatabaseAnswer(schema2, store, queue, method, params) {
142543
142757
  return { item: hit ? detached(hit) : null };
142544
142758
  }
142545
142759
  case "upsert": {
142546
- const obj12 = parseJsonObject(params.object);
142547
- if (!obj12 || typeof obj12.id !== "string") {
142760
+ const obj13 = parseJsonObject(params.object);
142761
+ if (!obj13 || typeof obj13.id !== "string") {
142548
142762
  throw new Error("local_database.upsert: object with string id required");
142549
142763
  }
142550
- const row2 = detached(obj12);
142764
+ const row2 = detached(obj13);
142551
142765
  const at2 = rows.findIndex((r3) => r3.id === row2.id);
142552
142766
  const next = [...rows];
142553
142767
  if (at2 >= 0) next[at2] = row2;
@@ -145458,19 +145672,19 @@ function logicBundleOf(descriptor) {
145458
145672
  }
145459
145673
  function collectComponentTypes(value2, into = /* @__PURE__ */ new Set()) {
145460
145674
  if (!value2 || typeof value2 !== "object") return into;
145461
- const obj12 = value2;
145462
- if ((obj12.package === "himalaya" || obj12.package === "himalaya.core") && typeof obj12.type === "string") into.add(obj12.type);
145463
- for (const child of Object.values(obj12)) collectComponentTypes(child, into);
145675
+ const obj13 = value2;
145676
+ if ((obj13.package === "himalaya" || obj13.package === "himalaya.core") && typeof obj13.type === "string") into.add(obj13.type);
145677
+ for (const child of Object.values(obj13)) collectComponentTypes(child, into);
145464
145678
  return into;
145465
145679
  }
145466
145680
  function unsupportedComponentMinVersions(value2, into = []) {
145467
145681
  if (!value2 || typeof value2 !== "object") return into;
145468
- const obj12 = value2;
145469
- const isComponent2 = typeof obj12.id === "string" && (obj12.body !== null && typeof obj12.body === "object" || typeof obj12.package === "string" && typeof obj12.type === "string");
145470
- if (isComponent2 && typeof obj12.minVersion === "number" && obj12.minVersion > SUPPORTED_COMPONENT_MIN_VERSION) {
145471
- into.push({ id: obj12.id, minVersion: obj12.minVersion });
145682
+ const obj13 = value2;
145683
+ const isComponent2 = typeof obj13.id === "string" && (obj13.body !== null && typeof obj13.body === "object" || typeof obj13.package === "string" && typeof obj13.type === "string");
145684
+ if (isComponent2 && typeof obj13.minVersion === "number" && obj13.minVersion > SUPPORTED_COMPONENT_MIN_VERSION) {
145685
+ into.push({ id: obj13.id, minVersion: obj13.minVersion });
145472
145686
  }
145473
- for (const child of Object.values(obj12)) unsupportedComponentMinVersions(child, into);
145687
+ for (const child of Object.values(obj13)) unsupportedComponentMinVersions(child, into);
145474
145688
  return into;
145475
145689
  }
145476
145690
  function explicitMinRuntimeVersion(raw) {
@@ -145481,11 +145695,11 @@ function explicitMinRuntimeVersion(raw) {
145481
145695
  }
145482
145696
  function collectNativeComponents(value2, into) {
145483
145697
  if (!value2 || typeof value2 !== "object") return;
145484
- const obj12 = value2;
145485
- const pkg = typeof obj12.package === "string" ? obj12.package : void 0;
145486
- const type2 = typeof obj12.type === "string" ? obj12.type : void 0;
145698
+ const obj13 = value2;
145699
+ const pkg = typeof obj13.package === "string" ? obj13.package : void 0;
145700
+ const type2 = typeof obj13.type === "string" ? obj13.type : void 0;
145487
145701
  if (pkg && type2 && pkg !== "himalaya" && pkg !== "himalaya.core") into.add(`${pkg}.${type2}`);
145488
- for (const child of Object.values(obj12)) collectNativeComponents(child, into);
145702
+ for (const child of Object.values(obj13)) collectNativeComponents(child, into);
145489
145703
  }
145490
145704
  function maximumBinaryVersion(current, candidate) {
145491
145705
  if (typeof candidate !== "string" || !/^\d+(?:\.\d+){0,3}$/.test(candidate)) return current;
@@ -147793,9 +148007,9 @@ function stateOf(view) {
147793
148007
  build: b2 && view.live ? { ok: b2.ok, ms: b2.ms, screens: b2.screens, at: b2.at, run: view.live.runId } : null
147794
148008
  };
147795
148009
  }
147796
- function frameFor(state, prev, ts20, v2, key3) {
147797
- if (key3 || !prev) return { ts: ts20, v: v2, key: true, ...state };
147798
- const f2 = { ts: ts20, v: v2 };
148010
+ function frameFor(state, prev, ts21, v2, key3) {
148011
+ if (key3 || !prev) return { ts: ts21, v: v2, key: true, ...state };
148012
+ const f2 = { ts: ts21, v: v2 };
147799
148013
  if (!same2(state.step, prev.step)) f2.step = state.step;
147800
148014
  if (!same2(state.now, prev.now)) f2.now = state.now;
147801
148015
  const screens = {};
@@ -149081,10 +149295,10 @@ function readUpdateCache(path2) {
149081
149295
  return {};
149082
149296
  }
149083
149297
  }
149084
- function writeUpdateCache(path2, cache2) {
149298
+ function writeUpdateCache(path2, cache3) {
149085
149299
  try {
149086
149300
  mkdirSync22(dirname28(path2), { recursive: true, mode: 448 });
149087
- writeFileSync16(path2, JSON.stringify(cache2, null, 2) + "\n", { mode: 384 });
149301
+ writeFileSync16(path2, JSON.stringify(cache3, null, 2) + "\n", { mode: 384 });
149088
149302
  } catch {
149089
149303
  }
149090
149304
  }
@@ -149316,18 +149530,18 @@ async function maybeSelfUpdate(argv, io2, opts = {}) {
149316
149530
  if (updateCheckSuppression(running, command, env, opts.cwd ?? process.cwd())) return void 0;
149317
149531
  const now = opts.now ?? Date.now();
149318
149532
  const cachePath = opts.cachePath ?? updateCachePath(env);
149319
- const cache2 = readUpdateCache(cachePath);
149320
- if (cache2.snoozedUntil && Date.parse(cache2.snoozedUntil) > now) return void 0;
149321
- let latest = cache2.latest;
149322
- let runningPublishedAt = cache2.runningPublishedAt;
149323
- const checkedAt = cache2.checkedAt ? Date.parse(cache2.checkedAt) : Number.NaN;
149324
- const describesThisBuild = cache2.running === running;
149533
+ const cache3 = readUpdateCache(cachePath);
149534
+ if (cache3.snoozedUntil && Date.parse(cache3.snoozedUntil) > now) return void 0;
149535
+ let latest = cache3.latest;
149536
+ let runningPublishedAt = cache3.runningPublishedAt;
149537
+ const checkedAt = cache3.checkedAt ? Date.parse(cache3.checkedAt) : Number.NaN;
149538
+ const describesThisBuild = cache3.running === running;
149325
149539
  const fresh = Number.isFinite(checkedAt) && now - checkedAt < UPDATE_CHECK_INTERVAL_MS && describesThisBuild;
149326
149540
  if (!describesThisBuild) runningPublishedAt = void 0;
149327
149541
  let answeredBy;
149328
149542
  let answeredLatest;
149329
- const attemptedAt = cache2.attemptedAt ? Date.parse(cache2.attemptedAt) : Number.NaN;
149330
- const recentlyTried = cache2.attemptedFor === running && Number.isFinite(attemptedAt) && now - attemptedAt < UPDATE_RETRY_AFTER_FAILURE_MS;
149543
+ const attemptedAt = cache3.attemptedAt ? Date.parse(cache3.attemptedAt) : Number.NaN;
149544
+ const recentlyTried = cache3.attemptedFor === running && Number.isFinite(attemptedAt) && now - attemptedAt < UPDATE_RETRY_AFTER_FAILURE_MS;
149331
149545
  if (!fresh && !recentlyTried) {
149332
149546
  const packument = await fetchCliPackument(opts.fetchImpl ?? fetch, UPDATE_FOREGROUND_BUDGET_MS, env, opts.scopedRegistry);
149333
149547
  if (packument) {
@@ -149335,9 +149549,9 @@ async function maybeSelfUpdate(argv, io2, opts = {}) {
149335
149549
  runningPublishedAt = packument.time[running];
149336
149550
  answeredBy = packument.registry;
149337
149551
  answeredLatest = packument.latest;
149338
- writeUpdateCache(cachePath, { ...cache2, running, checkedAt: new Date(now).toISOString(), latest, runningPublishedAt });
149552
+ writeUpdateCache(cachePath, { ...cache3, running, checkedAt: new Date(now).toISOString(), latest, runningPublishedAt });
149339
149553
  } else {
149340
- writeUpdateCache(cachePath, { ...cache2, attemptedAt: new Date(now).toISOString(), attemptedFor: running });
149554
+ writeUpdateCache(cachePath, { ...cache3, attemptedAt: new Date(now).toISOString(), attemptedFor: running });
149341
149555
  opts.spawnRefresh?.();
149342
149556
  }
149343
149557
  }
@@ -149388,7 +149602,7 @@ async function maybeSelfUpdate(argv, io2, opts = {}) {
149388
149602
  }
149389
149603
  if (!answeredBy || !answeredLatest || compareVersions2(answeredLatest, running) <= 0) {
149390
149604
  if (answeredBy && answeredLatest) {
149391
- writeUpdateCache(cachePath, { ...cache2, running, latest: answeredLatest, runningPublishedAt, checkedAt: new Date(now).toISOString() });
149605
+ writeUpdateCache(cachePath, { ...cache3, running, latest: answeredLatest, runningPublishedAt, checkedAt: new Date(now).toISOString() });
149392
149606
  }
149393
149607
  return void 0;
149394
149608
  }
@@ -149409,7 +149623,7 @@ async function maybeSelfUpdate(argv, io2, opts = {}) {
149409
149623
  running: after,
149410
149624
  latest: target,
149411
149625
  checkedAt: new Date(now).toISOString(),
149412
- ...cache2.snoozedUntil ? { snoozedUntil: cache2.snoozedUntil } : {}
149626
+ ...cache3.snoozedUntil ? { snoozedUntil: cache3.snoozedUntil } : {}
149413
149627
  });
149414
149628
  io2.error(` installed ${after} \u2014 re-running: himi ${argv.join(" ")}`);
149415
149629
  const exitCode = runner2.reexec(argv);
@@ -150142,16 +150356,16 @@ function blankComments(src) {
150142
150356
  }
150143
150357
  function parseStoreBlock(configTs) {
150144
150358
  const text15 = blankComments(configTs);
150145
- const literal = [...text15.matchAll(/(?<![\w$.])store\s*:\s*(?=\{\s*["']?adopt["']?\s*:)/g)];
150146
- if (literal.length > 1) throw new Error("config.ts declares `store: { adopt }` more than once");
150147
- if (literal.length === 0) {
150359
+ const literal2 = [...text15.matchAll(/(?<![\w$.])store\s*:\s*(?=\{\s*["']?adopt["']?\s*:)/g)];
150360
+ if (literal2.length > 1) throw new Error("config.ts declares `store: { adopt }` more than once");
150361
+ if (literal2.length === 0) {
150148
150362
  if (/(?<![\w$.])adopt\s*:/.test(text15) || /(?<![\w$.])store\s*:/.test(text15) && /(?<![\w$.])adopt\b/.test(text15)) {
150149
150363
  throw new Error("config.ts mentions store.adopt but not as an inline `store: { adopt: { \u2026 } }` literal \u2014 write it inline so every tool reads the same identity");
150150
150364
  }
150151
150365
  return void 0;
150152
150366
  }
150153
150367
  const p2 = new LiteralParser(text15);
150154
- p2.i = literal[0].index + literal[0][0].length;
150368
+ p2.i = literal2[0].index + literal2[0][0].length;
150155
150369
  return p2.object();
150156
150370
  }
150157
150371
  function adoptedIdentityOfConfigTs(configTs) {
@@ -155837,14 +156051,14 @@ function compress(arr3, options, matcher, readonlyMatcher) {
155837
156051
  } else if (text15 !== void 0) compressedObj[options.textNodeName] = text15;
155838
156052
  return compressedObj;
155839
156053
  }
155840
- function propName2(obj12) {
155841
- const keys = Object.keys(obj12);
156054
+ function propName2(obj13) {
156055
+ const keys = Object.keys(obj13);
155842
156056
  for (let i2 = 0; i2 < keys.length; i2++) {
155843
156057
  const key3 = keys[i2];
155844
156058
  if (key3 !== ":@") return key3;
155845
156059
  }
155846
156060
  }
155847
- function assignAttributes(obj12, attrMap, readonlyMatcher, options) {
156061
+ function assignAttributes(obj13, attrMap, readonlyMatcher, options) {
155848
156062
  if (attrMap) {
155849
156063
  const keys = Object.keys(attrMap);
155850
156064
  const len = keys.length;
@@ -155853,20 +156067,20 @@ function assignAttributes(obj12, attrMap, readonlyMatcher, options) {
155853
156067
  const rawAttrName = atrrName.startsWith(options.attributeNamePrefix) ? atrrName.substring(options.attributeNamePrefix.length) : atrrName;
155854
156068
  const jPathOrMatcher = options.jPath ? readonlyMatcher.toString() + "." + rawAttrName : readonlyMatcher;
155855
156069
  if (options.isArray(atrrName, jPathOrMatcher, true, true)) {
155856
- obj12[atrrName] = [attrMap[atrrName]];
156070
+ obj13[atrrName] = [attrMap[atrrName]];
155857
156071
  } else {
155858
- obj12[atrrName] = attrMap[atrrName];
156072
+ obj13[atrrName] = attrMap[atrrName];
155859
156073
  }
155860
156074
  }
155861
156075
  }
155862
156076
  }
155863
- function isLeafTag(obj12, options) {
156077
+ function isLeafTag(obj13, options) {
155864
156078
  const { textNodeName } = options;
155865
- const propCount = Object.keys(obj12).length;
156079
+ const propCount = Object.keys(obj13).length;
155866
156080
  if (propCount === 0) {
155867
156081
  return true;
155868
156082
  }
155869
- if (propCount === 1 && (obj12[textNodeName] || typeof obj12[textNodeName] === "boolean" || obj12[textNodeName] === 0)) {
156083
+ if (propCount === 1 && (obj13[textNodeName] || typeof obj13[textNodeName] === "boolean" || obj13[textNodeName] === 0)) {
155870
156084
  return true;
155871
156085
  }
155872
156086
  return false;
@@ -156159,11 +156373,11 @@ function attr_to_str_raw(attrMap, options) {
156159
156373
  }
156160
156374
  return attrStr;
156161
156375
  }
156162
- function propName3(obj12) {
156163
- const keys = Object.keys(obj12);
156376
+ function propName3(obj13) {
156377
+ const keys = Object.keys(obj13);
156164
156378
  for (let i2 = 0; i2 < keys.length; i2++) {
156165
156379
  const key3 = keys[i2];
156166
- if (!Object.prototype.hasOwnProperty.call(obj12, key3)) continue;
156380
+ if (!Object.prototype.hasOwnProperty.call(obj13, key3)) continue;
156167
156381
  if (key3 !== ":@") return key3;
156168
156382
  }
156169
156383
  }
@@ -156526,12 +156740,12 @@ var init_fxb = __esm({
156526
156740
  return " " + attrName;
156527
156741
  } else return " " + attrName + '="' + escapeAttribute2(val) + '"';
156528
156742
  };
156529
- Builder2.prototype.extractAttributes = function(obj12) {
156530
- if (!obj12 || typeof obj12 !== "object") return null;
156743
+ Builder2.prototype.extractAttributes = function(obj13) {
156744
+ if (!obj13 || typeof obj13 !== "object") return null;
156531
156745
  const attrValues = {};
156532
156746
  let hasAttrs = false;
156533
- if (this.options.attributesGroupName && obj12[this.options.attributesGroupName]) {
156534
- const attrGroup = obj12[this.options.attributesGroupName];
156747
+ if (this.options.attributesGroupName && obj13[this.options.attributesGroupName]) {
156748
+ const attrGroup = obj13[this.options.attributesGroupName];
156535
156749
  for (let attrKey in attrGroup) {
156536
156750
  if (!Object.prototype.hasOwnProperty.call(attrGroup, attrKey)) continue;
156537
156751
  const cleanKey = attrKey.startsWith(this.options.attributeNamePrefix) ? attrKey.substring(this.options.attributeNamePrefix.length) : attrKey;
@@ -156539,33 +156753,33 @@ var init_fxb = __esm({
156539
156753
  hasAttrs = true;
156540
156754
  }
156541
156755
  } else {
156542
- for (let key3 in obj12) {
156543
- if (!Object.prototype.hasOwnProperty.call(obj12, key3)) continue;
156756
+ for (let key3 in obj13) {
156757
+ if (!Object.prototype.hasOwnProperty.call(obj13, key3)) continue;
156544
156758
  const attr3 = this.isAttribute(key3);
156545
156759
  if (attr3) {
156546
- attrValues[attr3] = escapeAttribute2(obj12[key3]);
156760
+ attrValues[attr3] = escapeAttribute2(obj13[key3]);
156547
156761
  hasAttrs = true;
156548
156762
  }
156549
156763
  }
156550
156764
  }
156551
156765
  return hasAttrs ? attrValues : null;
156552
156766
  };
156553
- Builder2.prototype.buildRawContent = function(obj12) {
156554
- if (typeof obj12 === "string") {
156555
- return obj12;
156767
+ Builder2.prototype.buildRawContent = function(obj13) {
156768
+ if (typeof obj13 === "string") {
156769
+ return obj13;
156556
156770
  }
156557
- if (typeof obj12 !== "object" || obj12 === null) {
156558
- return String(obj12);
156771
+ if (typeof obj13 !== "object" || obj13 === null) {
156772
+ return String(obj13);
156559
156773
  }
156560
- if (obj12[this.options.textNodeName] !== void 0) {
156561
- return obj12[this.options.textNodeName];
156774
+ if (obj13[this.options.textNodeName] !== void 0) {
156775
+ return obj13[this.options.textNodeName];
156562
156776
  }
156563
156777
  let content = "";
156564
- for (let key3 in obj12) {
156565
- if (!Object.prototype.hasOwnProperty.call(obj12, key3)) continue;
156778
+ for (let key3 in obj13) {
156779
+ if (!Object.prototype.hasOwnProperty.call(obj13, key3)) continue;
156566
156780
  if (this.isAttribute(key3)) continue;
156567
156781
  if (this.options.attributesGroupName && key3 === this.options.attributesGroupName) continue;
156568
- const value2 = obj12[key3];
156782
+ const value2 = obj13[key3];
156569
156783
  if (key3 === this.options.textNodeName) {
156570
156784
  content += value2;
156571
156785
  } else if (Array.isArray(value2)) {
@@ -156596,11 +156810,11 @@ var init_fxb = __esm({
156596
156810
  }
156597
156811
  return content;
156598
156812
  };
156599
- Builder2.prototype.buildAttributesForStopNode = function(obj12) {
156600
- if (!obj12 || typeof obj12 !== "object") return "";
156813
+ Builder2.prototype.buildAttributesForStopNode = function(obj13) {
156814
+ if (!obj13 || typeof obj13 !== "object") return "";
156601
156815
  let attrStr = "";
156602
- if (this.options.attributesGroupName && obj12[this.options.attributesGroupName]) {
156603
- const attrGroup = obj12[this.options.attributesGroupName];
156816
+ if (this.options.attributesGroupName && obj13[this.options.attributesGroupName]) {
156817
+ const attrGroup = obj13[this.options.attributesGroupName];
156604
156818
  for (let attrKey in attrGroup) {
156605
156819
  if (!Object.prototype.hasOwnProperty.call(attrGroup, attrKey)) continue;
156606
156820
  const cleanKey = attrKey.startsWith(this.options.attributeNamePrefix) ? attrKey.substring(this.options.attributeNamePrefix.length) : attrKey;
@@ -156612,11 +156826,11 @@ var init_fxb = __esm({
156612
156826
  }
156613
156827
  }
156614
156828
  } else {
156615
- for (let key3 in obj12) {
156616
- if (!Object.prototype.hasOwnProperty.call(obj12, key3)) continue;
156829
+ for (let key3 in obj13) {
156830
+ if (!Object.prototype.hasOwnProperty.call(obj13, key3)) continue;
156617
156831
  const attr3 = this.isAttribute(key3);
156618
156832
  if (attr3) {
156619
- const val = obj12[key3];
156833
+ const val = obj13[key3];
156620
156834
  if (val === true && this.options.suppressBooleanAttributes) {
156621
156835
  attrStr += " " + attr3;
156622
156836
  } else {
@@ -158433,10 +158647,10 @@ function trimCapabilities(config, keptBlocks) {
158433
158647
  for (const block of objectLiteralsOf(code, ["app", "navigation"])) if (block.includes("...")) return unread;
158434
158648
  for (const m2 of code.matchAll(/\b(?:declaredCapabilities|declared_capabilities)["']?\s*:\s*/g)) {
158435
158649
  const rest = code.slice(m2.index + m2[0].length);
158436
- const literal = /^(\[[^\]]*\])\s*(?=[,}])/.exec(rest)?.[1];
158650
+ const literal2 = /^(\[[^\]]*\])\s*(?=[,}])/.exec(rest)?.[1];
158437
158651
  let ids;
158438
158652
  try {
158439
- ids = literal ? JSON.parse(literal) : void 0;
158653
+ ids = literal2 ? JSON.parse(literal2) : void 0;
158440
158654
  } catch {
158441
158655
  ids = void 0;
158442
158656
  }
@@ -158473,11 +158687,11 @@ function configWithoutComments(text15) {
158473
158687
  }
158474
158688
  return parts.join("") + text15.slice(end);
158475
158689
  }
158476
- function jsonString(literal, what) {
158690
+ function jsonString(literal2, what) {
158477
158691
  try {
158478
- return JSON.parse(literal);
158692
+ return JSON.parse(literal2);
158479
158693
  } catch (e2) {
158480
- throw new TrimRefusal(`${what} ${literal} is not a valid JSON string (${e2.message}) \u2014 trim reads the shape \`himi init\` writes; fix the literal or trim by hand (\`himi docs trim-a-template\`)`);
158694
+ throw new TrimRefusal(`${what} ${literal2} is not a valid JSON string (${e2.message}) \u2014 trim reads the shape \`himi init\` writes; fix the literal or trim by hand (\`himi docs trim-a-template\`)`);
158481
158695
  }
158482
158696
  }
158483
158697
  function bracketEnd(src, open) {
@@ -159092,13 +159306,13 @@ function planTrim(src, keepIds, links) {
159092
159306
  const dirs = new Set(src.workerDirs);
159093
159307
  const removedWorkers = sorted(removedRoutes.flatMap((r3) => r3.bundles).filter((b2) => dirs.has(b2) && !keptWorkers.has(b2)));
159094
159308
  const workerRefs = [];
159095
- const literal = /(["'`])([A-Za-z_][A-Za-z0-9_]*[_/]?)(?=\1|\$\{)/g;
159309
+ const literal2 = /(["'`])([A-Za-z_][A-Za-z0-9_]*[_/]?)(?=\1|\$\{)/g;
159096
159310
  for (const rel of Object.keys(src.workerFiles).sort()) {
159097
159311
  const dir = rel.split("/")[1];
159098
159312
  if (!keptWorkers.has(dir) || !dirs.has(dir)) continue;
159099
159313
  const lines = src.workerFiles[rel].split("\n");
159100
159314
  lines.forEach((line, i2) => {
159101
- for (const m2 of line.matchAll(literal)) {
159315
+ for (const m2 of line.matchAll(literal2)) {
159102
159316
  const token = m2[2];
159103
159317
  const prefix = /[_/]$/.test(token);
159104
159318
  const route = prefix ? app.templated.find((r3) => r3.re.test(`${token}x`)) : resolveIn(app, token);
@@ -160482,9 +160696,9 @@ function unwrap(node3) {
160482
160696
  }
160483
160697
  return current;
160484
160698
  }
160485
- function lookup3(literal, name) {
160699
+ function lookup3(literal2, name) {
160486
160700
  let found = { kind: "absent" };
160487
- for (const p2 of literal.properties) {
160701
+ for (const p2 of literal2.properties) {
160488
160702
  const key3 = p2.name && (ts7.isIdentifier(p2.name) || ts7.isStringLiteral(p2.name)) ? p2.name.text : void 0;
160489
160703
  if (ts7.isPropertyAssignment(p2) && key3 === name) found = { kind: "written", node: p2 };
160490
160704
  else if (ts7.isSpreadAssignment(p2) || p2.name && ts7.isComputedPropertyName(p2.name) || key3 === name) found = { kind: "opaque" };
@@ -160492,22 +160706,22 @@ function lookup3(literal, name) {
160492
160706
  return found;
160493
160707
  }
160494
160708
  function stringValue(node3, name) {
160495
- const literal = unwrap(node3);
160496
- const found = ts7.isObjectLiteralExpression(literal) ? lookup3(literal, name) : void 0;
160709
+ const literal2 = unwrap(node3);
160710
+ const found = ts7.isObjectLiteralExpression(literal2) ? lookup3(literal2, name) : void 0;
160497
160711
  const value2 = found?.kind === "written" ? found.node.initializer : void 0;
160498
160712
  return value2 && ts7.isStringLiteralLike(value2) ? value2.text : void 0;
160499
160713
  }
160500
- function appendProperties(literal, file2, lines) {
160714
+ function appendProperties(literal2, file2, lines) {
160501
160715
  const inline = () => lines.filter((line) => !line.trimStart().startsWith("//")).join(" ");
160502
- if (literal.properties.length === 0) {
160503
- const at3 = literal.getStart(file2) + 1;
160504
- return { at: at3, end: literal.end - 1, text: ` ${inline().replace(/,$/, "")} ` };
160716
+ if (literal2.properties.length === 0) {
160717
+ const at3 = literal2.getStart(file2) + 1;
160718
+ return { at: at3, end: literal2.end - 1, text: ` ${inline().replace(/,$/, "")} ` };
160505
160719
  }
160506
- const last = literal.properties[literal.properties.length - 1];
160507
- const trailing = literal.properties.hasTrailingComma;
160508
- const at2 = trailing ? literal.properties.end : last.end;
160720
+ const last = literal2.properties[literal2.properties.length - 1];
160721
+ const trailing = literal2.properties.hasTrailingComma;
160722
+ const at2 = trailing ? literal2.properties.end : last.end;
160509
160723
  const lead = trailing ? "" : ",";
160510
- if (onOneLine(literal, file2)) {
160724
+ if (onOneLine(literal2, file2)) {
160511
160725
  const text15 = inline();
160512
160726
  return { at: at2, end: at2, text: `${lead} ${trailing ? text15 : text15.replace(/,$/, "")}` };
160513
160727
  }
@@ -160636,8 +160850,8 @@ function planPush(app, pingAppName, plan) {
160636
160850
  }
160637
160851
  }
160638
160852
  function planRetiredFamily(block, plan) {
160639
- const literal = unwrap(block);
160640
- const found = ts8.isObjectLiteralExpression(literal) ? lookup3(literal, "pingAppName") : void 0;
160853
+ const literal2 = unwrap(block);
160854
+ const found = ts8.isObjectLiteralExpression(literal2) ? lookup3(literal2, "pingAppName") : void 0;
160641
160855
  const value2 = found?.kind === "written" ? unwrap(found.node.initializer) : void 0;
160642
160856
  const replacement = value2 && ts8.isStringLiteralLike(value2) ? replacementPingFamily(value2.text) : void 0;
160643
160857
  if (!value2 || !replacement) return;
@@ -162192,15 +162406,15 @@ function loadMemory2(dir) {
162192
162406
  for (const t2 of m2.timeline) {
162193
162407
  if (!isObj3(t2)) continue;
162194
162408
  const file2 = historyName(t2.sha, t2.ext);
162195
- const ts20 = str5(t2.ts);
162409
+ const ts21 = str5(t2.ts);
162196
162410
  const id = str5(t2.id);
162197
- if (file2 && ts20 && id) timeline.push({ ts: ts20, id, file: file2 });
162411
+ if (file2 && ts21 && id) timeline.push({ ts: ts21, id, file: file2 });
162198
162412
  }
162199
162413
  return { createdAt: str5(m2.createdAt), shots, timeline };
162200
162414
  }
162201
- function captionAt(entries, ts20) {
162415
+ function captionAt(entries, ts21) {
162202
162416
  let best = null;
162203
- for (const e2 of entries) if (e2.ts <= ts20) best = e2;
162417
+ for (const e2 of entries) if (e2.ts <= ts21) best = e2;
162204
162418
  return best ? best.message : null;
162205
162419
  }
162206
162420
  function thin(items, max) {
@@ -162320,13 +162534,13 @@ function duration(ms2) {
162320
162534
  const m2 = Math.round(ms2 / 6e4);
162321
162535
  return m2 < 60 ? `${m2} min` : `${Math.floor(m2 / 60)} h ${m2 % 60} min`;
162322
162536
  }
162323
- function utcDay(ts20) {
162324
- const d2 = new Date(ts20);
162537
+ function utcDay(ts21) {
162538
+ const d2 = new Date(ts21);
162325
162539
  return Number.isNaN(d2.getTime()) ? "" : `${d2.toUTCString().slice(0, 16)} (UTC)`;
162326
162540
  }
162327
- function sinceStart(start, ts20) {
162541
+ function sinceStart(start, ts21) {
162328
162542
  if (!start) return "";
162329
- const s2 = Math.max(0, Math.round((Date.parse(ts20) - Date.parse(start)) / 1e3));
162543
+ const s2 = Math.max(0, Math.round((Date.parse(ts21) - Date.parse(start)) / 1e3));
162330
162544
  const h2 = Math.floor(s2 / 3600);
162331
162545
  const m2 = Math.floor(s2 % 3600 / 60);
162332
162546
  const sec = String(s2 % 60).padStart(2, "0");
@@ -162336,7 +162550,7 @@ function renderReel(plan, images) {
162336
162550
  const img = (f2, alt, cls = "") => f2 && images.has(f2) ? `<img class="${cls}" src="${images.get(f2)}" alt="${escapeHtml(alt)}">` : "";
162337
162551
  const count2 = (n2) => escapeHtml(String(Number.isSafeInteger(n2) && n2 >= 0 ? n2 : 0));
162338
162552
  const accent = ACCENT.test(plan.accent) ? plan.accent : DEFAULT_ACCENT;
162339
- const clock = (ts20) => sinceStart(plan.startedAt, ts20);
162553
+ const clock = (ts21) => sinceStart(plan.startedAt, ts21);
162340
162554
  const frames = plan.frames.filter((f2) => images.has(f2.file));
162341
162555
  const flip = frames.length ? `<section class="flip"><div class="phone">${frames.map((f2, i2) => `<img class="fr${i2 === 0 ? " on" : ""}" src="${images.get(f2.file)}" alt="${escapeHtml(plan.focusId ?? "")} at ${clock(f2.ts)}">`).join("")}</div>
162342
162556
  <div class="flipcap"><div class="t" id="ft">${frames[0] ? clock(frames[0].ts) : ""}</div><div id="fc">${escapeHtml(frames[0]?.caption ?? "")}</div><div class="bar"><div id="fb"></div></div></div></section>` : `<p class="muted">No screen versions were recorded \u2014 open the build board with <code>himi studio</code> before building to capture them.</p>`;
@@ -163918,18 +164132,18 @@ function configuredTokensPath(dir) {
163918
164132
  }
163919
164133
  function tokenNumericIssues(tokens2, tokensPath = "tokens.json") {
163920
164134
  const issues = [];
163921
- const isRecord4 = (v2) => v2 !== null && typeof v2 === "object" && !Array.isArray(v2);
163922
- if (!isRecord4(tokens2)) return issues;
164135
+ const isRecord5 = (v2) => v2 !== null && typeof v2 === "object" && !Array.isArray(v2);
164136
+ if (!isRecord5(tokens2)) return issues;
163923
164137
  const shown2 = (v2) => typeof v2 === "string" ? JSON.stringify(v2) : JSON.stringify(v2) ?? String(v2);
163924
164138
  const bad2 = (v2) => !(typeof v2 === "number" && Number.isInteger(v2));
163925
164139
  const check = (layer, where) => {
163926
- if (!isRecord4(layer)) return;
164140
+ if (!isRecord5(layer)) return;
163927
164141
  const loses = where ? `the ${where.slice(0, -1)} overlay is dropped on device and the base look is used instead` : 'iOS and Android reject the WHOLE tokens.json otherwise ("Theme unavailable" on iOS, the default palette and fonts on Android)';
163928
164142
  for (const { group, field, unit } of INTEGER_TOKEN_FIELDS) {
163929
164143
  const entries = layer[group];
163930
- if (!isRecord4(entries)) continue;
164144
+ if (!isRecord5(entries)) continue;
163931
164145
  for (const [name, token] of Object.entries(entries)) {
163932
- if (!isRecord4(token) || !(field in token)) continue;
164146
+ if (!isRecord5(token) || !(field in token)) continue;
163933
164147
  const value2 = token[field];
163934
164148
  if (!bad2(value2)) continue;
163935
164149
  const path2 = `${where}${group}.${name}.${field}`;
@@ -163945,7 +164159,7 @@ function tokenNumericIssues(tokens2, tokensPath = "tokens.json") {
163945
164159
  }
163946
164160
  for (const group of INTEGER_TOKEN_MAPS) {
163947
164161
  const entries = layer[group];
163948
- if (!isRecord4(entries)) continue;
164162
+ if (!isRecord5(entries)) continue;
163949
164163
  for (const [name, value2] of Object.entries(entries)) {
163950
164164
  if (!bad2(value2)) continue;
163951
164165
  const fix = typeof value2 === "number" && Number.isFinite(value2) ? ` Write ${Math.round(value2)}.` : "";
@@ -163961,7 +164175,7 @@ function tokenNumericIssues(tokens2, tokensPath = "tokens.json") {
163961
164175
  };
163962
164176
  check(tokens2, "");
163963
164177
  const idiom = tokens2.idiom;
163964
- if (isRecord4(idiom)) {
164178
+ if (isRecord5(idiom)) {
163965
164179
  for (const [overlay, layer] of Object.entries(idiom)) check(layer, `idiom.${overlay}.`);
163966
164180
  }
163967
164181
  return issues;
@@ -165917,8 +166131,8 @@ function rotateHue(hex2, deg) {
165917
166131
  return "#" + rgb.map((v2) => Math.max(0, Math.min(255, v2)).toString(16).padStart(2, "0")).join("");
165918
166132
  }
165919
166133
  function resolveTokensPath(app, configTs) {
165920
- const literal = /^ {2}designTokensPath\s*:\s*["']([^"']+)["']/m.exec(stripComments(configTs))?.[1];
165921
- if (literal) return { path: resolve49(appDir(app), literal), source: "declared" };
166134
+ const literal2 = /^ {2}designTokensPath\s*:\s*["']([^"']+)["']/m.exec(stripComments(configTs))?.[1];
166135
+ if (literal2) return { path: resolve49(appDir(app), literal2), source: "declared" };
165922
166136
  return { path: join57(appDir(app), "tokens.json"), source: "assumed" };
165923
166137
  }
165924
166138
  function resolveToken(app, token, tokensPathOverride) {
@@ -166928,17 +167142,17 @@ function requireInt() {
166928
167142
  construct: constructYamlInteger,
166929
167143
  predicate: isInteger,
166930
167144
  represent: {
166931
- binary: function(obj12) {
166932
- return obj12 >= 0 ? "0b" + obj12.toString(2) : "-0b" + obj12.toString(2).slice(1);
167145
+ binary: function(obj13) {
167146
+ return obj13 >= 0 ? "0b" + obj13.toString(2) : "-0b" + obj13.toString(2).slice(1);
166933
167147
  },
166934
- octal: function(obj12) {
166935
- return obj12 >= 0 ? "0o" + obj12.toString(8) : "-0o" + obj12.toString(8).slice(1);
167148
+ octal: function(obj13) {
167149
+ return obj13 >= 0 ? "0o" + obj13.toString(8) : "-0o" + obj13.toString(8).slice(1);
166936
167150
  },
166937
- decimal: function(obj12) {
166938
- return obj12.toString(10);
167151
+ decimal: function(obj13) {
167152
+ return obj13.toString(10);
166939
167153
  },
166940
- hexadecimal: function(obj12) {
166941
- return obj12 >= 0 ? "0x" + obj12.toString(16).toUpperCase() : "-0x" + obj12.toString(16).toUpperCase().slice(1);
167154
+ hexadecimal: function(obj13) {
167155
+ return obj13 >= 0 ? "0x" + obj13.toString(16).toUpperCase() : "-0x" + obj13.toString(16).toUpperCase().slice(1);
166942
167156
  }
166943
167157
  },
166944
167158
  defaultStyle: "decimal",
@@ -167204,8 +167418,8 @@ function requireBinary() {
167204
167418
  }
167205
167419
  return result;
167206
167420
  }
167207
- function isBinary(obj12) {
167208
- return Object.prototype.toString.call(obj12) === "[object Uint8Array]";
167421
+ function isBinary(obj13) {
167422
+ return Object.prototype.toString.call(obj13) === "[object Uint8Array]";
167209
167423
  }
167210
167424
  binary = new Type22("tag:yaml.org,2002:binary", {
167211
167425
  kind: "scalar",
@@ -167351,8 +167565,8 @@ function requireLoader() {
167351
167565
  const PATTERN_FLOW_INDICATORS = /[,\[\]{}]/;
167352
167566
  const PATTERN_TAG_HANDLE = /^(?:!|!!|![0-9A-Za-z-]+!)$/;
167353
167567
  const PATTERN_TAG_URI = /^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;
167354
- function _class(obj12) {
167355
- return Object.prototype.toString.call(obj12);
167568
+ function _class(obj13) {
167569
+ return Object.prototype.toString.call(obj13);
167356
167570
  }
167357
167571
  function isEol(c2) {
167358
167572
  return c2 === 10 || c2 === 13;
@@ -171809,7 +172023,7 @@ function navPathError(raw, opts = {}) {
171809
172023
  function navConfigPathErrors(config) {
171810
172024
  const errors = [];
171811
172025
  const list2 = (v2) => Array.isArray(v2) ? v2.flatMap((x2, i2) => x2 !== null && typeof x2 === "object" ? [[x2, i2]] : []) : [];
171812
- const obj12 = (v2) => v2 !== null && typeof v2 === "object" && !Array.isArray(v2) ? v2 : void 0;
172026
+ const obj13 = (v2) => v2 !== null && typeof v2 === "object" && !Array.isArray(v2) ? v2 : void 0;
171813
172027
  const check = (where, raw, allowApp = true) => {
171814
172028
  const e2 = navPathError(raw, { allowApp });
171815
172029
  if (e2) errors.push(`${where}: ${e2}`);
@@ -171818,7 +172032,7 @@ function navConfigPathErrors(config) {
171818
172032
  check(`${where}.hiddenPath`, it2.hiddenPath, false);
171819
172033
  check(`${where}.labelPath`, it2.labelPath);
171820
172034
  check(`${where}.iconPath`, it2.iconPath);
171821
- check(`${where}.badge.valuePath`, obj12(it2.badge)?.valuePath);
172035
+ check(`${where}.badge.valuePath`, obj13(it2.badge)?.valuePath);
171822
172036
  if (it2.hiddenUntilResolved && !it2.hiddenPath) {
171823
172037
  errors.push(`${where}: hiddenUntilResolved without hiddenPath can never resolve, so the item would never show`);
171824
172038
  }
@@ -171829,30 +172043,30 @@ function navConfigPathErrors(config) {
171829
172043
  check(`${where}.subtitlePath`, h2.subtitlePath);
171830
172044
  check(`${where}.imageUrlPath`, h2.imageUrlPath);
171831
172045
  };
171832
- for (const [it2, i2] of list2(obj12(config.tabBar)?.items)) item(`tabBar.items[${i2}] "${it2.id}"`, it2);
171833
- for (const [it2, i2] of list2(obj12(config.sidebar)?.items)) item(`sidebar.items[${i2}] "${it2.id}"`, it2);
171834
- for (const [it2, i2] of list2(obj12(config.drawer)?.items)) item(`drawer.items[${i2}] "${it2.id}"`, it2);
171835
- for (const [it2, i2] of list2(obj12(config.topBarDefault)?.actions)) item(`topBarDefault.actions[${i2}] "${it2.id}"`, it2);
171836
- header("drawer.header", obj12(obj12(config.drawer)?.header));
171837
- const sidebarHeader = obj12(obj12(config.sidebar)?.header);
172046
+ for (const [it2, i2] of list2(obj13(config.tabBar)?.items)) item(`tabBar.items[${i2}] "${it2.id}"`, it2);
172047
+ for (const [it2, i2] of list2(obj13(config.sidebar)?.items)) item(`sidebar.items[${i2}] "${it2.id}"`, it2);
172048
+ for (const [it2, i2] of list2(obj13(config.drawer)?.items)) item(`drawer.items[${i2}] "${it2.id}"`, it2);
172049
+ for (const [it2, i2] of list2(obj13(config.topBarDefault)?.actions)) item(`topBarDefault.actions[${i2}] "${it2.id}"`, it2);
172050
+ header("drawer.header", obj13(obj13(config.drawer)?.header));
172051
+ const sidebarHeader = obj13(obj13(config.sidebar)?.header);
171838
172052
  header("sidebar.header", sidebarHeader);
171839
172053
  for (const key3 of ["titlePath", "subtitlePath", "imageUrlPath"]) {
171840
172054
  if (sidebarHeader?.[key3]) {
171841
172055
  errors.push(`sidebar.header.${key3}: sidebar header bindings are not rendered yet (#4116) \u2014 bind drawer.header, which the sidebar shows`);
171842
172056
  }
171843
172057
  }
171844
- check("topBarLogo.imageUrlPath", obj12(config.topBarLogo)?.imageUrlPath);
172058
+ check("topBarLogo.imageUrlPath", obj13(config.topBarLogo)?.imageUrlPath);
171845
172059
  const firstOf = (v2, skip = false) => list2(v2).find(([it2]) => !skip || it2.role !== "section" && it2.role !== "note");
171846
- const tabs = firstOf(obj12(config.tabBar)?.items);
172060
+ const tabs = firstOf(obj13(config.tabBar)?.items);
171847
172061
  const kind = typeof config.navKind === "string" ? config.navKind : "";
171848
- const rail = kind === "drawer" ? void 0 : firstOf(obj12(config.sidebar)?.items);
172062
+ const rail = kind === "drawer" ? void 0 : firstOf(obj13(config.sidebar)?.items);
171849
172063
  const homes = [];
171850
172064
  if (tabs && !(kind === "sidebar" && rail)) homes.push(["tabBar.items", tabs]);
171851
172065
  if (rail && (kind === "sidebar" || kind === "responsive" || !tabs)) homes.push(["sidebar.items", rail]);
171852
172066
  if (!tabs && !rail) {
171853
172067
  const home = typeof config.homeScreenId === "string" && config.homeScreenId.length > 0 ? config.homeScreenId : void 0;
171854
- const rows = list2(obj12(config.drawer)?.items);
171855
- const row2 = home !== void 0 ? rows.find(([it2]) => it2.screenId === home) : firstOf(obj12(config.drawer)?.items, true);
172068
+ const rows = list2(obj13(config.drawer)?.items);
172069
+ const row2 = home !== void 0 ? rows.find(([it2]) => it2.screenId === home) : firstOf(obj13(config.drawer)?.items, true);
171856
172070
  homes.push(["drawer.items", row2]);
171857
172071
  }
171858
172072
  for (const [where, first] of homes) {
@@ -178572,12 +178786,12 @@ __export(input_evidence_isolation_exports, {
178572
178786
  runInputEvidenceChild: () => runInputEvidenceChild
178573
178787
  });
178574
178788
  async function installInputEvidenceIsolation(dir) {
178575
- const { lstatSync: lstatSync30, readdirSync: readdirSync47 } = await import("node:fs");
178789
+ const { lstatSync: lstatSync30, readdirSync: readdirSync48 } = await import("node:fs");
178576
178790
  const { join: join144 } = await import("node:path");
178577
178791
  const check = (path2) => {
178578
178792
  const stat2 = lstatSync30(path2);
178579
178793
  if (stat2.isSymbolicLink()) throw new Error("input evidence requires a content tree without symlinks");
178580
- if (stat2.isDirectory()) for (const name of readdirSync47(path2)) check(join144(path2, name));
178794
+ if (stat2.isDirectory()) for (const name of readdirSync48(path2)) check(join144(path2, name));
178581
178795
  };
178582
178796
  check(dir);
178583
178797
  const { requireBuildConfinement: requireBuildConfinement2 } = await Promise.resolve().then(() => (init_build_lib(), build_lib_exports));
@@ -178646,9 +178860,9 @@ async function runInputEvidenceChild(ctx) {
178646
178860
  }
178647
178861
  }
178648
178862
  async function inputEvidenceSourceArchiveHash(dir) {
178649
- const { createHash: createHash60 } = await import("node:crypto");
178863
+ const { createHash: createHash61 } = await import("node:crypto");
178650
178864
  const { collectAppSource: collectAppSource2, zipAppSource: zipAppSource2 } = await Promise.resolve().then(() => (init_app_source(), app_source_exports));
178651
- return createHash60("sha256").update(zipAppSource2(collectAppSource2(dir).entries).toString("base64")).digest("hex");
178865
+ return createHash61("sha256").update(zipAppSource2(collectAppSource2(dir).entries).toString("base64")).digest("hex");
178652
178866
  }
178653
178867
  var init_input_evidence_isolation = __esm({
178654
178868
  "src/input-evidence-isolation.ts"() {
@@ -180315,12 +180529,12 @@ function appObject(source) {
180315
180529
  function patchConfig(configText, counters) {
180316
180530
  const topBar = { actions: counters.map(headerBadgeAction) };
180317
180531
  const bundle = headerBadgesBundleRef();
180318
- const literal = (value2, indent2) => JSON.stringify(value2, null, 2).replaceAll("\n", `
180532
+ const literal2 = (value2, indent2) => JSON.stringify(value2, null, 2).replaceAll("\n", `
180319
180533
  ${indent2}`);
180320
180534
  const source = ts11.createSourceFile("config.ts", configText, ts11.ScriptTarget.Latest, true, ts11.ScriptKind.TS);
180321
180535
  const diagnostics = source.parseDiagnostics;
180322
- const snippetFor = (indent2) => `${indent2}"topBarDefault": ${literal(topBar, indent2)},
180323
- ${indent2}"navLogicBundle": ${literal(bundle, indent2)},`;
180536
+ const snippetFor = (indent2) => `${indent2}"topBarDefault": ${literal2(topBar, indent2)},
180537
+ ${indent2}"navLogicBundle": ${literal2(bundle, indent2)},`;
180324
180538
  if (diagnostics.length) return { status: "manual", reason: "config.ts could not be parsed", snippet: snippetFor(" ") };
180325
180539
  const app = appObject(source);
180326
180540
  const navigationProperty = app && findProperty(app, "navigation");
@@ -180342,7 +180556,7 @@ ${indent2}"navLogicBundle": ${literal(bundle, indent2)},`;
180342
180556
  const existingText = existingBar === void 0 ? void 0 : squash(existingBar.initializer.getText(source));
180343
180557
  const same3 = existingBar !== void 0 && sameBundle && (existingText === squash(JSON.stringify(topBar)) || existingText === squash(JSON.stringify(inboxBar)));
180344
180558
  if (!existingBar && sameBundle) {
180345
- const barOnly = `${indent}"topBarDefault": ${literal(topBar, indent)},`;
180559
+ const barOnly = `${indent}"topBarDefault": ${literal2(topBar, indent)},`;
180346
180560
  const at2 = navigation.getStart(source) + 1;
180347
180561
  return { status: "written", text: `${configText.slice(0, at2)}
180348
180562
  ${barOnly}${configText.slice(at2)}`, snippet: snippet4 };
@@ -186440,12 +186654,12 @@ ${releaseId}`;
186440
186654
  }
186441
186655
  function sendDoc(request, body, pinned = false) {
186442
186656
  const etag = strongEtag(body);
186443
- const cache2 = pinned ? PINNED_CACHE_CONTROL : DOC_CACHE_CONTROL;
186657
+ const cache3 = pinned ? PINNED_CACHE_CONTROL : DOC_CACHE_CONTROL;
186444
186658
  const vary = pinned ? { vary: "x-himalaya-release" } : {};
186445
186659
  if (request.headers.get("if-none-match") === etag) {
186446
- return new Response(null, { status: 304, headers: { etag, "cache-control": cache2, ...vary } });
186660
+ return new Response(null, { status: 304, headers: { etag, "cache-control": cache3, ...vary } });
186447
186661
  }
186448
- return new Response(body, { status: 200, headers: { "content-type": JSON_CT3, etag, "cache-control": cache2, ...vary } });
186662
+ return new Response(body, { status: 200, headers: { "content-type": JSON_CT3, etag, "cache-control": cache3, ...vary } });
186449
186663
  }
186450
186664
  async function draftPreviewOnly(request, url, noStore) {
186451
186665
  const refuse7 = (status, error) => ({ ok: false, response: json6(status, { error }, noStore) });
@@ -187135,13 +187349,13 @@ ${releaseId}`;
187135
187349
  const bytes2 = await store.getSource(app, m2.sourceHash);
187136
187350
  if (!bytes2) return json6(404, { error: "template_source_not_found", app });
187137
187351
  const etag = `"${m2.sourceHash}"`;
187138
- const cache2 = { "cache-control": pin ? PINNED_CACHE_CONTROL : DOC_CACHE_CONTROL, ...pin ? { vary: "x-himalaya-release" } : {} };
187352
+ const cache3 = { "cache-control": pin ? PINNED_CACHE_CONTROL : DOC_CACHE_CONTROL, ...pin ? { vary: "x-himalaya-release" } : {} };
187139
187353
  if (request.headers.get("if-none-match") === etag) {
187140
- return new Response(null, { status: 304, headers: { etag, ...cache2 } });
187354
+ return new Response(null, { status: 304, headers: { etag, ...cache3 } });
187141
187355
  }
187142
187356
  return new Response(bytes2, {
187143
187357
  status: 200,
187144
- headers: { "content-type": JSON_CT3, etag, ...cache2, "x-himalaya-app": app }
187358
+ headers: { "content-type": JSON_CT3, etag, ...cache3, "x-himalaya-app": app }
187145
187359
  });
187146
187360
  }
187147
187361
  if (path2 === "/v1/authoring-docs" || /^\/v1\/authoring-docs\/(spec|mobile-ux)$/.test(path2)) {
@@ -187277,12 +187491,12 @@ ${releaseId}`;
187277
187491
  }
187278
187492
  const cfgTag = ringPinned ? sha256hex2(JSON.stringify(appConfig)) : mm.appConfigHash ?? "";
187279
187493
  const etag = strongEtag(`${mm.releaseId}:${cfgTag}:${mm.tokensHash ?? ""}:${screenHash}:${homeBundle?.sha256 ?? ""}`);
187280
- const cache2 = pin && !ringPinned ? PINNED_CACHE_CONTROL : DOC_CACHE_CONTROL;
187494
+ const cache3 = pin && !ringPinned ? PINNED_CACHE_CONTROL : DOC_CACHE_CONTROL;
187281
187495
  const vary = pin ? { vary: ringPinned ? `x-himalaya-release, ${RELEASE_SOURCE_HEADER}` : "x-himalaya-release" } : {};
187282
187496
  if (request.headers.get("if-none-match") === etag) {
187283
- return new Response(null, { status: 304, headers: { etag, "cache-control": cache2, ...vary } });
187497
+ return new Response(null, { status: 304, headers: { etag, "cache-control": cache3, ...vary } });
187284
187498
  }
187285
- return json6(200, { releaseId: mm.releaseId, app, appConfig, tokens: tokens2, homeScreenId, screen, homeBundle }, { etag, "cache-control": cache2, ...vary });
187499
+ return json6(200, { releaseId: mm.releaseId, app, appConfig, tokens: tokens2, homeScreenId, screen, homeBundle }, { etag, "cache-control": cache3, ...vary });
187286
187500
  }
187287
187501
  if (path2 === "/v1/tokens") {
187288
187502
  if (!app) return json6(400, { error: "missing_app" });
@@ -187441,16 +187655,16 @@ ${releaseId}`;
187441
187655
  const meta = m2?.widgets?.[widgetId];
187442
187656
  if (!m2 || !meta) return json6(404, { error: "widget_not_found", widgetId });
187443
187657
  const etag = `"${meta.contentEtag}"`;
187444
- const cache2 = pin ? PINNED_CACHE_CONTROL : `max-age=${meta.ttlSeconds}`;
187658
+ const cache3 = pin ? PINNED_CACHE_CONTROL : `max-age=${meta.ttlSeconds}`;
187445
187659
  const vary = pin ? { vary: "x-himalaya-release" } : {};
187446
187660
  if (request.headers.get("if-none-match") === etag) {
187447
- return new Response(null, { status: 304, headers: { etag, "cache-control": cache2, ...vary, ...widgetScope } });
187661
+ return new Response(null, { status: 304, headers: { etag, "cache-control": cache3, ...vary, ...widgetScope } });
187448
187662
  }
187449
187663
  const body = await store.getWidget(app, widgetId);
187450
187664
  if (!body) return json6(404, { error: "widget_not_found", widgetId });
187451
187665
  return new Response(body, {
187452
187666
  status: 200,
187453
- headers: { "content-type": JSON_CT3, etag, "cache-control": cache2, ...vary, "x-himalaya-app": app, ...widgetScope }
187667
+ headers: { "content-type": JSON_CT3, etag, "cache-control": cache3, ...vary, "x-himalaya-app": app, ...widgetScope }
187454
187668
  });
187455
187669
  }
187456
187670
  return json6(404, { error: "not_found" });
@@ -187972,48 +188186,48 @@ var init_preview_assets_generated = __esm({
187972
188186
  init_define_HHP_CATALOG();
187973
188187
  init_preview_assets_format();
187974
188188
  PREVIEW_ASSET_MANIFEST = [
187975
- { key: "assets/DashboardHost-C7NgWR_I.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 2971, sha256: "0f671123b1263a1e092b422bf41cf7c1c989125a92157f22f118d438e35c0f07" },
187976
- { key: "assets/DevDrawer-DXJObZXe.js", contentType: "application/javascript; charset=utf-8", offset: 2979, length: 16783, sha256: "b630575a1a020fe22d5c77f90a023d23212566ec6d1ba9c7e8563df91968622c" },
187977
- { key: "assets/IdiomCompare-BhFyn8Hc.js", contentType: "application/javascript; charset=utf-8", offset: 19762, length: 1926, sha256: "3aa6bfad15b5d10cf8a6a5364415e7a38730834d8acc1c5a63171d07068799e5" },
187978
- { key: "assets/LightboxViewer-D3Pk5IY4.js", contentType: "application/javascript; charset=utf-8", offset: 21688, length: 8171, sha256: "455821ac6479ff0669a874daadc8a9df2a8c1284dca80d2c231bb7c45f44a75c" },
187979
- { key: "assets/OfflineReadingBar-BJl_ZZ9T.js", contentType: "application/javascript; charset=utf-8", offset: 29859, length: 1707, sha256: "9d8bd62505b74252dd89c837d76582bafc79f3b54a508319b2a43b26838b8dda" },
187980
- { key: "assets/PhonePreviewControl-jCjzwLLv.js", contentType: "application/javascript; charset=utf-8", offset: 31566, length: 37851, sha256: "844843a49db745b762e8ac3377dae5476e3e120dcc1a5a6132d26fbbb0dccdc6" },
187981
- { key: "assets/SchemeCompare-B6_C9AHk.js", contentType: "application/javascript; charset=utf-8", offset: 69417, length: 1858, sha256: "e57904ddbcbafb32bfe203489368911c42796b47d29fa75a834a53ffbe0c22d9" },
187982
- { key: "assets/WixFrogTelemetrySink-SVoH8taa.js", contentType: "application/javascript; charset=utf-8", offset: 71275, length: 4492, sha256: "380a3e1b7aab467edb8d7a1c86d179eab0e5a931c5adae2d525cedaba726cd2a" },
187983
- { key: "assets/calendar-ics-BvfIYWjG.js", contentType: "application/javascript; charset=utf-8", offset: 75767, length: 2192, sha256: "1636167041e9829ceccd3544297b86b8475c38bd2f759c4dbc17c813dc6e9254" },
187984
- { key: "assets/catalog-CAoUWITw.js", contentType: "application/javascript; charset=utf-8", offset: 77959, length: 26046, sha256: "4c270ca3051f77d761aef1297125e02339d48493dd2b84a0cacf0faf41aa8cb3" },
187985
- { key: "assets/catalogFontFaces-BvWS8pXE.js", contentType: "application/javascript; charset=utf-8", offset: 104005, length: 1111, sha256: "bb7d7ac7c488caa37ab96a3d286cbfb9751b8d8c4422006aee8727fbc2cb5dfb" },
187986
- { key: "assets/contacts-vcard-BcohPQ0m.js", contentType: "application/javascript; charset=utf-8", offset: 105116, length: 2567, sha256: "c4ff75e96cd909bbb9182c5dc78794fcebc65139fbddef2537711d774fb33ad0" },
187987
- { key: "assets/files-transfer-d7_Fb4VG.js", contentType: "application/javascript; charset=utf-8", offset: 107683, length: 6446, sha256: "bde8a606ae1e76d1594a9113440b4672dd5e9c4af61b38ec729a8470f3026be2" },
187988
- { key: "assets/frogApiRules-CLamKfpd.js", contentType: "application/javascript; charset=utf-8", offset: 114129, length: 2207, sha256: "20b38da11e78993663e203625862b2bc5b5f6295f4528d76845de36c89439694" },
187989
- { key: "assets/glassPreviewBrowser-DONaOehd.js", contentType: "application/javascript; charset=utf-8", offset: 116336, length: 6578, sha256: "4402c4cddd2a564e7466cdf1e12a0e0277c0400b288e1e5eda1d23e797599d31" },
187990
- { key: "assets/image-preparation-Cj4gldm6.js", contentType: "application/javascript; charset=utf-8", offset: 122914, length: 2704, sha256: "32944ea587c2f3b84389b66b50a850437560238f1c8d33b6275973ee04eee865" },
187991
- { key: "assets/index-BxJfz-MQ.js", contentType: "application/javascript; charset=utf-8", offset: 125618, length: 1532402, sha256: "b6009cd79cf82014e86b747dbe63240ce582150336062a9891961852b744b011" },
187992
- { key: "assets/jsx-runtime-CdvZGgm7.js", contentType: "application/javascript; charset=utf-8", offset: 1658020, length: 7751, sha256: "42a78b508d0f309f6a4a6efbb8669015211b3c26574c5b0929884c4d9d20b806" },
187993
- { key: "assets/pdf-Bh7e0AqI.js", contentType: "application/javascript; charset=utf-8", offset: 1665771, length: 488215, sha256: "3361f61ce6b490c8b7b252658ea67f733d88c6e9f95906d0e31eea4827141df3" },
187994
- { key: "assets/pdf.worker.min-BGnVRhRG.js", contentType: "application/javascript; charset=utf-8", offset: 2153986, length: 90, sha256: "521a0e528916d678d7588b2cddf3dadd3bb959a6d62426382f61c77a82017e35" },
187995
- { key: "assets/pdf.worker.min-BmVo14Nb.mjs", contentType: "application/javascript; charset=utf-8", offset: 2154076, length: 1317034, sha256: "a33cfe728c584fdba4fcc1fd54bcdc2f9f2f13889ddbb5b2bd1d0f8cbe49b84e" },
187996
- { key: "assets/pdfDocument-C1YEIvpY.js", contentType: "application/javascript; charset=utf-8", offset: 3471110, length: 3470, sha256: "f152f4715d749a4a3812c1c59963611a12cb88655ccd879b10125051304bbdc0" },
187997
- { key: "assets/pdfFetch-Cc8i1I1h.js", contentType: "application/javascript; charset=utf-8", offset: 3474580, length: 2266, sha256: "1d21ad008921942217c9eac0c35b1713773b9d89c71e3ab4412781f7bb88f463" },
187998
- { key: "assets/webviewBridgeHost-DG1j3hvC.js", contentType: "application/javascript; charset=utf-8", offset: 3476846, length: 9888, sha256: "1e62764832280cbe7ef20510607a7154d9de9775b6825c015cc799676cbe3650" },
187999
- { key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 3486734, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
188000
- { key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 3491344, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
188001
- { key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 3979928, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
188002
- { key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 4070852, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
188003
- { key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 4161836, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
188004
- { key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 4252816, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
188005
- { key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 4343688, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
188006
- { key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 4434668, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
188007
- { key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 4543304, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
188008
- { key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 4652388, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
188009
- { key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 4761436, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
188010
- { key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 4869136, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
188011
- { key: "himi-sw.js", contentType: "application/javascript; charset=utf-8", offset: 4957244, length: 6818, sha256: "835250c3d8004f27c2b67f9b471984351ba6df07b916d97e33b43c691200a18c" },
188012
- { key: "index.html", contentType: "text/html; charset=utf-8", offset: 4964062, length: 4924, sha256: "3bd9d83d34671c88e8b6c3f1ce4488d023e70c04fc31657566e8971cfd46486c" },
188013
- { key: "ios-glass-preview.css", contentType: "text/css; charset=utf-8", offset: 4968986, length: 11457, sha256: "6cb2b75264fa5fa2b4d28851878a5eab0712900e8b3a6c2370cc661d6d820805" },
188014
- { key: "kit-tab-bar.css", contentType: "text/css; charset=utf-8", offset: 4980443, length: 1171, sha256: "9e2c3a0faaf05d5471badf167a4d3bdf1c4e6dd65c432eea6d254158bfd99585" },
188015
- { key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 4981614, length: 23047, sha256: "20d1459e3f896f344e478e613d0c979a0de02e81a929a45d3a0ef6a53af36441" },
188016
- { key: "t5-worker-frame.html", contentType: "text/html; charset=utf-8", offset: 5004661, length: 23064, sha256: "8655cfe9c74212ec5dafecb49d2fdeb48b19f1bd8a710091e3e55631f9b4ab06" }
188189
+ { key: "assets/DashboardHost-Bhk9ZjFZ.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 2971, sha256: "e5424ef8c8db026653e276cd4ae414c081961f4de5f8a077c05d2e8b5d54d8bc" },
188190
+ { key: "assets/DevDrawer-ty518RlN.js", contentType: "application/javascript; charset=utf-8", offset: 2979, length: 16783, sha256: "8479451d8a87528be9953cac2570e0f3cec9c278f1fe68a8ff8d2e398bc4db7e" },
188191
+ { key: "assets/IdiomCompare-cUFh10rt.js", contentType: "application/javascript; charset=utf-8", offset: 19762, length: 1926, sha256: "fe557bf07dbbac7bce16d21d3133f8f77e8c8528b3b04a8e1f88c882fc62450c" },
188192
+ { key: "assets/LightboxViewer-Bhvr0K8H.js", contentType: "application/javascript; charset=utf-8", offset: 21688, length: 8171, sha256: "b5288295e778f17f66eeffe1d30d891863a0544f93d851df947c06fcd01fccc7" },
188193
+ { key: "assets/OfflineReadingBar-C8TKAoTW.js", contentType: "application/javascript; charset=utf-8", offset: 29859, length: 1646, sha256: "34fd31200a6ecfdba82fde419a999b338da5c096708eb46e5807937ed57c5d13" },
188194
+ { key: "assets/PhonePreviewControl-ilutBHJo.js", contentType: "application/javascript; charset=utf-8", offset: 31505, length: 37851, sha256: "0f569c93e259369ac7d82f29aa5189547e4e06959031fac866022dfada5eb419" },
188195
+ { key: "assets/SchemeCompare-DYYmzgE4.js", contentType: "application/javascript; charset=utf-8", offset: 69356, length: 1858, sha256: "e697216e4c384e10a4358a0d3ed3887b1e26d858405a9be5ee124823bb559995" },
188196
+ { key: "assets/WixFrogTelemetrySink-BxTLkSSo.js", contentType: "application/javascript; charset=utf-8", offset: 71214, length: 4492, sha256: "cc4a3355e2f1d7e22a5f17d7519b914d6269b496e6c8a4c917fe47decab5c979" },
188197
+ { key: "assets/calendar-ics-BvfIYWjG.js", contentType: "application/javascript; charset=utf-8", offset: 75706, length: 2192, sha256: "1636167041e9829ceccd3544297b86b8475c38bd2f759c4dbc17c813dc6e9254" },
188198
+ { key: "assets/catalog-CAoUWITw.js", contentType: "application/javascript; charset=utf-8", offset: 77898, length: 26046, sha256: "4c270ca3051f77d761aef1297125e02339d48493dd2b84a0cacf0faf41aa8cb3" },
188199
+ { key: "assets/catalogFontFaces-CJWkrWxH.js", contentType: "application/javascript; charset=utf-8", offset: 103944, length: 1111, sha256: "40946c4b64571afe3dc1de58a2c120f5ae2e1b00eec6a6aed7b206de9692ba5a" },
188200
+ { key: "assets/contacts-vcard-BcohPQ0m.js", contentType: "application/javascript; charset=utf-8", offset: 105055, length: 2567, sha256: "c4ff75e96cd909bbb9182c5dc78794fcebc65139fbddef2537711d774fb33ad0" },
188201
+ { key: "assets/files-transfer-ksDbde2e.js", contentType: "application/javascript; charset=utf-8", offset: 107622, length: 6446, sha256: "87624bbbaf23a78f1ae6db386423701af567f76c35b87534ab684e54c59a1a37" },
188202
+ { key: "assets/frogApiRules-DSo2k8IL.js", contentType: "application/javascript; charset=utf-8", offset: 114068, length: 2207, sha256: "7f5c90bc62022f588edfab201b5ddb1522e2edbb6f97784a2b9ea92027185e81" },
188203
+ { key: "assets/glassPreviewBrowser-DONaOehd.js", contentType: "application/javascript; charset=utf-8", offset: 116275, length: 6578, sha256: "4402c4cddd2a564e7466cdf1e12a0e0277c0400b288e1e5eda1d23e797599d31" },
188204
+ { key: "assets/image-preparation-Cj4gldm6.js", contentType: "application/javascript; charset=utf-8", offset: 122853, length: 2704, sha256: "32944ea587c2f3b84389b66b50a850437560238f1c8d33b6275973ee04eee865" },
188205
+ { key: "assets/index-CttPssW7.js", contentType: "application/javascript; charset=utf-8", offset: 125557, length: 1533841, sha256: "f233027cc5b3cc55db5f2b3f5e4fb83b87e342b111220eff276ca3cb69529f18" },
188206
+ { key: "assets/jsx-runtime-CdvZGgm7.js", contentType: "application/javascript; charset=utf-8", offset: 1659398, length: 7751, sha256: "42a78b508d0f309f6a4a6efbb8669015211b3c26574c5b0929884c4d9d20b806" },
188207
+ { key: "assets/pdf-DTUlmBj2.js", contentType: "application/javascript; charset=utf-8", offset: 1667149, length: 488215, sha256: "155f61519885c85d61a39fa595197071a3ca07680da56055ccb1dcff2e709cd1" },
188208
+ { key: "assets/pdf.worker.min-BGnVRhRG.js", contentType: "application/javascript; charset=utf-8", offset: 2155364, length: 90, sha256: "521a0e528916d678d7588b2cddf3dadd3bb959a6d62426382f61c77a82017e35" },
188209
+ { key: "assets/pdf.worker.min-BmVo14Nb.mjs", contentType: "application/javascript; charset=utf-8", offset: 2155454, length: 1317034, sha256: "a33cfe728c584fdba4fcc1fd54bcdc2f9f2f13889ddbb5b2bd1d0f8cbe49b84e" },
188210
+ { key: "assets/pdfDocument-BsLA7FNe.js", contentType: "application/javascript; charset=utf-8", offset: 3472488, length: 3470, sha256: "be3fa08dd50bc021ad840abe7e927ddf10a8a57f9601e03998be2f5b017f3959" },
188211
+ { key: "assets/pdfFetch-Cc8i1I1h.js", contentType: "application/javascript; charset=utf-8", offset: 3475958, length: 2266, sha256: "1d21ad008921942217c9eac0c35b1713773b9d89c71e3ab4412781f7bb88f463" },
188212
+ { key: "assets/webviewBridgeHost-DF4YWFN8.js", contentType: "application/javascript; charset=utf-8", offset: 3478224, length: 9888, sha256: "462e7211739223b1c1e8792f2d539d1b19bf94e041417c89ba206e93ceb8b8a8" },
188213
+ { key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 3488112, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
188214
+ { key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 3492722, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
188215
+ { key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 3981306, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
188216
+ { key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 4072230, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
188217
+ { key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 4163214, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
188218
+ { key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 4254194, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
188219
+ { key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 4345066, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
188220
+ { key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 4436046, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
188221
+ { key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 4544682, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
188222
+ { key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 4653766, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
188223
+ { key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 4762814, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
188224
+ { key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 4870514, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
188225
+ { key: "himi-sw.js", contentType: "application/javascript; charset=utf-8", offset: 4958622, length: 6818, sha256: "835250c3d8004f27c2b67f9b471984351ba6df07b916d97e33b43c691200a18c" },
188226
+ { key: "index.html", contentType: "text/html; charset=utf-8", offset: 4965440, length: 4924, sha256: "385b05cb85e5a7f954e50c398b02f7ba49054ae4409bb0dfe2f4f64ed6ffcd0e" },
188227
+ { key: "ios-glass-preview.css", contentType: "text/css; charset=utf-8", offset: 4970364, length: 11457, sha256: "6cb2b75264fa5fa2b4d28851878a5eab0712900e8b3a6c2370cc661d6d820805" },
188228
+ { key: "kit-tab-bar.css", contentType: "text/css; charset=utf-8", offset: 4981821, length: 1171, sha256: "9e2c3a0faaf05d5471badf167a4d3bdf1c4e6dd65c432eea6d254158bfd99585" },
188229
+ { key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 4982992, length: 23047, sha256: "20d1459e3f896f344e478e613d0c979a0de02e81a929a45d3a0ef6a53af36441" },
188230
+ { key: "t5-worker-frame.html", contentType: "text/html; charset=utf-8", offset: 5006039, length: 23064, sha256: "8655cfe9c74212ec5dafecb49d2fdeb48b19f1bd8a710091e3e55631f9b4ab06" }
188017
188231
  ];
188018
188232
  }
188019
188233
  });
@@ -189399,8 +189613,8 @@ var init_iap_client = __esm({
189399
189613
  scrub(text15) {
189400
189614
  const { keyId, issuerId, privateKeyPem } = this.options.key;
189401
189615
  let out2 = text15;
189402
- for (const literal of [this.token?.value, privateKeyPem, issuerId, keyId]) {
189403
- if (literal) out2 = out2.split(literal).join("[redacted]");
189616
+ for (const literal2 of [this.token?.value, privateKeyPem, issuerId, keyId]) {
189617
+ if (literal2) out2 = out2.split(literal2).join("[redacted]");
189404
189618
  }
189405
189619
  for (const shape of SECRET_SHAPES2) out2 = out2.replace(shape, "[redacted]");
189406
189620
  return out2;
@@ -189978,39 +190192,39 @@ var init_iap_catalog_api = __esm({
189978
190192
  // ../store-release/iap-manifest.ts
189979
190193
  import { createHash as createHash44 } from "node:crypto";
189980
190194
  function readTarget(reader, value2) {
189981
- const obj12 = reader.object(value2, "target", TARGET_KEYS);
190195
+ const obj13 = reader.object(value2, "target", TARGET_KEYS);
189982
190196
  return {
189983
- himiApp: reader.text(obj12, "himiApp", "target"),
189984
- wixSiteId: reader.text(obj12, "wixSiteId", "target"),
189985
- appleAppId: reader.text(obj12, "appleAppId", "target", APPLE_APP_ID),
189986
- bundleId: reader.text(obj12, "bundleId", "target", BUNDLE_ID),
189987
- ...obj12.teamId !== void 0 ? { teamId: reader.text(obj12, "teamId", "target", TEAM_ID) } : {},
189988
- ...obj12.profile !== void 0 ? { profile: reader.text(obj12, "profile", "target") } : {}
190197
+ himiApp: reader.text(obj13, "himiApp", "target"),
190198
+ wixSiteId: reader.text(obj13, "wixSiteId", "target"),
190199
+ appleAppId: reader.text(obj13, "appleAppId", "target", APPLE_APP_ID),
190200
+ bundleId: reader.text(obj13, "bundleId", "target", BUNDLE_ID),
190201
+ ...obj13.teamId !== void 0 ? { teamId: reader.text(obj13, "teamId", "target", TEAM_ID) } : {},
190202
+ ...obj13.profile !== void 0 ? { profile: reader.text(obj13, "profile", "target") } : {}
189989
190203
  };
189990
190204
  }
189991
190205
  function readLocalizations(reader, item, path2) {
189992
190206
  const localizations = reader.list(item, "localizations", path2).map((value2, i2) => {
189993
190207
  const at2 = `${path2}.localizations[${i2}]`;
189994
- const obj12 = reader.object(value2, at2, LOCALIZATION_KEYS);
189995
- const name = reader.text(obj12, "name", at2);
190208
+ const obj13 = reader.object(value2, at2, LOCALIZATION_KEYS);
190209
+ const name = reader.text(obj13, "name", at2);
189996
190210
  const length = [...name].length;
189997
190211
  const { min, max } = APPLE_LIMITS.displayName;
189998
190212
  if (name && (length < min || length > max)) reader.problems.push(`${at2}.name must be ${min}\u2013${max} characters (got ${length})`);
189999
- const description = reader.text(obj12, "description", at2);
190213
+ const description = reader.text(obj13, "description", at2);
190000
190214
  reader.maxLength(description, `${at2}.description`, APPLE_LIMITS.description);
190001
- return { locale: reader.text(obj12, "locale", at2, LOCALE), name, description };
190215
+ return { locale: reader.text(obj13, "locale", at2, LOCALE), name, description };
190002
190216
  });
190003
190217
  reader.duplicates(localizations.map((l2) => l2.locale), `${path2}.localizations`, "locale");
190004
190218
  return localizations;
190005
190219
  }
190006
190220
  function readPrice(reader, item, path2) {
190007
190221
  const at2 = `${path2}.price`;
190008
- const obj12 = reader.object(item.price, at2, PRICE_KEYS);
190009
- const rule = obj12.rule === void 0 ? void 0 : reader.oneOf(obj12, "rule", at2, PRICE_RULES, "exact matches Apple's price exactly; atLeast takes the next Apple price point up");
190222
+ const obj13 = reader.object(item.price, at2, PRICE_KEYS);
190223
+ const rule = obj13.rule === void 0 ? void 0 : reader.oneOf(obj13, "rule", at2, PRICE_RULES, "exact matches Apple's price exactly; atLeast takes the next Apple price point up");
190010
190224
  return {
190011
- baseTerritory: reader.text(obj12, "baseTerritory", at2, TERRITORY),
190012
- currency: reader.text(obj12, "currency", at2, CURRENCY2),
190013
- amount: reader.text(obj12, "amount", at2, AMOUNT),
190225
+ baseTerritory: reader.text(obj13, "baseTerritory", at2, TERRITORY),
190226
+ currency: reader.text(obj13, "currency", at2, CURRENCY2),
190227
+ amount: reader.text(obj13, "amount", at2, AMOUNT),
190014
190228
  ...rule ? { rule } : {}
190015
190229
  };
190016
190230
  }
@@ -190024,50 +190238,50 @@ function readTerritories(reader, item, path2, baseTerritory) {
190024
190238
  return territories;
190025
190239
  }
190026
190240
  function readWixEntity(reader, value2, at2) {
190027
- const obj12 = reader.object(value2, at2, WIX_KEYS);
190028
- return { entityType: reader.text(obj12, "entityType", at2), entityId: reader.text(obj12, "entityId", at2) };
190241
+ const obj13 = reader.object(value2, at2, WIX_KEYS);
190242
+ return { entityType: reader.text(obj13, "entityType", at2), entityId: reader.text(obj13, "entityId", at2) };
190029
190243
  }
190030
- function readUnlocks(reader, obj12, path2) {
190031
- return reader.list(obj12, "unlocks", path2).map((value2, i2) => {
190244
+ function readUnlocks(reader, obj13, path2) {
190245
+ return reader.list(obj13, "unlocks", path2).map((value2, i2) => {
190032
190246
  const at2 = `${path2}.unlocks[${i2}]`;
190033
190247
  const unlock = reader.object(value2, at2, UNLOCK_KEYS);
190034
190248
  return { entityType: reader.text(unlock, "entityType", at2), entityId: reader.text(unlock, "entityId", at2), entitlement: reader.text(unlock, "entitlement", at2) };
190035
190249
  });
190036
190250
  }
190037
- function readSubject(reader, obj12, path2, type2) {
190038
- if (obj12.wix === void 0 === (obj12.unlocks === void 0)) {
190251
+ function readSubject(reader, obj13, path2, type2) {
190252
+ if (obj13.wix === void 0 === (obj13.unlocks === void 0)) {
190039
190253
  reader.problems.push(`${path2} must name exactly one of "wix" or "unlocks"`);
190040
190254
  return {};
190041
190255
  }
190042
- if (obj12.wix !== void 0) return { wix: readWixEntity(reader, obj12.wix, `${path2}.wix`) };
190256
+ if (obj13.wix !== void 0) return { wix: readWixEntity(reader, obj13.wix, `${path2}.wix`) };
190043
190257
  if (type2 !== "consumable") reader.problems.push(`${path2}: only a consumable may carry "unlocks" \u2014 a non-consumable sells exactly one Wix item`);
190044
- return { unlocks: readUnlocks(reader, obj12, path2) };
190258
+ return { unlocks: readUnlocks(reader, obj13, path2) };
190045
190259
  }
190046
- function limitedText(reader, obj12, key3, path2, max, rule) {
190047
- const value2 = reader.text(obj12, key3, path2, rule);
190260
+ function limitedText(reader, obj13, key3, path2, max, rule) {
190261
+ const value2 = reader.text(obj13, key3, path2, rule);
190048
190262
  reader.maxLength(value2, childPath(path2, key3), max);
190049
190263
  return value2;
190050
190264
  }
190051
190265
  function readItem(reader, value2, index) {
190052
190266
  const path2 = `items[${index}]`;
190053
- const obj12 = reader.object(value2, path2, ITEM_KEYS);
190054
- const type2 = reader.oneOf(obj12, "type", path2, PRODUCT_TYPES, "subscriptions are not supported by this version");
190055
- const price = readPrice(reader, obj12, path2);
190056
- const reviewNote = reader.optionalText(obj12, "reviewNote", path2);
190267
+ const obj13 = reader.object(value2, path2, ITEM_KEYS);
190268
+ const type2 = reader.oneOf(obj13, "type", path2, PRODUCT_TYPES, "subscriptions are not supported by this version");
190269
+ const price = readPrice(reader, obj13, path2);
190270
+ const reviewNote = reader.optionalText(obj13, "reviewNote", path2);
190057
190271
  if (reviewNote) reader.maxLength(reviewNote, `${path2}.reviewNote`, APPLE_LIMITS.reviewNote);
190058
- const reviewScreenshot = obj12.reviewScreenshot === void 0 ? void 0 : reader.text(obj12, "reviewScreenshot", path2, SCREENSHOT_PATH);
190272
+ const reviewScreenshot = obj13.reviewScreenshot === void 0 ? void 0 : reader.text(obj13, "reviewScreenshot", path2, SCREENSHOT_PATH);
190059
190273
  return {
190060
- ...readSubject(reader, obj12, path2, type2),
190061
- classification: reader.literal(obj12, "classification", path2, "digital", "physical goods and unclassified products are never registered as in-app purchases"),
190062
- entitlement: reader.text(obj12, "entitlement", path2),
190063
- productId: limitedText(reader, obj12, "productId", path2, APPLE_LIMITS.productId, PRODUCT_ID),
190274
+ ...readSubject(reader, obj13, path2, type2),
190275
+ classification: reader.literal(obj13, "classification", path2, "digital", "physical goods and unclassified products are never registered as in-app purchases"),
190276
+ entitlement: reader.text(obj13, "entitlement", path2),
190277
+ productId: limitedText(reader, obj13, "productId", path2, APPLE_LIMITS.productId, PRODUCT_ID),
190064
190278
  type: type2,
190065
- referenceName: limitedText(reader, obj12, "referenceName", path2, APPLE_LIMITS.referenceName),
190279
+ referenceName: limitedText(reader, obj13, "referenceName", path2, APPLE_LIMITS.referenceName),
190066
190280
  ...reviewNote === void 0 ? {} : { reviewNote },
190067
190281
  ...reviewScreenshot === void 0 ? {} : { reviewScreenshot },
190068
- localizations: readLocalizations(reader, obj12, path2),
190282
+ localizations: readLocalizations(reader, obj13, path2),
190069
190283
  price,
190070
- territories: readTerritories(reader, obj12, path2, price.baseTerritory)
190284
+ territories: readTerritories(reader, obj13, path2, price.baseTerritory)
190071
190285
  };
190072
190286
  }
190073
190287
  function wixEntitiesOf(item) {
@@ -190103,10 +190317,10 @@ function parseJson3(text15, label3) {
190103
190317
  function parseIapManifest(text15, label3) {
190104
190318
  const doc = parseJson3(text15, label3);
190105
190319
  const reader = new ManifestReader();
190106
- const obj12 = reader.object(doc, "", MANIFEST_KEYS);
190107
- if (obj12.manifestVersion !== 1) reader.problems.push("manifestVersion must be 1");
190108
- const target = readTarget(reader, obj12.target);
190109
- const items = reader.list(obj12, "items", "").map((item, i2) => readItem(reader, item, i2));
190320
+ const obj13 = reader.object(doc, "", MANIFEST_KEYS);
190321
+ if (obj13.manifestVersion !== 1) reader.problems.push("manifestVersion must be 1");
190322
+ const target = readTarget(reader, obj13.target);
190323
+ const items = reader.list(obj13, "items", "").map((item, i2) => readItem(reader, item, i2));
190110
190324
  reportDuplicateMappings(reader, items);
190111
190325
  reportCredentialMaterial(reader, doc, "");
190112
190326
  if (reader.problems.length) throw new IapManifestError(label3, reader.problems);
@@ -190115,8 +190329,8 @@ function parseIapManifest(text15, label3) {
190115
190329
  function sortKeys(value2) {
190116
190330
  if (Array.isArray(value2)) return value2.map(sortKeys);
190117
190331
  if (!value2 || typeof value2 !== "object") return value2;
190118
- const obj12 = value2;
190119
- return Object.fromEntries(Object.keys(obj12).sort().map((key3) => [key3, sortKeys(obj12[key3])]));
190332
+ const obj13 = value2;
190333
+ return Object.fromEntries(Object.keys(obj13).sort().map((key3) => [key3, sortKeys(obj13[key3])]));
190120
190334
  }
190121
190335
  function canonicalJson3(value2) {
190122
190336
  return JSON.stringify(sortKeys(value2));
@@ -190189,8 +190403,8 @@ var init_iap_manifest = __esm({
190189
190403
  }
190190
190404
  return value2;
190191
190405
  }
190192
- text(obj12, key3, path2, rule) {
190193
- return this.textValue(obj12[key3], childPath(path2, key3), rule);
190406
+ text(obj13, key3, path2, rule) {
190407
+ return this.textValue(obj13[key3], childPath(path2, key3), rule);
190194
190408
  }
190195
190409
  textValue(value2, at2, rule) {
190196
190410
  if (typeof value2 !== "string" || !value2.trim()) {
@@ -190200,23 +190414,23 @@ var init_iap_manifest = __esm({
190200
190414
  if (rule && !rule.pattern.test(value2)) this.problems.push(`${at2} must be ${rule.hint} (got ${JSON.stringify(value2)})`);
190201
190415
  return value2;
190202
190416
  }
190203
- optionalText(obj12, key3, path2) {
190204
- return obj12[key3] === void 0 ? void 0 : this.text(obj12, key3, path2);
190417
+ optionalText(obj13, key3, path2) {
190418
+ return obj13[key3] === void 0 ? void 0 : this.text(obj13, key3, path2);
190205
190419
  }
190206
- list(obj12, key3, path2) {
190207
- const value2 = obj12[key3];
190420
+ list(obj13, key3, path2) {
190421
+ const value2 = obj13[key3];
190208
190422
  if (!Array.isArray(value2) || value2.length === 0) {
190209
190423
  this.problems.push(`${childPath(path2, key3)} must be a non-empty list`);
190210
190424
  return [];
190211
190425
  }
190212
190426
  return value2;
190213
190427
  }
190214
- literal(obj12, key3, path2, expected, why) {
190215
- if (obj12[key3] !== expected) this.problems.push(`${childPath(path2, key3)} must be ${JSON.stringify(expected)} \u2014 ${why}`);
190428
+ literal(obj13, key3, path2, expected, why) {
190429
+ if (obj13[key3] !== expected) this.problems.push(`${childPath(path2, key3)} must be ${JSON.stringify(expected)} \u2014 ${why}`);
190216
190430
  return expected;
190217
190431
  }
190218
- oneOf(obj12, key3, path2, allowed2, why) {
190219
- const value2 = obj12[key3];
190432
+ oneOf(obj13, key3, path2, allowed2, why) {
190433
+ const value2 = obj13[key3];
190220
190434
  if (allowed2.includes(value2)) return value2;
190221
190435
  this.problems.push(`${childPath(path2, key3)} must be ${allowed2.map((a2) => JSON.stringify(a2)).join(" or ")} \u2014 ${why}`);
190222
190436
  return allowed2[0];
@@ -191934,10 +192148,10 @@ function bundleFinding(app, { bundleId, storeBundleId }, fileName) {
191934
192148
  function bindingFinding(app, file2, purchasesAppId, wanted, fileName) {
191935
192149
  const wixIap = lookup3(app, "wixIap");
191936
192150
  if (wixIap.kind === "absent") return { splice: appendProperties(app, file2, [`${wanted},`]), applied: "wixIap.purchasesAppId" };
191937
- const literal = wixIap.kind === "written" ? unwrap(wixIap.node.initializer) : void 0;
191938
- if (!literal || !ts15.isObjectLiteralExpression(literal)) return { instruction: `${fileName} computes wixIap, so it was not edited: it must evaluate to ${wanted}.` };
191939
- const current = lookup3(literal, "purchasesAppId");
191940
- if (current.kind === "absent") return { splice: appendProperties(literal, file2, [`purchasesAppId: ${JSON.stringify(purchasesAppId)},`]), applied: "wixIap.purchasesAppId" };
192151
+ const literal2 = wixIap.kind === "written" ? unwrap(wixIap.node.initializer) : void 0;
192152
+ if (!literal2 || !ts15.isObjectLiteralExpression(literal2)) return { instruction: `${fileName} computes wixIap, so it was not edited: it must evaluate to ${wanted}.` };
192153
+ const current = lookup3(literal2, "purchasesAppId");
192154
+ if (current.kind === "absent") return { splice: appendProperties(literal2, file2, [`purchasesAppId: ${JSON.stringify(purchasesAppId)},`]), applied: "wixIap.purchasesAppId" };
191941
192155
  const value2 = current.kind === "written" ? unwrap(current.node.initializer) : void 0;
191942
192156
  if (!value2 || !ts15.isStringLiteralLike(value2)) return { instruction: `${fileName} computes wixIap.purchasesAppId, so it was not edited: it must evaluate to ${JSON.stringify(purchasesAppId)}.` };
191943
192157
  if (value2.text === purchasesAppId) return {};
@@ -200558,20 +200772,20 @@ function fromJSON(str13) {
200558
200772
  if (!str13 || isEmptyString(str13)) {
200559
200773
  return void 0;
200560
200774
  }
200561
- let obj12;
200775
+ let obj13;
200562
200776
  if (typeof str13 === "string") {
200563
200777
  try {
200564
- obj12 = JSON.parse(str13);
200778
+ obj13 = JSON.parse(str13);
200565
200779
  } catch {
200566
200780
  return void 0;
200567
200781
  }
200568
200782
  } else {
200569
- obj12 = str13;
200783
+ obj13 = str13;
200570
200784
  }
200571
200785
  const c2 = new Cookie();
200572
200786
  Cookie.serializableProperties.forEach((prop2) => {
200573
- if (obj12 && typeof obj12 === "object" && inOperator(prop2, obj12)) {
200574
- const val = obj12[prop2];
200787
+ if (obj13 && typeof obj13 === "object" && inOperator(prop2, obj13)) {
200788
+ const val = obj13[prop2];
200575
200789
  if (val === void 0) {
200576
200790
  return;
200577
200791
  }
@@ -200590,7 +200804,7 @@ function fromJSON(str13) {
200590
200804
  case "creation":
200591
200805
  case "lastAccessed":
200592
200806
  if (typeof val === "number" || typeof val === "string" || val instanceof Date) {
200593
- c2[prop2] = obj12[prop2] == "Infinity" ? "Infinity" : new Date(val);
200807
+ c2[prop2] = obj13[prop2] == "Infinity" ? "Infinity" : new Date(val);
200594
200808
  } else if (val === null) {
200595
200809
  c2[prop2] = null;
200596
200810
  }
@@ -200848,7 +201062,7 @@ var init_dist = __esm({
200848
201062
  );
200849
201063
  }
200850
201064
  };
200851
- objectToString = (obj12) => Object.prototype.toString.call(obj12);
201065
+ objectToString = (obj13) => Object.prototype.toString.call(obj13);
200852
201066
  safeArrayToString = (arr3, seenArrays) => {
200853
201067
  if (typeof arr3.join !== "function") return objectToString(arr3);
200854
201068
  seenArrays.add(arr3);
@@ -201140,7 +201354,7 @@ var init_dist = __esm({
201140
201354
  * If you want a property to be serialized, add the property name to {@link Cookie.serializableProperties}.
201141
201355
  */
201142
201356
  toJSON() {
201143
- const obj12 = {};
201357
+ const obj13 = {};
201144
201358
  for (const prop2 of _Cookie2.serializableProperties) {
201145
201359
  const val = this[prop2];
201146
201360
  if (val === cookieDefaults[prop2]) {
@@ -201151,49 +201365,49 @@ var init_dist = __esm({
201151
201365
  case "value":
201152
201366
  case "sameSite":
201153
201367
  if (typeof val === "string") {
201154
- obj12[prop2] = val;
201368
+ obj13[prop2] = val;
201155
201369
  }
201156
201370
  break;
201157
201371
  case "expires":
201158
201372
  case "creation":
201159
201373
  case "lastAccessed":
201160
201374
  if (typeof val === "number" || typeof val === "string" || val instanceof Date) {
201161
- obj12[prop2] = val == "Infinity" ? "Infinity" : new Date(val).toISOString();
201375
+ obj13[prop2] = val == "Infinity" ? "Infinity" : new Date(val).toISOString();
201162
201376
  } else if (val === null) {
201163
- obj12[prop2] = null;
201377
+ obj13[prop2] = null;
201164
201378
  }
201165
201379
  break;
201166
201380
  case "maxAge":
201167
201381
  if (typeof val === "number" || val === "Infinity" || val === "-Infinity") {
201168
- obj12[prop2] = val;
201382
+ obj13[prop2] = val;
201169
201383
  }
201170
201384
  break;
201171
201385
  case "domain":
201172
201386
  case "path":
201173
201387
  if (typeof val === "string" || val === null) {
201174
- obj12[prop2] = val;
201388
+ obj13[prop2] = val;
201175
201389
  }
201176
201390
  break;
201177
201391
  case "secure":
201178
201392
  case "httpOnly":
201179
201393
  if (typeof val === "boolean") {
201180
- obj12[prop2] = val;
201394
+ obj13[prop2] = val;
201181
201395
  }
201182
201396
  break;
201183
201397
  case "extensions":
201184
201398
  if (Array.isArray(val)) {
201185
- obj12[prop2] = val;
201399
+ obj13[prop2] = val;
201186
201400
  }
201187
201401
  break;
201188
201402
  case "hostOnly":
201189
201403
  case "pathIsDefault":
201190
201404
  if (typeof val === "boolean" || val === null) {
201191
- obj12[prop2] = val;
201405
+ obj13[prop2] = val;
201192
201406
  }
201193
201407
  break;
201194
201408
  }
201195
201409
  }
201196
- return obj12;
201410
+ return obj13;
201197
201411
  }
201198
201412
  /**
201199
201413
  * Does a deep clone of this cookie, implemented exactly as `Cookie.fromJSON(cookie.toJSON())`.
@@ -204207,17 +204421,17 @@ var init_collect = __esm({
204207
204421
 
204208
204422
  // src/one-app/invite-plan.ts
204209
204423
  function planInvites(raw, metaSiteId) {
204210
- const obj12 = (v2) => v2 && typeof v2 === "object" && !Array.isArray(v2) ? v2 : {};
204424
+ const obj13 = (v2) => v2 && typeof v2 === "object" && !Array.isArray(v2) ? v2 : {};
204211
204425
  const part4 = (v2) => v2.replaceAll("~", "~0").replaceAll("/", "~1");
204212
- const headers2 = obj12(raw.headers);
204426
+ const headers2 = obj13(raw.headers);
204213
204427
  return {
204214
204428
  schemaVersion: 1,
204215
204429
  recipe: "@wix/himalaya/screens",
204216
204430
  declaredCapabilities: ["share", "wix_api", "app_info"],
204217
- screens: Object.entries(obj12(raw.screens)).flatMap(([screenId, value2]) => {
204218
- const headerId = obj12(value2).headerId;
204431
+ screens: Object.entries(obj13(raw.screens)).flatMap(([screenId, value2]) => {
204432
+ const headerId = obj13(value2).headerId;
204219
204433
  if (typeof headerId !== "string") return [];
204220
- const settings = obj12(obj12(headers2[headerId]).settings);
204434
+ const settings = obj13(obj13(headers2[headerId]).settings);
204221
204435
  if (typeof settings.showInviteButton !== "boolean") return [];
204222
204436
  return [{
204223
204437
  screenId,
@@ -204612,7 +204826,7 @@ function generateScreens(input) {
204612
204826
  let screenId2 = [...verticals][0];
204613
204827
  const present = input.takenScreenIds;
204614
204828
  const fallback = TEMPLATE_FALLBACKS[screenId2];
204615
- if (present && present.size && !present.has(screenId2)) {
204829
+ if (present && !present.has(screenId2)) {
204616
204830
  if (fallback && present.has(fallback)) {
204617
204831
  out2.gaps.push({ page: label3, sectionId: str11(elements[0].elementId), sectionDefinitionId: type2, reason: `this scaffold has no ${screenId2} screen; the page opens the template's ${fallback} instead, with its own title and layout` });
204618
204832
  out2.routes.push({ layoutItemId, label: label3, screenId: fallback, kind: "template" });
@@ -204680,7 +204894,9 @@ function generateScreens(input) {
204680
204894
  }
204681
204895
  const empty2 = built === null || Array.isArray(built) && built.length === 0;
204682
204896
  const fallback = FALLBACK_TARGETS[type2];
204683
- if (empty2 && unmapped.length > reported && fallback) {
204897
+ const scaffold = input.takenScreenIds;
204898
+ const linkable = !fallback?.needsScreen || !scaffold || scaffold.has(fallback.screen);
204899
+ if (empty2 && unmapped.length > reported && fallback && linkable) {
204684
204900
  const reasons = unmapped.splice(reported).map((u2) => u2.reason);
204685
204901
  uses.length = registered;
204686
204902
  extras.length = extra;
@@ -204788,7 +205004,8 @@ var init_generate2 = __esm({
204788
205004
  events_list_section: { sibling: "events_list_section", screen: "himi_events" },
204789
205005
  newBlog_postlist_vertical_section: { screen: "himi_blog" },
204790
205006
  newBlog_compact_post_list_vertical_section: { screen: "himi_blog" },
204791
- member_list_section: { sibling: "member_list_section", screen: "himi_members" }
205007
+ member_list_section: { sibling: "member_list_section", screen: "himi_members" },
205008
+ bookings_services_list_section: { screen: "himi_services", needsScreen: true }
204792
205009
  };
204793
205010
  ROUTE_PLACEHOLDER = "@route:";
204794
205011
  BOTTOM_TABS_BEFORE_MORE = 4;
@@ -204797,7 +205014,8 @@ var init_generate2 = __esm({
204797
205014
  groups_feed_section: "himi_groups_feed",
204798
205015
  loyalty_status_section: "himi_loyalty",
204799
205016
  loyalty_offering_section: "himi_loyalty",
204800
- stores_products_grid_section: "himi_shop"
205017
+ stores_products_grid_section: "himi_shop",
205018
+ bookings_services_list_section: "himi_services"
204801
205019
  };
204802
205020
  TEMPLATE_FALLBACKS = { himi_groups_feed: "himi_groups" };
204803
205021
  MODULES = {
@@ -204900,6 +205118,9 @@ var init_generate2 = __esm({
204900
205118
  if (placement?.state === "ready" && placement.component) return vstack(`${id}.box`, [placement.component], 0, inset(8, 8));
204901
205119
  return ctx.unsupported(elementId, "pages_section", placement ? `its Pages document is not ready in pages-content.json (state "${str11(placement.state)}")` : "its Pages document is not in pages-content.json: re-run `himi one-app migrate` to collect it");
204902
205120
  },
205121
+ // The services list is the template's own screen (search, category chips, location pin, course dates, Ended): it has no inline
205122
+ // form, so beside generated sections it keeps its place as its title and a See All link to that screen.
205123
+ bookings_services_list_section: (_id, _s2, _st, _index, ctx, sectionId) => ctx.unsupported(sectionId, "bookings_services_list_section", "the services list is the template's himi_services screen and has no inline form"),
204903
205124
  // The programs carousel: the shared programs module in carousel layout, configured from the section's own settings.
204904
205125
  achievements_carousel_section: (id, s2, st2, index, ctx) => {
204905
205126
  const sorting = obj6(st2.sortingSettings);
@@ -205019,14 +205240,14 @@ function ricosTexts(documentJson) {
205019
205240
  function literalSlugFindings(slug, displayName3, screens, authoredText = []) {
205020
205241
  if (slug.toLowerCase() === displayName3.trim().toLowerCase()) return [];
205021
205242
  const escaped = slug.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
205022
- const literal = new RegExp(`(^|[^\\p{L}\\p{N}_@/.-])${escaped}(?![\\p{L}\\p{N}_@/-]|\\.[\\p{L}\\p{N}])`, "iu");
205243
+ const literal2 = new RegExp(`(^|[^\\p{L}\\p{N}_@/.-])${escaped}(?![\\p{L}\\p{N}_@/-]|\\.[\\p{L}\\p{N}])`, "iu");
205023
205244
  const name = displayName3.trim().replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
205024
205245
  const businessName = new RegExp(`(^|[^\\p{L}\\p{N}_-])${name}(?![\\p{L}\\p{N}_-])`, "giu");
205025
205246
  const findings = [];
205026
205247
  const authored2 = new Set(authoredText);
205027
205248
  for (const { screenId, descriptor } of screens) {
205028
205249
  const check = (value2, path2, allowAuthored = screenId !== "himi_business_chat") => {
205029
- if (typeof value2 === "string" && !(allowAuthored && authored2.has(value2)) && !value2.startsWith("$service:") && !value2.startsWith("$item.") && literal.test(value2.replace(businessName, "$1"))) {
205250
+ if (typeof value2 === "string" && !(allowAuthored && authored2.has(value2)) && !value2.startsWith("$service:") && !value2.startsWith("$item.") && literal2.test(value2.replace(businessName, "$1"))) {
205030
205251
  findings.push({ screenId, path: path2, value: value2 });
205031
205252
  }
205032
205253
  };
@@ -205071,10 +205292,10 @@ function appNameLiteral(configSource) {
205071
205292
  return found;
205072
205293
  }
205073
205294
  function fixAppName(configSource, slug, displayName3) {
205074
- const literal = appNameLiteral(configSource);
205075
- if (!literal || literal.value.toLowerCase() !== slug.toLowerCase() || literal.value === displayName3.trim()) return void 0;
205295
+ const literal2 = appNameLiteral(configSource);
205296
+ if (!literal2 || literal2.value.toLowerCase() !== slug.toLowerCase() || literal2.value === displayName3.trim()) return void 0;
205076
205297
  if (slug.toLowerCase() === displayName3.trim().toLowerCase()) return void 0;
205077
- return { current: literal.value, fixed: configSource.slice(0, literal.start) + JSON.stringify(displayName3.trim()) + configSource.slice(literal.end) };
205298
+ return { current: literal2.value, fixed: configSource.slice(0, literal2.start) + JSON.stringify(displayName3.trim()) + configSource.slice(literal2.end) };
205078
205299
  }
205079
205300
  function sourceIdentity(evidenceDir) {
205080
205301
  const { manifest: manifest2, raw } = verifiedEvidence(evidenceDir);
@@ -205204,32 +205425,123 @@ var init_validate_identity = __esm({
205204
205425
  }
205205
205426
  });
205206
205427
 
205428
+ // src/one-app/invite-drawer.ts
205429
+ import { createHash as createHash57 } from "node:crypto";
205430
+ import ts17 from "typescript";
205431
+ function sourceShowsInvite(plan) {
205432
+ const screens = obj8(plan).screens;
205433
+ return Array.isArray(screens) && screens.some((screen) => obj8(obj8(screen).metadata).showInviteButton === true);
205434
+ }
205435
+ function rowText(indent) {
205436
+ const props2 = [
205437
+ ["id", INVITE_DRAWER_ID],
205438
+ ["screenId", INVITE_SCREEN],
205439
+ ["label", INVITE_LABEL],
205440
+ ["icon", INVITE_ACTION.icon],
205441
+ ["hiddenPath", INVITE_ACTION.hiddenPath],
205442
+ ["hiddenUntilResolved", true]
205443
+ ];
205444
+ return `{
205445
+ ${props2.map(([key3, value2]) => `${indent} ${JSON.stringify(key3)}: ${JSON.stringify(value2)}`).join(",\n")}
205446
+ ${indent}}`;
205447
+ }
205448
+ function applyInviteDrawer(configText, showsInvite) {
205449
+ const unchanged = (status, reason) => ({ status, ...reason ? { reason } : {}, text: configText });
205450
+ if (!showsInvite) return unchanged("unchanged", "the source header does not show the Invite button");
205451
+ const file2 = ts17.createSourceFile("config.ts", configText, ts17.ScriptTarget.Latest, true, ts17.ScriptKind.TS);
205452
+ const app = appObject(file2);
205453
+ const navigationValue = app && findProperty(app, "navigation")?.initializer;
205454
+ if (!navigationValue || !ts17.isObjectLiteralExpression(navigationValue)) return unchanged("manual", "config.ts has no literal `navigation: {...}` in its defineApp call");
205455
+ const drawerValue = findProperty(navigationValue, "drawer")?.initializer;
205456
+ const itemsValue = drawerValue && ts17.isObjectLiteralExpression(drawerValue) ? findProperty(drawerValue, "items")?.initializer : void 0;
205457
+ if (!itemsValue) return unchanged("absent", "the app has no side menu (navigation.drawer.items), so there is nowhere to add Invite");
205458
+ if (!ts17.isArrayLiteralExpression(itemsValue)) return unchanged("manual", "navigation.drawer.items is not an array literal, so a row cannot be added safely");
205459
+ const rows = itemsValue.elements.filter(ts17.isObjectLiteralExpression);
205460
+ const hasRow = rows.some((row2) => literal(findProperty(row2, "id")?.initializer) === INVITE_DRAWER_ID || literal(findProperty(row2, "screenId")?.initializer) === INVITE_SCREEN);
205461
+ if (hasRow) return { ...unchanged("unchanged", "the side menu already has an Invite row"), rowPresent: true };
205462
+ const linkValue = findProperty(navigationValue, "linkableScreens")?.initializer;
205463
+ const linked = linkValue && ts17.isArrayLiteralExpression(linkValue) && linkValue.elements.some((item) => ts17.isObjectLiteralExpression(item) && literal(findProperty(item, "screenId")?.initializer) === INVITE_SCREEN);
205464
+ if (!linked) {
205465
+ return unchanged("absent", `the source shows Invite, but config.ts does not declare ${INVITE_SCREEN} in navigation.linkableScreens: build the Invite flow first (himi docs one-app-to-himi-app, "Invite is behavior"), then provision again`);
205466
+ }
205467
+ const elements = itemsValue.elements;
205468
+ const firstSection = elements.findIndex((item) => ts17.isObjectLiteralExpression(item) && literal(findProperty(item, "role")?.initializer) === "section");
205469
+ const before = firstSection === -1 ? elements.length - 1 : firstSection - 1;
205470
+ const destination = elements.slice(0, before + 1).some((item) => ts17.isObjectLiteralExpression(item) && !!literal(findProperty(item, "screenId")?.initializer) && !["section", "note"].includes(literal(findProperty(item, "role")?.initializer) ?? ""));
205471
+ if (!destination) return unchanged("absent", "the side menu has no destination before where Invite would go, and Invite must not become the app's home screen");
205472
+ const anchor = elements[before];
205473
+ const indent = " ".repeat(file2.getLineAndCharacterOfPosition(anchor.getStart()).character);
205474
+ const trailing = before === elements.length - 1 && elements.hasTrailingComma;
205475
+ const at2 = trailing ? configText.indexOf(",", anchor.getEnd()) + 1 : anchor.getEnd();
205476
+ const insertion = trailing ? `
205477
+ ${indent}${rowText(indent)},` : `,
205478
+ ${indent}${rowText(indent)}`;
205479
+ const text15 = `${configText.slice(0, at2)}${insertion}${configText.slice(at2)}`;
205480
+ return { status: "set", rowPresent: true, text: text15 };
205481
+ }
205482
+ function withInviteTranslation(catalogText, locale) {
205483
+ const translation = INVITE_TRANSLATIONS[locale];
205484
+ if (!translation) return void 0;
205485
+ let catalog4;
205486
+ try {
205487
+ catalog4 = obj8(JSON.parse(catalogText));
205488
+ } catch {
205489
+ return void 0;
205490
+ }
205491
+ const messages = obj8(catalog4.messages);
205492
+ if (!("messages" in catalog4)) return void 0;
205493
+ const existing = Object.values(messages).map(obj8).find((row2) => row2.source === INVITE_LABEL);
205494
+ if (existing && typeof existing.translation === "string" && existing.translation.trim()) return void 0;
205495
+ if (existing) {
205496
+ existing.translation = translation;
205497
+ if (typeof existing.key !== "string" || !existing.key) existing.key = "tab.invite";
205498
+ } else {
205499
+ messages[`h_${createHash57("sha1").update(INVITE_LABEL).digest("hex").slice(0, 12)}`] = { source: INVITE_LABEL, key: "tab.invite", translation };
205500
+ }
205501
+ return `${JSON.stringify({ ...catalog4, messages }, null, 2)}
205502
+ `;
205503
+ }
205504
+ var INVITE_SCREEN, INVITE_DRAWER_ID, INVITE_ACTION, INVITE_LABEL, obj8, literal, INVITE_TRANSLATIONS;
205505
+ var init_invite_drawer = __esm({
205506
+ "src/one-app/invite-drawer.ts"() {
205507
+ init_define_HHP_CATALOG();
205508
+ init_header_badges();
205509
+ INVITE_SCREEN = "source_invite";
205510
+ INVITE_DRAWER_ID = "drawer_invite";
205511
+ INVITE_ACTION = { icon: "share", hiddenPath: "$service:invite.hidden" };
205512
+ INVITE_LABEL = "Invite";
205513
+ obj8 = (v2) => v2 && typeof v2 === "object" && !Array.isArray(v2) ? v2 : {};
205514
+ literal = (node3) => node3 && ts17.isStringLiteralLike(node3) ? node3.text : void 0;
205515
+ INVITE_TRANSLATIONS = { he: "\u05D4\u05D6\u05DE\u05E0\u05EA \u05D7\u05D1\u05E8\u05D9\u05DD" };
205516
+ }
205517
+ });
205518
+
205207
205519
  // src/one-app/provision.ts
205208
- import { existsSync as existsSync121, readFileSync as readFileSync140, writeFileSync as writeFileSync56 } from "node:fs";
205520
+ import { existsSync as existsSync121, readdirSync as readdirSync47, readFileSync as readFileSync140, writeFileSync as writeFileSync56 } from "node:fs";
205209
205521
  import { join as join130, resolve as resolve89 } from "node:path";
205210
- import ts17 from "typescript";
205522
+ import ts18 from "typescript";
205211
205523
  function rootOnAppear2(descriptor) {
205212
- const modifiers = obj8(obj8(descriptor.payload).modifiers);
205524
+ const modifiers = obj9(obj9(descriptor.payload).modifiers);
205213
205525
  const appear = modifiers.onAppear;
205214
205526
  return appear && typeof appear === "object" && !Array.isArray(appear) ? appear : void 0;
205215
205527
  }
205216
205528
  function nativeTabBar(configSource) {
205217
- const file2 = ts17.createSourceFile("config.ts", configSource, ts17.ScriptTarget.Latest, true, ts17.ScriptKind.TS);
205529
+ const file2 = ts18.createSourceFile("config.ts", configSource, ts18.ScriptTarget.Latest, true, ts18.ScriptKind.TS);
205218
205530
  let tabBar;
205219
205531
  const visit = (node3) => {
205220
205532
  if (tabBar) return;
205221
- if (ts17.isCallExpression(node3) && ts17.isIdentifier(node3.expression) && node3.expression.text === "defineApp") {
205222
- const navigation = node3.arguments[0] && ts17.isObjectLiteralExpression(node3.arguments[0]) ? propOf(node3.arguments[0], "navigation")?.initializer : void 0;
205223
- const bar = navigation && ts17.isObjectLiteralExpression(navigation) ? propOf(navigation, "tabBar")?.initializer : void 0;
205224
- if (bar && ts17.isObjectLiteralExpression(bar)) tabBar = bar;
205533
+ if (ts18.isCallExpression(node3) && ts18.isIdentifier(node3.expression) && node3.expression.text === "defineApp") {
205534
+ const navigation = node3.arguments[0] && ts18.isObjectLiteralExpression(node3.arguments[0]) ? propOf(node3.arguments[0], "navigation")?.initializer : void 0;
205535
+ const bar = navigation && ts18.isObjectLiteralExpression(navigation) ? propOf(navigation, "tabBar")?.initializer : void 0;
205536
+ if (bar && ts18.isObjectLiteralExpression(bar)) tabBar = bar;
205225
205537
  return;
205226
205538
  }
205227
- ts17.forEachChild(node3, visit);
205539
+ ts18.forEachChild(node3, visit);
205228
205540
  };
205229
205541
  visit(file2);
205230
205542
  if (!tabBar) return void 0;
205231
205543
  const current = propOf(tabBar, "presentation")?.initializer;
205232
- if (current && ts17.isStringLiteralLike(current) && current.text.trim()) return { presentation: current.text };
205544
+ if (current && ts18.isStringLiteralLike(current) && current.text.trim()) return { presentation: current.text };
205233
205545
  if (current || !tabBar.properties[0]) return void 0;
205234
205546
  const indent = file2.getLineAndCharacterOfPosition(tabBar.properties[0].getStart(file2)).character;
205235
205547
  const at2 = tabBar.getStart(file2) + 1;
@@ -205251,29 +205563,29 @@ function provisionSiteBinding(dir, binding2, dryRun = false) {
205251
205563
  return { status: "unverified", reason: "the collection has no verified source site id and URL; the auth is left as it is" };
205252
205564
  }
205253
205565
  const source = readFileSync140(configPath, "utf8");
205254
- const file2 = ts17.createSourceFile("config.ts", source, ts17.ScriptTarget.Latest, true, ts17.ScriptKind.TS);
205566
+ const file2 = ts18.createSourceFile("config.ts", source, ts18.ScriptTarget.Latest, true, ts18.ScriptKind.TS);
205255
205567
  let argument;
205256
205568
  const visit = (node3) => {
205257
205569
  if (argument) return;
205258
- if (ts17.isCallExpression(node3) && ts17.isIdentifier(node3.expression) && node3.expression.text === "WixConsumerAuthProvider") {
205570
+ if (ts18.isCallExpression(node3) && ts18.isIdentifier(node3.expression) && node3.expression.text === "WixConsumerAuthProvider") {
205259
205571
  const arg = node3.arguments[0];
205260
- if (arg && ts17.isObjectLiteralExpression(arg)) argument = arg;
205572
+ if (arg && ts18.isObjectLiteralExpression(arg)) argument = arg;
205261
205573
  return;
205262
205574
  }
205263
- ts17.forEachChild(node3, visit);
205575
+ ts18.forEachChild(node3, visit);
205264
205576
  };
205265
205577
  visit(file2);
205266
205578
  if (!argument) return { status: "absent", reason: "config.ts has no WixConsumerAuthProvider({...}) to bind" };
205267
205579
  const text15 = (name) => {
205268
205580
  const v2 = propOf(argument, name)?.initializer;
205269
- return v2 && ts17.isStringLiteralLike(v2) ? v2.text : void 0;
205581
+ return v2 && ts18.isStringLiteralLike(v2) ? v2.text : void 0;
205270
205582
  };
205271
205583
  if (text15("visitorSource") === "one-app" && text15("metaSiteId")?.toLowerCase() === binding2.metaSiteId.toLowerCase()) return { status: "unchanged" };
205272
205584
  const clientId = propOf(argument, "clientId")?.initializer;
205273
205585
  const placeholder3 = !clientId || clientId.getText(file2).includes("YOUR_WIX_CLIENT_ID");
205274
205586
  if (!placeholder3) return { status: "unchanged", reason: "config.ts has its own clientId, which is the author's binding; it is not replaced" };
205275
205587
  const indent = " ";
205276
- const literal = `{
205588
+ const literal2 = `{
205277
205589
  ${indent}${indent}// Bound to the source site through its One App visitor identity (guide "Same-site identity"): no OAuth client is
205278
205590
  ${indent}${indent}// created on the customer's site, and no environment variable can repoint the build.
205279
205591
  ${indent}${indent}visitorSource: "one-app",
@@ -205282,22 +205594,22 @@ ${indent}${indent}siteUrl: ${JSON.stringify(binding2.siteUrl)},
205282
205594
  ${indent}${indent}bootAsVisitor: true,
205283
205595
  ${indent}${indent}preserveVisitorOnSignOut: true,
205284
205596
  ${indent}}`;
205285
- if (!dryRun) writeFileSync56(configPath, `${source.slice(0, argument.getStart(file2))}${literal}${source.slice(argument.getEnd())}`, "utf8");
205597
+ if (!dryRun) writeFileSync56(configPath, `${source.slice(0, argument.getStart(file2))}${literal2}${source.slice(argument.getEnd())}`, "utf8");
205286
205598
  return { status: "set" };
205287
205599
  }
205288
205600
  function inboxEntriesInConfig(configSource) {
205289
- const file2 = ts17.createSourceFile("config.ts", configSource, ts17.ScriptTarget.Latest, true, ts17.ScriptKind.TS);
205601
+ const file2 = ts18.createSourceFile("config.ts", configSource, ts18.ScriptTarget.Latest, true, ts18.ScriptKind.TS);
205290
205602
  const found = [];
205291
205603
  const literalOf = (o2, name) => {
205292
205604
  const v2 = propOf(o2, name)?.initializer;
205293
- return v2 && ts17.isStringLiteralLike(v2) ? v2 : void 0;
205605
+ return v2 && ts18.isStringLiteralLike(v2) ? v2 : void 0;
205294
205606
  };
205295
205607
  const visit = (node3) => {
205296
- if (ts17.isObjectLiteralExpression(node3)) {
205608
+ if (ts18.isObjectLiteralExpression(node3)) {
205297
205609
  const id = literalOf(node3, "id")?.text;
205298
205610
  const onTap = propOf(node3, "onTap")?.initializer;
205299
- const params = onTap && ts17.isObjectLiteralExpression(onTap) ? propOf(onTap, "params")?.initializer : void 0;
205300
- const tapTarget2 = params && ts17.isObjectLiteralExpression(params) ? literalOf(params, "screenId") : void 0;
205611
+ const params = onTap && ts18.isObjectLiteralExpression(onTap) ? propOf(onTap, "params")?.initializer : void 0;
205612
+ const tapTarget2 = params && ts18.isObjectLiteralExpression(params) ? literalOf(params, "screenId") : void 0;
205301
205613
  if (id === "chat" && tapTarget2) found.push({ site: "top-bar chat", literal: tapTarget2 });
205302
205614
  const screenId = literalOf(node3, "screenId");
205303
205615
  if (id === "drawer_inbox" && screenId) found.push({ site: "drawer Inbox", literal: screenId });
@@ -205305,7 +205617,7 @@ function inboxEntriesInConfig(configSource) {
205305
205617
  if (screenId?.text === "himi_chat_thread" && parent) found.push({ site: "chat thread parent", literal: parent });
205306
205618
  if (screenId?.text === BUSINESS_CHAT_SCREEN && parent?.text === "") found.push({ site: "business chat parent", literal: parent });
205307
205619
  }
205308
- ts17.forEachChild(node3, visit);
205620
+ ts18.forEachChild(node3, visit);
205309
205621
  };
205310
205622
  visit(file2);
205311
205623
  const stale = found.filter((f2) => f2.literal.text === BUSINESS_CHAT_SCREEN || f2.site === "business chat parent");
@@ -205323,8 +205635,8 @@ function reopenAsInbox(node3) {
205323
205635
  }
205324
205636
  if (!node3 || typeof node3 !== "object") return false;
205325
205637
  const record3 = node3;
205326
- if (record3.actionId === "himi.open" && obj8(record3.params).screenId === BUSINESS_CHAT_SCREEN) {
205327
- record3.params = { ...obj8(record3.params), screenId: INBOX_SCREEN };
205638
+ if (record3.actionId === "himi.open" && obj9(record3.params).screenId === BUSINESS_CHAT_SCREEN) {
205639
+ record3.params = { ...obj9(record3.params), screenId: INBOX_SCREEN };
205328
205640
  changed = true;
205329
205641
  }
205330
205642
  for (const value2 of Object.values(record3)) changed = reopenAsInbox(value2) || changed;
@@ -205409,7 +205721,7 @@ function readEntry(dir, screenId) {
205409
205721
  }
205410
205722
  function parseEntry(entryText, screenId) {
205411
205723
  try {
205412
- return obj8(JSON.parse(`{${entryText.trimEnd().replace(/,$/, "")}}`)[screenId]);
205724
+ return obj9(JSON.parse(`{${entryText.trimEnd().replace(/,$/, "")}}`)[screenId]);
205413
205725
  } catch {
205414
205726
  return void 0;
205415
205727
  }
@@ -205418,7 +205730,7 @@ function applyScreenParams(dir, screenId, params, dryRun = false) {
205418
205730
  const descriptor = readEntry(dir, screenId);
205419
205731
  const appear = descriptor ? rootOnAppear2(descriptor) : void 0;
205420
205732
  if (!descriptor || !appear) return "absent";
205421
- const current = obj8(appear.params);
205733
+ const current = obj9(appear.params);
205422
205734
  if (Object.entries(params).every(([k2, v2]) => current[k2] === v2)) return "unchanged";
205423
205735
  if (!dryRun) {
205424
205736
  appear.params = { ...current, ...params };
@@ -205426,6 +205738,23 @@ function applyScreenParams(dir, screenId, params, dryRun = false) {
205426
205738
  }
205427
205739
  return "set";
205428
205740
  }
205741
+ function provisionInviteDrawer(dir, showsInvite, dryRun = false) {
205742
+ const configPath = join130(dir, "config.ts");
205743
+ if (!existsSync121(configPath)) return { status: "absent", reason: "no config.ts to add the Invite row to" };
205744
+ const result = applyInviteDrawer(readFileSync140(configPath, "utf8"), showsInvite);
205745
+ const translated = [];
205746
+ if (result.rowPresent) {
205747
+ const l10n = join130(dir, "l10n");
205748
+ for (const file2 of existsSync121(l10n) ? readdirSync47(l10n).filter((name) => /^[a-z]{2,3}(-[A-Za-z0-9]+)?\.json$/.test(name)) : []) {
205749
+ const next = withInviteTranslation(readFileSync140(join130(l10n, file2), "utf8"), file2.replace(/\.json$/, ""));
205750
+ if (next === void 0) continue;
205751
+ translated.push(file2.replace(/\.json$/, ""));
205752
+ if (!dryRun) writeFileSync56(join130(l10n, file2), next, "utf8");
205753
+ }
205754
+ if (result.status === "set" && !dryRun) writeFileSync56(configPath, result.text, "utf8");
205755
+ }
205756
+ return { status: result.status, ...result.reason ? { reason: result.reason } : {}, ...translated.length ? { translated } : {} };
205757
+ }
205429
205758
  function provisionScreens(dir, facts, dryRun = false) {
205430
205759
  const out2 = { set: [], unchanged: [], unverified: [], absent: [], renamed: [] };
205431
205760
  const byScreen = /* @__PURE__ */ new Map();
@@ -205441,7 +205770,7 @@ function provisionScreens(dir, facts, dryRun = false) {
205441
205770
  out2.absent.push(screenId);
205442
205771
  continue;
205443
205772
  }
205444
- const params = { ...obj8(appear.params) };
205773
+ const params = { ...obj9(appear.params) };
205445
205774
  let changed = false;
205446
205775
  for (const item of items) {
205447
205776
  const value2 = facts[item.evidence === "paymentCurrency" ? "paymentCurrency" : "timeZone"];
@@ -205466,6 +205795,7 @@ function provisionScreens(dir, facts, dryRun = false) {
205466
205795
  out2.renamed = provisionScreenNames(dir, facts.displayName, dryRun);
205467
205796
  out2.tabBar = provisionTabBar(dir, dryRun);
205468
205797
  out2.chat = provisionChatTarget(dir, facts.memberChat, dryRun);
205798
+ out2.invite = provisionInviteDrawer(dir, facts.showsInvite === true, dryRun);
205469
205799
  out2.siteBinding = provisionSiteBinding(dir, { metaSiteId: facts.metaSiteId, siteUrl: facts.siteUrl }, dryRun);
205470
205800
  return out2;
205471
205801
  }
@@ -205499,8 +205829,8 @@ async function runOneAppProvision(args, io2) {
205499
205829
  }
205500
205830
  let facts;
205501
205831
  try {
205502
- const manifest2 = obj8(verifiedEvidence(resolve89(evidenceDir)).manifest);
205503
- const context = obj8(readHashedEvidenceJson(resolve89(evidenceDir), "business-context.json"));
205832
+ const manifest2 = obj9(verifiedEvidence(resolve89(evidenceDir)).manifest);
205833
+ const context = obj9(readHashedEvidenceJson(resolve89(evidenceDir), "business-context.json"));
205504
205834
  facts = {
205505
205835
  ...typeof context.paymentCurrency === "string" && /^[A-Z]{3}$/.test(context.paymentCurrency) ? { paymentCurrency: context.paymentCurrency } : {},
205506
205836
  ...typeof context.timeZone === "string" && context.timeZone ? { timeZone: context.timeZone } : {},
@@ -205508,8 +205838,10 @@ async function runOneAppProvision(args, io2) {
205508
205838
  // Recorded by the collection from the source's own Inbox setting: only an explicit true counts.
205509
205839
  ...manifest2.memberChat === true ? { memberChat: true } : {},
205510
205840
  // The source site the migration collected from: what the same-site binding is written from.
205511
- ...typeof obj8(manifest2.source).metaSiteId === "string" ? { metaSiteId: obj8(manifest2.source).metaSiteId } : {},
205512
- ...typeof manifest2.siteUrl === "string" && manifest2.siteUrl ? { siteUrl: manifest2.siteUrl } : {}
205841
+ ...typeof obj9(manifest2.source).metaSiteId === "string" ? { metaSiteId: obj9(manifest2.source).metaSiteId } : {},
205842
+ ...typeof manifest2.siteUrl === "string" && manifest2.siteUrl ? { siteUrl: manifest2.siteUrl } : {},
205843
+ // The source header's own Invite setting, as planned at collection (an older collection has no plan: nothing is added).
205844
+ ...sourceShowsInvite(readHashedEvidenceJson(resolve89(evidenceDir), "invite-plan.json")) ? { showsInvite: true } : {}
205513
205845
  };
205514
205846
  } catch (error) {
205515
205847
  return report4(io2, false, { code: "evidence_invalid", error: error instanceof Error ? error.message : String(error) });
@@ -205521,7 +205853,7 @@ async function runOneAppProvision(args, io2) {
205521
205853
  return report4(io2, false, { code: "content_invalid", error: error instanceof Error ? error.message : String(error) });
205522
205854
  }
205523
205855
  }
205524
- var obj8, PROVISION_USAGE, PROVISIONED_PARAMS, propName6, propOf, GUID2, INBOX_SCREEN, BUSINESS_CHAT_SCREEN, INBOX_DOOR_SCREENS, NAME_SLOTS;
205856
+ var obj9, PROVISION_USAGE, PROVISIONED_PARAMS, propName6, propOf, GUID2, INBOX_SCREEN, BUSINESS_CHAT_SCREEN, INBOX_DOOR_SCREENS, NAME_SLOTS;
205525
205857
  var init_provision = __esm({
205526
205858
  "src/one-app/provision.ts"() {
205527
205859
  init_define_HHP_CATALOG();
@@ -205531,7 +205863,8 @@ var init_provision = __esm({
205531
205863
  init_coverage();
205532
205864
  init_validate_topbar();
205533
205865
  init_validate_identity();
205534
- obj8 = (v2) => v2 && typeof v2 === "object" && !Array.isArray(v2) ? v2 : {};
205866
+ init_invite_drawer();
205867
+ obj9 = (v2) => v2 && typeof v2 === "object" && !Array.isArray(v2) ? v2 : {};
205535
205868
  PROVISION_USAGE = "himi one-app provision --evidence-dir <.himi/one-app> --content <app-dir> [--dry-run]";
205536
205869
  PROVISIONED_PARAMS = [
205537
205870
  { screenId: "himi_loyalty", param: "currency", evidence: "paymentCurrency" },
@@ -205539,8 +205872,8 @@ var init_provision = __esm({
205539
205872
  { screenId: "himi_service", param: "businessTimeZone", evidence: "timeZone" },
205540
205873
  { screenId: "himi_time", param: "businessTimeZone", evidence: "timeZone" }
205541
205874
  ];
205542
- propName6 = (p2) => ts17.isPropertyAssignment(p2) && (ts17.isIdentifier(p2.name) || ts17.isStringLiteral(p2.name)) ? p2.name.text : void 0;
205543
- propOf = (o2, name) => o2.properties.find((p2) => propName6(p2) === name && ts17.isPropertyAssignment(p2));
205875
+ propName6 = (p2) => ts18.isPropertyAssignment(p2) && (ts18.isIdentifier(p2.name) || ts18.isStringLiteral(p2.name)) ? p2.name.text : void 0;
205876
+ propOf = (o2, name) => o2.properties.find((p2) => propName6(p2) === name && ts18.isPropertyAssignment(p2));
205544
205877
  GUID2 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
205545
205878
  INBOX_SCREEN = "himi_inbox";
205546
205879
  BUSINESS_CHAT_SCREEN = "himi_business_chat";
@@ -205679,16 +206012,16 @@ var init_generate_cli = __esm({
205679
206012
  });
205680
206013
 
205681
206014
  // src/one-app/access.ts
205682
- import ts18 from "typescript";
205683
- import { createHash as createHash57 } from "node:crypto";
206015
+ import ts19 from "typescript";
206016
+ import { createHash as createHash58 } from "node:crypto";
205684
206017
  function gateKey(layoutItemId) {
205685
206018
  let out2 = "g_";
205686
206019
  for (const char of layoutItemId.toLowerCase()) out2 += char >= "a" && char <= "z" || char >= "0" && char <= "9" ? char : "_";
205687
206020
  return out2;
205688
206021
  }
205689
206022
  function ruleOf(permissions) {
205690
- if (permissions.badges) return { kind: "badges", ids: strings(obj9(permissions.badges).ids) };
205691
- if (permissions.paidPlans) return { kind: "paidPlans", ids: strings(obj9(permissions.paidPlans).ids) };
206023
+ if (permissions.badges) return { kind: "badges", ids: strings(obj10(permissions.badges).ids) };
206024
+ if (permissions.paidPlans) return { kind: "paidPlans", ids: strings(obj10(permissions.paidPlans).ids) };
205692
206025
  if (permissions.membersOnly === true) return { kind: "membersOnly" };
205693
206026
  return void 0;
205694
206027
  }
@@ -205697,10 +206030,10 @@ function planAccess(raw, screens, previous = []) {
205697
206030
  const unmapped = [];
205698
206031
  const warnings = [];
205699
206032
  const taken = /* @__PURE__ */ new Map();
205700
- for (const [id, value2] of Object.entries(obj9(raw.layoutItems))) {
205701
- const item = obj9(value2);
206033
+ for (const [id, value2] of Object.entries(obj10(raw.layoutItems))) {
206034
+ const item = obj10(value2);
205702
206035
  const layoutItemId = text13(item.id) || id;
205703
- const permissions = obj9(item.permissions);
206036
+ const permissions = obj10(item.permissions);
205704
206037
  const rule = ruleOf(permissions);
205705
206038
  if (!rule) continue;
205706
206039
  const title = text13(item.title);
@@ -205715,7 +206048,7 @@ function planAccess(raw, screens, previous = []) {
205715
206048
  continue;
205716
206049
  }
205717
206050
  taken.set(screenId, layoutItemId);
205718
- const settings = obj9(permissions.accessScreenSettings);
206051
+ const settings = obj10(permissions.accessScreenSettings);
205719
206052
  const visible = settings.screenVisible ?? settings.isScreenVisible;
205720
206053
  gates.push({
205721
206054
  key: gateKey(layoutItemId),
@@ -205739,7 +206072,7 @@ function planAccess(raw, screens, previous = []) {
205739
206072
  for (const gate of gates.filter((item) => !written.has(item.layoutItemId))) byKey.set(gate.key, [...byKey.get(gate.key) ?? [], gate]);
205740
206073
  for (const [key3, group] of byKey) {
205741
206074
  if (group.length < 2 && !writtenKeys.has(key3)) continue;
205742
- for (const gate of group) gate.key = `${key3}_${createHash57("sha256").update(gate.layoutItemId).digest("hex").slice(0, 10)}`;
206075
+ for (const gate of group) gate.key = `${key3}_${createHash58("sha256").update(gate.layoutItemId).digest("hex").slice(0, 10)}`;
205743
206076
  warnings.push(`layout items ${group.map((gate) => gate.layoutItemId).join(", ")} normalize to a gate key another page has: each gets a hash suffix`);
205744
206077
  }
205745
206078
  if (new Set(gates.map((gate) => gate.key)).size !== gates.length) throw new Error("two layout items still share a gate key after the hash suffix: rename one in the source");
@@ -205795,18 +206128,18 @@ function applyEdits(source, edits) {
205795
206128
  return out2;
205796
206129
  }
205797
206130
  function parse3(fileName, source) {
205798
- const file2 = ts18.createSourceFile(fileName, source, ts18.ScriptTarget.Latest, true, ts18.ScriptKind.TS);
206131
+ const file2 = ts19.createSourceFile(fileName, source, ts19.ScriptTarget.Latest, true, ts19.ScriptKind.TS);
205799
206132
  return file2.parseDiagnostics.length ? void 0 : file2;
205800
206133
  }
205801
206134
  function screensObject(file2) {
205802
206135
  for (const statement of file2.statements) {
205803
- if (!ts18.isVariableStatement(statement)) continue;
206136
+ if (!ts19.isVariableStatement(statement)) continue;
205804
206137
  for (const declaration of statement.declarationList.declarations) {
205805
- if (!ts18.isIdentifier(declaration.name) || declaration.name.text !== "SCREENS" || !declaration.initializer) continue;
206138
+ if (!ts19.isIdentifier(declaration.name) || declaration.name.text !== "SCREENS" || !declaration.initializer) continue;
205806
206139
  let init = declaration.initializer;
205807
- while (ts18.isParenthesizedExpression(init) || ts18.isAsExpression(init) || ts18.isSatisfiesExpression(init)) init = init.expression;
205808
- if (ts18.isCallExpression(init) && init.arguments[0] && ts18.isObjectLiteralExpression(init.arguments[0])) return init.arguments[0];
205809
- if (ts18.isObjectLiteralExpression(init)) return init;
206140
+ while (ts19.isParenthesizedExpression(init) || ts19.isAsExpression(init) || ts19.isSatisfiesExpression(init)) init = init.expression;
206141
+ if (ts19.isCallExpression(init) && init.arguments[0] && ts19.isObjectLiteralExpression(init.arguments[0])) return init.arguments[0];
206142
+ if (ts19.isObjectLiteralExpression(init)) return init;
205810
206143
  }
205811
206144
  }
205812
206145
  return void 0;
@@ -205816,7 +206149,7 @@ function declaredScreens(source) {
205816
206149
  const screens = file2 && screensObject(file2);
205817
206150
  if (!screens) return void 0;
205818
206151
  const out2 = /* @__PURE__ */ new Set();
205819
- for (const property2 of screens.properties) if (ts18.isPropertyAssignment(property2)) {
206152
+ for (const property2 of screens.properties) if (ts19.isPropertyAssignment(property2)) {
205820
206153
  const name = propName5(property2.name);
205821
206154
  if (name) out2.add(name);
205822
206155
  }
@@ -205825,7 +206158,7 @@ function declaredScreens(source) {
205825
206158
  function payloadParts(source, payload) {
205826
206159
  const parts = {};
205827
206160
  for (const property2 of payload.properties) {
205828
- if (!ts18.isPropertyAssignment(property2)) return void 0;
206161
+ if (!ts19.isPropertyAssignment(property2)) return void 0;
205829
206162
  const name = propName5(property2.name);
205830
206163
  if (!name || !PAYLOAD_KEYS.has(name)) return void 0;
205831
206164
  parts[name] = slice(source, property2.initializer);
@@ -205838,9 +206171,9 @@ function openCase(payload, gate, source) {
205838
206171
  if (!body || stringValue3(findProperty(body, "type")?.initializer) !== "FragmentSlot" || !props2) return "none";
205839
206172
  if (stringValue3(findProperty(props2, "casePath")?.initializer) !== accessStatePath(gate)) return "none";
205840
206173
  const cases = findProperty(props2, "cases")?.initializer;
205841
- if (!cases || !ts18.isArrayLiteralExpression(cases)) return void 0;
206174
+ if (!cases || !ts19.isArrayLiteralExpression(cases)) return void 0;
205842
206175
  for (const element of cases.elements) {
205843
- if (!ts18.isObjectLiteralExpression(element)) continue;
206176
+ if (!ts19.isObjectLiteralExpression(element)) continue;
205844
206177
  if (stringValue3(findProperty(element, "id")?.initializer) !== "open") continue;
205845
206178
  const content = objectValue(findProperty(element, "content"));
205846
206179
  return content ? payloadParts(source, content) : void 0;
@@ -205878,7 +206211,7 @@ function applyScreens(source, gates, context) {
205878
206211
  const conflicts = [];
205879
206212
  const hiding = gates.filter(mayHide);
205880
206213
  const visit = (current) => {
205881
- if (ts18.isPropertyAssignment(current) && propName5(current.name) === "onTap" && ts18.isObjectLiteralExpression(current.initializer) && ts18.isObjectLiteralExpression(current.parent)) {
206214
+ if (ts19.isPropertyAssignment(current) && propName5(current.name) === "onTap" && ts19.isObjectLiteralExpression(current.initializer) && ts19.isObjectLiteralExpression(current.parent)) {
205882
206215
  const params = objectValue(findProperty(current.initializer, "params"));
205883
206216
  const opens = stringValue3(findProperty(current.initializer, "actionId")?.initializer) === "himi.open" ? stringValue3(params && findProperty(params, "screenId")?.initializer) : void 0;
205884
206217
  const gate = hiding.find((item) => item.screenId === opens);
@@ -205890,7 +206223,7 @@ function applyScreens(source, gates, context) {
205890
206223
  } else if (stringValue3(existing.initializer) !== accessRowHiddenPath(gate)) conflicts.push(`an entry opening ${gate.screenId} already has hiddenPath ${slice(source, existing.initializer)}`);
205891
206224
  }
205892
206225
  }
205893
- ts18.forEachChild(current, visit);
206226
+ ts19.forEachChild(current, visit);
205894
206227
  };
205895
206228
  visit(first);
205896
206229
  if (conflicts.length) return refuse7(conflicts.join("; "));
@@ -205901,7 +206234,7 @@ function applyScreens(source, gates, context) {
205901
206234
  const missing3 = [];
205902
206235
  const edits = [];
205903
206236
  for (const gate of gates) {
205904
- const screen = screens.properties.find((property2) => ts18.isPropertyAssignment(property2) && propName5(property2.name) === gate.screenId);
206237
+ const screen = screens.properties.find((property2) => ts19.isPropertyAssignment(property2) && propName5(property2.name) === gate.screenId);
205905
206238
  if (!screen) {
205906
206239
  missing3.push(gate.screenId);
205907
206240
  continue;
@@ -205928,7 +206261,7 @@ function applyConfig(configText, gates, options = {}) {
205928
206261
  const navigationProperty = app && findProperty(app, "navigation");
205929
206262
  const navigation = objectValue(navigationProperty);
205930
206263
  if (!navigation) return refuse7("config.ts has no literal `navigation: {...}` in its defineApp call");
205931
- if (navigation.properties.some((property2) => !ts18.isPropertyAssignment(property2))) return refuse7("navigation has spreads or accessors, so it cannot be edited safely");
206264
+ if (navigation.properties.some((property2) => !ts19.isPropertyAssignment(property2))) return refuse7("navigation has spreads or accessors, so it cannot be edited safely");
205932
206265
  const edits = [];
205933
206266
  const bound2 = [];
205934
206267
  const conflicts = [];
@@ -205959,7 +206292,7 @@ ${indent}"navLogicBundle": ${indented(headerBadgesBundleRef(ACCESS_NAV_BUNDLE),
205959
206292
  const appBlock = objectValue(appProperty);
205960
206293
  const declared = appBlock && findProperty(appBlock, "newApp");
205961
206294
  if (appProperty && !appBlock) conflicts.push("`app` in config.ts is not an object literal, so `newApp` cannot be added to it safely");
205962
- else if (declared?.initializer.kind !== ts18.SyntaxKind.TrueKeyword) {
206295
+ else if (declared?.initializer.kind !== ts19.SyntaxKind.TrueKeyword) {
205963
206296
  if (declared) conflicts.push("`app.newApp` is declared but not `true`: the page locks need app services, which an app that already shipped older binaries cannot use yet");
205964
206297
  else if (!options.newApp) return { ...refuse7(NEW_APP_REASON), needsNewApp: true };
205965
206298
  else if (appBlock) edits.push({ start: appBlock.getStart() + 1, end: appBlock.getStart() + 1, replacement: `
@@ -205977,7 +206310,7 @@ ${indent}"app": { "newApp": true },` });
205977
206310
  const itemsOf = (name) => {
205978
206311
  const block = objectValue(findProperty(navigation, name));
205979
206312
  const list2 = block && findProperty(block, "items")?.initializer;
205980
- return list2 && ts18.isArrayLiteralExpression(list2) ? list2.elements.filter(ts18.isObjectLiteralExpression) : [];
206313
+ return list2 && ts19.isArrayLiteralExpression(list2) ? list2.elements.filter(ts19.isObjectLiteralExpression) : [];
205981
206314
  };
205982
206315
  const screenOf = (row2) => stringValue3(findProperty(row2, "screenId")?.initializer);
205983
206316
  const tabs = itemsOf("tabBar");
@@ -205994,7 +206327,7 @@ ${indent}"app": { "newApp": true },` });
205994
206327
  const home = [];
205995
206328
  const found = /* @__PURE__ */ new Set();
205996
206329
  const visit = (current) => {
205997
- if (ts18.isObjectLiteralExpression(current) && findProperty(current, "label")) {
206330
+ if (ts19.isObjectLiteralExpression(current) && findProperty(current, "label")) {
205998
206331
  const screenId = stringValue3(findProperty(current, "screenId")?.initializer);
205999
206332
  const gate = hiding.find((item) => item.screenId === screenId);
206000
206333
  if (gate) {
@@ -206016,11 +206349,11 @@ ${indent}` });
206016
206349
  edits.push({ start: existing.getStart(), end: existing.getStart(), replacement: `"hiddenUntilResolved": true,
206017
206350
  ${indent}` });
206018
206351
  bound2.push(gate.screenId);
206019
- } else if (resolved2.initializer.kind !== ts18.SyntaxKind.TrueKeyword) conflicts.push(`the entry for ${gate.screenId} sets hiddenUntilResolved to something other than true, which would show a hidden tab before the lock is decided`);
206352
+ } else if (resolved2.initializer.kind !== ts19.SyntaxKind.TrueKeyword) conflicts.push(`the entry for ${gate.screenId} sets hiddenUntilResolved to something other than true, which would show a hidden tab before the lock is decided`);
206020
206353
  }
206021
206354
  }
206022
206355
  }
206023
- ts18.forEachChild(current, visit);
206356
+ ts19.forEachChild(current, visit);
206024
206357
  };
206025
206358
  visit(navigation);
206026
206359
  if (conflicts.length) return refuse7(conflicts.join("; "));
@@ -206036,16 +206369,16 @@ function applyLoginWall(configText, wall, options = {}) {
206036
206369
  const authProperty = app && findProperty(app, "auth");
206037
206370
  if (!authProperty) return refuse7("config.ts has no literal `auth: ...` in its defineApp call");
206038
206371
  const init = authProperty.initializer;
206039
- const wrapped = ts18.isCallExpression(init) && ts18.isIdentifier(init.expression) && init.expression.text === LOGIN_HELPER && init.arguments.length === 1;
206372
+ const wrapped = ts19.isCallExpression(init) && ts19.isIdentifier(init.expression) && init.expression.text === LOGIN_HELPER && init.arguments.length === 1;
206040
206373
  if (wall === "none") {
206041
206374
  if (wrapped && options.keepExisting) return { status: "unchanged", text: configText, kept: true };
206042
206375
  return wrapped ? refuse7("the app requires login (`requireLogin` in config.ts) but the source no longer does: remove it by hand, a login requirement is not taken out automatically") : { status: "unchanged", text: configText };
206043
206376
  }
206044
206377
  if (wrapped) return { status: "unchanged", text: configText };
206045
- const declared = file2.statements.some((statement) => ts18.isVariableStatement(statement) && statement.declarationList.declarations.some((declaration) => ts18.isIdentifier(declaration.name) && declaration.name.text === LOGIN_HELPER));
206378
+ const declared = file2.statements.some((statement) => ts19.isVariableStatement(statement) && statement.declarationList.declarations.some((declaration) => ts19.isIdentifier(declaration.name) && declaration.name.text === LOGIN_HELPER));
206046
206379
  const edits = [{ start: init.getStart(), end: init.getEnd(), replacement: `${LOGIN_HELPER}(${init.getText(file2)})` }];
206047
206380
  if (!declared) {
206048
- const imports = file2.statements.filter(ts18.isImportDeclaration);
206381
+ const imports = file2.statements.filter(ts19.isImportDeclaration);
206049
206382
  const at2 = imports.length ? imports[imports.length - 1].getEnd() : 0;
206050
206383
  edits.push({ start: at2, end: at2, replacement: `
206051
206384
 
@@ -206060,14 +206393,14 @@ function tableGates(tableText) {
206060
206393
  const file2 = parse3("access-gates-table.ts", tableText);
206061
206394
  if (!file2) return void 0;
206062
206395
  for (const statement of file2.statements) {
206063
- if (!ts18.isVariableStatement(statement)) continue;
206396
+ if (!ts19.isVariableStatement(statement)) continue;
206064
206397
  for (const declaration of statement.declarationList.declarations) {
206065
- if (!ts18.isIdentifier(declaration.name) || declaration.name.text !== "ACCESS_GATES" || !declaration.initializer) continue;
206398
+ if (!ts19.isIdentifier(declaration.name) || declaration.name.text !== "ACCESS_GATES" || !declaration.initializer) continue;
206066
206399
  let init = declaration.initializer;
206067
- while (ts18.isParenthesizedExpression(init) || ts18.isAsExpression(init) || ts18.isSatisfiesExpression(init)) init = init.expression;
206068
- if (!ts18.isArrayLiteralExpression(init)) return void 0;
206400
+ while (ts19.isParenthesizedExpression(init) || ts19.isAsExpression(init) || ts19.isSatisfiesExpression(init)) init = init.expression;
206401
+ if (!ts19.isArrayLiteralExpression(init)) return void 0;
206069
206402
  return init.elements.flatMap((element) => {
206070
- if (!ts18.isObjectLiteralExpression(element)) return [];
206403
+ if (!ts19.isObjectLiteralExpression(element)) return [];
206071
206404
  const key3 = stringValue3(findProperty(element, "key")?.initializer);
206072
206405
  if (key3 === void 0) return [];
206073
206406
  return [{ key: key3, layoutItemId: stringValue3(findProperty(element, "layoutItemId")?.initializer) ?? "", screenId: stringValue3(findProperty(element, "screenId")?.initializer) ?? "" }];
@@ -206091,13 +206424,13 @@ function renderGateTable(gates) {
206091
206424
  ""
206092
206425
  ].join("\n");
206093
206426
  }
206094
- var obj9, text13, strings, mayHide, STOCK_COPY, node2, SIGN_IN_SCREEN, CHAT_SCREEN, PLANS_SCREEN, slotPrefix, accessStatePath, accessRowHiddenPath, accessHiddenPath, slice, stringValue3, objectValue, PAYLOAD_KEYS, indented, LOGIN_HELPER, NEW_APP_REASON;
206427
+ var obj10, text13, strings, mayHide, STOCK_COPY, node2, SIGN_IN_SCREEN, CHAT_SCREEN, PLANS_SCREEN, slotPrefix, accessStatePath, accessRowHiddenPath, accessHiddenPath, slice, stringValue3, objectValue, PAYLOAD_KEYS, indented, LOGIN_HELPER, NEW_APP_REASON;
206095
206428
  var init_access = __esm({
206096
206429
  "src/one-app/access.ts"() {
206097
206430
  init_define_HHP_CATALOG();
206098
206431
  init_shared_drift();
206099
206432
  init_header_badges();
206100
- obj9 = (value2) => value2 && typeof value2 === "object" && !Array.isArray(value2) ? value2 : {};
206433
+ obj10 = (value2) => value2 && typeof value2 === "object" && !Array.isArray(value2) ? value2 : {};
206101
206434
  text13 = (value2) => typeof value2 === "string" ? value2 : "";
206102
206435
  strings = (value2) => Array.isArray(value2) ? value2.filter((item) => typeof item === "string") : [];
206103
206436
  mayHide = (gate) => gate.mode === "hidden" || gate.hideFromVisitors;
@@ -206121,8 +206454,8 @@ var init_access = __esm({
206121
206454
  accessRowHiddenPath = (gate) => `$app:${NAV_SERVICE}.accessHidden.${gate.key}`;
206122
206455
  accessHiddenPath = (gate) => `$service:${NAV_SERVICE}.accessHidden.${gate.key}`;
206123
206456
  slice = (source, node3) => source.slice(node3.getStart(), node3.getEnd());
206124
- stringValue3 = (node3) => node3 && (ts18.isStringLiteral(node3) || ts18.isNoSubstitutionTemplateLiteral(node3)) ? node3.text : void 0;
206125
- objectValue = (property2) => property2 && ts18.isObjectLiteralExpression(property2.initializer) ? property2.initializer : void 0;
206457
+ stringValue3 = (node3) => node3 && (ts19.isStringLiteral(node3) || ts19.isNoSubstitutionTemplateLiteral(node3)) ? node3.text : void 0;
206458
+ objectValue = (property2) => property2 && ts19.isObjectLiteralExpression(property2.initializer) ? property2.initializer : void 0;
206126
206459
  PAYLOAD_KEYS = /* @__PURE__ */ new Set(["id", "body", "modifiers"]);
206127
206460
  indented = (value2, indent) => JSON.stringify(value2, null, 2).replaceAll("\n", `
206128
206461
  ${indent}`);
@@ -206132,7 +206465,7 @@ ${indent}`);
206132
206465
  });
206133
206466
 
206134
206467
  // src/one-app/access-cli.ts
206135
- import { createHash as createHash58 } from "node:crypto";
206468
+ import { createHash as createHash59 } from "node:crypto";
206136
206469
  import { existsSync as existsSync123, readFileSync as readFileSync142, rmSync as rmSync37, statSync as statSync33, writeFileSync as writeFileSync58 } from "node:fs";
206137
206470
  import { join as join132, resolve as resolve91 } from "node:path";
206138
206471
  function parseArgs5(args) {
@@ -206269,7 +206602,7 @@ function recordedLoginPolicy(evidenceDir) {
206269
206602
  const expected = manifest2.sha256?.["access-policy.json"];
206270
206603
  if (expected === void 0) return void 0;
206271
206604
  const bytes2 = readFileSync142(join132(evidenceDir, "access-policy.json"));
206272
- if (createHash58("sha256").update(bytes2).digest("hex") !== expected) throw new Error("access-policy.json does not match the hash recorded in manifest.json.");
206605
+ if (createHash59("sha256").update(bytes2).digest("hex") !== expected) throw new Error("access-policy.json does not match the hash recorded in manifest.json.");
206273
206606
  const value2 = JSON.parse(bytes2.toString("utf8")).visitorModeEnabled;
206274
206607
  return typeof value2 === "boolean" ? value2 : void 0;
206275
206608
  }
@@ -206536,8 +206869,8 @@ var init_access_policy = __esm({
206536
206869
  import { readFileSync as readFileSync143 } from "node:fs";
206537
206870
  import { join as join133, resolve as resolve92 } from "node:path";
206538
206871
  function preservesUnverifiedFlow(flow) {
206539
- const checkout = obj10(flow.checkout);
206540
- return flow.payment === "online-paid" && obj10(flow.readiness).state === "unverified" && checkout.state === "supported" && text14(checkout.evidence) && (flow.decision === void 0 || obj10(flow.decision).action === "proceed");
206872
+ const checkout = obj11(flow.checkout);
206873
+ return flow.payment === "online-paid" && obj11(flow.readiness).state === "unverified" && checkout.state === "supported" && text14(checkout.evidence) && (flow.decision === void 0 || obj11(flow.decision).action === "proceed");
206541
206874
  }
206542
206875
  function initialPaymentReview(metaSiteId) {
206543
206876
  return {
@@ -206554,7 +206887,7 @@ function initialPaymentReview(metaSiteId) {
206554
206887
  };
206555
206888
  }
206556
206889
  function paymentReviewIssues(value2, metaSiteId) {
206557
- const review = obj10(value2);
206890
+ const review = obj11(value2);
206558
206891
  const issues = [];
206559
206892
  if (review.schemaVersion !== 1 && review.schemaVersion !== 2 || !sameSite(review.metaSiteId, metaSiteId)) issues.push("Review must name the collected site and schemaVersion 2 (or 1 for a legacy review).");
206560
206893
  if (review.inventoryReviewed !== true || !text14(review.inventoryEvidence)) issues.push("Review the source actions and live read-only catalog/payment options, including free and offline flows, before generation.");
@@ -206563,7 +206896,7 @@ function paymentReviewIssues(value2, metaSiteId) {
206563
206896
  if (review.flows.length > 0 && review.noPurchaseFlows === true) issues.push("A no-purchase finding cannot accompany listed flows; review the inventory.");
206564
206897
  const ids = /* @__PURE__ */ new Set();
206565
206898
  for (const [index, value3] of review.flows.entries()) {
206566
- const flow = obj10(value3);
206899
+ const flow = obj11(value3);
206567
206900
  const label3 = `Flow ${index + 1}`;
206568
206901
  if (!text14(flow.id) || ids.has(String(flow.id))) issues.push(`${label3} needs a unique source-bound id.`);
206569
206902
  ids.add(String(flow.id));
@@ -206573,9 +206906,9 @@ function paymentReviewIssues(value2, metaSiteId) {
206573
206906
  issues.push(`${label3} has unresolved payment intent; split mixed online/offline choices into separate flows.`);
206574
206907
  continue;
206575
206908
  }
206576
- const readiness = obj10(flow.readiness);
206577
- const decision = obj10(flow.decision);
206578
- const checkout = obj10(flow.checkout);
206909
+ const readiness = obj11(flow.readiness);
206910
+ const decision = obj11(flow.decision);
206911
+ const checkout = obj11(flow.checkout);
206579
206912
  if ((review.schemaVersion === 2 || flow.checkout !== void 0) && (typeof checkout.state !== "string" || !["supported", "unsupported", "unverified"].includes(checkout.state) || !text14(checkout.evidence))) issues.push(`${label3} needs supported, unsupported or unverified target checkout compatibility with evidence.`);
206580
206913
  if (!sameSite(readiness.metaSiteId, metaSiteId)) issues.push(`${label3} readiness must name the collected site; evidence from another site cannot authorize checkout.`);
206581
206914
  if (typeof readiness.state !== "string" || !["ready", "missing", "unverified"].includes(readiness.state) || !text14(readiness.evidence)) issues.push(`${label3} needs ready, missing or unverified readiness with site-bound evidence.`);
@@ -206589,7 +206922,7 @@ function paymentReviewIssues(value2, metaSiteId) {
206589
206922
  if (decision.action === "connect-provider") issues.push(`${label3} is waiting for owner setup and a new readiness review; do not generate its paid UI yet.`);
206590
206923
  if (decision.action === "retain") {
206591
206924
  if (!text14(decision.explanation)) issues.push(`${label3} must explain payment availability before checkout.`);
206592
- const recovery = obj10(decision.recovery);
206925
+ const recovery = obj11(decision.recovery);
206593
206926
  if (recovery.action !== "back" && !(recovery.action === "contact" && text14(recovery.target))) issues.push(`${label3} must record a back action or the real contact route to implement before checkout.`);
206594
206927
  }
206595
206928
  }
@@ -206613,12 +206946,12 @@ function runPaymentReview(args, io2) {
206613
206946
  if (!evidenceDir) return fail8("invalid_usage", ["Pass --evidence-dir."], 2);
206614
206947
  try {
206615
206948
  const { manifest: manifest2 } = verifiedEvidence(evidenceDir);
206616
- const metaSiteId = obj10(manifest2.source).metaSiteId;
206949
+ const metaSiteId = obj11(manifest2.source).metaSiteId;
206617
206950
  if (typeof metaSiteId !== "string") throw Error("Missing site binding");
206618
206951
  const review = JSON.parse(readFileSync143(join133(evidenceDir, "payment-review.json"), "utf8"));
206619
206952
  const issues = paymentReviewIssues(review, metaSiteId);
206620
206953
  if (issues.length) return fail8("payment_decision_required", issues, 1);
206621
- const warnings = obj10(review).flows.map(obj10).filter(preservesUnverifiedFlow).map((flow) => ({
206954
+ const warnings = obj11(review).flows.map(obj11).filter(preservesUnverifiedFlow).map((flow) => ({
206622
206955
  code: "payment_readiness_unverified",
206623
206956
  flowId: flow.id,
206624
206957
  message: "Payment setup could not be verified. Preserve the existing purchase flow with its supported checkout; do not claim payments are disconnected."
@@ -206629,12 +206962,12 @@ function runPaymentReview(args, io2) {
206629
206962
  return fail8("payment_review_unreadable", ["Read the collected manifest and source evidence, then prepare payment-review.json for that site."], 1);
206630
206963
  }
206631
206964
  }
206632
- var obj10, text14, sameSite, PAYMENT_REVIEW_USAGE;
206965
+ var obj11, text14, sameSite, PAYMENT_REVIEW_USAGE;
206633
206966
  var init_payment_review = __esm({
206634
206967
  "src/one-app/payment-review.ts"() {
206635
206968
  init_define_HHP_CATALOG();
206636
206969
  init_coverage();
206637
- obj10 = (value2) => value2 !== null && typeof value2 === "object" && !Array.isArray(value2) ? value2 : {};
206970
+ obj11 = (value2) => value2 !== null && typeof value2 === "object" && !Array.isArray(value2) ? value2 : {};
206638
206971
  text14 = (value2) => typeof value2 === "string" && value2.trim().length > 0;
206639
206972
  sameSite = (value2, expected) => typeof value2 === "string" && value2.toLowerCase() === expected.toLowerCase();
206640
206973
  PAYMENT_REVIEW_USAGE = "himi one-app validate-payments --evidence-dir <.himi/one-app> [--json]";
@@ -206804,7 +207137,7 @@ __export(cli_exports2, {
206804
207137
  runOneAppCommand: () => runOneAppCommand
206805
207138
  });
206806
207139
  import { closeSync as closeSync9, constants as constants9, lstatSync as lstatSync29, mkdirSync as mkdirSync53, openSync as openSync8, readFileSync as readFileSync144, realpathSync as realpathSync17, writeFileSync as writeFileSync59 } from "node:fs";
206807
- import { createHash as createHash59 } from "node:crypto";
207140
+ import { createHash as createHash60 } from "node:crypto";
206808
207141
  import { isIP as isIP2 } from "node:net";
206809
207142
  import { dirname as dirname65, join as join134, parse as parse4, resolve as resolve93 } from "node:path";
206810
207143
  function nativeSiteHost(host) {
@@ -207019,7 +207352,7 @@ validate-payments checks site-bound payment evidence and explicit paid-flow deci
207019
207352
  throw new OneAppError("artifact_write_failed", "Could not save the migration evidence. Existing files were kept.", { stage });
207020
207353
  }
207021
207354
  artifacts[name] = path2;
207022
- hashes[name] = createHash59("sha256").update(content).digest("hex");
207355
+ hashes[name] = createHash60("sha256").update(content).digest("hex");
207023
207356
  return path2;
207024
207357
  };
207025
207358
  const progress = (nextStage) => {
@@ -208559,30 +208892,30 @@ function verticalForSection(definitionId) {
208559
208892
  return SECTION_PREFIX_TO_VERTICAL.find(([prefix]) => definitionId.startsWith(prefix))?.[1];
208560
208893
  }
208561
208894
  function inOrder(refs) {
208562
- return refs.map(obj11);
208895
+ return refs.map(obj12);
208563
208896
  }
208564
208897
  function access(value2) {
208565
- const p2 = obj11(value2);
208898
+ const p2 = obj12(value2);
208566
208899
  const out2 = {};
208567
208900
  if (p2.membersOnly === true || p2.type === "membersOnly") out2.membersOnly = true;
208568
- const badges = strs2(obj11(p2.badges).ids);
208901
+ const badges = strs2(obj12(p2.badges).ids);
208569
208902
  if (badges.length) out2.badgeIds = badges;
208570
- const plans = strs2(obj11(pick2(p2, "paidPlans", "paid_plans")).ids);
208903
+ const plans = strs2(obj12(pick2(p2, "paidPlans", "paid_plans")).ids);
208571
208904
  if (plans.length) out2.paidPlanIds = plans;
208572
208905
  const hidden = strs2(pick2(p2, "hiddenForOs", "hidden_for_os")).filter((os2) => os2 === "IOS" || os2 === "ANDROID");
208573
208906
  if (hidden.length) out2.hiddenForOs = hidden;
208574
208907
  return Object.keys(out2).length ? out2 : void 0;
208575
208908
  }
208576
208909
  function summarizeStructure(raw, catalog4 = loadSectionCatalog()) {
208577
- const screens = obj11(raw.screens);
208578
- const layouts = obj11(pick2(raw, "layoutItems", "layout_items"));
208579
- const sections = obj11(raw.sections);
208910
+ const screens = obj12(raw.screens);
208911
+ const layouts = obj12(pick2(raw, "layoutItems", "layout_items"));
208912
+ const sections = obj12(raw.sections);
208580
208913
  const coverage = Object.fromEntries(SECTION_COVERAGES.map((c2) => [c2, 0]));
208581
208914
  const verticals = /* @__PURE__ */ new Set();
208582
208915
  const gaps = /* @__PURE__ */ new Set();
208583
208916
  const section3 = (ref) => {
208584
208917
  const id = str12(pick2(ref, "elementId", "element_id"));
208585
- const s2 = id ? obj11(sections[id]) : {};
208918
+ const s2 = id ? obj12(sections[id]) : {};
208586
208919
  const definitionId = str12(pick2(s2, "sectionDefinitionId", "section_definition_id"));
208587
208920
  if (!id || !definitionId || outOfScope(definitionId)) return [];
208588
208921
  const entry = catalog4.get(definitionId);
@@ -208597,7 +208930,7 @@ function summarizeStructure(raw, catalog4 = loadSectionCatalog()) {
208597
208930
  definitionId,
208598
208931
  ...str12(s2.title) ? { title: str12(s2.title) } : {},
208599
208932
  ...acc ? { access: acc } : {},
208600
- settingsKeys: Object.keys(obj11(s2.settings)).sort(),
208933
+ settingsKeys: Object.keys(obj12(s2.settings)).sort(),
208601
208934
  coverage: cov,
208602
208935
  ...entry?.himi ? { himi: entry.himi } : {},
208603
208936
  ...vertical ? { vertical } : {}
@@ -208605,22 +208938,22 @@ function summarizeStructure(raw, catalog4 = loadSectionCatalog()) {
208605
208938
  };
208606
208939
  const page = (layoutItemId) => {
208607
208940
  if (!Object.hasOwn(layouts, layoutItemId)) return void 0;
208608
- const item = obj11(layouts[layoutItemId]);
208941
+ const item = obj12(layouts[layoutItemId]);
208609
208942
  const acc = access(item.permissions);
208610
208943
  return {
208611
208944
  id: layoutItemId,
208612
208945
  ...str12(item.title) ? { title: str12(item.title) } : {},
208613
208946
  ...str12(item.slug) ? { slug: str12(item.slug) } : {},
208614
- ...obj11(item.settings).hideFromNavigation === true ? { hidden: true } : {},
208947
+ ...obj12(item.settings).hideFromNavigation === true ? { hidden: true } : {},
208615
208948
  ...acc ? { access: acc } : {},
208616
208949
  sections: inOrder(arr2(item.elements)).flatMap(section3)
208617
208950
  };
208618
208951
  };
208619
- const tabs = inOrder(arr2(pick2(obj11(raw.navigation), "bottomTabs", "bottom_tabs"))).flatMap((tab) => {
208952
+ const tabs = inOrder(arr2(pick2(obj12(raw.navigation), "bottomTabs", "bottom_tabs"))).flatMap((tab) => {
208620
208953
  const screenId = str12(pick2(tab, "screenId", "screen_id"));
208621
208954
  if (!screenId) return [];
208622
- const screen = obj11(screens[screenId]);
208623
- const layout = obj11(screen.layout);
208955
+ const screen = obj12(screens[screenId]);
208956
+ const layout = obj12(screen.layout);
208624
208957
  const items = inOrder(arr2(layout.items));
208625
208958
  const rendered = str12(layout.type) === "LINEAR" ? items.slice(0, 1) : items;
208626
208959
  const pages2 = rendered.flatMap((ref) => {
@@ -208638,11 +208971,11 @@ function summarizeStructure(raw, catalog4 = loadSectionCatalog()) {
208638
208971
  pages: pages2
208639
208972
  }];
208640
208973
  });
208641
- const profile = inOrder(arr2(obj11(pick2(raw, "businessProfile", "business_profile")).elements)).flatMap(section3);
208642
- const settings = obj11(raw.settings);
208643
- const theme = obj11(settings.theme);
208644
- const colors = obj11(theme.colors);
208645
- const typography = obj11(theme.typography);
208974
+ const profile = inOrder(arr2(obj12(pick2(raw, "businessProfile", "business_profile")).elements)).flatMap(section3);
208975
+ const settings = obj12(raw.settings);
208976
+ const theme = obj12(settings.theme);
208977
+ const colors = obj12(theme.colors);
208978
+ const typography = obj12(theme.typography);
208646
208979
  const themePrimary = str12(pick2(theme, "primaryColor", "primary_color"));
208647
208980
  const brandedPrimary = str12(colors.primary);
208648
208981
  const primaryColor = (pick2(raw, "appInstance", "app_instance") === "DEFAULT" ? themePrimary ?? brandedPrimary : brandedPrimary ?? themePrimary) ?? str12(pick2(settings, "primaryColor", "primary_color"));
@@ -208674,10 +209007,10 @@ function summarizeStructure(raw, catalog4 = loadSectionCatalog()) {
208674
209007
  }
208675
209008
  function pagesAreOwnerOnly(refs, layouts, sections) {
208676
209009
  return refs.every((ref) => {
208677
- const item = obj11(layouts[str12(pick2(obj11(ref), "layoutItemId", "layout_item_id")) ?? ""]);
209010
+ const item = obj12(layouts[str12(pick2(obj12(ref), "layoutItemId", "layout_item_id")) ?? ""]);
208678
209011
  const elements = arr2(item.elements);
208679
209012
  return elements.length > 0 && elements.every((e2) => {
208680
- const s2 = obj11(sections[str12(pick2(obj11(e2), "elementId", "element_id")) ?? ""]);
209013
+ const s2 = obj12(sections[str12(pick2(obj12(e2), "elementId", "element_id")) ?? ""]);
208681
209014
  return outOfScope(str12(pick2(s2, "sectionDefinitionId", "section_definition_id")));
208682
209015
  });
208683
209016
  });
@@ -208754,7 +209087,7 @@ function appPrimaryColor(app) {
208754
209087
  const m2 = /^#([0-9A-F])([0-9A-F])([0-9A-F])$/.exec(raw);
208755
209088
  return m2 ? `#${m2[1]}${m2[1]}${m2[2]}${m2[2]}${m2[3]}${m2[3]}` : void 0;
208756
209089
  }
208757
- var TIMEOUT_MS5, SECTION_CATALOG_GUIDE, bundledCatalog, SECTION_PREFIX_TO_VERTICAL, obj11, arr2, TEXT_CAP, str12, strs2, pick2, outOfScope, empty;
209090
+ var TIMEOUT_MS5, SECTION_CATALOG_GUIDE, bundledCatalog, SECTION_PREFIX_TO_VERTICAL, obj12, arr2, TEXT_CAP, str12, strs2, pick2, outOfScope, empty;
208758
209091
  var init_mobile_app = __esm({
208759
209092
  "src/site-analyze/mobile-app.ts"() {
208760
209093
  init_define_HHP_CATALOG();
@@ -208796,7 +209129,7 @@ var init_mobile_app = __esm({
208796
209129
  ["vod_", "videos"],
208797
209130
  ["podcasts_", "podcasts"]
208798
209131
  ];
208799
- obj11 = (v2) => v2 !== null && typeof v2 === "object" && !Array.isArray(v2) ? v2 : {};
209132
+ obj12 = (v2) => v2 !== null && typeof v2 === "object" && !Array.isArray(v2) ? v2 : {};
208800
209133
  arr2 = (v2) => Array.isArray(v2) ? v2 : [];
208801
209134
  TEXT_CAP = 200;
208802
209135
  str12 = (v2) => {
@@ -211443,7 +211776,7 @@ var init_site_oauth_client = __esm({
211443
211776
 
211444
211777
  // src/site-analyze/velo-source.ts
211445
211778
  import path from "node:path";
211446
- import ts19 from "typescript";
211779
+ import ts20 from "typescript";
211447
211780
  function applySourceEdits(source, edits) {
211448
211781
  const chunks = [];
211449
211782
  let cursor = 0;
@@ -211461,13 +211794,13 @@ function redactVeloSource(source, knownSecrets = []) {
211461
211794
  /\b(?:IST\.[\w.-]+|eyJ[\w-]+\.[\w-]+\.[\w-]+|(?:sk|rk)_(?:live|test)_[\w-]+|gh[pousr]_[\w]+|github_pat_[\w]+|AKIA[A-Z0-9]{16})\b/g,
211462
211795
  REDACTED2
211463
211796
  ).replace(/\b(?:Bearer|Basic)\s+[A-Za-z0-9._~+/=-]+/gi, REDACTED2).replace(/\b([a-z][a-z0-9+.-]*:\/\/)[^\s/'"`]+:[^\s/'"`]+@/gi, "$1[REDACTED]@").replace(/([?&](?:api[-_]?key|token|secret|password|signature)=)[^&#\s'"`]+/gi, "$1[REDACTED]");
211464
- const parsed = ts19.createSourceFile("backend.ts", source, ts19.ScriptTarget.Latest, true);
211797
+ const parsed = ts20.createSourceFile("backend.ts", source, ts20.ScriptTarget.Latest, true);
211465
211798
  const comments = /* @__PURE__ */ new Map();
211466
211799
  const visitComments = (node3) => {
211467
211800
  for (const range of [
211468
- ...ts19.getLeadingCommentRanges(source, node3.pos) ?? [],
211469
- ...ts19.getTrailingCommentRanges(source, node3.pos) ?? [],
211470
- ...ts19.getTrailingCommentRanges(source, node3.end) ?? []
211801
+ ...ts20.getLeadingCommentRanges(source, node3.pos) ?? [],
211802
+ ...ts20.getTrailingCommentRanges(source, node3.pos) ?? [],
211803
+ ...ts20.getTrailingCommentRanges(source, node3.end) ?? []
211471
211804
  ]) comments.set(range.pos, range.end);
211472
211805
  for (const child of node3.getChildren(parsed)) visitComments(child);
211473
211806
  };
@@ -211486,22 +211819,22 @@ function redactVeloSource(source, knownSecrets = []) {
211486
211819
  if (/^["'`][A-Za-z0-9_+/=-]{24,}["'`]$/.test(token)) return JSON.stringify(REDACTED2);
211487
211820
  return token;
211488
211821
  };
211489
- const clean2 = ts19.createSourceFile("backend.ts", source, ts19.ScriptTarget.Latest, true);
211822
+ const clean2 = ts20.createSourceFile("backend.ts", source, ts20.ScriptTarget.Latest, true);
211490
211823
  const masks = [];
211491
211824
  const collectMasks = (node3) => {
211492
211825
  const start = node3.getStart(clean2);
211493
- if (ts19.isRegularExpressionLiteral(node3)) {
211826
+ if (ts20.isRegularExpressionLiteral(node3)) {
211494
211827
  masks.push({ start, end: node3.end, text: " ".repeat(node3.end - start) });
211495
- } else if (ts19.isStringLiteral(node3) || ts19.isTemplateLiteralToken(node3)) {
211828
+ } else if (ts20.isStringLiteral(node3) || ts20.isTemplateLiteralToken(node3)) {
211496
211829
  masks.push({ start, end: node3.end, text: source.slice(start, node3.end).replace(/;/g, " ") });
211497
211830
  }
211498
- ts19.forEachChild(node3, collectMasks);
211831
+ ts20.forEachChild(node3, collectMasks);
211499
211832
  };
211500
211833
  collectMasks(clean2);
211501
211834
  const assignmentContext = applySourceEdits(source, masks);
211502
211835
  const edits = [];
211503
211836
  const visitLiterals = (node3) => {
211504
- if (ts19.isStringLiteral(node3) || ts19.isNoSubstitutionTemplateLiteral(node3) || ts19.isTemplateExpression(node3)) {
211837
+ if (ts20.isStringLiteral(node3) || ts20.isNoSubstitutionTemplateLiteral(node3) || ts20.isTemplateExpression(node3)) {
211505
211838
  const start = node3.getStart(clean2);
211506
211839
  const text15 = source.slice(start, node3.end);
211507
211840
  const redacted = redactLiteral(text15, start);
@@ -211510,7 +211843,7 @@ function redactVeloSource(source, knownSecrets = []) {
211510
211843
  return;
211511
211844
  }
211512
211845
  }
211513
- ts19.forEachChild(node3, visitLiterals);
211846
+ ts20.forEachChild(node3, visitLiterals);
211514
211847
  };
211515
211848
  visitLiterals(clean2);
211516
211849
  return applySourceEdits(source, edits);
@@ -211549,19 +211882,19 @@ function selectVeloSource(files, request, knownSecrets = []) {
211549
211882
  selected.set(file2.path, { source: excerpt, sourceTruncated: excerpt.length < redacted.length });
211550
211883
  remaining -= excerpt.length;
211551
211884
  const dependencies = [];
211552
- const parsed = ts19.createSourceFile(file2.path, file2.content, ts19.ScriptTarget.Latest, true);
211885
+ const parsed = ts20.createSourceFile(file2.path, file2.content, ts20.ScriptTarget.Latest, true);
211553
211886
  const specifiers = [];
211554
211887
  const collectImports = (node3) => {
211555
211888
  let specifier;
211556
- if (ts19.isImportDeclaration(node3) || ts19.isExportDeclaration(node3)) {
211889
+ if (ts20.isImportDeclaration(node3) || ts20.isExportDeclaration(node3)) {
211557
211890
  specifier = node3.moduleSpecifier;
211558
- } else if (ts19.isImportEqualsDeclaration(node3) && ts19.isExternalModuleReference(node3.moduleReference)) {
211891
+ } else if (ts20.isImportEqualsDeclaration(node3) && ts20.isExternalModuleReference(node3.moduleReference)) {
211559
211892
  specifier = node3.moduleReference.expression;
211560
- } else if (ts19.isCallExpression(node3) && (node3.expression.kind === ts19.SyntaxKind.ImportKeyword || ts19.isIdentifier(node3.expression) && node3.expression.text === "require")) {
211893
+ } else if (ts20.isCallExpression(node3) && (node3.expression.kind === ts20.SyntaxKind.ImportKeyword || ts20.isIdentifier(node3.expression) && node3.expression.text === "require")) {
211561
211894
  specifier = node3.arguments[0];
211562
211895
  }
211563
- if (specifier && ts19.isStringLiteralLike(specifier)) specifiers.push(specifier.text);
211564
- ts19.forEachChild(node3, collectImports);
211896
+ if (specifier && ts20.isStringLiteralLike(specifier)) specifiers.push(specifier.text);
211897
+ ts20.forEachChild(node3, collectImports);
211565
211898
  };
211566
211899
  collectImports(parsed);
211567
211900
  for (const specifier of specifiers) {
@@ -215274,12 +215607,12 @@ async function ejectCommand(ctx) {
215274
215607
  print({ ok: false, error: "eject needs a module", hint: `one of: ${EJECTABLE2.join(", ")}` });
215275
215608
  return 2;
215276
215609
  }
215277
- const { readdirSync: readdirSync47, existsSync: fileExists } = await import("node:fs");
215610
+ const { readdirSync: readdirSync48, existsSync: fileExists } = await import("node:fs");
215278
215611
  const { join: pathJoin3 } = await import("node:path");
215279
215612
  const targets = [];
215280
215613
  const t5 = pathJoin3(dir, "tier5-src");
215281
215614
  if (fileExists(t5)) {
215282
- for (const d2 of readdirSync47(t5, { withFileTypes: true })) {
215615
+ for (const d2 of readdirSync48(t5, { withFileTypes: true })) {
215283
215616
  if (d2.isDirectory()) targets.push(pathJoin3(t5, d2.name, "index.ts"));
215284
215617
  }
215285
215618
  }
@@ -215481,11 +215814,11 @@ function dpxCookieHeader(raw) {
215481
215814
  const trimmed = raw.trim();
215482
215815
  try {
215483
215816
  const json9 = Buffer.from(trimmed, "base64url").toString("utf8");
215484
- const obj12 = JSON.parse(json9);
215485
- if (obj12 && typeof obj12 === "object") {
215817
+ const obj13 = JSON.parse(json9);
215818
+ if (obj13 && typeof obj13 === "object") {
215486
215819
  const pairs2 = [
215487
- typeof obj12.wewix === "string" ? `${BO_WEWIX_COOKIE}=${obj12.wewix}` : void 0,
215488
- typeof obj12.bo === "string" ? `${BO_COOKIE}=${obj12.bo}` : void 0
215820
+ typeof obj13.wewix === "string" ? `${BO_WEWIX_COOKIE}=${obj13.wewix}` : void 0,
215821
+ typeof obj13.bo === "string" ? `${BO_COOKIE}=${obj13.bo}` : void 0
215489
215822
  ].filter((pair) => pair !== void 0);
215490
215823
  if (pairs2.length) return pairs2.join("; ");
215491
215824
  }
@@ -219738,7 +220071,7 @@ async function distCommand(ctx) {
219738
220071
  const app2 = typeof job.app === "string" ? job.app : void 0;
219739
220072
  const jobId = typeof job.jobId === "string" ? job.jobId : void 0;
219740
220073
  if (!player || !app2 || !jobId) return;
219741
- const render2 = (label3, payload, literal) => {
220074
+ const render2 = (label3, payload, literal2) => {
219742
220075
  io2.log(`
219743
220076
  ${label3}`);
219744
220077
  try {
@@ -219749,7 +220082,7 @@ ${label3}`);
219749
220082
  io2.log(" QR omitted (link is too long)");
219750
220083
  }
219751
220084
  io2.log(` ${payload}`);
219752
- if (literal && literal !== payload) io2.log(` ${literal}`);
220085
+ if (literal2 && literal2 !== payload) io2.log(` ${literal2}`);
219753
220086
  };
219754
220087
  render2(" Himi Player", player);
219755
220088
  if (job.status !== "SUCCESS") return;
@@ -221215,24 +221548,24 @@ import { existsSync as existsSync106 } from "node:fs";
221215
221548
  import { join as join112, resolve as resolve78 } from "node:path";
221216
221549
  async function runGuideCommand(command, pos, flags, io2, print) {
221217
221550
  const { referenceCache: referenceCache2, referenceIdentity: referenceIdentity2 } = await Promise.resolve().then(() => (init_guides(), guides_exports));
221218
- const cache2 = referenceCache2();
221551
+ const cache3 = referenceCache2();
221219
221552
  if (command === "docs" && ["status", "refresh"].includes(pos[1])) {
221220
221553
  try {
221221
- const kit = pos[1] === "refresh" ? await cache2.refresh({ pin: str3(flags.pin), unpin: flags.unpin === true, noNetwork: flags["no-network"] === true }) : cache2.status();
221554
+ const kit = pos[1] === "refresh" ? await cache3.refresh({ pin: str3(flags.pin), unpin: flags.unpin === true, noNetwork: flags["no-network"] === true }) : cache3.status();
221222
221555
  if (flags.json === true) print({ ok: true, kit });
221223
221556
  else io2.log(JSON.stringify(kit, null, 2));
221224
221557
  return 0;
221225
221558
  } catch (e2) {
221226
221559
  const { CatalogError: CatalogError2 } = await Promise.resolve().then(() => (init_catalog_cache(), catalog_cache_exports));
221227
- io2.error(JSON.stringify({ ok: false, code: e2 instanceof CatalogError2 ? e2.code : "catalog_refresh_failed", error: e2.message, kit: cache2.status() }));
221560
+ io2.error(JSON.stringify({ ok: false, code: e2 instanceof CatalogError2 ? e2.code : "catalog_refresh_failed", error: e2.message, kit: cache3.status() }));
221228
221561
  return 2;
221229
221562
  }
221230
221563
  }
221231
221564
  if (command === "docs" && pos[1] === "catalog") {
221232
- print({ ok: true, kit: cache2.status(), resources: cache2.list(pos[2]), hint: "himi docs refresh installs compatible references; template source is inspected/downloaded through the public catalog and never silently replaces an app" });
221565
+ print({ ok: true, kit: cache3.status(), resources: cache3.list(pos[2]), hint: "himi docs refresh installs compatible references; template source is inspected/downloaded through the public catalog and never silently replaces an app" });
221233
221566
  return 0;
221234
221567
  }
221235
- if (flags.pin !== void 0 || flags.unpin === true) await cache2.refresh({ pin: str3(flags.pin), unpin: flags.unpin === true, noNetwork: true });
221568
+ if (flags.pin !== void 0 || flags.unpin === true) await cache3.refresh({ pin: str3(flags.pin), unpin: flags.unpin === true, noNetwork: true });
221236
221569
  const activeKit = referenceIdentity2();
221237
221570
  if (flags.json !== true && activeKit.contentVersion) io2.error(`Authoring references: kit ${activeKit.contentVersion} (${activeKit.releaseDigest}); verified cache, no network.`);
221238
221571
  const legacyPrint = print;