@wix/himalaya-cli 0.1675.0 → 0.1676.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
@@ -2780,8 +2780,8 @@ async function readWip(store, app2) {
2780
2780
  if (!wipSupported(store)) return "unsupported";
2781
2781
  const { wip, promoted } = normalizeWipRecord(await store.getWipRecord(app2));
2782
2782
  if (!wip || promoted.some((p2) => p2.id === wip.releaseId)) return null;
2783
- const live3 = await store.getManifest(app2);
2784
- return live3?.releaseId === wip.releaseId ? null : wip;
2783
+ const live4 = await store.getManifest(app2);
2784
+ return live4?.releaseId === wip.releaseId ? null : wip;
2785
2785
  }
2786
2786
  var storedTime;
2787
2787
  var init_wip_pointer = __esm({
@@ -2802,15 +2802,15 @@ function validateFunctionManifest(manifest2) {
2802
2802
  throw new Error(`ReleaseManifest.functions[${fn2.name}] references missing bundle "${fn2.bundleHash}".`);
2803
2803
  }
2804
2804
  }
2805
- for (const schedule of manifest2.functionSchedules ?? []) {
2806
- if (!bundleHashes.has(schedule.bundleHash)) {
2807
- throw new Error(`ReleaseManifest.functionSchedules[${schedule.name}] references missing bundle "${schedule.bundleHash}".`);
2805
+ for (const schedule2 of manifest2.functionSchedules ?? []) {
2806
+ if (!bundleHashes.has(schedule2.bundleHash)) {
2807
+ throw new Error(`ReleaseManifest.functionSchedules[${schedule2.name}] references missing bundle "${schedule2.bundleHash}".`);
2808
2808
  }
2809
- const target = functionsByName.get(schedule.functionName);
2810
- if (!target) throw new Error(`ReleaseManifest.functionSchedules[${schedule.name}] references missing function "${schedule.functionName}".`);
2811
- if (target.bundleHash !== schedule.bundleHash) throw new Error(`ReleaseManifest.functionSchedules[${schedule.name}] bundle does not match function "${schedule.functionName}".`);
2809
+ const target = functionsByName.get(schedule2.functionName);
2810
+ if (!target) throw new Error(`ReleaseManifest.functionSchedules[${schedule2.name}] references missing function "${schedule2.functionName}".`);
2811
+ if (target.bundleHash !== schedule2.bundleHash) throw new Error(`ReleaseManifest.functionSchedules[${schedule2.name}] bundle does not match function "${schedule2.functionName}".`);
2812
2812
  if (target.wixIdentity !== "installation" || target.wixPermissions.length === 0) {
2813
- throw new Error(`ReleaseManifest.functionSchedules[${schedule.name}] requires an installation-identity function.`);
2813
+ throw new Error(`ReleaseManifest.functionSchedules[${schedule2.name}] requires an installation-identity function.`);
2814
2814
  }
2815
2815
  }
2816
2816
  }
@@ -15997,7 +15997,6 @@ function webViewOriginAllowed(url, origins) {
15997
15997
  }
15998
15998
  var init_webview_origin = __esm({
15999
15999
  "../../core/ts/src/webview-origin.ts"() {
16000
- "use strict";
16001
16000
  init_define_HHP_CATALOG();
16002
16001
  }
16003
16002
  });
@@ -21168,7 +21167,7 @@ function inputJson(input) {
21168
21167
  const json9 = JSON.stringify(input ?? {});
21169
21168
  return json9 === void 0 ? "{}" : json9;
21170
21169
  }
21171
- function timerGlobals(hide, live3) {
21170
+ function timerGlobals(hide, live4) {
21172
21171
  const hidden = new Set(hide ?? []);
21173
21172
  const stubs = {
21174
21173
  setTimeout: " globalThis.setTimeout = function () { return 0; };",
@@ -21194,7 +21193,7 @@ function timerGlobals(hide, live3) {
21194
21193
  setInterval: " globalThis.setInterval = function () { return 0; };",
21195
21194
  clearInterval: " globalThis.clearInterval = function () {};"
21196
21195
  };
21197
- const decls = live3 ? real : stubs;
21196
+ const decls = live4 ? real : stubs;
21198
21197
  return Object.entries(decls).filter(([name]) => !hidden.has(name)).map(([, src]) => src).join("\n");
21199
21198
  }
21200
21199
  function connectivityOnline(host) {
@@ -22252,7 +22251,7 @@ function createQuickJsWorkerRealm(options2 = {}) {
22252
22251
  );
22253
22252
  return thread;
22254
22253
  }
22255
- function answer(envelope, seq2) {
22254
+ function answer(envelope, seq3) {
22256
22255
  const bytes2 = encoder.encode(envelope);
22257
22256
  if (bytes2.length > data.length) {
22258
22257
  const err = encoder.encode(
@@ -22264,7 +22263,7 @@ function createQuickJsWorkerRealm(options2 = {}) {
22264
22263
  data.set(bytes2);
22265
22264
  Atomics.store(ctl, CTL_LEN, bytes2.length);
22266
22265
  }
22267
- Atomics.store(ctl, CTL_SEQ, seq2);
22266
+ Atomics.store(ctl, CTL_SEQ, seq3);
22268
22267
  Atomics.store(ctl, CTL_READY, 1);
22269
22268
  Atomics.notify(ctl, CTL_READY);
22270
22269
  }
@@ -38043,7 +38042,7 @@ import { createHash as createHash11 } from "node:crypto";
38043
38042
  function captureAccountSession(req, opts = {}) {
38044
38043
  const env = opts.env ?? process.env;
38045
38044
  const now = opts.now ?? Date.now();
38046
- const live3 = (cookie) => {
38045
+ const live4 = (cookie) => {
38047
38046
  const ws2 = /(?:^|;\s*)wixSession2=([^;]+)/.exec(cookie)?.[1];
38048
38047
  if (!ws2) return false;
38049
38048
  let value2 = ws2;
@@ -38054,10 +38053,10 @@ function captureAccountSession(req, opts = {}) {
38054
38053
  return !isWixSessionExpired(value2, now);
38055
38054
  };
38056
38055
  const fromRequest = forwardableWixSessionCookies(req.headers.cookie);
38057
- if (fromRequest && live3(fromRequest)) return { cookie: fromRequest, source: "cookie" };
38056
+ if (fromRequest && live4(fromRequest)) return { cookie: fromRequest, source: "cookie" };
38058
38057
  if (!opts.machineSession) return null;
38059
38058
  const fromEnv = forwardableWixSessionCookies(env.HIMI_WEB_ACCOUNT_COOKIE);
38060
- if (fromEnv && live3(fromEnv)) return { cookie: fromEnv, source: "env" };
38059
+ if (fromEnv && live4(fromEnv)) return { cookie: fromEnv, source: "env" };
38061
38060
  let fromFile = "";
38062
38061
  try {
38063
38062
  fromFile = readFileSync31(opts.dpxSessionPath ?? pathJoin2(homedir5(), ".dpx", "session", "wix-session"), "utf8").trim();
@@ -38065,7 +38064,7 @@ function captureAccountSession(req, opts = {}) {
38065
38064
  }
38066
38065
  if (fromFile && /^[^;\s=]+$/.test(fromFile)) {
38067
38066
  const cookie = `wixSession2=${fromFile}`;
38068
- if (live3(cookie)) return { cookie, source: "file" };
38067
+ if (live4(cookie)) return { cookie, source: "file" };
38069
38068
  }
38070
38069
  return null;
38071
38070
  }
@@ -40783,8 +40782,8 @@ function ImagePreviewScope({ node: node3, ctx, render: render3 }) {
40783
40782
  const id = React2.useId();
40784
40783
  const ref = React2.useRef(null);
40785
40784
  const prepared = React2.useRef();
40786
- const live3 = React2.useRef({ node: node3, ctx });
40787
- live3.current = { node: node3, ctx };
40785
+ const live4 = React2.useRef({ node: node3, ctx });
40786
+ live4.current = { node: node3, ctx };
40788
40787
  const mode = String(node3.modifiers?.imagePreview);
40789
40788
  const painted2 = React2.useRef({});
40790
40789
  const collections2 = React2.useRef(/* @__PURE__ */ new Map());
@@ -40808,13 +40807,13 @@ function ImagePreviewScope({ node: node3, ctx, render: render3 }) {
40808
40807
  const video = target.dataset.previewKind === "video" ? target.querySelector("video") ?? void 0 : void 0;
40809
40808
  if (video && !event.target.closest("[data-preview-open-video]")) return;
40810
40809
  event.stopPropagation();
40811
- const { node: node4, ctx: ctx2 } = live3.current;
40810
+ const { node: node4, ctx: ctx2 } = live4.current;
40812
40811
  if (!ctx2.onAction) return;
40813
40812
  if (prepared.current?.node !== node4) {
40814
- prepared.current = { node: node4, gallery: new ImagePreviewGallery(() => node4, (path2) => live3.current.ctx.provider?.value(path2), false) };
40813
+ prepared.current = { node: node4, gallery: new ImagePreviewGallery(() => node4, (path2) => live4.current.ctx.provider?.value(path2), false) };
40815
40814
  }
40816
- prepared.current.gallery.env = (raw) => evalEnvExpr(raw, ctxEnv(live3.current.ctx));
40817
- prepared.current.gallery.translate = (text22) => resolveTranslation(text22, live3.current.ctx.catalog);
40815
+ prepared.current.gallery.env = (raw) => evalEnvExpr(raw, ctxEnv(live4.current.ctx));
40816
+ prepared.current.gallery.translate = (text22) => resolveTranslation(text22, live4.current.ctx.catalog);
40818
40817
  const items = prepared.current.gallery.items(ctx2.itemScope ?? {}, painted2.current).filter((i2) => video ? i2.kind === "video" && JSON.stringify([i2.nodeId, ...i2.rowKeys ?? []]) === target.dataset.previewIdentity : i2.kind !== "video");
40819
40818
  const identity = target.dataset.previewIdentity;
40820
40819
  const identityFor = (item2) => JSON.stringify([item2.nodeId, ...item2.rowKeys ?? []]);
@@ -42113,13 +42112,13 @@ function easeScroll(all, instant2) {
42113
42112
  return ANCHOR_JUMP_MS;
42114
42113
  }
42115
42114
  function useTopAnchorReport(root, anchors, report9, content) {
42116
- const live3 = React8.useRef({ anchors, report: report9 });
42117
- live3.current = { anchors, report: report9 };
42115
+ const live4 = React8.useRef({ anchors, report: report9 });
42116
+ live4.current = { anchors, report: report9 };
42118
42117
  const tracker = React8.useRef(null);
42119
42118
  if (!tracker.current) {
42120
42119
  tracker.current = new TopAnchorTracker(
42121
- () => readTopAnchor(live3.current.anchors?.() ?? []),
42122
- (id) => live3.current.report(id)
42120
+ () => readTopAnchor(live4.current.anchors?.() ?? []),
42121
+ (id) => live4.current.report(id)
42123
42122
  );
42124
42123
  }
42125
42124
  const t2 = tracker.current;
@@ -42141,7 +42140,7 @@ function useTopAnchorReport(root, anchors, report9, content) {
42141
42140
  };
42142
42141
  }, [on4, t2, root]);
42143
42142
  return React8.useCallback((ms2) => {
42144
- if (live3.current.anchors) t2.jump(ms2);
42143
+ if (live4.current.anchors) t2.jump(ms2);
42145
42144
  }, [t2]);
42146
42145
  }
42147
42146
  var TOP_ANCHOR_TOLERANCE_PX, TOP_ANCHOR_SETTLE_MS, TOP_ANCHOR_JUMP_GRACE_MS, ANCHOR_JUMP_MS, SCROLL_SLACK_PX, tweens, INTERRUPTS, TopAnchorTracker;
@@ -43248,6 +43247,114 @@ var init_motionDefaults = __esm({
43248
43247
  }
43249
43248
  });
43250
43249
 
43250
+ // ../../core/web-renderer/src/inScreenMatch.ts
43251
+ function matchInScreen(before, after, opts = {}) {
43252
+ if (opts.reduceMotion) return [];
43253
+ const claimed = new Set(opts.claimed ?? []);
43254
+ const group = (entries) => {
43255
+ const m2 = /* @__PURE__ */ new Map();
43256
+ for (const e2 of entries) {
43257
+ if (!e2.id) continue;
43258
+ const list4 = m2.get(e2.id);
43259
+ if (list4) list4.push(e2);
43260
+ else m2.set(e2.id, [e2]);
43261
+ }
43262
+ return m2;
43263
+ };
43264
+ const b2 = group(before);
43265
+ const a2 = group(after);
43266
+ const out2 = [];
43267
+ for (const [id, was] of b2) {
43268
+ const now = a2.get(id);
43269
+ if (claimed.has(id) || was.length !== 1 || !now || now.length !== 1) continue;
43270
+ if (was[0].key === now[0].key || scopeOf(was[0]) !== scopeOf(now[0])) continue;
43271
+ out2.push(id);
43272
+ }
43273
+ return out2.sort();
43274
+ }
43275
+ function morphTiming(transition) {
43276
+ const m2 = /(\d+(?:\.\d+)?)(ms|s)\b\s*(.*)$/.exec(transition ?? "");
43277
+ if (!m2) return { duration: 200, easing: "ease-in-out" };
43278
+ return { duration: m2[2] === "s" ? Number(m2[1]) * 1e3 : Number(m2[1]), easing: m2[3].trim() || "ease-in-out" };
43279
+ }
43280
+ function rectOf(el2) {
43281
+ if (!el2) return null;
43282
+ const r3 = el2.getBoundingClientRect();
43283
+ return { left: r3.left, top: r3.top, width: r3.width, height: r3.height };
43284
+ }
43285
+ function noteEnter(e2) {
43286
+ live.set(e2.key, e2);
43287
+ entered.add(e2.key);
43288
+ schedule();
43289
+ }
43290
+ function noteLeave(key3, measure2) {
43291
+ const was = live.get(key3);
43292
+ live.delete(key3);
43293
+ entered.delete(key3);
43294
+ if (was) departed.push({ id: was.id, key: key3, scope: was.scope, rect: rectOf(measure2), radius: measure2 ? getComputedStyle(measure2).borderRadius : "" });
43295
+ schedule();
43296
+ }
43297
+ function schedule() {
43298
+ if (scheduled) return;
43299
+ scheduled = true;
43300
+ queueMicrotask(flush);
43301
+ }
43302
+ function navigating() {
43303
+ return typeof document !== "undefined" && !!document.activeViewTransition;
43304
+ }
43305
+ function flush() {
43306
+ scheduled = false;
43307
+ const left = departed;
43308
+ const arrived = entered;
43309
+ departed = [];
43310
+ entered = /* @__PURE__ */ new Set();
43311
+ if (!left.length || !arrived.size) return;
43312
+ const reduce = typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
43313
+ const nav = navigating();
43314
+ for (const scope3 of new Set(left.map(scopeOf))) playScope(scope3, left.filter((d2) => scopeOf(d2) === scope3), arrived, reduce, nav);
43315
+ }
43316
+ function playScope(scope3, left, arrived, reduce, nav) {
43317
+ const touched = new Set(left.map((d2) => d2.id));
43318
+ const after = [...live.values()].filter((l2) => touched.has(l2.id) && scopeOf(l2) === scope3);
43319
+ const before = [...after.filter((l2) => !arrived.has(l2.key)), ...left];
43320
+ const matched = matchInScreen(before, after, { reduceMotion: reduce, claimed: nav ? touched : [] });
43321
+ for (const id of matched) {
43322
+ const from = left.find((d2) => d2.id === id);
43323
+ const to2 = after.find((l2) => l2.id === id);
43324
+ const el2 = to2?.el();
43325
+ if (!from?.rect || !to2 || !el2 || typeof el2.animate !== "function") continue;
43326
+ const last = rectOf(el2);
43327
+ if (!last || last.width === 0 || last.height === 0) continue;
43328
+ const dx = from.rect.left + from.rect.width / 2 - (last.left + last.width / 2);
43329
+ const dy = from.rect.top + from.rect.height / 2 - (last.top + last.height / 2);
43330
+ const sx = from.rect.width / last.width;
43331
+ const sy = from.rect.height / last.height;
43332
+ const style = getComputedStyle(el2);
43333
+ const own6 = style.transform && style.transform !== "none" ? style.transform : "";
43334
+ const toRadius = style.borderRadius;
43335
+ el2.animate(
43336
+ [
43337
+ { transform: `translate(${dx}px, ${dy}px) scale(${sx}, ${sy})${own6 ? ` ${own6}` : ""}`, borderRadius: from.radius || toRadius },
43338
+ { transform: own6 || "none", borderRadius: toRadius }
43339
+ ],
43340
+ { duration: to2.duration, easing: to2.easing }
43341
+ );
43342
+ }
43343
+ }
43344
+ var scopeOf, live, departed, entered, scheduled, seq, nextMorphKey;
43345
+ var init_inScreenMatch = __esm({
43346
+ "../../core/web-renderer/src/inScreenMatch.ts"() {
43347
+ init_define_HHP_CATALOG();
43348
+ scopeOf = (e2) => e2.scope ?? "s";
43349
+ live = /* @__PURE__ */ new Map();
43350
+ departed = [];
43351
+ entered = /* @__PURE__ */ new Set();
43352
+ scheduled = false;
43353
+ seq = 0;
43354
+ nextMorphKey = () => `m${++seq}`;
43355
+ }
43356
+ });
43357
+
43251
43358
  // ../../core/web-renderer/src/boundTransforms.ts
43252
43359
  function boundNumber(value2) {
43253
43360
  if (typeof value2 === "number") return Number.isFinite(value2) ? value2 : void 0;
@@ -43567,8 +43674,8 @@ function createRicosHostSession(o2) {
43567
43674
  const t2 = o2.timers ?? realTimers;
43568
43675
  const flushMs = o2.flushTimeoutMs ?? RICOS_HOST_DEFAULTS.flushTimeoutMs;
43569
43676
  const debounceMs = o2.onChangeDebounceMs ?? RICOS_HOST_DEFAULTS.onChangeDebounceMs;
43570
- let seq2 = 0;
43571
- const newId = o2.newId ?? (() => `rq${Date.now().toString(36)}${++seq2}`);
43677
+ let seq3 = 0;
43678
+ const newId = o2.newId ?? (() => `rq${Date.now().toString(36)}${++seq3}`);
43572
43679
  const state = { ready: false, unavailable: null, dirty: false, toolbar: EMPTY_TOOLBAR, focused: false };
43573
43680
  let locale = o2.locale;
43574
43681
  let rtl = o2.rtl;
@@ -43990,7 +44097,7 @@ function RichContentEditorView({ props: props2, ctx, wrap, nodeId, renderChild,
43990
44097
  const C2 = ctx.color;
43991
44098
  const name = typeof props2.name === "string" && props2.name ? props2.name : void 0;
43992
44099
  const bag = React13.useContext(FormValuesContext);
43993
- const live3 = !!ctx.onAction;
44100
+ const live4 = !!ctx.onAction;
43994
44101
  const toolsKey = JSON.stringify(props2.tools ?? null);
43995
44102
  const tools = React13.useMemo(() => effectiveTools(props2.tools, props2.uploadService), [toolsKey, props2.uploadService]);
43996
44103
  const seedMode = typeof props2.documentJson === "string" ? "literal" : typeof props2.documentPath === "string" && props2.documentPath ? "binding" : "none";
@@ -44033,11 +44140,11 @@ function RichContentEditorView({ props: props2, ctx, wrap, nodeId, renderChild,
44033
44140
  const fireOnChangeRef = React13.useRef(fireOnChange);
44034
44141
  fireOnChangeRef.current = fireOnChange;
44035
44142
  React13.useEffect(() => {
44036
- if (live3) setSrc(new URL(ENGINE_PAGE_PATH, document.baseURI).toString());
44037
- }, [live3]);
44143
+ if (live4) setSrc(new URL(ENGINE_PAGE_PATH, document.baseURI).toString());
44144
+ }, [live4]);
44038
44145
  React13.useEffect(() => {
44039
44146
  const frame = iframeRef.current;
44040
- if (!live3 || !src || !frame) return;
44147
+ if (!live4 || !src || !frame) return;
44041
44148
  const t2 = ricosEditorWebTimings;
44042
44149
  const session = createRicosHostSession({
44043
44150
  send: (msg) => frame.contentWindow?.postMessage({ ricos: 1, msg }, "*"),
@@ -44082,7 +44189,7 @@ function RichContentEditorView({ props: props2, ctx, wrap, nodeId, renderChild,
44082
44189
  session.dispose();
44083
44190
  sessionRef.current = null;
44084
44191
  };
44085
- }, [live3, src]);
44192
+ }, [live4, src]);
44086
44193
  React13.useEffect(() => {
44087
44194
  sessionRef.current?.updateLocale(ctx.localeTag ?? "en", ctx.isRTL ?? document.documentElement.dir === "rtl");
44088
44195
  }, [ctx.localeTag, ctx.isRTL]);
@@ -44141,7 +44248,7 @@ function RichContentEditorView({ props: props2, ctx, wrap, nodeId, renderChild,
44141
44248
  setLink(null);
44142
44249
  };
44143
44250
  const root = { position: "relative", display: "flex", flexDirection: "column", width: "100%", ...fill ? { flex: "1 1 auto" } : {}, minHeight, ...wrap };
44144
- if (!live3) {
44251
+ if (!live4) {
44145
44252
  const { paddingTop: _t2, paddingBottom: _b, paddingLeft: _l2, paddingRight: _r2, ...rootNoSides } = root;
44146
44253
  const own6 = { ...rootNoSides, border: `1px solid ${C2("border", "#e3e3e3")}`, borderRadius: 8, padding: 12, boxSizing: "border-box" };
44147
44254
  return /* @__PURE__ */ jsx8("div", { ...dom, style: addIntrinsicPadding(own6, wrap) ?? own6, children: /* @__PURE__ */ jsx8("span", { style: { color: C2("textSecondary", "#636B78") }, children: placeholder3 || "Rich text editor" }) });
@@ -44526,7 +44633,7 @@ function createRadioGroups() {
44526
44633
  const owners = /* @__PURE__ */ new Map();
44527
44634
  const members2 = /* @__PURE__ */ new Map();
44528
44635
  const listeners2 = /* @__PURE__ */ new Set();
44529
- let seq2 = 0;
44636
+ let seq3 = 0;
44530
44637
  const emit = () => {
44531
44638
  for (const l2 of [...listeners2]) l2();
44532
44639
  };
@@ -44534,8 +44641,8 @@ function createRadioGroups() {
44534
44641
  /** A fresh member identity — per mounted radio, not per component id (rows of one bound
44535
44642
  * template share an id and must each be their own member). */
44536
44643
  newMember() {
44537
- seq2 += 1;
44538
- return `radio-${seq2}`;
44644
+ seq3 += 1;
44645
+ return `radio-${seq3}`;
44539
44646
  },
44540
44647
  owner(group) {
44541
44648
  return owners.get(group);
@@ -44681,8 +44788,8 @@ var init_controls = __esm({
44681
44788
  React15.useEffect(() => {
44682
44789
  setTapped(null);
44683
44790
  }, [bound2, props2.valuePath, ctx.provider]);
44684
- const live3 = standaloneService && tapped && tapped.path === props2.valuePath && Object.is(tapped.over, bound2) && tapped.provider === ctx.provider ? tapped.on : null;
44685
- const on4 = inForm && touchedField.current === fieldId && formOn !== null ? formOn : live3 ?? resolved2;
44791
+ const live4 = standaloneService && tapped && tapped.path === props2.valuePath && Object.is(tapped.over, bound2) && tapped.provider === ctx.provider ? tapped.on : null;
44792
+ const on4 = inForm && touchedField.current === fieldId && formOn !== null ? formOn : live4 ?? resolved2;
44686
44793
  const ruleKey = props2.validation ? JSON.stringify(props2.validation) : "";
44687
44794
  React15.useEffect(() => {
44688
44795
  if (!bag || !fieldId) return;
@@ -45211,7 +45318,7 @@ function isWithinTopModal(el2) {
45211
45318
  const top = topOver(el2);
45212
45319
  return top == null || top.el.contains(el2);
45213
45320
  }
45214
- function live() {
45321
+ function live2() {
45215
45322
  const out2 = [];
45216
45323
  for (const layer of layers) {
45217
45324
  const el2 = layer.el();
@@ -45246,7 +45353,7 @@ function topOf(candidates, all) {
45246
45353
  return top;
45247
45354
  }
45248
45355
  function topOver(target) {
45249
- const all = live();
45356
+ const all = live2();
45250
45357
  return topOf(all.filter((l2) => l2.scope.contains(target) || target.contains(l2.el)), all);
45251
45358
  }
45252
45359
  function topLayerOver(target) {
@@ -45257,7 +45364,7 @@ function sync() {
45257
45364
  watcher = null;
45258
45365
  for (const el2 of madeInert) el2.removeAttribute("inert");
45259
45366
  madeInert.clear();
45260
- const all = live();
45367
+ const all = live2();
45261
45368
  if (!all.length) return;
45262
45369
  const levels = /* @__PURE__ */ new Set();
45263
45370
  for (const scope3 of new Set(all.map((l2) => l2.scope))) {
@@ -47090,8 +47197,8 @@ function WebViewBridgeHost(p2) {
47090
47197
  const source2 = p2.htmlStr != null ? "\0html" : p2.urlStr ?? "";
47091
47198
  const origins = p2.allowedOrigins.join("\n");
47092
47199
  const sessionRef = React18.useRef(null);
47093
- const live3 = React18.useRef({ active: active2, muted });
47094
- live3.current = { active: active2, muted };
47200
+ const live4 = React18.useRef({ active: active2, muted });
47201
+ live4.current = { active: active2, muted };
47095
47202
  React18.useEffect(() => {
47096
47203
  if (typeof window === "undefined") return;
47097
47204
  if (p2.urlStr == null && p2.htmlStr == null) return;
@@ -47109,8 +47216,8 @@ function WebViewBridgeHost(p2) {
47109
47216
  consoleForwarding,
47110
47217
  win: window,
47111
47218
  frameWindow: () => p2.frameRef.current?.contentWindow ?? null,
47112
- active: live3.current.active,
47113
- muted: live3.current.muted
47219
+ active: live4.current.active,
47220
+ muted: live4.current.muted
47114
47221
  });
47115
47222
  session.start();
47116
47223
  sessionRef.current = session;
@@ -117477,7 +117584,7 @@ var init_pdf_worker_min = __esm({
117477
117584
  c2 = false;
117478
117585
  this[So].firstUnsplittable = null;
117479
117586
  this[So].noLayoutFailure = false;
117480
- const flush = (t4) => {
117587
+ const flush2 = (t4) => {
117481
117588
  const n3 = e2[xo]();
117482
117589
  if (n3) {
117483
117590
  c2 ||= n3.children?.length > 0;
@@ -117505,7 +117612,7 @@ var init_pdf_worker_min = __esm({
117505
117612
  }
117506
117613
  if (h3.isBreak()) {
117507
117614
  const e3 = h3.breakNode;
117508
- flush(t4);
117615
+ flush2(t4);
117509
117616
  if ("auto" === e3.targetType) continue;
117510
117617
  if (e3.leader) {
117511
117618
  l2 = this[gl](e3.leader, e3[zo]());
@@ -117531,7 +117638,7 @@ var init_pdf_worker_min = __esm({
117531
117638
  const n3 = e3[Ho](), a5 = n3.target;
117532
117639
  n3.addLeader = null !== n3.leader;
117533
117640
  n3.addTrailer = null !== n3.trailer;
117534
- flush(t4);
117641
+ flush2(t4);
117535
117642
  const s4 = t4;
117536
117643
  t4 = 1 / 0;
117537
117644
  if (a5 instanceof PageArea) o2 = a5;
@@ -117545,7 +117652,7 @@ var init_pdf_worker_min = __esm({
117545
117652
  }
117546
117653
  continue;
117547
117654
  }
117548
- flush(t4);
117655
+ flush2(t4);
117549
117656
  }
117550
117657
  this[So].pageNumber += 1;
117551
117658
  o2 && (o2[nl]() ? o2[So].numberOfUse += 1 : o2 = null);
@@ -127813,7 +127920,7 @@ function PdfDocument({ src, nativeSrc, title, height, startPage, zoomPercent, st
127813
127920
  frame2.scrollTop += (canvas.getBoundingClientRect().top - box.top) / scale;
127814
127921
  }, [startPage, pages2]);
127815
127922
  React19.useEffect(() => {
127816
- let live3 = true;
127923
+ let live4 = true;
127817
127924
  let loading;
127818
127925
  const container = containerRef.current;
127819
127926
  setFailedRequest(null);
@@ -127821,11 +127928,11 @@ function PdfDocument({ src, nativeSrc, title, height, startPage, zoomPercent, st
127821
127928
  void (async () => {
127822
127929
  if (!container) return;
127823
127930
  if (!container.ownerDocument.createElement("canvas").getContext("2d")) {
127824
- if (live3) setFailedRequest(request);
127931
+ if (live4) setFailedRequest(request);
127825
127932
  return;
127826
127933
  }
127827
127934
  const task = await loadDocument(src, container.ownerDocument);
127828
- if (!live3) {
127935
+ if (!live4) {
127829
127936
  void task.promise.catch(() => {
127830
127937
  });
127831
127938
  void destroyPdfDocumentLoad(task);
@@ -127833,13 +127940,13 @@ function PdfDocument({ src, nativeSrc, title, height, startPage, zoomPercent, st
127833
127940
  }
127834
127941
  loading = task;
127835
127942
  const document2 = await task.promise;
127836
- const count2 = await paintPdfDocument(document2, container, container.clientWidth || 600, startPageRef.current, zoomPercent, () => live3, onPageCount);
127837
- if (live3) setPages(count2);
127943
+ const count2 = await paintPdfDocument(document2, container, container.clientWidth || 600, startPageRef.current, zoomPercent, () => live4, onPageCount);
127944
+ if (live4) setPages(count2);
127838
127945
  })().catch(() => {
127839
- if (live3) setFailedRequest(request);
127946
+ if (live4) setFailedRequest(request);
127840
127947
  });
127841
127948
  return () => {
127842
- live3 = false;
127949
+ live4 = false;
127843
127950
  if (loading) void destroyPdfDocumentLoad(loading);
127844
127951
  container?.replaceChildren();
127845
127952
  };
@@ -128787,6 +128894,15 @@ function richContentDocumentHash(s2) {
128787
128894
  }
128788
128895
  return h2 >>> 0;
128789
128896
  }
128897
+ function visibilityDelegates(node3, ctx) {
128898
+ const mods = node3?.modifiers;
128899
+ const hp = mods?.hiddenPath ?? mods?.hidden_path;
128900
+ if (typeof hp === "string" && !isEnvExpr(hp) && isBinding(hp) && isStateBinding(hp) && !!ctx.provider) return true;
128901
+ const lit = typeof hp === "string" ? hp.trim().toLowerCase() : void 0;
128902
+ const litPath = lit === "true" || lit === "1" || lit === "false" || lit === "0";
128903
+ if ((typeof mods?.hidden === "boolean" || litPath) && exitSpecFor(mods, ctx)) return true;
128904
+ return typeof hp === "string" && isEnvExpr(hp) && !!exitSpecFor(mods, ctx);
128905
+ }
128790
128906
  function useBoundTransformMotion(node3, ctx) {
128791
128907
  const last = React20.useRef(void 0);
128792
128908
  const modifiers = node3?.modifiers;
@@ -130017,7 +130133,7 @@ function packOverlaps(items) {
130017
130133
  const result = [];
130018
130134
  let cluster = [];
130019
130135
  let clusterEnd = -Infinity;
130020
- const flush = () => {
130136
+ const flush2 = () => {
130021
130137
  if (!cluster.length) return;
130022
130138
  const columnsEnd = [];
130023
130139
  const placed = [];
@@ -130035,11 +130151,11 @@ function packOverlaps(items) {
130035
130151
  clusterEnd = -Infinity;
130036
130152
  };
130037
130153
  for (const item2 of sorted2) {
130038
- if (cluster.length && item2.startMin >= clusterEnd) flush();
130154
+ if (cluster.length && item2.startMin >= clusterEnd) flush2();
130039
130155
  cluster.push(item2);
130040
130156
  clusterEnd = Math.max(clusterEnd, item2.endMin);
130041
130157
  }
130042
- flush();
130158
+ flush2();
130043
130159
  return result;
130044
130160
  }
130045
130161
  function actionClick(ctx, action) {
@@ -130603,7 +130719,13 @@ function renderNode(node3, ctx) {
130603
130719
  }
130604
130720
  ensureFocusStyles();
130605
130721
  const bindings = directServiceBindings(node3);
130606
- return bindings.length > 0 && ctx.provider || boundTransformPaths(node3?.modifiers) ? /* @__PURE__ */ jsx13(ReactiveDirectScalars, { node: node3, ctx, bindings }) : renderNodeInner(node3, ctx);
130722
+ const rendered = bindings.length > 0 && ctx.provider || boundTransformPaths(node3?.modifiers) ? /* @__PURE__ */ jsx13(ReactiveDirectScalars, { node: node3, ctx, bindings }) : renderNodeInner(node3, ctx);
130723
+ const mods = node3?.modifiers;
130724
+ const tid2 = typeof mods?.transitionId === "string" ? resolvedComponentId(mods.transitionId, ctx) : void 0;
130725
+ if (tid2 && rendered != null && !visibilityDelegates(node3, ctx) && !ctx.reduceMotion() && !motionDeterministic()) {
130726
+ return /* @__PURE__ */ jsx13(InScreenMorphHost, { id: tid2, scope: ctx.screenId ?? "", transition: ctx.motionTransition(mods?.motion ?? ctx.kit?.motion), children: rendered });
130727
+ }
130728
+ return rendered;
130607
130729
  }
130608
130730
  function applyBoundTransforms(wrap, modifiers, bt2, motion, ctx) {
130609
130731
  if (bindsTransform(bt2.bound)) {
@@ -131414,7 +131536,7 @@ function reportUnknownComponent(ctx, pkg, type2) {
131414
131536
  function unknownComponentShowsDeveloperLabel(ctx) {
131415
131537
  return ctx.debugUnknownComponents ?? ctx.previewSurface != null;
131416
131538
  }
131417
- var AppearanceActionContext, rowValue, loadPdfFetch, WebViewBridgeHost2, useIsomorphicLayoutEffect2, GridColumnsContext, GridBoundList, GRID_SPAN_ALL, ResponsiveGrid, SPLIT_EXPANDED_MIN_WIDTH, SPLIT_COLUMN_GAP, ResponsiveSplitView, appearKeyframesInjected, valueSwapKeyframesInjected, NUMERIC_TEXT, shimmerKeyframesInjected, pressStylesInjected, REVEAL_ON_FOCUS_ATTR, FOCUS_RING_CSS, focusStylesInjected, HLIST_CHILD_CSS, hListStylesInjected, listAnimateRuntimeInstalled, transitionKeyframesInjected, countUpRuntimeInjected, MEASURE_PREFIX, measureRuntimeInjected, revealRuntimeInjected, AMBIENT_HOST_STYLE, AmbientMotionBox, vectorAnimStylesInjected, scrollProgressRuntimeInjected, confettiRuntimeInjected, lottieRuntimeInjected, LOTTIE_RUNTIME_ATTRIBUTES, lottieAnims, riveRuntimeInjected, gradientKeyframesInjected, parallaxRuntimeInjected, spinKeyframesInjected, marqueeKeyframesInjected, alignItems, zJustifyItems, hAlignItems, bodyFont, kids2, rowKidCtx, rowKids, staggeredKids, asTextL10n, asFinalTextL10n, asBoundText, useBoundString, asBoundCopy, useBoundCopy, InterpolatedTextView, txt, selectFragmentCase, fragmentValueHash, fragmentSlotContent, FragmentSlotNode, RichContentEditorNode, MediaFieldNode, WorkerSubtreeNode, RichContentNode, substituteItemDeep, resolveItemDeep2, resolveRowAction2, resolveSwipeActions, resolveModBindings, resolvedComponentId, directServiceBindings, withRootStyle, ReactiveDirectScalars, resolveNodeBoundTransforms, HiddenGate, ExitPresence, StatefulSectionNode, KEYBOARD_INPUT_MODES, AUTOCAPITALIZE_VALUES, ENTER_KEY_HINTS, AUTOGROW_CEILING, EditableField, MENU_ANCHOR_CONTROL, MenuNode, MENU_LONG_PRESS_MS, menuOpensOnLongPress, LoadMoreSentinel, FieldErrorNode, FormView, MediaSlotProvider, MEDIA_ITEM_BINDABLE, MediaPlayerView, VideoNode, PdfDocumentCanvas, PdfViewNode, WebViewNode, InteractivePicker, InteractiveDatePicker, InteractiveSearchField, InteractiveStepper, NODE_EXTRAS_TARGET, SYNTHETIC_TAP_ROLE, SYNTHETIC_TABINDEX, INFERRED_DECORATIVE, SELF_RENDERED_LEAF, ROLE_WHEN_NAMED, AUTHORED_ROLE, PENDING_RANGE, RANGE_ROLES, NODE_A11Y_ATTRS, INTERACTIVE_ROLES, ALWAYS_INTERACTIVE_COMPONENT_TYPES, TAP_ACTIVATOR_ATTR, TAP_GROUP_ATTR, NESTED_CONTROL_SELECTOR, VISUALLY_HIDDEN, NAME_SKIP_SELECTOR, activatorNameObservers, ACTIVATOR_STATE_ATTRS, controlNode, ToggleNode, SliderNode, SelectionControlNode, TabsNode, SegmentedControlNode, DisclosureGroupNode, GridNode, SplitViewNode, REVEAL_RELEASE_MS, REVEAL_FADE_MS, REVEAL_BUFFER, revealProgress, countWords, RevealText, TextNode, ImageNode, ANIMATION_LEAF, LottieNode, RiveNode, AvatarNode, IconNode, EMPTY_STATE_SPACING, EmptyStateNode, ERROR_STATE_VARIANTS, ERROR_STATE_SPACING, ErrorStateNode, ButtonNode, OtpInputNode, ProgressBarNode, SnackbarNode, ACTIVITY_DEFAULT_NAME, ACTIVITY_RING_ARC, ActivityIndicatorNode, NATIVELY_TABBABLE, BottomSheetNode, BOTTOM_DRAWER_HOST_STACK_EVENT, ModalBottomSheetNode, BottomDrawerNode, PRESENTED_OVERLAY_ATTR, TooltipNode, PopoverNode, ChipsInputNode, ChipNode, TableNode, GaugeRing, GaugeNode, RATING_METRICS, ratingMetrics, RatingNode, AvatarStripNode, CHART_STROKE_CYCLE, chartStrokeAt, chartBarCenter, ChartNode, donutSliceOpacity, DonutChartNode, QrCodeNode, ShapeNode, LegendMarker, LegendNode, cellAlign, dataTableProbe, DataTableNode, voiceNoteState, voiceNoteDelivery, VOICE_NOTE_DEFAULT_BARS, clampBarCount, VoiceNoteNode, LiveWaveformNode, TimelineNode, ECHO_WINDOW_MS, heldPageIndex, LiveWindowMeasured, LiveWindowPage, PagingNode, WheelPickerNode, ColorPickerNode, FilterChipsNode, TILE_PX, MAX_MERCATOR_LAT, DEFAULT_TILE_MAX_ZOOM, CIRCLE_SEGMENTS, METRES_PER_DEG_LAT, MARKER_HIT_RADIUS, SHAPE_HIT_RADIUS, MapNode, CAROUSEL_SETTLE_MS, railScrollLeft, carouselScrollLeft, scrollCarouselTo, CarouselNode, BannerNode, CollapsingHeaderNode, UnsupportedOnSurface, CALENDAR_DATE_ONLY_RE, CAL_DEFAULT_MAX_DOTS, CAL_AGENDA_INITIAL_DAYS, CAL_AGENDA_PAGE_DAYS, CAL_DEFAULT_SNAP_MINUTES, CAL_UNASSIGNED_LANE_ID, MonthCalendarNode, TimeGridNode, AgendaNode, ARIA_ROLE, initialFocusScheduled, PRESENTED_SCOPE, focusRoots, A11yHintDescription, rowRenderers, railRowFrame, renderRailRow, RowAnchors, reportedUnknownComponents, UnknownComponentNode, WebRenderer, ScrollIntoViewNode;
131539
+ var AppearanceActionContext, rowValue, loadPdfFetch, WebViewBridgeHost2, useIsomorphicLayoutEffect2, GridColumnsContext, GridBoundList, GRID_SPAN_ALL, ResponsiveGrid, SPLIT_EXPANDED_MIN_WIDTH, SPLIT_COLUMN_GAP, ResponsiveSplitView, appearKeyframesInjected, valueSwapKeyframesInjected, NUMERIC_TEXT, shimmerKeyframesInjected, pressStylesInjected, REVEAL_ON_FOCUS_ATTR, FOCUS_RING_CSS, focusStylesInjected, HLIST_CHILD_CSS, hListStylesInjected, listAnimateRuntimeInstalled, transitionKeyframesInjected, countUpRuntimeInjected, MEASURE_PREFIX, measureRuntimeInjected, revealRuntimeInjected, AMBIENT_HOST_STYLE, AmbientMotionBox, vectorAnimStylesInjected, scrollProgressRuntimeInjected, confettiRuntimeInjected, lottieRuntimeInjected, LOTTIE_RUNTIME_ATTRIBUTES, lottieAnims, riveRuntimeInjected, gradientKeyframesInjected, parallaxRuntimeInjected, spinKeyframesInjected, marqueeKeyframesInjected, alignItems, zJustifyItems, hAlignItems, bodyFont, kids2, rowKidCtx, rowKids, staggeredKids, asTextL10n, asFinalTextL10n, asBoundText, useBoundString, asBoundCopy, useBoundCopy, InterpolatedTextView, txt, selectFragmentCase, fragmentValueHash, fragmentSlotContent, FragmentSlotNode, RichContentEditorNode, MediaFieldNode, WorkerSubtreeNode, RichContentNode, substituteItemDeep, resolveItemDeep2, resolveRowAction2, resolveSwipeActions, resolveModBindings, resolvedComponentId, directServiceBindings, withRootStyle, InScreenMorphHost, ReactiveDirectScalars, resolveNodeBoundTransforms, HiddenGate, ExitPresence, StatefulSectionNode, KEYBOARD_INPUT_MODES, AUTOCAPITALIZE_VALUES, ENTER_KEY_HINTS, AUTOGROW_CEILING, EditableField, MENU_ANCHOR_CONTROL, MenuNode, MENU_LONG_PRESS_MS, menuOpensOnLongPress, LoadMoreSentinel, FieldErrorNode, FormView, MediaSlotProvider, MEDIA_ITEM_BINDABLE, MediaPlayerView, VideoNode, PdfDocumentCanvas, PdfViewNode, WebViewNode, InteractivePicker, InteractiveDatePicker, InteractiveSearchField, InteractiveStepper, NODE_EXTRAS_TARGET, SYNTHETIC_TAP_ROLE, SYNTHETIC_TABINDEX, INFERRED_DECORATIVE, SELF_RENDERED_LEAF, ROLE_WHEN_NAMED, AUTHORED_ROLE, PENDING_RANGE, RANGE_ROLES, NODE_A11Y_ATTRS, INTERACTIVE_ROLES, ALWAYS_INTERACTIVE_COMPONENT_TYPES, TAP_ACTIVATOR_ATTR, TAP_GROUP_ATTR, NESTED_CONTROL_SELECTOR, VISUALLY_HIDDEN, NAME_SKIP_SELECTOR, activatorNameObservers, ACTIVATOR_STATE_ATTRS, controlNode, ToggleNode, SliderNode, SelectionControlNode, TabsNode, SegmentedControlNode, DisclosureGroupNode, GridNode, SplitViewNode, REVEAL_RELEASE_MS, REVEAL_FADE_MS, REVEAL_BUFFER, revealProgress, countWords, RevealText, TextNode, ImageNode, ANIMATION_LEAF, LottieNode, RiveNode, AvatarNode, IconNode, EMPTY_STATE_SPACING, EmptyStateNode, ERROR_STATE_VARIANTS, ERROR_STATE_SPACING, ErrorStateNode, ButtonNode, OtpInputNode, ProgressBarNode, SnackbarNode, ACTIVITY_DEFAULT_NAME, ACTIVITY_RING_ARC, ActivityIndicatorNode, NATIVELY_TABBABLE, BottomSheetNode, BOTTOM_DRAWER_HOST_STACK_EVENT, ModalBottomSheetNode, BottomDrawerNode, PRESENTED_OVERLAY_ATTR, TooltipNode, PopoverNode, ChipsInputNode, ChipNode, TableNode, GaugeRing, GaugeNode, RATING_METRICS, ratingMetrics, RatingNode, AvatarStripNode, CHART_STROKE_CYCLE, chartStrokeAt, chartBarCenter, ChartNode, donutSliceOpacity, DonutChartNode, QrCodeNode, ShapeNode, LegendMarker, LegendNode, cellAlign, dataTableProbe, DataTableNode, voiceNoteState, voiceNoteDelivery, VOICE_NOTE_DEFAULT_BARS, clampBarCount, VoiceNoteNode, LiveWaveformNode, TimelineNode, ECHO_WINDOW_MS, heldPageIndex, LiveWindowMeasured, LiveWindowPage, PagingNode, WheelPickerNode, ColorPickerNode, FilterChipsNode, TILE_PX, MAX_MERCATOR_LAT, DEFAULT_TILE_MAX_ZOOM, CIRCLE_SEGMENTS, METRES_PER_DEG_LAT, MARKER_HIT_RADIUS, SHAPE_HIT_RADIUS, MapNode, CAROUSEL_SETTLE_MS, railScrollLeft, carouselScrollLeft, scrollCarouselTo, CarouselNode, BannerNode, CollapsingHeaderNode, UnsupportedOnSurface, CALENDAR_DATE_ONLY_RE, CAL_DEFAULT_MAX_DOTS, CAL_AGENDA_INITIAL_DAYS, CAL_AGENDA_PAGE_DAYS, CAL_DEFAULT_SNAP_MINUTES, CAL_UNASSIGNED_LANE_ID, MonthCalendarNode, TimeGridNode, AgendaNode, ARIA_ROLE, initialFocusScheduled, PRESENTED_SCOPE, focusRoots, A11yHintDescription, rowRenderers, railRowFrame, renderRailRow, RowAnchors, reportedUnknownComponents, UnknownComponentNode, WebRenderer, ScrollIntoViewNode;
131418
131540
  var init_renderNode = __esm({
131419
131541
  "../../core/web-renderer/src/renderNode.tsx"() {
131420
131542
  "use strict";
@@ -131459,6 +131581,7 @@ var init_renderNode = __esm({
131459
131581
  init_pickerField();
131460
131582
  init_symbolEffects();
131461
131583
  init_motionDefaults();
131584
+ init_inScreenMatch();
131462
131585
  init_boundTransforms();
131463
131586
  init_mediaProps();
131464
131587
  init_webviewFrame();
@@ -131593,12 +131716,12 @@ var init_renderNode = __esm({
131593
131716
  const react = () => {
131594
131717
  if (!alive) return;
131595
131718
  running = el2.animate(frames, { duration: total, easing: "ease-in-out", composite: "add" });
131596
- running.onfinish = () => schedule();
131719
+ running.onfinish = () => schedule2();
131597
131720
  };
131598
- const schedule = () => {
131721
+ const schedule2 = () => {
131599
131722
  if (alive) timer = setTimeout(react, ambientGapMs(kind, opts, Math.random()));
131600
131723
  };
131601
- schedule();
131724
+ schedule2();
131602
131725
  }
131603
131726
  return () => {
131604
131727
  alive = false;
@@ -131677,7 +131800,7 @@ var init_renderNode = __esm({
131677
131800
  const bound2 = Object.entries(params).filter(
131678
131801
  ([, v2]) => typeof v2 === "string" && isStateBinding(v2)
131679
131802
  );
131680
- const [live3, setLive] = React20.useState(() => {
131803
+ const [live4, setLive] = React20.useState(() => {
131681
131804
  const seed2 = {};
131682
131805
  if (ctx.provider) for (const [k3, p2] of bound2) seed2[k3] = ctx.provider.value(servicePath(p2));
131683
131806
  return seed2;
@@ -131691,7 +131814,7 @@ var init_renderNode = __esm({
131691
131814
  );
131692
131815
  return () => unsubs.forEach((u2) => u2());
131693
131816
  }, [ctx.provider, subKey]);
131694
- const resolved2 = { ...live3 };
131817
+ const resolved2 = { ...live4 };
131695
131818
  for (const [k3, v2] of Object.entries(params)) {
131696
131819
  if (typeof v2 === "string" && v2.startsWith("$item")) resolved2[k3] = resolveScalarStatic(v2, ctx);
131697
131820
  }
@@ -132050,6 +132173,18 @@ var init_renderNode = __esm({
132050
132173
  const element = content;
132051
132174
  return React20.cloneElement(element, { style: { ...element.props.style, ...style } });
132052
132175
  };
132176
+ InScreenMorphHost = ({ id, scope: scope3, transition, style, children: children2 }) => {
132177
+ const ref = React20.useRef(null);
132178
+ const key3 = React20.useRef("");
132179
+ if (!key3.current) key3.current = nextMorphKey();
132180
+ const timing = morphTiming(transition);
132181
+ React20.useLayoutEffect(() => {
132182
+ const k3 = key3.current;
132183
+ noteEnter({ id, key: k3, scope: scope3, el: () => ref.current?.firstElementChild, duration: timing.duration, easing: timing.easing });
132184
+ return () => noteLeave(k3, ref.current?.firstElementChild);
132185
+ }, [id, scope3]);
132186
+ return /* @__PURE__ */ jsx13("div", { ref, "data-himalaya-transition-id": id, style: { display: "contents" }, children: style ? withRootStyle(children2, style) : children2 });
132187
+ };
132053
132188
  ReactiveDirectScalars = ({ node: node3, ctx, bindings, style }) => {
132054
132189
  const [, rerender] = React20.useState(0);
132055
132190
  const bindingKey = bindings.join("|");
@@ -132791,18 +132926,18 @@ var init_renderNode = __esm({
132791
132926
  React20.useEffect(() => {
132792
132927
  const el2 = ref.current;
132793
132928
  if (!cursor || !ctx.onAction || !el2 || typeof IntersectionObserver === "undefined") return;
132794
- let live3 = true;
132929
+ let live4 = true;
132795
132930
  let root = el2.parentElement;
132796
132931
  while (root && !["auto", "scroll", "overlay"].includes(el2.ownerDocument.defaultView?.getComputedStyle(root).overflowY ?? "")) root = root.parentElement;
132797
132932
  const io2 = new IntersectionObserver((entries) => {
132798
- if (!live3 || !entries[entries.length - 1]?.isIntersecting) return;
132933
+ if (!live4 || !entries[entries.length - 1]?.isIntersecting) return;
132799
132934
  if (pages2.claim(cycle)) {
132800
132935
  ctx.onAction?.(workerTap.tapped(firedWithoutTap(action)));
132801
132936
  }
132802
132937
  }, { root, rootMargin: "0px 0px 320px 0px" });
132803
132938
  io2.observe(el2);
132804
132939
  return () => {
132805
- live3 = false;
132940
+ live4 = false;
132806
132941
  io2.disconnect();
132807
132942
  };
132808
132943
  }, [pages2, cycle, cursor, ctx.onAction, action]);
@@ -133355,12 +133490,12 @@ var init_renderNode = __esm({
133355
133490
  const [retyped, setRetyped] = React20.useState(null);
133356
133491
  React20.useEffect(() => {
133357
133492
  if (!retypeSrc) return;
133358
- let live3 = true;
133493
+ let live4 = true;
133359
133494
  let made = null;
133360
133495
  const settle2 = (r3) => {
133361
133496
  const u2 = r3?.url ?? null;
133362
133497
  made = u2;
133363
- if (!live3) {
133498
+ if (!live4) {
133364
133499
  if (u2) URL.revokeObjectURL(u2);
133365
133500
  return;
133366
133501
  }
@@ -133368,7 +133503,7 @@ var init_renderNode = __esm({
133368
133503
  };
133369
133504
  loadPdfFetch().then((m2) => m2.retypeAsPdfCounted(retypeSrc)).then(settle2, () => settle2(null));
133370
133505
  return () => {
133371
- live3 = false;
133506
+ live4 = false;
133372
133507
  if (made) URL.revokeObjectURL(made);
133373
133508
  setRetyped((cur) => cur?.from === retypeSrc ? null : cur);
133374
133509
  };
@@ -133381,15 +133516,15 @@ var init_renderNode = __esm({
133381
133516
  const [direct, setDirect] = React20.useState(null);
133382
133517
  React20.useEffect(() => {
133383
133518
  if (!directSrc) return;
133384
- let live3 = true;
133519
+ let live4 = true;
133385
133520
  let made = null;
133386
133521
  loadPdfFetch().then((m2) => m2.fetchPdfDocument(splitFragment(directSrc).base), () => null).then((doc) => {
133387
- if (!live3) return;
133522
+ if (!live4) return;
133388
133523
  made = wantsShare && doc ? URL.createObjectURL(doc.blob) : null;
133389
133524
  setDirect({ from: directSrc, count: doc?.pageCount ?? null, blobUrl: made });
133390
133525
  });
133391
133526
  return () => {
133392
- live3 = false;
133527
+ live4 = false;
133393
133528
  if (made) URL.revokeObjectURL(made);
133394
133529
  setDirect((cur) => cur?.from === directSrc ? null : cur);
133395
133530
  };
@@ -134922,7 +135057,7 @@ var init_renderNode = __esm({
134922
135057
  const drag = React20.useRef(null);
134923
135058
  const reduceMotion = ctx.reduceMotion();
134924
135059
  const [mounted, setMounted] = React20.useState(shown2);
134925
- const [entered, setEntered] = React20.useState(shown2 && ctx.staticRender === true);
135060
+ const [entered2, setEntered] = React20.useState(shown2 && ctx.staticRender === true);
134926
135061
  React20.useEffect(() => {
134927
135062
  if (shown2) {
134928
135063
  setMounted(true);
@@ -134955,7 +135090,7 @@ var init_renderNode = __esm({
134955
135090
  }, [mounted]);
134956
135091
  if (!shown2 && !mounted) return null;
134957
135092
  const leaving = !shown2;
134958
- const atRest = entered && !leaving;
135093
+ const atRest = entered2 && !leaving;
134959
135094
  const grabber = props2.showGrabber !== false && edge === "bottom";
134960
135095
  const sheet = idiomControls(ctx.idiom).sheet;
134961
135096
  const r3 = `${sheet.cornerRadius}px`;
@@ -135076,7 +135211,7 @@ var init_renderNode = __esm({
135076
135211
  }, [shown2]);
135077
135212
  const reduceMotion = ctx.reduceMotion();
135078
135213
  const [mounted, setMounted] = React20.useState(shown2);
135079
- const [entered, setEntered] = React20.useState(shown2 && ctx.staticRender === true);
135214
+ const [entered2, setEntered] = React20.useState(shown2 && ctx.staticRender === true);
135080
135215
  React20.useEffect(() => {
135081
135216
  if (shown2) {
135082
135217
  setMounted(true);
@@ -135229,7 +135364,7 @@ var init_renderNode = __esm({
135229
135364
  const index = Math.min(detentIndex, Math.max(detents.length - 1, 0));
135230
135365
  dragState.current = { index, count: detents.length, dismissible };
135231
135366
  const leaving = !shown2;
135232
- const atRest = entered && !leaving;
135367
+ const atRest = entered2 && !leaving;
135233
135368
  const grabber = props2.showGrabber !== false;
135234
135369
  const dragFrame = drawerDragFrame(index, detents, regionPx, dragDy, dismissible);
135235
135370
  const sized = detents.length && regionPx > 0 ? { height: `${Math.round(dragFrame.heightPx ?? detents[index] * regionPx)}px`, display: "flex", flexDirection: "column" } : {};
@@ -136378,7 +136513,7 @@ var init_renderNode = __esm({
136378
136513
  const granted = providerAllowsLiveAudio(ctx.provider);
136379
136514
  const canRun = gateOpen && sourceKnown && granted && !ctx.empty && typeof requestAnimationFrame === "function";
136380
136515
  const [levels, setLevels] = React20.useState(() => new Array(bars).fill(0));
136381
- const [live3, setLive] = React20.useState(false);
136516
+ const [live4, setLive] = React20.useState(false);
136382
136517
  React20.useEffect(() => {
136383
136518
  const flat2 = () => {
136384
136519
  setLive(false);
@@ -136423,13 +136558,13 @@ var init_renderNode = __esm({
136423
136558
  };
136424
136559
  }, [canRun, bars, ctx.liveAudioLevel]);
136425
136560
  const color = ctx.color(resolveScalarStatic(props2.color, ctx) ?? "accentPrimary", "#116DFF");
136426
- const glide = live3 && !ctx.reduceMotion() ? `height ${Math.round(LIVE_WAVEFORM_MIN_FRAME_MS * 4)}ms linear` : void 0;
136561
+ const glide = live4 && !ctx.reduceMotion() ? `height ${Math.round(LIVE_WAVEFORM_MIN_FRAME_MS * 4)}ms linear` : void 0;
136427
136562
  const minBar = 2;
136428
136563
  return /* @__PURE__ */ jsx13(
136429
136564
  "div",
136430
136565
  {
136431
- "data-live-waveform-state": live3 ? "live" : "idle",
136432
- "data-a11y-value": live3 ? "live" : "idle",
136566
+ "data-live-waveform-state": live4 ? "live" : "idle",
136567
+ "data-a11y-value": live4 ? "live" : "idle",
136433
136568
  "aria-hidden": "true",
136434
136569
  ...{ [INFERRED_DECORATIVE]: true, [ROLE_WHEN_NAMED]: "img" },
136435
136570
  style: { display: "flex", alignItems: "center", gap: 2, height, width: "100%", boxSizing: "border-box", ...wrap },
@@ -136442,9 +136577,9 @@ var init_renderNode = __esm({
136442
136577
  maxWidth: 6,
136443
136578
  minWidth: 1,
136444
136579
  borderRadius: 999,
136445
- height: live3 ? Math.max(minBar, Math.round(v2 * height)) : minBar,
136580
+ height: live4 ? Math.max(minBar, Math.round(v2 * height)) : minBar,
136446
136581
  background: color,
136447
- opacity: live3 ? 1 : 0.3,
136582
+ opacity: live4 ? 1 : 0.3,
136448
136583
  transition: glide
136449
136584
  }
136450
136585
  },
@@ -141053,9 +141188,9 @@ async function handleOwnerSitesRequest(req, res) {
141053
141188
  try {
141054
141189
  const { fetchLiveOwnerSites } = await import("./apps/wix-owner-clone-live.js");
141055
141190
  const { buildWixOwnerCloneSites } = await import("./apps/wix-owner-clone-app.js");
141056
- const live3 = await fetchLiveOwnerSites();
141057
- if (live3) {
141058
- payload = { sites: live3 };
141191
+ const live4 = await fetchLiveOwnerSites();
141192
+ if (live4) {
141193
+ payload = { sites: live4 };
141059
141194
  } else {
141060
141195
  source2 = "fallback";
141061
141196
  payload = buildWixOwnerCloneSites();
@@ -141507,7 +141642,7 @@ async function handleHotReloadCommand(req, res, state) {
141507
141642
  function startBundleArtifactWatcher(state) {
141508
141643
  const pending2 = /* @__PURE__ */ new Set();
141509
141644
  let timer;
141510
- const flush = () => {
141645
+ const flush2 = () => {
141511
141646
  timer = void 0;
141512
141647
  const bundles = [...pending2].sort();
141513
141648
  pending2.clear();
@@ -141526,7 +141661,7 @@ function startBundleArtifactWatcher(state) {
141526
141661
  if (!bundle) return;
141527
141662
  pending2.add(bundle);
141528
141663
  if (timer) clearTimeout(timer);
141529
- timer = setTimeout(flush, 120);
141664
+ timer = setTimeout(flush2, 120);
141530
141665
  });
141531
141666
  watcher2.on("error", (err) => {
141532
141667
  console.warn(`[himalaya-dev] bundle watcher stopped: ${err.message}`);
@@ -141546,10 +141681,10 @@ function startBundleSourceWatcher(state) {
141546
141681
  const pending2 = /* @__PURE__ */ new Set();
141547
141682
  let timer;
141548
141683
  let building = false;
141549
- const flush = async () => {
141684
+ const flush2 = async () => {
141550
141685
  timer = void 0;
141551
141686
  if (building) {
141552
- timer = setTimeout(flush, 120);
141687
+ timer = setTimeout(flush2, 120);
141553
141688
  return;
141554
141689
  }
141555
141690
  const names2 = [...pending2].sort();
@@ -141573,7 +141708,7 @@ function startBundleSourceWatcher(state) {
141573
141708
  if (!name || name.startsWith(".")) return;
141574
141709
  pending2.add(name);
141575
141710
  if (timer) clearTimeout(timer);
141576
- timer = setTimeout(flush, 200);
141711
+ timer = setTimeout(flush2, 200);
141577
141712
  });
141578
141713
  watcher2.on("error", (err) => {
141579
141714
  console.warn(`[himalaya-dev] bundle source watcher stopped: ${err.message}`);
@@ -141803,10 +141938,10 @@ function startAppSourceWatcher(state) {
141803
141938
  const pending2 = /* @__PURE__ */ new Set();
141804
141939
  let timer;
141805
141940
  let reloading = false;
141806
- const flush = async () => {
141941
+ const flush2 = async () => {
141807
141942
  timer = void 0;
141808
141943
  if (reloading) {
141809
- timer = setTimeout(flush, 120);
141944
+ timer = setTimeout(flush2, 120);
141810
141945
  return;
141811
141946
  }
141812
141947
  const paths2 = [...pending2];
@@ -141845,7 +141980,7 @@ function startAppSourceWatcher(state) {
141845
141980
  if (!classifyAppPath(rel2)) return;
141846
141981
  pending2.add(rel2);
141847
141982
  if (timer) clearTimeout(timer);
141848
- timer = setTimeout(flush, 200);
141983
+ timer = setTimeout(flush2, 200);
141849
141984
  });
141850
141985
  watcher2.on("error", (err) => {
141851
141986
  console.warn(`[himalaya-dev] app source watcher stopped: ${err.message}`);
@@ -142117,15 +142252,15 @@ async function handleWebWix(req, res, state) {
142117
142252
  await pipeWebWixStream(upstream2, res, abort.signal, recordStream);
142118
142253
  return;
142119
142254
  }
142120
- const live3 = currentBindingSession(session, state);
142121
- if (!live3.visitorToken && !live3.memberToken) {
142255
+ const live4 = currentBindingSession(session, state);
142256
+ if (!live4.visitorToken && !live4.memberToken) {
142122
142257
  try {
142123
- live3.visitorToken = await mintAppVisitor(state.app, live3);
142258
+ live4.visitorToken = await mintAppVisitor(state.app, live4);
142124
142259
  } catch {
142125
142260
  }
142126
142261
  }
142127
- const isMember = !!live3.memberToken;
142128
- let token = live3.memberToken ?? live3.visitorToken ?? "";
142262
+ const isMember = !!live4.memberToken;
142263
+ let token = live4.memberToken ?? live4.visitorToken ?? "";
142129
142264
  let upstream = await webWixStream(method, target.toString(), body, token, void 0, forwardedHeaders, abort.signal);
142130
142265
  if ((upstream.status === 401 || upstream.status === 403) && !isMember && !abort.signal.aborted) {
142131
142266
  try {
@@ -142133,7 +142268,7 @@ async function handleWebWix(req, res, state) {
142133
142268
  } catch {
142134
142269
  }
142135
142270
  try {
142136
- const again = currentBindingSession(live3, state);
142271
+ const again = currentBindingSession(live4, state);
142137
142272
  token = again.visitorToken = await mintAppVisitor(state.app, again);
142138
142273
  upstream = await webWixStream(method, target.toString(), body, token, void 0, forwardedHeaders, abort.signal);
142139
142274
  } catch {
@@ -142425,19 +142560,19 @@ async function handleWebWix(req, res, state) {
142425
142560
  return reply(status, { error: auth2 ? "webwix_owner_mint_failed" : "webwix_bridge_upstream_failed" });
142426
142561
  }
142427
142562
  }
142428
- const live3 = currentBindingSession(session, state);
142429
- if (!live3.visitorToken && !live3.memberToken) {
142563
+ const live4 = currentBindingSession(session, state);
142564
+ if (!live4.visitorToken && !live4.memberToken) {
142430
142565
  try {
142431
- live3.visitorToken = await mintAppVisitor(state.app, live3);
142566
+ live4.visitorToken = await mintAppVisitor(state.app, live4);
142432
142567
  } catch {
142433
142568
  }
142434
142569
  }
142435
- const token = live3.memberToken ?? live3.visitorToken ?? "";
142570
+ const token = live4.memberToken ?? live4.visitorToken ?? "";
142436
142571
  try {
142437
142572
  let r3 = await webWixCall(method, requestedPath, body, token, void 0, forwardedHeaders);
142438
- if ((r3.status === 401 || r3.status === 403) && !live3.memberToken) {
142573
+ if ((r3.status === 401 || r3.status === 403) && !live4.memberToken) {
142439
142574
  try {
142440
- const again = currentBindingSession(live3, state);
142575
+ const again = currentBindingSession(live4, state);
142441
142576
  again.visitorToken = await mintAppVisitor(state.app, again);
142442
142577
  r3 = await webWixCall(method, requestedPath, body, again.visitorToken, void 0, forwardedHeaders);
142443
142578
  } catch {
@@ -142534,10 +142669,10 @@ async function handleDev(req, res, state) {
142534
142669
  }
142535
142670
  let descriptor = body.descriptor;
142536
142671
  if (!descriptor && body.screenId) {
142537
- const live3 = await liveDescriptorFor(state, body.screenId);
142538
- if ("refusal" in live3) {
142539
- const diagnostics2 = depthRefusalDiagnostics(state, live3.refusal);
142540
- const legacy2 = { screenId: body.screenId, scheme, renderable: false, reason: `depth_budget_exceeded: ${live3.refusal.finding.message}`, diagnostics: diagnostics2 };
142672
+ const live4 = await liveDescriptorFor(state, body.screenId);
142673
+ if ("refusal" in live4) {
142674
+ const diagnostics2 = depthRefusalDiagnostics(state, live4.refusal);
142675
+ const legacy2 = { screenId: body.screenId, scheme, renderable: false, reason: `depth_budget_exceeded: ${live4.refusal.finding.message}`, diagnostics: diagnostics2 };
142541
142676
  const report10 = foldLegacyReport(legacy2, {
142542
142677
  source: "render",
142543
142678
  screenId: body.screenId,
@@ -142548,7 +142683,7 @@ async function handleDev(req, res, state) {
142548
142683
  });
142549
142684
  return sendJson(res, body.envelope === 1 ? 422 : 200, report10);
142550
142685
  }
142551
- descriptor = live3.descriptor;
142686
+ descriptor = live4.descriptor;
142552
142687
  }
142553
142688
  if (!descriptor || typeof descriptor !== "object") {
142554
142689
  return sendJson(res, 404, { error: "screen_not_found", screenId: body.screenId ?? null });
@@ -142598,9 +142733,9 @@ async function handleDev(req, res, state) {
142598
142733
  const diagMatch = /^\/__dev\/screen\/(.+?)\/diagnostics(?:\?|$)/.exec(url);
142599
142734
  if (diagMatch && req.method === "GET") {
142600
142735
  const screenId = decodeURIComponent(diagMatch[1]);
142601
- const live3 = await liveDescriptorFor(state, screenId);
142602
- if ("refusal" in live3) return sendJson(res, 422, depthRefusalDiagnostics(state, live3.refusal));
142603
- const descriptor = live3.descriptor;
142736
+ const live4 = await liveDescriptorFor(state, screenId);
142737
+ if ("refusal" in live4) return sendJson(res, 422, depthRefusalDiagnostics(state, live4.refusal));
142738
+ const descriptor = live4.descriptor;
142604
142739
  if (!descriptor) return sendJson(res, 404, { error: "screen_not_found", screenId });
142605
142740
  const diag = await runScreenDiagnostics(state, screenId, descriptor);
142606
142741
  return sendJson(res, diag.ok ? 200 : 422, diag);
@@ -143042,9 +143177,9 @@ async function handleAdminPlayground(req, res, state) {
143042
143177
  if (validateMatch && req.method === "GET") {
143043
143178
  const screenId = decodeURIComponent(validateMatch[1]);
143044
143179
  const strict = /[?&]strict=1(?:&|$)/.test(url);
143045
- const live3 = await liveDescriptorFor(state, screenId);
143046
- if ("refusal" in live3) return sendJson(res, 422, depthRefusalReport(live3.refusal, strict));
143047
- const descriptor = live3.descriptor;
143180
+ const live4 = await liveDescriptorFor(state, screenId);
143181
+ if ("refusal" in live4) return sendJson(res, 422, depthRefusalReport(live4.refusal, strict));
143182
+ const descriptor = live4.descriptor;
143048
143183
  if (!descriptor) return sendJson(res, 404, { error: "screen_not_found", screenId });
143049
143184
  const { validateScreenDescriptor: validateScreenDescriptor2, loadAllowedComponents: loadAllowedComponents2, readBuiltBundle: readBuiltBundle2, readBuiltBundleMap: readBuiltBundleMap2, appWorkerActionsFor: appWorkerActionsFor2, appWorkerServicesFor: appWorkerServicesFor2, appServicesContextFor: appServicesContextFor2 } = await Promise.resolve().then(() => (init_validate_descriptor(), validate_descriptor_exports));
143050
143185
  const tokens2 = readAppTokens(state) ?? void 0;
@@ -149078,7 +149213,7 @@ async function buildFromLoaded(preloaded, dest, opts = {}) {
149078
149213
  } else {
149079
149214
  const counting = countingWixCall(await ensureLiveWixCall());
149080
149215
  const host = collect2.render.host ? countingHostAnswers(collect2.render.host) : void 0;
149081
- const live3 = await liveRenderServices(bundleJs, {
149216
+ const live4 = await liveRenderServices(bundleJs, {
149082
149217
  wixCall: counting.call,
149083
149218
  input,
149084
149219
  budgetMs: collect2.render.loadBudgetMs ?? LIVE_LOAD_BUDGET_MS,
@@ -149086,14 +149221,14 @@ async function buildFromLoaded(preloaded, dest, opts = {}) {
149086
149221
  descriptor,
149087
149222
  ...host ? { host: host.host } : {}
149088
149223
  });
149089
- base2 = live3.services;
149090
- liveCalls = [...live3.calls];
149224
+ base2 = live4.services;
149225
+ liveCalls = [...live4.calls];
149091
149226
  liveReturned = counting.returned();
149092
149227
  if (host) liveReturned += host.answered();
149093
149228
  liveFailed = counting.failed();
149094
149229
  liveEmpty = counting.empty();
149095
149230
  liveRefused = counting.refused();
149096
- liveErrors = live3.errors;
149231
+ liveErrors = live4.errors;
149097
149232
  }
149098
149233
  } else if (collect2?.render?.mocks && collect2.render.hydrate !== false && bundleName && readBundle(bundleName)) {
149099
149234
  const calls = [];
@@ -149935,10 +150070,10 @@ async function buildFunctionsOnlyRelease(preloaded, dest) {
149935
150070
  functions: built.map((item2) => item2.record),
149936
150071
  ...config.functions.siteBinding ? { functionSiteBinding: { ...config.functions.siteBinding } } : {},
149937
150072
  ...functionDataResources ? { functionDataResources } : {},
149938
- ...config.functions.schedules?.length ? { functionSchedules: config.functions.schedules.map((schedule) => {
149939
- const target = built.find((item2) => item2.name === schedule.functionName);
149940
- if (!target) throw new Error(`function schedule "${schedule.name}" references unknown function "${schedule.functionName}"`);
149941
- return { ...schedule, bundleHash: target.bundleHash };
150073
+ ...config.functions.schedules?.length ? { functionSchedules: config.functions.schedules.map((schedule2) => {
150074
+ const target = built.find((item2) => item2.name === schedule2.functionName);
150075
+ if (!target) throw new Error(`function schedule "${schedule2.name}" references unknown function "${schedule2.functionName}"`);
150076
+ return { ...schedule2, bundleHash: target.bundleHash };
149942
150077
  }) } : {}
149943
150078
  };
149944
150079
  const sha4 = gitSha();
@@ -156262,9 +156397,9 @@ var init_src8 = __esm({
156262
156397
  });
156263
156398
 
156264
156399
  // ../../node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js
156265
- function hasSeq(data, seq2, i2) {
156266
- for (let j2 = 0; j2 < seq2.length; j2++) {
156267
- if (seq2[j2] !== data[i2 + j2 + 1]) return false;
156400
+ function hasSeq(data, seq3, i2) {
156401
+ for (let j2 = 0; j2 < seq3.length; j2++) {
156402
+ if (seq3[j2] !== data[i2 + j2 + 1]) return false;
156268
156403
  }
156269
156404
  return true;
156270
156405
  }
@@ -160169,9 +160304,9 @@ function decodeContentInfo(bytes2) {
160169
160304
  function contentInfos(info4, password) {
160170
160305
  if (!info4) return [];
160171
160306
  if (info4.oid === OID.data) {
160172
- const seq2 = readSequence(info4.payload, 0);
160173
- if (!seq2) return walkSafeBags(info4.payload, password);
160174
- return walkContentInfoList(seq2.contents, password);
160307
+ const seq3 = readSequence(info4.payload, 0);
160308
+ if (!seq3) return walkSafeBags(info4.payload, password);
160309
+ return walkContentInfoList(seq3.contents, password);
160175
160310
  }
160176
160311
  if (info4.oid === OID.encryptedData) {
160177
160312
  const decrypted = decryptEncryptedData(info4.payload, password);
@@ -160183,22 +160318,22 @@ function walkContentInfoList(bytes2, password) {
160183
160318
  const out2 = [];
160184
160319
  let i2 = 0;
160185
160320
  while (i2 < bytes2.length) {
160186
- const seq2 = readSequence(bytes2, i2);
160187
- if (!seq2) break;
160188
- const inner = decodeContentInfo(seq2.contents);
160321
+ const seq3 = readSequence(bytes2, i2);
160322
+ if (!seq3) break;
160323
+ const inner = decodeContentInfo(seq3.contents);
160189
160324
  if (inner?.oid === OID.data) {
160190
160325
  out2.push(...walkSafeBags(inner.payload, password));
160191
160326
  } else if (inner?.oid === OID.encryptedData) {
160192
160327
  const decrypted = decryptEncryptedData(inner.payload, password);
160193
160328
  if (decrypted) out2.push(...walkSafeBags(decrypted, password));
160194
160329
  }
160195
- i2 = seq2.end;
160330
+ i2 = seq3.end;
160196
160331
  }
160197
160332
  return out2;
160198
160333
  }
160199
160334
  function walkSafeBags(bytes2, password) {
160200
- const seq2 = bytes2[0] === 48 ? readSequence(bytes2, 0) : void 0;
160201
- const body = seq2 ? seq2.contents : bytes2;
160335
+ const seq3 = bytes2[0] === 48 ? readSequence(bytes2, 0) : void 0;
160336
+ const body = seq3 ? seq3.contents : bytes2;
160202
160337
  const out2 = [];
160203
160338
  let i2 = 0;
160204
160339
  while (i2 < body.length) {
@@ -160226,8 +160361,8 @@ function decodeSafeBag(bytes2, password) {
160226
160361
  return [];
160227
160362
  }
160228
160363
  function decodeCertBag(bytes2) {
160229
- const seq2 = readSequence(bytes2, 0);
160230
- const body = seq2 ? seq2.contents : bytes2;
160364
+ const seq3 = readSequence(bytes2, 0);
160365
+ const body = seq3 ? seq3.contents : bytes2;
160231
160366
  const oid = readOid(body, 0);
160232
160367
  if (!oid || oid.oid !== OID.x509Certificate) return [];
160233
160368
  const wrapped = readContext(body, oid.end, 0);
@@ -160241,11 +160376,11 @@ function decodeCertBag(bytes2) {
160241
160376
  }
160242
160377
  }
160243
160378
  function decryptEncryptedData(bytes2, password) {
160244
- const seq2 = readSequence(bytes2, 0);
160245
- if (!seq2) return void 0;
160246
- const ver = readInteger(seq2.contents, 0);
160379
+ const seq3 = readSequence(bytes2, 0);
160380
+ if (!seq3) return void 0;
160381
+ const ver = readInteger(seq3.contents, 0);
160247
160382
  if (!ver) return void 0;
160248
- const info4 = readSequence(seq2.contents, ver.end);
160383
+ const info4 = readSequence(seq3.contents, ver.end);
160249
160384
  if (!info4) return void 0;
160250
160385
  const contentType = readOid(info4.contents, 0);
160251
160386
  if (!contentType) return void 0;
@@ -160259,8 +160394,8 @@ function decryptEncryptedData(bytes2, password) {
160259
160394
  return decryptPbe(alg.contents, ciphertext, password);
160260
160395
  }
160261
160396
  function decryptShroudedKey(bytes2, password) {
160262
- const seq2 = readSequence(bytes2, 0);
160263
- const body = seq2 ? seq2.contents : bytes2;
160397
+ const seq3 = readSequence(bytes2, 0);
160398
+ const body = seq3 ? seq3.contents : bytes2;
160264
160399
  const alg = readSequence(body, 0);
160265
160400
  if (!alg) return void 0;
160266
160401
  const oct = readOctetString(body, alg.end);
@@ -164341,7 +164476,7 @@ async function runNotifySetup(pos, flags, io2, deps = {}) {
164341
164476
  if (ownership.state !== "owned") return refuse4(io2, "app_ownership_unverified", void 0, 1);
164342
164477
  input.app = ownership.slug;
164343
164478
  const common2 = { target, wixToken, previewTag, fetchImpl: deps.fetchImpl };
164344
- const readStatus = (live3 = false) => pushSetupRequest({ ...common2, operation: "status", query: { app: input.app, site: input.site, ...live3 ? { verify: "live" } : {} } });
164479
+ const readStatus = (live4 = false) => pushSetupRequest({ ...common2, operation: "status", query: { app: input.app, site: input.site, ...live4 ? { verify: "live" } : {} } });
164345
164480
  if (operation === "status") return report(await readStatus(flags.refresh === true), flags, io2, dir);
164346
164481
  const previous = await readStatus();
164347
164482
  if (!previous.ok || !STATES.has(String(previous.body?.state))) return report(previous, flags, io2, dir);
@@ -166559,7 +166694,7 @@ function watchReminder(dir, opts = {}) {
166559
166694
  try {
166560
166695
  if (!existsSync55(join51(dir, "himalaya.content.json"))) return void 0;
166561
166696
  const nowDate = opts.now ?? /* @__PURE__ */ new Date();
166562
- const live3 = liveWatch(dir, opts.isAlive, nowDate);
166697
+ const live4 = liveWatch(dir, opts.isAlive, nowDate);
166563
166698
  const now = nowDate.getTime();
166564
166699
  const file2 = join51(dir, REMINDERS_FILE);
166565
166700
  let last = Number.NaN;
@@ -166571,8 +166706,8 @@ function watchReminder(dir, opts = {}) {
166571
166706
  if (!realDirIn(dir, ".himi")) return void 0;
166572
166707
  writeFileAtomic(file2, `${JSON.stringify({ watch: new Date(now).toISOString() })}
166573
166708
  `);
166574
- if (live3) {
166575
- return `the live preview is running at ${live3.url} (pid ${live3.pid}${live3.by === "init" ? ", started by himi init" : ""}) \u2014 it repaints on every save, and the build board is ${live3.board}; give the owner that link to click around while you work, and do not start another`;
166709
+ if (live4) {
166710
+ return `the live preview is running at ${live4.url} (pid ${live4.pid}${live4.by === "init" ? ", started by himi init" : ""}) \u2014 it repaints on every save, and the build board is ${live4.board}; give the owner that link to click around while you work, and do not start another`;
166576
166711
  }
166577
166712
  const content = opts.content ?? displayPath(dir);
166578
166713
  const remote = readInitSource(dir)?.source === "remote" ? "init did not start it because this template came off the serve plane \u2014 once you have read its code, " : "";
@@ -166619,9 +166754,9 @@ async function startWatchAtInit(dir, opts) {
166619
166754
  const note = given.length ? { note: watchOptOutIgnoredNote(given) } : {};
166620
166755
  const deps = { ...defaultStartWatchDeps, ...opts.deps };
166621
166756
  const now = opts.now ?? /* @__PURE__ */ new Date();
166622
- const live3 = liveWatch(dir, deps.isAlive, now);
166623
- if (live3 && (live3.by === "init" || await deps.previewRunning(dir))) {
166624
- return { skipped: `a live preview of this app is already running (pid ${live3.pid})`, url: live3.url, board: live3.board, pid: live3.pid, ...note };
166757
+ const live4 = liveWatch(dir, deps.isAlive, now);
166758
+ if (live4 && (live4.by === "init" || await deps.previewRunning(dir))) {
166759
+ return { skipped: `a live preview of this app is already running (pid ${live4.pid})`, url: live4.url, board: live4.board, pid: live4.pid, ...note };
166625
166760
  }
166626
166761
  try {
166627
166762
  const port = await deps.freePort(previewPortForDir(dir));
@@ -168647,6 +168782,9 @@ function verticalsFromBook(path2) {
168647
168782
  function recommendTemplates(input) {
168648
168783
  const text22 = input.text ?? "";
168649
168784
  const owner = OWNER_WORDS.test(text22);
168785
+ const role = owner ? "owner" : "customer";
168786
+ const roleOf2 = (name) => /owner/.test(name) ? "owner" : "customer";
168787
+ const context = input.context?.trim() ? input.context : void 0;
168650
168788
  const rows = new Map(input.catalog.map((row2) => [row2.name, rowTokens([row2.name, row2.title ?? "", row2.description ?? "", ...row2.tags ?? [], row2.category ?? ""].join(" "))]));
168651
168789
  const hays = new Map([...rows].map(([name, r3]) => [name, r3.tokens]));
168652
168790
  const known = new Set([...hays.values()].flatMap((h2) => [...h2]));
@@ -168657,6 +168795,7 @@ function recommendTemplates(input) {
168657
168795
  const byName3 = /* @__PURE__ */ new Map();
168658
168796
  const fits = /* @__PURE__ */ new Set();
168659
168797
  const siteFits = /* @__PURE__ */ new Set();
168798
+ const requestFits = /* @__PURE__ */ new Set();
168660
168799
  for (const row2 of input.catalog) {
168661
168800
  const reasons = [];
168662
168801
  let score = 0;
@@ -168667,7 +168806,10 @@ function recommendTemplates(input) {
168667
168806
  if (hit.length) {
168668
168807
  const depth = rows.get(row2.name).depth;
168669
168808
  score += hit.reduce((n2, t2) => n2 + weight(t2) * (t2.startsWith("@") ? depthCredit(depth.get(t2) ?? 0) : 1), 0) / wantWeight;
168670
- if ((hit.some((t2) => t2.startsWith("@")) || hit.length >= 2) && owner === isOwner) fits.add(row2.name);
168809
+ if ((hit.some((t2) => t2.startsWith("@")) || hit.length >= 2) && owner === isOwner) {
168810
+ fits.add(row2.name);
168811
+ requestFits.add(row2.name);
168812
+ }
168671
168813
  reasons.push(`matches ${hit.map((h2) => h2.startsWith("@") ? `${h2.slice(1)} words` : `"${h2}"`).join(", ")}`);
168672
168814
  const more = extras.get(row2.name);
168673
168815
  if (more.length) reasons.push(`also covers ${more.map((t2) => t2.slice(1)).join(", ")}, which the brief did not ask for`);
@@ -168681,7 +168823,21 @@ function recommendTemplates(input) {
168681
168823
  score -= 0.3;
168682
168824
  }
168683
168825
  }
168684
- byName3.set(row2.name, { name: row2.name, score, reasons, ...row2.source ? { source: row2.source } : {} });
168826
+ byName3.set(row2.name, { name: row2.name, score, reasons, ...row2.source ? { source: row2.source } : {}, role: roleOf2(row2.name), fit: "none" });
168827
+ }
168828
+ const contextMatch = /* @__PURE__ */ new Map();
168829
+ if (context !== void 0 && want.size) {
168830
+ const named3 = new Set(tokens(context).filter((t2) => t2.startsWith("@") && known.has(t2)));
168831
+ const added = [...named3].filter((t2) => !asked.has(t2));
168832
+ for (const name of added.length ? requestFits : []) {
168833
+ const hay = hays.get(name);
168834
+ if ([...hay].some((t2) => t2.startsWith("@") && !asked.has(t2) && !named3.has(t2))) continue;
168835
+ const depth = rows.get(name).depth;
168836
+ const hit = added.filter((t2) => hay.has(t2));
168837
+ if (!hit.length) continue;
168838
+ contextMatch.set(name, hit.reduce((n2, t2) => n2 + depthCredit(depth.get(t2) ?? 0), 0));
168839
+ byName3.get(name).reasons.push(`the context also names ${hit.map((t2) => t2.slice(1)).join(", ")} (used only to order equal scores)`);
168840
+ }
168685
168841
  }
168686
168842
  if (input.verticals?.length) {
168687
168843
  for (const c2 of scoreOverlays(input.verticals, "")) {
@@ -168701,8 +168857,12 @@ function recommendTemplates(input) {
168701
168857
  fb.score = Math.max(fb.score + 0.25, best + 0.01);
168702
168858
  fb.reasons.push(owner ? "the default start for owner/operations apps" : "the default start for a customer app on a Wix site");
168703
168859
  }
168704
- const ranked = [...byName3.values()].map((r3) => ({ ...r3, score: Math.round(r3.score * 1e3) / 1e3 })).filter((r3) => r3.score > 0).sort((a2, b2) => b2.score - a2.score || Number(siteFits.has(b2.name)) - Number(siteFits.has(a2.name)) || (extras.get(a2.name)?.length ?? 0) - (extras.get(b2.name)?.length ?? 0) || Number(b2.name === fallback) - Number(a2.name === fallback) || a2.name.localeCompare(b2.name));
168705
- return { owner, ranked };
168860
+ const ranked = [...byName3.values()].map((r3) => ({
168861
+ ...r3,
168862
+ score: Math.round(r3.score * 1e3) / 1e3,
168863
+ fit: requestFits.has(r3.name) ? "request" : siteFits.has(r3.name) && r3.role === role ? "site" : r3.name === fallback ? "default" : "none"
168864
+ })).filter((r3) => r3.score > 0).sort((a2, b2) => b2.score - a2.score || (contextMatch.get(b2.name) ?? 0) - (contextMatch.get(a2.name) ?? 0) || Number(siteFits.has(b2.name)) - Number(siteFits.has(a2.name)) || (extras.get(a2.name)?.length ?? 0) - (extras.get(b2.name)?.length ?? 0) || Number(b2.name === fallback) - Number(a2.name === fallback) || a2.name.localeCompare(b2.name));
168865
+ return { owner, role, defaultTemplate: fb ? fallback : null, ...context !== void 0 ? { contextApplied: true } : {}, ranked };
168706
168866
  }
168707
168867
  var OWNER_WORDS, STOP, CONCEPTS, CONCEPT_OF, tokens, depthCredit, weight, BookRefusal, readJson7, uniq;
168708
168868
  var init_template_recommend = __esm({
@@ -170329,16 +170489,16 @@ function requireStr() {
170329
170489
  return str6;
170330
170490
  }
170331
170491
  function requireSeq() {
170332
- if (hasRequiredSeq) return seq;
170492
+ if (hasRequiredSeq) return seq2;
170333
170493
  hasRequiredSeq = 1;
170334
170494
  const Type22 = requireType();
170335
- seq = new Type22("tag:yaml.org,2002:seq", {
170495
+ seq2 = new Type22("tag:yaml.org,2002:seq", {
170336
170496
  kind: "sequence",
170337
170497
  construct: function(data) {
170338
170498
  return data !== null ? data : [];
170339
170499
  }
170340
170500
  });
170341
- return seq;
170501
+ return seq2;
170342
170502
  }
170343
170503
  function requireMap() {
170344
170504
  if (hasRequiredMap) return map;
@@ -172996,7 +173156,7 @@ function requireJsYaml() {
172996
173156
  jsYaml.safeDump = renamed("safeDump", "dump");
172997
173157
  return jsYaml;
172998
173158
  }
172999
- var jsYaml, loader, common, hasRequiredCommon, exception, hasRequiredException, snippet, hasRequiredSnippet, type, hasRequiredType, schema, hasRequiredSchema, str6, hasRequiredStr, seq, hasRequiredSeq, map, hasRequiredMap, failsafe, hasRequiredFailsafe, _null, hasRequired_null, bool2, hasRequiredBool, int2, hasRequiredInt, float, hasRequiredFloat, json2, hasRequiredJson, core, hasRequiredCore, timestamp, hasRequiredTimestamp, merge, hasRequiredMerge, binary, hasRequiredBinary, omap, hasRequiredOmap, pairs, hasRequiredPairs, set, hasRequiredSet, _default, hasRequired_default, hasRequiredLoader, dumper, hasRequiredDumper, hasRequiredJsYaml, jsYamlExports, yaml, Type2, Schema, FAILSAFE_SCHEMA, JSON_SCHEMA, CORE_SCHEMA, DEFAULT_SCHEMA, load3, loadAll, dump, YAMLException, types, safeLoad, safeLoadAll, safeDump;
173159
+ var jsYaml, loader, common, hasRequiredCommon, exception, hasRequiredException, snippet, hasRequiredSnippet, type, hasRequiredType, schema, hasRequiredSchema, str6, hasRequiredStr, seq2, hasRequiredSeq, map, hasRequiredMap, failsafe, hasRequiredFailsafe, _null, hasRequired_null, bool2, hasRequiredBool, int2, hasRequiredInt, float, hasRequiredFloat, json2, hasRequiredJson, core, hasRequiredCore, timestamp, hasRequiredTimestamp, merge, hasRequiredMerge, binary, hasRequiredBinary, omap, hasRequiredOmap, pairs, hasRequiredPairs, set, hasRequiredSet, _default, hasRequired_default, hasRequiredLoader, dumper, hasRequiredDumper, hasRequiredJsYaml, jsYamlExports, yaml, Type2, Schema, FAILSAFE_SCHEMA, JSON_SCHEMA, CORE_SCHEMA, DEFAULT_SCHEMA, load3, loadAll, dump, YAMLException, types, safeLoad, safeLoadAll, safeDump;
173000
173160
  var init_js_yaml = __esm({
173001
173161
  "../../node_modules/js-yaml/dist/js-yaml.mjs"() {
173002
173162
  init_define_HHP_CATALOG();
@@ -174668,12 +174828,12 @@ function genNativeConfig(app2, opts = {}) {
174668
174828
  const embedManaged = hasMarkers(project, "yaml", LABEL_LIVE_EMBED);
174669
174829
  if (targetManaged !== embedManaged) throw new Error(`${app2}: Live Activity target and embedding markers must be installed together`);
174670
174830
  const drainsWidgetActions = hostAppliesDeferredWidgetActions(app2);
174671
- const live3 = targetManaged ? liveActivityPlan(project, ids.includes("live_activity"), drainsWidgetActions) : void 0;
174672
- if (live3?.appGroupId) {
174831
+ const live4 = targetManaged ? liveActivityPlan(project, ids.includes("live_activity"), drainsWidgetActions) : void 0;
174832
+ if (live4?.appGroupId) {
174673
174833
  const key3 = "com.apple.security.application-groups";
174674
174834
  const existing = ios.entitlements[key3];
174675
174835
  const groups = Array.isArray(existing) ? [...existing] : existing === void 0 ? [] : [existing];
174676
- if (!groups.includes(live3.appGroupId)) groups.push(live3.appGroupId);
174836
+ if (!groups.includes(live4.appGroupId)) groups.push(live4.appGroupId);
174677
174837
  ios.entitlements[key3] = groups;
174678
174838
  }
174679
174839
  const files = [
@@ -174789,7 +174949,7 @@ function genNativeConfig(app2, opts = {}) {
174789
174949
  files.push(r3);
174790
174950
  }
174791
174951
  if (targetManaged) {
174792
- const plan = live3;
174952
+ const plan = live4;
174793
174953
  files.push(applyToFile(iosYml, "yaml", LABEL_LIVE_TARGET, (i2) => plan.target.map((line) => i2 + line), check));
174794
174954
  files.push(applyToFile(iosYml, "yaml", LABEL_LIVE_EMBED, (i2) => plan.embed.map((line) => i2 + line), check));
174795
174955
  const source2 = join63(dirname37(iosYml), LIVE_SOURCE_PATH);
@@ -174812,7 +174972,7 @@ function genNativeConfig(app2, opts = {}) {
174812
174972
  }
174813
174973
  if (targetManaged) {
174814
174974
  const manifest3 = join63(dirname37(iosYml), LIVE_PRIVACY_MANIFEST_PATH);
174815
- files.push(live3.source ? applyWholeFile(manifest3, renderPrivacyManifest(privacyPlanFor([])), check) : removeWholeFile(manifest3, check));
174975
+ files.push(live4.source ? applyWholeFile(manifest3, renderPrivacyManifest(privacyPlanFor([])), check) : removeWholeFile(manifest3, check));
174816
174976
  }
174817
174977
  const liveRoot = join63(dirname37(iosYml), dirname37(LIVE_PRIVACY_MANIFEST_PATH));
174818
174978
  for (const yml of [iosYml, macosProjectYml(app2)]) {
@@ -180521,9 +180681,9 @@ function makeFunctionsHandler(options2) {
180521
180681
  const target = resolveTarget3(new URL(request.url).pathname);
180522
180682
  if (!target) return errorResponse(404, "not_found", "function route not found", id);
180523
180683
  if (request.method === "OPTIONS") return new Response(null, { status: 204, headers: { "access-control-allow-origin": "*", "access-control-allow-methods": "GET,POST,PUT,PATCH,DELETE,OPTIONS", "access-control-allow-headers": "authorization,content-type,x-request-id,x-himalaya-release,x-himalaya-preview-token", "x-request-id": id } });
180524
- const live3 = await options2.store.getManifest(target.app);
180684
+ const live4 = await options2.store.getManifest(target.app);
180525
180685
  const pin = new URL(request.url).searchParams.get("release") || request.headers.get("x-himalaya-release");
180526
- let selected = live3;
180686
+ let selected = live4;
180527
180687
  if (pin && !options2.previewTokenSecret) return errorResponse(501, "preview_token_unavailable", "pinned release access requires preview token validation", id);
180528
180688
  let previewClaims;
180529
180689
  if (pin && options2.previewTokenSecret) {
@@ -180867,10 +181027,10 @@ function memoryStore(manifest2, built) {
180867
181027
  async function buildLocalFunctions(app2) {
180868
181028
  const built = await buildFunctions(app2.definitions, app2.sources);
180869
181029
  const bundles = Object.fromEntries(built.map((item2) => [item2.name, { sha256: item2.bundleHash, sri: item2.sri, bytes: item2.bytes.length }]));
180870
- const manifest2 = { releaseId: "local", gitSha: "local", app: app2.app, minBinaryVersion: null, screens: {}, bundles, functions: built.map((item2) => item2.record), ...app2.siteBinding ? { functionSiteBinding: { ...app2.siteBinding } } : {}, ...app2.data ? { functionDataResources: app2.data } : {}, ...app2.schedules?.length ? { functionSchedules: app2.schedules.map((schedule) => {
180871
- const target = built.find((item2) => item2.name === schedule.functionName);
180872
- if (!target) throw new Error(`function schedule "${schedule.name}" references unknown function "${schedule.functionName}"`);
180873
- return { ...schedule, bundleHash: target.bundleHash };
181030
+ const manifest2 = { releaseId: "local", gitSha: "local", app: app2.app, minBinaryVersion: null, screens: {}, bundles, functions: built.map((item2) => item2.record), ...app2.siteBinding ? { functionSiteBinding: { ...app2.siteBinding } } : {}, ...app2.data ? { functionDataResources: app2.data } : {}, ...app2.schedules?.length ? { functionSchedules: app2.schedules.map((schedule2) => {
181031
+ const target = built.find((item2) => item2.name === schedule2.functionName);
181032
+ if (!target) throw new Error(`function schedule "${schedule2.name}" references unknown function "${schedule2.functionName}"`);
181033
+ return { ...schedule2, bundleHash: target.bundleHash };
180874
181034
  }) } : {} };
180875
181035
  const store = memoryStore(manifest2, built);
180876
181036
  return { manifest: manifest2, built, handler: makeFunctionsHandler({ store, sandbox: createLocalTestSandbox(), definitions: app2.definitions, siteBinding: app2.siteBinding }) };
@@ -192655,10 +192815,10 @@ var init_commerce = __esm({
192655
192815
  }
192656
192816
  /** Manual prices, or undefined when the product was never priced (its synthetic schedule's prices 404). */
192657
192817
  async prices(id) {
192658
- const schedule = await optional3(() => this.t.get(`/v2/inAppPurchases/${encodeURIComponent(id)}/iapPriceSchedule`));
192659
- if (!schedule?.data)
192818
+ const schedule2 = await optional3(() => this.t.get(`/v2/inAppPurchases/${encodeURIComponent(id)}/iapPriceSchedule`));
192819
+ if (!schedule2?.data)
192660
192820
  return void 0;
192661
- const doc = await optional3(() => this.t.list(`/v1/inAppPurchasePriceSchedules/${encodeURIComponent(one(schedule, "price schedule").id)}/manualPrices`, { query: { include: "inAppPurchasePricePoint,territory" } }));
192821
+ const doc = await optional3(() => this.t.list(`/v1/inAppPurchasePriceSchedules/${encodeURIComponent(one(schedule2, "price schedule").id)}/manualPrices`, { query: { include: "inAppPurchasePricePoint,territory" } }));
192662
192822
  return doc && manualPrices(doc.data, doc.included ?? [], "inAppPurchasePricePoint");
192663
192823
  }
192664
192824
  /** Sets one base-territory price from `startDate` (default: today, US Pacific) — replaces the schedule. */
@@ -195363,13 +195523,13 @@ var init_actions_release = __esm({
195363
195523
  const item2 = items.find((i2) => i2.id === p2.itemId);
195364
195524
  if (!item2 || item2.state === "REMOVED")
195365
195525
  return noop("reviewSubmissionItems", `item ${p2.itemId} is not in submission ${p2.submissionId}`);
195366
- const live3 = items.filter((i2) => i2.state !== "REMOVED");
195526
+ const live4 = items.filter((i2) => i2.state !== "REMOVED");
195367
195527
  return {
195368
195528
  changes: [{ op: "delete", resource: "reviewSubmissionItems", id: p2.itemId, summary: `remove ${item2.type ?? "item"} ${item2.itemId ?? p2.itemId} (${item2.state}) from ${p2.submissionId} (${submission.state})` }],
195369
195529
  sideEffects: [
195370
195530
  "the item is no longer reviewed with this submission",
195371
195531
  ...item2.type === "appStoreVersions" ? ["it is the submission's app version: what is left is reviewed without it"] : [],
195372
- ...live3.length === 1 ? ["it is the submission's last item"] : []
195532
+ ...live4.length === 1 ? ["it is the submission's last item"] : []
195373
195533
  ],
195374
195534
  facts: { state: submission.state ?? null }
195375
195535
  };
@@ -195403,11 +195563,11 @@ var init_actions_release = __esm({
195403
195563
  const nothing = (p2.resolved === void 0 || p2.resolved === true && item2.state !== "REJECTED") && (p2.removed === void 0 || p2.removed === true && item2.state === "REMOVED" || p2.removed === false && item2.state !== "REMOVED");
195404
195564
  if (nothing)
195405
195565
  return noop("reviewSubmissionItems", `item ${p2.itemId} is ${item2.state}; nothing to change`);
195406
- const live3 = items.filter((i2) => i2.state !== "REMOVED");
195566
+ const live4 = items.filter((i2) => i2.state !== "REMOVED");
195407
195567
  const asked = [...p2.resolved !== void 0 ? [`resolved ${p2.resolved === null ? "cleared" : p2.resolved}`] : [], ...p2.removed !== void 0 ? [`removed ${p2.removed === null ? "cleared" : p2.removed}`] : []];
195408
195568
  return {
195409
195569
  changes: [{ op: "update", resource: "reviewSubmissionItems", id: p2.itemId, summary: `${item2.type ?? "item"} ${item2.itemId ?? p2.itemId} (${item2.state}): ${asked.join(", ")}`, after: { ...p2.resolved !== void 0 ? { resolved: p2.resolved } : {}, ...p2.removed !== void 0 ? { removed: p2.removed } : {} } }],
195410
- sideEffects: p2.removed === true ? ["the item is no longer reviewed with this submission", ...item2.type === "appStoreVersions" ? ["it is the submission's app version: what is left is reviewed without it"] : [], ...live3.length === 1 ? ["it is the submission's last item"] : []] : [],
195570
+ sideEffects: p2.removed === true ? ["the item is no longer reviewed with this submission", ...item2.type === "appStoreVersions" ? ["it is the submission's app version: what is left is reviewed without it"] : [], ...live4.length === 1 ? ["it is the submission's last item"] : []] : [],
195411
195571
  facts: { state: submission.state ?? null, itemState: item2.state }
195412
195572
  };
195413
195573
  },
@@ -196549,9 +196709,9 @@ var init_batch = __esm({
196549
196709
  if (batch.status !== "planned")
196550
196710
  throw new AscError("refused", `batch ${id} is ${batch.status}`);
196551
196711
  const offered = [...batch.approvals, { approver: ctx.actor, planHash: batch.planHash, at: this.now().toISOString() }];
196552
- const live3 = batch.items.filter((i2) => i2.status === "planned");
196553
- const accounts = [...new Set(live3.map((i2) => i2.issuerId))];
196554
- const decisions = await Promise.all([...new Set(live3.map((i2) => i2.action))].map((action) => this.options.gate.evaluate({ jobId: batch.id, action, requestedBy: batch.actor, planHash: batch.planHash, accounts, appCount: live3.length, offered, summary: `batch ${batch.id}: ${live3.length} line(s) across ${accounts.length} account(s)` })));
196712
+ const live4 = batch.items.filter((i2) => i2.status === "planned");
196713
+ const accounts = [...new Set(live4.map((i2) => i2.issuerId))];
196714
+ const decisions = await Promise.all([...new Set(live4.map((i2) => i2.action))].map((action) => this.options.gate.evaluate({ jobId: batch.id, action, requestedBy: batch.actor, planHash: batch.planHash, accounts, appCount: live4.length, offered, summary: `batch ${batch.id}: ${live4.length} line(s) across ${accounts.length} account(s)` })));
196555
196715
  batch.approvals = decisions[0]?.approvals ?? offered;
196556
196716
  const denied2 = decisions.find((d2) => d2.status === "denied");
196557
196717
  const pending2 = decisions.find((d2) => d2.status === "pending");
@@ -197804,8 +197964,8 @@ var init_actions_products = __esm({
197804
197964
  const base = await api4.subscriptions.pricePoint(p2.subscriptionId, p2.baseTerritory, p2.basePrice);
197805
197965
  const others = await api4.subscriptions.equalizations(base.id, p2.baseTerritory);
197806
197966
  const hasPrices = await api4.subscriptions.hasPrices(p2.subscriptionId);
197807
- const scheduled = !p2.startDate && hasPrices && LIVE_SUBSCRIPTION_STATES.has(String(subscription.state ?? "").trim().toUpperCase()) ? tomorrow(today(api4)) : void 0;
197808
- const start = p2.startDate ?? scheduled;
197967
+ const scheduled2 = !p2.startDate && hasPrices && LIVE_SUBSCRIPTION_STATES.has(String(subscription.state ?? "").trim().toUpperCase()) ? tomorrow(today(api4)) : void 0;
197968
+ const start = p2.startDate ?? scheduled2;
197809
197969
  const on4 = start ?? today(api4);
197810
197970
  const current = await api4.subscriptions.resolvedPrices(p2.subscriptionId, on4);
197811
197971
  const all = [{ territory: p2.baseTerritory, price: base.customerPrice, pricePointId: base.id }, ...others.map((o2) => ({ territory: o2.territory, price: o2.customerPrice, pricePointId: o2.id }))];
@@ -197814,7 +197974,7 @@ var init_actions_products = __esm({
197814
197974
  return noop6("subscriptionPrices", `all ${all.length} territories are already at the ${p2.basePrice} ${p2.baseTerritory} point on ${on4}`);
197815
197975
  return {
197816
197976
  changes: targets.map((t2) => ({ op: current.has(t2.territory) ? "update" : "create", resource: "subscriptionPrices", summary: `${t2.territory}: ${current.get(t2.territory)?.customerPrice ?? "no price"} \u2192 ${t2.price}${start ? ` from ${start}` : ""}` })),
197817
- sideEffects: [...unsold.length ? [`${unsold.length} of the priced territories are not in the subscription's availability: they get a price, and it stays off sale there (availability is not changed)`] : [], ...scheduled ? [`the subscription is ${subscription.state}: prices change on ${scheduled} (tomorrow, US Pacific)`] : [], ...hasPrices ? [] : [`the subscription has no price yet: ${p2.baseTerritory} is set first, the rest follow`], ...p2.preserveCurrentPrice ? ["current subscribers keep their price"] : []],
197977
+ sideEffects: [...unsold.length ? [`${unsold.length} of the priced territories are not in the subscription's availability: they get a price, and it stays off sale there (availability is not changed)`] : [], ...scheduled2 ? [`the subscription is ${subscription.state}: prices change on ${scheduled2} (tomorrow, US Pacific)`] : [], ...hasPrices ? [] : [`the subscription has no price yet: ${p2.baseTerritory} is set first, the rest follow`], ...p2.preserveCurrentPrice ? ["current subscribers keep their price"] : []],
197818
197978
  facts: { targets, hasPrices, start: start ?? null, on: on4, state: subscription.state ?? null, unsold: unsold.length }
197819
197979
  };
197820
197980
  },
@@ -202272,11 +202432,11 @@ async function runConnectFlow(opts) {
202272
202432
  let refusal2;
202273
202433
  let over = false;
202274
202434
  let path2 = "";
202275
- const live3 = /* @__PURE__ */ new Set();
202435
+ const live4 = /* @__PURE__ */ new Set();
202276
202436
  const begin = (input) => {
202277
202437
  const attempt2 = startAttempt(input);
202278
- live3.add(attempt2);
202279
- void attempt2.settled.then(() => live3.delete(attempt2));
202438
+ live4.add(attempt2);
202439
+ void attempt2.settled.then(() => live4.delete(attempt2));
202280
202440
  if (over)
202281
202441
  attempt2.cancel();
202282
202442
  return attempt2;
@@ -202395,13 +202555,13 @@ async function runConnectFlow(opts) {
202395
202555
  } catch (e2) {
202396
202556
  return fail10(`signed in, but App Store Connect did not list the teams: ${messageOf2(e2)}`);
202397
202557
  }
202398
- const live4 = { ...session, cookies: client4.cookies };
202558
+ const live5 = { ...session, cookies: client4.cookies };
202399
202559
  if (listed.available.length > 1) {
202400
- state = { name: "team", saved: session, live: live4, providers: listed.available, current: listed.current?.providerId };
202560
+ state = { name: "team", saved: session, live: live5, providers: listed.available, current: listed.current?.providerId };
202401
202561
  return show();
202402
202562
  }
202403
202563
  const provider = listed.current ?? listed.available[0] ?? { providerId: session.providerId ?? 0, name: session.providerName ?? "", publicProviderId: session.publicProviderId };
202404
- return connected(session, live4, provider);
202564
+ return connected(session, live5, provider);
202405
202565
  }
202406
202566
  async function onTeamPost(st2, form) {
202407
202567
  const chosen = st2.providers.find((p2) => String(p2.providerId) === form.get("providerId"));
@@ -202409,22 +202569,22 @@ async function runConnectFlow(opts) {
202409
202569
  state = { ...st2, error: { kind: "team", text: "Choose one of the teams." } };
202410
202570
  return show();
202411
202571
  }
202412
- let live4 = st2.live;
202572
+ let live5 = st2.live;
202413
202573
  if (chosen.providerId !== st2.current) {
202414
202574
  try {
202415
- live4 = (await new WebClient2(st2.live, clientOptions).selectProvider({ providerId: chosen.providerId })).session;
202575
+ live5 = (await new WebClient2(st2.live, clientOptions).selectProvider({ providerId: chosen.providerId })).session;
202416
202576
  } catch (e2) {
202417
202577
  state = { ...st2, error: { kind: "team", text: `App Store Connect did not move to that team: ${messageOf2(e2)}` } };
202418
202578
  return show();
202419
202579
  }
202420
202580
  }
202421
- return connected(st2.saved, live4, chosen);
202581
+ return connected(st2.saved, live5, chosen);
202422
202582
  }
202423
- async function connected(saved, live4, provider) {
202424
- let cookies = live4.cookies;
202583
+ async function connected(saved, live5, provider) {
202584
+ let cookies = live5.cookies;
202425
202585
  let teamId;
202426
202586
  try {
202427
- const portal = new AgreementsClient(onTeam(live4, provider), { ...clientOptions, developerBase: base.ascBase, onSessionChange: (s2) => void (cookies = s2.cookies) });
202587
+ const portal = new AgreementsClient(onTeam(live5, provider), { ...clientOptions, developerBase: base.ascBase, onSessionChange: (s2) => void (cookies = s2.cookies) });
202428
202588
  const match = matchDeveloperTeam(provider, await portal.developerTeams(), false);
202429
202589
  if (match.teamId !== null)
202430
202590
  teamId = match.teamId;
@@ -202482,7 +202642,7 @@ async function runConnectFlow(opts) {
202482
202642
  // already running (a key being created) is not stopped, and the page expires once it returns.
202483
202643
  onTtl: () => {
202484
202644
  over = true;
202485
- for (const attempt2 of live3)
202645
+ for (const attempt2 of live4)
202486
202646
  attempt2.cancel();
202487
202647
  },
202488
202648
  handler: async ({ method, path: at2, form }) => {
@@ -202503,9 +202663,9 @@ async function runConnectFlow(opts) {
202503
202663
  path2 = new URL(server.url).pathname;
202504
202664
  const letGo = async () => {
202505
202665
  over = true;
202506
- for (const attempt2 of live3)
202666
+ for (const attempt2 of live4)
202507
202667
  attempt2.cancel();
202508
- await Promise.all([...live3].map((a2) => a2.settled));
202668
+ await Promise.all([...live4].map((a2) => a2.settled));
202509
202669
  };
202510
202670
  let cancelled = false;
202511
202671
  const stopped = new Promise((resolve112) => {
@@ -203304,12 +203464,12 @@ var init_commands = __esm({
203304
203464
  summary: "The version on sale",
203305
203465
  options: { app: { type: "string" }, platform: { type: "string" } },
203306
203466
  async run(inv) {
203307
- const live3 = await (await inv.ctx.api()).versions.live(await appId2(inv), inv.opts.platform ?? "IOS");
203308
- if (!live3) {
203467
+ const live4 = await (await inv.ctx.api()).versions.live(await appId2(inv), inv.opts.platform ?? "IOS");
203468
+ if (!live4) {
203309
203469
  inv.ctx.io.stderr("no version on sale\n");
203310
203470
  return ExitCode.NotFound;
203311
203471
  }
203312
- inv.print(live3);
203472
+ inv.print(live4);
203313
203473
  }
203314
203474
  },
203315
203475
  "testflight groups": {
@@ -205769,9 +205929,9 @@ async function versionsFor(inv) {
205769
205929
  throw new AscError("notFound", `version ${versionId} is not a version of app ${id}`);
205770
205930
  return [v2];
205771
205931
  }
205772
- const live3 = await api4.versions.live(id, platform ?? "IOS");
205932
+ const live4 = await api4.versions.live(id, platform ?? "IOS");
205773
205933
  const inFlight = await api4.versions.inFlight(id, platform ?? "IOS");
205774
- return [inFlight, live3].filter((v2) => !!v2 && (v2 !== live3 || v2.id !== inFlight?.id));
205934
+ return [inFlight, live4].filter((v2) => !!v2 && (v2 !== live4 || v2.id !== inFlight?.id));
205775
205935
  }
205776
205936
  var versionOptions, phasedMove, RELEASE_CONTROL_COMMANDS;
205777
205937
  var init_commands_release_controls = __esm({
@@ -211149,12 +211309,12 @@ async function applyBatchAsking(ctx, a2, call, o2 = {}) {
211149
211309
  ctx.webAppleId = await identityForApply(ctx, batch.id);
211150
211310
  }
211151
211311
  if (batch.status === "planned" && ctx.approver && !ctx.worker) {
211152
- const live3 = batch.items.filter((i2) => i2.status === "planned");
211153
- const accounts = [...new Set(live3.map((i2) => i2.issuerId))];
211154
- const request = { jobId: batch.id, action: [...new Set(live3.map((i2) => i2.action))].join(", "), requestedBy: batch.actor, planHash: batch.planHash, accounts, appCount: live3.length, offered: batch.approvals, summary: `batch ${batch.id}${batch.ordered ? " (in this order)" : ""}: ${live3.length} line(s) across ${accounts.length} account(s)
211155
- ${batchSummaryLines(live3).join("\n")}${o2.detail ? `
211312
+ const live4 = batch.items.filter((i2) => i2.status === "planned");
211313
+ const accounts = [...new Set(live4.map((i2) => i2.issuerId))];
211314
+ const request = { jobId: batch.id, action: [...new Set(live4.map((i2) => i2.action))].join(", "), requestedBy: batch.actor, planHash: batch.planHash, accounts, appCount: live4.length, offered: batch.approvals, summary: `batch ${batch.id}${batch.ordered ? " (in this order)" : ""}: ${live4.length} line(s) across ${accounts.length} account(s)
211315
+ ${batchSummaryLines(live4).join("\n")}${o2.detail ? `
211156
211316
  ${o2.detail}` : ""}` };
211157
- const levels = [...new Set(live3.map((i2) => i2.action))].map((action) => requiredLevel(ctx.policy(), { ...request, action }));
211317
+ const levels = [...new Set(live4.map((i2) => i2.action))].map((action) => requiredLevel(ctx.policy(), { ...request, action }));
211158
211318
  const level = ["never", "two", "one", "auto"].find((l2) => levels.includes(l2)) ?? "one";
211159
211319
  let decided = batch;
211160
211320
  refuseIfGone(call, `batch ${batch.id}`);
@@ -211733,7 +211893,7 @@ function connectView(r3) {
211733
211893
  function startConnect(host, ctx, createKey) {
211734
211894
  const pageEnd = new AbortController();
211735
211895
  const waiting = /* @__PURE__ */ new Set();
211736
- let live3;
211896
+ let live4;
211737
211897
  let gotPage;
211738
211898
  const page = new Promise((r3) => gotPage = r3);
211739
211899
  const view = (async () => {
@@ -211760,12 +211920,12 @@ function startConnect(host, ctx, createKey) {
211760
211920
  return v2;
211761
211921
  } finally {
211762
211922
  gotPage(void 0);
211763
- if (liveConnects.get(host) === live3)
211923
+ if (liveConnects.get(host) === live4)
211764
211924
  liveConnects.delete(host);
211765
211925
  }
211766
211926
  })();
211767
211927
  const settled = view.then(() => void 0, () => void 0);
211768
- live3 = {
211928
+ live4 = {
211769
211929
  page,
211770
211930
  settled,
211771
211931
  async join(call) {
@@ -211792,13 +211952,13 @@ function startConnect(host, ctx, createKey) {
211792
211952
  }
211793
211953
  }
211794
211954
  };
211795
- liveConnects.set(host, live3);
211796
- return live3;
211955
+ liveConnects.set(host, live4);
211956
+ return live4;
211797
211957
  }
211798
- async function joinConnect(live3, call) {
211958
+ async function joinConnect(live4, call) {
211799
211959
  call.progress("A connect page from an earlier store_connect call is still open; waiting on it instead of starting a second sign-in");
211800
211960
  let reopened = false;
211801
- const reopening = Promise.race([live3.page, live3.settled.then(() => void 0)]).then(async (page) => {
211961
+ const reopening = Promise.race([live4.page, live4.settled.then(() => void 0)]).then(async (page) => {
211802
211962
  if (!page || !page.live || call.signal.aborted)
211803
211963
  return;
211804
211964
  try {
@@ -211809,7 +211969,7 @@ async function joinConnect(live3, call) {
211809
211969
  call.progress("Could not open the connect page again; it is still open in the person's browser");
211810
211970
  }
211811
211971
  });
211812
- const view = await live3.join(call);
211972
+ const view = await live4.join(call);
211813
211973
  await reopening;
211814
211974
  return { ...view, reopened };
211815
211975
  }
@@ -211936,9 +212096,9 @@ A submission can take more than one batch: after store_apply, call store_plan ag
211936
212096
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
211937
212097
  inputSchema: z6.object({ createKey: z6.boolean().optional().describe("Offer to create and save an API key on the page (default true).") }),
211938
212098
  handler: async (a2, ctx, host, call) => {
211939
- const live3 = liveConnects.get(host);
211940
- if (live3)
211941
- return ok2(await joinConnect(live3, call));
212099
+ const live4 = liveConnects.get(host);
212100
+ if (live4)
212101
+ return ok2(await joinConnect(live4, call));
211942
212102
  return ok2(await startConnect(host, ctx, a2.createKey ?? true).join(call));
211943
212103
  }
211944
212104
  },
@@ -216452,9 +216612,9 @@ async function renderCommand(ctx) {
216452
216612
  const scheme = str3(flags.scheme) === "dark" ? "dark" : "light";
216453
216613
  const wantPng = flags.png === true || typeof flags.png === "string";
216454
216614
  const hydrate = flags.static !== true;
216455
- const live3 = flags.live === true;
216615
+ const live4 = flags.live === true;
216456
216616
  const strict = flags.strict === true;
216457
- if (live3 && flags.static === true) {
216617
+ if (live4 && flags.static === true) {
216458
216618
  io2.error(JSON.stringify({ error: "--static and --live are mutually exclusive: --static renders raw bindings, --live renders real Wix data" }));
216459
216619
  return 2;
216460
216620
  }
@@ -216462,8 +216622,8 @@ async function renderCommand(ctx) {
216462
216622
  io2.error(JSON.stringify({ error: `--mocks takes no value (got "${String(flags.mocks)}") \u2014 pass it bare` }));
216463
216623
  return 2;
216464
216624
  }
216465
- if (flags.mocks === true && (live3 || flags.static === true)) {
216466
- io2.error(JSON.stringify({ error: `--mocks and ${live3 ? "--live" : "--static"} are mutually exclusive: --mocks loads the app's recorded data, ${live3 ? "--live real Wix data" : "--static no data at all"}` }));
216625
+ if (flags.mocks === true && (live4 || flags.static === true)) {
216626
+ io2.error(JSON.stringify({ error: `--mocks and ${live4 ? "--live" : "--static"} are mutually exclusive: --mocks loads the app's recorded data, ${live4 ? "--live real Wix data" : "--static no data at all"}` }));
216467
216627
  return 2;
216468
216628
  }
216469
216629
  if (flags.mocks === true && flags["no-mocks"] === true) {
@@ -216550,7 +216710,7 @@ async function renderCommand(ctx) {
216550
216710
  }
216551
216711
  let mocks;
216552
216712
  let mocksNote;
216553
- const mocksByDefault = flags.mocks !== true && flags["no-mocks"] !== true && !live3 && flags.static !== true && injectedState === void 0;
216713
+ const mocksByDefault = flags.mocks !== true && flags["no-mocks"] !== true && !live4 && flags.static !== true && injectedState === void 0;
216554
216714
  if (flags.mocks === true || mocksByDefault) {
216555
216715
  let rules = null;
216556
216716
  let bad3;
@@ -216574,7 +216734,7 @@ async function renderCommand(ctx) {
216574
216734
  ...hasWorkers ? { tier5Dir: bundleOutDir2(dir) } : {},
216575
216735
  // The settled state is always kept (printed only under --dump-state): it is what says whether
216576
216736
  // the picture landed on the screen's content or on its error, loading or empty state.
216577
- collect: { lint: true, strict, render: { screenId, scheme, png: wantPng, hydrate, dumpState: true, ...live3 ? { live: true } : {}, ...injectedState ? { state: injectedState } : {}, ...injectedInput ? { input: injectedInput } : {}, ...renderWidth ? { width: renderWidth } : {}, ...platform ? { platform } : {}, ...frame ? { frame: true } : {}, ...renderSurface ? { surface: renderSurface } : {}, ...flags.rtl === true ? { rtl: true } : {}, ...loadBudgetMs ? { loadBudgetMs } : {}, ...mocks ? { mocks: { rules: mocks.rules, cmsSeed: mocks.cmsSeed, ...mocks.base44Data ? { base44Data: mocks.base44Data } : {} } } : {} } }
216737
+ collect: { lint: true, strict, render: { screenId, scheme, png: wantPng, hydrate, dumpState: true, ...live4 ? { live: true } : {}, ...injectedState ? { state: injectedState } : {}, ...injectedInput ? { input: injectedInput } : {}, ...renderWidth ? { width: renderWidth } : {}, ...platform ? { platform } : {}, ...frame ? { frame: true } : {}, ...renderSurface ? { surface: renderSurface } : {}, ...flags.rtl === true ? { rtl: true } : {}, ...loadBudgetMs ? { loadBudgetMs } : {}, ...mocks ? { mocks: { rules: mocks.rules, cmsSeed: mocks.cmsSeed, ...mocks.base44Data ? { base44Data: mocks.base44Data } : {} } } : {} } }
216578
216738
  });
216579
216739
  const r3 = (outcome.renders ?? [])[0];
216580
216740
  if (!r3) {
@@ -216606,12 +216766,12 @@ async function renderCommand(ctx) {
216606
216766
  screenId,
216607
216767
  scheme,
216608
216768
  renderable: r3.renderable,
216609
- hydrated: live3 ? "live" : hydrate,
216610
- dataSource: renderDataSource({ live: live3, hydrate, liveCalls: r3.liveCalls, liveReturned: r3.liveReturned, liveEmpty: r3.liveEmpty, liveRefused: r3.liveRefused, mocked: !!r3.mockCalls }),
216611
- ...live3 && dataSourceHint(renderDataSource({ live: live3, hydrate, liveCalls: r3.liveCalls, liveReturned: r3.liveReturned, liveEmpty: r3.liveEmpty, liveRefused: r3.liveRefused })) ? { dataSourceHint: dataSourceHint(renderDataSource({ live: live3, hydrate, liveCalls: r3.liveCalls, liveReturned: r3.liveReturned, liveEmpty: r3.liveEmpty, liveRefused: r3.liveRefused })) } : {},
216769
+ hydrated: live4 ? "live" : hydrate,
216770
+ dataSource: renderDataSource({ live: live4, hydrate, liveCalls: r3.liveCalls, liveReturned: r3.liveReturned, liveEmpty: r3.liveEmpty, liveRefused: r3.liveRefused, mocked: !!r3.mockCalls }),
216771
+ ...live4 && dataSourceHint(renderDataSource({ live: live4, hydrate, liveCalls: r3.liveCalls, liveReturned: r3.liveReturned, liveEmpty: r3.liveEmpty, liveRefused: r3.liveRefused })) ? { dataSourceHint: dataSourceHint(renderDataSource({ live: live4, hydrate, liveCalls: r3.liveCalls, liveReturned: r3.liveReturned, liveEmpty: r3.liveEmpty, liveRefused: r3.liveRefused })) } : {},
216612
216772
  // What --mocks loaded from, how many requests the load made, and the ones no layer held.
216613
216773
  ...r3.mockCalls && mocks ? { mocks: { used: true, from: mocks.from, calls: r3.mockCalls.length, ...r3.mockUnserved?.length ? { unserved: r3.mockUnserved } : {}, ...mocks.ignored ? { ignored: mocks.ignored } : {}, ...mocksByDefault ? { default: true, hint: "the app's recorded data loaded by default; --no-mocks renders the offline initial state, --live the real site" } : {} } } : mocksNote ? { mocks: mocksNote } : mocks ? { mocks: { used: false, reason: r3.mockBootFailed ? "the screen's worker failed to boot against the recorded data, so its initial state was rendered" : "the screen has no worker bundle to load data into", ...mocks.ignored ? { ignored: mocks.ignored } : {} } } : {},
216614
- ...live3 ? renderLiveFields(r3) : {},
216774
+ ...live4 ? renderLiveFields(r3) : {},
216615
216775
  ...injectedState ? { stateInjected: Object.keys(injectedState) } : {},
216616
216776
  ...injectedInput ? { inputInjected: Object.keys(injectedInput) } : {},
216617
216777
  ...flags["dump-state"] === true && r3.serviceState ? { serviceState: r3.serviceState } : {},
@@ -216656,7 +216816,7 @@ async function renderCommand(ctx) {
216656
216816
  if (pngFile && r3.renderable) {
216657
216817
  const { recordShotState: recordShotState2, screenStateOf: screenStateOf2 } = await Promise.resolve().then(() => (init_screen_state(), screen_state_exports));
216658
216818
  const mocked = !!r3.mockCalls;
216659
- landed = screenStateOf2(r3.serviceState, r3.html, { initial: !live3 && !mocked, offline: mocked && (r3.mockUnserved?.length ?? 0) > 0 });
216819
+ landed = screenStateOf2(r3.serviceState, r3.html, { initial: !live4 && !mocked, offline: mocked && (r3.mockUnserved?.length ?? 0) > 0 });
216660
216820
  recordShotState2(dir, screenId, pngFile, landed);
216661
216821
  }
216662
216822
  const autoSkip = process.env.HIMI_AUTO_RENDER === "validate" && landed !== null && (landed.state === "loading" || landed.state === "empty" || landed.state === "error" && landed.offline === true) ? `the picture shows the home screen's ${landed.state} state${landed.initial || landed.offline ? " (an offline preview: the site's data is not loaded offline)" : ""}, so no postcard was journaled from it` : void 0;
@@ -220287,12 +220447,12 @@ function planFromPayload(payload, base, selectors) {
220287
220447
  }
220288
220448
  return { ok: true, plan: { patch, touched, included, rebound } };
220289
220449
  }
220290
- function regressionDiff(base, live3, touched) {
220450
+ function regressionDiff(base, live4, touched) {
220291
220451
  const moves = new Set(touched);
220292
220452
  const rows = [];
220293
- for (const id of /* @__PURE__ */ new Set([...Object.keys(live3.screens ?? {}), ...Object.keys(base.screens ?? {})])) {
220453
+ for (const id of /* @__PURE__ */ new Set([...Object.keys(live4.screens ?? {}), ...Object.keys(base.screens ?? {})])) {
220294
220454
  if (moves.has(`screen:${id}`)) continue;
220295
- const l2 = live3.screens?.[id];
220455
+ const l2 = live4.screens?.[id];
220296
220456
  const b2 = base.screens?.[id];
220297
220457
  if (!b2) {
220298
220458
  rows.push({ item: `screen:${id}`, live: l2?.descriptorHash ?? null, base: null, effect: `${id} DISAPPEARS \u2014 it was added after ${base.releaseId}` });
@@ -220306,13 +220466,13 @@ function regressionDiff(base, live3, touched) {
220306
220466
  rows.push({ item: `screen:${id}`, live: l2.descriptorHash, base: b2.descriptorHash, effect: `${id} reverts to its ${base.releaseId} descriptor` });
220307
220467
  continue;
220308
220468
  }
220309
- if (resolveBundleSha(live3, l2.bundle) !== resolveBundleSha(base, b2.bundle)) {
220310
- rows.push({ item: `screen:${id}`, live: resolveBundleSha(live3, l2.bundle), base: resolveBundleSha(base, b2.bundle), effect: `${id} rebinds to its ${base.releaseId} worker bundle` });
220469
+ if (resolveBundleSha(live4, l2.bundle) !== resolveBundleSha(base, b2.bundle)) {
220470
+ rows.push({ item: `screen:${id}`, live: resolveBundleSha(live4, l2.bundle), base: resolveBundleSha(base, b2.bundle), effect: `${id} rebinds to its ${base.releaseId} worker bundle` });
220311
220471
  }
220312
220472
  }
220313
220473
  const scalar4 = (key3, item2, what) => {
220314
220474
  if (moves.has(item2)) return;
220315
- const l2 = live3[key3] ?? null;
220475
+ const l2 = live4[key3] ?? null;
220316
220476
  const b2 = base[key3] ?? null;
220317
220477
  if (l2 !== b2) rows.push({ item: item2, live: l2, base: b2, effect: `${what} reverts to ${base.releaseId}` });
220318
220478
  };
@@ -220320,8 +220480,8 @@ function regressionDiff(base, live3, touched) {
220320
220480
  scalar4("appConfigHash", "app-config", "app-config");
220321
220481
  scalar4("iconHash", "icon", "the launcher icon");
220322
220482
  scalar4("minBinaryVersion", "minBinaryVersion", "the minimum binary version");
220323
- for (const name of /* @__PURE__ */ new Set([...Object.keys(live3.assets ?? {}), ...Object.keys(base.assets ?? {})])) {
220324
- const l2 = live3.assets?.[name]?.sha256 ?? null;
220483
+ for (const name of /* @__PURE__ */ new Set([...Object.keys(live4.assets ?? {}), ...Object.keys(base.assets ?? {})])) {
220484
+ const l2 = live4.assets?.[name]?.sha256 ?? null;
220325
220485
  const b2 = base.assets?.[name]?.sha256 ?? null;
220326
220486
  if (l2 === b2) continue;
220327
220487
  rows.push({
@@ -220331,16 +220491,16 @@ function regressionDiff(base, live3, touched) {
220331
220491
  effect: b2 === null ? `asset:${name} record DISAPPEARS \u2014 references fall back to the baked copy or render empty` : `asset:${name} reverts to ${base.releaseId}`
220332
220492
  });
220333
220493
  }
220334
- for (const name of /* @__PURE__ */ new Set([...Object.keys(live3.authoringDocs ?? {}), ...Object.keys(base.authoringDocs ?? {})])) {
220335
- const l2 = live3.authoringDocs?.[name]?.sha256 ?? null;
220494
+ for (const name of /* @__PURE__ */ new Set([...Object.keys(live4.authoringDocs ?? {}), ...Object.keys(base.authoringDocs ?? {})])) {
220495
+ const l2 = live4.authoringDocs?.[name]?.sha256 ?? null;
220336
220496
  const b2 = base.authoringDocs?.[name]?.sha256 ?? null;
220337
220497
  if (l2 !== b2) rows.push({ item: `doc:${name}`, live: l2, base: b2, effect: `${name} reverts to ${base.releaseId}` });
220338
220498
  }
220339
220499
  const PROVENANCE = /* @__PURE__ */ new Set(["releaseId", "gitSha", "shellSha", "label", "notes", "publishedAt", "publishedBy", "attestation", "forcedPastErrors", "allowedBinaryGap", "oneAppMigration"]);
220340
220500
  const REPORTED_IN_DETAIL = /* @__PURE__ */ new Set(["app", "screens", "bundles", "tokensHash", "appConfigHash", "iconHash", "minBinaryVersion", "assets", "authoringDocs"]);
220341
- for (const key3 of /* @__PURE__ */ new Set([...Object.keys(live3), ...Object.keys(base)])) {
220501
+ for (const key3 of /* @__PURE__ */ new Set([...Object.keys(live4), ...Object.keys(base)])) {
220342
220502
  if (PROVENANCE.has(key3) || REPORTED_IN_DETAIL.has(key3) || moves.has(key3)) continue;
220343
- const l2 = live3[key3] ?? null;
220503
+ const l2 = live4[key3] ?? null;
220344
220504
  const b2 = base[key3] ?? null;
220345
220505
  const ls2 = JSON.stringify(l2) ?? "null";
220346
220506
  const bs2 = JSON.stringify(b2) ?? "null";
@@ -220559,10 +220719,10 @@ __export(ring_pins_exports, {
220559
220719
  readRingPins: () => readRingPins,
220560
220720
  ringsPinnedElsewhere: () => ringsPinnedElsewhere
220561
220721
  });
220562
- function ringsPinnedElsewhere(live3, releaseId) {
220563
- if (!live3 || typeof live3 !== "object") return [];
220722
+ function ringsPinnedElsewhere(live4, releaseId) {
220723
+ if (!live4 || typeof live4 !== "object") return [];
220564
220724
  const pins = [];
220565
- for (const [pinned, rings] of Object.entries(live3)) {
220725
+ for (const [pinned, rings] of Object.entries(live4)) {
220566
220726
  if (pinned === releaseId || !Array.isArray(rings)) continue;
220567
220727
  for (const ring of rings) if (typeof ring === "string") pins.push({ ring, releaseId: pinned });
220568
220728
  }
@@ -220576,19 +220736,19 @@ function promoteCommand(o2, ring, force) {
220576
220736
  return `himi promote --app ${shellQuote(o2.app)} --release ${shellQuote(o2.releaseId)} --ring ${shellQuote(ring)}${force ? " --force" : ""} --target ${shellQuote(o2.target)}${control}`;
220577
220737
  }
220578
220738
  async function readRingPins(client4, o2) {
220579
- let live3;
220739
+ let live4;
220580
220740
  let markedForced = false;
220581
220741
  try {
220582
220742
  const r3 = await client4.releases(o2.app);
220583
220743
  if (!r3.ok) return null;
220584
220744
  const ledger = r3.json;
220585
- live3 = ledger?.live;
220745
+ live4 = ledger?.live;
220586
220746
  markedForced = Array.isArray(ledger?.releases) && ledger.releases.some((row2) => row2?.releaseId === o2.releaseId && row2.forcedPastErrors === true);
220587
220747
  } catch {
220588
220748
  return null;
220589
220749
  }
220590
220750
  const force = o2.force === true || markedForced;
220591
- const pins = ringsPinnedElsewhere(live3, o2.releaseId);
220751
+ const pins = ringsPinnedElsewhere(live4, o2.releaseId);
220592
220752
  if (!pins.length) return null;
220593
220753
  const ringPins = pins.map((pin) => ({ ...pin, promote: promoteCommand(o2, pin.ring, force) }));
220594
220754
  const named3 = pins.map((pin) => `ring "${forTerminal(pin.ring)}" is pinned to ${forTerminal(pin.releaseId)}`).join(", ");
@@ -220914,19 +221074,19 @@ function publicRecord(value2) {
220914
221074
  const { archiveBase64: _archiveBase64, ...record3 } = value2;
220915
221075
  return record3;
220916
221076
  }
220917
- function live2(value2, now) {
221077
+ function live3(value2, now) {
220918
221078
  if (!value2 || value2.revokedAt) return null;
220919
221079
  if (value2.expiresAt && Date.parse(value2.expiresAt) <= now.getTime()) return null;
220920
221080
  return value2;
220921
221081
  }
220922
221082
  async function resolvePackageShareMetadata(store, id, now = /* @__PURE__ */ new Date()) {
220923
221083
  if (!PACKAGE_SHARE_ID_PATTERN2.test(id) || !store.getDoc) return null;
220924
- const value2 = live2(parseStored(await store.getDoc(PACKAGE_SHARE_NAMESPACE, id), id), now);
221084
+ const value2 = live3(parseStored(await store.getDoc(PACKAGE_SHARE_NAMESPACE, id), id), now);
220925
221085
  return value2 ? publicRecord(value2) : null;
220926
221086
  }
220927
221087
  async function resolvePackageShare(store, id, now = /* @__PURE__ */ new Date()) {
220928
221088
  if (!PACKAGE_SHARE_ID_PATTERN2.test(id) || !store.getDoc) return null;
220929
- const value2 = live2(parseStored(await store.getDoc(PACKAGE_SHARE_NAMESPACE, id), id), now);
221089
+ const value2 = live3(parseStored(await store.getDoc(PACKAGE_SHARE_NAMESPACE, id), id), now);
220930
221090
  if (!value2) return null;
220931
221091
  const archive = await decodeArchive(value2, id);
220932
221092
  return archive ? { share: publicRecord(value2), archive } : null;
@@ -221583,8 +221743,8 @@ ${releaseId}`;
221583
221743
  if (/^\/v1\/app-config\/[^/]+$/.test(url.pathname)) return drop2();
221584
221744
  let servable;
221585
221745
  try {
221586
- const live3 = await manifest2(app2);
221587
- const eligible = live3?.releaseId === pin || await isRingRelease(app2, pin);
221746
+ const live4 = await manifest2(app2);
221747
+ const eligible = live4?.releaseId === pin || await isRingRelease(app2, pin);
221588
221748
  const pinned = eligible ? await pinnedManifest(app2, pin) : null;
221589
221749
  servable = pinned !== null;
221590
221750
  const screenId = /^\/v1\/screen\/([^/]+)$/.exec(url.pathname)?.[1];
@@ -222297,7 +222457,7 @@ ${releaseId}`;
222297
222457
  if (!m2) return json6(404, { error: "app_not_found", app: app2 });
222298
222458
  }
222299
222459
  const mm = m2;
222300
- const readDoc = (hash3, live3) => pin ? hash3 ? pinnedBody(app2, hash3, live3) : Promise.resolve(null) : live3();
222460
+ const readDoc = (hash3, live4) => pin ? hash3 ? pinnedBody(app2, hash3, live4) : Promise.resolve(null) : live4();
222301
222461
  const ringPinned = pin !== null && request.headers.get(RELEASE_SOURCE_HEADER) === "ring";
222302
222462
  const cfgBytes = ringPinned ? await store.getAppConfig(app2) : await readDoc(mm.appConfigHash, () => store.getAppConfig(app2));
222303
222463
  if (!cfgBytes) return json6(404, { error: "app_config_not_found", app: app2 });
@@ -222327,9 +222487,9 @@ ${releaseId}`;
222327
222487
  let homeFrom = mm;
222328
222488
  let readHome = readDoc;
222329
222489
  if (ringPinned && homeScreenId && !mm.screens[homeScreenId]) {
222330
- const live3 = await manifest2(app2);
222331
- if (live3?.screens[homeScreenId]) {
222332
- homeFrom = live3;
222490
+ const live4 = await manifest2(app2);
222491
+ if (live4?.screens[homeScreenId]) {
222492
+ homeFrom = live4;
222333
222493
  readHome = (_hash, liveSlot) => liveSlot();
222334
222494
  }
222335
222495
  }
@@ -223052,50 +223212,50 @@ var init_preview_assets_generated = __esm({
223052
223212
  init_define_HHP_CATALOG();
223053
223213
  init_preview_assets_format();
223054
223214
  PREVIEW_ASSET_MANIFEST = [
223055
- { key: "assets/DashboardHost-Dkt8yykH.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 2984, sha256: "e826ef5f55e3e6fe6e8b31e1911c6996e1e620c2e0799c317a7f89e918787958" },
223056
- { key: "assets/DevDrawer-Xew7BiFr.js", contentType: "application/javascript; charset=utf-8", offset: 2992, length: 16783, sha256: "692ccd0572a4862f04962ab4b446c4fa1985d8cfd4416cbdb6b0e077ea82f531" },
223057
- { key: "assets/IdiomCompare-D3DTQsPc.js", contentType: "application/javascript; charset=utf-8", offset: 19775, length: 1926, sha256: "5dfd234097857e00b518490a26f22cd763db72cd70703680d0d6cfc8e9d79a99" },
223058
- { key: "assets/LightboxViewer-CJBVb0qZ.js", contentType: "application/javascript; charset=utf-8", offset: 21701, length: 17379, sha256: "9a8dc89a99043771247f7d7ee2bbbf41a8df69c9f2c1408945a08e30944a1f3a" },
223059
- { key: "assets/OfflineReadingBar-8oyoGONb.js", contentType: "application/javascript; charset=utf-8", offset: 39080, length: 1646, sha256: "5f84a3bd39044fed0e8e96d0de5cab85eed3512ef195951bc25f12ee524412bd" },
223060
- { key: "assets/PhonePreviewControl-9KM0QxYm.js", contentType: "application/javascript; charset=utf-8", offset: 40726, length: 37851, sha256: "7d2f3b57ebec72ce4c925fcb3a68adec95c1af02c1e4b3cb4a8c2d8f1b25eb86" },
223061
- { key: "assets/SchemeCompare-Dxkab461.js", contentType: "application/javascript; charset=utf-8", offset: 78577, length: 1858, sha256: "a23c74bd63cc0502387dfaa4ab611e54c997a55cd814a0901b367b74cda7de67" },
223062
- { key: "assets/WixFrogTelemetrySink-DGrETY8d.js", contentType: "application/javascript; charset=utf-8", offset: 80435, length: 3497, sha256: "43409962b43b1aacb4ffb821e1f9f2775e901049b260e414e8c76ea7c8d7d024" },
223215
+ { key: "assets/DashboardHost-BooGgQCo.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 2984, sha256: "ba7ea038bd976272ce6ff4364921dba5e36b6ced7b55b55ebcfc935ee39bd773" },
223216
+ { key: "assets/DevDrawer-6UAU_WzF.js", contentType: "application/javascript; charset=utf-8", offset: 2992, length: 16783, sha256: "cb36f567192d42811affdbdded95f82262da92173a991efc9c0517e9b2ef7b61" },
223217
+ { key: "assets/IdiomCompare-d-zPX1kt.js", contentType: "application/javascript; charset=utf-8", offset: 19775, length: 1926, sha256: "2728f375a35ee69a0f5f5c92edb63e6039574062f4acf1a7c547ff3e97e7267f" },
223218
+ { key: "assets/LightboxViewer-_G76cl1r.js", contentType: "application/javascript; charset=utf-8", offset: 21701, length: 17379, sha256: "e297bda0131ae043bcb87b4b84bcbc3cd60a803d804aca4be28feee440ed48c8" },
223219
+ { key: "assets/OfflineReadingBar-ChX8WEgd.js", contentType: "application/javascript; charset=utf-8", offset: 39080, length: 1646, sha256: "602a6b47b27f32851fdfbee528a68ccc432df0bf26931306108297cc2da6f5e9" },
223220
+ { key: "assets/PhonePreviewControl-B8m-5Dsv.js", contentType: "application/javascript; charset=utf-8", offset: 40726, length: 37851, sha256: "e27ee9f2ae02b4e2b1570afd74374f937009c95094bb34a66834d45167e7d77a" },
223221
+ { key: "assets/SchemeCompare-BKO0lmYj.js", contentType: "application/javascript; charset=utf-8", offset: 78577, length: 1858, sha256: "ac196d83b5ba27b261511e0f000909dbe3adb06fa203cbe8129e796bc0328d51" },
223222
+ { key: "assets/WixFrogTelemetrySink-cNk7EaLI.js", contentType: "application/javascript; charset=utf-8", offset: 80435, length: 3497, sha256: "404fa9bcf5b8edd4dda961016cf736d6ed8906f3c0e07a1782f9f5ea1011b844" },
223063
223223
  { key: "assets/calendar-ics-BvfIYWjG.js", contentType: "application/javascript; charset=utf-8", offset: 83932, length: 2192, sha256: "1636167041e9829ceccd3544297b86b8475c38bd2f759c4dbc17c813dc6e9254" },
223064
223224
  { key: "assets/catalog-CAoUWITw.js", contentType: "application/javascript; charset=utf-8", offset: 86124, length: 26046, sha256: "4c270ca3051f77d761aef1297125e02339d48493dd2b84a0cacf0faf41aa8cb3" },
223065
- { key: "assets/catalogFontFaces-DarpOX-8.js", contentType: "application/javascript; charset=utf-8", offset: 112170, length: 1111, sha256: "e2dd72a0beb134687199d4b5728fdbb980a8af81071b31d3cee74c9a653d0603" },
223225
+ { key: "assets/catalogFontFaces-3bif4sZo.js", contentType: "application/javascript; charset=utf-8", offset: 112170, length: 1111, sha256: "265dca01900fa1d47ed52d8226c62cf2468371a013aa19be44b62e83f880a569" },
223066
223226
  { key: "assets/contacts-vcard-BcohPQ0m.js", contentType: "application/javascript; charset=utf-8", offset: 113281, length: 2567, sha256: "c4ff75e96cd909bbb9182c5dc78794fcebc65139fbddef2537711d774fb33ad0" },
223067
- { key: "assets/files-transfer-DSAckwLq.js", contentType: "application/javascript; charset=utf-8", offset: 115848, length: 6446, sha256: "9934ee9b52dda45ddb2f182c76d3cdb75b10f1fff150d94556d12c21bbdfcc6f" },
223227
+ { key: "assets/files-transfer-D1JGe1xf.js", contentType: "application/javascript; charset=utf-8", offset: 115848, length: 6446, sha256: "56a3b912ecd1d9f934cf3ddb3eea51056363569b595493e8a4411f57d1d101e1" },
223068
223228
  { key: "assets/frogActionMap-CTMe3Bz1.js", contentType: "application/javascript; charset=utf-8", offset: 122294, length: 1172, sha256: "9f1ce4c70a680dfb902949e1f482c7e47500b69c3350cd091b1b51d674032d53" },
223069
- { key: "assets/frogApiRules-CG0L8zVF.js", contentType: "application/javascript; charset=utf-8", offset: 123466, length: 2207, sha256: "5138a3316bd0e68303f18a1cc080171359db321492fec3cf23919ac50ca4b26e" },
223229
+ { key: "assets/frogApiRules-BrNkZjBp.js", contentType: "application/javascript; charset=utf-8", offset: 123466, length: 2207, sha256: "2e15a5edda8f13c30108be3e1e8c22e851eab659e899c61c9bd6978288a814f1" },
223070
223230
  { key: "assets/frogScreenMap-S_IRnz20.js", contentType: "application/javascript; charset=utf-8", offset: 125673, length: 1067, sha256: "22b2f71e1b06df8f1e79b890d47fe42e983d37865c2cc9be753e4121764c91e1" },
223071
223231
  { key: "assets/glassPreviewBrowser-DONaOehd.js", contentType: "application/javascript; charset=utf-8", offset: 126740, length: 6578, sha256: "4402c4cddd2a564e7466cdf1e12a0e0277c0400b288e1e5eda1d23e797599d31" },
223072
223232
  { key: "assets/image-preparation-Cj4gldm6.js", contentType: "application/javascript; charset=utf-8", offset: 133318, length: 2704, sha256: "32944ea587c2f3b84389b66b50a850437560238f1c8d33b6275973ee04eee865" },
223073
- { key: "assets/index-DmB0MJKJ.js", contentType: "application/javascript; charset=utf-8", offset: 136022, length: 1565290, sha256: "a7553f2bd9aba01389289b01059bacd1daa8f8c3503f320ccf95a7ce4487ff1f" },
223074
- { key: "assets/jsx-runtime-CdvZGgm7.js", contentType: "application/javascript; charset=utf-8", offset: 1701312, length: 7751, sha256: "42a78b508d0f309f6a4a6efbb8669015211b3c26574c5b0929884c4d9d20b806" },
223075
- { key: "assets/pdf-11HKDITS.js", contentType: "application/javascript; charset=utf-8", offset: 1709063, length: 488215, sha256: "0f5533bf4197dc43489701db18378cecdb02db230a0fc2603e764999544513da" },
223076
- { key: "assets/pdf.worker.min-BGnVRhRG.js", contentType: "application/javascript; charset=utf-8", offset: 2197278, length: 90, sha256: "521a0e528916d678d7588b2cddf3dadd3bb959a6d62426382f61c77a82017e35" },
223077
- { key: "assets/pdf.worker.min-BmVo14Nb.mjs", contentType: "application/javascript; charset=utf-8", offset: 2197368, length: 1317034, sha256: "a33cfe728c584fdba4fcc1fd54bcdc2f9f2f13889ddbb5b2bd1d0f8cbe49b84e" },
223078
- { key: "assets/pdfDocument-iMU9yIaT.js", contentType: "application/javascript; charset=utf-8", offset: 3514402, length: 3470, sha256: "3ff2e5acf741af0d65b9ea75b88477bd74cac31cfeb806c93a4991794afb08c8" },
223079
- { key: "assets/pdfFetch-Cc8i1I1h.js", contentType: "application/javascript; charset=utf-8", offset: 3517872, length: 2266, sha256: "1d21ad008921942217c9eac0c35b1713773b9d89c71e3ab4412781f7bb88f463" },
223080
- { key: "assets/webviewBridgeHost-vl_MZxfG.js", contentType: "application/javascript; charset=utf-8", offset: 3520138, length: 9888, sha256: "2b14eb62daabb9b8fc1b12010b5c7d182f997aebb04bae249c1276464a7fc15e" },
223081
- { key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 3530026, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
223082
- { key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 3534636, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
223083
- { key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 4023220, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
223084
- { key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 4114144, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
223085
- { key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 4205128, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
223086
- { key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 4296108, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
223087
- { key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 4386980, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
223088
- { key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 4477960, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
223089
- { key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 4586596, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
223090
- { key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 4695680, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
223091
- { key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 4804728, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
223092
- { key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 4912428, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
223093
- { key: "himi-sw.js", contentType: "application/javascript; charset=utf-8", offset: 5000536, length: 6818, sha256: "835250c3d8004f27c2b67f9b471984351ba6df07b916d97e33b43c691200a18c" },
223094
- { key: "index.html", contentType: "text/html; charset=utf-8", offset: 5007354, length: 4924, sha256: "d4354e106e5e5e7184e55323a6fff572f68747b9b25048bfbe4a22bc7af35ac6" },
223095
- { key: "ios-glass-preview.css", contentType: "text/css; charset=utf-8", offset: 5012278, length: 11457, sha256: "6cb2b75264fa5fa2b4d28851878a5eab0712900e8b3a6c2370cc661d6d820805" },
223096
- { key: "kit-tab-bar.css", contentType: "text/css; charset=utf-8", offset: 5023735, length: 1171, sha256: "9e2c3a0faaf05d5471badf167a4d3bdf1c4e6dd65c432eea6d254158bfd99585" },
223097
- { key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 5024906, length: 23047, sha256: "20d1459e3f896f344e478e613d0c979a0de02e81a929a45d3a0ef6a53af36441" },
223098
- { key: "t5-worker-frame.html", contentType: "text/html; charset=utf-8", offset: 5047953, length: 23064, sha256: "8655cfe9c74212ec5dafecb49d2fdeb48b19f1bd8a710091e3e55631f9b4ab06" }
223233
+ { key: "assets/index-9o0qdrDh.js", contentType: "application/javascript; charset=utf-8", offset: 136022, length: 1568398, sha256: "a0449f87848b927a52b7207f4e7a62ed7a39392caf4c1c1a5d651b061bd839b1" },
223234
+ { key: "assets/jsx-runtime-CdvZGgm7.js", contentType: "application/javascript; charset=utf-8", offset: 1704420, length: 7751, sha256: "42a78b508d0f309f6a4a6efbb8669015211b3c26574c5b0929884c4d9d20b806" },
223235
+ { key: "assets/pdf-BjM9gBHL.js", contentType: "application/javascript; charset=utf-8", offset: 1712171, length: 488215, sha256: "4a260ef73a6f9f421a9119eac3d67bb9978e67b44c66a870038d189e6c77a0bd" },
223236
+ { key: "assets/pdf.worker.min-BGnVRhRG.js", contentType: "application/javascript; charset=utf-8", offset: 2200386, length: 90, sha256: "521a0e528916d678d7588b2cddf3dadd3bb959a6d62426382f61c77a82017e35" },
223237
+ { key: "assets/pdf.worker.min-BmVo14Nb.mjs", contentType: "application/javascript; charset=utf-8", offset: 2200476, length: 1317034, sha256: "a33cfe728c584fdba4fcc1fd54bcdc2f9f2f13889ddbb5b2bd1d0f8cbe49b84e" },
223238
+ { key: "assets/pdfDocument-D_URrSsW.js", contentType: "application/javascript; charset=utf-8", offset: 3517510, length: 3470, sha256: "1dbbf7bdcad4a0bec0fe28a739aa7adeb5eb2471153c6bbdae5d9ea73c1b0c8c" },
223239
+ { key: "assets/pdfFetch-Cc8i1I1h.js", contentType: "application/javascript; charset=utf-8", offset: 3520980, length: 2266, sha256: "1d21ad008921942217c9eac0c35b1713773b9d89c71e3ab4412781f7bb88f463" },
223240
+ { key: "assets/webviewBridgeHost-C9A4jWR7.js", contentType: "application/javascript; charset=utf-8", offset: 3523246, length: 9888, sha256: "a8707f0e7f8fdc92baa40f496aaf9e882780fb493714b13c5d76399db46548e9" },
223241
+ { key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 3533134, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
223242
+ { key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 3537744, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
223243
+ { key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 4026328, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
223244
+ { key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 4117252, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
223245
+ { key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 4208236, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
223246
+ { key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 4299216, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
223247
+ { key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 4390088, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
223248
+ { key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 4481068, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
223249
+ { key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 4589704, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
223250
+ { key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 4698788, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
223251
+ { key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 4807836, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
223252
+ { key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 4915536, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
223253
+ { key: "himi-sw.js", contentType: "application/javascript; charset=utf-8", offset: 5003644, length: 6818, sha256: "835250c3d8004f27c2b67f9b471984351ba6df07b916d97e33b43c691200a18c" },
223254
+ { key: "index.html", contentType: "text/html; charset=utf-8", offset: 5010462, length: 4924, sha256: "ed8dc94c2f11cdb92b539cb9a780955114073aca7a53c9fbe2b8734e602928f6" },
223255
+ { key: "ios-glass-preview.css", contentType: "text/css; charset=utf-8", offset: 5015386, length: 11457, sha256: "6cb2b75264fa5fa2b4d28851878a5eab0712900e8b3a6c2370cc661d6d820805" },
223256
+ { key: "kit-tab-bar.css", contentType: "text/css; charset=utf-8", offset: 5026843, length: 1171, sha256: "9e2c3a0faaf05d5471badf167a4d3bdf1c4e6dd65c432eea6d254158bfd99585" },
223257
+ { key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 5028014, length: 23047, sha256: "20d1459e3f896f344e478e613d0c979a0de02e81a929a45d3a0ef6a53af36441" },
223258
+ { key: "t5-worker-frame.html", contentType: "text/html; charset=utf-8", offset: 5051061, length: 23064, sha256: "8655cfe9c74212ec5dafecb49d2fdeb48b19f1bd8a710091e3e55631f9b4ab06" }
223099
223259
  ];
223100
223260
  }
223101
223261
  });
@@ -225181,14 +225341,14 @@ var init_iap_api = __esm({
225181
225341
  return points.map((p2) => ({ id: p2.id, customerPrice: attr(p2, "customerPrice") }));
225182
225342
  }
225183
225343
  async readPriceSchedule(resourceId) {
225184
- const schedule = await readOptional(() => this.client.get(`/v2/inAppPurchases/${enc(resourceId)}/iapPriceSchedule?include=baseTerritory`));
225185
- if (!schedule) return void 0;
225186
- const doc = await this.client.get(`/v1/inAppPurchasePriceSchedules/${enc(schedule.id)}/manualPrices?include=inAppPurchasePricePoint,territory&${PAGE3}`);
225187
- if (doc.links?.next) throw new AscError2("truncated", `price schedule ${schedule.id} has more manual prices than one page`);
225344
+ const schedule2 = await readOptional(() => this.client.get(`/v2/inAppPurchases/${enc(resourceId)}/iapPriceSchedule?include=baseTerritory`));
225345
+ if (!schedule2) return void 0;
225346
+ const doc = await this.client.get(`/v1/inAppPurchasePriceSchedules/${enc(schedule2.id)}/manualPrices?include=inAppPurchasePricePoint,territory&${PAGE3}`);
225347
+ if (doc.links?.next) throw new AscError2("truncated", `price schedule ${schedule2.id} has more manual prices than one page`);
225188
225348
  const prices = Array.isArray(doc.data) ? doc.data : [];
225189
225349
  return {
225190
- id: schedule.id,
225191
- baseTerritory: relatedId(schedule, "baseTerritory"),
225350
+ id: schedule2.id,
225351
+ baseTerritory: relatedId(schedule2, "baseTerritory"),
225192
225352
  manualPrices: prices.map((p2) => toManualPrice(p2, doc.included ?? []))
225193
225353
  };
225194
225354
  }
@@ -225573,10 +225733,10 @@ function createCatalogIapApi(client4, appId3) {
225573
225733
  },
225574
225734
  listPricePoints: points,
225575
225735
  readPriceSchedule: async (id) => {
225576
- const schedule = (await client4.getPriceSchedule(appId3, id)).priceSchedule;
225577
- if (!schedule) return void 0;
225578
- const territories = new Map(await Promise.all([...new Set((schedule.manualPrices ?? []).map((p2) => p2.territory))].map(async (territory2) => [territory2, await points(id, territory2)])));
225579
- return { id: schedule.id, baseTerritory: schedule.baseTerritory ?? "", manualPrices: (schedule.manualPrices ?? []).map((p2) => {
225736
+ const schedule2 = (await client4.getPriceSchedule(appId3, id)).priceSchedule;
225737
+ if (!schedule2) return void 0;
225738
+ const territories = new Map(await Promise.all([...new Set((schedule2.manualPrices ?? []).map((p2) => p2.territory))].map(async (territory2) => [territory2, await points(id, territory2)])));
225739
+ return { id: schedule2.id, baseTerritory: schedule2.baseTerritory ?? "", manualPrices: (schedule2.manualPrices ?? []).map((p2) => {
225580
225740
  const point = territories.get(p2.territory)?.find((point2) => point2.id === p2.pricePointId);
225581
225741
  if (!point) throw new Error(`Catalog price point ${p2.pricePointId} could not be read`);
225582
225742
  return { territory: p2.territory, customerPrice: point.customerPrice, startDate: p2.startDate ?? null, endDate: p2.endDate ?? null };
@@ -226062,11 +226222,11 @@ var init_iap_result = __esm({
226062
226222
  });
226063
226223
 
226064
226224
  // ../store-release/iap-price-status.ts
226065
- function livePriceIssue(live3, item2) {
226066
- if (!live3) return "item missing from the Wix catalog";
226067
- if (live3.hidden || live3.kind !== "digital") return "Wix item is hidden or no longer a supported digital item";
226068
- if (!live3.price || !/^\d+(\.\d+)?$/.test(live3.price.amount) || compareAmounts(live3.price.amount, "0") <= 0) return "Wix item is free or has no valid paid price";
226069
- if (live3.price.currency !== item2.price.currency) return `Wix currency ${live3.price.currency} differs from ${item2.price.currency}`;
226225
+ function livePriceIssue(live4, item2) {
226226
+ if (!live4) return "item missing from the Wix catalog";
226227
+ if (live4.hidden || live4.kind !== "digital") return "Wix item is hidden or no longer a supported digital item";
226228
+ if (!live4.price || !/^\d+(\.\d+)?$/.test(live4.price.amount) || compareAmounts(live4.price.amount, "0") <= 0) return "Wix item is free or has no valid paid price";
226229
+ if (live4.price.currency !== item2.price.currency) return `Wix currency ${live4.price.currency} differs from ${item2.price.currency}`;
226070
226230
  return void 0;
226071
226231
  }
226072
226232
  async function checkStatusPrice(item2, observed, pricing, catalog4) {
@@ -226074,10 +226234,10 @@ async function checkStatusPrice(item2, observed, pricing, catalog4) {
226074
226234
  let price = item2.price;
226075
226235
  if (catalog4 !== void 0) {
226076
226236
  if (!item2.wix) return { priceSource, priceCheckIssue: "live Wix price checks do not reprice shared consumable tiers" };
226077
- const live3 = catalog4.find((c2) => c2.source === item2.wix.entityType && c2.id === item2.wix.entityId);
226078
- const issue3 = livePriceIssue(live3, item2);
226237
+ const live4 = catalog4.find((c2) => c2.source === item2.wix.entityType && c2.id === item2.wix.entityId);
226238
+ const issue3 = livePriceIssue(live4, item2);
226079
226239
  if (issue3) return { priceSource, priceCheckIssue: issue3 };
226080
- price = { ...price, amount: live3.price.amount };
226240
+ price = { ...price, amount: live4.price.amount };
226081
226241
  }
226082
226242
  if (!observed?.price || observed.price.customerPrices.length !== 1) return { priceSource, priceCheckIssue: "Apple has no unambiguous current base-territory price" };
226083
226243
  if (observed.price.baseTerritory !== price.baseTerritory) return { priceSource, priceCheckIssue: "Apple and the manifest use different base territories" };
@@ -226277,13 +226437,13 @@ function inEffect(price, today2) {
226277
226437
  return (!price.startDate || price.startDate <= today2) && (!price.endDate || price.endDate > today2);
226278
226438
  }
226279
226439
  async function readObservedPrice(api4, resourceId, today2 = isoDay(/* @__PURE__ */ new Date())) {
226280
- const schedule = await api4.readPriceSchedule(resourceId);
226281
- return priceInEffect(schedule, today2);
226440
+ const schedule2 = await api4.readPriceSchedule(resourceId);
226441
+ return priceInEffect(schedule2, today2);
226282
226442
  }
226283
- function priceInEffect(schedule, today2) {
226284
- const basePrices = schedule?.manualPrices.filter((p2) => p2.territory === schedule.baseTerritory && inEffect(p2, today2)) ?? [];
226285
- if (!schedule || !basePrices.length) return void 0;
226286
- return { baseTerritory: schedule.baseTerritory, customerPrices: basePrices.map((p2) => p2.customerPrice) };
226443
+ function priceInEffect(schedule2, today2) {
226444
+ const basePrices = schedule2?.manualPrices.filter((p2) => p2.territory === schedule2.baseTerritory && inEffect(p2, today2)) ?? [];
226445
+ if (!schedule2 || !basePrices.length) return void 0;
226446
+ return { baseTerritory: schedule2.baseTerritory, customerPrices: basePrices.map((p2) => p2.customerPrice) };
226287
226447
  }
226288
226448
  async function readObservedAvailability(api4, resourceId) {
226289
226449
  const availability = await api4.readAvailability(resourceId);
@@ -226425,16 +226585,16 @@ function localizationOps(item2, observed) {
226425
226585
  return found.name === wanted.name && found.description === wanted.description ? [] : [{ kind: "updateLocalization", locale: wanted.locale }];
226426
226586
  });
226427
226587
  }
226428
- function priceScheduleConflict(schedule, today2) {
226429
- if (!schedule) return "the price schedule could not be read";
226430
- const pending2 = schedule.manualPrices.filter((p2) => !p2.endDate || p2.endDate > today2);
226588
+ function priceScheduleConflict(schedule2, today2) {
226589
+ if (!schedule2) return "the price schedule could not be read";
226590
+ const pending2 = schedule2.manualPrices.filter((p2) => !p2.endDate || p2.endDate > today2);
226431
226591
  if (pending2.some((p2) => p2.startDate && p2.startDate > today2 || p2.endDate)) return "future or temporary price changes must be resolved in App Store Connect";
226432
- if (pending2.some((p2) => p2.territory !== schedule.baseTerritory)) return "custom territory prices must be resolved in App Store Connect";
226592
+ if (pending2.some((p2) => p2.territory !== schedule2.baseTerritory)) return "custom territory prices must be resolved in App Store Connect";
226433
226593
  if (pending2.length !== 1) return "the current base-territory price is ambiguous";
226434
226594
  return void 0;
226435
226595
  }
226436
- function priceScheduleDigest(schedule) {
226437
- return sha256Digest(schedule ? { ...schedule, manualPrices: [...schedule.manualPrices].sort((a2, b2) => JSON.stringify(a2).localeCompare(JSON.stringify(b2))) } : null);
226596
+ function priceScheduleDigest(schedule2) {
226597
+ return sha256Digest(schedule2 ? { ...schedule2, manualPrices: [...schedule2.manualPrices].sort((a2, b2) => JSON.stringify(a2).localeCompare(JSON.stringify(b2))) } : null);
226438
226598
  }
226439
226599
  async function priceOps(pricing, item2, observed, target, today2) {
226440
226600
  if (observed.price) {
@@ -226635,32 +226795,32 @@ function assertSameAccount(planned2, current) {
226635
226795
  `the plan was made with profile "${planned2.profile}" (team ${planned2.team}, key ${planned2.fingerprint}) but this run resolved profile "${current.profile}" (team ${current.team}, key ${current.fingerprint}). Make a new plan with the account you mean.`
226636
226796
  );
226637
226797
  }
226638
- function driftOf(planned2, live3, today2) {
226798
+ function driftOf(planned2, live4, today2) {
226639
226799
  if (planned2.decision === "conflict") return void 0;
226640
- if (live3.decision === "conflict") return `${live3.productId} now conflicts: ${live3.conflicts.join("; ")}`;
226800
+ if (live4.decision === "conflict") return `${live4.productId} now conflicts: ${live4.conflicts.join("; ")}`;
226641
226801
  const priceChange = planned2.ops.find((op) => op.kind === "changePrice");
226642
226802
  if (priceChange) {
226643
- if (planned2.targetPrice !== live3.targetPrice) return `${live3.productId} now resolves to another Apple price point`;
226644
- if (planned2.observed?.state !== live3.observed?.state || JSON.stringify(planned2.observed?.versions) !== JSON.stringify(live3.observed?.versions)) return `${live3.productId} changed review state`;
226645
- if (live3.ops.some((op) => op.kind === "changePrice") && priceScheduleDigest(planned2.observed?.priceSchedule) !== priceScheduleDigest(live3.observed?.priceSchedule)) return `${live3.productId} changed its price schedule`;
226646
- const scheduleProblem = priceScheduleConflict(live3.observed?.priceSchedule, today2);
226647
- if (scheduleProblem) return `${live3.productId}: ${scheduleProblem}`;
226648
- }
226649
- const [plannedShot, liveShot] = [planned2.reviewScreenshot, live3.reviewScreenshot];
226650
- if (plannedShot && liveShot && plannedShot.checksum !== liveShot.checksum) return `${live3.productId}: ${liveShot.fileName} changed since the plan was made`;
226651
- if (replacesUnplannedScreenshot(planned2, live3)) return `${live3.productId}: a review screenshot was added in App Store Connect after the plan \u2014 make a new plan before replacing it`;
226652
- const unplanned = live3.ops.filter((op) => !planned2.ops.some((p2) => sameOp(p2, op)));
226653
- return unplanned.length ? `${live3.productId} now needs ${unplanned.map(describeOp).join(", ")}, which the plan did not list` : void 0;
226654
- }
226655
- function replacesUnplannedScreenshot(planned2, live3) {
226656
- if (!live3.ops.some((op) => op.kind === "replaceReviewScreenshot")) return false;
226657
- const held = live3.observed?.reviewScreenshot;
226803
+ if (planned2.targetPrice !== live4.targetPrice) return `${live4.productId} now resolves to another Apple price point`;
226804
+ if (planned2.observed?.state !== live4.observed?.state || JSON.stringify(planned2.observed?.versions) !== JSON.stringify(live4.observed?.versions)) return `${live4.productId} changed review state`;
226805
+ if (live4.ops.some((op) => op.kind === "changePrice") && priceScheduleDigest(planned2.observed?.priceSchedule) !== priceScheduleDigest(live4.observed?.priceSchedule)) return `${live4.productId} changed its price schedule`;
226806
+ const scheduleProblem = priceScheduleConflict(live4.observed?.priceSchedule, today2);
226807
+ if (scheduleProblem) return `${live4.productId}: ${scheduleProblem}`;
226808
+ }
226809
+ const [plannedShot, liveShot] = [planned2.reviewScreenshot, live4.reviewScreenshot];
226810
+ if (plannedShot && liveShot && plannedShot.checksum !== liveShot.checksum) return `${live4.productId}: ${liveShot.fileName} changed since the plan was made`;
226811
+ if (replacesUnplannedScreenshot(planned2, live4)) return `${live4.productId}: a review screenshot was added in App Store Connect after the plan \u2014 make a new plan before replacing it`;
226812
+ const unplanned = live4.ops.filter((op) => !planned2.ops.some((p2) => sameOp(p2, op)));
226813
+ return unplanned.length ? `${live4.productId} now needs ${unplanned.map(describeOp).join(", ")}, which the plan did not list` : void 0;
226814
+ }
226815
+ function replacesUnplannedScreenshot(planned2, live4) {
226816
+ if (!live4.ops.some((op) => op.kind === "replaceReviewScreenshot")) return false;
226817
+ const held = live4.observed?.reviewScreenshot;
226658
226818
  if (!held || isScreenshotLeftover(held)) return false;
226659
226819
  const seen = planned2.observed?.reviewScreenshot;
226660
226820
  return !seen || seen.id !== held.id || isScreenshotLeftover(seen);
226661
226821
  }
226662
- function assertNoDrift(plan, live3, today2) {
226663
- const drift = [...live3].map(([i2, current]) => driftOf(plan.items[i2], current, today2)).filter((d2) => d2 !== void 0);
226822
+ function assertNoDrift(plan, live4, today2) {
226823
+ const drift = [...live4].map(([i2, current]) => driftOf(plan.items[i2], current, today2)).filter((d2) => d2 !== void 0);
226664
226824
  if (!drift.length) return;
226665
226825
  throw new IapProvisionError("drift", `App Store Connect changed since the plan was made \u2014 nothing was written:
226666
226826
  - ${drift.join("\n - ")}
@@ -226823,12 +226983,12 @@ function operationRunners(context, manifest2) {
226823
226983
  const { point, failure: failure3 } = await pricing.resolve(resourceId, price);
226824
226984
  if (!point || point.customerPrice !== op.to) throw new UnresolvedWriteError(failure3 ?? "Apple's target price changed after preflight \u2014 make a new plan");
226825
226985
  const matches2 = async () => {
226826
- const schedule = await api4.readPriceSchedule(resourceId);
226986
+ const schedule2 = await api4.readPriceSchedule(resourceId);
226827
226987
  const today2 = context.now().toISOString().slice(0, 10);
226828
- const problem = priceScheduleConflict(schedule, today2);
226988
+ const problem = priceScheduleConflict(schedule2, today2);
226829
226989
  if (problem) throw new UnresolvedWriteError(problem);
226830
- if (priceMatches(priceInEffect(schedule, today2), price, op.to)) return true;
226831
- if (priceScheduleDigest(schedule) !== priceScheduleDigest(run3.priceSchedule)) throw new UnresolvedWriteError("Apple's price schedule changed after preflight \u2014 make a new plan");
226990
+ if (priceMatches(priceInEffect(schedule2, today2), price, op.to)) return true;
226991
+ if (priceScheduleDigest(schedule2) !== priceScheduleDigest(run3.priceSchedule)) throw new UnresolvedWriteError("Apple's price schedule changed after preflight \u2014 make a new plan");
226832
226992
  return void 0;
226833
226993
  };
226834
226994
  if (await matches2()) return { state: "reconciled" };
@@ -226927,11 +227087,11 @@ async function knownUnmetFor(item2, planned2, context) {
226927
227087
  const metadata2 = metadataDiffs(item2, planned2.observed, planned2.targetPrice ?? await context.pricing.targetAmount(item2.price));
226928
227088
  return [...metadata2, ...context.api.managed ? [] : screenshotUnmet(planned2.reviewScreenshot, planned2.observed)];
226929
227089
  }
226930
- async function applyItem(item2, live3, context, manifest2) {
227090
+ async function applyItem(item2, live4, context, manifest2) {
226931
227091
  const base = { target: manifest2.target, item: item2, readAt: context.now() };
226932
- if (live3.decision === "conflict") {
226933
- const unmet2 = await knownUnmetFor(item2, live3, context);
226934
- return itemResult({ ...base, observed: live3.observed, outcome: "conflict", conflicts: live3.conflicts, unmet: unmet2 });
227092
+ if (live4.decision === "conflict") {
227093
+ const unmet2 = await knownUnmetFor(item2, live4, context);
227094
+ return itemResult({ ...base, observed: live4.observed, outcome: "conflict", conflicts: live4.conflicts, unmet: unmet2 });
226935
227095
  }
226936
227096
  if (context.api.managed) {
226937
227097
  try {
@@ -226940,30 +227100,30 @@ async function applyItem(item2, live3, context, manifest2) {
226940
227100
  const code3 = error instanceof IapCatalogError ? error.code : "catalog_request_failed";
226941
227101
  const conflict = ["sku_in_use", "mapping_conflict", "mapping_inactive", "mapping_type_mismatch", "mapping_unsupported"].includes(code3);
226942
227102
  const detail = error instanceof Error ? error.message : String(error);
226943
- const result2 = itemResult({ ...base, observed: live3.observed, outcome: conflict ? "conflict" : "failed", ...conflict ? { conflicts: [detail] } : { unmet: [detail] } });
227103
+ const result2 = itemResult({ ...base, observed: live4.observed, outcome: conflict ? "conflict" : "failed", ...conflict ? { conflicts: [detail] } : { unmet: [detail] } });
226944
227104
  result2.provisioning.code = code3;
226945
227105
  return result2;
226946
227106
  }
226947
227107
  }
226948
227108
  const run3 = {
226949
227109
  item: item2,
226950
- resourceId: live3.observed?.resourceId,
226951
- versionId: live3.observed?.draftVersionId,
226952
- localizations: live3.observed?.draftVersionId ? live3.observed.localizations : [],
226953
- priceSchedule: live3.observed?.priceSchedule
227110
+ resourceId: live4.observed?.resourceId,
227111
+ versionId: live4.observed?.draftVersionId,
227112
+ localizations: live4.observed?.draftVersionId ? live4.observed.localizations : [],
227113
+ priceSchedule: live4.observed?.priceSchedule
226954
227114
  };
226955
- const steps = await runOps(run3, live3.ops, context, manifest2);
227115
+ const steps = await runOps(run3, live4.ops, context, manifest2);
226956
227116
  const { observed, failure: failure3 } = await readBack2(run3, context, manifest2);
226957
- const unmet = failure3 ? [`could not read the product back: ${failure3}`] : [...await unmetFor(item2, observed, context), ...context.api.managed ? [] : screenshotUnmet(live3.reviewScreenshot, observed)];
226958
- const outcome = outcomeOf(live3.ops, steps, unmet);
227117
+ const unmet = failure3 ? [`could not read the product back: ${failure3}`] : [...await unmetFor(item2, observed, context), ...context.api.managed ? [] : screenshotUnmet(live4.reviewScreenshot, observed)];
227118
+ const outcome = outcomeOf(live4.ops, steps, unmet);
226959
227119
  const result = itemResult({ ...base, readAt: context.now(), observed, outcome, steps, unmet, appleResourceId: run3.resourceId });
226960
227120
  const code2 = steps.find((step) => step.code)?.code;
226961
227121
  if (code2) result.provisioning.code = code2;
226962
227122
  return result;
226963
227123
  }
226964
- function deferredResult(item2, live3, context, manifest2) {
226965
- const steps = live3.ops.map((op) => stepFor(op, "notRun"));
226966
- return itemResult({ target: manifest2.target, item: item2, observed: live3.observed, outcome: "deferred", steps, requirements: [DEFERRED_REQUIREMENT], readAt: context.now() });
227124
+ function deferredResult(item2, live4, context, manifest2) {
227125
+ const steps = live4.ops.map((op) => stepFor(op, "notRun"));
227126
+ return itemResult({ target: manifest2.target, item: item2, observed: live4.observed, outcome: "deferred", steps, requirements: [DEFERRED_REQUIREMENT], readAt: context.now() });
226967
227127
  }
226968
227128
  function needsRefresh(planned2) {
226969
227129
  return planned2.decision !== "conflict" && planned2.ops.length > 0;
@@ -226982,12 +227142,12 @@ async function applyIap(planDoc, applyContext) {
226982
227142
  const context = { ...applyContext, ...manifestDir ? { manifestDir } : {}, pricing: applyContext.pricing ?? new PriceGrid(applyContext.api) };
226983
227143
  const manifest2 = plan.manifest;
226984
227144
  const refresh = plan.items.flatMap((planned2, i2) => (context.api.managed ? planned2.decision !== "conflict" : needsRefresh(planned2)) ? [i2] : []);
226985
- const live3 = await planItemsAt(context, manifest2, refresh);
226986
- assertNoDrift(plan, live3, context.now().toISOString().slice(0, 10));
227145
+ const live4 = await planItemsAt(context, manifest2, refresh);
227146
+ assertNoDrift(plan, live4, context.now().toISOString().slice(0, 10));
226987
227147
  const items = [];
226988
227148
  let created = 0;
226989
227149
  for (const [i2, item2] of manifest2.items.entries()) {
226990
- const itemPlan2 = live3.get(i2);
227150
+ const itemPlan2 = live4.get(i2);
226991
227151
  if (!itemPlan2) {
226992
227152
  items.push(await plannedResult(item2, plan.items[i2], plan, context, manifest2));
226993
227153
  continue;
@@ -227355,10 +227515,10 @@ function refreshMergedPrices(items, catalog4, options2) {
227355
227515
  return items.flatMap((existing) => {
227356
227516
  if (!existing.wix || existing.price.rule !== "atLeast") return [];
227357
227517
  const { entityType, entityId } = existing.wix;
227358
- const live3 = byEntity.get(entityKey(entityType, entityId));
227359
- const reason = live3 ? skipReason(live3, { ...options2, baseTerritory: existing.price.baseTerritory, currency: existing.price.currency, applePrices: existing.price.baseTerritory === options2.baseTerritory ? options2.applePrices : void 0 }) : "missing from the Wix catalog";
227360
- if (reason) return [{ source: entityType, id: entityId, name: live3?.name ?? existing.referenceName, reason: `${reason} \u2014 existing mapping and price retained` }];
227361
- existing.price.amount = normalizeAmount(live3.price.amount);
227518
+ const live4 = byEntity.get(entityKey(entityType, entityId));
227519
+ const reason = live4 ? skipReason(live4, { ...options2, baseTerritory: existing.price.baseTerritory, currency: existing.price.currency, applePrices: existing.price.baseTerritory === options2.baseTerritory ? options2.applePrices : void 0 }) : "missing from the Wix catalog";
227520
+ if (reason) return [{ source: entityType, id: entityId, name: live4?.name ?? existing.referenceName, reason: `${reason} \u2014 existing mapping and price retained` }];
227521
+ existing.price.amount = normalizeAmount(live4.price.amount);
227362
227522
  return [];
227363
227523
  });
227364
227524
  }
@@ -229992,9 +230152,9 @@ function analyzeStoreIdentity(projectYml, storeConfig, xcconfig, adopted) {
229992
230152
  f2.push({ level: "error", message: `Store build would ship the developer identity: bundle id "${shipped}" ends in .dev. ${remedy}` });
229993
230153
  }
229994
230154
  }
229995
- const live3 = projectYml.split("\n").filter((l2) => !/^\s*#/.test(l2)).join("\n");
230155
+ const live4 = projectYml.split("\n").filter((l2) => !/^\s*#/.test(l2)).join("\n");
229996
230156
  const replaced = /* @__PURE__ */ new Set();
229997
- for (const m2 of live3.matchAll(/\b(applinks|webcredentials):([^\s"'#]+)/g)) {
230157
+ for (const m2 of live4.matchAll(/\b(applinks|webcredentials):([^\s"'#]+)/g)) {
229998
230158
  const [, service, written] = m2;
229999
230159
  if (service === "applinks" && adopted?.associatedDomainHosts.length) continue;
230000
230160
  const swapped = service === "applinks" && !!configured.associatedDomain && /^(?:localhost\b|\$\([A-Z0-9_]+\))/.test(written);
@@ -230014,7 +230174,7 @@ function analyzeStoreIdentity(projectYml, storeConfig, xcconfig, adopted) {
230014
230174
  }
230015
230175
  for (const name of replaced) {
230016
230176
  const ref = `$(${name})`;
230017
- const elsewhere = live3.split("\n").some((l2) => l2.includes(ref) && !/\b(?:applinks|webcredentials):/.test(l2));
230177
+ const elsewhere = live4.split("\n").some((l2) => l2.includes(ref) && !/\b(?:applinks|webcredentials):/.test(l2));
230018
230178
  const value2 = expandVars(ref, xcconfig);
230019
230179
  if (elsewhere && isLoopback2(value2)) {
230020
230180
  f2.push({
@@ -234085,12 +234245,12 @@ function keepRemotePermissions(desired, remote, spec) {
234085
234245
  const remoteProps = propsOf2(remote);
234086
234246
  const desiredProps = propsOf2(desired);
234087
234247
  for (const f2 of spec.fields ?? []) {
234088
- const live3 = remoteProps[f2.key];
234089
- if (!live3 || f2.rls === void 0) continue;
234090
- if (canonical7(f2.rls) === canonical7(live3.rls ?? {})) continue;
234091
- drift.push({ kind: "permissions", detail: `field "${f2.key}": declared rls ${canonical7(f2.rls)} differs from the live ${canonical7(live3.rls ?? {})} \u2014 the live rules are kept` });
234092
- if (live3.rls === void 0) delete desiredProps[f2.key].rls;
234093
- else desiredProps[f2.key].rls = live3.rls;
234248
+ const live4 = remoteProps[f2.key];
234249
+ if (!live4 || f2.rls === void 0) continue;
234250
+ if (canonical7(f2.rls) === canonical7(live4.rls ?? {})) continue;
234251
+ drift.push({ kind: "permissions", detail: `field "${f2.key}": declared rls ${canonical7(f2.rls)} differs from the live ${canonical7(live4.rls ?? {})} \u2014 the live rules are kept` });
234252
+ if (live4.rls === void 0) delete desiredProps[f2.key].rls;
234253
+ else desiredProps[f2.key].rls = live4.rls;
234094
234254
  }
234095
234255
  return drift;
234096
234256
  }
@@ -234111,9 +234271,9 @@ function planEntitySync(declared, snapshot4, opts) {
234111
234271
  const specs = declared.filter((s2) => !!s2 && typeof s2 === "object");
234112
234272
  const owned = new Map(specs.filter(isOwnedEntity).map((s2) => [physicalEntityName(s2, app2), s2]));
234113
234273
  const adopted = new Set(specs.filter(isAdoptedEntity).map((s2) => physicalEntityName(s2, app2)));
234114
- const live3 = new Map(snapshot4.map((e2) => [e2.name, e2]));
234274
+ const live4 = new Map(snapshot4.map((e2) => [e2.name, e2]));
234115
234275
  const provisioned = new Set((opts.provisioned ?? []).filter((n2) => isOwnedPhysical(n2, app2)));
234116
- const ownedHere = /* @__PURE__ */ new Set([...snapshot4.map((e2) => e2.name).filter((n2) => provisioned.has(n2)), ...[...owned.keys()].filter((n2) => !live3.has(n2))]);
234276
+ const ownedHere = /* @__PURE__ */ new Set([...snapshot4.map((e2) => e2.name).filter((n2) => provisioned.has(n2)), ...[...owned.keys()].filter((n2) => !live4.has(n2))]);
234117
234277
  plan.owned = [...ownedHere].sort();
234118
234278
  for (const e2 of snapshot4) {
234119
234279
  if (!ownedHere.has(e2.name)) {
@@ -234172,12 +234332,12 @@ function planEntitySync(declared, snapshot4, opts) {
234172
234332
  plan.actions.push({ name: e2.name, ownership: "owned", action: changed ? "update" : "unchanged", ...drift.length ? { drift } : {} });
234173
234333
  }
234174
234334
  for (const [name, spec] of owned) {
234175
- if (live3.has(name)) continue;
234335
+ if (live4.has(name)) continue;
234176
234336
  plan.next[name] = toBase44Schema(spec, app2);
234177
234337
  plan.actions.push({ name, ownership: "owned", action: "create" });
234178
234338
  }
234179
234339
  for (const name of adopted) {
234180
- if (!live3.has(name)) plan.warnings.push(`adopted entity "${name}" is not on the live app \u2014 himi never creates an entity it does not own`);
234340
+ if (!live4.has(name)) plan.warnings.push(`adopted entity "${name}" is not on the live app \u2014 himi never creates an entity it does not own`);
234181
234341
  }
234182
234342
  plan.refusals.push(...foreignGuard(snapshot4, plan.next, ownedHere));
234183
234343
  return plan;
@@ -234315,12 +234475,12 @@ async function createBase44Entities(opts) {
234315
234475
  const owned = new Set(second.owned);
234316
234476
  const ledgerNames = Object.keys(second.next).filter((n2) => owned.has(n2));
234317
234477
  const maybeApplied = async () => {
234318
- let live3 = /* @__PURE__ */ new Set();
234478
+ let live4 = /* @__PURE__ */ new Set();
234319
234479
  try {
234320
- live3 = new Set((await readEntitySnapshot(appId3, { download: opts.download })).entities.map((e2) => e2.name));
234480
+ live4 = new Set((await readEntitySnapshot(appId3, { download: opts.download })).entities.map((e2) => e2.name));
234321
234481
  } catch {
234322
234482
  }
234323
- return [.../* @__PURE__ */ new Set([...provisioned, ...ledgerNames.filter((n2) => provisioned.includes(n2) || live3.has(n2))])];
234483
+ return [.../* @__PURE__ */ new Set([...provisioned, ...ledgerNames.filter((n2) => provisioned.includes(n2) || live4.has(n2))])];
234324
234484
  };
234325
234485
  let res;
234326
234486
  try {
@@ -238660,16 +238820,16 @@ function canonical8(v2) {
238660
238820
  }
238661
238821
  return JSON.stringify(v2) ?? "undefined";
238662
238822
  }
238663
- function liveItemType(live3, key3) {
238664
- const props2 = live3.schema?.properties;
238823
+ function liveItemType(live4, key3) {
238824
+ const props2 = live4.schema?.properties;
238665
238825
  const items = props2?.[key3]?.items;
238666
238826
  const t2 = items && typeof items === "object" ? items.type : void 0;
238667
238827
  return typeof t2 === "string" ? t2 : void 0;
238668
238828
  }
238669
- function diffEntityFields(spec, live3) {
238670
- const entity = live3.name;
238829
+ function diffEntityFields(spec, live4) {
238830
+ const entity = live4.name;
238671
238831
  const out2 = [];
238672
- const liveFields = new Map(live3.fields.filter((f2) => !BUILTINS3.has(f2.name)).map((f2) => [f2.name, f2]));
238832
+ const liveFields = new Map(live4.fields.filter((f2) => !BUILTINS3.has(f2.name)).map((f2) => [f2.name, f2]));
238673
238833
  for (const f2 of spec.fields ?? []) {
238674
238834
  const remote = liveFields.get(f2.key);
238675
238835
  const declared = typeLabel(f2.type, f2.format);
@@ -238680,7 +238840,7 @@ function diffEntityFields(spec, live3) {
238680
238840
  if (actual !== declared) out2.push({ entity, kind: "type-mismatch", detail: `field "${f2.key}" is declared ${declared} but the live entity has ${actual}` });
238681
238841
  else if (f2.type === "array") {
238682
238842
  const declaredItems = f2.items?.type;
238683
- const liveItems = liveItemType(live3, f2.key);
238843
+ const liveItems = liveItemType(live4, f2.key);
238684
238844
  if (declaredItems !== liveItems) {
238685
238845
  out2.push({ entity, kind: "type-mismatch", detail: `field "${f2.key}" is declared array of ${declaredItems ?? "unspecified"} but the live entity has array of ${liveItems ?? "unspecified"}` });
238686
238846
  }
@@ -238692,8 +238852,8 @@ function diffEntityFields(spec, live3) {
238692
238852
  if (!DECLARABLE_TYPES.has(f2.type)) continue;
238693
238853
  out2.push({ entity, kind: "extra-field", detail: `field "${key3}" (${typeLabel(f2.type, f2.format)}) exists on the live entity but is not declared` });
238694
238854
  }
238695
- if (spec.rls !== void 0 && canonical8(spec.rls) !== canonical8(live3.rls ?? {})) {
238696
- out2.push({ entity, kind: "rls-mismatch", detail: `declared rls ${canonical8(spec.rls)} differs from the live rls ${canonical8(live3.rls ?? {})} \u2014 informational; nothing is changed` });
238855
+ if (spec.rls !== void 0 && canonical8(spec.rls) !== canonical8(live4.rls ?? {})) {
238856
+ out2.push({ entity, kind: "rls-mismatch", detail: `declared rls ${canonical8(spec.rls)} differs from the live rls ${canonical8(live4.rls ?? {})} \u2014 informational; nothing is changed` });
238697
238857
  }
238698
238858
  return out2;
238699
238859
  }
@@ -238726,15 +238886,15 @@ async function countRows(ports, appId3, entity, cap = ROW_COUNT_CAP) {
238726
238886
  async function queryBase44Entities(opts) {
238727
238887
  const { app: app2, appId: appId3, ports } = opts;
238728
238888
  const cap = opts.cap ?? ROW_COUNT_CAP;
238729
- let live3;
238889
+ let live4;
238730
238890
  let sourceError;
238731
238891
  try {
238732
- live3 = await readLiveSchemas(ports, appId3);
238892
+ live4 = await readLiveSchemas(ports, appId3);
238733
238893
  } catch (e2) {
238734
238894
  sourceError = e2.message;
238735
238895
  }
238736
- if (live3 && live3.size === 0) {
238737
- live3 = void 0;
238896
+ if (live4 && live4.size === 0) {
238897
+ live4 = void 0;
238738
238898
  sourceError = "the downloaded project files contain no entity schemas \u2014 drift not checked";
238739
238899
  }
238740
238900
  const specs = (opts.base44.entities ?? []).filter((s2) => !!s2 && typeof s2 === "object" && !!physicalEntityName(s2, app2));
@@ -238748,8 +238908,8 @@ async function queryBase44Entities(opts) {
238748
238908
  rows: null,
238749
238909
  drift: []
238750
238910
  };
238751
- const remote = live3?.get(physical);
238752
- if (live3 && !remote) {
238911
+ const remote = live4?.get(physical);
238912
+ if (live4 && !remote) {
238753
238913
  row2.drift.push({ entity: physical, kind: "missing", detail: `entity "${physical}" is declared but the live app does not have it` });
238754
238914
  } else {
238755
238915
  if (remote) row2.drift = diffEntityFields(spec, remote);
@@ -238764,7 +238924,7 @@ async function queryBase44Entities(opts) {
238764
238924
  declared.push(row2);
238765
238925
  }
238766
238926
  const known = new Set(declared.map((d2) => d2.physical));
238767
- const foreignNames = live3 ? [...live3.keys()].filter((n2) => !known.has(n2)).sort() : [];
238927
+ const foreignNames = live4 ? [...live4.keys()].filter((n2) => !known.has(n2)).sort() : [];
238768
238928
  return {
238769
238929
  ok: true,
238770
238930
  app: app2,
@@ -238772,7 +238932,7 @@ async function queryBase44Entities(opts) {
238772
238932
  prefix: base44Prefix(app2),
238773
238933
  declared,
238774
238934
  foreign: opts.all ? foreignNames : { count: foreignNames.length },
238775
- sourceRead: live3 ? "ok" : "unavailable",
238935
+ sourceRead: live4 ? "ok" : "unavailable",
238776
238936
  ...sourceError ? { sourceError } : {}
238777
238937
  };
238778
238938
  }
@@ -246857,13 +247017,13 @@ async function snapshotAndPublish(fetchImpl, token, msid, opts = {}) {
246857
247017
  timeoutMs: 45e3,
246858
247018
  body: { label: "WIX_CLI", useUniqueLabel: true }
246859
247019
  });
246860
- const live3 = production ? await veloCall(fetchImpl, "POST", SITE_PUBLISH_URL, { token, msid, timeoutMs: 45e3, body: {} }) : void 0;
247020
+ const live4 = production ? await veloCall(fetchImpl, "POST", SITE_PUBLISH_URL, { token, msid, timeoutMs: 45e3, body: {} }) : void 0;
246861
247021
  return {
246862
247022
  revision: revisionFrom(rev.json),
246863
247023
  codeAppId: codeAppIdFromRevision(rev.json),
246864
247024
  rev,
246865
247025
  rc,
246866
- live: live3
247026
+ live: live4
246867
247027
  };
246868
247028
  }
246869
247029
  function httpOk(r3) {
@@ -249912,9 +250072,12 @@ var USAGE = `himi \u2014 the Himalaya authoring CLI (remote dev loop)
249912
250072
  identifiers) across dev/index.ts, config.ts, tokens.json and tier5-src; syntax-checks
249913
250073
  every changed file (and re-parses a generated SCREENS map) before writing, and
249914
250074
  reports placeholdersLeft
249915
- himi template recommend [--text <description>] [--verticals a,b] [--book <site analyze dir>] [--remote]
250075
+ himi template recommend [--text <requested app> [--context <business context>]] [--verticals a,b] [--book <site analyze dir>] [--remote]
249916
250076
  rank the catalog for one business: description words + owner-vs-customer, and the
249917
- site's installed verticals (the same scoring site analyze uses)
250077
+ site's installed verticals (the same scoring site analyze uses). --context is the
250078
+ site's business analysis: supporting evidence that only reorders rows --text already
250079
+ fits, never the role. Each ranked row says its role and fit: request | site |
250080
+ default | none; the envelope says role, defaultTemplate and contextApplied
249918
250081
  himi build [--content <dir>] [--binary] compile Tier-5 workers with esbuild
249919
250082
  himi publish-size [--content <dir>] [--app <slug>] [--reserve-bytes <n>] [--binary|--source]
249920
250083
  build locally and measure draft publish JSON with source;
@@ -251367,6 +251530,16 @@ async function templateCommand(ctx) {
251367
251530
  let verticals = str3(flags.verticals)?.split(",").map((v2) => v2.trim()).filter(Boolean);
251368
251531
  const book = flags.book === true ? "." : str3(flags.book);
251369
251532
  let text22 = str3(flags.text) ?? (pos.slice(2).join(" ") || void 0);
251533
+ if (flags.context !== void 0 && (typeof flags.context !== "string" || !text22)) {
251534
+ io2.error(JSON.stringify({
251535
+ ok: false,
251536
+ code: "invalid_usage",
251537
+ error: typeof flags.context !== "string" ? '--context needs a value: --context "<supporting business context>"' : "--context needs --text: pass the requested app as --text and the site's business analysis as --context",
251538
+ usage: "himi template recommend --text <requested app> [--context <business context>] [--verticals a,b] [--book <dir>] [--remote]"
251539
+ }));
251540
+ return 2;
251541
+ }
251542
+ const context = str3(flags.context)?.trim() ? str3(flags.context) : void 0;
251370
251543
  let bookInfo;
251371
251544
  if (!verticals?.length && book) {
251372
251545
  let signal;
@@ -251399,7 +251572,7 @@ async function templateCommand(ctx) {
251399
251572
  ok: false,
251400
251573
  code: "invalid_usage",
251401
251574
  error: 'nothing to match \u2014 pass a business description (--text "\u2026"), --verticals stores,bookings, or --book <site analyze dir>',
251402
- usage: "himi template recommend [--text <description>] [--verticals a,b] [--book <dir>] [--remote]"
251575
+ usage: "himi template recommend [--text <requested app> [--context <business context>]] [--verticals a,b] [--book <dir>] [--remote]"
251403
251576
  }));
251404
251577
  return 2;
251405
251578
  }
@@ -251416,12 +251589,15 @@ async function templateCommand(ctx) {
251416
251589
  note = `remote catalog unreachable (${e2.message}); ranked the embedded templates only`;
251417
251590
  }
251418
251591
  }
251419
- const res = recommendTemplates2({ catalog: catalog4, verticals, text: text22 });
251592
+ const res = recommendTemplates2({ catalog: catalog4, verticals, text: text22, context });
251420
251593
  print({
251421
251594
  ok: true,
251422
251595
  ...verticals?.length ? { verticals } : {},
251423
251596
  ...bookInfo ? { book: bookInfo } : {},
251424
251597
  owner: res.owner,
251598
+ role: res.role,
251599
+ defaultTemplate: res.defaultTemplate,
251600
+ ...res.contextApplied ? { contextApplied: true } : {},
251425
251601
  recommended: res.ranked[0]?.name ?? null,
251426
251602
  ranked: res.ranked.slice(0, 8),
251427
251603
  ...note ? { note } : {},
@@ -251806,7 +251982,7 @@ async function templateCommand(ctx) {
251806
251982
  }
251807
251983
  }
251808
251984
  }
251809
- io2.error(JSON.stringify({ error: "template needs a subcommand", usage: "himi template list [--remote] | himi template prompt <name> | himi template publish [--dir <app>] [--source-dir <dir>] [--name <n>] [--icon <png>] [--target <t>] [--source-hash] | himi template trim --keep <id,id,\u2026>|--from-spec [SPEC.md] [--content <dir>] [--links follow|drop] [--dry-run] [--force] | himi template inspect | himi template screens [--show <id>] [--write <id> --from <file>] | himi template sweep --set 'Old=>New' | himi template recommend --text <description>" }));
251985
+ io2.error(JSON.stringify({ error: "template needs a subcommand", usage: "himi template list [--remote] | himi template prompt <name> | himi template publish [--dir <app>] [--source-dir <dir>] [--name <n>] [--icon <png>] [--target <t>] [--source-hash] | himi template trim --keep <id,id,\u2026>|--from-spec [SPEC.md] [--content <dir>] [--links follow|drop] [--dry-run] [--force] | himi template inspect | himi template screens [--show <id>] [--write <id> --from <file>] | himi template sweep --set 'Old=>New' | himi template recommend --text <requested app> [--context <business context>]" }));
251810
251986
  return 2;
251811
251987
  }
251812
251988
 
@@ -254797,9 +254973,9 @@ async function runPackageCommand(ctx) {
254797
254973
  await announce(running);
254798
254974
  if (watchKit && bus) {
254799
254975
  const { buildContentBundles: buildContentBundles2, buildReleaseFromContent: buildReleaseFromContent2, bundleOutDir: bundleOutDir2 } = await loadAuthoring();
254800
- const live3 = join124(running.releaseRoot, running.app);
254976
+ const live4 = join124(running.releaseRoot, running.app);
254801
254977
  const manifestOf = (tree) => JSON.parse(readFileSync129(join124(tree, "release-manifest.json"), "utf8"));
254802
- let current = manifestOf(live3);
254978
+ let current = manifestOf(live4);
254803
254979
  const failed3 = async (message2) => {
254804
254980
  if (stopping) return;
254805
254981
  bus.publish("build.failed", { message: message2 });
@@ -254829,13 +255005,13 @@ async function runPackageCommand(ctx) {
254829
255005
  const fresh = manifestOf(join124(next, running.app));
254830
255006
  const diff = watchKit.diffReleases(current, fresh);
254831
255007
  const { describeChanges: describeChanges2, headline: headline2 } = await Promise.resolve().then(() => (init_build_changes(), build_changes_exports));
254832
- const changes = describeChanges2(live3, join124(next, running.app), diff);
254833
- const retired = `${live3}.retired-${Date.now()}`;
254834
- renameSync17(live3, retired);
255008
+ const changes = describeChanges2(live4, join124(next, running.app), diff);
255009
+ const retired = `${live4}.retired-${Date.now()}`;
255010
+ renameSync17(live4, retired);
254835
255011
  try {
254836
- renameSync17(join124(next, running.app), live3);
255012
+ renameSync17(join124(next, running.app), live4);
254837
255013
  } catch {
254838
- cpSync3(join124(next, running.app), live3, { recursive: true });
255014
+ cpSync3(join124(next, running.app), live4, { recursive: true });
254839
255015
  }
254840
255016
  rmSync30(retired, { recursive: true, force: true });
254841
255017
  current = fresh;
@@ -260462,9 +260638,9 @@ himi v${cliVersion()} \u2014 run \`himi --version\`. If authoring commands fail
260462
260638
  io2.error(JSON.stringify(pushFailure2("release_read_failed", liveFound)));
260463
260639
  return 1;
260464
260640
  }
260465
- const live3 = liveFound.manifest;
260466
- if (live3 && live3.releaseId !== base.releaseId) {
260467
- regressions = regressionDiff2(base, live3, plan.touched);
260641
+ const live4 = liveFound.manifest;
260642
+ if (live4 && live4.releaseId !== base.releaseId) {
260643
+ regressions = regressionDiff2(base, live4, plan.touched);
260468
260644
  if (regressions.length > 0 && !opts.acceptRegressions) {
260469
260645
  io2.error(JSON.stringify(pushFailure2("would_regress", {
260470
260646
  ok: false,
@@ -260472,7 +260648,7 @@ himi v${cliVersion()} \u2014 run \`himi --version\`. If authoring commands fail
260472
260648
  error: "would_regress",
260473
260649
  app: app2,
260474
260650
  base: { releaseId: base.releaseId, publishedAt: base.publishedAt ?? null },
260475
- live: { releaseId: live3.releaseId, publishedAt: live3.publishedAt ?? null },
260651
+ live: { releaseId: live4.releaseId, publishedAt: live4.publishedAt ?? null },
260476
260652
  message: `a branch does not merge. Activating a release derived from ${base.releaseId} reverts every item this patch does not move.`,
260477
260653
  wouldRegress: regressions,
260478
260654
  moves: plan.touched,