@lumencast/runtime 0.9.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/app.d.ts +6 -1
  3. package/dist/app.d.ts.map +1 -1
  4. package/dist/app.js +3 -1
  5. package/dist/app.js.map +1 -1
  6. package/dist/{broadcast-ryjLRD5q.js → broadcast-DtHoU_fS.js} +3 -3
  7. package/dist/{broadcast-ryjLRD5q.js.map → broadcast-DtHoU_fS.js.map} +1 -1
  8. package/dist/{control-AgxbXOVS.js → control-B9frEbNG.js} +4 -4
  9. package/dist/{control-AgxbXOVS.js.map → control-B9frEbNG.js.map} +1 -1
  10. package/dist/index-Dz27r92m.js +1327 -0
  11. package/dist/index-Dz27r92m.js.map +1 -0
  12. package/dist/index.d.ts +3 -0
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.html +1 -1
  15. package/dist/index.js +16 -0
  16. package/dist/index.js.map +1 -1
  17. package/dist/lumencast.js +21 -12
  18. package/dist/mount.d.ts.map +1 -1
  19. package/dist/mount.js +22 -0
  20. package/dist/mount.js.map +1 -1
  21. package/dist/overlay/runtime-context.d.ts +10 -0
  22. package/dist/overlay/runtime-context.d.ts.map +1 -1
  23. package/dist/overlay/runtime-context.js.map +1 -1
  24. package/dist/render/bundle.d.ts +1 -1
  25. package/dist/render/bundle.d.ts.map +1 -1
  26. package/dist/render/bundle.js.map +1 -1
  27. package/dist/render/primitives/capture.d.ts +13 -4
  28. package/dist/render/primitives/capture.d.ts.map +1 -1
  29. package/dist/render/primitives/capture.js +54 -22
  30. package/dist/render/primitives/capture.js.map +1 -1
  31. package/dist/render/primitives/index.d.ts.map +1 -1
  32. package/dist/render/primitives/index.js +10 -0
  33. package/dist/render/primitives/index.js.map +1 -1
  34. package/dist/render/primitives/live-peer-video.d.ts +27 -0
  35. package/dist/render/primitives/live-peer-video.d.ts.map +1 -0
  36. package/dist/render/primitives/live-peer-video.js +64 -0
  37. package/dist/render/primitives/live-peer-video.js.map +1 -0
  38. package/dist/render/primitives/media.d.ts +37 -12
  39. package/dist/render/primitives/media.d.ts.map +1 -1
  40. package/dist/render/primitives/media.js +43 -17
  41. package/dist/render/primitives/media.js.map +1 -1
  42. package/dist/render/primitives/meet-peer-slot.d.ts +29 -0
  43. package/dist/render/primitives/meet-peer-slot.d.ts.map +1 -0
  44. package/dist/render/primitives/meet-peer-slot.js +46 -0
  45. package/dist/render/primitives/meet-peer-slot.js.map +1 -0
  46. package/dist/render/primitives/meet-peer.d.ts +31 -0
  47. package/dist/render/primitives/meet-peer.d.ts.map +1 -0
  48. package/dist/render/primitives/meet-peer.js +46 -0
  49. package/dist/render/primitives/meet-peer.js.map +1 -0
  50. package/dist/render/prop-allowlist.d.ts.map +1 -1
  51. package/dist/render/prop-allowlist.js +27 -1
  52. package/dist/render/prop-allowlist.js.map +1 -1
  53. package/dist/render/tree.js +42 -8
  54. package/dist/render/tree.js.map +1 -1
  55. package/dist/state/reserved-leaves.d.ts +37 -0
  56. package/dist/state/reserved-leaves.d.ts.map +1 -0
  57. package/dist/state/reserved-leaves.js +96 -0
  58. package/dist/state/reserved-leaves.js.map +1 -0
  59. package/dist/{status-pill-BxCdj-KZ.js → status-pill-B2vBTwRC.js} +2 -2
  60. package/dist/{status-pill-BxCdj-KZ.js.map → status-pill-B2vBTwRC.js.map} +1 -1
  61. package/dist/{test-CaRHj_J6.js → test-DD2SBDku.js} +4 -4
  62. package/dist/{test-CaRHj_J6.js.map → test-DD2SBDku.js.map} +1 -1
  63. package/dist/{tree-BLIxJbD3.js → tree-CgU_sUwI.js} +581 -479
  64. package/dist/tree-CgU_sUwI.js.map +1 -0
  65. package/dist/types.d.ts +25 -0
  66. package/dist/types.d.ts.map +1 -1
  67. package/dist/webrtc/index.d.ts +76 -0
  68. package/dist/webrtc/index.d.ts.map +1 -0
  69. package/dist/webrtc/index.js +180 -0
  70. package/dist/webrtc/index.js.map +1 -0
  71. package/dist/webrtc/meet-viewer.d.ts +139 -0
  72. package/dist/webrtc/meet-viewer.d.ts.map +1 -0
  73. package/dist/webrtc/meet-viewer.js +379 -0
  74. package/dist/webrtc/meet-viewer.js.map +1 -0
  75. package/dist/webrtc/peer-stream-registry.d.ts +21 -0
  76. package/dist/webrtc/peer-stream-registry.d.ts.map +1 -0
  77. package/dist/webrtc/peer-stream-registry.js +77 -0
  78. package/dist/webrtc/peer-stream-registry.js.map +1 -0
  79. package/package.json +4 -4
  80. package/src/app.tsx +9 -0
  81. package/src/index.ts +47 -0
  82. package/src/mount.ts +23 -0
  83. package/src/overlay/runtime-context.tsx +10 -0
  84. package/src/render/bundle.ts +11 -1
  85. package/src/render/primitives/capture.tsx +73 -28
  86. package/src/render/primitives/index.ts +10 -0
  87. package/src/render/primitives/live-peer-video.tsx +90 -0
  88. package/src/render/primitives/media.tsx +66 -17
  89. package/src/render/primitives/meet-peer-slot.tsx +55 -0
  90. package/src/render/primitives/meet-peer.tsx +57 -0
  91. package/src/render/prop-allowlist.ts +27 -1
  92. package/src/render/tree.tsx +44 -8
  93. package/src/state/reserved-leaves.ts +121 -0
  94. package/src/types.ts +25 -0
  95. package/src/webrtc/index.ts +252 -0
  96. package/src/webrtc/meet-viewer.ts +497 -0
  97. package/src/webrtc/peer-stream-registry.ts +93 -0
  98. package/dist/index-DrXsLYhe.js +0 -903
  99. package/dist/index-DrXsLYhe.js.map +0 -1
  100. package/dist/tree-BLIxJbD3.js.map +0 -1
@@ -1,28 +1,28 @@
1
- import { jsx as f, jsxs as G, Fragment as J } from "react/jsx-runtime";
2
- import { useSignals as vt } from "@preact/signals-react/runtime";
3
- import { motion as I, useMotionValue as B, useTransform as ye, animate as _t } from "framer-motion";
4
- import { createContext as st, useContext as U, useRef as it, useState as Ut, useEffect as ot, useMemo as Kt } from "react";
5
- import { e as S, r as at, m as lt, t as Q, a as be, s as ke, w as Vt, F as we, c as jt, b as Zt } from "./index-DrXsLYhe.js";
6
- import { checkHostAllowed as Jt } from "@lumencast/protocol";
1
+ import { jsx as f, jsxs as I, Fragment as Q } from "react/jsx-runtime";
2
+ import { useSignals as xt } from "@preact/signals-react/runtime";
3
+ import { motion as U, useMotionValue as L, useTransform as be, animate as _t } from "framer-motion";
4
+ import { createContext as st, useContext as K, useRef as tt, useState as vt, useEffect as Y, useMemo as Kt } from "react";
5
+ import { e as S, r as at, m as lt, t as et, a as Vt, s as ke, w as Zt, F as we, c as Tt, b as Jt } from "./index-Dz27r92m.js";
6
+ import { checkHostAllowed as Qt } from "@lumencast/protocol";
7
7
  import { effect as xe } from "@preact/signals-react";
