ryugi-artifacts 1.41.0 → 1.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
1
  import './stylex-Bp5PFQ3Y.css';
2
2
  import './index-uM2HnLXF.css';
3
- import { C as e, D as t, E as n, S as r, T as i, _ as a, a as o, b as s, c, d as l, f as u, g as d, h as f, i as p, l as m, m as h, n as g, o as _, p as v, r as y, s as b, t as x, u as S, v as C, w, y as T } from "./ids-8QtprMNq.js";
4
- import { d as E, f as D, g as O, h as k, l as A, m as j, n as ee, o as te, p as ne, r as re, s as ie, t as ae, u as oe } from "./relayConnection-CoSjRI7m.js";
5
- import { a as M, i as se, o as N, r as ce, s as le, t as ue } from "./Canvas-BL1JoYEQ.js";
6
- import { a as P, c as de, d as F, f as fe, i as I, l as L, m as pe, n as me, o as he, p as ge, r as _e, s as R, t as z, u as B } from "./cloud-BA1xJLJk.js";
7
- import { A as V, C as H, D as ve, E as ye, M as be, N as xe, O as Se, P as Ce, S as we, T as Te, a as Ee, c as De, d as Oe, g as ke, i as Ae, j as je, k as Me, l as Ne, m as Pe, n as Fe, o as U, p as Ie, r as Le, s as Re, t as ze, u as W, v as Be, w as Ve, x as He, y as Ue } from "./useCloudHeader-DwNI6tTZ.js";
3
+ import { C as e, D as t, E as n, S as r, T as i, _ as a, a as o, b as s, c, d as l, f as u, g as d, h as f, i as p, l as m, m as h, n as g, o as _, p as v, r as y, s as b, t as x, u as S, v as C, w, y as T } from "./ids-Crgtnwo0.js";
4
+ import { d as E, f as D, g as O, h as k, l as A, m as ee, n as te, o as ne, p as re, r as ie, s as ae, t as oe, u as se } from "./relayConnection-CoSjRI7m.js";
5
+ import { a as ce, i as le, o as j, r as ue, s as de, t as fe } from "./Canvas-BdS1Xa5w.js";
6
+ import { a as M, c as pe, d as N, f as P, i as me, l as F, m as I, n as L, o as he, p as ge, r as _e, s as ve, t as ye, u as R } from "./cloud-BA1xJLJk.js";
7
+ import { A as z, C as be, D as B, E as V, M as H, N as xe, O as Se, P as Ce, S as we, T as Te, a as Ee, c as De, d as Oe, g as ke, i as Ae, j as je, k as Me, l as U, m as Ne, n as Pe, o as Fe, p as Ie, r as Le, s as W, t as Re, u as ze, v as Be, w as Ve, x as He, y as Ue } from "./useCloudHeader-DwNI6tTZ.js";
8
8
  import { memo as We, useCallback as G, useEffect as K, useId as Ge, useLayoutEffect as Ke, useMemo as q, useReducer as qe, useRef as J, useState as Y, useSyncExternalStore as Je } from "react";
9
9
  import { Accordion as Ye, ActionIcon as Xe, Button as Ze, ColorPicker as Qe, DropdownMenu as $e, Icon as et, IconProvider as tt, Input as nt, InputNumber as rt, Popover as it, Segmented as at, Select as ot, Slider as st, Switch as ct, TabsIndicator as lt, TabsList as ut, TabsPanel as dt, TabsRoot as ft, TabsTab as pt, Tree as mt } from "@lobehub/ui";
10
10
  import { ArrowDown as ht, ArrowRight as gt, Ban as _t, Check as vt, CheckCircle2 as yt, ChevronDown as bt, ChevronLeft as xt, ChevronRight as St, Circle as Ct, CircleAlert as wt, Clock3 as Tt, CloudUpload as Et, Code2 as Dt, Columns3 as Ot, Copy as kt, Download as At, Ellipsis as jt, Film as Mt, Frame as Nt, Grid2X2 as Pt, Hand as Ft, Image as It, LoaderCircle as Lt, Maximize2 as Rt, MessageCirclePlus as zt, Minus as Bt, MousePointer2 as Vt, PanelRight as Ht, Play as Ut, RotateCcw as Wt, Rows3 as Gt, SlidersHorizontal as Kt, SquareDashed as qt, Type as Jt, X as Yt } from "lucide-react";
@@ -173,10 +173,10 @@ function on(e, t) {
173
173
  }
174
174
  var sn = (e) => `${Math.round(e * 100)}%`;
