@wix/himalaya-cli 0.1545.0 → 0.1546.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.
package/dist/cli.mjs CHANGED
@@ -694,8 +694,8 @@ function mobileUxDocumentBody(mobile) {
694
694
  }
695
695
  return out2 + mobile.slice(last);
696
696
  }
697
- function mobileUxSection(text11, heading) {
698
- const match = new RegExp(`(?:^|\\n)##[ \\t]+${heading}\\b[^\\n]*([\\s\\S]*?)(?=\\n##[ \\t]|$)`, "i").exec(text11);
697
+ function mobileUxSection(text12, heading) {
698
+ const match = new RegExp(`(?:^|\\n)##[ \\t]+${heading}\\b[^\\n]*([\\s\\S]*?)(?=\\n##[ \\t]|$)`, "i").exec(text12);
699
699
  return match ? match[1] : null;
700
700
  }
701
701
  function sectionTables(markdown) {
@@ -724,8 +724,8 @@ function namesOneCta(cell2) {
724
724
  if (!cell2) return false;
725
725
  return !/[,;]|\s\/\s/.test(cell2);
726
726
  }
727
- function declaredStates(text11) {
728
- const contract = section(text11, "Screen contract");
727
+ function declaredStates(text12) {
728
+ const contract = section(text12, "Screen contract");
729
729
  if (!contract) return [];
730
730
  const states = [];
731
731
  for (const bullet of contract.matchAll(/^[ \t]*[-*][ \t]*[^:\n]*\bstates?[ \t]*:[ \t]*(\S.*)$/gim)) {
@@ -735,8 +735,8 @@ function declaredStates(text11) {
735
735
  }
736
736
  return [...new Set(states.map((state) => state.toLowerCase()))];
737
737
  }
738
- function primaryCtaStructureGap(text11) {
739
- const acceptance = section(text11, "Implementation acceptance");
738
+ function primaryCtaStructureGap(text12) {
739
+ const acceptance = section(text12, "Implementation acceptance");
740
740
  if (acceptance === null) return "There is no `## Implementation acceptance` section to read it from.";
741
741
  const tables = sectionTables(acceptance).filter((table) => table.data.length > 0);
742
742
  if (!tables.length) return "Its acceptance table has no rows.";
@@ -749,7 +749,7 @@ function primaryCtaStructureGap(text11) {
749
749
  const data = ctaTables.flatMap(({ table }) => table.data);
750
750
  const flat = (value2) => value2.toLowerCase().replace(/[^a-z0-9]+/g, " ").trim();
751
751
  const rowText = data.map((row2) => flat(row2.join(" ")));
752
- const missing3 = declaredStates(text11).filter((state) => !rowText.some((row2) => row2.includes(flat(state))));
752
+ const missing3 = declaredStates(text12).filter((state) => !rowText.some((row2) => row2.includes(flat(state))));
753
753
  if (missing3.length) return `The acceptance table has no row for the declared state(s): ${missing3.join(", ")}.`;
754
754
  return null;
755
755
  }
@@ -764,16 +764,16 @@ function hasUnterminatedComment(mobile) {
764
764
  }
765
765
  }
766
766
  function mobileUxMarkerFindings(mobile, renderedWidths = []) {
767
- const text11 = mobileUxDocumentBody(mobile);
767
+ const text12 = mobileUxDocumentBody(mobile);
768
768
  const findings = [];
769
- if (!/^## Implementation acceptance\b/im.test(text11)) {
769
+ if (!/^## Implementation acceptance\b/im.test(text12)) {
770
770
  findings.push({ code: "missing-acceptance-matrix", message: "MOBILE-UX.md must contain the heading `## Implementation acceptance` at the start of a line. Case is not checked, but use this spelling: other tooling addresses the document by it." });
771
771
  }
772
- if (!/^## Evidence\b/im.test(text11)) {
772
+ if (!/^## Evidence\b/im.test(text12)) {
773
773
  findings.push({ code: "missing-evidence-section", message: "MOBILE-UX.md must contain the heading `## Evidence` at the start of a line. Case is not checked, but use this spelling: other tooling addresses the document by it." });
774
774
  }
775
- if (!/one primary CTA per state/i.test(text11)) {
776
- const gap = primaryCtaStructureGap(text11);
775
+ if (!/one primary CTA per state/i.test(text12)) {
776
+ const gap = primaryCtaStructureGap(text12);
777
777
  if (gap) {
778
778
  findings.push({
779
779
  code: "missing-primary-cta-rule",
@@ -781,8 +781,8 @@ function mobileUxMarkerFindings(mobile, renderedWidths = []) {
781
781
  });
782
782
  }
783
783
  }
784
- if (!hasWidthEvidence(text11, renderedWidths)) {
785
- findings.push({ code: "missing-width-evidence", message: widthEvidenceMessage(text11, renderedWidths) });
784
+ if (!hasWidthEvidence(text12, renderedWidths)) {
785
+ findings.push({ code: "missing-width-evidence", message: widthEvidenceMessage(text12, renderedWidths) });
786
786
  }
787
787
  if (findings.length && hasUnterminatedComment(mobile)) {
788
788
  return [{
@@ -792,15 +792,15 @@ function mobileUxMarkerFindings(mobile, renderedWidths = []) {
792
792
  }
793
793
  return findings;
794
794
  }
795
- function widthMentions(text11) {
795
+ function widthMentions(text12) {
796
796
  const mentions = [];
797
- for (const match of text11.matchAll(/\d+/g)) {
797
+ for (const match of text12.matchAll(/\d+/g)) {
798
798
  const value2 = Number(match[0]);
799
799
  const start = match.index ?? 0;
800
800
  if (!inRange(value2)) continue;
801
801
  const end = start + match[0].length;
802
- const after = text11.slice(end, end + EDGE_WINDOW);
803
- const before = text11.slice(Math.max(0, start - EDGE_WINDOW), start);
802
+ const after = text12.slice(end, end + EDGE_WINDOW);
803
+ const before = text12.slice(Math.max(0, start - EDGE_WINDOW), start);
804
804
  if (looksLikeYear(value2) && !(UNIT_ATTACHED.test(after) || UNIT_WORD_ATTACHED.test(after))) continue;
805
805
  const spelledAsWidth = UNIT_ATTACHED.test(after) || UNIT_WORD_ATTACHED.test(after) || FILENAME_AFTER.test(after);
806
806
  const vetoed = spelledAsWidth && (ANTI_CUE_BEFORE.test(before) || PAIR_HEIGHT_BEFORE.test(before) || ANTI_CUE_AFTER.test(after));
@@ -2741,15 +2741,15 @@ var init_dist_jobs = __esm({
2741
2741
  scope: scope2
2742
2742
  })
2743
2743
  });
2744
- const text11 = await res.text();
2744
+ const text12 = await res.text();
2745
2745
  if (!res.ok) {
2746
- throw new JobServiceError(`oauth failed for scope ${scope2}`, res.status, truncate(text11));
2746
+ throw new JobServiceError(`oauth failed for scope ${scope2}`, res.status, truncate(text12));
2747
2747
  }
2748
2748
  let token;
2749
2749
  try {
2750
- token = JSON.parse(text11).access_token;
2750
+ token = JSON.parse(text12).access_token;
2751
2751
  } catch {
2752
- throw new JobServiceError(`oauth returned non-JSON for scope ${scope2}`, res.status, truncate(text11));
2752
+ throw new JobServiceError(`oauth returned non-JSON for scope ${scope2}`, res.status, truncate(text12));
2753
2753
  }
2754
2754
  if (!token) throw new JobServiceError(`oauth returned no access_token for scope ${scope2}`, res.status);
2755
2755
  this.tokens.set(scope2, { token, expiresAt: this.now() + TOKEN_TTL_MS });
@@ -2763,15 +2763,15 @@ var init_dist_jobs = __esm({
2763
2763
  headers: { Authorization: token, ...body ? { "content-type": "application/json" } : {} },
2764
2764
  ...body ? { body: JSON.stringify(body) } : {}
2765
2765
  });
2766
- const text11 = await res.text();
2766
+ const text12 = await res.text();
2767
2767
  if (!res.ok) {
2768
- throw new JobServiceError(`job service ${method} ${path2} failed`, res.status, truncate(text11));
2768
+ throw new JobServiceError(`job service ${method} ${path2} failed`, res.status, truncate(text12));
2769
2769
  }
2770
- if (!text11) return {};
2770
+ if (!text12) return {};
2771
2771
  try {
2772
- return JSON.parse(text11);
2772
+ return JSON.parse(text12);
2773
2773
  } catch {
2774
- throw new JobServiceError(`job service ${method} ${path2} returned non-JSON`, res.status, truncate(text11));
2774
+ throw new JobServiceError(`job service ${method} ${path2} returned non-JSON`, res.status, truncate(text12));
2775
2775
  }
2776
2776
  }
2777
2777
  /**
@@ -3564,15 +3564,15 @@ function summarizeLint(app, bres, outcome, strict, extraIssues = []) {
3564
3564
  }
3565
3565
  };
3566
3566
  const record3 = (value2) => value2 && typeof value2 === "object" && !Array.isArray(value2) ? value2 : {};
3567
- const text11 = (value2) => typeof value2 === "string" && value2 ? value2 : void 0;
3567
+ const text12 = (value2) => typeof value2 === "string" && value2 ? value2 : void 0;
3568
3568
  const message2 = (value2) => {
3569
3569
  const item = record3(value2);
3570
- if (text11(item.message)) return text11(item.message);
3571
- if (text11(item.error)) return text11(item.error);
3570
+ if (text12(item.message)) return text12(item.message);
3571
+ if (text12(item.error)) return text12(item.error);
3572
3572
  if (Array.isArray(item.errors)) {
3573
3573
  const diagnostics = item.errors.map((entry) => {
3574
3574
  const diagnostic = record3(entry);
3575
- return text11(diagnostic.text) ?? text11(diagnostic.message);
3575
+ return text12(diagnostic.text) ?? text12(diagnostic.message);
3576
3576
  }).filter((entry) => !!entry);
3577
3577
  if (diagnostics.length) return diagnostics.join("; ");
3578
3578
  }
@@ -3585,29 +3585,29 @@ function summarizeLint(app, bres, outcome, strict, extraIssues = []) {
3585
3585
  ...issues,
3586
3586
  ...bres.compileErrors.map((value2) => ({
3587
3587
  pass: "compile",
3588
- path: text11(record3(value2).bundle),
3588
+ path: text12(record3(value2).bundle),
3589
3589
  ruleCode: "compile-error",
3590
3590
  severity: "error",
3591
3591
  message: message2(value2)
3592
3592
  })),
3593
3593
  ...outcome.failedToBuild.map((value2) => ({
3594
3594
  pass: "build",
3595
- screen: text11(record3(value2).screenId),
3595
+ screen: text12(record3(value2).screenId),
3596
3596
  ruleCode: "failed-to-build",
3597
3597
  severity: "error",
3598
3598
  message: message2(value2)
3599
3599
  })),
3600
3600
  ...outcome.missingBundles.map((value2) => ({
3601
3601
  pass: "build",
3602
- screen: text11(record3(value2).screen),
3603
- path: text11(record3(value2).bundle),
3602
+ screen: text12(record3(value2).screen),
3603
+ path: text12(record3(value2).bundle),
3604
3604
  ruleCode: "missing-bundle",
3605
3605
  severity: "error",
3606
3606
  message: message2(value2)
3607
3607
  })),
3608
3608
  ...workerThrows.map((value2) => ({
3609
3609
  pass: "worker",
3610
- path: text11(record3(value2).bundle),
3610
+ path: text12(record3(value2).bundle),
3611
3611
  ruleCode: "worker-threw",
3612
3612
  severity: "error",
3613
3613
  message: message2(value2.threw)
@@ -4148,8 +4148,8 @@ var init_catalog_cache = __esm({
4148
4148
  let prior;
4149
4149
  if (existsSync4(channelPath)) {
4150
4150
  try {
4151
- const text11 = readFileSync5(channelPath, "utf8");
4152
- if (Buffer.byteLength(text11) <= MAX_METADATA) prior = JSON.parse(text11);
4151
+ const text12 = readFileSync5(channelPath, "utf8");
4152
+ if (Buffer.byteLength(text12) <= MAX_METADATA) prior = JSON.parse(text12);
4153
4153
  } catch {
4154
4154
  }
4155
4155
  }
@@ -5253,8 +5253,8 @@ function parseStyles(source, file2, diagnostics, origin = { line: 1, column: 1 }
5253
5253
  declarations[decl.prop] = decl.value;
5254
5254
  locations[decl.prop] = declLoc;
5255
5255
  }
5256
- for (const text11 of node.selector.split(",")) {
5257
- const s2 = text11.trim();
5256
+ for (const text12 of node.selector.split(",")) {
5257
+ const s2 = text12.trim();
5258
5258
  if (!s2 || !selector.test(s2)) {
5259
5259
  diagnostics.push({ ...loc, code: "HHP-CSS-SELECTOR", severity: "error", message: `Unsupported selector ${s2}.`, hint: "Use static tag, id, class, or compound selectors." });
5260
5260
  continue;
@@ -6033,31 +6033,31 @@ function compileV2(html, profile, options) {
6033
6033
  return component;
6034
6034
  }
6035
6035
  const textNodes = element.contents().toArray().filter((n2) => n2.type === "text");
6036
- const text11 = textNodes.map((n2) => n2.data).join(" ").replace(/\s+/g, " ").trim();
6036
+ const text12 = textNodes.map((n2) => n2.data).join(" ").replace(/\s+/g, " ").trim();
6037
6037
  if (["Text", "RichText"].includes(type)) {
6038
- const matches = [...text11.matchAll(/{{\s*([\w.$]+)\s*}}/g)];
6039
- if (/{{|}}/.test(text11.replace(/{{\s*[\w.$]+\s*}}/g, ""))) error(el2, "HHP-TEXT-EXPRESSION", "Text interpolation accepts state/item paths; compute expressions in the controller.");
6038
+ const matches = [...text12.matchAll(/{{\s*([\w.$]+)\s*}}/g)];
6039
+ if (/{{|}}/.test(text12.replace(/{{\s*[\w.$]+\s*}}/g, ""))) error(el2, "HHP-TEXT-EXPRESSION", "Text interpolation accepts state/item paths; compute expressions in the controller.");
6040
6040
  if (matches.length) {
6041
- if (matches.length === 1 && matches[0][0] === text11 && type === "Text") {
6041
+ if (matches.length === 1 && matches[0][0] === text12 && type === "Text") {
6042
6042
  props.text = path2(el2, matches[0][1], row2);
6043
6043
  } else if (controller && type === "Text") {
6044
6044
  for (const match of matches) path2(el2, match[1], row2);
6045
6045
  const key3 = `t${textProjections.length}`;
6046
- const normalized = text11.replace(/{{\s*([\w.$]+)\s*}}/g, (_match, raw) => `{{${raw.startsWith("$item.") ? raw : statePath(raw)}}}`);
6046
+ const normalized = text12.replace(/{{\s*([\w.$]+)\s*}}/g, (_match, raw) => `{{${raw.startsWith("$item.") ? raw : statePath(raw)}}}`);
6047
6047
  textProjections.push({ key: key3, text: normalized, ...row2 ? { collection: row2 } : {} });
6048
6048
  props.text = row2 ? `$item.__hhpText_${key3}` : `$service:${serviceName}.__hhpText.${key3}`;
6049
6049
  } else {
6050
6050
  if (profile.surfaces.some((surface) => surface === "ios" || surface === "android" || surface === "macos"))
6051
6051
  error(el2, "HHP-TEXT-TEMPLATE-SURFACE", "Text templates are not implemented by the enabled native renderers.", "Compute the complete string in controller state and bind it on a Text component with {{path}} or bind:content.");
6052
6052
  const params = {};
6053
- let template = text11;
6053
+ let template = text12;
6054
6054
  matches.forEach((m2, i2) => {
6055
6055
  params[`v${i2}`] = path2(el2, m2[1], row2);
6056
6056
  template = template.replace(m2[0], `{v${i2}}`);
6057
6057
  });
6058
6058
  props.template = { template, params };
6059
6059
  }
6060
- } else if (text11) props.text = text11;
6060
+ } else if (text12) props.text = text12;
6061
6061
  if (/^h[1-6]$/.test(tag) && props.style === void 0) {
6062
6062
  const candidates = tag === "h1" ? ["largeTitle", "title1", "body"] : tag === "h2" ? ["title1", "headline", "body"] : ["headline", "body"];
6063
6063
  const available = profile.tokens.typography ?? [];
@@ -6065,8 +6065,8 @@ function compileV2(html, profile, options) {
6065
6065
  if (heading) props.style = heading;
6066
6066
  else error(el2, "HHP-TOKEN", "Headings require a body, title1, headline, or largeTitle typography token.");
6067
6067
  }
6068
- } else if (type === "Button" && (text11 || attrs.title)) props.title = text11 || attrs.title;
6069
- else if (text11) error(el2, "HHP-TEXT", "Wrap container text in a paragraph or span.");
6068
+ } else if (type === "Button" && (text12 || attrs.title)) props.title = text12 || attrs.title;
6069
+ else if (text12) error(el2, "HHP-TEXT", "Wrap container text in a paragraph or span.");
6070
6070
  if (type === "Image" && attrs.src) {
6071
6071
  if (/^https:\/\//.test(attrs.src)) props.url = attrs.src;
6072
6072
  else {
@@ -8090,17 +8090,17 @@ ${BLOCK_END}`;
8090
8090
  ${block}
8091
8091
  `;
8092
8092
  }
8093
- function markersIntact(text11) {
8094
- const begins = text11.split(BLOCK_BEGIN).length - 1;
8095
- const ends = text11.split(BLOCK_END).length - 1;
8093
+ function markersIntact(text12) {
8094
+ const begins = text12.split(BLOCK_BEGIN).length - 1;
8095
+ const ends = text12.split(BLOCK_END).length - 1;
8096
8096
  if (begins === 0 && ends === 0) return true;
8097
- return begins === 1 && ends === 1 && text11.indexOf(BLOCK_BEGIN) < text11.indexOf(BLOCK_END) && BLOCK_RE.test(text11);
8097
+ return begins === 1 && ends === 1 && text12.indexOf(BLOCK_BEGIN) < text12.indexOf(BLOCK_END) && BLOCK_RE.test(text12);
8098
8098
  }
8099
- function withoutBlock(text11) {
8100
- const m2 = BLOCK_RE.exec(text11);
8101
- if (!m2) return text11;
8102
- const before = text11.slice(0, m2.index).replace(/\n+$/, "");
8103
- const after = text11.slice(m2.index + m2[0].length).replace(/^\n+/, "");
8099
+ function withoutBlock(text12) {
8100
+ const m2 = BLOCK_RE.exec(text12);
8101
+ if (!m2) return text12;
8102
+ const before = text12.slice(0, m2.index).replace(/\n+$/, "");
8103
+ const after = text12.slice(m2.index + m2[0].length).replace(/^\n+/, "");
8104
8104
  if (!before) return after;
8105
8105
  if (!after) return `${before}
8106
8106
  `;
@@ -8108,8 +8108,8 @@ function withoutBlock(text11) {
8108
8108
 
8109
8109
  ${after}`;
8110
8110
  }
8111
- function blockVersion(text11) {
8112
- return STAMP_RE.exec(text11)?.[1] ?? null;
8111
+ function blockVersion(text12) {
8112
+ return STAMP_RE.exec(text12)?.[1] ?? null;
8113
8113
  }
8114
8114
  function agentsMdBody(appName2) {
8115
8115
  const gates = APPROVAL_GATES.map((g2) => `- \`${g2.id}\` \u2014 ${g2.label}`).join("\n");
@@ -8572,13 +8572,13 @@ function assertConfinedTsconfig(entry, contentRoot2, allows) {
8572
8572
  `refused to read ${p2}: ${why}. A tsconfig may extend a file from its own package or an installed dependency \u2014 nothing else.`
8573
8573
  );
8574
8574
  };
8575
- const stripJsonc = (text11) => {
8576
- if (text11.charCodeAt(0) === 65279) text11 = text11.slice(1);
8575
+ const stripJsonc = (text12) => {
8576
+ if (text12.charCodeAt(0) === 65279) text12 = text12.slice(1);
8577
8577
  let out2 = "";
8578
8578
  let inStr = false;
8579
8579
  let esc = false;
8580
- for (let i2 = 0; i2 < text11.length; i2++) {
8581
- const c2 = text11[i2];
8580
+ for (let i2 = 0; i2 < text12.length; i2++) {
8581
+ const c2 = text12[i2];
8582
8582
  if (inStr) {
8583
8583
  out2 += c2;
8584
8584
  if (esc) esc = false;
@@ -8591,13 +8591,13 @@ function assertConfinedTsconfig(entry, contentRoot2, allows) {
8591
8591
  out2 += c2;
8592
8592
  continue;
8593
8593
  }
8594
- if (c2 === "/" && text11[i2 + 1] === "/") {
8595
- while (i2 < text11.length && text11[i2] !== "\n") i2++;
8594
+ if (c2 === "/" && text12[i2 + 1] === "/") {
8595
+ while (i2 < text12.length && text12[i2] !== "\n") i2++;
8596
8596
  continue;
8597
8597
  }
8598
- if (c2 === "/" && text11[i2 + 1] === "*") {
8598
+ if (c2 === "/" && text12[i2 + 1] === "*") {
8599
8599
  i2 += 2;
8600
- while (i2 < text11.length && !(text11[i2] === "*" && text11[i2 + 1] === "/")) i2++;
8600
+ while (i2 < text12.length && !(text12[i2] === "*" && text12[i2 + 1] === "/")) i2++;
8601
8601
  i2++;
8602
8602
  continue;
8603
8603
  }
@@ -10189,6 +10189,7 @@ function resolveTranslation(value2, catalog4, sourceCatalog) {
10189
10189
  var BINDING_SIGILS, COLON_SIGILS, BINDING_SIGIL_RE, APP_BINDING_PREFIX, APP_BINDING_RE, TRANSLATION_PREFIX, TRANSLATION_KEY_RE;
10190
10190
  var init_bindings = __esm({
10191
10191
  "../../core/ts/src/bindings.ts"() {
10192
+ "use strict";
10192
10193
  BINDING_SIGILS = ["service", "flag", "item", "t"];
10193
10194
  COLON_SIGILS = /* @__PURE__ */ new Set(["t"]);
10194
10195
  BINDING_SIGIL_RE = new RegExp(
@@ -13207,8 +13208,8 @@ function pushSpan(out2, s2) {
13207
13208
  else out2.push(s2);
13208
13209
  }
13209
13210
  function spanOf(textNode) {
13210
- const text11 = str(at(textNode, "textData", "text"));
13211
- if (text11 === "") return null;
13211
+ const text12 = str(at(textNode, "textData", "text"));
13212
+ if (text12 === "") return null;
13212
13213
  let bold = false, italic = false, underline = false;
13213
13214
  let link;
13214
13215
  const decorations = at(textNode, "textData", "decorations");
@@ -13235,7 +13236,7 @@ function spanOf(textNode) {
13235
13236
  }
13236
13237
  }
13237
13238
  }
13238
- const span = { text: text11 };
13239
+ const span = { text: text12 };
13239
13240
  if (bold) span.bold = true;
13240
13241
  if (italic) span.italic = true;
13241
13242
  if (underline) span.underline = true;
@@ -13457,8 +13458,8 @@ function blockOf(ids, n2, path2) {
13457
13458
  const { title, url } = cardFields(n2, type);
13458
13459
  return [card(ids.claim(n2, path2), type, title, url)];
13459
13460
  }
13460
- const text11 = plainText(n2);
13461
- return text11.trim() !== "" ? [{ kind: "paragraph", id: ids.claim(n2, path2), spans: [{ text: text11 }] }] : [];
13461
+ const text12 = plainText(n2);
13462
+ return text12.trim() !== "" ? [{ kind: "paragraph", id: ids.claim(n2, path2), spans: [{ text: text12 }] }] : [];
13462
13463
  }
13463
13464
  }
13464
13465
  }
@@ -14991,26 +14992,26 @@ function serviceOnlyBindingValues(props, key3) {
14991
14992
  });
14992
14993
  return out2;
14993
14994
  }
14994
- function matchBraceSafe(text11, open) {
14995
+ function matchBraceSafe(text12, open) {
14995
14996
  let depth = 0;
14996
- for (let i2 = open; i2 < text11.length; i2++) {
14997
- const c2 = text11[i2];
14997
+ for (let i2 = open; i2 < text12.length; i2++) {
14998
+ const c2 = text12[i2];
14998
14999
  if (c2 === '"' || c2 === "'" || c2 === "`") {
14999
15000
  const q2 = c2;
15000
15001
  i2++;
15001
- while (i2 < text11.length && text11[i2] !== q2) {
15002
- if (text11[i2] === "\\") i2++;
15002
+ while (i2 < text12.length && text12[i2] !== q2) {
15003
+ if (text12[i2] === "\\") i2++;
15003
15004
  i2++;
15004
15005
  }
15005
15006
  continue;
15006
15007
  }
15007
- if (c2 === "/" && text11[i2 + 1] === "/") {
15008
- while (i2 < text11.length && text11[i2] !== "\n") i2++;
15008
+ if (c2 === "/" && text12[i2 + 1] === "/") {
15009
+ while (i2 < text12.length && text12[i2] !== "\n") i2++;
15009
15010
  continue;
15010
15011
  }
15011
- if (c2 === "/" && text11[i2 + 1] === "*") {
15012
+ if (c2 === "/" && text12[i2 + 1] === "*") {
15012
15013
  i2 += 2;
15013
- while (i2 < text11.length && !(text11[i2] === "*" && text11[i2 + 1] === "/")) i2++;
15014
+ while (i2 < text12.length && !(text12[i2] === "*" && text12[i2 + 1] === "/")) i2++;
15014
15015
  i2++;
15015
15016
  continue;
15016
15017
  }
@@ -18331,11 +18332,11 @@ function strip(line) {
18331
18332
  function scalar(v2) {
18332
18333
  return v2.trim().replace(/^["']|["']$/g, "");
18333
18334
  }
18334
- function parseRolloutYaml(text11) {
18335
+ function parseRolloutYaml(text12) {
18335
18336
  const cfg = { app: "", rings: [] };
18336
18337
  let cur = null;
18337
18338
  let inRings = false;
18338
- for (const raw of text11.split("\n")) {
18339
+ for (const raw of text12.split("\n")) {
18339
18340
  const line = strip(raw);
18340
18341
  if (!line.trim()) continue;
18341
18342
  const top = /^([a-zA-Z_]+):\s*(.*)$/.exec(line);
@@ -18366,10 +18367,10 @@ function assignRing(r3, key3, val) {
18366
18367
  else if (key3 === "percent") r3.percent = Number(v2);
18367
18368
  else if (key3 === "minBinaryVersion") r3.minBinaryVersion = v2;
18368
18369
  }
18369
- function parseRevocationsYaml(text11) {
18370
+ function parseRevocationsYaml(text12) {
18370
18371
  const out2 = { app: "", revoked: [] };
18371
18372
  let inList = false;
18372
- for (const raw of text11.split("\n")) {
18373
+ for (const raw of text12.split("\n")) {
18373
18374
  const line = strip(raw);
18374
18375
  if (!line.trim()) continue;
18375
18376
  const top = /^([a-zA-Z_]+):\s*(.*)$/.exec(line);
@@ -18748,14 +18749,14 @@ function discoverNativeActions(appDir3) {
18748
18749
  }
18749
18750
  const sources = roots2.flatMap(({ directory, extension, buildDirMaxDepth }) => nativeSourceFiles(resolve16(appDir3, directory), extension, buildDirMaxDepth));
18750
18751
  const registered = sources.flatMap((source) => {
18751
- let text11;
18752
+ let text12;
18752
18753
  try {
18753
- text11 = readFileSync16(source, "utf8");
18754
+ text12 = readFileSync16(source, "utf8");
18754
18755
  } catch (err) {
18755
18756
  if (!vanished(err)) throw err;
18756
18757
  return [];
18757
18758
  }
18758
- return registeredActions(text11);
18759
+ return registeredActions(text12);
18759
18760
  });
18760
18761
  return {
18761
18762
  registered: new Set(registered),
@@ -22377,9 +22378,9 @@ var init_wix_cache_policy = __esm({
22377
22378
  });
22378
22379
 
22379
22380
  // ../../core/dev-server/src/l10n-catalog.ts
22380
- function parseCatalog(text11) {
22381
+ function parseCatalog(text12) {
22381
22382
  try {
22382
- const c2 = JSON.parse(text11);
22383
+ const c2 = JSON.parse(text12);
22383
22384
  return c2 && typeof c2 === "object" && c2.messages && typeof c2.messages === "object" ? c2 : void 0;
22384
22385
  } catch {
22385
22386
  return void 0;
@@ -27924,10 +27925,10 @@ async function mintAnonymousVisitor(clientId, fetchImpl = fetch) {
27924
27925
  headers: { "Content-Type": "application/json" },
27925
27926
  body: JSON.stringify({ clientId, grantType: "anonymous" })
27926
27927
  });
27927
- const text11 = await res.text();
27928
+ const text12 = await res.text();
27928
27929
  let j2 = {};
27929
27930
  try {
27930
- j2 = text11 ? JSON.parse(text11) : {};
27931
+ j2 = text12 ? JSON.parse(text12) : {};
27931
27932
  } catch {
27932
27933
  }
27933
27934
  if (res.status !== 200 || !j2.access_token) throw new Error(`visitor mint failed (${res.status})`);
@@ -27942,10 +27943,10 @@ async function mintOneAppVisitor(msid, fetchImpl = fetch, timeoutMs = ONE_APP_VI
27942
27943
  redirect: "error",
27943
27944
  signal: AbortSignal.timeout(timeoutMs)
27944
27945
  });
27945
- const text11 = await res.text();
27946
+ const text12 = await res.text();
27946
27947
  let j2 = {};
27947
27948
  try {
27948
- j2 = text11 ? JSON.parse(text11) : {};
27949
+ j2 = text12 ? JSON.parse(text12) : {};
27949
27950
  } catch {
27950
27951
  }
27951
27952
  const expiresAt = typeof j2.validUntil === "string" ? Date.parse(j2.validUntil) : NaN;
@@ -28307,10 +28308,10 @@ ${session}`);
28307
28308
  }),
28308
28309
  timedOut
28309
28310
  ]);
28310
- const text11 = await Promise.race([res.text(), timedOut]);
28311
+ const text12 = await Promise.race([res.text(), timedOut]);
28311
28312
  let j2 = {};
28312
28313
  try {
28313
- j2 = text11 ? JSON.parse(text11) : {};
28314
+ j2 = text12 ? JSON.parse(text12) : {};
28314
28315
  } catch {
28315
28316
  }
28316
28317
  if (res.status < 200 || res.status >= 300 || !j2.signedInstance)
@@ -28496,7 +28497,7 @@ ${session}`);
28496
28497
  });
28497
28498
  const xsrf = /(?:^|;\s*)XSRF-TOKEN=([^;]+)/.exec(sessionCookie)?.[1];
28498
28499
  let status;
28499
- let text11;
28500
+ let text12;
28500
28501
  try {
28501
28502
  const res = await Promise.race([
28502
28503
  this.fetchImpl(`${ONE_APP_SESSION}/${msid}/signed-instance?signed_instance_type=Member`, {
@@ -28508,7 +28509,7 @@ ${session}`);
28508
28509
  timedOut
28509
28510
  ]);
28510
28511
  status = res.status;
28511
- text11 = await Promise.race([res.text(), timedOut]);
28512
+ text12 = await Promise.race([res.text(), timedOut]);
28512
28513
  } catch (e2) {
28513
28514
  return refuse7(new SiteInstanceUnavailable(msid, `mint failed: ${e2?.message ?? e2}`), MEMBER_TRANSIENT_TTL_MS);
28514
28515
  } finally {
@@ -28518,7 +28519,7 @@ ${session}`);
28518
28519
  if (status === 401) return refuse7(new AccountSessionExpired(msid, `mint refused (${status})`), MEMBER_TRANSIENT_TTL_MS);
28519
28520
  let instance;
28520
28521
  try {
28521
- instance = JSON.parse(text11).signedInstance;
28522
+ instance = JSON.parse(text12).signedInstance;
28522
28523
  } catch {
28523
28524
  }
28524
28525
  if (status < 200 || status >= 300 || typeof instance !== "string" || !instance) {
@@ -28597,8 +28598,8 @@ async function postJson(path2, body, auth) {
28597
28598
  headers: { "Content-Type": "application/json", ...auth ? { Authorization: auth } : {} },
28598
28599
  body: JSON.stringify(body)
28599
28600
  });
28600
- const text11 = await res.text();
28601
- return { status: res.status, json: text11 ? JSON.parse(text11) : {} };
28601
+ const text12 = await res.text();
28602
+ return { status: res.status, json: text12 ? JSON.parse(text12) : {} };
28602
28603
  }
28603
28604
  async function mintVisitor(clientId) {
28604
28605
  const r3 = await postJson("/oauth2/token", { clientId, grantType: "anonymous" });
@@ -28871,13 +28872,13 @@ function recordWixTraffic(gw, app, adminUrl, ev) {
28871
28872
  full.respBody = truncate2(redactBodyString(full.respBody));
28872
28873
  gw.traffic.push(full);
28873
28874
  if (gw.traffic.length > TRAFFIC_CAP) gw.traffic.splice(0, gw.traffic.length - TRAFFIC_CAP);
28874
- const text11 = `event: wix.traffic
28875
+ const text12 = `event: wix.traffic
28875
28876
  data: ${JSON.stringify(full)}
28876
28877
 
28877
28878
  `;
28878
28879
  for (const res of [...gw.clients]) {
28879
28880
  try {
28880
- res.write(text11);
28881
+ res.write(text12);
28881
28882
  } catch {
28882
28883
  gw.clients.delete(res);
28883
28884
  }
@@ -29380,13 +29381,13 @@ async function resolveWixAccounts(cookieHeader, fetchImpl = fetch, authorization
29380
29381
  if (res.status === 428 || res.status === 401 || res.status === 403) {
29381
29382
  return { ok: false, reason: "no_session" };
29382
29383
  }
29383
- const text11 = await res.text();
29384
+ const text12 = await res.text();
29384
29385
  if (!res.ok) {
29385
- return { ok: false, reason: "upstream_failed", status: res.status, detail: text11.slice(0, 200) };
29386
+ return { ok: false, reason: "upstream_failed", status: res.status, detail: text12.slice(0, 200) };
29386
29387
  }
29387
29388
  let parsed;
29388
29389
  try {
29389
- parsed = JSON.parse(text11);
29390
+ parsed = JSON.parse(text12);
29390
29391
  } catch {
29391
29392
  return { ok: false, reason: "upstream_failed", status: res.status, detail: "unparseable_body" };
29392
29393
  }
@@ -29427,13 +29428,13 @@ async function resolveAccountCredential(auth, fetchImpl) {
29427
29428
  if (res.status === 428 || res.status === 401 || res.status === 403 || res.status === 404) {
29428
29429
  return { ok: false, reason: "no_session" };
29429
29430
  }
29430
- const text11 = await res.text();
29431
+ const text12 = await res.text();
29431
29432
  if (!res.ok) {
29432
- return { ok: false, reason: "upstream_failed", status: res.status, detail: text11.slice(0, 200) };
29433
+ return { ok: false, reason: "upstream_failed", status: res.status, detail: text12.slice(0, 200) };
29433
29434
  }
29434
29435
  let parsed;
29435
29436
  try {
29436
- parsed = JSON.parse(text11);
29437
+ parsed = JSON.parse(text12);
29437
29438
  } catch {
29438
29439
  return { ok: false, reason: "upstream_failed", status: res.status, detail: "unparseable_body" };
29439
29440
  }
@@ -30085,9 +30086,9 @@ async function getAndroidPixelDims(serial) {
30085
30086
  try {
30086
30087
  const args = serial ? ["-s", serial, "shell", "wm", "size"] : ["shell", "wm", "size"];
30087
30088
  const out2 = await runner.capture(ADB_BIN, args);
30088
- const text11 = out2.toString("utf8");
30089
- const override = /Override size:\s*(\d+)x(\d+)/.exec(text11);
30090
- const physical = /Physical size:\s*(\d+)x(\d+)/.exec(text11);
30089
+ const text12 = out2.toString("utf8");
30090
+ const override = /Override size:\s*(\d+)x(\d+)/.exec(text12);
30091
+ const physical = /Physical size:\s*(\d+)x(\d+)/.exec(text12);
30091
30092
  const m2 = override ?? physical;
30092
30093
  if (!m2) throw new Error("could not parse wm size");
30093
30094
  const dims = { width: parseInt(m2[1], 10), height: parseInt(m2[2], 10) };
@@ -32051,9 +32052,9 @@ function mdScan(src, linkStyle = "") {
32051
32052
  }
32052
32053
  return out2 + mdEsc(src.slice(last));
32053
32054
  }
32054
- function mdInline(text11, linkColor) {
32055
+ function mdInline(text12, linkColor) {
32055
32056
  const safe = typeof linkColor === "string" && /^[#a-zA-Z0-9(),.%\s-]+$/.test(linkColor) ? linkColor : "";
32056
- return { __html: mdScan(text11, safe ? ` style="color:${safe}"` : "") };
32057
+ return { __html: mdScan(text12, safe ? ` style="color:${safe}"` : "") };
32057
32058
  }
32058
32059
  function sevColor(ctx, sev) {
32059
32060
  switch (sev) {
@@ -32895,7 +32896,7 @@ function PickerLeadingVisual({ option, ctx, size = 20 }) {
32895
32896
  return null;
32896
32897
  }
32897
32898
  }
32898
- function PickerFieldBox({ look, ctx, option, text: text11, isPlaceholder, font, style }) {
32899
+ function PickerFieldBox({ look, ctx, option, text: text12, isPlaceholder, font, style }) {
32899
32900
  const C2 = ctx.color;
32900
32901
  return /* @__PURE__ */ jsxs2(
32901
32902
  "div",
@@ -32919,7 +32920,7 @@ function PickerFieldBox({ look, ctx, option, text: text11, isPlaceholder, font,
32919
32920
  },
32920
32921
  children: [
32921
32922
  !isPlaceholder && /* @__PURE__ */ jsx5(PickerLeadingVisual, { option, ctx }),
32922
- /* @__PURE__ */ jsx5("span", { style: { flex: 1, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", color: isPlaceholder ? C2(look.placeholderColor, "#888") : C2("textPrimary", "#111") }, children: text11 }),
32923
+ /* @__PURE__ */ jsx5("span", { style: { flex: 1, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", color: isPlaceholder ? C2(look.placeholderColor, "#888") : C2("textPrimary", "#111") }, children: text12 }),
32923
32924
  look.chevronIcon && /* @__PURE__ */ jsx5("span", { "data-picker-chevron": "", style: { flex: "none", display: "inline-grid", placeItems: "center" }, children: iconSvg(look.chevronIcon, { size: 16, color: C2("textSecondary", "#636b78") }) })
32924
32925
  ]
32925
32926
  }
@@ -33364,9 +33365,9 @@ function createRicosHostSession(o2) {
33364
33365
  if (!state.ready || state.unavailable) return;
33365
33366
  o2.send({ v: 1, type: "command", name, ...arg?.level ? { level: arg.level } : {}, ...arg?.value ? { value: arg.value } : {} });
33366
33367
  },
33367
- insertLink(url, text11) {
33368
+ insertLink(url, text12) {
33368
33369
  if (!state.ready || state.unavailable || !isSafeEditorLink(url)) return false;
33369
- o2.send({ v: 1, type: "insertLink", url: url.trim(), ...text11 ? { text: text11 } : {} });
33370
+ o2.send({ v: 1, type: "insertLink", url: url.trim(), ...text12 ? { text: text12 } : {} });
33370
33371
  return true;
33371
33372
  },
33372
33373
  removeLink() {
@@ -35848,8 +35849,8 @@ var init_esm = __esm({
35848
35849
 
35849
35850
  // ../../core/ts/src/rich-text-field.ts
35850
35851
  function richTextHtmlToPlainText(html) {
35851
- const text11 = decodeHTML(html.replace(/<(script|style)\b[^>]*>[\s\S]*?<\/\1\s*>/gi, "").replace(/<li\b[^>]*>/gi, "\u2022 ").replace(/<br\s*\/?>|<\/(?:p|div|li|h[1-6]|blockquote|pre|tr)\s*>/gi, "\n").replace(/<[^>]*>/g, ""));
35852
- return text11.replace(/\r\n?/g, "\n").replace(/\n{3,}/g, "\n\n").trim();
35852
+ const text12 = decodeHTML(html.replace(/<(script|style)\b[^>]*>[\s\S]*?<\/\1\s*>/gi, "").replace(/<li\b[^>]*>/gi, "\u2022 ").replace(/<br\s*\/?>|<\/(?:p|div|li|h[1-6]|blockquote|pre|tr)\s*>/gi, "\n").replace(/<[^>]*>/g, ""));
35853
+ return text12.replace(/\r\n?/g, "\n").replace(/\n{3,}/g, "\n\n").trim();
35853
35854
  }
35854
35855
  function richTextPlainTextToHtml(value2) {
35855
35856
  if (value2 === "") return "";
@@ -35872,9 +35873,9 @@ function richTextEditedHtml(originalHtml, originalText, nextText) {
35872
35873
  if (/<(script|style)\b/i.test(source)) return richTextPlainTextToHtml(nextText);
35873
35874
  const spans = [];
35874
35875
  let visible = "";
35875
- const append = (text11, start, end, structural = false) => {
35876
- visible += text11;
35877
- for (let i2 = 0; i2 < text11.length; i2++) spans.push({ start, end, structural });
35876
+ const append = (text12, start, end, structural = false) => {
35877
+ visible += text12;
35878
+ for (let i2 = 0; i2 < text12.length; i2++) spans.push({ start, end, structural });
35878
35879
  };
35879
35880
  const token = /<[^>]*>|&(?:#\d+|#x[\da-f]+|[a-z][\da-z]+);?|[^<&]+/gi;
35880
35881
  for (const match of source.matchAll(token)) {
@@ -35928,7 +35929,7 @@ function richTextEditedHtml(originalHtml, originalText, nextText) {
35928
35929
  let edited = source;
35929
35930
  for (const span of removed.slice().reverse()) edited = edited.slice(0, span.start) + edited.slice(span.end);
35930
35931
  const insertionAfterDelete = insertionAt - removed.filter((span) => span.end <= insertionAt).reduce((n2, span) => n2 + span.end - span.start, 0);
35931
- const escape3 = (text11) => text11.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\"/g, "&quot;").replace(/'/g, "&#39;").replace(/\n/g, "<br>");
35932
+ const escape3 = (text12) => text12.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\"/g, "&quot;").replace(/'/g, "&#39;").replace(/\n/g, "<br>");
35932
35933
  const replacement = escape3(nextText.slice(prefix, newEnd));
35933
35934
  return edited.slice(0, insertionAfterDelete) + replacement + edited.slice(insertionAfterDelete);
35934
35935
  }
@@ -36033,13 +36034,13 @@ function NamedImage({ node, alt, env }) {
36033
36034
  }
36034
36035
  function Block({ b: b2, env, depth }) {
36035
36036
  const { ctx } = env;
36036
- const text11 = ctx.color("textPrimary", "#13171e");
36037
+ const text12 = ctx.color("textPrimary", "#13171e");
36037
36038
  const secondary = ctx.color("textSecondary", "#5c6370");
36038
36039
  const border = ctx.color("border", "#e5e5e5");
36039
36040
  switch (b2.kind) {
36040
36041
  case "paragraph":
36041
36042
  return /* @__PURE__ */ jsx9("p", { ...tid(env, b2.id, b2.kind), style: {
36042
- ...textStyle(ctx, "body", text11),
36043
+ ...textStyle(ctx, "body", text12),
36043
36044
  textAlign: b2.align,
36044
36045
  paddingInlineStart: b2.indent ? Math.min(b2.indent, 8) * 16 : void 0,
36045
36046
  minHeight: b2.spans.length ? void 0 : "1.5em"
@@ -36047,7 +36048,7 @@ function Block({ b: b2, env, depth }) {
36047
36048
  case "heading":
36048
36049
  return React10.createElement(
36049
36050
  `h${b2.level}`,
36050
- { ...tid(env, b2.id, b2.kind), style: textStyle(ctx, RICH_CONTENT_HEADING_TOKENS[b2.level - 1], text11) },
36051
+ { ...tid(env, b2.id, b2.kind), style: textStyle(ctx, RICH_CONTENT_HEADING_TOKENS[b2.level - 1], text12) },
36051
36052
  /* @__PURE__ */ jsx9(Spans, { spans: b2.spans, env })
36052
36053
  );
36053
36054
  case "list": {
@@ -36057,7 +36058,7 @@ function Block({ b: b2, env, depth }) {
36057
36058
  {
36058
36059
  ...tid(env, b2.id, b2.kind),
36059
36060
  start: b2.ordered ? b2.start : void 0,
36060
- style: { ...textStyle(ctx, "body", text11), paddingInlineStart: 24, listStyleType: b2.ordered ? "decimal" : depth % 2 ? "circle" : "disc" },
36061
+ style: { ...textStyle(ctx, "body", text12), paddingInlineStart: 24, listStyleType: b2.ordered ? "decimal" : depth % 2 ? "circle" : "disc" },
36061
36062
  children: b2.items.map((item, i2) => /* @__PURE__ */ jsx9("li", { "data-component-id": `${env.componentId}/${item.id}`, id: `${env.componentId}/${item.id}`, style: { marginBottom: 6 }, children: /* @__PURE__ */ jsx9("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: item.blocks.map((child, j2) => /* @__PURE__ */ jsx9(Block, { b: child, env, depth: depth + 1 }, `${j2}:${child.id}`)) }) }, `${i2}:${item.id}`))
36062
36063
  }
36063
36064
  );
@@ -36071,7 +36072,7 @@ function Block({ b: b2, env, depth }) {
36071
36072
  overflowWrap: "anywhere",
36072
36073
  fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
36073
36074
  fontSize: "0.9em",
36074
- color: text11,
36075
+ color: text12,
36075
36076
  background: ctx.color("surfaceSecondary", "#f5f5f7"),
36076
36077
  padding: 10,
36077
36078
  borderRadius: 6
@@ -36090,11 +36091,11 @@ function Block({ b: b2, env, depth }) {
36090
36091
  case "button":
36091
36092
  return /* @__PURE__ */ jsx9(LinkButton, { label: b2.label, url: b2.url, env, testId: `${env.componentId}/${b2.id}` });
36092
36093
  case "table":
36093
- return /* @__PURE__ */ jsx9("table", { ...tid(env, b2.id, b2.kind), style: { width: "100%", borderCollapse: "collapse", ...textStyle(ctx, "body", text11) }, children: /* @__PURE__ */ jsx9("tbody", { children: b2.rows.map((row2, r3) => /* @__PURE__ */ jsx9("tr", { children: row2.map((cell2, c2) => /* @__PURE__ */ jsx9("td", { style: { border: `1px solid ${border}`, padding: 6, whiteSpace: "pre-wrap", verticalAlign: "top" }, children: cell2 }, c2)) }, r3)) }) });
36094
+ return /* @__PURE__ */ jsx9("table", { ...tid(env, b2.id, b2.kind), style: { width: "100%", borderCollapse: "collapse", ...textStyle(ctx, "body", text12) }, children: /* @__PURE__ */ jsx9("tbody", { children: b2.rows.map((row2, r3) => /* @__PURE__ */ jsx9("tr", { children: row2.map((cell2, c2) => /* @__PURE__ */ jsx9("td", { style: { border: `1px solid ${border}`, padding: 6, whiteSpace: "pre-wrap", verticalAlign: "top" }, children: cell2 }, c2)) }, r3)) }) });
36094
36095
  case "card": {
36095
36096
  const title = richContentCardTitle(b2);
36096
36097
  return /* @__PURE__ */ jsxs6("div", { ...tid(env, b2.id, b2.kind), role: "group", "aria-label": title, style: { border: `1px solid ${border}`, borderRadius: 8, padding: 12, display: "flex", flexDirection: "column", gap: 6 }, children: [
36097
- /* @__PURE__ */ jsx9("div", { style: textStyle(ctx, "bodyEmphasis", text11), children: title }),
36098
+ /* @__PURE__ */ jsx9("div", { style: textStyle(ctx, "bodyEmphasis", text12), children: title }),
36098
36099
  b2.url ? /* @__PURE__ */ jsxs6(Fragment3, { children: [
36099
36100
  /* @__PURE__ */ jsx9("div", { style: textStyle(ctx, "caption", secondary), children: richContentHost(b2.url) }),
36100
36101
  /* @__PURE__ */ jsx9(LinkButton, { label: RICH_CONTENT_OPEN_LABEL, url: b2.url, env, testId: `${env.componentId}/${b2.id}/open` })
@@ -36123,10 +36124,10 @@ var init_richContent = __esm({
36123
36124
 
36124
36125
  // ../../core/web-renderer/src/pdfPageCount.ts
36125
36126
  function pdfPageCount(bytes2) {
36126
- const text11 = pdfObjectSyntax(new TextDecoder("latin1").decode(bytes2));
36127
- const rooted = pdfRootPageCount(text11);
36127
+ const text12 = pdfObjectSyntax(new TextDecoder("latin1").decode(bytes2));
36128
+ const rooted = pdfRootPageCount(text12);
36128
36129
  let scanned = null;
36129
- for (const m2 of text11.matchAll(/<<((?:(?!<<|>>)[\s\S])*)>>/g)) {
36130
+ for (const m2 of text12.matchAll(/<<((?:(?!<<|>>)[\s\S])*)>>/g)) {
36130
36131
  const dict = m2[1];
36131
36132
  if (!/\/Type\s*\/Pages(?![A-Za-z])/.test(dict)) continue;
36132
36133
  const c2 = /\/Count\s+(\d+)/.exec(dict);
@@ -36138,24 +36139,24 @@ function pdfPageCount(bytes2) {
36138
36139
  if (rooted !== null && scanned !== null && rooted !== scanned) return null;
36139
36140
  return count2 <= PDF_MAX_PLAUSIBLE_PAGES ? count2 : null;
36140
36141
  }
36141
- function pdfObjectSyntax(text11) {
36142
- const out2 = text11.split("");
36142
+ function pdfObjectSyntax(text12) {
36143
+ const out2 = text12.split("");
36143
36144
  const blank = (from, to2) => {
36144
36145
  for (let k2 = from; k2 < to2; k2++) out2[k2] = " ";
36145
36146
  };
36146
36147
  let i2 = 0;
36147
- while (i2 < text11.length) {
36148
- const c2 = text11[i2];
36148
+ while (i2 < text12.length) {
36149
+ const c2 = text12[i2];
36149
36150
  if (c2 === "%") {
36150
- const eol = text11.slice(i2).search(/[\r\n]/);
36151
- const end = eol < 0 ? text11.length : i2 + eol;
36151
+ const eol = text12.slice(i2).search(/[\r\n]/);
36152
+ const end = eol < 0 ? text12.length : i2 + eol;
36152
36153
  blank(i2, end);
36153
36154
  i2 = end;
36154
36155
  } else if (c2 === "(") {
36155
36156
  let depth = 0;
36156
36157
  let j2 = i2;
36157
- for (; j2 < text11.length; j2++) {
36158
- const d2 = text11[j2];
36158
+ for (; j2 < text12.length; j2++) {
36159
+ const d2 = text12[j2];
36159
36160
  if (d2 === "\\") {
36160
36161
  j2++;
36161
36162
  continue;
@@ -36165,21 +36166,21 @@ function pdfObjectSyntax(text11) {
36165
36166
  }
36166
36167
  blank(i2, j2 + 1);
36167
36168
  i2 = j2 + 1;
36168
- } else if (c2 === "<" && text11[i2 + 1] !== "<") {
36169
- const end = text11.indexOf(">", i2);
36170
- const stop = end < 0 ? text11.length : end + 1;
36169
+ } else if (c2 === "<" && text12[i2 + 1] !== "<") {
36170
+ const end = text12.indexOf(">", i2);
36171
+ const stop = end < 0 ? text12.length : end + 1;
36171
36172
  blank(i2, stop);
36172
36173
  i2 = stop;
36173
- } else if (c2 === "<" && text11[i2 + 1] === "<") {
36174
+ } else if (c2 === "<" && text12[i2 + 1] === "<") {
36174
36175
  i2 += 2;
36175
36176
  } else if (
36176
36177
  // The `stream` KEYWORD, not the tail of a name (`/my-stream`) or of `endstream`: preceded by
36177
36178
  // whitespace or the `>>` that closes its dictionary, and followed by CRLF or LF (PDF 32000
36178
36179
  // §7.3.8.1 — a CR alone is not allowed there).
36179
- text11.startsWith("stream", i2) && /[\s>]/.test(text11[i2 - 1] ?? "") && (text11[i2 + 6] === "\n" || text11.startsWith("\r\n", i2 + 6))
36180
+ text12.startsWith("stream", i2) && /[\s>]/.test(text12[i2 - 1] ?? "") && (text12[i2 + 6] === "\n" || text12.startsWith("\r\n", i2 + 6))
36180
36181
  ) {
36181
- const end = text11.indexOf("endstream", i2 + 6);
36182
- const stop = end < 0 ? text11.length : end;
36182
+ const end = text12.indexOf("endstream", i2 + 6);
36183
+ const stop = end < 0 ? text12.length : end;
36183
36184
  blank(i2 + 6, stop);
36184
36185
  i2 = stop + "endstream".length;
36185
36186
  } else {
@@ -38063,19 +38064,19 @@ function getFilenameFromContentDispositionHeader(contentDisposition) {
38063
38064
  if (!value2.startsWith("=?") || /[\x00-\x19\x80-\xff]/.test(value2)) {
38064
38065
  return value2;
38065
38066
  }
38066
- return value2.replaceAll(/=\?([\w-]*)\?([QB])\?((?:[^?]|\?(?!=))*)\?=/gi, function(matches, charset, encoding, text11) {
38067
+ return value2.replaceAll(/=\?([\w-]*)\?([QB])\?((?:[^?]|\?(?!=))*)\?=/gi, function(matches, charset, encoding, text12) {
38067
38068
  if (encoding === "q" || encoding === "Q") {
38068
- text11 = text11.replaceAll("_", " ");
38069
- text11 = text11.replaceAll(/=([0-9a-f]{2})/gi, function(match, hex2) {
38069
+ text12 = text12.replaceAll("_", " ");
38070
+ text12 = text12.replaceAll(/=([0-9a-f]{2})/gi, function(match, hex2) {
38070
38071
  return String.fromCharCode(parseInt(hex2, 16));
38071
38072
  });
38072
- return textdecode(charset, text11);
38073
+ return textdecode(charset, text12);
38073
38074
  }
38074
38075
  try {
38075
- text11 = atob(text11);
38076
+ text12 = atob(text12);
38076
38077
  } catch {
38077
38078
  }
38078
- return textdecode(charset, text11);
38079
+ return textdecode(charset, text12);
38079
38080
  });
38080
38081
  }
38081
38082
  return "";
@@ -41867,8 +41868,8 @@ var init_pdf = __esm({
41867
41868
  return 1 / nativeParse("-0 ") !== -Infinity;
41868
41869
  });
41869
41870
  $2({ target: "JSON", stat: true, forced: NO_SOURCE_SUPPORT }, {
41870
- parse: function parse4(text11, reviver) {
41871
- return PROPER_BASE_PARSE && !isCallable(reviver) ? nativeParse(text11) : $parse(text11, reviver);
41871
+ parse: function parse4(text12, reviver) {
41872
+ return PROPER_BASE_PARSE && !isCallable(reviver) ? nativeParse(text12) : $parse(text12, reviver);
41872
41873
  }
41873
41874
  });
41874
41875
  },
@@ -42006,7 +42007,7 @@ var init_pdf = __esm({
42006
42007
  return ordered;
42007
42008
  };
42008
42009
  if ($stringify) $2({ target: "JSON", stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE || !NATIVE_RAW_JSON }, {
42009
- stringify: function stringify(text11, replacer, space) {
42010
+ stringify: function stringify(text12, replacer, space) {
42010
42011
  var replacerFunction = isCallable(replacer) ? replacer : void 0;
42011
42012
  var propertyList = replacerFunction ? void 0 : getPropertyList(replacer);
42012
42013
  var keyPrefix = propertyList && getKeyPrefix(propertyList);
@@ -42016,7 +42017,7 @@ var init_pdf = __esm({
42016
42017
  var currentOrdered;
42017
42018
  var marked = false;
42018
42019
  var root = true;
42019
- var json8 = stringifyWithProperSymbolsConversion(text11, function(key3, value2) {
42020
+ var json8 = stringifyWithProperSymbolsConversion(text12, function(key3, value2) {
42020
42021
  key3 = $String(key3);
42021
42022
  if (propertyList) {
42022
42023
  if (key3 === END_MARK) {
@@ -45088,7 +45089,7 @@ var init_pdf = __esm({
45088
45089
  focusNode,
45089
45090
  focusOffset
45090
45091
  } = selection;
45091
- const text11 = selection.toString();
45092
+ const text12 = selection.toString();
45092
45093
  const anchorElement = this.#getAnchorElementForSelection(selection);
45093
45094
  const textLayer = anchorElement.closest(".textLayer");
45094
45095
  const boxes = this.getSelectionBoxes(textLayer);
@@ -45109,7 +45110,7 @@ var init_pdf = __esm({
45109
45110
  anchorOffset,
45110
45111
  focusNode,
45111
45112
  focusOffset,
45112
- text: text11
45113
+ text: text12
45113
45114
  });
45114
45115
  if (isNoneMode) {
45115
45116
  this.showAllEditors("highlight", true, true);
@@ -46815,32 +46816,32 @@ var init_pdf = __esm({
46815
46816
  deleted: this.isDeleted()
46816
46817
  };
46817
46818
  }
46818
- set data(text11) {
46819
- if (text11 !== this.#text) {
46819
+ set data(text12) {
46820
+ if (text12 !== this.#text) {
46820
46821
  this.#richText = null;
46821
46822
  }
46822
- if (text11 === null) {
46823
+ if (text12 === null) {
46823
46824
  this.#text = "";
46824
46825
  this.#deleted = true;
46825
46826
  return;
46826
46827
  }
46827
- this.#text = text11;
46828
+ this.#text = text12;
46828
46829
  this.#date = /* @__PURE__ */ new Date();
46829
46830
  this.#deleted = false;
46830
46831
  }
46831
46832
  restoreData({
46832
- text: text11,
46833
+ text: text12,
46833
46834
  richText,
46834
46835
  date
46835
46836
  }) {
46836
- this.#text = text11;
46837
+ this.#text = text12;
46837
46838
  this.#richText = richText;
46838
46839
  this.#date = date;
46839
46840
  this.#deleted = false;
46840
46841
  }
46841
- setInitialText(text11, richText = null) {
46842
- this.#initialText = text11;
46843
- this.data = text11;
46842
+ setInitialText(text12, richText = null) {
46843
+ this.#initialText = text12;
46844
+ this.data = text12;
46844
46845
  this.#date = null;
46845
46846
  this.#richText = richText;
46846
46847
  }
@@ -47891,8 +47892,8 @@ var init_pdf = __esm({
47891
47892
  get guessedAltText() {
47892
47893
  return this.#altText?.guessedText;
47893
47894
  }
47894
- async setGuessedAltText(text11) {
47895
- await this.#altText?.setGuessedText(text11);
47895
+ async setGuessedAltText(text12) {
47896
+ await this.#altText?.setGuessedText(text12);
47896
47897
  }
47897
47898
  serializeAltText(isForCopying) {
47898
47899
  return this.#altText?.serialize(isForCopying);
@@ -47939,13 +47940,13 @@ var init_pdf = __esm({
47939
47940
  const {
47940
47941
  data: {
47941
47942
  richText,
47942
- text: text11,
47943
+ text: text12,
47943
47944
  date,
47944
47945
  deleted
47945
47946
  }
47946
47947
  } = this.#comment;
47947
47948
  return {
47948
- text: text11,
47949
+ text: text12,
47949
47950
  richText,
47950
47951
  date,
47951
47952
  deleted,
@@ -58739,13 +58740,13 @@ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
58739
58740
  } = this;
58740
58741
  return this.annotationStorage.getRawValue(`${AnnotationEditorPrefix}${data.id}`)?.popup?.contents || data.contentsObj?.str || "";
58741
58742
  }
58742
- set commentText(text11) {
58743
+ set commentText(text12) {
58743
58744
  const {
58744
58745
  data
58745
58746
  } = this;
58746
58747
  const popup = {
58747
- deleted: !text11,
58748
- contents: text11 || ""
58748
+ deleted: !text12,
58749
+ contents: text12 || ""
58749
58750
  };
58750
58751
  if (!this.annotationStorage.updateEditor(data.id, {
58751
58752
  popup
@@ -58759,7 +58760,7 @@ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
58759
58760
  modificationDate: /* @__PURE__ */ new Date()
58760
58761
  });
58761
58762
  }
58762
- if (!text11) {
58763
+ if (!text12) {
58763
58764
  this.removePopup();
58764
58765
  }
58765
58766
  }
@@ -59311,9 +59312,9 @@ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
59311
59312
  get commentText() {
59312
59313
  return this.editor.comment.text;
59313
59314
  }
59314
- set commentText(text11) {
59315
- this.editor.comment = text11;
59316
- if (!text11) {
59315
+ set commentText(text12) {
59316
+ this.editor.comment = text12;
59317
+ if (!text12) {
59317
59318
  this.removePopup();
59318
59319
  }
59319
59320
  }
@@ -60771,11 +60772,11 @@ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
60771
60772
  this.#commentText ||= this.#firstElement.commentText;
60772
60773
  return this.#commentText;
60773
60774
  }
60774
- set comment(text11) {
60775
- if (text11 === this.comment) {
60775
+ set comment(text12) {
60776
+ if (text12 === this.comment) {
60776
60777
  return;
60777
60778
  }
60778
- this.#firstElement.commentText = this.#commentText = text11;
60779
+ this.#firstElement.commentText = this.#commentText = text12;
60779
60780
  }
60780
60781
  focus() {
60781
60782
  this.#firstElement.container?.focus();
@@ -60892,10 +60893,10 @@ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
60892
60893
  get #fontColor() {
60893
60894
  return this.#html?.attributes?.style?.color || null;
60894
60895
  }
60895
- #makePopupContent(text11) {
60896
+ #makePopupContent(text12) {
60896
60897
  const popupLines = [];
60897
60898
  const popupContent = {
60898
- str: text11,
60899
+ str: text12,
60899
60900
  html: {
60900
60901
  name: "div",
60901
60902
  attributes: {
@@ -60913,7 +60914,7 @@ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
60913
60914
  fontSize: this.#fontSize ? `calc(${this.#fontSize}px * var(--total-scale-factor))` : ""
60914
60915
  }
60915
60916
  };
60916
- for (const line of text11.split("\n")) {
60917
+ for (const line of text12.split("\n")) {
60917
60918
  popupLines.push({
60918
60919
  name: "span",
60919
60920
  value: line,
@@ -62422,9 +62423,9 @@ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
62422
62423
  if (savedText === newText) {
62423
62424
  return;
62424
62425
  }
62425
- const setText = (text11) => {
62426
- this.#content = text11;
62427
- if (!text11) {
62426
+ const setText = (text12) => {
62427
+ this.#content = text12;
62428
+ if (!text12) {
62428
62429
  this.remove();
62429
62430
  return;
62430
62431
  }
@@ -66239,7 +66240,7 @@ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
66239
66240
  const uint8Buf = this.#toUint8(grayImage);
66240
66241
  return [uint8Buf, newWidth, newHeight];
66241
66242
  }
66242
- static extractContoursFromText(text11, {
66243
+ static extractContoursFromText(text12, {
66243
66244
  fontFamily,
66244
66245
  fontStyle,
66245
66246
  fontWeight
@@ -66258,7 +66259,7 @@ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
66258
66259
  fontBoundingBoxAscent,
66259
66260
  fontBoundingBoxDescent,
66260
66261
  width
66261
- } = ctx.measureText(text11);
66262
+ } = ctx.measureText(text12);
66262
66263
  const SCALE = 1.5;
66263
66264
  const canvasWidth = Math.ceil(Math.max(Math.abs(actualBoundingBoxLeft) + Math.abs(actualBoundingBoxRight) || 0, width) * SCALE);
66264
66265
  const canvasHeight = Math.ceil(Math.max(Math.abs(actualBoundingBoxAscent) + Math.abs(actualBoundingBoxDescent) || fontSize, Math.abs(fontBoundingBoxAscent) + Math.abs(fontBoundingBoxDescent) || fontSize) * SCALE);
@@ -66272,7 +66273,7 @@ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
66272
66273
  ctx.fillStyle = "white";
66273
66274
  ctx.fillRect(0, 0, canvasWidth, canvasHeight);
66274
66275
  ctx.fillStyle = "black";
66275
- ctx.fillText(text11, canvasWidth * (SCALE - 1) / 2, canvasHeight * (3 - SCALE) / 2);
66276
+ ctx.fillText(text12, canvasWidth * (SCALE - 1) / 2, canvasHeight * (3 - SCALE) / 2);
66276
66277
  const uint8Buf = this.#toUint8(ctx.getImageData(0, 0, canvasWidth, canvasHeight).data);
66277
66278
  const histogram = this.#getHistogram(uint8Buf);
66278
66279
  const threshold = this.#guessThreshold(histogram);
@@ -66774,7 +66775,7 @@ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
66774
66775
  } = this.parent.viewport;
66775
66776
  return SignatureExtractor.process(bitmap, pageWidth, pageHeight, rotation, _SignatureEditor._INNER_MARGIN);
66776
66777
  }
66777
- getFromText(text11, fontInfo) {
66778
+ getFromText(text12, fontInfo) {
66778
66779
  const {
66779
66780
  rawDims: {
66780
66781
  pageWidth,
@@ -66782,7 +66783,7 @@ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
66782
66783
  },
66783
66784
  rotation
66784
66785
  } = this.parent.viewport;
66785
- return SignatureExtractor.extractContoursFromText(text11, fontInfo, pageWidth, pageHeight, rotation, _SignatureEditor._INNER_MARGIN);
66786
+ return SignatureExtractor.extractContoursFromText(text12, fontInfo, pageWidth, pageHeight, rotation, _SignatureEditor._INNER_MARGIN);
66786
66787
  }
66787
66788
  getDrawnSignature(curves) {
66788
66789
  const {
@@ -118793,9 +118794,9 @@ function withExtras(name, render) {
118793
118794
  Wrapped.displayName = name;
118794
118795
  return Wrapped;
118795
118796
  }
118796
- function rememberReveal(text11, n2) {
118797
+ function rememberReveal(text12, n2) {
118797
118798
  if (revealProgress.size > 500) revealProgress.clear();
118798
- revealProgress.set(text11, n2);
118799
+ revealProgress.set(text12, n2);
118799
118800
  }
118800
118801
  function revealHtml(html, shown2, fade) {
118801
118802
  let w2 = 0;
@@ -119639,8 +119640,8 @@ function applyA11ySemantics(node, ctx, extra) {
119639
119640
  extra["aria-live"] = str11(announce.politeness) === "assertive" ? "assertive" : "polite";
119640
119641
  extra["aria-atomic"] = "true";
119641
119642
  extra["aria-relevant"] = trigger === "on_appear" ? "additions" : trigger === "both" ? "additions text" : "text";
119642
- const text11 = str11(announce.text);
119643
- if (text11 && extra["aria-label"] == null) extra["aria-label"] = text11;
119643
+ const text12 = str11(announce.text);
119644
+ if (text12 && extra["aria-label"] == null) extra["aria-label"] = text12;
119644
119645
  }
119645
119646
  }
119646
119647
  return hint;
@@ -121999,13 +122000,13 @@ var init_renderNode = __esm({
121999
122000
  const C2 = ctx.color;
122000
122001
  const isBoundText = typeof props.textPath === "string" && isBinding(props.textPath);
122001
122002
  const bound2 = useResolvedScalar(isBoundText ? props.textPath : void 0, ctx);
122002
- const text11 = isBoundText ? typeof bound2 === "string" || typeof bound2 === "number" ? String(bound2) : "" : literalErrorText;
122003
+ const text12 = isBoundText ? typeof bound2 === "string" || typeof bound2 === "number" ? String(bound2) : "" : literalErrorText;
122003
122004
  if (props.visible === false) return null;
122004
- if (isBoundText && !text11) return null;
122005
+ if (isBoundText && !text12) return null;
122005
122006
  const c2 = (props.severity ?? "error") === "warning" ? C2("warning", "#E89F00") : C2("danger", "#E62214");
122006
122007
  return /* @__PURE__ */ jsxs8("div", { role: "alert", style: { display: "flex", gap: 6, alignItems: "center", color: c2, fontSize: pxToRem(13), fontFamily: bodyFont(ctx), ...wrap }, children: [
122007
122008
  /* @__PURE__ */ jsx11("span", { "aria-hidden": "true", children: "\u26A0" }),
122008
- text11
122009
+ text12
122009
122010
  ] });
122010
122011
  });
122011
122012
  FormView = withExtras("FormView", ({ props, ctx, wrap }) => {
@@ -122809,8 +122810,8 @@ var init_renderNode = __esm({
122809
122810
  const look = pickerFieldLook(props.field, ctx);
122810
122811
  const shownSel = ctx.onAction ? sel : ctx.empty ? null : selectedId;
122811
122812
  const picked = opts.find((o2) => o2 != null && String(o2.id) === String(shownSel ?? ""));
122812
- const text11 = picked ? labelOf(picked) : String(placeholderText || "Select");
122813
- const box = /* @__PURE__ */ jsx11(PickerFieldBox, { look, ctx, option: picked, text: text11, isPlaceholder: !picked, font: bodyFont(ctx) });
122813
+ const text12 = picked ? labelOf(picked) : String(placeholderText || "Select");
122814
+ const box = /* @__PURE__ */ jsx11(PickerFieldBox, { look, ctx, option: picked, text: text12, isPlaceholder: !picked, font: bodyFont(ctx) });
122814
122815
  if (!ctx.onAction) return /* @__PURE__ */ jsx11("div", { style: { width: "100%", ...wrap }, children: box });
122815
122816
  return /* @__PURE__ */ jsxs8("div", { ...{ [A11Y_PART]: "root" }, "data-hm-picker-focus": "", style: { position: "relative", width: "100%", ...wrap }, children: [
122816
122817
  box,
@@ -122829,7 +122830,7 @@ var init_renderNode = __esm({
122829
122830
  ...pickerA11yProps,
122830
122831
  style: { position: "absolute", inset: 0, width: "100%", height: "100%", opacity: 0, cursor: "pointer", margin: 0, border: 0, fontSize: pxToRem(15) },
122831
122832
  children: [
122832
- !picked && /* @__PURE__ */ jsx11("option", { value: "", disabled: true, children: text11 }),
122833
+ !picked && /* @__PURE__ */ jsx11("option", { value: "", disabled: true, children: text12 }),
122833
122834
  opts.map((o2, i2) => /* @__PURE__ */ jsx11("option", { value: o2?.id, disabled: !pickerOptionPickable(o2), children: labelOf(o2) }, o2?.id ?? i2))
122834
122835
  ]
122835
122836
  }
@@ -123328,37 +123329,37 @@ var init_renderNode = __esm({
123328
123329
  REVEAL_BUFFER = 12;
123329
123330
  revealProgress = /* @__PURE__ */ new Map();
123330
123331
  countWords = (s2) => s2.split(/\s+/).filter((t2) => t2 !== "").length;
123331
- RevealText = ({ text: text11, reduce, markdownHtml }) => {
123332
- const tokens2 = React13.useMemo(() => text11.split(/(\s+)/).filter((t2) => t2 !== ""), [text11]);
123332
+ RevealText = ({ text: text12, reduce, markdownHtml }) => {
123333
+ const tokens2 = React13.useMemo(() => text12.split(/(\s+)/).filter((t2) => t2 !== ""), [text12]);
123333
123334
  const total = React13.useMemo(
123334
- () => markdownHtml != null ? revealHtml(markdownHtml, 0, void 0).total : countWords(text11),
123335
- [text11, markdownHtml]
123335
+ () => markdownHtml != null ? revealHtml(markdownHtml, 0, void 0).total : countWords(text12),
123336
+ [text12, markdownHtml]
123336
123337
  );
123337
123338
  const [shown2, setShown] = React13.useState(total);
123338
123339
  const prevRef = React13.useRef(null);
123339
123340
  useIsomorphicLayoutEffect(() => {
123340
123341
  const prev = prevRef.current;
123341
- prevRef.current = text11;
123342
+ prevRef.current = text12;
123342
123343
  if (reduce) {
123343
- rememberReveal(text11, total);
123344
+ rememberReveal(text12, total);
123344
123345
  setShown(total);
123345
123346
  return;
123346
123347
  }
123347
- let start = revealProgress.get(text11);
123348
- if (start == null) start = prev != null && text11.startsWith(prev) ? revealProgress.get(prev) ?? countWords(prev) : 0;
123348
+ let start = revealProgress.get(text12);
123349
+ if (start == null) start = prev != null && text12.startsWith(prev) ? revealProgress.get(prev) ?? countWords(prev) : 0;
123349
123350
  start = Math.max(start, total - REVEAL_BUFFER);
123350
- rememberReveal(text11, start);
123351
+ rememberReveal(text12, start);
123351
123352
  setShown(start);
123352
123353
  if (start >= total) return;
123353
123354
  let n2 = start;
123354
123355
  const id = setInterval(() => {
123355
123356
  n2 += 1;
123356
- rememberReveal(text11, n2);
123357
+ rememberReveal(text12, n2);
123357
123358
  setShown(n2);
123358
123359
  if (n2 >= total) clearInterval(id);
123359
123360
  }, REVEAL_RELEASE_MS);
123360
123361
  return () => clearInterval(id);
123361
- }, [text11, reduce, total]);
123362
+ }, [text12, reduce, total]);
123362
123363
  const fade = reduce ? void 0 : `opacity ${REVEAL_FADE_MS}ms ease-out`;
123363
123364
  if (markdownHtml != null) {
123364
123365
  return /* @__PURE__ */ jsx11(
@@ -124456,7 +124457,7 @@ var init_renderNode = __esm({
124456
124457
  TooltipNode = withExtras("TooltipNode", ({ props, ctx, wrap }) => {
124457
124458
  const C2 = ctx.color;
124458
124459
  const title = useBoundString(props.title, ctx);
124459
- const text11 = useBoundString(props.text, ctx);
124460
+ const text12 = useBoundString(props.text, ctx);
124460
124461
  const rich = title !== "";
124461
124462
  const trigger = resolveTooltipTrigger(props.trigger, "pointer");
124462
124463
  const edge = resolveOverlayEdge("Tooltip", props.edge);
@@ -124546,7 +124547,7 @@ var init_renderNode = __esm({
124546
124547
  // A held press would otherwise open the browser's own context menu over the bubble.
124547
124548
  onContextMenu: (e2) => e2.preventDefault()
124548
124549
  };
124549
- const hint = [title, text11].filter((s2) => s2 !== "").join(". ");
124550
+ const hint = [title, text12].filter((s2) => s2 !== "").join(". ");
124550
124551
  const anchor = props.anchor ? renderNode(props.anchor, ctx) : null;
124551
124552
  const wrapperHintId = `hm-tip-hint${React13.useId()}`;
124552
124553
  useIsomorphicLayoutEffect(() => {
@@ -124579,7 +124580,7 @@ var init_renderNode = __esm({
124579
124580
  ] }) }),
124580
124581
  open && /* @__PURE__ */ jsxs8("div", { ref: bubbleRef, role: "tooltip", "data-hm-tooltip-edge": placed, style: { position: "absolute", zIndex: 45, maxWidth: Math.min(240, placement.maxWidth), overflowWrap: placement.maxWidth < 240 ? "anywhere" : void 0, width: "max-content", background: C2("textPrimary", "#13171e"), color: C2("textOnAccent", "#fff"), borderRadius: 8, padding: rich ? "10px 12px" : "6px 10px", fontFamily: bodyFont(ctx), fontSize: pxToRem(13), lineHeight: 1.35, boxShadow: "0 4px 14px rgba(0,0,0,.18)", ...overlayEdgeStyle(placed, TOOLTIP_GAP), translate: `${placement.x}px ${placement.y}px` }, children: [
124581
124582
  rich && /* @__PURE__ */ jsx11("div", { style: { fontWeight: 700, marginBottom: 3 }, children: title }),
124582
- text11
124583
+ text12
124583
124584
  ] })
124584
124585
  ] });
124585
124586
  });
@@ -127256,8 +127257,8 @@ function buildRenderTree(node, path2 = "$", provider = null, itemScope = void 0,
127256
127257
  const asText3 = VALUE_PATH_TEXT.get(type);
127257
127258
  if (typeof valuePath === "string" && asText3 && (valuePath.startsWith("$service:") || /^\$item\.[^.]/.test(valuePath))) {
127258
127259
  const r3 = resolveTreeScalar(valuePath, provider, itemScope);
127259
- const text11 = asText3(r3, props);
127260
- if (text11 !== void 0) values.value = text11;
127260
+ const text12 = asText3(r3, props);
127261
+ if (text12 !== void 0) values.value = text12;
127261
127262
  else if (r3 !== void 0 && r3 !== null) {
127262
127263
  delete values.value;
127263
127264
  }
@@ -129208,11 +129209,11 @@ async function handleOwnerChatRequest(req, res) {
129208
129209
  return sendJson(res, 400, { error: "invalid_json" }, cors);
129209
129210
  }
129210
129211
  const chatroomId = (parsed.chatroomId ?? "").trim();
129211
- const text11 = (parsed.text ?? "").trim();
129212
- if (!chatroomId || !text11) return sendJson(res, 400, { error: "chatroomId_and_text_required" }, cors);
129212
+ const text12 = (parsed.text ?? "").trim();
129213
+ if (!chatroomId || !text12) return sendJson(res, 400, { error: "chatroomId_and_text_required" }, cors);
129213
129214
  const metaSiteId = (parsed.metaSiteId ?? "").trim() || await resolveMetaSiteId();
129214
129215
  if (!metaSiteId) return sendJson(res, 400, { error: "no_meta_site" }, cors);
129215
- const result = await sendChatMessageLive(metaSiteId, chatroomId, text11);
129216
+ const result = await sendChatMessageLive(metaSiteId, chatroomId, text12);
129216
129217
  if (result.ok) return sendJson(res, 200, { ok: true, message: result.message }, cors);
129217
129218
  return sendJson(res, result.status >= 400 && result.status < 600 ? result.status : 502, { ok: false, status: result.status, error: result.error }, cors);
129218
129219
  }
@@ -129506,13 +129507,13 @@ function invalidate(state, ...screenIds) {
129506
129507
  publishSSE(state, "screen.invalidated", { screenIds });
129507
129508
  }
129508
129509
  function publishSSE(state, type, payload) {
129509
- const text11 = `event: ${type}
129510
+ const text12 = `event: ${type}
129510
129511
  data: ${JSON.stringify(payload)}
129511
129512
 
129512
129513
  `;
129513
129514
  for (const res of [...state.sseClients]) {
129514
129515
  try {
129515
- res.write(text11);
129516
+ res.write(text12);
129516
129517
  } catch {
129517
129518
  state.sseClients.delete(res);
129518
129519
  }
@@ -129528,13 +129529,13 @@ function publishAdminSSE(state, type, payload) {
129528
129529
  state.lastDeviceScreen.set(key3, screenId);
129529
129530
  }
129530
129531
  }
129531
- const text11 = `event: ${type}
129532
+ const text12 = `event: ${type}
129532
129533
  data: ${JSON.stringify(payload)}
129533
129534
 
129534
129535
  `;
129535
129536
  for (const res of [...state.adminClients]) {
129536
129537
  try {
129537
- res.write(text11);
129538
+ res.write(text12);
129538
129539
  } catch {
129539
129540
  state.adminClients.delete(res);
129540
129541
  }
@@ -129555,12 +129556,12 @@ function publishDevReady(state, res, extra = {}) {
129555
129556
  hotReloadEnabled: state.hotReloadEnabled,
129556
129557
  ...extra
129557
129558
  };
129558
- const text11 = `event: dev.ready
129559
+ const text12 = `event: dev.ready
129559
129560
  data: ${JSON.stringify(payload)}
129560
129561
 
129561
129562
  `;
129562
129563
  if (res) {
129563
- res.write(text11);
129564
+ res.write(text12);
129564
129565
  } else {
129565
129566
  publishSSE(state, "dev.ready", payload);
129566
129567
  }
@@ -131625,9 +131626,9 @@ async function handleLiveSubscription(req, res, state) {
131625
131626
  },
131626
131627
  body: JSON.stringify({ ...body, app })
131627
131628
  });
131628
- const text11 = await upstream.text();
131629
+ const text12 = await upstream.text();
131629
131630
  res.writeHead(upstream.status, { "Content-Type": "application/json", ...cors });
131630
- res.end(text11 || JSON.stringify({ ok: upstream.ok }));
131631
+ res.end(text12 || JSON.stringify({ ok: upstream.ok }));
131631
131632
  } catch (error) {
131632
131633
  sendJson(res, 502, { error: "admin_server_unreachable", detail: String(error) }, cors);
131633
131634
  }
@@ -133930,10 +133931,10 @@ function componentModuleIds() {
133930
133931
  function usageStringCopyFor(permissionCopy) {
133931
133932
  const out2 = {};
133932
133933
  for (const [rawId, copy] of Object.entries(permissionCopy ?? {})) {
133933
- const text11 = typeof copy === "string" ? copy.trim() : "";
133934
- if (!text11) continue;
133934
+ const text12 = typeof copy === "string" ? copy.trim() : "";
133935
+ if (!text12) continue;
133935
133936
  const req = CAPABILITY_NATIVE[catalogKey(rawId)];
133936
- for (const u2 of [...req?.ios?.usageStrings ?? [], ...req?.macos?.usageStrings ?? []]) out2[u2.key] = text11;
133937
+ for (const u2 of [...req?.ios?.usageStrings ?? [], ...req?.macos?.usageStrings ?? []]) out2[u2.key] = text12;
133937
133938
  }
133938
133939
  return out2;
133939
133940
  }
@@ -134861,10 +134862,10 @@ function netTransport(rules) {
134861
134862
  if (res.needsUpstream) {
134862
134863
  throw new Error(`net fixture rule ${res.ruleId} is a \`transform\` rule, which needs a real upstream \u2014 not usable in a hermetic crawl`);
134863
134864
  }
134864
- const { status, body: text11 } = res.resolved;
134865
+ const { status, body: text12 } = res.resolved;
134865
134866
  if (status < 200 || status >= 300) throw new Error(`Wix ${status} for ${method} ${bare}`);
134866
134867
  try {
134867
- return text11 ? JSON.parse(text11) : {};
134868
+ return text12 ? JSON.parse(text12) : {};
134868
134869
  } catch {
134869
134870
  return {};
134870
134871
  }
@@ -134908,10 +134909,10 @@ function layeredTransport(layers3) {
134908
134909
  });
134909
134910
  if (res.matched) {
134910
134911
  if (res.needsUpstream) throw new Error(`net fixture rule ${res.ruleId} is a \`transform\` rule, which needs a real upstream \u2014 not usable in a hermetic crawl`);
134911
- const { status, body: text11 } = res.resolved;
134912
+ const { status, body: text12 } = res.resolved;
134912
134913
  if (status < 200 || status >= 300) throw new Error(`Wix ${status} for ${m2} ${bare}`);
134913
134914
  try {
134914
- return text11 ? JSON.parse(text11) : {};
134915
+ return text12 ? JSON.parse(text12) : {};
134915
134916
  } catch {
134916
134917
  return {};
134917
134918
  }
@@ -137087,13 +137088,13 @@ var init_build2 = __esm({
137087
137088
  });
137088
137089
 
137089
137090
  // ../mobile-dist/release-pin.ts
137090
- function withPinnedRelease(text11, releaseId) {
137091
- if (!releaseId) return text11;
137091
+ function withPinnedRelease(text12, releaseId) {
137092
+ if (!releaseId) return text12;
137092
137093
  let cfg;
137093
137094
  try {
137094
- cfg = JSON.parse(text11);
137095
+ cfg = JSON.parse(text12);
137095
137096
  } catch {
137096
- return text11;
137097
+ return text12;
137097
137098
  }
137098
137099
  cfg.releaseId = releaseId;
137099
137100
  cfg.releasePinned = true;
@@ -137474,18 +137475,18 @@ async function bakeCatalogs(app, locale, fetchCatalog, putDoc) {
137474
137475
  const source = locale?.default ?? "en";
137475
137476
  const tags = [.../* @__PURE__ */ new Set([source, ...declared])];
137476
137477
  for (const tag of tags) {
137477
- const text11 = await fetchCatalog(tag);
137478
- if (!text11) continue;
137479
- if (!declared.length && !servesMessages(text11)) continue;
137480
- const hash2 = sha2563(text11);
137481
- await putDoc(app, hash2, text11);
137478
+ const text12 = await fetchCatalog(tag);
137479
+ if (!text12) continue;
137480
+ if (!declared.length && !servesMessages(text12)) continue;
137481
+ const hash2 = sha2563(text12);
137482
+ await putDoc(app, hash2, text12);
137482
137483
  out2[tag] = hash2;
137483
137484
  }
137484
137485
  return out2;
137485
137486
  }
137486
- function servesMessages(text11) {
137487
+ function servesMessages(text12) {
137487
137488
  try {
137488
- const m2 = JSON.parse(text11).messages;
137489
+ const m2 = JSON.parse(text12).messages;
137489
137490
  return !!m2 && typeof m2 === "object" && Object.keys(m2).length > 0;
137490
137491
  } catch {
137491
137492
  return false;
@@ -137580,9 +137581,9 @@ async function snapshotTokens(app, base, fetchTokens, put) {
137580
137581
  }
137581
137582
  };
137582
137583
  }
137583
- const text11 = await res.text();
137584
- await put(text11);
137585
- return { hash: sha2563(text11) };
137584
+ const text12 = await res.text();
137585
+ await put(text12);
137586
+ return { hash: sha2563(text12) };
137586
137587
  }
137587
137588
  function tokensSnapshotMessage(app, base, status) {
137588
137589
  const why = status === 400 ? `the dev-server rejected the app id as malformed (400 bad_app). It must be lowercase letters, digits and hyphens, starting with a letter or digit, at most 63 characters, with at most one interior dot \u2014 so a leading underscore or an uppercase letter fails, on every build of that app. A single dot is FINE (an owner-namespaced slug), so do not remove one to get past this` : `${status} from the tokens route`;
@@ -137683,23 +137684,23 @@ function maximumBinaryVersion(current, candidate) {
137683
137684
  }
137684
137685
  return current;
137685
137686
  }
137686
- async function withStoreNavBundle(text11, address) {
137687
+ async function withStoreNavBundle(text12, address) {
137687
137688
  let cfg;
137688
137689
  try {
137689
- cfg = JSON.parse(text11);
137690
+ cfg = JSON.parse(text12);
137690
137691
  } catch {
137691
- return text11;
137692
+ return text12;
137692
137693
  }
137693
137694
  const refs = [cfg?.app?.logicBundle, cfg?.navigation?.navLogicBundle, cfg?.navLogicBundle].filter(
137694
137695
  (r3) => !!r3 && typeof r3 === "object" && typeof r3.url === "string"
137695
137696
  );
137696
- if (refs.length === 0) return text11;
137697
+ if (refs.length === 0) return text12;
137697
137698
  const resolved2 = [];
137698
137699
  for (const ref of refs) {
137699
137700
  const name = bundleNameFromUrl(ref.url);
137700
- if (!name) return text11;
137701
+ if (!name) return text12;
137701
137702
  const addressed = await address(name);
137702
- if (!addressed) return text11;
137703
+ if (!addressed) return text12;
137703
137704
  resolved2.push({ ref, url: addressed.url, sri: addressed.sri });
137704
137705
  }
137705
137706
  for (const { ref, url, sri: integrity2 } of resolved2) {
@@ -137708,10 +137709,10 @@ async function withStoreNavBundle(text11, address) {
137708
137709
  }
137709
137710
  return JSON.stringify(cfg);
137710
137711
  }
137711
- function linkableScreenIdsFrom(text11) {
137712
+ function linkableScreenIdsFrom(text12) {
137712
137713
  let cfg;
137713
137714
  try {
137714
- cfg = JSON.parse(text11);
137715
+ cfg = JSON.parse(text12);
137715
137716
  } catch {
137716
137717
  return [];
137717
137718
  }
@@ -137723,24 +137724,24 @@ function linkableScreenIdsFrom(text11) {
137723
137724
  }
137724
137725
  return [...ids];
137725
137726
  }
137726
- function withoutDevOnlyAppConfig(text11) {
137727
+ function withoutDevOnlyAppConfig(text12) {
137727
137728
  let cfg;
137728
137729
  try {
137729
- cfg = JSON.parse(text11);
137730
+ cfg = JSON.parse(text12);
137730
137731
  } catch {
137731
- return text11;
137732
+ return text12;
137732
137733
  }
137733
- if (!cfg || typeof cfg !== "object" || !("devGatewayConfig" in cfg)) return text11;
137734
+ if (!cfg || typeof cfg !== "object" || !("devGatewayConfig" in cfg)) return text12;
137734
137735
  delete cfg.devGatewayConfig;
137735
137736
  return JSON.stringify(cfg);
137736
137737
  }
137737
- function withProdServeAppConfig(text11, prod) {
137738
- if (!prod?.serve) return text11;
137738
+ function withProdServeAppConfig(text12, prod) {
137739
+ if (!prod?.serve) return text12;
137739
137740
  let cfg;
137740
137741
  try {
137741
- cfg = JSON.parse(text11);
137742
+ cfg = JSON.parse(text12);
137742
137743
  } catch {
137743
- return text11;
137744
+ return text12;
137744
137745
  }
137745
137746
  cfg.useProdServe = true;
137746
137747
  cfg.prodServeBaseUrl = prod.serve;
@@ -138124,10 +138125,10 @@ async function buildFromLoaded(preloaded, dest, opts = {}) {
138124
138125
  if (bytes2.length === 0 || bytes2.length > MAX_AUTHORING_DOC_BYTES) {
138125
138126
  throw new Error(`${file2} must be non-empty and at most ${MAX_AUTHORING_DOC_BYTES} bytes to ship with a release.`);
138126
138127
  }
138127
- const text11 = bytes2.toString("utf8");
138128
- if (!Buffer.from(text11, "utf8").equals(bytes2)) throw new Error(`${file2} must be canonical UTF-8 Markdown.`);
138128
+ const text12 = bytes2.toString("utf8");
138129
+ if (!Buffer.from(text12, "utf8").equals(bytes2)) throw new Error(`${file2} must be canonical UTF-8 Markdown.`);
138129
138130
  const hash2 = sha2563(bytes2);
138130
- await store.putDoc(app, hash2, text11);
138131
+ await store.putDoc(app, hash2, text12);
138131
138132
  authoringDocs[name] = { sha256: hash2, sri: sri2(bytes2), bytes: bytes2.length, contentType: "text/markdown; charset=utf-8" };
138132
138133
  }
138133
138134
  }
@@ -138280,10 +138281,10 @@ async function buildFromLoaded(preloaded, dest, opts = {}) {
138280
138281
  base = BAKE_OFFLINE_BASE;
138281
138282
  }
138282
138283
  const devFetch = (url, init) => dev.inject(new Request(url, init));
138283
- const depthRefusalFromText = (status, text11) => {
138284
+ const depthRefusalFromText = (status, text12) => {
138284
138285
  if (status !== 422) return null;
138285
138286
  try {
138286
- const body = JSON.parse(text11);
138287
+ const body = JSON.parse(text12);
138287
138288
  return body?.error === "depth_budget_exceeded" && body.finding ? body.finding : null;
138288
138289
  } catch {
138289
138290
  return null;
@@ -138291,8 +138292,8 @@ async function buildFromLoaded(preloaded, dest, opts = {}) {
138291
138292
  };
138292
138293
  const depthRefusalOf = async (res) => depthRefusalFromText(res.status, await res.text());
138293
138294
  const recordUnbuilt = async (screenId, res) => {
138294
- const text11 = await res.text();
138295
- const finding2 = depthRefusalFromText(res.status, text11);
138295
+ const text12 = await res.text();
138296
+ const finding2 = depthRefusalFromText(res.status, text12);
138296
138297
  if (finding2) {
138297
138298
  failedToBuild.push({ screenId, status: res.status, error: finding2.message });
138298
138299
  if (!depthRefusals.some((r3) => r3.screenId === screenId)) depthRefusals.push({ screenId, finding: finding2 });
@@ -138301,7 +138302,7 @@ async function buildFromLoaded(preloaded, dest, opts = {}) {
138301
138302
  }
138302
138303
  return;
138303
138304
  }
138304
- failedToBuild.push({ screenId, status: res.status, error: text11.slice(0, 2e3) });
138305
+ failedToBuild.push({ screenId, status: res.status, error: text12.slice(0, 2e3) });
138305
138306
  };
138306
138307
  try {
138307
138308
  for (const screenId of screenIds) {
@@ -138547,11 +138548,11 @@ async function buildFromLoaded(preloaded, dest, opts = {}) {
138547
138548
  ok: res.ok,
138548
138549
  status: res.status,
138549
138550
  text: async () => {
138550
- const text11 = await res.text();
138551
+ const text12 = await res.text();
138551
138552
  try {
138552
- const doc = JSON.parse(text11);
138553
+ const doc = JSON.parse(text12);
138553
138554
  if (!publishedFontPlan) {
138554
- if (!("fontFaces" in doc)) return text11;
138555
+ if (!("fontFaces" in doc)) return text12;
138555
138556
  const kept = publishableFontFaces(doc.fontFaces);
138556
138557
  if (kept) doc.fontFaces = kept;
138557
138558
  else delete doc.fontFaces;
@@ -138560,12 +138561,12 @@ async function buildFromLoaded(preloaded, dest, opts = {}) {
138560
138561
  doc.fontFaces = servedProjection(publishedFontPlan);
138561
138562
  return JSON.stringify(doc);
138562
138563
  } catch {
138563
- return text11;
138564
+ return text12;
138564
138565
  }
138565
138566
  }
138566
138567
  };
138567
138568
  },
138568
- (text11) => store.putTokens(app, text11)
138569
+ (text12) => store.putTokens(app, text12)
138569
138570
  );
138570
138571
  if (snapshot3.hash) tokensHash = snapshot3.hash;
138571
138572
  if (snapshot3.failure) {
@@ -138595,14 +138596,14 @@ async function buildFromLoaded(preloaded, dest, opts = {}) {
138595
138596
  if (streamPolicyErrors.length) {
138596
138597
  throw new Error(`invalid streamPolicy for release ${app}: ${streamPolicyErrors.join("; ")}`);
138597
138598
  }
138598
- const text11 = await withStoreNavBundle(prodText, async (name) => {
138599
+ const text12 = await withStoreNavBundle(prodText, async (name) => {
138599
138600
  const hash2 = await addressBundle(name) ?? null;
138600
138601
  const entry = hash2 ? bundles[name] : void 0;
138601
138602
  return entry ? { url: store.bundleUrl(app, entry.sha256), sri: entry.sri } : null;
138602
138603
  });
138603
- await store.putAppConfig(app, text11);
138604
- appConfigHash = sha2563(text11);
138605
- if (collect2?.descriptors) for (const id of linkableScreenIdsFrom(text11)) linkable.add(id);
138604
+ await store.putAppConfig(app, text12);
138605
+ appConfigHash = sha2563(text12);
138606
+ if (collect2?.descriptors) for (const id of linkableScreenIdsFrom(text12)) linkable.add(id);
138606
138607
  }
138607
138608
  const ahRes = await devFetch(`${base}/v1/action-handlers/${encodeURIComponent(app)}`, { headers: { "X-Himalaya-App": app } });
138608
138609
  if (ahRes.ok) {
@@ -139537,8 +139538,8 @@ function penalty(m2, size) {
139537
139538
  score += Math.floor(Math.abs(dark * 20 - total * 10) / total) * 10;
139538
139539
  return score;
139539
139540
  }
139540
- function encodeQr(text11) {
139541
- const bytes2 = [...new TextEncoder().encode(text11)];
139541
+ function encodeQr(text12) {
139542
+ const bytes2 = [...new TextEncoder().encode(text12)];
139542
139543
  const version5 = fitVersion(bytes2.length);
139543
139544
  if (!version5) {
139544
139545
  throw new RangeError(`QR payload too long: ${bytes2.length} bytes exceeds version ${QR_MAX_VERSION} at EC level L`);
@@ -139778,14 +139779,14 @@ function headline(changes) {
139778
139779
  function boardLines(changes) {
139779
139780
  const lines = [];
139780
139781
  for (const c2 of changes.items) {
139781
- const text11 = lineOf(c2);
139782
- const same3 = lines.find((l2) => l2.text === text11);
139782
+ const text12 = lineOf(c2);
139783
+ const same3 = lines.find((l2) => l2.text === text12);
139783
139784
  if (same3) {
139784
139785
  same3.n++;
139785
139786
  continue;
139786
139787
  }
139787
139788
  lines.push({
139788
- text: text11,
139789
+ text: text12,
139789
139790
  n: 1,
139790
139791
  ...c2.kind === "token" && c2.from && HEX.test(c2.from) ? { from: c2.from } : {},
139791
139792
  ...c2.kind === "token" && c2.to && HEX.test(c2.to) ? { to: c2.to } : {}
@@ -140634,14 +140635,14 @@ function contentDir(flags) {
140634
140635
  return resolve33(str3(flags.content) ?? process.cwd());
140635
140636
  }
140636
140637
  function renameRestoredSource(restored, declaredApp, renamed) {
140637
- const text11 = {};
140638
+ const text12 = {};
140638
140639
  for (const entry of restored) {
140639
140640
  const decoded = entry.bytes.toString("utf8");
140640
- if (Buffer.from(decoded, "utf8").equals(entry.bytes)) text11[entry.path] = decoded;
140641
+ if (Buffer.from(decoded, "utf8").equals(entry.bytes)) text12[entry.path] = decoded;
140641
140642
  }
140642
- const sentineled = sentinelizeArchive(text11, declaredApp);
140643
+ const sentineled = sentinelizeArchive(text12, declaredApp);
140643
140644
  for (const entry of restored) {
140644
- if (!(entry.path in text11)) continue;
140645
+ if (!(entry.path in text12)) continue;
140645
140646
  const body = sentineled[entry.path];
140646
140647
  if (body !== void 0) entry.bytes = Buffer.from(substituteIdentity(body, renamed), "utf8");
140647
140648
  }
@@ -140721,8 +140722,8 @@ function materializeForPreview(appDir3, slug, displayName3) {
140721
140722
  }
140722
140723
  async function appId(dir) {
140723
140724
  try {
140724
- const { readFileSync: readFileSync127 } = await import("node:fs");
140725
- const m2 = JSON.parse(readFileSync127(join31(dir, "himalaya.content.json"), "utf8"));
140725
+ const { readFileSync: readFileSync128 } = await import("node:fs");
140726
+ const m2 = JSON.parse(readFileSync128(join31(dir, "himalaya.content.json"), "utf8"));
140726
140727
  if (m2.name) return m2.name;
140727
140728
  } catch {
140728
140729
  }
@@ -141137,10 +141138,10 @@ function ownerTransport(msid, fetchImpl = fetch, timeoutMs = DEFAULT_TIMEOUT_MS,
141137
141138
  }
141138
141139
  throw new Error(`${method} ${path2} failed: ${err?.message ?? String(e2)}`);
141139
141140
  }
141140
- const text11 = await res.text();
141141
- let parsed = text11;
141141
+ const text12 = await res.text();
141142
+ let parsed = text12;
141142
141143
  try {
141143
- parsed = text11 ? JSON.parse(text11) : null;
141144
+ parsed = text12 ? JSON.parse(text12) : null;
141144
141145
  } catch {
141145
141146
  }
141146
141147
  if (!res.ok) throw new WixApiError(res.status, method, path2, parsed);
@@ -141310,10 +141311,10 @@ function makeTransport(fetchImpl, auth, timeoutMs = DEFAULT_TIMEOUT_MS2) {
141310
141311
  body: body === void 0 ? void 0 : JSON.stringify(body),
141311
141312
  signal: AbortSignal.timeout(timeoutMs)
141312
141313
  });
141313
- const text11 = await res.text();
141314
- let parsed = text11;
141314
+ const text12 = await res.text();
141315
+ let parsed = text12;
141315
141316
  try {
141316
- parsed = text11 ? JSON.parse(text11) : null;
141317
+ parsed = text12 ? JSON.parse(text12) : null;
141317
141318
  } catch {
141318
141319
  }
141319
141320
  if (!res.ok) throw new WixApiError2(res.status, method, path2, parsed);
@@ -141414,10 +141415,10 @@ async function mintVisitorToken(fetchImpl, clientId) {
141414
141415
  body: JSON.stringify({ clientId, grantType: "anonymous" }),
141415
141416
  signal: AbortSignal.timeout(8e3)
141416
141417
  });
141417
- const text11 = await res.text();
141418
- let parsed = text11;
141418
+ const text12 = await res.text();
141419
+ let parsed = text12;
141419
141420
  try {
141420
- parsed = text11 ? JSON.parse(text11) : null;
141421
+ parsed = text12 ? JSON.parse(text12) : null;
141421
141422
  } catch {
141422
141423
  }
141423
141424
  if (!res.ok) throw new WixApiError2(res.status, "POST", "/oauth2/token", parsed);
@@ -141615,10 +141616,10 @@ function scalar3(v2) {
141615
141616
  }
141616
141617
  return t2;
141617
141618
  }
141618
- function parseStoreConfig(text11) {
141619
+ function parseStoreConfig(text12) {
141619
141620
  const cfg = {};
141620
141621
  let section3 = null;
141621
- for (const raw of text11.split("\n")) {
141622
+ for (const raw of text12.split("\n")) {
141622
141623
  const line = strip2(raw);
141623
141624
  if (!line.trim()) continue;
141624
141625
  const indented = /^\s+/.test(raw);
@@ -146776,7 +146777,7 @@ function prettify(node, options, matcher, readonlyMatcher) {
146776
146777
  return compress(node, options, matcher, readonlyMatcher);
146777
146778
  }
146778
146779
  function compress(arr2, options, matcher, readonlyMatcher) {
146779
- let text11;
146780
+ let text12;
146780
146781
  const compressedObj = {};
146781
146782
  for (let i2 = 0; i2 < arr2.length; i2++) {
146782
146783
  const tagObj = arr2[i2];
@@ -146789,8 +146790,8 @@ function compress(arr2, options, matcher, readonlyMatcher) {
146789
146790
  matcher.push(property2, rawAttrs);
146790
146791
  }
146791
146792
  if (property2 === options.textNodeName) {
146792
- if (text11 === void 0) text11 = tagObj[property2];
146793
- else text11 += "" + tagObj[property2];
146793
+ if (text12 === void 0) text12 = tagObj[property2];
146794
+ else text12 += "" + tagObj[property2];
146794
146795
  } else if (property2 === void 0) {
146795
146796
  continue;
146796
146797
  } else if (tagObj[property2]) {
@@ -146828,9 +146829,9 @@ function compress(arr2, options, matcher, readonlyMatcher) {
146828
146829
  }
146829
146830
  }
146830
146831
  }
146831
- if (typeof text11 === "string") {
146832
- if (text11.length > 0) compressedObj[options.textNodeName] = text11;
146833
- } else if (text11 !== void 0) compressedObj[options.textNodeName] = text11;
146832
+ if (typeof text12 === "string") {
146833
+ if (text12.length > 0) compressedObj[options.textNodeName] = text12;
146834
+ } else if (text12 !== void 0) compressedObj[options.textNodeName] = text12;
146834
146835
  return compressedObj;
146835
146836
  }
146836
146837
  function propName2(obj7) {
@@ -147008,9 +147009,9 @@ function arrToStr(arr2, options, indentation, matcher, stopNodeExpressions, xmlV
147008
147009
  }
147009
147010
  if (!Array.isArray(arr2)) {
147010
147011
  if (arr2 !== void 0 && arr2 !== null) {
147011
- let text11 = arr2.toString();
147012
- text11 = replaceEntitiesValue2(text11, options);
147013
- return text11;
147012
+ let text12 = arr2.toString();
147013
+ text12 = replaceEntitiesValue2(text12, options);
147014
+ return text12;
147014
147015
  }
147015
147016
  return "";
147016
147017
  }
@@ -149315,9 +149316,9 @@ function bundlesOf(block) {
149315
149316
  walk2(block);
149316
149317
  return [...out2];
149317
149318
  }
149318
- function parseJson2(text11, what) {
149319
+ function parseJson2(text12, what) {
149319
149320
  try {
149320
- const value2 = JSON.parse(text11);
149321
+ const value2 = JSON.parse(text12);
149321
149322
  if (!value2 || typeof value2 !== "object" || Array.isArray(value2)) throw new Error("not an object");
149322
149323
  return value2;
149323
149324
  } catch (e2) {
@@ -149902,9 +149903,9 @@ function planTrim(src, keepIds, links) {
149902
149903
  for (const r3 of keptRoutes) for (const b2 of r3.bundles) keptWorkers.add(b2);
149903
149904
  const importsOf2 = (dir) => {
149904
149905
  const out2 = [];
149905
- for (const [rel, text11] of Object.entries(src.workerFiles)) {
149906
+ for (const [rel, text12] of Object.entries(src.workerFiles)) {
149906
149907
  if (!rel.startsWith(`tier5-src/${dir}/`)) continue;
149907
- for (const m2 of text11.matchAll(/(?:\bfrom\s*|\bimport\s*\(?\s*|\brequire\s*\(\s*)["']\.\.\/([A-Za-z0-9_.-]+)(?:\/|["'])/g)) out2.push(m2[1]);
149908
+ for (const m2 of text12.matchAll(/(?:\bfrom\s*|\bimport\s*\(?\s*|\brequire\s*\(\s*)["']\.\.\/([A-Za-z0-9_.-]+)(?:\/|["'])/g)) out2.push(m2[1]);
149908
149909
  }
149909
149910
  return out2;
149910
149911
  };
@@ -149950,9 +149951,9 @@ function planTrim(src, keepIds, links) {
149950
149951
  continue;
149951
149952
  }
149952
149953
  const block = edited.get(r3);
149953
- let text11 = block ? serializeAt(block, app.dev, r3.open) : void 0;
149954
- if (r3 === app.home && homeModules?.text !== void 0) text11 = homeModules.text;
149955
- if (text11 !== void 0) cut2(r3.open, r3.close, text11);
149954
+ let text12 = block ? serializeAt(block, app.dev, r3.open) : void 0;
149955
+ if (r3 === app.home && homeModules?.text !== void 0) text12 = homeModules.text;
149956
+ if (text12 !== void 0) cut2(r3.open, r3.close, text12);
149956
149957
  }
149957
149958
  if (templatedEmptied) cut2(templatedEmptied[0], templatedEmptied[1], "\n");
149958
149959
  dev += app.dev.slice(cursor);
@@ -150005,9 +150006,9 @@ function homeModulesPass(app, kept, edited) {
150005
150006
  const removedVertical = verticals.some(([, card2]) => !kept.has(app.exact.get(card2.screenId)));
150006
150007
  if (!removedVertical) return { dropped: [] };
150007
150008
  const block = edited.get(app.home);
150008
- const text11 = block ? serializeAt(block, app.dev, app.home.open) : app.dev.slice(app.home.open, app.home.close);
150009
+ const text12 = block ? serializeAt(block, app.dev, app.home.open) : app.dev.slice(app.home.open, app.home.close);
150009
150010
  const installed = verticals.filter(([, card2]) => kept.has(app.exact.get(card2.screenId))).map(([v2]) => v2);
150010
- const patched = patchHomeModules(text11, installed);
150011
+ const patched = patchHomeModules(text12, installed);
150011
150012
  if (!patched.droppedModules.length) return { dropped: [] };
150012
150013
  return { text: patched.src, dropped: patched.droppedModules };
150013
150014
  }
@@ -150497,8 +150498,8 @@ function workerReach(src) {
150497
150498
  const f2 = queue.shift();
150498
150499
  if (seen.has(f2)) continue;
150499
150500
  seen.add(f2);
150500
- const text11 = all.get(f2) ?? "";
150501
- for (const m2 of text11.matchAll(RELATIVE_IMPORT)) {
150501
+ const text12 = all.get(f2) ?? "";
150502
+ for (const m2 of text12.matchAll(RELATIVE_IMPORT)) {
150502
150503
  const r3 = resolveImport(f2, m2[1], all);
150503
150504
  if (r3 && !seen.has(r3)) queue.push(r3);
150504
150505
  }
@@ -150508,11 +150509,11 @@ function workerReach(src) {
150508
150509
  let fetchCall = false;
150509
150510
  const hits = [];
150510
150511
  for (const f2 of [...seen].sort()) {
150511
- const text11 = all.get(f2) ?? "";
150512
+ const text12 = all.get(f2) ?? "";
150512
150513
  const before = wix.size;
150513
- for (const m2 of text11.matchAll(WIX_MODULE)) wix.add(m2[1].replace(/^@wix\/himalaya\//, "@himalaya/"));
150514
- const r3 = /\bwixApi\b/.test(text11);
150515
- const fe2 = /(?<![.\w])fetch\s*\(/.test(text11);
150514
+ for (const m2 of text12.matchAll(WIX_MODULE)) wix.add(m2[1].replace(/^@wix\/himalaya\//, "@himalaya/"));
150515
+ const r3 = /\bwixApi\b/.test(text12);
150516
+ const fe2 = /(?<![.\w])fetch\s*\(/.test(text12);
150516
150517
  if (wix.size > before || r3 || fe2) hits.push(f2);
150517
150518
  raw ||= r3;
150518
150519
  fetchCall ||= fe2;
@@ -150961,10 +150962,10 @@ async function pushSetupRequest(options) {
150961
150962
  signal: AbortSignal.timeout(options.timeoutMs ?? (setup ? 12e4 : 3e4)),
150962
150963
  ...setup ? { body: JSON.stringify(options.body) } : {}
150963
150964
  });
150964
- const text11 = await response.text();
150965
+ const text12 = await response.text();
150965
150966
  let parsed = null;
150966
150967
  try {
150967
- const value2 = text11 ? JSON.parse(text11) : null;
150968
+ const value2 = text12 ? JSON.parse(text12) : null;
150968
150969
  parsed = value2 && typeof value2 === "object" && !Array.isArray(value2) ? value2 : null;
150969
150970
  } catch {
150970
150971
  parsed = null;
@@ -151108,8 +151109,8 @@ function appendProperties(literal, file2, lines) {
151108
151109
  const at2 = trailing ? literal.properties.end : last.end;
151109
151110
  const lead = trailing ? "" : ",";
151110
151111
  if (onOneLine(literal, file2)) {
151111
- const text11 = inline();
151112
- return { at: at2, end: at2, text: `${lead} ${trailing ? text11 : text11.replace(/,$/, "")}` };
151112
+ const text12 = inline();
151113
+ return { at: at2, end: at2, text: `${lead} ${trailing ? text12 : text12.replace(/,$/, "")}` };
151113
151114
  }
151114
151115
  const indent = lineIndent2(file2.text, last.getStart(file2));
151115
151116
  return { at: at2, end: at2, text: lead + lines.map((line) => `
@@ -151119,9 +151120,9 @@ function onOneLine(node, file2) {
151119
151120
  const line = (position) => file2.getLineAndCharacterOfPosition(position).line;
151120
151121
  return line(node.getStart(file2)) === line(node.getEnd());
151121
151122
  }
151122
- function lineIndent2(text11, position) {
151123
- const lineStart = text11.lastIndexOf("\n", position - 1) + 1;
151124
- return /^[ \t]*/.exec(text11.slice(lineStart))[0];
151123
+ function lineIndent2(text12, position) {
151124
+ const lineStart = text12.lastIndexOf("\n", position - 1) + 1;
151125
+ return /^[ \t]*/.exec(text12.slice(lineStart))[0];
151125
151126
  }
151126
151127
  function applySplices(source, splices) {
151127
151128
  return [...splices].sort((a2, b2) => b2.at - a2.at).reduce((out2, s2) => out2.slice(0, s2.at) + s2.text + out2.slice(s2.end), source);
@@ -152630,9 +152631,9 @@ __export(screen_state_exports, {
152630
152631
  import { createHash as createHash26 } from "node:crypto";
152631
152632
  import { lstatSync as lstatSync16, readFileSync as readFileSync52 } from "node:fs";
152632
152633
  import { join as join41 } from "node:path";
152633
- function quotableLine(text11) {
152634
- if (!text11) return void 0;
152635
- const first = text11.split(/\r?\n/).map((l2) => l2.trim()).find(Boolean);
152634
+ function quotableLine(text12) {
152635
+ if (!text12) return void 0;
152636
+ const first = text12.split(/\r?\n/).map((l2) => l2.trim()).find(Boolean);
152636
152637
  if (!first) return void 0;
152637
152638
  let line = first.replace(/\s+/g, " ");
152638
152639
  if (line.length > LINE_MAX) {
@@ -152645,9 +152646,9 @@ function quotableLine(text11) {
152645
152646
  function visibleText(html) {
152646
152647
  return html.replace(/<(script|style)\b[\s\S]*?<\/\1>/gi, " ").replace(/<[^>]*>/g, " ").replace(/&#x([0-9a-f]+);/gi, (_2, h2) => String.fromCodePoint(parseInt(h2, 16))).replace(/&#(\d+);/g, (_2, d2) => String.fromCodePoint(Number(d2))).replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&nbsp;/g, " ").replace(/&amp;/g, "&").replace(/\s+/g, " ");
152647
152648
  }
152648
- function painted(text11, page) {
152649
+ function painted(text12, page) {
152649
152650
  if (page === void 0) return true;
152650
- const probe2 = text11.replace(/\s+/g, " ").trim().slice(0, 60);
152651
+ const probe2 = text12.replace(/\s+/g, " ").trim().slice(0, 60);
152651
152652
  return !!probe2 && page.includes(probe2);
152652
152653
  }
152653
152654
  function errorMessageOf(s2) {
@@ -153926,8 +153927,8 @@ var init_cms_schema = __esm({
153926
153927
 
153927
153928
  // ../native-config/car.ts
153928
153929
  function parseCarConfig(configTs) {
153929
- const { text: text11, inString } = scanConfig(configTs);
153930
- for (const m2 of text11.matchAll(/\bcar\s*[:=]\s*\{([^}]*)\}/g)) {
153930
+ const { text: text12, inString } = scanConfig(configTs);
153931
+ for (const m2 of text12.matchAll(/\bcar\s*[:=]\s*\{([^}]*)\}/g)) {
153931
153932
  if (inString[m2.index]) continue;
153932
153933
  return { category: /category\s*:\s*["']([^"']+)["']/.exec(m2[1])?.[1] };
153933
153934
  }
@@ -154458,10 +154459,10 @@ function tokenColorIssues(dir, tokensPathOverride) {
154458
154459
  if (controlButton === void 0 || controlButton === null || typeof controlButton !== "object" || Array.isArray(controlButton)) return;
154459
154460
  const btn = controlButton;
154460
154461
  for (const size of ["sm", "md", "lg"]) {
154461
- const text11 = btn[size]?.text;
154462
- if (text11 === void 0 || typeof text11 === "string" && typo.has(text11)) continue;
154462
+ const text12 = btn[size]?.text;
154463
+ if (text12 === void 0 || typeof text12 === "string" && typo.has(text12)) continue;
154463
154464
  error(
154464
- `${tokensPath}: ${where}controls.button.${size}.text is ${JSON.stringify(text11)}, which names no \`typography\` token \u2014 every renderer would keep the built-in Button label. Name one that exists.`
154465
+ `${tokensPath}: ${where}controls.button.${size}.text is ${JSON.stringify(text12)}, which names no \`typography\` token \u2014 every renderer would keep the built-in Button label. Name one that exists.`
154465
154466
  );
154466
154467
  }
154467
154468
  const variants = btn.variants;
@@ -154948,16 +154949,16 @@ function encode(value2, quote) {
154948
154949
  if (quote === "'") return `'${value2.replace(/[\\']/g, "\\$&").replace(/\n/g, "\\n")}'`;
154949
154950
  return `\`${value2.replace(/[\\`]|\$(?=\{)/g, "\\$&")}\``;
154950
154951
  }
154951
- function syntaxErrors(file2, text11) {
154952
+ function syntaxErrors(file2, text12) {
154952
154953
  if (file2.endsWith(".json")) {
154953
154954
  try {
154954
- JSON.parse(text11);
154955
+ JSON.parse(text12);
154955
154956
  return [];
154956
154957
  } catch (e2) {
154957
154958
  return [e2.message];
154958
154959
  }
154959
154960
  }
154960
- const out2 = ts8.transpileModule(text11, { fileName: file2, reportDiagnostics: true, compilerOptions: { target: ts8.ScriptTarget.ES2022 } });
154961
+ const out2 = ts8.transpileModule(text12, { fileName: file2, reportDiagnostics: true, compilerOptions: { target: ts8.ScriptTarget.ES2022 } });
154961
154962
  return (out2.diagnostics ?? []).map((d2) => ts8.flattenDiagnosticMessageText(d2.messageText, "\n"));
154962
154963
  }
154963
154964
  function parses(dev, config) {
@@ -154978,10 +154979,10 @@ function sweepCopy(dir, pairs, dryRun) {
154978
154979
  const next = /* @__PURE__ */ new Map();
154979
154980
  const replaced = pairs.map(([from, to2]) => ({ from, to: to2, files: {} }));
154980
154981
  for (const f2 of files) {
154981
- const text11 = readFileSync60(join50(dir, f2), "utf8");
154982
- if (!pairs.some(([from]) => text11.includes(from) || text11.includes(JSON.stringify(from).slice(1, -1)))) continue;
154982
+ const text12 = readFileSync60(join50(dir, f2), "utf8");
154983
+ if (!pairs.some(([from]) => text12.includes(from) || text12.includes(JSON.stringify(from).slice(1, -1)))) continue;
154983
154984
  const kind = f2.endsWith(".json") ? ts8.ScriptKind.JSON : f2.endsWith("x") ? ts8.ScriptKind.TSX : ts8.ScriptKind.TS;
154984
- const sf2 = ts8.createSourceFile(f2, text11, ts8.ScriptTarget.Latest, true, kind);
154985
+ const sf2 = ts8.createSourceFile(f2, text12, ts8.ScriptTarget.Latest, true, kind);
154985
154986
  const edits = [];
154986
154987
  const visit = (node) => {
154987
154988
  if ((ts8.isStringLiteral(node) || ts8.isNoSubstitutionTemplateLiteral(node)) && isCopy(node, f2)) {
@@ -154994,14 +154995,14 @@ function sweepCopy(dir, pairs, dryRun) {
154994
154995
  });
154995
154996
  if (value2 !== node.text) {
154996
154997
  const start = node.getStart(sf2);
154997
- edits.push({ start, end: node.end, text: encode(value2, text11[start]) });
154998
+ edits.push({ start, end: node.end, text: encode(value2, text12[start]) });
154998
154999
  }
154999
155000
  }
155000
155001
  ts8.forEachChild(node, visit);
155001
155002
  };
155002
155003
  visit(sf2);
155003
155004
  if (!edits.length) continue;
155004
- let out2 = text11;
155005
+ let out2 = text12;
155005
155006
  for (const e2 of edits.sort((a2, b2) => b2.start - a2.start)) out2 = out2.slice(0, e2.start) + e2.text + out2.slice(e2.end);
155006
155007
  if (f2.startsWith("tier5-src/_shared/") && f2.endsWith(".ts") && !out2.includes(SHARED_FORK_MARKER)) {
155007
155008
  out2 = `${SHARED_FORK_MARKER} \u2014 copy rewritten by \`himi template sweep\`
@@ -155302,9 +155303,9 @@ function verticalsFromBook(path2) {
155302
155303
  throw new Error(`no book.json / provisioning.overlay.json under ${path2} \u2014 run \`himi site analyze\` first, or pass --verticals`);
155303
155304
  }
155304
155305
  function recommendTemplates(input) {
155305
- const text11 = input.text ?? "";
155306
- const owner = OWNER_WORDS.test(text11);
155307
- const want = new Set(tokens(text11));
155306
+ const text12 = input.text ?? "";
155307
+ const owner = OWNER_WORDS.test(text12);
155308
+ const want = new Set(tokens(text12));
155308
155309
  const byName3 = /* @__PURE__ */ new Map();
155309
155310
  for (const row2 of input.catalog) {
155310
155311
  const reasons = [];
@@ -155318,7 +155319,7 @@ function recommendTemplates(input) {
155318
155319
  reasons.push(`matches ${hit.map((h2) => `"${h2}"`).join(", ")}`);
155319
155320
  }
155320
155321
  }
155321
- if (text11) {
155322
+ if (text12) {
155322
155323
  if (owner === isOwner) {
155323
155324
  score += 0.3;
155324
155325
  reasons.push(owner ? "owner/operations app, and this is an owner template" : "customer-facing app, and this is a customer template");
@@ -156926,9 +156927,9 @@ function xmlAttr(value2) {
156926
156927
  return value2.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
156927
156928
  }
156928
156929
  function renderHealthPermissionCopyXml(copy, indent) {
156929
- const text11 = copy?.trim();
156930
- if (!text11) return [];
156931
- return [`${indent}<meta-data android:name="${HEALTH_PERMISSION_COPY_META}" android:value="${xmlAttr(text11)}" />`];
156930
+ const text12 = copy?.trim();
156931
+ if (!text12) return [];
156932
+ return [`${indent}<meta-data android:name="${HEALTH_PERMISSION_COPY_META}" android:value="${xmlAttr(text12)}" />`];
156932
156933
  }
156933
156934
  function renderModulesIosPackage(products, indent) {
156934
156935
  return products.flatMap((p2) => {
@@ -157095,8 +157096,8 @@ function swiftFilesWithModuleMarkers(app) {
157095
157096
  if (entry.isDirectory()) {
157096
157097
  if (!entry.name.endsWith(".xcodeproj")) stack.push(path2);
157097
157098
  } else if (entry.isFile() && entry.name.endsWith(".swift")) {
157098
- const text11 = readFileSync65(path2, "utf8");
157099
- if (hasMarkers(text11, "slash", LABEL_MODULES_SWIFT_IMPORT) || hasMarkers(text11, "slash", LABEL_MODULES_SWIFT_INSTALL)) out2.push(path2);
157099
+ const text12 = readFileSync65(path2, "utf8");
157100
+ if (hasMarkers(text12, "slash", LABEL_MODULES_SWIFT_IMPORT) || hasMarkers(text12, "slash", LABEL_MODULES_SWIFT_INSTALL)) out2.push(path2);
157100
157101
  }
157101
157102
  }
157102
157103
  }
@@ -157131,8 +157132,8 @@ function kotlinBootSourcesUnder(root) {
157131
157132
  }
157132
157133
  return out2.sort();
157133
157134
  }
157134
- function stripComments2(text11) {
157135
- return text11.replace(/\/\*[\s\S]*?\*\//g, (c2) => c2.replace(/[^\n]/g, " ")).replace(/\/\/[^\n]*/g, "");
157135
+ function stripComments2(text12) {
157136
+ return text12.replace(/\/\*[\s\S]*?\*\//g, (c2) => c2.replace(/[^\n]/g, " ")).replace(/\/\/[^\n]*/g, "");
157136
157137
  }
157137
157138
  function duplicateModuleInstalls(...texts) {
157138
157139
  const calls = ["installLinkedModules", ...NATIVE_MODULES.flatMap((m2) => m2.ios ? [`${m2.ios.product}.install`] : [])];
@@ -157194,19 +157195,19 @@ function hostAppliesDeferredWidgetActions(app) {
157194
157195
  }
157195
157196
  return false;
157196
157197
  }
157197
- function countBeginMarkers(text11, kind, label3) {
157198
- return text11.split("\n").filter((l2) => isBegin(l2, kind, label3)).length;
157198
+ function countBeginMarkers(text12, kind, label3) {
157199
+ return text12.split("\n").filter((l2) => isBegin(l2, kind, label3)).length;
157199
157200
  }
157200
- function countEndMarkers(text11, kind, label3) {
157201
- return text11.split("\n").filter((l2) => isEnd(l2, kind, label3)).length;
157201
+ function countEndMarkers(text12, kind, label3) {
157202
+ return text12.split("\n").filter((l2) => isEnd(l2, kind, label3)).length;
157202
157203
  }
157203
- function hasMarkers(text11, kind, label3) {
157204
- const lines = text11.split("\n");
157204
+ function hasMarkers(text12, kind, label3) {
157205
+ const lines = text12.split("\n");
157205
157206
  return lines.some((l2) => isBegin(l2, kind, label3)) && lines.some((l2) => isEnd(l2, kind, label3));
157206
157207
  }
157207
- function assertSingleMarkerPair(text11, kind, label3, where = "the file") {
157208
- const opens = countBeginMarkers(text11, kind, label3);
157209
- const closes = countEndMarkers(text11, kind, label3);
157208
+ function assertSingleMarkerPair(text12, kind, label3, where = "the file") {
157209
+ const opens = countBeginMarkers(text12, kind, label3);
157210
+ const closes = countEndMarkers(text12, kind, label3);
157210
157211
  if (opens > 1 || closes > 1) {
157211
157212
  const which = opens > 1 ? `">>> ${label3}" opens ${opens} times` : `"<<< ${label3}" closes ${closes} times`;
157212
157213
  throw new Error(
@@ -157214,9 +157215,9 @@ function assertSingleMarkerPair(text11, kind, label3, where = "the file") {
157214
157215
  );
157215
157216
  }
157216
157217
  }
157217
- function injectBlock(text11, kind, label3, render, where = "the file") {
157218
- assertSingleMarkerPair(text11, kind, label3, where);
157219
- const lines = text11.split("\n");
157218
+ function injectBlock(text12, kind, label3, render, where = "the file") {
157219
+ assertSingleMarkerPair(text12, kind, label3, where);
157220
+ const lines = text12.split("\n");
157220
157221
  const beginIdx = lines.findIndex((l2) => isBegin(l2, kind, label3));
157221
157222
  const endIdx = lines.findIndex((l2) => isEnd(l2, kind, label3));
157222
157223
  if (beginIdx === -1 || endIdx === -1 || endIdx < beginIdx) {
@@ -157256,8 +157257,8 @@ function applyToFile(path2, kind, label3, render, check) {
157256
157257
  function assertModuleFlagsMarkers(paths2) {
157257
157258
  for (const path2 of paths2) {
157258
157259
  if (!existsSync56(path2)) continue;
157259
- const text11 = readFileSync65(path2, "utf8");
157260
- if (hasMarkers(text11, "yaml", LABEL_MODULES_IOS_LINK) && !hasMarkers(text11, "yaml", LABEL_MODULES_IOS_FLAGS)) {
157260
+ const text12 = readFileSync65(path2, "utf8");
157261
+ if (hasMarkers(text12, "yaml", LABEL_MODULES_IOS_LINK) && !hasMarkers(text12, "yaml", LABEL_MODULES_IOS_FLAGS)) {
157261
157262
  throw new Error(`${path2} links modules (${LABEL_MODULES_IOS_LINK}) but has no ${LABEL_MODULES_IOS_FLAGS} block under its project-level settings:, so no module would install. Add the markers (see apps/_template).`);
157262
157263
  }
157263
157264
  }
@@ -157493,8 +157494,8 @@ function genNativeConfig(app, opts = {}) {
157493
157494
  }
157494
157495
  }
157495
157496
  for (const swift of swiftFilesWithModuleMarkers(app)) {
157496
- const text11 = readFileSync65(swift, "utf8");
157497
- if (!hasMarkers(text11, "slash", LABEL_MODULES_SWIFT_IMPORT) || !hasMarkers(text11, "slash", LABEL_MODULES_SWIFT_INSTALL)) {
157497
+ const text12 = readFileSync65(swift, "utf8");
157498
+ if (!hasMarkers(text12, "slash", LABEL_MODULES_SWIFT_IMPORT) || !hasMarkers(text12, "slash", LABEL_MODULES_SWIFT_INSTALL)) {
157498
157499
  throw new Error(`${app}: ${swift} must carry both ${LABEL_MODULES_SWIFT_IMPORT} and ${LABEL_MODULES_SWIFT_INSTALL} markers`);
157499
157500
  }
157500
157501
  files.push(applyToFile(swift, "slash", LABEL_MODULES_SWIFT_IMPORT, renderModulesSwiftImport, check));
@@ -157503,8 +157504,8 @@ function genNativeConfig(app, opts = {}) {
157503
157504
  files.push(...genCapabilityRegistrations(appDir(app), ids, check));
157504
157505
  const rce = declaresRichContentEditor(configTs);
157505
157506
  for (const yml of [iosYml, macosProjectYml(app)]) {
157506
- const text11 = existsSync56(yml) ? readFileSync65(yml, "utf8") : "";
157507
- const r3 = applyToFile(yml, "yaml", LABEL_LOCALWEB, renderLocalWebYaml(resourcesDirOf(text11), rce), check);
157507
+ const text12 = existsSync56(yml) ? readFileSync65(yml, "utf8") : "";
157508
+ const r3 = applyToFile(yml, "yaml", LABEL_LOCALWEB, renderLocalWebYaml(resourcesDirOf(text12), rce), check);
157508
157509
  if (existsSync56(yml)) assertLocalWebBlockLanded(app, rce, yml, r3.outcome);
157509
157510
  files.push(r3);
157510
157511
  }
@@ -158518,8 +158519,8 @@ function renderBase44Types(entities, app) {
158518
158519
  for (const f2 of fields) body.push(` ${key2(f2.key)}${required3.has(f2.key) ? "" : "?"}: ${fieldType(f2)};`);
158519
158520
  body.push("};", `export const ${name} = entities<${name}Row>(${JSON.stringify(physicalEntityName(e2, app))});`);
158520
158521
  }
158521
- const text11 = body.join("\n");
158522
- const types = ["Json", "JsonObject"].filter((t2) => new RegExp(`\\b${t2}\\b`).test(text11)).map((t2) => `type ${t2}`);
158522
+ const text12 = body.join("\n");
158523
+ const types = ["Json", "JsonObject"].filter((t2) => new RegExp(`\\b${t2}\\b`).test(text12)).map((t2) => `type ${t2}`);
158523
158524
  if (usable.length) L2.push(`import { ${["entities", ...types].join(", ")} } from "@himalaya/base44";`);
158524
158525
  return [...L2, ...body].join("\n") + "\n";
158525
158526
  }
@@ -158531,14 +158532,14 @@ async function declaredEntities(dir) {
158531
158532
  async function writeBase44Types(dir, app) {
158532
158533
  const list2 = await declaredEntities(dir);
158533
158534
  if (!list2?.length) throw new Base44TypesError("no_base44_entities", "config.ts declares no base44.entities \u2014 nothing to type. Declare them (or run `himi base44 adopt`) first.");
158534
- const text11 = renderBase44Types(list2, app);
158535
+ const text12 = renderBase44Types(list2, app);
158535
158536
  const path2 = join57(dir, BASE44_TYPES_PATH);
158536
- const changed = !existsSync58(path2) || readFileSync67(path2, "utf8") !== text11;
158537
+ const changed = !existsSync58(path2) || readFileSync67(path2, "utf8") !== text12;
158537
158538
  if (changed) {
158538
158539
  mkdirSync26(dirname33(path2), { recursive: true });
158539
- writeFileSync22(path2, text11);
158540
+ writeFileSync22(path2, text12);
158540
158541
  }
158541
- return { path: path2, changed, entities: text11.split("\nexport const ").length - 1 };
158542
+ return { path: path2, changed, entities: text12.split("\nexport const ").length - 1 };
158542
158543
  }
158543
158544
  async function base44TypesIssues(dir, app, strict) {
158544
158545
  const path2 = join57(dir, BASE44_TYPES_PATH);
@@ -159505,8 +159506,8 @@ function isNoneEntry(entry) {
159505
159506
  const head = entryHead(entry);
159506
159507
  return NONE.test(entry) || head !== "" && NONE.test(head);
159507
159508
  }
159508
- function parseDataAccess(text11, from) {
159509
- const body = text11.replace(/<!--[\s\S]*?(?:-->|$)/g, "");
159509
+ function parseDataAccess(text12, from) {
159510
+ const body = text12.replace(/<!--[\s\S]*?(?:-->|$)/g, "");
159510
159511
  const heading = new RegExp(`(?:^|\\n)##[ \\t]+${DATA_ACCESS_HEADING}\\b[^\\n]*([\\s\\S]*?)(?=\\n##[ \\t]|$)`, "i").exec(body);
159511
159512
  if (!heading) return null;
159512
159513
  const lines = heading[1].split("\n").map((l2) => l2.trim()).filter((l2) => l2.startsWith("|"));
@@ -159533,13 +159534,13 @@ function readDataAccess(dir) {
159533
159534
  for (const name of ["SPEC.md", "MOBILE-UX.md"]) {
159534
159535
  const p2 = join63(dir, name);
159535
159536
  if (!existsSync63(p2)) continue;
159536
- let text11;
159537
+ let text12;
159537
159538
  try {
159538
- text11 = readFileSync72(p2, "utf8");
159539
+ text12 = readFileSync72(p2, "utf8");
159539
159540
  } catch {
159540
159541
  continue;
159541
159542
  }
159542
- const plan = parseDataAccess(text11, name);
159543
+ const plan = parseDataAccess(text12, name);
159543
159544
  if (plan) return plan;
159544
159545
  }
159545
159546
  return null;
@@ -159695,7 +159696,7 @@ function readTestConfig(dir) {
159695
159696
  if (input !== void 0 && (!input || typeof input !== "object" || Array.isArray(input) || Object.values(input).some((v2) => typeof v2 !== "string"))) {
159696
159697
  throw new Error(`${TEST_CONFIG_FILE}: journeys[${i2}].input must be an object of string values \u2014 the screen input a nav edge would send, e.g. { "id": "svc-0001" }`);
159697
159698
  }
159698
- if (!Array.isArray(journey.expectText) || !journey.expectText.length || journey.expectText.some((text11) => typeof text11 !== "string" || !text11.trim())) {
159699
+ if (!Array.isArray(journey.expectText) || !journey.expectText.length || journey.expectText.some((text12) => typeof text12 !== "string" || !text12.trim())) {
159699
159700
  throw new Error(`${TEST_CONFIG_FILE}: journeys[${i2}] needs non-empty expectText values that prove a visible result`);
159700
159701
  }
159701
159702
  });
@@ -161385,14 +161386,14 @@ import { join as join69 } from "node:path";
161385
161386
  function mobileUxIssues(dir, strict) {
161386
161387
  const file2 = join69(dir, "MOBILE-UX.md");
161387
161388
  if (!existsSync67(file2)) return [];
161388
- let text11;
161389
+ let text12;
161389
161390
  try {
161390
- text11 = readFileSync77(file2, "utf8");
161391
+ text12 = readFileSync77(file2, "utf8");
161391
161392
  } catch {
161392
161393
  return [];
161393
161394
  }
161394
- if (!text11) return [];
161395
- return mobileUxMarkerFindings(text11, recordedRenderWidths(dir)).map((finding2) => {
161395
+ if (!text12) return [];
161396
+ return mobileUxMarkerFindings(text12, recordedRenderWidths(dir)).map((finding2) => {
161396
161397
  const scaffoldAdvisory = finding2.code === "missing-width-evidence";
161397
161398
  return {
161398
161399
  screen: null,
@@ -163216,12 +163217,12 @@ async function runRemoteFunctionOperation(input) {
163216
163217
  if (input.boCookie) headers2.cookie = input.boCookie;
163217
163218
  if (input.previewToken) headers2["x-himalaya-preview-token"] = input.previewToken;
163218
163219
  const response = await (input.fetchImpl ?? fetch)(url, { method, headers: headers2 });
163219
- const text11 = await response.text();
163220
+ const text12 = await response.text();
163220
163221
  let body;
163221
163222
  try {
163222
- body = JSON.parse(text11);
163223
+ body = JSON.parse(text12);
163223
163224
  } catch {
163224
- body = text11;
163225
+ body = text12;
163225
163226
  }
163226
163227
  return { ok: response.ok, status: response.status, body };
163227
163228
  }
@@ -164325,18 +164326,18 @@ function walkSource(dir, root = dir) {
164325
164326
  const ext = entry.name.slice(entry.name.lastIndexOf("."));
164326
164327
  if (!SOURCE_EXTENSIONS.has(ext)) continue;
164327
164328
  const absolute = join77(dir, entry.name);
164328
- const text11 = readText2(absolute);
164329
- if (text11 !== null) found.push({ path: relative15(root, absolute), text: text11 });
164329
+ const text12 = readText2(absolute);
164330
+ if (text12 !== null) found.push({ path: relative15(root, absolute), text: text12 });
164330
164331
  }
164331
164332
  return found;
164332
164333
  }
164333
- function blankMatrixRows(text11) {
164334
- const acceptance = mobileUxSection(mobileUxDocumentBody(text11), "Implementation acceptance") ?? "";
164334
+ function blankMatrixRows(text12) {
164335
+ const acceptance = mobileUxSection(mobileUxDocumentBody(text12), "Implementation acceptance") ?? "";
164335
164336
  return /\|\s*(?:Ready|Empty|Add\s*\/\s*edit|Saved\s*\/\s*completed|Error\s*\/\s*recovery)\s*\|\s*\|\s*\|\s*\|\s*\|/i.test(acceptance);
164336
164337
  }
164337
164338
  function usesAppNetwork(source) {
164338
- const code = (text11) => text11.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\/\/[^\n]*/g, "");
164339
- return source.some(({ text: text11 }) => /\bwixApi\b|(?:from|import)\s*["']@(?:himalaya|wix\/himalaya)\/wix-[^"']+["']/.test(code(text11)));
164339
+ const code = (text12) => text12.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\/\/[^\n]*/g, "");
164340
+ return source.some(({ text: text12 }) => /\bwixApi\b|(?:from|import)\s*["']@(?:himalaya|wix\/himalaya)\/wix-[^"']+["']/.test(code(text12)));
164340
164341
  }
164341
164342
  function auditUx(content, strict = false) {
164342
164343
  const dir = resolve62(content);
@@ -168019,24 +168020,24 @@ async function readCapped(res, maxChars) {
168019
168020
  return null;
168020
168021
  }
168021
168022
  if (!res.body) {
168022
- const text12 = await res.text();
168023
- return text12.length > maxChars ? null : text12;
168023
+ const text13 = await res.text();
168024
+ return text13.length > maxChars ? null : text13;
168024
168025
  }
168025
168026
  const reader = res.body.getReader();
168026
168027
  const decoder = new TextDecoder();
168027
- let text11 = "";
168028
+ let text12 = "";
168028
168029
  for (; ; ) {
168029
168030
  const { done, value: value2 } = await reader.read();
168030
168031
  if (done) break;
168031
- text11 += decoder.decode(value2, { stream: true });
168032
- if (text11.length > maxChars) {
168032
+ text12 += decoder.decode(value2, { stream: true });
168033
+ if (text12.length > maxChars) {
168033
168034
  await reader.cancel().catch(() => {
168034
168035
  });
168035
168036
  return null;
168036
168037
  }
168037
168038
  }
168038
- text11 += decoder.decode();
168039
- return text11.length > maxChars ? null : text11;
168039
+ text12 += decoder.decode();
168040
+ return text12.length > maxChars ? null : text12;
168040
168041
  }
168041
168042
  async function memberForwardCall(match, body, memberToken, fetchImpl = fetch, extraHeaders = {}) {
168042
168043
  const headers2 = { Accept: "application/json", ...extraHeaders };
@@ -168051,9 +168052,9 @@ async function memberForwardCall(match, body, memberToken, fetchImpl = fetch, ex
168051
168052
  credentials: "omit",
168052
168053
  signal: AbortSignal.timeout(FORWARD_TIMEOUT_MS)
168053
168054
  });
168054
- const text11 = await readCapped(res, MAX_RESPONSE_CHARS);
168055
- if (text11 === null) return { ok: false, code: "forward_too_large" };
168056
- return { ok: true, status: res.status, body: text11 };
168055
+ const text12 = await readCapped(res, MAX_RESPONSE_CHARS);
168056
+ if (text12 === null) return { ok: false, code: "forward_too_large" };
168057
+ return { ok: true, status: res.status, body: text12 };
168057
168058
  } catch {
168058
168059
  return { ok: false, code: "forward_failed" };
168059
168060
  }
@@ -168276,10 +168277,10 @@ async function hostedAuthUrl(req, visitorToken, fetchImpl = fetch) {
168276
168277
  }
168277
168278
  })
168278
168279
  });
168279
- const text11 = await res.text();
168280
+ const text12 = await res.text();
168280
168281
  let parsed = {};
168281
168282
  try {
168282
- parsed = text11 ? JSON.parse(text11) : {};
168283
+ parsed = text12 ? JSON.parse(text12) : {};
168283
168284
  } catch {
168284
168285
  }
168285
168286
  const fullUrl = parsed.redirectSession?.fullUrl;
@@ -168299,10 +168300,10 @@ async function exchangeAuthCode(cfg, code, verifier, fetchImpl = fetch) {
168299
168300
  redirectUri: cfg.redirectUri
168300
168301
  })
168301
168302
  });
168302
- const text11 = await res.text();
168303
+ const text12 = await res.text();
168303
168304
  let parsed = {};
168304
168305
  try {
168305
- parsed = text11 ? JSON.parse(text11) : {};
168306
+ parsed = text12 ? JSON.parse(text12) : {};
168306
168307
  } catch {
168307
168308
  }
168308
168309
  if (res.status !== 200 || !parsed.access_token) throw new Error(`token exchange failed (${res.status})`);
@@ -169923,11 +169924,11 @@ async function localizeConfigResponse(res, kind, header) {
169923
169924
  header
169924
169925
  )
169925
169926
  };
169926
- const text11 = JSON.stringify(next);
169927
+ const text12 = JSON.stringify(next);
169927
169928
  const headers2 = new Headers(res.headers);
169928
169929
  headers2.delete("etag");
169929
- headers2.set("content-length", String(new TextEncoder().encode(text11).length));
169930
- return new Response(text11, { status: 200, headers: headers2 });
169930
+ headers2.set("content-length", String(new TextEncoder().encode(text12).length));
169931
+ return new Response(text12, { status: 200, headers: headers2 });
169931
169932
  }
169932
169933
  function makeRunHandler(opts) {
169933
169934
  const mount = opts.chrome === "app" ? "/app" : "/preview";
@@ -170136,8 +170137,8 @@ var init_node_adapter = __esm({
170136
170137
  function authConfigOf(appConfig) {
170137
170138
  if (!appConfig) return void 0;
170138
170139
  try {
170139
- const text11 = typeof appConfig === "string" ? appConfig : new TextDecoder().decode(appConfig);
170140
- return JSON.parse(text11)?.authConfig ?? void 0;
170140
+ const text12 = typeof appConfig === "string" ? appConfig : new TextDecoder().decode(appConfig);
170141
+ return JSON.parse(text12)?.authConfig ?? void 0;
170141
170142
  } catch {
170142
170143
  return void 0;
170143
170144
  }
@@ -170514,16 +170515,16 @@ async function releasePayloadFromDir(root, app, header) {
170514
170515
  const manifest2 = await store.getManifest(app);
170515
170516
  if (!manifest2) throw new Error(`no release manifest for ${app} under ${root}`);
170516
170517
  const b64 = (b2) => b2 ? Buffer.from(b2).toString("base64") : void 0;
170517
- const text11 = (b2) => b2 ? new TextDecoder().decode(b2) : void 0;
170518
+ const text12 = (b2) => b2 ? new TextDecoder().decode(b2) : void 0;
170518
170519
  const screens = {};
170519
170520
  const docs = {};
170520
170521
  const addDoc = async (hash2) => {
170521
170522
  if (!hash2 || docs[hash2] !== void 0) return;
170522
- const d2 = text11(await store.getDoc?.(app, hash2) ?? null);
170523
+ const d2 = text12(await store.getDoc?.(app, hash2) ?? null);
170523
170524
  if (d2 !== void 0) docs[hash2] = d2;
170524
170525
  };
170525
170526
  for (const [id, meta] of Object.entries(manifest2.screens ?? {})) {
170526
- const s2 = text11(await store.getScreen(app, id));
170527
+ const s2 = text12(await store.getScreen(app, id));
170527
170528
  if (s2 !== void 0) screens[id] = s2;
170528
170529
  await addDoc(meta.descriptorHash);
170529
170530
  }
@@ -170544,10 +170545,10 @@ async function releasePayloadFromDir(root, app, header) {
170544
170545
  }
170545
170546
  const widgets = {};
170546
170547
  for (const id of Object.keys(manifest2.widgets ?? {})) {
170547
- const w2 = text11(await store.getWidget?.(app, id) ?? null);
170548
+ const w2 = text12(await store.getWidget?.(app, id) ?? null);
170548
170549
  if (w2 !== void 0) widgets[id] = w2;
170549
170550
  }
170550
- const appConfig = text11(await store.getAppConfig(app));
170551
+ const appConfig = text12(await store.getAppConfig(app));
170551
170552
  const wixClientId = appConfigWixClientId(appConfig);
170552
170553
  return {
170553
170554
  app,
@@ -170557,7 +170558,7 @@ async function releasePayloadFromDir(root, app, header) {
170557
170558
  docs,
170558
170559
  assets,
170559
170560
  widgets,
170560
- tokens: text11(await store.getTokens(app)),
170561
+ tokens: text12(await store.getTokens(app)),
170561
170562
  appConfig,
170562
170563
  icon: b64(await store.getIcon?.(app) ?? null),
170563
170564
  header,
@@ -170778,6 +170779,164 @@ var init_store_iap_purchases = __esm({
170778
170779
  }
170779
170780
  });
170780
170781
 
170782
+ // src/apple-keys.ts
170783
+ var apple_keys_exports = {};
170784
+ __export(apple_keys_exports, {
170785
+ runAppleKeys: () => runAppleKeys
170786
+ });
170787
+ import { createPublicKey as createPublicKey2 } from "node:crypto";
170788
+ import { readFileSync as readFileSync102, realpathSync as realpathSync13, statSync as statSync25 } from "node:fs";
170789
+ function readKey(flags, kind) {
170790
+ const names2 = kind === "asc" ? ["asc-key-file", "asc-key-id", "asc-issuer-id"] : ["iap-key", "iap-key-id", "iap-issuer-id"];
170791
+ if (names2.every((name) => flags[name] === void 0)) return void 0;
170792
+ const [file2, keyId, issuerId] = names2.map((name) => text8(flags[name]));
170793
+ if (!file2 || !keyId || !issuerId) throw new UsageError(`Supply --${names2.join(" --")} together.`);
170794
+ try {
170795
+ const path2 = realpathSync13(file2);
170796
+ assertCredentialOutsideRepo(names2[0], path2);
170797
+ if (statSync25(path2).size > 16384) throw new Error("oversized");
170798
+ const key3 = { keyId, issuerId, key: readFileSync102(path2, "utf8") };
170799
+ if (!isAppStoreConnectKey(key3)) throw new Error("invalid key");
170800
+ return key3;
170801
+ } catch {
170802
+ throw new UsageError(`Invalid ${kind.toUpperCase()} key: use a P-256 PKCS#8 .p8 file outside the repository, a 10-character key ID, and a UUID issuer ID.`);
170803
+ }
170804
+ }
170805
+ function publicKeyBytes(key3) {
170806
+ return createPublicKey2(key3).export({ type: "spki", format: "der" });
170807
+ }
170808
+ async function ascRequest(session, input, fetchImpl) {
170809
+ if (credentialHostRefusal(session.target.control)) throw new Error("insecure target");
170810
+ const base = session.target.control.replace(/\/$/, "");
170811
+ const query = new URLSearchParams({ app: input.app, site: input.site });
170812
+ const response = await fetchImpl(`${base}/v1/admin/store/asc-key${input.key ? "" : `?${query}`}`, {
170813
+ method: input.key ? "POST" : "GET",
170814
+ redirect: "error",
170815
+ signal: AbortSignal.timeout(6e4),
170816
+ headers: {
170817
+ Authorization: session.wixToken,
170818
+ "x-control-token": session.controlToken,
170819
+ ...session.previewTag ? { "x-wix-route-serve": session.previewTag } : {},
170820
+ ...input.key ? { "content-type": "application/json" } : {}
170821
+ },
170822
+ ...input.key ? { body: JSON.stringify({ app: input.app, site: input.site, appStoreConnect: input.key }) } : {}
170823
+ });
170824
+ if (!response.ok) throw new Error("ASC request failed");
170825
+ const body = await response.json();
170826
+ if (body.ok !== true || typeof body.asc?.present !== "boolean") throw new Error("invalid status");
170827
+ return {
170828
+ present: body.asc.present,
170829
+ ...typeof body.asc.keyId === "string" ? { keyId: body.asc.keyId } : {},
170830
+ ...typeof body.asc.issuerId === "string" ? { issuerId: body.asc.issuerId } : {}
170831
+ };
170832
+ }
170833
+ async function runAppleKeys(pos, flags, io2, deps = {}) {
170834
+ const completed = [];
170835
+ try {
170836
+ const operation = pos[2];
170837
+ if (operation !== "setup" && operation !== "status") throw new UsageError("Use himi store apple-keys setup|status.");
170838
+ const app = text8(flags.app), site = text8(flags.site)?.toLowerCase(), bundleId = text8(flags["bundle-id"]);
170839
+ if (!app || !site || !bundleId) throw new UsageError("Supply --app <slug> --site <metaSiteId> --bundle-id <id>.");
170840
+ if (!isValidAppId(app) || !/^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i.test(site) || !/^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)+$/.test(bundleId)) throw new UsageError("Invalid app, site or bundle ID.");
170841
+ for (const name of ["yes", "dry-run", "json"]) if (flags[name] !== void 0 && typeof flags[name] !== "boolean") throw new UsageError(`--${name} is a boolean flag.`);
170842
+ const setup = operation === "setup", dryRun = flags["dry-run"] === true;
170843
+ if (setup && !dryRun && flags.yes !== true) throw new UsageError("Key setup writes to Wix; pass --yes or preview with --dry-run.");
170844
+ const owner = await (deps.session ?? hostedOwnerSession)(flags);
170845
+ if (!owner.ok) {
170846
+ io2.error(JSON.stringify({ ok: false, code: "owner_session_unavailable", error: owner.error, ...owner.hint ? { hint: owner.hint } : {} }));
170847
+ return owner.exit;
170848
+ }
170849
+ const ascKey = setup ? readKey(flags, "asc") : void 0;
170850
+ const iapKey = setup ? readKey(flags, "iap") : void 0;
170851
+ if (setup && !ascKey && !iapKey) throw new UsageError("Supply an ASC key, an In-App Purchase key, or both. Each needs its own key ID and issuer ID.");
170852
+ if (!setup && Object.keys(flags).some((name) => /^(asc|iap)-(key|issuer)/.test(name))) throw new UsageError("Upload keys with setup, not status.");
170853
+ if (ascKey && iapKey && publicKeyBytes(ascKey.key).equals(publicKeyBytes(iapKey.key))) throw new UsageError("ASC and In-App Purchase require separate keys.");
170854
+ let asc = { present: null, state: "not_checked" };
170855
+ let iap = { present: null, state: "not_checked" };
170856
+ let failed3 = false;
170857
+ if (ascKey || !setup) {
170858
+ try {
170859
+ asc = await ascRequest(owner.session, { app, site, ...ascKey && !dryRun ? { key: ascKey } : {} }, deps.fetchImpl ?? fetch);
170860
+ if (ascKey && !dryRun) {
170861
+ completed.push("asc");
170862
+ if (!asc.present || asc.keyId !== ascKey.keyId || asc.issuerId !== ascKey.issuerId) throw new Error("ASC key not confirmed");
170863
+ }
170864
+ } catch {
170865
+ asc = { present: null, state: "unavailable" };
170866
+ failed3 = true;
170867
+ }
170868
+ }
170869
+ let purchasesAppId = null;
170870
+ if (iapKey || !setup) {
170871
+ try {
170872
+ const api2 = createPurchasesOwnerApi((deps.purchases ?? ((id) => ownerTransport(id, (url, init) => (deps.fetchImpl ?? fetch)(url, { ...init, redirect: "error" }), void 0, userSiteToken)))(site));
170873
+ let purchasesApp = (await api2.listApps()).find((candidate) => candidate.bundleId === bundleId);
170874
+ if (iapKey && !dryRun) {
170875
+ if (!purchasesApp) {
170876
+ try {
170877
+ purchasesApp = await api2.registerApp({ name: text8(flags["display-name"]) ?? app, bundleId });
170878
+ completed.push("purchases_app");
170879
+ } catch (error) {
170880
+ if (refusalCode(error) !== "ALREADY_EXISTS") throw error;
170881
+ purchasesApp = (await api2.listApps()).find((candidate) => candidate.bundleId === bundleId);
170882
+ if (!purchasesApp) throw error;
170883
+ }
170884
+ }
170885
+ purchasesAppId = purchasesApp.id;
170886
+ await api2.setAppleCredentials(purchasesApp.id, { keyId: iapKey.keyId, issuerId: iapKey.issuerId, privateKey: iapKey.key });
170887
+ completed.push("iap");
170888
+ purchasesApp = (await api2.listApps()).find((candidate) => candidate.bundleId === bundleId);
170889
+ if (!purchasesApp?.privateKeyStored) throw new Error("IAP key not confirmed");
170890
+ }
170891
+ iap = { present: purchasesApp?.privateKeyStored === true };
170892
+ purchasesAppId = purchasesApp?.id ?? null;
170893
+ } catch {
170894
+ iap = { present: null, state: "unavailable" };
170895
+ failed3 = true;
170896
+ }
170897
+ }
170898
+ const result = {
170899
+ ok: !failed3,
170900
+ app,
170901
+ site,
170902
+ bundleId,
170903
+ asc,
170904
+ iap,
170905
+ ready: asc.present === true && iap.present === true,
170906
+ purchasesAppId,
170907
+ ...failed3 ? { code: "apple_keys_failed", hint: "Read apple-keys status before retrying; completed writes remain stored." } : {},
170908
+ ...dryRun ? { dryRun: true, planned: [...ascKey ? ["asc"] : [], ...iapKey ? ["iap"] : []] } : {},
170909
+ completed
170910
+ };
170911
+ (failed3 ? io2.error : io2.log)(JSON.stringify(result));
170912
+ return failed3 ? 1 : 0;
170913
+ } catch (error) {
170914
+ const usage = error instanceof UsageError;
170915
+ io2.error(JSON.stringify({
170916
+ ok: false,
170917
+ code: usage ? "invalid_usage" : "apple_keys_failed",
170918
+ completed,
170919
+ ...usage ? { error: error.message } : { hint: "Read apple-keys status before retrying; completed writes remain stored. Check Wix login, site ownership and service availability." }
170920
+ }));
170921
+ return usage ? 2 : 1;
170922
+ }
170923
+ }
170924
+ var text8, UsageError;
170925
+ var init_apple_keys = __esm({
170926
+ "src/apple-keys.ts"() {
170927
+ init_hosted_owner();
170928
+ init_store_iap_purchases();
170929
+ init_wix_owner();
170930
+ init_preflight();
170931
+ init_push_setup_apple_credentials();
170932
+ init_contract();
170933
+ init_credential_hosts();
170934
+ text8 = (value2) => typeof value2 === "string" && value2.trim() ? value2.trim() : void 0;
170935
+ UsageError = class extends Error {
170936
+ };
170937
+ }
170938
+ });
170939
+
170781
170940
  // src/iap-catalog-client.ts
170782
170941
  function createIapCatalogClient(call, route) {
170783
170942
  if (!/^\/(?!\/)[^\s?#]+$/.test(route.prefix)) throw new IapCatalogError("catalog_route_unavailable", "IAP Catalog requires an explicit gateway path");
@@ -171067,7 +171226,7 @@ var init_embedded_bundles = __esm({
171067
171226
  });
171068
171227
 
171069
171228
  // ../store-release/register-bundle.ts
171070
- import { readFileSync as readFileSync102 } from "node:fs";
171229
+ import { readFileSync as readFileSync103 } from "node:fs";
171071
171230
  import { createPrivateKey as createPrivateKey4, sign as sign2 } from "node:crypto";
171072
171231
  function b64url3(b2) {
171073
171232
  return Buffer.from(b2).toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
@@ -171085,7 +171244,7 @@ function bundleIdBody(identifier, name, platform = "IOS") {
171085
171244
  async function registerBundleId(opts) {
171086
171245
  const env = requireEnv(["ASC_KEY_ID", "ASC_ISSUER_ID", "ASC_KEY_PATH"]);
171087
171246
  assertCredentialOutsideRepo("ASC_KEY_PATH", env.ASC_KEY_PATH);
171088
- const jwt = ascJwt(env.ASC_KEY_ID, env.ASC_ISSUER_ID, readFileSync102(env.ASC_KEY_PATH, "utf8"), Math.floor(Date.now() / 1e3));
171247
+ const jwt = ascJwt(env.ASC_KEY_ID, env.ASC_ISSUER_ID, readFileSync103(env.ASC_KEY_PATH, "utf8"), Math.floor(Date.now() / 1e3));
171089
171248
  const res = await fetch(`${ASC_API}/v1/bundleIds`, {
171090
171249
  method: "POST",
171091
171250
  headers: { Authorization: `Bearer ${jwt}`, "Content-Type": "application/json" },
@@ -171095,11 +171254,11 @@ async function registerBundleId(opts) {
171095
171254
  const j2 = await res.json();
171096
171255
  return { status: "created", id: j2.data?.id };
171097
171256
  }
171098
- const text11 = await res.text();
171099
- if (res.status === 409 || /already (exists|in use)|duplicate|ENTITY_ERROR.*identifier/i.test(text11)) {
171257
+ const text12 = await res.text();
171258
+ if (res.status === 409 || /already (exists|in use)|duplicate|ENTITY_ERROR.*identifier/i.test(text12)) {
171100
171259
  return { status: "exists" };
171101
171260
  }
171102
- throw new Error(`POST /v1/bundleIds \u2192 ${res.status}: ${text11.slice(0, 300)}`);
171261
+ throw new Error(`POST /v1/bundleIds \u2192 ${res.status}: ${text12.slice(0, 300)}`);
171103
171262
  }
171104
171263
  async function main() {
171105
171264
  const [app, ...rest] = process.argv.slice(2);
@@ -171115,7 +171274,7 @@ async function main() {
171115
171274
  }
171116
171275
  const ni2 = rest.indexOf("--name");
171117
171276
  const name = ni2 >= 0 ? rest[ni2 + 1] : cfg.app ?? app;
171118
- const yml = readFileSync102(iosProjectYml(app), "utf8");
171277
+ const yml = readFileSync103(iosProjectYml(app), "utf8");
171119
171278
  for (const { id, label: label3 } of [{ id: identifier, label: name }, ...embeddedBundles(yml).map((b2) => ({
171120
171279
  id: embeddedBundleId(identifier, b2),
171121
171280
  label: `${name} ${embeddedAppIdLabel(b2)}`
@@ -171352,9 +171511,9 @@ var init_iap_client = __esm({
171352
171511
  retryAfterMs(response.headers.get("retry-after"), this.now())
171353
171512
  );
171354
171513
  }
171355
- scrub(text11) {
171514
+ scrub(text12) {
171356
171515
  const { keyId, issuerId, privateKeyPem } = this.options.key;
171357
- let out2 = text11;
171516
+ let out2 = text12;
171358
171517
  for (const literal of [this.token?.value, privateKeyPem, issuerId, keyId]) {
171359
171518
  if (literal) out2 = out2.split(literal).join("[redacted]");
171360
171519
  }
@@ -171524,19 +171683,19 @@ var init_iap_api = __esm({
171524
171683
  });
171525
171684
  return toVersion(requireSingle(doc, "in-app purchase version"));
171526
171685
  }
171527
- async createLocalization(versionId, text11) {
171686
+ async createLocalization(versionId, text12) {
171528
171687
  const doc = await this.client.post("/v2/inAppPurchaseLocalizations", {
171529
171688
  data: {
171530
171689
  type: "inAppPurchaseLocalizations",
171531
- attributes: { locale: text11.locale, name: text11.name, description: text11.description },
171690
+ attributes: { locale: text12.locale, name: text12.name, description: text12.description },
171532
171691
  relationships: { version: related("inAppPurchaseVersions", versionId) }
171533
171692
  }
171534
171693
  });
171535
171694
  return toLocalization(requireSingle(doc, "localization"));
171536
171695
  }
171537
- async updateLocalization(localizationId, text11) {
171696
+ async updateLocalization(localizationId, text12) {
171538
171697
  const doc = await this.client.patch(`/v2/inAppPurchaseLocalizations/${enc(localizationId)}`, {
171539
- data: { type: "inAppPurchaseLocalizations", id: localizationId, attributes: { name: text11.name, description: text11.description } }
171698
+ data: { type: "inAppPurchaseLocalizations", id: localizationId, attributes: { name: text12.name, description: text12.description } }
171540
171699
  });
171541
171700
  return toLocalization(requireSingle(doc, "localization"));
171542
171701
  }
@@ -171769,9 +171928,9 @@ function createCatalogIapApi(client2, appId2) {
171769
171928
  const checkedApp = async (appleAppId) => {
171770
171929
  const reply = await client2.readAppleApp(appId2);
171771
171930
  if (reply.appleAppId !== appleAppId || reply.resource.id !== appleAppId) throw new Error("Catalog's verified Apple app differs from the manifest");
171772
- return { id: reply.resource.id, bundleId: text8(reply.resource, "bundleId") };
171931
+ return { id: reply.resource.id, bundleId: text9(reply.resource, "bundleId") };
171773
171932
  };
171774
- const points = async (id, territory) => (await client2.listResources(appId2, "PRICE_POINT", { inAppPurchaseId: id, territory })).resources.map((point) => ({ id: point.id, customerPrice: text8(point, "customerPrice") }));
171933
+ const points = async (id, territory) => (await client2.listResources(appId2, "PRICE_POINT", { inAppPurchaseId: id, territory })).resources.map((point) => ({ id: point.id, customerPrice: text9(point, "customerPrice") }));
171775
171934
  const desired = (item) => ({ localizations: item.localizations, price: selection(item.price), territories: item.territories });
171776
171935
  const mapping = async (item) => {
171777
171936
  const rule = item.wix && !item.unlocks?.length ? APPLE_PROVISIONING_RULES[item.wix.entityType] : void 0;
@@ -171850,7 +172009,7 @@ function createCatalogIapApi(client2, appId2) {
171850
172009
  },
171851
172010
  readApp: checkedApp,
171852
172011
  findBundles: async () => missing2("bundle-verification (performed on the server)"),
171853
- listTerritories: async () => (await client2.listResources(appId2, "TERRITORY")).resources.map((r3) => ({ id: r3.id, currency: text8(r3, "currency") })),
172012
+ listTerritories: async () => (await client2.listResources(appId2, "TERRITORY")).resources.map((r3) => ({ id: r3.id, currency: text9(r3, "currency") })),
171854
172013
  listProducts: async (appleAppId) => {
171855
172014
  const reply = await client2.listInAppPurchases(appId2);
171856
172015
  if (reply.appleAppId !== appleAppId) throw new Error("Catalog returned products for another Apple app");
@@ -171908,17 +172067,17 @@ function createCatalogIapApi(client2, appId2) {
171908
172067
  deleteReviewScreenshot: async () => missing2("review-screenshot/delete")
171909
172068
  };
171910
172069
  }
171911
- var text8, product, version3, localization;
172070
+ var text9, product, version3, localization;
171912
172071
  var init_iap_catalog_api = __esm({
171913
172072
  "../store-release/iap-catalog-api.ts"() {
171914
172073
  init_wix_payments_contract();
171915
172074
  init_iap_catalog_client();
171916
172075
  init_store_iap_purchases();
171917
172076
  init_iap_api();
171918
- text8 = (resource, key3) => typeof resource.attributes[key3] === "string" ? resource.attributes[key3] : "";
171919
- product = (resource) => ({ id: resource.id, productId: text8(resource, "productId"), referenceName: text8(resource, "name"), type: text8(resource, "inAppPurchaseType"), state: text8(resource, "state") });
171920
- version3 = (resource) => ({ id: resource.id, state: text8(resource, "state"), ...typeof resource.attributes.version === "number" ? { version: resource.attributes.version } : {} });
171921
- localization = (resource) => ({ id: resource.id, locale: text8(resource, "locale"), name: text8(resource, "name"), description: text8(resource, "description") });
172077
+ text9 = (resource, key3) => typeof resource.attributes[key3] === "string" ? resource.attributes[key3] : "";
172078
+ product = (resource) => ({ id: resource.id, productId: text9(resource, "productId"), referenceName: text9(resource, "name"), type: text9(resource, "inAppPurchaseType"), state: text9(resource, "state") });
172079
+ version3 = (resource) => ({ id: resource.id, state: text9(resource, "state"), ...typeof resource.attributes.version === "number" ? { version: resource.attributes.version } : {} });
172080
+ localization = (resource) => ({ id: resource.id, locale: text9(resource, "locale"), name: text9(resource, "name"), description: text9(resource, "description") });
171922
172081
  }
171923
172082
  });
171924
172083
 
@@ -172026,8 +172185,8 @@ function reportDuplicateMappings(reader, items) {
172026
172185
  reader.duplicates(items.flatMap((i2) => [i2.entitlement, ...(i2.unlocks ?? []).map((u2) => u2.entitlement)]), "items", "entitlement");
172027
172186
  reader.duplicates(items.map((i2) => i2.referenceName), "items", "referenceName");
172028
172187
  }
172029
- function looksLikeCredential(text11) {
172030
- return CREDENTIAL_SHAPES.some((shape) => shape.test(text11));
172188
+ function looksLikeCredential(text12) {
172189
+ return CREDENTIAL_SHAPES.some((shape) => shape.test(text12));
172031
172190
  }
172032
172191
  function reportCredentialMaterial(reader, value2, path2) {
172033
172192
  if (typeof value2 === "string") {
@@ -172040,15 +172199,15 @@ function reportCredentialMaterial(reader, value2, path2) {
172040
172199
  for (const [key3, v2] of Object.entries(value2)) reportCredentialMaterial(reader, v2, childPath(path2, key3));
172041
172200
  }
172042
172201
  }
172043
- function parseJson3(text11, label3) {
172202
+ function parseJson3(text12, label3) {
172044
172203
  try {
172045
- return JSON.parse(text11);
172204
+ return JSON.parse(text12);
172046
172205
  } catch (e2) {
172047
172206
  throw new Error(`${label3} is not valid JSON: ${e2.message}`);
172048
172207
  }
172049
172208
  }
172050
- function parseIapManifest(text11, label3) {
172051
- const doc = parseJson3(text11, label3);
172209
+ function parseIapManifest(text12, label3) {
172210
+ const doc = parseJson3(text12, label3);
172052
172211
  const reader = new ManifestReader();
172053
172212
  const obj7 = reader.object(doc, "", MANIFEST_KEYS);
172054
172213
  if (obj7.manifestVersion !== 1) reader.problems.push("manifestVersion must be 1");
@@ -172996,9 +173155,9 @@ async function ensure(spec, sleep) {
172996
173155
  }
172997
173156
  }
172998
173157
  function textFor(item, locale) {
172999
- const text11 = item.localizations.find((l2) => l2.locale === locale);
173000
- if (!text11) throw new Error(`no ${locale} localization in the manifest for ${item.productId}`);
173001
- return text11;
173158
+ const text12 = item.localizations.find((l2) => l2.locale === locale);
173159
+ if (!text12) throw new Error(`no ${locale} localization in the manifest for ${item.productId}`);
173160
+ return text12;
173002
173161
  }
173003
173162
  async function findProduct(api2, appId2, productId) {
173004
173163
  return (await api2.listProducts(appId2)).find((p2) => p2.productId === productId);
@@ -173057,14 +173216,14 @@ async function deleteLeftoverScreenshot(context, resourceId) {
173057
173216
  }
173058
173217
  async function upsertManagedLocalization(run2, locale, context) {
173059
173218
  const resourceId = required(run2.resourceId, "the product id");
173060
- const text11 = textFor(run2.item, locale);
173219
+ const text12 = textFor(run2.item, locale);
173061
173220
  const { api: api2, sleep } = context;
173062
173221
  const find2 = async () => {
173063
173222
  const version5 = await findDraft(api2, resourceId);
173064
- const localization2 = version5 && await findLocalization(api2, version5.id, locale, text11);
173223
+ const localization2 = version5 && await findLocalization(api2, version5.id, locale, text12);
173065
173224
  return version5 && localization2 ? { version: version5, localization: localization2, outcome: "ALREADY_APPLIED" } : void 0;
173066
173225
  };
173067
- const { value: value2, state } = await ensure({ write: () => api2.managed.upsertLocalization(resourceId, text11), find: find2 }, sleep);
173226
+ const { value: value2, state } = await ensure({ write: () => api2.managed.upsertLocalization(resourceId, text12), find: find2 }, sleep);
173068
173227
  run2.versionId = value2.version.id;
173069
173228
  return { state: value2.outcome === "ALREADY_APPLIED" ? "reconciled" : state, resourceId: value2.localization.id };
173070
173229
  }
@@ -173089,16 +173248,16 @@ function operationRunners(context, manifest2) {
173089
173248
  createLocalization: async (run2, op) => {
173090
173249
  if (api2.managed) return upsertManagedLocalization(run2, op.locale, context);
173091
173250
  const versionId = required(run2.versionId, "the draft version");
173092
- const text11 = textFor(run2.item, op.locale);
173093
- const { value: value2, state } = await ensure({ write: () => api2.createLocalization(versionId, text11), find: () => findLocalization(api2, versionId, text11.locale) }, sleep);
173251
+ const text12 = textFor(run2.item, op.locale);
173252
+ const { value: value2, state } = await ensure({ write: () => api2.createLocalization(versionId, text12), find: () => findLocalization(api2, versionId, text12.locale) }, sleep);
173094
173253
  return { state, resourceId: value2.id };
173095
173254
  },
173096
173255
  updateLocalization: async (run2, op) => {
173097
173256
  if (api2.managed) return upsertManagedLocalization(run2, op.locale, context);
173098
173257
  const versionId = required(run2.versionId, "the draft version");
173099
- const text11 = textFor(run2.item, op.locale);
173100
- const localizationId = required(run2.localizations.find((l2) => l2.locale === text11.locale)?.id, `the ${text11.locale} localization`);
173101
- const { value: value2, state } = await ensure({ write: () => api2.updateLocalization(localizationId, text11), find: () => findLocalization(api2, versionId, text11.locale, text11) }, sleep);
173258
+ const text12 = textFor(run2.item, op.locale);
173259
+ const localizationId = required(run2.localizations.find((l2) => l2.locale === text12.locale)?.id, `the ${text12.locale} localization`);
173260
+ const { value: value2, state } = await ensure({ write: () => api2.updateLocalization(localizationId, text12), find: () => findLocalization(api2, versionId, text12.locale, text12) }, sleep);
173102
173261
  return { state, resourceId: value2.id };
173103
173262
  },
173104
173263
  setPrice: async (run2) => {
@@ -173351,7 +173510,7 @@ __export(credential_profile_exports, {
173351
173510
  profilePath: () => profilePath,
173352
173511
  resolveStoreCredentials: () => resolveStoreCredentials
173353
173512
  });
173354
- import { existsSync as existsSync90, readFileSync as readFileSync103 } from "node:fs";
173513
+ import { existsSync as existsSync90, readFileSync as readFileSync104 } from "node:fs";
173355
173514
  import { homedir as homedir11 } from "node:os";
173356
173515
  import { join as join95 } from "node:path";
173357
173516
  function credentialsDir(home = homedir11()) {
@@ -173365,10 +173524,10 @@ function profilePath(name, home = homedir11()) {
173365
173524
  }
173366
173525
  return join95(credentialsDir(home), `${name}.json`);
173367
173526
  }
173368
- function parseProfile(text11, label3) {
173527
+ function parseProfile(text12, label3) {
173369
173528
  let doc;
173370
173529
  try {
173371
- doc = JSON.parse(text11);
173530
+ doc = JSON.parse(text12);
173372
173531
  } catch (e2) {
173373
173532
  throw new Error(`${label3} is not valid JSON: ${e2.message}`);
173374
173533
  }
@@ -173394,7 +173553,7 @@ function resolveStoreCredentials(opts) {
173394
173553
  const { app, cfg } = opts;
173395
173554
  const env = opts.env ?? process.env;
173396
173555
  const home = opts.home ?? homedir11();
173397
- const read = opts.readProfile ?? ((p2) => readFileSync103(p2, "utf8"));
173556
+ const read = opts.readProfile ?? ((p2) => readFileSync104(p2, "utf8"));
173398
173557
  const exists = opts.profileExists ?? existsSync90;
173399
173558
  const ios = cfg.ios ?? {};
173400
173559
  const flagName = opts.profileFlag?.trim();
@@ -173461,7 +173620,7 @@ var init_credential_profile = __esm({
173461
173620
 
173462
173621
  // ../store-release/iap-credentials.ts
173463
173622
  import { createHash as createHash45 } from "node:crypto";
173464
- import { existsSync as existsSync91, readFileSync as readFileSync104, realpathSync as realpathSync13 } from "node:fs";
173623
+ import { existsSync as existsSync91, readFileSync as readFileSync105, realpathSync as realpathSync14 } from "node:fs";
173465
173624
  import { homedir as homedir12 } from "node:os";
173466
173625
  function accountFingerprint(keyId, issuerId) {
173467
173626
  return `sha256:${createHash45("sha256").update(`${issuerId}:${keyId}`).digest("hex").slice(0, 16)}`;
@@ -173481,7 +173640,7 @@ function requireExplicitProfile(profileFlag, target) {
173481
173640
  }
173482
173641
  return profile;
173483
173642
  }
173484
- function readKey(path2, profile, readFile3) {
173643
+ function readKey2(path2, profile, readFile3) {
173485
173644
  try {
173486
173645
  return readFile3(path2);
173487
173646
  } catch {
@@ -173498,8 +173657,8 @@ function canonicalKeyPath(path2, profile, realpath) {
173498
173657
  function resolveIapCredentials(options) {
173499
173658
  const { target } = options;
173500
173659
  const home = options.home ?? homedir12();
173501
- const readFile3 = options.readFile ?? ((p2) => readFileSync104(p2, "utf8"));
173502
- const realpath = options.realpath ?? realpathSync13;
173660
+ const readFile3 = options.readFile ?? ((p2) => readFileSync105(p2, "utf8"));
173661
+ const realpath = options.realpath ?? realpathSync14;
173503
173662
  const profile = requireExplicitProfile(options.profileFlag, target);
173504
173663
  const creds = resolveStoreCredentials({
173505
173664
  app: target.himiApp,
@@ -173516,7 +173675,7 @@ function resolveIapCredentials(options) {
173516
173675
  throw new Error(`credential profile "${profile}" is for team "${creds.team}" but the manifest targets team "${target.teamId}".`);
173517
173676
  }
173518
173677
  return {
173519
- key: { keyId: creds.ascKeyId, issuerId: creds.ascIssuerId, privateKeyPem: readKey(creds.ascKeyPath, profile, readFile3) },
173678
+ key: { keyId: creds.ascKeyId, issuerId: creds.ascIssuerId, privateKeyPem: readKey2(creds.ascKeyPath, profile, readFile3) },
173520
173679
  team: creds.team,
173521
173680
  profile,
173522
173681
  fingerprint: accountFingerprint(creds.ascKeyId, creds.ascIssuerId)
@@ -173536,9 +173695,9 @@ var init_iap_credentials = __esm({
173536
173695
 
173537
173696
  // ../store-release/iap-draft.ts
173538
173697
  import { createHash as createHash46 } from "node:crypto";
173539
- function fit(text11, max) {
173540
- const chars = [...text11];
173541
- return chars.length <= max ? text11 : `${chars.slice(0, max - 1).join("").trimEnd()}${ELLIPSIS}`;
173698
+ function fit(text12, max) {
173699
+ const chars = [...text12];
173700
+ return chars.length <= max ? text12 : `${chars.slice(0, max - 1).join("").trimEnd()}${ELLIPSIS}`;
173542
173701
  }
173543
173702
  function plainText2(html) {
173544
173703
  return html.replace(/<[^>]*>/g, " ").replace(/&(amp|nbsp|lt|gt|quot|#39);/g, (entity) => ENTITIES[entity]).replace(/\s+/g, " ").trim();
@@ -173688,7 +173847,7 @@ var init_iap_draft = __esm({
173688
173847
  TIER_DESCRIPTION = "Unlocks one item in the app";
173689
173848
  ELLIPSIS = "\u2026";
173690
173849
  entityKey = (entityType, entityId) => `${entityType}:${entityId}`;
173691
- sha2 = (text11) => createHash46("sha256").update(text11).digest("hex");
173850
+ sha2 = (text12) => createHash46("sha256").update(text12).digest("hex");
173692
173851
  ENTITIES = { "&amp;": "&", "&nbsp;": " ", "&lt;": "<", "&gt;": ">", "&quot;": '"', "&#39;": "'" };
173693
173852
  MAX_SUFFIX = 24;
173694
173853
  ReferenceNames = class {
@@ -173826,7 +173985,7 @@ __export(version_exports, {
173826
173985
  stampTargetVersion: () => stampTargetVersion,
173827
173986
  stampVersionKeys: () => stampVersionKeys
173828
173987
  });
173829
- import { readFileSync as readFileSync105, writeFileSync as writeFileSync35 } from "node:fs";
173988
+ import { readFileSync as readFileSync106, writeFileSync as writeFileSync35 } from "node:fs";
173830
173989
  function readIosVersion(projectYml) {
173831
173990
  const marketing = matchScalar(projectYml, "CFBundleShortVersionString");
173832
173991
  const build3 = matchScalar(projectYml, "CFBundleVersion");
@@ -173973,8 +174132,8 @@ function setAndroidVersion(gradle, v2) {
173973
174132
  function bumpVersion(app, opts) {
173974
174133
  const iosPath = iosProjectYml(app);
173975
174134
  const gradlePath = androidGradle(app);
173976
- const iosYml = readFileSync105(iosPath, "utf8");
173977
- const gradle = readFileSync105(gradlePath, "utf8");
174135
+ const iosYml = readFileSync106(iosPath, "utf8");
174136
+ const gradle = readFileSync106(gradlePath, "utf8");
173978
174137
  const current = readIosVersion(iosYml);
173979
174138
  const next = {
173980
174139
  marketing: opts.marketing ?? current.marketing,
@@ -174013,7 +174172,7 @@ var init_store_spec = __esm({
174013
174172
  });
174014
174173
 
174015
174174
  // src/iap-config-edit.ts
174016
- import { existsSync as existsSync92, readFileSync as readFileSync106 } from "node:fs";
174175
+ import { existsSync as existsSync92, readFileSync as readFileSync107 } from "node:fs";
174017
174176
  import { basename as basename25, join as join96 } from "node:path";
174018
174177
  import ts11 from "typescript";
174019
174178
  function bindPurchasesAppInConfig(source, options) {
@@ -174095,14 +174254,14 @@ function withStoreBundle(dir, options) {
174095
174254
  if (options.storeBundleId) return options;
174096
174255
  const path2 = join96(dir, "store", "store.config.yaml");
174097
174256
  if (!existsSync92(path2)) return options;
174098
- const storeBundleId = parseStoreConfig(readFileSync106(path2, "utf8")).ios?.bundleId;
174257
+ const storeBundleId = parseStoreConfig(readFileSync107(path2, "utf8")).ios?.bundleId;
174099
174258
  return storeBundleId ? { ...options, storeBundleId } : options;
174100
174259
  }
174101
174260
  function previewIapConfigEdit(dir, options) {
174102
174261
  const path2 = configEntry(dir);
174103
174262
  if (!path2) return void 0;
174104
174263
  if (isSymlink2(path2)) return { path: path2, changed: false, applied: [], conflicts: [], instructions: [`${basename25(path2)} is a symlink, so it would not be edited: add the purchases app in the file it points to.`] };
174105
- const { changed, applied, conflicts, instructions } = bindPurchasesAppInConfig(readFileSync106(path2, "utf8"), { ...withStoreBundle(dir, options), fileName: basename25(path2) });
174264
+ const { changed, applied, conflicts, instructions } = bindPurchasesAppInConfig(readFileSync107(path2, "utf8"), { ...withStoreBundle(dir, options), fileName: basename25(path2) });
174106
174265
  return { path: path2, changed, applied, conflicts, instructions };
174107
174266
  }
174108
174267
  async function applyIapConfigEdit(dir, options, validate5) {
@@ -174111,7 +174270,7 @@ async function applyIapConfigEdit(dir, options, validate5) {
174111
174270
  const fileName = basename25(path2);
174112
174271
  const refuse7 = (why) => ({ path: path2, changed: false, applied: [], conflicts: [], instructions: [why] });
174113
174272
  if (isSymlink2(path2)) return refuse7(`${fileName} is a symlink, so it was not edited: add the purchases app in the file it points to.`);
174114
- const original = readFileSync106(path2, "utf8");
174273
+ const original = readFileSync107(path2, "utf8");
174115
174274
  const edit = bindPurchasesAppInConfig(original, { ...withStoreBundle(dir, options), fileName });
174116
174275
  const { applied, conflicts, instructions } = edit;
174117
174276
  if (!edit.changed) return { path: path2, changed: false, applied, conflicts, instructions };
@@ -174181,7 +174340,7 @@ function bookingAttendanceOf(raw) {
174181
174340
  const policy = object8(object8(s2.bookingPolicy).participantsPolicy);
174182
174341
  return {
174183
174342
  kind: "bookingsService",
174184
- type: text9(s2.type),
174343
+ type: text10(s2.type),
174185
174344
  capacity: numeric(s2.defaultCapacity),
174186
174345
  maxParticipantsPerBooking: policy.enabled === true ? numeric(policy.maxParticipantsPerBooking) : void 0,
174187
174346
  hidden: boolean3(s2.hidden),
@@ -174190,21 +174349,21 @@ function bookingAttendanceOf(raw) {
174190
174349
  onlineBooking: boolean3(object8(s2.onlineBooking).enabled),
174191
174350
  onlinePayment: boolean3(options.online),
174192
174351
  deposit: options.deposit === true || fixed.deposit !== void 0,
174193
- priceType: text9(payment.rateType),
174194
- amount: text9(price.value),
174195
- currency: text9(price.currency)
174352
+ priceType: text10(payment.rateType),
174353
+ amount: text10(price.value),
174354
+ currency: text10(price.currency)
174196
174355
  };
174197
174356
  }
174198
174357
  function locationType(raw) {
174199
174358
  const location = object8(raw);
174200
- const type = text9(location.type) ?? "UNKNOWN";
174359
+ const type = text10(location.type) ?? "UNKNOWN";
174201
174360
  const addresses = [object8(location.custom).address, location.calculatedAddress].map(object8);
174202
174361
  return type === "CUSTOM" && addresses.every(describesNoPlace) ? ADDRESSLESS_CUSTOM : type;
174203
174362
  }
174204
174363
  function describesNoPlace(address) {
174205
174364
  const parts = ["country", "subdivision", "city", "postalCode", "addressLine", "addressLine2", "streetAddress", "location"];
174206
174365
  if (parts.some((key3) => address[key3] !== void 0 && address[key3] !== "")) return false;
174207
- const description = text9(address.formattedAddress)?.trim() ?? "";
174366
+ const description = text10(address.formattedAddress)?.trim() ?? "";
174208
174367
  return description === "" || ONLINE_LABEL.test(description);
174209
174368
  }
174210
174369
  function ticketAttendanceOf(event, definition) {
@@ -174213,31 +174372,31 @@ function ticketAttendanceOf(event, definition) {
174213
174372
  const pricing = object8(t2.pricingMethod);
174214
174373
  const price = object8(pricing.fixedPrice);
174215
174374
  const registration = object8(e2.registration);
174216
- const type = text9(registration.type) ?? text9(registration.initialType) ?? text9(e2.eventType);
174217
- const status = text9(e2.status) ?? text9(e2.eventStatus);
174375
+ const type = text10(registration.type) ?? text10(registration.initialType) ?? text10(e2.eventType);
174376
+ const status = text10(e2.status) ?? text10(e2.eventStatus);
174218
174377
  return {
174219
174378
  kind: "eventsTicket",
174220
- location: text9(object8(e2.location).type),
174379
+ location: text10(object8(e2.location).type),
174221
174380
  registration: type === "TICKETS" || type === "RSVP_AND_TICKETS" ? "TICKETING" : type,
174222
174381
  eventStatus: status === "SCHEDULED" ? "UPCOMING" : status,
174223
- saleStatus: text9(t2.saleStatus),
174382
+ saleStatus: text10(t2.saleStatus),
174224
174383
  hidden: boolean3(t2.hidden),
174225
- priceType: text9(pricing.pricingType),
174226
- amount: text9(price.value),
174227
- currency: text9(price.currency)
174384
+ priceType: text10(pricing.pricingType),
174385
+ amount: text10(price.value),
174386
+ currency: text10(price.currency)
174228
174387
  };
174229
174388
  }
174230
174389
  function object8(value2) {
174231
174390
  return value2 !== null && typeof value2 === "object" && !Array.isArray(value2) ? value2 : {};
174232
174391
  }
174233
- var ADDRESSLESS_CUSTOM, PHYSICAL_LOCATIONS, ONLINE_LABEL, text9, numeric, boolean3, zeroPrice;
174392
+ var ADDRESSLESS_CUSTOM, PHYSICAL_LOCATIONS, ONLINE_LABEL, text10, numeric, boolean3, zeroPrice;
174234
174393
  var init_attendance_classifier = __esm({
174235
174394
  "../../core/sdk/iap/src/attendance-classifier.ts"() {
174236
174395
  init_wix_payments_contract();
174237
174396
  ADDRESSLESS_CUSTOM = "CUSTOM_WITHOUT_ADDRESS";
174238
174397
  PHYSICAL_LOCATIONS = ["BUSINESS", "CUSTOMER", "CUSTOM", ADDRESSLESS_CUSTOM];
174239
174398
  ONLINE_LABEL = /^(online|virtual)(\s+(class|classes|classroom|course|session|sessions|meeting|lesson|training|workshop|event))?$/i;
174240
- text9 = (value2) => typeof value2 === "string" ? value2 : void 0;
174399
+ text10 = (value2) => typeof value2 === "string" ? value2 : void 0;
174241
174400
  numeric = (value2) => typeof value2 === "number" ? value2 : void 0;
174242
174401
  boolean3 = (value2) => typeof value2 === "boolean" ? value2 : void 0;
174243
174402
  zeroPrice = (value2) => typeof value2 === "string" && /^0+(?:\.0+)?$/.test(value2);
@@ -174250,8 +174409,8 @@ function amountText(value2) {
174250
174409
  return typeof value2 === "string" && value2.trim() ? value2.trim() : void 0;
174251
174410
  }
174252
174411
  function priceOf(amount, currency) {
174253
- const text11 = amountText(amount);
174254
- return text11 && typeof currency === "string" && currency ? { amount: text11, currency } : void 0;
174412
+ const text12 = amountText(amount);
174413
+ return text12 && typeof currency === "string" && currency ? { amount: text12, currency } : void 0;
174255
174414
  }
174256
174415
  function catalogItem(fields) {
174257
174416
  return Object.fromEntries(Object.entries(fields).filter(([, v2]) => v2 !== void 0 && v2 !== "" && v2 !== false));
@@ -174536,12 +174695,12 @@ function credentialsPlan(deps) {
174536
174695
  if (!deps.appleKey && deps.serverKeyOnly) return {
174537
174696
  state: "blocked",
174538
174697
  code: "apple_key_missing",
174539
- detail: "The server has no In-App Purchase key. Complete owner-driven server key onboarding before managed connect; the Branded key bridge is not yet available. An App Store Connect API key cannot replace this credential."
174698
+ detail: "The purchases app has no In-App Purchase key. Run himi store apple-keys setup --app <slug> --site <metaSiteId> --bundle-id <id> --iap-key <AuthKey.p8> --iap-key-id <id> --iap-issuer-id <issuer> --yes, then rerun connect. An App Store Connect API key cannot replace this credential."
174540
174699
  };
174541
174700
  return deps.appleKey ? { state: "planned", detail: "store the In-App Purchase key" } : {
174542
174701
  state: "blocked",
174543
174702
  code: "apple_key_missing",
174544
- detail: "no In-App Purchase key: create one in App Store Connect \u2192 Users and Access \u2192 Integrations \u2192 In-App Purchase, then rerun with --iap-key <AuthKey.p8> --iap-key-id <key id> (an App Store Connect API key is rejected)."
174703
+ detail: "no In-App Purchase key: create one in App Store Connect \u2192 Users and Access \u2192 Integrations \u2192 In-App Purchase, then run himi store apple-keys setup with --iap-key <AuthKey.p8> --iap-key-id <key id> --iap-issuer-id <issuer>, or rerun legacy connect with its key flags (an App Store Connect API key is rejected)."
174545
174704
  };
174546
174705
  }
174547
174706
  async function connectProvider(provider, appId2, apply) {
@@ -174826,8 +174985,8 @@ async function shoot(selected, run2, outDir) {
174826
174985
  function visibleText2(html) {
174827
174986
  return html.replace(/&nbsp;|&#160;|&#xa0;/gi, "\xA0").replace(/&amp;/g, "&");
174828
174987
  }
174829
- function manifestWithScreenshots(text11, shot) {
174830
- const doc = JSON.parse(text11);
174988
+ function manifestWithScreenshots(text12, shot) {
174989
+ const doc = JSON.parse(text12);
174831
174990
  for (const [index, path2] of shot) doc.items[index].reviewScreenshot = path2;
174832
174991
  return `${JSON.stringify(doc, null, 2)}
174833
174992
  `;
@@ -174870,7 +175029,7 @@ var init_store_iap_screenshots = __esm({
174870
175029
  });
174871
175030
 
174872
175031
  // src/store-iap-screenshot-render.ts
174873
- import { existsSync as existsSync93, mkdtempSync as mkdtempSync9, readFileSync as readFileSync107, rmSync as rmSync25 } from "node:fs";
175032
+ import { existsSync as existsSync93, mkdtempSync as mkdtempSync9, readFileSync as readFileSync108, rmSync as rmSync25 } from "node:fs";
174874
175033
  import { tmpdir as tmpdir10 } from "node:os";
174875
175034
  import { join as join98 } from "node:path";
174876
175035
  function renderProblems(render, entityId) {
@@ -174933,7 +175092,7 @@ function createReviewScreenRenderer() {
174933
175092
  async capture(html, contentDir2) {
174934
175093
  const { pngPageHtml: pngPageHtml2, stabilizePngPage: stabilizePngPage2 } = await Promise.resolve().then(() => (init_render_descriptor(), render_descriptor_exports));
174935
175094
  const tokensPath = join98(contentDir2, "tokens.json");
174936
- const tokens2 = existsSync93(tokensPath) ? JSON.parse(readFileSync107(tokensPath, "utf8")) : null;
175095
+ const tokens2 = existsSync93(tokensPath) ? JSON.parse(readFileSync108(tokensPath, "utf8")) : null;
174937
175096
  const { width, height, scale } = REVIEW_SCREENSHOT_FRAME;
174938
175097
  const page = await (await (browser ??= launch())).newPage({ viewport: { width, height }, deviceScaleFactor: scale, colorScheme: "light" });
174939
175098
  try {
@@ -175015,7 +175174,7 @@ __export(store_iap_exports, {
175015
175174
  });
175016
175175
  import { execFileSync as execFileSync8 } from "node:child_process";
175017
175176
  import { randomUUID as randomUUID9 } from "node:crypto";
175018
- import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync40, readFileSync as readFileSync108, realpathSync as realpathSync14, renameSync as renameSync14, rmSync as rmSync26, writeFileSync as writeFileSync36 } from "node:fs";
175177
+ import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync40, readFileSync as readFileSync109, realpathSync as realpathSync15, renameSync as renameSync14, rmSync as rmSync26, writeFileSync as writeFileSync36 } from "node:fs";
175019
175178
  import { homedir as homedir13, hostname as hostname2 } from "node:os";
175020
175179
  import { dirname as dirname49, join as join99, resolve as resolve73 } from "node:path";
175021
175180
  function scrubDeep(value2, scrub) {
@@ -175038,7 +175197,7 @@ function textFlag(flags, name) {
175038
175197
  }
175039
175198
  function requireFlag(flags, name, command) {
175040
175199
  const value2 = textFlag(flags, name);
175041
- if (!value2) throw new UsageError(`store iap ${command} needs --${name} <value>`);
175200
+ if (!value2) throw new UsageError2(`store iap ${command} needs --${name} <value>`);
175042
175201
  return value2;
175043
175202
  }
175044
175203
  function readInput(deps, path2, what) {
@@ -175055,9 +175214,9 @@ function manifestDirOf(manifestPath) {
175055
175214
  return dirname49(resolve73(manifestPath));
175056
175215
  }
175057
175216
  function readPlan(deps, path2) {
175058
- const text11 = readInput(deps, path2, "plan");
175217
+ const text12 = readInput(deps, path2, "plan");
175059
175218
  try {
175060
- return verifyPlan2(JSON.parse(text11));
175219
+ return verifyPlan2(JSON.parse(text12));
175061
175220
  } catch (e2) {
175062
175221
  if (e2 instanceof SyntaxError) throw new Error(`${path2} is not valid JSON: ${e2.message}`);
175063
175222
  throw e2;
@@ -175068,10 +175227,10 @@ function writeJson(deps, out2, path2, value2) {
175068
175227
  `);
175069
175228
  }
175070
175229
  function writePlan(deps, out2, path2, plan) {
175071
- const text11 = `${JSON.stringify(plan, null, 2)}
175230
+ const text12 = `${JSON.stringify(plan, null, 2)}
175072
175231
  `;
175073
- if (out2.carriesSecret(text11)) throw new Error("refusing to write a plan that contains this run's App Store Connect credentials");
175074
- deps.writeFileAtomic(path2, text11);
175232
+ if (out2.carriesSecret(text12)) throw new Error("refusing to write a plan that contains this run's App Store Connect credentials");
175233
+ deps.writeFileAtomic(path2, text12);
175075
175234
  }
175076
175235
  function catalogRoutePrefix(flags, deps) {
175077
175236
  if (flags["catalog-route"] !== void 0 && !textFlag(flags, "catalog-route")) throw new IapCatalogError("catalog_route_unavailable", "--catalog-route needs an explicit gateway path");
@@ -175087,7 +175246,7 @@ function catalogClient(flags, deps, site) {
175087
175246
  }
175088
175247
  function openSession(deps, out2, target, profile, flags = {}) {
175089
175248
  if (flags.managed === true) {
175090
- if (profile) throw new UsageError("--managed cannot be combined with --profile; no profile fallback is supported");
175249
+ if (profile) throw new UsageError2("--managed cannot be combined with --profile; no profile fallback is supported");
175091
175250
  const purchasesAppId = requireFlag(flags, "purchases-app", "managed");
175092
175251
  const identity2 = { mode: "managed", siteId: target.wixSiteId, purchasesAppId };
175093
175252
  const catalogRoute = catalogRoutePrefix(flags, deps);
@@ -175213,7 +175372,7 @@ async function planCommand(flags, deps, out2) {
175213
175372
  function createLimit(flags) {
175214
175373
  const value2 = textFlag(flags, "limit");
175215
175374
  if (value2 === void 0) return void 0;
175216
- if (!/^[1-9]\d*$/.test(value2)) throw new UsageError(`--limit must be a positive whole number (got ${JSON.stringify(value2)})`);
175375
+ if (!/^[1-9]\d*$/.test(value2)) throw new UsageError2(`--limit must be a positive whole number (got ${JSON.stringify(value2)})`);
175217
175376
  return Number(value2);
175218
175377
  }
175219
175378
  async function applyWithLock(deps, plan, session, limit, submitForReview = true) {
@@ -175275,26 +175434,26 @@ async function statusCommand(flags, deps, out2) {
175275
175434
  function draftMode(flags) {
175276
175435
  const value2 = textFlag(flags, "mode") ?? "per-item";
175277
175436
  const mode = DRAFT_MODES[value2];
175278
- if (!mode) throw new UsageError(`--mode must be per-item or tiers (got ${JSON.stringify(value2)})`);
175437
+ if (!mode) throw new UsageError2(`--mode must be per-item or tiers (got ${JSON.stringify(value2)})`);
175279
175438
  return mode;
175280
175439
  }
175281
175440
  function territoriesFlag(flags, base) {
175282
175441
  const territories = (textFlag(flags, "territories") ?? base).split(",").map((t2) => t2.trim().toUpperCase()).filter(Boolean);
175283
175442
  const bad2 = territories.find((t2) => !TERRITORY_CODE.test(t2));
175284
- if (bad2) throw new UsageError(`--territories must be ISO 3166-1 alpha-3 codes such as USA (got ${JSON.stringify(bad2)})`);
175443
+ if (bad2) throw new UsageError2(`--territories must be ISO 3166-1 alpha-3 codes such as USA (got ${JSON.stringify(bad2)})`);
175285
175444
  const duplicate = territories.find((t2, i2) => territories.indexOf(t2) !== i2);
175286
- if (duplicate) throw new UsageError(`--territories: duplicate territory ${duplicate}`);
175287
- if (!territories.includes(base)) throw new UsageError(`--territories must include the base territory ${base}`);
175445
+ if (duplicate) throw new UsageError2(`--territories: duplicate territory ${duplicate}`);
175446
+ if (!territories.includes(base)) throw new UsageError2(`--territories must include the base territory ${base}`);
175288
175447
  return territories;
175289
175448
  }
175290
175449
  function localeFlag(flags) {
175291
175450
  const locale = textFlag(flags, "locale") ?? "en-US";
175292
- if (!LOCALE_CODE.test(locale)) throw new UsageError(`--locale must be a locale such as en-US (got ${JSON.stringify(locale)})`);
175451
+ if (!LOCALE_CODE.test(locale)) throw new UsageError2(`--locale must be a locale such as en-US (got ${JSON.stringify(locale)})`);
175293
175452
  return locale;
175294
175453
  }
175295
175454
  function baseTerritoryFlag(flags) {
175296
175455
  const base = requireFlag(flags, "base-territory", "draft").toUpperCase();
175297
- if (!TERRITORY_CODE.test(base)) throw new UsageError(`--base-territory must be an ISO 3166-1 alpha-3 code such as USA (got ${JSON.stringify(base)})`);
175456
+ if (!TERRITORY_CODE.test(base)) throw new UsageError2(`--base-territory must be an ISO 3166-1 alpha-3 code such as USA (got ${JSON.stringify(base)})`);
175298
175457
  return base;
175299
175458
  }
175300
175459
  async function applePriceGrid(session, target, baseTerritory) {
@@ -175374,11 +175533,11 @@ function readInAppPurchaseKey(flags, deps, creds) {
175374
175533
  const path2 = textFlag(flags, "iap-key");
175375
175534
  const keyId = textFlag(flags, "iap-key-id");
175376
175535
  if (!path2 && !keyId) return null;
175377
- if (!path2 || !keyId) throw new UsageError("store iap connect needs --iap-key <AuthKey.p8> and --iap-key-id <id> together");
175378
- if (!/^[A-Z0-9]{10}$/.test(keyId)) throw new UsageError(`--iap-key-id must be the 10-character key id App Store Connect shows, got "${keyId}"`);
175536
+ if (!path2 || !keyId) throw new UsageError2("store iap connect needs --iap-key <AuthKey.p8> and --iap-key-id <id> together");
175537
+ if (!/^[A-Z0-9]{10}$/.test(keyId)) throw new UsageError2(`--iap-key-id must be the 10-character key id App Store Connect shows, got "${keyId}"`);
175379
175538
  let privateKey;
175380
175539
  try {
175381
- assertCredentialOutsideRepo("--iap-key", (deps.realpath ?? realpathSync14)(path2));
175540
+ assertCredentialOutsideRepo("--iap-key", (deps.realpath ?? realpathSync15)(path2));
175382
175541
  privateKey = readInput(deps, path2, "In-App Purchase key");
175383
175542
  } catch (error) {
175384
175543
  throw new KeyError(error.message);
@@ -175429,7 +175588,7 @@ async function connectCommand(flags, deps, out2) {
175429
175588
  return await connectWith(flags, deps, out2);
175430
175589
  } catch (error) {
175431
175590
  if (error instanceof IapCatalogError) return failFrom(error, out2);
175432
- if (error instanceof UsageError) return out2.fail(error.message, { ok: false, code: "invalid_usage", usage: STORE_IAP_USAGE });
175591
+ if (error instanceof UsageError2) return out2.fail(error.message, { ok: false, code: "invalid_usage", usage: STORE_IAP_USAGE });
175433
175592
  if (error instanceof IapManifestError) {
175434
175593
  return out2.fail(`${error.label} is not a valid IAP manifest`, { ok: false, code: "manifest_invalid", problems: error.problems });
175435
175594
  }
@@ -175445,7 +175604,7 @@ async function connectWith(flags, deps, out2) {
175445
175604
  try {
175446
175605
  previewTag = parsePreviewTag(textFlag(flags, "preview-tag") ?? process.env.HIMI_SERVE_PREVIEW_TAG);
175447
175606
  } catch (error) {
175448
- throw new UsageError(error.message);
175607
+ throw new UsageError2(error.message);
175449
175608
  }
175450
175609
  const manifest2 = readManifest2(deps, manifestPath);
175451
175610
  const catalog4 = catalogClient(flags, deps, manifest2.target.wixSiteId);
@@ -175484,7 +175643,7 @@ async function connectWith(flags, deps, out2) {
175484
175643
  return out2.fail(error instanceof Error ? error.message : String(error), { ok: false, code: "request_failed" });
175485
175644
  }
175486
175645
  const expectedApp = textFlag(flags, "purchases-app");
175487
- if (expectedApp && plan.purchasesAppId !== expectedApp) throw new UsageError("--purchases-app differs from the registration for the manifest's bundle on this site");
175646
+ if (expectedApp && plan.purchasesAppId !== expectedApp) throw new UsageError2("--purchases-app differs from the registration for the manifest's bundle on this site");
175488
175647
  let report3 = plan;
175489
175648
  if (!dryRun && writesPlanned(plan)) {
175490
175649
  const confirmed = flags.yes === true;
@@ -175560,8 +175719,8 @@ async function mappingsCommand(flags, deps, out2) {
175560
175719
  const appId2 = requireFlag(flags, "purchases-app", "mappings");
175561
175720
  const productId = textFlag(flags, "product");
175562
175721
  const active = textFlag(flags, "active");
175563
- if (flags.active !== void 0 && active !== "true" && active !== "false") throw new UsageError("--active must be true or false");
175564
- if (productId === void 0 !== (active === void 0)) throw new UsageError("mapping changes require both --product <mapping-id> and --active true|false");
175722
+ if (flags.active !== void 0 && active !== "true" && active !== "false") throw new UsageError2("--active must be true or false");
175723
+ if (productId === void 0 !== (active === void 0)) throw new UsageError2("mapping changes require both --product <mapping-id> and --active true|false");
175565
175724
  const client2 = catalogClient(flags, deps, site);
175566
175725
  if (!productId) {
175567
175726
  out2.print({ ok: true, products: await client2.listProducts(appId2) });
@@ -175604,7 +175763,7 @@ function printScreenshots(out2, report3, manifestPath, dryRun) {
175604
175763
  else if (report3.items.some((i2) => i2.screenshot)) out2.line(` manifest updated: ${manifestPath} \u2014 next: himi store iap plan --manifest ${manifestPath} \u2026 uploads them.`);
175605
175764
  }
175606
175765
  async function screenshotsCommand(flags, deps, out2) {
175607
- if (flags.managed === true) throw new UsageError("Catalog generates review screenshots during apply; local screenshots require explicit legacy --profile mode");
175766
+ if (flags.managed === true) throw new UsageError2("Catalog generates review screenshots during apply; local screenshots require explicit legacy --profile mode");
175608
175767
  const manifestPath = requireFlag(flags, "manifest", "screenshots");
175609
175768
  const contentDir2 = requireFlag(flags, "content", "screenshots");
175610
175769
  const manifestText = readInput(deps, manifestPath, "manifest");
@@ -175630,7 +175789,7 @@ async function screenshotsCommand(flags, deps, out2) {
175630
175789
  appleLocked: (item) => facts.get(item.productId)?.locked,
175631
175790
  appleRead: textFlag(flags, "profile") !== void 0,
175632
175791
  writeBytes: deps.writeBytes ?? writeBinaryFile,
175633
- writeText: (path2, text11) => deps.writeFileAtomic(path2, text11),
175792
+ writeText: (path2, text12) => deps.writeFileAtomic(path2, text12),
175634
175793
  ...only ? { only: new Set(only.split(",").map((id) => id.trim()).filter(Boolean)) } : {},
175635
175794
  ...outDir ? { outDir: resolve73(outDir) } : {},
175636
175795
  force: flags.force === true,
@@ -175666,7 +175825,7 @@ async function runStoreIap(pos, flags, io2, deps) {
175666
175825
  try {
175667
175826
  return await command(flags, deps, out2);
175668
175827
  } catch (e2) {
175669
- if (e2 instanceof UsageError) return out2.fail(e2.message, { usage: STORE_IAP_USAGE, ...flags.managed === true ? { ok: false, code: "invalid_usage" } : {} });
175828
+ if (e2 instanceof UsageError2) return out2.fail(e2.message, { usage: STORE_IAP_USAGE, ...flags.managed === true ? { ok: false, code: "invalid_usage" } : {} });
175670
175829
  return failFrom(e2, out2, flags.managed === true);
175671
175830
  }
175672
175831
  }
@@ -175678,7 +175837,7 @@ function fileJournal(path2) {
175678
175837
  }
175679
175838
  function readLockSummary(path2) {
175680
175839
  try {
175681
- const { pid, host, at: at2 } = JSON.parse(readFileSync108(path2, "utf8"));
175840
+ const { pid, host, at: at2 } = JSON.parse(readFileSync109(path2, "utf8"));
175682
175841
  return `pid ${pid} on ${host} since ${at2}`;
175683
175842
  } catch {
175684
175843
  return "unreadable lock";
@@ -175698,7 +175857,7 @@ function acquireApplyLock(dir, appleAppId) {
175698
175857
  return () => {
175699
175858
  let current = "";
175700
175859
  try {
175701
- current = readFileSync108(path2, "utf8");
175860
+ current = readFileSync109(path2, "utf8");
175702
175861
  } catch {
175703
175862
  return;
175704
175863
  }
@@ -175722,8 +175881,8 @@ async function confirmOnTerminal(question) {
175722
175881
  }
175723
175882
  function defaultStoreIapDeps() {
175724
175883
  return {
175725
- readFile: (path2) => readFileSync108(path2, "utf8"),
175726
- readBytes: (path2) => readFileSync108(path2),
175884
+ readFile: (path2) => readFileSync109(path2, "utf8"),
175885
+ readBytes: (path2) => readFileSync109(path2),
175727
175886
  readBuildIapBinding: (path2) => JSON.parse(execFileSync8("plutil", ["-convert", "json", "-o", "-", resolve73(path2)], { encoding: "utf8" })),
175728
175887
  visitorTransport: async (clientId, siteId) => {
175729
175888
  const [{ mintVisitorToken: mintVisitorToken2 }, { visitorTransportFrom: visitorTransportFrom2 }] = await Promise.all([Promise.resolve().then(() => (init_visitor_auth(), visitor_auth_exports)), Promise.resolve().then(() => (init_rest(), rest_exports))]);
@@ -175747,7 +175906,7 @@ function defaultStoreIapDeps() {
175747
175906
  sleep: (ms2) => new Promise((resolve85) => setTimeout(resolve85, ms2))
175748
175907
  };
175749
175908
  }
175750
- var STORE_IAP_USAGE, SUMMARY_THRESHOLD, SUMMARY_DETAIL_LIMIT, UsageError, CommandOutput, pad, DECISION_ORDER, OUTCOME_ORDER, COMPLETE, DRAFT_MODES, TERRITORY_CODE, LOCALE_CODE, GRID_UNAVAILABLE_NOTE, KeyError, CredentialsError, writesPlanned, COMMANDS2;
175909
+ var STORE_IAP_USAGE, SUMMARY_THRESHOLD, SUMMARY_DETAIL_LIMIT, UsageError2, CommandOutput, pad, DECISION_ORDER, OUTCOME_ORDER, COMPLETE, DRAFT_MODES, TERRITORY_CODE, LOCALE_CODE, GRID_UNAVAILABLE_NOTE, KeyError, CredentialsError, writesPlanned, COMMANDS2;
175751
175910
  var init_store_iap = __esm({
175752
175911
  "src/store-iap.ts"() {
175753
175912
  init_iap_catalog_client();
@@ -175777,7 +175936,7 @@ var init_store_iap = __esm({
175777
175936
  STORE_IAP_USAGE = "himi store iap draft|plan|apply|status|connect|screenshots|check|mappings \u2014 draft --site <msid> (--profile <name> | --purchases-app <id> --catalog-route <path>) --apple-app <id> --bundle <id> --base-territory <ISO3> --out <manifest.json> [--territories <a,b>] [--locale <l>] [--mode per-item|tiers] [--merge <manifest.json>] [--report <file>] \xB7 plan --manifest <file> (--profile <name> | --purchases-app <id> --catalog-route <path>) --out <plan.json> \xB7 apply --plan <plan.json> (--profile <name> | --purchases-app <id> --catalog-route <path>) --out <result.json> [--yes] [--limit <n>] [--no-submit] \xB7 status --manifest <file> (--profile <name> | --purchases-app <id> --catalog-route <path>) [--out <file>] [--refresh-wix] \xB7 connect --manifest <file> [--profile <name>] --catalog-route <path> [--iap-key <AuthKey.p8> --iap-key-id <id>] [--content <dir>] [--preview-tag dp-<tag>] [--dry-run] [--yes] [--out <report.json>] \xB7 screenshots --manifest <file> --content <app dir> --profile <name> [--out-dir <dir>] [--only <productId,\u2026>] [--force] [--dry-run] \xB7 check --manifest <file> --catalog-route <path> [--purchases-app <id>] [--content <dir>] [--plist <built Info.plist>] [--visitor-client <id>] \xB7 mappings --site <msid> --purchases-app <id> --catalog-route <path> [--product <mapping-id> --active true|false --yes] \xB7 Catalog is the default: --purchases-app <id> --catalog-route <path> for Apple reads; --managed is optional. --profile selects direct Apple mode.";
175778
175937
  SUMMARY_THRESHOLD = 50;
175779
175938
  SUMMARY_DETAIL_LIMIT = 20;
175780
- UsageError = class extends Error {
175939
+ UsageError2 = class extends Error {
175781
175940
  };
175782
175941
  CommandOutput = class {
175783
175942
  constructor(io2, json8) {
@@ -175794,8 +175953,8 @@ var init_store_iap = __esm({
175794
175953
  protectKey(key3) {
175795
175954
  this.secrets.push(key3.privateKey, key3.keyId);
175796
175955
  }
175797
- line(text11 = "") {
175798
- this.io.log(this.scrub(text11));
175956
+ line(text12 = "") {
175957
+ this.io.log(this.scrub(text12));
175799
175958
  }
175800
175959
  print(value2) {
175801
175960
  this.io.log(this.serialize(value2));
@@ -175808,11 +175967,11 @@ var init_store_iap = __esm({
175808
175967
  return JSON.stringify(scrubDeep(value2, (t2) => this.scrub(t2)), null, 2);
175809
175968
  }
175810
175969
  /** This run's own key material, raw or JSON-escaped, anywhere in `text`. */
175811
- carriesSecret(text11) {
175812
- return this.secrets.some((secret) => secret && (text11.includes(secret) || text11.includes(JSON.stringify(secret).slice(1, -1))));
175970
+ carriesSecret(text12) {
175971
+ return this.secrets.some((secret) => secret && (text12.includes(secret) || text12.includes(JSON.stringify(secret).slice(1, -1))));
175813
175972
  }
175814
- scrub(text11) {
175815
- let out2 = text11;
175973
+ scrub(text12) {
175974
+ let out2 = text12;
175816
175975
  for (const secret of this.secrets) if (secret) out2 = out2.split(secret).join("[redacted]");
175817
175976
  return scrubString(out2);
175818
175977
  }
@@ -176221,7 +176380,7 @@ __export(preflight_app_exports, {
176221
176380
  profileAccount: () => profileAccount,
176222
176381
  readXcconfigVars: () => readXcconfigVars
176223
176382
  });
176224
- import { readFileSync as readFileSync109, existsSync as existsSync94, readdirSync as readdirSync39, statSync as statSync25 } from "node:fs";
176383
+ import { readFileSync as readFileSync110, existsSync as existsSync94, readdirSync as readdirSync39, statSync as statSync26 } from "node:fs";
176225
176384
  import { createHash as createHash47 } from "node:crypto";
176226
176385
  import { dirname as dirname50, join as join100 } from "node:path";
176227
176386
  function analyze(projectYml, storeConfig, icon, account) {
@@ -176350,7 +176509,7 @@ function readXcconfigVars(iosDir, projectYml) {
176350
176509
  const read = (path2) => {
176351
176510
  if (seen.has(path2) || !existsSync94(path2)) return;
176352
176511
  seen.add(path2);
176353
- for (const raw of readFileSync109(path2, "utf8").split("\n")) {
176512
+ for (const raw of readFileSync110(path2, "utf8").split("\n")) {
176354
176513
  const inc = /^\s*#include\??\s+"([^"]+)"/.exec(raw);
176355
176514
  if (inc) {
176356
176515
  read(join100(dirname50(path2), inc[1]));
@@ -176377,8 +176536,8 @@ function profileAccount(app, storeConfig, opts = {}) {
176377
176536
  }
176378
176537
  }
176379
176538
  async function preflightApp(app, opts = {}) {
176380
- const projectYml = existsSync94(iosProjectYml(app)) ? readFileSync109(iosProjectYml(app), "utf8") : "";
176381
- const storeConfig = existsSync94(storeConfigPath(app)) ? readFileSync109(storeConfigPath(app), "utf8") : "";
176539
+ const projectYml = existsSync94(iosProjectYml(app)) ? readFileSync110(iosProjectYml(app), "utf8") : "";
176540
+ const storeConfig = existsSync94(storeConfigPath(app)) ? readFileSync110(storeConfigPath(app), "utf8") : "";
176382
176541
  const identity = projectYml ? analyzeStoreIdentity(projectYml, storeConfig, readXcconfigVars(join100(appDir(app), "ios"), projectYml)) : [];
176383
176542
  if (!storeConfig) return [{ level: "error", message: `no apps/${app}/store/store.config.yaml \u2014 run /setup-store-signing first.` }, ...identity];
176384
176543
  const findings = analyze(
@@ -176539,7 +176698,7 @@ function playListingAssets(app, locale = "en-US") {
176539
176698
  for (const name of names2) {
176540
176699
  const p2 = join100(dir, name);
176541
176700
  try {
176542
- if (statSync25(p2).isFile()) return { name, bytes: readFileSync109(p2) };
176701
+ if (statSync26(p2).isFile()) return { name, bytes: readFileSync110(p2) };
176543
176702
  } catch {
176544
176703
  }
176545
176704
  }
@@ -176579,7 +176738,7 @@ function listScreenshots(app, locale = "en-US") {
176579
176738
  const flat = join100(storeDir(app), "screenshots", locale);
176580
176739
  if (existsSync94(flat)) {
176581
176740
  for (const png of readdirSync39(flat).filter((n2) => n2.endsWith(".png"))) {
176582
- const sz = pngSize2(readFileSync109(join100(flat, png)));
176741
+ const sz = pngSize2(readFileSync110(join100(flat, png)));
176583
176742
  if (sz) out2.push({ name: png, w: sz.w, h: sz.h });
176584
176743
  }
176585
176744
  }
@@ -176587,9 +176746,9 @@ function listScreenshots(app, locale = "en-US") {
176587
176746
  if (existsSync94(legacy)) {
176588
176747
  for (const deviceDir of readdirSync39(legacy)) {
176589
176748
  const d2 = join100(legacy, deviceDir);
176590
- if (!statSync25(d2).isDirectory()) continue;
176749
+ if (!statSync26(d2).isDirectory()) continue;
176591
176750
  for (const png of readdirSync39(d2).filter((n2) => n2.endsWith(".png"))) {
176592
- const sz = pngSize2(readFileSync109(join100(d2, png)));
176751
+ const sz = pngSize2(readFileSync110(join100(d2, png)));
176593
176752
  if (sz) out2.push({ name: `${deviceDir}/${png}`, w: sz.w, h: sz.h });
176594
176753
  }
176595
176754
  }
@@ -176602,8 +176761,8 @@ function placeholderHashes2() {
176602
176761
  for (const target of readdirSync39(templateIos)) {
176603
176762
  const p2 = join100(templateIos, target, "Assets.xcassets", "AppIcon.appiconset", "icon_1024.png");
176604
176763
  try {
176605
- if (!statSync25(p2).isFile()) continue;
176606
- return [LEGACY_PLACEHOLDER_SHA2562, createHash47("sha256").update(readFileSync109(p2)).digest("hex")];
176764
+ if (!statSync26(p2).isFile()) continue;
176765
+ return [LEGACY_PLACEHOLDER_SHA2562, createHash47("sha256").update(readFileSync110(p2)).digest("hex")];
176607
176766
  } catch {
176608
176767
  }
176609
176768
  }
@@ -176638,8 +176797,8 @@ async function appIconState(iosDir) {
176638
176797
  for (const target of readdirSync39(iosDir)) {
176639
176798
  const p2 = join100(iosDir, target, "Assets.xcassets", "AppIcon.appiconset", "icon_1024.png");
176640
176799
  try {
176641
- if (!statSync25(p2).isFile()) continue;
176642
- const bytes2 = readFileSync109(p2);
176800
+ if (!statSync26(p2).isFile()) continue;
176801
+ const bytes2 = readFileSync110(p2);
176643
176802
  const hash2 = createHash47("sha256").update(bytes2).digest("hex");
176644
176803
  const pixels = await pixelIssues(bytes2);
176645
176804
  return {
@@ -176710,7 +176869,7 @@ __export(asc_status_exports, {
176710
176869
  ascStatus: () => ascStatus,
176711
176870
  buildVerdict: () => buildVerdict
176712
176871
  });
176713
- import { readFileSync as readFileSync110 } from "node:fs";
176872
+ import { readFileSync as readFileSync111 } from "node:fs";
176714
176873
  function buildVerdict(builds) {
176715
176874
  if (!builds.length) {
176716
176875
  return "NO builds registered \u2014 if you uploaded recently and it's been >15 min, the binary was REJECTED IN PROCESSING (reason is email-only; run validate-binary.ts / scan-purpose-strings.ts to reproduce it).";
@@ -176724,7 +176883,7 @@ function buildVerdict(builds) {
176724
176883
  function client(creds) {
176725
176884
  const env = creds ?? requireEnv(["ASC_KEY_ID", "ASC_ISSUER_ID", "ASC_KEY_PATH"]);
176726
176885
  assertCredentialOutsideRepo("ASC_KEY_PATH", env.ASC_KEY_PATH);
176727
- const jwt = ascJwt(env.ASC_KEY_ID, env.ASC_ISSUER_ID, readFileSync110(env.ASC_KEY_PATH, "utf8"), Math.floor(Date.now() / 1e3));
176886
+ const jwt = ascJwt(env.ASC_KEY_ID, env.ASC_ISSUER_ID, readFileSync111(env.ASC_KEY_PATH, "utf8"), Math.floor(Date.now() / 1e3));
176728
176887
  return async (path2) => {
176729
176888
  const r3 = await fetch(`${ASC}${path2}`, { headers: { Authorization: `Bearer ${jwt}` } });
176730
176889
  return { status: r3.status, json: await r3.json().catch(() => ({})) };
@@ -177117,7 +177276,7 @@ __export(secrets_exports, {
177117
177276
  runRemoteSecretsCommand: () => runRemoteSecretsCommand,
177118
177277
  runSecretsCommand: () => runSecretsCommand
177119
177278
  });
177120
- import { readFileSync as readFileSync112 } from "node:fs";
177279
+ import { readFileSync as readFileSync113 } from "node:fs";
177121
177280
  function environment(value2) {
177122
177281
  if (value2 === "preview" || value2 === "production") return value2;
177123
177282
  throw new Error("--environment must be preview or production");
@@ -177148,7 +177307,7 @@ async function runSecretsCommand(operation, flags, io2, options = {}) {
177148
177307
  io2.log(JSON.stringify(await vault.list({ app, environment: env })));
177149
177308
  return 0;
177150
177309
  }
177151
- const value2 = options.readValue ? options.readValue() : readFileSync112(0, "utf8").replace(/\r?\n$/, "");
177310
+ const value2 = options.readValue ? options.readValue() : readFileSync113(0, "utf8").replace(/\r?\n$/, "");
177152
177311
  if (operation === "set") await vault.set({ app, environment: env, name, value: value2 });
177153
177312
  else if (operation === "rotate") await vault.rotate({ app, environment: env, name, value: value2 });
177154
177313
  else throw new Error(`unknown secrets operation ${operation}`);
@@ -177177,16 +177336,16 @@ async function runRemoteSecretsCommand(operation, flags, io2, options) {
177177
177336
  }
177178
177337
  let body;
177179
177338
  if (operation !== "list") {
177180
- const value2 = options.readValue ? options.readValue() : readFileSync112(0, "utf8").replace(/\r?\n$/, "");
177339
+ const value2 = options.readValue ? options.readValue() : readFileSync113(0, "utf8").replace(/\r?\n$/, "");
177181
177340
  body = JSON.stringify({ value: value2 });
177182
177341
  }
177183
177342
  const response = await (options.fetchImpl ?? fetch)(url, { method: operation === "list" ? "GET" : operation === "set" ? "PUT" : "POST", headers: headers2, body });
177184
- const text11 = await response.text();
177343
+ const text12 = await response.text();
177185
177344
  let output;
177186
177345
  try {
177187
- output = JSON.parse(text11);
177346
+ output = JSON.parse(text12);
177188
177347
  } catch {
177189
- output = text11;
177348
+ output = text12;
177190
177349
  }
177191
177350
  if (!response.ok) throw new Error(typeof output === "string" ? output : JSON.stringify(output));
177192
177351
  io2.log(JSON.stringify(output));
@@ -177244,9 +177403,9 @@ function headersFor(options) {
177244
177403
  ...options.previewTag ? { "x-wix-route-serve": options.previewTag } : {}
177245
177404
  };
177246
177405
  }
177247
- function objectFrom(text11) {
177406
+ function objectFrom(text12) {
177248
177407
  try {
177249
- const value2 = text11 ? JSON.parse(text11) : null;
177408
+ const value2 = text12 ? JSON.parse(text12) : null;
177250
177409
  return value2 && typeof value2 === "object" && !Array.isArray(value2) ? value2 : null;
177251
177410
  } catch {
177252
177411
  return null;
@@ -177484,12 +177643,12 @@ async function runNotifyPing(flags, io2, deps = {}) {
177484
177643
  const flagError = flagRefusal(flags);
177485
177644
  if (flagError) return refuse6(io2, flagError);
177486
177645
  const allMembers = flags["all-members"] === true;
177487
- if (allMembers && text10(flags["member-email"])) return refuse6(io2, "recipient_conflict", "Choose --all-members or --member-email.");
177646
+ if (allMembers && text11(flags["member-email"])) return refuse6(io2, "recipient_conflict", "Choose --all-members or --member-email.");
177488
177647
  if (allMembers && flags["dry-run"] !== true && flags.yes !== true) return refuse6(io2, "confirmation_required", "Preview with --dry-run, then add --yes to send to every approved member.");
177489
- const input = mergePushInputs(pushInputsFromContent(resolve75(text10(flags.content) ?? process.cwd())), flags);
177490
- const missing3 = [...input.app ? [] : ["app"], ...input.site ? [] : ["site"], ...REQUIRED_FLAGS.filter((f2) => !(allMembers && f2 === "member-email") && !text10(flags[f2]))];
177648
+ const input = mergePushInputs(pushInputsFromContent(resolve75(text11(flags.content) ?? process.cwd())), flags);
177649
+ const missing3 = [...input.app ? [] : ["app"], ...input.site ? [] : ["site"], ...REQUIRED_FLAGS.filter((f2) => !(allMembers && f2 === "member-email") && !text11(flags[f2]))];
177491
177650
  if (missing3.length) return refuse6(io2, "needs_input", "Name the app and site (or --content), the member's login email, a title and a link.", 2, { missing: missing3 });
177492
- const requestId2 = text10(flags["request-id"]) ?? (deps.newRequestId ?? randomUUID10)();
177651
+ const requestId2 = text11(flags["request-id"]) ?? (deps.newRequestId ?? randomUUID10)();
177493
177652
  if (!UUID_RE.test(requestId2)) return refuse6(io2, "invalid_request_id", "Reuse the requestId a previous send printed.");
177494
177653
  const owner = await hostedOwnerSession(flags, deps);
177495
177654
  if (!owner.ok) return refuse6(io2, owner.error, owner.hint, owner.exit);
@@ -177506,10 +177665,10 @@ async function runNotifyPing(flags, io2, deps = {}) {
177506
177665
  const body = {
177507
177666
  app: ownership.slug,
177508
177667
  site: input.site,
177509
- memberEmail: text10(flags["member-email"]),
177510
- title: text10(flags.title),
177511
- ...text10(flags.body) ? { body: text10(flags.body) } : {},
177512
- link: text10(flags.link),
177668
+ memberEmail: text11(flags["member-email"]),
177669
+ title: text11(flags.title),
177670
+ ...text11(flags.body) ? { body: text11(flags.body) } : {},
177671
+ link: text11(flags.link),
177513
177672
  requestId: requestId2,
177514
177673
  ...flags["dry-run"] === true ? { dryRun: true } : {}
177515
177674
  };
@@ -177549,7 +177708,7 @@ async function runAllMembers(args) {
177549
177708
  const code = error instanceof PushSendError ? error.code : error instanceof Error && ROSTER_CODES.has(error.message) ? error.message : "member_lookup_unavailable";
177550
177709
  return refuse6(io2, code, void 0, 1);
177551
177710
  }
177552
- const base = { app: input.app, site: input.site, title: text10(flags.title), ...text10(flags.body) ? { body: text10(flags.body) } : {}, link: text10(flags.link) };
177711
+ const base = { app: input.app, site: input.site, title: text11(flags.title), ...text11(flags.body) ? { body: text11(flags.body) } : {}, link: text11(flags.link) };
177553
177712
  const send2 = (recipient, memberRequestId, dryRun = false) => pushSendRequest({
177554
177713
  target: session.target,
177555
177714
  wixToken: session.wixToken,
@@ -177632,7 +177791,7 @@ function summary(result, sent) {
177632
177791
  }
177633
177792
  return `Ping accepted request ${sent.requestId} for ${sent.memberEmail}. Ping does not confirm delivery: it reaches the member's signed-in devices with notifications allowed.`;
177634
177793
  }
177635
- var LOCAL_SENDER_FLAGS, SWITCHES, REQUIRED_FLAGS, UUID_RE, KNOWN_CODES, ROSTER_CODES, HINTS, text10;
177794
+ var LOCAL_SENDER_FLAGS, SWITCHES, REQUIRED_FLAGS, UUID_RE, KNOWN_CODES, ROSTER_CODES, HINTS, text11;
177636
177795
  var init_notify_ping = __esm({
177637
177796
  "src/notify-ping.ts"() {
177638
177797
  init_push_send();
@@ -177660,7 +177819,7 @@ var init_notify_ping = __esm({
177660
177819
  site_token_invalid: "Run wix login as the site owner; the site token must belong to the app owner's account.",
177661
177820
  ping_permission_denied: "Himi Serve is not permitted to send through Ping; this is a platform issue, not your setup."
177662
177821
  };
177663
- text10 = (v2) => typeof v2 === "string" && v2.length > 0 ? v2 : void 0;
177822
+ text11 = (v2) => typeof v2 === "string" && v2.length > 0 ? v2 : void 0;
177664
177823
  }
177665
177824
  });
177666
177825
 
@@ -177675,7 +177834,7 @@ __export(notify_exports, {
177675
177834
  runNotify: () => runNotify,
177676
177835
  saveAdminSession: () => saveAdminSession
177677
177836
  });
177678
- import { chmodSync as chmodSync3, mkdirSync as mkdirSync41, readFileSync as readFileSync115, writeFileSync as writeFileSync38 } from "node:fs";
177837
+ import { chmodSync as chmodSync3, mkdirSync as mkdirSync41, readFileSync as readFileSync116, writeFileSync as writeFileSync38 } from "node:fs";
177679
177838
  import { homedir as homedir14 } from "node:os";
177680
177839
  import { dirname as dirname52, join as join105 } from "node:path";
177681
177840
  function defaultSessionsPath() {
@@ -177683,7 +177842,7 @@ function defaultSessionsPath() {
177683
177842
  }
177684
177843
  function loadSessionsFile(path2 = defaultSessionsPath()) {
177685
177844
  try {
177686
- return JSON.parse(readFileSync115(path2, "utf8"));
177845
+ return JSON.parse(readFileSync116(path2, "utf8"));
177687
177846
  } catch {
177688
177847
  return {};
177689
177848
  }
@@ -178052,7 +178211,7 @@ __export(base44_adopt_exports, {
178052
178211
  renderAdoptModule: () => renderAdoptModule,
178053
178212
  runBase44Adopt: () => runBase44Adopt
178054
178213
  });
178055
- import { existsSync as existsSync98, readFileSync as readFileSync116, writeFileSync as writeFileSync39 } from "node:fs";
178214
+ import { existsSync as existsSync98, readFileSync as readFileSync117, writeFileSync as writeFileSync39 } from "node:fs";
178056
178215
  import { join as join106, resolve as resolve76 } from "node:path";
178057
178216
  function prop(entity, key3) {
178058
178217
  const props = entity.schema?.properties;
@@ -178147,7 +178306,7 @@ function runBase44Adopt(opts) {
178147
178306
  const bookPath = join106(bookDir, "book.json");
178148
178307
  let book;
178149
178308
  try {
178150
- book = JSON.parse(readFileSync116(bookPath, "utf8"));
178309
+ book = JSON.parse(readFileSync117(bookPath, "utf8"));
178151
178310
  if (!book || typeof book !== "object" || !Array.isArray(book.entities)) throw new Error("not a Base44 app book (no entities[])");
178152
178311
  } catch (e2) {
178153
178312
  throw new AdoptError("book_unreadable", `could not read ${bookPath}: ${e2.message}. Run \`himi base44 analyze --app-id <id>\` first.`);
@@ -178410,7 +178569,7 @@ __export(generate_exports, {
178410
178569
  writeGenerated: () => writeGenerated
178411
178570
  });
178412
178571
  import { createHash as createHash50 } from "node:crypto";
178413
- import { existsSync as existsSync99, mkdirSync as mkdirSync42, readdirSync as readdirSync40, readFileSync as readFileSync117, writeFileSync as writeFileSync40 } from "node:fs";
178572
+ import { existsSync as existsSync99, mkdirSync as mkdirSync42, readdirSync as readdirSync40, readFileSync as readFileSync118, writeFileSync as writeFileSync40 } from "node:fs";
178414
178573
  import { dirname as dirname53, join as join107 } from "node:path";
178415
178574
  function withHeader(body) {
178416
178575
  return `${GENERATED_HEADER}${sha2566(body)}
@@ -178539,7 +178698,7 @@ function writeGenerated(dir, files, opts = {}) {
178539
178698
  let outcome;
178540
178699
  if (!existsSync99(abs)) outcome = "written";
178541
178700
  else {
178542
- const cur = readFileSync117(abs, "utf8");
178701
+ const cur = readFileSync118(abs, "utf8");
178543
178702
  if (cur === next) outcome = "unchanged";
178544
178703
  else if (isEdited(cur) && !opts.force) outcome = "skipped-edited";
178545
178704
  else outcome = "written";
@@ -178564,7 +178723,7 @@ function orphanedFiles(dir, current) {
178564
178723
  }
178565
178724
  for (const rel of candidates.sort()) {
178566
178725
  if (keep.has(rel) || !existsSync99(join107(dir, rel))) continue;
178567
- if (readFileSync117(join107(dir, rel), "utf8").startsWith(GENERATED_HEADER)) found.push(rel);
178726
+ if (readFileSync118(join107(dir, rel), "utf8").startsWith(GENERATED_HEADER)) found.push(rel);
178568
178727
  }
178569
178728
  return found;
178570
178729
  }
@@ -178602,7 +178761,7 @@ __export(base44_auth_exports, {
178602
178761
  usableBase44Auth: () => usableBase44Auth,
178603
178762
  writeBase44Session: () => writeBase44Session
178604
178763
  });
178605
- import { chmodSync as chmodSync4, existsSync as existsSync100, mkdirSync as mkdirSync43, readFileSync as readFileSync118, rmSync as rmSync27, writeFileSync as writeFileSync41 } from "node:fs";
178764
+ import { chmodSync as chmodSync4, existsSync as existsSync100, mkdirSync as mkdirSync43, readFileSync as readFileSync119, rmSync as rmSync27, writeFileSync as writeFileSync41 } from "node:fs";
178606
178765
  import { homedir as homedir15 } from "node:os";
178607
178766
  import { dirname as dirname54, join as join108 } from "node:path";
178608
178767
  function base44ApiBase(env = process.env) {
@@ -178615,7 +178774,7 @@ function readBase44Session(home) {
178615
178774
  const p2 = base44SessionPath(home);
178616
178775
  if (!existsSync100(p2)) return void 0;
178617
178776
  try {
178618
- const s2 = JSON.parse(readFileSync118(p2, "utf8"));
178777
+ const s2 = JSON.parse(readFileSync119(p2, "utf8"));
178619
178778
  return typeof s2.accessToken === "string" && s2.accessToken ? s2 : void 0;
178620
178779
  } catch {
178621
178780
  return void 0;
@@ -178735,7 +178894,7 @@ function hasBase44WriteScope(auth) {
178735
178894
  function importBase44CliSession(home = homedir15(), env = process.env) {
178736
178895
  const src = join108(home, ".base44", "auth", "auth.json");
178737
178896
  if (!existsSync100(src)) throw new Error(`no Base44 CLI session at ${src} \u2014 run \`npx base44 login\` first, or use \`himi base44 login\``);
178738
- const a2 = JSON.parse(readFileSync118(src, "utf8"));
178897
+ const a2 = JSON.parse(readFileSync119(src, "utf8"));
178739
178898
  if (typeof a2.accessToken !== "string" || !a2.accessToken) throw new Error(`${src} holds no access token`);
178740
178899
  const session = {
178741
178900
  accessToken: a2.accessToken,
@@ -178785,14 +178944,14 @@ async function callJson(t2, appId2, method, path2, what, body) {
178785
178944
  ...body !== void 0 ? { body: JSON.stringify(body) } : {}
178786
178945
  });
178787
178946
  if (!res.ok) {
178788
- const text12 = await res.text().catch(() => "");
178789
- throw new Base44RequestError(res.status, text12.slice(0, 500), what);
178947
+ const text13 = await res.text().catch(() => "");
178948
+ throw new Base44RequestError(res.status, text13.slice(0, 500), what);
178790
178949
  }
178791
- const text11 = await res.text();
178950
+ const text12 = await res.text();
178792
178951
  try {
178793
- return JSON.parse(text11);
178952
+ return JSON.parse(text12);
178794
178953
  } catch {
178795
- throw new Base44RequestError(res.status, `unreadable response: ${text11.slice(0, 200)}`, what);
178954
+ throw new Base44RequestError(res.status, `unreadable response: ${text12.slice(0, 200)}`, what);
178796
178955
  }
178797
178956
  }
178798
178957
  function requestFailure(e2) {
@@ -178832,14 +178991,14 @@ __export(seed_exports, {
178832
178991
  seedBase44Entities: () => seedBase44Entities,
178833
178992
  writeBase44SeedRows: () => writeBase44SeedRows
178834
178993
  });
178835
- import { existsSync as existsSync101, readFileSync as readFileSync119, writeFileSync as writeFileSync42 } from "node:fs";
178994
+ import { existsSync as existsSync101, readFileSync as readFileSync120, writeFileSync as writeFileSync42 } from "node:fs";
178836
178995
  import { join as join109 } from "node:path";
178837
178996
  function readBase44SeedFile(dir) {
178838
178997
  const file2 = join109(dir, BASE44_SEED_FILE);
178839
178998
  if (!existsSync101(file2)) return {};
178840
178999
  let parsed;
178841
179000
  try {
178842
- parsed = JSON.parse(readFileSync119(file2, "utf8"));
179001
+ parsed = JSON.parse(readFileSync120(file2, "utf8"));
178843
179002
  } catch (e2) {
178844
179003
  throw new SeedFileError(`${BASE44_SEED_FILE} is not valid JSON (${e2.message}). Fix or delete it.`);
178845
179004
  }
@@ -178999,7 +179158,7 @@ function writeBase44SeedRows(opts) {
178999
179158
  if (existsSync101(path2)) {
179000
179159
  let parsed;
179001
179160
  try {
179002
- parsed = JSON.parse(readFileSync119(path2, "utf8"));
179161
+ parsed = JSON.parse(readFileSync120(path2, "utf8"));
179003
179162
  } catch (e2) {
179004
179163
  throw new SeedFileError(`${BASE44_SEED_FILE} is not valid JSON (${e2.message}). Refusing to regenerate, because overwriting it would discard the rows already in it.`);
179005
179164
  }
@@ -179060,16 +179219,16 @@ var init_seed = __esm({
179060
179219
  });
179061
179220
 
179062
179221
  // src/base44-analyze/project.ts
179063
- function parseJsonc(text11) {
179222
+ function parseJsonc(text12) {
179064
179223
  let out2 = "";
179065
179224
  let i2 = 0;
179066
179225
  let inStr = false;
179067
- while (i2 < text11.length) {
179068
- const c2 = text11[i2];
179226
+ while (i2 < text12.length) {
179227
+ const c2 = text12[i2];
179069
179228
  if (inStr) {
179070
179229
  out2 += c2;
179071
179230
  if (c2 === "\\") {
179072
- out2 += text11[i2 + 1] ?? "";
179231
+ out2 += text12[i2 + 1] ?? "";
179073
179232
  i2 += 2;
179074
179233
  continue;
179075
179234
  }
@@ -179081,11 +179240,11 @@ function parseJsonc(text11) {
179081
179240
  inStr = true;
179082
179241
  out2 += c2;
179083
179242
  i2++;
179084
- } else if (c2 === "/" && text11[i2 + 1] === "/") {
179085
- while (i2 < text11.length && text11[i2] !== "\n") i2++;
179086
- } else if (c2 === "/" && text11[i2 + 1] === "*") {
179243
+ } else if (c2 === "/" && text12[i2 + 1] === "/") {
179244
+ while (i2 < text12.length && text12[i2] !== "\n") i2++;
179245
+ } else if (c2 === "/" && text12[i2 + 1] === "*") {
179087
179246
  i2 += 2;
179088
- while (i2 < text11.length && !(text11[i2] === "*" && text11[i2 + 1] === "/")) i2++;
179247
+ while (i2 < text12.length && !(text12[i2] === "*" && text12[i2 + 1] === "/")) i2++;
179089
179248
  i2 += 2;
179090
179249
  } else {
179091
179250
  out2 += c2;
@@ -179094,32 +179253,32 @@ function parseJsonc(text11) {
179094
179253
  }
179095
179254
  return JSON.parse(dropTrailingCommas(out2));
179096
179255
  }
179097
- function dropTrailingCommas(text11) {
179256
+ function dropTrailingCommas(text12) {
179098
179257
  let out2 = "";
179099
179258
  let inStr = false;
179100
- for (let i2 = 0; i2 < text11.length; i2++) {
179101
- const c2 = text11[i2];
179259
+ for (let i2 = 0; i2 < text12.length; i2++) {
179260
+ const c2 = text12[i2];
179102
179261
  if (inStr) {
179103
179262
  out2 += c2;
179104
- if (c2 === "\\") out2 += text11[++i2] ?? "";
179263
+ if (c2 === "\\") out2 += text12[++i2] ?? "";
179105
179264
  else if (c2 === '"') inStr = false;
179106
179265
  continue;
179107
179266
  }
179108
179267
  if (c2 === '"') inStr = true;
179109
179268
  if (c2 === ",") {
179110
179269
  let j2 = i2 + 1;
179111
- while (j2 < text11.length && /\s/.test(text11[j2])) j2++;
179112
- if (text11[j2] === "}" || text11[j2] === "]") continue;
179270
+ while (j2 < text12.length && /\s/.test(text12[j2])) j2++;
179271
+ if (text12[j2] === "}" || text12[j2] === "]") continue;
179113
179272
  }
179114
179273
  out2 += c2;
179115
179274
  }
179116
179275
  return out2;
179117
179276
  }
179118
179277
  function readJson9(files, path2) {
179119
- const text11 = files.get(path2);
179120
- if (text11 === void 0) return void 0;
179278
+ const text12 = files.get(path2);
179279
+ if (text12 === void 0) return void 0;
179121
179280
  try {
179122
- const v2 = parseJsonc(text11);
179281
+ const v2 = parseJsonc(text12);
179123
179282
  return v2 && typeof v2 === "object" && !Array.isArray(v2) ? v2 : void 0;
179124
179283
  } catch {
179125
179284
  return void 0;
@@ -179649,11 +179808,11 @@ async function readEntitySnapshot(appId2, deps) {
179649
179808
  const { entries, skipped } = collectAppSource(dl2.dir);
179650
179809
  const files = new Map(entries.map((e2) => [e2.path, e2.bytes.toString("utf8")]));
179651
179810
  for (const cfgPath of ["base44/config.jsonc", "base44/config.json"]) {
179652
- const text11 = files.get(cfgPath);
179653
- if (text11 === void 0) continue;
179811
+ const text12 = files.get(cfgPath);
179812
+ if (text12 === void 0) continue;
179654
179813
  let cfg;
179655
179814
  try {
179656
- cfg = parseJsonc(text11);
179815
+ cfg = parseJsonc(text12);
179657
179816
  } catch (e2) {
179658
179817
  throw new Error(`${cfgPath} does not parse (${e2.message}) \u2014 the entity directory it names cannot be trusted, so the snapshot may be incomplete`);
179659
179818
  }
@@ -179666,11 +179825,11 @@ async function readEntitySnapshot(appId2, deps) {
179666
179825
  const isEntityFile = (p2) => entityDirs.some((d2) => p2.startsWith(d2) && !p2.slice(d2.length).includes("/") && JSON_FILE2.test(p2));
179667
179826
  const dropped = skipped.map((p2) => p2.split(/[\\/]/).join("/")).filter((p2) => entityDirs.some((d2) => p2.startsWith(d2) || d2.startsWith(`${p2}/`)));
179668
179827
  if (dropped.length) throw new Error(`the download's entity files include ones himi will not read (${dropped.join(", ")}) \u2014 a sync without them would delete those entities`);
179669
- for (const [path2, text11] of files) {
179828
+ for (const [path2, text12] of files) {
179670
179829
  if (!isEntityFile(path2)) continue;
179671
179830
  let v2;
179672
179831
  try {
179673
- v2 = parseJsonc(text11);
179832
+ v2 = parseJsonc(text12);
179674
179833
  } catch (e2) {
179675
179834
  throw new Error(`entity file ${path2} does not parse (${e2.message}) \u2014 a sync without it would delete that entity`);
179676
179835
  }
@@ -179698,7 +179857,7 @@ __export(apply_exports, {
179698
179857
  createBase44Entities: () => createBase44Entities,
179699
179858
  fileLedger: () => fileLedger
179700
179859
  });
179701
- import { existsSync as existsSync103, readFileSync as readFileSync120, writeFileSync as writeFileSync43 } from "node:fs";
179860
+ import { existsSync as existsSync103, readFileSync as readFileSync121, writeFileSync as writeFileSync43 } from "node:fs";
179702
179861
  import { join as join111 } from "node:path";
179703
179862
  function fileLedger(dir, appId2) {
179704
179863
  const path2 = join111(dir, LEDGER_FILE2);
@@ -179706,7 +179865,7 @@ function fileLedger(dir, appId2) {
179706
179865
  if (!existsSync103(path2)) return {};
179707
179866
  let v2;
179708
179867
  try {
179709
- v2 = JSON.parse(readFileSync120(path2, "utf8"));
179868
+ v2 = JSON.parse(readFileSync121(path2, "utf8"));
179710
179869
  } catch (e2) {
179711
179870
  throw new LedgerError(`${LEDGER_FILE2} is not valid JSON (${e2.message}) \u2014 fix it (a merge conflict?) rather than let himi rewrite it`);
179712
179871
  }
@@ -179863,16 +180022,16 @@ function isPrivateV4([a2, b2, c2]) {
179863
180022
  return a2 >= 224;
179864
180023
  }
179865
180024
  function v6Groups(host) {
179866
- let text11 = host;
179867
- const dotted = /:((?:\d{1,3}\.){3}\d{1,3})$/.exec(text11);
180025
+ let text12 = host;
180026
+ const dotted = /:((?:\d{1,3}\.){3}\d{1,3})$/.exec(text12);
179868
180027
  if (dotted) {
179869
180028
  const octets = ipv4Octets(dotted[1]);
179870
180029
  if (!octets) return null;
179871
180030
  const hi2 = (octets[0] << 8 | octets[1]).toString(16);
179872
180031
  const lo2 = (octets[2] << 8 | octets[3]).toString(16);
179873
- text11 = `${text11.slice(0, dotted.index)}:${hi2}:${lo2}`;
180032
+ text12 = `${text12.slice(0, dotted.index)}:${hi2}:${lo2}`;
179874
180033
  }
179875
- const halves = text11.split("::");
180034
+ const halves = text12.split("::");
179876
180035
  if (halves.length > 2) return null;
179877
180036
  const parts = (part3) => part3 ? part3.split(":") : [];
179878
180037
  const head = parts(halves[0]);
@@ -180152,28 +180311,28 @@ var init_net_guard = __esm({
180152
180311
  });
180153
180312
 
180154
180313
  // src/site-analyze/copy-clean.ts
180155
- function isTemplatePlaceholder(text11) {
180156
- return PLACEHOLDER_RE.test(text11);
180314
+ function isTemplatePlaceholder(text12) {
180315
+ return PLACEHOLDER_RE.test(text12);
180157
180316
  }
180158
180317
  function cleanText(raw, cap) {
180159
180318
  const s2 = String(raw ?? "").replace(/[\u0000-\u001F\u007F]/g, " ").replace(/\s+/g, " ").trim();
180160
180319
  return s2.length > cap ? `${s2.slice(0, cap - 1).trimEnd()}\u2026` : s2;
180161
180320
  }
180162
- function stripPii(text11) {
180163
- return text11.replace(EMAIL_RE2, "").replace(PHONE_SHAPE_RE, (m2) => {
180321
+ function stripPii(text12) {
180322
+ return text12.replace(EMAIL_RE2, "").replace(PHONE_SHAPE_RE, (m2) => {
180164
180323
  const digits2 = (m2.match(ANY_DIGIT_RE) ?? []).length;
180165
180324
  return digits2 >= PHONE_MIN_DIGITS && PHONE_DIGIT_RUN_RE.test(m2) ? "" : m2;
180166
180325
  }).replace(/\s+/g, " ").trim();
180167
180326
  }
180168
- function isBoilerplate(text11) {
180169
- return BOILERPLATE_RE.test(text11) || PLACEHOLDER_RE.test(text11);
180327
+ function isBoilerplate(text12) {
180328
+ return BOILERPLATE_RE.test(text12) || PLACEHOLDER_RE.test(text12);
180170
180329
  }
180171
180330
  function copyOrDrop(raw, cap) {
180172
- const text11 = stripPii(cleanText(raw, cap));
180173
- if (text11.length < 2) return "";
180174
- if (isBoilerplate(text11)) return "";
180175
- if (!/[A-Za-zͰ-῿぀-힯]/.test(text11)) return "";
180176
- return text11;
180331
+ const text12 = stripPii(cleanText(raw, cap));
180332
+ if (text12.length < 2) return "";
180333
+ if (isBoilerplate(text12)) return "";
180334
+ if (!/[A-Za-zͰ-῿぀-힯]/.test(text12)) return "";
180335
+ return text12;
180177
180336
  }
180178
180337
  function dedupe2(values, cap) {
180179
180338
  const out2 = [];
@@ -180269,8 +180428,8 @@ function parsePublishedHtml(html) {
180269
180428
  const rawHeadings = [];
180270
180429
  HEADING_RE.lastIndex = 0;
180271
180430
  while (m2 = HEADING_RE.exec(html)) {
180272
- const text11 = copyOrDrop(textFromHtml(m2[1] ?? ""), 120);
180273
- if (text11) rawHeadings.push(text11);
180431
+ const text12 = copyOrDrop(textFromHtml(m2[1] ?? ""), 120);
180432
+ if (text12) rawHeadings.push(text12);
180274
180433
  if (rawHeadings.length >= 40) break;
180275
180434
  }
180276
180435
  const headings = dedupe2(rawHeadings, 20);
@@ -180362,14 +180521,14 @@ async function readPublishedHtml(fetchImpl, siteUrl, opts) {
180362
180521
  const chunk = await reader.read();
180363
180522
  if (chunk.done) break;
180364
180523
  bytes2 += chunk.value.byteLength;
180365
- const text11 = decoder.decode(chunk.value, { stream: true });
180366
- html += text11;
180367
- if (CODE_APP_ID_DONE_RE.test(overlap + text11) || bytes2 >= maxBytes) {
180524
+ const text12 = decoder.decode(chunk.value, { stream: true });
180525
+ html += text12;
180526
+ if (CODE_APP_ID_DONE_RE.test(overlap + text12) || bytes2 >= maxBytes) {
180368
180527
  await reader.cancel().catch(() => {
180369
180528
  });
180370
180529
  break;
180371
180530
  }
180372
- overlap = (overlap + text11).slice(-80);
180531
+ overlap = (overlap + text12).slice(-80);
180373
180532
  }
180374
180533
  } catch (e2) {
180375
180534
  if (!opts.signal?.aborted) throw e2;
@@ -180594,9 +180753,9 @@ var init_permissions = __esm({
180594
180753
  function genericDescription(it2) {
180595
180754
  for (const field of DESCRIPTION_FIELDS) {
180596
180755
  const raw = it2[field];
180597
- const text11 = typeof raw === "string" ? raw : str8(raw?.text);
180598
- if (!text11) continue;
180599
- const plain2 = text11.replace(/<[^>]*>/g, " ").replace(/&nbsp;/g, " ");
180756
+ const text12 = typeof raw === "string" ? raw : str8(raw?.text);
180757
+ if (!text12) continue;
180758
+ const plain2 = text12.replace(/<[^>]*>/g, " ").replace(/&nbsp;/g, " ");
180600
180759
  if (plain2.trim()) return plain2;
180601
180760
  }
180602
180761
  return void 0;
@@ -181077,8 +181236,8 @@ function cmsStatusNote(taxonomy) {
181077
181236
  function yn2(v2) {
181078
181237
  return v2 == null || v2 === "" ? "\u2014" : String(v2);
181079
181238
  }
181080
- function isAuthPhrase(text11) {
181081
- const t2 = text11.trim();
181239
+ function isAuthPhrase(text12) {
181240
+ const t2 = text12.trim();
181082
181241
  return AUTH_ONLY_ASCII.test(t2) || LOGIN_HE.includes(t2);
181083
181242
  }
181084
181243
  function looksGated(page) {
@@ -181877,12 +182036,12 @@ function mergeWst(pages2) {
181877
182036
  return acc;
181878
182037
  }
181879
182038
  function fontSlug(value2) {
181880
- let text11 = value2;
182039
+ let text12 = value2;
181881
182040
  try {
181882
- text11 = decodeURIComponent(value2);
182041
+ text12 = decodeURIComponent(value2);
181883
182042
  } catch {
181884
182043
  }
181885
- return text11.toLowerCase().replace(/[^a-z0-9]+/g, "");
182044
+ return text12.toLowerCase().replace(/[^a-z0-9]+/g, "");
181886
182045
  }
181887
182046
  function fontUrlSlug(url) {
181888
182047
  const last = url.split("?")[0].split("#")[0].split("/").pop() ?? "";
@@ -181970,9 +182129,9 @@ function attachVeloSources(book, sources, put) {
181970
182129
  if (isSecretVeloPath(f2.path)) continue;
181971
182130
  const rel = veloArtifactRelPath(f2.path);
181972
182131
  if (!rel) continue;
181973
- const text11 = byPath.get(f2.path) ?? f2.excerpt;
181974
- if (!text11) continue;
181975
- put(rel, text11);
182132
+ const text12 = byPath.get(f2.path) ?? f2.excerpt;
182133
+ if (!text12) continue;
182134
+ put(rel, text12);
181976
182135
  f2.localPath = rel;
181977
182136
  }
181978
182137
  }
@@ -182363,7 +182522,7 @@ function appIdFromUrl(raw) {
182363
182522
  return void 0;
182364
182523
  }
182365
182524
  }
182366
- function appIdFromText(text11) {
182525
+ function appIdFromText(text12) {
182367
182526
  const shapes = [
182368
182527
  // The published shell's own badge tag: `<script data-app-id="<id>" src="/static/js/badge.js">`.
182369
182528
  /\bdata-app-id\s*=\s*["']([a-f0-9]{24})["']/,
@@ -182374,7 +182533,7 @@ function appIdFromText(text11) {
182374
182533
  /\/apps\/([a-f0-9]{24})\b/
182375
182534
  ];
182376
182535
  for (const re2 of shapes) {
182377
- const m2 = re2.exec(text11);
182536
+ const m2 = re2.exec(text12);
182378
182537
  if (m2) return m2[1];
182379
182538
  }
182380
182539
  return void 0;
@@ -182748,11 +182907,11 @@ var init_analyze = __esm({
182748
182907
  });
182749
182908
 
182750
182909
  // src/base44-analyze/write-artifacts.ts
182751
- import { existsSync as existsSync104, mkdirSync as mkdirSync45, readFileSync as readFileSync121, rmSync as rmSync29, writeFileSync as writeFileSync45 } from "node:fs";
182910
+ import { existsSync as existsSync104, mkdirSync as mkdirSync45, readFileSync as readFileSync122, rmSync as rmSync29, writeFileSync as writeFileSync45 } from "node:fs";
182752
182911
  import { dirname as dirname55, join as join113, resolve as resolve77, sep as sep21 } from "node:path";
182753
182912
  function isBookFolder(dir) {
182754
182913
  try {
182755
- return JSON.parse(readFileSync121(join113(dir, "book.json"), "utf8")).kind === "base44-app-book";
182914
+ return JSON.parse(readFileSync122(join113(dir, "book.json"), "utf8")).kind === "base44-app-book";
182756
182915
  } catch {
182757
182916
  return false;
182758
182917
  }
@@ -185822,8 +185981,8 @@ function copyFromEval(evaled) {
185822
185981
  evaled.meta?.ogTitle,
185823
185982
  evaled.meta?.ogDescription
185824
185983
  ].map((raw) => {
185825
- const text11 = cleanText(raw, 400);
185826
- return text11 && isTemplatePlaceholder(text11) ? stripPii(cleanText(text11, 90)) : "";
185984
+ const text12 = cleanText(raw, 400);
185985
+ return text12 && isTemplatePlaceholder(text12) ? stripPii(cleanText(text12, 90)) : "";
185827
185986
  }),
185828
185987
  8
185829
185988
  );
@@ -187093,7 +187252,7 @@ __export(cli_exports2, {
187093
187252
  ONE_APP_WORKFLOW: () => ONE_APP_WORKFLOW,
187094
187253
  runOneAppCommand: () => runOneAppCommand
187095
187254
  });
187096
- import { closeSync as closeSync8, constants as constants7, lstatSync as lstatSync25, mkdirSync as mkdirSync47, openSync as openSync7, readFileSync as readFileSync122, realpathSync as realpathSync15, writeFileSync as writeFileSync47 } from "node:fs";
187255
+ import { closeSync as closeSync8, constants as constants7, lstatSync as lstatSync25, mkdirSync as mkdirSync47, openSync as openSync7, readFileSync as readFileSync123, realpathSync as realpathSync16, writeFileSync as writeFileSync47 } from "node:fs";
187097
187256
  import { createHash as createHash52 } from "node:crypto";
187098
187257
  import { dirname as dirname56, join as join116, parse as parse3, resolve as resolve80 } from "node:path";
187099
187258
  function readOptions(argv, cwd, commandIncluded) {
@@ -187143,7 +187302,7 @@ function readOptions(argv, cwd, commandIncluded) {
187143
187302
  const file2 = resolve80(cwd, flags["prompt-file"]);
187144
187303
  const stat2 = lstatSync25(file2);
187145
187304
  if (!stat2.isFile() || stat2.size > MAX_PROMPT_BYTES) throw new Error("invalid prompt file");
187146
- prompt = readFileSync122(file2, "utf8");
187305
+ prompt = readFileSync123(file2, "utf8");
187147
187306
  } catch {
187148
187307
  throw new OneAppError("invalid_prompt", "Use a readable text file of at most 64 KiB for --prompt-file.");
187149
187308
  }
@@ -187290,7 +187449,7 @@ validate-topbar checks authored source top-bar controls against the migrated con
187290
187449
  mkdirSync47(options.parentDir, { recursive: true, mode: 448 });
187291
187450
  assertSafeParents(options.parentDir);
187292
187451
  mkdirSync47(options.workspace, { mode: 448 });
187293
- if (realpathSync15(options.workspace) !== options.workspace) throw new Error("destination changed");
187452
+ if (realpathSync16(options.workspace) !== options.workspace) throw new Error("destination changed");
187294
187453
  evidenceDir = join116(options.workspace, ".himi", "one-app");
187295
187454
  mkdirSync47(evidenceDir, { recursive: true, mode: 448 });
187296
187455
  } catch (error) {
@@ -188501,8 +188660,8 @@ var init_copy = __esm({
188501
188660
  function textFields(look) {
188502
188661
  if (look.unavailable) return [];
188503
188662
  const out2 = [];
188504
- const add = (text11, where, narrative = false) => {
188505
- if (text11 && text11.trim()) out2.push({ text: text11, where, narrative });
188663
+ const add = (text12, where, narrative = false) => {
188664
+ if (text12 && text12.trim()) out2.push({ text: text12, where, narrative });
188506
188665
  };
188507
188666
  for (const label3 of look.navLabels) add(label3, "nav");
188508
188667
  for (const p2 of look.pages) {
@@ -189191,8 +189350,8 @@ async function analyzeSite(input, ports) {
189191
189350
  if (locale) plan.provisioning.locale = locale;
189192
189351
  const velo = buildVeloChapter({ look, owner: ownerVelo });
189193
189352
  const veloFiles = ownerVelo.files.flatMap((f2) => {
189194
- const text11 = f2.content ?? f2.excerpt;
189195
- return text11 ? [{ path: f2.path, text: text11 }] : [];
189353
+ const text12 = f2.content ?? f2.excerpt;
189354
+ return text12 ? [{ path: f2.path, text: text12 }] : [];
189196
189355
  }).slice(0, 80);
189197
189356
  const permissions = buildPermissionsChapter({
189198
189357
  cms,
@@ -189404,7 +189563,7 @@ var init_customer_build = __esm({
189404
189563
  });
189405
189564
 
189406
189565
  // src/site-analyze/apply.ts
189407
- import { existsSync as existsSync106, readFileSync as readFileSync123, writeFileSync as writeFileSync48, copyFileSync as copyFileSync2, mkdirSync as mkdirSync48, realpathSync as realpathSync16, statSync as statSync27 } from "node:fs";
189566
+ import { existsSync as existsSync106, readFileSync as readFileSync124, writeFileSync as writeFileSync48, copyFileSync as copyFileSync2, mkdirSync as mkdirSync48, realpathSync as realpathSync17, statSync as statSync28 } from "node:fs";
189408
189567
  import { dirname as dirname57, isAbsolute as isAbsolute10, join as join117, resolve as resolve81, sep as sep22 } from "node:path";
189409
189568
  import { spawnSync as spawnSync7 } from "node:child_process";
189410
189569
  function unpairedRedirectNote(overlay) {
@@ -189527,7 +189686,7 @@ function buildMergedContract(options) {
189527
189686
  if (!existsSync106(committedPath)) {
189528
189687
  throw new Error(`shell has no committed provisioning.json at ${committedPath} to build a contract from`);
189529
189688
  }
189530
- const committed = JSON.parse(readFileSync123(committedPath, "utf8"));
189689
+ const committed = JSON.parse(readFileSync124(committedPath, "utf8"));
189531
189690
  const merged = mergeCustomerOwned(committed, overlay);
189532
189691
  const overlayFontFamily = (overlay.branding ?? {}).fontFamily;
189533
189692
  const branding = merged.branding ?? {};
@@ -189544,14 +189703,14 @@ function buildMergedContract(options) {
189544
189703
  let real;
189545
189704
  let realRoot;
189546
189705
  try {
189547
- real = realpathSync16(from);
189548
- realRoot = realpathSync16(packageDir);
189706
+ real = realpathSync17(from);
189707
+ realRoot = realpathSync17(packageDir);
189549
189708
  } catch {
189550
189709
  return void 0;
189551
189710
  }
189552
189711
  if (!real.startsWith(realRoot + sep22)) return void 0;
189553
189712
  try {
189554
- if (!statSync27(real).isFile()) return void 0;
189713
+ if (!statSync28(real).isFile()) return void 0;
189555
189714
  mkdirSync48(dirname57(to2), { recursive: true });
189556
189715
  copyFileSync2(real, to2);
189557
189716
  } catch {
@@ -189566,7 +189725,7 @@ function buildMergedContract(options) {
189566
189725
  if (existsSync106(facesPath)) {
189567
189726
  let faces = [];
189568
189727
  try {
189569
- const parsed = JSON.parse(readFileSync123(facesPath, "utf8"));
189728
+ const parsed = JSON.parse(readFileSync124(facesPath, "utf8"));
189570
189729
  faces = Array.isArray(parsed) ? parsed : [];
189571
189730
  } catch {
189572
189731
  faces = [];
@@ -189627,7 +189786,7 @@ function staticFaqFor(overlay, overlayPath) {
189627
189786
  const bookPath = join117(dirname57(resolve81(overlayPath)), "book.json");
189628
189787
  if (!existsSync106(bookPath)) return void 0;
189629
189788
  try {
189630
- const book = JSON.parse(readFileSync123(bookPath, "utf8"));
189789
+ const book = JSON.parse(readFileSync124(bookPath, "utf8"));
189631
189790
  const copy = book?.copy;
189632
189791
  if (!copy || typeof copy !== "object" || copy.unavailable) return void 0;
189633
189792
  const pairs = deriveStaticFaq(copy.faq);
@@ -189644,7 +189803,7 @@ function staticGalleriesFor(overlay, overlayPath) {
189644
189803
  const bookPath = join117(dirname57(resolve81(overlayPath)), "book.json");
189645
189804
  if (!existsSync106(bookPath)) return void 0;
189646
189805
  try {
189647
- const book = JSON.parse(readFileSync123(bookPath, "utf8"));
189806
+ const book = JSON.parse(readFileSync124(bookPath, "utf8"));
189648
189807
  if (!book.look || book.look.unavailable || !Array.isArray(book.look.pages)) return void 0;
189649
189808
  const galleries = deriveStaticGalleries(book.look.pages);
189650
189809
  return galleries.length || book.look.complete === true ? galleries : void 0;
@@ -189656,8 +189815,8 @@ async function applyOverlays(input) {
189656
189815
  const cwd = resolve81(input.cwd);
189657
189816
  const shell = input.shell ?? DEFAULT_BRANDABLE_SHELL;
189658
189817
  assertKnownShell(shell);
189659
- const overlay = JSON.parse(readFileSync123(input.overlayPath, "utf8"));
189660
- const tokens2 = JSON.parse(readFileSync123(input.tokensPath, "utf8"));
189818
+ const overlay = JSON.parse(readFileSync124(input.overlayPath, "utf8"));
189819
+ const tokens2 = JSON.parse(readFileSync124(input.tokensPath, "utf8"));
189661
189820
  const faq = staticFaqFor(overlay, input.overlayPath);
189662
189821
  if (faq !== void 0) overlay.faq = faq;
189663
189822
  const galleries = staticGalleriesFor(overlay, input.overlayPath);
@@ -189676,7 +189835,7 @@ async function applyOverlays(input) {
189676
189835
  }
189677
189836
  const appDir3 = join117(repoRoot2, shellAppDir(shell));
189678
189837
  const committedPath = join117(appDir3, "provisioning.json");
189679
- const committedSite = existsSync106(committedPath) ? JSON.parse(readFileSync123(committedPath, "utf8")).site : void 0;
189838
+ const committedSite = existsSync106(committedPath) ? JSON.parse(readFileSync124(committedPath, "utf8")).site : void 0;
189680
189839
  if (committedSite !== void 0 && overlay.site === void 0) {
189681
189840
  throw new Error(
189682
189841
  `shell "${shell}" is a site shell: its contract names the customer's website (a \`site\` block), and this overlay has none. Re-run \`himi site analyze --url <site> --shell ${shell}\` to derive the site's page map (edit \`site.pages\` in provisioning.overlay.json if needed), then --apply.`
@@ -189718,7 +189877,7 @@ async function applyOverlays(input) {
189718
189877
  let packageFaq = faq;
189719
189878
  let packageGalleries = galleries;
189720
189879
  if (existsSync106(pkgProv)) {
189721
- const cur = JSON.parse(readFileSync123(pkgProv, "utf8"));
189880
+ const cur = JSON.parse(readFileSync124(pkgProv, "utf8"));
189722
189881
  if (galleries === void 0 && !sameKnownSite(cur, overlay)) overlay.galleries = [];
189723
189882
  const merged = deepMerge4(cur, overlay);
189724
189883
  packageFaq = merged.faq;
@@ -189736,7 +189895,7 @@ async function applyOverlays(input) {
189736
189895
  }
189737
189896
  const pkgTokens = join117(cwd, "tokens.json");
189738
189897
  if (existsSync106(pkgTokens) && (tokens2.colors || tokens2.typography)) {
189739
- const cur = JSON.parse(readFileSync123(pkgTokens, "utf8"));
189898
+ const cur = JSON.parse(readFileSync124(pkgTokens, "utf8"));
189740
189899
  let tokensIn = tokens2;
189741
189900
  if (tokens2.typography) {
189742
189901
  const fonts = catalogTypography(tokens2.typography, cur.typography);
@@ -189763,7 +189922,7 @@ async function applyOverlays(input) {
189763
189922
  const homeAction = homeRefreshActionId(shell);
189764
189923
  const homeSrc = join117(cwd, "dev/index.ts");
189765
189924
  if (homeAction && existsSync106(homeSrc)) {
189766
- const prev = readFileSync123(homeSrc, "utf8");
189925
+ const prev = readFileSync124(homeSrc, "utf8");
189767
189926
  const patched = patchBrandParams(prev, overlay, homeAction);
189768
189927
  let next = patched.src;
189769
189928
  if (!patched.foreign && faq?.length && prev.includes('"tier5.himiBrandedFaq.load"') && !prev.includes('"staticFaq"')) {
@@ -190498,13 +190657,13 @@ async function veloCall(fetchImpl, method, url, opts = {}) {
190498
190657
  body: opts.body === void 0 ? void 0 : JSON.stringify(opts.body),
190499
190658
  signal: AbortSignal.timeout(opts.timeoutMs ?? 3e4)
190500
190659
  });
190501
- const text11 = await res.text();
190502
- let json8 = text11;
190660
+ const text12 = await res.text();
190661
+ let json8 = text12;
190503
190662
  try {
190504
- json8 = text11 ? JSON.parse(text11) : null;
190663
+ json8 = text12 ? JSON.parse(text12) : null;
190505
190664
  } catch {
190506
190665
  }
190507
- return { status: res.status, json: json8, text: text11 };
190666
+ return { status: res.status, json: json8, text: text12 };
190508
190667
  }
190509
190668
  function snippet2(x2, cap = 180) {
190510
190669
  const s2 = typeof x2 === "string" ? x2 : JSON.stringify(x2) ?? "";
@@ -190763,7 +190922,7 @@ __export(cli_exports3, {
190763
190922
  runSiteAnalyze: () => runSiteAnalyze,
190764
190923
  runSiteFunctionCli: () => runSiteFunctionCli
190765
190924
  });
190766
- import { existsSync as existsSync107, readFileSync as readFileSync124 } from "node:fs";
190925
+ import { existsSync as existsSync107, readFileSync as readFileSync125 } from "node:fs";
190767
190926
  import { resolve as resolve82 } from "node:path";
190768
190927
  function applyNeedsClient(shell) {
190769
190928
  if (shell === void 0 || !SHELL_NAMES.includes(shell)) return true;
@@ -190833,7 +190992,7 @@ async function runSiteAnalyze(opts) {
190833
190992
  const prevOverlayPath = resolve82(outDir, "provisioning.overlay.json");
190834
190993
  const prevSite = existsSync107(prevOverlayPath) ? (() => {
190835
190994
  try {
190836
- return JSON.parse(readFileSync124(prevOverlayPath, "utf8")).site;
190995
+ return JSON.parse(readFileSync125(prevOverlayPath, "utf8")).site;
190837
190996
  } catch {
190838
190997
  return void 0;
190839
190998
  }
@@ -190852,7 +191011,7 @@ async function runSiteAnalyze(opts) {
190852
191011
  }
190853
191012
  const previousOverlay = resolve82(outDir, "provisioning.overlay.json");
190854
191013
  carryOverGoals(
190855
- existsSync107(previousOverlay) ? readFileSync124(previousOverlay, "utf8") : void 0,
191014
+ existsSync107(previousOverlay) ? readFileSync125(previousOverlay, "utf8") : void 0,
190856
191015
  result.provisioningOverlay
190857
191016
  );
190858
191017
  const ownerCall = ownerAuth ? ownerTransportFrom(fetchImpl, ownerAuth) : void 0;
@@ -190910,7 +191069,7 @@ async function runSiteFunctionCli(opts) {
190910
191069
  let source;
190911
191070
  if (opts.sourcePath) {
190912
191071
  const p2 = resolve82(opts.cwd ?? process.cwd(), opts.sourcePath);
190913
- source = readFileSync124(p2, "utf8");
191072
+ source = readFileSync125(p2, "utf8");
190914
191073
  }
190915
191074
  let body;
190916
191075
  if (opts.bodyRaw != null) {
@@ -190940,7 +191099,7 @@ async function runSiteFunctionCli(opts) {
190940
191099
  function base44BookRoutes(bookPath, siteUrl) {
190941
191100
  if (!existsSync107(bookPath)) return void 0;
190942
191101
  try {
190943
- const book = JSON.parse(readFileSync124(bookPath, "utf8"));
191102
+ const book = JSON.parse(readFileSync125(bookPath, "utf8"));
190944
191103
  if (book.kind !== "base44-app-book" || !Array.isArray(book.routes)) return void 0;
190945
191104
  const host = (u2) => {
190946
191105
  try {
@@ -191061,10 +191220,10 @@ function accountTransport(fetchImpl = fetch, timeoutMs = DEFAULT_TIMEOUT_MS5, sp
191061
191220
  }
191062
191221
  throw new Error(`${method} ${path2} failed: ${err?.message ?? String(e2)}`);
191063
191222
  }
191064
- const text11 = await res.text();
191065
- let parsed = text11;
191223
+ const text12 = await res.text();
191224
+ let parsed = text12;
191066
191225
  try {
191067
- parsed = text11 ? JSON.parse(text11) : null;
191226
+ parsed = text12 ? JSON.parse(text12) : null;
191068
191227
  } catch {
191069
191228
  }
191070
191229
  if (!res.ok) throw new WixApiError(res.status, method, path2, parsed);
@@ -191125,16 +191284,16 @@ async function installVerticals(msid, wanted, token, fetchImpl = fetch, timeoutM
191125
191284
  body: JSON.stringify({ apps: wanted.map((w2) => ({ id: w2.appDefId })) }),
191126
191285
  signal: AbortSignal.timeout(timeoutMs)
191127
191286
  });
191128
- const text11 = await res.text();
191287
+ const text12 = await res.text();
191129
191288
  if (!res.ok) {
191130
191289
  return {
191131
191290
  ...empty2,
191132
- errors: wanted.map((w2) => ({ ...w2, message: `bulk-install -> ${res.status}: ${text11.slice(0, 200)}` }))
191291
+ errors: wanted.map((w2) => ({ ...w2, message: `bulk-install -> ${res.status}: ${text12.slice(0, 200)}` }))
191133
191292
  };
191134
191293
  }
191135
191294
  let body = {};
191136
191295
  try {
191137
- body = text11 ? JSON.parse(text11) : {};
191296
+ body = text12 ? JSON.parse(text12) : {};
191138
191297
  } catch {
191139
191298
  }
191140
191299
  const nameOf2 = (appDefId) => wanted.find((w2) => w2.appDefId === appDefId)?.vertical ?? appDefId;
@@ -191195,7 +191354,7 @@ __export(site_create_exports, {
191195
191354
  runSiteList: () => runSiteList,
191196
191355
  writeProvisioningBinding: () => writeProvisioningBinding
191197
191356
  });
191198
- import { existsSync as existsSync108, readFileSync as readFileSync125, writeFileSync as writeFileSync49 } from "node:fs";
191357
+ import { existsSync as existsSync108, readFileSync as readFileSync126, writeFileSync as writeFileSync49 } from "node:fs";
191199
191358
  import { resolve as resolvePath2 } from "node:path";
191200
191359
  function oauthClientName(projectName) {
191201
191360
  return `${projectName} client`;
@@ -191344,7 +191503,7 @@ async function runSiteCreate(opts) {
191344
191503
  if (!wantOauthApp) return { ...base, nextSteps: nextSteps(metaSiteId) };
191345
191504
  return { ...base, clientId, redirectUri, nextSteps: nextSteps(metaSiteId, clientId) };
191346
191505
  }
191347
- function writeProvisioningBinding(target, binding2, fs2 = { existsSync: existsSync108, readFileSync: readFileSync125, writeFileSync: writeFileSync49 }) {
191506
+ function writeProvisioningBinding(target, binding2, fs2 = { existsSync: existsSync108, readFileSync: readFileSync126, writeFileSync: writeFileSync49 }) {
191348
191507
  const msid = binding2.siteId;
191349
191508
  const path2 = resolvePath2(target);
191350
191509
  const committed = committedShellProvisioning(path2);
@@ -191740,9 +191899,9 @@ function redactVeloSource(source, knownSecrets = []) {
191740
191899
  const visitLiterals = (node) => {
191741
191900
  if (ts12.isStringLiteral(node) || ts12.isNoSubstitutionTemplateLiteral(node) || ts12.isTemplateExpression(node)) {
191742
191901
  const start = node.getStart(clean2);
191743
- const text11 = source.slice(start, node.end);
191744
- const redacted = redactLiteral(text11, start);
191745
- if (redacted !== text11) {
191902
+ const text12 = source.slice(start, node.end);
191903
+ const redacted = redactLiteral(text12, start);
191904
+ if (redacted !== text12) {
191746
191905
  edits.push({ start, end: node.end, text: redacted });
191747
191906
  return;
191748
191907
  }
@@ -192273,7 +192432,7 @@ var init_capture = __esm({
192273
192432
 
192274
192433
  // src/fidelity/judge.ts
192275
192434
  import { spawn as spawn7 } from "node:child_process";
192276
- import { copyFileSync as copyFileSync3, mkdtempSync as mkdtempSync11, readFileSync as readFileSync126, rmSync as rmSync32 } from "node:fs";
192435
+ import { copyFileSync as copyFileSync3, mkdtempSync as mkdtempSync11, readFileSync as readFileSync127, rmSync as rmSync32 } from "node:fs";
192277
192436
  import { tmpdir as tmpdir12 } from "node:os";
192278
192437
  import { basename as basename26, dirname as dirname58, join as join119, resolve as resolve83 } from "node:path";
192279
192438
  import { fileURLToPath as fileURLToPath32 } from "node:url";
@@ -192309,8 +192468,8 @@ async function judgeStrip(strip3, screen, variant, opts = {}) {
192309
192468
  const judgeDir = opts.judgeDir ?? SOURCE_JUDGE_DIR;
192310
192469
  let prompt, schema;
192311
192470
  try {
192312
- prompt = readFileSync126(resolve83(judgeDir, "JUDGE.md"), "utf8");
192313
- schema = readFileSync126(resolve83(judgeDir, "verdict.schema.json"), "utf8");
192471
+ prompt = readFileSync127(resolve83(judgeDir, "JUDGE.md"), "utf8");
192472
+ schema = readFileSync127(resolve83(judgeDir, "verdict.schema.json"), "utf8");
192314
192473
  } catch (e2) {
192315
192474
  return cannotTell(`the judge prompt could not be read from ${judgeDir}: ${e2.message}`);
192316
192475
  }
@@ -192698,7 +192857,7 @@ __export(fidelity_exports, {
192698
192857
  himalayaRepoRoot: () => himalayaRepoRoot
192699
192858
  });
192700
192859
  import { execFileSync as execFileSync10 } from "node:child_process";
192701
- import { existsSync as existsSync111, realpathSync as realpathSync17 } from "node:fs";
192860
+ import { existsSync as existsSync111, realpathSync as realpathSync18 } from "node:fs";
192702
192861
  import { join as join123, relative as relative20, sep as sep23 } from "node:path";
192703
192862
  function himalayaRepoRoot(dir) {
192704
192863
  let top;
@@ -192708,7 +192867,7 @@ function himalayaRepoRoot(dir) {
192708
192867
  return null;
192709
192868
  }
192710
192869
  if (!existsSync111(join123(top, "tools/judges/fidelity/JUDGE.md"))) return null;
192711
- const rel = relative20(realpathSync17(top), realpathSync17(dir));
192870
+ const rel = relative20(realpathSync18(top), realpathSync18(dir));
192712
192871
  return rel.startsWith(`..${sep23}`) || rel === ".." ? null : top;
192713
192872
  }
192714
192873
  function fidelityEnvelope(report3) {
@@ -192837,10 +192996,10 @@ var ServeCliClient = class {
192837
192996
  ...carriesCredential ? { redirect: "error" } : {},
192838
192997
  body: opts.rawBody !== void 0 ? new Uint8Array(opts.rawBody) : opts.body !== void 0 ? JSON.stringify(opts.body) : void 0
192839
192998
  });
192840
- const text11 = await res.text();
192999
+ const text12 = await res.text();
192841
193000
  let json8 = null;
192842
193001
  try {
192843
- json8 = text11 ? JSON.parse(text11) : null;
193002
+ json8 = text12 ? JSON.parse(text12) : null;
192844
193003
  } catch {
192845
193004
  json8 = null;
192846
193005
  }
@@ -192848,7 +193007,7 @@ var ServeCliClient = class {
192848
193007
  res.headers.forEach((v2, k2) => {
192849
193008
  h2[k2] = v2;
192850
193009
  });
192851
- return { status: res.status, ok: res.ok, json: json8, text: text11, headers: h2 };
193010
+ return { status: res.status, ok: res.ok, json: json8, text: text12, headers: h2 };
192852
193011
  }
192853
193012
  // ---- serve (device-facing reads) ----
192854
193013
  health(plane) {
@@ -194349,7 +194508,7 @@ var COMMANDS = [
194349
194508
  { name: "visibility", summary: "read (no value) or set whether the public registry (/v1/apps + the Himi Player picker) LISTS the app. `public` lists it for everyone; `unlisted` hides it from listings while direct reads by app id \u2014 deep links, previews \u2014 keep working. App from --app or the content dir. Setting it needs no republish.", required: "[public|unlisted] [--app <a>] [--content <dir>] (--control-token)" },
194350
194509
  { name: "dist", summary: "build an INSTALLABLE QA binary (signed IPA / APK) on the Wix Job Service Mac pool and return an install link \u2014 the serve plane brokers the job, the pool builds it. WAITS for the build by default (~4 min) and prints the install link; `--no-wait` returns a jobId immediately instead. Omitting `--release` builds whatever is LIVE for the app. A named draft is refused unless `--allow-draft` makes that exceptional build explicit. `status <jobId>` / `watch <jobId>` / `list --app <a>` / `cancel <jobId>` inspect and stop builds (`watch` reports up front whether the job mints its own signing identity or borrows one, so a doomed iOS build is cancellable in seconds rather than after the archive). Off-repo, name a target \u2014 `--target wix` for a self-serve Wix login or `--target bo` for the internal employee path (the in-repo default is a local dev plane that isn't reachable off-repo); self-serve callers may build their OWN apps under a tighter budget (2 in flight / 5 per 24h), while a manage-only owner-role credential is refused. `--shell` picks the native host to sign into (branded-lite | owner-lite | brandy | base44 | player | demo-app) and defaults to the content package's himalaya.content.json `shell` (templates carry the one they were written for), else branded-lite. The per-app shells ADD the release's declared capabilities to the binary, while Himi Player and demo-app refuse a release declaring one they lack; `--plan` previews it without building; `brandy` is the site shell \u2014 the customer's own website as native-framed tabs. `--signing` defaults to `wix-managed` \u2014 the Wix Apple account mints a per-app signing identity for the build, so the caller provisions no Apple credentials of their own; `--signing byo --site <id>` reuses an existing customer ad-hoc profile and certificate for iOS; requires an owned site and a completed personal signing binding. `--android-signing` is the Android counterpart and a SEPARATE axis (a keystore, not an Apple account): `qa-keystore` (default \u2014 the repo's committed QA key, identical on every pool machine, so a build installs over the previous one), `wix-keystore` (the Wix key the pool machine carries; the build FAILS naming the paths searched if it carries none, rather than quietly signing with something else), or `debug` (the old per-machine key \u2014 QA must uninstall any previous build first). `--aab` builds an Android App Bundle (.aab) for the owner to upload to Google Play AND an APK from the same build \u2014 a download link for the .aab, an install link and QR for the APK; Android only; the bundle is signed with the Wix production key (`wix-keystore`, the upload key Branded apps use) \u2014 any other `--android-signing` is refused \u2014 and the APK with the committed QA key; a self-serve caller gets one only as the store build of its own Containers app (it must own the app's site, and `--aab` sends your Wix login); any other self-serve `--aab` gets 403 android_format_not_allowed. NOT the normal way to ship: screens, Tier-5 bundles, tokens and app-config all go over the air with `himi push` in seconds \u2014 a binary trip is only needed for a NATIVE delta (a new SDUI component, a new declared capability/entitlement, a new bundle id, or a minBinaryVersion floor bump). Refuses to build an app whose launcher icon is missing, a placeholder, or one a store would reject \u2014 the one thing a binary carries that no later OTA push can fix; `--force` builds anyway. Also refuses a release whose member login (WixConsumerAuthProvider) names no siteId, or not in lower case, when Wix says its site requires a member CAPTCHA \u2014 such a binary ships without the CAPTCHA key and every member sign-in fails; whatever it cannot read (the release, the site's setting) only warns and builds; `--skip-captcha-check` builds anyway", required: "[--app <a>] [--platform ios,android] [--release <id>] [--allow-draft] [--target <t>] [--shell branded-lite|owner-lite|brandy|base44|player|demo-app] [--signing wix-managed|byo] [--site <id>] [--android-signing qa-keystore|wix-keystore|debug] [--aab] [--borrow-ios-id <bundleId>] [--no-wait] [--force] [--skip-captcha-check] [--plan] | status <jobId> [--target <t>] | watch <jobId> [--target <t>] [--interval <ms>] | list --app <a> [--target <t>] | cancel <jobId> [--target <t>]" },
194351
194510
  { name: "testflight", summary: 'build, sign and upload an app to TestFlight (internal testers \u2014 no Beta App Review), then WAIT until App Store Connect finishes processing it. Sugar for `store upload --track testflight`. Prompts first: a build number is consumed permanently on a real Apple account and cannot be reused \u2014 `--yes` for CI, `--dry-run` to see the plan without touching anything. The wait is the real check, not a nicety: fastlane prints "Successfully uploaded" for a binary App Store Connect then rejects in processing, and a rejected binary leaves NO build record at all (the reason is emailed). Public App Store review is deliberately NOT automatable here \u2014 `--track appstore` is refused; use /submit-ios-app when you mean to go public', required: "<app> [--track testflight|internal] [--profile <name>] [--yes] [--dry-run] [--skip-build] [--no-wait] [--json]" },
194352
- { name: "store", summary: "the App Store Connect group behind `testflight`. `preflight <app>` checks readiness offline (icon, entitlements, encryption flag, version, store.config ids, listing + review record); `upload <app>` is what `testflight` runs; `status <app>` reads live build + processing state. `--profile` selects WHICH App Store Connect account: an app built for a Wix customer ships under the CUSTOMER's Apple team (Apple guideline 4.2.6 forbids an app-generation service submitting on a client's behalf), declared per-app as ios.credentialProfile in store.config.yaml and resolved from ~/.himalaya/store-credentials/<name>.json \u2014 the .p8 itself never enters the repo. `iap draft|plan|apply|status|connect|screenshots|check|mappings` registers an app owner's digital products as in-app purchases (non-consumables, or consumable price tiers): draft reads the Wix catalog and writes the manifest, plan and status only read, apply is the one App Store mutation boundary, connect readies the Wix site to sell them (purchases app, In-App Purchase key, appleIAP provider, product mappings; --preview-tag routes only its Serve calls to a deploy preview), legacy screenshots --profile renders each product's purchase screen from the app (--content) as a bound iPhone shows it to a signed-in member and names the 1290\xD72796 PNG as the item's App Review screenshot, and none of them builds, signs or needs a checkout (`himi docs iap-products`) IAP provisioning defaults to Catalog; managed apply generates screenshots on the server with no local .p8 or profile fallback; --managed is optional and --profile selects legacy mode; --catalog-route or HIMI_IAP_CATALOG_ROUTE has no default.", required: "preflight <app> [--profile <n>] | upload <app> [--track <t>] [--profile <n>] [--yes] [--dry-run] | status <app> [--profile <n>] | iap draft --site <msid> " + IAP_CREDENTIAL_OPTIONS + " --apple-app <id> --bundle <id> --base-territory <t> --out <f> [--territories <a,b>] [--locale <l>] [--mode per-item|tiers] [--merge <f>] [--report <f>] [--json] | iap plan --manifest <f> " + IAP_CREDENTIAL_OPTIONS + " --out <f> [--json] | iap apply --plan <f> " + IAP_CREDENTIAL_OPTIONS + " --out <f> [--yes] [--limit <n>] [--no-submit] [--json] | iap status --manifest <f> " + IAP_CREDENTIAL_OPTIONS + " [--out <f>] [--json] | iap connect --manifest <f> [--profile <n>] [--catalog-route <prefix>] [--iap-key <AuthKey.p8> --iap-key-id <id>] [--content <dir>] [--preview-tag dp-<tag>] [--dry-run] [--yes] [--out <f>] [--json] | iap screenshots --manifest <f> --content <dir> --profile <n> [--out-dir <d>] [--only <id,\u2026>] [--force] [--dry-run] [--json] | iap check --manifest <f> --catalog-route <prefix> [--purchases-app <id>] [--content <dir>] [--plist <file>] [--visitor-client <id>] [--json] | iap mappings --site <msid> --purchases-app <id> --catalog-route <prefix> [--product <id> --active true|false --yes] [--json]" },
194511
+ { name: "store", summary: "`apple-keys setup|status` onboards the owner\u2019s ASC and In-App Purchase keys independently of push and signing profiles. The App Store Connect group behind `testflight`. `preflight <app>` checks readiness offline (icon, entitlements, encryption flag, version, store.config ids, listing + review record); `upload <app>` is what `testflight` runs; `status <app>` reads live build + processing state. `--profile` selects WHICH App Store Connect account: an app built for a Wix customer ships under the CUSTOMER's Apple team (Apple guideline 4.2.6 forbids an app-generation service submitting on a client's behalf), declared per-app as ios.credentialProfile in store.config.yaml and resolved from ~/.himalaya/store-credentials/<name>.json \u2014 the .p8 itself never enters the repo. `iap draft|plan|apply|status|connect|screenshots|check|mappings` registers an app owner's digital products as in-app purchases (non-consumables, or consumable price tiers): draft reads the Wix catalog and writes the manifest, plan and status only read, apply is the one App Store mutation boundary, connect readies the Wix site to sell them (purchases app, In-App Purchase key, appleIAP provider, product mappings; --preview-tag routes only its Serve calls to a deploy preview), legacy screenshots --profile renders each product's purchase screen from the app (--content) as a bound iPhone shows it to a signed-in member and names the 1290\xD72796 PNG as the item's App Review screenshot, and none of them builds, signs or needs a checkout (`himi docs iap-products`) IAP provisioning defaults to Catalog; managed apply generates screenshots on the server with no local .p8 or profile fallback; --managed is optional and --profile selects legacy mode; --catalog-route or HIMI_IAP_CATALOG_ROUTE has no default.", required: "apple-keys setup|status --app <slug> --site <metaSiteId> --bundle-id <id> [--asc-key-file <p8> --asc-key-id <id> --asc-issuer-id <issuer>] [--iap-key <p8> --iap-key-id <id> --iap-issuer-id <issuer>] [--yes|--dry-run] [--json] | preflight <app> [--profile <n>] | upload <app> [--track <t>] [--profile <n>] [--yes] [--dry-run] | status <app> [--profile <n>] | iap draft --site <msid> " + IAP_CREDENTIAL_OPTIONS + " --apple-app <id> --bundle <id> --base-territory <t> --out <f> [--territories <a,b>] [--locale <l>] [--mode per-item|tiers] [--merge <f>] [--report <f>] [--json] | iap plan --manifest <f> " + IAP_CREDENTIAL_OPTIONS + " --out <f> [--json] | iap apply --plan <f> " + IAP_CREDENTIAL_OPTIONS + " --out <f> [--yes] [--limit <n>] [--no-submit] [--json] | iap status --manifest <f> " + IAP_CREDENTIAL_OPTIONS + " [--out <f>] [--json] | iap connect --manifest <f> [--profile <n>] [--catalog-route <prefix>] [--iap-key <AuthKey.p8> --iap-key-id <id>] [--content <dir>] [--preview-tag dp-<tag>] [--dry-run] [--yes] [--out <f>] [--json] | iap screenshots --manifest <f> --content <dir> --profile <n> [--out-dir <d>] [--only <id,\u2026>] [--force] [--dry-run] [--json] | iap check --manifest <f> --catalog-route <prefix> [--purchases-app <id>] [--content <dir>] [--plist <file>] [--visitor-client <id>] [--json] | iap mappings --site <msid> --purchases-app <id> --catalog-route <prefix> [--product <id> --active true|false --yes] [--json]" },
194353
194512
  { name: "guide", summary: "print the Himalaya overview + headless dev loop + available topics (offline)", required: "[--json]" },
194354
194513
  { name: "docs", summary: "print bundled/verified cached guides offline; status reports kit identity; refresh downloads compatible reference content independently of CLI without changing app source", required: "[<topic>|catalog [kind]|status|refresh] [--pin <version|digest>] [--unpin] [--no-network] [--json]" },
194355
194514
  { name: "components", summary: "print the SDUI component vocabulary + props; a name = that component (offline)", required: "[<Name>] [--json]" },
@@ -195494,8 +195653,8 @@ async function templateCommand(ctx) {
195494
195653
  io2.error(JSON.stringify({ ok: false, error: e2.message }));
195495
195654
  return 2;
195496
195655
  }
195497
- const text11 = str3(flags.text) ?? (pos.slice(2).join(" ") || void 0);
195498
- if (!text11 && !verticals?.length) {
195656
+ const text12 = str3(flags.text) ?? (pos.slice(2).join(" ") || void 0);
195657
+ if (!text12 && !verticals?.length) {
195499
195658
  io2.error(JSON.stringify({
195500
195659
  ok: false,
195501
195660
  error: 'nothing to match \u2014 pass a business description (--text "\u2026"), --verticals stores,bookings, or --book <site analyze dir>',
@@ -195516,7 +195675,7 @@ async function templateCommand(ctx) {
195516
195675
  note = `remote catalog unreachable (${e2.message}); ranked the embedded templates only`;
195517
195676
  }
195518
195677
  }
195519
- const res = recommendTemplates2({ catalog: catalog4, verticals, text: text11 });
195678
+ const res = recommendTemplates2({ catalog: catalog4, verticals, text: text12 });
195520
195679
  print({
195521
195680
  ok: true,
195522
195681
  ...verticals?.length ? { verticals } : {},
@@ -196157,9 +196316,9 @@ function dpxSessionPresent(path2 = dpxSessionTokenPath()) {
196157
196316
  return false;
196158
196317
  }
196159
196318
  }
196160
- function isPortInUseError(text11) {
196161
- if (!text11) return false;
196162
- return /EADDRINUSE/i.test(text11) || new RegExp(`(:::|:)${DPX_SESSION_PORT}\\b`).test(text11);
196319
+ function isPortInUseError(text12) {
196320
+ if (!text12) return false;
196321
+ return /EADDRINUSE/i.test(text12) || new RegExp(`(:::|:)${DPX_SESSION_PORT}\\b`).test(text12);
196163
196322
  }
196164
196323
  function parseDpxAuthStatusIdentity(stdout) {
196165
196324
  if (!stdout) return void 0;
@@ -196312,23 +196471,23 @@ async function functionsCommand(ctx) {
196312
196471
  const app = str3(flags.app) ?? loaded.app;
196313
196472
  const invoked2 = await invokeRemoteFunction2({ baseUrl: target.baseUrl, app, definition, body: input, params, releaseId: remoteRelease, previewToken: str3(flags["preview-token"]), boCookie: boCookie() });
196314
196473
  const response = invoked2.response;
196315
- const text12 = await response.text();
196474
+ const text13 = await response.text();
196316
196475
  let body2;
196317
196476
  try {
196318
- body2 = JSON.parse(text12);
196477
+ body2 = JSON.parse(text13);
196319
196478
  } catch {
196320
- body2 = text12;
196479
+ body2 = text13;
196321
196480
  }
196322
196481
  print({ ok: response.ok, app, releaseId: remoteRelease ?? null, url: invoked2.url, status: response.status, body: body2 });
196323
196482
  return response.ok ? 0 : 1;
196324
196483
  }
196325
196484
  const invoked = await invokeLocalFunction2(loaded, name, input, params);
196326
- const text11 = await invoked.response.text();
196485
+ const text12 = await invoked.response.text();
196327
196486
  let body;
196328
196487
  try {
196329
- body = JSON.parse(text11);
196488
+ body = JSON.parse(text12);
196330
196489
  } catch {
196331
- body = text11;
196490
+ body = text12;
196332
196491
  }
196333
196492
  print({ ok: invoked.response.ok, app: loaded.app, releaseId: invoked.releaseId, status: invoked.response.status, body });
196334
196493
  return invoked.response.ok ? 0 : 1;
@@ -197495,8 +197654,8 @@ function pushAuthHint(status, token, target, hasOwnerIssuer = true) {
197495
197654
  }
197496
197655
  async function contentVisibility(dir) {
197497
197656
  try {
197498
- const { readFileSync: readFileSync127 } = await import("node:fs");
197499
- const m2 = JSON.parse(readFileSync127(join89(dir, "himalaya.content.json"), "utf8"));
197657
+ const { readFileSync: readFileSync128 } = await import("node:fs");
197658
+ const m2 = JSON.parse(readFileSync128(join89(dir, "himalaya.content.json"), "utf8"));
197500
197659
  if (m2.visibility === "public" || m2.visibility === "unlisted") return m2.visibility;
197501
197660
  } catch {
197502
197661
  }
@@ -198464,8 +198623,8 @@ import { resolve as resolve70 } from "node:path";
198464
198623
 
198465
198624
  // ../../core/admin-web/src/utils/qr-terminal.ts
198466
198625
  init_qr();
198467
- function qrTerminal(text11, opts = {}) {
198468
- const { modules, size } = encodeQr(text11);
198626
+ function qrTerminal(text12, opts = {}) {
198627
+ const { modules, size } = encodeQr(text12);
198469
198628
  const quietZone = opts.quietZone ?? 4;
198470
198629
  const dim = size + quietZone * 2;
198471
198630
  const dark = (x2, y2) => x2 >= quietZone && x2 < quietZone + size && y2 >= quietZone && y2 < quietZone + size ? modules[y2 - quietZone][x2 - quietZone] : false;
@@ -200036,6 +200195,10 @@ function wixPlayerTestflightTarget(requested) {
200036
200195
  }
200037
200196
  async function testflightCommand(ctx) {
200038
200197
  const { io: io2, deps, pos, flags, command } = ctx;
200198
+ if (command === "store" && pos[1] === "apple-keys") {
200199
+ const { runAppleKeys: runAppleKeys2 } = await Promise.resolve().then(() => (init_apple_keys(), apple_keys_exports));
200200
+ return runAppleKeys2(pos, flags, io2);
200201
+ }
200039
200202
  if (command === "store" && pos[1] === "iap") {
200040
200203
  const { runStoreIap: runStoreIap2, defaultStoreIapDeps: defaultStoreIapDeps2 } = await Promise.resolve().then(() => (init_store_iap(), store_iap_exports));
200041
200204
  return runStoreIap2(pos, flags, io2, { ...defaultStoreIapDeps2(), validateConfig: createTrimValidator(deps) });
@@ -200665,7 +200828,7 @@ ${label3}`);
200665
200828
 
200666
200829
  // src/commands/login.ts
200667
200830
  init_config();
200668
- import { readFileSync as readFileSync111 } from "node:fs";
200831
+ import { readFileSync as readFileSync112 } from "node:fs";
200669
200832
  init_browser_login();
200670
200833
  init_wix_owner();
200671
200834
  init_owner_claim();
@@ -200886,7 +201049,7 @@ async function loginCommand(ctx) {
200886
201049
  const dpxPath = dpxSessionTokenPath();
200887
201050
  let dpx;
200888
201051
  try {
200889
- dpx = readFileSync111(dpxPath, "utf8").trim();
201052
+ dpx = readFileSync112(dpxPath, "utf8").trim();
200890
201053
  } catch {
200891
201054
  io2.error(JSON.stringify({ error: `no dpx session at ${dpxPath} \u2014 run \`dpx auth login\` then \`dpx auth token > ${dpxPath}\` (dpx 2.x keeps its own state in ~/.dpx/auth.json and does NOT write the legacy session file), or omit --dpx` }));
200892
201055
  return 1;
@@ -201253,7 +201416,7 @@ async function upgradeCommand(ctx) {
201253
201416
 
201254
201417
  // src/commands/doctor.ts
201255
201418
  init_config();
201256
- import { statSync as statSync26, accessSync as accessSync2, constants as constants6 } from "node:fs";
201419
+ import { statSync as statSync27, accessSync as accessSync2, constants as constants6 } from "node:fs";
201257
201420
  import { join as join102 } from "node:path";
201258
201421
  init_wix_owner();
201259
201422
  init_owner_claim();
@@ -201301,7 +201464,7 @@ function executableOnPath(name, env = process.env) {
201301
201464
  for (const suffix of suffixes) {
201302
201465
  const candidate = join102(dir, `${name}${suffix}`);
201303
201466
  try {
201304
- if (!statSync26(candidate).isFile()) continue;
201467
+ if (!statSync27(candidate).isFile()) continue;
201305
201468
  if (process.platform !== "win32") accessSync2(candidate, constants6.X_OK);
201306
201469
  return true;
201307
201470
  } catch {
@@ -201744,7 +201907,7 @@ async function guideCommand(ctx) {
201744
201907
  }
201745
201908
 
201746
201909
  // src/commands/secrets.ts
201747
- import { readFileSync as readFileSync113 } from "node:fs";
201910
+ import { readFileSync as readFileSync114 } from "node:fs";
201748
201911
  init_cli_shared();
201749
201912
  async function secretsCommand(ctx) {
201750
201913
  const { io: io2, pos, flags } = ctx;
@@ -201765,7 +201928,7 @@ async function secretsCommand(ctx) {
201765
201928
  const path2 = dpxSessionTokenPath();
201766
201929
  let raw;
201767
201930
  try {
201768
- raw = readFileSync113(path2, "utf8");
201931
+ raw = readFileSync114(path2, "utf8");
201769
201932
  } catch {
201770
201933
  io2.error(JSON.stringify({ error: `no DPX BO session at ${path2}` }));
201771
201934
  return 1;
@@ -201783,7 +201946,7 @@ init_schema2();
201783
201946
  // src/cms.ts
201784
201947
  init_cms_schema();
201785
201948
  init_wix_owner();
201786
- import { existsSync as existsSync97, readFileSync as readFileSync114, writeFileSync as writeFileSync37 } from "node:fs";
201949
+ import { existsSync as existsSync97, readFileSync as readFileSync115, writeFileSync as writeFileSync37 } from "node:fs";
201787
201950
  import { join as join104 } from "node:path";
201788
201951
  var FOREIGN_DETAIL_LIMIT = 25;
201789
201952
  var MAX_COLLECTION_PAGES = 40;
@@ -202308,7 +202471,7 @@ function readSeedFile(dir) {
202308
202471
  if (!existsSync97(file2)) return {};
202309
202472
  let parsed;
202310
202473
  try {
202311
- parsed = JSON.parse(readFileSync114(file2, "utf8"));
202474
+ parsed = JSON.parse(readFileSync115(file2, "utf8"));
202312
202475
  } catch (e2) {
202313
202476
  throw new Error(`cms-seed.json is not valid JSON (${e2.message}). Fix or delete it.`);
202314
202477
  }
@@ -202370,7 +202533,7 @@ async function writeSeedRows(opts) {
202370
202533
  if (existsSync97(file2)) {
202371
202534
  let parsed;
202372
202535
  try {
202373
- parsed = JSON.parse(readFileSync114(file2, "utf8"));
202536
+ parsed = JSON.parse(readFileSync115(file2, "utf8"));
202374
202537
  } catch (e2) {
202375
202538
  throw new Error(
202376
202539
  `cms-seed.json is not valid JSON (${e2.message}). Refusing to regenerate, because overwriting it would discard the rows already in it. Fix the JSON, or delete the file if you want a fresh set.`
@@ -203268,14 +203431,14 @@ function createTrimValidator(deps = {}, spawnFn = spawn9) {
203268
203431
  const parsed = JSON.parse(report3);
203269
203432
  counts = parsed.counts;
203270
203433
  if (Array.isArray(parsed.findings)) {
203271
- const text11 = (v2) => typeof v2 === "string" && v2 ? v2 : void 0;
203434
+ const text12 = (v2) => typeof v2 === "string" && v2 ? v2 : void 0;
203272
203435
  errors = parsed.findings.filter((f2) => f2 && f2.severity === "error" && typeof f2.id === "string").map((f2) => ({
203273
203436
  id: f2.id,
203274
- message: text11(f2.message) ?? "",
203275
- ...text11(f2.pass) ? { pass: text11(f2.pass) } : {},
203276
- ...text11(f2.screen) ? { screen: text11(f2.screen) } : {},
203277
- ...text11(f2.path) ? { path: text11(f2.path) } : {},
203278
- ...text11(f2.ruleCode) ? { ruleCode: text11(f2.ruleCode) } : {}
203437
+ message: text12(f2.message) ?? "",
203438
+ ...text12(f2.pass) ? { pass: text12(f2.pass) } : {},
203439
+ ...text12(f2.screen) ? { screen: text12(f2.screen) } : {},
203440
+ ...text12(f2.path) ? { path: text12(f2.path) } : {},
203441
+ ...text12(f2.ruleCode) ? { ruleCode: text12(f2.ruleCode) } : {}
203279
203442
  }));
203280
203443
  }
203281
203444
  } catch {