8
8
  function ve({ resolved: t, children: e, establishesContainingBlock: n }) {
9
- const i = t.direction ?? "vertical", r = Tt(t.gap, 0), s = t.wrap === !0, o = Tt(t.crossGap, 0), a = t.align ?? "stretch", l = t.justify ?? "flex-start", c = i === "horizontal", u = {
9
+ const i = t.direction ?? "vertical", r = Ct(t.gap, 0), a = t.wrap === !0, o = Ct(t.crossGap, 0), s = t.align ?? "stretch", l = t.justify ?? "flex-start", c = i === "horizontal", u = {
10
10
  display: "flex",
11
11
  flexDirection: c ? "row" : "column",
12
- alignItems: a,
12
+ alignItems: s,
13
13
  justifyContent: l,
14
14
  // ADR 002 §3.1 (D1) — establish a containing block when a child is
15
15
  // absolutely placed, so its `left/top` resolve against this stack.
16
16
  // Untouched for pure auto-layout stacks (RC#2).
17
17
  ...n ? { position: "relative" } : {}
18
18
  };
19
- return s ? (u.flexWrap = "wrap", c ? (u.columnGap = r, u.rowGap = o) : (u.rowGap = r, u.columnGap = o)) : u.gap = r, /* @__PURE__ */ f("div", { style: u, children: e });
19
+ return a ? (u.flexWrap = "wrap", c ? (u.columnGap = r, u.rowGap = o) : (u.rowGap = r, u.columnGap = o)) : u.gap = r, /* @__PURE__ */ f("div", { style: u, children: e });
20
20
  }
21
- function Tt(t, e) {
21
+ function Ct(t, e) {
22
22
  return typeof t == "number" && Number.isFinite(t) ? t : e;
23
23
  }
24
24
  function $e({ resolved: t, children: e, establishesContainingBlock: n }) {
25
- const i = t.cols ?? "1fr", r = t.rows ?? "auto", s = t.gap ?? 0;
25
+ const i = t.cols ?? "1fr", r = t.rows ?? "auto", a = t.gap ?? 0;
26
26
  return /* @__PURE__ */ f(
27
27
  "div",
28
28
  {
@@ -30,7 +30,7 @@ function $e({ resolved: t, children: e, establishesContainingBlock: n }) {
30
30
  display: "grid",
31
31
  gridTemplateColumns: i,
32
32
  gridTemplateRows: r,
33
- gap: s,
33
+ gap: a,
34
34
  // ADR 002 §3.1 (D1) — establish a containing block for absolutely
35
35
  // placed children ; untouched for pure auto-layout grids (RC#2).
36
36
  ...n ? { position: "relative" } : {}
@@ -39,14 +39,14 @@ function $e({ resolved: t, children: e, establishesContainingBlock: n }) {
39
39
  }
40
40
  );
41
41
  }
42
- const Se = 64, Me = /^[#a-zA-Z0-9(),.% ]{1,64}$/, Ae = /^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/, W = String.raw`\d{1,3}(?:\.\d{1,4})?`, Qt = String.raw`(?:0|1|0?\.\d{1,4}|${W}%)`, _ = String.raw`[ ]{0,4}`, Fe = new RegExp(
43
- `^rgba?\\(${_}(${W})(%?)${_},${_}(${W})(%?)${_},${_}(${W})(%?)${_}(?:,${_}${Qt}${_})?\\)$`
42
+ const Se = 64, Me = /^[#a-zA-Z0-9(),.% ]{1,64}$/, Ae = /^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/, q = String.raw`\d{1,3}(?:\.\d{1,4})?`, te = String.raw`(?:0|1|0?\.\d{1,4}|${q}%)`, j = String.raw`[ ]{0,4}`, Fe = new RegExp(
43
+ `^rgba?\\(${j}(${q})(%?)${j},${j}(${q})(%?)${j},${j}(${q})(%?)${j}(?:,${j}${te}${j})?\\)$`
44
44
  ), Re = new RegExp(
45
- `^hsla?\\(${_}(${W})(?:deg)?${_},${_}(${W})%${_},${_}(${W})%${_}(?:,${_}${Qt}${_})?\\)$`
46
- ), _e = new Set(
45
+ `^hsla?\\(${j}(${q})(?:deg)?${j},${j}(${q})%${j},${j}(${q})%${j}(?:,${j}${te}${j})?\\)$`
46
+ ), je = new Set(
47
47
  "aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond blue blueviolet brown burlywood cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkcyan darkgoldenrod darkgray darkgreen darkgrey darkkhaki darkmagenta darkolivegreen darkorange darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkslategrey darkturquoise darkviolet deeppink deepskyblue dimgray dimgrey dodgerblue firebrick floralwhite forestgreen fuchsia gainsboro ghostwhite gold goldenrod gray green greenyellow grey honeydew hotpink indianred indigo ivory khaki lavender lavenderblush lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightgrey lightpink lightsalmon lightseagreen lightskyblue lightslategray lightslategrey lightsteelblue lightyellow lime limegreen linen magenta maroon mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue mintcream mistyrose moccasin navajowhite navy oldlace olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise palevioletred papayawhip peachpuff peru pink plum powderblue purple rebeccapurple red rosybrown royalblue saddlebrown salmon sandybrown seagreen seashell sienna silver skyblue slateblue slategray slategrey snow springgreen steelblue tan teal thistle tomato turquoise violet wheat white whitesmoke yellow yellowgreen transparent currentcolor".split(" ")
48
48
  );
49
- function E(t) {
49
+ function D(t) {
50
50
  if (typeof t != "string") return null;
51
51
  const e = t.trim();
52
52
  if (e.length === 0 || e.length > Se) return null;
@@ -58,35 +58,35 @@ function E(t) {
58
58
  if (!i) return null;
59
59
  const r = [i[2], i[4], i[6]];
60
60
  if (!(r.every((o) => o === "%") || r.every((o) => o === ""))) return null;
61
- const s = r[0] === "%" ? 100 : 255;
61
+ const a = r[0] === "%" ? 100 : 255;
62
62
  for (const o of [i[1], i[3], i[5]])
63
- if (Number(o) > s) return null;
63
+ if (Number(o) > a) return null;
64
64
  return n;
65
65
  }
66
66
  if (n.startsWith("hsl")) {
67
67
  const i = Re.exec(n);
68
68
  return !i || Number(i[1]) > 360 || Number(i[2]) > 100 || Number(i[3]) > 100 ? null : n;
69
69
  }
70
- return _e.has(n) ? n : null;
70
+ return je.has(n) ? n : null;
71
71
  }
72
- function D(t, e) {
72
+ function B(t, e) {
73
73
  S(
74
74
  e,
75
75
  t,
76
76
  "rejected unsafe colour : not a strict hex/rgb()/hsl()/named colour"
77
77
  );
78
78
  }
79
- const te = st(void 0);
80
- function ur({
79
+ const ee = st(void 0);
80
+ function hr({
81
81
  hosts: t,
82
82
  children: e
83
83
  }) {
84
- return /* @__PURE__ */ f(te.Provider, { value: t, children: e });
84
+ return /* @__PURE__ */ f(ee.Provider, { value: t, children: e });
85
85
  }
86
- function tt() {
87
- return U(te);
86
+ function nt() {
87
+ return K(ee);
88
88
  }
89
- function fr(t) {
89
+ function gr(t) {
90
90
  const n = t.assets?.allowedHosts;
91
91
  if (!Array.isArray(n)) return;
92
92
  const i = n.filter((r) => typeof r == "string");
@@ -94,11 +94,11 @@ function fr(t) {
94
94
  }
95
95
  function $t(t, e, n, i) {
96
96
  if (typeof t != "string" || t.length === 0) return;
97
- const r = Jt(t, e);
97
+ const r = Qt(t, e);
98
98
  if (r.allowed) return t;
99
99
  S(i, n, r.reason ?? "asset host/scheme rejected");
100
100
  }
101
- const je = /* @__PURE__ */ new Set([
101
+ const _e = /* @__PURE__ */ new Set([
102
102
  "normal",
103
103
  "multiply",
104
104
  "screen",
@@ -118,46 +118,46 @@ const je = /* @__PURE__ */ new Set([
118
118
  // Figma LINEAR_DODGE (add) — exact additive blend, gentler than color-dodge.
119
119
  "plus-lighter"
120
120
  ]);
121
- function Y(t) {
122
- return typeof t == "string" && je.has(t) ? t : void 0;
121
+ function X(t) {
122
+ return typeof t == "string" && _e.has(t) ? t : void 0;
123
123
  }
124
124
  const Te = /* @__PURE__ */ new Set(["cover", "contain", "fill", "none", "scale-down"]);
125
125
  function Ce(t) {
126
126
  return typeof t == "string" && Te.has(t) ? t : void 0;
127
127
  }
128
128
  let ft = 0;
129
- function Ct() {
129
+ function Ot() {
130
130
  return ft = (ft + 1) % 1e6, `lumen-grad-${ft.toString(36)}`;
131
131
  }
132
132
  function Oe(t) {
133
- const e = Y(t.blendMode);
133
+ const e = X(t.blendMode);
134
134
  if (t.kind === "solid") {
135
- const a = t.opacity !== void 0 ? kt(t.color, t.opacity) : t.color;
136
- return { defs: [], ref: a, mixBlendMode: e };
135
+ const s = t.opacity !== void 0 ? bt(t.color, t.opacity) : t.color;
136
+ return { defs: [], ref: s, mixBlendMode: e };
137
137
  }
138
138
  if (t.kind === "image") {
139
- const a = Ct(), l = Pe(t.objectFit);
139
+ const s = Ot(), l = Ne(t.objectFit);
140
140
  return { defs: [
141
- /* @__PURE__ */ f("pattern", { id: a, patternContentUnits: "objectBoundingBox", width: "1", height: "1", children: /* @__PURE__ */ f("image", { href: t.src, width: "1", height: "1", preserveAspectRatio: l }) }, a)
142
- ], ref: `url(#${a})`, mixBlendMode: e };
141
+ /* @__PURE__ */ f("pattern", { id: s, patternContentUnits: "objectBoundingBox", width: "1", height: "1", children: /* @__PURE__ */ f("image", { href: t.src, width: "1", height: "1", preserveAspectRatio: l }) }, s)
142
+ ], ref: `url(#${s})`, mixBlendMode: e };
143
143
  }
144
- const n = Ct();
144
+ const n = Ot();
145
145
  if (t.kind === "linear-gradient") {
146
- let a, l, c, u;
146
+ let s, l, c, u;
147
147
  const d = t.transform;
148
148
  if (Array.isArray(d) && d.length === 6 && Number.isFinite(d[0]) && Number.isFinite(d[1])) {
149
149
  const g = Math.hypot(d[0], d[1]) || 1, m = d[0] / g, A = d[1] / g;
150
- a = 0.5 - 0.5 * m, l = 0.5 - 0.5 * A, c = 0.5 + 0.5 * m, u = 0.5 + 0.5 * A;
150
+ s = 0.5 - 0.5 * m, l = 0.5 - 0.5 * A, c = 0.5 + 0.5 * m, u = 0.5 + 0.5 * A;
151
151
  } else {
152
152
  const m = ((t.angle_deg ?? 0) - 90) * Math.PI / 180;
153
- a = 0.5 - 0.5 * Math.cos(m), l = 0.5 - 0.5 * Math.sin(m), c = 0.5 + 0.5 * Math.cos(m), u = 0.5 + 0.5 * Math.sin(m);
153
+ s = 0.5 - 0.5 * Math.cos(m), l = 0.5 - 0.5 * Math.sin(m), c = 0.5 + 0.5 * Math.cos(m), u = 0.5 + 0.5 * Math.sin(m);
154
154
  }
155
155
  return { defs: [
156
156
  /* @__PURE__ */ f(
157
157
  "linearGradient",
158
158
  {
159
159
  id: n,
160
- x1: `${a * 100}%`,
160
+ x1: `${s * 100}%`,
161
161
  y1: `${l * 100}%`,
162
162
  x2: `${c * 100}%`,
163
163
  y2: `${u * 100}%`,
@@ -175,20 +175,20 @@ function Oe(t) {
175
175
  )
176
176
  ], ref: `url(#${n})`, mixBlendMode: e };
177
177
  }
178
- const i = t.center?.x ?? 0.5, r = t.center?.y ?? 0.5, s = t.radius ?? 0.5;
178
+ const i = t.center?.x ?? 0.5, r = t.center?.y ?? 0.5, a = t.radius ?? 0.5;
179
179
  return { defs: [
180
- /* @__PURE__ */ f("radialGradient", { id: n, cx: `${i * 100}%`, cy: `${r * 100}%`, r: `${s * 100}%`, children: t.stops.map((a, l) => /* @__PURE__ */ f(
180
+ /* @__PURE__ */ f("radialGradient", { id: n, cx: `${i * 100}%`, cy: `${r * 100}%`, r: `${a * 100}%`, children: t.stops.map((s, l) => /* @__PURE__ */ f(
181
181
  "stop",
182
182
  {
183
- offset: a.offset,
184
- stopColor: a.color,
185
- ...a.opacity !== void 0 ? { stopOpacity: a.opacity } : {}
183
+ offset: s.offset,
184
+ stopColor: s.color,
185
+ ...s.opacity !== void 0 ? { stopOpacity: s.opacity } : {}
186
186
  },
187
187
  l
188
188
  )) }, n)
189
189
  ], ref: `url(#${n})`, mixBlendMode: e };
190
190
  }
191
- function Ne(t) {
191
+ function Pe(t) {
192
192
  switch (t) {
193
193
  case "contain":
194
194
  case "scale-down":
@@ -202,7 +202,7 @@ function Ne(t) {
202
202
  return "cover";
203
203
  }
204
204
  }
205
- function Pe(t) {
205
+ function Ne(t) {
206
206
  switch (t) {
207
207
  case "contain":
208
208
  case "scale-down":
@@ -218,15 +218,15 @@ function Pe(t) {
218
218
  }
219
219
  function Ee(t, e) {
220
220
  const n = [], i = [];
221
- for (const a of t) {
222
- const l = Be(a, e);
223
- l && (i.push(l), n.push(a));
221
+ for (const s of t) {
222
+ const l = Be(s, e);
223
+ l && (i.push(l), n.push(s));
224
224
  }
225
225
  if (i.length === 0) return {};
226
- const r = { backgroundImage: i.join(", ") }, s = n.map((a) => Y(a.blendMode) ?? "normal");
227
- s.some((a) => a !== "normal") && (r.backgroundBlendMode = s.join(", "));
228
- const o = t.find((a) => a.kind === "image");
229
- return o && (r.backgroundSize = Ne(o.objectFit), r.backgroundPosition = "center", r.backgroundRepeat = "no-repeat"), r;
226
+ const r = { backgroundImage: i.join(", ") }, a = n.map((s) => X(s.blendMode) ?? "normal");
227
+ a.some((s) => s !== "normal") && (r.backgroundBlendMode = a.join(", "));
228
+ const o = t.find((s) => s.kind === "image");
229
+ return o && (r.backgroundSize = Pe(o.objectFit), r.backgroundPosition = "center", r.backgroundRepeat = "no-repeat"), r;
230
230
  }
231
231
  function De(t) {
232
232
  return `url("${t.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}")`;
@@ -235,30 +235,30 @@ function Be(t, e) {
235
235
  if (t.kind === "image")
236
236
  return De(t.src);
237
237
  if (t.kind === "solid") {
238
- const o = E(t.color);
238
+ const o = D(t.color);
239
239
  if (o === null)
240
- return D("fill.color", e), null;
241
- const a = t.opacity !== void 0 ? kt(o, t.opacity) : o;
242
- return `linear-gradient(${a}, ${a})`;
240
+ return B("fill.color", e), null;
241
+ const s = t.opacity !== void 0 ? bt(o, t.opacity) : o;
242
+ return `linear-gradient(${s}, ${s})`;
243
243
  }
244
244
  const n = [];
245
245
  for (const o of t.stops) {
246
- const a = E(o.color);
247
- if (a === null)
248
- return D("fill.stops.color", e), null;
249
- const l = o.opacity !== void 0 ? kt(a, o.opacity) : a;
246
+ const s = D(o.color);
247
+ if (s === null)
248
+ return B("fill.stops.color", e), null;
249
+ const l = o.opacity !== void 0 ? bt(s, o.opacity) : s;
250
250
  n.push(`${l} ${(o.offset * 100).toFixed(2)}%`);
251
251
  }
252
252
  const i = n.join(", ");
253
253
  if (t.kind === "linear-gradient") {
254
254
  let o = t.angle_deg ?? 0;
255
- const a = t.transform;
256
- return Array.isArray(a) && a.length === 6 && Number.isFinite(a[0]) && Number.isFinite(a[1]) && (o = (Math.atan2(a[0], -a[1]) * 180 / Math.PI + 360) % 360), `linear-gradient(${o}deg, ${i})`;
255
+ const s = t.transform;
256
+ return Array.isArray(s) && s.length === 6 && Number.isFinite(s[0]) && Number.isFinite(s[1]) && (o = (Math.atan2(s[0], -s[1]) * 180 / Math.PI + 360) % 360), `linear-gradient(${o}deg, ${i})`;
257
257
  }
258
- const r = (t.center?.x ?? 0.5) * 100, s = (t.center?.y ?? 0.5) * 100;
259
- return `radial-gradient(circle at ${r}% ${s}%, ${i})`;
258
+ const r = (t.center?.x ?? 0.5) * 100, a = (t.center?.y ?? 0.5) * 100;
259
+ return `radial-gradient(circle at ${r}% ${a}%, ${i})`;
260
260
  }
261
- function kt(t, e) {
261
+ function bt(t, e) {
262
262
  const n = t.match(/^#([0-9a-f]{6})$/i);
263
263
  if (n) {
264
264
  const i = Math.round(e * 255).toString(16).padStart(2, "0");
@@ -274,68 +274,68 @@ function Le(t, e, n) {
274
274
  continue;
275
275
  }
276
276
  if (r.kind === "solid") {
277
- const a = E(r.color);
278
- if (a === null) {
279
- D(`${e}.color`, n);
277
+ const s = D(r.color);
278
+ if (s === null) {
279
+ B(`${e}.color`, n);
280
280
  continue;
281
281
  }
282
- i.push({ ...r, color: a });
282
+ i.push({ ...r, color: s });
283
283
  continue;
284
284
  }
285
- const s = [];
285
+ const a = [];
286
286
  let o = !1;
287
- for (const a of r.stops ?? []) {
288
- const l = E(a.color);
287
+ for (const s of r.stops ?? []) {
288
+ const l = D(s.color);
289
289
  if (l === null) {
290
- D(`${e}.stops.color`, n), o = !0;
290
+ B(`${e}.stops.color`, n), o = !0;
291
291
  break;
292
292
  }
293
- s.push({ ...a, color: l });
293
+ a.push({ ...s, color: l });
294
294
  }
295
- o || i.push({ ...r, stops: s });
295
+ o || i.push({ ...r, stops: a });
296
296
  }
297
297
  return i;
298
298
  }
299
- function ee(t, e, n) {
299
+ function ne(t, e, n) {
300
300
  if (!Array.isArray(t)) return [];
301
301
  if (e !== void 0)
302
302
  for (const i of t)
303
- Ot(i) || S(
303
+ Pt(i) || S(
304
304
  n,
305
305
  `${e}.kind`,
306
306
  "fill kind is not renderable by this runtime ; layer dropped (angular/diamond gradients land with LSML 1.2)"
307
307
  );
308
- return t.filter(Ot).map((i) => {
308
+ return t.filter(Pt).map((i) => {
309
309
  let r = i;
310
- if (r.blendMode !== void 0 && Y(r.blendMode) === void 0) {
310
+ if (r.blendMode !== void 0 && X(r.blendMode) === void 0) {
311
311
  S(
312
312
  n,
313
313
  e !== void 0 ? `${e}.blendMode` : "fill.blendMode",
314
314
  "is not a recognised mix-blend-mode ; falling back to normal (ADR 002 §3.2)"
315
315
  );
316
- const { blendMode: o, ...a } = r;
317
- r = a;
316
+ const { blendMode: o, ...s } = r;
317
+ r = s;
318
318
  }
319
319
  if (r.kind !== "image" || r.objectFit === void 0) return r;
320
- const s = Ce(r.objectFit);
321
- if (s === void 0) {
320
+ const a = Ce(r.objectFit);
321
+ if (a === void 0) {
322
322
  S(
323
323
  n,
324
324
  e !== void 0 ? `${e}.objectFit` : "fill.objectFit",
325
325
  "is not a recognised object-fit ; falling back to default (ADR 002 §3.2)"
326
326
  );
327
- const { objectFit: o, ...a } = r;
328
- return a;
327
+ const { objectFit: o, ...s } = r;
328
+ return s;
329
329
  }
330
- return { ...r, objectFit: s };
330
+ return { ...r, objectFit: a };
331
331
  });
332
332
  }
333
- function Ot(t) {
333
+ function Pt(t) {
334
334
  if (typeof t != "object" || t === null) return !1;
335
335
  const e = t.kind;
336
336
  return e === "solid" || e === "linear-gradient" || e === "radial-gradient" ? !0 : e === "image" && typeof t.src == "string";
337
337
  }
338
- function ne(t, e, n, i) {
338
+ function re(t, e, n, i) {
339
339
  return t.filter((r) => r.kind !== "image" ? !0 : $t(r.src, e, `${n}.src`, i) !== void 0);
340
340
  }
341
341
  function ze({
@@ -345,10 +345,10 @@ function ze({
345
345
  animateInitial: i,
346
346
  children: r
347
347
  }) {
348
- const s = C(t.x, 0), o = C(t.y, 0), a = Nt(t.width), l = Nt(t.height), c = C(t.opacity, 1), u = C(t.scale, 1), d = C(t.rotate, C(t.rotation, 0)), h = t.flipY === !0, g = C(t.radius, 0), m = t.background, A = m === void 0 ? void 0 : E(m);
349
- m !== void 0 && A === null && D("frame.background", e);
350
- const x = tt(), F = ne(
351
- ee(t.backgrounds, "frame.backgrounds", e),
348
+ const a = O(t.x, 0), o = O(t.y, 0), s = Nt(t.width), l = Nt(t.height), c = O(t.opacity, 1), u = O(t.scale, 1), d = O(t.rotate, O(t.rotation, 0)), h = t.flipY === !0, g = O(t.radius, 0), m = t.background, A = m === void 0 ? void 0 : D(m);
349
+ m !== void 0 && A === null && B("frame.background", e);
350
+ const x = nt(), F = re(
351
+ ne(t.backgrounds, "frame.backgrounds", e),
352
352
  x,
353
353
  "frame.backgrounds",
354
354
  e
@@ -360,7 +360,7 @@ function ze({
360
360
  position: "absolute",
361
361
  left: 0,
362
362
  top: 0,
363
- width: a,
363
+ width: s,
364
364
  height: l,
365
365
  // NB: NO permanent `will-change`. `will-change: opacity` makes the frame an
366
366
  // isolated group (the browser pre-promotes it as if opacity < 1), which
@@ -379,17 +379,17 @@ function ze({
379
379
  const { filter: w, boxShadow: v } = We(t.shadow, e);
380
380
  v !== void 0 && (p.boxShadow = v), w !== void 0 && (p.filter = w);
381
381
  const $ = lt(
382
- { opacity: c, x: s, y: o, scale: u, rotate: d, ...h ? { scaleY: -1 } : {} },
382
+ { opacity: c, x: a, y: o, scale: u, rotate: d, ...h ? { scaleY: -1 } : {} },
383
383
  i,
384
384
  e
385
385
  );
386
386
  return /* @__PURE__ */ f(
387
- I.div,
387
+ U.div,
388
388
  {
389
389
  style: p,
390
390
  initial: $.initial,
391
391
  animate: $.animate,
392
- transition: Q(y),
392
+ transition: et(y),
393
393
  children: r
394
394
  }
395
395
  );
@@ -397,25 +397,25 @@ function ze({
397
397
  function He(t, e) {
398
398
  return t === void 0 ? !0 : typeof t == "boolean" ? t : (S(e, "frame.clipsContent", "rejected value : not a boolean"), !0);
399
399
  }
400
- function C(t, e) {
400
+ function O(t, e) {
401
401
  return typeof t == "number" && Number.isFinite(t) ? t : e;
402
402
  }
403
403
  function We(t, e) {
404
404
  if (!Array.isArray(t) || t.length === 0) return {};
405
405
  const n = [], i = [];
406
- for (const s of t) {
407
- if (typeof s != "object" || s === null) continue;
408
- const o = s, a = typeof o.color == "string" ? E(o.color) : null;
409
- if (a === null) {
410
- D("frame.shadow.color", e);
406
+ for (const a of t) {
407
+ if (typeof a != "object" || a === null) continue;
408
+ const o = a, s = typeof o.color == "string" ? D(o.color) : null;
409
+ if (s === null) {
410
+ B("frame.shadow.color", e);
411
411
  continue;
412
412
  }
413
- const l = C(o.x, 0), c = C(o.y, 0), u = C(o.blur, 0), d = C(o.spread, 0), h = o.inset === !0;
413
+ const l = O(o.x, 0), c = O(o.y, 0), u = O(o.blur, 0), d = O(o.spread, 0), h = o.inset === !0;
414
414
  if (!h && d === 0)
415
- n.push(`drop-shadow(${l}px ${c}px ${u / 2}px ${a})`);
415
+ n.push(`drop-shadow(${l}px ${c}px ${u / 2}px ${s})`);
416
416
  else {
417
417
  const g = h ? "inset " : "";
418
- i.push(`${g}${l}px ${c}px ${u}px ${d}px ${a}`);
418
+ i.push(`${g}${l}px ${c}px ${u}px ${d}px ${s}`);
419
419
  }
420
420
  }
421
421
  const r = {};
@@ -424,34 +424,34 @@ function We(t, e) {
424
424
  function Nt(t) {
425
425
  if (typeof t == "number" && Number.isFinite(t) || typeof t == "string" && t.length > 0) return t;
426
426
  }
427
- const qe = /* @__PURE__ */ new Set(["none", "uppercase", "lowercase", "capitalize"]), Ge = /* @__PURE__ */ new Set(["none", "underline", "line-through"]), Ye = /* @__PURE__ */ new Set(["normal", "italic", "oblique"]), Xe = 1e3, Ie = 100, Pt = 1e3, Ue = /^[a-zA-Z0-9 ,.'"_-]{1,256}$/;
427
+ const qe = /* @__PURE__ */ new Set(["none", "uppercase", "lowercase", "capitalize"]), Ge = /* @__PURE__ */ new Set(["none", "underline", "line-through"]), Ie = /* @__PURE__ */ new Set(["normal", "italic", "oblique"]), Ye = 1e3, Xe = 100, Et = 1e3, Ue = /^[a-zA-Z0-9 ,.'"_-]{1,256}$/;
428
428
  function Ke(t) {
429
429
  if (typeof t != "string") return null;
430
430
  const e = t.trim();
431
431
  return e.length === 0 ? null : Ue.test(e) ? e : null;
432
432
  }
433
433
  function Ve({ resolved: t, nodeId: e, transitionFor: n, animateInitial: i }) {
434
- const r = t.value === void 0 ? "" : String(t.value), s = t.size ?? "1rem", o = t.weight ?? 400;
435
- let a;
434
+ const r = t.value === void 0 ? "" : String(t.value), a = t.size ?? "1rem", o = t.weight ?? 400;
435
+ let s;
436
436
  if (t.font !== void 0) {
437
437
  const m = Ke(t.font);
438
- m === null ? S(e, "text.font", "rejected fontFamily : outside the family-list grammar") : a = m;
438
+ m === null ? S(e, "text.font", "rejected fontFamily : outside the family-list grammar") : s = m;
439
439
  }
440
440
  let l = "currentColor";
441
441
  if (t.colour !== void 0) {
442
- const m = E(t.colour);
443
- m === null ? D("text.colour", e) : l = m;
442
+ const m = D(t.colour);
443
+ m === null ? B("text.colour", e) : l = m;
444
444
  }
445
445
  const c = t.align ?? "start", u = Ze(t.opacity, 1), d = Je(t, e), h = at(n, ["opacity", "value"], i), g = lt({ opacity: u }, i, e);
446
446
  return /* @__PURE__ */ f(
447
- I.span,
447
+ U.span,
448
448
  {
449
449
  style: {
450
450
  display: "inline-block",
451
- fontSize: s,
451
+ fontSize: a,
452
452
  // `font` carries LSML text.style.fontFamily (spec'd in schema.json).
453
453
  // Omitted => inherit the host/container font.
454
- ...a !== void 0 ? { fontFamily: a } : {},
454
+ ...s !== void 0 ? { fontFamily: s } : {},
455
455
  fontWeight: o,
456
456
  color: l,
457
457
  textAlign: c,
@@ -459,7 +459,7 @@ function Ve({ resolved: t, nodeId: e, transitionFor: n, animateInitial: i }) {
459
459
  },
460
460
  initial: g.initial,
461
461
  animate: g.animate,
462
- transition: Q(h),
462
+ transition: et(h),
463
463
  children: r
464
464
  }
465
465
  );
@@ -468,16 +468,16 @@ function Ze(t, e) {
468
468
  return typeof t == "number" && Number.isFinite(t) ? t : e;
469
469
  }
470
470
  function Je(t, e) {
471
- const n = Et(
471
+ const n = Dt(
472
472
  t.lineHeight,
473
473
  0,
474
- Ie,
474
+ Xe,
475
475
  "text.lineHeight",
476
476
  e
477
- ), i = Et(
477
+ ), i = Dt(
478
478
  t.letterSpacing,
479
- -Pt,
480
- Pt,
479
+ -Et,
480
+ Et,
481
481
  "text.letterSpacing",
482
482
  e
483
483
  ), r = dt(
@@ -485,23 +485,23 @@ function Je(t, e) {
485
485
  qe,
486
486
  "text.textTransform",
487
487
  e
488
- ), s = dt(
488
+ ), a = dt(
489
489
  t.textDecoration,
490
490
  Ge,
491
491
  "text.textDecoration",
492
492
  e
493
- ), o = dt(t.fontStyle, Ye, "text.fontStyle", e), a = Qe(t.maxLines, Xe, "text.maxLines", e);
493
+ ), o = dt(t.fontStyle, Ie, "text.fontStyle", e), s = Qe(t.maxLines, Ye, "text.maxLines", e);
494
494
  return {
495
495
  ...n !== void 0 ? { lineHeight: n } : {},
496
496
  // Built from a validated finite number — no string passthrough.
497
497
  ...i !== void 0 ? { letterSpacing: `${i}px` } : {},
498
498
  ...r !== void 0 ? { textTransform: r } : {},
499
- ...s !== void 0 ? { textDecoration: s } : {},
499
+ ...a !== void 0 ? { textDecoration: a } : {},
500
500
  ...o !== void 0 ? { fontStyle: o } : {},
501
- ...a !== void 0 ? {
501
+ ...s !== void 0 ? {
502
502
  display: "-webkit-box",
503
503
  WebkitBoxOrient: "vertical",
504
- WebkitLineClamp: a,
504
+ WebkitLineClamp: s,
505
505
  overflow: "hidden",
506
506
  textOverflow: "ellipsis"
507
507
  } : {}
@@ -513,7 +513,7 @@ function dt(t, e, n, i) {
513
513
  St(n, i);
514
514
  }
515
515
  }
516
- function Et(t, e, n, i, r) {
516
+ function Dt(t, e, n, i, r) {
517
517
  if (t !== void 0) {
518
518
  if (typeof t == "number" && Number.isFinite(t) && t >= e && t <= n) return t;
519
519
  St(i, r);
@@ -533,16 +533,16 @@ function St(t, e) {
533
533
  );
534
534
  }
535
535
  function tn({ resolved: t, nodeId: e, transitionFor: n, animateInitial: i }) {
536
- const r = tt(), s = $t(t.src, r, "image.src", e);
537
- if (!s) return null;
538
- const o = typeof t.alt == "string" ? t.alt : "", a = t.fit ?? "contain", l = t.position ?? "center", c = en(t.opacity, 1), u = Dt(t.width, "100%"), d = Dt(t.height, "100%"), h = at(n, ["opacity", "src"], i), g = lt({ opacity: c }, i, e);
536
+ const r = nt(), a = $t(t.src, r, "image.src", e);
537
+ if (!a) return null;
538
+ const o = typeof t.alt == "string" ? t.alt : "", s = t.fit ?? "contain", l = t.position ?? "center", c = en(t.opacity, 1), u = Bt(t.width, "100%"), d = Bt(t.height, "100%"), h = at(n, ["opacity", "src"], i), g = lt({ opacity: c }, i, e);
539
539
  return /* @__PURE__ */ f(
540
- I.img,
540
+ U.img,
541
541
  {
542
- src: s,
542
+ src: a,
543
543
  alt: o,
544
544
  style: {
545
- objectFit: a,
545
+ objectFit: s,
546
546
  objectPosition: l,
547
547
  width: u,
548
548
  height: d
@@ -555,7 +555,7 @@ function tn({ resolved: t, nodeId: e, transitionFor: n, animateInitial: i }) {
555
555
  },
556
556
  initial: g.initial,
557
557
  animate: g.animate,
558
- transition: Q(h),
558
+ transition: et(h),
559
559
  draggable: !1
560
560
  }
561
561
  );
@@ -563,7 +563,7 @@ function tn({ resolved: t, nodeId: e, transitionFor: n, animateInitial: i }) {
563
563
  function en(t, e) {
564
564
  return typeof t == "number" && Number.isFinite(t) ? t : e;
565
565
  }
566
- function Dt(t, e) {
566
+ function Bt(t, e) {
567
567
  return typeof t == "number" && Number.isFinite(t) ? `${t}px` : typeof t == "string" && t.length > 0 ? t : e;
568
568
  }
569
569
  const nn = 8192, rn = 4e3, on = 64, sn = new Set("MmLlHhVvCcSsQqTtAaZz");
@@ -573,23 +573,23 @@ function pt(t) {
573
573
  function an(t) {
574
574
  return t === 32 || t === 9 || t === 13 || t === 10 || t === 44;
575
575
  }
576
- function Bt(t) {
576
+ function Lt(t) {
577
577
  if (typeof t != "string" || t.length === 0 || t.length > nn) return null;
578
578
  const e = t.trim();
579
579
  if (e.length === 0) return null;
580
580
  const n = e.toLowerCase();
581
581
  if (n.includes("url(") || n.includes("data:") || e.includes("<") || e.includes("&")) return null;
582
582
  const i = e.length;
583
- let r = 0, s = 0, o = !1;
583
+ let r = 0, a = 0, o = !1;
584
584
  for (; r < i; ) {
585
- const a = e.charCodeAt(r);
586
- if (an(a)) {
585
+ const s = e.charCodeAt(r);
586
+ if (an(s)) {
587
587
  r++;
588
588
  continue;
589
589
  }
590
590
  const l = e[r];
591
591
  if (sn.has(l)) {
592
- if (!o && l !== "M" && l !== "m" || (o = !0, s++, s > rn)) return null;
592
+ if (!o && l !== "M" && l !== "m" || (o = !0, a++, a > rn)) return null;
593
593
  r++;
594
594
  continue;
595
595
  }
@@ -615,39 +615,39 @@ function Bt(t) {
615
615
  if (u === 0) return null;
616
616
  }
617
617
  }
618
- return s === 0 ? null : e;
618
+ return a === 0 ? null : e;
619
619
  }
620
620
  function ln(t, e) {
621
621
  const n = t.paths, i = t.pathData;
622
622
  if (Array.isArray(n)) {
623
- i !== void 0 && H(e, "shape.pathData", "mutually exclusive with paths[] ; paths[] wins");
623
+ i !== void 0 && W(e, "shape.pathData", "mutually exclusive with paths[] ; paths[] wins");
624
624
  const r = [];
625
- for (let s = 0; s < n.length; s++) {
625
+ for (let a = 0; a < n.length; a++) {
626
626
  if (r.length >= on) {
627
- H(e, "shape.paths", "subpath cap exceeded ; remaining entries dropped");
627
+ W(e, "shape.paths", "subpath cap exceeded ; remaining entries dropped");
628
628
  break;
629
629
  }
630
- const o = n[s], a = Bt(
630
+ const o = n[a], s = Lt(
631
631
  typeof o == "object" && o !== null ? o.data : void 0
632
632
  );
633
- if (a === null) {
634
- H(e, "shape.paths.data", "not a strict SVG path grammar (allowlist/caps)");
633
+ if (s === null) {
634
+ W(e, "shape.paths.data", "not a strict SVG path grammar (allowlist/caps)");
635
635
  continue;
636
636
  }
637
- r.push({ d: a, fillRule: cn(o?.windingRule, e) });
637
+ r.push({ d: s, fillRule: cn(o?.windingRule, e) });
638
638
  }
639
- return r.length === 0 && n.length > 0 && H(e, "shape.paths", "no renderable subpath ; shape geometry omitted"), r;
639
+ return r.length === 0 && n.length > 0 && W(e, "shape.paths", "no renderable subpath ; shape geometry omitted"), r;
640
640
  }
641
641
  if (i !== void 0) {
642
- const r = Bt(i);
643
- return r === null ? (H(e, "shape.pathData", "not a strict SVG path grammar (allowlist/caps)"), []) : [{ d: r, fillRule: "nonzero" }];
642
+ const r = Lt(i);
643
+ return r === null ? (W(e, "shape.pathData", "not a strict SVG path grammar (allowlist/caps)"), []) : [{ d: r, fillRule: "nonzero" }];
644
644
  }
645
- return H(e, "shape.paths", "geometry is path but neither pathData nor paths[] is present"), [];
645
+ return W(e, "shape.paths", "geometry is path but neither pathData nor paths[] is present"), [];
646
646
  }
647
647
  function cn(t, e) {
648
- return t === void 0 || t === "NONZERO" ? "nonzero" : t === "EVENODD" ? "evenodd" : (H(e, "shape.paths.windingRule", "unknown winding rule ; defaulting to nonzero"), "nonzero");
648
+ return t === void 0 || t === "NONZERO" ? "nonzero" : t === "EVENODD" ? "evenodd" : (W(e, "shape.paths.windingRule", "unknown winding rule ; defaulting to nonzero"), "nonzero");
649
649
  }
650
- function H(t, e, n) {
650
+ function W(t, e, n) {
651
651
  S(t, e, n);
652
652
  }
653
653
  function un(t) {
@@ -657,7 +657,7 @@ function ht(t, e) {
657
657
  return typeof t == "number" && Number.isFinite(t) ? t : e;
658
658
  }
659
659
  function Mt(t, e, n, i = "geom") {
660
- const r = un(t), s = ht(t.width, 100), o = ht(t.height, 100), a = ht(t.radius, 0), l = e.stroke ?? "none", c = e.strokeWidth ?? 0, u = e.mixBlendMode !== void 0 ? { mixBlendMode: e.mixBlendMode } : void 0;
660
+ const r = un(t), a = ht(t.width, 100), o = ht(t.height, 100), s = ht(t.radius, 0), l = e.stroke ?? "none", c = e.strokeWidth ?? 0, u = e.mixBlendMode !== void 0 ? { mixBlendMode: e.mixBlendMode } : void 0;
661
661
  if (r === "path") {
662
662
  const d = ln(t, n);
663
663
  return /* @__PURE__ */ f("g", { style: u, children: d.map((h, g) => /* @__PURE__ */ f(
@@ -676,9 +676,9 @@ function Mt(t, e, n, i = "geom") {
676
676
  "ellipse",
677
677
  {
678
678
  style: u,
679
- cx: s / 2,
679
+ cx: a / 2,
680
680
  cy: o / 2,
681
- rx: Math.max(0, s / 2 - c / 2),
681
+ rx: Math.max(0, a / 2 - c / 2),
682
682
  ry: Math.max(0, o / 2 - c / 2),
683
683
  fill: e.fill,
684
684
  stroke: l,
@@ -691,7 +691,7 @@ function Mt(t, e, n, i = "geom") {
691
691
  style: u,
692
692
  x1: "0",
693
693
  y1: o / 2,
694
- x2: s,
694
+ x2: a,
695
695
  y2: o / 2,
696
696
  stroke: l !== "none" ? l : e.fill,
697
697
  strokeWidth: c || 1
@@ -703,10 +703,10 @@ function Mt(t, e, n, i = "geom") {
703
703
  style: u,
704
704
  x: c / 2,
705
705
  y: c / 2,
706
- width: Math.max(0, s - c),
706
+ width: Math.max(0, a - c),
707
707
  height: Math.max(0, o - c),
708
- rx: a,
709
- ry: a,
708
+ rx: s,
709
+ ry: s,
710
710
  fill: e.fill,
711
711
  stroke: l,
712
712
  strokeWidth: c
@@ -719,33 +719,33 @@ function fn(t, e) {
719
719
  const n = t.props ?? {};
720
720
  return Mt(n, { fill: "white" }, e, "mask-cover");
721
721
  }
722
- const dn = 64, re = 1;
723
- function ie(t) {
722
+ const dn = 64, ie = 1;
723
+ function oe(t) {
724
724
  return t.props?.visible === !1;
725
725
  }
726
- function rt(t, e) {
726
+ function ot(t, e) {
727
727
  const n = t?.[e];
728
728
  return typeof n == "number" && Number.isFinite(n) ? n : 0;
729
729
  }
730
- function pn(t, e, n = re, i = dn) {
730
+ function pn(t, e, n = ie, i = dn) {
731
731
  if (t.kind !== "frame") return null;
732
- const r = se(t, e, n, i, "grp");
732
+ const r = ae(t, e, n, i, "grp");
733
733
  return r.length === 0 ? null : /* @__PURE__ */ f("g", { children: r }, "mask-group-cover");
734
734
  }
735
- function oe(t, e = re) {
735
+ function se(t, e = ie) {
736
736
  if (t.kind !== "frame") return !1;
737
737
  for (const n of t.children ?? [])
738
- if (!ie(n) && (rt(n.props, "blur") > 0 || n.kind === "frame" && e > 0 && oe(n, e - 1)))
738
+ if (!oe(n) && (ot(n.props, "blur") > 0 || n.kind === "frame" && e > 0 && se(n, e - 1)))
739
739
  return !0;
740
740
  return !1;
741
741
  }
742
- function se(t, e, n, i, r) {
743
- const s = t.children ?? [], o = [];
744
- let a = 0;
745
- for (let l = 0; l < s.length; l++) {
746
- const c = s[l];
747
- if (ie(c)) continue;
748
- if (a >= i) {
742
+ function ae(t, e, n, i, r) {
743
+ const a = t.children ?? [], o = [];
744
+ let s = 0;
745
+ for (let l = 0; l < a.length; l++) {
746
+ const c = a[l];
747
+ if (oe(c)) continue;
748
+ if (s >= i) {
749
749
  S(
750
750
  e,
751
751
  "mask.source.ref",
@@ -757,42 +757,42 @@ function se(t, e, n, i, r) {
757
757
  if (c.kind === "shape")
758
758
  u = Mt(c.props ?? {}, { fill: "white" }, c.id, `${r}-${l}`);
759
759
  else if (c.kind === "frame" && n > 0) {
760
- const m = se(c, e, n - 1, i, `${r}-${l}`);
760
+ const m = ae(c, e, n - 1, i, `${r}-${l}`);
761
761
  m.length > 0 && (u = /* @__PURE__ */ f("g", { children: m }, `${r}-${l}`));
762
762
  }
763
763
  if (u === null) continue;
764
- const d = rt(c.props, "blur");
764
+ const d = ot(c.props, "blur");
765
765
  if (d > 0) {
766
766
  const m = `lumen-mcov-blur-${e ?? "x"}-${r}-${l}`;
767
- u = /* @__PURE__ */ G("g", { children: [
767
+ u = /* @__PURE__ */ I("g", { children: [
768
768
  /* @__PURE__ */ f("filter", { id: m, x: "-120%", y: "-120%", width: "340%", height: "340%", children: /* @__PURE__ */ f("feGaussianBlur", { stdDeviation: d / 2 }) }),
769
769
  /* @__PURE__ */ f("g", { filter: `url(#${m})`, children: u })
770
770
  ] }, `${r}-b-${l}`);
771
771
  }
772
- const h = rt(c.props, "x"), g = rt(c.props, "y");
772
+ const h = ot(c.props, "x"), g = ot(c.props, "y");
773
773
  o.push(
774
774
  h !== 0 || g !== 0 ? /* @__PURE__ */ f("g", { transform: `translate(${h} ${g})`, children: u }, `${r}-t-${l}`) : u
775
- ), a++;
775
+ ), s++;
776
776
  }
777
777
  return o;
778
778
  }
779
779
  function hn({ resolved: t, nodeId: e, transitionFor: n, animateInitial: i }) {
780
- const r = t.geometry ?? t.kind ?? "rect", s = gt(t.fill, "shape.fill", e) ?? "transparent", o = gt(t.stroke, "shape.stroke", e) ?? "transparent", a = et(t.stroke_width, 0), l = et(t.width, 100), c = et(t.height, 100), u = et(t.opacity, 1), d = typeof t.ariaLabel == "string" ? t.ariaLabel : void 0, h = at(n, ["opacity"], i), g = Q(h), m = lt({ opacity: u }, i, e), A = tt(), x = ne(
781
- Le(ee(t.fills, "shape.fills", e), "shape.fills", e),
780
+ const r = t.geometry ?? t.kind ?? "rect", a = gt(t.fill, "shape.fill", e) ?? "transparent", o = gt(t.stroke, "shape.stroke", e) ?? "transparent", s = rt(t.stroke_width, 0), l = rt(t.width, 100), c = rt(t.height, 100), u = rt(t.opacity, 1), d = typeof t.ariaLabel == "string" ? t.ariaLabel : void 0, h = at(n, ["opacity"], i), g = et(h), m = lt({ opacity: u }, i, e), A = nt(), x = re(
781
+ Le(ne(t.fills, "shape.fills", e), "shape.fills", e),
782
782
  A,
783
783
  "shape.fills",
784
784
  e
785
- ), F = gn(t.strokes), k = x.map(Oe), y = k.flatMap((R) => R.defs), p = k.length > 0 ? k.map((R) => ({ ref: R.ref, mixBlendMode: R.mixBlendMode })) : [{ ref: s }], w = F.length > 0 ? F.map((R) => ({
785
+ ), F = gn(t.strokes), k = x.map(Oe), y = k.flatMap((R) => R.defs), p = k.length > 0 ? k.map((R) => ({ ref: R.ref, mixBlendMode: R.mixBlendMode })) : [{ ref: a }], w = F.length > 0 ? F.map((R) => ({
786
786
  color: gt(R.color, "shape.strokes.color", e) ?? "transparent",
787
787
  width: R.width ?? 0
788
- })) : [{ color: o, width: a }], v = [...p].reverse(), $ = [...w].reverse(), j = r === "path" ? $.filter((R) => R.width > 0 && R.color !== "transparent") : $, K = (R, b, O, N) => Mt(
788
+ })) : [{ color: o, width: s }], v = [...p].reverse(), $ = [...w].reverse(), _ = r === "path" ? $.filter((R) => R.width > 0 && R.color !== "transparent") : $, V = (R, b, P, N) => Mt(
789
789
  t,
790
790
  { fill: R, stroke: b.color, strokeWidth: b.width, mixBlendMode: N },
791
791
  e,
792
- O
792
+ P
793
793
  );
794
- return /* @__PURE__ */ G(
795
- I.svg,
794
+ return /* @__PURE__ */ I(
795
+ U.svg,
796
796
  {
797
797
  width: l,
798
798
  height: c,
@@ -804,58 +804,133 @@ function hn({ resolved: t, nodeId: e, transitionFor: n, animateInitial: i }) {
804
804
  children: [
805
805
  y.length > 0 && /* @__PURE__ */ f("defs", { children: y }),
806
806
  v.map(
807
- (R, b) => K(R.ref, { color: "transparent", width: 0 }, `fill-${b}`, R.mixBlendMode)
807
+ (R, b) => V(R.ref, { color: "transparent", width: 0 }, `fill-${b}`, R.mixBlendMode)
808
808
  ),
809
- j.map((R, b) => K("none", R, `stroke-${b}`))
809
+ _.map((R, b) => V("none", R, `stroke-${b}`))
810
810
  ]
811
811
  }
812
812
  );
813
813
  }
814
814
  function gt(t, e, n) {
815
815
  if (typeof t != "string") return null;
816
- const i = E(t);
817
- return i === null && D(e, n), i;
816
+ const i = D(t);
817
+ return i === null && B(e, n), i;
818
818
  }
819
819
  function gn(t) {
820
820
  return Array.isArray(t) ? t.filter(
821
821
  (e) => typeof e == "object" && e !== null && ("color" in e || "width" in e)
822
822
  ) : [];
823
823
  }
824
- function et(t, e) {
824
+ function rt(t, e) {
825
825
  return typeof t == "number" && Number.isFinite(t) ? t : e;
826
826
  }
827
- function mn({ resolved: t, nodeId: e }) {
828
- const n = tt(), i = $t(t.src, n, "media.src", e);
829
- if (!i) return null;
830
- const r = t.loop ?? !0, s = t.mute ?? !0, o = t.autoplay ?? !0, a = t.fit ?? "cover";
831
- return /* @__PURE__ */ f(
827
+ function At({
828
+ peerLabel: t,
829
+ objectFit: e,
830
+ muted: n = !0
831
+ }) {
832
+ const i = Vt(), r = i?.resolvePeerStream, a = i?.subscribePeerStream, o = tt(null), [s, l] = vt(null);
833
+ return Y(() => {
834
+ if (a !== void 0)
835
+ return a(t, l);
836
+ if (r !== void 0) {
837
+ l(r(t));
838
+ return;
839
+ }
840
+ l(null);
841
+ }, [t, r, a]), Y(() => {
842
+ const c = o.current;
843
+ if (c !== null)
844
+ return c.srcObject = s, () => {
845
+ c !== null && (c.srcObject = null);
846
+ };
847
+ }, [s]), s === null ? /* @__PURE__ */ f(
848
+ "div",
849
+ {
850
+ "aria-hidden": !0,
851
+ "data-lumencast-media-live": !0,
852
+ style: { width: "100%", height: "100%", opacity: 0, pointerEvents: "none" }
853
+ }
854
+ ) : /* @__PURE__ */ f(
832
855
  "video",
833
856
  {
834
- src: i,
835
- autoPlay: o,
836
- loop: r,
837
- muted: s,
857
+ ref: o,
858
+ "data-lumencast-media-live": !0,
859
+ autoPlay: !0,
860
+ muted: n,
838
861
  playsInline: !0,
839
862
  style: {
840
863
  width: "100%",
841
864
  height: "100%",
842
- objectFit: a
865
+ objectFit: e,
866
+ pointerEvents: "none"
843
867
  }
844
868
  }
845
869
  );
846
870
  }
847
- const Lt = /* @__PURE__ */ new Set();
848
- function yn({ resolved: t, nodeId: e }) {
871
+ function mn({ resolved: t, nodeId: e }) {
872
+ const n = nt(), i = t.fit ?? "cover", r = typeof t.peerLabel == "string" && t.peerLabel.length > 0 ? t.peerLabel : "";
873
+ if (r !== "")
874
+ return /* @__PURE__ */ f(At, { peerLabel: r, objectFit: i });
875
+ const a = $t(t.src, n, "media.src", e);
876
+ if (!a) return null;
877
+ const o = t.loop ?? !0, s = t.mute ?? !0, l = t.autoplay ?? !0;
878
+ return /* @__PURE__ */ f(
879
+ "video",
880
+ {
881
+ src: a,
882
+ autoPlay: l,
883
+ loop: o,
884
+ muted: s,
885
+ playsInline: !0,
886
+ style: yn(i)
887
+ }
888
+ );
889
+ }
890
+ function yn(t) {
891
+ return {
892
+ width: "100%",
893
+ height: "100%",
894
+ objectFit: t
895
+ };
896
+ }
897
+ function bn({ resolved: t }) {
898
+ const e = typeof t.peer_label == "string" && t.peer_label.length > 0 ? t.peer_label : "";
899
+ if (e === "")
900
+ return /* @__PURE__ */ f(
901
+ "div",
902
+ {
903
+ "aria-hidden": !0,
904
+ "data-lumencast-meet-peer": !0,
905
+ style: { width: "100%", height: "100%", opacity: 0, pointerEvents: "none" }
906
+ }
907
+ );
908
+ const n = typeof t.object_fit == "string" && t.object_fit.length > 0 ? t.object_fit : "cover", i = t.muted === void 0 ? !0 : t.muted !== !1;
909
+ return /* @__PURE__ */ f(At, { peerLabel: e, objectFit: n, muted: i });
910
+ }
911
+ function kn({ resolved: t }) {
912
+ const e = typeof t["x-zab.slotRef"] == "string" && t["x-zab.slotRef"].length > 0 ? t["x-zab.slotRef"] : "";
913
+ return e === "" ? /* @__PURE__ */ f(
914
+ "div",
915
+ {
916
+ "aria-hidden": !0,
917
+ "data-lumencast-meet-peer-slot": !0,
918
+ style: { width: "100%", height: "100%", opacity: 0, pointerEvents: "none" }
919
+ }
920
+ ) : /* @__PURE__ */ f(At, { peerLabel: e, objectFit: "cover", muted: !0 });
921
+ }
922
+ const zt = /* @__PURE__ */ new Set();
923
+ function wn({ resolved: t, nodeId: e }) {
849
924
  const n = t.scene_id, i = t.scene_version;
850
925
  if (!n || !i)
851
926
  return S(e, "instance.scene_id", "missing scene_id or scene_version ; not rendered"), null;
852
927
  const r = `${n}:${i}`;
853
- Lt.has(r) || (Lt.add(r), S(
928
+ zt.has(r) || (zt.add(r), S(
854
929
  e,
855
930
  "instance",
856
931
  "scaffold render — async bundle fetch + __params.* injection are not yet wired (LSML 1.1 §4.9)"
857
932
  ));
858
- const s = t.size, o = t.position;
933
+ const a = t.size, o = t.position;
859
934
  return /* @__PURE__ */ f(
860
935
  "div",
861
936
  {
@@ -865,43 +940,43 @@ function yn({ resolved: t, nodeId: e }) {
865
940
  position: o ? "absolute" : "relative",
866
941
  left: o?.x,
867
942
  top: o?.y,
868
- width: s?.w,
869
- height: s?.h,
943
+ width: a?.w,
944
+ height: a?.h,
870
945
  outline: "none",
871
946
  boxSizing: "border-box"
872
947
  }
873
948
  }
874
949
  );
875
950
  }
876
- function bn({ resolved: t }) {
877
- const e = Ht(t.width, "100%"), n = Ht(t.height, "100%"), i = typeof t["x-zab.sourceKind"] == "string" ? t["x-zab.sourceKind"] : "", r = typeof t["x-zab.deviceRef"] == "string" ? t["x-zab.deviceRef"] : "", o = be()?.resolveCaptureDevice, a = it(null), [l, c] = Ut(null);
878
- return ot(() => {
879
- if (!kn()) return;
951
+ function xn({ resolved: t }) {
952
+ const e = Wt(t.width, "100%"), n = Wt(t.height, "100%"), i = typeof t["x-zab.sourceKind"] == "string" ? t["x-zab.sourceKind"] : "", r = typeof t["x-zab.deviceRef"] == "string" ? t["x-zab.deviceRef"] : "", o = Vt()?.resolveCaptureDevice, s = tt(null), [l, c] = vt(null);
953
+ return Y(() => {
954
+ if (!vn()) return;
880
955
  let u = !1, d = null;
881
956
  return (async () => {
882
957
  try {
883
- const h = await xn(i, r, o);
958
+ const h = await Sn(i, r, o);
884
959
  if (h === null) return;
885
960
  if (u) {
886
- zt(h);
961
+ Ht(h);
887
962
  return;
888
963
  }
889
964
  d = h, c(h);
890
965
  } catch {
891
966
  }
892
967
  })(), () => {
893
- u = !0, d !== null && zt(d);
968
+ u = !0, d !== null && Ht(d);
894
969
  };
895
- }, [i, r, o]), ot(() => {
896
- const u = a.current;
970
+ }, [i, r, o]), Y(() => {
971
+ const u = s.current;
897
972
  if (u !== null)
898
973
  return u.srcObject = l, () => {
899
974
  u !== null && (u.srcObject = null);
900
975
  };
901
- }, [l]), l !== null && wn(i) ? /* @__PURE__ */ f(
976
+ }, [l]), l !== null && $n(i) ? /* @__PURE__ */ f(
902
977
  "video",
903
978
  {
904
- ref: a,
979
+ ref: s,
905
980
  "data-lumencast-capture": !0,
906
981
  autoPlay: !0,
907
982
  muted: !0,
@@ -917,38 +992,49 @@ function bn({ resolved: t }) {
917
992
  }
918
993
  );
919
994
  }
920
- function kn() {
995
+ function vn() {
921
996
  return typeof navigator < "u" && typeof navigator.mediaDevices?.getUserMedia == "function";
922
997
  }
923
- function wn(t) {
998
+ function $n(t) {
924
999
  return t === "media.webcam" || t === "media.screen" || t === "media.window";
925
1000
  }
926
- async function xn(t, e, n) {
927
- const i = navigator.mediaDevices, s = (n?.(e, t) ?? null)?.deviceId;
1001
+ async function Sn(t, e, n) {
1002
+ const i = navigator.mediaDevices, r = await n?.(e, t) ?? null, a = r?.deviceId, o = e.length > 0;
928
1003
  switch (t) {
929
1004
  case "media.webcam":
930
- return i.getUserMedia({ video: mt(s) });
931
1005
  case "media.mic":
932
- return i.getUserMedia({ audio: mt(s) });
933
- case "media.app_audio":
934
- return i.getUserMedia({ audio: mt(s) });
1006
+ case "media.app_audio": {
1007
+ if (o && (typeof a != "string" || a.length === 0))
1008
+ return null;
1009
+ const s = t === "media.webcam" ? "video" : "audio";
1010
+ return i.getUserMedia({ [s]: Mn(a) });
1011
+ }
935
1012
  case "media.screen":
936
- case "media.window":
937
- return i.getDisplayMedia({ video: !0 });
1013
+ case "media.window": {
1014
+ const s = r?.captureSourceId;
1015
+ return typeof s == "string" && s.length > 0 ? i.getUserMedia({
1016
+ video: {
1017
+ mandatory: {
1018
+ chromeMediaSource: "desktop",
1019
+ chromeMediaSourceId: s
1020
+ }
1021
+ }
1022
+ }) : o ? null : i.getDisplayMedia({ video: !0 });
1023
+ }
938
1024
  default:
939
1025
  return null;
940
1026
  }
941
1027
  }
942
- function mt(t) {
943
- return typeof t == "string" && t.length > 0 ? { deviceId: t } : !0;
1028
+ function Mn(t) {
1029
+ return typeof t == "string" && t.length > 0 ? { deviceId: { exact: t } } : !0;
944
1030
  }
945
- function zt(t) {
1031
+ function Ht(t) {
946
1032
  for (const e of t.getTracks()) e.stop();
947
1033
  }
948
- function Ht(t, e) {
1034
+ function Wt(t, e) {
949
1035
  return typeof t == "number" && Number.isFinite(t) ? `${t}px` : typeof t == "string" && t.length > 0 ? t : e;
950
1036
  }
951
- const vn = {
1037
+ const An = {
952
1038
  stack: ve,
953
1039
  grid: $e,
954
1040
  frame: ze,
@@ -956,21 +1042,29 @@ const vn = {
956
1042
  image: tn,
957
1043
  shape: hn,
958
1044
  media: mn,
959
- instance: yn,
1045
+ // ADR 006 §3.3/§3.5 — the unified source kind : every exported source is a
1046
+ // `meet.peer` node rendered in `<video srcObject>` from the WebRTC viewer.
1047
+ "meet.peer": bn,
1048
+ instance: wn,
960
1049
  // RFC-0001 / ADR 004 — Zab vendor capture placeholder (transparent, inert).
961
- "x-zab.capture": bn
962
- }, wt = st("");
963
- function $n({ prefix: t, children: e }) {
964
- const n = U(wt), i = n ? `${n}.${t}` : t;
965
- return /* @__PURE__ */ f(wt.Provider, { value: i, children: e });
966
- }
967
- function At() {
968
- return U(wt);
969
- }
970
- function q(t, e) {
1050
+ "x-zab.capture": xn,
1051
+ // ADR Blue 009 §3.1 (Amendment 2) — Zab vendor meet-peer SLOT placeholder.
1052
+ // Carries only a logical `x-zab.slotRef` ; the host's slot-aware peer-stream
1053
+ // registry resolves `slotRef peer_label MediaStream` (transparent when
1054
+ // unbound). Closes the kind→primitive gap that left it an unknown-kind drop.
1055
+ "x-zab.meet-peer": kn
1056
+ }, kt = st("");
1057
+ function Fn({ prefix: t, children: e }) {
1058
+ const n = K(kt), i = n ? `${n}.${t}` : t;
1059
+ return /* @__PURE__ */ f(kt.Provider, { value: i, children: e });
1060
+ }
1061
+ function Ft() {
1062
+ return K(kt);
1063
+ }
1064
+ function G(t, e) {
971
1065
  return !t || e.startsWith("__") ? e : `${t}.${e}`;
972
1066
  }
973
- function Wt(t) {
1067
+ function qt(t) {
974
1068
  switch (t) {
975
1069
  case "fixed":
976
1070
  return "0 0 auto";
@@ -982,84 +1076,84 @@ function Wt(t) {
982
1076
  return;
983
1077
  }
984
1078
  }
985
- function Sn(t) {
986
- const e = Wt(t?.x), n = Wt(t?.y);
1079
+ function Rn(t) {
1080
+ const e = qt(t?.x), n = qt(t?.y);
987
1081
  return e === n && e !== void 0 ? e : e ?? n;
988
1082
  }
989
- function Mn({
1083
+ function jn({
990
1084
  visible: t,
991
1085
  opacity: e,
992
1086
  rotation: n,
993
1087
  flipY: i,
994
1088
  blur: r,
995
- sizing: s,
1089
+ sizing: a,
996
1090
  position: o,
997
- size: a,
1091
+ size: s,
998
1092
  blendMode: l,
999
1093
  children: c
1000
1094
  }) {
1001
1095
  if (t === !1)
1002
1096
  return null;
1003
- const u = Y(l), d = typeof e == "number" && e !== 1, h = typeof n == "number" && n !== 0, g = i === !0, m = typeof r == "number" && r > 0, A = s?.x !== void 0 || s?.y !== void 0, x = o !== void 0, F = u !== void 0;
1097
+ const u = X(l), d = typeof e == "number" && e !== 1, h = typeof n == "number" && n !== 0, g = i === !0, m = typeof r == "number" && r > 0, A = a?.x !== void 0 || a?.y !== void 0, x = o !== void 0, F = u !== void 0;
1004
1098
  if (!d && !h && !g && !m && !A && !x && !F)
1005
- return /* @__PURE__ */ f(J, { children: c });
1099
+ return /* @__PURE__ */ f(Q, { children: c });
1006
1100
  let k;
1007
1101
  if (h || g) {
1008
1102
  const v = [];
1009
1103
  h && v.push(`rotate(${n}deg)`), g && v.push("scaleY(-1)"), k = v.join(" ");
1010
1104
  }
1011
- const y = m ? `blur(${r / 2}px)` : void 0, p = A ? Sn(s) : void 0;
1105
+ const y = m ? `blur(${r / 2}px)` : void 0, p = A ? Rn(a) : void 0;
1012
1106
  if (F && (d || k !== void 0 || y !== void 0)) {
1013
1107
  const v = { mixBlendMode: u };
1014
1108
  x && (v.position = "absolute", v.left = o.x, v.top = o.y), p !== void 0 && (v.flex = p);
1015
1109
  const $ = {};
1016
- return typeof a?.w == "number" && ($.width = a.w), typeof a?.h == "number" && ($.height = a.h), d && ($.opacity = e), k !== void 0 && ($.transform = k), y !== void 0 && ($.filter = y), /* @__PURE__ */ f("div", { style: v, children: /* @__PURE__ */ f("div", { style: $, children: c }) });
1110
+ return typeof s?.w == "number" && ($.width = s.w), typeof s?.h == "number" && ($.height = s.h), d && ($.opacity = e), k !== void 0 && ($.transform = k), y !== void 0 && ($.filter = y), /* @__PURE__ */ f("div", { style: v, children: /* @__PURE__ */ f("div", { style: $, children: c }) });
1017
1111
  }
1018
1112
  const w = {};
1019
- return d && (w.opacity = e), k !== void 0 && (w.transform = k), y !== void 0 && (w.filter = y), F && (w.mixBlendMode = u), x && (w.position = "absolute", w.left = o.x, w.top = o.y, typeof a?.w == "number" && (w.width = a.w), typeof a?.h == "number" && (w.height = a.h)), p !== void 0 && (w.flex = p), /* @__PURE__ */ f("div", { style: w, children: c });
1113
+ return d && (w.opacity = e), k !== void 0 && (w.transform = k), y !== void 0 && (w.filter = y), F && (w.mixBlendMode = u), x && (w.position = "absolute", w.left = o.x, w.top = o.y, typeof s?.w == "number" && (w.width = s.w), typeof s?.h == "number" && (w.height = s.h)), p !== void 0 && (w.flex = p), /* @__PURE__ */ f("div", { style: w, children: c });
1020
1114
  }
1021
- const An = {
1115
+ const _n = {
1022
1116
  linear: "linear",
1023
1117
  "ease-in": "easeIn",
1024
1118
  "ease-out": "easeOut",
1025
1119
  "ease-in-out": "easeInOut"
1026
1120
  };
1027
- function Fn(t, e) {
1121
+ function Tn(t, e) {
1028
1122
  const n = t.steps;
1029
1123
  if (!Array.isArray(n) || n.length < 2) return;
1030
1124
  const i = n[0], r = n[n.length - 1];
1031
1125
  if (i.at !== 0 || r.at !== 1) return;
1032
- const s = n.map((a) => a.at), o = {};
1033
- return qt(n, "opacity", o, e), qt(n, "filter", o, e), nt(n, "scale", o), nt(n, "translateX", o), nt(n, "translateY", o), nt(n, "rotate", o), {
1126
+ const a = n.map((s) => s.at), o = {};
1127
+ return Gt(n, "opacity", o, e), Gt(n, "filter", o, e), it(n, "scale", o), it(n, "translateX", o), it(n, "translateY", o), it(n, "rotate", o), {
1034
1128
  animate: o,
1035
1129
  transition: {
1036
1130
  duration: t.duration_ms / 1e3,
1037
- ease: An[t.easing ?? "linear"],
1038
- times: s
1131
+ ease: _n[t.easing ?? "linear"],
1132
+ times: a
1039
1133
  }
1040
1134
  };
1041
1135
  }
1042
- function qt(t, e, n, i) {
1136
+ function Gt(t, e, n, i) {
1043
1137
  let r = !1;
1044
- const s = [];
1138
+ const a = [];
1045
1139
  let o;
1046
- for (const a of t) {
1047
- let l = a[e];
1140
+ for (const s of t) {
1141
+ let l = s[e];
1048
1142
  if (e === "filter" && l !== void 0) {
1049
1143
  const c = ke(l);
1050
- c === null ? (Vt("keyframes.steps[].filter", i), l = void 0) : l = c;
1144
+ c === null ? (Zt("keyframes.steps[].filter", i), l = void 0) : l = c;
1051
1145
  }
1052
- l !== void 0 ? (r = !0, o = l, s.push(l)) : s.push(o ?? (e === "opacity" ? 1 : we));
1146
+ l !== void 0 ? (r = !0, o = l, a.push(l)) : a.push(o ?? (e === "opacity" ? 1 : we));
1053
1147
  }
1054
- r && (n[e] = s);
1148
+ r && (n[e] = a);
1055
1149
  }
1056
- function nt(t, e, n) {
1150
+ function it(t, e, n) {
1057
1151
  let i = !1;
1058
1152
  const r = [];
1059
- let s;
1153
+ let a;
1060
1154
  for (const o of t) {
1061
- const a = o.transform?.[e];
1062
- typeof a == "number" ? (i = !0, s = a, r.push(a)) : r.push(s ?? Rn(e));
1155
+ const s = o.transform?.[e];
1156
+ typeof s == "number" ? (i = !0, a = s, r.push(s)) : r.push(a ?? Cn(e));
1063
1157
  }
1064
1158
  if (i)
1065
1159
  if (e === "rotate")
@@ -1069,76 +1163,76 @@ function nt(t, e, n) {
1069
1163
  n[o] = r;
1070
1164
  }
1071
1165
  }
1072
- function Rn(t) {
1166
+ function Cn(t) {
1073
1167
  return t === "scale" ? 1 : 0;
1074
1168
  }
1075
- const Ft = st(0), Gt = 2e3;
1076
- function _n(t, e) {
1169
+ const Rt = st(0), It = 2e3;
1170
+ function On(t, e) {
1077
1171
  if (e <= 0) return 0;
1078
1172
  const n = t * e;
1079
- return n > Gt ? Gt : n;
1173
+ return n > It ? It : n;
1080
1174
  }
1081
- function jn({
1175
+ function Pn({
1082
1176
  keyframes: t,
1083
1177
  store: e,
1084
1178
  nodeId: n,
1085
1179
  children: i
1086
1180
  }) {
1087
- vt();
1088
- const r = At(), s = U(Ft), o = it(void 0), a = it(0);
1181
+ xt();
1182
+ const r = Ft(), a = K(Rt), o = tt(void 0), s = tt(0);
1089
1183
  if (t.key !== void 0) {
1090
- const u = e.signal(q(r, t.key)).value;
1091
- o.current !== u && (o.current = u, a.current += 1);
1184
+ const u = e.signal(G(r, t.key)).value;
1185
+ o.current !== u && (o.current = u, s.current += 1);
1092
1186
  }
1093
- const l = Fn(t, n);
1187
+ const l = Tn(t, n);
1094
1188
  if (!l)
1095
- return /* @__PURE__ */ f(J, { children: i });
1096
- const c = s > 0 ? { ...l.transition, delay: s / 1e3 } : l.transition;
1097
- return /* @__PURE__ */ G(
1098
- I.div,
1189
+ return /* @__PURE__ */ f(Q, { children: i });
1190
+ const c = a > 0 ? { ...l.transition, delay: a / 1e3 } : l.transition;
1191
+ return /* @__PURE__ */ I(
1192
+ U.div,
1099
1193
  {
1100
1194
  style: { position: "absolute", inset: 0 },
1101
- initial: Cn(l.animate),
1195
+ initial: En(l.animate),
1102
1196
  animate: l.animate,
1103
1197
  transition: c,
1104
1198
  children: [
1105
- /* @__PURE__ */ f(Tn, {}),
1199
+ /* @__PURE__ */ f(Nn, {}),
1106
1200
  i
1107
1201
  ]
1108
1202
  },
1109
- a.current
1203
+ s.current
1110
1204
  );
1111
1205
  }
1112
- function Tn() {
1113
- return ot(() => {
1206
+ function Nn() {
1207
+ return Y(() => {
1114
1208
  }, []), null;
1115
1209
  }
1116
- function Cn(t) {
1210
+ function En(t) {
1117
1211
  const e = {};
1118
1212
  for (const [n, i] of Object.entries(t))
1119
1213
  i.length > 0 && (e[n] = i[0]);
1120
1214
  return e;
1121
1215
  }
1122
- function On(t, e = (i) => requestAnimationFrame(i), n = (i) => cancelAnimationFrame(i)) {
1216
+ function Dn(t, e = (i) => requestAnimationFrame(i), n = (i) => cancelAnimationFrame(i)) {
1123
1217
  const i = /* @__PURE__ */ new Map();
1124
- let r = null, s = !1;
1218
+ let r = null, a = !1;
1125
1219
  const o = () => {
1126
1220
  r = null;
1127
- const a = [...i.entries()];
1221
+ const s = [...i.entries()];
1128
1222
  i.clear();
1129
- for (const [l, c] of a)
1223
+ for (const [l, c] of s)
1130
1224
  t(l, c);
1131
1225
  };
1132
1226
  return {
1133
- push(a, l) {
1134
- s || (i.set(a, l), r === null && (r = e(o)));
1227
+ push(s, l) {
1228
+ a || (i.set(s, l), r === null && (r = e(o)));
1135
1229
  },
1136
1230
  dispose() {
1137
- s = !0, i.clear(), r !== null && (n(r), r = null);
1231
+ a = !0, i.clear(), r !== null && (n(r), r = null);
1138
1232
  }
1139
1233
  };
1140
1234
  }
1141
- const Nn = {
1235
+ const Bn = {
1142
1236
  aliceblue: 15792383,
1143
1237
  antiquewhite: 16444375,
1144
1238
  aqua: 65535,
@@ -1288,42 +1382,42 @@ const Nn = {
1288
1382
  yellow: 16776960,
1289
1383
  yellowgreen: 10145074
1290
1384
  };
1291
- function Pn(t) {
1292
- const e = E(t);
1385
+ function Ln(t) {
1386
+ const e = D(t);
1293
1387
  if (e === null) return null;
1294
- if (e.startsWith("#")) return En(e);
1388
+ if (e.startsWith("#")) return zn(e);
1295
1389
  if (e.startsWith("rgb")) {
1296
1390
  const r = e.slice(e.indexOf("(") + 1, -1).split(",").map((d) => d.trim());
1297
1391
  if (r.length < 3) return null;
1298
- const o = r[0].endsWith("%") ? 100 : 255, a = yt(r[0], o), l = yt(r[1], o), c = yt(r[2], o), u = r.length > 3 ? Yt(r[3]) : 1;
1299
- return a === null || l === null || c === null || u === null ? null : [a, l, c, u];
1392
+ const o = r[0].endsWith("%") ? 100 : 255, s = mt(r[0], o), l = mt(r[1], o), c = mt(r[2], o), u = r.length > 3 ? Yt(r[3]) : 1;
1393
+ return s === null || l === null || c === null || u === null ? null : [s, l, c, u];
1300
1394
  }
1301
1395
  if (e.startsWith("hsl")) {
1302
1396
  const r = e.slice(e.indexOf("(") + 1, -1).split(",").map((h) => h.trim());
1303
1397
  if (r.length < 3) return null;
1304
- const s = Number(r[0].replace("deg", "")), o = Number(r[1].replace("%", "")) / 100, a = Number(r[2].replace("%", "")) / 100, l = r.length > 3 ? Yt(r[3]) : 1;
1305
- if (![s, o, a].every(Number.isFinite) || l === null) return null;
1306
- const [c, u, d] = Dn(s, o, a);
1398
+ const a = Number(r[0].replace("deg", "")), o = Number(r[1].replace("%", "")) / 100, s = Number(r[2].replace("%", "")) / 100, l = r.length > 3 ? Yt(r[3]) : 1;
1399
+ if (![a, o, s].every(Number.isFinite) || l === null) return null;
1400
+ const [c, u, d] = Hn(a, o, s);
1307
1401
  return [c, u, d, l];
1308
1402
  }
1309
1403
  if (e === "transparent") return [0, 0, 0, 0];
1310
1404
  if (e === "currentcolor") return null;
1311
- const n = Nn[e];
1405
+ const n = Bn[e];
1312
1406
  return n === void 0 ? null : [(n >> 16 & 255) / 255, (n >> 8 & 255) / 255, (n & 255) / 255, 1];
1313
1407
  }
1314
- function En(t) {
1408
+ function zn(t) {
1315
1409
  const e = t.slice(1);
1316
1410
  if (e.length === 3 || e.length === 4) {
1317
- const n = parseInt(e[0] + e[0], 16), i = parseInt(e[1] + e[1], 16), r = parseInt(e[2] + e[2], 16), s = e.length === 4 ? parseInt(e[3] + e[3], 16) : 255;
1318
- return [n / 255, i / 255, r / 255, s / 255];
1411
+ const n = parseInt(e[0] + e[0], 16), i = parseInt(e[1] + e[1], 16), r = parseInt(e[2] + e[2], 16), a = e.length === 4 ? parseInt(e[3] + e[3], 16) : 255;
1412
+ return [n / 255, i / 255, r / 255, a / 255];
1319
1413
  }
1320
1414
  if (e.length === 6 || e.length === 8) {
1321
- const n = parseInt(e.slice(0, 2), 16), i = parseInt(e.slice(2, 4), 16), r = parseInt(e.slice(4, 6), 16), s = e.length === 8 ? parseInt(e.slice(6, 8), 16) : 255;
1322
- return [n / 255, i / 255, r / 255, s / 255];
1415
+ const n = parseInt(e.slice(0, 2), 16), i = parseInt(e.slice(2, 4), 16), r = parseInt(e.slice(4, 6), 16), a = e.length === 8 ? parseInt(e.slice(6, 8), 16) : 255;
1416
+ return [n / 255, i / 255, r / 255, a / 255];
1323
1417
  }
1324
1418
  return null;
1325
1419
  }
1326
- function yt(t, e) {
1420
+ function mt(t, e) {
1327
1421
  const n = Number(t.replace("%", ""));
1328
1422
  return Number.isFinite(n) ? T(n / e) : null;
1329
1423
  }
@@ -1331,14 +1425,14 @@ function Yt(t) {
1331
1425
  const e = t.endsWith("%"), n = Number(t.replace("%", ""));
1332
1426
  return Number.isFinite(n) ? T(e ? n / 100 : n) : null;
1333
1427
  }
1334
- function Dn(t, e, n) {
1335
- const i = (t % 360 + 360) % 360, r = (1 - Math.abs(2 * n - 1)) * e, s = i / 60, o = r * (1 - Math.abs(s % 2 - 1));
1336
- let a = 0, l = 0, c = 0;
1337
- s < 1 ? [a, l, c] = [r, o, 0] : s < 2 ? [a, l, c] = [o, r, 0] : s < 3 ? [a, l, c] = [0, r, o] : s < 4 ? [a, l, c] = [0, o, r] : s < 5 ? [a, l, c] = [o, 0, r] : [a, l, c] = [r, 0, o];
1428
+ function Hn(t, e, n) {
1429
+ const i = (t % 360 + 360) % 360, r = (1 - Math.abs(2 * n - 1)) * e, a = i / 60, o = r * (1 - Math.abs(a % 2 - 1));
1430
+ let s = 0, l = 0, c = 0;
1431
+ a < 1 ? [s, l, c] = [r, o, 0] : a < 2 ? [s, l, c] = [o, r, 0] : a < 3 ? [s, l, c] = [0, r, o] : a < 4 ? [s, l, c] = [0, o, r] : a < 5 ? [s, l, c] = [o, 0, r] : [s, l, c] = [r, 0, o];
1338
1432
  const u = n - r / 2;
1339
- return [T(a + u), T(l + u), T(c + u)];
1433
+ return [T(s + u), T(l + u), T(c + u)];
1340
1434
  }
1341
- function Bn(t, e, n) {
1435
+ function Wn(t, e, n) {
1342
1436
  return [
1343
1437
  T(t[0] + n * (e[0] - t[0])),
1344
1438
  T(t[1] + n * (e[1] - t[1])),
@@ -1353,57 +1447,57 @@ function Xt(t) {
1353
1447
  function T(t) {
1354
1448
  return t < 0 ? 0 : t > 1 ? 1 : t;
1355
1449
  }
1356
- const ae = {
1450
+ const le = {
1357
1451
  "style.color": "colour",
1358
1452
  fill: "fill",
1359
1453
  background: "background"
1360
1454
  };
1361
- function Ln(t, e) {
1455
+ function qn(t, e) {
1362
1456
  switch (t) {
1363
1457
  case "opacity": {
1364
- const n = z(e);
1458
+ const n = H(e);
1365
1459
  return n === null ? null : { opacity: n < 0 ? 0 : n > 1 ? 1 : n };
1366
1460
  }
1367
1461
  case "transform.translate": {
1368
1462
  if (!Array.isArray(e) || e.length !== 2) return null;
1369
- const n = z(e[0]), i = z(e[1]);
1463
+ const n = H(e[0]), i = H(e[1]);
1370
1464
  return n === null || i === null ? null : { x: n, y: i };
1371
1465
  }
1372
1466
  case "transform.scale": {
1373
- const n = z(e);
1467
+ const n = H(e);
1374
1468
  if (n !== null) return { scaleX: n, scaleY: n };
1375
1469
  if (Array.isArray(e) && e.length === 2) {
1376
- const i = z(e[0]), r = z(e[1]);
1470
+ const i = H(e[0]), r = H(e[1]);
1377
1471
  return i === null || r === null ? null : { scaleX: i, scaleY: r };
1378
1472
  }
1379
1473
  return null;
1380
1474
  }
1381
1475
  case "transform.rotate": {
1382
- const n = z(e);
1476
+ const n = H(e);
1383
1477
  return n === null ? null : { rotate: n };
1384
1478
  }
1385
1479
  case "filter.blur": {
1386
- const n = jt("blur", e);
1480
+ const n = Tt("blur", e);
1387
1481
  return n === null ? null : { blur: n };
1388
1482
  }
1389
1483
  case "filter.brightness": {
1390
- const n = jt("brightness", e);
1484
+ const n = Tt("brightness", e);
1391
1485
  return n === null ? null : { brightness: n };
1392
1486
  }
1393
1487
  default:
1394
1488
  return null;
1395
1489
  }
1396
1490
  }
1397
- function z(t) {
1491
+ function H(t) {
1398
1492
  return typeof t != "number" || !Number.isFinite(t) ? null : Object.is(t, -0) ? 0 : t;
1399
1493
  }
1400
- const zn = {
1494
+ const Gn = {
1401
1495
  kind: "spring",
1402
1496
  stiffness: 170,
1403
1497
  damping: 26,
1404
1498
  mass: 1
1405
1499
  };
1406
- function Hn(t) {
1500
+ function In(t) {
1407
1501
  switch (t) {
1408
1502
  case "opacity":
1409
1503
  return "opacity";
@@ -1417,80 +1511,80 @@ function Hn(t) {
1417
1511
  case "filter.brightness":
1418
1512
  return "filter";
1419
1513
  default:
1420
- return ae[t] ?? t;
1514
+ return le[t] ?? t;
1421
1515
  }
1422
1516
  }
1423
- const Wn = {};
1424
- function qn(t, e, n) {
1425
- const i = t.animateBindings, r = U(Ft), s = B(1), o = B(0), a = B(0), l = B(1), c = B(1), u = B(0), d = B(0), h = B(1), g = ye(
1517
+ const Yn = {};
1518
+ function Xn(t, e, n) {
1519
+ const i = t.animateBindings, r = K(Rt), a = L(1), o = L(0), s = L(0), l = L(1), c = L(1), u = L(0), d = L(0), h = L(1), g = be(
1426
1520
  [d, h],
1427
1521
  ([k, y]) => `blur(${k}px) brightness(${y})`
1428
- ), [m, A] = Ut(Wn), x = it({
1429
- opacity: s,
1522
+ ), [m, A] = vt(Yn), x = tt({
1523
+ opacity: a,
1430
1524
  x: o,
1431
- y: a,
1525
+ y: s,
1432
1526
  scaleX: l,
1433
1527
  scaleY: c,
1434
1528
  rotate: u,
1435
1529
  blur: d,
1436
1530
  brightness: h
1437
1531
  });
1438
- return ot(() => {
1532
+ return Y(() => {
1439
1533
  if (!i || Object.keys(i).length === 0) return;
1440
1534
  const k = x.current, y = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Set();
1441
1535
  let v = !1;
1442
- const $ = (b, O) => {
1443
- const V = e.transitionSignal(O).peek() ?? t.transitions?.[Hn(b)], Z = Q(V ?? zn);
1444
- return r > 0 && !w.has(b) ? { ...Z, delay: r / 1e3 } : Z;
1445
- }, j = (b, O, N) => {
1446
- const V = ae[b], Z = q(n, i[b]);
1447
- if (V !== void 0) {
1448
- const P = Pn(O);
1449
- if (P === null) {
1450
- D(`bindAnimate.${b}`, t.id);
1536
+ const $ = (b, P) => {
1537
+ const Z = e.transitionSignal(P).peek() ?? t.transitions?.[In(b)], J = et(Z ?? Gn);
1538
+ return r > 0 && !w.has(b) ? { ...J, delay: r / 1e3 } : J;
1539
+ }, _ = (b, P, N) => {
1540
+ const Z = le[b], J = G(n, i[b]);
1541
+ if (Z !== void 0) {
1542
+ const E = Ln(P);
1543
+ if (E === null) {
1544
+ B(`bindAnimate.${b}`, t.id);
1451
1545
  return;
1452
1546
  }
1453
- const L = p.get(b);
1454
- if (N || L === void 0) {
1455
- p.set(b, { current: P }), A((ut) => ({ ...ut, [V]: Xt(P) }));
1547
+ const z = p.get(b);
1548
+ if (N || z === void 0) {
1549
+ p.set(b, { current: E }), A((ut) => ({ ...ut, [Z]: Xt(E) }));
1456
1550
  return;
1457
1551
  }
1458
- const he = L.current, ge = $(b, Z);
1552
+ const ge = z.current, me = $(b, J);
1459
1553
  w.add(b), y.get(`color:${b}`)?.stop(), y.set(
1460
1554
  `color:${b}`,
1461
1555
  _t(0, 1, {
1462
- ...ge,
1556
+ ...me,
1463
1557
  onUpdate: (ut) => {
1464
- const Rt = Bn(he, P, ut);
1465
- L.current = Rt, A((me) => ({ ...me, [V]: Xt(Rt) }));
1558
+ const jt = Wn(ge, E, ut);
1559
+ z.current = jt, A((ye) => ({ ...ye, [Z]: Xt(jt) }));
1466
1560
  }
1467
1561
  })
1468
1562
  );
1469
1563
  return;
1470
1564
  }
1471
- const ct = Ln(b, O);
1565
+ const ct = qn(b, P);
1472
1566
  if (ct === null) {
1473
- b.startsWith("filter.") ? Vt(`bindAnimate.${b}`, t.id) : Gn(b, t.id);
1567
+ b.startsWith("filter.") ? Zt(`bindAnimate.${b}`, t.id) : Un(b, t.id);
1474
1568
  return;
1475
1569
  }
1476
1570
  if (N) {
1477
- for (const [P, L] of Object.entries(ct))
1478
- k[P].jump(L);
1571
+ for (const [E, z] of Object.entries(ct))
1572
+ k[E].jump(z);
1479
1573
  return;
1480
1574
  }
1481
- const pe = $(b, Z);
1575
+ const he = $(b, J);
1482
1576
  w.add(b);
1483
- for (const [P, L] of Object.entries(ct))
1484
- y.set(P, _t(k[P], L, pe));
1485
- }, K = On((b, O) => j(b, O, !1)), R = Object.entries(i).map(
1486
- ([b, O]) => xe(() => {
1487
- const N = e.signal(q(n, O)).value;
1488
- N !== void 0 && (v ? K.push(b, N) : j(b, N, !0));
1577
+ for (const [E, z] of Object.entries(ct))
1578
+ y.set(E, _t(k[E], z, he));
1579
+ }, V = Dn((b, P) => _(b, P, !1)), R = Object.entries(i).map(
1580
+ ([b, P]) => xe(() => {
1581
+ const N = e.signal(G(n, P)).value;
1582
+ N !== void 0 && (v ? V.push(b, N) : _(b, N, !0));
1489
1583
  })
1490
1584
  );
1491
1585
  return v = !0, () => {
1492
1586
  for (const b of R) b();
1493
- K.dispose();
1587
+ V.dispose();
1494
1588
  for (const b of y.values()) b.stop();
1495
1589
  };
1496
1590
  }, [t, i, e, n, r]), { motionStyle: Kt(() => {
@@ -1500,10 +1594,10 @@ function qn(t, e, n) {
1500
1594
  for (const p of Object.keys(i))
1501
1595
  switch (p) {
1502
1596
  case "opacity":
1503
- k.opacity = s, y = !0;
1597
+ k.opacity = a, y = !0;
1504
1598
  break;
1505
1599
  case "transform.translate":
1506
- k.x = o, k.y = a, y = !0;
1600
+ k.x = o, k.y = s, y = !0;
1507
1601
  break;
1508
1602
  case "transform.scale":
1509
1603
  k.scaleX = l, k.scaleY = c, y = !0;
@@ -1517,32 +1611,32 @@ function qn(t, e, n) {
1517
1611
  break;
1518
1612
  }
1519
1613
  return y ? (k.willChange = "transform, opacity, filter", k) : null;
1520
- }, [i, s, o, a, l, c, u, g]), colorProps: m };
1614
+ }, [i, a, o, s, l, c, u, g]), colorProps: m };
1521
1615
  }
1522
- function Gn(t, e) {
1616
+ function Un(t, e) {
1523
1617
  S(
1524
1618
  e,
1525
1619
  `bindAnimate.${t}`,
1526
1620
  "rejected bound value : JSON shape does not match the property type (LSML §6.3)"
1527
1621
  );
1528
1622
  }
1529
- const le = /* @__PURE__ */ new Set(["alpha", "luminance"]), xt = 180, ce = /* @__PURE__ */ new Set(["intersect", "subtract", "union"]);
1530
- let bt = 0;
1531
- function Yn() {
1532
- return bt = (bt + 1) % 1e6, `lumen-mask-${bt.toString(36)}`;
1623
+ const ce = /* @__PURE__ */ new Set(["alpha", "luminance"]), wt = 180, ue = /* @__PURE__ */ new Set(["intersect", "subtract", "union"]);
1624
+ let yt = 0;
1625
+ function Kn() {
1626
+ return yt = (yt + 1) % 1e6, `lumen-mask-${yt.toString(36)}`;
1533
1627
  }
1534
- function Xn(t) {
1628
+ function Vn(t) {
1535
1629
  return /^[A-Za-z0-9_:-]+$/.test(t) ? t : null;
1536
1630
  }
1537
1631
  function M(t) {
1538
1632
  return typeof t == "number" && Number.isFinite(t);
1539
1633
  }
1540
- function In(t, e) {
1634
+ function Zn(t, e) {
1541
1635
  if (typeof t != "object" || t === null) return null;
1542
1636
  const n = t;
1543
- if (typeof n.type != "string" || !le.has(n.type))
1637
+ if (typeof n.type != "string" || !ce.has(n.type))
1544
1638
  return S(e, "mask.type", "is not alpha|luminance ; mask omitted (ADR 002 §3.2, T4)"), null;
1545
- if (typeof n.op != "string" || !ce.has(n.op))
1639
+ if (typeof n.op != "string" || !ue.has(n.op))
1546
1640
  return S(
1547
1641
  e,
1548
1642
  "mask.op",
@@ -1552,37 +1646,37 @@ function In(t, e) {
1552
1646
  if (typeof i != "object" || i === null)
1553
1647
  return S(e, "mask.source", "is not a typed shape|image source ; mask omitted (T3)"), null;
1554
1648
  const r = i;
1555
- let s;
1649
+ let a;
1556
1650
  if (r.kind === "shape" && typeof r.ref == "string")
1557
- s = { kind: "shape", ref: r.ref };
1651
+ a = { kind: "shape", ref: r.ref };
1558
1652
  else if (r.kind === "image" && typeof r.src == "string") {
1559
1653
  const c = r.srcRect;
1560
- s = c && M(c.x) && M(c.y) && M(c.w) && M(c.h) ? { kind: "image", src: r.src, srcRect: { x: c.x, y: c.y, w: c.w, h: c.h } } : { kind: "image", src: r.src };
1654
+ a = c && M(c.x) && M(c.y) && M(c.w) && M(c.h) ? { kind: "image", src: r.src, srcRect: { x: c.x, y: c.y, w: c.w, h: c.h } } : { kind: "image", src: r.src };
1561
1655
  } else if (r.kind === "group" && typeof r.ref == "string")
1562
- s = { kind: "group", ref: r.ref };
1656
+ a = { kind: "group", ref: r.ref };
1563
1657
  else
1564
1658
  return S(
1565
1659
  e,
1566
1660
  "mask.source",
1567
1661
  "is not a typed shape|image|group source ; mask omitted (T3)"
1568
1662
  ), null;
1569
- const o = { source: s, type: n.type, op: n.op }, a = n.position;
1570
- a && M(a.x) && M(a.y) && (o.position = { x: a.x, y: a.y });
1663
+ const o = { source: a, type: n.type, op: n.op }, s = n.position;
1664
+ s && M(s.x) && M(s.y) && (o.position = { x: s.x, y: s.y });
1571
1665
  const l = n.size;
1572
1666
  return l && M(l.w) && M(l.h) && (o.size = { w: l.w, h: l.h }), o;
1573
1667
  }
1574
- function Un(t, e, n, i, r, s = !1) {
1575
- if (!le.has(t.type) || !ce.has(t.op))
1668
+ function Jn(t, e, n, i, r, a = !1) {
1669
+ if (!ce.has(t.type) || !ue.has(t.op))
1576
1670
  return S(n, "mask", "type/op outside the closed enum ; mask omitted (T4)"), null;
1577
- const o = Yn(), a = t.position?.x, l = t.position?.y, c = t.size?.w, u = t.size?.h, d = {
1578
- ...M(a) ? { x: a } : {},
1671
+ const o = Kn(), s = t.position?.x, l = t.position?.y, c = t.size?.w, u = t.size?.h, d = {
1672
+ ...M(s) ? { x: s } : {},
1579
1673
  ...M(l) ? { y: l } : {},
1580
1674
  ...M(c) ? { width: c } : {},
1581
1675
  ...M(u) ? { height: u } : {}
1582
1676
  };
1583
1677
  let h;
1584
1678
  if (t.source.kind === "image") {
1585
- const x = Jt(t.source.src, e);
1679
+ const x = Qt(t.source.src, e);
1586
1680
  if (!x.allowed)
1587
1681
  return S(
1588
1682
  n,
@@ -1611,7 +1705,7 @@ function Un(t, e, n, i, r, s = !1) {
1611
1705
  const F = Object.keys(d).length > 0 ? d : M(r?.w) && M(r?.h) ? { x: 0, y: 0, width: r.w, height: r.h } : { width: "100%", height: "100%" };
1612
1706
  h = /* @__PURE__ */ f("image", { href: t.source.src, preserveAspectRatio: "none", ...F });
1613
1707
  } else {
1614
- const x = Xn(t.source.ref);
1708
+ const x = Vn(t.source.ref);
1615
1709
  if (x === null)
1616
1710
  return S(
1617
1711
  n,
@@ -1633,12 +1727,12 @@ function Un(t, e, n, i, r, s = !1) {
1633
1727
  }
1634
1728
  ) : F;
1635
1729
  }
1636
- s && (h = /* @__PURE__ */ f("g", { transform: `translate(${xt} ${xt})`, children: h }, "feather-pad"));
1730
+ a && (h = /* @__PURE__ */ f("g", { transform: `translate(${wt} ${wt})`, children: h }, "feather-pad"));
1637
1731
  let g;
1638
- t.op === "intersect" ? g = h : t.op === "union" ? g = /* @__PURE__ */ G(J, { children: [
1732
+ t.op === "intersect" ? g = h : t.op === "union" ? g = /* @__PURE__ */ I(Q, { children: [
1639
1733
  /* @__PURE__ */ f("rect", { x: 0, y: 0, width: "100%", height: "100%", fill: "white" }),
1640
1734
  h
1641
- ] }) : g = /* @__PURE__ */ G(J, { children: [
1735
+ ] }) : g = /* @__PURE__ */ I(Q, { children: [
1642
1736
  /* @__PURE__ */ f("rect", { x: 0, y: 0, width: "100%", height: "100%", fill: "white" }),
1643
1737
  /* @__PURE__ */ f("g", { style: { filter: "invert(1)" }, children: h })
1644
1738
  ] });
@@ -1656,11 +1750,11 @@ function Un(t, e, n, i, r, s = !1) {
1656
1750
  },
1657
1751
  o
1658
1752
  ), A = `url(#${o})`;
1659
- return { def: m, style: { mask: A, WebkitMask: A }, id: o, feather: s };
1753
+ return { def: m, style: { mask: A, WebkitMask: A }, id: o, feather: a };
1660
1754
  }
1661
- const ue = /* @__PURE__ */ new Map(), fe = st(ue);
1662
- function dr(t) {
1663
- if (!t) return ue;
1755
+ const fe = /* @__PURE__ */ new Map(), de = st(fe);
1756
+ function mr(t) {
1757
+ if (!t) return fe;
1664
1758
  const e = /* @__PURE__ */ new Map(), n = [t];
1665
1759
  for (; n.length > 0; ) {
1666
1760
  const i = n.pop();
@@ -1669,59 +1763,59 @@ function dr(t) {
1669
1763
  "id",
1670
1764
  "duplicate shape id ; first occurrence kept, later ones ignored (ADR 002 A2.1 #K)"
1671
1765
  ) : e.set(i.id, i));
1672
- const s = i.children;
1673
- if (s)
1674
- for (let o = s.length - 1; o >= 0; o--) n.push(s[o]);
1766
+ const a = i.children;
1767
+ if (a)
1768
+ for (let o = a.length - 1; o >= 0; o--) n.push(a[o]);
1675
1769
  }
1676
1770
  return e;
1677
1771
  }
1678
- function pr({
1772
+ function yr({
1679
1773
  index: t,
1680
1774
  children: e
1681
1775
  }) {
1682
- return /* @__PURE__ */ f(fe.Provider, { value: t, children: e });
1776
+ return /* @__PURE__ */ f(de.Provider, { value: t, children: e });
1683
1777
  }
1684
- function Kn() {
1685
- return U(fe);
1778
+ function Qn() {
1779
+ return K(de);
1686
1780
  }
1687
- function de({ node: t, store: e }) {
1688
- return t.kind === "repeat" ? /* @__PURE__ */ f(tr, { node: t, store: e }) : /* @__PURE__ */ f(Vn, { node: t, store: e });
1781
+ function pe({ node: t, store: e }) {
1782
+ return t.kind === "repeat" ? /* @__PURE__ */ f(ir, { node: t, store: e }) : /* @__PURE__ */ f(tr, { node: t, store: e });
1689
1783
  }
1690
- function Vn({ node: t, store: e }) {
1691
- vt();
1692
- const n = At(), i = tt(), r = Kn(), s = Kt(
1693
- () => er(t, e, n),
1784
+ function tr({ node: t, store: e }) {
1785
+ xt();
1786
+ const n = Ft(), i = nt(), r = Qn(), a = Kt(
1787
+ () => or(t, e, n),
1694
1788
  // We re-build per render — signals re-render cheaply, and the
1695
1789
  // resolution itself is O(bindings) which is small. The memo is a
1696
1790
  // micro-optimisation to keep object identity stable across renders
1697
1791
  // when the inputs haven't changed.
1698
- [t, e, n, ...nr(t, e, n)]
1699
- ), o = qn(t, e, n);
1700
- Zt(t);
1701
- const a = vn[t.kind];
1702
- if (!a)
1792
+ [t, e, n, ...sr(t, e, n)]
1793
+ ), o = Xn(t, e, n);
1794
+ Jt(t);
1795
+ const s = An[t.kind];
1796
+ if (!s)
1703
1797
  return S(t.id, "kind", "unknown render kind ; node not rendered"), null;
1704
1798
  const l = {};
1705
1799
  if (t.bindings)
1706
1800
  for (const [p, w] of Object.entries(t.bindings)) {
1707
- const v = e.transitionSignal(q(n, w)).value;
1801
+ const v = e.transitionSignal(G(n, w)).value;
1708
1802
  v !== void 0 && (l[p] = v);
1709
1803
  }
1710
- const c = (p) => p in l ? l[p] : t.transitions?.[p], u = t.children?.map((p, w) => /* @__PURE__ */ f(de, { node: p, store: e }, p.id ?? w)), d = s.mask !== void 0 && typeof s.blendMode == "string" && Y(s.blendMode) !== void 0, h = {
1711
- visible: typeof s.visible == "boolean" ? s.visible : void 0,
1712
- opacity: typeof s.universal_opacity == "number" ? s.universal_opacity : void 0,
1804
+ const c = (p) => p in l ? l[p] : t.transitions?.[p], u = t.children?.map((p, w) => /* @__PURE__ */ f(pe, { node: p, store: e }, p.id ?? w)), d = a.mask !== void 0 && typeof a.blendMode == "string" && X(a.blendMode) !== void 0, h = {
1805
+ visible: typeof a.visible == "boolean" ? a.visible : void 0,
1806
+ opacity: typeof a.universal_opacity == "number" ? a.universal_opacity : void 0,
1713
1807
  // A frame applies its own static rotation (frame.tsx) so it pivots around
1714
1808
  // its centre ; the wrapper has no box for a self-positioning frame and would
1715
1809
  // pivot around a collapsed (0-height) box. Non-frames keep it on the wrapper
1716
1810
  // (they DO carry position/size there).
1717
- rotation: t.kind === "frame" ? void 0 : typeof s.rotation == "number" ? s.rotation : void 0,
1811
+ rotation: t.kind === "frame" ? void 0 : typeof a.rotation == "number" ? a.rotation : void 0,
1718
1812
  // Mirror (Figma scaleY(-1)) — like rotation, a frame mirrors itself
1719
1813
  // (frame.tsx) ; non-frames carry it on the wrapper, composed with rotation.
1720
- flipY: t.kind === "frame" ? void 0 : s.flipY === !0,
1721
- blur: typeof s.blur == "number" ? s.blur : void 0,
1722
- sizing: Zn(s.sizing),
1723
- position: t.kind === "frame" ? void 0 : Jn(s),
1724
- size: t.kind === "frame" ? void 0 : It(s),
1814
+ flipY: t.kind === "frame" ? void 0 : a.flipY === !0,
1815
+ blur: typeof a.blur == "number" ? a.blur : void 0,
1816
+ sizing: er(a.sizing),
1817
+ position: t.kind === "frame" ? void 0 : nr(a),
1818
+ size: t.kind === "frame" ? void 0 : Ut(a),
1725
1819
  // ADR 002 §3.2 (D2 / #D) — `blendMode` is a universal prop on every
1726
1820
  // primitive ; the wrapper re-validates it against the closed enum
1727
1821
  // before applying `mix-blend-mode` (T4 runtime gate). Pass the raw
@@ -1731,9 +1825,9 @@ function Vn({ node: t, store: e }) {
1731
1825
  // (inner) wrapper would fold over a transparent backdrop (the caramel
1732
1826
  // hard-light showed the raw blue wave instead of compositing over the warm
1733
1827
  // gradient). Drop it here when it will be hoisted.
1734
- blendMode: typeof s.blendMode == "string" && !d ? s.blendMode : void 0
1735
- }, g = t.children?.some(Qn) ?? !1, m = Object.keys(o.colorProps).length > 0 ? { ...s, ...o.colorProps } : s, A = /* @__PURE__ */ f(
1736
- a,
1828
+ blendMode: typeof a.blendMode == "string" && !d ? a.blendMode : void 0
1829
+ }, g = t.children?.some(rr) ?? !1, m = Object.keys(o.colorProps).length > 0 ? { ...a, ...o.colorProps } : a, A = /* @__PURE__ */ f(
1830
+ s,
1737
1831
  {
1738
1832
  resolved: m,
1739
1833
  nodeId: t.id,
@@ -1744,28 +1838,28 @@ function Vn({ node: t, store: e }) {
1744
1838
  }
1745
1839
  );
1746
1840
  let x = null;
1747
- if (s.mask !== void 0) {
1748
- const p = In(s.mask, t.id), w = ($) => {
1749
- const j = r.get($);
1750
- return j ? j.kind === "frame" ? pn(j, j.id) : fn(j, j.id) : null;
1841
+ if (a.mask !== void 0) {
1842
+ const p = Zn(a.mask, t.id), w = ($) => {
1843
+ const _ = r.get($);
1844
+ return _ ? _.kind === "frame" ? pn(_, _.id) : fn(_, _.id) : null;
1751
1845
  };
1752
1846
  let v = !1;
1753
1847
  if (p) {
1754
1848
  const $ = p.source;
1755
1849
  if (($.kind === "group" || $.kind === "shape") && typeof $.ref == "string") {
1756
- const j = r.get($.ref);
1757
- v = j ? oe(j) : !1;
1850
+ const _ = r.get($.ref);
1851
+ v = _ ? se(_) : !1;
1758
1852
  }
1759
1853
  }
1760
- x = p ? Un(p, i, t.id, w, It(s), v) : null;
1854
+ x = p ? Jn(p, i, t.id, w, Ut(a), v) : null;
1761
1855
  }
1762
1856
  const F = x !== null && x.style != null && "maskImage" in x.style;
1763
1857
  let k = A;
1764
1858
  x && F && (k = /* @__PURE__ */ f("div", { style: { width: "100%", height: "100%", ...x.style }, children: k }));
1765
- let y = /* @__PURE__ */ f(Mn, { ...h, children: k });
1859
+ let y = /* @__PURE__ */ f(jn, { ...h, children: k });
1766
1860
  if (x && !F) {
1767
- const p = x.feather ? xt : 0;
1768
- y = /* @__PURE__ */ G(
1861
+ const p = x.feather ? wt : 0;
1862
+ y = /* @__PURE__ */ I(
1769
1863
  "div",
1770
1864
  {
1771
1865
  style: {
@@ -1782,7 +1876,7 @@ function Vn({ node: t, store: e }) {
1782
1876
  );
1783
1877
  }
1784
1878
  if (x && d) {
1785
- const p = Y(s.blendMode);
1879
+ const p = X(a.blendMode);
1786
1880
  y = /* @__PURE__ */ f(
1787
1881
  "div",
1788
1882
  {
@@ -1795,66 +1889,74 @@ function Vn({ node: t, store: e }) {
1795
1889
  }
1796
1890
  );
1797
1891
  }
1798
- return o.motionStyle && (y = /* @__PURE__ */ f(I.div, { "data-lumencast-bind-animate": t.id ?? "", style: o.motionStyle, children: y })), t.keyframes ? /* @__PURE__ */ f(jn, { keyframes: t.keyframes, store: e, nodeId: t.id, children: y }) : y;
1892
+ return o.motionStyle && (y = /* @__PURE__ */ f(U.div, { "data-lumencast-bind-animate": t.id ?? "", style: o.motionStyle, children: y })), t.keyframes ? /* @__PURE__ */ f(Pn, { keyframes: t.keyframes, store: e, nodeId: t.id, children: y }) : y;
1799
1893
  }
1800
- function Zn(t) {
1894
+ function er(t) {
1801
1895
  if (typeof t != "object" || t === null) return;
1802
1896
  const e = t, n = {};
1803
1897
  return (e.x === "fixed" || e.x === "hug" || e.x === "fill") && (n.x = e.x), (e.y === "fixed" || e.y === "hug" || e.y === "fill") && (n.y = e.y), n.x !== void 0 || n.y !== void 0 ? n : void 0;
1804
1898
  }
1805
- function X(t) {
1899
+ function C(t) {
1806
1900
  return typeof t == "number" && Number.isFinite(t) ? t : void 0;
1807
1901
  }
1808
- function Jn(t) {
1809
- const e = X(t.x), n = X(t.y);
1902
+ function nr(t) {
1903
+ let e = C(t.x), n = C(t.y);
1904
+ if (e === void 0 && n === void 0) {
1905
+ const i = t.position;
1906
+ i && typeof i == "object" && (e = C(i.x), n = C(i.y));
1907
+ }
1810
1908
  if (!(e === void 0 || n === void 0))
1811
1909
  return { x: e, y: n };
1812
1910
  }
1813
- function It(t) {
1814
- const e = X(t.width), n = X(t.height);
1911
+ function Ut(t) {
1912
+ let e = C(t.width), n = C(t.height);
1913
+ if (e === void 0 && n === void 0) {
1914
+ const i = t.size;
1915
+ i && typeof i == "object" && (e = C(i.w), n = C(i.h));
1916
+ }
1815
1917
  if (!(e === void 0 && n === void 0))
1816
1918
  return { w: e, h: n };
1817
1919
  }
1818
- function Qn(t) {
1920
+ function rr(t) {
1819
1921
  if (t.kind === "frame") return !1;
1820
- const e = t.props ?? {}, n = t.bindings ?? {}, i = X(e.x) !== void 0 || "x" in n, r = X(e.y) !== void 0 || "y" in n;
1821
- return i && r;
1822
- }
1823
- function tr({ node: t, store: e }) {
1824
- vt();
1825
- const n = At();
1826
- Zt(t);
1827
- const i = t.bindings?.items, r = i === void 0 ? [] : e.signal(q(n, i)).value ?? [];
1922
+ const e = t.props ?? {}, n = t.bindings ?? {}, i = e.position, r = C(e.x) !== void 0 || "x" in n || (i ? C(i.x) !== void 0 : !1), a = C(e.y) !== void 0 || "y" in n || (i ? C(i.y) !== void 0 : !1);
1923
+ return r && a;
1924
+ }
1925
+ function ir({ node: t, store: e }) {
1926
+ xt();
1927
+ const n = Ft();
1928
+ Jt(t);
1929
+ const i = t.bindings?.items, r = i === void 0 ? [] : e.signal(G(n, i)).value ?? [];
1828
1930
  if (!Array.isArray(r)) return null;
1829
- const s = t.children?.[0];
1830
- if (!s) return null;
1931
+ const a = t.children?.[0];
1932
+ if (!a) return null;
1831
1933
  const o = typeof t.stagger_ms == "number" ? t.stagger_ms : 0;
1832
- return /* @__PURE__ */ f(J, { children: r.map((a, l) => {
1833
- const c = _n(l, o), u = /* @__PURE__ */ f($n, { prefix: `${i ?? ""}.${l}`, children: /* @__PURE__ */ f(de, { node: s, store: e }) }, l);
1834
- return c <= 0 ? u : /* @__PURE__ */ f(Ft.Provider, { value: c, children: u }, l);
1934
+ return /* @__PURE__ */ f(Q, { children: r.map((s, l) => {
1935
+ const c = On(l, o), u = /* @__PURE__ */ f(Fn, { prefix: `${i ?? ""}.${l}`, children: /* @__PURE__ */ f(pe, { node: a, store: e }) }, l);
1936
+ return c <= 0 ? u : /* @__PURE__ */ f(Rt.Provider, { value: c, children: u }, l);
1835
1937
  }) });
1836
1938
  }
1837
- function er(t, e, n) {
1939
+ function or(t, e, n) {
1838
1940
  const i = { ...t.props ?? {} };
1839
1941
  if (t.bindings)
1840
- for (const [r, s] of Object.entries(t.bindings)) {
1841
- const o = q(n, s);
1942
+ for (const [r, a] of Object.entries(t.bindings)) {
1943
+ const o = G(n, a);
1842
1944
  i[r] = e.signal(o).value;
1843
1945
  }
1844
1946
  return i;
1845
1947
  }
1846
- function nr(t, e, n) {
1948
+ function sr(t, e, n) {
1847
1949
  if (!t.bindings) return [];
1848
1950
  const i = [];
1849
1951
  for (const r of Object.values(t.bindings))
1850
- i.push(e.signal(q(n, r)).value);
1952
+ i.push(e.signal(G(n, r)).value);
1851
1953
  return i;
1852
1954
  }
1853
1955
  export {
1854
- ur as A,
1855
- pr as S,
1856
- de as T,
1857
- dr as b,
1858
- fr as r
1956
+ hr as A,
1957
+ yr as S,
1958
+ pe as T,
1959
+ mr as b,
1960
+ gr as r
1859
1961
  };
1860
- //# sourceMappingURL=tree-BLIxJbD3.js.map
1962
+ //# sourceMappingURL=tree-CgU_sUwI.js.map