175
175
  function cn(e) {
176
- if (e.group) return e.verdict === "reject" ? L.t("anchor.rejected", { group: e.group }) : e.group;
177
- if (!e.board) return L.t("anchor.page", { page: e.page });
176
+ if (e.group) return e.verdict === "reject" ? F.t("anchor.rejected", { group: e.group }) : e.group;
177
+ if (!e.board) return F.t("anchor.page", { page: e.page });
178
178
  let t = e.nodes ?? [];
179
- if (t.length > 1) return L.t("anchor.elements", {
179
+ if (t.length > 1) return F.t("anchor.elements", {
180
180
  board: e.board,
181
181
  count: t.length
182
182
  });
@@ -184,7 +184,7 @@ function cn(e) {
184
184
  let n = e.offset ? ` · ${sn(e.offset.x)}, ${sn(e.offset.y)}` : "";
185
185
  return `${e.board} · ${t[0].path}${n}`;
186
186
  }
187
- var ln = (e) => e.verdict ? L.t("anchor.evidenceUpdated") : L.t("anchor.stale"), un = (e) => e.messages[0]?.at ?? e.statusAt;
187
+ var ln = (e) => e.verdict ? F.t("anchor.evidenceUpdated") : F.t("anchor.stale"), un = (e) => e.messages[0]?.at ?? e.statusAt;
188
188
  function dn(e) {
189
189
  let t = e.filter((e) => e.anchor?.verdict !== "pass").sort((e, t) => un(e) < un(t) ? -1 : +(un(e) > un(t)));
190
190
  return new Map(t.map((e, t) => [e.id, t + 1]));
@@ -248,7 +248,7 @@ function _n(e, t) {
248
248
  return n + pn > t - 12 ? Math.max(12, e - mn - pn) : n;
249
249
  }
250
250
  function vn({ view: e, page: t, boards: n, width: r, threads: i, stale: a, numbers: o, showResolved: s, draft: c, openId: l, actions: u, agent: d, onOpen: f, onSubmit: p, onCancelDraft: m }) {
251
- let { t: h } = F(), g = i.filter((e) => e.anchor.page === t && e.anchor.verdict !== "pass" && e.messages.some((e) => !e.deleted) && (s || e.status === "open" || e.id === l)), _ = i.find((e) => e.id === l), v = _ ? on(_.anchor, n) : null, y = c ? on(c, n) : null;
251
+ let { t: h } = N(), g = i.filter((e) => e.anchor.page === t && e.anchor.verdict !== "pass" && e.messages.some((e) => !e.deleted) && (s || e.status === "open" || e.id === l)), _ = i.find((e) => e.id === l), v = _ ? on(_.anchor, n) : null, y = c ? on(c, n) : null;
252
252
  return /* @__PURE__ */ Q("div", {
253
253
  "data-chrome": "comments",
254
254
  className: "x10l6tqk x10a8y8t x47corl xb3r6kr x1q8xho0",
@@ -321,12 +321,12 @@ function vn({ view: e, page: t, boards: n, width: r, threads: i, stale: a, numbe
321
321
  }
322
322
  //#endregion
323
323
  //#region src/viewer/comments/CommentsPanel.tsx
324
- var yn = (e) => new Date(e).toLocaleTimeString(L.language, {
324
+ var yn = (e) => new Date(e).toLocaleTimeString(F.language, {
325
325
  hour: "2-digit",
326
326
  minute: "2-digit"
327
327
  });
328
328
  function bn({ threads: e, page: t, stale: n, numbers: r, openId: i, tab: a, onTab: o, onOpen: s, onClose: c }) {
329
- let { t: l } = F(), u = e.filter((e) => e.anchor.page === t && e.anchor.verdict !== "pass" && e.messages.some((e) => !e.deleted)), d = u.filter((e) => e.status === "open"), f = (a === "open" ? d : u).sort((e, t) => (r.get(e.id) ?? 0) - (r.get(t.id) ?? 0));
329
+ let { t: l } = N(), u = e.filter((e) => e.anchor.page === t && e.anchor.verdict !== "pass" && e.messages.some((e) => !e.deleted)), d = u.filter((e) => e.status === "open"), f = (a === "open" ? d : u).sort((e, t) => (r.get(e.id) ?? 0) - (r.get(t.id) ?? 0));
330
330
  return /* @__PURE__ */ Q("aside", {
331
331
  className: "ryugi-inspector",
332
332
  "data-chrome": !0,
@@ -509,8 +509,8 @@ function En({ id: e, board: n, src: r, interactive: i, onClose: a, parameterActi
509
509
  /* @__PURE__ */ Z(Xe, {
510
510
  icon: Yt,
511
511
  size: "small",
512
- title: B("chrome.closeEsc"),
513
- "aria-label": B("chrome.close"),
512
+ title: R("chrome.closeEsc"),
513
+ "aria-label": R("chrome.close"),
514
514
  onClick: a
515
515
  })
516
516
  ]
@@ -523,7 +523,7 @@ function En({ id: e, board: n, src: r, interactive: i, onClose: a, parameterActi
523
523
  height: n.h,
524
524
  marginBottom: 36
525
525
  },
526
- children: /* @__PURE__ */ Z(se, {
526
+ children: /* @__PURE__ */ Z(le, {
527
527
  src: r,
528
528
  title: n.title ?? e,
529
529
  barScale: 1,
@@ -818,7 +818,7 @@ var Un = (e, t) => new Date(e).toLocaleTimeString(t, {
818
818
  hour12: !1
819
819
  });
820
820
  function Wn({ verdict: e, evidenceAt: t, canJudge: n, onPass: r, onReject: i, onUndo: a }) {
821
- let { t: o, i18n: s } = F();
821
+ let { t: o, i18n: s } = N();
822
822
  return e.state === "pass" ? /* @__PURE__ */ Q(X, { children: [
823
823
  /* @__PURE__ */ Q("span", {
824
824
  className: "x78zum5 x6s0dn4 x17d4w8g x1hm9lzh xk50ysn xvn0vjr",
@@ -912,7 +912,7 @@ function Qn({ view: e, boards: n, groups: r, allBoards: i, contentBase: o, versi
912
912
  }), b !== null && n.map(([n, r]) => {
913
913
  let i = a(r, e);
914
914
  if (!i) return null;
915
- let h = i.width / b, _ = M(s, r.file) && !c.has(n), v = _ && N(r, s);
915
+ let h = i.width / b, _ = ce(s, r.file) && !c.has(n), v = _ && j(r, s);
916
916
  return /* @__PURE__ */ Q("div", {
917
917
  "data-chrome": "board-label",
918
918
  className: "x10l6tqk x78zum5 x6s0dn4 xxk0z11 x1hj3fc7 x1120s5i x1bo0w0s x67bb7w",
@@ -944,8 +944,8 @@ function Qn({ view: e, boards: n, groups: r, allBoards: i, contentBase: o, versi
944
944
  blockSize: 22,
945
945
  size: 13
946
946
  },
947
- title: B("chrome.expand"),
948
- "aria-label": B("chrome.expandBoard", { id: n }),
947
+ title: R("chrome.expand"),
948
+ "aria-label": R("chrome.expandBoard", { id: n }),
949
949
  onClick: () => u(n)
950
950
  }), /* @__PURE__ */ Z(Xe, {
951
951
  icon: At,
@@ -953,13 +953,13 @@ function Qn({ view: e, boards: n, groups: r, allBoards: i, contentBase: o, versi
953
953
  blockSize: 22,
954
954
  size: 13
955
955
  },
956
- title: B("chrome.download"),
957
- "aria-label": B("chrome.downloadBoard", { id: n }),
956
+ title: R("chrome.download"),
957
+ "aria-label": R("chrome.downloadBoard", { id: n }),
958
958
  onClick: () => Zn(`${o}${r.file}`, r.file.split("/").pop() ?? `${n}.html`)
959
959
  })] }),
960
960
  _ && p?.[n] !== void 0 && h >= Gn && /* @__PURE__ */ Q("button", {
961
961
  type: "button",
962
- "aria-label": B("chrome.parametersBoard", { id: n }),
962
+ "aria-label": R("chrome.parametersBoard", { id: n }),
963
963
  "aria-expanded": m === n,
964
964
  onClick: (e) => g?.(n, e.currentTarget),
965
965
  ...{
@@ -968,7 +968,7 @@ function Qn({ view: e, boards: n, groups: r, allBoards: i, contentBase: o, versi
968
968
  }[m === n | 0],
969
969
  children: [
970
970
  /* @__PURE__ */ Z(Kt, { size: 11 }),
971
- B("chrome.parameters"),
971
+ R("chrome.parameters"),
972
972
  " ",
973
973
  p[n] || "!"
974
974
  ]
@@ -979,14 +979,14 @@ function Qn({ view: e, boards: n, groups: r, allBoards: i, contentBase: o, versi
979
979
  blockSize: 22,
980
980
  size: 13
981
981
  },
982
- title: B("chrome.replay"),
983
- "aria-label": B("chrome.replayBoard", { id: n }),
982
+ title: R("chrome.replay"),
983
+ "aria-label": R("chrome.replayBoard", { id: n }),
984
984
  onClick: () => f(n)
985
985
  }),
986
986
  v && h >= Kn && /* @__PURE__ */ Q("button", {
987
987
  type: "button",
988
988
  "aria-pressed": l.has(n),
989
- "aria-label": l.has(n) ? B("chrome.stopBoard", { id: n }) : B("chrome.playBoard", { id: n }),
989
+ "aria-label": l.has(n) ? R("chrome.stopBoard", { id: n }) : R("chrome.playBoard", { id: n }),
990
990
  onClick: () => d(n),
991
991
  ...{
992
992
  0: { className: "x78zum5 x6s0dn4 x1jnr06f x1qx5ct2 xdwrcjd xlkn9b3 xmkeg23 x1y0btm7 x1lvdfi3 x1kogg8i xjbqb8w x12zwl0d x12ogdgn xqfszdh x1j6dyjg x1s688f x1vyo3qp x1ypdohk" },
@@ -995,7 +995,7 @@ function Qn({ view: e, boards: n, groups: r, allBoards: i, contentBase: o, versi
995
995
  children: [/* @__PURE__ */ Z(Ut, {
996
996
  size: 11,
997
997
  strokeWidth: 2.4
998
- }), l.has(n) ? B("chrome.playing") : B("chrome.play")]
998
+ }), l.has(n) ? R("chrome.playing") : R("chrome.play")]
999
999
  })
1000
1000
  ]
1001
1001
  }, n);
@@ -1005,7 +1005,7 @@ function Qn({ view: e, boards: n, groups: r, allBoards: i, contentBase: o, versi
1005
1005
  //#endregion
1006
1006
  //#region src/viewer/components/Toolbar.tsx
1007
1007
  function $n({ pages: e, page: t, onPageChange: n, tool: r, onToolChange: i, commenting: a = !1 }) {
1008
- let { t: o } = F(), s = e.find((e) => e.id === t);
1008
+ let { t: o } = N(), s = e.find((e) => e.id === t);
1009
1009
  return /* @__PURE__ */ Q("div", {
1010
1010
  "data-chrome": !0,
1011
1011
  className: "x10l6tqk x1eu8d0j x78zum5 x6s0dn4 x195vfkc x1vqgdyp xfn1xvj x12ilycc xmkeg23 x1y0btm7 x12xov25 x1q4ynmn x1cqdj14 x4z9k3i xo2rkog x1n327nk x12lbrt0",
@@ -1060,7 +1060,7 @@ function $n({ pages: e, page: t, onPageChange: n, tool: r, onToolChange: i, comm
1060
1060
  });
1061
1061
  }
1062
1062
  function er({ actions: e, live: t, warnings: n, zoom: r, onZoomIn: i, onZoomOut: a, onFit: o, onActualSize: s, inspectorOpen: c, onToggleInspector: l, verify: u, onNextVerify: d }) {
1063
- let { t: f } = F(), p = (e) => /* @__PURE__ */ Z("span", {
1063
+ let { t: f } = N(), p = (e) => /* @__PURE__ */ Z("span", {
1064
1064
  className: "xddlp02 x1fao0z8 xfifm61",
1065
1065
  children: e
1066
1066
  });
@@ -1454,89 +1454,92 @@ function br({ persistence: e = yr(), resize: t = vr, createUrl: n = (e) => URL.c
1454
1454
  }
1455
1455
  //#endregion
1456
1456
  //#region src/viewer/lib/tier-controller.ts
1457
- var xr = 1500, Sr = 150, Cr = 2, wr = 2, Tr = 3e3, Er = 8e3;
1458
- function Dr({ now: e = () => performance.now(), schedule: t = (e, t) => window.setTimeout(e, t), cancel: n = (e) => window.clearTimeout(e), onChange: r }) {
1459
- let i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set(), c = {
1460
- id: null,
1461
- since: 0
1462
- }, l = (e) => {
1463
- let t = i.get(e);
1457
+ var xr = 1500, Sr = 2, Cr = 2, wr = 3e3, Tr = 8e3;
1458
+ function Er({ now: e = () => performance.now(), schedule: t = (e, t) => window.setTimeout(e, t), cancel: n = (e) => window.clearTimeout(e), onChange: r, onGiveUp: i }) {
1459
+ let a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set(), l = (e) => {
1460
+ let t = a.get(e);
1464
1461
  t && !t.ready && (t.ready = !0, t.timer !== void 0 && n(t.timer), t.timer = void 0, r());
1465
1462
  }, u = (e) => {
1466
- let t = i.get(e);
1467
- t?.timer !== void 0 && n(t.timer), i.delete(e);
1463
+ let t = a.get(e);
1464
+ t?.timer !== void 0 && n(t.timer), a.delete(e);
1465
+ }, d = (e) => {
1466
+ u(e), i?.(e);
1467
+ }, f = (e) => {
1468
+ if (c.has(e)) return l(e);
1469
+ a.has(e) && (d(e), r());
1470
+ }, p = (e) => {
1471
+ let n = {
1472
+ ready: !1,
1473
+ reported: !1
1474
+ };
1475
+ a.set(e, n), n.timer = t(() => f(e), Tr);
1468
1476
  };
1469
1477
  return {
1470
1478
  loaded(e) {
1471
- let r = i.get(e);
1472
- r && !r.ready && (r.timer !== void 0 && n(r.timer), r.timer = t(() => l(e), Tr));
1479
+ let r = a.get(e);
1480
+ r && !r.ready && c.has(e) && (r.timer !== void 0 && n(r.timer), r.timer = t(() => f(e), wr));
1473
1481
  },
1474
- ready: l,
1475
- update(d) {
1476
- let f = e(), p = new Set(d.boards.map((e) => e.id));
1477
- for (let e of [...i.keys()]) p.has(e) || u(e);
1478
- d.hovered !== c.id && (c.timer !== void 0 && n(c.timer), c = {
1479
- id: d.hovered,
1480
- since: f,
1481
- timer: d.hovered ? t(r, Sr) : void 0
1482
- });
1483
- let h = d.hoverPromotes && c.id && f - c.since >= Sr ? c.id : null, g = h ? /* @__PURE__ */ new Set([...d.pinned, h]) : d.pinned, _ = m({
1484
- ...d,
1485
- pinned: g
1482
+ ready(e) {
1483
+ let t = a.get(e);
1484
+ t && (t.reported = !0), l(e);
1485
+ },
1486
+ update(n) {
1487
+ let i = e(), l = new Set(n.boards.map((e) => e.id));
1488
+ for (let e of [...a.keys()]) l.has(e) || u(e);
1489
+ let f = n.pinned, h = (e) => f.has(e) || n.hoverPromotes && e === n.hovered, g = m({
1490
+ ...n,
1491
+ hovered: n.hoverPromotes ? n.hovered : null
1486
1492
  });
1487
- if (!d.scaling) {
1493
+ if (!n.scaling) {
1488
1494
  let e = /* @__PURE__ */ new Set();
1489
- for (let [t, n] of _) n === "live" && (a.set(t, f), e.add(t));
1490
- for (let n of s) {
1491
- if (e.has(n) || !p.has(n)) continue;
1492
- let i = f - (a.get(n) ?? -Infinity);
1493
- i >= xr || (e.add(n), o.has(n) || o.set(n, t(() => {
1494
- o.delete(n), r();
1495
- }, xr - i)));
1495
+ for (let [t, n] of g) n === "live" && (o.set(t, i), e.add(t));
1496
+ for (let n of c) {
1497
+ if (e.has(n) || !l.has(n)) continue;
1498
+ let a = i - (o.get(n) ?? -Infinity);
1499
+ a >= xr || (e.add(n), s.has(n) || s.set(n, t(() => {
1500
+ s.delete(n), r();
1501
+ }, xr - a)));
1496
1502
  }
1497
- s = e;
1498
- let n = (d.warm ?? []).filter((e) => p.has(e) && !s.has(e)), c = new Set(n);
1499
- for (let e of [...i.keys()]) !s.has(e) && !c.has(e) && u(e);
1500
- let m = [...i.values()].filter((e) => !e.ready).length, h = d.boards.map((e) => e.id).filter((e) => s.has(e) && !i.has(e)).sort((e, t) => Number(g.has(t)) - Number(g.has(e)));
1501
- for (let e of h) {
1502
- if (m >= Cr) break;
1503
- let n = { ready: !1 };
1504
- i.set(e, n), n.timer = t(() => l(e), Er), m++;
1503
+ c = e;
1504
+ let f = (n.warm ?? []).filter((e) => l.has(e) && !c.has(e)), m = new Set(f), _ = /* @__PURE__ */ new Set();
1505
+ for (let [e, t] of [...a]) c.has(e) || (m.has(e) ? t.ready && !t.reported && (d(e), _.add(e)) : u(e));
1506
+ let v = [...a.values()].filter((e) => !e.ready).length, y = n.boards.map((e) => e.id).filter((e) => c.has(e) && !a.has(e)).sort((e, t) => Number(h(t)) - Number(h(e)));
1507
+ for (let e of y) {
1508
+ if (v >= Sr) break;
1509
+ p(e), v++;
1505
1510
  }
1506
- let v = [...i.keys()].filter((e) => !s.has(e)).length;
1507
- for (let e of n) {
1508
- if (m >= Cr || v >= wr) break;
1509
- if (i.has(e)) continue;
1510
- let n = { ready: !1 };
1511
- i.set(e, n), n.timer = t(() => l(e), Er), m++, v++;
1511
+ let b = [...a.keys()].filter((e) => !c.has(e)).length;
1512
+ for (let e of f) {
1513
+ if (v >= Sr || b >= Cr) break;
1514
+ a.has(e) || _.has(e) || (p(e), v++, b++);
1512
1515
  }
1513
1516
  }
1514
- let v = /* @__PURE__ */ new Map();
1515
- for (let [e, t] of _) {
1516
- let n = i.get(e);
1517
- n && s.has(e) ? v.set(e, {
1517
+ let _ = /* @__PURE__ */ new Map();
1518
+ for (let [e, t] of g) {
1519
+ let r = a.get(e);
1520
+ r && c.has(e) ? _.set(e, {
1518
1521
  tier: "live",
1519
1522
  mounted: !0,
1520
- ready: n.ready
1521
- }) : n ? v.set(e, {
1522
- tier: d.snapshots.has(e) ? "snapshot" : "placeholder",
1523
+ ready: r.ready
1524
+ }) : r ? _.set(e, {
1525
+ tier: n.snapshots.has(e) ? "snapshot" : "placeholder",
1523
1526
  mounted: !0,
1524
- ready: n.ready,
1527
+ ready: r.ready,
1525
1528
  warming: !0
1526
- }) : v.set(e, {
1527
- tier: t === "live" ? d.snapshots.has(e) ? "snapshot" : "placeholder" : t,
1529
+ }) : _.set(e, {
1530
+ tier: t === "live" ? n.snapshots.has(e) ? "snapshot" : "placeholder" : t,
1528
1531
  mounted: !1,
1529
1532
  ready: !1
1530
1533
  });
1531
1534
  }
1532
- return v;
1535
+ return _;
1533
1536
  }
1534
1537
  };
1535
1538
  }
1536
1539
  //#endregion
1537
1540
  //#region src/viewer/hooks/useBoardTiers.ts
1538
- var Or = 3e3, kr = null;
1539
- function Ar() {
1541
+ var Dr = 1e4, Or = null;
1542
+ function kr() {
1540
1543
  let e = typeof matchMedia == "function" ? matchMedia("(prefers-color-scheme: dark)") : null, [t, n] = Y(!!e?.matches);
1541
1544
  return K(() => {
1542
1545
  if (!e) return;
@@ -1544,56 +1547,62 @@ function Ar() {
1544
1547
  return e.addEventListener?.("change", t), () => e.removeEventListener?.("change", t);
1545
1548
  }, [e]), t ? "dark" : "light";
1546
1549
  }
1547
- function jr({ artifact: e, boards: n, versions: r, pending: i, view: a, scaling: o, viewport: s, pinned: l, hovered: u, hoverPromotes: d, persistable: f, store: p }) {
1548
- let h = p ?? (kr ??= br()), [, g] = qe((e) => e + 1, 0), [_] = Y(() => Dr({ onChange: g })), v = typeof devicePixelRatio == "number" && devicePixelRatio > 0 ? devicePixelRatio : 1, y = Ar(), b = J(/* @__PURE__ */ new Map()), x = J(/* @__PURE__ */ new Map()), C = n.filter(([e, n]) => !t(n) && M(r, n.file) && !i.has(e)), w = new Map(C.map(([t, n]) => [t, _r({
1550
+ function Ar({ artifact: e, boards: n, versions: r, pending: i, view: a, scaling: o, viewport: s, pinned: l, hovered: u, hoverPromotes: d, persistable: f, store: p }) {
1551
+ let h = p ?? (Or ??= br()), [, g] = qe((e) => e + 1, 0), _ = J(/* @__PURE__ */ new Set()), [v] = Y(() => Er({
1552
+ onChange: g,
1553
+ onGiveUp: (e) => {
1554
+ let t = O.current.get(e);
1555
+ t && _.current.add(t);
1556
+ }
1557
+ })), y = typeof devicePixelRatio == "number" && devicePixelRatio > 0 ? devicePixelRatio : 1, b = kr(), x = J(/* @__PURE__ */ new Map()), C = J(/* @__PURE__ */ new Set()), w = J(/* @__PURE__ */ new Set()), T = J(/* @__PURE__ */ new Map()), E = n.filter(([e, n]) => !t(n) && ce(r, n.file) && !i.has(e)), D = new Map(E.map(([t, n]) => [t, _r({
1549
1558
  artifact: e,
1550
1559
  file: n.file,
1551
1560
  version: r[n.file] ?? 0,
1552
- scheme: y,
1561
+ scheme: b,
1553
1562
  w: n.w,
1554
1563
  h: n.h
1555
- })])), T = J(w);
1556
- T.current = w;
1557
- let E = J(f);
1558
- E.current = f;
1559
- let D = J(o);
1560
- D.current = o, K(() => h.subscribe(() => g()), [h]);
1561
- let O = J(/* @__PURE__ */ new Set());
1564
+ })])), O = J(D);
1565
+ O.current = D;
1566
+ let k = J(f);
1567
+ k.current = f;
1568
+ let A = J(o);
1569
+ A.current = o, K(() => h.subscribe(() => g()), [h]);
1570
+ let ee = J(/* @__PURE__ */ new Set());
1562
1571
  K(() => {
1563
- for (let e of w.values()) h.has(e) || O.current.has(e) || (O.current.add(e), h.load(e));
1572
+ for (let e of D.values()) h.has(e) || ee.current.has(e) || (ee.current.add(e), h.load(e));
1564
1573
  });
1565
- let k = new Set([...w].filter(([, e]) => h.has(e) && !h.isUnsupported(e)).map(([e]) => e)), A = C.map(([e, t]) => ({
1574
+ let te = new Set([...D].filter(([, e]) => h.has(e) && !h.isUnsupported(e)).map(([e]) => e)), ne = E.map(([e, t]) => ({
1566
1575
  id: e,
1567
1576
  x: t.x,
1568
1577
  y: t.y,
1569
1578
  w: t.w,
1570
1579
  h: t.h
1571
- })), j = new Set([...w].filter(([, e]) => h.isUnsupported(e)).map(([e]) => e)), ee = o ? [] : c({
1572
- boards: A,
1580
+ })), re = new Set([...D].filter(([, e]) => h.isUnsupported(e) || _.current.has(e)).map(([e]) => e)), ie = o ? [] : c({
1581
+ boards: ne,
1573
1582
  view: a,
1574
1583
  viewport: s,
1575
- snapshots: k,
1576
- skip: j
1577
- }), te = _.update({
1578
- boards: A,
1584
+ snapshots: te,
1585
+ skip: re
1586
+ }), ae = v.update({
1587
+ boards: ne,
1579
1588
  view: a,
1580
1589
  viewport: s,
1581
1590
  pinned: l,
1582
- snapshots: k,
1591
+ snapshots: te,
1583
1592
  scaling: o,
1584
1593
  hovered: u,
1585
1594
  hoverPromotes: d,
1586
- warm: ee
1587
- }), ne = J(a.k);
1588
- o || (ne.current = a.k);
1589
- let re = S(ne.current, v), [ie, ae] = Y({}), oe = J(/* @__PURE__ */ new Set()), se = J(/* @__PURE__ */ new Set()), N = J(/* @__PURE__ */ new Set());
1595
+ warm: ie
1596
+ }), oe = J(a.k);
1597
+ o || (oe.current = a.k);
1598
+ let se = S(oe.current, y), [le, j] = Y({}), ue = J(/* @__PURE__ */ new Set()), de = J(/* @__PURE__ */ new Set()), fe = J(/* @__PURE__ */ new Set());
1590
1599
  K(() => {
1591
- for (let [e, t] of w) {
1592
- let n = te.get(e);
1593
- if (!k.has(e) || !(n?.tier === "snapshot" || n?.mounted)) continue;
1594
- let r = `${t}#${h.revision(t)}@${re}`;
1595
- ie[e]?.name === r || oe.current.has(r) || N.current.has(r) || (oe.current.add(r), h.url(t, re).then((t) => {
1596
- oe.current.delete(r), t && se.current.has(t) ? N.current.add(r) : t && ae((n) => n[e]?.name === r ? n : {
1600
+ for (let [e, t] of D) {
1601
+ let n = ae.get(e);
1602
+ if (!te.has(e) || !(n?.tier === "snapshot" || n?.mounted)) continue;
1603
+ let r = `${t}#${h.revision(t)}@${se}`;
1604
+ le[e]?.name === r || ue.current.has(r) || fe.current.has(r) || (ue.current.add(r), h.url(t, se).then((t) => {
1605
+ ue.current.delete(r), t && de.current.has(t) ? fe.current.add(r) : t && j((n) => n[e]?.name === r ? n : {
1597
1606
  ...n,
1598
1607
  [e]: {
1599
1608
  name: r,
@@ -1603,24 +1612,24 @@ function jr({ artifact: e, boards: n, versions: r, pending: i, view: a, scaling:
1603
1612
  }));
1604
1613
  }
1605
1614
  });
1606
- let ce = G((e, t) => {
1607
- t.startsWith("blob:") && (se.current.add(t), ae((n) => {
1615
+ let M = G((e, t) => {
1616
+ t.startsWith("blob:") && (de.current.add(t), j((n) => {
1608
1617
  if (n[e]?.url !== t) return n;
1609
1618
  let { [e]: r, ...i } = n;
1610
1619
  return i;
1611
1620
  }));
1612
- }, []), le = q(() => new Map(n.map(([e, t]) => [e, `data:image/svg+xml;charset=utf-8,${encodeURIComponent(mr({
1621
+ }, []), pe = q(() => new Map(n.map(([e, t]) => [e, `data:image/svg+xml;charset=utf-8,${encodeURIComponent(mr({
1613
1622
  id: e,
1614
1623
  title: t.title,
1615
1624
  w: t.w,
1616
1625
  h: t.h
1617
- }))}`])), [n]), ue = J([]), P = J(null), de = J(0), F = G(() => {
1618
- if (!(P.current || D.current)) for (; ue.current.length;) {
1619
- let e = ue.current.shift(), t = b.current.get(e)?.contentWindow, n = T.current.get(e);
1626
+ }))}`])), [n]), N = J([]), P = J(null), me = J(0), F = G(() => {
1627
+ if (!(P.current || A.current)) for (; N.current.length;) {
1628
+ let e = N.current.shift(), t = x.current.get(e)?.contentWindow, n = O.current.get(e);
1620
1629
  if (!t || !n || h.isUnsupported(n)) continue;
1621
- let r = ++de.current, i = window.setTimeout(() => {
1622
- P.current?.request === r && (h.markUnsupported(n), P.current = null, g(), F());
1623
- }, Or);
1630
+ let r = ++me.current, i = window.setTimeout(() => {
1631
+ P.current?.request === r && (_.current.add(n), w.current.add(e), P.current = null, g(), F());
1632
+ }, Dr);
1624
1633
  P.current = {
1625
1634
  id: e,
1626
1635
  key: n,
@@ -1629,25 +1638,25 @@ function jr({ artifact: e, boards: n, versions: r, pending: i, view: a, scaling:
1629
1638
  }, t.postMessage({
1630
1639
  type: "ryugi:board:capture",
1631
1640
  request: r,
1632
- scale: v
1641
+ scale: y
1633
1642
  }, "*");
1634
1643
  return;
1635
1644
  }
1636
- }, [h, v]), fe = J(F);
1637
- fe.current = F, K(() => {
1645
+ }, [h, y]), I = J(F);
1646
+ I.current = F, K(() => {
1638
1647
  o || F();
1639
1648
  }, [o, F]), K(() => () => {
1640
1649
  P.current && window.clearTimeout(P.current.timer);
1641
1650
  }, []), K(() => {
1642
1651
  let e = (e) => {
1643
- ue.current.includes(e) || ue.current.push(e), F();
1652
+ w.current.has(e) || (N.current.includes(e) || N.current.push(e), F());
1644
1653
  }, t = (t) => {
1645
1654
  let n = t.data?.type;
1646
1655
  if (typeof n != "string" || !n.startsWith("ryugi:board:")) return;
1647
- let r = [...b.current].find(([, e]) => e.contentWindow === t.source)?.[0];
1656
+ let r = [...x.current].find(([, e]) => e.contentWindow === t.source)?.[0];
1648
1657
  if (r) {
1649
- if (n === "ryugi:board:ready") _.ready(r), e(r);
1650
- else if (n === "ryugi:board:changed") e(r);
1658
+ if (n === "ryugi:board:ready") C.current.add(r), v.ready(r), e(r);
1659
+ else if (n === "ryugi:board:changed") C.current.has(r) && e(r);
1651
1660
  else if (n === "ryugi:board:snapshot") {
1652
1661
  let e = P.current;
1653
1662
  if (!e || e.id !== r || t.data.request !== e.request) return;
@@ -1657,22 +1666,24 @@ function jr({ artifact: e, boards: n, versions: r, pending: i, view: a, scaling:
1657
1666
  blob: n,
1658
1667
  width: i,
1659
1668
  height: a,
1660
- scale: v
1661
- }, { persist: E.current(r) }) : (h.markUnsupported(e.key), g()), F();
1669
+ scale: y
1670
+ }, { persist: k.current(r) }) : (h.markUnsupported(e.key), g()), F();
1662
1671
  }
1663
1672
  }
1664
1673
  };
1665
1674
  return window.addEventListener("message", t), () => window.removeEventListener("message", t);
1666
1675
  }, [
1667
- _,
1676
+ v,
1668
1677
  F,
1669
1678
  h,
1670
- v
1679
+ y
1671
1680
  ]);
1672
- let I = G((e) => (x.current.has(e) || x.current.set(e, (t) => {
1673
- t ? b.current.set(e, t) : (b.current.delete(e), ue.current = ue.current.filter((t) => t !== e), P.current?.id === e && (window.clearTimeout(P.current.timer), P.current = null, fe.current()));
1674
- }), x.current.get(e)), []), L = G((e) => _.loaded(e), [_]), pe = n.filter(([, e]) => t(e)), me = m({
1675
- boards: pe.map(([e, t]) => ({
1681
+ let L = G((e) => (T.current.has(e) || T.current.set(e, (t) => {
1682
+ t ? x.current.set(e, t) : (x.current.delete(e), C.current.delete(e), w.current.delete(e), N.current = N.current.filter((t) => t !== e), P.current?.id === e && (window.clearTimeout(P.current.timer), P.current = null, I.current()));
1683
+ }), T.current.get(e)), []), he = G((e) => {
1684
+ C.current.delete(e), w.current.delete(e), v.loaded(e);
1685
+ }, [v]), ge = n.filter(([, e]) => t(e)), _e = m({
1686
+ boards: ge.map(([e, t]) => ({
1676
1687
  id: e,
1677
1688
  x: t.x,
1678
1689
  y: t.y,
@@ -1682,18 +1693,18 @@ function jr({ artifact: e, boards: n, versions: r, pending: i, view: a, scaling:
1682
1693
  view: a,
1683
1694
  viewport: s,
1684
1695
  pinned: /* @__PURE__ */ new Set(),
1685
- snapshots: new Set(pe.map(([e]) => e))
1686
- }), he = /* @__PURE__ */ new Map();
1687
- for (let [e, t] of me) he.set(e, {
1696
+ snapshots: new Set(ge.map(([e]) => e))
1697
+ }), ve = /* @__PURE__ */ new Map();
1698
+ for (let [e, t] of _e) ve.set(e, {
1688
1699
  tier: t,
1689
1700
  mounted: !1,
1690
1701
  image: null,
1691
1702
  overlay: !1,
1692
1703
  hidden: !1
1693
1704
  });
1694
- for (let [e, t] of te) {
1695
- let n = w.get(e), r = ie[e], i = k.has(e) && r?.name.startsWith(`${n}#`) ? r.url : null, a = t.tier === "empty" ? null : i ?? le.get(e) ?? null;
1696
- he.set(e, {
1705
+ for (let [e, t] of ae) {
1706
+ let n = D.get(e), r = le[e], i = te.has(e) && r?.name.startsWith(`${n}#`) ? r.url : null, a = t.tier === "empty" ? null : i ?? pe.get(e) ?? null;
1707
+ ve.set(e, {
1697
1708
  tier: t.tier,
1698
1709
  mounted: t.mounted,
1699
1710
  image: a,
@@ -1702,23 +1713,132 @@ function jr({ artifact: e, boards: n, versions: r, pending: i, view: a, scaling:
1702
1713
  });
1703
1714
  }
1704
1715
  return {
1705
- renders: he,
1706
- frameRef: I,
1707
- loaded: L,
1708
- imageFailed: ce
1716
+ renders: ve,
1717
+ frameRef: L,
1718
+ loaded: he,
1719
+ imageFailed: M
1720
+ };
1721
+ }
1722
+ //#endregion
1723
+ //#region src/viewer/lib/hover-dwell.ts
1724
+ var jr = 4;
1725
+ function Mr({ dwellMs: e, schedule: t, cancel: n, onChange: r }) {
1726
+ let i = null, a = null, o = !1, s, c = () => {
1727
+ s !== void 0 && n(s), s = void 0;
1728
+ }, l = (e) => {
1729
+ e !== a && (a = e, r());
1730
+ }, u = () => {
1731
+ if (c(), !i || o || a === i.board) return;
1732
+ let n = i.board;
1733
+ s = t(() => {
1734
+ s = void 0, l(n);
1735
+ }, e);
1736
+ };
1737
+ return {
1738
+ move(e, t) {
1739
+ e !== a && l(null), e ? i?.board === e && Math.hypot(t.x - i.x, t.y - i.y) < jr || (i = {
1740
+ board: e,
1741
+ ...t
1742
+ }, u()) : (i = null, c());
1743
+ },
1744
+ setScaling(e) {
1745
+ e !== o && (o = e, o ? c() : u());
1746
+ },
1747
+ current: () => a,
1748
+ dispose: c
1709
1749
  };
1710
1750
  }
1711
1751
  //#endregion
1752
+ //#region src/viewer/hooks/useHoverDwell.ts
1753
+ var Nr = {
1754
+ x: -1e9,
1755
+ y: -1e9
1756
+ }, Pr = () => {
1757
+ if (typeof location > "u") return 600;
1758
+ let e = new URLSearchParams(location.search), t = Number(e.get("hover"));
1759
+ return e.has("debug") && t > 0 ? t : 600;
1760
+ };
1761
+ function Fr({ scaling: e, view: t, inside: n = null, locate: r }) {
1762
+ let [, i] = qe((e) => e + 1, 0), [a] = Y(() => Mr({
1763
+ dwellMs: Pr(),
1764
+ schedule: (e, t) => window.setTimeout(e, t),
1765
+ cancel: (e) => window.clearTimeout(e),
1766
+ onChange: i
1767
+ })), o = J(null), s = J(r);
1768
+ s.current = r;
1769
+ let c = G((e) => {
1770
+ o.current = {
1771
+ clientX: e.clientX,
1772
+ clientY: e.clientY
1773
+ };
1774
+ let { board: t, x: n, y: r } = s.current(o.current);
1775
+ a.move(t, {
1776
+ x: n,
1777
+ y: r
1778
+ });
1779
+ }, [a]), l = G(() => {
1780
+ o.current = null, a.move(null, {
1781
+ x: 0,
1782
+ y: 0
1783
+ });
1784
+ }, [a]);
1785
+ return K(() => () => a.dispose(), [a]), K(() => a.setScaling(e), [a, e]), K(() => {
1786
+ n && (o.current = null, a.move(n, Nr));
1787
+ }, [a, n]), K(() => {
1788
+ o.current && !e && c(o.current);
1789
+ }, [
1790
+ t.x,
1791
+ t.y,
1792
+ t.k,
1793
+ e,
1794
+ c
1795
+ ]), {
1796
+ hovered: a.current(),
1797
+ track: c,
1798
+ leave: l
1799
+ };
1800
+ }
1801
+ function Ir(e, t, n) {
1802
+ let r = [...e.filter((e) => e.id !== t), {
1803
+ id: t,
1804
+ version: n
1805
+ }];
1806
+ return r.slice(Math.max(0, r.length - 6));
1807
+ }
1808
+ function Lr(e, t) {
1809
+ let n = e.filter((e) => t.get(e.id) === e.version);
1810
+ return n.length === e.length ? e : n;
1811
+ }
1812
+ //#endregion
1813
+ //#region src/viewer/hooks/useKeptBoards.ts
1814
+ function Rr(e, t, n = () => !0) {
1815
+ let [r, i] = Y([]), a = q(() => new Map(e.map(([e, n]) => [e, t[n.file] ?? 0])), [e, t]), o = J(a);
1816
+ o.current = a;
1817
+ let s = J(n);
1818
+ s.current = n, K(() => {
1819
+ let e = (e) => {
1820
+ if (e.data?.type !== "ryugi:board:interacted" || !e.source) return;
1821
+ let t = [...document.querySelectorAll("[data-board] iframe")].find((t) => t.contentWindow === e.source)?.closest("[data-board]")?.dataset.board, n = t === void 0 ? void 0 : o.current.get(t);
1822
+ t !== void 0 && n !== void 0 && s.current(t) && i((e) => e.at(-1)?.id === t && e.at(-1)?.version === n ? e : Ir(e, t, n));
1823
+ };
1824
+ return window.addEventListener("message", e), () => window.removeEventListener("message", e);
1825
+ }, []);
1826
+ let c = Lr(r, a);
1827
+ return K(() => {
1828
+ c !== r && i(c);
1829
+ }, [c, r]), q(() => new Set(c.map((e) => e.id)), [c]);
1830
+ }
1831
+ //#endregion
1712
1832
  //#region src/shared/verdicts.ts
1713
- var Mr = (e) => e.messages[0]?.at ?? e.statusAt;
1714
- function Nr(e, t, n) {
1715
- let r = e.filter((e) => e.anchor.group === t && e.anchor.verdict && e.messages.some((e) => !e.deleted)).sort((e, t) => Mr(e) < Mr(t) ? -1 : +(Mr(e) > Mr(t))), i = r.filter((e) => e.anchor.verdict === "reject" && e.status === "open").length, a = r.at(-1);
1833
+ var zr = (e) => e.messages[0]?.at ?? e.statusAt;
1834
+ function Br(e, t, n) {
1835
+ let r = e.filter((e) => e.anchor.group === t && e.anchor.verdict && e.messages.some((e) => !e.deleted)).sort((e, t) => zr(e) < zr(t) ? -1 : +(zr(e) > zr(t))), i = r.filter((e) => e.anchor.verdict === "reject" && e.status === "open").length, a = r.at(-1);
1716
1836
  if (!a) return {
1717
1837
  state: "pending",
1718
1838
  evidenceUpdated: !1,
1719
1839
  rejectThreads: i
1720
1840
  };
1721
- let o = Mr(a);
1841
+ let o = zr(a);
1722
1842
  return n.has(a.id) ? {
1723
1843
  state: "pending",
1724
1844
  at: o,
@@ -1736,11 +1856,11 @@ function Nr(e, t, n) {
1736
1856
  rejectThreads: i
1737
1857
  };
1738
1858
  }
1739
- function Pr(e, t, n) {
1859
+ function Vr(e, t, n) {
1740
1860
  return Object.entries(e).filter(([, e]) => e.verify === !0 && e.boards.some((e) => t[e]?.page === n));
1741
1861
  }
1742
- function Fr(e, t, n, r, i) {
1743
- let a = Pr(e, t, n), o = a.map(([e]) => [e, Nr(r, e, i).state]), s = o.find(([, e]) => e !== "pass")?.[0];
1862
+ function Hr(e, t, n, r, i) {
1863
+ let a = Vr(e, t, n), o = a.map(([e]) => [e, Br(r, e, i).state]), s = o.find(([, e]) => e !== "pass")?.[0];
1744
1864
  return {
1745
1865
  passed: o.filter(([, e]) => e === "pass").length,
1746
1866
  total: a.length,
@@ -1749,14 +1869,14 @@ function Fr(e, t, n, r, i) {
1749
1869
  }
1750
1870
  //#endregion
1751
1871
  //#region src/viewer/hooks/useVerdicts.ts
1752
- function Ir({ canvas: e, page: t, threads: n, stale: r, versions: i, comment: a }) {
1753
- let [o, s] = Y(null), c = q(() => e?.groups ?? {}, [e]), l = q(() => e?.boards ?? {}, [e]), u = q(() => Object.fromEntries(Pr(c, l, t).map(([e]) => [e, Nr(n, e, r)])), [
1872
+ function Ur({ canvas: e, page: t, threads: n, stale: r, versions: i, comment: a }) {
1873
+ let [o, s] = Y(null), c = q(() => e?.groups ?? {}, [e]), l = q(() => e?.boards ?? {}, [e]), u = q(() => Object.fromEntries(Vr(c, l, t).map(([e]) => [e, Br(n, e, r)])), [
1754
1874
  c,
1755
1875
  l,
1756
1876
  t,
1757
1877
  n,
1758
1878
  r
1759
- ]), d = q(() => Fr(c, l, t, n, r), [
1879
+ ]), d = q(() => Hr(c, l, t, n, r), [
1760
1880
  c,
1761
1881
  l,
1762
1882
  t,
@@ -1812,8 +1932,8 @@ function Ir({ canvas: e, page: t, threads: n, stale: r, versions: i, comment: a
1812
1932
  }
1813
1933
  //#endregion
1814
1934
  //#region src/viewer/verdicts/RejectComposer.tsx
1815
- function Lr({ group: e, left: t, top: n, onSubmit: r, onCancel: i }) {
1816
- let { t: a } = F();
1935
+ function Wr({ group: e, left: t, top: n, onSubmit: r, onCancel: i }) {
1936
+ let { t: a } = N();
1817
1937
  return /* @__PURE__ */ Q("div", {
1818
1938
  "data-chrome": "reject",
1819
1939
  className: "x10l6tqk xk3oba8 xj6ak53 xb3r6kr xixl9f9 x12ilycc x1d5q07e xqfszdh xfifm61 xo2rkog xt0e3qv",
@@ -1854,7 +1974,7 @@ function Lr({ group: e, left: t, top: n, onSubmit: r, onCancel: i }) {
1854
1974
  }
1855
1975
  //#endregion
1856
1976
  //#region src/shared/inspector.ts
1857
- var Rr = [
1977
+ var Gr = [
1858
1978
  "width",
1859
1979
  "height",
1860
1980
  "position",
@@ -1871,7 +1991,7 @@ var Rr = [
1871
1991
  "font-size",
1872
1992
  "color",
1873
1993
  "box-shadow"
1874
- ], zr = "M14.5 3a10.5 10.5 0 1 1-4.2 20.1l-5 1.6c-.9.3-1.7-.5-1.4-1.4l1.6-5A10.5 10.5 0 0 1 14.5 3z", Br = `<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'><path d='${zr}' fill='none' stroke='white' stroke-width='4' stroke-linejoin='round'/><path d='${zr}' fill='#c65d3b'/><path d='M14.5 9.3v8.4M10.3 13.5h8.4' stroke='white' stroke-width='2.4' stroke-linecap='round'/></svg>`, Vr = `url("data:image/svg+xml,${encodeURIComponent(Br)}") 4 24, crosshair`, Hr = (e) => !!e && typeof e == "object" && !Array.isArray(e), $ = (e, t) => typeof e == "string" && e.length <= t, Ur = (e) => typeof e == "number" && Number.isFinite(e) && Math.abs(e) <= 1e8, Wr = (e) => Number.isSafeInteger(e) && e > 0, Gr = (e) => e === null || Hr(e) && Ur(e.x) && Ur(e.y) && Ur(e.width) && Ur(e.height) && e.width >= 0 && e.height >= 0, Kr = (e) => Rr.some((t) => t === e), qr = /* @__PURE__ */ new Set([
1994
+ ], Kr = "M14.5 3a10.5 10.5 0 1 1-4.2 20.1l-5 1.6c-.9.3-1.7-.5-1.4-1.4l1.6-5A10.5 10.5 0 0 1 14.5 3z", qr = `<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'><path d='${Kr}' fill='none' stroke='white' stroke-width='4' stroke-linejoin='round'/><path d='${Kr}' fill='#c65d3b'/><path d='M14.5 9.3v8.4M10.3 13.5h8.4' stroke='white' stroke-width='2.4' stroke-linecap='round'/></svg>`, Jr = `url("data:image/svg+xml,${encodeURIComponent(qr)}") 4 24, crosshair`, Yr = (e) => !!e && typeof e == "object" && !Array.isArray(e), $ = (e, t) => typeof e == "string" && e.length <= t, Xr = (e) => typeof e == "number" && Number.isFinite(e) && Math.abs(e) <= 1e8, Zr = (e) => Number.isSafeInteger(e) && e > 0, Qr = (e) => e === null || Yr(e) && Xr(e.x) && Xr(e.y) && Xr(e.width) && Xr(e.height) && e.width >= 0 && e.height >= 0, $r = (e) => Gr.some((t) => t === e), ei = /* @__PURE__ */ new Set([
1875
1995
  "Frame",
1876
1996
  "Column",
1877
1997
  "Row",
@@ -1881,28 +2001,28 @@ var Rr = [
1881
2001
  "Image",
1882
2002
  "Button"
1883
2003
  ]);
1884
- function Jr(e) {
2004
+ function ti(e) {
1885
2005
  if (!Array.isArray(e) || e.length > 2500) return !1;
1886
2006
  let t = /* @__PURE__ */ new Map();
1887
2007
  for (let n of e) {
1888
- if (!Hr(n) || !Wr(n.id) || t.has(n.id) || !$(n.name, 100) || !$(n.tag, 80) || !$(n.selector, 200) || !$(n.path, 4e3) || !qr.has(n.kind) || !Array.isArray(n.children) || n.children.length > e.length || n.children.some((e) => !Wr(e)) || new Set(n.children).size !== n.children.length || (t.size === 0 ? n.parentId !== null : !Wr(n.parentId) || !t.has(n.parentId))) return !1;
2008
+ if (!Yr(n) || !Zr(n.id) || t.has(n.id) || !$(n.name, 100) || !$(n.tag, 80) || !$(n.selector, 200) || !$(n.path, 4e3) || !ei.has(n.kind) || !Array.isArray(n.children) || n.children.length > e.length || n.children.some((e) => !Zr(e)) || new Set(n.children).size !== n.children.length || (t.size === 0 ? n.parentId !== null : !Zr(n.parentId) || !t.has(n.parentId))) return !1;
1889
2009
  t.set(n.id, n);
1890
2010
  }
1891
2011
  for (let e of t.values()) if (e.children.some((n) => t.get(n)?.parentId !== e.id) || e.parentId !== null && !t.get(e.parentId)?.children.includes(e.id)) return !1;
1892
2012
  return !0;
1893
2013
  }
1894
- function Yr(e) {
1895
- if (!Hr(e) || !$(e.session, 128) || !e.session || !$(e.connection, 128) || !e.connection) return null;
2014
+ function ni(e) {
2015
+ if (!Yr(e) || !$(e.session, 128) || !e.session || !$(e.connection, 128) || !e.connection) return null;
1896
2016
  let t = !1;
1897
2017
  switch (e.type) {
1898
2018
  case "ryugi:inspect:tree":
1899
- t = typeof e.truncated == "boolean" && Jr(e.nodes);
2019
+ t = typeof e.truncated == "boolean" && ti(e.nodes);
1900
2020
  break;
1901
2021
  case "ryugi:inspect:hover":
1902
- t = Gr(e.rect) && (e.id === void 0 || e.id === null || Wr(e.id));
2022
+ t = Qr(e.rect) && (e.id === void 0 || e.id === null || Zr(e.id));
1903
2023
  break;
1904
2024
  case "ryugi:inspect:rect":
1905
- t = Wr(e.id) && e.rect !== null && Gr(e.rect);
2025
+ t = Zr(e.id) && e.rect !== null && Qr(e.rect);
1906
2026
  break;
1907
2027
  case "ryugi:inspect:selection": {
1908
2028
  if (![
@@ -1912,18 +2032,18 @@ function Yr(e) {
1912
2032
  "primary"
1913
2033
  ].includes(e.reason) || e.toggle !== void 0 && typeof e.toggle != "boolean") break;
1914
2034
  let n = e.selection;
1915
- t = n === null || Hr(n) && Wr(n.id) && $(n.name, 100) && $(n.tag, 80) && $(n.selector, 200) && n.rect !== null && Gr(n.rect) && $(n.html, 2e4) && [
2035
+ t = n === null || Yr(n) && Zr(n.id) && $(n.name, 100) && $(n.tag, 80) && $(n.selector, 200) && n.rect !== null && Qr(n.rect) && $(n.html, 2e4) && [
1916
2036
  "fixed",
1917
2037
  "fill",
1918
2038
  "hug"
1919
- ].includes(n.widthMode) && ["fixed", "hug"].includes(n.heightMode) && Hr(n.css) && Rr.every((e) => $(n.css[e], 2e3));
2039
+ ].includes(n.widthMode) && ["fixed", "hug"].includes(n.heightMode) && Yr(n.css) && Gr.every((e) => $(n.css[e], 2e3));
1920
2040
  break;
1921
2041
  }
1922
2042
  case "ryugi:inspect:targets":
1923
- t = Wr(e.request) && Array.isArray(e.targets) && e.targets.length <= 2500 && new Set(e.targets.map((e) => Hr(e) ? e.id : null)).size === e.targets.length && e.targets.every((e) => Hr(e) && Wr(e.id) && $(e.name, 100) && e.rect !== null && Gr(e.rect));
2043
+ t = Zr(e.request) && Array.isArray(e.targets) && e.targets.length <= 2500 && new Set(e.targets.map((e) => Yr(e) ? e.id : null)).size === e.targets.length && e.targets.every((e) => Yr(e) && Zr(e.id) && $(e.name, 100) && e.rect !== null && Qr(e.rect));
1924
2044
  break;
1925
2045
  case "ryugi:inspect:details":
1926
- t = Wr(e.request) && Array.isArray(e.nodes) && e.nodes.length <= 2500 && e.nodes.every((e) => Hr(e) && Wr(e.id) && $(e.text, 200) && $(e.html, 2e3));
2046
+ t = Zr(e.request) && Array.isArray(e.nodes) && e.nodes.length <= 2500 && e.nodes.every((e) => Yr(e) && Zr(e.id) && $(e.text, 200) && $(e.html, 2e3));
1927
2047
  break;
1928
2048
  case "ryugi:inspect:drag":
1929
2049
  t = [
@@ -1931,16 +2051,16 @@ function Yr(e) {
1931
2051
  "move",
1932
2052
  "end",
1933
2053
  "cancel"
1934
- ].includes(e.phase) && Ur(e.x) && Ur(e.y) && typeof e.append == "boolean" && (e.id === void 0 || Wr(e.id));
2054
+ ].includes(e.phase) && Xr(e.x) && Xr(e.y) && typeof e.append == "boolean" && (e.id === void 0 || Zr(e.id));
1935
2055
  break;
1936
2056
  case "ryugi:inspect:tweaks":
1937
- t = Array.isArray(e.tweaks) && e.tweaks.length <= 2500 && e.tweaks.every((e) => Hr(e) && Wr(e.id) && $(e.name, 200) && Kr(e.property) && $(e.from, 2e3) && $(e.value, 300));
2057
+ t = Array.isArray(e.tweaks) && e.tweaks.length <= 2500 && e.tweaks.every((e) => Yr(e) && Zr(e.id) && $(e.name, 200) && $r(e.property) && $(e.from, 2e3) && $(e.value, 300));
1938
2058
  break;
1939
2059
  case "ryugi:inspect:wheel":
1940
- t = Ur(e.deltaX) && Ur(e.deltaY) && Ur(e.x) && Ur(e.y) && typeof e.zoom == "boolean";
2060
+ t = Xr(e.deltaX) && Xr(e.deltaY) && Xr(e.x) && Xr(e.y) && typeof e.zoom == "boolean";
1941
2061
  break;
1942
2062
  case "ryugi:inspect:pan":
1943
- t = Ur(e.deltaX) && Ur(e.deltaY);
2063
+ t = Xr(e.deltaX) && Xr(e.deltaY);
1944
2064
  break;
1945
2065
  case "ryugi:inspect:key": t = $(e.code, 32) && $(e.key, 32) && [
1946
2066
  "down",
@@ -1954,7 +2074,7 @@ function Yr(e) {
1954
2074
  }
1955
2075
  //#endregion
1956
2076
  //#region src/viewer/hooks/useInspector.ts
1957
- function Xr(e) {
2077
+ function ri(e) {
1958
2078
  let [t, n] = Y({
1959
2079
  frames: {},
1960
2080
  selection: null,
@@ -2031,7 +2151,7 @@ function Xr(e) {
2031
2151
  let e = (e) => {
2032
2152
  let t = Array.from(i.current).find(([, t]) => t.element.contentWindow === e.source);
2033
2153
  if (!t) return;
2034
- let [a, o] = t, l = Yr(e.data);
2154
+ let [a, o] = t, l = ni(e.data);
2035
2155
  if (!(!l || l.connection !== o.connection || o.session !== null && o.session !== l.session) && (r.current.options.enabled || l.type === "ryugi:inspect:tweaks") && !(r.current.options.playing.has(a) && l.type !== "ryugi:inspect:tweaks")) {
2036
2156
  if (l.type === "ryugi:inspect:tree") {
2037
2157
  o.session = l.session;
@@ -2299,7 +2419,7 @@ function Xr(e) {
2299
2419
  }
2300
2420
  //#endregion
2301
2421
  //#region src/viewer/hooks/useMarqueeSelection.ts
2302
- function Zr(e, t, n, r) {
2422
+ function ii(e, t, n, r) {
2303
2423
  let i = J(null), [a, o] = Y(!1), [s, c] = Y(null), { cancelDrag: l } = t, u = G(() => {
2304
2424
  i.current = null, c(null), o(!1), l();
2305
2425
  }, [l]);
@@ -2347,7 +2467,7 @@ function Zr(e, t, n, r) {
2347
2467
  }
2348
2468
  //#endregion
2349
2469
  //#region src/viewer/lib/selection.ts
2350
- function Qr({ boards: e, frames: t, targets: n, details: r }) {
2470
+ function ai({ boards: e, frames: t, targets: n, details: r }) {
2351
2471
  let i = /* @__PURE__ */ new Map();
2352
2472
  for (let [n, r] of Object.entries(t)) {
2353
2473
  let t = e[n];
@@ -2389,15 +2509,15 @@ function Qr({ boards: e, frames: t, targets: n, details: r }) {
2389
2509
  nodes: [...i.values()]
2390
2510
  };
2391
2511
  }
2392
- var $r = (e) => e.id.length <= A.id && e.board.length <= A.board && e.file.length <= A.file && e.tag.length <= A.tag && e.path.length <= A.path && e.name.length <= A.name, ei = (e) => new TextEncoder().encode(JSON.stringify(e)).length;
2393
- function ti(e, t = oe) {
2394
- let n = e.selected.filter((e) => $r(e) && e.text.length <= A.text && e.html.length <= A.html), r = e.tweaks.filter((e) => $r(e) && e.from.length <= A.from && e.value.length <= A.value), i = {
2512
+ var oi = (e) => e.id.length <= A.id && e.board.length <= A.board && e.file.length <= A.file && e.tag.length <= A.tag && e.path.length <= A.path && e.name.length <= A.name, si = (e) => new TextEncoder().encode(JSON.stringify(e)).length;
2513
+ function ci(e, t = se) {
2514
+ let n = e.selected.filter((e) => oi(e) && e.text.length <= A.text && e.html.length <= A.html), r = e.tweaks.filter((e) => oi(e) && e.from.length <= A.from && e.value.length <= A.value), i = {
2395
2515
  ...e,
2396
2516
  selected: n,
2397
2517
  tweaks: r,
2398
- nodes: e.nodes.filter($r).slice(0, E)
2518
+ nodes: e.nodes.filter(oi).slice(0, E)
2399
2519
  };
2400
- for (let e = ei(i); e > t && i.nodes.length; e = ei(i)) i = {
2520
+ for (let e = si(i); e > t && i.nodes.length; e = si(i)) i = {
2401
2521
  ...i,
2402
2522
  nodes: i.nodes.slice(0, Math.floor(i.nodes.length * Math.min(.95, t / e)))
2403
2523
  };
@@ -2405,9 +2525,9 @@ function ti(e, t = oe) {
2405
2525
  }
2406
2526
  //#endregion
2407
2527
  //#region src/viewer/hooks/useSelectionSync.ts
2408
- var ni = crypto.randomUUID();
2409
- function ri({ artifact: e, boards: t, live: n, inspector: r, send: i }) {
2410
- let a = J(0), { frames: o, selectedTargets: s, details: c, revision: l } = r, u = JSON.stringify(s.map(({ boardId: e, id: t }) => [e, t])), d = q(() => JSON.parse(u), [u]), f = q(() => Qr({
2528
+ var li = crypto.randomUUID();
2529
+ function ui({ artifact: e, boards: t, live: n, inspector: r, send: i }) {
2530
+ let a = J(0), { frames: o, selectedTargets: s, details: c, revision: l } = r, u = JSON.stringify(s.map(({ boardId: e, id: t }) => [e, t])), d = q(() => JSON.parse(u), [u]), f = q(() => ai({
2411
2531
  boards: t ?? {},
2412
2532
  frames: o,
2413
2533
  targets: d.map(([e, t]) => ({
@@ -2425,10 +2545,10 @@ function ri({ artifact: e, boards: t, live: n, inspector: r, send: i }) {
2425
2545
  if (!e || !i || !n) return;
2426
2546
  let t = setTimeout(() => {
2427
2547
  let t = l !== a.current;
2428
- a.current = l, i(ti({
2548
+ a.current = l, i(ci({
2429
2549
  type: "selection",
2430
2550
  artifact: e,
2431
- tab: ni,
2551
+ tab: li,
2432
2552
  human: t,
2433
2553
  ...f
2434
2554
  }));
@@ -2444,12 +2564,12 @@ function ri({ artifact: e, boards: t, live: n, inspector: r, send: i }) {
2444
2564
  }
2445
2565
  //#endregion
2446
2566
  //#region src/viewer/hooks/usePanZoom.ts
2447
- var ii = {
2567
+ var di = {
2448
2568
  top: 64,
2449
2569
  right: 24,
2450
2570
  bottom: 24,
2451
2571
  left: 24
2452
- }, ai = .01, oi = 420, si = 150, ci = 100, li = f(.2, 0, 0, 1), ui = () => typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches, di = `[data-chrome]${[
2572
+ }, fi = .01, pi = 420, mi = 150, hi = 100, gi = f(.2, 0, 0, 1), _i = () => typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches, vi = `[data-chrome]${[
2453
2573
  "board-label",
2454
2574
  "group-label",
2455
2575
  "video-controls",
@@ -2457,14 +2577,14 @@ var ii = {
2457
2577
  "reject",
2458
2578
  "parameters"
2459
2579
  ].map((e) => `:not([data-chrome="${e}"])`).join("")}`;
2460
- function fi(e, t, n, r) {
2580
+ function yi(e, t, n, r) {
2461
2581
  for (let i = e; i && i !== t; i = i.parentElement) {
2462
2582
  let { overflowX: e, overflowY: t } = getComputedStyle(i);
2463
2583
  if (r && /auto|scroll/.test(t) && i.scrollHeight > i.clientHeight || n && /auto|scroll/.test(e) && i.scrollWidth > i.clientWidth) return !0;
2464
2584
  }
2465
2585
  return !1;
2466
2586
  }
2467
- function pi(t) {
2587
+ function bi(t) {
2468
2588
  let n = J(null), [i, a] = Y({
2469
2589
  x: 0,
2470
2590
  y: 0,
@@ -2479,10 +2599,10 @@ function pi(t) {
2479
2599
  Ke(() => {
2480
2600
  if (i.k === v.current) return;
2481
2601
  v.current = i.k;
2482
- let e = Date.now(), t = e - y.current < ci;
2602
+ let e = Date.now(), t = e - y.current < hi;
2483
2603
  y.current = e, (t || b.current !== void 0) && (_(!0), clearTimeout(b.current), b.current = setTimeout(() => {
2484
2604
  b.current = void 0, _(!1);
2485
- }, si));
2605
+ }, mi));
2486
2606
  }, [i.k]), K(() => () => clearTimeout(b.current), []);
2487
2607
  let [x, S] = Y(() => ({
2488
2608
  width: typeof innerWidth == "number" ? innerWidth : 0,
@@ -2502,14 +2622,14 @@ function pi(t) {
2502
2622
  x: n.x + e,
2503
2623
  y: n.y + t
2504
2624
  })), []), E = G((t) => {
2505
- t.zoom ? a((n) => e(n, Math.exp(-t.deltaY * ai), t.x, t.y)) : C(-t.deltaX, -t.deltaY);
2625
+ t.zoom ? a((n) => e(n, Math.exp(-t.deltaY * fi), t.x, t.y)) : C(-t.deltaX, -t.deltaY);
2506
2626
  }, [C]);
2507
2627
  K(() => {
2508
2628
  let e = n.current;
2509
2629
  if (!e) return;
2510
2630
  let t = (t) => {
2511
2631
  let n = t.target, r = t.ctrlKey || t.metaKey;
2512
- if (n?.closest?.(di) || !r && fi(n, e, t.deltaX, t.deltaY)) return;
2632
+ if (n?.closest?.(vi) || !r && yi(n, e, t.deltaX, t.deltaY)) return;
2513
2633
  t.preventDefault(), h();
2514
2634
  let i = e.getBoundingClientRect(), a = t.deltaMode === 1 ? 16 : t.deltaMode === 2 ? e.clientHeight : 1;
2515
2635
  E({
@@ -2571,7 +2691,7 @@ function pi(t) {
2571
2691
  e ? f.current.delete(e.pointerId) : f.current.clear();
2572
2692
  let t = [...f.current.values()][0];
2573
2693
  u.current = t ? { ...t } : null, t || l(!1);
2574
- }, []), j = () => {
2694
+ }, []), ee = () => {
2575
2695
  let e = n.current;
2576
2696
  return {
2577
2697
  cx: (e?.clientWidth ?? 0) / 2,
@@ -2584,36 +2704,36 @@ function pi(t) {
2584
2704
  scaling: g,
2585
2705
  size: x,
2586
2706
  place: a,
2587
- fit: G((e, t = ii, i = {}) => {
2707
+ fit: G((e, t = di, i = {}) => {
2588
2708
  let o = n.current;
2589
2709
  if (!o || !e) return;
2590
2710
  let s = d(e, {
2591
2711
  width: o.clientWidth,
2592
2712
  height: o.clientHeight
2593
2713
  }, t);
2594
- if (h(), !i.animate || ui()) {
2714
+ if (h(), !i.animate || _i()) {
2595
2715
  a(s);
2596
2716
  return;
2597
2717
  }
2598
2718
  let c = p.current, l = performance.now(), u = () => {
2599
- let e = Math.min(1, (performance.now() - l) / oi);
2600
- a(e === 1 ? s : r(c, s, li(e))), m.current = e === 1 ? null : requestAnimationFrame(u);
2719
+ let e = Math.min(1, (performance.now() - l) / pi);
2720
+ a(e === 1 ? s : r(c, s, gi(e))), m.current = e === 1 ? null : requestAnimationFrame(u);
2601
2721
  };
2602
2722
  m.current = requestAnimationFrame(u);
2603
2723
  }, [h]),
2604
2724
  zoomBy: G((t) => {
2605
- let { cx: n, cy: r } = j();
2725
+ let { cx: n, cy: r } = ee();
2606
2726
  a((i) => e(i, t, n, r));
2607
2727
  }, []),
2608
2728
  zoomTo: G((e) => {
2609
- let { cx: t, cy: n } = j();
2729
+ let { cx: t, cy: n } = ee();
2610
2730
  a((r) => w(r, e, t, n));
2611
2731
  }, []),
2612
2732
  panBy: C,
2613
2733
  wheelAt: E,
2614
2734
  panning: D,
2615
2735
  setSpaceHeld: s,
2616
- cursor: c ? "grabbing" : D ? "grab" : t === "comment" ? Vr : "default",
2736
+ cursor: c ? "grabbing" : D ? "grab" : t === "comment" ? Jr : "default",
2617
2737
  hand: c ? "pinch" : D ? "open" : null,
2618
2738
  handlers: {
2619
2739
  onPointerDown: O,
@@ -2625,7 +2745,7 @@ function pi(t) {
2625
2745
  }
2626
2746
  //#endregion
2627
2747
  //#region src/viewer/inspector/InspectionOutline.tsx
2628
- function mi({ board: e, rect: t, view: n, name: r, nodeId: i, selected: a }) {
2748
+ function xi({ board: e, rect: t, view: n, name: r, nodeId: i, selected: a }) {
2629
2749
  return t.width <= 0 || t.height <= 0 ? null : /* @__PURE__ */ Q("div", {
2630
2750
  className: `ri-outline${a ? " ri-outline-selected" : ""}`,
2631
2751
  "aria-hidden": "true",
@@ -2660,7 +2780,7 @@ function mi({ board: e, rect: t, view: n, name: r, nodeId: i, selected: a }) {
2660
2780
  }
2661
2781
  //#endregion
2662
2782
  //#region src/viewer/inspector/Layers.tsx
2663
- var hi = {
2783
+ var Si = {
2664
2784
  Frame: Nt,
2665
2785
  Column: Ot,
2666
2786
  Row: Gt,
@@ -2669,21 +2789,21 @@ var hi = {
2669
2789
  Text: Jt,
2670
2790
  Image: It,
2671
2791
  Button: Vt
2672
- }, gi = (e, t, n) => `${encodeURIComponent(e)}:${encodeURIComponent(t)}:${n}`;
2673
- function _i({ boards: e, frames: t, selection: n, targets: r, playing: i, select: a, hoverNode: o }) {
2792
+ }, Ci = (e, t, n) => `${encodeURIComponent(e)}:${encodeURIComponent(t)}:${n}`;
2793
+ function wi({ boards: e, frames: t, selection: n, targets: r, playing: i, select: a, hoverNode: o }) {
2674
2794
  let [s, c] = Y([]), l = J(null), u = J(null), d = J(!1), { treeData: f, byKey: p } = q(() => {
2675
2795
  let n = /* @__PURE__ */ new Map(), r = [];
2676
2796
  for (let [a, o] of e) {
2677
2797
  let e = t[a];
2678
2798
  if (!e?.nodes[0]) continue;
2679
2799
  let s = new Map(e.nodes.map((e) => [e.id, e])), c = i.has(a), l = (t, r) => {
2680
- let i = gi(a, e.session, t.id);
2800
+ let i = Ci(a, e.session, t.id);
2681
2801
  n.set(i, {
2682
2802
  boardId: a,
2683
2803
  node: t,
2684
2804
  parentKey: r
2685
2805
  });
2686
- let u = r === null ? "Frame" : t.kind, d = r === null ? o.title || a : t.name, f = hi[u];
2806
+ let u = r === null ? "Frame" : t.kind, d = r === null ? o.title || a : t.name, f = Si[u];
2687
2807
  return {
2688
2808
  key: i,
2689
2809
  disabled: c,
@@ -2697,7 +2817,7 @@ function _i({ boards: e, frames: t, selection: n, targets: r, playing: i, select
2697
2817
  title: `${t.tag} · ${d || t.selector}`,
2698
2818
  children: [/* @__PURE__ */ Z("span", {
2699
2819
  className: "ri-layer-kind",
2700
- children: B(`inspector.kind.${u}`)
2820
+ children: R(`inspector.kind.${u}`)
2701
2821
  }), /* @__PURE__ */ Z("span", {
2702
2822
  className: "ri-layer-name",
2703
2823
  children: d ? `“${d}”` : `<${t.tag}>`
@@ -2709,7 +2829,7 @@ function _i({ boards: e, frames: t, selection: n, targets: r, playing: i, select
2709
2829
  }),
2710
2830
  c && /* @__PURE__ */ Z("span", {
2711
2831
  className: "ri-playing",
2712
- children: B("inspector.playing")
2832
+ children: R("inspector.playing")
2713
2833
  })
2714
2834
  ] }),
2715
2835
  children: t.children.flatMap((e) => {
@@ -2728,7 +2848,7 @@ function _i({ boards: e, frames: t, selection: n, targets: r, playing: i, select
2728
2848
  e,
2729
2849
  t,
2730
2850
  i
2731
- ]), m = n && t[n.boardId] ? gi(n.boardId, t[n.boardId].session, n.node.id) : null, h = r ? r.flatMap((e) => t[e.boardId] ? [gi(e.boardId, t[e.boardId].session, e.id)] : []) : m ? [m] : [], g = [], _ = m ? p.get(m)?.parentKey : null;
2851
+ ]), m = n && t[n.boardId] ? Ci(n.boardId, t[n.boardId].session, n.node.id) : null, h = r ? r.flatMap((e) => t[e.boardId] ? [Ci(e.boardId, t[e.boardId].session, e.id)] : []) : m ? [m] : [], g = [], _ = m ? p.get(m)?.parentKey : null;
2732
2852
  for (; _;) g.push(_), _ = p.get(_)?.parentKey;
2733
2853
  let v = [m, ...g].filter((e) => !!e && !!p.get(e)?.node.children.length).join("|");
2734
2854
  K(() => {
@@ -2742,13 +2862,13 @@ function _i({ boards: e, frames: t, selection: n, targets: r, playing: i, select
2742
2862
  return /* @__PURE__ */ Q(X, { children: [
2743
2863
  /* @__PURE__ */ Q("div", {
2744
2864
  className: "ri-layer-heading",
2745
- children: [/* @__PURE__ */ Z("span", { children: B("inspector.layers") }), /* @__PURE__ */ Z("span", { children: b ? B("inspector.elements", { count: b }) : B("common.loading") })]
2865
+ children: [/* @__PURE__ */ Z("span", { children: R("inspector.layers") }), /* @__PURE__ */ Z("span", { children: b ? R("inspector.elements", { count: b }) : R("common.loading") })]
2746
2866
  }),
2747
2867
  /* @__PURE__ */ Q("div", {
2748
2868
  ref: l,
2749
2869
  className: "ri-layers",
2750
2870
  role: "region",
2751
- "aria-label": B("inspector.domLayers"),
2871
+ "aria-label": R("inspector.domLayers"),
2752
2872
  onClickCapture: (e) => {
2753
2873
  d.current = e.shiftKey || e.metaKey || e.ctrlKey;
2754
2874
  },
@@ -2795,26 +2915,26 @@ function _i({ boards: e, frames: t, selection: n, targets: r, playing: i, select
2795
2915
  }
2796
2916
  }), !f.length && /* @__PURE__ */ Z("p", {
2797
2917
  className: "ri-hint",
2798
- children: B("inspector.waitingBoard")
2918
+ children: R("inspector.waitingBoard")
2799
2919
  })]
2800
2920
  }),
2801
2921
  Object.values(t).some((e) => e.truncated) && /* @__PURE__ */ Z("p", {
2802
2922
  className: "ri-limit",
2803
2923
  role: "status",
2804
- children: B("inspector.truncated")
2924
+ children: R("inspector.truncated")
2805
2925
  })
2806
2926
  ] });
2807
2927
  }
2808
2928
  //#endregion
2809
2929
  //#region src/viewer/inspector/Properties.tsx
2810
- var vi = (e) => Number.isFinite(parseFloat(e)) ? Math.round(parseFloat(e) * 100) / 100 : 0, yi = (e) => e.map(([e, t]) => ({
2930
+ var Ti = (e) => Number.isFinite(parseFloat(e)) ? Math.round(parseFloat(e) * 100) / 100 : 0, Ei = (e) => e.map(([e, t]) => ({
2811
2931
  value: e,
2812
2932
  label: t
2813
- })), bi = (e) => {
2933
+ })), Di = (e) => {
2814
2934
  let t = e.match(/^rgba?\(([\d.]+),\s*([\d.]+),\s*([\d.]+)(?:,\s*([\d.]+))?\)$/);
2815
2935
  return t ? "#" + t.slice(1).filter((e) => e !== void 0).map((e, t) => Math.round(Number(e) * (t === 3 ? 255 : 1)).toString(16).padStart(2, "0")).join("") : e;
2816
2936
  };
2817
- function xi({ label: e, children: t, controlId: n }) {
2937
+ function Oi({ label: e, children: t, controlId: n }) {
2818
2938
  return /* @__PURE__ */ Q("div", {
2819
2939
  className: "ri-field",
2820
2940
  children: [n ? /* @__PURE__ */ Z("label", {
@@ -2827,12 +2947,12 @@ function xi({ label: e, children: t, controlId: n }) {
2827
2947
  }), t]
2828
2948
  });
2829
2949
  }
2830
- function Si({ label: e, property: t, node: n, change: r, unit: i = "px", max: a, min: o = 0, step: s = 1, sizing: c }) {
2950
+ function ki({ label: e, property: t, node: n, change: r, unit: i = "px", max: a, min: o = 0, step: s = 1, sizing: c }) {
2831
2951
  let l = Ge(), u = /* @__PURE__ */ Z(rt, {
2832
2952
  id: l,
2833
2953
  size: "small",
2834
2954
  controls: !1,
2835
- value: vi(n.css[t]),
2955
+ value: Ti(n.css[t]),
2836
2956
  suffix: i || void 0,
2837
2957
  min: o,
2838
2958
  max: a,
@@ -2842,7 +2962,7 @@ function Si({ label: e, property: t, node: n, change: r, unit: i = "px", max: a,
2842
2962
  },
2843
2963
  style: { width: "100%" }
2844
2964
  });
2845
- return /* @__PURE__ */ Z(xi, {
2965
+ return /* @__PURE__ */ Z(Oi, {
2846
2966
  label: e,
2847
2967
  controlId: l,
2848
2968
  children: c ? /* @__PURE__ */ Q("div", {
@@ -2857,16 +2977,16 @@ function Si({ label: e, property: t, node: n, change: r, unit: i = "px", max: a,
2857
2977
  }) : u
2858
2978
  });
2859
2979
  }
2860
- function Ci({ label: e, property: t, values: n, node: r, change: i }) {
2980
+ function Ai({ label: e, property: t, values: n, node: r, change: i }) {
2861
2981
  let a = Ge(), o = r.css[t], s = n.some(([e]) => e === o) ? n : [...n, [o, o]];
2862
- return /* @__PURE__ */ Z(xi, {
2982
+ return /* @__PURE__ */ Z(Oi, {
2863
2983
  label: e,
2864
2984
  controlId: a,
2865
2985
  children: /* @__PURE__ */ Z(ot, {
2866
2986
  size: "small",
2867
2987
  id: a,
2868
2988
  value: o,
2869
- options: yi(s),
2989
+ options: Ei(s),
2870
2990
  onChange: (e) => {
2871
2991
  typeof e == "string" && i(t, e);
2872
2992
  },
@@ -2874,7 +2994,7 @@ function Ci({ label: e, property: t, values: n, node: r, change: i }) {
2874
2994
  })
2875
2995
  });
2876
2996
  }
2877
- function wi({ node: e, change: t }) {
2997
+ function ji({ node: e, change: t }) {
2878
2998
  let n = {
2879
2999
  node: e,
2880
3000
  change: t
@@ -2883,58 +3003,58 @@ function wi({ node: e, change: t }) {
2883
3003
  /* @__PURE__ */ Q("section", {
2884
3004
  className: "ri-section",
2885
3005
  children: [
2886
- /* @__PURE__ */ Z("h2", { children: B("inspector.size") }),
2887
- /* @__PURE__ */ Z(Si, {
3006
+ /* @__PURE__ */ Z("h2", { children: R("inspector.size") }),
3007
+ /* @__PURE__ */ Z(ki, {
2888
3008
  ...n,
2889
- label: B("inspector.width"),
3009
+ label: R("inspector.width"),
2890
3010
  property: "width",
2891
3011
  sizing: /* @__PURE__ */ Q(X, { children: [/* @__PURE__ */ Z("label", {
2892
3012
  className: "ri-sr-only",
2893
3013
  htmlFor: r,
2894
- children: B("inspector.widthSizing")
3014
+ children: R("inspector.widthSizing")
2895
3015
  }), /* @__PURE__ */ Z(ot, {
2896
3016
  id: r,
2897
3017
  size: "small",
2898
3018
  value: e.widthMode,
2899
- options: yi([
2900
- ["fixed", B("inspector.fixed")],
2901
- ["fill", B("inspector.fill")],
2902
- ["hug", B("inspector.hug")]
3019
+ options: Ei([
3020
+ ["fixed", R("inspector.fixed")],
3021
+ ["fill", R("inspector.fill")],
3022
+ ["hug", R("inspector.hug")]
2903
3023
  ]),
2904
- onChange: (n) => t("width", n === "fill" ? "100%" : n === "hug" ? "max-content" : `${vi(e.css.width) || e.rect.width}px`)
3024
+ onChange: (n) => t("width", n === "fill" ? "100%" : n === "hug" ? "max-content" : `${Ti(e.css.width) || e.rect.width}px`)
2905
3025
  })] })
2906
3026
  }),
2907
- /* @__PURE__ */ Z(Si, {
3027
+ /* @__PURE__ */ Z(ki, {
2908
3028
  ...n,
2909
- label: B("inspector.height"),
3029
+ label: R("inspector.height"),
2910
3030
  property: "height",
2911
3031
  sizing: /* @__PURE__ */ Q(X, { children: [/* @__PURE__ */ Z("label", {
2912
3032
  className: "ri-sr-only",
2913
3033
  htmlFor: i,
2914
- children: B("inspector.heightSizing")
3034
+ children: R("inspector.heightSizing")
2915
3035
  }), /* @__PURE__ */ Z(ot, {
2916
3036
  id: i,
2917
3037
  size: "small",
2918
3038
  value: e.heightMode,
2919
- options: yi([["hug", B("inspector.hug")], ["fixed", B("inspector.fixed")]]),
2920
- onChange: (n) => t("height", n === "hug" ? "auto" : `${vi(e.css.height) || e.rect.height}px`)
3039
+ options: Ei([["hug", R("inspector.hug")], ["fixed", R("inspector.fixed")]]),
3040
+ onChange: (n) => t("height", n === "hug" ? "auto" : `${Ti(e.css.height) || e.rect.height}px`)
2921
3041
  })] })
2922
3042
  }),
2923
- /* @__PURE__ */ Z(Ci, {
3043
+ /* @__PURE__ */ Z(Ai, {
2924
3044
  ...n,
2925
- label: B("inspector.position"),
3045
+ label: R("inspector.position"),
2926
3046
  property: "position",
2927
3047
  values: [
2928
- ["static", B("inspector.inline")],
2929
- ["relative", B("inspector.relative")],
2930
- ["absolute", B("inspector.absolute")],
2931
- ["fixed", B("inspector.fixed")],
2932
- ["sticky", B("inspector.sticky")]
3048
+ ["static", R("inspector.inline")],
3049
+ ["relative", R("inspector.relative")],
3050
+ ["absolute", R("inspector.absolute")],
3051
+ ["fixed", R("inspector.fixed")],
3052
+ ["sticky", R("inspector.sticky")]
2933
3053
  ]
2934
3054
  }),
2935
- /* @__PURE__ */ Z(Si, {
3055
+ /* @__PURE__ */ Z(ki, {
2936
3056
  ...n,
2937
- label: B("inspector.grow"),
3057
+ label: R("inspector.grow"),
2938
3058
  property: "flex-grow",
2939
3059
  unit: "",
2940
3060
  max: 100
@@ -2944,22 +3064,22 @@ function wi({ node: e, change: t }) {
2944
3064
  /* @__PURE__ */ Q("section", {
2945
3065
  className: "ri-section",
2946
3066
  children: [
2947
- /* @__PURE__ */ Z("h2", { children: B("inspector.layout") }),
2948
- /* @__PURE__ */ Z(Ci, {
3067
+ /* @__PURE__ */ Z("h2", { children: R("inspector.layout") }),
3068
+ /* @__PURE__ */ Z(Ai, {
2949
3069
  ...n,
2950
- label: B("inspector.layout"),
3070
+ label: R("inspector.layout"),
2951
3071
  property: "display",
2952
3072
  values: [
2953
- ["flex", B("inspector.stack")],
2954
- ["grid", B("inspector.grid")],
2955
- ["block", B("inspector.block")],
2956
- ["inline", B("inspector.inline")],
2957
- ["inline-flex", B("inspector.inlineStack")],
2958
- ["none", B("inspector.hidden")]
3073
+ ["flex", R("inspector.stack")],
3074
+ ["grid", R("inspector.grid")],
3075
+ ["block", R("inspector.block")],
3076
+ ["inline", R("inspector.inline")],
3077
+ ["inline-flex", R("inspector.inlineStack")],
3078
+ ["none", R("inspector.hidden")]
2959
3079
  ]
2960
3080
  }),
2961
- (e.css.display === "flex" || e.css.display === "inline-flex") && /* @__PURE__ */ Q(X, { children: [/* @__PURE__ */ Z(xi, {
2962
- label: B("inspector.direction"),
3081
+ (e.css.display === "flex" || e.css.display === "inline-flex") && /* @__PURE__ */ Q(X, { children: [/* @__PURE__ */ Z(Oi, {
3082
+ label: R("inspector.direction"),
2963
3083
  children: /* @__PURE__ */ Z(at, {
2964
3084
  size: "small",
2965
3085
  block: !0,
@@ -2972,9 +3092,9 @@ function wi({ node: e, change: t }) {
2972
3092
  }),
2973
3093
  label: /* @__PURE__ */ Z("span", {
2974
3094
  className: "ri-sr-only",
2975
- children: B("inspector.horizontal")
3095
+ children: R("inspector.horizontal")
2976
3096
  }),
2977
- title: B("inspector.horizontal")
3097
+ title: R("inspector.horizontal")
2978
3098
  }, {
2979
3099
  value: "column",
2980
3100
  icon: /* @__PURE__ */ Z(ht, {
@@ -2983,35 +3103,35 @@ function wi({ node: e, change: t }) {
2983
3103
  }),
2984
3104
  label: /* @__PURE__ */ Z("span", {
2985
3105
  className: "ri-sr-only",
2986
- children: B("inspector.vertical")
3106
+ children: R("inspector.vertical")
2987
3107
  }),
2988
- title: B("inspector.vertical")
3108
+ title: R("inspector.vertical")
2989
3109
  }],
2990
3110
  onChange: (e) => t("flex-direction", e)
2991
3111
  })
2992
- }), /* @__PURE__ */ Z(xi, {
2993
- label: B("inspector.align"),
3112
+ }), /* @__PURE__ */ Z(Oi, {
3113
+ label: R("inspector.align"),
2994
3114
  children: /* @__PURE__ */ Z(at, {
2995
3115
  size: "small",
2996
3116
  block: !0,
2997
- "aria-label": B("inspector.align"),
3117
+ "aria-label": R("inspector.align"),
2998
3118
  value: e.css["align-items"],
2999
- options: yi([
3000
- ["flex-start", B("inspector.start")],
3001
- ["center", B("inspector.center")],
3002
- ["stretch", B("inspector.fill")]
3119
+ options: Ei([
3120
+ ["flex-start", R("inspector.start")],
3121
+ ["center", R("inspector.center")],
3122
+ ["stretch", R("inspector.fill")]
3003
3123
  ]),
3004
3124
  onChange: (e) => t("align-items", e)
3005
3125
  })
3006
3126
  })] }),
3007
- /* @__PURE__ */ Z(Si, {
3127
+ /* @__PURE__ */ Z(ki, {
3008
3128
  ...n,
3009
- label: B("inspector.gap"),
3129
+ label: R("inspector.gap"),
3010
3130
  property: "gap"
3011
3131
  }),
3012
- /* @__PURE__ */ Z(Si, {
3132
+ /* @__PURE__ */ Z(ki, {
3013
3133
  ...n,
3014
- label: B("inspector.padding"),
3134
+ label: R("inspector.padding"),
3015
3135
  property: "padding"
3016
3136
  })
3017
3137
  ]
@@ -3019,34 +3139,34 @@ function wi({ node: e, change: t }) {
3019
3139
  /* @__PURE__ */ Q("section", {
3020
3140
  className: "ri-section",
3021
3141
  children: [
3022
- /* @__PURE__ */ Z("h2", { children: B("inspector.appearance") }),
3023
- /* @__PURE__ */ Z(xi, {
3024
- label: B("inspector.fill"),
3142
+ /* @__PURE__ */ Z("h2", { children: R("inspector.appearance") }),
3143
+ /* @__PURE__ */ Z(Oi, {
3144
+ label: R("inspector.fill"),
3025
3145
  children: /* @__PURE__ */ Z(Qe, {
3026
3146
  size: "small",
3027
3147
  trigger: "field",
3028
3148
  alpha: !0,
3029
3149
  recent: !1,
3030
- value: bi(e.css["background-color"]),
3150
+ value: Di(e.css["background-color"]),
3031
3151
  onChange: (e) => t("background-color", e)
3032
3152
  })
3033
3153
  }),
3034
- /* @__PURE__ */ Z(Si, {
3154
+ /* @__PURE__ */ Z(ki, {
3035
3155
  ...n,
3036
- label: B("inspector.opacity"),
3156
+ label: R("inspector.opacity"),
3037
3157
  property: "opacity",
3038
3158
  unit: "",
3039
3159
  max: 1,
3040
3160
  step: .1
3041
3161
  }),
3042
- /* @__PURE__ */ Z(Si, {
3162
+ /* @__PURE__ */ Z(ki, {
3043
3163
  ...n,
3044
- label: B("inspector.radius"),
3164
+ label: R("inspector.radius"),
3045
3165
  property: "border-radius"
3046
3166
  }),
3047
- /* @__PURE__ */ Z(Ci, {
3167
+ /* @__PURE__ */ Z(Ai, {
3048
3168
  ...n,
3049
- label: B("inspector.border"),
3169
+ label: R("inspector.border"),
3050
3170
  property: "border-style",
3051
3171
  values: [
3052
3172
  ["none", /* @__PURE__ */ Q("span", {
@@ -3054,28 +3174,28 @@ function wi({ node: e, change: t }) {
3054
3174
  children: [/* @__PURE__ */ Z(_t, {
3055
3175
  size: 13,
3056
3176
  "aria-hidden": !0
3057
- }), B("inspector.none")]
3177
+ }), R("inspector.none")]
3058
3178
  })],
3059
3179
  ["solid", /* @__PURE__ */ Q("span", {
3060
3180
  className: "ri-option",
3061
3181
  children: [/* @__PURE__ */ Z(Bt, {
3062
3182
  size: 13,
3063
3183
  "aria-hidden": !0
3064
- }), B("inspector.solid")]
3184
+ }), R("inspector.solid")]
3065
3185
  })],
3066
3186
  ["dashed", /* @__PURE__ */ Q("span", {
3067
3187
  className: "ri-option",
3068
3188
  children: [/* @__PURE__ */ Z(qt, {
3069
3189
  size: 13,
3070
3190
  "aria-hidden": !0
3071
- }), B("inspector.dashed")]
3191
+ }), R("inspector.dashed")]
3072
3192
  })],
3073
3193
  ["dotted", /* @__PURE__ */ Q("span", {
3074
3194
  className: "ri-option",
3075
3195
  children: [/* @__PURE__ */ Z(jt, {
3076
3196
  size: 13,
3077
3197
  "aria-hidden": !0
3078
- }), B("inspector.dotted")]
3198
+ }), R("inspector.dotted")]
3079
3199
  })]
3080
3200
  ]
3081
3201
  })
@@ -3097,30 +3217,30 @@ function wi({ node: e, change: t }) {
3097
3217
  },
3098
3218
  items: [{
3099
3219
  key: "typography",
3100
- title: B("inspector.typography"),
3101
- children: /* @__PURE__ */ Q(X, { children: [/* @__PURE__ */ Z(Si, {
3220
+ title: R("inspector.typography"),
3221
+ children: /* @__PURE__ */ Q(X, { children: [/* @__PURE__ */ Z(ki, {
3102
3222
  ...n,
3103
- label: B("inspector.fontSize"),
3223
+ label: R("inspector.fontSize"),
3104
3224
  property: "font-size",
3105
3225
  min: 1
3106
- }), /* @__PURE__ */ Z(xi, {
3107
- label: B("inspector.color"),
3226
+ }), /* @__PURE__ */ Z(Oi, {
3227
+ label: R("inspector.color"),
3108
3228
  children: /* @__PURE__ */ Z(Qe, {
3109
3229
  size: "small",
3110
3230
  trigger: "field",
3111
3231
  alpha: !0,
3112
3232
  recent: !1,
3113
- value: bi(e.css.color),
3233
+ value: Di(e.css.color),
3114
3234
  onChange: (e) => t("color", e)
3115
3235
  })
3116
3236
  })] })
3117
3237
  }, {
3118
3238
  key: "effects",
3119
- title: B("inspector.effects"),
3120
- children: /* @__PURE__ */ Z(xi, {
3121
- label: B("inspector.shadow"),
3239
+ title: R("inspector.effects"),
3240
+ children: /* @__PURE__ */ Z(Oi, {
3241
+ label: R("inspector.shadow"),
3122
3242
  children: /* @__PURE__ */ Z(nt, {
3123
- "aria-label": B("inspector.shadow"),
3243
+ "aria-label": R("inspector.shadow"),
3124
3244
  size: "small",
3125
3245
  value: a,
3126
3246
  onChange: (e) => o(e.target.value),
@@ -3134,19 +3254,19 @@ function wi({ node: e, change: t }) {
3134
3254
  }
3135
3255
  //#endregion
3136
3256
  //#region src/viewer/inspector/InspectorPanel.tsx
3137
- var Ti = [
3257
+ var Mi = [
3138
3258
  "Properties",
3139
3259
  "Code",
3140
3260
  "Tweaks"
3141
- ], Ei = We(function({ boards: e, frames: t, selection: n, targets: r, playing: i, select: a, hoverNode: o, change: s, reset: c, enabled: l, onClose: u }) {
3261
+ ], Ni = We(function({ boards: e, frames: t, selection: n, targets: r, playing: i, select: a, hoverNode: o, change: s, reset: c, enabled: l, onClose: u }) {
3142
3262
  let [d, f] = Y("Properties"), [p, m] = Y(""), h = n?.node, g = Object.entries(t).flatMap(([e, t]) => t.tweaks.map((t) => ({
3143
3263
  ...t,
3144
3264
  boardId: e
3145
3265
  }))), _ = h ? `${h.selector} {\n${Object.entries(h.css).map(([e, t]) => ` ${e}: ${t};`).join("\n")}\n}` : "", v = async (e) => {
3146
3266
  try {
3147
- await navigator.clipboard.writeText(e), m(B("inspector.copied"));
3267
+ await navigator.clipboard.writeText(e), m(R("inspector.copied"));
3148
3268
  } catch {
3149
- m(B("inspector.copyFailed"));
3269
+ m(R("inspector.copyFailed"));
3150
3270
  }
3151
3271
  };
3152
3272
  return /* @__PURE__ */ Z(tt, {
@@ -3154,11 +3274,11 @@ var Ti = [
3154
3274
  children: /* @__PURE__ */ Z("aside", {
3155
3275
  className: "ryugi-inspector",
3156
3276
  "data-chrome": !0,
3157
- "aria-label": B("inspector.label"),
3277
+ "aria-label": R("inspector.label"),
3158
3278
  children: /* @__PURE__ */ Q(ft, {
3159
3279
  value: d,
3160
3280
  onValueChange: (e) => {
3161
- Ti.includes(e) && f(e);
3281
+ Mi.includes(e) && f(e);
3162
3282
  },
3163
3283
  size: "small",
3164
3284
  variant: "rounded",
@@ -3170,10 +3290,10 @@ var Ti = [
3170
3290
  className: "ri-tabs",
3171
3291
  activateOnFocus: !0,
3172
3292
  style: { alignSelf: "center" },
3173
- "aria-label": B("inspector.views"),
3174
- children: [/* @__PURE__ */ Z(lt, {}), Ti.map((e) => /* @__PURE__ */ Q(pt, {
3293
+ "aria-label": R("inspector.views"),
3294
+ children: [/* @__PURE__ */ Z(lt, {}), Mi.map((e) => /* @__PURE__ */ Q(pt, {
3175
3295
  value: e,
3176
- children: [B(`inspector.tab.${e}`), e === "Tweaks" && g.length > 0 && /* @__PURE__ */ Z(Ct, {
3296
+ children: [R(`inspector.tab.${e}`), e === "Tweaks" && g.length > 0 && /* @__PURE__ */ Z(Ct, {
3177
3297
  className: "ri-change-dot",
3178
3298
  size: 4,
3179
3299
  fill: "currentColor",
@@ -3183,12 +3303,12 @@ var Ti = [
3183
3303
  }), /* @__PURE__ */ Z(Xe, {
3184
3304
  icon: Yt,
3185
3305
  size: "small",
3186
- "aria-label": B("inspector.close"),
3187
- title: B("inspector.close"),
3306
+ "aria-label": R("inspector.close"),
3307
+ title: R("inspector.close"),
3188
3308
  onClick: u
3189
3309
  })]
3190
3310
  }),
3191
- /* @__PURE__ */ Z(_i, {
3311
+ /* @__PURE__ */ Z(wi, {
3192
3312
  boards: e,
3193
3313
  frames: t,
3194
3314
  selection: n,
@@ -3200,7 +3320,7 @@ var Ti = [
3200
3320
  /* @__PURE__ */ Q("div", {
3201
3321
  className: "ri-node-meta",
3202
3322
  children: [
3203
- /* @__PURE__ */ Z("code", { children: r.length > 1 ? B("inspector.selected", { count: r.length }) : h ? `<${h.tag}>` : B("inspector.selectElement") }),
3323
+ /* @__PURE__ */ Z("code", { children: r.length > 1 ? R("inspector.selected", { count: r.length }) : h ? `<${h.tag}>` : R("inspector.selectElement") }),
3204
3324
  h && /* @__PURE__ */ Q("span", {
3205
3325
  className: "ri-node-id",
3206
3326
  children: [`${n.boardId}#${h.id}`, /* @__PURE__ */ Z(Xe, {
@@ -3209,8 +3329,8 @@ var Ti = [
3209
3329
  blockSize: 16,
3210
3330
  size: 10
3211
3331
  },
3212
- "aria-label": B("inspector.copyNode"),
3213
- title: B("inspector.copyNode"),
3332
+ "aria-label": R("inspector.copyNode"),
3333
+ title: R("inspector.copyNode"),
3214
3334
  onClick: () => void v(`${n.boardId}#${h.id}`)
3215
3335
  })]
3216
3336
  }),
@@ -3225,26 +3345,26 @@ var Ti = [
3225
3345
  size: 6,
3226
3346
  fill: "currentColor",
3227
3347
  "aria-hidden": !0
3228
- }), B("inspector.live")]
3348
+ }), R("inspector.live")]
3229
3349
  })
3230
3350
  ]
3231
3351
  }),
3232
3352
  r.length > 1 && /* @__PURE__ */ Z("p", {
3233
3353
  className: "ri-hint",
3234
3354
  style: { margin: "8px 16px" },
3235
- children: B("inspector.lastSelected")
3355
+ children: R("inspector.lastSelected")
3236
3356
  }),
3237
3357
  /* @__PURE__ */ Q("div", {
3238
3358
  className: "ri-panel-body",
3239
3359
  children: [
3240
3360
  /* @__PURE__ */ Z(dt, {
3241
3361
  value: "Properties",
3242
- children: h && l ? /* @__PURE__ */ Z(wi, {
3362
+ children: h && l ? /* @__PURE__ */ Z(ji, {
3243
3363
  node: h,
3244
3364
  change: s
3245
3365
  }, `${n.boardId}:${t[n.boardId]?.session}:${h.id}`) : /* @__PURE__ */ Z("p", {
3246
3366
  className: "ri-empty",
3247
- children: B(l ? "inspector.pickElement" : "inspector.closeExpanded")
3367
+ children: R(l ? "inspector.pickElement" : "inspector.closeExpanded")
3248
3368
  })
3249
3369
  }),
3250
3370
  /* @__PURE__ */ Z(dt, {
@@ -3254,12 +3374,12 @@ var Ti = [
3254
3374
  children: [
3255
3375
  /* @__PURE__ */ Q("div", {
3256
3376
  className: "ri-code-heading",
3257
- children: [/* @__PURE__ */ Z("h2", { children: B("inspector.computedCss") }), /* @__PURE__ */ Z(Ze, {
3377
+ children: [/* @__PURE__ */ Z("h2", { children: R("inspector.computedCss") }), /* @__PURE__ */ Z(Ze, {
3258
3378
  size: "small",
3259
3379
  type: "text",
3260
3380
  icon: kt,
3261
3381
  onClick: () => void v(_),
3262
- children: B("inspector.copy")
3382
+ children: R("inspector.copy")
3263
3383
  })]
3264
3384
  }),
3265
3385
  /* @__PURE__ */ Z("pre", {
@@ -3273,7 +3393,7 @@ var Ti = [
3273
3393
  type: "text",
3274
3394
  icon: kt,
3275
3395
  onClick: () => void v(h.html),
3276
- children: B("inspector.copy")
3396
+ children: R("inspector.copy")
3277
3397
  })]
3278
3398
  }),
3279
3399
  /* @__PURE__ */ Z("pre", {
@@ -3283,12 +3403,12 @@ var Ti = [
3283
3403
  /* @__PURE__ */ Z("p", {
3284
3404
  className: "ri-hint",
3285
3405
  role: "status",
3286
- children: p || B("inspector.fromDom")
3406
+ children: p || R("inspector.fromDom")
3287
3407
  })
3288
3408
  ]
3289
3409
  }) : /* @__PURE__ */ Z("p", {
3290
3410
  className: "ri-empty",
3291
- children: B("inspector.selectForCode")
3411
+ children: R("inspector.selectForCode")
3292
3412
  })
3293
3413
  }),
3294
3414
  /* @__PURE__ */ Z(dt, {
@@ -3297,7 +3417,7 @@ var Ti = [
3297
3417
  className: "ri-section",
3298
3418
  children: [
3299
3419
  /* @__PURE__ */ Q("h2", { children: [
3300
- B("inspector.sessionChanges"),
3420
+ R("inspector.sessionChanges"),
3301
3421
  " ",
3302
3422
  /* @__PURE__ */ Z("span", {
3303
3423
  className: "ri-count",
@@ -3306,7 +3426,7 @@ var Ti = [
3306
3426
  ] }),
3307
3427
  /* @__PURE__ */ Z("p", {
3308
3428
  className: "ri-hint",
3309
- children: B("inspector.changesApply")
3429
+ children: R("inspector.changesApply")
3310
3430
  }),
3311
3431
  /* @__PURE__ */ Z("div", {
3312
3432
  className: "ri-tweaks",
@@ -3325,7 +3445,7 @@ var Ti = [
3325
3445
  }),
3326
3446
  !g.length && /* @__PURE__ */ Z("p", {
3327
3447
  className: "ri-hint",
3328
- children: B("inspector.noChanges")
3448
+ children: R("inspector.noChanges")
3329
3449
  }),
3330
3450
  /* @__PURE__ */ Z(Ze, {
3331
3451
  icon: Wt,
@@ -3333,7 +3453,7 @@ var Ti = [
3333
3453
  block: !0,
3334
3454
  disabled: !g.length,
3335
3455
  onClick: c,
3336
- children: B("inspector.resetPreview")
3456
+ children: R("inspector.resetPreview")
3337
3457
  })
3338
3458
  ]
3339
3459
  })
@@ -3349,8 +3469,8 @@ var Ti = [
3349
3469
  fill: "currentColor",
3350
3470
  "aria-hidden": !0
3351
3471
  }),
3352
- g.length ? B("inspector.previewChanges", { count: g.length }) : B("inspector.liveInspection"),
3353
- /* @__PURE__ */ Z("span", { children: B("inspector.previewOnly") })
3472
+ g.length ? R("inspector.previewChanges", { count: g.length }) : R("inspector.liveInspection"),
3473
+ /* @__PURE__ */ Z("span", { children: R("inspector.previewOnly") })
3354
3474
  ]
3355
3475
  })
3356
3476
  ]
@@ -3360,12 +3480,12 @@ var Ti = [
3360
3480
  });
3361
3481
  //#endregion
3362
3482
  //#region src/viewer/hooks/usePageQuery.ts
3363
- function Di(e, t) {
3483
+ function Pi(e, t) {
3364
3484
  if (t === null) return e;
3365
3485
  let n = new URL(e);
3366
3486
  return n.searchParams.set("page", t), n.href;
3367
3487
  }
3368
- function Oi() {
3488
+ function Fi() {
3369
3489
  let e = b(), t = G((t) => (e.addEventListener("popstate", t), e.addEventListener("ryugi:pagechange", t), () => {
3370
3490
  e.removeEventListener("popstate", t), e.removeEventListener("ryugi:pagechange", t);
3371
3491
  }), [e]);
@@ -3376,8 +3496,8 @@ function Oi() {
3376
3496
  }
3377
3497
  //#endregion
3378
3498
  //#region src/viewer/hooks/useArtboardPage.ts
3379
- function ki({ canvas: e, layout: t, fitPage: n, fitFocus: r, startAtFocus: i = !1 }) {
3380
- let [a, o] = Y(null), c = J(void 0), l = J(void 0), u = J(null), d = J(!1), [f, p] = Oi(), m = J(f), h = G((e, t = !0) => {
3499
+ function Ii({ canvas: e, layout: t, fitPage: n, fitFocus: r, startAtFocus: i = !1 }) {
3500
+ let [a, o] = Y(null), c = J(void 0), l = J(void 0), u = J(null), d = J(!1), [f, p] = Fi(), m = J(f), h = G((e, t = !0) => {
3381
3501
  o(e), u.current = e, m.current = e, p(e, t);
3382
3502
  }, [p]);
3383
3503
  return K(() => {
@@ -3423,7 +3543,7 @@ function ki({ canvas: e, layout: t, fitPage: n, fitFocus: r, startAtFocus: i = !
3423
3543
  }
3424
3544
  //#endregion
3425
3545
  //#region src/viewer/components/PhoneArtboardBar.tsx
3426
- function Ai({ pages: e, page: t, onPageChange: n }) {
3546
+ function Li({ pages: e, page: t, onPageChange: n }) {
3427
3547
  if (e.length < 2) return null;
3428
3548
  let r = e.find((e) => e.id === t);
3429
3549
  return /* @__PURE__ */ Z($e, {
@@ -3436,7 +3556,7 @@ function Ai({ pages: e, page: t, onPageChange: n }) {
3436
3556
  })),
3437
3557
  children: /* @__PURE__ */ Q("button", {
3438
3558
  type: "button",
3439
- "aria-label": B("chrome.switchPage"),
3559
+ "aria-label": R("chrome.switchPage"),
3440
3560
  className: "x78zum5 x6s0dn4 x195vfkc xeuugli x1717udv xc342km xjbqb8w x1bo0w0s xqfszdh x4z9k3i x1ypdohk",
3441
3561
  children: [/* @__PURE__ */ Z("span", {
3442
3562
  className: "xb3r6kr xuxw1ft xlyipyv",
@@ -3445,7 +3565,7 @@ function Ai({ pages: e, page: t, onPageChange: n }) {
3445
3565
  })
3446
3566
  });
3447
3567
  }
3448
- function ji({ title: e, pages: t, page: n, onPageChange: r, actions: i, live: a }) {
3568
+ function Ri({ title: e, pages: t, page: n, onPageChange: r, actions: i, live: a }) {
3449
3569
  return /* @__PURE__ */ Q("header", {
3450
3570
  "data-chrome": !0,
3451
3571
  className: "x2lah0s xdd8jsf x78zum5 x6s0dn4 x883omv x1hr3lfm xso031l x1q0q8m5 xtrfj0v x1rozbrz xo2rkog xqfszdh xif65rj",
@@ -3454,14 +3574,14 @@ function ji({ title: e, pages: t, page: n, onPageChange: r, actions: i, live: a
3454
3574
  className: "xeuugli xb3r6kr xuxw1ft xlyipyv x1s688f",
3455
3575
  children: e
3456
3576
  }),
3457
- /* @__PURE__ */ Z(Ai, {
3577
+ /* @__PURE__ */ Z(Li, {
3458
3578
  pages: t,
3459
3579
  page: n,
3460
3580
  onPageChange: r
3461
3581
  }),
3462
3582
  /* @__PURE__ */ Z("span", { className: "x98rzlu" }),
3463
3583
  a === void 0 ? null : /* @__PURE__ */ Z("i", {
3464
- title: B(a ? "chrome.live" : "chrome.reconnecting"),
3584
+ title: R(a ? "chrome.live" : "chrome.reconnecting"),
3465
3585
  ...{
3466
3586
  0: { className: "xci0xqf x1hagigm x2lah0s x16rqkct xxwmxtg" },
3467
3587
  1: { className: "xci0xqf x1hagigm x2lah0s x16rqkct xux1nz0" }
@@ -3473,7 +3593,7 @@ function ji({ title: e, pages: t, page: n, onPageChange: r, actions: i, live: a
3473
3593
  }
3474
3594
  //#endregion
3475
3595
  //#region src/viewer/components/ghost.ts
3476
- var Mi = { ghost: {
3596
+ var zi = { ghost: {
3477
3597
  k1xSpc: "xrvj5dj",
3478
3598
  kgQiWS: "x1ku5rj1",
3479
3599
  kmuXW: "x2lah0s",
@@ -3489,8 +3609,8 @@ var Mi = { ghost: {
3489
3609
  kIyJzY: "xgdialr",
3490
3610
  k3aq6I: "x19kf12q",
3491
3611
  $$css: !0
3492
- } }, Ni = 120, Pi = .5, Fi = 110, Ii = .4, Li = .25;
3493
- function Ri(e, t, n) {
3612
+ } }, Bi = 120, Vi = .5, Hi = 110, Ui = .4, Wi = .25;
3613
+ function Gi(e, t, n) {
3494
3614
  if (!e || Oe()) return {
3495
3615
  done: Promise.resolve(),
3496
3616
  cancel: () => {}
@@ -3504,8 +3624,8 @@ function Ri(e, t, n) {
3504
3624
  cancel: () => r.cancel()
3505
3625
  };
3506
3626
  }
3507
- function zi({ id: e, board: n, src: r, siblings: i, origin: a, onOpen: o, onClose: s }) {
3508
- let { viewportRef: c, view: l, place: u, handlers: d } = pi("hand"), f = J(null), p = J(null), m = J(null), h = J(null), [g, _] = Y(null), v = J(null), y = J(l);
3627
+ function Ki({ id: e, board: n, src: r, siblings: i, origin: a, onOpen: o, onClose: s }) {
3628
+ let { viewportRef: c, view: l, place: u, handlers: d } = bi("hand"), f = J(null), p = J(null), m = J(null), h = J(null), [g, _] = Y(null), v = J(null), y = J(l);
3509
3629
  y.current = l;
3510
3630
  let b = J(!1), x = J(null), S = J(!1), C = i.indexOf(e), w = C > 0 ? i[C - 1] : void 0, T = C >= 0 ? i[C + 1] : void 0, E = () => ({
3511
3631
  width: c.current?.clientWidth ?? n.w,
@@ -3525,13 +3645,13 @@ function zi({ id: e, board: n, src: r, siblings: i, origin: a, onOpen: o, onClos
3525
3645
  if (u(i), y.current = i, !b.current) {
3526
3646
  b.current = !0;
3527
3647
  let e = D(a);
3528
- e && W(f.current, [{ transform: e }, { transform: "none" }], {
3529
- duration: Ne.duration,
3530
- easing: Ne.easing
3531
- }), W(p.current, [{ opacity: 0 }, { opacity: 1 }], {
3648
+ e && ze(f.current, [{ transform: e }, { transform: "none" }], {
3649
+ duration: U.duration,
3650
+ easing: U.easing
3651
+ }), ze(p.current, [{ opacity: 0 }, { opacity: 1 }], {
3532
3652
  duration: 200,
3533
- easing: Re
3534
- }), k().forEach((e, t) => void W(e, [{
3653
+ easing: W
3654
+ }), k().forEach((e, t) => void ze(e, [{
3535
3655
  opacity: 0,
3536
3656
  transform: `translateY(${t ? 12 : -8}px)`
3537
3657
  }, {
@@ -3540,19 +3660,19 @@ function zi({ id: e, board: n, src: r, siblings: i, origin: a, onOpen: o, onClos
3540
3660
  }], {
3541
3661
  duration: 180,
3542
3662
  delay: 90,
3543
- easing: Re
3663
+ easing: W
3544
3664
  }));
3545
3665
  } else if (x.current) {
3546
3666
  let { dir: t, leaving: n } = x.current;
3547
- x.current = null, n(), W(f.current, [{
3667
+ x.current = null, n(), ze(f.current, [{
3548
3668
  transform: `translateX(${t * e * .35}px)`,
3549
3669
  opacity: 0
3550
3670
  }, {
3551
3671
  transform: "none",
3552
3672
  opacity: 1
3553
3673
  }], {
3554
- duration: Ne.duration,
3555
- easing: Ne.easing
3674
+ duration: U.duration,
3675
+ easing: U.easing
3556
3676
  });
3557
3677
  }
3558
3678
  }, [
@@ -3565,14 +3685,14 @@ function zi({ id: e, board: n, src: r, siblings: i, origin: a, onOpen: o, onClos
3565
3685
  ]);
3566
3686
  let A = () => {
3567
3687
  let e = f.current?.style.transform || "none";
3568
- _(null), W(f.current, [{ transform: e }, { transform: "none" }], {
3569
- duration: Ne.duration,
3570
- easing: Ne.easing
3571
- }), [p.current, ...k()].forEach((e) => void W(e, [{ opacity: Number(e?.style.opacity || 1) }, { opacity: 1 }], {
3688
+ _(null), ze(f.current, [{ transform: e }, { transform: "none" }], {
3689
+ duration: U.duration,
3690
+ easing: U.easing
3691
+ }), [p.current, ...k()].forEach((e) => void ze(e, [{ opacity: Number(e?.style.opacity || 1) }, { opacity: 1 }], {
3572
3692
  duration: 200,
3573
- easing: Re
3693
+ easing: W
3574
3694
  }));
3575
- }, j = async () => {
3695
+ }, ee = async () => {
3576
3696
  if (S.current) return;
3577
3697
  S.current = !0;
3578
3698
  let e = f.current?.style.transform || "none", t = D(a), n = {
@@ -3580,20 +3700,20 @@ function zi({ id: e, board: n, src: r, siblings: i, origin: a, onOpen: o, onClos
3580
3700
  easing: De
3581
3701
  };
3582
3702
  await Promise.all([
3583
- t ? Ri(f.current, [{ transform: e }, { transform: t }], {
3703
+ t ? Gi(f.current, [{ transform: e }, { transform: t }], {
3584
3704
  duration: 240,
3585
3705
  easing: De
3586
- }).done : Ri(f.current, [{ opacity: 1 }, { opacity: 0 }], n).done,
3587
- Ri(p.current, [{ opacity: Number(p.current?.style.opacity || 1) }, { opacity: 0 }], {
3706
+ }).done : Gi(f.current, [{ opacity: 1 }, { opacity: 0 }], n).done,
3707
+ Gi(p.current, [{ opacity: Number(p.current?.style.opacity || 1) }, { opacity: 0 }], {
3588
3708
  duration: 240,
3589
3709
  easing: De
3590
3710
  }).done,
3591
- ...k().map((e) => Ri(e, [{ opacity: Number(e?.style.opacity || 1) }, { opacity: 0 }], n).done)
3711
+ ...k().map((e) => Gi(e, [{ opacity: Number(e?.style.opacity || 1) }, { opacity: 0 }], n).done)
3592
3712
  ]), s();
3593
- }, ee = async (e, t) => {
3713
+ }, te = async (e, t) => {
3594
3714
  if (!t || S.current) return;
3595
3715
  S.current = !0;
3596
- let n = f.current?.style.transform || "none", r = Ri(f.current, [{
3716
+ let n = f.current?.style.transform || "none", r = Gi(f.current, [{
3597
3717
  transform: n,
3598
3718
  opacity: 1
3599
3719
  }, {
@@ -3607,7 +3727,7 @@ function zi({ id: e, board: n, src: r, siblings: i, origin: a, onOpen: o, onClos
3607
3727
  dir: e,
3608
3728
  leaving: r.cancel
3609
3729
  }, S.current = !1, _(null), o(t);
3610
- }, ne = (e) => {
3730
+ }, re = (e) => {
3611
3731
  let t = v.current;
3612
3732
  if (S.current || t?.mode === "dismiss" || t?.mode === "swipe" || (t && (t.mode = "pan"), d.onPointerDown(e), t)) return;
3613
3733
  [
@@ -3615,7 +3735,7 @@ function zi({ id: e, board: n, src: r, siblings: i, origin: a, onOpen: o, onClos
3615
3735
  p.current,
3616
3736
  ...k()
3617
3737
  ].forEach((e) => e?.getAnimations().forEach((e) => e.cancel()));
3618
- let n = ie();
3738
+ let n = ae();
3619
3739
  n.add(e.clientX, e.clientY, performance.now()), v.current = {
3620
3740
  id: e.pointerId,
3621
3741
  x: e.clientX,
@@ -3623,13 +3743,13 @@ function zi({ id: e, board: n, src: r, siblings: i, origin: a, onOpen: o, onClos
3623
3743
  mode: "pending",
3624
3744
  track: n
3625
3745
  };
3626
- }, re = (e) => {
3746
+ }, ie = (e) => {
3627
3747
  let t = v.current;
3628
3748
  if (!t || t.id !== e.pointerId) return d.onPointerMove(e);
3629
3749
  t.track.add(e.clientX, e.clientY, performance.now());
3630
3750
  let r = e.clientX - t.x, a = e.clientY - t.y;
3631
3751
  if (t.mode === "pending") {
3632
- let o = te(r, a);
3752
+ let o = ne(r, a);
3633
3753
  if (!o) return;
3634
3754
  let s = n.w * l.k <= E().width + 1;
3635
3755
  t.mode = o === "y" && a > 0 && l.y >= -.5 ? "dismiss" : o === "x" && s && i.length > 1 ? "swipe" : "pan", t.mode !== "pan" && d.onPointerUp(e);
@@ -3639,18 +3759,18 @@ function zi({ id: e, board: n, src: r, siblings: i, origin: a, onOpen: o, onClos
3639
3759
  dx: r,
3640
3760
  dy: a
3641
3761
  });
3642
- }, ae = (e) => {
3762
+ }, oe = (e) => {
3643
3763
  let t = v.current;
3644
3764
  if (!t || t.id !== e.pointerId || (v.current = null, t.mode === "pan" || t.mode === "pending")) return d.onPointerUp(e);
3645
3765
  let n = t.track.velocity(performance.now()), r = e.clientX - t.x, i = e.clientY - t.y;
3646
- if (t.mode === "dismiss") return i > Ni && n.y > -.4 || n.y > Pi ? void j() : A();
3647
- let a = n.x < -.4 ? 1 : n.x > Ii ? -1 : 0, o = r < -110 ? 1 : r > Fi ? -1 : 0, s = a === 0 ? o : o === 0 || o === a ? a : 0, c = s === 1 ? T : s === -1 ? w : void 0;
3648
- c && s ? ee(s, c) : A();
3649
- }, { width: oe, height: M } = E(), se, N = 1, le = 1;
3766
+ if (t.mode === "dismiss") return i > Bi && n.y > -.4 || n.y > Vi ? void ee() : A();
3767
+ let a = n.x < -.4 ? 1 : n.x > Ui ? -1 : 0, o = r < -110 ? 1 : r > Hi ? -1 : 0, s = a === 0 ? o : o === 0 || o === a ? a : 0, c = s === 1 ? T : s === -1 ? w : void 0;
3768
+ c && s ? te(s, c) : A();
3769
+ }, { width: se, height: ce } = E(), le, j = 1, de = 1;
3650
3770
  if (g?.axis === "y") {
3651
3771
  let e = Math.max(0, g.dy), t = 1 - Math.min(e / 900, .3);
3652
- se = `translate(${g.dx * .6 + (1 - t) * oe / 2}px, ${e + (1 - t) * M / 2}px) scale(${t})`, N = 1 - Math.min(e / 420, .85), le = Math.max(0, 1 - e / Ni);
3653
- } else g?.axis === "x" && (se = `translateX(${g.dx > 0 && !w || g.dx < 0 && !T ? g.dx * Li : g.dx}px)`);
3772
+ le = `translate(${g.dx * .6 + (1 - t) * se / 2}px, ${e + (1 - t) * ce / 2}px) scale(${t})`, j = 1 - Math.min(e / 420, .85), de = Math.max(0, 1 - e / Bi);
3773
+ } else g?.axis === "x" && (le = `translateX(${g.dx > 0 && !w || g.dx < 0 && !T ? g.dx * Wi : g.dx}px)`);
3654
3774
  return /* @__PURE__ */ Q("div", {
3655
3775
  "data-phone-board": !0,
3656
3776
  className: "xixxii4 x10a8y8t x68pp3s x78zum5 xdt5ytf xo2rkog xqfszdh",
@@ -3658,18 +3778,18 @@ function zi({ id: e, board: n, src: r, siblings: i, origin: a, onOpen: o, onClos
3658
3778
  /* @__PURE__ */ Z("div", {
3659
3779
  ref: p,
3660
3780
  className: "x10l6tqk x10a8y8t x184qs1t",
3661
- style: g ? { opacity: N } : void 0
3781
+ style: g ? { opacity: j } : void 0
3662
3782
  }),
3663
3783
  /* @__PURE__ */ Q("header", {
3664
3784
  ref: m,
3665
3785
  className: "x1n2onr6 x2lah0s xdd8jsf x78zum5 x6s0dn4 x195vfkc x135b78x xv54qhq xso031l x1q0q8m5 xtrfj0v x1rozbrz",
3666
- style: g ? { opacity: le } : void 0,
3786
+ style: g ? { opacity: de } : void 0,
3667
3787
  children: [
3668
3788
  /* @__PURE__ */ Z("button", {
3669
3789
  type: "button",
3670
- "aria-label": B("phone.backToCanvas"),
3671
- onClick: () => void j(),
3672
- ...O(Mi.ghost),
3790
+ "aria-label": R("phone.backToCanvas"),
3791
+ onClick: () => void ee(),
3792
+ ...O(zi.ghost),
3673
3793
  children: /* @__PURE__ */ Z(xt, { size: 22 })
3674
3794
  }),
3675
3795
  /* @__PURE__ */ Q("span", {
@@ -3695,9 +3815,9 @@ function zi({ id: e, board: n, src: r, siblings: i, origin: a, onOpen: o, onClos
3695
3815
  /* @__PURE__ */ Z("div", {
3696
3816
  ref: c,
3697
3817
  "data-board-body": !0,
3698
- onPointerDown: ne,
3699
- onPointerMove: re,
3700
- onPointerUp: ae,
3818
+ onPointerDown: re,
3819
+ onPointerMove: ie,
3820
+ onPointerUp: oe,
3701
3821
  onPointerCancel: (e) => {
3702
3822
  let t = v.current;
3703
3823
  t?.id === e.pointerId && ((t.mode === "dismiss" || t.mode === "swipe") && A(), v.current = null), d.onPointerCancel(e);
@@ -3707,7 +3827,7 @@ function zi({ id: e, board: n, src: r, siblings: i, origin: a, onOpen: o, onClos
3707
3827
  ref: f,
3708
3828
  "data-board-stage": !0,
3709
3829
  className: "x10l6tqk x10a8y8t x1hj3fc7",
3710
- style: se ? { transform: se } : void 0,
3830
+ style: le ? { transform: le } : void 0,
3711
3831
  children: /* @__PURE__ */ Z("div", {
3712
3832
  className: "x10l6tqk xu96u03 x13vifvy x1hj3fc7",
3713
3833
  style: {
@@ -3715,7 +3835,7 @@ function zi({ id: e, board: n, src: r, siblings: i, origin: a, onOpen: o, onClos
3715
3835
  height: n.h,
3716
3836
  transform: `translate(${l.x}px, ${l.y}px) scale(${l.k})`
3717
3837
  },
3718
- children: t(n) ? /* @__PURE__ */ Z(ce, {
3838
+ children: t(n) ? /* @__PURE__ */ Z(ue, {
3719
3839
  id: e,
3720
3840
  board: n,
3721
3841
  src: r,
@@ -3737,14 +3857,14 @@ function zi({ id: e, board: n, src: r, siblings: i, origin: a, onOpen: o, onClos
3737
3857
  i.length > 1 ? /* @__PURE__ */ Q("div", {
3738
3858
  ref: h,
3739
3859
  className: "x1n2onr6 x2lah0s x78zum5 x6s0dn4 xdqyycr x1iorvi4 xe1blv6 x178xt8z x13fuv20 xxu5053 x1rozbrz",
3740
- style: g ? { opacity: le } : void 0,
3860
+ style: g ? { opacity: de } : void 0,
3741
3861
  children: [
3742
3862
  /* @__PURE__ */ Z("button", {
3743
3863
  type: "button",
3744
- "aria-label": B("phone.previousBoard"),
3864
+ "aria-label": R("phone.previousBoard"),
3745
3865
  disabled: !w,
3746
- onClick: () => void ee(-1, w),
3747
- ...O(Mi.ghost),
3866
+ onClick: () => void te(-1, w),
3867
+ ...O(zi.ghost),
3748
3868
  children: /* @__PURE__ */ Z(xt, { size: 20 })
3749
3869
  }),
3750
3870
  /* @__PURE__ */ Z("span", {
@@ -3759,10 +3879,10 @@ function zi({ id: e, board: n, src: r, siblings: i, origin: a, onOpen: o, onClos
3759
3879
  }),
3760
3880
  /* @__PURE__ */ Z("button", {
3761
3881
  type: "button",
3762
- "aria-label": B("phone.nextBoard"),
3882
+ "aria-label": R("phone.nextBoard"),
3763
3883
  disabled: !T,
3764
- onClick: () => void ee(1, T),
3765
- ...O(Mi.ghost),
3884
+ onClick: () => void te(1, T),
3885
+ ...O(zi.ghost),
3766
3886
  children: /* @__PURE__ */ Z(St, { size: 20 })
3767
3887
  })
3768
3888
  ]
@@ -3772,13 +3892,13 @@ function zi({ id: e, board: n, src: r, siblings: i, origin: a, onOpen: o, onClos
3772
3892
  }
3773
3893
  //#endregion
3774
3894
  //#region src/viewer/lib/questions.ts
3775
- var Bi = (e) => ({
3895
+ var qi = (e) => ({
3776
3896
  minX: e.x,
3777
3897
  minY: e.y,
3778
3898
  maxX: e.x + e.w,
3779
3899
  maxY: e.y + e.h
3780
3900
  });
3781
- function Vi(e, t, n) {
3901
+ function Ji(e, t, n) {
3782
3902
  let r = t.pages[n];
3783
3903
  if (!r) return [];
3784
3904
  let i = /* @__PURE__ */ new Set(), a = [];
@@ -3790,7 +3910,7 @@ function Vi(e, t, n) {
3790
3910
  id: t,
3791
3911
  title: o.title ?? t,
3792
3912
  boards: c,
3793
- bounds: Bi(s)
3913
+ bounds: qi(s)
3794
3914
  });
3795
3915
  }
3796
3916
  }
@@ -3798,7 +3918,7 @@ function Vi(e, t, n) {
3798
3918
  id: t,
3799
3919
  title: r.title ?? t,
3800
3920
  boards: [t],
3801
- bounds: Bi(r)
3921
+ bounds: qi(r)
3802
3922
  });
3803
3923
  a.sort((e, t) => e.bounds.minY - t.bounds.minY || e.bounds.minX - t.bounds.minX);
3804
3924
  let o = Object.entries(e.notes ?? {}).filter(([e, t]) => t.page === n && t.kind === "title" && r.notes[e]).map(([e, t]) => ({
@@ -3810,31 +3930,31 @@ function Vi(e, t, n) {
3810
3930
  let t = o.filter((t) => t.rect.y + t.rect.h <= e.bounds.minY).sort((e, t) => t.rect.y - e.rect.y)[0], n = t?.id ?? null;
3811
3931
  s.has(n) || s.set(n, {
3812
3932
  id: n,
3813
- title: t?.text ?? L.t("common.other"),
3933
+ title: t?.text ?? F.t("common.other"),
3814
3934
  questions: []
3815
3935
  }), s.get(n).questions.push(e);
3816
3936
  }
3817
3937
  let c = (e) => o.find((t) => t.id === e)?.rect.y ?? -Infinity;
3818
3938
  return [...s.values()].sort((e, t) => c(t.id) - c(e.id));
3819
3939
  }
3820
- var Hi = (e) => e.flatMap((e) => e.questions);
3821
- function Ui(e, t) {
3822
- let n = Hi(e);
3940
+ var Yi = (e) => e.flatMap((e) => e.questions);
3941
+ function Xi(e, t) {
3942
+ let n = Yi(e);
3823
3943
  if (t) {
3824
3944
  let r = e.find((e) => e.id === t)?.questions[0] ?? n.find((e) => e.id === t) ?? n.find((e) => e.boards.includes(t));
3825
3945
  if (r) return r;
3826
3946
  }
3827
3947
  return n[0] ?? null;
3828
3948
  }
3829
- function Wi(e, t, n) {
3949
+ function Zi(e, t, n) {
3830
3950
  let r = e.findIndex((e) => e.id === t);
3831
3951
  return r === -1 ? null : e[r + n] ?? null;
3832
3952
  }
3833
- var Gi = .66, Ki = (e, t, n) => e.id === t?.id ? "current" : n[e.id]?.state === "pass" ? "pass" : n[e.id]?.state === "reject" ? "reject" : "open";
3834
- function qi({ rounds: e, current: t, previous: n, next: r, pages: i, page: a, onPageChange: o, onPick: s, snap: c, onSnap: l, verdicts: u = {} }) {
3835
- let { t: d } = F(), f = Hi(e), p = t ? f.findIndex((e) => e.id === t.id) : -1;
3836
- return /* @__PURE__ */ Z(re, {
3837
- snaps: [78, Gi],
3953
+ var Qi = .66, $i = (e, t, n) => e.id === t?.id ? "current" : n[e.id]?.state === "pass" ? "pass" : n[e.id]?.state === "reject" ? "reject" : "open";
3954
+ function ea({ rounds: e, current: t, previous: n, next: r, pages: i, page: a, onPageChange: o, onPick: s, snap: c, onSnap: l, verdicts: u = {} }) {
3955
+ let { t: d } = N(), f = Yi(e), p = t ? f.findIndex((e) => e.id === t.id) : -1;
3956
+ return /* @__PURE__ */ Z(ie, {
3957
+ snaps: [78, Qi],
3838
3958
  snap: c,
3839
3959
  onSnap: l,
3840
3960
  onScrim: () => l(78),
@@ -3846,7 +3966,7 @@ function qi({ rounds: e, current: t, previous: n, next: r, pages: i, page: a, on
3846
3966
  "aria-label": d("questions.previous"),
3847
3967
  disabled: !n,
3848
3968
  onClick: () => n && s(n),
3849
- ...O(Mi.ghost),
3969
+ ...O(zi.ghost),
3850
3970
  children: /* @__PURE__ */ Z(xt, { size: 20 })
3851
3971
  }),
3852
3972
  /* @__PURE__ */ Q("span", {
@@ -3879,7 +3999,7 @@ function qi({ rounds: e, current: t, previous: n, next: r, pages: i, page: a, on
3879
3999
  "data-progress": !0,
3880
4000
  className: "x78zum5 x1ed6fcf",
3881
4001
  children: f.map((e) => {
3882
- let n = Ki(e, t, u);
4002
+ let n = $i(e, t, u);
3883
4003
  return /* @__PURE__ */ Z("span", {
3884
4004
  "data-mark": n,
3885
4005
  ...{
@@ -3901,7 +4021,7 @@ function qi({ rounds: e, current: t, previous: n, next: r, pages: i, page: a, on
3901
4021
  "aria-label": d("questions.next"),
3902
4022
  disabled: !r,
3903
4023
  onClick: () => r && s(r),
3904
- ...O(Mi.ghost),
4024
+ ...O(zi.ghost),
3905
4025
  children: /* @__PURE__ */ Z(St, { size: 20 })
3906
4026
  })
3907
4027
  ]
@@ -3910,7 +4030,7 @@ function qi({ rounds: e, current: t, previous: n, next: r, pages: i, page: a, on
3910
4030
  className: "xwxc41k xqfszdh",
3911
4031
  children: [i.length > 1 ? /* @__PURE__ */ Z("div", {
3912
4032
  className: "x78zum5 x13a6bvl x1hr3lfm x12ulsxz",
3913
- children: /* @__PURE__ */ Z(Ai, {
4033
+ children: /* @__PURE__ */ Z(Li, {
3914
4034
  pages: i,
3915
4035
  page: a,
3916
4036
  onPageChange: o
@@ -3947,19 +4067,19 @@ function qi({ rounds: e, current: t, previous: n, next: r, pages: i, page: a, on
3947
4067
  }
3948
4068
  //#endregion
3949
4069
  //#region src/viewer/layouts/PhoneArtboard.tsx
3950
- var Ji = {
4070
+ var ta = {
3951
4071
  top: 16,
3952
4072
  right: 16,
3953
4073
  bottom: 94,
3954
4074
  left: 16
3955
- }, Yi = 8, Xi = /* @__PURE__ */ new Set(), Zi = [];
3956
- function Qi({ id: e, canvas: t, layout: n, warnings: r, pending: i, contentBase: a, versions: o, live: s, loaded: c, agent: d, comments: f, actions: p }) {
3957
- let { viewportRef: m, view: h, size: g, fit: _, handlers: v } = pi("hand"), [y, b] = Y(null), [x, S] = Y(78), [C, w] = Y(null), T = J(null), E = G((e, t = !1) => e ? (b(e.id), _(e.bounds, Ji, { animate: t }), !0) : !1, [_]), { page: D, changePage: O } = ki({
4075
+ }, na = 8, ra = /* @__PURE__ */ new Set(), ia = [];
4076
+ function aa({ id: e, canvas: t, layout: n, warnings: r, pending: i, contentBase: a, versions: o, live: s, loaded: c, agent: d, comments: f, actions: p }) {
4077
+ let { viewportRef: m, view: h, size: g, fit: _, handlers: v } = bi("hand"), [y, b] = Y(null), [x, S] = Y(78), [C, w] = Y(null), T = J(null), E = G((e, t = !1) => e ? (b(e.id), _(e.bounds, ta, { animate: t }), !0) : !1, [_]), { page: D, changePage: O } = Ii({
3958
4078
  canvas: t,
3959
4079
  layout: n,
3960
4080
  fitPage: G((e) => {
3961
4081
  let r = n?.pages[e];
3962
- return !t || !r ? !1 : (E(Ui(Vi(t, n, e), t.focus?.target)) || (b(null), r.bounds && _(r.bounds, Ji)), !0);
4082
+ return !t || !r ? !1 : (E(Xi(Ji(t, n, e), t.focus?.target)) || (b(null), r.bounds && _(r.bounds, ta)), !0);
3963
4083
  }, [
3964
4084
  t,
3965
4085
  n,
@@ -3967,7 +4087,7 @@ function Qi({ id: e, canvas: t, layout: n, warnings: r, pending: i, contentBase:
3967
4087
  E
3968
4088
  ]),
3969
4089
  fitFocus: G((e, r) => {
3970
- t && n && E(Ui(Vi(t, n, r.page), e)) || _(r.bounds, Ji);
4090
+ t && n && E(Xi(Ji(t, n, r.page), e)) || _(r.bounds, ta);
3971
4091
  }, [
3972
4092
  t,
3973
4093
  n,
@@ -3975,22 +4095,22 @@ function Qi({ id: e, canvas: t, layout: n, warnings: r, pending: i, contentBase:
3975
4095
  E
3976
4096
  ]),
3977
4097
  startAtFocus: !0
3978
- }), k = q(() => t && n && D ? Vi(t, n, D) : [], [
4098
+ }), k = q(() => t && n && D ? Ji(t, n, D) : [], [
3979
4099
  t,
3980
4100
  n,
3981
4101
  D
3982
- ]), A = q(() => Hi(k), [k]), j = A.find((e) => e.id === y) ?? null, ee = (e) => {
4102
+ ]), A = q(() => Yi(k), [k]), ee = A.find((e) => e.id === y) ?? null, te = (e) => {
3983
4103
  E(e, !0), S(78);
3984
- }, te = t?.boards ?? {}, ne = q(() => Object.entries(t?.boards ?? {}).filter(([, e]) => e.page === D), [t, D]), re = Object.entries(t?.groups ?? {}).filter(([, e]) => e.boards.some((e) => te[e]?.page === D)), ie = Object.entries(t?.notes ?? {}).filter(([, e]) => e.page === D), ae = q(() => new Set(i), [i]), oe = q(() => new Set(f?.stale ?? []), [f]), M = Ir({
4104
+ }, ne = t?.boards ?? {}, re = q(() => Object.entries(t?.boards ?? {}).filter(([, e]) => e.page === D), [t, D]), ie = Object.entries(t?.groups ?? {}).filter(([, e]) => e.boards.some((e) => ne[e]?.page === D)), ae = Object.entries(t?.notes ?? {}).filter(([, e]) => e.page === D), oe = q(() => new Set(i), [i]), se = q(() => new Set(f?.stale ?? []), [f]), ce = Ur({
3985
4105
  canvas: t,
3986
4106
  page: D,
3987
- threads: f?.comments.threads ?? Zi,
3988
- stale: oe,
4107
+ threads: f?.comments.threads ?? ia,
4108
+ stale: se,
3989
4109
  versions: o
3990
- }), se = (e) => {
4110
+ }), le = (e) => {
3991
4111
  let t = m.current.getBoundingClientRect(), n = (e.clientX - t.left - h.x) / h.k, r = (e.clientY - t.top - h.y) / h.k;
3992
- return ne.find(([, e]) => n >= e.x && n <= e.x + e.w && r >= e.y && r <= e.y + e.h)?.[0] ?? null;
3993
- }, N = (e) => {
4112
+ return re.find(([, e]) => n >= e.x && n <= e.x + e.w && r >= e.y && r <= e.y + e.h)?.[0] ?? null;
4113
+ }, j = (e) => {
3994
4114
  v.onPointerDown(e);
3995
4115
  let t = !e.currentTarget.contains(e.target) || e.target.closest("[data-chrome]");
3996
4116
  T.current = T.current || t ? null : {
@@ -3998,26 +4118,26 @@ function Qi({ id: e, canvas: t, layout: n, warnings: r, pending: i, contentBase:
3998
4118
  x: e.clientX,
3999
4119
  y: e.clientY
4000
4120
  };
4001
- }, ce = (e) => {
4121
+ }, ue = (e) => {
4002
4122
  v.onPointerMove(e);
4003
4123
  let t = T.current;
4004
- t && (t.pointer !== e.pointerId || Math.hypot(e.clientX - t.x, e.clientY - t.y) > Yi) && (T.current = null);
4005
- }, le = (e) => {
4124
+ t && (t.pointer !== e.pointerId || Math.hypot(e.clientX - t.x, e.clientY - t.y) > na) && (T.current = null);
4125
+ }, de = (e) => {
4006
4126
  v.onPointerUp(e);
4007
4127
  let t = T.current;
4008
4128
  if (T.current = null, t?.pointer !== e.pointerId) return;
4009
- let n = se(e);
4129
+ let n = le(e);
4010
4130
  n && w(n);
4011
- }, P = C ? te[C] : void 0, de = m.current?.getBoundingClientRect(), F = P && de ? {
4012
- x: de.left + h.x + P.x * h.k,
4013
- y: de.top + h.y + P.y * h.k,
4014
- w: P.w * h.k,
4015
- h: P.h * h.k
4016
- } : void 0, fe = (e) => !t?.groups?.[e.id], I = C ? k.find((e) => e.questions.some((e) => e.boards.includes(C))) : void 0, L = I?.questions.find((e) => e.boards.includes(C)), pe = C ? L ? fe(L) ? I.questions.filter(fe).map((e) => e.id) : L.boards : [C] : [];
4131
+ }, M = C ? ne[C] : void 0, pe = m.current?.getBoundingClientRect(), N = M && pe ? {
4132
+ x: pe.left + h.x + M.x * h.k,
4133
+ y: pe.top + h.y + M.y * h.k,
4134
+ w: M.w * h.k,
4135
+ h: M.h * h.k
4136
+ } : void 0, P = (e) => !t?.groups?.[e.id], me = C ? k.find((e) => e.questions.some((e) => e.boards.includes(C))) : void 0, F = me?.questions.find((e) => e.boards.includes(C)), I = C ? F ? P(F) ? me.questions.filter(P).map((e) => e.id) : F.boards : [C] : [];
4017
4137
  return /* @__PURE__ */ Q("div", {
4018
4138
  className: "xixxii4 x10a8y8t x78zum5 xdt5ytf x184qs1t",
4019
4139
  children: [
4020
- /* @__PURE__ */ Z(ji, {
4140
+ /* @__PURE__ */ Z(Ri, {
4021
4141
  title: t?.title || e,
4022
4142
  pages: t?.pages ?? [],
4023
4143
  page: D,
@@ -4028,30 +4148,30 @@ function Qi({ id: e, canvas: t, layout: n, warnings: r, pending: i, contentBase:
4028
4148
  /* @__PURE__ */ Q("div", {
4029
4149
  ref: m,
4030
4150
  className: "x1n2onr6 x98rzlu x2lwn1j xb3r6kr x5ve5x3 x87ps6o xqfszdh xo2rkog",
4031
- onPointerDown: N,
4032
- onPointerMove: ce,
4033
- onPointerUp: le,
4151
+ onPointerDown: j,
4152
+ onPointerMove: ue,
4153
+ onPointerUp: de,
4034
4154
  onPointerCancel: (e) => {
4035
4155
  v.onPointerCancel(e), T.current = null;
4036
4156
  },
4037
4157
  children: [t && n ? /* @__PURE__ */ Q(u, {
4038
4158
  resetKey: t,
4039
- children: [/* @__PURE__ */ Z(ue, {
4159
+ children: [/* @__PURE__ */ Z(fe, {
4040
4160
  view: h,
4041
4161
  renders: l({
4042
- boards: ne.map(([e, t]) => ({
4162
+ boards: re.map(([e, t]) => ({
4043
4163
  id: e,
4044
4164
  ...t
4045
4165
  })),
4046
4166
  view: h,
4047
4167
  viewport: g
4048
4168
  }),
4049
- boards: ne,
4050
- notes: ie,
4169
+ boards: re,
4170
+ notes: ae,
4051
4171
  contentBase: a,
4052
4172
  versions: o,
4053
- pending: ae,
4054
- playing: Xi,
4173
+ pending: oe,
4174
+ playing: ra,
4055
4175
  replays: {},
4056
4176
  inspecting: !1,
4057
4177
  frameRef: () => () => {},
@@ -4061,17 +4181,17 @@ function Qi({ id: e, canvas: t, layout: n, warnings: r, pending: i, contentBase:
4061
4181
  agent: d
4062
4182
  }), /* @__PURE__ */ Z(Qn, {
4063
4183
  view: h,
4064
- boards: ne,
4065
- groups: re,
4066
- allBoards: te,
4184
+ boards: re,
4185
+ groups: ie,
4186
+ allBoards: ne,
4067
4187
  contentBase: a,
4068
4188
  versions: o,
4069
- pending: ae,
4070
- playing: Xi,
4189
+ pending: oe,
4190
+ playing: ra,
4071
4191
  onExpand: w,
4072
4192
  onTogglePlay: w,
4073
4193
  onReplay: () => {},
4074
- verdicts: M
4194
+ verdicts: ce
4075
4195
  })]
4076
4196
  }) : /* @__PURE__ */ Z("div", {
4077
4197
  className: "x10l6tqk x10a8y8t xrvj5dj x1ku5rj1 xggk2y7 x1bo0w0s xif65rj x2b8uid",
@@ -4079,27 +4199,27 @@ function Qi({ id: e, canvas: t, layout: n, warnings: r, pending: i, contentBase:
4079
4199
  }), A.length > 0 ? /* @__PURE__ */ Z("div", {
4080
4200
  "data-chrome": !0,
4081
4201
  className: "x10l6tqk x10a8y8t x1n327nk x47corl",
4082
- children: /* @__PURE__ */ Z(qi, {
4202
+ children: /* @__PURE__ */ Z(ea, {
4083
4203
  rounds: k,
4084
- current: j,
4085
- previous: y ? Wi(A, y, -1) : null,
4086
- next: y ? Wi(A, y, 1) : null,
4204
+ current: ee,
4205
+ previous: y ? Zi(A, y, -1) : null,
4206
+ next: y ? Zi(A, y, 1) : null,
4087
4207
  pages: t?.pages ?? [],
4088
4208
  page: D,
4089
4209
  onPageChange: O,
4090
- onPick: ee,
4210
+ onPick: te,
4091
4211
  snap: x,
4092
4212
  onSnap: S,
4093
- verdicts: M.states
4213
+ verdicts: ce.states
4094
4214
  })
4095
4215
  }) : null]
4096
4216
  }),
4097
- C && P ? /* @__PURE__ */ Z(zi, {
4217
+ C && M ? /* @__PURE__ */ Z(Ki, {
4098
4218
  id: C,
4099
- board: P,
4100
- src: `${a}${P.file}?v=${o[P.file] ?? 0}`,
4101
- siblings: pe,
4102
- origin: F,
4219
+ board: M,
4220
+ src: `${a}${M.file}?v=${o[M.file] ?? 0}`,
4221
+ siblings: I,
4222
+ origin: N,
4103
4223
  onOpen: w,
4104
4224
  onClose: () => w(null)
4105
4225
  }) : null
@@ -4108,7 +4228,7 @@ function Qi({ id: e, canvas: t, layout: n, warnings: r, pending: i, contentBase:
4108
4228
  }
4109
4229
  //#endregion
4110
4230
  //#region src/viewer/hooks/useBoardTweaks.ts
4111
- function $i(e) {
4231
+ function oa(e) {
4112
4232
  let t = J({}), [n, r] = Y(t.current), i = J(/* @__PURE__ */ new Map()), a = J(/* @__PURE__ */ new Map()), o = G((e, n) => {
4113
4233
  t.current = {
4114
4234
  ...t.current,
@@ -4183,18 +4303,18 @@ function $i(e) {
4183
4303
  }, [u])
4184
4304
  };
4185
4305
  }
4186
- var ea = (e, t) => ({
4306
+ var sa = (e, t) => ({
4187
4307
  left: t.x + (e.x + e.w) * t.k + 12,
4188
4308
  top: t.y + e.y * t.k
4189
4309
  });
4190
- function ta(e, t, n) {
4191
- let r = ea(e, t);
4310
+ function ca(e, t, n) {
4311
+ let r = sa(e, t);
4192
4312
  return {
4193
4313
  x: Math.min(Math.max(12, r.left), Math.max(12, n.width - 352 - 12)) - r.left,
4194
4314
  y: Math.min(Math.max(60, r.top), Math.max(60, n.height - 604 - 12)) - r.top
4195
4315
  };
4196
4316
  }
4197
- function na({ control: e, value: t, change: n }) {
4317
+ function la({ control: e, value: t, change: n }) {
4198
4318
  let r = Ge(), i = e.type === "enum" && e.options.length <= 3, a = i ? "fieldset" : "div", o;
4199
4319
  return o = e.type === "color" ? /* @__PURE__ */ Q("div", {
4200
4320
  className: "rt-color",
@@ -4285,10 +4405,10 @@ function na({ control: e, value: t, change: n }) {
4285
4405
  }), o]
4286
4406
  });
4287
4407
  }
4288
- function ra({ boardId: e, title: t, state: n, anchor: r, onChange: i, onReset: a, onClose: o }) {
4408
+ function ua({ boardId: e, title: t, state: n, anchor: r, onChange: i, onReset: a, onClose: o }) {
4289
4409
  let s = J(null), c = /* @__PURE__ */ new Map();
4290
4410
  for (let e of Object.entries(n.schema?.controls ?? {})) {
4291
- let t = e[1].section || B("parameters.controls");
4411
+ let t = e[1].section || R("parameters.controls");
4292
4412
  c.has(t) || c.set(t, []), c.get(t).push(e);
4293
4413
  }
4294
4414
  let l = Object.entries(n.values).filter(([e, t]) => t !== n.schema?.controls[e]?.default).length;
@@ -4297,7 +4417,7 @@ function ra({ boardId: e, title: t, state: n, anchor: r, onChange: i, onReset: a
4297
4417
  children: [/* @__PURE__ */ Q("aside", {
4298
4418
  className: "ryugi-parameters",
4299
4419
  "data-chrome": "parameters",
4300
- "aria-label": B("parameters.title"),
4420
+ "aria-label": R("parameters.title"),
4301
4421
  style: {
4302
4422
  position: r ? "absolute" : "relative",
4303
4423
  ...r,
@@ -4315,12 +4435,12 @@ function ra({ boardId: e, title: t, state: n, anchor: r, onChange: i, onReset: a
4315
4435
  size: 15,
4316
4436
  "aria-hidden": !0
4317
4437
  }),
4318
- /* @__PURE__ */ Z("h2", { children: B("parameters.title") }),
4438
+ /* @__PURE__ */ Z("h2", { children: R("parameters.title") }),
4319
4439
  /* @__PURE__ */ Z(Xe, {
4320
4440
  icon: Yt,
4321
4441
  size: "small",
4322
- "aria-label": B("parameters.close"),
4323
- title: B("parameters.close"),
4442
+ "aria-label": R("parameters.close"),
4443
+ title: R("parameters.close"),
4324
4444
  onClick: o
4325
4445
  })
4326
4446
  ]
@@ -4333,7 +4453,7 @@ function ra({ boardId: e, title: t, state: n, anchor: r, onChange: i, onReset: a
4333
4453
  "aria-hidden": !0
4334
4454
  }),
4335
4455
  /* @__PURE__ */ Q("div", { children: [/* @__PURE__ */ Z("strong", { children: t }), /* @__PURE__ */ Z("code", { children: e })] }),
4336
- /* @__PURE__ */ Z("span", { children: B("parameters.currentBoard") })
4456
+ /* @__PURE__ */ Z("span", { children: R("parameters.currentBoard") })
4337
4457
  ]
4338
4458
  }),
4339
4459
  /* @__PURE__ */ Q("div", {
@@ -4346,7 +4466,7 @@ function ra({ boardId: e, title: t, state: n, anchor: r, onChange: i, onReset: a
4346
4466
  }),
4347
4467
  [...c].map(([e, t]) => /* @__PURE__ */ Q("section", {
4348
4468
  className: "rt-section",
4349
- children: [/* @__PURE__ */ Z("h3", { children: e }), t.map(([e, t]) => /* @__PURE__ */ Z(na, {
4469
+ children: [/* @__PURE__ */ Z("h3", { children: e }), t.map(([e, t]) => /* @__PURE__ */ Z(la, {
4350
4470
  control: t,
4351
4471
  value: n.values[e],
4352
4472
  change: (t) => i(e, t)
@@ -4354,12 +4474,12 @@ function ra({ boardId: e, title: t, state: n, anchor: r, onChange: i, onReset: a
4354
4474
  }, e)),
4355
4475
  n.schema && /* @__PURE__ */ Q("div", {
4356
4476
  className: "rt-declaration",
4357
- children: [/* @__PURE__ */ Z("span", { children: B("parameters.declaredBy") }), /* @__PURE__ */ Z(Ze, {
4477
+ children: [/* @__PURE__ */ Z("span", { children: R("parameters.declaredBy") }), /* @__PURE__ */ Z(Ze, {
4358
4478
  size: "small",
4359
4479
  type: "text",
4360
4480
  icon: Dt,
4361
4481
  onClick: () => s.current?.showModal(),
4362
- children: B("parameters.viewDeclaration")
4482
+ children: R("parameters.viewDeclaration")
4363
4483
  })]
4364
4484
  })
4365
4485
  ]
@@ -4368,419 +4488,441 @@ function ra({ boardId: e, title: t, state: n, anchor: r, onChange: i, onReset: a
4368
4488
  className: "rt-footer",
4369
4489
  children: [/* @__PURE__ */ Z("span", {
4370
4490
  role: "status",
4371
- children: l ? B("parameters.changed", { count: l }) : B("parameters.defaults")
4491
+ children: l ? R("parameters.changed", { count: l }) : R("parameters.defaults")
4372
4492
  }), /* @__PURE__ */ Z(Ze, {
4373
4493
  size: "small",
4374
4494
  type: "text",
4375
4495
  icon: Wt,
4376
4496
  disabled: !l,
4377
4497
  onClick: a,
4378
- children: B("parameters.reset")
4498
+ children: R("parameters.reset")
4379
4499
  })]
4380
4500
  })
4381
4501
  ]
4382
4502
  }), /* @__PURE__ */ Q("dialog", {
4383
4503
  ref: s,
4384
4504
  className: "rt-dialog",
4385
- "aria-label": B("parameters.declaration"),
4505
+ "aria-label": R("parameters.declaration"),
4386
4506
  onKeyDown: (e) => e.stopPropagation(),
4387
4507
  children: [
4388
- /* @__PURE__ */ Q("header", { children: [/* @__PURE__ */ Z("h2", { children: B("parameters.declaration") }), /* @__PURE__ */ Z(Xe, {
4508
+ /* @__PURE__ */ Q("header", { children: [/* @__PURE__ */ Z("h2", { children: R("parameters.declaration") }), /* @__PURE__ */ Z(Xe, {
4389
4509
  icon: Yt,
4390
4510
  size: "small",
4391
- "aria-label": B("parameters.closeDeclaration"),
4511
+ "aria-label": R("parameters.closeDeclaration"),
4392
4512
  onClick: () => s.current?.close()
4393
4513
  })] }),
4394
4514
  /* @__PURE__ */ Z("pre", {
4395
4515
  tabIndex: 0,
4396
4516
  children: JSON.stringify(n.schema, null, 2)
4397
4517
  }),
4398
- /* @__PURE__ */ Z("h3", { children: B("parameters.currentValues") }),
4518
+ /* @__PURE__ */ Z("h3", { children: R("parameters.currentValues") }),
4399
4519
  /* @__PURE__ */ Z("pre", {
4400
4520
  tabIndex: 0,
4401
4521
  children: JSON.stringify(n.values, null, 2)
4402
4522
  }),
4403
- /* @__PURE__ */ Z("p", { children: B("parameters.sessionOnly") })
4523
+ /* @__PURE__ */ Z("p", { children: R("parameters.sessionOnly") })
4404
4524
  ]
4405
4525
  })]
4406
4526
  });
4407
4527
  }
4408
4528
  //#endregion
4409
4529
  //#region src/viewer/layouts/ArtboardView.tsx
4410
- function ia(e) {
4411
- return Pe("(max-width: 640px)") ? /* @__PURE__ */ Z(Qi, { ...e }) : /* @__PURE__ */ Z(aa, { ...e });
4530
+ function da(e) {
4531
+ return Ne("(max-width: 640px)") ? /* @__PURE__ */ Z(aa, { ...e }) : /* @__PURE__ */ Z(fa, { ...e });
4412
4532
  }
4413
- function aa({ id: e, artifact: t, canvas: n, layout: r, warnings: i, pending: a, contentBase: o, versions: s, live: c, loaded: l, send: d, agent: f, comments: p, comment: m, actions: h }) {
4414
- let [g, _] = Y("select"), { viewportRef: v, view: y, scaling: b, size: x, fit: S, zoomBy: C, zoomTo: w, cursor: T, hand: E, handlers: O, panBy: k, wheelAt: A, panning: j, setSpaceHeld: ee } = pi(g), [te, ne] = Y(!1), [re] = Y(() => new URLSearchParams(location.search).has("debug")), [ie, ae] = Y("open"), oe = (e) => e && r?.pages[e]?.bounds || null, { page: M, changePage: se } = ki({
4533
+ function fa({ id: e, artifact: t, canvas: n, layout: r, warnings: i, pending: a, contentBase: o, versions: s, live: c, loaded: d, send: f, agent: p, comments: m, comment: h, actions: g, tiers: _ = !0 }) {
4534
+ let [v, y] = Y("select"), { viewportRef: b, view: x, scaling: S, size: C, fit: w, zoomBy: T, zoomTo: E, cursor: O, hand: k, handlers: A, panBy: ee, wheelAt: te, panning: ne, setSpaceHeld: re } = bi(v), [ie, ae] = Y(!1), [oe] = Y(() => new URLSearchParams(location.search).has("debug")), [se, ce] = Y("open"), le = (e) => e && r?.pages[e]?.bounds || null, { page: j, changePage: ue } = Ii({
4415
4535
  canvas: n,
4416
4536
  layout: r,
4417
4537
  fitPage: G((e) => {
4418
4538
  let t = r?.pages[e]?.bounds;
4419
- return t ? (S(t), !0) : !1;
4420
- }, [r, S]),
4421
- fitFocus: G((e, t) => S(t.bounds), [S])
4422
- }), [N, ce] = Y(null), [P, de] = Y(() => /* @__PURE__ */ new Set()), [F, fe] = Y({}), I = $i(e), [L, pe] = Y(null), me = J(null);
4423
- K(() => pe(null), [M, e]);
4424
- let he = () => {
4425
- pe(null), me.current?.focus();
4426
- }, ge = (e, t) => {
4427
- me.current = t;
4428
- let r = n?.boards[e], i = v.current;
4429
- if (L !== e && !N && r && i) {
4430
- let e = ta(r, y, {
4539
+ return t ? (w(t), !0) : !1;
4540
+ }, [r, w]),
4541
+ fitFocus: G((e, t) => w(t.bounds), [w])
4542
+ }), [M, pe] = Y(null), [N, P] = Y(() => /* @__PURE__ */ new Set()), [me, F] = Y({}), I = oa(e), [L, he] = Y(null), ge = J(null);
4543
+ K(() => he(null), [j, e]);
4544
+ let _e = () => {
4545
+ he(null), ge.current?.focus();
4546
+ }, ve = (e, t) => {
4547
+ ge.current = t;
4548
+ let r = n?.boards[e], i = b.current;
4549
+ if (L !== e && !M && r && i) {
4550
+ let e = ca(r, x, {
4431
4551
  width: i.clientWidth,
4432
4552
  height: i.clientHeight
4433
4553
  });
4434
- (e.x || e.y) && k(e.x, e.y);
4554
+ (e.x || e.y) && ee(e.x, e.y);
4435
4555
  }
4436
- pe((t) => t === e ? null : e);
4437
- }, _e = g === "select" && !N && !j, R = g === "comment", z = Xr({
4438
- enabled: !N && (g === "select" || R || te),
4439
- mode: R ? "comment" : "select",
4440
- playing: P,
4556
+ he((t) => t === e ? null : e);
4557
+ }, ye = v === "select" && !M && !ne, z = v === "comment", be = !M && (v === "select" || z || ie), B = ri({
4558
+ enabled: be,
4559
+ mode: z ? "comment" : "select",
4560
+ playing: N,
4441
4561
  onInput: (e, t) => {
4442
4562
  let r = n?.boards[e];
4443
- r && (t.type === "ryugi:inspect:wheel" ? A({
4563
+ r && (t.type === "ryugi:inspect:wheel" ? te({
4444
4564
  ...t,
4445
- x: y.x + (r.x + t.x) * y.k,
4446
- y: y.y + (r.y + t.y) * y.k
4447
- }) : t.type === "ryugi:inspect:pan" ? k(t.deltaX, t.deltaY) : t.type === "ryugi:inspect:drag" ? R ? V.onFrameDrag(e, t) : _e && U.drag(t.phase, r.x + t.x, r.y + t.y, t.append, t.id ? {
4565
+ x: x.x + (r.x + t.x) * x.k,
4566
+ y: x.y + (r.y + t.y) * x.k
4567
+ }) : t.type === "ryugi:inspect:pan" ? ee(t.deltaX, t.deltaY) : t.type === "ryugi:inspect:drag" ? z ? V.onFrameDrag(e, t) : ye && W.drag(t.phase, r.x + t.x, r.y + t.y, t.append, t.id ? {
4448
4568
  boardId: e,
4449
4569
  id: t.id
4450
- } : void 0) : t.code === "Space" ? ee(t.down) : t.down && Te(t));
4570
+ } : void 0) : t.code === "Space" ? re(t.down) : t.down && Oe(t));
4451
4571
  }
4452
4572
  });
4453
- ri({
4573
+ ui({
4454
4574
  artifact: t,
4455
4575
  boards: n?.boards,
4456
4576
  live: c,
4457
- inspector: z,
4458
- send: d
4577
+ inspector: B,
4578
+ send: f
4459
4579
  });
4460
4580
  let V = cr({
4461
- comments: p,
4462
- comment: m,
4463
- page: M,
4581
+ comments: m,
4582
+ comment: h,
4583
+ page: j,
4464
4584
  boards: n?.boards ?? {},
4465
- inspector: z
4466
- }), H = Ir({
4585
+ inspector: B
4586
+ }), H = Ur({
4467
4587
  canvas: n,
4468
- page: M,
4588
+ page: j,
4469
4589
  threads: V.threads,
4470
4590
  stale: V.stale,
4471
4591
  versions: s,
4472
- comment: m
4473
- }), ve = H.rejecting ? H.origin(H.rejecting) : null, ye = () => {
4474
- let e = H.progress.next && M ? r?.pages[M]?.groups[H.progress.next] : void 0;
4475
- e && S({
4592
+ comment: h
4593
+ }), xe = H.rejecting ? H.origin(H.rejecting) : null, Se = () => {
4594
+ let e = H.progress.next && j ? r?.pages[j]?.groups[H.progress.next] : void 0;
4595
+ e && w({
4476
4596
  minX: e.x,
4477
4597
  minY: e.y,
4478
4598
  maxX: e.x + e.w,
4479
4599
  maxY: e.y + e.h
4480
4600
  });
4481
- }, be = (e) => {
4482
- (e !== "comment" || m) && (e === "comment" && g === "select" && V.commentSelection(), e !== "comment" && V.close(), _(e));
4483
- }, xe = (e) => {
4484
- let t = V.threads.find((t) => t.id === e), r = t && on(t.anchor, n?.boards ?? {}), i = v.current;
4485
- r && i && k(i.clientWidth / 2 - (y.x + r.x * y.k), i.clientHeight / 2 - (y.y + r.y * y.k)), V.setOpenId(e);
4486
- }, Se = G(() => ne(!1), []);
4601
+ }, Ce = (e) => {
4602
+ (e !== "comment" || h) && (e === "comment" && v === "select" && V.commentSelection(), e !== "comment" && V.close(), y(e));
4603
+ }, we = (e) => {
4604
+ let t = V.threads.find((t) => t.id === e), r = t && on(t.anchor, n?.boards ?? {}), i = b.current;
4605
+ r && i && ee(i.clientWidth / 2 - (x.x + r.x * x.k), i.clientHeight / 2 - (x.y + r.y * x.k)), V.setOpenId(e);
4606
+ }, Te = G(() => ae(!1), []);
4487
4607
  K(() => {
4488
- N && ee(!1);
4489
- }, [N, ee]);
4490
- let Ce = q(() => new Set(a), [a]), we = n?.pages ?? [];
4608
+ M && re(!1);
4609
+ }, [M, re]);
4610
+ let Ee = q(() => new Set(a), [a]), De = n?.pages ?? [];
4491
4611
  K(() => {
4492
4612
  document.title = n?.title || e;
4493
4613
  }, [n?.title, e]), D("artboard");
4494
- function Te(e) {
4614
+ function Oe(e) {
4495
4615
  if ("target" in e && e.target?.closest?.("input, textarea, select, [contenteditable], [role=\"tree\"], [role=\"treeitem\"], [data-chrome=\"parameters\"]")) return;
4496
4616
  let t = () => {
4497
4617
  "preventDefault" in e && e.preventDefault();
4498
4618
  }, n = e.metaKey || e.ctrlKey;
4499
- e.key === "Escape" && R ? V.close() || be("select") : e.key === "Escape" ? L ? he() : (ce(null), z.clearSelection(), U.reset()) : n && (e.key === "=" || e.key === "+") ? (t(), C(1.25)) : n && e.key === "-" ? (t(), C(.8)) : e.shiftKey && e.code === "Digit1" ? S(oe(M)) : e.shiftKey && e.code === "Digit0" ? w(1) : !n && !e.shiftKey && e.key.toLowerCase() === "v" ? be("select") : !n && !e.shiftKey && e.key.toLowerCase() === "h" ? be("hand") : !n && !e.shiftKey && e.key.toLowerCase() === "c" && (t(), be("comment"));
4619
+ e.key === "Escape" && z ? V.close() || Ce("select") : e.key === "Escape" ? L ? _e() : (pe(null), B.clearSelection(), W.reset()) : n && (e.key === "=" || e.key === "+") ? (t(), T(1.25)) : n && e.key === "-" ? (t(), T(.8)) : e.shiftKey && e.code === "Digit1" ? w(le(j)) : e.shiftKey && e.code === "Digit0" ? E(1) : !n && !e.shiftKey && e.key.toLowerCase() === "v" ? Ce("select") : !n && !e.shiftKey && e.key.toLowerCase() === "h" ? Ce("hand") : !n && !e.shiftKey && e.key.toLowerCase() === "c" && (t(), Ce("comment"));
4500
4620
  }
4501
- K(() => (window.addEventListener("keydown", Te), () => window.removeEventListener("keydown", Te)));
4502
- let Ee = n?.boards ?? {}, De = q(() => Object.entries(n?.boards ?? {}).filter(([, e]) => e.page === M), [n, M]), Oe = Object.entries(n?.groups ?? {}).filter(([, e]) => e.boards.some((e) => Ee[e]?.page === M)), ke = Object.entries(n?.notes ?? {}).filter(([, e]) => e.page === M), Ae = N ? Ee[N] : void 0, je = Object.fromEntries(Object.entries(I.states).flatMap(([e, t]) => {
4621
+ K(() => (window.addEventListener("keydown", Oe), () => window.removeEventListener("keydown", Oe)));
4622
+ let ke = n?.boards ?? {}, Ae = q(() => Object.entries(n?.boards ?? {}).filter(([, e]) => e.page === j), [n, j]), je = Object.entries(n?.groups ?? {}).filter(([, e]) => e.boards.some((e) => ke[e]?.page === j)), Me = Object.entries(n?.notes ?? {}).filter(([, e]) => e.page === j), U = M ? ke[M] : void 0, Ne = Object.fromEntries(Object.entries(I.states).flatMap(([e, t]) => {
4503
4623
  let n = Object.keys(t.schema?.controls ?? {}).length;
4504
4624
  return n || t.error ? [[e, n]] : [];
4505
- })), Me = L ? I.states[L] : void 0, Ne = L ? Ee[L] : void 0, Pe = (e) => L && Me && Ne && (Me.schema || Me.error) ? /* @__PURE__ */ Z(ra, {
4625
+ })), Pe = L ? I.states[L] : void 0, Fe = L ? ke[L] : void 0, Ie = (e) => L && Pe && Fe && (Pe.schema || Pe.error) ? /* @__PURE__ */ Z(ua, {
4506
4626
  boardId: L,
4507
- title: Ne.title ?? L,
4508
- state: Me,
4509
- anchor: e ? ea(Ne, y) : void 0,
4627
+ title: Fe.title ?? L,
4628
+ state: Pe,
4629
+ anchor: e ? sa(Fe, x) : void 0,
4510
4630
  onChange: (e, t) => I.change(L, e, t),
4511
4631
  onReset: () => I.reset(L),
4512
- onClose: he
4513
- }) : null, Fe = Ae ? (s[Ae.file] ?? 0) > 0 && !Ce.has(N) : !1, U = Zr(De, z, y.k, [
4514
- g,
4515
- N,
4632
+ onClose: _e
4633
+ }) : null, Le = U ? (s[U.file] ?? 0) > 0 && !Ee.has(M) : !1, W = ii(Ae, B, x.k, [
4634
+ v,
4516
4635
  M,
4517
- j
4518
- ]), Ie = (e) => {
4519
- let t = v.current.getBoundingClientRect();
4636
+ j,
4637
+ ne
4638
+ ]), Re = (e) => {
4639
+ let t = b.current.getBoundingClientRect();
4520
4640
  return {
4521
- x: (e.clientX - t.left - y.x) / y.k,
4522
- y: (e.clientY - t.top - y.y) / y.k
4641
+ x: (e.clientX - t.left - x.x) / x.k,
4642
+ y: (e.clientY - t.top - x.y) / x.k
4523
4643
  };
4524
- }, [Le, Re] = Y(null), ze = (e) => De.find(([, t]) => e.x >= t.x && e.x <= t.x + t.w && e.y >= t.y && e.y <= t.y + t.h)?.[0] ?? null, W = U.marquee, Be = q(() => /* @__PURE__ */ new Set([
4525
- ...P,
4526
- ...[N, L].filter((e) => !!e),
4527
- ...z.selectedTargets.map((e) => e.boardId),
4528
- ...Object.entries(z.frames).filter(([, e]) => e.tweaks.length > 0).map(([e]) => e),
4529
- ...W ? De.filter(([, e]) => e.x < W.x + W.width && e.x + e.w > W.x && e.y < W.y + W.height && e.y + e.h > W.y).map(([e]) => e) : []
4644
+ }, ze = (e) => Ae.find(([, t]) => e.x >= t.x && e.x <= t.x + t.w && e.y >= t.y && e.y <= t.y + t.h)?.[0] ?? null, Be = Fr({
4645
+ scaling: S,
4646
+ view: x,
4647
+ inside: B.hover?.boardId ?? null,
4648
+ locate: (e) => {
4649
+ let t = Re(e);
4650
+ return {
4651
+ board: ze(t),
4652
+ x: t.x * x.k,
4653
+ y: t.y * x.k
4654
+ };
4655
+ }
4656
+ }), Ve = W.marquee, He = Rr(Ae, s, (e) => !be || N.has(e)), Ue = q(() => /* @__PURE__ */ new Set([
4657
+ ...He,
4658
+ ...N,
4659
+ ...[M, L].filter((e) => !!e),
4660
+ ...B.selectedTargets.map((e) => e.boardId),
4661
+ ...Object.entries(B.frames).filter(([, e]) => e.tweaks.length > 0).map(([e]) => e),
4662
+ ...Ve ? Ae.filter(([, e]) => e.x < Ve.x + Ve.width && e.x + e.w > Ve.x && e.y < Ve.y + Ve.height && e.y + e.h > Ve.y).map(([e]) => e) : []
4530
4663
  ]), [
4531
- P,
4664
+ He,
4532
4665
  N,
4666
+ M,
4533
4667
  L,
4534
- z.selectedTargets,
4535
- z.frames,
4536
- W,
4537
- De
4538
- ]), Ve = jr({
4668
+ B.selectedTargets,
4669
+ B.frames,
4670
+ Ve,
4671
+ Ae
4672
+ ]), We = Ar({
4539
4673
  artifact: t ?? e,
4540
- boards: De,
4674
+ boards: _ ? Ae : [],
4541
4675
  versions: s,
4542
- pending: Ce,
4543
- view: y,
4544
- scaling: b,
4545
- viewport: x,
4546
- pinned: Be,
4547
- hovered: z.hover?.boardId ?? Le,
4548
- hoverPromotes: g === "select" || R,
4676
+ pending: Ee,
4677
+ view: x,
4678
+ scaling: S,
4679
+ viewport: C,
4680
+ pinned: Ue,
4681
+ hovered: Be.hovered,
4682
+ hoverPromotes: v === "select" || z,
4549
4683
  persistable: (e) => {
4550
4684
  let t = I.states[e];
4551
- return !(t?.schema && JSON.stringify(t.values) !== JSON.stringify(en(t.schema))) && !z.frames[e]?.tweaks.length;
4685
+ return !(t?.schema && JSON.stringify(t.values) !== JSON.stringify(en(t.schema))) && !B.frames[e]?.tweaks.length;
4552
4686
  }
4553
- }), He = q(() => {
4687
+ }), Ge = _ ? We.renders : l({
4688
+ boards: Ae.map(([e, t]) => ({
4689
+ id: e,
4690
+ ...t
4691
+ })),
4692
+ view: x,
4693
+ viewport: C
4694
+ }), Ke = q(() => {
4554
4695
  let e = /* @__PURE__ */ new Map();
4555
4696
  return (t) => (e.has(t) || e.set(t, (e) => {
4556
- I.refFor(t)(e), z.refFor(t)(e), Ve.frameRef(t)(e);
4697
+ I.refFor(t)(e), B.refFor(t)(e), We.frameRef(t)(e);
4557
4698
  }), e.get(t));
4558
4699
  }, [
4559
4700
  I.refFor,
4560
- z.refFor,
4561
- Ve.frameRef
4562
- ]), Ue = G((e) => {
4563
- I.loaded(e), z.loaded(e), Ve.loaded(e);
4701
+ B.refFor,
4702
+ We.frameRef
4703
+ ]), qe = G((e) => {
4704
+ I.loaded(e), B.loaded(e), We.loaded(e);
4564
4705
  }, [
4565
4706
  I.loaded,
4566
- z.loaded,
4567
- Ve.loaded
4707
+ B.loaded,
4708
+ We.loaded
4568
4709
  ]);
4569
4710
  return /* @__PURE__ */ Q("div", {
4570
4711
  className: "x78zum5 xh8yej3 x5yr21d xb3r6kr",
4571
4712
  children: [
4572
4713
  /* @__PURE__ */ Q("div", {
4573
- ref: v,
4714
+ ref: b,
4574
4715
  className: "x98rzlu xeuugli x1n2onr6 xh8yej3 x5yr21d xb3r6kr x5ve5x3 x87ps6o x184qs1t xqfszdh xo2rkog",
4575
- style: { cursor: T },
4716
+ style: { cursor: O },
4576
4717
  onClickCapture: (e) => {
4577
- !N && (R || j) && e.target.closest("[data-video-surface]") && e.stopPropagation();
4718
+ !M && (z || ne) && e.target.closest("[data-video-surface]") && e.stopPropagation();
4578
4719
  },
4579
4720
  onPointerDown: (e) => {
4580
- if (O.onPointerDown(e), R && !j && !N && e.button === 0 && e.pointerType !== "touch" && e.currentTarget.contains(e.target) && !e.target.closest("[data-chrome]") && (e.preventDefault(), V.onCanvasClick(Ie(e))), !_e || e.pointerType === "touch" || e.button !== 0 || !e.currentTarget.contains(e.target) || e.target.closest("[data-chrome], [data-video-surface]")) return;
4581
- let t = Ie(e);
4582
- e.currentTarget.setPointerCapture(e.pointerId), U.drag("start", t.x, t.y, e.shiftKey || e.metaKey || e.ctrlKey);
4721
+ if (A.onPointerDown(e), z && !ne && !M && e.button === 0 && e.pointerType !== "touch" && e.currentTarget.contains(e.target) && !e.target.closest("[data-chrome]") && (e.preventDefault(), V.onCanvasClick(Re(e))), !ye || e.pointerType === "touch" || e.button !== 0 || !e.currentTarget.contains(e.target) || e.target.closest("[data-chrome], [data-video-surface]")) return;
4722
+ let t = Re(e);
4723
+ e.currentTarget.setPointerCapture(e.pointerId), W.drag("start", t.x, t.y, e.shiftKey || e.metaKey || e.ctrlKey);
4583
4724
  },
4584
4725
  onPointerMove: (e) => {
4585
- if (O.onPointerMove(e), Re(ze(Ie(e))), U.dragging()) {
4726
+ if (A.onPointerMove(e), Be.track(e), W.dragging()) {
4586
4727
  e.buttons === 1 && e.currentTarget.setPointerCapture(e.pointerId);
4587
- let t = Ie(e);
4588
- U.drag("move", t.x, t.y);
4728
+ let t = Re(e);
4729
+ W.drag("move", t.x, t.y);
4589
4730
  }
4590
4731
  },
4591
4732
  onPointerUp: (e) => {
4592
- if (O.onPointerUp(e), U.dragging()) {
4593
- let t = Ie(e);
4594
- U.drag("end", t.x, t.y);
4733
+ if (A.onPointerUp(e), W.dragging()) {
4734
+ let t = Re(e);
4735
+ W.drag("end", t.x, t.y);
4595
4736
  }
4596
4737
  },
4738
+ onPointerLeave: Be.leave,
4597
4739
  onPointerCancel: (e) => {
4598
- O.onPointerCancel(e), U.reset();
4740
+ A.onPointerCancel(e), W.reset();
4599
4741
  },
4600
4742
  children: [
4601
4743
  /* @__PURE__ */ Z(Hn, {
4602
- viewport: v,
4603
- hand: E
4744
+ viewport: b,
4745
+ hand: k
4604
4746
  }),
4605
- re && /* @__PURE__ */ Z(Tn, {
4606
- renders: Ve.renders,
4607
- scaling: b
4747
+ oe && /* @__PURE__ */ Z(Tn, {
4748
+ renders: Ge,
4749
+ scaling: S
4608
4750
  }),
4609
4751
  n && r && /* @__PURE__ */ Q(u, {
4610
4752
  resetKey: n,
4611
4753
  children: [
4612
- /* @__PURE__ */ Z(ue, {
4613
- view: y,
4614
- renders: Ve.renders,
4615
- boards: De,
4616
- notes: ke,
4754
+ /* @__PURE__ */ Z(fe, {
4755
+ view: x,
4756
+ renders: Ge,
4757
+ boards: Ae,
4758
+ notes: Me,
4617
4759
  contentBase: o,
4618
4760
  versions: s,
4619
- pending: Ce,
4620
- playing: P,
4621
- replays: F,
4622
- inspecting: _e || R && !N && !j,
4623
- frameRef: He,
4624
- frameLoaded: Ue,
4761
+ pending: Ee,
4762
+ playing: N,
4763
+ replays: me,
4764
+ inspecting: ye || z && !M && !ne,
4765
+ frameRef: Ke,
4766
+ frameLoaded: qe,
4625
4767
  live: c,
4626
4768
  writing: c ? n.writing : void 0,
4627
- agent: f,
4628
- onExpand: ce,
4629
- onImageError: Ve.imageFailed
4769
+ agent: p,
4770
+ onExpand: pe,
4771
+ onImageError: We.imageFailed
4630
4772
  }),
4631
4773
  /* @__PURE__ */ Z(Qn, {
4632
- view: y,
4633
- boards: De,
4634
- groups: Oe,
4635
- allBoards: Ee,
4774
+ view: x,
4775
+ boards: Ae,
4776
+ groups: je,
4777
+ allBoards: ke,
4636
4778
  contentBase: o,
4637
4779
  versions: s,
4638
- pending: Ce,
4639
- playing: P,
4640
- onExpand: ce,
4641
- onTogglePlay: (e) => de((t) => le(t, e)),
4642
- onReplay: (e) => fe((t) => ({
4780
+ pending: Ee,
4781
+ playing: N,
4782
+ onExpand: pe,
4783
+ onTogglePlay: (e) => P((t) => de(t, e)),
4784
+ onReplay: (e) => F((t) => ({
4643
4785
  ...t,
4644
4786
  [e]: (t[e] ?? 0) + 1
4645
4787
  })),
4646
- parameters: je,
4788
+ parameters: Ne,
4647
4789
  activeParameters: L,
4648
- onToggleParameters: ge,
4790
+ onToggleParameters: ve,
4649
4791
  verdicts: H
4650
4792
  }),
4651
- H.rejecting && ve && /* @__PURE__ */ Z(Lr, {
4793
+ H.rejecting && xe && /* @__PURE__ */ Z(Wr, {
4652
4794
  group: H.rejecting,
4653
- left: y.x + ve.x * y.k,
4654
- top: y.y + ve.y * y.k + 8,
4795
+ left: x.x + xe.x * x.k,
4796
+ top: x.y + xe.y * x.k + 8,
4655
4797
  onSubmit: H.submitReject,
4656
4798
  onCancel: H.cancelReject
4657
4799
  }),
4658
- R && /* @__PURE__ */ Z(vn, {
4659
- view: y,
4660
- page: M,
4661
- boards: Ee,
4662
- width: v.current?.clientWidth ?? 0,
4800
+ z && /* @__PURE__ */ Z(vn, {
4801
+ view: x,
4802
+ page: j,
4803
+ boards: ke,
4804
+ width: b.current?.clientWidth ?? 0,
4663
4805
  threads: V.threads,
4664
4806
  stale: V.stale,
4665
4807
  numbers: V.numbers,
4666
- showResolved: ie === "all",
4808
+ showResolved: se === "all",
4667
4809
  draft: V.draft,
4668
4810
  openId: V.openId,
4669
4811
  actions: V.actions,
4670
- agent: f,
4812
+ agent: p,
4671
4813
  onOpen: V.setOpenId,
4672
4814
  onSubmit: V.submit,
4673
4815
  onCancelDraft: V.cancelDraft
4674
4816
  })
4675
4817
  ]
4676
4818
  }),
4677
- (_e || R) && !U.marquee && z.hover && Ee[z.hover.boardId] && /* @__PURE__ */ Z(mi, {
4678
- board: Ee[z.hover.boardId],
4679
- rect: z.hover.rect,
4680
- view: y,
4681
- nodeId: z.hover.id ? `${z.hover.boardId}#${z.hover.id}` : void 0
4819
+ (ye || z) && !W.marquee && B.hover && ke[B.hover.boardId] && /* @__PURE__ */ Z(xi, {
4820
+ board: ke[B.hover.boardId],
4821
+ rect: B.hover.rect,
4822
+ view: x,
4823
+ nodeId: B.hover.id ? `${B.hover.boardId}#${B.hover.id}` : void 0
4682
4824
  }),
4683
- !N && z.targets.map((e) => Ee[e.boardId] && /* @__PURE__ */ Z(mi, {
4684
- board: Ee[e.boardId],
4825
+ !M && B.targets.map((e) => ke[e.boardId] && /* @__PURE__ */ Z(xi, {
4826
+ board: ke[e.boardId],
4685
4827
  rect: e.rect,
4686
- view: y,
4828
+ view: x,
4687
4829
  name: e.name,
4688
4830
  selected: !0
4689
4831
  }, `${e.boardId}:${e.id}`)),
4690
- U.selecting && /* @__PURE__ */ Z("div", {
4832
+ W.selecting && /* @__PURE__ */ Z("div", {
4691
4833
  className: "ri-selection-capture",
4692
4834
  "aria-hidden": "true"
4693
4835
  }),
4694
- U.marquee && /* @__PURE__ */ Z("div", {
4836
+ W.marquee && /* @__PURE__ */ Z("div", {
4695
4837
  className: "ri-marquee",
4696
4838
  "aria-hidden": "true",
4697
4839
  style: {
4698
- left: y.x + U.marquee.x * y.k,
4699
- top: y.y + U.marquee.y * y.k,
4700
- width: U.marquee.width * y.k,
4701
- height: U.marquee.height * y.k
4840
+ left: x.x + W.marquee.x * x.k,
4841
+ top: x.y + W.marquee.y * x.k,
4842
+ width: W.marquee.width * x.k,
4843
+ height: W.marquee.height * x.k
4702
4844
  }
4703
4845
  }),
4704
4846
  (!n || !r) && /* @__PURE__ */ Z("div", {
4705
4847
  className: "x10l6tqk x10a8y8t x78zum5 x6s0dn4 xl56j7k xggk2y7 x1bo0w0s xif65rj x2b8uid x47corl",
4706
- children: l ? i[0] ?? B("chrome.waitingCanvas") : B("common.connecting")
4848
+ children: d ? i[0] ?? R("chrome.waitingCanvas") : R("common.connecting")
4707
4849
  }),
4708
4850
  /* @__PURE__ */ Z($n, {
4709
- pages: we,
4710
- page: M,
4711
- onPageChange: se,
4712
- tool: g,
4713
- onToolChange: be,
4714
- commenting: !!m
4851
+ pages: De,
4852
+ page: j,
4853
+ onPageChange: ue,
4854
+ tool: v,
4855
+ onToolChange: Ce,
4856
+ commenting: !!h
4715
4857
  }),
4716
4858
  /* @__PURE__ */ Z(er, {
4717
- actions: h,
4859
+ actions: g,
4718
4860
  live: c,
4719
4861
  warnings: i,
4720
- zoom: y.k,
4721
- onZoomIn: () => C(1.25),
4722
- onZoomOut: () => C(.8),
4723
- onFit: () => S(oe(M)),
4724
- onActualSize: () => w(1),
4725
- inspectorOpen: te,
4726
- onToggleInspector: () => ne((e) => !e),
4862
+ zoom: x.k,
4863
+ onZoomIn: () => T(1.25),
4864
+ onZoomOut: () => T(.8),
4865
+ onFit: () => w(le(j)),
4866
+ onActualSize: () => E(1),
4867
+ inspectorOpen: ie,
4868
+ onToggleInspector: () => ae((e) => !e),
4727
4869
  verify: H.progress,
4728
- onNextVerify: ye
4870
+ onNextVerify: Se
4729
4871
  }),
4730
- !N && Pe(!0),
4731
- N && Ae && Fe && /* @__PURE__ */ Z(En, {
4732
- id: N,
4733
- board: Ae,
4734
- src: `${o}${Ae.file}?v=${s[Ae.file] ?? 0}`,
4735
- interactive: Ae.interactive === !0,
4736
- onClose: () => ce(null),
4737
- frameRef: I.refFor(N, "expanded"),
4738
- onFrameLoad: () => I.loaded(N, "expanded"),
4739
- parameterAction: je[N] === void 0 ? void 0 : /* @__PURE__ */ Z(tt, {
4872
+ !M && Ie(!0),
4873
+ M && U && Le && /* @__PURE__ */ Z(En, {
4874
+ id: M,
4875
+ board: U,
4876
+ src: `${o}${U.file}?v=${s[U.file] ?? 0}`,
4877
+ interactive: U.interactive === !0,
4878
+ onClose: () => pe(null),
4879
+ frameRef: I.refFor(M, "expanded"),
4880
+ onFrameLoad: () => I.loaded(M, "expanded"),
4881
+ parameterAction: Ne[M] === void 0 ? void 0 : /* @__PURE__ */ Z(tt, {
4740
4882
  config: { "aria-hidden": !0 },
4741
4883
  children: /* @__PURE__ */ Z(Ze, {
4742
4884
  icon: Kt,
4743
4885
  size: "small",
4744
4886
  type: "text",
4745
- "aria-expanded": L === N,
4746
- onClick: (e) => ge(N, e.currentTarget),
4747
- children: B("chrome.parameters")
4887
+ "aria-expanded": L === M,
4888
+ onClick: (e) => ve(M, e.currentTarget),
4889
+ children: R("chrome.parameters")
4748
4890
  })
4749
4891
  }),
4750
- parameters: L === N ? Pe(!1) : void 0
4892
+ parameters: L === M ? Ie(!1) : void 0
4751
4893
  })
4752
4894
  ]
4753
4895
  }),
4754
- R && /* @__PURE__ */ Z(bn, {
4896
+ z && /* @__PURE__ */ Z(bn, {
4755
4897
  threads: V.threads,
4756
- page: M,
4898
+ page: j,
4757
4899
  stale: V.stale,
4758
4900
  numbers: V.numbers,
4759
4901
  openId: V.openId,
4760
- tab: ie,
4761
- onTab: ae,
4762
- onOpen: xe,
4763
- onClose: () => be("select")
4902
+ tab: se,
4903
+ onTab: ce,
4904
+ onOpen: we,
4905
+ onClose: () => Ce("select")
4764
4906
  }),
4765
- te && !R && /* @__PURE__ */ Z(Ei, {
4766
- boards: De,
4767
- frames: z.frames,
4768
- selection: z.selection,
4769
- targets: z.targets,
4770
- select: z.select,
4771
- hoverNode: z.hoverNode,
4772
- change: z.change,
4773
- reset: z.reset,
4774
- playing: P,
4775
- enabled: !N,
4776
- onClose: Se
4907
+ ie && !z && /* @__PURE__ */ Z(Ni, {
4908
+ boards: Ae,
4909
+ frames: B.frames,
4910
+ selection: B.selection,
4911
+ targets: B.targets,
4912
+ select: B.select,
4913
+ hoverNode: B.hoverNode,
4914
+ change: B.change,
4915
+ reset: B.reset,
4916
+ playing: N,
4917
+ enabled: !M,
4918
+ onClose: Te
4777
4919
  })
4778
4920
  ]
4779
4921
  });
4780
4922
  }
4781
4923
  //#endregion
4782
4924
  //#region src/viewer/hooks/useHtmlData.ts
4783
- function oa(e, { live: t, revision: n, load: r, send: i }) {
4925
+ function pa(e, { live: t, revision: n, load: r, send: i }) {
4784
4926
  let [a, o] = Y(null);
4785
4927
  return K(() => {
4786
4928
  let t = !1;
@@ -4809,12 +4951,12 @@ function oa(e, { live: t, revision: n, load: r, send: i }) {
4809
4951
  }
4810
4952
  //#endregion
4811
4953
  //#region src/viewer/layouts/HtmlView.tsx
4812
- function sa({ id: e, feed: t, actions: n }) {
4813
- let { data: r, send: i } = oa(e, t);
4954
+ function ma({ id: e, feed: t, actions: n }) {
4955
+ let { data: r, send: i } = pa(e, t);
4814
4956
  K(() => {
4815
4957
  document.title = r?.title || e;
4816
4958
  }, [r?.title, e]), D("html");
4817
- let a = r?.found && !r.warnings.includes("index.html not found"), o = a ? `${r.contentBase}index.html?v=${r.version}` : null, { frameRef: s, src: c, onLoad: l } = U(o, {
4959
+ let a = r?.found && !r.warnings.includes("index.html not found"), o = a ? `${r.contentBase}index.html?v=${r.version}` : null, { frameRef: s, src: c, onLoad: l } = Fe(o, {
4818
4960
  onError: (t) => i({
4819
4961
  type: "runtime-error",
4820
4962
  artifact: `html/${e}`,
@@ -4845,18 +4987,18 @@ function sa({ id: e, feed: t, actions: n }) {
4845
4987
  children: r ? r.warnings[0] ?? "Waiting for the agent to write index.html…" : "Connecting…"
4846
4988
  }),
4847
4989
  n,
4848
- /* @__PURE__ */ Z(ee, { warnings: r?.warnings ?? [] })
4990
+ /* @__PURE__ */ Z(te, { warnings: r?.warnings ?? [] })
4849
4991
  ]
4850
4992
  });
4851
4993
  }
4852
4994
  //#endregion
4853
4995
  //#region src/viewer/components/TypeIcon.tsx
4854
- function ca({ type: e, size: t = 16 }) {
4855
- let { fill: n, stroke: r } = ne[e];
4996
+ function ha({ type: e, size: t = 16 }) {
4997
+ let { fill: n, stroke: r } = re[e];
4856
4998
  return /* @__PURE__ */ Q("svg", {
4857
4999
  width: t,
4858
5000
  height: t,
4859
- viewBox: j,
5001
+ viewBox: ee,
4860
5002
  "aria-hidden": "true",
4861
5003
  style: {
4862
5004
  flex: "none",
@@ -4877,12 +5019,12 @@ function ca({ type: e, size: t = 16 }) {
4877
5019
  }
4878
5020
  //#endregion
4879
5021
  //#region src/viewer/components/ArtifactThumbnail.tsx
4880
- function la({ src: e, type: t }) {
5022
+ function ga({ src: e, type: t }) {
4881
5023
  let [n, r] = Y(null);
4882
5024
  return /* @__PURE__ */ Q("div", {
4883
5025
  className: "library-thumbnail",
4884
5026
  "aria-hidden": "true",
4885
- children: [/* @__PURE__ */ Z(ca, {
5027
+ children: [/* @__PURE__ */ Z(ha, {
4886
5028
  type: t,
4887
5029
  size: 24
4888
5030
  }), e && n !== e && /* @__PURE__ */ Z("img", {
@@ -4899,7 +5041,7 @@ function la({ src: e, type: t }) {
4899
5041
  }
4900
5042
  //#endregion
4901
5043
  //#region src/viewer/components/PublicationStatus.tsx
4902
- var ua = {
5044
+ var _a = {
4903
5045
  summary: {
4904
5046
  k1xSpc: "x3nfvp2",
4905
5047
  kGNEyG: "x6s0dn4",
@@ -4931,8 +5073,8 @@ var ua = {
4931
5073
  $$css: !0
4932
5074
  }
4933
5075
  };
4934
- function da({ publication: e, published: t, publishedAt: n, online: r, onPublish: i, compact: a = !1, busy: o = !1 }) {
4935
- let { t: s, i18n: c } = F(), l = Xt(), u = e?.phase ?? (t ? "published" : "waiting"), d = t && u !== "published", f = I(u), p = s(`publication.${d ? `update_${u}` : u}`), m = f ? Lt : u === "failed" ? wt : u === "published" ? yt : Tt, h = u === "failed" ? ua.failed : u === "published" ? ua.success : void 0, g = /* @__PURE__ */ Z(et, {
5076
+ function va({ publication: e, published: t, publishedAt: n, online: r, onPublish: i, compact: a = !1, busy: o = !1 }) {
5077
+ let { t: s, i18n: c } = N(), l = Xt(), u = e?.phase ?? (t ? "published" : "waiting"), d = t && u !== "published", f = me(u), p = s(`publication.${d ? `update_${u}` : u}`), m = f ? Lt : u === "failed" ? wt : u === "published" ? yt : Tt, h = u === "failed" ? _a.failed : u === "published" ? _a.success : void 0, g = /* @__PURE__ */ Z(et, {
4936
5078
  icon: m,
4937
5079
  spin: f && !l,
4938
5080
  size: a ? 14 : 16,
@@ -4940,13 +5082,13 @@ function da({ publication: e, published: t, publishedAt: n, online: r, onPublish
4940
5082
  });
4941
5083
  if (a) return /* @__PURE__ */ Q("span", {
4942
5084
  role: "status",
4943
- ...O(ua.summary, h),
5085
+ ...O(_a.summary, h),
4944
5086
  children: [g, p]
4945
5087
  });
4946
5088
  let _ = e?.publishedAt ?? n, v = i && !f && u !== "published" && u !== "not-ready";
4947
5089
  return /* @__PURE__ */ Q("section", {
4948
5090
  "aria-label": s("publication.label"),
4949
- ...O(ua.card, h),
5091
+ ...O(_a.card, h),
4950
5092
  children: [
4951
5093
  /* @__PURE__ */ Q("div", {
4952
5094
  role: "status",
@@ -4992,14 +5134,14 @@ function da({ publication: e, published: t, publishedAt: n, online: r, onPublish
4992
5134
  }
4993
5135
  //#endregion
4994
5136
  //#region src/shared/brand.ts
4995
- var fa = "0 0 512 512", pa = "<g transform=\"translate(82 136.317460) scale(0.613756614)\"><g transform=\"translate(0.000000,390.000000) scale(0.100000,-0.100000)\" stroke=\"none\"><path d=\"M4945 3889 c-339 -44 -682 -239 -905 -517 -139 -172 -232 -355 -365 -717 -136 -368 -285 -735 -360 -890 -219 -449 -524 -768 -849 -887 -121 -44 -215 -60 -356 -60 -162 0 -244 18 -450 97 -291 111 -420 144 -650 166 -257 24 -637 -19 -772 -87 -148 -75 -249 -247 -235 -399 19 -197 186 -344 392 -346 40 -1 127 11 205 27 115 23 160 28 300 28 242 1 372 -29 671 -155 226 -95 467 -149 662 -149 252 0 548 74 789 197 394 201 708 521 988 1008 83 144 271 529 405 830 220 493 300 632 436 759 121 112 226 162 424 201 44 9 108 29 143 45 165 77 274 285 244 467 -31 188 -168 334 -354 378 -70 16 -249 18 -363 4z M765 3139 c-202 -11 -415 -48 -497 -86 -91 -44 -151 -101 -193 -186 -123 -248 31 -525 307 -554 38 -4 99 3 204 23 137 27 167 29 384 29 205 0 249 -3 347 -23 225 -45 387 -106 658 -247 182 -94 308 -144 463 -182 138 -35 350 -39 447 -9 174 53 275 152 305 299 26 130 -40 267 -158 323 -52 25 -72 28 -227 35 -248 11 -328 37 -576 187 -232 140 -384 213 -585 281 -283 95 -541 127 -879 110z M620 2104 c-273 -32 -384 -65 -471 -143 -235 -208 -136 -589 172 -660 68 -16 129 -13 272 14 400 73 702 31 1167 -163 239 -99 350 -125 535 -125 193 0 338 51 448 157 117 113 139 261 56 375 -50 69 -99 85 -294 92 -245 10 -332 35 -563 163 -224 123 -456 211 -693 262 -111 23 -149 26 -359 29 -129 2 -251 1 -270 -1z\"/></g></g>";
5137
+ var ya = "0 0 512 512", ba = "<g transform=\"translate(82 136.317460) scale(0.613756614)\"><g transform=\"translate(0.000000,390.000000) scale(0.100000,-0.100000)\" stroke=\"none\"><path d=\"M4945 3889 c-339 -44 -682 -239 -905 -517 -139 -172 -232 -355 -365 -717 -136 -368 -285 -735 -360 -890 -219 -449 -524 -768 -849 -887 -121 -44 -215 -60 -356 -60 -162 0 -244 18 -450 97 -291 111 -420 144 -650 166 -257 24 -637 -19 -772 -87 -148 -75 -249 -247 -235 -399 19 -197 186 -344 392 -346 40 -1 127 11 205 27 115 23 160 28 300 28 242 1 372 -29 671 -155 226 -95 467 -149 662 -149 252 0 548 74 789 197 394 201 708 521 988 1008 83 144 271 529 405 830 220 493 300 632 436 759 121 112 226 162 424 201 44 9 108 29 143 45 165 77 274 285 244 467 -31 188 -168 334 -354 378 -70 16 -249 18 -363 4z M765 3139 c-202 -11 -415 -48 -497 -86 -91 -44 -151 -101 -193 -186 -123 -248 31 -525 307 -554 38 -4 99 3 204 23 137 27 167 29 384 29 205 0 249 -3 347 -23 225 -45 387 -106 658 -247 182 -94 308 -144 463 -182 138 -35 350 -39 447 -9 174 53 275 152 305 299 26 130 -40 267 -158 323 -52 25 -72 28 -227 35 -248 11 -328 37 -576 187 -232 140 -384 213 -585 281 -283 95 -541 127 -879 110z M620 2104 c-273 -32 -384 -65 -471 -143 -235 -208 -136 -589 172 -660 68 -16 129 -13 272 14 400 73 702 31 1167 -163 239 -99 350 -125 535 -125 193 0 338 51 448 157 117 113 139 261 56 375 -50 69 -99 85 -294 92 -245 10 -332 35 -563 163 -224 123 -456 211 -693 262 -111 23 -149 26 -359 29 -129 2 -251 1 -270 -1z\"/></g></g>";
4996
5138
  //#endregion
4997
5139
  //#region src/viewer/components/RyugiMark.tsx
4998
- function ma({ size: e = 16, color: t }) {
5140
+ function xa({ size: e = 16, color: t }) {
4999
5141
  return /* @__PURE__ */ Z("svg", {
5000
5142
  width: e,
5001
5143
  height: e,
5002
- viewBox: fa,
5144
+ viewBox: ya,
5003
5145
  fill: "currentColor",
5004
5146
  "aria-hidden": "true",
5005
5147
  style: {
@@ -5007,40 +5149,40 @@ function ma({ size: e = 16, color: t }) {
5007
5149
  display: "block",
5008
5150
  color: t
5009
5151
  },
5010
- dangerouslySetInnerHTML: { __html: pa }
5152
+ dangerouslySetInnerHTML: { __html: ba }
5011
5153
  });
5012
5154
  }
5013
5155
  //#endregion
5014
5156
  //#region src/viewer/lib/artifact-list.ts
5015
- function ha(e, t = Date.now()) {
5016
- let n = new Intl.RelativeTimeFormat(L.language, { numeric: "always" }), r = Math.floor(Math.max(0, t - e) / 6e4);
5017
- return r === 0 ? L.t("time.justNow") : r < 60 ? n.format(-r, "minute") : r < 1440 ? n.format(-Math.floor(r / 60), "hour") : n.format(-Math.floor(r / 1440), "day");
5157
+ function Sa(e, t = Date.now()) {
5158
+ let n = new Intl.RelativeTimeFormat(F.language, { numeric: "always" }), r = Math.floor(Math.max(0, t - e) / 6e4);
5159
+ return r === 0 ? F.t("time.justNow") : r < 60 ? n.format(-r, "minute") : r < 1440 ? n.format(-Math.floor(r / 60), "hour") : n.format(-Math.floor(r / 1440), "day");
5018
5160
  }
5019
5161
  //#endregion
5020
5162
  //#region src/viewer/lib/error-text.ts
5021
- function ga(e, t) {
5022
- return typeof e == "string" && L.exists(`errors.${e}`) ? L.t(`errors.${e}`) : t;
5163
+ function Ca(e, t) {
5164
+ return typeof e == "string" && F.exists(`errors.${e}`) ? F.t(`errors.${e}`) : t;
5023
5165
  }
5024
- var _a = (e) => typeof e == "object" && !!e && [
5166
+ var wa = (e) => typeof e == "object" && !!e && [
5025
5167
  "private",
5026
5168
  "public",
5027
5169
  "total",
5028
5170
  "publishes"
5029
5171
  ].includes(e.kind) && typeof e.max == "number";
5030
- function va({ kind: e, max: t }) {
5031
- return L.t(`planLimit.${e}`, { max: t });
5172
+ function Ta({ kind: e, max: t }) {
5173
+ return F.t(`planLimit.${e}`, { max: t });
5032
5174
  }
5033
- function ya(e, t) {
5034
- return e.code === "plan_limit" && _a(e.limit) ? va(e.limit) : ga(e.code, typeof e.error == "string" ? e.error : t);
5175
+ function Ea(e, t) {
5176
+ return e.code === "plan_limit" && wa(e.limit) ? Ta(e.limit) : Ca(e.code, typeof e.error == "string" ? e.error : t);
5035
5177
  }
5036
5178
  //#endregion
5037
5179
  //#region src/viewer/lib/version.ts
5038
- var ba = "1.41.0", xa = 100, Sa = 2e3, Ca = 50, wa = (e, t = xa) => typeof e == "string" && e.length > 0 && e.length <= t, Ta = (e) => typeof e == "number" && Number.isFinite(e), Ea = (e) => Ta(e) && e >= 0 && e <= 1;
5039
- function Da(e) {
5040
- if (!Array.isArray(e) || e.length === 0 || e.length > Ca) return null;
5180
+ var Da = "1.42.0", Oa = 100, ka = 2e3, Aa = 50, ja = (e, t = Oa) => typeof e == "string" && e.length > 0 && e.length <= t, Ma = (e) => typeof e == "number" && Number.isFinite(e), Na = (e) => Ma(e) && e >= 0 && e <= 1;
5181
+ function Pa(e) {
5182
+ if (!Array.isArray(e) || e.length === 0 || e.length > Aa) return null;
5041
5183
  let t = [];
5042
5184
  for (let n of e) {
5043
- if (!Se(n) || !wa(n.board) || !wa(n.path, Sa)) return null;
5185
+ if (!Se(n) || !ja(n.board) || !ja(n.path, ka)) return null;
5044
5186
  t.push({
5045
5187
  board: n.board,
5046
5188
  path: n.path
@@ -5048,24 +5190,24 @@ function Da(e) {
5048
5190
  }
5049
5191
  return t;
5050
5192
  }
5051
- function Oa(e) {
5193
+ function Fa(e) {
5052
5194
  if (!Se(e) || Array.isArray(e)) return null;
5053
5195
  let t = Object.entries(e);
5054
- return t.length > Ca || !t.every(([e, t]) => wa(e) && wa(t)) ? null : Object.fromEntries(t);
5196
+ return t.length > Aa || !t.every(([e, t]) => ja(e) && ja(t)) ? null : Object.fromEntries(t);
5055
5197
  }
5056
- function ka(e) {
5057
- if (!Se(e) || !wa(e.page) || !Ta(e.x) || !Ta(e.y)) return null;
5198
+ function Ia(e) {
5199
+ if (!Se(e) || !ja(e.page) || !Ma(e.x) || !Ma(e.y)) return null;
5058
5200
  let t = {
5059
5201
  page: e.page,
5060
5202
  x: e.x,
5061
5203
  y: e.y
5062
5204
  };
5063
5205
  if (e.board !== void 0) {
5064
- if (!wa(e.board)) return null;
5206
+ if (!ja(e.board)) return null;
5065
5207
  t.board = e.board;
5066
5208
  }
5067
5209
  if (e.group !== void 0) {
5068
- if (!wa(e.group)) return null;
5210
+ if (!ja(e.group)) return null;
5069
5211
  t.group = e.group;
5070
5212
  }
5071
5213
  if (e.verdict !== void 0) {
@@ -5073,36 +5215,36 @@ function ka(e) {
5073
5215
  t.verdict = e.verdict;
5074
5216
  }
5075
5217
  if (e.nodes !== void 0) {
5076
- let n = Da(e.nodes);
5218
+ let n = Pa(e.nodes);
5077
5219
  if (!n) return null;
5078
5220
  t.nodes = n;
5079
5221
  }
5080
5222
  if (e.offset !== void 0) {
5081
5223
  let n = e.offset;
5082
- if (!t.nodes || !Se(n) || !Ea(n.x) || !Ea(n.y)) return null;
5224
+ if (!t.nodes || !Se(n) || !Na(n.x) || !Na(n.y)) return null;
5083
5225
  t.offset = {
5084
5226
  x: n.x,
5085
5227
  y: n.y
5086
5228
  };
5087
5229
  }
5088
5230
  if (e.hashes !== void 0) {
5089
- let n = Oa(e.hashes);
5231
+ let n = Fa(e.hashes);
5090
5232
  if (!n) return null;
5091
5233
  t.hashes = n;
5092
5234
  }
5093
5235
  return t;
5094
5236
  }
5095
- var Aa = {
5096
- read: ka,
5237
+ var La = {
5238
+ read: Ia,
5097
5239
  same: (e, t) => e.page === t.page && e.board === t.board && e.group === t.group && e.verdict === t.verdict && e.x === t.x && e.y === t.y,
5098
5240
  missing: "a new thread needs a board anchor (page, x, y); dropped it"
5099
- }, ja = () => ({
5241
+ }, Ra = () => ({
5100
5242
  version: 1,
5101
5243
  threads: []
5102
- }), Ma = (e) => be(e, Aa), Na = (e, t, n, r, i, a) => Me(e, t, n, r, i, a, Aa);
5103
- function Pa(e, t, n, r, i) {
5244
+ }), za = (e) => H(e, La), Ba = (e, t, n, r, i, a) => Me(e, t, n, r, i, a, La);
5245
+ function Va(e, t, n, r, i) {
5104
5246
  if (t.op !== "create") return Te(e, t, n, r, i);
5105
- let a = V(t.anchor, "human", t.text, n, r, i);
5247
+ let a = z(t.anchor, "human", t.text, n, r, i);
5106
5248
  if (t.anchor.verdict !== "pass") return {
5107
5249
  ...e,
5108
5250
  threads: [...e.threads, a]
@@ -5123,10 +5265,10 @@ function Pa(e, t, n, r, i) {
5123
5265
  }]
5124
5266
  };
5125
5267
  }
5126
- function Fa(e, t, n, r, i) {
5268
+ function Ha(e, t, n, r, i) {
5127
5269
  if (t.op === "resolve" && e.threads.find((e) => e.id === t.threadId)?.anchor.verdict === "reject") throw Error("a reject closes only when your human partner passes the group");
5128
5270
  if (t.op === "add") {
5129
- let a = V(t.anchor, "agent", t.text, n, r, { name: i });
5271
+ let a = z(t.anchor, "agent", t.text, n, r, { name: i });
5130
5272
  return {
5131
5273
  file: {
5132
5274
  ...e,
@@ -5136,7 +5278,7 @@ function Fa(e, t, n, r, i) {
5136
5278
  messageId: a.messages[0].id
5137
5279
  };
5138
5280
  }
5139
- return H(e, t, n, r, i);
5281
+ return be(e, t, n, r, i);
5140
5282
  }
5141
5283
  //#endregion
5142
- export { i as ARTIFACT_TYPES, ia as ArtboardView, la as ArtifactThumbnail, n as BOARD_TYPES, u as CanvasErrorBoundary, fe as HTML_LANG, Ee as HTML_SANDBOX, sa as HtmlView, Ie as PHONE_QUERY, o as PreviewView, da as PublicationStatus, Ae as RailSwitch, ma as RyugiMark, ne as TYPE_GLYPHS, j as TYPE_ICON_VIEWBOX, R as Trans, ca as TypeIcon, ba as VIEWER_VERSION, _ as ViewerProvider, we as applyAgentOp, H as applyAgentThreadOp, Fa as applyBoardAgentOp, Pa as applyBoardHumanOp, Ve as applyHumanOp, Te as applyThreadOp, Aa as boardAnchors, ir as boardCommentsFromMessage, rr as boardCommentsFromPayload, y as cloudErrorDetails, ae as createRelayConnection, de as createViewerI18n, ye as documentAnchors, ja as emptyBoardComments, ve as emptyComments, ga as errorText, L as i18n, x as isArtifactId, g as isArtifactType, t as isMediaBoard, Se as isObject, _a as isPlanLimit, z as isVisibility, Na as mergeBoardComments, Me as mergeComments, V as openThread, me as ownLink, Di as pageLink, ge as parseAcceptLanguage, je as parseComments, va as planLimitMessage, _e as publishState, I as publishing, ka as readBoardAnchor, ze as readCloudHeader, P as readPublication, ha as relativeUpdatedAt, Fe as reportCloudHeader, pe as resolveLocale, ya as responseErrorText, Ma as savedBoardComments, be as savedComments, he as syncNote, B as t, k as typeFaviconHref, xe as unreadThreads, sr as useCanvasData, Le as useCloudHeader, Pe as useMedia, Oi as usePageQuery, U as useSandboxFrame, p as useSystemTheme, F as useTranslation, D as useTypeFavicon, Ce as waitingOn };
5284
+ export { i as ARTIFACT_TYPES, da as ArtboardView, ga as ArtifactThumbnail, n as BOARD_TYPES, u as CanvasErrorBoundary, P as HTML_LANG, Ee as HTML_SANDBOX, ma as HtmlView, Ie as PHONE_QUERY, o as PreviewView, va as PublicationStatus, Ae as RailSwitch, xa as RyugiMark, re as TYPE_GLYPHS, ee as TYPE_ICON_VIEWBOX, ve as Trans, ha as TypeIcon, Da as VIEWER_VERSION, _ as ViewerProvider, we as applyAgentOp, be as applyAgentThreadOp, Ha as applyBoardAgentOp, Va as applyBoardHumanOp, Ve as applyHumanOp, Te as applyThreadOp, La as boardAnchors, ir as boardCommentsFromMessage, rr as boardCommentsFromPayload, y as cloudErrorDetails, oe as createRelayConnection, pe as createViewerI18n, V as documentAnchors, Ra as emptyBoardComments, B as emptyComments, Ca as errorText, F as i18n, x as isArtifactId, g as isArtifactType, t as isMediaBoard, Se as isObject, wa as isPlanLimit, ye as isVisibility, Ba as mergeBoardComments, Me as mergeComments, z as openThread, L as ownLink, Pi as pageLink, ge as parseAcceptLanguage, je as parseComments, Ta as planLimitMessage, _e as publishState, me as publishing, Ia as readBoardAnchor, Re as readCloudHeader, M as readPublication, Sa as relativeUpdatedAt, Pe as reportCloudHeader, I as resolveLocale, Ea as responseErrorText, za as savedBoardComments, H as savedComments, he as syncNote, R as t, k as typeFaviconHref, xe as unreadThreads, sr as useCanvasData, Le as useCloudHeader, Ne as useMedia, Fi as usePageQuery, Fe as useSandboxFrame, p as useSystemTheme, N as useTranslation, D as useTypeFavicon, Ce as waitingOn };