@pygmalionjs/pygmalion 0.5.23 → 0.5.26

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.
@@ -1,9 +1,9 @@
1
1
  var yh = Object.defineProperty;
2
2
  var vh = (e, t, n) => t in e ? yh(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var gn = (e, t, n) => vh(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { jsx as s, jsxs as g, Fragment as qe } from "react/jsx-runtime";
5
- import { R as si, u as wh, c as Ea, b as ud, g as lt, d as Sh, m as Dt, e as f, f as Tt, r as cn, h as Ps, i as Yn, j as ka, k as wn, l as fd, n as wr, p as Nh, o as pr, q as ze, t as Ih, v as Ch, w as Ph, x as $h, y as Mh, z as Eh, A as kh, B as $s, C as Ah, D as Rh, E as Th, G as Fh, H as Lh, I as _h, S as Dh, J as zh, K as hd, L as Oh, M as Ms, O as Bh, P as jh, Q as Wh, T as Hh, U as pd, V as Uh, W as Oc, X as Vh, Y as md, Z as Kh, _ as qh, $ as Yh, a0 as Gh, a1 as Xh, a2 as Jh, a3 as gd, a4 as Qh, a5 as Zh, a6 as J, a7 as Bc, a8 as jc, a9 as ep, aa as os, ab as tp, ac as qo, ad as Es, ae as np, af as bd, ag as rp, ah as op, ai as ip, s as sp, aj as ir, ak as xd, al as yd, am as ks, an as vd, ao as ap, ap as cp, aq as Wc, ar as lp, as as dp, at as Hc, au as up, av as fp, aw as hp, ax as pp, ay as mp, az as gp, aA as bp, aB as xp, aC as yp, aD as vp, aE as wp, aF as Sp, a as Np, aG as Ip, aH as Cp, aI as Pp, aJ as $p, aK as Mp, aL as Ep, aM as kp, aN as Ap, aO as Rp, aP as Tp, aQ as Fp, aR as Lp, aS as Uc, aT as _p, aU as Dp, aV as zp, aW as Op, aX as Vc } from "./FrozenRoutePreview-Dh_-9mqN.js";
6
- import { aY as c1, aZ as l1, a_ as d1, a$ as u1, b0 as f1, b1 as h1, b2 as p1, b3 as m1, b4 as g1, b5 as b1, b6 as x1, b7 as y1, b8 as v1, b9 as w1, ba as S1, bb as N1 } from "./FrozenRoutePreview-Dh_-9mqN.js";
4
+ import { jsx as s, jsxs as g, Fragment as Ye } from "react/jsx-runtime";
5
+ import { R as si, u as wh, c as Ea, b as ud, g as lt, d as Sh, m as Dt, e as f, f as Tt, r as cn, h as Ps, i as Yn, j as ka, k as wn, l as fd, n as wr, p as Nh, o as pr, q as Be, t as Ih, v as Ch, w as Ph, x as $h, y as Mh, z as Eh, A as kh, B as $s, C as Ah, D as Rh, E as Th, G as Fh, H as Lh, I as _h, S as Dh, J as zh, K as hd, L as Oh, M as Ms, O as Bh, P as jh, Q as Wh, T as Hh, U as pd, V as Uh, W as Oc, X as Vh, Y as md, Z as Kh, _ as qh, $ as Yh, a0 as Gh, a1 as Xh, a2 as Jh, a3 as gd, a4 as Qh, a5 as Zh, a6 as J, a7 as Bc, a8 as jc, a9 as ep, aa as os, ab as tp, ac as qo, ad as Es, ae as np, af as bd, ag as rp, ah as op, ai as ip, s as sp, aj as ir, ak as xd, al as yd, am as ks, an as vd, ao as ap, ap as cp, aq as Wc, ar as lp, as as dp, at as Hc, au as up, av as fp, aw as hp, ax as pp, ay as mp, az as gp, aA as bp, aB as xp, aC as yp, aD as vp, aE as wp, aF as Sp, a as Np, aG as Ip, aH as Cp, aI as Pp, aJ as $p, aK as Mp, aL as Ep, aM as kp, aN as Ap, aO as Rp, aP as Tp, aQ as Fp, aR as Lp, aS as Uc, aT as _p, aU as Dp, aV as zp, aW as Op, aX as Vc } from "./FrozenRoutePreview-Df_DH4UK.js";
6
+ import { aY as a1, aZ as c1, a_ as l1, a$ as d1, b0 as u1, b1 as f1, b2 as h1, b3 as p1, b4 as m1, b5 as g1, b6 as b1, b7 as x1, b8 as y1, b9 as v1, ba as w1, bb as S1 } from "./FrozenRoutePreview-Df_DH4UK.js";
7
7
  import { useRef as Pe, useLayoutEffect as ai, useSyncExternalStore as Xe, useCallback as Pt, useReducer as wd, useEffect as ae, memo as Sd, createElement as ao, useState as Q, useMemo as _t } from "react";
8
8
  import { createPortal as Bp } from "react-dom";
9
9
  const Aa = {
@@ -572,7 +572,7 @@ function _i(e) {
572
572
  c.has(l) || t.push(`Screenshot asset "${l}" is unreferenced.`);
573
573
  return { valid: t.length === 0, errors: t, bytes: n };
574
574
  }
575
- function T0(e, t) {
575
+ function R0(e, t) {
576
576
  var o;
577
577
  const n = _i(e);
578
578
  if (!n.valid)
@@ -585,7 +585,7 @@ function T0(e, t) {
585
585
  t
586
586
  ) : null;
587
587
  }
588
- function F0(e, t) {
588
+ function T0(e, t) {
589
589
  var a;
590
590
  const n = _i(e);
591
591
  if (!n.valid)
@@ -2097,7 +2097,7 @@ function ng(e, t) {
2097
2097
  );
2098
2098
  Xn.get(e) !== t && (Xn.set(e, t), tc());
2099
2099
  }
2100
- function L0() {
2100
+ function F0() {
2101
2101
  Xn.size && (Xn.clear(), tc());
2102
2102
  }
2103
2103
  function rg() {
@@ -2660,14 +2660,14 @@ function ji(e = {}) {
2660
2660
  }
2661
2661
  async function k(R, T) {
2662
2662
  if (e.prepare) return e.prepare(R, T);
2663
- const { getDesignImportController: I } = await import("./FrozenRoutePreview-Dh_-9mqN.js").then((F) => F.bd), N = I();
2663
+ const { getDesignImportController: I } = await import("./FrozenRoutePreview-Df_DH4UK.js").then((F) => F.bd), N = I();
2664
2664
  if (!N)
2665
2665
  throw new Error("The design import controller is not available.");
2666
2666
  return N.prepareScreenCapture(R, T);
2667
2667
  }
2668
2668
  async function L(R, T) {
2669
2669
  if (e.settle) return e.settle(R, T);
2670
- const { settleScreen: I } = await import("./FrozenRoutePreview-Dh_-9mqN.js").then((N) => N.bc);
2670
+ const { settleScreen: I } = await import("./FrozenRoutePreview-Df_DH4UK.js").then((N) => N.bc);
2671
2671
  return I(R, T);
2672
2672
  }
2673
2673
  async function W(R, T) {
@@ -3274,7 +3274,7 @@ function qg(e) {
3274
3274
  () => !1
3275
3275
  );
3276
3276
  }
3277
- const Yg = ze(function({
3277
+ const Yg = Be(function({
3278
3278
  page: t,
3279
3279
  active: n,
3280
3280
  onLabelDown: r
@@ -3335,7 +3335,7 @@ const Yg = ze(function({
3335
3335
  children: a.code ?? a.title
3336
3336
  }
3337
3337
  ),
3338
- !d && /* @__PURE__ */ g(qe, { children: [
3338
+ !d && /* @__PURE__ */ g(Ye, { children: [
3339
3339
  /* @__PURE__ */ g(
3340
3340
  "span",
3341
3341
  {
@@ -3726,7 +3726,7 @@ function wi(e, t, n) {
3726
3726
  }
3727
3727
  );
3728
3728
  }
3729
- function _0({
3729
+ function L0({
3730
3730
  sourceRevision: e,
3731
3731
  recipes: t,
3732
3732
  recipeVersion: n,
@@ -4058,7 +4058,7 @@ function Mb(e) {
4058
4058
  t.has(r) && n.add(r), t.add(r);
4059
4059
  return [...n];
4060
4060
  }
4061
- function D0(e, t) {
4061
+ function _0(e, t) {
4062
4062
  var a;
4063
4063
  const n = [], r = new Map(e.map((c) => [c.id, c])), o = /* @__PURE__ */ new Map();
4064
4064
  for (const c of e)
@@ -4133,7 +4133,7 @@ function kb(e, t) {
4133
4133
  const n = e.split("/"), r = t.split("/");
4134
4134
  return n.length !== r.length ? !1 : n.every((o, i) => o.startsWith(":") || o === "*" ? r[i].length > 0 : o === r[i]);
4135
4135
  }
4136
- function z0(e) {
4136
+ function D0(e) {
4137
4137
  const t = e.declaredScreens.map((o) => o.route).filter((o) => typeof o == "string").map(cl), n = /* @__PURE__ */ new Set(), r = [];
4138
4138
  for (const o of e.routes) {
4139
4139
  const i = o.path ?? o.id;
@@ -4492,7 +4492,7 @@ function Ur({ node: e }) {
4492
4492
  };
4493
4493
  window.addEventListener("mousemove", u), window.addEventListener("mouseup", p);
4494
4494
  };
4495
- return /* @__PURE__ */ g(qe, { children: [
4495
+ return /* @__PURE__ */ g(Ye, { children: [
4496
4496
  Xb.map((n) => /* @__PURE__ */ s(
4497
4497
  "span",
4498
4498
  {
@@ -4551,7 +4551,7 @@ function Vr({ node: e }) {
4551
4551
  }
4552
4552
  );
4553
4553
  }
4554
- const Kr = ze(function({ count: t }) {
4554
+ const Kr = Be(function({ count: t }) {
4555
4555
  return f.showRenderCount ? /* @__PURE__ */ s(
4556
4556
  "span",
4557
4557
  {
@@ -4708,7 +4708,13 @@ const ul = /* @__PURE__ */ new WeakMap(), fl = Sd(function e({ node: t }) {
4708
4708
  // Even if the background shorthand of the computed DOM remains, the editor fill
4709
4709
  // Cover the shorthand itself so that it becomes the final paint.
4710
4710
  ...t.fill ? { background: t.fill, backgroundColor: t.fill } : {},
4711
- ...t.radius ? { borderRadius: t.radius } : {},
4711
+ // `radius` is one number, so applying it over a captured style would round
4712
+ // corners the capture had deliberately flattened — a bar that shares its
4713
+ // bottom edge with the input below it came back with the seam visible.
4714
+ // The captured corners win when there are any. (The lightweight renderer
4715
+ // holds the same rule; both draw imported frames, so a guard in one of
4716
+ // them only fixes the frames the other does not draw.)
4717
+ ...t.radius && t.domStyle.borderTopLeftRadius == null ? { borderRadius: t.radius } : {},
4712
4718
  ...t.locked ? { pointerEvents: "none" } : {}
4713
4719
  }, m = { ...t.domAttributes };
4714
4720
  for (const x of ["disabled", "checked", "selected", "multiple", "readOnly", "required", "autofocus"])
@@ -4821,7 +4827,11 @@ function ei(e, t = !1) {
4821
4827
  ...e.domStyle.position === "fixed" ? { position: "absolute" } : {},
4822
4828
  opacity: e.opacity,
4823
4829
  ...e.fill ? { background: e.fill, backgroundColor: e.fill } : {},
4824
- ...e.radius ? { borderRadius: e.radius } : {},
4830
+ // `radius` is one number, so applying it over a captured style would round
4831
+ // corners the capture had deliberately flattened — a bar that shares its
4832
+ // bottom edge with the input below it came back with the seam visible.
4833
+ // The captured corners win when there are any.
4834
+ ...e.radius && e.domStyle.borderTopLeftRadius == null ? { borderRadius: e.radius } : {},
4825
4835
  ...t ? { pointerEvents: "none" } : {}
4826
4836
  }, i = Ku.has(e.domTag) ? void 0 : e.children.map((a) => ei(a));
4827
4837
  return ao(
@@ -4852,7 +4862,7 @@ function ei(e, t = !1) {
4852
4862
  e.id
4853
4863
  );
4854
4864
  }
4855
- const hl = ze(function({
4865
+ const hl = Be(function({
4856
4866
  root: t
4857
4867
  }) {
4858
4868
  return ei(t, !0);
@@ -5004,7 +5014,7 @@ function sf() {
5004
5014
  }
5005
5015
  return e;
5006
5016
  }
5007
- const rx = ze(function({
5017
+ const rx = Be(function({
5008
5018
  def: t,
5009
5019
  name: n
5010
5020
  }) {
@@ -5128,7 +5138,7 @@ const rx = ze(function({
5128
5138
  ]
5129
5139
  }
5130
5140
  );
5131
- }), ox = ze(function({
5141
+ }), ox = Be(function({
5132
5142
  section: t,
5133
5143
  origin: n
5134
5144
  }) {
@@ -5136,7 +5146,7 @@ const rx = ze(function({
5136
5146
  const r = f.canvasPages.filter(
5137
5147
  (a) => a.section === t && f.isScreenStateShown(a)
5138
5148
  ), o = hd(t, r), i = Ms;
5139
- return /* @__PURE__ */ s(qe, { children: o.map((a) => {
5149
+ return /* @__PURE__ */ s(Ye, { children: o.map((a) => {
5140
5150
  const c = Oh(t, a.laneId);
5141
5151
  if (!c) return null;
5142
5152
  const l = a.frames.filter(
@@ -5202,7 +5212,7 @@ const rx = ze(function({
5202
5212
  a.laneId
5203
5213
  );
5204
5214
  }) });
5205
- }), ix = ze(function() {
5215
+ }), ix = Be(function() {
5206
5216
  const t = f.sectionRenameTarget, n = (i, a) => {
5207
5217
  f.renameSection(f.activeCanvas, i, a), f.setSectionRenameTarget(null);
5208
5218
  }, r = (i, a) => (c) => {
@@ -5247,7 +5257,7 @@ const rx = ze(function({
5247
5257
  };
5248
5258
  window.addEventListener("mousemove", x), window.addEventListener("mouseup", w);
5249
5259
  };
5250
- return /* @__PURE__ */ s(qe, { children: [...sf().entries()].map(([i, a]) => {
5260
+ return /* @__PURE__ */ s(Ye, { children: [...sf().entries()].map(([i, a]) => {
5251
5261
  var u;
5252
5262
  const c = nx(a, of(i)), l = Bh(i), d = ((u = f.selectedCanvasObject) == null ? void 0 : u.kind) === "section" && f.selectedCanvasObject.name === i;
5253
5263
  return /* @__PURE__ */ g(
@@ -5958,7 +5968,7 @@ async function vx(e, t) {
5958
5968
  });
5959
5969
  return Oo.set(r, i), i;
5960
5970
  }
5961
- const wx = ze(function({
5971
+ const wx = Be(function({
5962
5972
  page: t,
5963
5973
  snapshot: n,
5964
5974
  artifact: r,
@@ -6252,7 +6262,7 @@ function Ax(e, t) {
6252
6262
  }
6253
6263
  }, [t, e]);
6254
6264
  }
6255
- const Rx = ze(function({
6265
+ const Rx = Be(function({
6256
6266
  page: t,
6257
6267
  active: n,
6258
6268
  selected: r,
@@ -6344,7 +6354,7 @@ const Rx = ze(function({
6344
6354
  }, [t.layersImported, t.id]);
6345
6355
  const [Me, ue] = Q(!1), K = n || r || P || st || Me, Ie = Px(t.id, K), ve = $x(t.id);
6346
6356
  Ax(t.id, Ie);
6347
- const [V, Ne] = Q(null), [re, U] = Q(0), [oe, ne] = Q([]), We = Le ?? (A && !M ? nn(ee) : null), Oe = M != null || We != null || ($ == null ? void 0 : $.screenshot) != null, le = n, Ge = a && Jd({
6357
+ const [V, Ne] = Q(null), [re, U] = Q(0), [oe, ne] = Q([]), We = Le ?? (A && !M ? nn(ee) : null), ze = M != null || We != null || ($ == null ? void 0 : $.screenshot) != null, le = n, Ge = a && Jd({
6348
6358
  detailActive: le,
6349
6359
  previewIntended: P
6350
6360
  }), He = _t(() => !r || t.route == null || !t.layersImported ? null : Ae === ee && We != null ? We : nn(Ae) ?? We, [
@@ -6355,7 +6365,7 @@ const Rx = ze(function({
6355
6365
  t.route,
6356
6366
  ee,
6357
6367
  r
6358
- ]), Be = gg(
6368
+ ]), Oe = gg(
6359
6369
  He != null,
6360
6370
  bg({
6361
6371
  resizeDraftActive: S != null,
@@ -6453,7 +6463,7 @@ const Rx = ze(function({
6453
6463
  );
6454
6464
  }, [A, a, ee]), ae(() => {
6455
6465
  var Ce, ke;
6456
- if (!A || t.route == null || t.layersImported || Oe || V || !Ge)
6466
+ if (!A || t.route == null || t.layersImported || ze || V || !Ge)
6457
6467
  return;
6458
6468
  let Y = !0, ge = null;
6459
6469
  const ye = (we) => {
@@ -6516,7 +6526,7 @@ const Rx = ze(function({
6516
6526
  re,
6517
6527
  ee,
6518
6528
  $e,
6519
- Oe,
6529
+ ze,
6520
6530
  Ge
6521
6531
  ]), ae(() => {
6522
6532
  const Y = We != null && go(ee);
@@ -6574,7 +6584,7 @@ const Rx = ze(function({
6574
6584
  // here regardless was the bypass that let a live boot — against a dead
6575
6585
  // backend, a cold dev server — deliver the import a healthy capture
6576
6586
  // already covered.
6577
- Ke || t.route == null || t.layersImported || !Oe || V)
6587
+ Ke || t.route == null || t.layersImported || !ze || V)
6578
6588
  return;
6579
6589
  let Y = !0;
6580
6590
  const ge = `detail:${$e}`;
@@ -6601,14 +6611,14 @@ const Rx = ze(function({
6601
6611
  le,
6602
6612
  A,
6603
6613
  Ke,
6604
- Oe,
6614
+ ze,
6605
6615
  t.importLayers,
6606
6616
  t.layersImported,
6607
6617
  t.route,
6608
6618
  V,
6609
6619
  $e
6610
6620
  ]), ae(() => {
6611
- !G || !A || t.route == null || t.layersImported || Oe || V || gi(
6621
+ !G || !A || t.route == null || t.layersImported || ze || V || gi(
6612
6622
  ee,
6613
6623
  -1e3,
6614
6624
  async () => null,
@@ -6623,7 +6633,7 @@ const Rx = ze(function({
6623
6633
  V,
6624
6634
  ee,
6625
6635
  $e,
6626
- Oe
6636
+ ze
6627
6637
  ]);
6628
6638
  const sn = c.trim().length > 0, z = sn && ac(t, { detailActive: le }) ? sc({
6629
6639
  origin: c,
@@ -6778,11 +6788,11 @@ const Rx = ze(function({
6778
6788
  }), j(null);
6779
6789
  };
6780
6790
  window.addEventListener("mousemove", rt), window.addEventListener("mouseup", Zt);
6781
- }, nt = t.frameSizeMode === "content" || le || G && Ie !== "detached", Ye = Od({
6791
+ }, nt = t.frameSizeMode === "content" || le || G && Ie !== "detached", qe = Od({
6782
6792
  hasRoute: t.route != null,
6783
6793
  layersImported: !!t.layersImported,
6784
6794
  cacheHydrated: A,
6785
- hasSnapshot: Oe,
6795
+ hasSnapshot: ze,
6786
6796
  // A grant only counts while there is somewhere to run. Without a live origin
6787
6797
  // the frame stayed "live" — so it never fell back to the capture it already
6788
6798
  // had, and showed "reproducing" forever in front of its own snapshot.
@@ -6791,7 +6801,7 @@ const Rx = ze(function({
6791
6801
  t.id
6792
6802
  ), Nt = !t.layersImported || Rr != null, at = (
6793
6803
  // No live origin means no prepared checkout — see liveOriginReady.
6794
- sn && a && (zt || Ye === "live" || Me || (le && !Ke || // Hover intent while the artifact cache is still hydrating — or a
6804
+ sn && a && (zt || qe === "live" || Me || (le && !Ke || // Hover intent while the artifact cache is still hydrating — or a
6795
6805
  // flow session owes this screen — must not warm-boot the app: the
6796
6806
  // capture that makes the boot unnecessary may simply not have
6797
6807
  // arrived yet. Intent prepares the frozen mount.
@@ -6805,7 +6815,7 @@ const Rx = ze(function({
6805
6815
  // so its live producer boots offscreen.
6806
6816
  active: (le || P) && Rr == null,
6807
6817
  live: at
6808
- }), fn = !o && Oe && // A live slot only outranks the capture while live can actually run. The
6818
+ }), fn = !o && ze && // A live slot only outranks the capture while live can actually run. The
6809
6819
  // frame the designer works in claims a slot as soon as it is active, so
6810
6820
  // before a checkout exists that claim suppressed the static surface and the
6811
6821
  // live route could not render either — the frame sat empty in front of the
@@ -6819,7 +6829,7 @@ const Rx = ze(function({
6819
6829
  // that arrived without the hover mounts it here and promotes on mount.
6820
6830
  preparedForPromotion: P || Ke,
6821
6831
  preferDom: Kh() === "dom"
6822
- }), wo = t.layersImported && f.pageRequiresLiveSharedPreview(t), qi = Oe && f.frozenPreviewMutations().some((Y) => !!Y.staleReason);
6832
+ }), wo = t.layersImported && f.pageRequiresLiveSharedPreview(t), qi = ze && f.frozenPreviewMutations().some((Y) => !!Y.staleReason);
6823
6833
  ae(() => {
6824
6834
  if (t.frameSizeMode !== "content" || !nt)
6825
6835
  return;
@@ -6916,7 +6926,7 @@ const Rx = ze(function({
6916
6926
  },
6917
6927
  `live:${t.id}`
6918
6928
  ) : null;
6919
- return /* @__PURE__ */ g(qe, { children: [
6929
+ return /* @__PURE__ */ g(Ye, { children: [
6920
6930
  /* @__PURE__ */ g(
6921
6931
  "div",
6922
6932
  {
@@ -6925,10 +6935,10 @@ const Rx = ze(function({
6925
6935
  "data-canonical-frame-id": t.importPageId ?? t.id,
6926
6936
  "data-frame-active": n || void 0,
6927
6937
  "data-frame-detail-active": le || void 0,
6928
- "data-preview-state": Ye,
6938
+ "data-preview-state": qe,
6929
6939
  "data-pyg-static-surface": Tr,
6930
6940
  "data-pyg-static-route": String(fn),
6931
- "data-pyg-has-snapshot": String(Oe),
6941
+ "data-pyg-has-snapshot": String(ze),
6932
6942
  "data-pyg-artifact": String(M != null),
6933
6943
  "data-pyg-live-slot": String(!!zt),
6934
6944
  "data-pyg-background-only": String(o),
@@ -6937,12 +6947,12 @@ const Rx = ze(function({
6937
6947
  "data-frame-lod": Ie,
6938
6948
  "data-artifact-status": $ == null ? void 0 : $.status,
6939
6949
  "data-artifact-resolution": Se.status,
6940
- "data-preview-exact": Oe && ($ == null ? void 0 : $.stale) !== !0 ? "true" : "false",
6950
+ "data-preview-exact": ze && ($ == null ? void 0 : $.stale) !== !0 ? "true" : "false",
6941
6951
  "data-live-preview": at || void 0,
6942
6952
  "data-preview-intent": P || void 0,
6943
6953
  "data-preview-stale": oe.length > 0 || qi || ($ == null ? void 0 : $.stale) || void 0,
6944
6954
  "data-responsive-resizing": S != null || void 0,
6945
- "data-responsive-preview": Be || void 0,
6955
+ "data-responsive-preview": Oe || void 0,
6946
6956
  "data-viewport-width": Math.round(T),
6947
6957
  "data-viewport-height": Math.round(I),
6948
6958
  "data-background-preview": o || void 0,
@@ -7087,7 +7097,7 @@ const Rx = ze(function({
7087
7097
  // page imported, and the frame then shows the authored placeholder —
7088
7098
  // one empty div — while a 453KB snapshot of the real screen sits
7089
7099
  // unused beside it. Measured: layerImportCount 1, snapshot present.
7090
- (t.layerImportCount == null || t.layerImportCount > 1) && nt && (le || t.route == null || wo) ? le ? Be && He != null ? /* @__PURE__ */ s(
7100
+ (t.layerImportCount == null || t.layerImportCount > 1) && nt && (le || t.route == null || wo) ? le ? Oe && He != null ? /* @__PURE__ */ s(
7091
7101
  Vh,
7092
7102
  {
7093
7103
  page: t,
@@ -7403,10 +7413,10 @@ ${o.join(`
7403
7413
  Sl = i;
7404
7414
  }
7405
7415
  }
7406
- function O0() {
7416
+ function z0() {
7407
7417
  return [...Er.values()].map(Vi);
7408
7418
  }
7409
- function B0(e) {
7419
+ function O0(e) {
7410
7420
  const t = Er.get(e);
7411
7421
  return t ? Vi(t) : void 0;
7412
7422
  }
@@ -7466,7 +7476,7 @@ function ff() {
7466
7476
  )
7467
7477
  );
7468
7478
  }
7469
- function j0(e, t = {}) {
7479
+ function B0(e, t = {}) {
7470
7480
  const n = Er.get(e);
7471
7481
  if (!n)
7472
7482
  throw new Error(`Unknown component connection "${e}".`);
@@ -7783,12 +7793,12 @@ function Xx(e) {
7783
7793
  function xf() {
7784
7794
  return [...Mi.entries()].map(([e, t]) => ({ name: e, value: t }));
7785
7795
  }
7786
- function W0(e, t) {
7796
+ function j0(e, t) {
7787
7797
  Mi.set(e, t), document.documentElement.style.setProperty(e, t);
7788
7798
  const n = xf();
7789
7799
  qn == null || qn(n), mf(n);
7790
7800
  }
7791
- function H0() {
7801
+ function W0() {
7792
7802
  for (const e of Mi.keys()) document.documentElement.style.removeProperty(e);
7793
7803
  Mi.clear(), qn == null || qn([]), mf([]);
7794
7804
  }
@@ -8258,11 +8268,11 @@ function Tl({
8258
8268
  const re = Pe(n);
8259
8269
  re.current = n;
8260
8270
  const U = J.buildApplyPayload(), oe = JSON.stringify(U), ne = oy(U), We = JSON.stringify(ne);
8261
- function Oe() {
8271
+ function ze() {
8262
8272
  var h;
8263
8273
  (h = ve.current) == null || h.cleanup(), ve.current = null;
8264
8274
  }
8265
- const le = !!e, Ge = le ? ((Fc = e.current) == null ? void 0 : Fc.contentDocument) ?? null : ((Lc = t == null ? void 0 : t.current) == null ? void 0 : Lc.ownerDocument) ?? null, He = (Ge == null ? void 0 : Ge.defaultView) ?? null, Be = _t(() => Ea(lt()), []), Ue = _t(
8275
+ const le = !!e, Ge = le ? ((Fc = e.current) == null ? void 0 : Fc.contentDocument) ?? null : ((Lc = t == null ? void 0 : t.current) == null ? void 0 : Lc.ownerDocument) ?? null, He = (Ge == null ? void 0 : Ge.defaultView) ?? null, Oe = _t(() => Ea(lt()), []), Ue = _t(
8266
8276
  () => Object.entries(lt()).filter(
8267
8277
  ([h, y]) => /^[A-Z][A-Za-z0-9_$]*$/.test(h) && !!y.importPath && Bc(h) != null
8268
8278
  ).sort(([h], [y]) => h.localeCompare(y)),
@@ -8317,18 +8327,18 @@ function Tl({
8317
8327
  y = !0;
8318
8328
  };
8319
8329
  }, [We]), ae(() => K(), [a]), ae(() => {
8320
- Oe(), E(null), L("original"), q("default"), j("item"), F(null), he(""), xe(""), Me(a ? jc(a) ?? 0 : 0);
8330
+ ze(), E(null), L("original"), q("default"), j("item"), F(null), he(""), xe(""), Me(a ? jc(a) ?? 0 : 0);
8321
8331
  }, [a]), ae(() => {
8322
- Oe();
8332
+ ze();
8323
8333
  const h = a != null && a.isConnected ? a : null;
8324
8334
  if (h) {
8325
8335
  if (v == null && k === "original" && W === "default") {
8326
8336
  window.requestAnimationFrame(() => K());
8327
8337
  return;
8328
8338
  }
8329
- return ve.current = fy(h, { repeat: v, text: k, state: W }), K(), () => Oe();
8339
+ return ve.current = fy(h, { repeat: v, text: k, state: W }), K(), () => ze();
8330
8340
  }
8331
- }, [a, v, k, W]), ae(() => () => Oe(), []), ae(() => {
8341
+ }, [a, v, k, W]), ae(() => () => ze(), []), ae(() => {
8332
8342
  const h = [window];
8333
8343
  le && He && He !== window && h.push(He), !le && (t != null && t.current) && h.push(t.current);
8334
8344
  const y = () => K();
@@ -8395,7 +8405,7 @@ function Tl({
8395
8405
  const y = (C = r.current) == null ? void 0 : C.getBoundingClientRect();
8396
8406
  return { left: h.left - ((y == null ? void 0 : y.left) ?? 0), top: h.top - ((y == null ? void 0 : y.top) ?? 0), width: h.width, height: h.height };
8397
8407
  }, dt = (h) => {
8398
- const y = Be(h);
8408
+ const y = Oe(h);
8399
8409
  if (y) return y.name;
8400
8410
  const C = vf(h), H = h.tagName.toLowerCase();
8401
8411
  return C ? `${H}.${C}` : H;
@@ -8465,14 +8475,14 @@ function Tl({
8465
8475
  } catch (D) {
8466
8476
  J.toast(`Apply failed:${String(D).slice(0, 80)}`);
8467
8477
  }
8468
- }, z = a != null && a.isConnected ? a : null, Sn = o != null && o.isConnected ? o : null, pe = z != null && z.parentElement && z.parentElement !== Ve ? z.parentElement : null, St = S === "container" && pe ? pe : z, Z = z ? pt(z.getBoundingClientRect()) : null, X = pe ? pt(pe.getBoundingClientRect()) : null, Jn = S === "container" && St && St !== z ? pt(St.getBoundingClientRect()) : null, vo = Sn && Sn !== z ? pt(Sn.getBoundingClientRect()) : null, nt = z ? He.getComputedStyle(z) : null, Ye = pe ? He.getComputedStyle(pe) : null, Rr = St ? He.getComputedStyle(St) : null, Nt = z ? dt(z) : "", at = z ? Be(z) : null, Qt = z ? ep(z) : null, fn = z ? J.structuralEditKind(z) : null, Tr = z ? J.hasPendingValueEdit(z) : !1, wo = z ? J.structuralBlockReason(z, "insert") : "No elements are selected.", qi = z ? J.structuralBlockReason(z, "remove") : "No elements are selected.", Fr = z ? J.structuralBlockReason(z, "move") : "No elements are selected.", Qn = z && z.parentElement ? Array.from(z.parentElement.children).indexOf(z) : -1, Zn = ((_c = z == null ? void 0 : z.parentElement) == null ? void 0 : _c.children.length) ?? 0, Lr = at ? lt()[at.name] ?? null : null, Y = Qt && /^[A-Z]/.test(Qt.elementName) ? (at == null ? void 0 : at.name) ?? null : null, ge = z ? J.componentInsertBlockReason(z, Y) : "No elements are selected.", ye = _.trim().toLocaleLowerCase(), Re = Ue.filter(
8478
+ }, z = a != null && a.isConnected ? a : null, Sn = o != null && o.isConnected ? o : null, pe = z != null && z.parentElement && z.parentElement !== Ve ? z.parentElement : null, St = S === "container" && pe ? pe : z, Z = z ? pt(z.getBoundingClientRect()) : null, X = pe ? pt(pe.getBoundingClientRect()) : null, Jn = S === "container" && St && St !== z ? pt(St.getBoundingClientRect()) : null, vo = Sn && Sn !== z ? pt(Sn.getBoundingClientRect()) : null, nt = z ? He.getComputedStyle(z) : null, qe = pe ? He.getComputedStyle(pe) : null, Rr = St ? He.getComputedStyle(St) : null, Nt = z ? dt(z) : "", at = z ? Oe(z) : null, Qt = z ? ep(z) : null, fn = z ? J.structuralEditKind(z) : null, Tr = z ? J.hasPendingValueEdit(z) : !1, wo = z ? J.structuralBlockReason(z, "insert") : "No elements are selected.", qi = z ? J.structuralBlockReason(z, "remove") : "No elements are selected.", Fr = z ? J.structuralBlockReason(z, "move") : "No elements are selected.", Qn = z && z.parentElement ? Array.from(z.parentElement.children).indexOf(z) : -1, Zn = ((_c = z == null ? void 0 : z.parentElement) == null ? void 0 : _c.children.length) ?? 0, Lr = at ? lt()[at.name] ?? null : null, Y = Qt && /^[A-Z]/.test(Qt.elementName) ? (at == null ? void 0 : at.name) ?? null : null, ge = z ? J.componentInsertBlockReason(z, Y) : "No elements are selected.", ye = _.trim().toLocaleLowerCase(), Re = Ue.filter(
8469
8479
  ([h, y]) => !ye || h.toLocaleLowerCase().includes(ye) || y.importPath.toLocaleLowerCase().includes(ye)
8470
8480
  ), Ce = Re.find(([h]) => h === te) ?? Re[0] ?? null, ke = (Ce == null ? void 0 : Ce[1]) ?? null, we = Ce ? Bc(Ce[0]) : null, rt = (z ? jc(z) : null) ?? 0, Zt = z ? dy(z, (at == null ? void 0 : at.props) ?? null, Lr) : !1, Mt = z ? uy(z, (at == null ? void 0 : at.props) ?? null, Lr) : [], er = z ? wf(z) : [], Ut = { count: er.length }, mt = Ae && z && Sn && Sn !== z ? [z, Sn] : null, En = J.entries, So = Object.entries((at == null ? void 0 : at.primitiveProps) ?? {}), hn = U, en = En.reduce((h, y) => {
8471
8481
  const C = h.find((H) => H.el === y.el);
8472
8482
  return C ? (C.label = y.label, C.items.push(y)) : h.push({ id: y.id, el: y.el, label: y.label, items: [y] }), h;
8473
8483
  }, []), tr = hn.styles.length + hn.texts.length + hn.operations.length, No = qo() != null, Yi = No && A !== oe, Gf = en.filter(
8474
8484
  (h) => h.items.some((y) => !os(y))
8475
- ).length, Gi = v != null || k !== "original" || W !== "default", _r = Gi && z ? gy(z, He) : null, Qe = py(Ye), nr = Qe != null, Et = my(pe), pn = G === "custom" ? T.minWidth != null || T.maxWidth != null ? {
8485
+ ).length, Gi = v != null || k !== "original" || W !== "default", _r = Gi && z ? gy(z, He) : null, Qe = py(qe), nr = Qe != null, Et = my(pe), pn = G === "custom" ? T.minWidth != null || T.maxWidth != null ? {
8476
8486
  ...T.minWidth != null ? { minWidth: Math.max(0, Math.round(T.minWidth)) } : {},
8477
8487
  ...T.maxWidth != null ? { maxWidth: Math.max(0, Math.round(T.maxWidth)) } : {}
8478
8488
  } : null : ((Dc = El.find((h) => h.id === G)) == null ? void 0 : Dc.media) ?? null, Xi = er.filter((h) => h.isConnected && He.getComputedStyle(h).getPropertyValue("display") !== "none").map((h, y) => ({ el: h, index: y, rect: pt(h.getBoundingClientRect()) })).filter(({ rect: h }) => h.width > 0 && h.height > 0), Ji = Xi.slice().sort((h, y) => h.rect.top - y.rect.top || h.rect.left - y.rect.left).reduce((h, y) => {
@@ -8498,12 +8508,12 @@ function Tl({
8498
8508
  width: Math.max(16, Math.min(h.right, C.right) - Math.max(h.left, C.left)),
8499
8509
  height: Math.max(0, C.top - h.bottom)
8500
8510
  };
8501
- }), mn = Math.max(0, Ot(Ye, "column-gap", Ot(Ye, "gap"))), Dr = Math.max(0, Ot(Ye, "row-gap", Ot(Ye, "gap"))), kt = {
8502
- top: Math.max(0, Ot(Ye, "padding-top")),
8503
- right: Math.max(0, Ot(Ye, "padding-right")),
8504
- bottom: Math.max(0, Ot(Ye, "padding-bottom")),
8505
- left: Math.max(0, Ot(Ye, "padding-left"))
8506
- }, Qf = kt.left, Zf = kt.top, zr = (Ye == null ? void 0 : Ye.getPropertyValue("justify-content")) || "normal", Nc = (Ye == null ? void 0 : Ye.getPropertyValue("align-items")) || "normal", Qi = (Ye == null ? void 0 : Ye.getPropertyValue("flex-direction")) || "row", eh = Rl(Qi.includes("column") ? Nc : zr), th = Rl(Qi.includes("column") ? zr : Nc), nh = jo(
8511
+ }), mn = Math.max(0, Ot(qe, "column-gap", Ot(qe, "gap"))), Dr = Math.max(0, Ot(qe, "row-gap", Ot(qe, "gap"))), kt = {
8512
+ top: Math.max(0, Ot(qe, "padding-top")),
8513
+ right: Math.max(0, Ot(qe, "padding-right")),
8514
+ bottom: Math.max(0, Ot(qe, "padding-bottom")),
8515
+ left: Math.max(0, Ot(qe, "padding-left"))
8516
+ }, Qf = kt.left, Zf = kt.top, zr = (qe == null ? void 0 : qe.getPropertyValue("justify-content")) || "normal", Nc = (qe == null ? void 0 : qe.getPropertyValue("align-items")) || "normal", Qi = (qe == null ? void 0 : qe.getPropertyValue("flex-direction")) || "row", eh = Rl(Qi.includes("column") ? Nc : zr), th = Rl(Qi.includes("column") ? zr : Nc), nh = jo(
8507
8517
  (pe == null ? void 0 : pe.style.getPropertyValue("width")) || (X && X.width >= window.innerWidth * 0.8 ? "100%" : ""),
8508
8518
  (X == null ? void 0 : X.width) ?? 0
8509
8519
  ), rh = jo(
@@ -8524,7 +8534,7 @@ function Tl({
8524
8534
  ), es = Math.max(
8525
8535
  0,
8526
8536
  (Io - mn * Math.max(0, It - 1)) / It
8527
- ), $c = Math.max(80, Math.floor(es)), lh = es < 160, Mc = Qe === "grid" && Et === It, dh = Qe === "scroll" ? `${It} items · horizontal scroll · ${Math.round(Pc)}px cards` : `${It} items · ${ch} rows × ${Co} columns · about ${Math.round(Pc)}px each`, uh = u === "cases" && !m && !!pe && !!X && !!Z, kn = !!pe && pe.scrollWidth > pe.clientWidth + 1 && !["auto", "scroll"].includes((Ye == null ? void 0 : Ye.getPropertyValue("overflow-x")) ?? ""), Ec = [
8537
+ ), $c = Math.max(80, Math.floor(es)), lh = es < 160, Mc = Qe === "grid" && Et === It, dh = Qe === "scroll" ? `${It} items · horizontal scroll · ${Math.round(Pc)}px cards` : `${It} items · ${ch} rows × ${Co} columns · about ${Math.round(Pc)}px each`, uh = u === "cases" && !m && !!pe && !!X && !!Z, kn = !!pe && pe.scrollWidth > pe.clientWidth + 1 && !["auto", "scroll"].includes((qe == null ? void 0 : qe.getPropertyValue("overflow-x")) ?? ""), Ec = [
8528
8538
  v != null ? `${v} items` : null,
8529
8539
  k === "long" ? "long text" : k === "extreme" ? "extreme text" : null,
8530
8540
  W === "selected" ? "selection status" : W === "disabled" ? "inactive" : W === "loading" ? "loading status" : null
@@ -8752,7 +8762,7 @@ function Tl({
8752
8762
  }
8753
8763
  ),
8754
8764
  vo && !l && /* @__PURE__ */ s("div", { style: Ao(vo, "#7cc4f8", !0) }),
8755
- Jn && St && /* @__PURE__ */ g(qe, { children: [
8765
+ Jn && St && /* @__PURE__ */ g(Ye, { children: [
8756
8766
  /* @__PURE__ */ s("div", { style: Ao(Jn, "#9747ff", !0) }),
8757
8767
  /* @__PURE__ */ g(
8758
8768
  "div",
@@ -8766,7 +8776,7 @@ function Tl({
8766
8776
  }
8767
8777
  )
8768
8778
  ] }),
8769
- Z && /* @__PURE__ */ g(qe, { children: [
8779
+ Z && /* @__PURE__ */ g(Ye, { children: [
8770
8780
  /* @__PURE__ */ s("div", { style: Ao(Z, "#0d99ff") }),
8771
8781
  /* @__PURE__ */ s(
8772
8782
  "div",
@@ -8806,7 +8816,7 @@ function Tl({
8806
8816
  C
8807
8817
  ))
8808
8818
  ] }),
8809
- uh && X && /* @__PURE__ */ g(qe, { children: [
8819
+ uh && X && /* @__PURE__ */ g(Ye, { children: [
8810
8820
  /* @__PURE__ */ s("div", { style: Ao(X, kn ? "#f24822" : "#9747ff", !0) }),
8811
8821
  /* @__PURE__ */ g(
8812
8822
  "div",
@@ -9015,7 +9025,7 @@ function Tl({
9015
9025
  )
9016
9026
  ] }, y);
9017
9027
  }),
9018
- Z && /* @__PURE__ */ g(qe, { children: [
9028
+ Z && /* @__PURE__ */ g(Ye, { children: [
9019
9029
  /* @__PURE__ */ s(
9020
9030
  "button",
9021
9031
  {
@@ -9184,7 +9194,7 @@ function Tl({
9184
9194
  ] })
9185
9195
  ] })
9186
9196
  ] }),
9187
- !m && /* @__PURE__ */ s(qe, { children: (!z || !nt) && u !== "source" ? /* @__PURE__ */ g("div", { className: "flex min-h-0 flex-1 flex-col", children: [
9197
+ !m && /* @__PURE__ */ s(Ye, { children: (!z || !nt) && u !== "source" ? /* @__PURE__ */ g("div", { className: "flex min-h-0 flex-1 flex-col", children: [
9188
9198
  /* @__PURE__ */ s("div", { className: "px-4 py-8 text-center text-[12px] leading-relaxed text-[#71717a]", children: "Select an element on the canvas." }),
9189
9199
  en.length > 0 && /* @__PURE__ */ g(
9190
9200
  "button",
@@ -9299,7 +9309,7 @@ function Tl({
9299
9309
  className: `h-7 rounded-md text-[10px] font-semibold ${v === h ? "bg-[#0d99ff] text-white" : "bg-[#f4f4f5] text-[#52525b] hover:bg-[#e9e9ee]"}`,
9300
9310
  onClick: () => {
9301
9311
  if (h == null) {
9302
- Oe(), E(null), K();
9312
+ ze(), E(null), K();
9303
9313
  return;
9304
9314
  }
9305
9315
  Po(h);
@@ -9449,7 +9459,7 @@ function Tl({
9449
9459
  children: nr ? "Applied" : "+ add"
9450
9460
  }
9451
9461
  ) : null,
9452
- children: pe && X ? /* @__PURE__ */ g(qe, { children: [
9462
+ children: pe && X ? /* @__PURE__ */ g(Ye, { children: [
9453
9463
  /* @__PURE__ */ g(
9454
9464
  "button",
9455
9465
  {
@@ -9727,7 +9737,7 @@ function Tl({
9727
9737
  {
9728
9738
  type: "checkbox",
9729
9739
  "aria-label": "Hide excess content",
9730
- checked: (Ye == null ? void 0 : Ye.getPropertyValue("overflow")) === "hidden",
9740
+ checked: (qe == null ? void 0 : qe.getPropertyValue("overflow")) === "hidden",
9731
9741
  className: "h-4 w-4 accent-[#0d99ff]",
9732
9742
  onChange: (h) => Ze("overflow", h.currentTarget.checked ? "hidden" : "visible")
9733
9743
  }
@@ -9737,7 +9747,7 @@ function Tl({
9737
9747
  ] }) : /* @__PURE__ */ s("div", { className: "text-[11px] text-[#a1a1aa]", children: "There is no parent frame." })
9738
9748
  }
9739
9749
  ),
9740
- pe && /* @__PURE__ */ s(qe, { children: /* @__PURE__ */ g(et, { title: "Child · Resizing", children: [
9750
+ pe && /* @__PURE__ */ s(Ye, { children: /* @__PURE__ */ g(et, { title: "Child · Resizing", children: [
9741
9751
  /* @__PURE__ */ s("div", { className: "grid grid-cols-4 gap-1", children: [
9742
9752
  ["auto", "Auto"],
9743
9753
  ["flex-start", "start"],
@@ -9878,7 +9888,7 @@ function Tl({
9878
9888
  type: "button",
9879
9889
  className: "h-9 rounded-md bg-[#f4f4f5] text-[10px] font-semibold text-[#52525b] hover:bg-[#e9e9ee]",
9880
9890
  onClick: () => {
9881
- Oe(), E(null), L("original"), q("default"), K();
9891
+ ze(), E(null), L("original"), q("default"), K();
9882
9892
  },
9883
9893
  children: "Reset case preview"
9884
9894
  }
@@ -9889,7 +9899,7 @@ function Tl({
9889
9899
  type: "button",
9890
9900
  className: "h-9 rounded-md bg-[#18181b] text-[10px] font-semibold text-white hover:bg-black",
9891
9901
  onClick: () => {
9892
- en.length > 0 && !window.confirm("Reset all unapplied editor changes? This also clears undo and redo history.") || (Oe(), E(null), L("original"), q("default"), J.discardPending(), P(null), M(""), Ee(""), J.toast("Reset all unapplied changes"), K());
9902
+ en.length > 0 && !window.confirm("Reset all unapplied editor changes? This also clears undo and redo history.") || (ze(), E(null), L("original"), q("default"), J.discardPending(), P(null), M(""), Ee(""), J.toast("Reset all unapplied changes"), K());
9893
9903
  },
9894
9904
  children: "Reset changes"
9895
9905
  }
@@ -10294,7 +10304,7 @@ function Tl({
10294
10304
  disabled: en.length === 0,
10295
10305
  className: "mt-1.5 h-8 w-full rounded-md border border-[#fecaca] bg-[#fff7f7] text-[10px] font-semibold text-[#b91c1c] hover:bg-[#fef2f2] disabled:border-[#e4e4e7] disabled:bg-[#f4f4f5] disabled:text-[#a1a1aa]",
10296
10306
  onClick: () => {
10297
- window.confirm("Reset all unapplied editor changes? This also clears undo and redo history.") && (Oe(), E(null), L("original"), q("default"), J.discardPending(), P(null), M(""), Ee(""), J.toast("Reset all unapplied changes"));
10307
+ window.confirm("Reset all unapplied editor changes? This also clears undo and redo history.") && (ze(), E(null), L("original"), q("default"), J.discardPending(), P(null), M(""), Ee(""), J.toast("Reset all unapplied changes"));
10298
10308
  },
10299
10309
  children: "Reset changes"
10300
10310
  }
@@ -10642,7 +10652,7 @@ function Fl() {
10642
10652
  )
10643
10653
  ] });
10644
10654
  }
10645
- const by = ze(function({ onClose: t }) {
10655
+ const by = Be(function({ onClose: t }) {
10646
10656
  const n = Xe(ka, wn, wn), r = f.activePage, o = Pe(null), i = Pe(null), [a, c] = Q(!1);
10647
10657
  if (ae(() => J.reset(), []), r.route != null) {
10648
10658
  const l = () => {
@@ -11049,7 +11059,7 @@ function zl({
11049
11059
  }
11050
11060
  );
11051
11061
  }
11052
- const Ay = ze(function() {
11062
+ const Ay = Be(function() {
11053
11063
  const [t, n] = Q(null), [r, o] = Q(""), [i, a] = Q(null), [c, l] = Q(null);
11054
11064
  if (!f.applyOpen) return null;
11055
11065
  const d = f.getPendingSourceChanges(), u = JSON.stringify(d.payload), p = ky(d.payload), m = (i == null ? void 0 : i.fingerprint) === u && i.journalRevision === d.revision, b = xf(), x = op(), w = f.pages.filter(
@@ -11121,7 +11131,7 @@ const Ay = ze(function() {
11121
11131
  }
11122
11132
  }
11123
11133
  };
11124
- return /* @__PURE__ */ g(qe, { children: [
11134
+ return /* @__PURE__ */ g(Ye, { children: [
11125
11135
  /* @__PURE__ */ s("div", { className: "fixed inset-0 z-40 bg-black/30", onMouseDown: () => f.setApplyOpen(!1) }),
11126
11136
  /* @__PURE__ */ g("div", { className: "fixed left-1/2 top-1/2 z-50 flex max-h-[80vh] w-[560px] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-[13px] bg-white shadow-[0_8px_40px_rgba(0,0,0,.25)]", children: [
11127
11137
  /* @__PURE__ */ g("div", { className: "flex items-center justify-between border-b border-[#e6e6e6] px-4 py-3", children: [
@@ -11222,7 +11232,7 @@ const Ay = ze(function() {
11222
11232
  )),
11223
11233
  !E || !k ? /* @__PURE__ */ s("div", { className: "text-[10px] text-amber-600", children: "Connect source preview and apply callbacks to review these changes." }) : null
11224
11234
  ] }),
11225
- m && i ? /* @__PURE__ */ g(qe, { children: [
11235
+ m && i ? /* @__PURE__ */ g(Ye, { children: [
11226
11236
  /* @__PURE__ */ g("div", { className: "mb-3 rounded-md border border-[#d9ecfb] bg-[#f4faff] p-2", children: [
11227
11237
  /* @__PURE__ */ g("div", { className: "mb-1 text-[10px] font-semibold text-[#1677b8]", children: [
11228
11238
  "Reviewed code diff · revision ",
@@ -11659,7 +11669,7 @@ function Xy(e) {
11659
11669
  );
11660
11670
  return t;
11661
11671
  }
11662
- function U0(e, t) {
11672
+ function H0(e, t) {
11663
11673
  return $f(e, t).document;
11664
11674
  }
11665
11675
  function $f(e, t) {
@@ -11805,7 +11815,7 @@ function ev(e) {
11805
11815
  }
11806
11816
  return [...t.values()];
11807
11817
  }
11808
- const tv = ze(function() {
11818
+ const tv = Be(function() {
11809
11819
  var p;
11810
11820
  const [t, n] = Q("jsx-tailwind"), [r, o] = Q(!1);
11811
11821
  if (!f.codeOpen) return null;
@@ -11894,7 +11904,7 @@ const tv = ze(function() {
11894
11904
  )
11895
11905
  ] }) : c.status === "blocked" ? /* @__PURE__ */ s("div", { className: "flex min-h-0 flex-1 items-center justify-center px-6 text-center text-[11px] text-red-300", children: "Resolve the compiler errors before generating code." }) : /* @__PURE__ */ s("pre", { className: "min-h-0 flex-1 overflow-auto px-3 pb-3 text-[11px] leading-relaxed text-emerald-300", children: c.code })
11896
11906
  ] });
11897
- }), nv = ze(function() {
11907
+ }), nv = Be(function() {
11898
11908
  var l;
11899
11909
  const t = f.ctxMenu;
11900
11910
  if (!t) return null;
@@ -11929,7 +11939,7 @@ const tv = ze(function() {
11929
11939
  ], c = f.editMode ? a : a.map(
11930
11940
  (d) => d === "sep" || d.label === "Copy" ? d : { ...d, enabled: !1 }
11931
11941
  );
11932
- return /* @__PURE__ */ g(qe, { children: [
11942
+ return /* @__PURE__ */ g(Ye, { children: [
11933
11943
  /* @__PURE__ */ s(
11934
11944
  "div",
11935
11945
  {
@@ -12004,47 +12014,78 @@ function ov(e, t, n = () => !0) {
12004
12014
  }
12005
12015
  return { loose: a, groups: c };
12006
12016
  }
12007
- let Sa = null;
12008
- const Na = /* @__PURE__ */ new Set();
12017
+ let ho = [], po = null;
12018
+ const Sa = /* @__PURE__ */ new Set();
12019
+ function iv(e) {
12020
+ ho = e.map((t) => {
12021
+ const n = String(t.label ?? "").trim();
12022
+ if (!n) throw new Error("Session preset is missing a label.");
12023
+ return {
12024
+ label: n,
12025
+ ...t.environment ? { environment: t.environment } : {},
12026
+ ...t.description ? { description: t.description } : {}
12027
+ };
12028
+ }), po != null && po >= ho.length && Mf(null);
12029
+ }
12030
+ function sv() {
12031
+ return ho;
12032
+ }
12033
+ function jl() {
12034
+ return po;
12035
+ }
12036
+ function Mf(e) {
12037
+ const t = e != null && e >= 0 && e < ho.length ? e : null;
12038
+ if (t !== po) {
12039
+ po = t, ir(
12040
+ t == null ? void 0 : ho[t].environment
12041
+ );
12042
+ for (const n of Sa) n();
12043
+ }
12044
+ }
12045
+ function av(e) {
12046
+ return Sa.add(e), () => Sa.delete(e);
12047
+ }
12048
+ let Na = null;
12049
+ const Ia = /* @__PURE__ */ new Set();
12009
12050
  function $n(e) {
12010
- if (!Object.is(Sa, e)) {
12011
- Sa = e;
12012
- for (const t of Na) t();
12051
+ if (!Object.is(Na, e)) {
12052
+ Na = e;
12053
+ for (const t of Ia) t();
12013
12054
  }
12014
12055
  }
12015
- function ho() {
12016
- return Sa;
12056
+ function mo() {
12057
+ return Na;
12017
12058
  }
12018
- function Mf(e) {
12019
- return Na.add(e), () => Na.delete(e);
12059
+ function Ef(e) {
12060
+ return Ia.add(e), () => Ia.delete(e);
12020
12061
  }
12021
- const iv = "data-pygmalion-source", sv = "/__pygmalion-storyboard/source-usage", av = 4e3;
12062
+ const cv = "data-pygmalion-source", lv = "/__pygmalion-storyboard/source-usage", dv = 4e3;
12022
12063
  function wc(e) {
12023
12064
  if (!e) return null;
12024
12065
  const t = e.replaceAll("\\", "/").trim();
12025
12066
  return !t || t.startsWith("/") || t.includes("\0") || t.split("/").includes("..") || t.length > 1200 ? null : t;
12026
12067
  }
12027
- function cv(e) {
12068
+ function uv(e) {
12028
12069
  if (!e) return null;
12029
12070
  const t = e.lastIndexOf("#");
12030
12071
  return t <= 0 ? null : wc(e.slice(0, t));
12031
12072
  }
12032
- function lv(e) {
12073
+ function fv(e) {
12033
12074
  if (!e) return null;
12034
12075
  const t = e.indexOf("|");
12035
12076
  return wc(t > 0 ? e.slice(0, t) : e);
12036
12077
  }
12037
- function Ia(e) {
12078
+ function Ca(e) {
12038
12079
  const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
12039
12080
  let r = 0;
12040
12081
  const o = (i) => {
12041
12082
  var l;
12042
- if (!i || r >= av) return;
12083
+ if (!i || r >= dv) return;
12043
12084
  r += 1, i.componentName && n.add(i.componentName);
12044
- const a = cv(i.sourceStyle);
12085
+ const a = uv(i.sourceStyle);
12045
12086
  a && t.add(a);
12046
- const c = lv(
12047
- (l = i.domAttributes) == null ? void 0 : l[iv]
12087
+ const c = fv(
12088
+ (l = i.domAttributes) == null ? void 0 : l[cv]
12048
12089
  );
12049
12090
  c && t.add(c);
12050
12091
  for (const d of i.children ?? []) o(d);
@@ -12054,23 +12095,23 @@ function Ia(e) {
12054
12095
  componentNames: [...n].sort()
12055
12096
  };
12056
12097
  }
12057
- function dv(e) {
12098
+ function hv(e) {
12058
12099
  if (!e) return;
12059
12100
  if (e.componentName) return e.componentName;
12060
- const { componentNames: t } = Ia(e);
12101
+ const { componentNames: t } = Ca(e);
12061
12102
  return t.length === 1 ? t[0] : void 0;
12062
12103
  }
12063
- function uv(e) {
12104
+ function pv(e) {
12064
12105
  const t = e.slice(e.lastIndexOf("/") + 1), n = t.indexOf(".");
12065
12106
  return n === -1 ? t : t.slice(0, n);
12066
12107
  }
12067
- function Ef(e) {
12108
+ function kf(e) {
12068
12109
  var r;
12069
12110
  const t = (r = e.componentName) == null ? void 0 : r.trim(), n = (o) => {
12070
12111
  const i = [...new Set(o.map(wc).filter(Boolean))].sort();
12071
12112
  if (i.length !== 0) {
12072
12113
  if (t) {
12073
- const a = i.find((c) => uv(c) === t);
12114
+ const a = i.find((c) => pv(c) === t);
12074
12115
  if (a) return a;
12075
12116
  }
12076
12117
  return i[0];
@@ -12078,13 +12119,13 @@ function Ef(e) {
12078
12119
  };
12079
12120
  return n(e.declaredFiles ?? []) ?? n(e.sourceFiles);
12080
12121
  }
12081
- function fv(e) {
12122
+ function mv(e) {
12082
12123
  var a;
12083
12124
  const t = e.usageByFile ?? {}, n = e.usageRequested ?? !1, r = new Map(
12084
12125
  e.consumers.map((c) => [c.frameId, c])
12085
12126
  ), o = [], i = [];
12086
12127
  for (const c of e.catalog) {
12087
- const l = Ef(c), d = ((a = c.componentName) == null ? void 0 : a.trim()) || void 0;
12128
+ const l = kf(c), d = ((a = c.componentName) == null ? void 0 : a.trim()) || void 0;
12088
12129
  if (!l && !d) {
12089
12130
  i.push(c.frameId);
12090
12131
  continue;
@@ -12116,7 +12157,7 @@ function fv(e) {
12116
12157
  unplacedFrameIds: i.sort()
12117
12158
  };
12118
12159
  }
12119
- function hv(e = []) {
12160
+ function gv(e = []) {
12120
12161
  return {
12121
12162
  frames: [],
12122
12163
  canonicalGroups: [],
@@ -12145,7 +12186,7 @@ function hv(e = []) {
12145
12186
  })).sort((t, n) => t.frameId.localeCompare(n.frameId))
12146
12187
  };
12147
12188
  }
12148
- function pv(e) {
12189
+ function bv(e) {
12149
12190
  const t = /* @__PURE__ */ new Set([
12150
12191
  ...e.startFrameIds,
12151
12192
  ...e.branchFrameIds
@@ -12165,7 +12206,7 @@ function Fn(e) {
12165
12206
  (t, n) => t.localeCompare(n)
12166
12207
  );
12167
12208
  }
12168
- function kf(e, t) {
12209
+ function Af(e, t) {
12169
12210
  const n = [...t].filter((N) => N.frameId.trim()).map((N) => ({
12170
12211
  ...N,
12171
12212
  frameId: N.frameId.trim(),
@@ -12338,7 +12379,7 @@ function kf(e, t) {
12338
12379
  return (F = l.get(N.nodeId)) == null ? void 0 : F.frameId;
12339
12380
  }
12340
12381
  )
12341
- ), T = pv({
12382
+ ), T = bv({
12342
12383
  frames: W,
12343
12384
  canonicalGroups: q,
12344
12385
  sharedSources: S,
@@ -12367,13 +12408,13 @@ function kf(e, t) {
12367
12408
  unplacedFrames: I
12368
12409
  };
12369
12410
  }
12370
- const jl = {
12411
+ const Wl = {
12371
12412
  spine: [],
12372
12413
  detours: /* @__PURE__ */ new Map(),
12373
12414
  detourParent: /* @__PURE__ */ new Map(),
12374
12415
  offJourney: []
12375
12416
  };
12376
- function Af(e) {
12417
+ function Rf(e) {
12377
12418
  const t = e.frames.some(
12378
12419
  (r) => r.outgoingTransitions.some((o) => o.origin === "explicit")
12379
12420
  ), n = /* @__PURE__ */ new Map();
@@ -12383,7 +12424,7 @@ function Af(e) {
12383
12424
  }
12384
12425
  return n;
12385
12426
  }
12386
- function mv(e) {
12427
+ function xv(e) {
12387
12428
  const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = (o) => {
12388
12429
  const i = t.get(o);
12389
12430
  if (i) return { path: i, cyclic: !1 };
@@ -12400,15 +12441,15 @@ function mv(e) {
12400
12441
  };
12401
12442
  return (o) => r(o).path;
12402
12443
  }
12403
- function gv(e) {
12404
- if (e.frames.length === 0) return jl;
12405
- const t = Af(e), n = mv(t), r = e.startFrameIds.length ? e.startFrameIds : e.frames.filter((d) => d.incomingTransitions.length === 0).map((d) => d.frameId);
12444
+ function yv(e) {
12445
+ if (e.frames.length === 0) return Wl;
12446
+ const t = Rf(e), n = xv(t), r = e.startFrameIds.length ? e.startFrameIds : e.frames.filter((d) => d.incomingTransitions.length === 0).map((d) => d.frameId);
12406
12447
  let o = [];
12407
12448
  for (const d of r) {
12408
12449
  const u = n(d);
12409
12450
  u.length > o.length && (o = u);
12410
12451
  }
12411
- if (o.length < 2) return jl;
12452
+ if (o.length < 2) return Wl;
12412
12453
  const i = new Set(o), a = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
12413
12454
  for (const d of o) {
12414
12455
  const u = (t.get(d) ?? []).filter((p) => !i.has(p));
@@ -12421,14 +12462,14 @@ function gv(e) {
12421
12462
  const l = e.frames.map((d) => d.frameId).filter((d) => !i.has(d) && !c.has(d));
12422
12463
  return { spine: o, detours: a, detourParent: c, offJourney: l };
12423
12464
  }
12424
- function bv(e, t) {
12465
+ function vv(e, t) {
12425
12466
  return t ? e.spine.includes(t) ? t : e.detourParent.get(t) ?? null : null;
12426
12467
  }
12427
- function xv(e) {
12428
- const t = Af(e);
12468
+ function wv(e) {
12469
+ const t = Rf(e);
12429
12470
  return e.frames.filter((n) => (t.get(n.frameId) ?? []).length === 0);
12430
12471
  }
12431
- function Rf({
12472
+ function Tf({
12432
12473
  frame: e,
12433
12474
  label: t,
12434
12475
  onSelectFrame: n
@@ -12463,7 +12504,7 @@ function hr({
12463
12504
  }
12464
12505
  );
12465
12506
  }
12466
- const yv = {
12507
+ const Sv = {
12467
12508
  observed: "Frames observed rendering this piece",
12468
12509
  direct: "Files that name this piece; barrels are followed through",
12469
12510
  transitive: "Nothing names it directly. This is the dependency closure, which a barrel inflates — not a usage count.",
@@ -12471,10 +12512,10 @@ const yv = {
12471
12512
  unused: "The source scan found nothing that uses it",
12472
12513
  "not-traced": "No source file to trace, or no scan available"
12473
12514
  };
12474
- function vv(e) {
12515
+ function Nv(e) {
12475
12516
  return e.evidence === "observed" ? `${e.usedByFrames.length} frames` : e.evidence === "direct" ? `${e.usedByFiles.length} files` : e.evidence === "transitive" ? `${e.transitiveCount ?? 0} indirect` : e.evidence === "pending" ? "checking…" : e.evidence === "unused" ? "unused" : "not traced";
12476
12517
  }
12477
- function wv({
12518
+ function Iv({
12478
12519
  children: e,
12479
12520
  count: t
12480
12521
  }) {
@@ -12506,19 +12547,19 @@ function Hn({
12506
12547
  children: "›"
12507
12548
  }
12508
12549
  ),
12509
- /* @__PURE__ */ s("span", { className: "min-w-0 flex-1", children: /* @__PURE__ */ s(wv, { count: t, children: e }) })
12550
+ /* @__PURE__ */ s("span", { className: "min-w-0 flex-1", children: /* @__PURE__ */ s(Iv, { count: t, children: e }) })
12510
12551
  ]
12511
12552
  }
12512
12553
  ),
12513
12554
  o ? /* @__PURE__ */ s("div", { className: "mt-0.5 flex flex-col gap-0.5", children: r }) : null
12514
12555
  ] });
12515
12556
  }
12516
- function Sv({
12557
+ function Cv({
12517
12558
  model: e,
12518
12559
  frameById: t,
12519
12560
  onSelectFrame: n
12520
12561
  }) {
12521
- const r = xv(e), o = f.canvasPages.filter((l) => l.route != null), i = o.filter((l) => {
12562
+ const r = wv(e), o = f.canvasPages.filter((l) => l.route != null), i = o.filter((l) => {
12522
12563
  var d;
12523
12564
  return !((d = l.scenarioIds) != null && d.length);
12524
12565
  }), a = o.flatMap((l) => {
@@ -12533,7 +12574,7 @@ function Sv({
12533
12574
  r.length > 0 && /* @__PURE__ */ g(Hn, { label: "Nothing follows", count: r.length, children: [
12534
12575
  /* @__PURE__ */ s("p", { className: "px-1.5 text-[9px] leading-relaxed text-[#999]", children: "An end state is fine here. A step that should continue is not." }),
12535
12576
  r.map((l) => /* @__PURE__ */ s(
12536
- Rf,
12577
+ Tf,
12537
12578
  {
12538
12579
  frame: l,
12539
12580
  onSelectFrame: n
@@ -12576,14 +12617,14 @@ function Sv({
12576
12617
  )
12577
12618
  ] });
12578
12619
  }
12579
- function Nv({
12620
+ function Pv({
12580
12621
  model: e,
12581
12622
  onSelectFrame: t,
12582
12623
  activeFrameId: n,
12583
12624
  composition: r = null,
12584
12625
  frameNameById: o
12585
12626
  }) {
12586
- const i = new Map(e.frames.map((x) => [x.frameId, x])), a = _t(() => gv(e), [e]), c = bv(a, n), [l, d] = Q({}), u = e.frames.filter((x) => x.warnings.length), p = (r == null ? void 0 : r.entries) ?? [], m = (r == null ? void 0 : r.unplacedFrameIds) ?? [];
12627
+ const i = new Map(e.frames.map((x) => [x.frameId, x])), a = _t(() => yv(e), [e]), c = vv(a, n), [l, d] = Q({}), u = e.frames.filter((x) => x.warnings.length), p = (r == null ? void 0 : r.entries) ?? [], m = (r == null ? void 0 : r.unplacedFrameIds) ?? [];
12587
12628
  return e.startFrameIds.length > 0 || e.branchFrameIds.length > 0 || e.canonicalGroups.length > 0 || e.sharedSources.length > 0 || e.warnings.length > 0 || e.unplacedFrames.length > 0 || p.length > 0 || m.length > 0 ? (
12588
12629
  // The height belongs to the panel that stacks the regions, so this one
12589
12630
  // fills what it is given rather than capping itself.
@@ -12691,7 +12732,7 @@ function Nv({
12691
12732
  ) : null,
12692
12733
  /* @__PURE__ */ g("div", { className: "mt-2 flex flex-col gap-2", children: [
12693
12734
  /* @__PURE__ */ s(
12694
- Sv,
12735
+ Cv,
12695
12736
  {
12696
12737
  model: e,
12697
12738
  frameById: i,
@@ -12724,8 +12765,8 @@ function Nv({
12724
12765
  "span",
12725
12766
  {
12726
12767
  className: "shrink-0 text-[9px] text-[#999]",
12727
- title: yv[x.evidence],
12728
- children: vv(x)
12768
+ title: Sv[x.evidence],
12769
+ children: Nv(x)
12729
12770
  }
12730
12771
  )
12731
12772
  ] }),
@@ -12789,7 +12830,7 @@ function Nv({
12789
12830
  ),
12790
12831
  e.warnings.length > 0 && /* @__PURE__ */ g(Hn, { label: "Warnings", count: e.warnings.length, children: [
12791
12832
  u.map((x) => /* @__PURE__ */ s(
12792
- Rf,
12833
+ Tf,
12793
12834
  {
12794
12835
  frame: x,
12795
12836
  label: `${x.name} · ${x.warnings.length}`,
@@ -12813,16 +12854,16 @@ function Nv({
12813
12854
  )
12814
12855
  ) : null;
12815
12856
  }
12816
- function Iv({ type: e }) {
12857
+ function $v({ type: e }) {
12817
12858
  return /* @__PURE__ */ s("span", { className: `shrink-0 ${e === "component" ? "text-[#9747ff]" : "text-[#999]"}`, children: e === "text" ? /* @__PURE__ */ s(Gu, { size: 10 }) : e === "columns" ? /* @__PURE__ */ s(hc, { size: 10 }) : e === "component" ? /* @__PURE__ */ s(Ci, { size: 10 }) : /* @__PURE__ */ s(Ni, { size: 10 }) });
12818
12859
  }
12819
- const Cv = Sd(function e({ node: t, depth: n }) {
12860
+ const Mv = Sd(function e({ node: t, depth: n }) {
12820
12861
  return Vu(() => {
12821
12862
  const r = f.isSelected(t.id), o = f.collapsed.has(t.id), i = t.children.length > 0, a = f.renamingId === t.id, c = t.type === "text" ? t.text : t.name, l = (d) => {
12822
12863
  const u = d.trim();
12823
12864
  u && u !== c && f.patch(t, t.type === "text" ? { text: u } : { name: u }), f.setRenaming(null);
12824
12865
  };
12825
- return /* @__PURE__ */ g(qe, { children: [
12866
+ return /* @__PURE__ */ g(Ye, { children: [
12826
12867
  /* @__PURE__ */ g(
12827
12868
  "div",
12828
12869
  {
@@ -12853,7 +12894,7 @@ const Cv = Sd(function e({ node: t, depth: n }) {
12853
12894
  children: /* @__PURE__ */ s(ni, { open: !o })
12854
12895
  }
12855
12896
  ),
12856
- /* @__PURE__ */ s(Iv, { type: t.type }),
12897
+ /* @__PURE__ */ s($v, { type: t.type }),
12857
12898
  a ? /* @__PURE__ */ s(
12858
12899
  "input",
12859
12900
  {
@@ -12913,7 +12954,7 @@ const Cv = Sd(function e({ node: t, depth: n }) {
12913
12954
  ] });
12914
12955
  });
12915
12956
  });
12916
- function Pv({
12957
+ function Ev({
12917
12958
  id: e,
12918
12959
  name: t,
12919
12960
  active: n,
@@ -12950,32 +12991,32 @@ function Pv({
12950
12991
  }
12951
12992
  );
12952
12993
  }
12953
- const Tf = "pygmalion.leftPanel.heights";
12954
- function Wl() {
12994
+ const Ff = "pygmalion.leftPanel.heights";
12995
+ function Hl() {
12955
12996
  try {
12956
- const e = window.localStorage.getItem(Tf), t = e ? JSON.parse(e) : null;
12997
+ const e = window.localStorage.getItem(Ff), t = e ? JSON.parse(e) : null;
12957
12998
  return t && typeof t == "object" && !Array.isArray(t) ? t : {};
12958
12999
  } catch {
12959
13000
  return {};
12960
13001
  }
12961
13002
  }
12962
- function $v(e, t) {
13003
+ function kv(e, t) {
12963
13004
  const [n, r] = Q(() => {
12964
- const i = Wl()[e];
13005
+ const i = Hl()[e];
12965
13006
  return typeof i == "number" && Number.isFinite(i) ? i : t;
12966
13007
  });
12967
13008
  return [n, (i) => {
12968
13009
  r(i);
12969
13010
  try {
12970
13011
  window.localStorage.setItem(
12971
- Tf,
12972
- JSON.stringify({ ...Wl(), [e]: i })
13012
+ Ff,
13013
+ JSON.stringify({ ...Hl(), [e]: i })
12973
13014
  );
12974
13015
  } catch {
12975
13016
  }
12976
13017
  }];
12977
13018
  }
12978
- function Mv({
13019
+ function Av({
12979
13020
  label: e,
12980
13021
  height: t,
12981
13022
  onResize: n,
@@ -13000,7 +13041,7 @@ function Mv({
13000
13041
  }
13001
13042
  );
13002
13043
  }
13003
- function Ff({ shown: e, declared: t }) {
13044
+ function Lf({ shown: e, declared: t }) {
13004
13045
  return t === 0 ? null : /* @__PURE__ */ s(
13005
13046
  "span",
13006
13047
  {
@@ -13010,7 +13051,7 @@ function Ff({ shown: e, declared: t }) {
13010
13051
  }
13011
13052
  );
13012
13053
  }
13013
- const vs = ze(function({
13054
+ const vs = Be(function({
13014
13055
  leaf: t,
13015
13056
  label: n,
13016
13057
  active: r,
@@ -13026,23 +13067,50 @@ const vs = ze(function({
13026
13067
  onClick: () => f.switchCanvas(t.canvas),
13027
13068
  children: [
13028
13069
  /* @__PURE__ */ s("span", { className: "min-w-0 flex-1 truncate", children: n ?? t.label }),
13029
- /* @__PURE__ */ s(Ff, { shown: t.frames, declared: t.declared })
13070
+ /* @__PURE__ */ s(Lf, { shown: t.frames, declared: t.declared })
13030
13071
  ]
13031
13072
  }
13032
13073
  );
13033
- }), Ev = ze(function({
13074
+ }), Rv = Be(function() {
13075
+ const t = Xe(
13076
+ av,
13077
+ jl,
13078
+ // The selection is a module value, so it reads the same on both sides —
13079
+ // and the panel renders server-side in tests, which requires this.
13080
+ jl
13081
+ ), n = sv();
13082
+ return n.length === 0 ? null : /* @__PURE__ */ g("div", { className: "shrink-0 border-b border-[#e6e6e6] px-3 py-2.5", children: [
13083
+ /* @__PURE__ */ s("div", { className: "text-[11px] font-semibold text-[#333]", children: "Runtime" }),
13084
+ /* @__PURE__ */ s("div", { role: "group", "aria-label": "Runtime", className: "mt-1.5 flex gap-1", children: n.map((r, o) => {
13085
+ const i = t === o;
13086
+ return /* @__PURE__ */ s(
13087
+ "button",
13088
+ {
13089
+ type: "button",
13090
+ "data-session-preset": r.label,
13091
+ "aria-pressed": i,
13092
+ title: r.description,
13093
+ className: `h-7 flex-1 rounded-md px-2 text-[11px] font-medium ${i ? "bg-[#e5f4ff] text-[#0d99ff]" : "bg-[#f5f5f5] text-[#555] hover:bg-[#ececec] hover:text-[#333]"}`,
13094
+ onClick: () => Mf(i ? null : o),
13095
+ children: r.label
13096
+ },
13097
+ r.label
13098
+ );
13099
+ }) })
13100
+ ] });
13101
+ }), Tv = Be(function({
13034
13102
  view: t = "story",
13035
13103
  onFrameFocus: n = (o) => f.selectFrame(o),
13036
13104
  storyboardReady: r = !0
13037
13105
  }) {
13038
- const [o, i] = $v("frames", 176), [a, c] = Q({}), l = ov(
13106
+ const [o, i] = kv("frames", 176), [a, c] = Q({}), l = ov(
13039
13107
  f.pages,
13040
13108
  f.canvasNames,
13041
13109
  (I) => f.isScreenStateShown(I)
13042
13110
  ), d = (I) => I.canvases.some((N) => N.canvas === f.activeCanvas), u = Xe(
13043
- Mf,
13044
- ho,
13045
- ho
13111
+ Ef,
13112
+ mo,
13113
+ mo
13046
13114
  ), p = f.canvasPages, m = p.length > 0 && p.every((I) => I.route == null), b = (I) => ({
13047
13115
  frameId: I.id,
13048
13116
  screenId: I.importPageId ?? I.id,
@@ -13052,20 +13120,20 @@ const vs = ze(function({
13052
13120
  ), w = new Set(x.map((I) => I.id)), v = [
13053
13121
  ...x.map(b),
13054
13122
  ...m ? [] : p.filter((I) => !w.has(I.id)).map(b)
13055
- ], E = r ? u ? kf(u, v) : hv(v) : null, k = p.map((I) => ({
13123
+ ], E = r ? u ? Af(u, v) : gv(v) : null, k = p.map((I) => ({
13056
13124
  frameId: I.id,
13057
13125
  name: I.name,
13058
- componentName: dv(I.root),
13126
+ componentName: hv(I.root),
13059
13127
  declaredFiles: I.sourcePaths ?? [],
13060
- ...Ia(I.root)
13061
- })), [L, W] = Q({}), [q, S] = Q(!1), G = (m ? [...new Set(k.map(Ef).filter(Boolean))].sort() : []).join(",");
13128
+ ...Ca(I.root)
13129
+ })), [L, W] = Q({}), [q, S] = Q(!1), G = (m ? [...new Set(k.map(kf).filter(Boolean))].sort() : []).join(",");
13062
13130
  ae(() => {
13063
13131
  if (!G) return;
13064
13132
  let I = !1;
13065
13133
  return S(!0), (async () => {
13066
13134
  try {
13067
13135
  const N = await fetch(
13068
- `${sv}?files=${encodeURIComponent(G)}`
13136
+ `${lv}?files=${encodeURIComponent(G)}`
13069
13137
  );
13070
13138
  if (I || !N.ok) return;
13071
13139
  const F = await N.json();
@@ -13078,20 +13146,21 @@ const vs = ze(function({
13078
13146
  I = !0;
13079
13147
  };
13080
13148
  }, [G]);
13081
- const R = m ? fv({
13149
+ const R = m ? mv({
13082
13150
  usageByFile: L,
13083
13151
  usageRequested: q,
13084
13152
  catalog: k,
13085
13153
  consumers: f.pages.filter((I) => I.layersImported === !0).map((I) => ({
13086
13154
  frameId: I.id,
13087
13155
  name: I.name,
13088
- ...Ia(I.root)
13156
+ ...Ca(I.root)
13089
13157
  }))
13090
13158
  }) : null, T = new Map(
13091
13159
  f.pages.map((I) => [I.id, I.name])
13092
13160
  );
13093
13161
  return /* @__PURE__ */ g("div", { className: "flex min-h-0 flex-1 flex-col", children: [
13094
- t === "story" && /* @__PURE__ */ g(qe, { children: [
13162
+ /* @__PURE__ */ s(Rv, {}),
13163
+ t === "story" && /* @__PURE__ */ g(Ye, { children: [
13095
13164
  /* @__PURE__ */ g("div", { className: "shrink-0 border-b border-[#e6e6e6] px-3 py-2.5", children: [
13096
13165
  /* @__PURE__ */ s("div", { className: "text-[11px] font-semibold text-[#333]", children: "Pages" }),
13097
13166
  /* @__PURE__ */ g("div", { className: "mt-1.5 flex flex-col gap-0.5", children: [
@@ -13126,7 +13195,7 @@ const vs = ze(function({
13126
13195
  children: [
13127
13196
  /* @__PURE__ */ s("span", { className: "w-3 shrink-0 text-[9px] text-[#999]", children: a[I.section] ?? d(I) ? "▾" : "▸" }),
13128
13197
  /* @__PURE__ */ s("span", { className: "min-w-0 flex-1 truncate", children: I.section }),
13129
- /* @__PURE__ */ s(Ff, { shown: I.frames, declared: I.declared })
13198
+ /* @__PURE__ */ s(Lf, { shown: I.frames, declared: I.declared })
13130
13199
  ]
13131
13200
  }
13132
13201
  ),
@@ -13165,7 +13234,7 @@ const vs = ze(function({
13165
13234
  }) })
13166
13235
  ] }),
13167
13236
  E && /* @__PURE__ */ s("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ s(
13168
- Nv,
13237
+ Pv,
13169
13238
  {
13170
13239
  model: E,
13171
13240
  onSelectFrame: n,
@@ -13175,7 +13244,7 @@ const vs = ze(function({
13175
13244
  }
13176
13245
  ) })
13177
13246
  ] }),
13178
- t === "frames" && /* @__PURE__ */ g(qe, { children: [
13247
+ t === "frames" && /* @__PURE__ */ g(Ye, { children: [
13179
13248
  /* @__PURE__ */ g("div", { className: "shrink-0 px-3 pb-2 pt-2.5", style: { height: o }, children: [
13180
13249
  /* @__PURE__ */ s("div", { className: "text-[11px] font-semibold text-[#333]", children: "Frames" }),
13181
13250
  /* @__PURE__ */ s("div", { className: "mt-1.5 flex h-[calc(100%-1.25rem)] flex-col gap-0.5 overflow-auto", children: f.canvasPages.map((I, N) => {
@@ -13187,7 +13256,7 @@ const vs = ze(function({
13187
13256
  /* @__PURE__ */ s("span", { className: "h-px flex-1 bg-[#e6e6e6]" })
13188
13257
  ] }),
13189
13258
  /* @__PURE__ */ s(
13190
- Pv,
13259
+ Ev,
13191
13260
  {
13192
13261
  id: I.id,
13193
13262
  name: I.name,
@@ -13200,7 +13269,7 @@ const vs = ze(function({
13200
13269
  }) })
13201
13270
  ] }),
13202
13271
  /* @__PURE__ */ s(
13203
- Mv,
13272
+ Av,
13204
13273
  {
13205
13274
  label: "Frames height",
13206
13275
  height: o,
@@ -13208,74 +13277,43 @@ const vs = ze(function({
13208
13277
  }
13209
13278
  ),
13210
13279
  /* @__PURE__ */ s("div", { className: "px-3 pb-1 pt-1 text-[11px] font-semibold text-[#333]", children: "Layers" }),
13211
- /* @__PURE__ */ s("div", { className: "min-h-0 flex-1 overflow-auto pb-2", children: /* @__PURE__ */ s(Cv, { node: f.root, depth: 0 }) })
13280
+ /* @__PURE__ */ s("div", { className: "min-h-0 flex-1 overflow-auto pb-2", children: /* @__PURE__ */ s(Mv, { node: f.root, depth: 0 }) })
13212
13281
  ] })
13213
13282
  ] });
13214
13283
  });
13215
- let Lf = [];
13216
- function Hl(e, t, n) {
13284
+ let _f = [];
13285
+ function Ul(e, t, n) {
13217
13286
  if (!Number.isFinite(e) || e < 1)
13218
13287
  throw new Error(
13219
13288
  `Viewport preset "${n}" has an invalid ${t}: ${String(e)}.`
13220
13289
  );
13221
13290
  return Math.round(e);
13222
13291
  }
13223
- function kv(e) {
13224
- Lf = e.map((t) => {
13292
+ function Fv(e) {
13293
+ _f = e.map((t) => {
13225
13294
  const n = String(t.label ?? "").trim();
13226
13295
  if (!n) throw new Error("Viewport preset is missing a label.");
13227
13296
  return {
13228
13297
  label: n,
13229
- width: Hl(t.width, "width", n),
13230
- ...t.height == null ? {} : { height: Hl(t.height, "height", n) },
13298
+ width: Ul(t.width, "width", n),
13299
+ ...t.height == null ? {} : { height: Ul(t.height, "height", n) },
13231
13300
  ...t.description ? { description: t.description } : {}
13232
13301
  };
13233
13302
  });
13234
13303
  }
13235
- function _f() {
13236
- return Lf;
13304
+ function Df() {
13305
+ return _f;
13237
13306
  }
13238
- function Av(e, t) {
13307
+ function Lv(e, t) {
13239
13308
  return Math.round(t.width) !== e.width ? !1 : e.height == null || Math.round(t.height) === e.height;
13240
13309
  }
13241
- let po = [], mo = null;
13242
- const Ca = /* @__PURE__ */ new Set();
13243
- function Rv(e) {
13244
- po = e.map((t) => {
13245
- const n = String(t.label ?? "").trim();
13246
- if (!n) throw new Error("Session preset is missing a label.");
13247
- return {
13248
- label: n,
13249
- ...t.environment ? { environment: t.environment } : {},
13250
- ...t.description ? { description: t.description } : {}
13251
- };
13252
- }), mo != null && mo >= po.length && Df(null);
13253
- }
13254
- function Tv() {
13255
- return po;
13256
- }
13257
- function Ul() {
13258
- return mo;
13259
- }
13260
- function Df(e) {
13261
- const t = e != null && e >= 0 && e < po.length ? e : null;
13262
- if (t !== mo) {
13263
- mo = t, ir(
13264
- t == null ? void 0 : po[t].environment
13265
- );
13266
- for (const n of Ca) n();
13267
- }
13268
- }
13269
- function Fv(e) {
13270
- return Ca.add(e), () => Ca.delete(e);
13271
- }
13272
- function Lv(e, t) {
13310
+ function _v(e, t) {
13273
13311
  return Object.entries((t == null ? void 0 : t.props) ?? {}).filter(
13274
13312
  ([n, r]) => Object.hasOwn(e.sourceProps, n) && r.some((o) => typeof o == typeof e.sourceProps[n])
13275
13313
  ).map(([n]) => n);
13276
13314
  }
13277
- const _v = 10;
13278
- function V0(e, t) {
13315
+ const Dv = 10;
13316
+ function U0(e, t) {
13279
13317
  var c, l;
13280
13318
  const n = [], r = new Set(t.scenarios.map((d) => d.id)), o = new Map(t.screens.map((d) => [d.id, d])), i = /* @__PURE__ */ new Map();
13281
13319
  for (const d of t.screens)
@@ -13291,7 +13329,7 @@ function V0(e, t) {
13291
13329
  continue;
13292
13330
  }
13293
13331
  if (d.kind === "behavior" || d.kind === "todo") {
13294
- d.reason.trim().length < _v && n.push({
13332
+ d.reason.trim().length < Dv && n.push({
13295
13333
  severity: "error",
13296
13334
  scenarioId: d.scenarioId,
13297
13335
  message: `${d.kind} claim needs a substantive reason`
@@ -13411,7 +13449,7 @@ function V0(e, t) {
13411
13449
  });
13412
13450
  return n;
13413
13451
  }
13414
- function Dv(e) {
13452
+ function zv(e) {
13415
13453
  return f.pages.find(
13416
13454
  (t) => (t.importPageId ?? t.id) === e
13417
13455
  ) ?? null;
@@ -13424,13 +13462,13 @@ function zf(e, t) {
13424
13462
  }
13425
13463
  return null;
13426
13464
  }
13427
- function zv(e) {
13465
+ function Ov(e) {
13428
13466
  if (e.kind === "behavior" || e.kind === "todo")
13429
13467
  return {
13430
13468
  status: "failed",
13431
13469
  message: "behavior/todo claims have no editor state to reproduce"
13432
13470
  };
13433
- const t = Dv(e.screenId);
13471
+ const t = zv(e.screenId);
13434
13472
  if (!t)
13435
13473
  return { status: "failed", message: `screen "${e.screenId}" is not loaded` };
13436
13474
  if (f.selectFrame(t.id), e.kind === "frame" || e.kind === "screen-state" || e.kind === "catalog")
@@ -13448,7 +13486,7 @@ function zv(e) {
13448
13486
  };
13449
13487
  }
13450
13488
  if (e.kind === "viewport") {
13451
- const r = _f().find(
13489
+ const r = Df().find(
13452
13490
  (o) => o.label === e.preset
13453
13491
  );
13454
13492
  return r ? (f.resizeFrame(
@@ -13497,7 +13535,7 @@ function zv(e) {
13497
13535
  };
13498
13536
  }
13499
13537
  const so = /* @__PURE__ */ new Map();
13500
- function Ov(e) {
13538
+ function Bv(e) {
13501
13539
  so.clear();
13502
13540
  for (const t of e) {
13503
13541
  if (t.kind === "behavior" || t.kind === "todo") continue;
@@ -13505,10 +13543,10 @@ function Ov(e) {
13505
13543
  n.push(t), so.set(t.screenId, n);
13506
13544
  }
13507
13545
  }
13508
- function Bv(e) {
13546
+ function jv(e) {
13509
13547
  return so.get(e) ?? [];
13510
13548
  }
13511
- function jv(e, t, n) {
13549
+ function Wv(e, t, n) {
13512
13550
  const r = [];
13513
13551
  for (const o of so.get(e) ?? [])
13514
13552
  o.kind === "component-state" && o.componentName === t && o.prop === n && r.push(o.scenarioId);
@@ -13527,22 +13565,22 @@ function Fe({
13527
13565
  /* @__PURE__ */ s("div", { className: "mt-1 flex flex-col gap-1.5", children: n })
13528
13566
  ] });
13529
13567
  }
13530
- function Wv(e, t, n, r) {
13568
+ function Hv(e, t, n, r) {
13531
13569
  return Object.hasOwn(e.componentProps, t) ? e.componentProps[t] : r ?? n[0];
13532
13570
  }
13533
13571
  function Vl(e) {
13534
13572
  return typeof e == "boolean" ? e ? "On" : "Off" : String(e);
13535
13573
  }
13536
- function Hv({
13574
+ function Uv({
13537
13575
  node: e,
13538
13576
  entry: t,
13539
13577
  sourceWritableProps: n = null,
13540
13578
  propBadges: r,
13541
13579
  onPatch: o
13542
13580
  }) {
13543
- return /* @__PURE__ */ s(qe, { children: Object.entries(t.props ?? {}).map(([i, a]) => {
13581
+ return /* @__PURE__ */ s(Ye, { children: Object.entries(t.props ?? {}).map(([i, a]) => {
13544
13582
  var p, m;
13545
- const c = ((p = t.propLabels) == null ? void 0 : p[i]) ?? i, l = Wv(
13583
+ const c = ((p = t.propLabels) == null ? void 0 : p[i]) ?? i, l = Hv(
13546
13584
  e,
13547
13585
  i,
13548
13586
  a,
@@ -13628,7 +13666,7 @@ function Kl({ kind: e }) {
13628
13666
  }
13629
13667
  ) : null;
13630
13668
  }
13631
- const Uv = ze(function({
13669
+ const Vv = Be(function({
13632
13670
  page: t
13633
13671
  }) {
13634
13672
  if (!t.scenario || t.route == null) return null;
@@ -13711,7 +13749,7 @@ const Uv = ze(function({
13711
13749
  })
13712
13750
  }
13713
13751
  ) });
13714
- }), Vv = {
13752
+ }), Kv = {
13715
13753
  frame: "FRAME",
13716
13754
  "screen-state": "STATE",
13717
13755
  "component-state": "TOGGLE",
@@ -13720,7 +13758,7 @@ const Uv = ze(function({
13720
13758
  "interactive-state": "AXIS",
13721
13759
  "card-slot": "SLOT",
13722
13760
  "list-length": "LIST"
13723
- }, Kv = /* @__PURE__ */ new Set([
13761
+ }, qv = /* @__PURE__ */ new Set([
13724
13762
  "component-state",
13725
13763
  "card-slot",
13726
13764
  "list-length"
@@ -13745,12 +13783,12 @@ function ql(e) {
13745
13783
  return "this frame";
13746
13784
  }
13747
13785
  }
13748
- const qv = ze(function({
13786
+ const Yv = Be(function({
13749
13787
  page: t
13750
13788
  }) {
13751
- const n = Bv(t.importPageId ?? t.id);
13789
+ const n = jv(t.importPageId ?? t.id);
13752
13790
  return n.length === 0 ? null : /* @__PURE__ */ s(Fe, { title: "Scenario coverage", children: n.map((r) => {
13753
- const o = !f.editMode && Kv.has(r.kind);
13791
+ const o = !f.editMode && qv.has(r.kind);
13754
13792
  return /* @__PURE__ */ g(
13755
13793
  "button",
13756
13794
  {
@@ -13761,33 +13799,33 @@ const qv = ze(function({
13761
13799
  title: o ? zn : r.reason ?? ql(r),
13762
13800
  className: "flex h-7 items-center justify-between gap-2 rounded-md bg-[#fafafa] px-2 text-left ring-1 ring-inset ring-[#ececec] hover:bg-[#f0f7ff] disabled:cursor-not-allowed disabled:opacity-45 disabled:hover:bg-[#fafafa]",
13763
13801
  onClick: () => {
13764
- zv(r);
13802
+ Ov(r);
13765
13803
  },
13766
13804
  children: [
13767
13805
  /* @__PURE__ */ s("span", { className: "truncate text-[11px] font-semibold text-[#333]", children: r.scenarioId }),
13768
13806
  /* @__PURE__ */ g("span", { className: "flex shrink-0 items-center gap-1", children: [
13769
13807
  /* @__PURE__ */ s("span", { className: "max-w-40 truncate text-[9px] text-[#999]", children: ql(r) }),
13770
- /* @__PURE__ */ s("span", { className: "rounded bg-[#f0f0f0] px-1 py-0.5 text-[8px] font-semibold tracking-wide text-[#666]", children: Vv[r.kind] ?? r.kind })
13808
+ /* @__PURE__ */ s("span", { className: "rounded bg-[#f0f0f0] px-1 py-0.5 text-[8px] font-semibold tracking-wide text-[#666]", children: Kv[r.kind] ?? r.kind })
13771
13809
  ] })
13772
13810
  ]
13773
13811
  },
13774
13812
  r.scenarioId
13775
13813
  );
13776
13814
  }) });
13777
- }), Yv = "/__pygmalion-storyboard/component-branches", Yl = /* @__PURE__ */ new Map();
13778
- function Gv(e) {
13815
+ }), Gv = "/__pygmalion-storyboard/component-branches", Yl = /* @__PURE__ */ new Map();
13816
+ function Xv(e) {
13779
13817
  const t = Yl.get(e);
13780
13818
  if (t) return t;
13781
13819
  const n = fetch(
13782
- `${Yv}?source=${encodeURIComponent(e)}`
13820
+ `${Gv}?source=${encodeURIComponent(e)}`
13783
13821
  ).then((r) => r.ok ? r.json() : { branches: [] }).then((r) => r.branches ?? []).catch(() => []);
13784
13822
  return Yl.set(e, n), n;
13785
13823
  }
13786
- function Xv(e) {
13824
+ function Jv(e) {
13787
13825
  var t, n;
13788
13826
  return e.prop ? (((n = (t = lt()[e.component]) == null ? void 0 : t.props) == null ? void 0 : n[e.prop]) ?? []).filter((o) => typeof o == "string") : (e.options ?? []).map((r) => r.label);
13789
13827
  }
13790
- function Jv({
13828
+ function Qv({
13791
13829
  label: e,
13792
13830
  title: t,
13793
13831
  ariaLabel: n,
@@ -13812,7 +13850,7 @@ function Jv({
13812
13850
  )
13813
13851
  ] });
13814
13852
  }
13815
- const Qv = ze(function({
13853
+ const Zv = Be(function({
13816
13854
  page: t
13817
13855
  }) {
13818
13856
  const n = dp(), [r, o] = Q({}), i = n.filter(
@@ -13821,7 +13859,7 @@ const Qv = ze(function({
13821
13859
  return ae(() => {
13822
13860
  let c = !0;
13823
13861
  for (const l of a)
13824
- Gv(l).then((d) => {
13862
+ Xv(l).then((d) => {
13825
13863
  c && o(
13826
13864
  (u) => u[l] ? u : { ...u, [l]: d }
13827
13865
  );
@@ -13832,7 +13870,7 @@ const Qv = ze(function({
13832
13870
  }, [a.join("|")]), i.length === 0 ? null : /* @__PURE__ */ s(Fe, { title: "Screen dimensions", children: i.map((c) => {
13833
13871
  const l = [Wc(t, c)].filter(
13834
13872
  Boolean
13835
- ), d = Xv(c), u = new Set(d), m = (c.sourcePath ? r[c.sourcePath] ?? [] : []).filter((b) => {
13873
+ ), d = Jv(c), u = new Set(d), m = (c.sourcePath ? r[c.sourcePath] ?? [] : []).filter((b) => {
13836
13874
  const x = [b.renders, ...b.values ?? []].filter(
13837
13875
  (w) => !!w
13838
13876
  );
@@ -13845,7 +13883,7 @@ const Qv = ze(function({
13845
13883
  className: "flex flex-col gap-1",
13846
13884
  children: [
13847
13885
  l.map((b) => /* @__PURE__ */ s(
13848
- Jv,
13886
+ Qv,
13849
13887
  {
13850
13888
  label: c.label,
13851
13889
  title: c.component,
@@ -13885,7 +13923,7 @@ const Qv = ze(function({
13885
13923
  c.id
13886
13924
  );
13887
13925
  }) });
13888
- }), Zv = ze(function({
13926
+ }), ew = Be(function({
13889
13927
  page: t
13890
13928
  }) {
13891
13929
  const n = vd().filter(
@@ -13937,7 +13975,7 @@ const Qv = ze(function({
13937
13975
  r.id
13938
13976
  );
13939
13977
  }) });
13940
- }), ew = ze(function({
13978
+ }), tw = Be(function({
13941
13979
  page: t
13942
13980
  }) {
13943
13981
  const n = yd().filter(
@@ -13982,7 +14020,7 @@ const Qv = ze(function({
13982
14020
  );
13983
14021
  })
13984
14022
  ] }, o.id)) }, r.id)) });
13985
- }), tw = ze(function({
14023
+ }), nw = Be(function({
13986
14024
  page: t
13987
14025
  }) {
13988
14026
  const n = pp(t, xd());
@@ -14015,7 +14053,7 @@ const Qv = ze(function({
14015
14053
  r.id
14016
14054
  );
14017
14055
  }) });
14018
- }), nw = ze(function({
14056
+ }), rw = Be(function({
14019
14057
  page: t
14020
14058
  }) {
14021
14059
  const { unclassified: n } = Wu(
@@ -14044,7 +14082,7 @@ const Qv = ze(function({
14044
14082
  r.id
14045
14083
  ))
14046
14084
  ] });
14047
- }), rw = [
14085
+ }), ow = [
14048
14086
  { v: "fill", label: "Fill" },
14049
14087
  { v: "fit", label: "Hug" },
14050
14088
  { v: "fixed", label: "Fixed" }
@@ -14058,7 +14096,7 @@ function Ct({ label: e, value: t }) {
14058
14096
  function Gl(e, t) {
14059
14097
  return e === "fixed" ? `${Math.round(t ?? 0)}px` : e;
14060
14098
  }
14061
- const ow = ze(function({
14099
+ const iw = Be(function({
14062
14100
  node: t
14063
14101
  }) {
14064
14102
  const n = t.type === "component" ? lt()[t.componentName] : void 0, r = Object.entries(t.componentProps ?? {});
@@ -14076,7 +14114,7 @@ const ow = ze(function({
14076
14114
  ] }),
14077
14115
  t.sourceComponent && /* @__PURE__ */ s(Fe, { title: "Source", children: /* @__PURE__ */ s(Ct, { label: "Component", value: t.sourceComponent }) })
14078
14116
  ] });
14079
- }), iw = ze(function({
14117
+ }), sw = Be(function({
14080
14118
  section: t,
14081
14119
  members: n
14082
14120
  }) {
@@ -14092,7 +14130,7 @@ const ow = ze(function({
14092
14130
  /* @__PURE__ */ s(Ct, { label: "Frames", value: String(n) })
14093
14131
  ] }) });
14094
14132
  });
14095
- function sw({ node: e }) {
14133
+ function aw({ node: e }) {
14096
14134
  const t = f.sharedSourceImpactFor(e);
14097
14135
  if (t.frames.length < 2) return null;
14098
14136
  const n = f.sharedSourceEditScopeFor(e), r = t.frames.slice(0, 3).map((a) => a.name), o = t.frames.length - r.length, i = `${r.join(" · ")}${o > 0 ? ` · ${o} more` : ""}`;
@@ -14127,7 +14165,7 @@ function sw({ node: e }) {
14127
14165
  /* @__PURE__ */ s("div", { className: "text-[10px] leading-relaxed text-[#999]", children: "Unsupported source operations remain limited to the selected frame." })
14128
14166
  ] });
14129
14167
  }
14130
- function aw({ node: e }) {
14168
+ function cw({ node: e }) {
14131
14169
  var i;
14132
14170
  const t = e.type === "component" ? (i = lt()[e.componentName]) == null ? void 0 : i.props : void 0, n = Object.entries(e.sourceProps).filter(
14133
14171
  ([a]) => !t || !Object.hasOwn(t, a)
@@ -14223,7 +14261,7 @@ function Xl({ value: e, onChange: t }) {
14223
14261
  className: "h-7 min-w-0 flex-1 rounded-md bg-[#f5f5f5] px-1.5 text-[11px] text-[#333] outline-none hover:ring-1 hover:ring-inset hover:ring-[#e6e6e6]",
14224
14262
  value: e,
14225
14263
  onChange: (n) => t(n.target.value),
14226
- children: rw.map((n) => /* @__PURE__ */ s("option", { value: n.v, children: n.label }, n.v))
14264
+ children: ow.map((n) => /* @__PURE__ */ s("option", { value: n.v, children: n.label }, n.v))
14227
14265
  }
14228
14266
  );
14229
14267
  }
@@ -14235,7 +14273,7 @@ function ii({
14235
14273
  const [r, o] = Q(!1), [i, a] = Q(""), c = bf(), l = e.startsWith("var("), d = l ? e.slice(4, -1) : "", u = c.find((m) => m.name === d), p = i.trim() ? c.filter((m) => m.name.toLowerCase().includes(i.trim().toLowerCase())) : c;
14236
14274
  return /* @__PURE__ */ g("div", { className: "relative", children: [
14237
14275
  /* @__PURE__ */ g("div", { className: "flex h-7 items-center gap-1.5 rounded-md bg-[#f5f5f5] px-1.5", children: [
14238
- l ? /* @__PURE__ */ g(qe, { children: [
14276
+ l ? /* @__PURE__ */ g(Ye, { children: [
14239
14277
  /* @__PURE__ */ s(
14240
14278
  "button",
14241
14279
  {
@@ -14247,7 +14285,7 @@ function ii({
14247
14285
  }
14248
14286
  ),
14249
14287
  /* @__PURE__ */ s("span", { className: "w-full truncate text-[11px] text-[#333]", children: d })
14250
- ] }) : /* @__PURE__ */ g(qe, { children: [
14288
+ ] }) : /* @__PURE__ */ g(Ye, { children: [
14251
14289
  /* @__PURE__ */ s(
14252
14290
  "input",
14253
14291
  {
@@ -14337,7 +14375,7 @@ function Jl({
14337
14375
  )) });
14338
14376
  }
14339
14377
  const Ql = ["start", "center", "end"];
14340
- function cw({ node: e }) {
14378
+ function lw({ node: e }) {
14341
14379
  const t = e.type === "rows", n = (o, i) => f.patch(
14342
14380
  e,
14343
14381
  t ? { justify: o, alignItems: i } : { justify: i, alignItems: o }
@@ -14373,14 +14411,14 @@ function cw({ node: e }) {
14373
14411
  )
14374
14412
  ] });
14375
14413
  }
14376
- function lw(e) {
14414
+ function dw(e) {
14377
14415
  const t = e.root.domStyle.display;
14378
14416
  if (t === "grid" || t === "inline-grid") return "grid";
14379
14417
  if (t === "block" || t === "contents") return "free";
14380
14418
  const n = e.root.domStyle.flexDirection;
14381
14419
  return n != null && n.startsWith("row") ? "horizontal" : n != null && n.startsWith("column") ? "vertical" : e.root.type === "columns" ? "horizontal" : "vertical";
14382
14420
  }
14383
- function dw({ mode: e }) {
14421
+ function uw({ mode: e }) {
14384
14422
  return e === "grid" ? /* @__PURE__ */ s("span", { "aria-hidden": "true", className: "grid h-4 w-4 grid-cols-2 gap-[3px]", children: [0, 1, 2, 3].map((t) => /* @__PURE__ */ s("i", { className: "rounded-[2px] border border-current" }, t)) }) : e === "vertical" || e === "horizontal" ? /* @__PURE__ */ g("span", { "aria-hidden": "true", className: `flex items-center gap-[3px] ${e === "vertical" ? "flex-col" : ""}`, children: [
14385
14423
  /* @__PURE__ */ s("i", { className: "h-[5px] w-[5px] rounded-[2px] border border-current" }),
14386
14424
  /* @__PURE__ */ s("i", { className: "h-[5px] w-[5px] rounded-[2px] border border-current" }),
@@ -14391,13 +14429,13 @@ function dw({ mode: e }) {
14391
14429
  /* @__PURE__ */ s("i", { className: "absolute bottom-0 left-[4px] h-[5px] w-[5px] rounded-[2px] border border-current" })
14392
14430
  ] });
14393
14431
  }
14394
- const uw = ze(function({ page: t }) {
14432
+ const fw = Be(function({ page: t }) {
14395
14433
  Xe(
14396
14434
  nc,
14397
14435
  $r,
14398
14436
  $r
14399
14437
  );
14400
- const n = t.route == null, r = (b) => f.patchPage(t.id, b), o = lw(t), i = (b) => {
14438
+ const n = t.route == null, r = (b) => f.patchPage(t.id, b), o = dw(t), i = (b) => {
14401
14439
  const x = { ...t.root.domStyle };
14402
14440
  b === "free" ? (x.display = "block", x.position = "relative", delete x.flexDirection, delete x.gridTemplateColumns) : b === "grid" ? (x.display = "grid", x.gridTemplateColumns || (x.gridTemplateColumns = "repeat(2, minmax(0, 1fr))"), x.gap || (x.gap = `${t.root.gap}px`), delete x.flexDirection) : (x.display = "flex", x.flexDirection = b === "horizontal" ? "row" : "column", delete x.gridTemplateColumns), f.patch(t.root, {
14403
14441
  type: b === "horizontal" ? "columns" : "rows",
@@ -14426,7 +14464,7 @@ const uw = ze(function({ page: t }) {
14426
14464
  resizeHeight: b.height != null
14427
14465
  }
14428
14466
  );
14429
- }, d = _f(), u = eg(), p = t.authoredFrameSize, m = f.frameSizeDiffersFromAuthored(t.id);
14467
+ }, d = Df(), u = eg(), p = t.authoredFrameSize, m = f.frameSizeDiffersFromAuthored(t.id);
14430
14468
  return /* @__PURE__ */ g("div", { "data-object-props": "frame", className: "min-h-0 flex-1 overflow-auto", children: [
14431
14469
  f.editMode ? /* @__PURE__ */ s(Fe, { title: "Frame", children: /* @__PURE__ */ s(
14432
14470
  "input",
@@ -14474,7 +14512,7 @@ const uw = ze(function({ page: t }) {
14474
14512
  "aria-label": "Preview viewport",
14475
14513
  className: "flex flex-wrap gap-1",
14476
14514
  children: d.map((b) => {
14477
- const x = Av(b, {
14515
+ const x = Lv(b, {
14478
14516
  width: t.width ?? 390,
14479
14517
  height: t.height ?? 600
14480
14518
  });
@@ -14557,16 +14595,16 @@ const uw = ze(function({ page: t }) {
14557
14595
  b.id
14558
14596
  ))
14559
14597
  ] }),
14560
- /* @__PURE__ */ s(Uv, { page: t }),
14561
- /* @__PURE__ */ s(tw, { page: t }),
14598
+ /* @__PURE__ */ s(Vv, { page: t }),
14562
14599
  /* @__PURE__ */ s(nw, { page: t }),
14563
- f.editMode && /* @__PURE__ */ g(qe, { children: [
14564
- /* @__PURE__ */ s(Qv, { page: t }),
14565
- /* @__PURE__ */ s(ew, { page: t }),
14566
- /* @__PURE__ */ s(Zv, { page: t })
14600
+ /* @__PURE__ */ s(rw, { page: t }),
14601
+ f.editMode && /* @__PURE__ */ g(Ye, { children: [
14602
+ /* @__PURE__ */ s(Zv, { page: t }),
14603
+ /* @__PURE__ */ s(tw, { page: t }),
14604
+ /* @__PURE__ */ s(ew, { page: t })
14567
14605
  ] }),
14568
- /* @__PURE__ */ s(qv, { page: t }),
14569
- f.editMode && /* @__PURE__ */ g(qe, { children: [
14606
+ /* @__PURE__ */ s(Yv, { page: t }),
14607
+ f.editMode && /* @__PURE__ */ g(Ye, { children: [
14570
14608
  /* @__PURE__ */ g(Fe, { title: "Position", children: [
14571
14609
  /* @__PURE__ */ s("div", { className: "grid grid-cols-6 gap-1", children: [
14572
14610
  ["left alignment", "x", "start", /* @__PURE__ */ s(Qu, { size: 13 }, "left")],
@@ -14629,7 +14667,7 @@ const uw = ze(function({ page: t }) {
14629
14667
  "aria-pressed": o === b,
14630
14668
  className: `flex h-8 items-center justify-center rounded-md ${o === b ? "bg-white text-[#18181b] shadow-sm ring-1 ring-inset ring-[#dedee3]" : "text-[#777] hover:text-[#333]"}`,
14631
14669
  onClick: () => i(b),
14632
- children: /* @__PURE__ */ s(dw, { mode: b })
14670
+ children: /* @__PURE__ */ s(uw, { mode: b })
14633
14671
  },
14634
14672
  b
14635
14673
  )) }),
@@ -14662,7 +14700,7 @@ const uw = ze(function({ page: t }) {
14662
14700
  ] }),
14663
14701
  /* @__PURE__ */ s(ii, { value: t.fill ?? "#ffffff", onChange: (b) => r({ fill: b }) })
14664
14702
  ] }),
14665
- /* @__PURE__ */ s(Fe, { title: "Screen", children: n ? /* @__PURE__ */ g(qe, { children: [
14703
+ /* @__PURE__ */ s(Fe, { title: "Screen", children: n ? /* @__PURE__ */ g(Ye, { children: [
14666
14704
  /* @__PURE__ */ s(
14667
14705
  "input",
14668
14706
  {
@@ -14710,7 +14748,7 @@ const uw = ze(function({ page: t }) {
14710
14748
  ] })
14711
14749
  ] })
14712
14750
  ] });
14713
- }), fw = ze(function({ section: t }) {
14751
+ }), hw = Be(function({ section: t }) {
14714
14752
  const n = f.canvasPages.filter((r) => r.section === t.name).length;
14715
14753
  return f.editMode ? /* @__PURE__ */ g("div", { "data-object-props": "section", className: "min-h-0 flex-1 overflow-auto", children: [
14716
14754
  /* @__PURE__ */ g(Fe, { title: "Section", children: [
@@ -14786,48 +14824,16 @@ const uw = ze(function({ page: t }) {
14786
14824
  ]
14787
14825
  }
14788
14826
  ) })
14789
- ] }) : /* @__PURE__ */ s(iw, { section: t, members: n });
14790
- }), hw = ze(function() {
14791
- const t = Xe(
14792
- Fv,
14793
- Ul,
14794
- // The selection is a module value, so it reads the same on both sides —
14795
- // and the panel renders server-side in tests, which requires this.
14796
- Ul
14797
- ), n = Tv();
14798
- return n.length === 0 ? null : /* @__PURE__ */ g("div", { className: "border-b border-[#e5e5e5] px-3 py-2", children: [
14799
- /* @__PURE__ */ s("div", { className: "mb-1.5 text-[10px] font-semibold uppercase tracking-wide text-[#999]", children: "Runtime" }),
14800
- /* @__PURE__ */ s("div", { role: "group", "aria-label": "Runtime", className: "flex flex-wrap gap-1", children: n.map((r, o) => {
14801
- const i = t === o;
14802
- return /* @__PURE__ */ s(
14803
- "button",
14804
- {
14805
- type: "button",
14806
- "data-session-preset": r.label,
14807
- "aria-pressed": i,
14808
- title: r.description,
14809
- className: `h-8 min-w-[56px] flex-1 rounded-md px-2 text-[11px] font-semibold ${i ? "bg-[#e5f4ff] text-[#0d99ff]" : "bg-[#f5f5f5] text-[#555] hover:bg-[#ececec] hover:text-[#333]"}`,
14810
- onClick: () => Df(i ? null : o),
14811
- children: r.label
14812
- },
14813
- r.label
14814
- );
14815
- }) })
14816
- ] });
14817
- }), pw = ze(function() {
14818
- return /* @__PURE__ */ g(qe, { children: [
14819
- /* @__PURE__ */ s(hw, {}),
14820
- /* @__PURE__ */ s(mw, {})
14821
- ] });
14822
- }), mw = ze(function() {
14827
+ ] }) : /* @__PURE__ */ s(sw, { section: t, members: n });
14828
+ }), pw = Be(function() {
14823
14829
  var l, d;
14824
14830
  if (((l = f.selectedCanvasObject) == null ? void 0 : l.kind) === "frame") {
14825
14831
  const u = f.selectedFrame;
14826
- return u ? /* @__PURE__ */ s(uw, { page: u }) : null;
14832
+ return u ? /* @__PURE__ */ s(fw, { page: u }) : null;
14827
14833
  }
14828
14834
  if (((d = f.selectedCanvasObject) == null ? void 0 : d.kind) === "section") {
14829
14835
  const u = f.selectedSection;
14830
- return u ? /* @__PURE__ */ s(fw, { section: u }) : null;
14836
+ return u ? /* @__PURE__ */ s(hw, { section: u }) : null;
14831
14837
  }
14832
14838
  const t = f.selected;
14833
14839
  if (!t)
@@ -14842,8 +14848,8 @@ const uw = ze(function({ page: t }) {
14842
14848
  f.selectedIds.length,
14843
14849
  " selected · Property edits use the primary selection"
14844
14850
  ] }),
14845
- /* @__PURE__ */ s(sw, { node: t }),
14846
14851
  /* @__PURE__ */ s(aw, { node: t }),
14852
+ /* @__PURE__ */ s(cw, { node: t }),
14847
14853
  /* @__PURE__ */ s(Fe, { title: t.name, children: /* @__PURE__ */ s(
14848
14854
  "input",
14849
14855
  {
@@ -14871,15 +14877,15 @@ const uw = ze(function({ page: t }) {
14871
14877
  t.componentName
14872
14878
  ] }),
14873
14879
  a && /* @__PURE__ */ s(
14874
- Hv,
14880
+ Uv,
14875
14881
  {
14876
14882
  node: t,
14877
14883
  entry: a,
14878
- sourceWritableProps: t.sourceComponent ? Lv(t, a) : null,
14884
+ sourceWritableProps: t.sourceComponent ? _v(t, a) : null,
14879
14885
  propBadges: Object.fromEntries(
14880
14886
  Object.keys(a.props ?? {}).map((u) => [
14881
14887
  u,
14882
- jv(
14888
+ Wv(
14883
14889
  f.activePage.importPageId ?? f.activePage.id,
14884
14890
  t.componentName,
14885
14891
  u
@@ -14912,7 +14918,7 @@ const uw = ze(function({ page: t }) {
14912
14918
  onChange: (u) => n({ type: u })
14913
14919
  }
14914
14920
  ),
14915
- /* @__PURE__ */ s(cw, { node: t }),
14921
+ /* @__PURE__ */ s(lw, { node: t }),
14916
14922
  /* @__PURE__ */ g("div", { className: "flex gap-1.5", children: [
14917
14923
  /* @__PURE__ */ s(ct, { label: "Gap", value: t.gap, onChange: (u) => n({ gap: u }) }),
14918
14924
  /* @__PURE__ */ s(ct, { label: "Padding", value: t.padding, onChange: (u) => n({ padding: u }) })
@@ -14961,7 +14967,7 @@ const uw = ze(function({ page: t }) {
14961
14967
  children: /* @__PURE__ */ s(Ii, { size: 12 })
14962
14968
  }
14963
14969
  ),
14964
- children: t.borderWidth > 0 ? /* @__PURE__ */ g(qe, { children: [
14970
+ children: t.borderWidth > 0 ? /* @__PURE__ */ g(Ye, { children: [
14965
14971
  /* @__PURE__ */ s(
14966
14972
  ii,
14967
14973
  {
@@ -15027,9 +15033,9 @@ const uw = ze(function({ page: t }) {
15027
15033
  ),
15028
15034
  /* @__PURE__ */ s(ii, { value: t.color, onChange: (u) => n({ color: u }) })
15029
15035
  ] })
15030
- ] }) : /* @__PURE__ */ s(ow, { node: t });
15031
- }), gw = ze(function() {
15032
- return /* @__PURE__ */ g(qe, { children: [
15036
+ ] }) : /* @__PURE__ */ s(iw, { node: t });
15037
+ }), mw = Be(function() {
15038
+ return /* @__PURE__ */ g(Ye, { children: [
15033
15039
  /* @__PURE__ */ s(
15034
15040
  "button",
15035
15041
  {
@@ -15056,8 +15062,8 @@ const uw = ze(function({ page: t }) {
15056
15062
  )
15057
15063
  ] });
15058
15064
  });
15059
- ze(function() {
15060
- return /* @__PURE__ */ g(qe, { children: [
15065
+ Be(function() {
15066
+ return /* @__PURE__ */ g(Ye, { children: [
15061
15067
  /* @__PURE__ */ s(
15062
15068
  "button",
15063
15069
  {
@@ -15082,7 +15088,7 @@ ze(function() {
15082
15088
  )
15083
15089
  ] });
15084
15090
  });
15085
- function bw(e) {
15091
+ function gw(e) {
15086
15092
  return [...new Set(e)].sort().join(`
15087
15093
  `);
15088
15094
  }
@@ -15093,10 +15099,10 @@ function Zl(e, t) {
15093
15099
  r - t.viewportHeight / 2
15094
15100
  );
15095
15101
  }
15096
- function xw(e, t) {
15102
+ function bw(e, t) {
15097
15103
  return e === t ? 0 : e < t ? -1 : 1;
15098
15104
  }
15099
- function yw(e, t = {}) {
15105
+ function xw(e, t = {}) {
15100
15106
  const n = t.hasSnapshot ?? (() => !1), r = [], o = [], i = /* @__PURE__ */ new Set();
15101
15107
  for (const p of e)
15102
15108
  if (!n(p.key)) {
@@ -15107,7 +15113,7 @@ function yw(e, t = {}) {
15107
15113
  i.has(p.key) || (i.add(p.key), o.push(p));
15108
15114
  }
15109
15115
  const a = o.map((p, m) => ({ candidate: p, order: m })).sort(
15110
- (p, m) => xw(p.candidate.distance, m.candidate.distance) || p.order - m.order
15116
+ (p, m) => bw(p.candidate.distance, m.candidate.distance) || p.order - m.order
15111
15117
  ).map((p) => p.candidate), c = /* @__PURE__ */ new Map();
15112
15118
  for (const p of a) {
15113
15119
  if (p.groupKey == null) continue;
@@ -15136,33 +15142,33 @@ function yw(e, t = {}) {
15136
15142
  }
15137
15143
  return { units: l, interactionFrames: r };
15138
15144
  }
15139
- const vw = 250, ww = 8, Sw = 32, Nw = /* @__PURE__ */ new Set();
15145
+ const yw = 250, vw = 8, ww = 32, Sw = /* @__PURE__ */ new Set();
15140
15146
  let ed = {
15141
15147
  phase: "idle",
15142
15148
  total: 0,
15143
15149
  completed: 0,
15144
15150
  failed: 0
15145
15151
  };
15146
- function Iw(e) {
15152
+ function Nw(e) {
15147
15153
  const t = ed;
15148
15154
  if (!(t.phase === e.phase && t.total === e.total && t.completed === e.completed && t.failed === e.failed)) {
15149
15155
  ed = e;
15150
- for (const n of Nw) n();
15156
+ for (const n of Sw) n();
15151
15157
  }
15152
15158
  }
15153
- function Cw(e, t = {}) {
15159
+ function Iw(e, t = {}) {
15154
15160
  const n = Math.max(
15155
15161
  1,
15156
- t.pauseBackoffMs ?? vw
15162
+ t.pauseBackoffMs ?? yw
15157
15163
  ), r = Math.max(
15158
15164
  1,
15159
- t.interactionChunkSize ?? ww
15165
+ t.interactionChunkSize ?? vw
15160
15166
  ), o = Math.max(
15161
15167
  0,
15162
- t.interactionRequestCap ?? Sw
15168
+ t.interactionRequestCap ?? ww
15163
15169
  );
15164
15170
  let i = 0, a = !1, c = null, l = 0, d = 0, u = 0;
15165
- const p = (E) => new Promise((k) => setTimeout(k, E)), m = (E) => Iw({ phase: E, total: l, completed: d, failed: u }), b = (E, k) => {
15171
+ const p = (E) => new Promise((k) => setTimeout(k, E)), m = (E) => Nw({ phase: E, total: l, completed: d, failed: u }), b = (E, k) => {
15166
15172
  if (E)
15167
15173
  try {
15168
15174
  k ? E.discard() : E.release();
@@ -15229,7 +15235,7 @@ function Cw(e, t = {}) {
15229
15235
  }
15230
15236
  return { run: w, cancel: v };
15231
15237
  }
15232
- const td = "absolute z-20 flex flex-col overflow-hidden rounded-[13px] border border-[#e6e6e6] bg-white shadow-[0_2px_14px_rgba(0,0,0,.08)]", Pw = 600, bn = 200, an = 280, $w = 480, ws = "absolute bottom-11 left-1/2 z-40 w-44 -translate-x-1/2 rounded-xl bg-[#1e1e1e] p-1.5 text-[12px] shadow-[0_4px_20px_rgba(0,0,0,.25)]", Xr = (e) => `flex h-9 w-9 items-center justify-center rounded-lg ${e ? "bg-[#0d99ff] text-white" : "text-[#333] hover:bg-[#f5f5f5]"}`;
15238
+ const td = "absolute z-20 flex flex-col overflow-hidden rounded-[13px] border border-[#e6e6e6] bg-white shadow-[0_2px_14px_rgba(0,0,0,.08)]", Cw = 600, bn = 200, an = 280, Pw = 480, ws = "absolute bottom-11 left-1/2 z-40 w-44 -translate-x-1/2 rounded-xl bg-[#1e1e1e] p-1.5 text-[12px] shadow-[0_4px_20px_rgba(0,0,0,.25)]", Xr = (e) => `flex h-9 w-9 items-center justify-center rounded-lg ${e ? "bg-[#0d99ff] text-white" : "text-[#333] hover:bg-[#f5f5f5]"}`;
15233
15239
  function Ln({
15234
15240
  icon: e,
15235
15241
  label: t,
@@ -15257,7 +15263,7 @@ function Ln({
15257
15263
  )
15258
15264
  );
15259
15265
  }
15260
- const Mw = ze(function({
15266
+ const $w = Be(function({
15261
15267
  previewIdentityReady: t = !0
15262
15268
  } = {}) {
15263
15269
  var wt;
@@ -15280,10 +15286,10 @@ const Mw = ze(function({
15280
15286
  $r
15281
15287
  );
15282
15288
  const l = Xe(
15283
- Mf,
15284
- ho,
15285
- ho
15286
- ), d = t ? l : null, p = (d ? kf(
15289
+ Ef,
15290
+ mo,
15291
+ mo
15292
+ ), d = t ? l : null, p = (d ? Af(
15287
15293
  d,
15288
15294
  f.canvasPages.map((_) => ({
15289
15295
  frameId: _.id,
@@ -15317,7 +15323,7 @@ const Mw = ze(function({
15317
15323
  )
15318
15324
  ])
15319
15325
  )
15320
- ], w = bw(x), [v, E] = Q("");
15326
+ ], w = gw(x), [v, E] = Q("");
15321
15327
  ae(() => {
15322
15328
  let _ = !0;
15323
15329
  return E(""), t ? (Qa(x).then(() => {
@@ -15381,9 +15387,9 @@ const Mw = ze(function({
15381
15387
  ...oe && We ? { frame: { id: ne, fingerprint: We } } : {}
15382
15388
  });
15383
15389
  }
15384
- const ue = yw(Me, {
15390
+ const ue = xw(Me, {
15385
15391
  hasSnapshot: Gn
15386
- }), K = cc(), Ie = Cw({
15392
+ }), K = cc(), Ie = Iw({
15387
15393
  leaseInstance: async (V) => {
15388
15394
  const Ne = B.get(V.pageId);
15389
15395
  if (!Ne || Ne.route == null) return null;
@@ -15417,22 +15423,22 @@ const Mw = ze(function({
15417
15423
  try {
15418
15424
  await new Promise((le, Ge) => {
15419
15425
  const He = () => {
15420
- ne.removeEventListener("load", Be), ne.removeEventListener("error", Ue);
15421
- }, Be = () => {
15426
+ ne.removeEventListener("load", Oe), ne.removeEventListener("error", Ue);
15427
+ }, Oe = () => {
15422
15428
  He(), le();
15423
15429
  }, Ue = () => {
15424
15430
  He(), Ge(new Error(`The sweep preview failed to load ${oe}.`));
15425
15431
  };
15426
- ne.addEventListener("load", Be), ne.addEventListener("error", Ue), ne.src = oe;
15432
+ ne.addEventListener("load", Oe), ne.addEventListener("error", Ue), ne.src = oe;
15427
15433
  });
15428
15434
  } catch (le) {
15429
15435
  throw ne.remove(), le;
15430
15436
  }
15431
15437
  let We = !1;
15432
- const Oe = () => {
15438
+ const ze = () => {
15433
15439
  We || (We = !0, ne.remove());
15434
15440
  };
15435
- return { reused: !1, iframe: ne, release: Oe, discard: Oe };
15441
+ return { reused: !1, iframe: ne, release: ze, discard: ze };
15436
15442
  },
15437
15443
  produce: (V, Ne, re) => {
15438
15444
  const U = B.get(V.pageId), oe = Ne == null ? void 0 : Ne.iframe;
@@ -15557,28 +15563,28 @@ const Mw = ze(function({
15557
15563
  preset: oe.preset,
15558
15564
  interactions: oe.interactions,
15559
15565
  assertions: oe.assertions
15560
- }, Oe = wi(
15566
+ }, ze = wi(
15561
15567
  We,
15562
15568
  a,
15563
15569
  _
15564
15570
  );
15565
- if (!Oe || go(jt(oe, a)))
15571
+ if (!ze || go(jt(oe, a)))
15566
15572
  continue;
15567
- const le = Jt(ne, Oe), Ge = (oe.canvas ?? "default") === q;
15573
+ const le = Jt(ne, ze), Ge = (oe.canvas ?? "default") === q;
15568
15574
  le.status === "error" && le.reason !== "not-prepared" && Ge && V.add(ne);
15569
15575
  const He = le.status === "error" && le.reason === "not-prepared";
15570
15576
  if (Ge && (le.status === "outdated" || le.status === "generating" || le.status === "checking" || He) && (Ne += 1), le.status !== "outdated" && !(He && ue))
15571
15577
  continue;
15572
- const Be = oe.width ?? 390, Ue = cn(oe), Te = oe.canvas ?? "default";
15578
+ const Oe = oe.width ?? 390, Ue = cn(oe), Te = oe.canvas ?? "default";
15573
15579
  ve.push({
15574
15580
  pageId: oe.id,
15575
15581
  canonicalId: ne,
15576
15582
  canvas: Te,
15577
15583
  distance: Ie && Te === q ? Zl(
15578
- { x: oe.x ?? 0, y: oe.y ?? 0, width: Be, height: Ue },
15584
+ { x: oe.x ?? 0, y: oe.y ?? 0, width: Oe, height: Ue },
15579
15585
  Ie
15580
15586
  ) : Number.POSITIVE_INFINITY,
15581
- fingerprint: Oe,
15587
+ fingerprint: ze,
15582
15588
  ...(() => {
15583
15589
  const Ve = lc(We, _);
15584
15590
  return Ve ? { recipe: Ve } : {};
@@ -15624,7 +15630,7 @@ const Mw = ze(function({
15624
15630
  (te) => te.id === G
15625
15631
  );
15626
15632
  he && Cu(he, a);
15627
- }, Pw);
15633
+ }, Cw);
15628
15634
  return () => clearTimeout(_);
15629
15635
  }, [
15630
15636
  R,
@@ -15880,7 +15886,7 @@ const Mw = ze(function({
15880
15886
  const te = he.clientX, xe = _ === "left" ? se : Se, B = (ue) => {
15881
15887
  const K = _ === "left" ? ue.clientX - te : te - ue.clientX, Ie = Math.max(
15882
15888
  bn,
15883
- Math.min($w, xe + K)
15889
+ Math.min(Pw, xe + K)
15884
15890
  );
15885
15891
  _ === "left" ? Ee(Ie) : be(Ie);
15886
15892
  }, Me = () => {
@@ -16138,7 +16144,7 @@ const Mw = ze(function({
16138
16144
  )) })
16139
16145
  ] }),
16140
16146
  /* @__PURE__ */ s(
16141
- Ev,
16147
+ Tv,
16142
16148
  {
16143
16149
  view: O,
16144
16150
  onFrameFocus: _e,
@@ -16314,7 +16320,7 @@ const Mw = ze(function({
16314
16320
  children: "↔"
16315
16321
  }
16316
16322
  ),
16317
- /* @__PURE__ */ s(gw, {})
16323
+ /* @__PURE__ */ s(mw, {})
16318
16324
  ] })
16319
16325
  ] }),
16320
16326
  /* @__PURE__ */ s(pw, {}),
@@ -16567,12 +16573,12 @@ const Mw = ze(function({
16567
16573
  ]
16568
16574
  }
16569
16575
  );
16570
- }), Ew = 1, kw = 4;
16571
- function Aw() {
16576
+ }), Mw = 1, Ew = 4;
16577
+ function kw() {
16572
16578
  if (!(typeof navigator > "u"))
16573
16579
  return navigator.deviceMemory;
16574
16580
  }
16575
- function Rw(e, t, n, r = Ew) {
16581
+ function Aw(e, t, n, r = Mw) {
16576
16582
  const o = /* @__PURE__ */ new Map();
16577
16583
  return e.forEach((i, a) => {
16578
16584
  if (!ac(i)) return;
@@ -16603,7 +16609,7 @@ function Rw(e, t, n, r = Ew) {
16603
16609
  });
16604
16610
  }), [...o.values()].sort((i, a) => a.members - i.members || i.order - a.order).slice(0, Math.max(0, r)).map((i) => i.target);
16605
16611
  }
16606
- function Tw(e, t, n) {
16612
+ function Rw(e, t, n) {
16607
16613
  if (!e) return [];
16608
16614
  const r = (p) => p.importPageId ?? p.id, o = t.find((p) => p.id === n);
16609
16615
  if (!o) return [];
@@ -16636,13 +16642,13 @@ function Tw(e, t, n) {
16636
16642
  }
16637
16643
  return d;
16638
16644
  }
16639
- function Fw(e) {
16640
- const t = e.deviceMemoryGb ?? Aw();
16641
- if (t != null && t < kw)
16645
+ function Tw(e) {
16646
+ const t = e.deviceMemoryGb ?? kw();
16647
+ if (t != null && t < Ew)
16642
16648
  return () => {
16643
16649
  };
16644
- const n = e.instances ?? cc(), r = e.getGraph ?? ho;
16645
- for (const o of Rw(
16650
+ const n = e.instances ?? cc(), r = e.getGraph ?? mo;
16651
+ for (const o of Aw(
16646
16652
  e.getPages(),
16647
16653
  e.appOrigin,
16648
16654
  e.baselineEnvironment
@@ -16653,7 +16659,7 @@ function Fw(e) {
16653
16659
  () => e.editor.activePageId,
16654
16660
  (o) => {
16655
16661
  if (!o) return;
16656
- const i = Tw(
16662
+ const i = Rw(
16657
16663
  r(),
16658
16664
  e.getPages(),
16659
16665
  o
@@ -16665,7 +16671,7 @@ function Fw(e) {
16665
16671
  }
16666
16672
  );
16667
16673
  }
16668
- function Lw(e) {
16674
+ function Fw(e) {
16669
16675
  return e.flatMap((t, n) => {
16670
16676
  const r = t.id.trim() || `path:${n + 1}`, o = t.screenIds.map((i) => i.trim()).filter(Boolean);
16671
16677
  return o.slice(1).map((i, a) => {
@@ -16696,7 +16702,7 @@ function Pa(e, t = /* @__PURE__ */ new Set()) {
16696
16702
  }
16697
16703
  return t.delete(e), n;
16698
16704
  }
16699
- function _w(e) {
16705
+ function Lw(e) {
16700
16706
  return JSON.stringify(
16701
16707
  Pa({
16702
16708
  version: 1,
@@ -16720,11 +16726,11 @@ function _w(e) {
16720
16726
  function ut(e) {
16721
16727
  return [...new Set([...e].map((t) => t == null ? void 0 : t.trim()).filter(Boolean))].sort((t, n) => t.localeCompare(n));
16722
16728
  }
16723
- function Dw(e, t) {
16729
+ function _w(e, t) {
16724
16730
  var r;
16725
16731
  return ((r = e.id) == null ? void 0 : r.trim()) || `edge:${t + 1}`;
16726
16732
  }
16727
- function zw(e) {
16733
+ function Dw(e) {
16728
16734
  const t = [...e.screens].sort((r, o) => r.id.localeCompare(o.id)), n = t[0].id;
16729
16735
  return {
16730
16736
  id: `story:${n}`,
@@ -16753,7 +16759,7 @@ function nd(e) {
16753
16759
  e.scenarioId
16754
16760
  ].join(":");
16755
16761
  }
16756
- function Ow(e) {
16762
+ function zw(e) {
16757
16763
  var ce, ie;
16758
16764
  const t = [], n = [], r = /* @__PURE__ */ new Map();
16759
16765
  for (const P of e.screens) {
@@ -16774,7 +16780,7 @@ function Ow(e) {
16774
16780
  for (const P of n) {
16775
16781
  let A;
16776
16782
  try {
16777
- if (A = (e.recipeKey ?? _w)(P), !A.trim()) throw new Error("Recipe keys cannot be empty.");
16783
+ if (A = (e.recipeKey ?? Lw)(P), !A.trim()) throw new Error("Recipe keys cannot be empty.");
16778
16784
  } catch ($) {
16779
16785
  i.add(P.id), t.push({
16780
16786
  code: "invalid-recipe",
@@ -16786,7 +16792,7 @@ function Ow(e) {
16786
16792
  const M = o.get(A);
16787
16793
  M ? M.screens.push(P) : o.set(A, { recipeKey: A, screens: [P] });
16788
16794
  }
16789
- const a = [...o.values()].map(zw).sort((P, A) => P.id.localeCompare(A.id)), c = {};
16795
+ const a = [...o.values()].map(Dw).sort((P, A) => P.id.localeCompare(A.id)), c = {};
16790
16796
  for (const P of a)
16791
16797
  for (const A of P.screenIds) c[A] = P.id;
16792
16798
  const l = new Map(a.map((P) => [P.id, P])), d = (P, A) => ut([
@@ -16845,7 +16851,7 @@ function Ow(e) {
16845
16851
  let E = 0;
16846
16852
  for (const [P, A] of v)
16847
16853
  for (const M of A) {
16848
- const $ = Dw(M, E);
16854
+ const $ = _w(M, E);
16849
16855
  E += 1;
16850
16856
  const de = b(M.from, $, "source"), se = b(M.to, $, "target");
16851
16857
  if (!de || !se || de === se) continue;
@@ -17015,7 +17021,7 @@ function Ow(e) {
17015
17021
  coverage: je
17016
17022
  };
17017
17023
  }
17018
- function Bw(e) {
17024
+ function Ow(e) {
17019
17025
  return e ? JSON.parse(JSON.stringify(e)) : void 0;
17020
17026
  }
17021
17027
  function ki(e) {
@@ -17029,7 +17035,7 @@ function ki(e) {
17029
17035
  function rd(e) {
17030
17036
  return JSON.stringify(ki(e ?? null));
17031
17037
  }
17032
- function jw(e) {
17038
+ function Bw(e) {
17033
17039
  return !!(e && typeof e == "object" && !Array.isArray(e));
17034
17040
  }
17035
17041
  function Ht(e) {
@@ -17077,7 +17083,7 @@ function od(e, t, n) {
17077
17083
  screenIds: n.get(i) ?? [a]
17078
17084
  })).sort((i, a) => i.representativeId.localeCompare(a.representativeId));
17079
17085
  }
17080
- function Ww(e) {
17086
+ function jw(e) {
17081
17087
  var n;
17082
17088
  const t = /* @__PURE__ */ new Map();
17083
17089
  for (const r of e ?? []) {
@@ -17091,7 +17097,7 @@ function Ww(e) {
17091
17097
  }
17092
17098
  return [...t.values()].sort((r, o) => r.id.localeCompare(o.id));
17093
17099
  }
17094
- function Hw(e, t, n, r) {
17100
+ function Ww(e, t, n, r) {
17095
17101
  return (e ?? []).flatMap((o, i) => {
17096
17102
  var p, m, b;
17097
17103
  const a = (p = o.from) == null ? void 0 : p.trim(), c = (m = o.to) == null ? void 0 : m.trim();
@@ -17115,7 +17121,7 @@ function Hw(e, t, n, r) {
17115
17121
  );
17116
17122
  });
17117
17123
  }
17118
- function Uw(e, t, n) {
17124
+ function Hw(e, t, n) {
17119
17125
  const r = Ht(e.route);
17120
17126
  if (!r) return [];
17121
17127
  const o = t.filter(
@@ -17139,7 +17145,7 @@ function Uw(e, t, n) {
17139
17145
  )
17140
17146
  ].sort((c, l) => c.localeCompare(l));
17141
17147
  }
17142
- function Vw(e, t) {
17148
+ function Uw(e, t) {
17143
17149
  const n = e.some((i) => i.importKind != null), r = t.candidates ?? [], o = jf(t);
17144
17150
  return e.filter(
17145
17151
  (i) => n ? i.importKind === "screens" : !!i.route
@@ -17161,7 +17167,7 @@ function Vw(e, t) {
17161
17167
  scenario: i.scenario,
17162
17168
  state: i.state,
17163
17169
  scenarioId: i.scenarioId,
17164
- scenarioIds: Uw(i, r, o),
17170
+ scenarioIds: Hw(i, r, o),
17165
17171
  interactions: i.interactions,
17166
17172
  environment: i.environment,
17167
17173
  preset: i.preset,
@@ -17178,7 +17184,7 @@ function Ki(e, t) {
17178
17184
  const i = !e.environment && !e.preset ? 0 : 1, a = !t.environment && !t.preset ? 0 : 1;
17179
17185
  return i !== a ? i - a : e.id.localeCompare(t.id);
17180
17186
  }
17181
- function Kw(e) {
17187
+ function Vw(e) {
17182
17188
  const t = /* @__PURE__ */ new Map();
17183
17189
  for (const n of e) {
17184
17190
  const r = Ht(n.route);
@@ -17193,7 +17199,7 @@ function Kw(e) {
17193
17199
  })
17194
17200
  );
17195
17201
  }
17196
- function qw(e) {
17202
+ function Kw(e) {
17197
17203
  const t = /* @__PURE__ */ new Map();
17198
17204
  for (const n of e) {
17199
17205
  const r = Ht(n.route);
@@ -17208,7 +17214,7 @@ function qw(e) {
17208
17214
  ])
17209
17215
  );
17210
17216
  }
17211
- function Yw(e) {
17217
+ function qw(e) {
17212
17218
  return e.action === "wait" ? null : JSON.stringify(
17213
17219
  ki({
17214
17220
  action: e.action,
@@ -17225,12 +17231,12 @@ function Yw(e) {
17225
17231
  );
17226
17232
  }
17227
17233
  function Bf(e) {
17228
- return (e.interactions ?? []).map(Yw).filter((t) => t != null);
17234
+ return (e.interactions ?? []).map(qw).filter((t) => t != null);
17229
17235
  }
17230
- function Gw(e, t) {
17236
+ function Yw(e, t) {
17231
17237
  return e.length < t.length && e.every((n, r) => n === t[r]);
17232
17238
  }
17233
- function Xw(e, t) {
17239
+ function Gw(e, t) {
17234
17240
  const n = /* @__PURE__ */ new Map();
17235
17241
  for (const r of e) {
17236
17242
  const o = Ht(r.route);
@@ -17249,7 +17255,7 @@ function Xw(e, t) {
17249
17255
  }));
17250
17256
  });
17251
17257
  }
17252
- function Jw(e, t) {
17258
+ function Xw(e, t) {
17253
17259
  const n = /* @__PURE__ */ new Map();
17254
17260
  for (const r of e) {
17255
17261
  const o = Ht(r.route);
@@ -17267,7 +17273,7 @@ function Jw(e, t) {
17267
17273
  const d = i.get(l.id);
17268
17274
  if (!d.length) return [];
17269
17275
  const p = o.filter(
17270
- (m) => Gw(
17276
+ (m) => Yw(
17271
17277
  i.get(m.id),
17272
17278
  d
17273
17279
  )
@@ -17299,7 +17305,7 @@ function Jw(e, t) {
17299
17305
  });
17300
17306
  });
17301
17307
  }
17302
- function Qw(e) {
17308
+ function Jw(e) {
17303
17309
  var n;
17304
17310
  const t = /* @__PURE__ */ new Map();
17305
17311
  for (const r of e) {
@@ -17331,7 +17337,7 @@ function Qw(e) {
17331
17337
  });
17332
17338
  });
17333
17339
  }
17334
- function Zw(e, t, n) {
17340
+ function Qw(e, t, n) {
17335
17341
  const r = new Set(
17336
17342
  (t.routes ?? []).map((o) => Ht(o.path)).filter((o) => !!o)
17337
17343
  );
@@ -17353,7 +17359,7 @@ function Zw(e, t, n) {
17353
17359
  } : o;
17354
17360
  });
17355
17361
  }
17356
- function e0(e, t) {
17362
+ function Zw(e, t) {
17357
17363
  var d, u, p, m, b;
17358
17364
  const n = new Set(e.map((x) => x.id)), r = new Map(
17359
17365
  e.map((x, w) => [x.id, w])
@@ -17418,42 +17424,42 @@ function e0(e, t) {
17418
17424
  }
17419
17425
  function jf(e) {
17420
17426
  var t, n;
17421
- return Bw(
17427
+ return Ow(
17422
17428
  (n = (t = e.scenarios) == null ? void 0 : t.find(
17423
17429
  (r) => r.id === "environment:baseline"
17424
17430
  )) == null ? void 0 : n.environment
17425
17431
  );
17426
17432
  }
17427
- function t0(e) {
17433
+ function e0(e) {
17428
17434
  var l, d, u, p, m;
17429
- const t = Vw(
17435
+ const t = Uw(
17430
17436
  e.pages,
17431
17437
  e.manifest
17432
- ), n = Kw(t), r = qw(t), o = Zw(
17438
+ ), n = Vw(t), r = Kw(t), o = Qw(
17433
17439
  t,
17434
17440
  e.manifest,
17435
17441
  n
17436
17442
  ), a = [
17437
- ...Hw(
17443
+ ...Ww(
17438
17444
  e.manifest.edges,
17439
17445
  n,
17440
17446
  r,
17441
17447
  new Set(o.map((b) => b.id))
17442
17448
  ),
17449
+ ...Gw(o, n),
17443
17450
  ...Xw(o, n),
17444
- ...Jw(o, n),
17445
- ...Qw(o)
17451
+ ...Jw(o)
17446
17452
  ], c = [
17447
17453
  ...((l = e.storyboard) == null ? void 0 : l.edges) ?? [],
17448
- ...Lw(((d = e.storyboard) == null ? void 0 : d.paths) ?? [])
17454
+ ...Fw(((d = e.storyboard) == null ? void 0 : d.paths) ?? [])
17449
17455
  ];
17450
- return Ow({
17456
+ return zw({
17451
17457
  screens: o,
17452
17458
  assets: e.assets,
17453
- scenarios: Ww(e.manifest.routes),
17459
+ scenarios: jw(e.manifest.routes),
17454
17460
  explicitEdges: c,
17455
17461
  inferredEdges: a,
17456
- startScreenIds: (p = (u = e.storyboard) == null ? void 0 : u.startScreenIds) != null && p.length ? e.storyboard.startScreenIds : e0(o, [...c, ...a]),
17462
+ startScreenIds: (p = (u = e.storyboard) == null ? void 0 : u.startScreenIds) != null && p.length ? e.storyboard.startScreenIds : Zw(o, [...c, ...a]),
17457
17463
  nonVisualScenarioIds: (m = e.storyboard) == null ? void 0 : m.nonVisualScenarioIds
17458
17464
  });
17459
17465
  }
@@ -17466,12 +17472,12 @@ async function Wf(e) {
17466
17472
  if (!n.ok)
17467
17473
  throw new Error(`Storyboard discovery failed (${n.status})`);
17468
17474
  const r = await n.json();
17469
- if (!jw(r))
17475
+ if (!Bw(r))
17470
17476
  throw new Error("Storyboard discovery returned an invalid manifest.");
17471
17477
  return {
17472
17478
  manifest: r,
17473
17479
  baselineEnvironment: jf(r),
17474
- graph: t0({
17480
+ graph: e0({
17475
17481
  manifest: r,
17476
17482
  pages: e.pages,
17477
17483
  assets: e.assets,
@@ -17479,7 +17485,7 @@ async function Wf(e) {
17479
17485
  })
17480
17486
  };
17481
17487
  }
17482
- async function K0(e) {
17488
+ async function V0(e) {
17483
17489
  $n(null);
17484
17490
  try {
17485
17491
  const t = await Wf(e);
@@ -17488,15 +17494,15 @@ async function K0(e) {
17488
17494
  throw $n(null), t;
17489
17495
  }
17490
17496
  }
17491
- const Ai = "var(--pygmalion-catalog-surface, #ffffff)", Ri = "var(--pygmalion-catalog-canvas, #f5f5f5)", $a = "var(--pygmalion-catalog-border, #e5e7eb)", Ti = "var(--pygmalion-catalog-text, #202124)", Wt = "var(--pygmalion-catalog-muted, #6b7280)", n0 = "var(--pygmalion-catalog-header, #11182f)", r0 = "var(--pygmalion-catalog-accent, #7c6cf2)";
17492
- function q0({
17497
+ const Ai = "var(--pygmalion-catalog-surface, #ffffff)", Ri = "var(--pygmalion-catalog-canvas, #f5f5f5)", $a = "var(--pygmalion-catalog-border, #e5e7eb)", Ti = "var(--pygmalion-catalog-text, #202124)", Wt = "var(--pygmalion-catalog-muted, #6b7280)", t0 = "var(--pygmalion-catalog-header, #11182f)", n0 = "var(--pygmalion-catalog-accent, #7c6cf2)";
17498
+ function K0({
17493
17499
  title: e,
17494
17500
  eyebrow: t,
17495
17501
  description: n,
17496
17502
  version: r,
17497
17503
  meta: o,
17498
17504
  children: i,
17499
- headerBackground: a = n0,
17505
+ headerBackground: a = t0,
17500
17506
  headerColor: c = "#ffffff",
17501
17507
  bodyBackground: l = Ai,
17502
17508
  bodyGap: d = 40
@@ -17613,7 +17619,7 @@ function q0({
17613
17619
  }
17614
17620
  );
17615
17621
  }
17616
- function Y0({
17622
+ function q0({
17617
17623
  title: e,
17618
17624
  itemId: t,
17619
17625
  count: n,
@@ -17658,7 +17664,7 @@ function Y0({
17658
17664
  }
17659
17665
  );
17660
17666
  }
17661
- function G0({
17667
+ function Y0({
17662
17668
  rows: e,
17663
17669
  columns: t,
17664
17670
  cornerLabel: n,
@@ -17677,7 +17683,7 @@ function G0({
17677
17683
  display: "inline-block",
17678
17684
  width: "max-content",
17679
17685
  padding: a ? 16 : 0,
17680
- border: a ? `1px dashed ${r0}` : void 0,
17686
+ border: a ? `1px dashed ${n0}` : void 0,
17681
17687
  borderRadius: a ? 4 : void 0
17682
17688
  },
17683
17689
  children: /* @__PURE__ */ g(
@@ -17755,11 +17761,11 @@ function G0({
17755
17761
  }
17756
17762
  );
17757
17763
  }
17758
- function o0(e) {
17764
+ function r0(e) {
17759
17765
  return e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^\p{L}\p{N}]+/gu, "-").replace(/^-+|-+$/g, "").toLowerCase() || "page";
17760
17766
  }
17761
17767
  function Hf(e, t, n = "PygmalionCatalog") {
17762
- const r = (o) => o0(o).replace(/-/g, "_");
17768
+ const r = (o) => r0(o).replace(/-/g, "_");
17763
17769
  return `${n}_${r(e)}_${r(t)}`;
17764
17770
  }
17765
17771
  function Uf(e, t) {
@@ -17781,10 +17787,10 @@ function Vf(e) {
17781
17787
  t.add(n.id);
17782
17788
  }
17783
17789
  }
17784
- function i0(e, t, n) {
17790
+ function o0(e, t, n) {
17785
17791
  return typeof e == "function" ? e(t, n) : e;
17786
17792
  }
17787
- function s0({
17793
+ function i0({
17788
17794
  page: e,
17789
17795
  items: t,
17790
17796
  renderPreview: n,
@@ -17888,7 +17894,7 @@ function s0({
17888
17894
  }
17889
17895
  );
17890
17896
  }
17891
- function X0(e) {
17897
+ function G0(e) {
17892
17898
  Vf(e.items);
17893
17899
  const t = /* @__PURE__ */ new Map();
17894
17900
  for (const o of e.items) {
@@ -17912,7 +17918,7 @@ function X0(e) {
17912
17918
  const n = {}, r = [];
17913
17919
  for (const o of t.values()) {
17914
17920
  const i = () => /* @__PURE__ */ s(
17915
- s0,
17921
+ i0,
17916
17922
  {
17917
17923
  page: o.page,
17918
17924
  items: o.items,
@@ -17925,7 +17931,7 @@ function X0(e) {
17925
17931
  component: i,
17926
17932
  children: "none"
17927
17933
  };
17928
- const a = i0(e.frame, o.page, o.items);
17934
+ const a = o0(e.frame, o.page, o.items);
17929
17935
  r.push({
17930
17936
  ...o.page,
17931
17937
  componentName: o.registryName,
@@ -17943,7 +17949,7 @@ function X0(e) {
17943
17949
  }
17944
17950
  };
17945
17951
  }
17946
- function a0(e, t = 60) {
17952
+ function s0(e, t = 60) {
17947
17953
  const n = Object.entries((e == null ? void 0 : e.props) ?? {}).filter(([, c]) => c.length > 0).sort(([c, l], [d, u]) => u.length - l.length || c.localeCompare(d)), r = n[0], o = n[1], i = Math.max(1, (r == null ? void 0 : r[1].length) ?? 1), a = o == null ? void 0 : o[1].slice(0, Math.max(1, Math.floor(t / i)));
17948
17954
  return {
17949
17955
  row: r,
@@ -17952,7 +17958,7 @@ function a0(e, t = 60) {
17952
17958
  additional: n.slice(2)
17953
17959
  };
17954
17960
  }
17955
- function c0(e, t, n, r) {
17961
+ function a0(e, t, n, r) {
17956
17962
  return {
17957
17963
  ...e.defaultProps,
17958
17964
  ...Object.fromEntries(t.fixed),
@@ -17960,7 +17966,7 @@ function c0(e, t, n, r) {
17960
17966
  ...t.column && r !== void 0 ? { [t.column[0]]: r } : {}
17961
17967
  };
17962
17968
  }
17963
- function l0({
17969
+ function c0({
17964
17970
  item: e,
17965
17971
  entry: t,
17966
17972
  maxVariantCells: n
@@ -17986,7 +17992,7 @@ function l0({
17986
17992
  ]
17987
17993
  }
17988
17994
  );
17989
- const r = a0(t, n), o = ((c = r.row) == null ? void 0 : c[1]) ?? [void 0], i = ((l = r.column) == null ? void 0 : l[1]) ?? [void 0], a = t.component;
17995
+ const r = s0(t, n), o = ((c = r.row) == null ? void 0 : c[1]) ?? [void 0], i = ((l = r.column) == null ? void 0 : l[1]) ?? [void 0], a = t.component;
17990
17996
  return /* @__PURE__ */ g(
17991
17997
  "section",
17992
17998
  {
@@ -18017,7 +18023,7 @@ function l0({
18017
18023
  children: o.flatMap(
18018
18024
  (d) => i.map((u) => {
18019
18025
  var b, x;
18020
- const p = c0(t, r, d, u), m = [
18026
+ const p = a0(t, r, d, u), m = [
18021
18027
  r.row && d !== void 0 ? `${((b = t.propLabels) == null ? void 0 : b[r.row[0]]) ?? r.row[0]}=${String(d)}` : "",
18022
18028
  r.column && u !== void 0 ? `${((x = t.propLabels) == null ? void 0 : x[r.column[0]]) ?? r.column[0]}=${String(u)}` : ""
18023
18029
  ].filter(Boolean).join(" · ");
@@ -18076,7 +18082,7 @@ function l0({
18076
18082
  }
18077
18083
  );
18078
18084
  }
18079
- function J0(e) {
18085
+ function X0(e) {
18080
18086
  Vf(e.items);
18081
18087
  const t = {}, n = [], r = [], o = e.maxVariantCells ?? 60;
18082
18088
  for (const i of e.items) {
@@ -18085,7 +18091,7 @@ function J0(e) {
18085
18091
  i.id,
18086
18092
  e.registryPrefix
18087
18093
  ), c = e.registry[i.name], l = () => /* @__PURE__ */ s(
18088
- l0,
18094
+ c0,
18089
18095
  {
18090
18096
  item: i,
18091
18097
  entry: c,
@@ -18113,7 +18119,7 @@ function J0(e) {
18113
18119
  }
18114
18120
  };
18115
18121
  }
18116
- const Ss = (e) => e.map((t) => `"${t.name}"`).join(", "), id = (e) => `${e.width ?? "?"}x${e.height ?? "?"}`, d0 = (e) => e.state ?? "default", u0 = (e) => e === void 0 ? "(no canvas)" : `"${e}"`, Vo = (e, t) => {
18122
+ const Ss = (e) => e.map((t) => `"${t.name}"`).join(", "), id = (e) => `${e.width ?? "?"}x${e.height ?? "?"}`, l0 = (e) => e.state ?? "default", d0 = (e) => e === void 0 ? "(no canvas)" : `"${e}"`, Vo = (e, t) => {
18117
18123
  const n = /* @__PURE__ */ new Map();
18118
18124
  for (const r of e) {
18119
18125
  const o = n.get(t(r));
@@ -18121,7 +18127,7 @@ const Ss = (e) => e.map((t) => `"${t.name}"`).join(", "), id = (e) => `${e.width
18121
18127
  }
18122
18128
  return n;
18123
18129
  };
18124
- function Q0(e) {
18130
+ function J0(e) {
18125
18131
  const t = Vo(
18126
18132
  e.filter((r) => !!r.scenario && r.route != null),
18127
18133
  (r) => r.scenario
@@ -18138,7 +18144,7 @@ function Q0(e) {
18138
18144
  }
18139
18145
  const i = Vo(o, (a) => a.canvas);
18140
18146
  if (i.size > 1) {
18141
- const a = [...i.entries()].map(([c, l]) => `${u0(c)}: ${Ss(l)}`).join("; ");
18147
+ const a = [...i.entries()].map(([c, l]) => `${d0(c)}: ${Ss(l)}`).join("; ");
18142
18148
  n.push({
18143
18149
  severity: "warning",
18144
18150
  code: "cross-canvas",
@@ -18156,7 +18162,7 @@ function Q0(e) {
18156
18162
  message: `Scenario "${r}" mixes viewports: ${d}; sibling states should share one viewport so flipping between them compares like with like.`
18157
18163
  });
18158
18164
  }
18159
- const l = Vo(a, d0);
18165
+ const l = Vo(a, l0);
18160
18166
  for (const [d, u] of l)
18161
18167
  u.length < 2 || n.push({
18162
18168
  severity: "warning",
@@ -18168,23 +18174,23 @@ function Q0(e) {
18168
18174
  }
18169
18175
  return n.sort((r, o) => r.severity !== o.severity ? r.severity === "warning" ? -1 : 1 : r.scenario < o.scenario ? -1 : r.scenario > o.scenario ? 1 : 0);
18170
18176
  }
18171
- const Kf = 42e4, f0 = 2e3, h0 = 500, p0 = 5e3, m0 = 3e4;
18172
- function g0(e) {
18173
- const t = p0 * 2 ** Math.max(0, e);
18174
- return Math.min(t, m0);
18177
+ const Kf = 42e4, u0 = 2e3, f0 = 500, h0 = 5e3, p0 = 3e4;
18178
+ function m0(e) {
18179
+ const t = h0 * 2 ** Math.max(0, e);
18180
+ return Math.min(t, p0);
18175
18181
  }
18176
- function b0(e) {
18182
+ function g0(e) {
18177
18183
  return new Promise((t) => setTimeout(t, e));
18178
18184
  }
18179
- async function x0(e) {
18185
+ async function b0(e) {
18180
18186
  const {
18181
18187
  initial: t,
18182
18188
  fetchStatus: n,
18183
18189
  requestResync: r,
18184
18190
  timeoutMs: o = Kf,
18185
- intervalMs: i = h0,
18191
+ intervalMs: i = f0,
18186
18192
  now: a = Date.now,
18187
- sleep: c = b0
18193
+ sleep: c = g0
18188
18194
  } = e;
18189
18195
  let l = t, d = !1;
18190
18196
  const u = a();
@@ -18201,9 +18207,9 @@ async function x0(e) {
18201
18207
  }
18202
18208
  return l;
18203
18209
  }
18204
- const sd = /^[a-f0-9]{64}$/, y0 = /^\/__pygmalion-qa\/artifacts\/[A-Za-z0-9_-]{8,120}\.png$/, v0 = /^p\d+$/;
18210
+ const sd = /^[a-f0-9]{64}$/, x0 = /^\/__pygmalion-qa\/artifacts\/[A-Za-z0-9_-]{8,120}\.png$/, y0 = /^p\d+$/;
18205
18211
  function Ma(e) {
18206
- return typeof e == "string" && y0.test(e) ? e : void 0;
18212
+ return typeof e == "string" && x0.test(e) ? e : void 0;
18207
18213
  }
18208
18214
  function ad(e, t) {
18209
18215
  const n = new URL(e, t);
@@ -18223,7 +18229,7 @@ function cd(e) {
18223
18229
  const t = e;
18224
18230
  return !Number.isSafeInteger(t.width) || !Number.isSafeInteger(t.height) || Number(t.width) < 1 || Number(t.height) < 1 || Number(t.width) > 65536 || Number(t.height) > 65536 ? null : { width: Number(t.width), height: Number(t.height) };
18225
18231
  }
18226
- function w0(e) {
18232
+ function v0(e) {
18227
18233
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
18228
18234
  const t = e, n = cd(t.before), r = cd(t.after);
18229
18235
  if (!n || !r || !Number.isSafeInteger(t.changedPixels) || !Number.isSafeInteger(t.totalPixels) || Number(t.changedPixels) < 0 || Number(t.totalPixels) < 1 || Number(t.changedPixels) > Number(t.totalPixels) || typeof t.threshold != "number" || !Number.isFinite(t.threshold) || t.threshold < 0 || t.threshold > 1)
@@ -18240,7 +18246,7 @@ function w0(e) {
18240
18246
  heatmapUrl: o
18241
18247
  };
18242
18248
  }
18243
- function S0(e, t) {
18249
+ function w0(e, t) {
18244
18250
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
18245
18251
  const n = e;
18246
18252
  if (typeof n.id != "string" || !n.id) return null;
@@ -18248,7 +18254,7 @@ function S0(e, t) {
18248
18254
  if (!o) return null;
18249
18255
  const i = Ns(n.after);
18250
18256
  if (t === "changed" && !i) return null;
18251
- const a = i ? w0(n.pixelDiff) : null;
18257
+ const a = i ? v0(n.pixelDiff) : null;
18252
18258
  return {
18253
18259
  id: n.id,
18254
18260
  before: o,
@@ -18260,7 +18266,7 @@ function S0(e, t) {
18260
18266
  ...a ? { pixelDiff: a } : {}
18261
18267
  };
18262
18268
  }
18263
- function N0(e, t = []) {
18269
+ function S0(e, t = []) {
18264
18270
  const n = new Set(t), r = n.size > 0, o = /* @__PURE__ */ new Set(), i = [
18265
18271
  ...e.styles.map((a) => a.affectedFrames ?? []),
18266
18272
  ...e.texts.map((a) => a.affectedFrames ?? []),
@@ -18268,7 +18274,7 @@ function N0(e, t = []) {
18268
18274
  ];
18269
18275
  for (const a of i)
18270
18276
  for (const c of a) {
18271
- if (r && v0.test(c.id) && !n.has(c.id))
18277
+ if (r && y0.test(c.id) && !n.has(c.id))
18272
18278
  throw new Error(
18273
18279
  `"Impact Screen"${c.name}"This internal editor ID (${c.id}) is used. A canonical screen ID is required.`
18274
18280
  );
@@ -18288,7 +18294,7 @@ async function ld(e, t, n) {
18288
18294
  );
18289
18295
  if (typeof o.baselineId != "string" || !o.baselineId)
18290
18296
  throw new Error("Pygmalion visual QA response has no baselineId");
18291
- const i = Array.isArray(o.frames) ? o.frames.map((u) => S0(u, n.phase)).filter((u) => u != null) : [], a = Array.isArray(o.failures) ? o.failures.map((u) => {
18297
+ const i = Array.isArray(o.frames) ? o.frames.map((u) => w0(u, n.phase)).filter((u) => u != null) : [], a = Array.isArray(o.failures) ? o.failures.map((u) => {
18292
18298
  if (!u || typeof u != "object" || Array.isArray(u)) return null;
18293
18299
  const p = u;
18294
18300
  return typeof p.id == "string" && typeof p.error == "string" ? { id: p.id, error: p.error } : null;
@@ -18305,12 +18311,12 @@ const Is = {
18305
18311
  mirror: "/__pygmalion-dev-control",
18306
18312
  sessions: "/__pygmalion-design-session",
18307
18313
  inspect: "/__pygmalion-inspect"
18308
- }, I0 = "pygmalion.designSessionId", C0 = "/__pygmalion-qa", Ko = /* @__PURE__ */ new Map();
18314
+ }, N0 = "pygmalion.designSessionId", I0 = "/__pygmalion-qa", Ko = /* @__PURE__ */ new Map();
18309
18315
  function dd() {
18310
18316
  var e;
18311
18317
  return typeof window < "u" && ((e = window.crypto) != null && e.randomUUID) ? window.crypto.randomUUID() : `pygmalion-${Date.now()}-${Math.random().toString(36).slice(2)}`;
18312
18318
  }
18313
- function P0(e, t) {
18319
+ function C0(e, t) {
18314
18320
  if (e) return e;
18315
18321
  const n = Ko.get(t);
18316
18322
  if (n) return n;
@@ -18330,23 +18336,23 @@ async function tn(e) {
18330
18336
  if (!e.ok) throw new Error(t.error ?? `Pygmalion request failed (${e.status})`);
18331
18337
  return t;
18332
18338
  }
18333
- const $0 = 3e4;
18334
- function Cs(e = $0) {
18339
+ const P0 = 3e4;
18340
+ function Cs(e = P0) {
18335
18341
  return typeof AbortSignal > "u" || typeof AbortSignal.timeout != "function" ? {} : { signal: AbortSignal.timeout(e) };
18336
18342
  }
18337
- function Z0(e = {}) {
18343
+ function Q0(e = {}) {
18338
18344
  var je, ce, ie, P, A;
18339
18345
  const {
18340
18346
  sessionId: t,
18341
- sessionStorageKey: n = I0,
18347
+ sessionStorageKey: n = N0,
18342
18348
  autoStart: r = !0,
18343
18349
  fetcher: o = fetch,
18344
18350
  formatApplyMessage: i
18345
- } = e, a = ((je = e.endpoints) == null ? void 0 : je.mirror) ?? Is.mirror, c = ((ce = e.endpoints) == null ? void 0 : ce.sessions) ?? Is.sessions, l = ((ie = e.endpoints) == null ? void 0 : ie.inspect) ?? Is.inspect, d = e.visualQa != null, u = ((P = e.visualQa) == null ? void 0 : P.endpoint) ?? C0, p = JSON.stringify(((A = e.visualQa) == null ? void 0 : A.eligibleFrameIds) ?? []), m = _t(
18351
+ } = e, a = ((je = e.endpoints) == null ? void 0 : je.mirror) ?? Is.mirror, c = ((ce = e.endpoints) == null ? void 0 : ce.sessions) ?? Is.sessions, l = ((ie = e.endpoints) == null ? void 0 : ie.inspect) ?? Is.inspect, d = e.visualQa != null, u = ((P = e.visualQa) == null ? void 0 : P.endpoint) ?? I0, p = JSON.stringify(((A = e.visualQa) == null ? void 0 : A.eligibleFrameIds) ?? []), m = _t(
18346
18352
  () => JSON.parse(p),
18347
18353
  [p]
18348
18354
  ), b = _t(
18349
- () => P0(t, n),
18355
+ () => C0(t, n),
18350
18356
  [t, n]
18351
18357
  ), [x, w] = Q({
18352
18358
  state: "idle",
@@ -18378,7 +18384,7 @@ function Z0(e = {}) {
18378
18384
  ...M || se ? {} : Cs()
18379
18385
  });
18380
18386
  let Se = await tn(Ee);
18381
- if (M || (Se = await x0({
18387
+ if (M || (Se = await b0({
18382
18388
  initial: Se,
18383
18389
  fetchStatus: async () => tn(
18384
18390
  await o(`${a}/status`, Cs())
@@ -18527,7 +18533,7 @@ function Z0(e = {}) {
18527
18533
  );
18528
18534
  if (!$.ok || !Number.isSafeInteger($.revision))
18529
18535
  throw new Error($.error ?? "Pygmalion could not preview the visual changes");
18530
- const de = d ? N0(M, m) : [];
18536
+ const de = d ? S0(M, m) : [];
18531
18537
  let se;
18532
18538
  const Ee = v.appOrigin ?? x.appOrigin;
18533
18539
  if (de.length > 0) {
@@ -18615,7 +18621,7 @@ function Z0(e = {}) {
18615
18621
  if (x.state !== "error") return;
18616
18622
  const M = window.setTimeout(() => {
18617
18623
  G(!1);
18618
- }, g0(ee.current++));
18624
+ }, m0(ee.current++));
18619
18625
  return () => window.clearTimeout(M);
18620
18626
  }, [r, k, x.state, G]), ae(() => {
18621
18627
  if (!r || x.state !== "idle") return;
@@ -18631,7 +18637,7 @@ function Z0(e = {}) {
18631
18637
  } catch {
18632
18638
  }
18633
18639
  })();
18634
- }, f0);
18640
+ }, u0);
18635
18641
  return () => {
18636
18642
  M = !0, window.clearInterval($);
18637
18643
  };
@@ -18656,7 +18662,7 @@ function Z0(e = {}) {
18656
18662
  revertLastVisual: O
18657
18663
  };
18658
18664
  }
18659
- function e1({
18665
+ function Z0({
18660
18666
  value: e,
18661
18667
  currentCommit: t = null,
18662
18668
  refs: n,
@@ -18751,7 +18757,7 @@ function e1({
18751
18757
  );
18752
18758
  }
18753
18759
  let qf = !1, Yf = "";
18754
- const t1 = {
18760
+ const e1 = {
18755
18761
  editor: f,
18756
18762
  getObserverTree: vp,
18757
18763
  isObservableProp: yp,
@@ -18761,8 +18767,8 @@ const t1 = {
18761
18767
  Promise.resolve().then(() => ea),
18762
18768
  Promise.resolve().then(() => og),
18763
18769
  Promise.resolve().then(() => nm),
18764
- import("./FrozenRoutePreview-Dh_-9mqN.js").then((u) => u.bf),
18765
- import("./FrozenRoutePreview-Dh_-9mqN.js").then((u) => u.be)
18770
+ import("./FrozenRoutePreview-Df_DH4UK.js").then((u) => u.bf),
18771
+ import("./FrozenRoutePreview-Df_DH4UK.js").then((u) => u.be)
18766
18772
  ]), a = i.getMountedShadowPreviewHandle(e), c = f.pages.find(
18767
18773
  (u) => u.id === e
18768
18774
  );
@@ -18862,17 +18868,17 @@ const t1 = {
18862
18868
  };
18863
18869
  }
18864
18870
  };
18865
- function n1(e) {
18871
+ function t1(e) {
18866
18872
  f.navigateToPageByName(e);
18867
18873
  }
18868
- function r1() {
18874
+ function n1() {
18869
18875
  f.openPreview();
18870
18876
  }
18871
- function o1() {
18877
+ function r1() {
18872
18878
  const e = J.entries.length > 0;
18873
18879
  return e && J.discardPending(), f.resetCurrentEdits() || e;
18874
18880
  }
18875
- function i1({
18881
+ function o1({
18876
18882
  registry: e,
18877
18883
  tokens: t,
18878
18884
  initialPages: n,
@@ -18932,7 +18938,7 @@ function i1({
18932
18938
  const [st, wt] = Q();
18933
18939
  d && (d.assertComplete(), Sp(d));
18934
18940
  const _ = e ?? (d == null ? void 0 : d.getRegistry()), he = t ?? (d == null ? void 0 : d.getTokens()), te = n ?? (d == null ? void 0 : d.getInitialPages());
18935
- _ && Np(_), Fx(i ?? []), he && Gx(he), kv(a ?? []), Rv(c ?? []), Xx(u ?? null), eu(b), Xd(
18941
+ _ && Np(_), Fx(i ?? []), he && Gx(he), Fv(a ?? []), iv(c ?? []), Xx(u ?? null), eu(b), Xd(
18936
18942
  !!(w != null && w.trim())
18937
18943
  );
18938
18944
  const xe = st ?? x, B = _t(
@@ -18988,7 +18994,7 @@ function i1({
18988
18994
  interactions: U.interactions,
18989
18995
  assertions: U.assertions
18990
18996
  })
18991
- ), v != null && ou(v), _p(k ?? null), L != null && Ip(L), W != null && Cp(W), Ry(q), f.initEditMode(o !== "view-only"), Nu(S ?? []), vu(j ?? 1), Ov(G ?? []), Pp(R ?? []), $p(T ?? []), Mp(I ?? [], N), Ep(F ?? []), kp(O ?? [], ee), Ap(Ae ?? []), jg($e ?? 0), Rp(je ?? []), Ob(ce ?? []), Dp(ie ?? null), zp(A ?? null), Tp(M ?? null), Op($ ?? null), te && f.initPagesFromComponents(te, { initialCanvas: r }), ai(() => {
18997
+ ), v != null && ou(v), _p(k ?? null), L != null && Ip(L), W != null && Cp(W), Ry(q), f.initEditMode(o !== "view-only"), Nu(S ?? []), vu(j ?? 1), Bv(G ?? []), Pp(R ?? []), $p(T ?? []), Mp(I ?? [], N), Ep(F ?? []), kp(O ?? [], ee), Ap(Ae ?? []), jg($e ?? 0), Rp(je ?? []), Ob(ce ?? []), Dp(ie ?? null), zp(A ?? null), Tp(M ?? null), Op($ ?? null), te && f.initPagesFromComponents(te, { initialCanvas: r }), ai(() => {
18992
18998
  p != null && Fp(p), m != null && Lp(m), Zm(l ?? []);
18993
18999
  }, [p, l, m]), ai(() => {
18994
19000
  !xe || !te || !_e || Qs(xe, {
@@ -19030,8 +19036,8 @@ function i1({
19030
19036
  const U = new AbortController(), oe = yb({
19031
19037
  endpoint: w,
19032
19038
  captureBaseUrl: p
19033
- }), ne = Ya(m), We = (Be) => {
19034
- Qs(Be, {
19039
+ }), ne = Ya(m), We = (Oe) => {
19040
+ Qs(Oe, {
19035
19041
  namespace: b,
19036
19042
  previewRevision: m,
19037
19043
  appOrigin: Uc(),
@@ -19045,23 +19051,23 @@ function i1({
19045
19051
  fingerprint: (Ve = Ne[Te]) == null ? void 0 : Ve.fingerprint
19046
19052
  };
19047
19053
  })
19048
- }), wt(Be);
19049
- }, Oe = (Be, Ue, Te, Ve) => $b({
19054
+ }), wt(Oe);
19055
+ }, ze = (Oe, Ue, Te, Ve) => $b({
19050
19056
  namespace: b,
19051
19057
  sourceRevision: ne,
19052
19058
  transport: oe,
19053
19059
  signal: Te,
19054
- ...Be.length ? { frames: Be } : {},
19060
+ ...Oe.length ? { frames: Oe } : {},
19055
19061
  ...Ue ? {} : { generate: !1 },
19056
19062
  ...Ve === void 0 ? {} : { priority: Ve }
19057
- }), le = (Be, Ue) => {
19063
+ }), le = (Oe, Ue) => {
19058
19064
  const Te = new Set(Ue);
19059
- return Be.filter((Ve) => Te.has(Ve.id));
19060
- }, Ge = (Be, Ue) => Be instanceof Error && Be.message ? Be.message : Ue, He = new AbortController();
19061
- if (Ys(async (Be, Ue) => {
19065
+ return Oe.filter((Ve) => Te.has(Ve.id));
19066
+ }, Ge = (Oe, Ue) => Oe instanceof Error && Oe.message ? Oe.message : Ue, He = new AbortController();
19067
+ if (Ys(async (Oe, Ue) => {
19062
19068
  var Ve, $t, pt, dt;
19063
- const Te = await Oe(
19064
- Be,
19069
+ const Te = await ze(
19070
+ Oe,
19065
19071
  !0,
19066
19072
  He.signal,
19067
19073
  Ue == null ? void 0 : Ue.priority
@@ -19069,7 +19075,7 @@ function i1({
19069
19075
  if (Te.status === "accepted") {
19070
19076
  We(Te.artifact);
19071
19077
  const un = new Set(((Ve = Te.frameResolution) == null ? void 0 : Ve.exact) ?? []);
19072
- if (Be.every((Je) => un.has(Je.id)))
19078
+ if (Oe.every((Je) => un.has(Je.id)))
19073
19079
  return { status: "accepted" };
19074
19080
  const zt = [
19075
19081
  ...(($t = Te.frameResolution) == null ? void 0 : $t.missing) ?? [],
@@ -19098,14 +19104,14 @@ function i1({
19098
19104
  ...(dt = Te.error) != null && dt.pygmalionNotPrepared ? { notPrepared: !0 } : {}
19099
19105
  };
19100
19106
  }), ve.current.length) {
19101
- const Be = ve.current.filter((Te) => {
19107
+ const Oe = ve.current.filter((Te) => {
19102
19108
  const Ve = Jt(
19103
19109
  Te.id,
19104
19110
  Te.fingerprint
19105
19111
  ).status;
19106
19112
  return Ve !== "exact" && Ve !== "generating";
19107
19113
  });
19108
- ft(Be, { status: "checking" });
19114
+ ft(Oe, { status: "checking" });
19109
19115
  const Ue = (Te) => Te.filter((Ve) => {
19110
19116
  const $t = Jt(
19111
19117
  Ve.id,
@@ -19127,12 +19133,12 @@ function i1({
19127
19133
  );
19128
19134
  ft(
19129
19135
  Ue(
19130
- Be.filter((Je) => Ve.has(Je.id))
19136
+ Oe.filter((Je) => Ve.has(Je.id))
19131
19137
  ),
19132
19138
  { status: "exact" }
19133
19139
  );
19134
19140
  const $t = Ue(
19135
- Be.filter((Je) => !Ve.has(Je.id))
19141
+ Oe.filter((Je) => !Ve.has(Je.id))
19136
19142
  ), pt = [];
19137
19143
  for (const Je of sl(
19138
19144
  $t
@@ -19172,7 +19178,7 @@ function i1({
19172
19178
  for (const Je of sl(
19173
19179
  Ue(pt)
19174
19180
  )) {
19175
- const Ke = await Oe(
19181
+ const Ke = await ze(
19176
19182
  Je,
19177
19183
  !1,
19178
19184
  U.signal
@@ -19205,7 +19211,7 @@ function i1({
19205
19211
  }
19206
19212
  })().catch((Te) => {
19207
19213
  if (U.signal.aborted) return;
19208
- const Ve = Ue(Be);
19214
+ const Ve = Ue(Oe);
19209
19215
  ft(Ve, {
19210
19216
  status: "error",
19211
19217
  reason: "unavailable",
@@ -19266,125 +19272,125 @@ function i1({
19266
19272
  const U = p ?? wn();
19267
19273
  if (!U) return;
19268
19274
  const oe = `${U}|${m ?? Yn()}`;
19269
- return re.current != null && re.current !== oe && Qg(), re.current = oe, Fw({
19275
+ return re.current != null && re.current !== oe && Qg(), re.current = oe, Tw({
19270
19276
  editor: f,
19271
19277
  getPages: () => f.pages,
19272
19278
  appOrigin: U,
19273
19279
  baselineEnvironment: Tt()
19274
19280
  });
19275
- }, [p, _e, m]), /* @__PURE__ */ s(Mw, { previewIdentityReady: _e });
19281
+ }, [p, _e, m]), /* @__PURE__ */ s($w, { previewIdentityReady: _e });
19276
19282
  }
19277
19283
  export {
19278
19284
  Vy as DEFAULT_DESIGN_COMPILE_LIMITS,
19279
- c1 as DESIGN_IMPORT_KINDS,
19285
+ a1 as DESIGN_IMPORT_KINDS,
19280
19286
  Hy as DESIGN_IR_SCHEMA,
19281
19287
  Uy as DESIGN_IR_VERSION,
19282
19288
  al as MIN_SURFACE_REASON_LENGTH,
19283
- q0 as PygmalionCatalogDocument,
19284
- G0 as PygmalionCatalogMatrix,
19285
- Y0 as PygmalionCatalogSection,
19286
- i1 as PygmalionEditor,
19289
+ K0 as PygmalionCatalogDocument,
19290
+ Y0 as PygmalionCatalogMatrix,
19291
+ q0 as PygmalionCatalogSection,
19292
+ o1 as PygmalionEditor,
19287
19293
  wp as STORYBOARD_ENVIRONMENT_CONTROL,
19288
- l1 as STORYBOARD_ENVIRONMENT_QUERY,
19289
- e1 as SourceRefControl,
19290
- t1 as __debug,
19291
- zv as applyScenarioCoverageClaim,
19292
- W0 as applyTokenOverride,
19294
+ c1 as STORYBOARD_ENVIRONMENT_QUERY,
19295
+ Z0 as SourceRefControl,
19296
+ e1 as __debug,
19297
+ Ov as applyScenarioCoverageClaim,
19298
+ j0 as applyTokenOverride,
19293
19299
  $b as bootstrapPreviewArtifact,
19294
- L0 as clearPreviewEnvironmentControlValues,
19300
+ F0 as clearPreviewEnvironmentControlValues,
19295
19301
  Hm as clearPygmalionPreviewCache,
19296
19302
  Zy as compileDesignDocument,
19297
- J0 as createDesignComponentCatalog,
19298
- a0 as createDesignComponentVariantMatrix,
19299
- X0 as createDesignGalleryCatalog,
19300
- d1 as createDesignImportController,
19301
- U0 as createDesignIntermediateDocument,
19302
- u1 as createDesignScreenCollection,
19303
+ X0 as createDesignComponentCatalog,
19304
+ s0 as createDesignComponentVariantMatrix,
19305
+ G0 as createDesignGalleryCatalog,
19306
+ l1 as createDesignImportController,
19307
+ H0 as createDesignIntermediateDocument,
19308
+ d1 as createDesignScreenCollection,
19303
19309
  yb as createPreviewArtifactHttpTransport,
19304
- _0 as createPreviewCacheNamespace,
19310
+ L0 as createPreviewCacheNamespace,
19305
19311
  pb as createPreviewFrameFingerprint,
19306
19312
  Lu as createPreviewRecipeFingerprint,
19307
19313
  xb as createStoryboardCaptureRecipeIdentity,
19308
- Ow as createStoryboardGraph,
19309
- t0 as createStoryboardGraphFromDiscovery,
19310
- kf as createStoryboardGraphViewModel,
19311
- Lw as createStoryboardPathEdges,
19314
+ zw as createStoryboardGraph,
19315
+ e0 as createStoryboardGraphFromDiscovery,
19316
+ Af as createStoryboardGraphViewModel,
19317
+ Fw as createStoryboardPathEdges,
19312
19318
  Of as createStoryboardRouteScenarioId,
19313
19319
  wr as createStoryboardRouteUrl,
19314
- o0 as designCatalogKey,
19320
+ r0 as designCatalogKey,
19315
19321
  Hf as designCatalogRegistryName,
19316
19322
  _b as enumerateControlCandidates,
19317
- j0 as enumerateDesignComponentConnectionCases,
19323
+ B0 as enumerateDesignComponentConnectionCases,
19318
19324
  zb as enumerateRequestCandidates,
19319
- z0 as enumerateRouteCandidates,
19320
- f1 as expandDesignScreenCasesViewports,
19321
- h1 as expandDesignScreenCollectionViewports,
19325
+ D0 as enumerateRouteCandidates,
19326
+ u1 as expandDesignScreenCasesViewports,
19327
+ f1 as expandDesignScreenCollectionViewports,
19322
19328
  Wu as frameSurfaceDemands,
19323
- p1 as framesMissingScenario,
19329
+ h1 as framesMissingScenario,
19324
19330
  Qy as getDesignCodegenAdapters,
19325
- B0 as getDesignComponentConnection,
19331
+ O0 as getDesignComponentConnection,
19326
19332
  ma as getDesignComponentConnectionForComponent,
19327
- O0 as getDesignComponentConnections,
19333
+ z0 as getDesignComponentConnections,
19328
19334
  Wb as getObservedRequests,
19329
19335
  tg as getPreviewEnvironmentControlValue,
19330
19336
  eg as getPreviewEnvironmentControls,
19331
19337
  rg as getPreviewEnvironmentOverride,
19332
19338
  Fa as getRecommendedPygmalionPreviewConcurrency,
19333
- Ul as getSelectedSessionPreset,
19334
- Tv as getSessionPresets,
19339
+ jl as getSelectedSessionPreset,
19340
+ sv as getSessionPresets,
19335
19341
  Tt as getStoryboardBaselineEnvironment,
19336
19342
  jf as getStoryboardDiscoveryBaselineEnvironment,
19337
- ho as getStoryboardGraph,
19343
+ mo as getStoryboardGraph,
19338
19344
  Bb as getSurfaceClassifications,
19339
- _f as getViewportPresets,
19345
+ Df as getViewportPresets,
19340
19346
  Wf as loadStoryboardDiscovery,
19341
- m1 as mergeScreenPresets,
19347
+ p1 as mergeScreenPresets,
19342
19348
  Dt as mergeStoryboardEnvironment,
19343
- K0 as publishStoryboardDiscovery,
19344
- n1 as pygmalionNavigate,
19345
- r1 as pygmalionOpenPreview,
19346
- o1 as pygmalionResetCurrentEdits,
19347
- F0 as reconstructRoutePreviewArtifactScreenshotV3,
19348
- T0 as reconstructRoutePreviewArtifactSnapshotV3,
19349
+ V0 as publishStoryboardDiscovery,
19350
+ t1 as pygmalionNavigate,
19351
+ n1 as pygmalionOpenPreview,
19352
+ r1 as pygmalionResetCurrentEdits,
19353
+ T0 as reconstructRoutePreviewArtifactScreenshotV3,
19354
+ R0 as reconstructRoutePreviewArtifactSnapshotV3,
19349
19355
  Jy as registerDesignCodegenAdapter,
19350
19356
  Db as requestEndpointShape,
19351
- H0 as resetTokenOverrides,
19357
+ W0 as resetTokenOverrides,
19352
19358
  Pb as resolvePreviewArtifactFrames,
19353
- Vw as resolveStoryboardScreenCases,
19354
- Df as selectSessionPreset,
19359
+ Uw as resolveStoryboardScreenCases,
19360
+ Mf as selectSessionPreset,
19355
19361
  Np as setComponentRegistry,
19356
19362
  Fx as setDesignComponentConnections,
19357
19363
  jb as setObservedRequests,
19358
19364
  ng as setPreviewEnvironmentControlValue,
19359
19365
  Zm as setPreviewEnvironmentControls,
19360
19366
  Fp as setPygmalionAppOrigin,
19361
- g1 as setPygmalionArtifactOrigin,
19367
+ m1 as setPygmalionArtifactOrigin,
19362
19368
  ou as setPygmalionPreviewConcurrency,
19363
19369
  Lp as setPygmalionPreviewRevision,
19364
- Rv as setSessionPresets,
19370
+ iv as setSessionPresets,
19365
19371
  ir as setStoryboardBaselineEnvironment,
19366
19372
  $n as setStoryboardGraph,
19367
19373
  Ob as setSurfaceClassifications,
19368
19374
  Gx as setTokens,
19369
- kv as setViewportPresets,
19370
- _w as storyboardScreenRecipeKey,
19375
+ Fv as setViewportPresets,
19376
+ Lw as storyboardScreenRecipeKey,
19371
19377
  nc as subscribePreviewEnvironmentControls,
19372
- Fv as subscribeSessionPresets,
19373
- Mf as subscribeStoryboardGraph,
19378
+ av as subscribeSessionPresets,
19379
+ Ef as subscribeStoryboardGraph,
19374
19380
  Eb as unclassifiedSurfaces,
19375
- Z0 as usePygmalionProject,
19381
+ Q0 as usePygmalionProject,
19376
19382
  ff as validateDesignComponentConnections,
19377
- b1 as validateFrameBranchKinds,
19378
- x1 as validateInteractiveStates,
19383
+ g1 as validateFrameBranchKinds,
19384
+ b1 as validateInteractiveStates,
19379
19385
  Cb as validatePreviewArtifactBundle,
19380
19386
  _i as validateRoutePreviewArtifactV3Browser,
19381
- V0 as validateScenarioCoverage,
19382
- y1 as validateScreenCards,
19383
- v1 as validateScreenDimensions,
19387
+ U0 as validateScenarioCoverage,
19388
+ x1 as validateScreenCards,
19389
+ y1 as validateScreenDimensions,
19384
19390
  Lg as validateScreenFlows,
19385
- w1 as validateScreenLanes,
19386
- S1 as validateScreenLists,
19387
- Q0 as validateScreenStateGroups,
19388
- N1 as validateSectionHeaders,
19389
- D0 as validateSurfaceDemands
19391
+ v1 as validateScreenLanes,
19392
+ w1 as validateScreenLists,
19393
+ J0 as validateScreenStateGroups,
19394
+ S1 as validateSectionHeaders,
19395
+ _0 as validateSurfaceDemands
19390
19396
  };