@wix/himalaya-cli 0.1256.0 → 0.1258.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +2 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/motion/src/index.d.ts +45 -5
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/sdk-types/src/capabilities.generated.d.ts +1 -1
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/audio-record.mjs +1 -1
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calendar.mjs +1 -1
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calls.mjs +1 -1
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/contacts.mjs +1 -1
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/location.mjs +1 -1
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/motion.mjs +18 -2
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/photos.mjs +1 -1
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdk-types.mjs +1 -1
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/tasks.mjs +1 -1
  13. package/dist/cli.mjs +649 -65
  14. package/dist/preview-assets.generated.bin +0 -0
  15. package/guides/base44-app-to-himi-app.md +41 -5
  16. package/guides/component-reference.json +0 -84
  17. package/guides/component-reference.md +2 -23
  18. package/guides/sdk-reference.json +15 -3
  19. package/package.json +2 -2
  20. package/templates/beauty-salon/tier5-src/_shared/collection-service.ts +7 -0
  21. package/templates/beauty-salon/tier5-src/_shared/weekly-goal.ts +107 -0
  22. package/templates/beauty-salon/tier5-src/himi-booking-bookings/index.ts +41 -4
  23. package/templates/beauty-salon/tier5-src/himi-branded-lite-home/index.ts +31 -7
  24. package/templates/beauty-salon-owner/tier5-src/_shared/collection-service.ts +7 -0
  25. package/templates/branded-lite/config.ts +14 -1
  26. package/templates/branded-lite/dev/index.ts +845 -2
  27. package/templates/branded-lite/tier5-src/_shared/collection-service.ts +7 -0
  28. package/templates/branded-lite/tier5-src/_shared/weekly-goal.ts +107 -0
  29. package/templates/branded-lite/tier5-src/himi-booking-bookings/index.ts +41 -4
  30. package/templates/branded-lite/tier5-src/himi-branded-lite-home/index.ts +31 -7
  31. package/templates/branded-lite/tier5-src/himi-branded-lite-steps/index.ts +524 -0
  32. package/templates/community-club/tier5-src/_shared/collection-service.ts +7 -0
  33. package/templates/community-club/tier5-src/_shared/weekly-goal.ts +107 -0
  34. package/templates/community-club/tier5-src/himi-branded-lite-home/index.ts +31 -7
  35. package/templates/community-club-owner/tier5-src/_shared/collection-service.ts +7 -0
  36. package/templates/events-meetups/tier5-src/_shared/collection-service.ts +7 -0
  37. package/templates/events-meetups/tier5-src/_shared/weekly-goal.ts +107 -0
  38. package/templates/events-meetups/tier5-src/himi-branded-lite-home/index.ts +31 -7
  39. package/templates/events-meetups-owner/tier5-src/_shared/collection-service.ts +7 -0
  40. package/templates/gym-fitness/config.ts +14 -1
  41. package/templates/gym-fitness/dev/index.ts +844 -1
  42. package/templates/gym-fitness/tier5-src/_shared/collection-service.ts +7 -0
  43. package/templates/gym-fitness/tier5-src/_shared/weekly-goal.ts +107 -0
  44. package/templates/gym-fitness/tier5-src/himi-booking-bookings/index.ts +41 -4
  45. package/templates/gym-fitness/tier5-src/himi-branded-lite-home/index.ts +31 -7
  46. package/templates/gym-fitness/tier5-src/himi-branded-lite-steps/index.ts +524 -0
  47. package/templates/gym-fitness-owner/tier5-src/_shared/collection-service.ts +7 -0
  48. package/templates/nonprofit-cause/tier5-src/_shared/collection-service.ts +7 -0
  49. package/templates/nonprofit-cause/tier5-src/_shared/weekly-goal.ts +107 -0
  50. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-home/index.ts +31 -7
  51. package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-service.ts +7 -0
  52. package/templates/owner-lite/tier5-src/_shared/collection-service.ts +7 -0
  53. package/templates/podcast-creator/tier5-src/_shared/collection-service.ts +7 -0
  54. package/templates/podcast-creator/tier5-src/_shared/weekly-goal.ts +107 -0
  55. package/templates/podcast-creator/tier5-src/himi-branded-lite-home/index.ts +31 -7
  56. package/templates/podcast-creator-owner/tier5-src/_shared/collection-service.ts +7 -0
  57. package/templates/portfolio-creative/tier5-src/_shared/collection-service.ts +7 -0
  58. package/templates/portfolio-creative/tier5-src/_shared/weekly-goal.ts +107 -0
  59. package/templates/portfolio-creative/tier5-src/himi-branded-lite-home/index.ts +31 -7
  60. package/templates/portfolio-creative-owner/tier5-src/_shared/collection-service.ts +7 -0
  61. package/templates/restaurant/tier5-src/_shared/collection-service.ts +7 -0
  62. package/templates/restaurant/tier5-src/_shared/weekly-goal.ts +107 -0
  63. package/templates/restaurant/tier5-src/himi-branded-lite-home/index.ts +31 -7
  64. package/templates/restaurant-owner/tier5-src/_shared/collection-service.ts +7 -0
  65. package/templates/retail-store/tier5-src/_shared/collection-service.ts +7 -0
  66. package/templates/retail-store/tier5-src/_shared/weekly-goal.ts +107 -0
  67. package/templates/retail-store/tier5-src/himi-branded-lite-home/index.ts +31 -7
  68. package/templates/retail-store-owner/tier5-src/_shared/collection-service.ts +7 -0
  69. package/templates/yoga-studio/dev/index.ts +90 -1
  70. package/templates/yoga-studio/tier5-src/_shared/collection-service.ts +7 -0
  71. package/templates/yoga-studio/tier5-src/_shared/weekly-goal.ts +107 -0
  72. package/templates/yoga-studio/tier5-src/himi-booking-bookings/index.ts +41 -4
  73. package/templates/yoga-studio/tier5-src/himi-branded-lite-home/index.ts +31 -7
  74. package/templates/yoga-studio-owner/tier5-src/_shared/collection-service.ts +7 -0
package/dist/cli.mjs CHANGED
@@ -1396,14 +1396,30 @@ function templateTakesBase44AppId(template) {
1396
1396
  const config = join3(templateSourceDir(template), "config.ts");
1397
1397
  return existsSync2(config) && readFileSync3(config, "utf8").includes(`"${BASE44_APP_ID_PLACEHOLDER}"`);
1398
1398
  }
