@pygmalionjs/pygmalion 0.2.24 → 0.2.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.
@@ -2,7 +2,7 @@ var Ah = Object.defineProperty;
2
2
  var Oh = (t, e, n) => e in t ? Ah(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
3
  var I = (t, e, n) => Oh(t, typeof e != "symbol" ? e + "" : e, n);
4
4
  import { jsx as c, jsxs as g, Fragment as Ke } from "react/jsx-runtime";
5
- import Eo, { useState as W, forwardRef as ia, memo as mi, createElement as nr, useReducer as Dd, useRef as ce, useEffect as le, useMemo as mo, useSyncExternalStore as Pn, Component as Mh } from "react";
5
+ import Eo, { useState as W, forwardRef as ia, memo as mi, createElement as nr, useReducer as Dd, useRef as le, useEffect as ce, useMemo as mo, useSyncExternalStore as Pn, Component as Mh } from "react";
6
6
  import { unstable_batchedUpdates as Ph, flushSync as Ih, createPortal as $h } from "react-dom";
7
7
  import { createRoot as Rd } from "react-dom/client";
8
8
  var kh = {
@@ -7372,8 +7372,8 @@ function mb() {
7372
7372
  const p = new pb();
7373
7373
  let Kl = 0;
7374
7374
  function Zu(t) {
7375
- const [, e] = Dd((i) => i + 1, 0), n = ce(null);
7376
- n.current || (n.current = new Bt(`useObserved#${++Kl}`, () => e())), le(() => (n.current || (n.current = new Bt(`useObserved#${++Kl}`, () => e()), e()), () => {
7375
+ const [, e] = Dd((i) => i + 1, 0), n = le(null);
7376
+ n.current || (n.current = new Bt(`useObserved#${++Kl}`, () => e())), ce(() => (n.current || (n.current = new Bt(`useObserved#${++Kl}`, () => e()), e()), () => {
7377
7377
  var i;
7378
7378
  (i = n.current) == null || i.dispose(), n.current = null;
7379
7379
  }), []);
@@ -7546,8 +7546,8 @@ const Qr = at(function({ count: e }) {
7546
7546
  ) : null;
7547
7547
  });
7548
7548
  function Ul({ node: t }) {
7549
- const e = ce(null);
7550
- return le(() => {
7549
+ const e = le(null);
7550
+ return ce(() => {
7551
7551
  const r = e.current;
7552
7552
  if (!r) return;
7553
7553
  r.focus();
@@ -8554,11 +8554,11 @@ function sd({
8554
8554
  affectedFrames: n = []
8555
8555
  }) {
8556
8556
  var Jc, Zc, Qc, el, tl;
8557
- const r = ce(null), [i, o] = W(null), [s, a] = W(null), [l, d] = W(null), [u, h] = W("cases"), [m, x] = W(!1), [b, w] = W(Wb), [S, N] = W(null), [y, A] = W("original"), [E, B] = W("default"), [C, R] = W("item"), [V, te] = W("base"), [L, de] = W({ minWidth: 768 }), [Ne, ne] = W(null), [G, fe] = W(!0), [Q, ve] = W(!1), [re, ze] = W(!1), [Oe, se] = W(null), [De, Re] = W(""), [M, oe] = W(!1), [J, me] = W(""), [T, he] = W(!1), [ae, H] = W(""), [ie, ge] = W(null), [be, Ue] = W(""), [nt, Ce] = W(""), [Wt, bt] = W(0), [fr, qe] = Dd((f) => f + 1, 0), hr = ce(""), vt = ce(null), Lr = ce(null);
8557
+ const r = le(null), [i, o] = W(null), [s, a] = W(null), [l, d] = W(null), [u, h] = W("cases"), [m, x] = W(!1), [b, w] = W(Wb), [S, N] = W(null), [y, A] = W("original"), [E, B] = W("default"), [C, R] = W("item"), [V, te] = W("base"), [L, de] = W({ minWidth: 768 }), [Ne, ne] = W(null), [G, fe] = W(!0), [J, ge] = W(!1), [re, ze] = W(!1), [Oe, se] = W(null), [De, Re] = W(""), [M, oe] = W(!1), [Z, be] = W(""), [T, he] = W(!1), [ae, H] = W(""), [ie, pe] = W(null), [ve, Ue] = W(""), [nt, Ce] = W(""), [Wt, bt] = W(0), [fr, qe] = Dd((f) => f + 1, 0), hr = le(""), vt = le(null), Lr = le(null);
8558
8558
  Lr.current = s;
8559
- const Ri = ce(null);
8559
+ const Ri = le(null);
8560
8560
  Ri.current = l;
8561
- const Le = ce(n);
8561
+ const Le = le(n);
8562
8562
  Le.current = n;
8563
8563
  const Rn = j.buildApplyPayload(), pr = JSON.stringify(Rn), mr = Vb(Rn), gr = JSON.stringify(mr);
8564
8564
  function Kt() {
@@ -8576,7 +8576,7 @@ function sd({
8576
8576
  v[_] = f.filter((O) => $.test(O.name));
8577
8577
  return v;
8578
8578
  }, []);
8579
- if (le(() => qe(), []), le(() => {
8579
+ if (ce(() => qe(), []), ce(() => {
8580
8580
  if (!D) return;
8581
8581
  const f = t == null ? void 0 : t.current;
8582
8582
  if (!f) return;
@@ -8584,7 +8584,7 @@ function sd({
8584
8584
  o(null), a(null), qe();
8585
8585
  };
8586
8586
  return f.addEventListener("load", v), () => f.removeEventListener("load", v);
8587
- }, [t, D]), le(
8587
+ }, [t, D]), ce(
8588
8588
  () => j.subscribe(() => {
8589
8589
  qe(), window.requestAnimationFrame(() => {
8590
8590
  var f;
@@ -8592,7 +8592,7 @@ function sd({
8592
8592
  });
8593
8593
  }),
8594
8594
  []
8595
- ), le(() => {
8595
+ ), ce(() => {
8596
8596
  const f = zg();
8597
8597
  if (!f || mr.length === 0) {
8598
8598
  he(!1), H("");
@@ -8603,12 +8603,12 @@ function sd({
8603
8603
  if (v) return;
8604
8604
  const $ = [.../* @__PURE__ */ new Set([...mr, ..._.files])], O = p.pages.filter(
8605
8605
  (X) => (X.sourcePaths ?? []).some(
8606
- (pe) => $.some((Je) => Bb(pe, Je))
8606
+ (me) => $.some((Je) => Bb(me, Je))
8607
8607
  )
8608
8608
  ).map((X) => ({ id: _i(X), name: X.name })), Y = [
8609
8609
  ...Le.current,
8610
8610
  ...O.filter(
8611
- (X) => !Le.current.some((pe) => pe.id === X.id)
8611
+ (X) => !Le.current.some((me) => me.id === X.id)
8612
8612
  )
8613
8613
  ];
8614
8614
  j.updateAffectedFrames(Y);
@@ -8619,9 +8619,9 @@ function sd({
8619
8619
  }), () => {
8620
8620
  v = !0;
8621
8621
  };
8622
- }, [gr]), le(() => qe(), [s]), le(() => {
8622
+ }, [gr]), ce(() => qe(), [s]), ce(() => {
8623
8623
  Kt(), N(null), A("original"), B("default"), R("item"), ne(null), Ue(""), Ce(""), bt(s ? Ro(s) ?? 0 : 0);
8624
- }, [s]), le(() => {
8624
+ }, [s]), ce(() => {
8625
8625
  Kt();
8626
8626
  const f = s != null && s.isConnected ? s : null;
8627
8627
  if (f) {
@@ -8631,7 +8631,7 @@ function sd({
8631
8631
  }
8632
8632
  return vt.current = Gb(f, { repeat: S, text: y, state: E }), qe(), () => Kt();
8633
8633
  }
8634
- }, [s, S, y, E]), le(() => () => Kt(), []), le(() => {
8634
+ }, [s, S, y, E]), ce(() => () => Kt(), []), ce(() => {
8635
8635
  const f = [window];
8636
8636
  D && q && q !== window && f.push(q), !D && (e != null && e.current) && f.push(e.current);
8637
8637
  const v = () => qe();
@@ -8641,22 +8641,22 @@ function sd({
8641
8641
  for (const _ of f)
8642
8642
  _.removeEventListener("scroll", v, { capture: !0 }), _.removeEventListener("resize", v);
8643
8643
  };
8644
- }, [q, D]), le(() => {
8644
+ }, [q, D]), ce(() => {
8645
8645
  const f = [window];
8646
8646
  D && q && q !== window && f.push(q);
8647
8647
  const v = (O) => {
8648
- if (O.key === "Alt" && ve(!0), Ri.current) return;
8648
+ if (O.key === "Alt" && ge(!0), Ri.current) return;
8649
8649
  (O.metaKey || O.ctrlKey) && O.key.toLowerCase() === "z" ? (O.preventDefault(), O.stopPropagation(), O.shiftKey ? j.redo() : j.undo()) : O.key === "Escape" && Lr.current && (O.stopPropagation(), a(null));
8650
8650
  }, _ = (O) => {
8651
- O.key === "Alt" && ve(!1);
8652
- }, $ = () => ve(!1);
8651
+ O.key === "Alt" && ge(!1);
8652
+ }, $ = () => ge(!1);
8653
8653
  for (const O of f)
8654
8654
  O.addEventListener("keydown", v, !0), O.addEventListener("keyup", _, !0), O.addEventListener("blur", $);
8655
8655
  return () => {
8656
8656
  for (const O of f)
8657
8657
  O.removeEventListener("keydown", v, !0), O.removeEventListener("keyup", _, !0), O.removeEventListener("blur", $);
8658
8658
  };
8659
- }, [q, D]), le(() => {
8659
+ }, [q, D]), ce(() => {
8660
8660
  const f = l;
8661
8661
  if (!f) return;
8662
8662
  let v = !1;
@@ -8671,7 +8671,7 @@ function sd({
8671
8671
  return f.addEventListener("keydown", $), f.addEventListener("blur", O), () => {
8672
8672
  f.removeEventListener("keydown", $), f.removeEventListener("blur", O);
8673
8673
  };
8674
- }, [l]), le(() => {
8674
+ }, [l]), ce(() => {
8675
8675
  if (j.toastSeq === 0) return;
8676
8676
  ze(!0);
8677
8677
  const f = window.setTimeout(() => ze(!1), 1800);
@@ -8737,12 +8737,12 @@ function sd({
8737
8737
  j.toast("Please check the diff after the impact screen calculation is complete.");
8738
8738
  return;
8739
8739
  }
8740
- oe(!0), me(""), se(null), Re("");
8740
+ oe(!0), be(""), se(null), Re("");
8741
8741
  try {
8742
8742
  const v = await f(Rn);
8743
8743
  se(v), Re(pr), j.toast(`Code diff ready · ${v.files.length} files`);
8744
8744
  } catch (v) {
8745
- me(String(v)), j.toast(`diff creation failed:${String(v).slice(0, 80)}`);
8745
+ be(String(v)), j.toast(`diff creation failed:${String(v).slice(0, 80)}`);
8746
8746
  } finally {
8747
8747
  oe(!1);
8748
8748
  }
@@ -8762,20 +8762,20 @@ function sd({
8762
8762
  }
8763
8763
  try {
8764
8764
  const O = await f(_);
8765
- j.clearApplied(), ge((O == null ? void 0 : O.qa) ?? null), se(null), Re(""), me("");
8765
+ j.clearApplied(), pe((O == null ? void 0 : O.qa) ?? null), se(null), Re(""), be("");
8766
8766
  const Y = O != null && O.qa ? O.qa.complete ? ` · ${O.qa.frames.length} affected frames checked` : ` · ${O.qa.failures.length} QA failures` : "";
8767
8767
  j.toast(`${(O == null ? void 0 : O.message) ?? `Applied ${(O == null ? void 0 : O.applied) ?? $} changes`}${Y}`);
8768
8768
  } catch (O) {
8769
8769
  j.toast(`Apply failed:${String(O).slice(0, 80)}`);
8770
8770
  }
8771
- }, P = s != null && s.isConnected ? s : null, wn = i != null && i.isConnected ? i : null, Z = P != null && P.parentElement && P.parentElement !== Ee ? P.parentElement : null, rt = C === "container" && Z ? Z : P, K = P ? $e(P.getBoundingClientRect()) : null, z = Z ? $e(Z.getBoundingClientRect()) : null, Fi = C === "container" && rt && rt !== P ? $e(rt.getBoundingClientRect()) : null, Oc = wn && wn !== P ? $e(wn.getBoundingClientRect()) : null, it = P ? q.getComputedStyle(P) : null, Ae = Z ? q.getComputedStyle(Z) : null, Mc = rt ? q.getComputedStyle(rt) : null, Mt = P ? He(P) : "", ot = P ? Se(P) : null, Sn = P ? It(P) : null, vr = P ? j.structuralEditKind(P) : null, eh = P ? j.hasPendingValueEdit(P) : !1, Pc = P ? j.structuralBlockReason(P, "insert") : "No elements are selected.", th = P ? j.structuralBlockReason(P, "remove") : "No elements are selected.", Ic = P ? j.structuralBlockReason(P, "move") : "No elements are selected.", us = P && P.parentElement ? Array.from(P.parentElement.children).indexOf(P) : -1, nh = ((Qc = P == null ? void 0 : P.parentElement) == null ? void 0 : Qc.children.length) ?? 0, $c = ot ? we()[ot.name] ?? null : null, kc = Sn && /^[A-Z]/.test(Sn.elementName) ? (ot == null ? void 0 : ot.name) ?? null : null, Tc = P ? j.componentInsertBlockReason(P, kc) : "No elements are selected.", fs = be.trim().toLocaleLowerCase(), zi = xe.filter(
8771
+ }, P = s != null && s.isConnected ? s : null, wn = i != null && i.isConnected ? i : null, Q = P != null && P.parentElement && P.parentElement !== Ee ? P.parentElement : null, rt = C === "container" && Q ? Q : P, K = P ? $e(P.getBoundingClientRect()) : null, z = Q ? $e(Q.getBoundingClientRect()) : null, Fi = C === "container" && rt && rt !== P ? $e(rt.getBoundingClientRect()) : null, Oc = wn && wn !== P ? $e(wn.getBoundingClientRect()) : null, it = P ? q.getComputedStyle(P) : null, Ae = Q ? q.getComputedStyle(Q) : null, Mc = rt ? q.getComputedStyle(rt) : null, Mt = P ? He(P) : "", ot = P ? Se(P) : null, Sn = P ? It(P) : null, vr = P ? j.structuralEditKind(P) : null, eh = P ? j.hasPendingValueEdit(P) : !1, Pc = P ? j.structuralBlockReason(P, "insert") : "No elements are selected.", th = P ? j.structuralBlockReason(P, "remove") : "No elements are selected.", Ic = P ? j.structuralBlockReason(P, "move") : "No elements are selected.", us = P && P.parentElement ? Array.from(P.parentElement.children).indexOf(P) : -1, nh = ((Qc = P == null ? void 0 : P.parentElement) == null ? void 0 : Qc.children.length) ?? 0, $c = ot ? we()[ot.name] ?? null : null, kc = Sn && /^[A-Z]/.test(Sn.elementName) ? (ot == null ? void 0 : ot.name) ?? null : null, Tc = P ? j.componentInsertBlockReason(P, kc) : "No elements are selected.", fs = ve.trim().toLocaleLowerCase(), zi = xe.filter(
8772
8772
  ([f, v]) => !fs || f.toLocaleLowerCase().includes(fs) || v.importPath.toLocaleLowerCase().includes(fs)
8773
- ), xt = zi.find(([f]) => f === nt) ?? zi[0] ?? null, Dc = (xt == null ? void 0 : xt[1]) ?? null, Li = xt ? xa(xt[0]) : null, Vr = (P ? Ro(P) : null) ?? 0, Rc = P ? qb(P, (ot == null ? void 0 : ot.props) ?? null, $c) : !1, hs = P ? Yb(P, (ot == null ? void 0 : ot.props) ?? null, $c) : [], Fc = P ? sf(P) : [], Fn = { count: Fc.length }, ps = Q && P && wn && wn !== P ? [P, wn] : null, zc = j.entries, Lc = Object.entries((ot == null ? void 0 : ot.primitiveProps) ?? {}), zn = Rn, on = zc.reduce((f, v) => {
8773
+ ), xt = zi.find(([f]) => f === nt) ?? zi[0] ?? null, Dc = (xt == null ? void 0 : xt[1]) ?? null, Li = xt ? xa(xt[0]) : null, Vr = (P ? Ro(P) : null) ?? 0, Rc = P ? qb(P, (ot == null ? void 0 : ot.props) ?? null, $c) : !1, hs = P ? Yb(P, (ot == null ? void 0 : ot.props) ?? null, $c) : [], Fc = P ? sf(P) : [], Fn = { count: Fc.length }, ps = J && P && wn && wn !== P ? [P, wn] : null, zc = j.entries, Lc = Object.entries((ot == null ? void 0 : ot.primitiveProps) ?? {}), zn = Rn, on = zc.reduce((f, v) => {
8774
8774
  const _ = f.find(($) => $.el === v.el);
8775
8775
  return _ ? (_.label = v.label, _.items.push(v)) : f.push({ id: v.id, el: v.el, label: v.label, items: [v] }), f;
8776
8776
  }, []), ji = zn.styles.length + zn.texts.length + zn.operations.length, Vi = xo() != null, ms = Vi && De !== pr, rh = on.filter(
8777
8777
  (f) => f.items.some((v) => !Zt(v))
8778
- ).length, gs = S != null || y !== "original" || E !== "default", Br = gs && P ? Qb(P, q) : null, Me = Jb(Ae), xr = Me != null, lt = Zb(Z), sn = V === "custom" ? L.minWidth != null || L.maxWidth != null ? {
8778
+ ).length, gs = S != null || y !== "original" || E !== "default", Br = gs && P ? Qb(P, q) : null, Me = Jb(Ae), xr = Me != null, lt = Zb(Q), sn = V === "custom" ? L.minWidth != null || L.maxWidth != null ? {
8779
8779
  ...L.minWidth != null ? { minWidth: Math.max(0, Math.round(L.minWidth)) } : {},
8780
8780
  ...L.maxWidth != null ? { maxWidth: Math.max(0, Math.round(L.maxWidth)) } : {}
8781
8781
  } : null : ((el = nd.find((f) => f.id === V)) == null ? void 0 : el.media) ?? null, bs = Fc.filter((f) => f.isConnected && q.getComputedStyle(f).getPropertyValue("display") !== "none").map((f, v) => ({ el: f, index: v, rect: $e(f.getBoundingClientRect()) })).filter(({ rect: f }) => f.width > 0 && f.height > 0), vs = bs.slice().sort((f, v) => f.rect.top - v.rect.top || f.rect.left - v.rect.left).reduce((f, v) => {
@@ -8789,8 +8789,8 @@ function sd({
8789
8789
  }), f;
8790
8790
  }, []).sort((f, v) => f.top - v.top), ih = vs.flatMap(
8791
8791
  (f, v) => f.items.slice(0, -1).map((_, $) => {
8792
- const O = f.items[$ + 1], Y = _.rect.left + _.rect.width, X = O.rect.left, pe = Math.max(_.rect.top, O.rect.top), Je = Math.min(_.rect.top + _.rect.height, O.rect.top + O.rect.height);
8793
- return { key: `${v}-${$}`, left: Y, top: pe, width: Math.max(0, X - Y), height: Math.max(16, Je - pe) };
8792
+ const O = f.items[$ + 1], Y = _.rect.left + _.rect.width, X = O.rect.left, me = Math.max(_.rect.top, O.rect.top), Je = Math.min(_.rect.top + _.rect.height, O.rect.top + O.rect.height);
8793
+ return { key: `${v}-${$}`, left: Y, top: me, width: Math.max(0, X - Y), height: Math.max(16, Je - me) };
8794
8794
  })
8795
8795
  ), oh = vs.slice(0, -1).map((f, v) => {
8796
8796
  const _ = vs[v + 1];
@@ -8807,12 +8807,12 @@ function sd({
8807
8807
  bottom: Math.max(0, yt(Ae, "padding-bottom")),
8808
8808
  left: Math.max(0, yt(Ae, "padding-left"))
8809
8809
  }, sh = dt.left, ah = dt.top, Wr = (Ae == null ? void 0 : Ae.getPropertyValue("justify-content")) || "normal", jc = (Ae == null ? void 0 : Ae.getPropertyValue("align-items")) || "normal", xs = (Ae == null ? void 0 : Ae.getPropertyValue("flex-direction")) || "row", ch = od(xs.includes("column") ? jc : Wr), lh = od(xs.includes("column") ? Wr : jc), dh = io(
8810
- (Z == null ? void 0 : Z.style.getPropertyValue("width")) || (z && z.width >= window.innerWidth * 0.8 ? "100%" : ""),
8810
+ (Q == null ? void 0 : Q.style.getPropertyValue("width")) || (z && z.width >= window.innerWidth * 0.8 ? "100%" : ""),
8811
8811
  (z == null ? void 0 : z.width) ?? 0
8812
8812
  ), uh = io(
8813
- (Z == null ? void 0 : Z.style.getPropertyValue("height")) || "",
8813
+ (Q == null ? void 0 : Q.style.getPropertyValue("height")) || "",
8814
8814
  (z == null ? void 0 : z.height) ?? 0
8815
- ), fh = io((P == null ? void 0 : P.style.getPropertyValue("width")) || "", (K == null ? void 0 : K.width) ?? 0), hh = io((P == null ? void 0 : P.style.getPropertyValue("height")) || "", (K == null ? void 0 : K.height) ?? 0), Vc = (it == null ? void 0 : it.getPropertyValue("align-self")) || "auto", ph = yt(it, "order"), Kr = (P == null ? void 0 : P.style.getPropertyValue("grid-column")) || (it == null ? void 0 : it.getPropertyValue("grid-column")) || "auto", Bc = Number(((tl = /span\s+(\d+)/.exec(Kr)) == null ? void 0 : tl[1]) ?? 1), ys = (it == null ? void 0 : it.getPropertyValue("position")) === "absolute", yr = Us(Z, (K == null ? void 0 : K.width) ?? 240), st = S ?? Math.max(1, Fn.count), Bi = Math.max(
8815
+ ), fh = io((P == null ? void 0 : P.style.getPropertyValue("width")) || "", (K == null ? void 0 : K.width) ?? 0), hh = io((P == null ? void 0 : P.style.getPropertyValue("height")) || "", (K == null ? void 0 : K.height) ?? 0), Vc = (it == null ? void 0 : it.getPropertyValue("align-self")) || "auto", ph = yt(it, "order"), Kr = (P == null ? void 0 : P.style.getPropertyValue("grid-column")) || (it == null ? void 0 : it.getPropertyValue("grid-column")) || "auto", Bc = Number(((tl = /span\s+(\d+)/.exec(Kr)) == null ? void 0 : tl[1]) ?? 1), ys = (it == null ? void 0 : it.getPropertyValue("position")) === "absolute", yr = Us(Q, (K == null ? void 0 : K.width) ?? 240), st = S ?? Math.max(1, Fn.count), Bi = Math.max(
8816
8816
  0,
8817
8817
  ((z == null ? void 0 : z.width) ?? 0) - dt.left - dt.right
8818
8818
  ), mh = Math.max(
@@ -8827,7 +8827,7 @@ function sd({
8827
8827
  ), ws = Math.max(
8828
8828
  0,
8829
8829
  (Bi - an * Math.max(0, st - 1)) / st
8830
- ), Wc = Math.max(80, Math.floor(ws)), bh = ws < 160, Kc = Me === "grid" && lt === st, vh = Me === "scroll" ? `${st} items · horizontal scroll · ${Math.round(Hc)}px cards` : `${st} items · ${gh} rows × ${Hi} columns · about ${Math.round(Hc)}px each`, xh = u === "cases" && !m && !!Z && !!z && !!K, Ln = !!Z && Z.scrollWidth > Z.clientWidth + 1 && !["auto", "scroll"].includes((Ae == null ? void 0 : Ae.getPropertyValue("overflow-x")) ?? ""), Uc = [
8830
+ ), Wc = Math.max(80, Math.floor(ws)), bh = ws < 160, Kc = Me === "grid" && lt === st, vh = Me === "scroll" ? `${st} items · horizontal scroll · ${Math.round(Hc)}px cards` : `${st} items · ${gh} rows × ${Hi} columns · about ${Math.round(Hc)}px each`, xh = u === "cases" && !m && !!Q && !!z && !!K, Ln = !!Q && Q.scrollWidth > Q.clientWidth + 1 && !["auto", "scroll"].includes((Ae == null ? void 0 : Ae.getPropertyValue("overflow-x")) ?? ""), Uc = [
8831
8831
  S != null ? `${S} items` : null,
8832
8832
  y === "long" ? "long text" : y === "extreme" ? "extreme text" : null,
8833
8833
  E === "selected" ? "selection status" : E === "disabled" ? "inactive" : E === "loading" ? "loading status" : null
@@ -8836,20 +8836,20 @@ function sd({
8836
8836
  }, Ki = (f, v, _, $) => {
8837
8837
  if (f.button !== 0) return;
8838
8838
  f.preventDefault(), f.stopPropagation();
8839
- const O = f.clientX, Y = f.clientY, X = document.body.style.cursor, pe = document.body.style.userSelect;
8839
+ const O = f.clientX, Y = f.clientY, X = document.body.style.cursor, me = document.body.style.userSelect;
8840
8840
  document.body.style.cursor = v, document.body.style.userSelect = "none";
8841
8841
  const Je = (Nn) => {
8842
8842
  _(Nn.clientX - O, Nn.clientY - Y), qe();
8843
8843
  }, _n = () => {
8844
- window.removeEventListener("pointermove", Je), window.removeEventListener("pointerup", _n), document.body.style.cursor = X, document.body.style.userSelect = pe, $(), qe();
8844
+ window.removeEventListener("pointermove", Je), window.removeEventListener("pointerup", _n), document.body.style.cursor = X, document.body.style.userSelect = me, $(), qe();
8845
8845
  };
8846
8846
  window.addEventListener("pointermove", Je), window.addEventListener("pointerup", _n, { once: !0 });
8847
8847
  }, Pe = (f, v) => {
8848
- Z && j.recordStyle(
8849
- Z,
8848
+ Q && j.recordStyle(
8849
+ Q,
8850
8850
  f,
8851
8851
  v,
8852
- He(Z),
8852
+ He(Q),
8853
8853
  sn,
8854
8854
  Le.current
8855
8855
  );
@@ -8864,7 +8864,7 @@ function sd({
8864
8864
  Le.current
8865
8865
  ), (_ = vt.current) == null || _.mirrorStyle(P, f, v));
8866
8866
  }, Ss = (f) => {
8867
- if (!Z) return;
8867
+ if (!Q) return;
8868
8868
  const v = Kb.find((_) => _.mode === f);
8869
8869
  if (v) {
8870
8870
  for (const [_, $] of Object.entries(v.declarations)) Pe(_, $);
@@ -8874,66 +8874,66 @@ function sd({
8874
8874
  R("container"), j.toast(`${v.label}change to batch`);
8875
8875
  }
8876
8876
  }, Ur = (f) => {
8877
- !Z || !P || (Pe("display", "grid"), Pe("grid-template-columns", `repeat(${f}, minmax(0, 1fr))`), Fe("width", "auto"), Fe("min-width", "0"), j.toast(`Maximum ${f} per row · ${Bn(sn)}`));
8877
+ !Q || !P || (Pe("display", "grid"), Pe("grid-template-columns", `repeat(${f}, minmax(0, 1fr))`), Fe("width", "auto"), Fe("min-width", "0"), j.toast(`Maximum ${f} per row · ${Bn(sn)}`));
8878
8878
  }, Ui = (f) => {
8879
- if (!Z || !P) return;
8879
+ if (!Q || !P) return;
8880
8880
  const v = Math.max(
8881
8881
  80,
8882
8882
  Math.min(
8883
8883
  600,
8884
8884
  Math.round(
8885
- typeof f == "number" ? f : Us(Z, (K == null ? void 0 : K.width) ?? 240)
8885
+ typeof f == "number" ? f : Us(Q, (K == null ? void 0 : K.width) ?? 240)
8886
8886
  )
8887
8887
  )
8888
8888
  );
8889
8889
  Pe("display", "grid"), Pe("grid-template-columns", `repeat(auto-fit, minmax(min(${v}px, 100%), 1fr))`), Fe("width", "auto"), Fe("min-width", "0"), j.toast(`Automatic columns · minimum ${v}px · ${Bn(sn)}`);
8890
8890
  }, _s = (f, v) => {
8891
- if (!Z) return;
8892
- const _ = Z.style.getPropertyValue(f), $ = f === "column-gap" ? an : f === "row-gap" ? Hr : dt[f.replace("padding-", "")];
8891
+ if (!Q) return;
8892
+ const _ = Q.style.getPropertyValue(f), $ = f === "column-gap" ? an : f === "row-gap" ? Hr : dt[f.replace("padding-", "")];
8893
8893
  let O = $;
8894
8894
  const Y = f === "column-gap" || f === "padding-left" || f === "padding-right", X = f === "padding-right" || f === "padding-bottom" ? -1 : 1;
8895
8895
  ne(f), f.startsWith("padding-") && fe(!1), Ki(
8896
8896
  v,
8897
8897
  Y ? "ew-resize" : "ns-resize",
8898
- (pe, Je) => {
8899
- O = Math.max(0, Math.min(256, Math.round($ + (Y ? pe : Je) * X))), Z.style.setProperty(f, `${O}px`);
8898
+ (me, Je) => {
8899
+ O = Math.max(0, Math.min(256, Math.round($ + (Y ? me : Je) * X))), Q.style.setProperty(f, `${O}px`);
8900
8900
  },
8901
8901
  () => {
8902
- jn(Z, f, _), Pe(f, `${O}px`), ne(null), j.toast(
8902
+ jn(Q, f, _), Pe(f, `${O}px`), ne(null), j.toast(
8903
8903
  `${f === "column-gap" ? "column spacing" : f === "row-gap" ? "row spacing" : f.replace("padding-", "padding")} ${O}px`
8904
8904
  );
8905
8905
  }
8906
8906
  );
8907
8907
  }, qi = (f, v) => {
8908
- if (!Z || !z) return;
8909
- const _ = Z.style.getPropertyValue("width"), $ = Z.style.getPropertyValue("height");
8908
+ if (!Q || !z) return;
8909
+ const _ = Q.style.getPropertyValue("width"), $ = Q.style.getPropertyValue("height");
8910
8910
  let O = Math.round(z.width), Y = Math.round(z.height);
8911
8911
  Ki(
8912
8912
  v,
8913
8913
  f === "width" ? "ew-resize" : f === "height" ? "ns-resize" : "nwse-resize",
8914
- (X, pe) => {
8915
- f !== "height" && (O = Math.max(200, Math.min(1920, Math.round(z.width + X))), Z.style.setProperty("width", `${O}px`)), f !== "width" && (Y = Math.max(80, Math.min(1600, Math.round(z.height + pe))), Z.style.setProperty("height", `${Y}px`));
8914
+ (X, me) => {
8915
+ f !== "height" && (O = Math.max(200, Math.min(1920, Math.round(z.width + X))), Q.style.setProperty("width", `${O}px`)), f !== "width" && (Y = Math.max(80, Math.min(1600, Math.round(z.height + me))), Q.style.setProperty("height", `${Y}px`));
8916
8916
  },
8917
8917
  () => {
8918
- jn(Z, "width", _), jn(Z, "height", $), f !== "height" && Pe("width", `${O}px`), f !== "width" && Pe("height", `${Y}px`), j.toast(`container${O} × ${Y}px`);
8918
+ jn(Q, "width", _), jn(Q, "height", $), f !== "height" && Pe("width", `${O}px`), f !== "width" && Pe("height", `${Y}px`), j.toast(`container${O} × ${Y}px`);
8919
8919
  }
8920
8920
  );
8921
8921
  }, yh = (f) => {
8922
- if (!Z || !P) return;
8923
- const v = Z.style.getPropertyValue("display"), _ = Z.style.getPropertyValue("grid-template-columns"), $ = P.style.getPropertyValue("min-width"), O = Us(Z, (K == null ? void 0 : K.width) ?? 240);
8922
+ if (!Q || !P) return;
8923
+ const v = Q.style.getPropertyValue("display"), _ = Q.style.getPropertyValue("grid-template-columns"), $ = P.style.getPropertyValue("min-width"), O = Us(Q, (K == null ? void 0 : K.width) ?? 240);
8924
8924
  let Y = O;
8925
8925
  Ki(
8926
8926
  f,
8927
8927
  "ew-resize",
8928
8928
  (X) => {
8929
- var pe;
8930
- Y = Math.max(80, Math.min(600, Math.round(O + X))), Z.style.setProperty("display", "grid"), Z.style.setProperty(
8929
+ var me;
8930
+ Y = Math.max(80, Math.min(600, Math.round(O + X))), Q.style.setProperty("display", "grid"), Q.style.setProperty(
8931
8931
  "grid-template-columns",
8932
8932
  `repeat(auto-fit, minmax(min(${Y}px, 100%), 1fr))`
8933
- ), P.style.setProperty("min-width", "0"), (pe = vt.current) == null || pe.mirrorStyle(P, "min-width", "0");
8933
+ ), P.style.setProperty("min-width", "0"), (me = vt.current) == null || me.mirrorStyle(P, "min-width", "0");
8934
8934
  },
8935
8935
  () => {
8936
- jn(Z, "display", v), jn(Z, "grid-template-columns", _), jn(P, "min-width", $), Pe("display", "grid"), Pe("grid-template-columns", `repeat(auto-fit, minmax(min(${Y}px, 100%), 1fr))`), Fe("min-width", "0"), j.toast(`item minimum width${Y}px`);
8936
+ jn(Q, "display", v), jn(Q, "grid-template-columns", _), jn(P, "min-width", $), Pe("display", "grid"), Pe("grid-template-columns", `repeat(auto-fit, minmax(min(${Y}px, 100%), 1fr))`), Fe("min-width", "0"), j.toast(`item minimum width${Y}px`);
8937
8937
  }
8938
8938
  );
8939
8939
  }, wh = (f) => {
@@ -9015,14 +9015,14 @@ function sd({
9015
9015
  pointerEvents: "none"
9016
9016
  }), wr = { lines: [], labels: [] };
9017
9017
  if (ps) {
9018
- const f = $e(ps[0].getBoundingClientRect()), v = $e(ps[1].getBoundingClientRect()), _ = f.left + f.width, $ = f.top + f.height, O = v.left + v.width, Y = v.top + v.height, X = _ <= v.left ? { from: _, to: v.left } : O <= f.left ? { from: O, to: f.left } : null, pe = $ <= v.top ? { from: $, to: v.top } : Y <= f.top ? { from: Y, to: f.top } : null;
9018
+ const f = $e(ps[0].getBoundingClientRect()), v = $e(ps[1].getBoundingClientRect()), _ = f.left + f.width, $ = f.top + f.height, O = v.left + v.width, Y = v.top + v.height, X = _ <= v.left ? { from: _, to: v.left } : O <= f.left ? { from: O, to: f.left } : null, me = $ <= v.top ? { from: $, to: v.top } : Y <= f.top ? { from: Y, to: f.top } : null;
9019
9019
  if (X && X.to - X.from > 0.5) {
9020
9020
  const Je = X.to - X.from, _n = Math.max(f.top, v.top), Nn = Math.min($, Y), Yr = Nn > _n ? (_n + Nn) / 2 : (f.top + $ + v.top + Y) / 4;
9021
9021
  wr.lines.push({ left: X.from, top: Yr - 0.5, width: Je, height: 1 }), wr.labels.push({ x: X.from + Je / 2, y: Yr, text: `${Math.round(Je)}px` });
9022
9022
  }
9023
- if (pe && pe.to - pe.from > 0.5) {
9024
- const Je = pe.to - pe.from, _n = Math.max(f.left, v.left), Nn = Math.min(_, O), Yr = Nn > _n ? (_n + Nn) / 2 : (f.left + _ + v.left + O) / 4;
9025
- wr.lines.push({ left: Yr - 0.5, top: pe.from, width: 1, height: Je }), wr.labels.push({ x: Yr, y: pe.from + Je / 2, text: `${Math.round(Je)}px` });
9023
+ if (me && me.to - me.from > 0.5) {
9024
+ const Je = me.to - me.from, _n = Math.max(f.left, v.left), Nn = Math.min(_, O), Yr = Nn > _n ? (_n + Nn) / 2 : (f.left + _ + v.left + O) / 4;
9025
+ wr.lines.push({ left: Yr - 0.5, top: me.from, width: 1, height: Je }), wr.labels.push({ x: Yr, y: me.from + Je / 2, text: `${Math.round(Je)}px` });
9026
9026
  }
9027
9027
  }
9028
9028
  const Xi = 7, Eh = K ? [
@@ -9738,7 +9738,7 @@ function sd({
9738
9738
  Ie,
9739
9739
  {
9740
9740
  title: "Auto layout",
9741
- action: Z ? /* @__PURE__ */ c(
9741
+ action: Q ? /* @__PURE__ */ c(
9742
9742
  "button",
9743
9743
  {
9744
9744
  type: "button",
@@ -9752,7 +9752,7 @@ function sd({
9752
9752
  children: xr ? "Applied" : "+ add"
9753
9753
  }
9754
9754
  ) : null,
9755
- children: Z && z ? /* @__PURE__ */ g(Ke, { children: [
9755
+ children: Q && z ? /* @__PURE__ */ g(Ke, { children: [
9756
9756
  /* @__PURE__ */ g(
9757
9757
  "button",
9758
9758
  {
@@ -10040,7 +10040,7 @@ function sd({
10040
10040
  ] }) : /* @__PURE__ */ c("div", { className: "text-[11px] text-[#a1a1aa]", children: "There is no parent frame." })
10041
10041
  }
10042
10042
  ),
10043
- Z && /* @__PURE__ */ c(Ke, { children: /* @__PURE__ */ g(Ie, { title: "Child · Resizing", children: [
10043
+ Q && /* @__PURE__ */ c(Ke, { children: /* @__PURE__ */ g(Ie, { title: "Child · Resizing", children: [
10044
10044
  /* @__PURE__ */ c("div", { className: "grid grid-cols-4 gap-1", children: [
10045
10045
  ["auto", "Auto"],
10046
10046
  ["flex-start", "start"],
@@ -10157,7 +10157,7 @@ function sd({
10157
10157
  "button",
10158
10158
  {
10159
10159
  type: "button",
10160
- disabled: !Z,
10160
+ disabled: !Q,
10161
10161
  className: "h-8 rounded-md bg-[#18181b] text-[10px] font-semibold text-white disabled:bg-[#d4d4d8]",
10162
10162
  onClick: () => qc("container"),
10163
10163
  children: "Container"
@@ -10192,7 +10192,7 @@ function sd({
10192
10192
  type: "button",
10193
10193
  className: "h-9 rounded-md bg-[#18181b] text-[10px] font-semibold text-white hover:bg-black",
10194
10194
  onClick: () => {
10195
- on.length > 0 && !window.confirm("Reset all unapplied editor changes? This also clears undo and redo history.") || (Kt(), N(null), A("original"), B("default"), j.discardPending(), se(null), Re(""), me(""), j.toast("Reset all unapplied changes"), qe());
10195
+ on.length > 0 && !window.confirm("Reset all unapplied editor changes? This also clears undo and redo history.") || (Kt(), N(null), A("original"), B("default"), j.discardPending(), se(null), Re(""), be(""), j.toast("Reset all unapplied changes"), qe());
10196
10196
  },
10197
10197
  children: "Reset changes"
10198
10198
  }
@@ -10218,7 +10218,7 @@ function sd({
10218
10218
  {
10219
10219
  type: "button",
10220
10220
  "aria-pressed": C === "container",
10221
- disabled: !Z,
10221
+ disabled: !Q,
10222
10222
  className: `h-8 rounded-md text-[10px] font-semibold ${C === "container" ? "bg-white text-[#6d28d9] shadow-sm" : "text-[#71717a] hover:text-[#18181b] disabled:text-[#c4c4c8]"}`,
10223
10223
  onClick: () => R("container"),
10224
10224
  children: "Repeat container"
@@ -10303,7 +10303,7 @@ function sd({
10303
10303
  "input",
10304
10304
  {
10305
10305
  type: "search",
10306
- value: be,
10306
+ value: ve,
10307
10307
  placeholder: "Search for component name or import path",
10308
10308
  "aria-label": "Search for component to insert",
10309
10309
  className: "h-8 w-full rounded-md bg-[#f4f4f5] px-2 text-[10px] text-[#18181b] outline-none placeholder:text-[#a1a1aa] focus:ring-1 focus:ring-inset focus:ring-[#0d99ff]",
@@ -10455,12 +10455,12 @@ function sd({
10455
10455
  const _ = zc.find(
10456
10456
  (X) => X.kind === "prop" && X.el === P && X.prop === f
10457
10457
  ), $ = _ ? typeof v == "boolean" ? _.to === "true" : typeof v == "number" ? Number(_.to) : _.to : v, O = rc(P, f), Y = (X) => {
10458
- const pe = typeof v == "number" ? Number(X) : X;
10459
- typeof pe == "number" && !Number.isFinite(pe) || pe !== $ && j.recordProp(
10458
+ const me = typeof v == "number" ? Number(X) : X;
10459
+ typeof me == "number" && !Number.isFinite(me) || me !== $ && j.recordProp(
10460
10460
  P,
10461
10461
  f,
10462
10462
  v,
10463
- pe,
10463
+ me,
10464
10464
  Mt,
10465
10465
  Sn,
10466
10466
  Le.current
@@ -10597,7 +10597,7 @@ function sd({
10597
10597
  disabled: on.length === 0,
10598
10598
  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]",
10599
10599
  onClick: () => {
10600
- window.confirm("Reset all unapplied editor changes? This also clears undo and redo history.") && (Kt(), N(null), A("original"), B("default"), j.discardPending(), se(null), Re(""), me(""), j.toast("Reset all unapplied changes"));
10600
+ window.confirm("Reset all unapplied editor changes? This also clears undo and redo history.") && (Kt(), N(null), A("original"), B("default"), j.discardPending(), se(null), Re(""), be(""), j.toast("Reset all unapplied changes"));
10601
10601
  },
10602
10602
  children: "Reset changes"
10603
10603
  }
@@ -10620,12 +10620,12 @@ function sd({
10620
10620
  ]
10621
10621
  }
10622
10622
  ),
10623
- Vi && (Oe || J) && /* @__PURE__ */ c(
10623
+ Vi && (Oe || Z) && /* @__PURE__ */ c(
10624
10624
  Ie,
10625
10625
  {
10626
10626
  title: "code diff",
10627
10627
  action: ms ? /* @__PURE__ */ c("span", { className: "rounded bg-[#fef3c7] px-1.5 py-0.5 text-[9px] font-semibold text-[#b45309]", children: "Changes updated · Review again" }) : /* @__PURE__ */ c("span", { className: "rounded bg-[#dcfce7] px-1.5 py-0.5 text-[9px] font-semibold text-[#15803d]", children: "Reviewed and ready to apply" }),
10628
- children: J ? /* @__PURE__ */ c("div", { className: "rounded-md bg-[#fef2f2] px-2.5 py-2 text-[10px] leading-relaxed text-[#b91c1c]", children: J }) : Oe && Oe.files.length > 0 ? /* @__PURE__ */ g("div", { className: "flex flex-col gap-2", children: [
10628
+ children: Z ? /* @__PURE__ */ c("div", { className: "rounded-md bg-[#fef2f2] px-2.5 py-2 text-[10px] leading-relaxed text-[#b91c1c]", children: Z }) : Oe && Oe.files.length > 0 ? /* @__PURE__ */ g("div", { className: "flex flex-col gap-2", children: [
10629
10629
  Oe.files.map((f) => /* @__PURE__ */ g("div", { className: "overflow-hidden rounded-md border border-[#e4e4e7] bg-[#18181b]", children: [
10630
10630
  /* @__PURE__ */ c("div", { className: "truncate border-b border-white/10 px-2 py-1.5 font-mono text-[9px] font-semibold text-white/80", children: f.file }),
10631
10631
  /* @__PURE__ */ c("pre", { className: "max-h-56 overflow-auto whitespace-pre p-2 font-mono text-[9px] leading-relaxed text-[#e4e4e7]", children: f.diff })
@@ -10707,10 +10707,10 @@ function sd({
10707
10707
  f.pixelDiff.totalPixels.toLocaleString("en-US"),
10708
10708
  !f.pixelDiff.dimensionsMatch && `· size${f.pixelDiff.before.width}×${f.pixelDiff.before.height} → ${f.pixelDiff.after.width}×${f.pixelDiff.after.height}`
10709
10709
  ] }),
10710
- $.length > 0 && /* @__PURE__ */ c("div", { className: "mt-2 grid grid-cols-3 gap-1", children: $.map(([X, pe]) => /* @__PURE__ */ g(
10710
+ $.length > 0 && /* @__PURE__ */ c("div", { className: "mt-2 grid grid-cols-3 gap-1", children: $.map(([X, me]) => /* @__PURE__ */ g(
10711
10711
  "a",
10712
10712
  {
10713
- href: pe,
10713
+ href: me,
10714
10714
  target: "_blank",
10715
10715
  rel: "noreferrer",
10716
10716
  className: "overflow-hidden rounded border border-[#e4e4e7] bg-white",
@@ -10719,7 +10719,7 @@ function sd({
10719
10719
  /* @__PURE__ */ c(
10720
10720
  "img",
10721
10721
  {
10722
- src: pe,
10722
+ src: me,
10723
10723
  alt: `${f.id} ${X}`,
10724
10724
  loading: "lazy",
10725
10725
  className: "h-14 w-full object-cover object-top"
@@ -10967,7 +10967,7 @@ function $a(t, e) {
10967
10967
  }
10968
10968
  function ud() {
10969
10969
  const [, t] = W(0);
10970
- return le(() => j.subscribe(() => t((e) => e + 1)), []), /* @__PURE__ */ g("div", { className: "flex shrink-0 items-center gap-0.5", "aria-label": "Inspection change history", children: [
10970
+ return ce(() => j.subscribe(() => t((e) => e + 1)), []), /* @__PURE__ */ g("div", { className: "flex shrink-0 items-center gap-0.5", "aria-label": "Inspection change history", children: [
10971
10971
  /* @__PURE__ */ c(
10972
10972
  "button",
10973
10973
  {
@@ -10997,8 +10997,8 @@ function ud() {
10997
10997
  ] });
10998
10998
  }
10999
10999
  const iv = at(function({ onClose: e }) {
11000
- const n = Pn(Wu, wi, wi), r = p.activePage, i = ce(null), o = ce(null), [s, a] = W(!1);
11001
- if (le(() => j.reset(), []), r.route != null) {
11000
+ const n = Pn(Wu, wi, wi), r = p.activePage, i = le(null), o = le(null), [s, a] = W(!1);
11001
+ if (ce(() => j.reset(), []), r.route != null) {
11002
11002
  const l = () => {
11003
11003
  if (!i.current) return;
11004
11004
  const d = Qn(), u = d ? d.captureIframe(i.current) : ya(i.current, {
@@ -16206,11 +16206,11 @@ function ky({
16206
16206
  onDocumentHeightChange: i,
16207
16207
  onReplayIssuesChange: o
16208
16208
  }) {
16209
- const s = ce(null), a = ce(() => {
16210
- }), l = ce(() => {
16211
- }), d = ce(i);
16209
+ const s = le(null), a = le(() => {
16210
+ }), l = le(() => {
16211
+ }), d = le(i);
16212
16212
  d.current = i;
16213
- const u = ce(0), [h, m] = W([]), [x, b] = W("none"), w = p.frozenPreviewOverrideCss(t), S = p.frozenPreviewCssRules(), N = p.frozenPreviewMutations(), y = JSON.stringify({ cssRules: S, mutations: N }), A = () => {
16213
+ const u = le(0), [h, m] = W([]), [x, b] = W("none"), w = p.frozenPreviewOverrideCss(t), S = p.frozenPreviewCssRules(), N = p.frozenPreviewMutations(), y = JSON.stringify({ cssRules: S, mutations: N }), A = () => {
16214
16214
  var Ne, ne;
16215
16215
  const E = (Ne = s.current) == null ? void 0 : Ne.contentDocument;
16216
16216
  if (!(E != null && E.head)) return;
@@ -16239,40 +16239,40 @@ function ky({
16239
16239
  C.push(G.staleReason), (G.component || G.key.endsWith(":component-props")) && (L += fe.length);
16240
16240
  continue;
16241
16241
  }
16242
- for (const Q of fe) {
16242
+ for (const J of fe) {
16243
16243
  if (G.component) {
16244
16244
  const se = G.component, De = we()[se.name];
16245
16245
  if (!De) {
16246
16246
  C.push(
16247
16247
  `Component registry entry not found:${se.name}`
16248
- ), L += 1, Q.setAttribute("data-pygmalion-sandbox-replay", "stale"), V.push(() => {
16249
- Q.removeAttribute("data-pygmalion-sandbox-replay");
16248
+ ), L += 1, J.setAttribute("data-pygmalion-sandbox-replay", "stale"), V.push(() => {
16249
+ J.removeAttribute("data-pygmalion-sandbox-replay");
16250
16250
  });
16251
16251
  continue;
16252
16252
  }
16253
16253
  if (De.children === "nodes") {
16254
16254
  C.push(
16255
16255
  "Components that use node children cannot be safely replayed in a frozen sandbox."
16256
- ), L += 1, Q.setAttribute("data-pygmalion-sandbox-replay", "stale"), V.push(() => {
16257
- Q.removeAttribute("data-pygmalion-sandbox-replay");
16256
+ ), L += 1, J.setAttribute("data-pygmalion-sandbox-replay", "stale"), V.push(() => {
16257
+ J.removeAttribute("data-pygmalion-sandbox-replay");
16258
16258
  });
16259
16259
  continue;
16260
16260
  }
16261
16261
  const Re = E.createElement("pygmalion-sandbox-root");
16262
- Re.setAttribute("data-pygmalion-sandbox-replay", "applied"), Re.style.display = "contents", Q.before(Re);
16263
- const M = Q.hasAttribute("hidden");
16264
- Q.setAttribute("hidden", ""), Q.setAttribute("data-pygmalion-sandbox-replay", "source");
16262
+ Re.setAttribute("data-pygmalion-sandbox-replay", "applied"), Re.style.display = "contents", J.before(Re);
16263
+ const M = J.hasAttribute("hidden");
16264
+ J.setAttribute("hidden", ""), J.setAttribute("data-pygmalion-sandbox-replay", "source");
16265
16265
  let oe = Rd(Re);
16266
- const J = () => {
16266
+ const Z = () => {
16267
16267
  const T = oe;
16268
- oe = null, Re.remove(), Q.toggleAttribute("hidden", M), Q.removeAttribute("data-pygmalion-sandbox-replay"), T && queueMicrotask(() => T.unmount());
16268
+ oe = null, Re.remove(), J.toggleAttribute("hidden", M), J.removeAttribute("data-pygmalion-sandbox-replay"), T && queueMicrotask(() => T.unmount());
16269
16269
  };
16270
- V.push(J);
16271
- const me = (T) => {
16270
+ V.push(Z);
16271
+ const be = (T) => {
16272
16272
  if (u.current !== B) return;
16273
16273
  L += 1;
16274
16274
  const he = T instanceof Error ? T.message : String(T), ae = `Component sandbox rendering failed:${se.name} · ${he}`;
16275
- C.push(ae), Re.setAttribute("data-pygmalion-sandbox-replay", "stale"), Q.toggleAttribute("hidden", M), b("stale"), m((H) => {
16275
+ C.push(ae), Re.setAttribute("data-pygmalion-sandbox-replay", "stale"), J.toggleAttribute("hidden", M), b("stale"), m((H) => {
16276
16276
  const ie = [.../* @__PURE__ */ new Set([...H, ae])];
16277
16277
  return o == null || o(ie), ie;
16278
16278
  });
@@ -16282,7 +16282,7 @@ function ky({
16282
16282
  oe == null || oe.render(
16283
16283
  nr(
16284
16284
  My,
16285
- { onError: me },
16285
+ { onError: be },
16286
16286
  nr(
16287
16287
  De.component,
16288
16288
  { ...se.props },
@@ -16291,39 +16291,39 @@ function ky({
16291
16291
  )
16292
16292
  ), te += 1;
16293
16293
  } catch (T) {
16294
- me(T);
16294
+ be(T);
16295
16295
  }
16296
16296
  continue;
16297
16297
  }
16298
16298
  if (G.hidden != null) {
16299
- const se = Q.hasAttribute("hidden");
16300
- Q.toggleAttribute("hidden", G.hidden), V.push(() => Q.toggleAttribute("hidden", se));
16299
+ const se = J.hasAttribute("hidden");
16300
+ J.toggleAttribute("hidden", G.hidden), V.push(() => J.toggleAttribute("hidden", se));
16301
16301
  }
16302
16302
  if (G.attributes)
16303
16303
  for (const [se, De] of Object.entries(G.attributes)) {
16304
- const Re = Q.getAttribute(se);
16305
- De == null ? Q.removeAttribute(se) : Q.setAttribute(se, De), V.push(() => {
16306
- Re == null ? Q.removeAttribute(se) : Q.setAttribute(se, Re);
16304
+ const Re = J.getAttribute(se);
16305
+ De == null ? J.removeAttribute(se) : J.setAttribute(se, De), V.push(() => {
16306
+ Re == null ? J.removeAttribute(se) : J.setAttribute(se, Re);
16307
16307
  });
16308
16308
  }
16309
16309
  if (G.replaceChildrenHtml != null) {
16310
- const se = Q.innerHTML;
16311
- Q.innerHTML = G.replaceChildrenHtml, V.push(() => {
16312
- Q.innerHTML = se;
16310
+ const se = J.innerHTML;
16311
+ J.innerHTML = G.replaceChildrenHtml, V.push(() => {
16312
+ J.innerHTML = se;
16313
16313
  });
16314
16314
  }
16315
16315
  if (G.text == null) continue;
16316
16316
  if (G.textNodeOrdinal == null) {
16317
- const se = Q.textContent;
16318
- Q.textContent = G.text, V.push(() => {
16319
- Q.textContent = se;
16317
+ const se = J.textContent;
16318
+ J.textContent = G.text, V.push(() => {
16319
+ J.textContent = se;
16320
16320
  });
16321
16321
  continue;
16322
16322
  }
16323
- const ve = ((ne = E.defaultView) == null ? void 0 : ne.Node.TEXT_NODE) ?? 3, ze = [...Q.childNodes].filter(
16323
+ const ge = ((ne = E.defaultView) == null ? void 0 : ne.Node.TEXT_NODE) ?? 3, ze = [...J.childNodes].filter(
16324
16324
  (se) => {
16325
16325
  var De;
16326
- return se.nodeType === ve && !!((De = se.textContent) != null && De.trim());
16326
+ return se.nodeType === ge && !!((De = se.textContent) != null && De.trim());
16327
16327
  }
16328
16328
  )[G.textNodeOrdinal];
16329
16329
  if (!ze) continue;
@@ -16343,9 +16343,9 @@ function ky({
16343
16343
  (G) => JSON.stringify(G) === JSON.stringify(de) ? G : de
16344
16344
  ), o == null || o(de);
16345
16345
  };
16346
- return le(() => (A(), () => {
16346
+ return ce(() => (A(), () => {
16347
16347
  u.current += 1, a.current();
16348
- }), [w, e, y]), le(
16348
+ }), [w, e, y]), ce(
16349
16349
  () => () => {
16350
16350
  l.current();
16351
16351
  },
@@ -16452,12 +16452,12 @@ const Ry = at(function({
16452
16452
  onDocumentHeightChange: a,
16453
16453
  onReplayIssuesChange: l
16454
16454
  }) {
16455
- const d = ce(null), u = ce(null), h = ce(() => {
16456
- }), m = ce(() => {
16457
- }), x = ce(a);
16455
+ const d = le(null), u = le(null), h = le(() => {
16456
+ }), m = le(() => {
16457
+ }), x = le(a);
16458
16458
  x.current = a;
16459
16459
  const [b, w] = W(0), [S, N] = W([]), y = p.frozenPreviewOverrideCss(e), A = p.frozenPreviewMutations(), E = JSON.stringify(A), B = `${Hf()}:${s}:shared-overrides`;
16460
- return le(() => {
16460
+ return ce(() => {
16461
16461
  const C = d.current;
16462
16462
  if (!C) return;
16463
16463
  let R = null;
@@ -16486,10 +16486,10 @@ const Ry = at(function({
16486
16486
  }, m.current(), m.current = () => {
16487
16487
  }, R == null || R.teardown(), u.current === R && (u.current = null);
16488
16488
  };
16489
- }, [r, o, B, n]), le(() => {
16489
+ }, [r, o, B, n]), ce(() => {
16490
16490
  var C;
16491
16491
  (C = u.current) == null || C.updateOverrideCss(y);
16492
- }, [b, y]), le(() => {
16492
+ }, [b, y]), ce(() => {
16493
16493
  const C = u.current;
16494
16494
  if (!C) return;
16495
16495
  h.current();
@@ -16497,39 +16497,39 @@ const Ry = at(function({
16497
16497
  const V = Ny(C.root, A, {
16498
16498
  baseUrl: o
16499
16499
  }), te = [V.cleanup], L = [...V.issues], de = C.root.host.ownerDocument, Ne = () => {
16500
- const Q = [...new Set(L)];
16500
+ const J = [...new Set(L)];
16501
16501
  N(
16502
- (ve) => JSON.stringify(ve) === JSON.stringify(Q) ? ve : Q
16503
- ), l == null || l(Q);
16502
+ (ge) => JSON.stringify(ge) === JSON.stringify(J) ? ge : J
16503
+ ), l == null || l(J);
16504
16504
  };
16505
16505
  Ne();
16506
- const ne = A.flatMap((Q) => {
16507
- if (!Q.component || Q.staleReason) return [];
16508
- let ve;
16506
+ const ne = A.flatMap((J) => {
16507
+ if (!J.component || J.staleReason) return [];
16508
+ let ge;
16509
16509
  try {
16510
- ve = [...C.root.querySelectorAll(Q.selector)];
16510
+ ge = [...C.root.querySelectorAll(J.selector)];
16511
16511
  } catch {
16512
- return L.push(`DOM selector cannot be applied:${Q.key}`), [];
16512
+ return L.push(`DOM selector cannot be applied:${J.key}`), [];
16513
16513
  }
16514
- return ve.length ? [
16515
- Dy(s, Q.component).then(
16516
- (re) => ({ elements: ve, markup: re, mutation: Q }),
16514
+ return ge.length ? [
16515
+ Dy(s, J.component).then(
16516
+ (re) => ({ elements: ge, markup: re, mutation: J }),
16517
16517
  (re) => (L.push(re instanceof Error ? re.message : String(re)), null)
16518
16518
  )
16519
16519
  ] : [];
16520
16520
  });
16521
- Promise.all(ne).then((Q) => {
16521
+ Promise.all(ne).then((J) => {
16522
16522
  if (!R) {
16523
- for (const ve of Q)
16524
- if (ve)
16525
- for (const re of ve.elements) {
16523
+ for (const ge of J)
16524
+ if (ge)
16525
+ for (const re of ge.elements) {
16526
16526
  const ze = de.createElement("pygmalion-static-component");
16527
16527
  ze.setAttribute(
16528
16528
  "data-pygmalion-shadow-component",
16529
- ve.mutation.key
16529
+ ge.mutation.key
16530
16530
  ), ze.style.display = "contents";
16531
16531
  const Oe = de.createElement("template");
16532
- Oe.innerHTML = ve.markup, ze.append(Oe.content.cloneNode(!0));
16532
+ Oe.innerHTML = ge.markup, ze.append(Oe.content.cloneNode(!0));
16533
16533
  const se = re.hasAttribute("hidden");
16534
16534
  re.before(ze), re.setAttribute("hidden", ""), te.push(() => {
16535
16535
  ze.remove(), re.toggleAttribute("hidden", se);
@@ -16542,7 +16542,7 @@ const Ry = at(function({
16542
16542
  const fe = () => {
16543
16543
  if (!G) {
16544
16544
  G = !0;
16545
- for (const Q of te.reverse()) Q();
16545
+ for (const J of te.reverse()) J();
16546
16546
  }
16547
16547
  };
16548
16548
  return h.current = fe, () => {
@@ -16615,10 +16615,10 @@ const Ry = at(function({
16615
16615
  Ku,
16616
16616
  Si,
16617
16617
  Si
16618
- ), l = ce(null), d = ce(null), u = ce(null), h = ce(null), m = ce(null), x = ce(!1), b = ce(
16618
+ ), l = le(null), d = le(null), u = le(null), h = le(null), m = le(null), x = le(!1), b = le(
16619
16619
  () => {
16620
16620
  }
16621
- ), w = ce(null), S = ce(!1), N = ce(null), y = ce(0), A = ce(null), [E, B] = W(null), [C, R] = W(!1), V = (E == null ? void 0 : E.width) ?? e.width ?? 390, te = (E == null ? void 0 : E.height) ?? wt(e), L = (E == null ? void 0 : E.x) ?? e.x ?? 0, de = (E == null ? void 0 : E.y) ?? e.y ?? 0, Ne = ls(
16621
+ ), w = le(null), S = le(!1), N = le(null), y = le(0), A = le(null), [E, B] = W(null), [C, R] = W(!1), V = (E == null ? void 0 : E.width) ?? e.width ?? 390, te = (E == null ? void 0 : E.height) ?? wt(e), L = (E == null ? void 0 : E.x) ?? e.x ?? 0, de = (E == null ? void 0 : E.y) ?? e.y ?? 0, Ne = ls(
16622
16622
  Ra(),
16623
16623
  e.environment
16624
16624
  ), ne = Gn(e, a), G = Gn(
@@ -16628,7 +16628,7 @@ const Ry = at(function({
16628
16628
  width: e.width ?? 390,
16629
16629
  height: e.height ?? 600
16630
16630
  }
16631
- ), fe = `${s}|${ne}`, Q = e.route ? Sx(
16631
+ ), fe = `${s}|${ne}`, J = e.route ? Sx(
16632
16632
  {
16633
16633
  canonicalId: e.importPageId ?? e.id,
16634
16634
  route: e.route,
@@ -16647,9 +16647,9 @@ const Ry = at(function({
16647
16647
  Od,
16648
16648
  Od
16649
16649
  );
16650
- const ve = oi(ne), re = Hx(ne), [ze, Oe] = W(
16651
- () => ve ? null : hn(ne)
16652
- ), [se, De] = W(!1), [Re, M] = W(!1), [oe, J] = W(null), [me, T] = W(0), [he, ae] = W([]), H = ze ?? (o && !ve ? hn(ne) : null), ie = ve != null || H != null || (re == null ? void 0 : re.screenshot) != null, ge = n, be = mo(() => !r || e.route == null || !e.layersImported ? null : G === ne && H != null ? H : hn(G) ?? H, [
16650
+ const ge = oi(ne), re = Hx(ne), [ze, Oe] = W(
16651
+ () => ge ? null : hn(ne)
16652
+ ), [se, De] = W(!1), [Re, M] = W(!1), [oe, Z] = W(null), [be, T] = W(0), [he, ae] = W([]), H = ze ?? (o && !ge ? hn(ne) : null), ie = ge != null || H != null || (re == null ? void 0 : re.screenshot) != null, pe = n, ve = mo(() => !r || e.route == null || !e.layersImported ? null : G === ne && H != null ? H : hn(G) ?? H, [
16653
16653
  G,
16654
16654
  o,
16655
16655
  H,
@@ -16657,8 +16657,8 @@ const Ry = at(function({
16657
16657
  e.route,
16658
16658
  ne,
16659
16659
  r
16660
- ]), Ue = be != null;
16661
- le(() => {
16660
+ ]), Ue = ve != null;
16661
+ ce(() => {
16662
16662
  const D = l.current;
16663
16663
  if (!D || typeof IntersectionObserver > "u") {
16664
16664
  R(!0);
@@ -16671,7 +16671,7 @@ const Ry = at(function({
16671
16671
  { rootMargin: "600px" }
16672
16672
  );
16673
16673
  return U.observe(D), () => U.disconnect();
16674
- }, []), le(() => {
16674
+ }, []), ce(() => {
16675
16675
  if (!n || !e.importLayers || e.layersImported || e.route != null) return;
16676
16676
  const D = Qn();
16677
16677
  if (!D) return;
@@ -16692,47 +16692,43 @@ const Ry = at(function({
16692
16692
  return () => {
16693
16693
  U = !0, cancelAnimationFrame(Se), cancelAnimationFrame(q);
16694
16694
  };
16695
- }, [n, e.id, e.importLayers, e.layersImported, e.route]), le(() => {
16695
+ }, [n, e.id, e.importLayers, e.layersImported, e.route]), ce(() => {
16696
16696
  var D, U;
16697
- (D = h.current) == null || D.resolve(null), h.current = null, (U = m.current) == null || U.resolve(), m.current = null, De(!1), M(!1), J(null), T(0), ae([]), Oe(
16697
+ (D = h.current) == null || D.resolve(null), h.current = null, (U = m.current) == null || U.resolve(), m.current = null, De(!1), M(!1), Z(null), T(0), ae([]), Oe(
16698
16698
  oi(ne) ? null : hn(ne)
16699
16699
  ), y.current += 1, S.current = !1, N.current = null, w.current = null, b.current(), b.current = () => {
16700
16700
  }, p.resetPageDocumentHeight(e.id);
16701
- }, [ne]), le(
16701
+ }, [ne]), ce(
16702
16702
  () => () => {
16703
16703
  b.current();
16704
16704
  },
16705
16705
  []
16706
- ), le(() => {
16706
+ ), ce(() => {
16707
16707
  e.layersImported && (b.current(), b.current = () => {
16708
16708
  });
16709
- }, [e.layersImported]), le(() => {
16709
+ }, [e.layersImported]), ce(() => {
16710
16710
  o && Oe(
16711
16711
  oi(ne) ? null : hn(ne)
16712
16712
  );
16713
- }, [o, ne]), le(() => {
16713
+ }, [o, ne]), ce(() => {
16714
16714
  var xe, ye;
16715
16715
  if (!o || e.route == null || e.layersImported || ie || oe)
16716
16716
  return;
16717
- !ve && Q && Kx(
16718
- e.importPageId ?? e.id,
16719
- Q
16720
- );
16721
16717
  let D = !0, U = null;
16722
16718
  const q = (Ee) => {
16723
16719
  if (!D) return;
16724
16720
  De(!1);
16725
- const Be = Fx(me);
16721
+ const Be = Fx(be);
16726
16722
  if (Be == null) {
16727
- J(
16723
+ Z(
16728
16724
  Ee instanceof Error ? Ee.message : "Failed to pin screen preview."
16729
16725
  );
16730
16726
  return;
16731
16727
  }
16732
16728
  U = setTimeout(() => {
16733
- D && (J(null), T(($e) => $e + 1));
16729
+ D && (Z(null), T(($e) => $e + 1));
16734
16730
  }, Be);
16735
- }, Se = ge ? -1e4 : (((xe = e.interactions) == null ? void 0 : xe.length) ?? 0) + (((ye = e.assertions) == null ? void 0 : ye.length) ?? 0) + (e.preset ? 1 : 0);
16731
+ }, Se = pe ? -1e4 : (((xe = e.interactions) == null ? void 0 : xe.length) ?? 0) + (((ye = e.assertions) == null ? void 0 : ye.length) ?? 0) + (e.preset ? 1 : 0);
16736
16732
  return Pd(
16737
16733
  ne,
16738
16734
  Se,
@@ -16754,7 +16750,7 @@ const Ry = at(function({
16754
16750
  if (Ee) {
16755
16751
  Oe(
16756
16752
  oi(ne) ? null : Ee
16757
- ), J(null);
16753
+ ), Z(null);
16758
16754
  return;
16759
16755
  }
16760
16756
  q(new Error("The screen preview producer returned no snapshot."));
@@ -16767,17 +16763,30 @@ const Ry = at(function({
16767
16763
  (Ee == null ? void 0 : Ee.key) === fe && (h.current = null, Ee.resolve(null)), De(!1);
16768
16764
  };
16769
16765
  }, [
16770
- ge,
16766
+ pe,
16771
16767
  o,
16772
16768
  e.layersImported,
16773
16769
  e.route,
16774
16770
  oe,
16775
- me,
16771
+ be,
16776
16772
  ne,
16777
16773
  fe,
16778
16774
  ie
16779
- ]), le(() => {
16780
- if (!ge || !o || e.route == null || e.layersImported || !ie || oe)
16775
+ ]), ce(() => {
16776
+ !pe || e.route == null || e.layersImported || ge || !J || Kx(
16777
+ e.importPageId ?? e.id,
16778
+ J
16779
+ );
16780
+ }, [
16781
+ pe,
16782
+ e.route,
16783
+ e.layersImported,
16784
+ e.importPageId,
16785
+ e.id,
16786
+ ge,
16787
+ J
16788
+ ]), ce(() => {
16789
+ if (!pe || !o || e.route == null || e.layersImported || !ie || oe)
16781
16790
  return;
16782
16791
  let D = !0;
16783
16792
  const U = `detail:${fe}`;
@@ -16792,7 +16801,7 @@ const Ry = at(function({
16792
16801
  m.current = { key: U, resolve: q }, M(!0);
16793
16802
  })
16794
16803
  ).catch((q) => {
16795
- D && J(
16804
+ D && Z(
16796
16805
  q instanceof Error ? q.message : "Failed to promote the screen preview."
16797
16806
  );
16798
16807
  }), () => {
@@ -16801,7 +16810,7 @@ const Ry = at(function({
16801
16810
  (q == null ? void 0 : q.key) === U && (m.current = null, q.resolve()), M(!1);
16802
16811
  };
16803
16812
  }, [
16804
- ge,
16813
+ pe,
16805
16814
  o,
16806
16815
  ie,
16807
16816
  e.importLayers,
@@ -16809,7 +16818,7 @@ const Ry = at(function({
16809
16818
  e.route,
16810
16819
  oe,
16811
16820
  fe
16812
- ]), le(() => {
16821
+ ]), ce(() => {
16813
16822
  !C || !o || e.route == null || e.layersImported || ie || oe || Pd(
16814
16823
  ne,
16815
16824
  -1e3,
@@ -16899,8 +16908,8 @@ const Ry = at(function({
16899
16908
  if (window.removeEventListener("mousemove", Ee), window.removeEventListener("mouseup", Be), !ye) return;
16900
16909
  const $e = e.x ?? 0, He = e.y ?? 0, Ot = $e + (e.width ?? 390), jr = He + te;
16901
16910
  for (const [yn, ct] of Qf()) {
16902
- const br = ct.explicit ? 0 : Zf, P = ct.x0 - br, wn = ct.y0 - br, Z = ct.x1 + br, rt = ct.y1 + br;
16903
- if (yn !== e.section && $e < Z && Ot > P && He < rt && jr > wn) {
16911
+ const br = ct.explicit ? 0 : Zf, P = ct.x0 - br, wn = ct.y0 - br, Q = ct.x1 + br, rt = ct.y1 + br;
16912
+ if (yn !== e.section && $e < Q && Ot > P && He < rt && jr > wn) {
16904
16913
  p.setPageSection(e.id, yn);
16905
16914
  break;
16906
16915
  }
@@ -16931,17 +16940,17 @@ const Ry = at(function({
16931
16940
  }), B(null);
16932
16941
  };
16933
16942
  window.addEventListener("mousemove", $e), window.addEventListener("mouseup", He);
16934
- }, qe = e.frameSizeMode === "content" || ge || C, hr = Rx({
16943
+ }, qe = e.frameSizeMode === "content" || pe || C, hr = Rx({
16935
16944
  hasRoute: e.route != null,
16936
16945
  layersImported: !!e.layersImported,
16937
16946
  cacheHydrated: o,
16938
16947
  hasSnapshot: ie,
16939
16948
  liveGranted: se
16940
- }), vt = hr === "live" || Re || ge && e.route != null && !e.layersImported, Lr = py({
16941
- active: ge,
16949
+ }), vt = hr === "live" || Re || pe && e.route != null && !e.layersImported, Lr = py({
16950
+ active: pe,
16942
16951
  live: vt
16943
16952
  }), Ri = !i && ie, Le = e.layersImported && p.pageRequiresLiveSharedPreview(e), Rn = ie && p.frozenPreviewMutations().some((D) => !!D.staleReason);
16944
- le(() => {
16953
+ ce(() => {
16945
16954
  if (e.frameSizeMode !== "content" || !qe)
16946
16955
  return;
16947
16956
  const D = d.current;
@@ -16994,14 +17003,14 @@ const Ry = at(function({
16994
17003
  new Error(
16995
17004
  "Failed to freeze same-origin screen DOM to cache snapshot."
16996
17005
  )
16997
- )) : J(
17006
+ )) : Z(
16998
17007
  "Failed to freeze same-origin screen DOM to cache snapshot."
16999
17008
  );
17000
17009
  }
17001
17010
  p.activePageId === e.id && await Wt();
17002
17011
  } catch (U) {
17003
17012
  const q = U instanceof Error ? U.message : "Failed to reproduce the live screen preview.", Se = h.current;
17004
- (Se == null ? void 0 : Se.key) === fe ? (h.current = null, Se.reject(U)) : J(q);
17013
+ (Se == null ? void 0 : Se.key) === fe ? (h.current = null, Se.reject(U)) : Z(q);
17005
17014
  } finally {
17006
17015
  const U = m.current;
17007
17016
  (U == null ? void 0 : U.key) === `detail:${fe}` && (m.current = null, U.resolve());
@@ -17033,7 +17042,7 @@ const Ry = at(function({
17033
17042
  "data-frame-id": e.id,
17034
17043
  "data-canonical-frame-id": e.importPageId ?? e.id,
17035
17044
  "data-frame-active": n || void 0,
17036
- "data-frame-detail-active": ge || void 0,
17045
+ "data-frame-detail-active": pe || void 0,
17037
17046
  "data-preview-state": hr,
17038
17047
  "data-artifact-status": re == null ? void 0 : re.status,
17039
17048
  "data-live-preview": vt || void 0,
@@ -17101,11 +17110,11 @@ const Ry = at(function({
17101
17110
  overscrollBehavior: n ? "contain" : void 0,
17102
17111
  borderRadius: "inherit"
17103
17112
  },
17104
- children: Lr === "canvas" && gr ? /* @__PURE__ */ c("div", { style: { position: "relative", width: "100%", height: "100%" }, children: gr }) : e.layersImported && qe && (ge || e.route == null || Le) ? ge ? Ue ? /* @__PURE__ */ c(
17113
+ children: Lr === "canvas" && gr ? /* @__PURE__ */ c("div", { style: { position: "relative", width: "100%", height: "100%" }, children: gr }) : e.layersImported && qe && (pe || e.route == null || Le) ? pe ? Ue ? /* @__PURE__ */ c(
17105
17114
  Ty,
17106
17115
  {
17107
17116
  page: e,
17108
- snapshot: be,
17117
+ snapshot: ve,
17109
17118
  height: te,
17110
17119
  onDocumentHeightChange: (D) => {
17111
17120
  p.setPageDocumentHeight(e.id, D);
@@ -17117,12 +17126,12 @@ const Ry = at(function({
17117
17126
  }
17118
17127
  },
17119
17128
  `responsive:${e.id}:${a}`
17120
- ) : /* @__PURE__ */ c(Yl, { node: e.root }) : /* @__PURE__ */ c(Gl, { root: e.root }) : e.route != null && Ri ? ve != null || H != null ? /* @__PURE__ */ c(
17129
+ ) : /* @__PURE__ */ c(Yl, { node: e.root }) : /* @__PURE__ */ c(Gl, { root: e.root }) : e.route != null && Ri ? ge != null || H != null ? /* @__PURE__ */ c(
17121
17130
  Ry,
17122
17131
  {
17123
17132
  page: e,
17124
17133
  snapshot: H ?? void 0,
17125
- artifact: ve ?? void 0,
17134
+ artifact: ge ?? void 0,
17126
17135
  height: te,
17127
17136
  baseUrl: pr,
17128
17137
  revision: a,
@@ -17150,7 +17159,7 @@ const Ry = at(function({
17150
17159
  pointerEvents: "none"
17151
17160
  }
17152
17161
  }
17153
- ) : null : qe ? e.route == null || e.layersImported ? ge ? /* @__PURE__ */ c(Yl, { node: e.root }) : /* @__PURE__ */ c(Gl, { root: e.root }) : /* @__PURE__ */ g(
17162
+ ) : null : qe ? e.route == null || e.layersImported ? pe ? /* @__PURE__ */ c(Yl, { node: e.root }) : /* @__PURE__ */ c(Gl, { root: e.root }) : /* @__PURE__ */ g(
17154
17163
  "div",
17155
17164
  {
17156
17165
  role: "status",
@@ -17282,7 +17291,7 @@ const Ry = at(function({
17282
17291
  )
17283
17292
  ] });
17284
17293
  }), Cw = at(function() {
17285
- const e = ce(null), n = Pn(
17294
+ const e = le(null), n = Pn(
17286
17295
  Ku,
17287
17296
  Si,
17288
17297
  Si
@@ -17314,8 +17323,8 @@ const Ry = at(function({
17314
17323
  })) : [], s = p.pages.filter((M) => M.route != null).sort((M, oe) => {
17315
17324
  if (M.id === p.activePageId) return -1;
17316
17325
  if (oe.id === p.activePageId) return 1;
17317
- const J = (M.canvas ?? "default") === p.activeCanvas, me = (oe.canvas ?? "default") === p.activeCanvas;
17318
- return J !== me ? J ? -1 : 1 : 0;
17326
+ const Z = (M.canvas ?? "default") === p.activeCanvas, be = (oe.canvas ?? "default") === p.activeCanvas;
17327
+ return Z !== be ? Z ? -1 : 1 : 0;
17319
17328
  }), a = s.map((M) => Gn(M, n)), l = [
17320
17329
  ...new Set(
17321
17330
  s.flatMap((M) => [
@@ -17331,7 +17340,7 @@ const Ry = at(function({
17331
17340
  ])
17332
17341
  )
17333
17342
  ], d = Wv(l), [u, h] = W("");
17334
- le(() => {
17343
+ ce(() => {
17335
17344
  let M = !0;
17336
17345
  return h(""), dy(l).then(() => {
17337
17346
  M && h(d);
@@ -17343,13 +17352,13 @@ const Ry = at(function({
17343
17352
  (M) => Lf(M)
17344
17353
  ).length, b = a.length, w = m && x === b, [S, N] = W(!1), [y, A] = W(null), [E, B] = W("layers"), [C, R] = W("story"), [V, te] = W(null), L = Object.keys(we()), de = p.canAddFrame, Ne = (M) => {
17345
17354
  p.setTool(M), te(null);
17346
- }, [ne, G] = W(!0), [fe, Q] = W(!0), [ve, re] = W(240), [ze, Oe] = W(240), se = ce(!1), De = (M) => {
17347
- const oe = p.pages.find((T) => T.id === M), J = e.current;
17348
- if (!oe || !J) {
17355
+ }, [ne, G] = W(!0), [fe, J] = W(!0), [ge, re] = W(240), [ze, Oe] = W(240), se = le(!1), De = (M) => {
17356
+ const oe = p.pages.find((T) => T.id === M), Z = e.current;
17357
+ if (!oe || !Z) {
17349
17358
  p.selectFrame(M);
17350
17359
  return;
17351
17360
  }
17352
- const me = tg(
17361
+ const be = tg(
17353
17362
  {
17354
17363
  x: oe.x ?? 0,
17355
17364
  y: oe.y ?? 0,
@@ -17357,49 +17366,49 @@ const Ry = at(function({
17357
17366
  height: wt(oe)
17358
17367
  },
17359
17368
  {
17360
- width: J.clientWidth,
17361
- height: J.clientHeight,
17362
- insetLeft: ne ? ve + 24 : 12,
17369
+ width: Z.clientWidth,
17370
+ height: Z.clientHeight,
17371
+ insetLeft: ne ? ge + 24 : 12,
17363
17372
  insetRight: fe ? ze + 24 : 12,
17364
17373
  insetTop: 12,
17365
17374
  insetBottom: 64
17366
17375
  }
17367
17376
  );
17368
- p.focusFrame(M, me);
17377
+ p.focusFrame(M, be);
17369
17378
  };
17370
- le(() => {
17379
+ ce(() => {
17371
17380
  const M = e.current;
17372
17381
  if (!M) return;
17373
- const oe = (J) => {
17374
- const me = mv(J);
17375
- if (me !== "native-preview") {
17376
- if (me === "programmatic-preview") {
17377
- J.preventDefault();
17382
+ const oe = (Z) => {
17383
+ const be = mv(Z);
17384
+ if (be !== "native-preview") {
17385
+ if (be === "programmatic-preview") {
17386
+ Z.preventDefault();
17378
17387
  return;
17379
17388
  }
17380
- if (J.preventDefault(), J.ctrlKey || J.metaKey) {
17389
+ if (Z.preventDefault(), Z.ctrlKey || Z.metaKey) {
17381
17390
  const T = M.getBoundingClientRect();
17382
- p.zoomAt(J.clientX - T.left, J.clientY - T.top, J.deltaY < 0 ? 1.08 : 0.92);
17391
+ p.zoomAt(Z.clientX - T.left, Z.clientY - T.top, Z.deltaY < 0 ? 1.08 : 0.92);
17383
17392
  } else
17384
- p.panBy(-J.deltaX, -J.deltaY);
17393
+ p.panBy(-Z.deltaX, -Z.deltaY);
17385
17394
  }
17386
17395
  };
17387
17396
  return M.addEventListener("wheel", oe, { passive: !1 }), () => M.removeEventListener("wheel", oe);
17388
- }, []), le(() => {
17397
+ }, []), ce(() => {
17389
17398
  const M = () => {
17390
17399
  const T = e.current;
17391
17400
  if (!T) return;
17392
17401
  const he = p.canvasPages;
17393
17402
  if (!he.length) return;
17394
- const ae = Math.min(...he.map((Ce) => Ce.x ?? 0)), H = Math.min(...he.map((Ce) => Ce.y ?? 0)), ie = Math.max(...he.map((Ce) => (Ce.x ?? 0) + (Ce.width ?? 390))), ge = Math.max(...he.map((Ce) => (Ce.y ?? 0) + (Ce.height ?? 600))), be = ie - ae, Ue = ge - H, nt = Math.max(0.25, Math.min((T.clientWidth - 120) / be, (T.clientHeight - 200) / Ue, 1.5));
17395
- p.setZoom(nt), p.setPan((T.clientWidth - be * nt) / 2 - ae * nt, (T.clientHeight - Ue * nt) / 2 - H * nt);
17403
+ const ae = Math.min(...he.map((Ce) => Ce.x ?? 0)), H = Math.min(...he.map((Ce) => Ce.y ?? 0)), ie = Math.max(...he.map((Ce) => (Ce.x ?? 0) + (Ce.width ?? 390))), pe = Math.max(...he.map((Ce) => (Ce.y ?? 0) + (Ce.height ?? 600))), ve = ie - ae, Ue = pe - H, nt = Math.max(0.25, Math.min((T.clientWidth - 120) / ve, (T.clientHeight - 200) / Ue, 1.5));
17404
+ p.setZoom(nt), p.setPan((T.clientWidth - ve * nt) / 2 - ae * nt, (T.clientHeight - Ue * nt) / 2 - H * nt);
17396
17405
  }, oe = () => {
17397
17406
  const T = e.current;
17398
17407
  if (!T) return;
17399
17408
  const he = p.activePage, ae = he.width ?? 390, H = he.height ?? 600, ie = Math.max(0.25, Math.min((T.clientWidth - 560) / ae, (T.clientHeight - 140) / H));
17400
17409
  p.setZoom(ie), p.setPan((T.clientWidth - ae * ie) / 2 - (he.x ?? 0) * ie, 80 - (he.y ?? 0) * ie);
17401
- }, J = (T) => {
17402
- var ie, ge;
17410
+ }, Z = (T) => {
17411
+ var ie, pe;
17403
17412
  const he = T.target;
17404
17413
  if (he != null && he.closest('input, textarea, select, [contenteditable="true"]')) return;
17405
17414
  if (p.previewOpen) {
@@ -17412,9 +17421,9 @@ const Ry = at(function({
17412
17421
  return;
17413
17422
  }
17414
17423
  if (ae && T.key === "\\") {
17415
- T.preventDefault(), G((be) => {
17416
- const Ue = !(be || fe);
17417
- return Q(Ue), Ue;
17424
+ T.preventDefault(), G((ve) => {
17425
+ const Ue = !(ve || fe);
17426
+ return J(Ue), Ue;
17418
17427
  });
17419
17428
  return;
17420
17429
  }
@@ -17523,12 +17532,12 @@ const Ry = at(function({
17523
17532
  return;
17524
17533
  case "Delete":
17525
17534
  case "Backspace":
17526
- T.preventDefault(), ((ie = p.selectedCanvasObject) == null ? void 0 : ie.kind) === "frame" ? p.removeFrame(p.selectedCanvasObject.id) : ((ge = p.selectedCanvasObject) == null ? void 0 : ge.kind) === "section" ? p.removeSection(p.selectedCanvasObject.name) : p.removeSelected();
17535
+ T.preventDefault(), ((ie = p.selectedCanvasObject) == null ? void 0 : ie.kind) === "frame" ? p.removeFrame(p.selectedCanvasObject.id) : ((pe = p.selectedCanvasObject) == null ? void 0 : pe.kind) === "section" ? p.removeSection(p.selectedCanvasObject.name) : p.removeSelected();
17527
17536
  return;
17528
17537
  case "Enter": {
17529
17538
  T.preventDefault();
17530
- const be = p.selected;
17531
- (be == null ? void 0 : be.type) === "text" ? p.startTextEdit(be.id) : p.selectFirstChild();
17539
+ const ve = p.selected;
17540
+ (ve == null ? void 0 : ve.type) === "text" ? p.startTextEdit(ve.id) : p.selectFirstChild();
17532
17541
  return;
17533
17542
  }
17534
17543
  case "Tab":
@@ -17566,17 +17575,17 @@ const Ry = at(function({
17566
17575
  /^[0-9]$/.test(T.key) && p.setOpacitySelected(T.key === "0" ? 1 : Number(T.key) / 10);
17567
17576
  }
17568
17577
  }
17569
- }, me = (T) => {
17578
+ }, be = (T) => {
17570
17579
  T.code === "Space" && N(!1);
17571
17580
  };
17572
- return window.addEventListener("keydown", J), window.addEventListener("keyup", me), () => {
17573
- window.removeEventListener("keydown", J), window.removeEventListener("keyup", me);
17581
+ return window.addEventListener("keydown", Z), window.addEventListener("keyup", be), () => {
17582
+ window.removeEventListener("keydown", Z), window.removeEventListener("keyup", be);
17574
17583
  };
17575
17584
  }, [fe]);
17576
17585
  const Re = (M) => (oe) => {
17577
17586
  oe.preventDefault();
17578
- const J = oe.clientX, me = M === "left" ? ve : ze, T = (ae) => {
17579
- const H = M === "left" ? ae.clientX - J : J - ae.clientX, ie = Math.max(180, Math.min(480, me + H));
17587
+ const Z = oe.clientX, be = M === "left" ? ge : ze, T = (ae) => {
17588
+ const H = M === "left" ? ae.clientX - Z : Z - ae.clientX, ie = Math.max(180, Math.min(480, be + H));
17580
17589
  M === "left" ? re(ie) : Oe(ie);
17581
17590
  }, he = () => {
17582
17591
  window.removeEventListener("mousemove", T), window.removeEventListener("mouseup", he);
@@ -17604,33 +17613,33 @@ const Ry = at(function({
17604
17613
  },
17605
17614
  onMouseDownCapture: (M) => {
17606
17615
  if (!S && M.button !== 1 || (M.preventDefault(), M.stopPropagation(), !e.current)) return;
17607
- const J = { x: M.clientX, y: M.clientY, px: p.panX, py: p.panY }, me = (he) => {
17608
- se.current = !0, p.setPan(J.px + (he.clientX - J.x), J.py + (he.clientY - J.y));
17616
+ const Z = { x: M.clientX, y: M.clientY, px: p.panX, py: p.panY }, be = (he) => {
17617
+ se.current = !0, p.setPan(Z.px + (he.clientX - Z.x), Z.py + (he.clientY - Z.y));
17609
17618
  }, T = () => {
17610
- window.removeEventListener("mousemove", me), window.removeEventListener("mouseup", T);
17619
+ window.removeEventListener("mousemove", be), window.removeEventListener("mouseup", T);
17611
17620
  };
17612
- window.addEventListener("mousemove", me), window.addEventListener("mouseup", T);
17621
+ window.addEventListener("mousemove", be), window.addEventListener("mouseup", T);
17613
17622
  },
17614
17623
  onMouseDown: (M) => {
17615
17624
  var ae;
17616
17625
  if (S || M.button !== 0) return;
17617
17626
  const oe = e.current;
17618
17627
  if ((M.metaKey || M.ctrlKey) && oe) {
17619
- const H = { x: M.clientX, y: M.clientY, px: p.panX, py: p.panY }, ie = (be) => {
17620
- se.current = !0, p.setPan(H.px + (be.clientX - H.x), H.py + (be.clientY - H.y));
17621
- }, ge = () => {
17622
- window.removeEventListener("mousemove", ie), window.removeEventListener("mouseup", ge);
17628
+ const H = { x: M.clientX, y: M.clientY, px: p.panX, py: p.panY }, ie = (ve) => {
17629
+ se.current = !0, p.setPan(H.px + (ve.clientX - H.x), H.py + (ve.clientY - H.y));
17630
+ }, pe = () => {
17631
+ window.removeEventListener("mousemove", ie), window.removeEventListener("mouseup", pe);
17623
17632
  };
17624
- window.addEventListener("mousemove", ie), window.addEventListener("mouseup", ge);
17633
+ window.addEventListener("mousemove", ie), window.addEventListener("mouseup", pe);
17625
17634
  return;
17626
17635
  }
17627
17636
  if (p.tool === "hand") {
17628
- const H = { x: M.clientX, y: M.clientY, px: p.panX, py: p.panY }, ie = (be) => {
17629
- se.current = !0, p.setPan(H.px + (be.clientX - H.x), H.py + (be.clientY - H.y));
17630
- }, ge = () => {
17631
- window.removeEventListener("mousemove", ie), window.removeEventListener("mouseup", ge);
17637
+ const H = { x: M.clientX, y: M.clientY, px: p.panX, py: p.panY }, ie = (ve) => {
17638
+ se.current = !0, p.setPan(H.px + (ve.clientX - H.x), H.py + (ve.clientY - H.y));
17639
+ }, pe = () => {
17640
+ window.removeEventListener("mousemove", ie), window.removeEventListener("mouseup", pe);
17632
17641
  };
17633
- window.addEventListener("mousemove", ie), window.addEventListener("mouseup", ge);
17642
+ window.addEventListener("mousemove", ie), window.addEventListener("mouseup", pe);
17634
17643
  return;
17635
17644
  }
17636
17645
  if (p.tool === "zoom") {
@@ -17639,30 +17648,30 @@ const Ry = at(function({
17639
17648
  return;
17640
17649
  }
17641
17650
  if (p.tool === "section") {
17642
- const H = { x: M.clientX, y: M.clientY }, ie = (be) => {
17643
- se.current = !0, A({ x0: H.x, y0: H.y, x1: be.clientX, y1: be.clientY });
17644
- }, ge = (be) => {
17651
+ const H = { x: M.clientX, y: M.clientY }, ie = (ve) => {
17652
+ se.current = !0, A({ x0: H.x, y0: H.y, x1: ve.clientX, y1: ve.clientY });
17653
+ }, pe = (ve) => {
17645
17654
  var Wt;
17646
- window.removeEventListener("mousemove", ie), window.removeEventListener("mouseup", ge), A(null);
17655
+ window.removeEventListener("mousemove", ie), window.removeEventListener("mouseup", pe), A(null);
17647
17656
  const Ue = (Wt = e.current) == null ? void 0 : Wt.getBoundingClientRect();
17648
17657
  if (!Ue) return;
17649
17658
  const nt = (bt) => (bt - Ue.left - p.panX) / p.zoom, Ce = (bt) => (bt - Ue.top - p.panY) / p.zoom;
17650
- p.createSectionFromRect(nt(H.x), Ce(H.y), nt(be.clientX), Ce(be.clientY));
17659
+ p.createSectionFromRect(nt(H.x), Ce(H.y), nt(ve.clientX), Ce(ve.clientY));
17651
17660
  };
17652
- window.addEventListener("mousemove", ie), window.addEventListener("mouseup", ge);
17661
+ window.addEventListener("mousemove", ie), window.addEventListener("mouseup", pe);
17653
17662
  return;
17654
17663
  }
17655
- const J = { x: M.clientX, y: M.clientY };
17656
- let me = !1;
17664
+ const Z = { x: M.clientX, y: M.clientY };
17665
+ let be = !1;
17657
17666
  const T = (H) => {
17658
- if (!me && Math.hypot(H.clientX - J.x, H.clientY - J.y) < 4) return;
17659
- me = !0, se.current = !0, A({ x0: J.x, y0: J.y, x1: H.clientX, y1: H.clientY });
17660
- const ie = Math.min(J.x, H.clientX), ge = Math.max(J.x, H.clientX), be = Math.min(J.y, H.clientY), Ue = Math.max(J.y, H.clientY), nt = p.root.children.filter((Ce) => {
17667
+ if (!be && Math.hypot(H.clientX - Z.x, H.clientY - Z.y) < 4) return;
17668
+ be = !0, se.current = !0, A({ x0: Z.x, y0: Z.y, x1: H.clientX, y1: H.clientY });
17669
+ const ie = Math.min(Z.x, H.clientX), pe = Math.max(Z.x, H.clientX), ve = Math.min(Z.y, H.clientY), Ue = Math.max(Z.y, H.clientY), nt = p.root.children.filter((Ce) => {
17661
17670
  if (Ce.hidden || Ce.locked) return !1;
17662
17671
  const Wt = document.querySelector(`[data-node-id="${Ce.id}"]`);
17663
17672
  if (!Wt) return !1;
17664
17673
  const bt = Wt.getBoundingClientRect();
17665
- return bt.left < ge && bt.right > ie && bt.top < Ue && bt.bottom > be;
17674
+ return bt.left < pe && bt.right > ie && bt.top < Ue && bt.bottom > ve;
17666
17675
  }).map((Ce) => Ce.id);
17667
17676
  p.setSelection(nt);
17668
17677
  }, he = () => {
@@ -17733,7 +17742,7 @@ const Ry = at(function({
17733
17742
  )
17734
17743
  }
17735
17744
  ),
17736
- ne ? /* @__PURE__ */ g("aside", { className: `${Td} bottom-3 left-3 top-3`, style: { width: ve }, children: [
17745
+ ne ? /* @__PURE__ */ g("aside", { className: `${Td} bottom-3 left-3 top-3`, style: { width: ge }, children: [
17737
17746
  /* @__PURE__ */ g("header", { className: "border-b border-[#e6e6e6] px-3 pt-3", children: [
17738
17747
  /* @__PURE__ */ g("div", { className: "flex items-baseline gap-1.5", children: [
17739
17748
  /* @__PURE__ */ c("span", { className: "text-[13px] font-bold", children: "Pygmalion" }),
@@ -17921,7 +17930,7 @@ const Ry = at(function({
17921
17930
  type: "button",
17922
17931
  "aria-label": "Collapse right panel",
17923
17932
  className: "ml-1 text-[13px] text-[#999] hover:text-[#333]",
17924
- onClick: () => Q(!1),
17933
+ onClick: () => J(!1),
17925
17934
  children: "›"
17926
17935
  }
17927
17936
  )
@@ -17943,7 +17952,7 @@ const Ry = at(function({
17943
17952
  type: "button",
17944
17953
  "aria-label": "Expand right panel",
17945
17954
  className: "absolute right-0 top-3 z-20 rounded-l-lg border border-r-0 border-[#e6e6e6] bg-white px-1 py-3 text-[13px] text-[#999] shadow-[0_2px_8px_rgba(0,0,0,.08)] hover:text-[#333]",
17946
- onClick: () => Q(!0),
17955
+ onClick: () => J(!0),
17947
17956
  children: "‹"
17948
17957
  }
17949
17958
  ),