1399
- function applyBase44AppId(dir, appId2) {
1399
+ function base44TenantUrl(raw) {
1400
+ const url = new URL(raw);
1401
+ if (url.protocol !== "https:" || url.username || url.password || url.port || url.pathname !== "/" || url.search || url.hash || url.hostname === "localhost" || !/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)*\.[a-z]{2,}$/i.test(url.hostname)) {
1402
+ throw new Error("--base44-app-url must be the published tenant's HTTPS origin, without a path, port or credentials");
1403
+ }
1404
+ return url;
1405
+ }
1406
+ function applyBase44AppId(dir, appId2, tenantUrl) {
1400
1407
  if (!BASE44_APP_ID_RE.test(appId2)) throw new Error(`"${appId2}" is not a Base44 app id (8\u201364 letters and digits)`);
1401
1408
  const config = join3(dir, "config.ts");
1402
1409
  if (!existsSync2(config)) return false;
1403
1410
  const body = readFileSync3(config, "utf8");
1404
1411
  const literal = `"${BASE44_APP_ID_PLACEHOLDER}"`;
1405
1412
  if (!body.includes(literal)) return false;
1406
- writeFileSync3(config, body.replaceAll(literal, `"${appId2}"`));
1413
+ let configured = body.replaceAll(literal, `"${appId2}"`);
1414
+ if (tenantUrl !== void 0) {
1415
+ const host = base44TenantUrl(tenantUrl).hostname;
1416
+ if (!/^\s*base44:\s*\{/m.test(configured) || /\bappLinkHosts\s*:/.test(configured)) {
1417
+ throw new Error("this template cannot accept --base44-app-url; set appLinkHosts in config.ts");
1418
+ }
1419
+ configured = configured.replace(/^(\s*)base44:/m, `$1appLinkHosts: [${JSON.stringify(host)}],
1420
+ $1base44:`);
1421
+ }
1422
+ writeFileSync3(config, configured);
1407
1423
  return true;
1408
1424
  }
1409
1425
  function templateIconPath(name) {
@@ -17286,7 +17302,9 @@ var init_native_requirements = __esm({
17286
17302
  "motion: CoreMotion (CMPedometer + CMAltimeter) and Android SensorManager (TYPE_STEP_COUNTER / TYPE_PRESSURE / TYPE_MAGNETIC_FIELD). Sensor reads stay on device unless the app transmits them.",
17287
17303
  "ACTIVITY_RECOGNITION is runtime-granted on Android 10+ and gates ONLY the step counter \u2014 barometer and compass keep working when it is denied, so a denied grant must degrade the steps tile rather than the whole screen.",
17288
17304
  "iOS heading is delivered by CoreLocation, not CoreMotion: an app using `watch({ sensor: 'heading' })` must ALSO declare `location` (and hold that permission) or headings never arrive. This is the single most common motion integration bug.",
17289
- "No barometer exists on the iOS Simulator or most Android emulators. Verify elevation features on real hardware \u2014 `availability().altimeter` is false in a simulator, so a simulator-only test proves nothing about the altitude path."
17305
+ "No barometer exists on the iOS Simulator or most Android emulators. Verify elevation features on real hardware \u2014 `availability().altimeter` is false in a simulator, so a simulator-only test proves nothing about the altitude path.",
17306
+ "Android daily step totals (getStepCount over a past window) come from an opt-in step STORE, never from the app itself: the step counter keeps one total since boot with no dates, and an app the user is not using has an idle uid that receives no sensor events, so no job or alarm can take a midnight reading. The store is Google's Recording API (:core-runtime-step-recording, `StepRecording.install` at boot). Health Connect is deliberately not a motion store \u2014 reading it is the `health` capability, gated per bundle. This row adds no permission beyond ACTIVITY_RECOGNITION, which the Recording API needs.",
17307
+ 'Recording API (:core-runtime-step-recording, opt-in): Google Play services records the step count itself and keeps up to 10 days ON THE DEVICE, with no Google account; the app reads the day\'s total when a screen opens and writes nothing. History starts at the first subscription (the first grant), so the first day is partial. Phones without Google Play services answer `stepHistory: "unsupported"` and fall back to the live count. The Fitness data-safety row above covers it; nothing leaves the device unless the app transmits it.'
17290
17308
  ]
17291
17309
  }
17292
17310
  },
@@ -17706,9 +17724,9 @@ function isKnownCapability(id) {
17706
17724
  function needsNativeBuild(id) {
17707
17725
  const req = CAPABILITY_NATIVE[catalogKey(id)];
17708
17726
  if (!req) return false;
17709
- const nonEmpty2 = (v2) => Array.isArray(v2) ? v2.length > 0 : v2 != null && typeof v2 === "object" ? Object.keys(v2).length > 0 : false;
17727
+ const nonEmpty3 = (v2) => Array.isArray(v2) ? v2.length > 0 : v2 != null && typeof v2 === "object" ? Object.keys(v2).length > 0 : false;
17710
17728
  const { ios, android } = req;
17711
- return nonEmpty2(ios?.usageStrings) || nonEmpty2(ios?.infoPlist) || nonEmpty2(ios?.entitlements) || nonEmpty2(ios?.spmProducts) || nonEmpty2(android?.permissions) || nonEmpty2(android?.features) || nonEmpty2(android?.services) || nonEmpty2(android?.foregroundServiceTypes) || nonEmpty2(android?.gradleDeps);
17729
+ return nonEmpty3(ios?.usageStrings) || nonEmpty3(ios?.infoPlist) || nonEmpty3(ios?.entitlements) || nonEmpty3(ios?.spmProducts) || nonEmpty3(android?.permissions) || nonEmpty3(android?.features) || nonEmpty3(android?.services) || nonEmpty3(android?.foregroundServiceTypes) || nonEmpty3(android?.gradleDeps);
17712
17730
  }
17713
17731
  function capabilitiesUsedBy(bundleJs) {
17714
17732
  const out2 = /* @__PURE__ */ new Set();
@@ -22841,7 +22859,7 @@ var init_capabilities_generated = __esm({
22841
22859
  "local_database": ["availability", "count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
22842
22860
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
22843
22861
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
22844
- "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "requestPermission", "watchNext", "watchStart", "watchStop"],
22862
+ "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "openStepHistorySetup", "requestPermission", "watchNext", "watchStart", "watchStop"],
22845
22863
  "on_device_ai": ["availability", "generateText"],
22846
22864
  "open_url": ["canOpen", "open"],
22847
22865
  "pdf": ["isAvailable", "open"],
@@ -22922,8 +22940,8 @@ var init_shell_capabilities_generated = __esm({
22922
22940
  appDir: "apps/himi-branded-lite",
22923
22941
  shared: false,
22924
22942
  extensible: true,
22925
- built: ["app_info", "calendar", "clipboard", "live_activity", "local_database", "media_playback", "open_url", "push", "release_control", "secure_storage", "share", "wix_api", "wix_platform"],
22926
- serves: ["app_info", "calendar", "clipboard", "live_activity", "local_database", "media_playback", "open_url", "push", "release_control", "secure_storage", "share", "wix_api", "wix_platform"]
22943
+ built: ["app_info", "calendar", "clipboard", "live_activity", "local_database", "media_playback", "motion", "open_url", "push", "release_control", "secure_storage", "share", "wix_api", "wix_platform"],
22944
+ serves: ["app_info", "calendar", "clipboard", "live_activity", "local_database", "media_playback", "motion", "open_url", "push", "release_control", "secure_storage", "share", "wix_api", "wix_platform"]
22927
22945
  },
22928
22946
  "brandy": {
22929
22947
  appDir: "apps/himi-brandy",
@@ -32405,10 +32423,134 @@ function classifyEmbedUrl(url, pageOrigin = currentOrigin()) {
32405
32423
  function isWebviewUrlAllowed(url) {
32406
32424
  return webviewFrameSandbox(url, [], null) !== null;
32407
32425
  }
32408
- var NETWORK_SCHEMES;
32426
+ function webViewWebConfig(raw) {
32427
+ const c2 = asRecord(raw);
32428
+ const media = asRecord(c2.media);
32429
+ const g2 = asRecord(c2.gestures);
32430
+ const all = g2.disableAll === true;
32431
+ const disabled = (flag) => typeof flag === "boolean" ? flag : all;
32432
+ const disableContextMenu = disabled(g2.disableContextMenu);
32433
+ const allow = [];
32434
+ if (c2.media && typeof c2.media === "object") {
32435
+ if (media.autoplay === true) allow.push("autoplay");
32436
+ if (media.allowFullscreen !== false) allow.push("fullscreen");
32437
+ if (media.allowPictureInPicture === true) allow.push("picture-in-picture");
32438
+ }
32439
+ const css = [];
32440
+ if (disabled(g2.disableTextSelection)) css.push("*{-webkit-user-select:none!important;user-select:none!important}input,textarea,[contenteditable]{-webkit-user-select:text!important;user-select:text!important}");
32441
+ if (disableContextMenu) css.push("*{-webkit-touch-callout:none!important}");
32442
+ if (disabled(g2.disableUserDrag)) css.push("*{-webkit-user-drag:none}");
32443
+ if (disabled(g2.disableTapHighlight)) css.push("*{-webkit-tap-highlight-color:transparent}");
32444
+ if (disabled(g2.disableScrollIndicators)) css.push("html,body{scrollbar-width:none}::-webkit-scrollbar{display:none}");
32445
+ if (disabled(g2.disablePinchZoom)) css.push("html{touch-action:pan-x pan-y}");
32446
+ if (disabled(g2.disableScrollBounce)) css.push("html,body{overscroll-behavior:none}");
32447
+ return {
32448
+ allowedOrigins: Array.isArray(c2.allowedOrigins) ? c2.allowedOrigins.filter((o2) => typeof o2 === "string" && o2.length > 0) : [],
32449
+ allow: allow.join("; "),
32450
+ injectStart: nonEmpty2(c2.injectJsDocumentStart),
32451
+ injectEnd: nonEmpty2(c2.injectJsDocumentEnd),
32452
+ gestureCss: css.join(""),
32453
+ disableContextMenu,
32454
+ loadingText: nonEmpty2(c2.loadingText),
32455
+ showProgressBar: c2.showProgressBar === true,
32456
+ coverBandColor: nonEmpty2(c2.coverBandColor)
32457
+ };
32458
+ }
32459
+ function maskInertHtml(html) {
32460
+ const blank = (m2) => " ".repeat(m2.length);
32461
+ return html.replace(/<!--[\s\S]*?(?:-->|$)/g, blank).replace(/(<(script|style|textarea|title)\b[^>]*>)([\s\S]*?)(<\/\2\s*>|$)/gi, (_m, open, _t2, body, close) => open + blank(body) + close);
32462
+ }
32463
+ function injectIntoInlineHtml(html, config, scrollEnabled = true) {
32464
+ let head = "";
32465
+ if (!scrollEnabled) head += `<style data-himalaya-scroll>html,body{overflow:hidden!important}</style><script data-himalaya-scroll>(function(){function f(){[document.documentElement,document.body].forEach(function(e){if(e)e.style.setProperty("overflow","hidden","important")})}f();document.addEventListener("DOMContentLoaded",f)})()</script>`;
32466
+ if (config.gestureCss) head += `<style data-himalaya-gestures>${config.gestureCss}</style>`;
32467
+ if (config.disableContextMenu) head += `<script>document.addEventListener("contextmenu",function(e){e.preventDefault()},true)</script>`;
32468
+ if (config.injectStart) head += `<script data-himalaya-inject="start">${scriptBody(config.injectStart)}</script>`;
32469
+ const tail = config.injectEnd ? `<script data-himalaya-inject="end">${scriptBody(config.injectEnd)}</script>` : "";
32470
+ if (!head && !tail) return html;
32471
+ let out2 = html;
32472
+ if (head) {
32473
+ const masked = maskInertHtml(out2);
32474
+ const anchor = /<head(?:\s[^>]*)?>/i.exec(masked) ?? /<html(?:\s[^>]*)?>/i.exec(masked) ?? /^\s*<!doctype[^>]*>/i.exec(masked);
32475
+ out2 = anchor ? out2.slice(0, anchor.index + anchor[0].length) + head + out2.slice(anchor.index + anchor[0].length) : head + out2;
32476
+ }
32477
+ if (tail) out2 += tail;
32478
+ return out2;
32479
+ }
32480
+ function hasDotSegment(absolute) {
32481
+ const schemeEnd = absolute.indexOf("://");
32482
+ if (schemeEnd < 0) return false;
32483
+ const hierarchical = absolute.slice(schemeEnd + 3).split(/[?#]/)[0];
32484
+ const pathStart = hierarchical.indexOf("/");
32485
+ if (pathStart < 0) return false;
32486
+ return hierarchical.slice(pathStart).replace(/%2e/g, ".").split("/").some((seg) => seg === "." || seg === "..");
32487
+ }
32488
+ function rawUrlParts(url) {
32489
+ const trimmed = url.replace(/^[\u0000- ]+|[\u0000- ]+$/g, "");
32490
+ if (/[\\\u0000-\u0020\u007f]/.test(trimmed)) return null;
32491
+ const raw = trimmed;
32492
+ const m2 = /^([a-z][a-z0-9+.-]*):\/\/([^/?#]*)/i.exec(raw);
32493
+ if (!m2) return null;
32494
+ const authority = m2[2].slice(m2[2].lastIndexOf("@") + 1);
32495
+ let host;
32496
+ let port = "";
32497
+ if (authority.startsWith("[")) {
32498
+ const close = authority.indexOf("]");
32499
+ if (close < 0) return null;
32500
+ host = authority.slice(1, close);
32501
+ const rest = authority.slice(close + 1);
32502
+ if (rest.startsWith(":")) port = rest.slice(1);
32503
+ } else {
32504
+ const colon = authority.lastIndexOf(":");
32505
+ host = colon >= 0 ? authority.slice(0, colon) : authority;
32506
+ port = colon >= 0 ? authority.slice(colon + 1) : "";
32507
+ }
32508
+ host = host.toLowerCase();
32509
+ if (!host) return null;
32510
+ if (port !== "" && !/^\d+$/.test(port)) return null;
32511
+ let parsed;
32512
+ try {
32513
+ parsed = new URL(raw);
32514
+ } catch {
32515
+ return null;
32516
+ }
32517
+ const scheme = m2[1].toLowerCase();
32518
+ const bracketless = parsed.hostname.replace(/^\[|\]$/g, "").toLowerCase();
32519
+ if (parsed.protocol !== `${scheme}:` || bracketless !== host) return null;
32520
+ if (parsed.port !== "" && parsed.port !== String(Number(port))) return null;
32521
+ return { absolute: raw.toLowerCase(), host, hostPort: port !== "" ? `${host}:${Number(port)}` : host };
32522
+ }
32523
+ function webViewOriginAllowed(url, origins) {
32524
+ const u2 = rawUrlParts(url);
32525
+ if (!u2) return false;
32526
+ const { absolute, host, hostPort } = u2;
32527
+ for (const o2 of origins) {
32528
+ const origin = o2.toLowerCase();
32529
+ if (origin.endsWith("/") && origin.includes("://")) {
32530
+ if (hasDotSegment(absolute)) continue;
32531
+ const base = origin.slice(0, -1);
32532
+ if (absolute.startsWith(origin) || absolute === base || absolute.startsWith(base + "?") || absolute.startsWith(base + "#")) return true;
32533
+ continue;
32534
+ }
32535
+ if (origin === host || origin === hostPort) return true;
32536
+ if (absolute.startsWith(origin)) {
32537
+ const next = absolute.charAt(origin.length);
32538
+ if (origin.endsWith("/") || next === "" || next === "/" || next === "?" || next === "#") return true;
32539
+ }
32540
+ if (origin.startsWith("*.") || origin.startsWith(".")) {
32541
+ const suffix = origin.startsWith("*.") ? origin.slice(2) : origin.slice(1);
32542
+ if (host === suffix || host.endsWith(`.${suffix}`)) return true;
32543
+ }
32544
+ }
32545
+ return false;
32546
+ }
32547
+ var NETWORK_SCHEMES, asRecord, nonEmpty2, scriptBody;
32409
32548
  var init_webviewFrame = __esm({
32410
32549
  "../../core/web-renderer/src/webviewFrame.ts"() {
32411
32550
  NETWORK_SCHEMES = /* @__PURE__ */ new Set(["http:", "https:"]);
32551
+ asRecord = (v2) => v2 && typeof v2 === "object" ? v2 : {};
32552
+ nonEmpty2 = (v2) => typeof v2 === "string" && v2.length > 0 ? v2 : void 0;
32553
+ scriptBody = (js2) => js2.replace(/<\/(script)/gi, "<\\/$1");
32412
32554
  }
32413
32555
  });
32414
32556
 
@@ -116770,6 +116912,22 @@ function withExtras(name, render) {
116770
116912
  Wrapped.displayName = name;
116771
116913
  return Wrapped;
116772
116914
  }
116915
+ function rememberReveal(text8, n2) {
116916
+ if (revealProgress.size > 500) revealProgress.clear();
116917
+ revealProgress.set(text8, n2);
116918
+ }
116919
+ function revealHtml(html, shown2, fade) {
116920
+ let w2 = 0;
116921
+ const out2 = html.split(/(<[^>]*>)/).map((part) => {
116922
+ if (part.startsWith("<")) return part;
116923
+ return part.split(/(\s+)/).map((t2) => {
116924
+ if (t2 === "" || /^\s+$/.test(t2)) return t2;
116925
+ const visible = w2++ < shown2;
116926
+ return `<span style="opacity:${visible ? 1 : 0}${fade ? `;transition:${fade}` : ""}">${t2}</span>`;
116927
+ }).join("");
116928
+ }).join("");
116929
+ return { html: out2, total: w2 };
116930
+ }
116773
116931
  function spacingToken(ctx, [name, fallback]) {
116774
116932
  const v2 = ctx.tokens?.spacing?.[name];
116775
116933
  return typeof v2 === "number" && Number.isFinite(v2) ? Math.max(0, v2) : fallback;
@@ -117039,6 +117197,19 @@ function layoutScale(el2) {
117039
117197
  ky: r2.height > 0 && el2.offsetHeight > 0 ? el2.offsetHeight / r2.height : 1
117040
117198
  };
117041
117199
  }
117200
+ function isWebAssetPath(name) {
117201
+ return name !== "" && (/[/:]/.test(name) || /\.[a-z0-9]{2,5}$/i.test(name));
117202
+ }
117203
+ function collapsingScrollPort(el2) {
117204
+ const doc = el2.ownerDocument;
117205
+ const win = doc.defaultView;
117206
+ if (!win) return null;
117207
+ for (let p2 = el2.parentElement; p2 && p2 !== doc.body && p2 !== doc.documentElement; p2 = p2.parentElement) {
117208
+ const oy = win.getComputedStyle(p2).overflowY;
117209
+ if ((oy === "auto" || oy === "scroll" || oy === "overlay") && p2.scrollHeight > p2.clientHeight) return p2;
117210
+ }
117211
+ return null;
117212
+ }
117042
117213
  function parseLocalDate(when) {
117043
117214
  if (when == null || when === "") return null;
117044
117215
  if (typeof when === "string") {
@@ -118317,11 +118488,12 @@ function renderInner(node, ctx) {
118317
118488
  if (carItemsPath && items[0] && ctx.provider) {
118318
118489
  return /* @__PURE__ */ jsx9("div", { style: { width: "100%", ...wrap }, children: /* @__PURE__ */ jsx9("div", { style: { display: "flex", overflowX: "auto", gap: 12, width: "100%" }, children: /* @__PURE__ */ jsx9(BoundList, { ctx, itemsPath: carItemsPath, template: items[0], renderRow: (t2, ic) => /* @__PURE__ */ jsx9("div", { style: { flex: "0 0 auto" }, children: renderNode(t2, ic) }) }) }) });
118319
118490
  }
118491
+ if (type === "Carousel") return /* @__PURE__ */ jsx9(CarouselNode, { props, ctx, wrap });
118320
118492
  const pages = items.filter((p2) => isNodeLike(p2) || p2?.type);
118321
118493
  const cur = props.currentIndex ?? 0;
118322
118494
  return /* @__PURE__ */ jsxs6("div", { style: { width: "100%", ...wrap }, children: [
118323
118495
  /* @__PURE__ */ jsx9("div", { style: { display: "flex", overflowX: "auto", scrollSnapType: "x mandatory", width: "100%" }, children: pages.map((pg, i2) => /* @__PURE__ */ jsx9("div", { style: { minWidth: "100%", scrollSnapAlign: "start" }, children: renderNode(pg, ctx) }, pg?.id ?? i2)) }),
118324
- pages.length > 1 && (type === "Carousel" || props.showIndicator !== false) && /* @__PURE__ */ jsx9("div", { style: { display: "flex", gap: 6, justifyContent: "center", marginTop: 10 }, children: pages.map((_2, i2) => /* @__PURE__ */ jsx9("span", { style: { width: i2 === cur ? 18 : 7, height: 7, borderRadius: 999, background: i2 === cur ? C2("accentPrimary", "#116DFF") : C2("border", "#ccc") } }, i2)) })
118496
+ pages.length > 1 && props.showIndicator !== false && /* @__PURE__ */ jsx9("div", { style: { display: "flex", gap: 6, justifyContent: "center", marginTop: 10 }, children: pages.map((_2, i2) => /* @__PURE__ */ jsx9("span", { style: { width: i2 === cur ? 18 : 7, height: 7, borderRadius: 999, background: i2 === cur ? C2("accentPrimary", "#116DFF") : C2("border", "#ccc") } }, i2)) })
118325
118497
  ] });
118326
118498
  }
118327
118499
  case "StepIndicator": {
@@ -118334,17 +118506,8 @@ function renderInner(node, ctx) {
118334
118506
  case "AvatarStrip":
118335
118507
  return /* @__PURE__ */ jsx9(AvatarStripNode, { props, ctx, wrap });
118336
118508
  // ───────────── feedback ─────────────
118337
- case "Banner": {
118338
- const accent = sevColor(ctx, props.severity ?? "info");
118339
- return /* @__PURE__ */ jsxs6("div", { style: { display: "flex", gap: 11, width: "100%", boxSizing: "border-box", borderRadius: ctx.radius("md", 10), padding: 13, background: `color-mix(in srgb, ${accent} 12%, ${C2("surfacePrimary", "#fff")})`, border: `1px solid color-mix(in srgb, ${accent} 32%, transparent)`, ...wrap }, children: [
118340
- /* @__PURE__ */ jsx9("div", { style: { width: 3, borderRadius: 3, background: accent, flex: "none" } }),
118341
- /* @__PURE__ */ jsxs6("div", { children: [
118342
- /* @__PURE__ */ jsx9("div", { style: { fontFamily: bodyFont(ctx), fontWeight: 600, fontSize: pxToRem(14), color: C2("textPrimary", "#111") }, children: txt(props.title, ctx) }),
118343
- props.message && /* @__PURE__ */ jsx9("div", { style: { fontFamily: bodyFont(ctx), fontSize: pxToRem(13), lineHeight: 1.4, color: C2("textSecondary", "#666"), marginTop: 2 }, children: txt(props.message, ctx) }),
118344
- actionTextButton(ctx, props.action, asBoundText(props.actionLabel, ctx) || "Take action", C2("textPrimary", "#111"), { marginTop: 7, textDecoration: "underline" })
118345
- ] })
118346
- ] });
118347
- }
118509
+ case "Banner":
118510
+ return /* @__PURE__ */ jsx9(BannerNode, { props, ctx, wrap });
118348
118511
  case "Snackbar": {
118349
118512
  const dot = sevColor(ctx, props.severity ?? "info");
118350
118513
  return /* @__PURE__ */ jsxs6("div", { style: { display: "flex", alignItems: "center", gap: 10, background: "#1c1f26", color: "#fff", borderRadius: ctx.radius("md", 10), padding: "12px 14px", width: "100%", boxSizing: "border-box", fontFamily: bodyFont(ctx), fontWeight: 500, fontSize: pxToRem(14), ...wrap }, children: [
@@ -118385,7 +118548,7 @@ function renderInner(node, ctx) {
118385
118548
  }
118386
118549
  }
118387
118550
  }
118388
- var useIsomorphicLayoutEffect, ResponsiveGrid, SPLIT_EXPANDED_MIN_WIDTH, SPLIT_COLUMN_GAP, ResponsiveSplitView, ABSOLUTE_URL_RE, appearKeyframesInjected, pressStylesInjected, REVEAL_ON_FOCUS_ATTR, FOCUS_RING_CSS, focusStylesInjected, HLIST_CHILD_CSS, hListStylesInjected, listAnimateRuntimeInstalled, transitionKeyframesInjected, countUpRuntimeInjected, MEASURE_PREFIX, measureRuntimeInjected, revealRuntimeInjected, vectorAnimStylesInjected, scrollProgressRuntimeInjected, confettiRuntimeInjected, lottieRuntimeInjected, riveRuntimeInjected, gradientKeyframesInjected, parallaxRuntimeInjected, spinKeyframesInjected, marqueeKeyframesInjected, alignItems, zJustifyItems, hAlignItems, bodyFont, kids2, rowKidCtx, rowKids, staggeredKids, asTextL10n, asFinalTextL10n, asBoundText, useBoundString, InterpolatedTextView, txt, selectFragmentCase, fragmentValueHash, fragmentSlotContent, FragmentSlotNode, RichContentEditorNode, MediaFieldNode, WorkerSubtreeNode, RichContentNode, resolveItemDeep2, resolveRowAction2, resolveSwipeActions, resolveModBindings, resolvedComponentId, directServiceBindings, withRootStyle, ReactiveDirectScalars, HiddenGate, KEYBOARD_INPUT_MODES, AUTOCAPITALIZE_VALUES, ENTER_KEY_HINTS, AUTOGROW_CEILING, EditableField, MenuNode, LoadMoreSentinel, FieldErrorNode, FormView, MediaSlotProvider, MEDIA_ITEM_BINDABLE, MediaPlayerView, VideoNode, PdfDocumentCanvas, PdfViewNode, WebViewNode, InteractivePicker, InteractiveDatePicker, InteractiveSearchField, InteractiveStepper, 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, VISUALLY_HIDDEN, NAME_SKIP_SELECTOR, activatorNameObservers, ACTIVATOR_STATE_ATTRS, controlNode, ToggleNode, SliderNode, SelectionControlNode, TabsNode, SegmentedControlNode, DisclosureGroupNode, GridNode, SplitViewNode, TextNode, ImageNode, ANIMATION_LEAF, LottieNode, RiveNode, AvatarNode, IconNode, EMPTY_STATE_SPACING, EmptyStateNode, ButtonNode, OtpInputNode, ProgressBarNode, ACTIVITY_DEFAULT_NAME, ActivityIndicatorNode, NATIVELY_TABBABLE, BottomSheetNode, PRESENTED_OVERLAY_ATTR, PopoverNode, ChipsInputNode, ChipNode, TableNode, GaugeRing, GaugeNode, RATING_METRICS, ratingMetrics, RatingNode, AvatarStripNode, CHART_STROKE_CYCLE, chartStrokeAt, chartBarCenter, ChartNode, donutSliceOpacity, DonutChartNode, LegendMarker, LegendNode, cellAlign, DataTableNode, voiceNoteState, voiceNoteDelivery, VOICE_NOTE_DEFAULT_BARS, clampBarCount, VoiceNoteNode, TimelineNode, 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, 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, WebRenderer;
118551
+ var useIsomorphicLayoutEffect, ResponsiveGrid, SPLIT_EXPANDED_MIN_WIDTH, SPLIT_COLUMN_GAP, ResponsiveSplitView, ABSOLUTE_URL_RE, appearKeyframesInjected, pressStylesInjected, REVEAL_ON_FOCUS_ATTR, FOCUS_RING_CSS, focusStylesInjected, HLIST_CHILD_CSS, hListStylesInjected, listAnimateRuntimeInstalled, transitionKeyframesInjected, countUpRuntimeInjected, MEASURE_PREFIX, measureRuntimeInjected, revealRuntimeInjected, vectorAnimStylesInjected, scrollProgressRuntimeInjected, confettiRuntimeInjected, lottieRuntimeInjected, riveRuntimeInjected, gradientKeyframesInjected, parallaxRuntimeInjected, spinKeyframesInjected, marqueeKeyframesInjected, alignItems, zJustifyItems, hAlignItems, bodyFont, kids2, rowKidCtx, rowKids, staggeredKids, asTextL10n, asFinalTextL10n, asBoundText, useBoundString, InterpolatedTextView, txt, selectFragmentCase, fragmentValueHash, fragmentSlotContent, FragmentSlotNode, RichContentEditorNode, MediaFieldNode, WorkerSubtreeNode, RichContentNode, resolveItemDeep2, resolveRowAction2, resolveSwipeActions, resolveModBindings, resolvedComponentId, directServiceBindings, withRootStyle, ReactiveDirectScalars, HiddenGate, KEYBOARD_INPUT_MODES, AUTOCAPITALIZE_VALUES, ENTER_KEY_HINTS, AUTOGROW_CEILING, EditableField, MenuNode, LoadMoreSentinel, FieldErrorNode, FormView, MediaSlotProvider, MEDIA_ITEM_BINDABLE, MediaPlayerView, VideoNode, PdfDocumentCanvas, PdfViewNode, WebViewNode, InteractivePicker, InteractiveDatePicker, InteractiveSearchField, InteractiveStepper, 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, 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, ButtonNode, OtpInputNode, ProgressBarNode, ACTIVITY_DEFAULT_NAME, ActivityIndicatorNode, NATIVELY_TABBABLE, BottomSheetNode, PRESENTED_OVERLAY_ATTR, PopoverNode, ChipsInputNode, ChipNode, TableNode, GaugeRing, GaugeNode, RATING_METRICS, ratingMetrics, RatingNode, AvatarStripNode, CHART_STROKE_CYCLE, chartStrokeAt, chartBarCenter, ChartNode, donutSliceOpacity, DonutChartNode, LegendMarker, LegendNode, cellAlign, DataTableNode, voiceNoteState, voiceNoteDelivery, VOICE_NOTE_DEFAULT_BARS, clampBarCount, VoiceNoteNode, TimelineNode, 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, 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, WebRenderer;
118389
118552
  var init_renderNode = __esm({
118390
118553
  "../../core/web-renderer/src/renderNode.tsx"() {
118391
118554
  "use strict";
@@ -119882,15 +120045,36 @@ var init_renderNode = __esm({
119882
120045
  const url = props.url != null && isBinding(props.url) ? boundUrl : props.url;
119883
120046
  const inlineHtml = props.inlineHtml != null && isBinding(props.inlineHtml) ? boundHtml : props.inlineHtml;
119884
120047
  const urlStr = typeof url === "string" && url.length > 0 && !isBinding(url) ? url : void 0;
119885
- const htmlStr = typeof inlineHtml === "string" && inlineHtml.length > 0 && !isBinding(inlineHtml) ? inlineHtml : void 0;
119886
- const urlFrame = urlStr ? webviewFrameSandbox(urlStr) : null;
120048
+ const rawHtml = typeof inlineHtml === "string" && inlineHtml.length > 0 && !isBinding(inlineHtml) ? inlineHtml : void 0;
120049
+ const config = webViewWebConfig(props.config);
120050
+ const scrollEnabled = props.scrollEnabled === true;
120051
+ const htmlStr = rawHtml != null ? injectIntoInlineHtml(rawHtml, config, scrollEnabled) : void 0;
120052
+ const urlAllowed = urlStr != null && (config.allowedOrigins.length === 0 || webViewOriginAllowed(urlStr, config.allowedOrigins));
120053
+ const urlFrame = urlStr && urlAllowed ? webviewFrameSandbox(urlStr) : null;
119887
120054
  const h2 = typeof props.height === "number" && props.height > 0 ? props.height : void 0;
119888
120055
  const ar2 = typeof props.aspectRatio === "number" && props.aspectRatio > 0 ? props.aspectRatio : void 0;
119889
- const frameStyle = { width: "100%", boxSizing: "border-box", border: "none", borderRadius: ctx.radius("md", 8), background: "#fff", ...h2 ? { height: h2 } : ar2 ? { aspectRatio: String(ar2) } : { height: 200 } };
119890
- const bandColor = typeof props.coverBandColor === "string" && props.coverBandColor.length > 0 ? props.coverBandColor : void 0;
120056
+ const frameStyle = { width: "100%", boxSizing: "border-box", border: "none", borderRadius: ctx.radius("md", 8), background: "#fff", ...scrollEnabled ? {} : { overflow: "hidden" }, ...h2 ? { height: h2 } : ar2 ? { aspectRatio: String(ar2) } : { height: 200 } };
120057
+ const frameKey = htmlStr ?? urlFrame?.src ?? null;
120058
+ const [loadedKey, setLoadedKey] = React8.useState(null);
120059
+ const loaded = loadedKey === frameKey;
120060
+ const frameProps = {
120061
+ title: "webview",
120062
+ scrolling: scrollEnabled ? void 0 : "no",
120063
+ "data-scroll-enabled": scrollEnabled ? "true" : "false",
120064
+ allow: config.allow || void 0,
120065
+ onLoad: () => setLoadedKey(frameKey),
120066
+ style: frameStyle
120067
+ };
120068
+ const showLoading = !loaded && (config.loadingText != null || config.showProgressBar) && (htmlStr != null || urlFrame != null);
120069
+ const rawBand = config.coverBandColor ?? props.coverBandColor;
120070
+ const bandColor = typeof rawBand === "string" && rawBand.length > 0 ? rawBand : void 0;
119891
120071
  return /* @__PURE__ */ jsxs6("div", { style: { width: "100%", position: "relative", ...bandColor ? { background: bandColor, borderRadius: ctx.radius("md", 8), overflow: "hidden" } : {}, ...wrap }, children: [
119892
120072
  bandColor ? /* @__PURE__ */ jsx9("div", { "data-testid": "webview-cover-band", style: { height: 8, background: bandColor } }) : null,
119893
- htmlStr ? /* @__PURE__ */ jsx9("iframe", { title: "webview", srcDoc: htmlStr, sandbox: "allow-scripts", style: frameStyle }) : urlFrame ? /* @__PURE__ */ jsx9("iframe", { title: "webview", src: urlFrame.src, sandbox: urlFrame.sandbox, style: frameStyle }) : /* @__PURE__ */ jsx9("div", { style: { ...frameStyle, display: "grid", placeItems: "center", color: "#999", fontFamily: "ui-monospace, monospace", fontSize: pxToRem(11), border: "1px dashed #ccc" }, children: urlStr ? "WebView (url not allowed)" : "WebView (no url)" })
120073
+ htmlStr ? /* @__PURE__ */ jsx9("iframe", { ...frameProps, srcDoc: htmlStr, sandbox: "allow-scripts" }) : urlFrame ? /* @__PURE__ */ jsx9("iframe", { ...frameProps, src: urlFrame.src, sandbox: urlFrame.sandbox }) : /* @__PURE__ */ jsx9("div", { style: { ...frameStyle, display: "grid", placeItems: "center", color: "#999", fontFamily: "ui-monospace, monospace", fontSize: pxToRem(11), border: "1px dashed #ccc" }, children: urlStr ? "WebView (url not allowed)" : "WebView (no url)" }),
120074
+ showLoading ? /* @__PURE__ */ jsxs6("div", { "data-testid": "webview-loading", role: "status", "aria-live": "polite", "aria-label": config.loadingText ? void 0 : "Loading", style: { position: "absolute", left: 0, right: 0, top: bandColor ? 8 : 0, bottom: 0, display: "grid", placeItems: "center", pointerEvents: "none", fontFamily: bodyFont(ctx), fontSize: pxToRem(13), color: ctx.color("textSecondary", "#666") }, children: [
120075
+ config.showProgressBar ? /* @__PURE__ */ jsx9("div", { "aria-hidden": "true", style: { position: "absolute", left: 0, top: 0, height: 3, width: "40%", background: ctx.color("accentPrimary", "#116DFF") } }) : null,
120076
+ config.loadingText ?? null
120077
+ ] }) : null
119894
120078
  ] });
119895
120079
  });
119896
120080
  InteractivePicker = withExtras("InteractivePicker", ({ props, ctx, wrap }) => {
@@ -120336,11 +120520,66 @@ var init_renderNode = __esm({
120336
120520
  extra: wrap
120337
120521
  });
120338
120522
  });
120523
+ REVEAL_RELEASE_MS = 90;
120524
+ REVEAL_FADE_MS = 220;
120525
+ REVEAL_BUFFER = 12;
120526
+ revealProgress = /* @__PURE__ */ new Map();
120527
+ countWords = (s2) => s2.split(/\s+/).filter((t2) => t2 !== "").length;
120528
+ RevealText = ({ text: text8, reduce, markdownHtml }) => {
120529
+ const tokens2 = React8.useMemo(() => text8.split(/(\s+)/).filter((t2) => t2 !== ""), [text8]);
120530
+ const total = React8.useMemo(
120531
+ () => markdownHtml != null ? revealHtml(markdownHtml, 0, void 0).total : countWords(text8),
120532
+ [text8, markdownHtml]
120533
+ );
120534
+ const [shown2, setShown] = React8.useState(total);
120535
+ const prevRef = React8.useRef(null);
120536
+ useIsomorphicLayoutEffect(() => {
120537
+ const prev = prevRef.current;
120538
+ prevRef.current = text8;
120539
+ if (reduce) {
120540
+ rememberReveal(text8, total);
120541
+ setShown(total);
120542
+ return;
120543
+ }
120544
+ let start = revealProgress.get(text8);
120545
+ if (start == null) start = prev != null && text8.startsWith(prev) ? revealProgress.get(prev) ?? countWords(prev) : 0;
120546
+ start = Math.max(start, total - REVEAL_BUFFER);
120547
+ rememberReveal(text8, start);
120548
+ setShown(start);
120549
+ if (start >= total) return;
120550
+ let n2 = start;
120551
+ const id = setInterval(() => {
120552
+ n2 += 1;
120553
+ rememberReveal(text8, n2);
120554
+ setShown(n2);
120555
+ if (n2 >= total) clearInterval(id);
120556
+ }, REVEAL_RELEASE_MS);
120557
+ return () => clearInterval(id);
120558
+ }, [text8, reduce, total]);
120559
+ const fade = reduce ? void 0 : `opacity ${REVEAL_FADE_MS}ms ease-out`;
120560
+ if (markdownHtml != null) {
120561
+ return /* @__PURE__ */ jsx9(
120562
+ "span",
120563
+ {
120564
+ "data-himalaya-reveal": `${Math.min(shown2, total)}/${total}`,
120565
+ dangerouslySetInnerHTML: { __html: revealHtml(markdownHtml, shown2, fade).html }
120566
+ }
120567
+ );
120568
+ }
120569
+ let w2 = 0;
120570
+ return /* @__PURE__ */ jsx9("span", { "data-himalaya-reveal": `${Math.min(shown2, total)}/${total}`, children: tokens2.map((t2, i2) => {
120571
+ if (/^\s+$/.test(t2)) return t2;
120572
+ const visible = w2++ < shown2;
120573
+ return /* @__PURE__ */ jsx9("span", { style: { opacity: visible ? 1 : 0, transition: fade }, children: t2 }, i2);
120574
+ }) });
120575
+ };
120339
120576
  TextNode = withExtras("TextNode", ({ props, ctx, wrap }) => {
120340
120577
  const C2 = ctx.color;
120341
120578
  const f2 = ctx.font(props.style);
120342
120579
  const collapse = props.collapseWhenEmpty === true;
120343
120580
  const resolvedForCollapse = useResolvedScalar(collapse && isBinding(props.text) ? props.text : void 0, ctx);
120581
+ const reveal = props.animateReveal === true;
120582
+ const resolvedForReveal = useResolvedScalar(reveal && isBinding(props.text) ? props.text : void 0, ctx);
120344
120583
  let countAttrs;
120345
120584
  let countContent;
120346
120585
  if (props.animateValue === true && !ctx.reduceMotion()) {
@@ -120374,11 +120613,23 @@ var init_renderNode = __esm({
120374
120613
  const resolved2 = resolveScalarStatic(props.text, ctx);
120375
120614
  return resolved2 == null ? null : String(resolved2);
120376
120615
  })();
120377
- const content = countContent != null ? countContent : icuPattern != null ? /* @__PURE__ */ jsx9(InterpolatedTextView, { pattern: icuPattern, params: props.template?.params ?? {}, ctx }) : mdSource != null ? /* @__PURE__ */ jsx9("span", { dangerouslySetInnerHTML: mdInline(mdSource, accentTextColor(ctx)) }) : txt(props.text, ctx);
120378
- const tAlign = props.textAlign === "center" ? "center" : props.textAlign === "trailing" ? "right" : props.textAlign === "justify" ? "justify" : props.textAlign === "leading" ? "left" : void 0;
120616
+ const revealSource = (() => {
120617
+ if (!reveal || countContent != null || icuPattern != null) return null;
120618
+ if (mdSource != null) return mdSource;
120619
+ const raw = props.text;
120620
+ if (typeof raw !== "string") return null;
120621
+ if (!isBinding(raw)) return raw;
120622
+ const v2 = raw.startsWith("$service:") ? ctx.provider ? resolvedForReveal : void 0 : resolveScalarStatic(raw, ctx);
120623
+ return v2 == null ? null : String(v2);
120624
+ })();
120625
+ const revealMarkdown = props.markdown === true && revealSource != null ? mdSource ?? revealSource : null;
120626
+ const content = countContent != null ? countContent : revealSource != null && revealSource !== "" ? /* @__PURE__ */ jsx9(RevealText, { text: revealSource, reduce: ctx.reduceMotion(), markdownHtml: revealMarkdown != null ? mdInline(revealMarkdown, accentTextColor(ctx)).__html : void 0 }) : icuPattern != null ? /* @__PURE__ */ jsx9(InterpolatedTextView, { pattern: icuPattern, params: props.template?.params ?? {}, ctx }) : mdSource != null ? /* @__PURE__ */ jsx9("span", { dangerouslySetInnerHTML: mdInline(mdSource, accentTextColor(ctx)) }) : txt(props.text, ctx);
120627
+ const authoredDirection = props.textDirection === "auto" || props.textDirection === "ltr" || props.textDirection === "rtl";
120628
+ const dir = authoredDirection ? props.textDirection : "auto";
120629
+ const tAlign = props.textAlign === "center" ? "center" : props.textAlign === "trailing" ? authoredDirection ? "end" : "right" : props.textAlign === "justify" ? "justify" : props.textAlign === "leading" ? authoredDirection ? "start" : "left" : void 0;
120379
120630
  const tDecor = props.decoration === "strikethrough" ? "line-through" : props.decoration === "underline" ? "underline" : void 0;
120380
120631
  const ln2 = typeof props.lineSpacing === "number" ? pxToRem((f2.line ?? 1.4) * f2.size + props.lineSpacing) : f2.line;
120381
- return /* @__PURE__ */ jsx9("div", { ...countAttrs, style: { fontFamily: fontStack(f2.family, ctx.idiom), fontSize: f2.remSize, fontWeight: f2.weight, lineHeight: ln2, letterSpacing: f2.letterSpacing, color: C2(resolveScalarStatic(props.color, ctx) ?? "textPrimary", "#13171e"), whiteSpace: props.maxLines === 1 ? "nowrap" : "pre-wrap", overflowWrap: "anywhere", wordBreak: "break-word", minWidth: 0, ...tAlign ? { textAlign: tAlign } : {}, ...tDecor ? { textDecoration: tDecor } : {}, ...props.maxLines === 1 ? { overflow: "hidden", textOverflow: "ellipsis" } : props.maxLines ? { display: "-webkit-box", WebkitLineClamp: props.maxLines, WebkitBoxOrient: "vertical", overflow: "hidden" } : {}, ...wrap }, dir: props.textDirection ?? "auto", children: content == null || content === "" ? collapse ? null : "\xA0" : content });
120632
+ return /* @__PURE__ */ jsx9("div", { ...countAttrs, dir, style: { fontFamily: fontStack(f2.family, ctx.idiom), fontSize: f2.remSize, fontWeight: f2.weight, lineHeight: ln2, letterSpacing: f2.letterSpacing, color: C2(resolveScalarStatic(props.color, ctx) ?? "textPrimary", "#13171e"), whiteSpace: props.maxLines === 1 ? "nowrap" : "pre-wrap", overflowWrap: "anywhere", wordBreak: "break-word", minWidth: 0, ...tAlign ? { textAlign: tAlign } : {}, ...tDecor ? { textDecoration: tDecor } : {}, ...props.maxLines === 1 ? { overflow: "hidden", textOverflow: "ellipsis" } : props.maxLines ? { display: "-webkit-box", WebkitLineClamp: props.maxLines, WebkitBoxOrient: "vertical", overflow: "hidden" } : {}, ...wrap }, children: content == null || content === "" ? collapse ? null : "\xA0" : content });
120382
120633
  });
120383
120634
  ImageNode = withExtras("ImageNode", ({ props, ctx, wrap }) => {
120384
120635
  const C2 = ctx.color;
@@ -121613,9 +121864,32 @@ var init_renderNode = __esm({
121613
121864
  }, [boxEl, h2]);
121614
121865
  const hasMarkerFeed = typeof props.markersPath === "string" && props.markersPath !== "";
121615
121866
  const hasStaticMarkers = markers.length > 0 && !hasMarkerFeed;
121616
- const otherTileReason = route.length > 0 || shapes.length > 0 || hasEvents || props.cameraPath != null || props.showUserLocation === true || props.fitToContent === true;
121617
- const usesTileArm = (otherTileReason || hasStaticMarkers) && !usesSchematicRoute(props);
121867
+ const follow = props.followUserLocation === true;
121868
+ const observeUserLocation = props.showUserLocation === true || follow;
121869
+ const otherTileReason = route.length > 0 || shapes.length > 0 || hasEvents || props.cameraPath != null || props.showUserLocation === true || follow || props.fitToContent === true;
121870
+ const hasRouteContent = route.length > 0 || props.markersPath != null || props.routePath != null;
121871
+ const schematic = hasRouteContent && usesSchematicRoute(props);
121872
+ const explicitSchematic = schematic && props.routeMode?.toLowerCase() === "schematic";
121873
+ const usesTileArm = !explicitSchematic && (otherTileReason || hasStaticMarkers) && (follow || !schematic);
121618
121874
  const pinsOnly = hasStaticMarkers && !otherTileReason;
121875
+ const [userFix, setUserFix] = React8.useState(null);
121876
+ const [followBroken, setFollowBroken] = React8.useState(false);
121877
+ React8.useEffect(() => {
121878
+ if (follow) setFollowBroken(false);
121879
+ }, [follow]);
121880
+ React8.useEffect(() => {
121881
+ if (!observeUserLocation || !usesTileArm) return;
121882
+ const geo = typeof navigator !== "undefined" ? navigator.geolocation : void 0;
121883
+ if (!geo || typeof geo.watchPosition !== "function") return;
121884
+ const id = geo.watchPosition(
121885
+ (p2) => setUserFix({ lat: p2.coords.latitude, lng: p2.coords.longitude }),
121886
+ () => {
121887
+ },
121888
+ { enableHighAccuracy: true, maximumAge: 5e3 }
121889
+ );
121890
+ return () => geo.clearWatch(id);
121891
+ }, [observeUserLocation, usesTileArm]);
121892
+ const followActive = follow && !followBroken && userFix != null;
121619
121893
  {
121620
121894
  const all = [...route, ...markers, ...shapes.flatMap((sh) => sh.points)].filter((p2) => p2 && typeof p2.latitude === "number" && typeof p2.longitude === "number");
121621
121895
  const declared = typeof props.zoom === "number" && props.zoom > 0 ? Math.max(1, Math.min(19, props.zoom)) : 13;
@@ -121628,11 +121902,12 @@ var init_renderNode = __esm({
121628
121902
  const baseLat = all.length && shouldFit ? (Math.min(...all.map((p2) => p2.latitude)) + Math.max(...all.map((p2) => p2.latitude))) / 2 : typeof props.latitude === "number" ? props.latitude : 37.7749;
121629
121903
  const baseLng = all.length && shouldFit ? (Math.min(...all.map((p2) => p2.longitude)) + Math.max(...all.map((p2) => p2.longitude))) / 2 : typeof props.longitude === "number" ? props.longitude : -122.4194;
121630
121904
  const z4 = userCam?.z ?? fitted;
121631
- const cLat = userCam?.lat ?? baseLat;
121632
- const cLng = userCam?.lng ?? baseLng;
121905
+ const cLat = followActive ? userFix.lat : userCam?.lat ?? baseLat;
121906
+ const cLng = followActive ? userFix.lng : userCam?.lng ?? baseLng;
121633
121907
  React8.useEffect(() => {
121634
121908
  const resolved2 = resolveCamera(commandedCamera, cLat, cLng, z4);
121635
121909
  if (!resolved2) return;
121910
+ setFollowBroken(true);
121636
121911
  setUserCam({
121637
121912
  lat: Math.max(-MAX_MERCATOR_LAT, Math.min(MAX_MERCATOR_LAT, resolved2.latitude)),
121638
121913
  lng: resolved2.longitude,
@@ -121699,6 +121974,7 @@ var init_renderNode = __esm({
121699
121974
  const dy = (e2.clientY - d3.y) * d3.ky;
121700
121975
  if (Math.abs(dx) + Math.abs(dy) < 3) return;
121701
121976
  dragMovedRef.current = true;
121977
+ if (follow) setFollowBroken(true);
121702
121978
  const cx = mercatorX(d3.lng, d3.z) - dx;
121703
121979
  const cy = mercatorY(d3.lat, d3.z) - dy;
121704
121980
  setUserCam({
@@ -121807,7 +122083,11 @@ var init_renderNode = __esm({
121807
122083
  /* @__PURE__ */ jsx9("circle", { cx: sx(m2), cy: sy(m2), r: typeof m2.icon === "string" && m2.icon ? 9 : 6, fill: typeof m2.tint === "string" && m2.tint ? C2(m2.tint, accent) : accent, stroke: "#fff", strokeWidth: 2 }),
121808
122084
  typeof m2.icon === "string" && m2.icon ? /* @__PURE__ */ jsx9("text", { x: sx(m2), y: sy(m2), textAnchor: "middle", dominantBaseline: "central", fontSize: 9, fill: "#fff", children: iconGlyph(m2.icon) }) : null
121809
122085
  ] }, i2)
121810
- ))
122086
+ )),
122087
+ userFix && (props.showUserLocation === true || follow) ? /* @__PURE__ */ jsxs6("g", { "data-testid": "map-user-location", "data-following": followActive ? "true" : "false", children: [
122088
+ /* @__PURE__ */ jsx9("circle", { cx: sx({ latitude: userFix.lat, longitude: userFix.lng }), cy: sy({ latitude: userFix.lat, longitude: userFix.lng }), r: 14, fill: accent, fillOpacity: 0.18 }),
122089
+ /* @__PURE__ */ jsx9("circle", { cx: sx({ latitude: userFix.lat, longitude: userFix.lng }), cy: sy({ latitude: userFix.lat, longitude: userFix.lng }), r: 7, fill: accent, stroke: "#fff", strokeWidth: 2.5 })
122090
+ ] }) : null
121811
122091
  ] }),
121812
122092
  /* @__PURE__ */ jsx9("div", { style: { position: "absolute", right: 2, bottom: 1, font: "10px/12px system-ui", color: "#333", background: "rgba(255,255,255,.7)", padding: "0 3px", borderRadius: 2 }, children: resolvedTileSource?.attribution ?? "\xA9 OpenStreetMap" })
121813
122093
  ]
@@ -121836,21 +122116,185 @@ var init_renderNode = __esm({
121836
122116
  const src = `https://www.openstreetmap.org/export/embed.html?bbox=${encodeURIComponent(bbox)}&layer=mapnik&marker=${lat},${lng}`;
121837
122117
  return /* @__PURE__ */ jsx9("div", { style: { width: "100%", boxSizing: "border-box", height: h2, borderRadius: ctx.radius("md", 8), overflow: "hidden", border: `1px solid ${C2("border", "#e3e3e3")}`, position: "relative", ...wrap }, children: /* @__PURE__ */ jsx9("iframe", { title: "map", src, style: { width: "100%", height: "100%", border: "none", pointerEvents: props.interactive === false ? "none" : "auto" }, loading: "lazy" }) });
121838
122118
  });
122119
+ CAROUSEL_SETTLE_MS = 1e3;
122120
+ scrollCarouselTo = (el2, page) => {
122121
+ if (!el2) return;
122122
+ const left = page * el2.clientWidth;
122123
+ if (typeof el2.scrollTo === "function") el2.scrollTo({ left, behavior: "smooth" });
122124
+ else el2.scrollLeft = left;
122125
+ };
122126
+ CarouselNode = withExtras("CarouselNode", ({ props, ctx, wrap }) => {
122127
+ const C2 = ctx.color;
122128
+ const items = Array.isArray(props.items) ? props.items : [];
122129
+ const pages = items.filter((p2) => isNodeLike(p2) || p2?.type);
122130
+ const count2 = pages.length;
122131
+ const [index, setIndex] = React8.useState(typeof props.currentIndex === "number" ? props.currentIndex : 0);
122132
+ const indexRef = React8.useRef(index);
122133
+ const trackRef = React8.useRef(null);
122134
+ const [hovered, setHovered] = React8.useState(false);
122135
+ const [focused, setFocused] = React8.useState(false);
122136
+ const paused = hovered || focused;
122137
+ const interval = typeof props.autoplayIntervalMs === "number" && props.autoplayIntervalMs > 0 ? props.autoplayIntervalMs : 0;
122138
+ const autoplay = interval > 0 && count2 > 1 && !ctx.reduceMotion();
122139
+ const onChange = props.onChange;
122140
+ const onChangeRef = React8.useRef(onChange);
122141
+ onChangeRef.current = onChange;
122142
+ const autoScrollRef = React8.useRef(null);
122143
+ const endAutoScroll = React8.useCallback(() => {
122144
+ if (autoScrollRef.current) clearTimeout(autoScrollRef.current.timer);
122145
+ autoScrollRef.current = null;
122146
+ }, []);
122147
+ React8.useEffect(() => {
122148
+ const el2 = trackRef.current;
122149
+ el2?.addEventListener("scrollend", endAutoScroll);
122150
+ return () => {
122151
+ el2?.removeEventListener("scrollend", endAutoScroll);
122152
+ endAutoScroll();
122153
+ };
122154
+ }, [endAutoScroll]);
122155
+ const pageTo = React8.useCallback((page) => {
122156
+ if (page === indexRef.current) return;
122157
+ indexRef.current = page;
122158
+ setIndex(page);
122159
+ const action = onChangeRef.current;
122160
+ if (action && ctx.onAction) ctx.onAction({ ...action, args: { ...action.args ?? {}, index: page } });
122161
+ }, [ctx]);
122162
+ React8.useEffect(() => {
122163
+ if (!autoplay || paused) return;
122164
+ const id = setInterval(() => {
122165
+ const next = (indexRef.current + 1) % count2;
122166
+ endAutoScroll();
122167
+ autoScrollRef.current = { target: next, timer: setTimeout(endAutoScroll, CAROUSEL_SETTLE_MS) };
122168
+ pageTo(next);
122169
+ scrollCarouselTo(trackRef.current, next);
122170
+ }, interval);
122171
+ return () => clearInterval(id);
122172
+ }, [autoplay, paused, interval, count2, pageTo, endAutoScroll]);
122173
+ const onScroll = (e2) => {
122174
+ const el2 = e2.currentTarget;
122175
+ if (el2.clientWidth <= 0) return;
122176
+ const page = Math.max(0, Math.min(count2 - 1, Math.round(el2.scrollLeft / el2.clientWidth)));
122177
+ if (autoScrollRef.current) {
122178
+ if (page === autoScrollRef.current.target) endAutoScroll();
122179
+ return;
122180
+ }
122181
+ pageTo(page);
122182
+ };
122183
+ const onPointerOver = () => setHovered(true);
122184
+ const onPointerOut = () => setHovered(false);
122185
+ const onFocusIn = () => setFocused(true);
122186
+ const onFocusOut = (e2) => {
122187
+ const next = e2.relatedTarget;
122188
+ if (next && e2.currentTarget.contains(next)) return;
122189
+ setFocused(false);
122190
+ };
122191
+ const userTakesOver = (event) => {
122192
+ const el2 = trackRef.current;
122193
+ if (autoScrollRef.current && el2 && typeof el2.scrollTo === "function") {
122194
+ el2.scrollTo({ left: el2.scrollLeft, behavior: "instant" });
122195
+ }
122196
+ endAutoScroll();
122197
+ if (event.type === "keydown") setFocused(true);
122198
+ else setHovered(true);
122199
+ };
122200
+ return /* @__PURE__ */ jsxs6(
122201
+ "div",
122202
+ {
122203
+ "data-carousel-index": index,
122204
+ "data-carousel-autoplay": autoplay ? paused ? "paused" : "on" : "off",
122205
+ onPointerEnter: onPointerOver,
122206
+ onPointerDown: onPointerOver,
122207
+ onPointerLeave: onPointerOut,
122208
+ onFocus: onFocusIn,
122209
+ onBlur: onFocusOut,
122210
+ style: { width: "100%", ...wrap },
122211
+ children: [
122212
+ /* @__PURE__ */ jsx9("div", { ref: trackRef, onScroll, onPointerDown: userTakesOver, onTouchStart: userTakesOver, onWheel: userTakesOver, onKeyDown: userTakesOver, style: { display: "flex", overflowX: "auto", scrollSnapType: "x mandatory", width: "100%" }, children: pages.map((pg, i2) => /* @__PURE__ */ jsx9("div", { style: { minWidth: "100%", scrollSnapAlign: "start" }, children: renderNode(pg, ctx) }, pg?.id ?? i2)) }),
122213
+ count2 > 1 && /* @__PURE__ */ jsx9("div", { style: { display: "flex", gap: 6, justifyContent: "center", marginTop: 10 }, children: pages.map((_2, i2) => /* @__PURE__ */ jsx9("span", { style: { width: i2 === index ? 18 : 7, height: 7, borderRadius: 999, background: i2 === index ? C2("accentPrimary", "#116DFF") : C2("border", "#ccc") } }, i2)) })
122214
+ ]
122215
+ }
122216
+ );
122217
+ });
122218
+ BannerNode = withExtras("BannerNode", ({ props, ctx, wrap }) => {
122219
+ const C2 = ctx.color;
122220
+ const [dismissed, setDismissed] = React8.useState(false);
122221
+ if (dismissed) return null;
122222
+ const accent = sevColor(ctx, props.severity ?? "info");
122223
+ return /* @__PURE__ */ jsxs6("div", { style: { display: "flex", gap: 11, width: "100%", boxSizing: "border-box", borderRadius: ctx.radius("md", 10), padding: 13, background: `color-mix(in srgb, ${accent} 12%, ${C2("surfacePrimary", "#fff")})`, border: `1px solid color-mix(in srgb, ${accent} 32%, transparent)`, ...wrap }, children: [
122224
+ /* @__PURE__ */ jsx9("div", { style: { width: 3, borderRadius: 3, background: accent, flex: "none" } }),
122225
+ /* @__PURE__ */ jsxs6("div", { style: props.dismissible === true ? { flex: 1, minWidth: 0 } : void 0, children: [
122226
+ /* @__PURE__ */ jsx9("div", { style: { fontFamily: bodyFont(ctx), fontWeight: 600, fontSize: pxToRem(14), color: C2("textPrimary", "#111") }, children: txt(props.title, ctx) }),
122227
+ props.message && /* @__PURE__ */ jsx9("div", { style: { fontFamily: bodyFont(ctx), fontSize: pxToRem(13), lineHeight: 1.4, color: C2("textSecondary", "#666"), marginTop: 2 }, children: txt(props.message, ctx) }),
122228
+ actionTextButton(ctx, props.action, asBoundText(props.actionLabel, ctx) || "Take action", C2("textPrimary", "#111"), { marginTop: 7, textDecoration: "underline" })
122229
+ ] }),
122230
+ props.dismissible === true && /* @__PURE__ */ jsx9(
122231
+ "button",
122232
+ {
122233
+ type: "button",
122234
+ "data-testid": "banner-dismiss",
122235
+ "aria-label": "Dismiss",
122236
+ onClick: (e2) => {
122237
+ e2.stopPropagation();
122238
+ setDismissed(true);
122239
+ },
122240
+ style: { flex: "none", alignSelf: "flex-start", appearance: "none", WebkitAppearance: "none", border: "none", background: "transparent", padding: 0, minWidth: 24, minHeight: 24, display: "grid", placeItems: "center", color: C2("textSecondary", "#666"), fontSize: pxToRem(16), lineHeight: 1, cursor: "pointer" },
122241
+ children: /* @__PURE__ */ jsx9("span", { "aria-hidden": "true", children: "\u2715" })
122242
+ }
122243
+ )
122244
+ ] });
122245
+ });
121839
122246
  CollapsingHeaderNode = withExtras("CollapsingHeaderNode", ({ props, ctx, wrap }) => {
121840
122247
  const C2 = ctx.color;
121841
122248
  const items = Array.isArray(props.children) ? props.children : [];
121842
122249
  const boundImageUrl = useResolvedScalar(props.imageUrl != null && isBinding(props.imageUrl) ? props.imageUrl : void 0, ctx);
121843
122250
  const rawImageUrl = props.imageUrl != null && isBinding(props.imageUrl) ? boundImageUrl : props.imageUrl;
121844
- const imageUrl = typeof rawImageUrl === "string" && rawImageUrl !== "" ? resolveAssetUrl(rawImageUrl, ctx.assetBaseUrl) : void 0;
121845
- return /* @__PURE__ */ jsxs6("div", { ...{ [A11Y_PART]: "root" }, style: { width: "100%", ...wrap }, children: [
121846
- /* @__PURE__ */ jsxs6("div", { style: { position: "relative", height: Math.min(props.expandedHeight ?? 120, 160), borderRadius: ctx.radius("md", 10), overflow: "hidden", background: imageUrl ? void 0 : `linear-gradient(135deg, ${C2("accentPrimary", "#116DFF")}, ${C2("accentSecondary", "#0E5FE3")})` }, children: [
121847
- imageUrl && /* @__PURE__ */ jsx9("img", { src: imageUrl, alt: "", style: { width: "100%", height: "100%", objectFit: "cover" } }),
121848
- imageUrl && /* @__PURE__ */ jsx9("div", { "data-testid": "collapsing-header-scrim", "aria-hidden": "true", style: { position: "absolute", left: 0, right: 0, bottom: 0, height: "60%", background: "linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.45))", pointerEvents: "none" } }),
121849
- /* @__PURE__ */ jsxs6("div", { style: { position: "absolute", left: 14, bottom: 12, color: "#fff", textShadow: "0 1px 4px rgba(0,0,0,.5)" }, children: [
122251
+ const heroSrc = typeof rawImageUrl === "string" && rawImageUrl !== "" ? rawImageUrl : typeof props.imageAsset === "string" && isWebAssetPath(props.imageAsset) ? props.imageAsset : void 0;
122252
+ const resolvedHero = heroSrc ? resolveAssetUrl(heroSrc, ctx.assetBaseUrl) : void 0;
122253
+ const [failedHero, setFailedHero] = React8.useState(null);
122254
+ const imageUrl = resolvedHero && resolvedHero !== failedHero ? resolvedHero : void 0;
122255
+ const expanded = Math.min(props.expandedHeight ?? 120, 160);
122256
+ const collapsed = Math.max(0, Math.min(expanded, typeof props.collapsedHeight === "number" && props.collapsedHeight > 0 ? props.collapsedHeight : 64));
122257
+ const parallax = typeof props.parallaxFactor === "number" && Number.isFinite(props.parallaxFactor) ? Math.max(0, Math.min(1, props.parallaxFactor)) : 0.5;
122258
+ const span = Math.max(1, expanded - collapsed);
122259
+ const rootRef = React8.useRef(null);
122260
+ const [offset, setOffset] = React8.useState(0);
122261
+ React8.useEffect(() => {
122262
+ const el2 = rootRef.current;
122263
+ const win = el2?.ownerDocument?.defaultView;
122264
+ if (!el2 || !win) return;
122265
+ let port = collapsingScrollPort(el2);
122266
+ const measure2 = () => {
122267
+ const top = port ? port.getBoundingClientRect().top : 0;
122268
+ const next = Math.max(0, Math.round(top - el2.getBoundingClientRect().top));
122269
+ setOffset((prev) => prev === next ? prev : next);
122270
+ };
122271
+ const onScroll = (e2) => {
122272
+ const t2 = e2.target;
122273
+ if (t2 && t2.nodeType === 1 && t2 !== el2 && t2.contains(el2)) port = t2;
122274
+ measure2();
122275
+ };
122276
+ measure2();
122277
+ win.addEventListener("scroll", onScroll, { capture: true, passive: true });
122278
+ win.addEventListener("resize", measure2);
122279
+ return () => {
122280
+ win.removeEventListener("scroll", onScroll, { capture: true });
122281
+ win.removeEventListener("resize", measure2);
122282
+ };
122283
+ }, []);
122284
+ const progress = Math.min(1, offset / span);
122285
+ const height = Math.round(expanded - (expanded - collapsed) * progress);
122286
+ const lost = expanded - height;
122287
+ const fade = 1 - progress * 0.7;
122288
+ return /* @__PURE__ */ jsxs6("div", { ref: rootRef, ...{ [A11Y_PART]: "root" }, style: { width: "100%", ...wrap }, children: [
122289
+ /* @__PURE__ */ jsxs6("div", { "data-collapse-progress": progress.toFixed(2), style: { position: "sticky", top: 0, zIndex: 1, height, borderRadius: ctx.radius("md", 10), overflow: "hidden", background: imageUrl ? C2("surfaceSecondary", "#eef1f5") : `linear-gradient(135deg, ${C2("accentPrimary", "#116DFF")}, ${C2("accentSecondary", "#0E5FE3")})` }, children: [
122290
+ imageUrl && /* @__PURE__ */ jsx9("img", { src: imageUrl, alt: "", "data-testid": "collapsing-header-image", onError: () => setFailedHero(imageUrl), style: { position: "absolute", left: 0, top: 0, width: "100%", height: expanded, objectFit: "cover", ...lost > 0 ? { transform: `translateY(${-Math.round(lost * (1 - parallax))}px)` } : {} } }),
122291
+ imageUrl && /* @__PURE__ */ jsx9("div", { "data-testid": "collapsing-header-scrim", "aria-hidden": "true", style: { position: "absolute", left: 0, right: 0, bottom: 0, height: "60%", background: "linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.45))", pointerEvents: "none", ...progress > 0 ? { opacity: fade } : {} } }),
122292
+ /* @__PURE__ */ jsxs6("div", { style: { position: "absolute", left: 14, bottom: 12, color: "#fff", textShadow: "0 1px 4px rgba(0,0,0,.5)", ...progress > 0 ? { opacity: fade } : {} }, children: [
121850
122293
  /* @__PURE__ */ jsx9("div", { ...{ [A11Y_PART]: "node" }, role: "heading", "aria-level": 2, style: { fontFamily: ctx.font("title1").family || ctx.idiom && ctx.idiom !== "base" ? fontStack(ctx.font("title1").family, ctx.idiom) : '"Wix Madefor Display", system-ui', fontWeight: 700, fontSize: pxToRem(20) }, children: txt(props.title, ctx) }),
121851
122294
  props.subtitle && /* @__PURE__ */ jsx9("div", { style: { fontSize: pxToRem(13), opacity: 0.9 }, children: txt(props.subtitle, ctx) })
121852
122295
  ] })
121853
122296
  ] }),
122297
+ lost > 0 && /* @__PURE__ */ jsx9("div", { "aria-hidden": "true", style: { height: lost } }),
121854
122298
  items.length > 0 && /* @__PURE__ */ jsx9("div", { style: { paddingTop: 12 }, children: kids2(items, ctx) })
121855
122299
  ] });
121856
122300
  });
@@ -144075,23 +144519,23 @@ var init_preview_assets_generated = __esm({
144075
144519
  "../../packages/serve/src/preview-assets.generated.ts"() {
144076
144520
  init_preview_assets_format();
144077
144521
  PREVIEW_ASSET_MANIFEST = [
144078
- { key: "assets/index-Yk7eJmSu.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 1200025, sha256: "c6028353fe04eec23e8ef1273e57f2f19d044048a03666b9976ca2f6e877167a" },
144079
- { key: "assets/pdf.worker.min-BmVo14Nb.mjs", contentType: "application/octet-stream", offset: 1200033, length: 1317034, sha256: "a33cfe728c584fdba4fcc1fd54bcdc2f9f2f13889ddbb5b2bd1d0f8cbe49b84e" },
144080
- { key: "assets/pdfDocument-B4ZYxHI3.js", contentType: "application/javascript; charset=utf-8", offset: 2517067, length: 489166, sha256: "a82d40ad0a9bc9867f937e0a29a10c90622d3cd704ca83853e060d2211bf6936" },
144081
- { key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 3006233, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
144082
- { key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 3010843, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
144083
- { key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 3499427, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
144084
- { key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 3590351, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
144085
- { key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 3681335, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
144086
- { key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 3772315, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
144087
- { key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 3863187, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
144088
- { key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 3954167, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
144089
- { key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 4062803, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
144090
- { key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 4171887, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
144091
- { key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 4280935, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
144092
- { key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 4388635, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
144093
- { key: "index.html", contentType: "text/html; charset=utf-8", offset: 4476743, length: 4947, sha256: "f51dc601646327e37dec4c09191aa1543f72474ea01857dea29be6452f06fa0f" },
144094
- { key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 4481690, length: 17344, sha256: "d057298d75e7373e5e2c4d11b7d1bcbea88e03af555ba63d97641c78509c58e4" }
144522
+ { key: "assets/index-BlEeasLL.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 1213832, sha256: "a8237b1b52ea2668925107beba9e28aa67e9e91905b4a4f798eb0bd8001c1744" },
144523
+ { key: "assets/pdf.worker.min-BmVo14Nb.mjs", contentType: "application/octet-stream", offset: 1213840, length: 1317034, sha256: "a33cfe728c584fdba4fcc1fd54bcdc2f9f2f13889ddbb5b2bd1d0f8cbe49b84e" },
144524
+ { key: "assets/pdfDocument-B42oKMYf.js", contentType: "application/javascript; charset=utf-8", offset: 2530874, length: 489166, sha256: "49018b2728690ad63ea4a93c8bb09b680f6e9f78737df2f3f5a2e894a0d0f440" },
144525
+ { key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 3020040, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
144526
+ { key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 3024650, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
144527
+ { key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 3513234, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
144528
+ { key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 3604158, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
144529
+ { key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 3695142, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
144530
+ { key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 3786122, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
144531
+ { key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 3876994, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
144532
+ { key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 3967974, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
144533
+ { key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 4076610, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
144534
+ { key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 4185694, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
144535
+ { key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 4294742, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
144536
+ { key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 4402442, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
144537
+ { key: "index.html", contentType: "text/html; charset=utf-8", offset: 4490550, length: 4947, sha256: "f41341372a0773c0bdbb3711e2f68b136fd110997452bd3829ce91d3200d7d40" },
144538
+ { key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 4495497, length: 17344, sha256: "d057298d75e7373e5e2c4d11b7d1bcbea88e03af555ba63d97641c78509c58e4" }
144095
144539
  ];
144096
144540
  }
144097
144541
  });
@@ -149040,6 +149484,96 @@ var init_notify = __esm({
149040
149484
  }
149041
149485
  });
149042
149486
 
149487
+ // src/base44-auth-check.ts
149488
+ var base44_auth_check_exports = {};
149489
+ __export(base44_auth_check_exports, {
149490
+ checkBase44NativeAuth: () => checkBase44NativeAuth
149491
+ });
149492
+ async function checkBase44NativeAuth(options) {
149493
+ const tenant = base44TenantUrl(options.url);
149494
+ const ios = options.iosAppId;
149495
+ const pkg = options.androidPackage;
149496
+ const fingerprint = options.androidSha256?.toUpperCase();
149497
+ if (!ios && !pkg) throw new Error("auth-check needs --ios-app-id <PREFIX.bundle.id> and/or --android-package <package> --android-sha256 <fingerprint>");
149498
+ if (ios && !/^[A-Z0-9]{10}\.[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)+$/.test(ios)) throw new Error("--ios-app-id must be the signed app's application-identifier (PREFIX.bundle.id)");
149499
+ if (Boolean(pkg) !== Boolean(fingerprint)) throw new Error("--android-package and --android-sha256 must be supplied together");
149500
+ if (pkg && !/^[a-zA-Z][a-zA-Z0-9_]*(?:\.[a-zA-Z][a-zA-Z0-9_]*)+$/.test(pkg)) throw new Error("invalid --android-package");
149501
+ if (fingerprint && !/^(?:[A-F0-9]{2}:){31}[A-F0-9]{2}$/.test(fingerprint)) throw new Error("--android-sha256 must be the signing certificate's colon-separated SHA-256 fingerprint");
149502
+ const fetchImpl = options.fetchImpl ?? fetch;
149503
+ const requiredDocuments = {
149504
+ ...ios ? { "apple-app-site-association": {
149505
+ webcredentials: { apps: [ios] },
149506
+ applinks: { apps: [], details: [{ appID: ios, paths: ["/"] }] }
149507
+ } } : {},
149508
+ ...pkg ? { "assetlinks.json": [{
149509
+ relation: ["delegate_permission/common.handle_all_urls"],
149510
+ target: { namespace: "android_app", package_name: pkg, sha256_cert_fingerprints: [fingerprint] }
149511
+ }] } : {}
149512
+ };
149513
+ const checks = [];
149514
+ async function document2(name) {
149515
+ const url = new URL(`/.well-known/${name}`, tenant).href;
149516
+ const response = await fetchImpl(url, { redirect: "manual", signal: AbortSignal.timeout(15e3), headers: { Accept: "application/json" } });
149517
+ if (!response.ok) throw new Error(`HTTP ${response.status} (association files must be served directly)`);
149518
+ const body = await response.text();
149519
+ if (body.length > 1e6) throw new Error("association file is too large");
149520
+ return JSON.parse(body);
149521
+ }
149522
+ if (ios) {
149523
+ const missing = [];
149524
+ try {
149525
+ const aasa = await document2("apple-app-site-association");
149526
+ if (!Array.isArray(aasa?.webcredentials?.apps) || !aasa.webcredentials.apps.includes(ios)) missing.push(`webcredentials.apps must include ${ios}`);
149527
+ const details = aasa?.applinks?.details;
149528
+ const permitsRoot = (() => {
149529
+ for (const entry of Array.isArray(details) ? details : []) {
149530
+ if (entry?.appID !== ios && !(Array.isArray(entry?.appIDs) && entry.appIDs.includes(ios))) continue;
149531
+ if (Array.isArray(entry.components)) {
149532
+ const root2 = entry.components.find((c2) => c2 && typeof c2 === "object" && !Array.isArray(c2) && ["/", "/*", "*"].includes(c2["/"] ?? "*") && (c2["#"] === void 0 || typeof c2["#"] === "string" && /^\**$/.test(c2["#"])));
149533
+ if (!root2) continue;
149534
+ return root2.exclude !== true && root2["?"] === void 0;
149535
+ }
149536
+ const root = Array.isArray(entry.paths) && entry.paths.find((p2) => typeof p2 === "string" && ["/", "/*", "*", "NOT /", "NOT /*", "NOT *"].includes(p2));
149537
+ if (typeof root !== "string") continue;
149538
+ return !root.startsWith("NOT ");
149539
+ }
149540
+ return false;
149541
+ })();
149542
+ if (!permitsRoot) missing.push(`applinks.details must allow / for ${ios} (required by the older-iOS fallback)`);
149543
+ } catch (error) {
149544
+ missing.push(error instanceof Error ? error.message : String(error));
149545
+ }
149546
+ checks.push({ platform: "ios", url: new URL("/.well-known/apple-app-site-association", tenant).href, ok: missing.length === 0, missing });
149547
+ }
149548
+ if (pkg) {
149549
+ const missing = [];
149550
+ try {
149551
+ const links = await document2("assetlinks.json");
149552
+ const matches = Array.isArray(links) && links.some((entry) => Array.isArray(entry?.relation) && entry.relation.includes("delegate_permission/common.handle_all_urls") && entry?.target?.namespace === "android_app" && entry.target.package_name === pkg && Array.isArray(entry.target.sha256_cert_fingerprints) && entry.target.sha256_cert_fingerprints.some((f2) => typeof f2 === "string" && f2.toUpperCase() === fingerprint));
149553
+ if (!matches) missing.push(`assetlinks must authorize ${pkg} with the supplied signing certificate and common.handle_all_urls`);
149554
+ } catch (error) {
149555
+ missing.push(error instanceof Error ? error.message : String(error));
149556
+ }
149557
+ checks.push({ platform: "android", url: new URL("/.well-known/assetlinks.json", tenant).href, ok: missing.length === 0, missing });
149558
+ }
149559
+ const ok2 = checks.every((check) => check.ok);
149560
+ return {
149561
+ ok: ok2,
149562
+ ...!ok2 ? { code: "base44_native_auth_not_ready" } : {},
149563
+ tenantUrl: tenant.origin,
149564
+ callbackHost: tenant.hostname,
149565
+ callbackPath: "/",
149566
+ checks,
149567
+ requiredDocuments,
149568
+ note: "Merge these entries into the tenant's existing association files using Base44's mobile-app configuration. This command is read-only. Passing proves domain configuration; validate Google sign-in and auth.me on the signed native app too."
149569
+ };
149570
+ }
149571
+ var init_base44_auth_check = __esm({
149572
+ "src/base44-auth-check.ts"() {
149573
+ init_scaffold();
149574
+ }
149575
+ });
149576
+
149043
149577
  // src/base44-auth.ts
149044
149578
  var base44_auth_exports = {};
149045
149579
  __export(base44_auth_exports, {
@@ -157372,7 +157906,8 @@ function mergeCustomerOwned(committed, overlay) {
157372
157906
  "wix",
157373
157907
  "copy",
157374
157908
  "faq",
157375
- "site"
157909
+ "site",
157910
+ "goals"
157376
157911
  ];
157377
157912
  const customer = {};
157378
157913
  for (const key2 of CUSTOMER_OWNED) {
@@ -157392,7 +157927,23 @@ function mergeCustomerOwned(committed, overlay) {
157392
157927
  if (typeof value === "string" && value.trim() === "") delete overlayIdentity[key2];
157393
157928
  }
157394
157929
  if (customer.identity !== void 0) customer.identity = overlayIdentity;
157395
- return deepMerge4(committed, customer);
157930
+ const { goals: _shellGoals, ...shell } = committed;
157931
+ return deepMerge4(shell, customer);
157932
+ }
157933
+ function carryOverGoals(previousOverlayJson, overlay) {
157934
+ if (overlay.goals !== void 0 || !previousOverlayJson) return;
157935
+ try {
157936
+ const previous = JSON.parse(previousOverlayJson);
157937
+ const site = siteKeyOf(overlay);
157938
+ if (previous.goals !== void 0 && site !== "" && siteKeyOf(previous) === site) overlay.goals = previous.goals;
157939
+ } catch {
157940
+ }
157941
+ }
157942
+ function siteKeyOf(overlay) {
157943
+ const siteId = typeof overlay.siteId === "string" ? overlay.siteId.trim() : "";
157944
+ if (siteId) return `id:${siteId}`;
157945
+ const url = overlay.wix?.siteUrl;
157946
+ return typeof url === "string" && url.trim() ? `url:${url.trim().replace(/\/+$/, "").toLowerCase()}` : "";
157396
157947
  }
157397
157948
  function buildMergedContract(options) {
157398
157949
  const { appDir: appDir3, packageDir, overlay } = options;
@@ -158664,6 +159215,11 @@ async function runSiteAnalyze(opts) {
158664
159215
  ];
158665
159216
  }
158666
159217
  }
159218
+ const previousOverlay = resolve55(outDir, "provisioning.overlay.json");
159219
+ carryOverGoals(
159220
+ existsSync72(previousOverlay) ? readFileSync89(previousOverlay, "utf8") : void 0,
159221
+ result.provisioningOverlay
159222
+ );
158667
159223
  const ownerCall = ownerAuth ? ownerTransportFrom(fetchImpl, ownerAuth) : void 0;
158668
159224
  const written = await writeBusinessBook(result, {
158669
159225
  outDir,
@@ -162004,10 +162560,11 @@ var USAGE = `himi \u2014 the Himalaya authoring CLI (remote dev loop)
162004
162560
  create/store or inspect CAPTCHA keys (not login tokens).
162005
162561
  Setup needs final --ios-bundle-id / --android-package-name.
162006
162562
 
162007
- himi init <name> [--dir <parent>] [--template <t>] [--remote] [--base44-app-id <id>] [--push-setup | --no-push-setup] [--no-agent] [--no-first-look]
162563
+ himi init <name> [--dir <parent>] [--template <t>] [--remote] [--base44-app-id <id>] [--base44-app-url <https://tenant>] [--push-setup | --no-push-setup] [--no-agent] [--no-first-look]
162008
162564
  scaffold a starter content package (--template <t> starts
162009
162565
  from a reference app; --remote fetches it off the serve plane;
162010
162566
  --base44-app-id writes a Base44 app id into a Base44 template
162567
+ --base44-app-url sets the published tenant callback host
162011
162568
  such as base44-starter \u2014 himi docs base44-app-to-himi-app),
162012
162569
  with the agent files inside it (AGENTS.md, CLAUDE.md, the himalaya
162013
162570
  skill, a session-start hook); --no-agent skips them. Also makes
@@ -162630,6 +163187,10 @@ var USAGE = `himi \u2014 the Himalaya authoring CLI (remote dev loop)
162630
163187
  himi base44 login [--from-base44-cli] | whoami | logout
162631
163188
  the Base44 session, in ~/.himi/base44/ (never the repo).
162632
163189
  BASE44_ACCESS_TOKEN wins, for CI.
163190
+ himi base44 auth-check --url <https://tenant> [--ios-app-id <PREFIX.bundle.id>]
163191
+ [--android-package <package> --android-sha256 <fingerprint>]
163192
+ check the public tenant association files for native
163193
+ Google sign-in; print the required entries. READ-ONLY.
162633
163194
  himi doctor [--target <t>] [--dpx] [--json]
162634
163195
  off-VPN preflight: probe the PUBLIC data plane
162635
163196
  (www.wixapis.com), the internal serve/control plane
@@ -162745,7 +163306,7 @@ WHAT A PATCH DOES NOT CARRY \u2014 all reported in the output, never silent
162745
163306
  himi docs releasing-with-himi-serve`;
162746
163307
  var COMMANDS2 = [
162747
163308
  { name: "captcha", summary: "create and store native CAPTCHA keys in Serve, or inspect setup status; customer setup verifies Wix site ownership; does not enable member CAPTCHA SDKs", required: "setup|status --app <app> [--content <dir>] [--site <msid>] [--ios-bundle-id <id>] [--android-package-name <id>] [--target <t>]" },
162748
- { name: "init", summary: "scaffold a starter content package (OTA-only; no native shells). --template <t> starts from a full reference app (branded-lite = consumer storefront over a Wix site; owner-lite = owner CRUD/management) instead of the minimal counter; --templates lists bundled ones; --remote fetches the template off the serve plane (falls back to the bundled copy offline). The new app also gets its agent files (the same set `himi agent-init` writes: AGENTS.md, CLAUDE.md, the himalaya skill, HIMALAYA.md, a SessionStart hook) so the next session started inside it picks the work up; --no-agent skips them. It also makes the build board (.himi/studio/, exactly as `himi studio --no-open` does \u2014 it never opens a browser), so every later render, test, validate, push and progress entry refreshes it; and, for a template bundled with this CLI, it makes the FIRST PICTURE itself (never for a --remote one: that is its publisher's code, and a render runs it on this machine, so next[] leaves the render to the agent after it has read the code): exactly `himi render <homeScreenId> --png --mocks --device iphone` (offline \u2014 no request; never --live; --mocks loads the app's recorded data when it has any), run as a child it kills after a time budget, writing .himi/shots/<home>.png and journaling it (by: himi) as the STARTING POINT (\"Starting point: the <template> template, before any of your changes\") so the board and the journal hold a picture when init returns. init also records the source it wrote (.himi/init-source.json: a content fingerprint, Markdown left out), and the first home PNG render after the source diverges from it is journaled once as \"First look at your app\" \u2014 reported as `firstLook: {image}` or `{skipped: <reason>}`, never a failed init; `--no-first-look` skips it (for scripts and CI that render themselves). For a bundled template (never a --remote one \u2014 the preview would build and serve its publisher's code) init also STARTS the live preview itself: `himi run --watch --content <dir> --port <p> --no-open --idle-exit 30`, detached in its own process group with its output in .himi/watch.log, never waited for (the url is chosen before it builds), recorded in .himi/watch.json, and reported as `watch: {started, pid, url, board, log}` \u2014 or `{skipped: <reason>}` for a `CI` environment, a test runner, a watch already running, or a start that failed (never a failed init). Nothing else skips it: outside CI it is started, and `watch.note` says an opt-out was ignored. The envelope LEADS with `doNow`: three lines to run now (the consent preflight, the live preview \u2014 its url and board when init started it, else `himi run --watch --content <dir> &` with the board's path \u2014 and the postcard line), and ENDS with the same lines as `doNowAgain`, so an agent that reads only the head or only the tail (`| tail`) gets them; at a terminal they are also printed as plain text on stderr, before the JSON and again after it. Its `next[]` LEADS with the steps for THIS session, in this order for every app \u2014 the offline first render and that picture's `himi progress` postcard (only when init could not make the picture), the skill's consent preflight (authorize or mock any Wix or external startup request; with none, go straight on), and only then the live preview (the running one's url, or `himi run --watch &` when init did not start it) \u2014 ahead of the next-session guidance", required: "<name> [--dir] [--template <t>] [--remote] [--base44-app-id <id>] [--no-agent] [--no-first-look] | --templates" },
163309
+ { name: "init", summary: "scaffold a starter content package (OTA-only; no native shells). --template <t> starts from a full reference app (branded-lite = consumer storefront over a Wix site; owner-lite = owner CRUD/management) instead of the minimal counter; --templates lists bundled ones; --remote fetches the template off the serve plane (falls back to the bundled copy offline). The new app also gets its agent files (the same set `himi agent-init` writes: AGENTS.md, CLAUDE.md, the himalaya skill, HIMALAYA.md, a SessionStart hook) so the next session started inside it picks the work up; --no-agent skips them. It also makes the build board (.himi/studio/, exactly as `himi studio --no-open` does \u2014 it never opens a browser), so every later render, test, validate, push and progress entry refreshes it; and, for a template bundled with this CLI, it makes the FIRST PICTURE itself (never for a --remote one: that is its publisher's code, and a render runs it on this machine, so next[] leaves the render to the agent after it has read the code): exactly `himi render <homeScreenId> --png --mocks --device iphone` (offline \u2014 no request; never --live; --mocks loads the app's recorded data when it has any), run as a child it kills after a time budget, writing .himi/shots/<home>.png and journaling it (by: himi) as the STARTING POINT (\"Starting point: the <template> template, before any of your changes\") so the board and the journal hold a picture when init returns. init also records the source it wrote (.himi/init-source.json: a content fingerprint, Markdown left out), and the first home PNG render after the source diverges from it is journaled once as \"First look at your app\" \u2014 reported as `firstLook: {image}` or `{skipped: <reason>}`, never a failed init; `--no-first-look` skips it (for scripts and CI that render themselves). For a bundled template (never a --remote one \u2014 the preview would build and serve its publisher's code) init also STARTS the live preview itself: `himi run --watch --content <dir> --port <p> --no-open --idle-exit 30`, detached in its own process group with its output in .himi/watch.log, never waited for (the url is chosen before it builds), recorded in .himi/watch.json, and reported as `watch: {started, pid, url, board, log}` \u2014 or `{skipped: <reason>}` for a `CI` environment, a test runner, a watch already running, or a start that failed (never a failed init). Nothing else skips it: outside CI it is started, and `watch.note` says an opt-out was ignored. The envelope LEADS with `doNow`: three lines to run now (the consent preflight, the live preview \u2014 its url and board when init started it, else `himi run --watch --content <dir> &` with the board's path \u2014 and the postcard line), and ENDS with the same lines as `doNowAgain`, so an agent that reads only the head or only the tail (`| tail`) gets them; at a terminal they are also printed as plain text on stderr, before the JSON and again after it. Its `next[]` LEADS with the steps for THIS session, in this order for every app \u2014 the offline first render and that picture's `himi progress` postcard (only when init could not make the picture), the skill's consent preflight (authorize or mock any Wix or external startup request; with none, go straight on), and only then the live preview (the running one's url, or `himi run --watch &` when init did not start it) \u2014 ahead of the next-session guidance", required: "<name> [--dir] [--template <t>] [--remote] [--base44-app-id <id>] [--base44-app-url <https://tenant>] [--no-agent] [--no-first-look] | --templates" },
162749
163310
  { name: "template", summary: "starter-template catalog + publishing. Every template is a SHOWCASE APP \u2014 a real published release you can open running before you start from it. `list` prints available templates with metadata (title/description/tags) plus each one's start prompt \u2014 pass --remote to include the serve-plane catalog so an agent can pick one; `prompt <name>` prints just that sentence for one template (the skill URL is the public door, or the plane named by --target/--serve-url); `publish` publishes an app AS a `himi init --template` (needs a himalaya.template.json; builds a previewable release + attaches the scaffold source; --source-dir overrides which tree becomes the source, --name sets the template name; bakes a launcher icon \u2014 --icon <png>, or the committed template-icons/<name>.png \u2014 and extracts accent/palette gallery meta from the scaffold's tokens.json; --visibility unlisted keeps it out of the /v1/templates catalog \u2014 templates default to public); `trim --keep <ids>` cuts an app scaffolded from a template down to those screens (the home, and any screen the navigation pins such as a drawer body, always stays) \u2014 it deletes the other SCREENS/TEMPLATED entries whole, prunes navigation (linkableScreens, tabBar, drawer, deep links, surfaces) and drops tier5-src workers no kept screen uses, then runs validate --strict and rolls everything back if it fails (--force keeps it, --dry-run writes nothing). A kept screen that links to a removed one is refused unless --links follow (keep those too) or --links drop (remove the taps). Adopting one: `inspect` writes the adoption inventory (.himi/adopt.json: screens, workers, which screens can call Wix/network on appear \u2014 bootsOffline \u2014 placeholder and sample copy, proposed Data access rows, typed-journey stubs); `screens` lists, shows, rewrites or adds ONE dev/index.ts entry; `sweep` replaces sample identity/copy inside string literals; `recommend` ranks the catalog for a business description or a site's verticals; `trim --from-spec` takes the kept screens from SPEC.md's Screen catalogue", required: "list [--remote] | prompt <name> | publish [--dir <app>] [--source-dir <dir>] [--name <n>] [--icon <png>] [--visibility public|unlisted] [--target <t>] | trim --keep <id,id,\u2026>|--from-spec [SPEC.md] [--content <dir>] [--links follow|drop] [--dry-run] [--force] | inspect [--content <dir>] [--dry-run] | screens [--show <id>] [--write <id> --from <file>] [--add <id> --from <file>] | sweep --set 'Old=>New' | --map <file> [--dry-run] | recommend [--text <t>] [--verticals a,b] [--book <dir>] [--remote]" },
162750
163311
  { name: "build", summary: "compile tier5-src/<name>/index.ts -> dist/bundles/<name>.bundle.js with esbuild (--binary = resolve published @himalaya/*); semantic TypeScript checking belongs to himi validate", required: "[--content <dir>] [--binary]" },
162751
163312
  { name: "functions", summary: "inspect/invoke server functions and operate durable jobs or schedules", required: "list|describe|openapi|invoke | jobs list|get|cancel|retry|dlq | schedule describe|invoke [--app <a>] [--environment preview|production] [--release <id>]" },
@@ -162764,7 +163325,7 @@ var COMMANDS2 = [
162764
163325
  { name: "logout", summary: "remove the stored control token for a target", required: "[--target <t>]" },
162765
163326
  { name: "notify", summary: "Hosted --all-members requires --yes for a live send; --dry-run checks ownership/readiness and counts approved recipients without sending. `setup` optionally configures Branded/Ping from local customer key files; `status --refresh` reads live backend readiness. Setup may be deferred while building. These use serve-control and require owner plus Wix account authentication. `send`, `tokens`, `doctor`: send a REAL push notification to registered devices (RFC 0036 WS5) \u2014 APNs .p8 over HTTP/2 for iOS, FCM v1 for Android. `send` targets one device (--token / --device <registry id>) or fans out to the whole app (--all), reporting a per-device result; a token the provider says is uninstalled (APNs 410 Unregistered / FCM UNREGISTERED) is auto-disabled, while a merely wrong one (BadDeviceToken \u2014 usually a sandbox/production mismatch) is recorded and left enabled. `tokens` lists the registry. `doctor` reports which credentials resolve and which sender each platform picks. Talks to the admin-server via --admin-url/HIMALAYA_ADMIN_URL, authenticated with --admin-session/HIMALAYA_ADMIN_SESSION. `send --provider ping` is the hosted alternative: the serve plane sends to one site member (--member-email) or all approved members (--all-members) through Ping as Himalaya, with owner login instead of provider keys, and reports acceptance, never delivery. NOT `himi push`, which publishes a release.", required: "setup|status [--content <dir>] [--target <t>] [--refresh] [--yes] [--no-push-setup] | send --provider ping [--content <dir>] [--app <a>] [--site <msid>] (--member-email <email> | --all-members (--dry-run | --yes)) --title <s> [--body <s>] --link <url> [--request-id <uuid>] [--dry-run] [--json] | send|tokens|doctor [--app <a>] [--token <t> | --device <id> | --all] [--title <s>] [--body <s>] [--link <url>] [--platform ios|android] [--badge <n>] [--channel <id>] [--silent] [--dry-run] [--json]" },
162766
163327
  { name: "site", summary: "PROVISION a Wix project, then analyze or extend it. `create` is the one door that makes a site instead of adopting one: POST /funnel/projects/v1/create (a WIX site, a HEADLESS backend, a BRANDED_APP, or a VIBE site), and for headless it also mints the OAuth app whose id IS the `WIX_CLIENT_ID` \u2014 with --redirect-uri already registered, because an unregistered redirect makes native signInDirect fail at redirect-session. `--verticals` REQUIRES `--template` and reports only what Wix confirmed: measured, installing onto a project created from the BLANK template returns 200 while the vertical's API answers 428 forever, because there is no site for it to attach to (the install asks for CREATE_SITE). A real template ships its verticals installed and populated, and installing further ones onto it then works. It MUTATES your Wix account and needs --yes; without it you get the payload and nothing is sent. `list` is the read-only site inventory (with each site's premium flag, which is what explains an installed-but-428 vertical). Auth is the account-scoped `wix token` (no --site), falling back to WIX_API_KEY + WIX_ACCOUNT_ID. `client` is the same OAuth step for a site that ALREADY exists \u2014 the one himi adopts rather than makes \u2014 so a clientId no longer means a manual trip to the dashboard: `client ensure` reconciles rather than mints, because a site can already carry a client with NO registered redirect and shipping that one fails signInDirect at runtime; it reuses a client that carries --redirect-uri, PATCHes one that matches --name but lacks it (unioning, so another app's redirect survives), and creates only when there is nothing to reuse (--new forces a fresh one). --name IS the idempotency key. `client` auth is SITE-scoped (`wix token --site <msid>`) because minting is owner-of-that-site, and --yes gates every mutation: a site that already has a usable client resolves WITHOUT it, but --write-provisioning needs --yes even then because it rewrites a manifest on disk (the dry run's planned.provisioning names the file). That query endpoint IGNORES paging (measured: query.paging, cursorPaging and a top-level paging all return the full set at offset 0), so when pagingMetadata reports more clients than came back, `ensure` REFUSES EVERY outcome \u2014 create, patch AND reuse. Reuse is refused too because pickClient breaks ties on the OLDEST createdDate, so an omitted older same-named MOBILE client with the same redirect would win a later complete read and the resolved clientId would MOVE between runs \u2014 and it gets written into provisioning.json; convergence is what makes a stray duplicate untidy rather than harmful. --name cannot narrow the query (no filter is sent; the name is applied to the rows after they arrive), so the recovery is the dashboard; --new skips the query entirely. A `patched` result is verified against what Wix STORED \u2014 the redirect list is read off the PATCH response, and re-read via GET when the response omits it, because falling back to the list himi just sent would make the guard pass vacuously on exactly the silent no-op it exists to catch. `client list` is the read-only inventory of a site's clients: act on its `shippable` column rather than `hasRedirect`, because shippable ALSO requires a MOBILE applicationType and `ensure` refuses a WEB client \u2014 a WEB one carrying your redirect looks right and is not a candidate \u2014 and it sets truncated:true rather than presenting a partial inventory as the whole one. `analyze --read-only` returns API-only generation context as JSON (identity, access probes, CMS permissions and selected redacted Velo source); it needs no URL/browser and never uploads or applies anything. `analyze` reads a site into a business-book folder (REST + Playwright, GET-only); `--url` alone is the visitor-only pass over the published pages, and `--client-id` adds the vertical probes and the app binding `--apply` requires; `site function` list/get/put/publish/invokes that site's Velo HTTP functions and is not `himi functions` (serve-plane jobs). `--apply` bakes into a brandable shell (a site shell needs no `--client-id`: it is visitor-only and binds no client); `--shell` takes the same names `himi dist --shell` does and defaults to branded-lite, and a shell that ships no prepare:customer is refused by name rather than half-built. `--shell brandy` (the site shell, RFC 0062) also derives the site's page map from its published pages and header menu \u2014 Home first, up to four tabs for the pages a visitor returns to, the rest in the drawer \u2014 into the overlay's `site` block, so it can be edited before `--apply`; only a site shell ever receives that block. It never overwrites any shell's committed apps/<shell>/provisioning.json.", required: "create <name> [--type wix|headless|branded-app|vibe] [--template <guid>] [--verticals stores,bookings,\u2026] [--folder <guid>] [--redirect-uri <uri>] [--no-oauth-app] [--write-provisioning [path]] [--site-url <url>] [--json] --yes | list | client ensure|list --site <msid> [--name <name>] [--redirect-uri <uri>] [--new] [--write-provisioning [path]] [--site-url <url>] [--json] --yes | analyze --read-only [--site <msid>] [--client-id <id>] [--json] | analyze --url <https> [--client-id <id>] [--site <msid>] [--out <dir>] [--redirect-uri <uri>] [--apply] [--shell " + SHELL_ENUM + "] | function list|get|put|publish|invoke [--site <msid>] [--url <https>] [--method GET|POST|PUT|DELETE] [--source <file>] [--body <json>] [--publish] [--invoke]" },
162767
- { name: "base44", summary: "read a BASE44 app into an app book (book.json + BOOK.md) for the agent building a Himi app from it \u2014 the Base44 counterpart of `site analyze`, READ-ONLY. `analyze --url <published app>` is the VISITOR pass: the app id, name, favicon and colours from the published SPA, its router paths, and screenshots + look tokens from the Playwright crawl. `analyze --app-id <id>` adds the OWNER pass and needs a session: the project source under <out>/source/ (the read half of `base44 eject` \u2014 GET api/apps/<id>/eject \u2014 through the same deny-list and secret scan `himi push` uses, widened by the book's token shapes; `eject` itself is never run because it CREATES a copy of the app), every entity's JSON schema, required fields and RLS rules with up to --sample redacted rows (default 5, 0 = off), backend functions, agents, connectors (names and scopes only, never tokens), secret NAMES (never values), auth visibility + providers, and the route \u2192 component \u2192 entities map from the source router. Every chapter it could not read is listed in `gaps` rather than failing the run. `login` runs Base44's device sign-in and stores the session in ~/.himi/base44/session.json (never the repo; --from-base44-cli imports `npx base44 login`'s session instead); BASE44_ACCESS_TOKEN in the environment wins, for CI. `whoami` prints who is signed in (never the token); `logout` removes the stored session. --json prints the book itself. himi docs base44-app-context", required: "analyze (--url <https://\u2026> | --app-id <id>) [--out .himi/base44-book] [--sample <n>] [--json] | login [--from-base44-cli] | whoami | logout" },
163328
+ { name: "base44", summary: "read a BASE44 app into an app book (book.json + BOOK.md) for the agent building a Himi app from it \u2014 the Base44 counterpart of `site analyze`, READ-ONLY. `analyze --url <published app>` is the VISITOR pass: the app id, name, favicon and colours from the published SPA, its router paths, and screenshots + look tokens from the Playwright crawl. `analyze --app-id <id>` adds the OWNER pass and needs a session: the project source under <out>/source/ (the read half of `base44 eject` \u2014 GET api/apps/<id>/eject \u2014 through the same deny-list and secret scan `himi push` uses, widened by the book's token shapes; `eject` itself is never run because it CREATES a copy of the app), every entity's JSON schema, required fields and RLS rules with up to --sample redacted rows (default 5, 0 = off), backend functions, agents, connectors (names and scopes only, never tokens), secret NAMES (never values), auth visibility + providers, and the route \u2192 component \u2192 entities map from the source router. Every chapter it could not read is listed in `gaps` rather than failing the run. `login` runs Base44's device sign-in and stores the session in ~/.himi/base44/session.json (never the repo; --from-base44-cli imports `npx base44 login`'s session instead); BASE44_ACCESS_TOKEN in the environment wins, for CI. `whoami` prints who is signed in (never the token); `logout` removes the stored session. `auth-check --url <tenant> --ios-app-id <PREFIX.bundle.id>` and/or `--android-package <package> --android-sha256 <fingerprint>` checks public native-login associations and prints missing entries; it never reads an owner token. --json prints the book itself. himi docs base44-app-context", required: "analyze (--url <https://\u2026> | --app-id <id>) [--out .himi/base44-book] [--sample <n>] [--json] | login [--from-base44-cli] | whoami | logout | auth-check --url <https://tenant> [--ios-app-id <PREFIX.bundle.id>] [--android-package <package> --android-sha256 <fingerprint>]" },
162768
163329
  { name: "doctor", summary: 'off-VPN preflight in one shot: probe the PUBLIC data plane (www.wixapis.com \u2014 reachable off-VPN), the INTERNAL serve/control plane for the selected target (VPN-gated), and report auth state (dpx session on disk + stored control token). --dpx additionally runs a live, EADDRINUSE-safe `dpx whoami`. Machine-readable with --json (an unreachable internal plane carries a stable code:"needs_vpn" so an agent branches on the code, not the prose); human-readable otherwise. Never loads the authoring runtime \u2014 works off-repo.', required: "[--target <t>] [--dpx] [--json] [--data-url <url>] [--timeout <ms>]" },
162769
163330
  { name: "upgrade", summary: "install the newest published CLI (`npm i -g @wix/himalaya-cli@latest`) and report what moved. This is the explicit door: himi also updates itself when the running build is more than a week old \u2014 unattended it just does it and re-runs your command, at a terminal it asks first \u2014 and `HIMI_NO_UPDATE_CHECK=1` turns that off, leaving this command as the way to catch up. Reports `unchanged` rather than claiming success when npm exits 0 without moving the version, which is what a registry mirror serving its own pinned copy looks like.", required: "[--json]" },
162770
163331
  { name: "push", summary: "lint + build + publish a release (default --draft: servable via ?release= but NOT live). REFUSES to publish on any error unless --force; --strict promotes warnings. Prints preview + agent-context links. A successful draft push also rebuilds the making-of (.himi/making-of.html, local and offline) and names it as `reel` \u2014 the file to hand the owner beside the preview link. Its postcard carries the home shot only when that shot is newer than the last source edit; a repeat draft's postcard adds what changed since the last one (\"Since the last draft: the home screen changed.\", from the release manifests' screen hashes, remembered in .himi/last-draft.json); otherwise the postcard says why and names `himi render <home> --png`, and the envelope's `postcardPicture: {skipped, render}` leads next[] with that render (the push never renders it itself). The published slug is NAMESPACED per owner \u2014 `<ownerPrefix>.<name>`, composed offline from the control token's ownerPrefix claim, so the CLI and the server derive the identical string and himalaya.content.json is NOT rewritten (a legacy token with no ownerPrefix publishes the declared name unchanged). An app claimed BEFORE namespacing is stored under its FLAT slug, so the claim route answers `alreadyYours` naming that slug and the push adopts it \u2014 reported as `adoptedSlug`, since it is the one case where the published `app` differs from what the declared name composes to. `--no-claim` skips the route that knows this, so a pre-namespacing app pushed with it still fails 403. --visibility public|unlisted decides whether /v1/apps + the Himi Player picker LIST the app (also declarable as `visibility` in himalaya.content.json; omitted, a brand-new app defaults to unlisted \u2014 share by link \u2014 and an existing setting is kept). --account-id names which account owns the app when your Wix session resolves to several (the auto-claim of a brand-new slug cannot guess \u2014 without it a multi-account caller is told to name one). An unforced push of a release that carries SCREENS also refuses when `.himi/ux-audit.json` holds no mobile-UX drive recorded against that release id, or holds one that FAILED (#2955) \u2014 a published draft IS the owner-private preview a customer is handed; `himi ux record` clears it and `--force` overrides it, which the success envelope then says out loud. `--only <selector>` publishes ONLY the named items as a release derived from the app's live release (or `--from-release <id>`), running the identical build + lint gate and simply publishing less; it requires an explicit `--draft` or `--live` because a partial publish has no safe default, never claims a slug, and carries neither attestation nor a source archive (both named in the output). Selectors are comma-separated in ONE `--only`: `changed` (every item whose bytes differ from the base), `screen:<id|glob>`, `bundle:<name>`, `tokens`, `app-config` \u2014 a selected screen drags its logic bundle and a selected bundle drags the screens that reference it, or the bytes land under a key nothing reads.", required: "[--content <dir>] [--draft] [--live] [--force] [--strict] [--label] [--notes] [--visibility public|unlisted] [--no-claim] [--account-id <id>] [--only <selector>] [--from-release <id>] [--accept-regressions] [--accept-partial] [--app <slug>] (--control-token)" },
@@ -164877,6 +165438,16 @@ himi v${cliVersion()} \u2014 run \`himi --version\`. If authoring commands fail
164877
165438
  const template = str9(flags.template);
164878
165439
  const parentDir = resolve56(str9(flags.dir) ?? process.cwd());
164879
165440
  const base44AppId = flags["base44-app-id"] === void 0 ? void 0 : String(flags["base44-app-id"]);
165441
+ const base44AppUrl = flags["base44-app-url"] === void 0 ? void 0 : String(flags["base44-app-url"]);
165442
+ if (base44AppUrl !== void 0) {
165443
+ try {
165444
+ if (base44AppId === void 0) throw new Error("--base44-app-url needs --base44-app-id");
165445
+ base44TenantUrl(base44AppUrl);
165446
+ } catch (e2) {
165447
+ io2.error(JSON.stringify({ ok: false, code: "invalid_base44_app_url", error: e2 instanceof Error ? e2.message : String(e2) }));
165448
+ return 2;
165449
+ }
165450
+ }
164880
165451
  if (base44AppId !== void 0) {
164881
165452
  if (!BASE44_APP_ID_RE.test(base44AppId)) {
164882
165453
  io2.error(JSON.stringify({ error: `--base44-app-id "${base44AppId}" is not a Base44 app id (8\u201364 letters and digits)`, hint: "it is the id in your app's URL: https://app.base44.com/apps/<id>" }));
@@ -164893,8 +165464,8 @@ himi v${cliVersion()} \u2014 run \`himi --version\`. If authoring commands fail
164893
165464
  }
164894
165465
  const base44Applied = (dir) => {
164895
165466
  if (base44AppId === void 0) return {};
164896
- if (!applyBase44AppId(dir, base44AppId)) throw new Error(`--base44-app-id: ${dir}/config.ts lost its Base44 app id placeholder`);
164897
- return { base44: { appId: base44AppId } };
165467
+ if (!applyBase44AppId(dir, base44AppId, base44AppUrl)) throw new Error(`--base44-app-id: ${dir}/config.ts lost its Base44 app id placeholder`);
165468
+ return { base44: { appId: base44AppId, ...base44AppUrl ? { tenantUrl: base44TenantUrl(base44AppUrl).origin, callbackHost: base44TenantUrl(base44AppUrl).hostname } : {} } };
164898
165469
  };
164899
165470
  const withAgentFiles = async (dir) => {
164900
165471
  const seeded = await seedAgentFilesFor(dir, flags);
@@ -170377,6 +170948,19 @@ ${report3.ok ? "OK \u2014 data + serve plane reachable." : typeof report3.hint =
170377
170948
  return report3.ok ? 0 : 1;
170378
170949
  }
170379
170950
  case "base44": {
170951
+ if (pos[1] === "auth-check") {
170952
+ const { checkBase44NativeAuth: checkBase44NativeAuth2 } = await Promise.resolve().then(() => (init_base44_auth_check(), base44_auth_check_exports));
170953
+ try {
170954
+ const url = str9(flags.url);
170955
+ if (!url) throw new Error("auth-check needs --url <https://tenant>");
170956
+ const result = await checkBase44NativeAuth2({ url, iosAppId: str9(flags["ios-app-id"]), androidPackage: str9(flags["android-package"]), androidSha256: str9(flags["android-sha256"]) });
170957
+ print(result);
170958
+ return result.ok ? 0 : 1;
170959
+ } catch (e2) {
170960
+ io2.error(JSON.stringify({ ok: false, code: "invalid_base44_auth_check", error: e2 instanceof Error ? e2.message : String(e2) }));
170961
+ return 2;
170962
+ }
170963
+ }
170380
170964
  const sub = pos[1];
170381
170965
  const b44Usage = "himi base44 analyze (--url <https://\u2026> | --app-id <id>) [--out .himi/base44-book] [--sample <n>] [--json] | himi base44 login [--from-base44-cli] | himi base44 whoami | himi base44 logout";
170382
170966
  const auth = await Promise.resolve().then(() => (init_base44_auth(), base44_auth_exports));