@lumencast/runtime 0.8.0 → 0.10.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 (99) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/animate/keyframes.js +8 -1
  3. package/dist/animate/keyframes.js.map +1 -1
  4. package/dist/app.d.ts +9 -1
  5. package/dist/app.d.ts.map +1 -1
  6. package/dist/app.js +4 -1
  7. package/dist/app.js.map +1 -1
  8. package/dist/{broadcast-Gcd-dmC7.js → broadcast-L5wm2I6J.js} +3 -3
  9. package/dist/{broadcast-Gcd-dmC7.js.map → broadcast-L5wm2I6J.js.map} +1 -1
  10. package/dist/{control-C5TfClga.js → control-eEUG7unp.js} +4 -4
  11. package/dist/{control-C5TfClga.js.map → control-eEUG7unp.js.map} +1 -1
  12. package/dist/index-Clrya_9l.js +1281 -0
  13. package/dist/index-Clrya_9l.js.map +1 -0
  14. package/dist/index.d.ts +3 -0
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.html +1 -1
  17. package/dist/index.js +11 -0
  18. package/dist/index.js.map +1 -1
  19. package/dist/lumencast.js +17 -12
  20. package/dist/mount.d.ts.map +1 -1
  21. package/dist/mount.js +16 -0
  22. package/dist/mount.js.map +1 -1
  23. package/dist/overlay/runtime-context.d.ts +21 -0
  24. package/dist/overlay/runtime-context.d.ts.map +1 -1
  25. package/dist/overlay/runtime-context.js +8 -0
  26. package/dist/overlay/runtime-context.js.map +1 -1
  27. package/dist/render/bundle.d.ts +1 -1
  28. package/dist/render/bundle.d.ts.map +1 -1
  29. package/dist/render/bundle.js +4 -0
  30. package/dist/render/bundle.js.map +1 -1
  31. package/dist/render/keyframe-player.d.ts.map +1 -1
  32. package/dist/render/keyframe-player.js +15 -1
  33. package/dist/render/keyframe-player.js.map +1 -1
  34. package/dist/render/primitives/capture.d.ts +49 -0
  35. package/dist/render/primitives/capture.d.ts.map +1 -0
  36. package/dist/render/primitives/capture.js +203 -0
  37. package/dist/render/primitives/capture.js.map +1 -0
  38. package/dist/render/primitives/index.d.ts.map +1 -1
  39. package/dist/render/primitives/index.js +7 -0
  40. package/dist/render/primitives/index.js.map +1 -1
  41. package/dist/render/primitives/live-peer-video.d.ts +27 -0
  42. package/dist/render/primitives/live-peer-video.d.ts.map +1 -0
  43. package/dist/render/primitives/live-peer-video.js +64 -0
  44. package/dist/render/primitives/live-peer-video.js.map +1 -0
  45. package/dist/render/primitives/media.d.ts +37 -12
  46. package/dist/render/primitives/media.d.ts.map +1 -1
  47. package/dist/render/primitives/media.js +43 -17
  48. package/dist/render/primitives/media.js.map +1 -1
  49. package/dist/render/primitives/meet-peer.d.ts +31 -0
  50. package/dist/render/primitives/meet-peer.d.ts.map +1 -0
  51. package/dist/render/primitives/meet-peer.js +46 -0
  52. package/dist/render/primitives/meet-peer.js.map +1 -0
  53. package/dist/render/prop-allowlist.d.ts.map +1 -1
  54. package/dist/render/prop-allowlist.js +32 -1
  55. package/dist/render/prop-allowlist.js.map +1 -1
  56. package/dist/render/tree.js +42 -8
  57. package/dist/render/tree.js.map +1 -1
  58. package/dist/{status-pill-BaLQoIDl.js → status-pill-elORkMrh.js} +2 -2
  59. package/dist/{status-pill-BaLQoIDl.js.map → status-pill-elORkMrh.js.map} +1 -1
  60. package/dist/{test-CA30C2By.js → test-7q_KJkdX.js} +4 -4
  61. package/dist/{test-CA30C2By.js.map → test-7q_KJkdX.js.map} +1 -1
  62. package/dist/{tree-1coZ32nd.js → tree-BMxx5170.js} +773 -604
  63. package/dist/tree-BMxx5170.js.map +1 -0
  64. package/dist/types.d.ts +23 -0
  65. package/dist/types.d.ts.map +1 -1
  66. package/dist/webrtc/index.d.ts +76 -0
  67. package/dist/webrtc/index.d.ts.map +1 -0
  68. package/dist/webrtc/index.js +180 -0
  69. package/dist/webrtc/index.js.map +1 -0
  70. package/dist/webrtc/meet-viewer.d.ts +139 -0
  71. package/dist/webrtc/meet-viewer.d.ts.map +1 -0
  72. package/dist/webrtc/meet-viewer.js +379 -0
  73. package/dist/webrtc/meet-viewer.js.map +1 -0
  74. package/dist/webrtc/peer-stream-registry.d.ts +21 -0
  75. package/dist/webrtc/peer-stream-registry.d.ts.map +1 -0
  76. package/dist/webrtc/peer-stream-registry.js +77 -0
  77. package/dist/webrtc/peer-stream-registry.js.map +1 -0
  78. package/package.json +4 -4
  79. package/src/animate/keyframes.ts +8 -1
  80. package/src/app.tsx +14 -0
  81. package/src/index.ts +40 -0
  82. package/src/mount.ts +16 -0
  83. package/src/overlay/runtime-context.tsx +24 -0
  84. package/src/render/bundle.ts +19 -1
  85. package/src/render/keyframe-player.tsx +14 -1
  86. package/src/render/primitives/capture.tsx +255 -0
  87. package/src/render/primitives/index.ts +7 -0
  88. package/src/render/primitives/live-peer-video.tsx +90 -0
  89. package/src/render/primitives/media.tsx +66 -17
  90. package/src/render/primitives/meet-peer.tsx +57 -0
  91. package/src/render/prop-allowlist.ts +32 -1
  92. package/src/render/tree.tsx +44 -8
  93. package/src/types.ts +23 -0
  94. package/src/webrtc/index.ts +252 -0
  95. package/src/webrtc/meet-viewer.ts +497 -0
  96. package/src/webrtc/peer-stream-registry.ts +93 -0
  97. package/dist/index-N-VqrIxN.js +0 -885
  98. package/dist/index-N-VqrIxN.js.map +0 -1
  99. package/dist/tree-1coZ32nd.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 wt } from "@preact/signals-react/runtime";
3
- import { motion as I, useMotionValue as B, useTransform as pe, animate as Ft } from "framer-motion";
4
- import { createContext as it, useContext as K, useRef as mt, useEffect as Gt, useState as he, useMemo as Yt } from "react";
5
- import { e as S, r as ot, m as st, t as Q, s as ge, w as Xt, F as me, c as _t, a as It } from "./index-N-VqrIxN.js";
6
- import { checkHostAllowed as Kt } from "@lumencast/protocol";
7
- import { effect as ye } from "@preact/signals-react";
8
- function be({ resolved: t, children: e, establishesContainingBlock: n }) {
9
- const i = t.direction ?? "vertical", r = Rt(t.gap, 0), s = t.wrap === !0, o = Rt(t.crossGap, 0), a = t.align ?? "stretch", l = t.justify ?? "flex-start", c = i === "horizontal", u = {
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 jt } from "framer-motion";
4
+ import { createContext as st, useContext as K, useRef as tt, useState as vt, useEffect as Y, useMemo as Ut } from "react";
5
+ import { e as S, r as at, m as lt, t as et, a as Kt, s as ke, w as Vt, F as we, c as Rt, b as Zt } from "./index-Clrya_9l.js";
6
+ import { checkHostAllowed as Jt } from "@lumencast/protocol";
7
+ import { effect as xe } from "@preact/signals-react";
8
+ function ve({ resolved: t, children: e, establishesContainingBlock: n }) {
9
+ const i = t.direction ?? "vertical", r = Tt(t.gap, 0), a = t.wrap === !0, o = Tt(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 Rt(t, e) {
21
+ function Tt(t, e) {
22
22
  return typeof t == "number" && Number.isFinite(t) ? t : e;
23
23
  }
24
- function ke({ resolved: t, children: e, establishesContainingBlock: n }) {
25
- const i = t.cols ?? "1fr", r = t.rows ?? "auto", s = t.gap ?? 0;
24
+ function $e({ resolved: t, children: e, establishesContainingBlock: n }) {
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 ke({ 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,66 +39,66 @@ function ke({ resolved: t, children: e, establishesContainingBlock: n }) {
39
39
  }
40
40
  );
41
41
  }
42
- const we = 64, xe = /^[#a-zA-Z0-9(),.% ]{1,64}$/, $e = /^#(?:[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})?`, Ut = String.raw`(?:0|1|0?\.\d{1,4}|${W}%)`, R = String.raw`[ ]{0,4}`, ve = new RegExp(
43
- `^rgba?\\(${R}(${W})(%?)${R},${R}(${W})(%?)${R},${R}(${W})(%?)${R}(?:,${R}${Ut}${R})?\\)$`
44
- ), Se = new RegExp(
45
- `^hsla?\\(${R}(${W})(?:deg)?${R},${R}(${W})%${R},${R}(${W})%${R}(?:,${R}${Ut}${R})?\\)$`
46
- ), Me = new Set(
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})?`, Qt = 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}${Qt}${j})?\\)$`
44
+ ), _e = new RegExp(
45
+ `^hsla?\\(${j}(${q})(?:deg)?${j},${j}(${q})%${j},${j}(${q})%${j}(?:,${j}${Qt}${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
- if (e.length === 0 || e.length > we) return null;
52
+ if (e.length === 0 || e.length > Se) return null;
53
53
  const n = e.toLowerCase();
54
- if (n.includes("url(") || e.includes(";") || e.includes("}") || !xe.test(e)) return null;
55
- if (e.startsWith("#")) return $e.test(e) ? e : null;
54
+ if (n.includes("url(") || e.includes(";") || e.includes("}") || !Me.test(e)) return null;
55
+ if (e.startsWith("#")) return Ae.test(e) ? e : null;
56
56
  if (n.startsWith("rgb")) {
57
- const i = ve.exec(n);
57
+ const i = Fe.exec(n);
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
- const i = Se.exec(n);
67
+ const i = _e.exec(n);
68
68
  return !i || Number(i[1]) > 360 || Number(i[2]) > 100 || Number(i[3]) > 100 ? null : n;
69
69
  }
70
- return Me.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 Vt = it(void 0);
80
- function nr({
79
+ const te = st(void 0);
80
+ function pr({
81
81
  hosts: t,
82
82
  children: e
83
83
  }) {
84
- return /* @__PURE__ */ f(Vt.Provider, { value: t, children: e });
84
+ return /* @__PURE__ */ f(te.Provider, { value: t, children: e });
85
85
  }
86
- function tt() {
87
- return K(Vt);
86
+ function nt() {
87
+ return K(te);
88
88
  }
89
- function rr(t) {
89
+ function hr(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");
93
93
  return i.length > 0 ? i : void 0;
94
94
  }
95
- function xt(t, e, n, i) {
95
+ function $t(t, e, n, i) {
96
96
  if (typeof t != "string" || t.length === 0) return;
97
- const r = Kt(t, e);
97
+ const r = Jt(t, e);
98
98
  if (r.allowed) return t;
99
99
  S(i, n, r.reason ?? "asset host/scheme rejected");
100
100
  }
101
- const Ae = /* @__PURE__ */ new Set([
101
+ const Re = /* @__PURE__ */ new Set([
102
102
  "normal",
103
103
  "multiply",
104
104
  "screen",
@@ -118,77 +118,77 @@ const Ae = /* @__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" && Ae.has(t) ? t : void 0;
121
+ function X(t) {
122
+ return typeof t == "string" && Re.has(t) ? t : void 0;
123
123
  }
124
- const Fe = /* @__PURE__ */ new Set(["cover", "contain", "fill", "none", "scale-down"]);
125
- function _e(t) {
126
- return typeof t == "string" && Fe.has(t) ? t : void 0;
124
+ const Te = /* @__PURE__ */ new Set(["cover", "contain", "fill", "none", "scale-down"]);
125
+ function Ce(t) {
126
+ return typeof t == "string" && Te.has(t) ? t : void 0;
127
127
  }
128
- let ct = 0;
129
- function Tt() {
130
- return ct = (ct + 1) % 1e6, `lumen-grad-${ct.toString(36)}`;
128
+ let ft = 0;
129
+ function Ct() {
130
+ return ft = (ft + 1) % 1e6, `lumen-grad-${ft.toString(36)}`;
131
131
  }
132
- function Re(t) {
133
- const e = Y(t.blendMode);
132
+ function Oe(t) {
133
+ const e = X(t.blendMode);
134
134
  if (t.kind === "solid") {
135
- const a = t.opacity !== void 0 ? yt(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 = Tt(), l = je(t.objectFit);
139
+ const s = Ct(), l = Pe(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 = Tt();
144
+ const n = Ct();
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
- const h = Math.hypot(d[0], d[1]) || 1, g = d[0] / h, A = d[1] / h;
150
- a = 0.5 - 0.5 * g, l = 0.5 - 0.5 * A, c = 0.5 + 0.5 * g, u = 0.5 + 0.5 * A;
149
+ const g = Math.hypot(d[0], d[1]) || 1, m = d[0] / g, A = d[1] / g;
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
- const g = ((t.angle_deg ?? 0) - 90) * Math.PI / 180;
153
- a = 0.5 - 0.5 * Math.cos(g), l = 0.5 - 0.5 * Math.sin(g), c = 0.5 + 0.5 * Math.cos(g), u = 0.5 + 0.5 * Math.sin(g);
152
+ const m = ((t.angle_deg ?? 0) - 90) * Math.PI / 180;
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}%`,
164
- children: t.stops.map((h, g) => /* @__PURE__ */ f(
164
+ children: t.stops.map((g, m) => /* @__PURE__ */ f(
165
165
  "stop",
166
166
  {
167
- offset: h.offset,
168
- stopColor: h.color,
169
- ...h.opacity !== void 0 ? { stopOpacity: h.opacity } : {}
167
+ offset: g.offset,
168
+ stopColor: g.color,
169
+ ...g.opacity !== void 0 ? { stopOpacity: g.opacity } : {}
170
170
  },
171
- g
171
+ m
172
172
  ))
173
173
  },
174
174
  n
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 Te(t) {
191
+ function Ne(t) {
192
192
  switch (t) {
193
193
  case "contain":
194
194
  case "scale-down":
@@ -202,7 +202,7 @@ function Te(t) {
202
202
  return "cover";
203
203
  }
204
204
  }
205
- function je(t) {
205
+ function Pe(t) {
206
206
  switch (t) {
207
207
  case "contain":
208
208
  case "scale-down":
@@ -216,49 +216,49 @@ function je(t) {
216
216
  return "xMidYMid slice";
217
217
  }
218
218
  }
219
- function Ne(t, e) {
219
+ function Ee(t, e) {
220
220
  const n = [], i = [];
221
- for (const a of t) {
222
- const l = Oe(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 = Te(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 = Ne(o.objectFit), r.backgroundPosition = "center", r.backgroundRepeat = "no-repeat"), r;
230
230
  }
231
- function Ce(t) {
231
+ function De(t) {
232
232
  return `url("${t.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}")`;
233
233
  }
234
- function Oe(t, e) {
234
+ function Be(t, e) {
235
235
  if (t.kind === "image")
236
- return Ce(t.src);
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 ? yt(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 ? yt(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 yt(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");
@@ -266,7 +266,7 @@ function yt(t, e) {
266
266
  }
267
267
  return `color-mix(in srgb, ${t} ${e * 100}%, transparent)`;
268
268
  }
269
- function Pe(t, e, n) {
269
+ function Le(t, e, n) {
270
270
  const i = [];
271
271
  for (const r of t) {
272
272
  if (r.kind === "image") {
@@ -274,85 +274,85 @@ function Pe(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 Zt(t, e, n) {
299
+ function ee(t, e, n) {
300
300
  if (!Array.isArray(t)) return [];
301
301
  if (e !== void 0)
302
302
  for (const i of t)
303
- jt(i) || S(
303
+ Ot(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(jt).map((i) => {
308
+ return t.filter(Ot).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 = _e(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 jt(t) {
333
+ function Ot(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 Jt(t, e, n, i) {
339
- return t.filter((r) => r.kind !== "image" ? !0 : xt(r.src, e, `${n}.src`, i) !== void 0);
338
+ function ne(t, e, n, i) {
339
+ return t.filter((r) => r.kind !== "image" ? !0 : $t(r.src, e, `${n}.src`, i) !== void 0);
340
340
  }
341
- function Ee({
341
+ function ze({
342
342
  resolved: t,
343
343
  nodeId: e,
344
344
  transitionFor: n,
345
345
  animateInitial: i,
346
346
  children: r
347
347
  }) {
348
- const s = N(t.x, 0), o = N(t.y, 0), a = Nt(t.width), l = Nt(t.height), c = N(t.opacity, 1), u = N(t.scale, 1), d = N(t.rotate, N(t.rotation, 0)), m = t.flipY === !0, h = N(t.radius, 0), g = t.background, A = g === void 0 ? void 0 : E(g);
349
- g !== void 0 && A === null && D("frame.background", e);
350
- const x = tt(), F = Jt(
351
- Zt(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 = ne(
351
+ ee(t.backgrounds, "frame.backgrounds", e),
352
352
  x,
353
353
  "frame.backgrounds",
354
354
  e
355
- ), k = De(t.clipsContent, e), y = ot(
355
+ ), k = He(t.clipsContent, e), y = at(
356
356
  n,
357
357
  ["opacity", "scale", "rotate", "x", "y"],
358
358
  i
@@ -360,7 +360,7 @@ function Ee({
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
@@ -373,49 +373,49 @@ function Ee({
373
373
  // animates, so it stays off the 0-layout-event hot path (ADR 001
374
374
  // §3.2.5). `false` => omit the declaration (CSS initial = visible).
375
375
  ...k ? { overflow: "hidden" } : {},
376
- ...h > 0 ? { borderRadius: h } : {}
376
+ ...g > 0 ? { borderRadius: g } : {}
377
377
  };
378
- F.length > 0 ? Object.assign(p, Ne(F, e)) : A != null && (p.background = A);
379
- const { filter: w, boxShadow: $ } = Be(t.shadow, e);
380
- $ !== void 0 && (p.boxShadow = $), w !== void 0 && (p.filter = w);
381
- const v = st(
382
- { opacity: c, x: s, y: o, scale: u, rotate: d, ...m ? { scaleY: -1 } : {} },
378
+ F.length > 0 ? Object.assign(p, Ee(F, e)) : A != null && (p.background = A);
379
+ const { filter: w, boxShadow: v } = We(t.shadow, e);
380
+ v !== void 0 && (p.boxShadow = v), w !== void 0 && (p.filter = w);
381
+ const $ = lt(
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
- initial: v.initial,
391
- animate: v.animate,
392
- transition: Q(y),
390
+ initial: $.initial,
391
+ animate: $.animate,
392
+ transition: et(y),
393
393
  children: r
394
394
  }
395
395
  );
396
396
  }
397
- function De(t, e) {
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 N(t, e) {
400
+ function O(t, e) {
401
401
  return typeof t == "number" && Number.isFinite(t) ? t : e;
402
402
  }
403
- function Be(t, e) {
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 = N(o.x, 0), c = N(o.y, 0), u = N(o.blur, 0), d = N(o.spread, 0), m = o.inset === !0;
414
- if (!m && d === 0)
415
- n.push(`drop-shadow(${l}px ${c}px ${u / 2}px ${a})`);
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
+ if (!h && d === 0)
415
+ n.push(`drop-shadow(${l}px ${c}px ${u / 2}px ${s})`);
416
416
  else {
417
- const h = m ? "inset " : "";
418
- i.push(`${h}${l}px ${c}px ${u}px ${d}px ${a}`);
417
+ const g = h ? "inset " : "";
418
+ i.push(`${g}${l}px ${c}px ${u}px ${d}px ${s}`);
419
419
  }
420
420
  }
421
421
  const r = {};
@@ -424,125 +424,125 @@ function Be(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 Le = /* @__PURE__ */ new Set(["none", "uppercase", "lowercase", "capitalize"]), He = /* @__PURE__ */ new Set(["none", "underline", "line-through"]), ze = /* @__PURE__ */ new Set(["normal", "italic", "oblique"]), We = 1e3, qe = 100, Ct = 1e3, Ge = /^[a-zA-Z0-9 ,.'"_-]{1,256}$/;
428
- function Ye(t) {
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, Pt = 1e3, Ue = /^[a-zA-Z0-9 ,.'"_-]{1,256}$/;
428
+ function Ke(t) {
429
429
  if (typeof t != "string") return null;
430
430
  const e = t.trim();
431
- return e.length === 0 ? null : Ge.test(e) ? e : null;
431
+ return e.length === 0 ? null : Ue.test(e) ? e : null;
432
432
  }
433
- function Xe({ 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;
433
+ function Ve({ resolved: t, nodeId: e, transitionFor: n, animateInitial: i }) {
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
- const g = Ye(t.font);
438
- g === null ? S(e, "text.font", "rejected fontFamily : outside the family-list grammar") : a = g;
437
+ const m = Ke(t.font);
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 g = E(t.colour);
443
- g === null ? D("text.colour", e) : l = g;
442
+ const m = D(t.colour);
443
+ m === null ? B("text.colour", e) : l = m;
444
444
  }
445
- const c = t.align ?? "start", u = Ie(t.opacity, 1), d = Ke(t, e), m = ot(n, ["opacity", "value"], i), h = st({ opacity: u }, i, e);
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,
458
458
  ...d
459
459
  },
460
- initial: h.initial,
461
- animate: h.animate,
462
- transition: Q(m),
460
+ initial: g.initial,
461
+ animate: g.animate,
462
+ transition: et(h),
463
463
  children: r
464
464
  }
465
465
  );
466
466
  }
467
- function Ie(t, e) {
467
+ function Ze(t, e) {
468
468
  return typeof t == "number" && Number.isFinite(t) ? t : e;
469
469
  }
470
- function Ke(t, e) {
471
- const n = Ot(
470
+ function Je(t, e) {
471
+ const n = Et(
472
472
  t.lineHeight,
473
473
  0,
474
- qe,
474
+ Xe,
475
475
  "text.lineHeight",
476
476
  e
477
- ), i = Ot(
477
+ ), i = Et(
478
478
  t.letterSpacing,
479
- -Ct,
480
- Ct,
479
+ -Pt,
480
+ Pt,
481
481
  "text.letterSpacing",
482
482
  e
483
- ), r = ut(
483
+ ), r = dt(
484
484
  t.textTransform,
485
- Le,
485
+ qe,
486
486
  "text.textTransform",
487
487
  e
488
- ), s = ut(
488
+ ), a = dt(
489
489
  t.textDecoration,
490
- He,
490
+ Ge,
491
491
  "text.textDecoration",
492
492
  e
493
- ), o = ut(t.fontStyle, ze, "text.fontStyle", e), a = Ue(t.maxLines, We, "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
  } : {}
508
508
  };
509
509
  }
510
- function ut(t, e, n, i) {
510
+ function dt(t, e, n, i) {
511
511
  if (t !== void 0) {
512
512
  if (typeof t == "string" && e.has(t)) return t;
513
- $t(n, i);
513
+ St(n, i);
514
514
  }
515
515
  }
516
- function Ot(t, e, n, i, r) {
516
+ function Et(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
- $t(i, r);
519
+ St(i, r);
520
520
  }
521
521
  }
522
- function Ue(t, e, n, i) {
522
+ function Qe(t, e, n, i) {
523
523
  if (t !== void 0) {
524
524
  if (typeof t == "number" && Number.isInteger(t) && t >= 1 && t <= e) return t;
525
- $t(n, i);
525
+ St(n, i);
526
526
  }
527
527
  }
528
- function $t(t, e) {
528
+ function St(t, e) {
529
529
  S(
530
530
  e,
531
531
  t,
532
532
  "rejected typography value : outside the field's spec'd grammar or caps"
533
533
  );
534
534
  }
535
- function Ve({ resolved: t, nodeId: e, transitionFor: n, animateInitial: i }) {
536
- const r = tt(), s = xt(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 = Ze(t.opacity, 1), u = Pt(t.width, "100%"), d = Pt(t.height, "100%"), m = ot(n, ["opacity", "src"], i), h = st({ opacity: c }, i, e);
535
+ function tn({ resolved: t, nodeId: e, transitionFor: n, animateInitial: i }) {
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 = Dt(t.width, "100%"), d = Dt(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
@@ -553,55 +553,55 @@ function Ve({ resolved: t, nodeId: e, transitionFor: n, animateInitial: i }) {
553
553
  // image's contribution (the diagonal light streaks, the warm Ruby) is
554
554
  // lost. Static images don't need the compositor hint anyway.
555
555
  },
556
- initial: h.initial,
557
- animate: h.animate,
558
- transition: Q(m),
556
+ initial: g.initial,
557
+ animate: g.animate,
558
+ transition: et(h),
559
559
  draggable: !1
560
560
  }
561
561
  );
562
562
  }
563
- function Ze(t, e) {
563
+ function en(t, e) {
564
564
  return typeof t == "number" && Number.isFinite(t) ? t : e;
565
565
  }
566
- function Pt(t, e) {
566
+ function Dt(t, e) {
567
567
  return typeof t == "number" && Number.isFinite(t) ? `${t}px` : typeof t == "string" && t.length > 0 ? t : e;
568
568
  }
569
- const Je = 8192, Qe = 4e3, tn = 64, en = new Set("MmLlHhVvCcSsQqTtAaZz");
570
- function ft(t) {
569
+ const nn = 8192, rn = 4e3, on = 64, sn = new Set("MmLlHhVvCcSsQqTtAaZz");
570
+ function pt(t) {
571
571
  return t >= 48 && t <= 57;
572
572
  }
573
- function nn(t) {
573
+ function an(t) {
574
574
  return t === 32 || t === 9 || t === 13 || t === 10 || t === 44;
575
575
  }
576
- function Et(t) {
577
- if (typeof t != "string" || t.length === 0 || t.length > Je) return null;
576
+ function Bt(t) {
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 (nn(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
- if (en.has(l)) {
592
- if (!o && l !== "M" && l !== "m" || (o = !0, s++, s > Qe)) return null;
591
+ if (sn.has(l)) {
592
+ if (!o && l !== "M" && l !== "m" || (o = !0, a++, a > rn)) return null;
593
593
  r++;
594
594
  continue;
595
595
  }
596
596
  if (!o) return null;
597
597
  (l === "+" || l === "-") && r++;
598
598
  let c = 0;
599
- for (; r < i && ft(e.charCodeAt(r)); )
599
+ for (; r < i && pt(e.charCodeAt(r)); )
600
600
  r++, c++;
601
601
  if (r < i && e[r] === ".") {
602
602
  r++;
603
603
  let u = 0;
604
- for (; r < i && ft(e.charCodeAt(r)); )
604
+ for (; r < i && pt(e.charCodeAt(r)); )
605
605
  r++, u++;
606
606
  if (u === 0 && r < i && e[r] === ".") return null;
607
607
  c += u;
@@ -610,75 +610,75 @@ function Et(t) {
610
610
  if (r < i && (e[r] === "e" || e[r] === "E")) {
611
611
  r++, r < i && (e[r] === "+" || e[r] === "-") && r++;
612
612
  let u = 0;
613
- for (; r < i && ft(e.charCodeAt(r)); )
613
+ for (; r < i && pt(e.charCodeAt(r)); )
614
614
  r++, u++;
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
- function rn(t, e) {
620
+ function ln(t, e) {
621
621
  const n = t.paths, i = t.pathData;
622
622
  if (Array.isArray(n)) {
623
- i !== void 0 && z(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++) {
626
- if (r.length >= tn) {
627
- z(e, "shape.paths", "subpath cap exceeded ; remaining entries dropped");
625
+ for (let a = 0; a < n.length; a++) {
626
+ if (r.length >= on) {
627
+ W(e, "shape.paths", "subpath cap exceeded ; remaining entries dropped");
628
628
  break;
629
629
  }
630
- const o = n[s], a = Et(
630
+ const o = n[a], s = Bt(
631
631
  typeof o == "object" && o !== null ? o.data : void 0
632
632
  );
633
- if (a === null) {
634
- z(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: on(o?.windingRule, e) });
637
+ r.push({ d: s, fillRule: cn(o?.windingRule, e) });
638
638
  }
639
- return r.length === 0 && n.length > 0 && z(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 = Et(i);
643
- return r === null ? (z(e, "shape.pathData", "not a strict SVG path grammar (allowlist/caps)"), []) : [{ d: r, fillRule: "nonzero" }];
642
+ const r = Bt(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 z(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
- function on(t, e) {
648
- return t === void 0 || t === "NONZERO" ? "nonzero" : t === "EVENODD" ? "evenodd" : (z(e, "shape.paths.windingRule", "unknown winding rule ; defaulting to nonzero"), "nonzero");
647
+ function cn(t, e) {
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 z(t, e, n) {
650
+ function W(t, e, n) {
651
651
  S(t, e, n);
652
652
  }
653
- function sn(t) {
653
+ function un(t) {
654
654
  return t.geometry ?? t.kind ?? "rect";
655
655
  }
656
- function dt(t, e) {
656
+ function ht(t, e) {
657
657
  return typeof t == "number" && Number.isFinite(t) ? t : e;
658
658
  }
659
- function vt(t, e, n, i = "geom") {
660
- const r = sn(t), s = dt(t.width, 100), o = dt(t.height, 100), a = dt(t.radius, 0), l = e.stroke ?? "none", c = e.strokeWidth ?? 0, u = e.mixBlendMode !== void 0 ? { mixBlendMode: e.mixBlendMode } : void 0;
659
+ function Mt(t, e, n, i = "geom") {
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
- const d = rn(t, n);
663
- return /* @__PURE__ */ f("g", { style: u, children: d.map((m, h) => /* @__PURE__ */ f(
662
+ const d = ln(t, n);
663
+ return /* @__PURE__ */ f("g", { style: u, children: d.map((h, g) => /* @__PURE__ */ f(
664
664
  "path",
665
665
  {
666
- d: m.d,
667
- fillRule: m.fillRule,
666
+ d: h.d,
667
+ fillRule: h.fillRule,
668
668
  fill: e.fill,
669
669
  stroke: l,
670
670
  strokeWidth: c
671
671
  },
672
- h
672
+ g
673
673
  )) }, i);
674
674
  }
675
675
  return r === "circle" ? /* @__PURE__ */ f(
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 vt(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 vt(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
@@ -714,38 +714,38 @@ function vt(t, e, n, i = "geom") {
714
714
  i
715
715
  );
716
716
  }
717
- function an(t, e) {
717
+ function fn(t, e) {
718
718
  if (t.kind !== "shape") return null;
719
719
  const n = t.props ?? {};
720
- return vt(n, { fill: "white" }, e, "mask-cover");
720
+ return Mt(n, { fill: "white" }, e, "mask-cover");
721
721
  }
722
- const ln = 64, Qt = 1;
723
- function te(t) {
722
+ const dn = 64, re = 1;
723
+ function ie(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 cn(t, e, n = Qt, i = ln) {
730
+ function pn(t, e, n = re, i = dn) {
731
731
  if (t.kind !== "frame") return null;
732
- const r = ne(t, e, n, i, "grp");
732
+ const r = se(t, e, n, i, "grp");
733
733
  return r.length === 0 ? null : /* @__PURE__ */ f("g", { children: r }, "mask-group-cover");
734
734
  }
735
- function ee(t, e = Qt) {
735
+ function oe(t, e = re) {
736
736
  if (t.kind !== "frame") return !1;
737
737
  for (const n of t.children ?? [])
738
- if (!te(n) && (rt(n.props, "blur") > 0 || n.kind === "frame" && e > 0 && ee(n, e - 1)))
738
+ if (!ie(n) && (ot(n.props, "blur") > 0 || n.kind === "frame" && e > 0 && oe(n, e - 1)))
739
739
  return !0;
740
740
  return !1;
741
741
  }
742
- function ne(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 (te(c)) continue;
748
- if (a >= i) {
742
+ function se(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 (ie(c)) continue;
748
+ if (s >= i) {
749
749
  S(
750
750
  e,
751
751
  "mask.source.ref",
@@ -755,107 +755,171 @@ function ne(t, e, n, i, r) {
755
755
  }
756
756
  let u = null;
757
757
  if (c.kind === "shape")
758
- u = vt(c.props ?? {}, { fill: "white" }, c.id, `${r}-${l}`);
758
+ u = Mt(c.props ?? {}, { fill: "white" }, c.id, `${r}-${l}`);
759
759
  else if (c.kind === "frame" && n > 0) {
760
- const g = ne(c, e, n - 1, i, `${r}-${l}`);
761
- g.length > 0 && (u = /* @__PURE__ */ f("g", { children: g }, `${r}-${l}`));
760
+ const m = se(c, e, n - 1, i, `${r}-${l}`);
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
- const g = `lumen-mcov-blur-${e ?? "x"}-${r}-${l}`;
767
- u = /* @__PURE__ */ G("g", { children: [
768
- /* @__PURE__ */ f("filter", { id: g, x: "-120%", y: "-120%", width: "340%", height: "340%", children: /* @__PURE__ */ f("feGaussianBlur", { stdDeviation: d / 2 }) }),
769
- /* @__PURE__ */ f("g", { filter: `url(#${g})`, children: u })
766
+ const m = `lumen-mcov-blur-${e ?? "x"}-${r}-${l}`;
767
+ u = /* @__PURE__ */ I("g", { children: [
768
+ /* @__PURE__ */ f("filter", { id: m, x: "-120%", y: "-120%", width: "340%", height: "340%", children: /* @__PURE__ */ f("feGaussianBlur", { stdDeviation: d / 2 }) }),
769
+ /* @__PURE__ */ f("g", { filter: `url(#${m})`, children: u })
770
770
  ] }, `${r}-b-${l}`);
771
771
  }
772
- const m = rt(c.props, "x"), h = rt(c.props, "y");
772
+ const h = ot(c.props, "x"), g = ot(c.props, "y");
773
773
  o.push(
774
- m !== 0 || h !== 0 ? /* @__PURE__ */ f("g", { transform: `translate(${m} ${h})`, children: u }, `${r}-t-${l}`) : u
775
- ), a++;
774
+ h !== 0 || g !== 0 ? /* @__PURE__ */ f("g", { transform: `translate(${h} ${g})`, children: u }, `${r}-t-${l}`) : u
775
+ ), s++;
776
776
  }
777
777
  return o;
778
778
  }
779
- function un({ resolved: t, nodeId: e, transitionFor: n, animateInitial: i }) {
780
- const r = t.geometry ?? t.kind ?? "rect", s = pt(t.fill, "shape.fill", e) ?? "transparent", o = pt(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, m = ot(n, ["opacity"], i), h = Q(m), g = st({ opacity: u }, i, e), A = tt(), x = Jt(
781
- Pe(Zt(t.fills, "shape.fills", e), "shape.fills", e),
779
+ function hn({ resolved: t, nodeId: e, transitionFor: n, animateInitial: i }) {
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 = ne(
781
+ Le(ee(t.fills, "shape.fills", e), "shape.fills", e),
782
782
  A,
783
783
  "shape.fills",
784
784
  e
785
- ), F = fn(t.strokes), k = x.map(Re), y = k.flatMap((_) => _.defs), p = k.length > 0 ? k.map((_) => ({ ref: _.ref, mixBlendMode: _.mixBlendMode })) : [{ ref: s }], w = F.length > 0 ? F.map((_) => ({
786
- color: pt(_.color, "shape.strokes.color", e) ?? "transparent",
785
+ ), F = gn(t.strokes), k = x.map(Oe), y = k.flatMap((_) => _.defs), p = k.length > 0 ? k.map((_) => ({ ref: _.ref, mixBlendMode: _.mixBlendMode })) : [{ ref: a }], w = F.length > 0 ? F.map((_) => ({
786
+ color: gt(_.color, "shape.strokes.color", e) ?? "transparent",
787
787
  width: _.width ?? 0
788
- })) : [{ color: o, width: a }], $ = [...p].reverse(), v = [...w].reverse(), T = r === "path" ? v.filter((_) => _.width > 0 && _.color !== "transparent") : v, U = (_, b, C, O) => vt(
788
+ })) : [{ color: o, width: s }], v = [...p].reverse(), $ = [...w].reverse(), R = r === "path" ? $.filter((_) => _.width > 0 && _.color !== "transparent") : $, V = (_, b, N, P) => Mt(
789
789
  t,
790
- { fill: _, stroke: b.color, strokeWidth: b.width, mixBlendMode: O },
790
+ { fill: _, stroke: b.color, strokeWidth: b.width, mixBlendMode: P },
791
791
  e,
792
- C
792
+ N
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,
799
799
  viewBox: `0 0 ${l} ${c}`,
800
800
  ...d !== void 0 ? { "aria-label": d, role: "img" } : {},
801
- initial: g.initial,
802
- animate: g.animate,
803
- transition: h,
801
+ initial: m.initial,
802
+ animate: m.animate,
803
+ transition: g,
804
804
  children: [
805
805
  y.length > 0 && /* @__PURE__ */ f("defs", { children: y }),
806
- $.map(
807
- (_, b) => U(_.ref, { color: "transparent", width: 0 }, `fill-${b}`, _.mixBlendMode)
806
+ v.map(
807
+ (_, b) => V(_.ref, { color: "transparent", width: 0 }, `fill-${b}`, _.mixBlendMode)
808
808
  ),
809
- T.map((_, b) => U("none", _, `stroke-${b}`))
809
+ R.map((_, b) => V("none", _, `stroke-${b}`))
810
810
  ]
811
811
  }
812
812
  );
813
813
  }
814
- function pt(t, e, n) {
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
- function fn(t) {
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 dn({ resolved: t, nodeId: e }) {
828
- const n = tt(), i = xt(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 ae({
828
+ peerLabel: t,
829
+ objectFit: e,
830
+ muted: n = !0
831
+ }) {
832
+ const i = Kt(), 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 Dt = /* @__PURE__ */ new Set();
848
- function pn({ 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(ae, { 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(ae, { peerLabel: e, objectFit: n, muted: i });
910
+ }
911
+ const Lt = /* @__PURE__ */ new Set();
912
+ function kn({ resolved: t, nodeId: e }) {
849
913
  const n = t.scene_id, i = t.scene_version;
850
914
  if (!n || !i)
851
915
  return S(e, "instance.scene_id", "missing scene_id or scene_version ; not rendered"), null;
852
916
  const r = `${n}:${i}`;
853
- Dt.has(r) || (Dt.add(r), S(
917
+ Lt.has(r) || (Lt.add(r), S(
854
918
  e,
855
919
  "instance",
856
920
  "scaffold render — async bundle fetch + __params.* injection are not yet wired (LSML 1.1 §4.9)"
857
921
  ));
858
- const s = t.size, o = t.position;
922
+ const a = t.size, o = t.position;
859
923
  return /* @__PURE__ */ f(
860
924
  "div",
861
925
  {
@@ -865,35 +929,126 @@ function pn({ resolved: t, nodeId: e }) {
865
929
  position: o ? "absolute" : "relative",
866
930
  left: o?.x,
867
931
  top: o?.y,
868
- width: s?.w,
869
- height: s?.h,
932
+ width: a?.w,
933
+ height: a?.h,
870
934
  outline: "none",
871
935
  boxSizing: "border-box"
872
936
  }
873
937
  }
874
938
  );
875
939
  }
876
- const hn = {
877
- stack: be,
878
- grid: ke,
879
- frame: Ee,
880
- text: Xe,
881
- image: Ve,
882
- shape: un,
883
- media: dn,
884
- instance: pn
885
- }, bt = it("");
886
- function gn({ prefix: t, children: e }) {
887
- const n = K(bt), i = n ? `${n}.${t}` : t;
888
- return /* @__PURE__ */ f(bt.Provider, { value: i, children: e });
889
- }
890
- function St() {
891
- return K(bt);
892
- }
893
- function q(t, e) {
940
+ function wn({ resolved: t }) {
941
+ 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 = Kt()?.resolveCaptureDevice, s = tt(null), [l, c] = vt(null);
942
+ return Y(() => {
943
+ if (!xn()) return;
944
+ let u = !1, d = null;
945
+ return (async () => {
946
+ try {
947
+ const h = await $n(i, r, o);
948
+ if (h === null) return;
949
+ if (u) {
950
+ zt(h);
951
+ return;
952
+ }
953
+ d = h, c(h);
954
+ } catch {
955
+ }
956
+ })(), () => {
957
+ u = !0, d !== null && zt(d);
958
+ };
959
+ }, [i, r, o]), Y(() => {
960
+ const u = s.current;
961
+ if (u !== null)
962
+ return u.srcObject = l, () => {
963
+ u !== null && (u.srcObject = null);
964
+ };
965
+ }, [l]), l !== null && vn(i) ? /* @__PURE__ */ f(
966
+ "video",
967
+ {
968
+ ref: s,
969
+ "data-lumencast-capture": !0,
970
+ autoPlay: !0,
971
+ muted: !0,
972
+ playsInline: !0,
973
+ style: { width: e, height: n, objectFit: "cover", pointerEvents: "none" }
974
+ }
975
+ ) : /* @__PURE__ */ f(
976
+ "div",
977
+ {
978
+ "aria-hidden": !0,
979
+ "data-lumencast-capture": !0,
980
+ style: { width: e, height: n, opacity: 0, pointerEvents: "none" }
981
+ }
982
+ );
983
+ }
984
+ function xn() {
985
+ return typeof navigator < "u" && typeof navigator.mediaDevices?.getUserMedia == "function";
986
+ }
987
+ function vn(t) {
988
+ return t === "media.webcam" || t === "media.screen" || t === "media.window";
989
+ }
990
+ async function $n(t, e, n) {
991
+ const i = navigator.mediaDevices, r = await n?.(e, t) ?? null, a = r?.deviceId, o = e.length > 0;
992
+ switch (t) {
993
+ case "media.webcam":
994
+ case "media.mic":
995
+ case "media.app_audio": {
996
+ if (o && (typeof a != "string" || a.length === 0))
997
+ return null;
998
+ const s = t === "media.webcam" ? "video" : "audio";
999
+ return i.getUserMedia({ [s]: Sn(a) });
1000
+ }
1001
+ case "media.screen":
1002
+ case "media.window": {
1003
+ const s = r?.captureSourceId;
1004
+ return typeof s == "string" && s.length > 0 ? i.getUserMedia({
1005
+ video: {
1006
+ mandatory: {
1007
+ chromeMediaSource: "desktop",
1008
+ chromeMediaSourceId: s
1009
+ }
1010
+ }
1011
+ }) : o ? null : i.getDisplayMedia({ video: !0 });
1012
+ }
1013
+ default:
1014
+ return null;
1015
+ }
1016
+ }
1017
+ function Sn(t) {
1018
+ return typeof t == "string" && t.length > 0 ? { deviceId: { exact: t } } : !0;
1019
+ }
1020
+ function zt(t) {
1021
+ for (const e of t.getTracks()) e.stop();
1022
+ }
1023
+ function Ht(t, e) {
1024
+ return typeof t == "number" && Number.isFinite(t) ? `${t}px` : typeof t == "string" && t.length > 0 ? t : e;
1025
+ }
1026
+ const Mn = {
1027
+ stack: ve,
1028
+ grid: $e,
1029
+ frame: ze,
1030
+ text: Ve,
1031
+ image: tn,
1032
+ shape: hn,
1033
+ media: mn,
1034
+ // ADR 006 §3.3/§3.5 — the unified source kind : every exported source is a
1035
+ // `meet.peer` node rendered in `<video srcObject>` from the WebRTC viewer.
1036
+ "meet.peer": bn,
1037
+ instance: kn,
1038
+ // RFC-0001 / ADR 004 — Zab vendor capture placeholder (transparent, inert).
1039
+ "x-zab.capture": wn
1040
+ }, kt = st("");
1041
+ function An({ prefix: t, children: e }) {
1042
+ const n = K(kt), i = n ? `${n}.${t}` : t;
1043
+ return /* @__PURE__ */ f(kt.Provider, { value: i, children: e });
1044
+ }
1045
+ function At() {
1046
+ return K(kt);
1047
+ }
1048
+ function G(t, e) {
894
1049
  return !t || e.startsWith("__") ? e : `${t}.${e}`;
895
1050
  }
896
- function Bt(t) {
1051
+ function Wt(t) {
897
1052
  switch (t) {
898
1053
  case "fixed":
899
1054
  return "0 0 auto";
@@ -905,157 +1060,163 @@ function Bt(t) {
905
1060
  return;
906
1061
  }
907
1062
  }
908
- function mn(t) {
909
- const e = Bt(t?.x), n = Bt(t?.y);
1063
+ function Fn(t) {
1064
+ const e = Wt(t?.x), n = Wt(t?.y);
910
1065
  return e === n && e !== void 0 ? e : e ?? n;
911
1066
  }
912
- function yn({
1067
+ function _n({
913
1068
  visible: t,
914
1069
  opacity: e,
915
1070
  rotation: n,
916
1071
  flipY: i,
917
1072
  blur: r,
918
- sizing: s,
1073
+ sizing: a,
919
1074
  position: o,
920
- size: a,
1075
+ size: s,
921
1076
  blendMode: l,
922
1077
  children: c
923
1078
  }) {
924
1079
  if (t === !1)
925
1080
  return null;
926
- const u = Y(l), d = typeof e == "number" && e !== 1, m = typeof n == "number" && n !== 0, h = i === !0, g = typeof r == "number" && r > 0, A = s?.x !== void 0 || s?.y !== void 0, x = o !== void 0, F = u !== void 0;
927
- if (!d && !m && !h && !g && !A && !x && !F)
928
- return /* @__PURE__ */ f(J, { children: c });
1081
+ 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;
1082
+ if (!d && !h && !g && !m && !A && !x && !F)
1083
+ return /* @__PURE__ */ f(Q, { children: c });
929
1084
  let k;
930
- if (m || h) {
931
- const $ = [];
932
- m && $.push(`rotate(${n}deg)`), h && $.push("scaleY(-1)"), k = $.join(" ");
1085
+ if (h || g) {
1086
+ const v = [];
1087
+ h && v.push(`rotate(${n}deg)`), g && v.push("scaleY(-1)"), k = v.join(" ");
933
1088
  }
934
- const y = g ? `blur(${r / 2}px)` : void 0, p = A ? mn(s) : void 0;
1089
+ const y = m ? `blur(${r / 2}px)` : void 0, p = A ? Fn(a) : void 0;
935
1090
  if (F && (d || k !== void 0 || y !== void 0)) {
936
- const $ = { mixBlendMode: u };
937
- x && ($.position = "absolute", $.left = o.x, $.top = o.y), p !== void 0 && ($.flex = p);
938
- const v = {};
939
- return typeof a?.w == "number" && (v.width = a.w), typeof a?.h == "number" && (v.height = a.h), d && (v.opacity = e), k !== void 0 && (v.transform = k), y !== void 0 && (v.filter = y), /* @__PURE__ */ f("div", { style: $, children: /* @__PURE__ */ f("div", { style: v, children: c }) });
1091
+ const v = { mixBlendMode: u };
1092
+ x && (v.position = "absolute", v.left = o.x, v.top = o.y), p !== void 0 && (v.flex = p);
1093
+ const $ = {};
1094
+ 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 }) });
940
1095
  }
941
1096
  const w = {};
942
- 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 });
1097
+ 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 });
943
1098
  }
944
- const bn = {
1099
+ const jn = {
945
1100
  linear: "linear",
946
1101
  "ease-in": "easeIn",
947
1102
  "ease-out": "easeOut",
948
1103
  "ease-in-out": "easeInOut"
949
1104
  };
950
- function kn(t, e) {
1105
+ function Rn(t, e) {
951
1106
  const n = t.steps;
952
1107
  if (!Array.isArray(n) || n.length < 2) return;
953
1108
  const i = n[0], r = n[n.length - 1];
954
1109
  if (i.at !== 0 || r.at !== 1) return;
955
- const s = n.map((a) => a.at), o = {};
956
- return Lt(n, "opacity", o, e), Lt(n, "filter", o, e), nt(n, "scale", o), nt(n, "translateX", o), nt(n, "translateY", o), nt(n, "rotate", o), {
1110
+ const a = n.map((s) => s.at), o = {};
1111
+ return qt(n, "opacity", o, e), qt(n, "filter", o, e), it(n, "scale", o), it(n, "translateX", o), it(n, "translateY", o), it(n, "rotate", o), {
957
1112
  animate: o,
958
1113
  transition: {
959
1114
  duration: t.duration_ms / 1e3,
960
- ease: bn[t.easing ?? "linear"],
961
- times: s
1115
+ ease: jn[t.easing ?? "linear"],
1116
+ times: a
962
1117
  }
963
1118
  };
964
1119
  }
965
- function Lt(t, e, n, i) {
1120
+ function qt(t, e, n, i) {
966
1121
  let r = !1;
967
- const s = [];
1122
+ const a = [];
968
1123
  let o;
969
- for (const a of t) {
970
- let l = a[e];
1124
+ for (const s of t) {
1125
+ let l = s[e];
971
1126
  if (e === "filter" && l !== void 0) {
972
- const c = ge(l);
973
- c === null ? (Xt("keyframes.steps[].filter", i), l = void 0) : l = c;
1127
+ const c = ke(l);
1128
+ c === null ? (Vt("keyframes.steps[].filter", i), l = void 0) : l = c;
974
1129
  }
975
- l !== void 0 ? (r = !0, o = l, s.push(l)) : s.push(o ?? (e === "opacity" ? 1 : me));
1130
+ l !== void 0 ? (r = !0, o = l, a.push(l)) : a.push(o ?? (e === "opacity" ? 1 : we));
976
1131
  }
977
- r && (n[e] = s);
1132
+ r && (n[e] = a);
978
1133
  }
979
- function nt(t, e, n) {
1134
+ function it(t, e, n) {
980
1135
  let i = !1;
981
1136
  const r = [];
982
- let s;
1137
+ let a;
983
1138
  for (const o of t) {
984
- const a = o.transform?.[e];
985
- typeof a == "number" ? (i = !0, s = a, r.push(a)) : r.push(s ?? wn(e));
1139
+ const s = o.transform?.[e];
1140
+ typeof s == "number" ? (i = !0, a = s, r.push(s)) : r.push(a ?? Tn(e));
986
1141
  }
987
- i && (e === "rotate" ? n.rotate = r.map((o) => `${o}deg`) : n[e] = r);
1142
+ if (i)
1143
+ if (e === "rotate")
1144
+ n.rotate = r.map((o) => `${o}deg`);
1145
+ else {
1146
+ const o = e === "translateX" ? "x" : e === "translateY" ? "y" : e;
1147
+ n[o] = r;
1148
+ }
988
1149
  }
989
- function wn(t) {
1150
+ function Tn(t) {
990
1151
  return t === "scale" ? 1 : 0;
991
1152
  }
992
- const Mt = it(0), Ht = 2e3;
993
- function xn(t, e) {
1153
+ const Ft = st(0), Gt = 2e3;
1154
+ function Cn(t, e) {
994
1155
  if (e <= 0) return 0;
995
1156
  const n = t * e;
996
- return n > Ht ? Ht : n;
1157
+ return n > Gt ? Gt : n;
997
1158
  }
998
- function $n({
1159
+ function On({
999
1160
  keyframes: t,
1000
1161
  store: e,
1001
1162
  nodeId: n,
1002
1163
  children: i
1003
1164
  }) {
1004
- wt();
1005
- const r = St(), s = K(Mt), o = mt(void 0), a = mt(0);
1165
+ xt();
1166
+ const r = At(), a = K(Ft), o = tt(void 0), s = tt(0);
1006
1167
  if (t.key !== void 0) {
1007
- const u = e.signal(q(r, t.key)).value;
1008
- o.current !== u && (o.current = u, a.current += 1);
1168
+ const u = e.signal(G(r, t.key)).value;
1169
+ o.current !== u && (o.current = u, s.current += 1);
1009
1170
  }
1010
- const l = kn(t, n);
1171
+ const l = Rn(t, n);
1011
1172
  if (!l)
1012
- return /* @__PURE__ */ f(J, { children: i });
1013
- const c = s > 0 ? { ...l.transition, delay: s / 1e3 } : l.transition;
1014
- return /* @__PURE__ */ G(
1015
- I.div,
1173
+ return /* @__PURE__ */ f(Q, { children: i });
1174
+ const c = a > 0 ? { ...l.transition, delay: a / 1e3 } : l.transition;
1175
+ return /* @__PURE__ */ I(
1176
+ U.div,
1016
1177
  {
1017
- style: { display: "contents" },
1018
- initial: Sn(l.animate),
1178
+ style: { position: "absolute", inset: 0 },
1179
+ initial: Pn(l.animate),
1019
1180
  animate: l.animate,
1020
1181
  transition: c,
1021
1182
  children: [
1022
- /* @__PURE__ */ f(vn, {}),
1183
+ /* @__PURE__ */ f(Nn, {}),
1023
1184
  i
1024
1185
  ]
1025
1186
  },
1026
- a.current
1187
+ s.current
1027
1188
  );
1028
1189
  }
1029
- function vn() {
1030
- return Gt(() => {
1190
+ function Nn() {
1191
+ return Y(() => {
1031
1192
  }, []), null;
1032
1193
  }
1033
- function Sn(t) {
1194
+ function Pn(t) {
1034
1195
  const e = {};
1035
1196
  for (const [n, i] of Object.entries(t))
1036
1197
  i.length > 0 && (e[n] = i[0]);
1037
1198
  return e;
1038
1199
  }
1039
- function Mn(t, e = (i) => requestAnimationFrame(i), n = (i) => cancelAnimationFrame(i)) {
1200
+ function En(t, e = (i) => requestAnimationFrame(i), n = (i) => cancelAnimationFrame(i)) {
1040
1201
  const i = /* @__PURE__ */ new Map();
1041
- let r = null, s = !1;
1202
+ let r = null, a = !1;
1042
1203
  const o = () => {
1043
1204
  r = null;
1044
- const a = [...i.entries()];
1205
+ const s = [...i.entries()];
1045
1206
  i.clear();
1046
- for (const [l, c] of a)
1207
+ for (const [l, c] of s)
1047
1208
  t(l, c);
1048
1209
  };
1049
1210
  return {
1050
- push(a, l) {
1051
- s || (i.set(a, l), r === null && (r = e(o)));
1211
+ push(s, l) {
1212
+ a || (i.set(s, l), r === null && (r = e(o)));
1052
1213
  },
1053
1214
  dispose() {
1054
- s = !0, i.clear(), r !== null && (n(r), r = null);
1215
+ a = !0, i.clear(), r !== null && (n(r), r = null);
1055
1216
  }
1056
1217
  };
1057
1218
  }
1058
- const An = {
1219
+ const Dn = {
1059
1220
  aliceblue: 15792383,
1060
1221
  antiquewhite: 16444375,
1061
1222
  aqua: 65535,
@@ -1205,77 +1366,77 @@ const An = {
1205
1366
  yellow: 16776960,
1206
1367
  yellowgreen: 10145074
1207
1368
  };
1208
- function Fn(t) {
1209
- const e = E(t);
1369
+ function Bn(t) {
1370
+ const e = D(t);
1210
1371
  if (e === null) return null;
1211
- if (e.startsWith("#")) return _n(e);
1372
+ if (e.startsWith("#")) return Ln(e);
1212
1373
  if (e.startsWith("rgb")) {
1213
1374
  const r = e.slice(e.indexOf("(") + 1, -1).split(",").map((d) => d.trim());
1214
1375
  if (r.length < 3) return null;
1215
- const o = r[0].endsWith("%") ? 100 : 255, a = ht(r[0], o), l = ht(r[1], o), c = ht(r[2], o), u = r.length > 3 ? zt(r[3]) : 1;
1216
- return a === null || l === null || c === null || u === null ? null : [a, l, c, u];
1376
+ 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 ? It(r[3]) : 1;
1377
+ return s === null || l === null || c === null || u === null ? null : [s, l, c, u];
1217
1378
  }
1218
1379
  if (e.startsWith("hsl")) {
1219
- const r = e.slice(e.indexOf("(") + 1, -1).split(",").map((m) => m.trim());
1380
+ const r = e.slice(e.indexOf("(") + 1, -1).split(",").map((h) => h.trim());
1220
1381
  if (r.length < 3) return null;
1221
- const s = Number(r[0].replace("deg", "")), o = Number(r[1].replace("%", "")) / 100, a = Number(r[2].replace("%", "")) / 100, l = r.length > 3 ? zt(r[3]) : 1;
1222
- if (![s, o, a].every(Number.isFinite) || l === null) return null;
1223
- const [c, u, d] = Rn(s, o, a);
1382
+ const a = Number(r[0].replace("deg", "")), o = Number(r[1].replace("%", "")) / 100, s = Number(r[2].replace("%", "")) / 100, l = r.length > 3 ? It(r[3]) : 1;
1383
+ if (![a, o, s].every(Number.isFinite) || l === null) return null;
1384
+ const [c, u, d] = zn(a, o, s);
1224
1385
  return [c, u, d, l];
1225
1386
  }
1226
1387
  if (e === "transparent") return [0, 0, 0, 0];
1227
1388
  if (e === "currentcolor") return null;
1228
- const n = An[e];
1389
+ const n = Dn[e];
1229
1390
  return n === void 0 ? null : [(n >> 16 & 255) / 255, (n >> 8 & 255) / 255, (n & 255) / 255, 1];
1230
1391
  }
1231
- function _n(t) {
1392
+ function Ln(t) {
1232
1393
  const e = t.slice(1);
1233
1394
  if (e.length === 3 || e.length === 4) {
1234
- 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;
1235
- return [n / 255, i / 255, r / 255, s / 255];
1395
+ 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;
1396
+ return [n / 255, i / 255, r / 255, a / 255];
1236
1397
  }
1237
1398
  if (e.length === 6 || e.length === 8) {
1238
- 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;
1239
- return [n / 255, i / 255, r / 255, s / 255];
1399
+ 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;
1400
+ return [n / 255, i / 255, r / 255, a / 255];
1240
1401
  }
1241
1402
  return null;
1242
1403
  }
1243
- function ht(t, e) {
1404
+ function mt(t, e) {
1244
1405
  const n = Number(t.replace("%", ""));
1245
- return Number.isFinite(n) ? j(n / e) : null;
1406
+ return Number.isFinite(n) ? T(n / e) : null;
1246
1407
  }
1247
- function zt(t) {
1408
+ function It(t) {
1248
1409
  const e = t.endsWith("%"), n = Number(t.replace("%", ""));
1249
- return Number.isFinite(n) ? j(e ? n / 100 : n) : null;
1410
+ return Number.isFinite(n) ? T(e ? n / 100 : n) : null;
1250
1411
  }
1251
- function Rn(t, e, n) {
1252
- 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));
1253
- let a = 0, l = 0, c = 0;
1254
- 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];
1412
+ function zn(t, e, n) {
1413
+ 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));
1414
+ let s = 0, l = 0, c = 0;
1415
+ 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];
1255
1416
  const u = n - r / 2;
1256
- return [j(a + u), j(l + u), j(c + u)];
1417
+ return [T(s + u), T(l + u), T(c + u)];
1257
1418
  }
1258
- function Tn(t, e, n) {
1419
+ function Hn(t, e, n) {
1259
1420
  return [
1260
- j(t[0] + n * (e[0] - t[0])),
1261
- j(t[1] + n * (e[1] - t[1])),
1262
- j(t[2] + n * (e[2] - t[2])),
1263
- j(t[3] + n * (e[3] - t[3]))
1421
+ T(t[0] + n * (e[0] - t[0])),
1422
+ T(t[1] + n * (e[1] - t[1])),
1423
+ T(t[2] + n * (e[2] - t[2])),
1424
+ T(t[3] + n * (e[3] - t[3]))
1264
1425
  ];
1265
1426
  }
1266
- function Wt(t) {
1267
- const e = Math.round(j(t[0]) * 255), n = Math.round(j(t[1]) * 255), i = Math.round(j(t[2]) * 255), r = Math.round(j(t[3]) * 1e4) / 1e4;
1427
+ function Yt(t) {
1428
+ const e = Math.round(T(t[0]) * 255), n = Math.round(T(t[1]) * 255), i = Math.round(T(t[2]) * 255), r = Math.round(T(t[3]) * 1e4) / 1e4;
1268
1429
  return `rgba(${e}, ${n}, ${i}, ${r})`;
1269
1430
  }
1270
- function j(t) {
1431
+ function T(t) {
1271
1432
  return t < 0 ? 0 : t > 1 ? 1 : t;
1272
1433
  }
1273
- const re = {
1434
+ const le = {
1274
1435
  "style.color": "colour",
1275
1436
  fill: "fill",
1276
1437
  background: "background"
1277
1438
  };
1278
- function jn(t, e) {
1439
+ function Wn(t, e) {
1279
1440
  switch (t) {
1280
1441
  case "opacity": {
1281
1442
  const n = H(e);
@@ -1300,11 +1461,11 @@ function jn(t, e) {
1300
1461
  return n === null ? null : { rotate: n };
1301
1462
  }
1302
1463
  case "filter.blur": {
1303
- const n = _t("blur", e);
1464
+ const n = Rt("blur", e);
1304
1465
  return n === null ? null : { blur: n };
1305
1466
  }
1306
1467
  case "filter.brightness": {
1307
- const n = _t("brightness", e);
1468
+ const n = Rt("brightness", e);
1308
1469
  return n === null ? null : { brightness: n };
1309
1470
  }
1310
1471
  default:
@@ -1314,13 +1475,13 @@ function jn(t, e) {
1314
1475
  function H(t) {
1315
1476
  return typeof t != "number" || !Number.isFinite(t) ? null : Object.is(t, -0) ? 0 : t;
1316
1477
  }
1317
- const Nn = {
1478
+ const qn = {
1318
1479
  kind: "spring",
1319
1480
  stiffness: 170,
1320
1481
  damping: 26,
1321
1482
  mass: 1
1322
1483
  };
1323
- function Cn(t) {
1484
+ function Gn(t) {
1324
1485
  switch (t) {
1325
1486
  case "opacity":
1326
1487
  return "opacity";
@@ -1334,93 +1495,93 @@ function Cn(t) {
1334
1495
  case "filter.brightness":
1335
1496
  return "filter";
1336
1497
  default:
1337
- return re[t] ?? t;
1498
+ return le[t] ?? t;
1338
1499
  }
1339
1500
  }
1340
- const On = {};
1341
- function Pn(t, e, n) {
1342
- const i = t.animateBindings, r = K(Mt), s = B(1), o = B(0), a = B(0), l = B(1), c = B(1), u = B(0), d = B(0), m = B(1), h = pe(
1343
- [d, m],
1501
+ const In = {};
1502
+ function Yn(t, e, n) {
1503
+ const i = t.animateBindings, r = K(Ft), 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(
1504
+ [d, h],
1344
1505
  ([k, y]) => `blur(${k}px) brightness(${y})`
1345
- ), [g, A] = he(On), x = mt({
1346
- opacity: s,
1506
+ ), [m, A] = vt(In), x = tt({
1507
+ opacity: a,
1347
1508
  x: o,
1348
- y: a,
1509
+ y: s,
1349
1510
  scaleX: l,
1350
1511
  scaleY: c,
1351
1512
  rotate: u,
1352
1513
  blur: d,
1353
- brightness: m
1514
+ brightness: h
1354
1515
  });
1355
- return Gt(() => {
1516
+ return Y(() => {
1356
1517
  if (!i || Object.keys(i).length === 0) return;
1357
1518
  const k = x.current, y = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Set();
1358
- let $ = !1;
1359
- const v = (b, C) => {
1360
- const V = e.transitionSignal(C).peek() ?? t.transitions?.[Cn(b)], Z = Q(V ?? Nn);
1361
- return r > 0 && !w.has(b) ? { ...Z, delay: r / 1e3 } : Z;
1362
- }, T = (b, C, O) => {
1363
- const V = re[b], Z = q(n, i[b]);
1364
- if (V !== void 0) {
1365
- const P = Fn(C);
1366
- if (P === null) {
1367
- D(`bindAnimate.${b}`, t.id);
1519
+ let v = !1;
1520
+ const $ = (b, N) => {
1521
+ const Z = e.transitionSignal(N).peek() ?? t.transitions?.[Gn(b)], J = et(Z ?? qn);
1522
+ return r > 0 && !w.has(b) ? { ...J, delay: r / 1e3 } : J;
1523
+ }, R = (b, N, P) => {
1524
+ const Z = le[b], J = G(n, i[b]);
1525
+ if (Z !== void 0) {
1526
+ const E = Bn(N);
1527
+ if (E === null) {
1528
+ B(`bindAnimate.${b}`, t.id);
1368
1529
  return;
1369
1530
  }
1370
- const L = p.get(b);
1371
- if (O || L === void 0) {
1372
- p.set(b, { current: P }), A((lt) => ({ ...lt, [V]: Wt(P) }));
1531
+ const z = p.get(b);
1532
+ if (P || z === void 0) {
1533
+ p.set(b, { current: E }), A((ut) => ({ ...ut, [Z]: Yt(E) }));
1373
1534
  return;
1374
1535
  }
1375
- const ue = L.current, fe = v(b, Z);
1536
+ const ge = z.current, me = $(b, J);
1376
1537
  w.add(b), y.get(`color:${b}`)?.stop(), y.set(
1377
1538
  `color:${b}`,
1378
- Ft(0, 1, {
1379
- ...fe,
1380
- onUpdate: (lt) => {
1381
- const At = Tn(ue, P, lt);
1382
- L.current = At, A((de) => ({ ...de, [V]: Wt(At) }));
1539
+ jt(0, 1, {
1540
+ ...me,
1541
+ onUpdate: (ut) => {
1542
+ const _t = Hn(ge, E, ut);
1543
+ z.current = _t, A((ye) => ({ ...ye, [Z]: Yt(_t) }));
1383
1544
  }
1384
1545
  })
1385
1546
  );
1386
1547
  return;
1387
1548
  }
1388
- const at = jn(b, C);
1389
- if (at === null) {
1390
- b.startsWith("filter.") ? Xt(`bindAnimate.${b}`, t.id) : En(b, t.id);
1549
+ const ct = Wn(b, N);
1550
+ if (ct === null) {
1551
+ b.startsWith("filter.") ? Vt(`bindAnimate.${b}`, t.id) : Xn(b, t.id);
1391
1552
  return;
1392
1553
  }
1393
- if (O) {
1394
- for (const [P, L] of Object.entries(at))
1395
- k[P].jump(L);
1554
+ if (P) {
1555
+ for (const [E, z] of Object.entries(ct))
1556
+ k[E].jump(z);
1396
1557
  return;
1397
1558
  }
1398
- const ce = v(b, Z);
1559
+ const he = $(b, J);
1399
1560
  w.add(b);
1400
- for (const [P, L] of Object.entries(at))
1401
- y.set(P, Ft(k[P], L, ce));
1402
- }, U = Mn((b, C) => T(b, C, !1)), _ = Object.entries(i).map(
1403
- ([b, C]) => ye(() => {
1404
- const O = e.signal(q(n, C)).value;
1405
- O !== void 0 && ($ ? U.push(b, O) : T(b, O, !0));
1561
+ for (const [E, z] of Object.entries(ct))
1562
+ y.set(E, jt(k[E], z, he));
1563
+ }, V = En((b, N) => R(b, N, !1)), _ = Object.entries(i).map(
1564
+ ([b, N]) => xe(() => {
1565
+ const P = e.signal(G(n, N)).value;
1566
+ P !== void 0 && (v ? V.push(b, P) : R(b, P, !0));
1406
1567
  })
1407
1568
  );
1408
- return $ = !0, () => {
1569
+ return v = !0, () => {
1409
1570
  for (const b of _) b();
1410
- U.dispose();
1571
+ V.dispose();
1411
1572
  for (const b of y.values()) b.stop();
1412
1573
  };
1413
- }, [t, i, e, n, r]), { motionStyle: Yt(() => {
1574
+ }, [t, i, e, n, r]), { motionStyle: Ut(() => {
1414
1575
  if (!i) return null;
1415
1576
  const k = {};
1416
1577
  let y = !1;
1417
1578
  for (const p of Object.keys(i))
1418
1579
  switch (p) {
1419
1580
  case "opacity":
1420
- k.opacity = s, y = !0;
1581
+ k.opacity = a, y = !0;
1421
1582
  break;
1422
1583
  case "transform.translate":
1423
- k.x = o, k.y = a, y = !0;
1584
+ k.x = o, k.y = s, y = !0;
1424
1585
  break;
1425
1586
  case "transform.scale":
1426
1587
  k.scaleX = l, k.scaleY = c, y = !0;
@@ -1430,36 +1591,36 @@ function Pn(t, e, n) {
1430
1591
  break;
1431
1592
  case "filter.blur":
1432
1593
  case "filter.brightness":
1433
- k.filter = h, y = !0;
1594
+ k.filter = g, y = !0;
1434
1595
  break;
1435
1596
  }
1436
1597
  return y ? (k.willChange = "transform, opacity, filter", k) : null;
1437
- }, [i, s, o, a, l, c, u, h]), colorProps: g };
1598
+ }, [i, a, o, s, l, c, u, g]), colorProps: m };
1438
1599
  }
1439
- function En(t, e) {
1600
+ function Xn(t, e) {
1440
1601
  S(
1441
1602
  e,
1442
1603
  `bindAnimate.${t}`,
1443
1604
  "rejected bound value : JSON shape does not match the property type (LSML §6.3)"
1444
1605
  );
1445
1606
  }
1446
- const ie = /* @__PURE__ */ new Set(["alpha", "luminance"]), kt = 180, oe = /* @__PURE__ */ new Set(["intersect", "subtract", "union"]);
1447
- let gt = 0;
1448
- function Dn() {
1449
- return gt = (gt + 1) % 1e6, `lumen-mask-${gt.toString(36)}`;
1607
+ const ce = /* @__PURE__ */ new Set(["alpha", "luminance"]), wt = 180, ue = /* @__PURE__ */ new Set(["intersect", "subtract", "union"]);
1608
+ let yt = 0;
1609
+ function Un() {
1610
+ return yt = (yt + 1) % 1e6, `lumen-mask-${yt.toString(36)}`;
1450
1611
  }
1451
- function Bn(t) {
1612
+ function Kn(t) {
1452
1613
  return /^[A-Za-z0-9_:-]+$/.test(t) ? t : null;
1453
1614
  }
1454
1615
  function M(t) {
1455
1616
  return typeof t == "number" && Number.isFinite(t);
1456
1617
  }
1457
- function Ln(t, e) {
1618
+ function Vn(t, e) {
1458
1619
  if (typeof t != "object" || t === null) return null;
1459
1620
  const n = t;
1460
- if (typeof n.type != "string" || !ie.has(n.type))
1621
+ if (typeof n.type != "string" || !ce.has(n.type))
1461
1622
  return S(e, "mask.type", "is not alpha|luminance ; mask omitted (ADR 002 §3.2, T4)"), null;
1462
- if (typeof n.op != "string" || !oe.has(n.op))
1623
+ if (typeof n.op != "string" || !ue.has(n.op))
1463
1624
  return S(
1464
1625
  e,
1465
1626
  "mask.op",
@@ -1469,37 +1630,37 @@ function Ln(t, e) {
1469
1630
  if (typeof i != "object" || i === null)
1470
1631
  return S(e, "mask.source", "is not a typed shape|image source ; mask omitted (T3)"), null;
1471
1632
  const r = i;
1472
- let s;
1633
+ let a;
1473
1634
  if (r.kind === "shape" && typeof r.ref == "string")
1474
- s = { kind: "shape", ref: r.ref };
1635
+ a = { kind: "shape", ref: r.ref };
1475
1636
  else if (r.kind === "image" && typeof r.src == "string") {
1476
1637
  const c = r.srcRect;
1477
- 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 };
1638
+ 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 };
1478
1639
  } else if (r.kind === "group" && typeof r.ref == "string")
1479
- s = { kind: "group", ref: r.ref };
1640
+ a = { kind: "group", ref: r.ref };
1480
1641
  else
1481
1642
  return S(
1482
1643
  e,
1483
1644
  "mask.source",
1484
1645
  "is not a typed shape|image|group source ; mask omitted (T3)"
1485
1646
  ), null;
1486
- const o = { source: s, type: n.type, op: n.op }, a = n.position;
1487
- a && M(a.x) && M(a.y) && (o.position = { x: a.x, y: a.y });
1647
+ const o = { source: a, type: n.type, op: n.op }, s = n.position;
1648
+ s && M(s.x) && M(s.y) && (o.position = { x: s.x, y: s.y });
1488
1649
  const l = n.size;
1489
1650
  return l && M(l.w) && M(l.h) && (o.size = { w: l.w, h: l.h }), o;
1490
1651
  }
1491
- function Hn(t, e, n, i, r, s = !1) {
1492
- if (!ie.has(t.type) || !oe.has(t.op))
1652
+ function Zn(t, e, n, i, r, a = !1) {
1653
+ if (!ce.has(t.type) || !ue.has(t.op))
1493
1654
  return S(n, "mask", "type/op outside the closed enum ; mask omitted (T4)"), null;
1494
- const o = Dn(), a = t.position?.x, l = t.position?.y, c = t.size?.w, u = t.size?.h, d = {
1495
- ...M(a) ? { x: a } : {},
1655
+ const o = Un(), s = t.position?.x, l = t.position?.y, c = t.size?.w, u = t.size?.h, d = {
1656
+ ...M(s) ? { x: s } : {},
1496
1657
  ...M(l) ? { y: l } : {},
1497
1658
  ...M(c) ? { width: c } : {},
1498
1659
  ...M(u) ? { height: u } : {}
1499
1660
  };
1500
- let m;
1661
+ let h;
1501
1662
  if (t.source.kind === "image") {
1502
- const x = Kt(t.source.src, e);
1663
+ const x = Jt(t.source.src, e);
1503
1664
  if (!x.allowed)
1504
1665
  return S(
1505
1666
  n,
@@ -1507,18 +1668,18 @@ function Hn(t, e, n, i, r, s = !1) {
1507
1668
  `image host/scheme rejected ; mask omitted (T1/T2 — ${x.reason ?? "denied"})`
1508
1669
  ), null;
1509
1670
  if (t.op === "intersect") {
1510
- const k = t.type === "alpha" ? "alpha" : "luminance", y = `url("${t.source.src}")`, p = t.source.srcRect, w = p && M(p.x) && M(p.y) && M(p.w) && M(p.h), $ = w ? `${p.w}px ${p.h}px` : "cover", v = w ? `${p.x}px ${p.y}px` : "center";
1671
+ const k = t.type === "alpha" ? "alpha" : "luminance", y = `url("${t.source.src}")`, p = t.source.srcRect, w = p && M(p.x) && M(p.y) && M(p.w) && M(p.h), v = w ? `${p.w}px ${p.h}px` : "cover", $ = w ? `${p.x}px ${p.y}px` : "center";
1511
1672
  return {
1512
1673
  def: /* @__PURE__ */ f("defs", {}, o),
1513
1674
  style: {
1514
1675
  maskImage: y,
1515
1676
  WebkitMaskImage: y,
1516
- maskSize: $,
1517
- WebkitMaskSize: $,
1677
+ maskSize: v,
1678
+ WebkitMaskSize: v,
1518
1679
  maskRepeat: "no-repeat",
1519
1680
  WebkitMaskRepeat: "no-repeat",
1520
- maskPosition: v,
1521
- WebkitMaskPosition: v,
1681
+ maskPosition: $,
1682
+ WebkitMaskPosition: $,
1522
1683
  maskMode: k
1523
1684
  },
1524
1685
  id: o,
@@ -1526,9 +1687,9 @@ function Hn(t, e, n, i, r, s = !1) {
1526
1687
  };
1527
1688
  }
1528
1689
  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%" };
1529
- m = /* @__PURE__ */ f("image", { href: t.source.src, preserveAspectRatio: "none", ...F });
1690
+ h = /* @__PURE__ */ f("image", { href: t.source.src, preserveAspectRatio: "none", ...F });
1530
1691
  } else {
1531
- const x = Bn(t.source.ref);
1692
+ const x = Kn(t.source.ref);
1532
1693
  if (x === null)
1533
1694
  return S(
1534
1695
  n,
@@ -1542,7 +1703,7 @@ function Hn(t, e, n, i, r, s = !1) {
1542
1703
  "mask.source.ref",
1543
1704
  "shape ref does not resolve to an indexed shape ; mask omitted (ADR 002 A2.1 #K)"
1544
1705
  ), null;
1545
- m = Object.keys(d).length > 0 ? /* @__PURE__ */ f(
1706
+ h = Object.keys(d).length > 0 ? /* @__PURE__ */ f(
1546
1707
  "g",
1547
1708
  {
1548
1709
  transform: M(d.x) || M(d.y) ? `translate(${M(d.x) ? d.x : 0} ${M(d.y) ? d.y : 0})` : void 0,
@@ -1550,16 +1711,16 @@ function Hn(t, e, n, i, r, s = !1) {
1550
1711
  }
1551
1712
  ) : F;
1552
1713
  }
1553
- s && (m = /* @__PURE__ */ f("g", { transform: `translate(${kt} ${kt})`, children: m }, "feather-pad"));
1554
- let h;
1555
- t.op === "intersect" ? h = m : t.op === "union" ? h = /* @__PURE__ */ G(J, { children: [
1714
+ a && (h = /* @__PURE__ */ f("g", { transform: `translate(${wt} ${wt})`, children: h }, "feather-pad"));
1715
+ let g;
1716
+ t.op === "intersect" ? g = h : t.op === "union" ? g = /* @__PURE__ */ I(Q, { children: [
1556
1717
  /* @__PURE__ */ f("rect", { x: 0, y: 0, width: "100%", height: "100%", fill: "white" }),
1557
- m
1558
- ] }) : h = /* @__PURE__ */ G(J, { children: [
1718
+ h
1719
+ ] }) : g = /* @__PURE__ */ I(Q, { children: [
1559
1720
  /* @__PURE__ */ f("rect", { x: 0, y: 0, width: "100%", height: "100%", fill: "white" }),
1560
- /* @__PURE__ */ f("g", { style: { filter: "invert(1)" }, children: m })
1721
+ /* @__PURE__ */ f("g", { style: { filter: "invert(1)" }, children: h })
1561
1722
  ] });
1562
- const g = /* @__PURE__ */ f(
1723
+ const m = /* @__PURE__ */ f(
1563
1724
  "mask",
1564
1725
  {
1565
1726
  id: o,
@@ -1569,15 +1730,15 @@ function Hn(t, e, n, i, r, s = !1) {
1569
1730
  width: "200%",
1570
1731
  height: "200%",
1571
1732
  ...t.type === "alpha" && t.source.kind !== "image" ? { "mask-type": "alpha" } : {},
1572
- children: h
1733
+ children: g
1573
1734
  },
1574
1735
  o
1575
1736
  ), A = `url(#${o})`;
1576
- return { def: g, style: { mask: A, WebkitMask: A }, id: o, feather: s };
1737
+ return { def: m, style: { mask: A, WebkitMask: A }, id: o, feather: a };
1577
1738
  }
1578
- const se = /* @__PURE__ */ new Map(), ae = it(se);
1579
- function ir(t) {
1580
- if (!t) return se;
1739
+ const fe = /* @__PURE__ */ new Map(), de = st(fe);
1740
+ function gr(t) {
1741
+ if (!t) return fe;
1581
1742
  const e = /* @__PURE__ */ new Map(), n = [t];
1582
1743
  for (; n.length > 0; ) {
1583
1744
  const i = n.pop();
@@ -1586,59 +1747,59 @@ function ir(t) {
1586
1747
  "id",
1587
1748
  "duplicate shape id ; first occurrence kept, later ones ignored (ADR 002 A2.1 #K)"
1588
1749
  ) : e.set(i.id, i));
1589
- const s = i.children;
1590
- if (s)
1591
- for (let o = s.length - 1; o >= 0; o--) n.push(s[o]);
1750
+ const a = i.children;
1751
+ if (a)
1752
+ for (let o = a.length - 1; o >= 0; o--) n.push(a[o]);
1592
1753
  }
1593
1754
  return e;
1594
1755
  }
1595
- function or({
1756
+ function mr({
1596
1757
  index: t,
1597
1758
  children: e
1598
1759
  }) {
1599
- return /* @__PURE__ */ f(ae.Provider, { value: t, children: e });
1760
+ return /* @__PURE__ */ f(de.Provider, { value: t, children: e });
1600
1761
  }
1601
- function zn() {
1602
- return K(ae);
1762
+ function Jn() {
1763
+ return K(de);
1603
1764
  }
1604
- function le({ node: t, store: e }) {
1605
- return t.kind === "repeat" ? /* @__PURE__ */ f(Xn, { node: t, store: e }) : /* @__PURE__ */ f(Wn, { node: t, store: e });
1765
+ function pe({ node: t, store: e }) {
1766
+ return t.kind === "repeat" ? /* @__PURE__ */ f(rr, { node: t, store: e }) : /* @__PURE__ */ f(Qn, { node: t, store: e });
1606
1767
  }
1607
- function Wn({ node: t, store: e }) {
1608
- wt();
1609
- const n = St(), i = tt(), r = zn(), s = Yt(
1610
- () => In(t, e, n),
1768
+ function Qn({ node: t, store: e }) {
1769
+ xt();
1770
+ const n = At(), i = nt(), r = Jn(), a = Ut(
1771
+ () => ir(t, e, n),
1611
1772
  // We re-build per render — signals re-render cheaply, and the
1612
1773
  // resolution itself is O(bindings) which is small. The memo is a
1613
1774
  // micro-optimisation to keep object identity stable across renders
1614
1775
  // when the inputs haven't changed.
1615
- [t, e, n, ...Kn(t, e, n)]
1616
- ), o = Pn(t, e, n);
1617
- It(t);
1618
- const a = hn[t.kind];
1619
- if (!a)
1776
+ [t, e, n, ...or(t, e, n)]
1777
+ ), o = Yn(t, e, n);
1778
+ Zt(t);
1779
+ const s = Mn[t.kind];
1780
+ if (!s)
1620
1781
  return S(t.id, "kind", "unknown render kind ; node not rendered"), null;
1621
1782
  const l = {};
1622
1783
  if (t.bindings)
1623
1784
  for (const [p, w] of Object.entries(t.bindings)) {
1624
- const $ = e.transitionSignal(q(n, w)).value;
1625
- $ !== void 0 && (l[p] = $);
1785
+ const v = e.transitionSignal(G(n, w)).value;
1786
+ v !== void 0 && (l[p] = v);
1626
1787
  }
1627
- const c = (p) => p in l ? l[p] : t.transitions?.[p], u = t.children?.map((p, w) => /* @__PURE__ */ f(le, { node: p, store: e }, p.id ?? w)), d = s.mask !== void 0 && typeof s.blendMode == "string" && Y(s.blendMode) !== void 0, m = {
1628
- visible: typeof s.visible == "boolean" ? s.visible : void 0,
1629
- opacity: typeof s.universal_opacity == "number" ? s.universal_opacity : void 0,
1788
+ 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 = {
1789
+ visible: typeof a.visible == "boolean" ? a.visible : void 0,
1790
+ opacity: typeof a.universal_opacity == "number" ? a.universal_opacity : void 0,
1630
1791
  // A frame applies its own static rotation (frame.tsx) so it pivots around
1631
1792
  // its centre ; the wrapper has no box for a self-positioning frame and would
1632
1793
  // pivot around a collapsed (0-height) box. Non-frames keep it on the wrapper
1633
1794
  // (they DO carry position/size there).
1634
- rotation: t.kind === "frame" ? void 0 : typeof s.rotation == "number" ? s.rotation : void 0,
1795
+ rotation: t.kind === "frame" ? void 0 : typeof a.rotation == "number" ? a.rotation : void 0,
1635
1796
  // Mirror (Figma scaleY(-1)) — like rotation, a frame mirrors itself
1636
1797
  // (frame.tsx) ; non-frames carry it on the wrapper, composed with rotation.
1637
- flipY: t.kind === "frame" ? void 0 : s.flipY === !0,
1638
- blur: typeof s.blur == "number" ? s.blur : void 0,
1639
- sizing: qn(s.sizing),
1640
- position: t.kind === "frame" ? void 0 : Gn(s),
1641
- size: t.kind === "frame" ? void 0 : qt(s),
1798
+ flipY: t.kind === "frame" ? void 0 : a.flipY === !0,
1799
+ blur: typeof a.blur == "number" ? a.blur : void 0,
1800
+ sizing: tr(a.sizing),
1801
+ position: t.kind === "frame" ? void 0 : er(a),
1802
+ size: t.kind === "frame" ? void 0 : Xt(a),
1642
1803
  // ADR 002 §3.2 (D2 / #D) — `blendMode` is a universal prop on every
1643
1804
  // primitive ; the wrapper re-validates it against the closed enum
1644
1805
  // before applying `mix-blend-mode` (T4 runtime gate). Pass the raw
@@ -1648,41 +1809,41 @@ function Wn({ node: t, store: e }) {
1648
1809
  // (inner) wrapper would fold over a transparent backdrop (the caramel
1649
1810
  // hard-light showed the raw blue wave instead of compositing over the warm
1650
1811
  // gradient). Drop it here when it will be hoisted.
1651
- blendMode: typeof s.blendMode == "string" && !d ? s.blendMode : void 0
1652
- }, h = t.children?.some(Yn) ?? !1, g = Object.keys(o.colorProps).length > 0 ? { ...s, ...o.colorProps } : s, A = /* @__PURE__ */ f(
1653
- a,
1812
+ blendMode: typeof a.blendMode == "string" && !d ? a.blendMode : void 0
1813
+ }, g = t.children?.some(nr) ?? !1, m = Object.keys(o.colorProps).length > 0 ? { ...a, ...o.colorProps } : a, A = /* @__PURE__ */ f(
1814
+ s,
1654
1815
  {
1655
- resolved: g,
1816
+ resolved: m,
1656
1817
  nodeId: t.id,
1657
1818
  transitionFor: c,
1658
1819
  animateInitial: t.animate_initial,
1659
- establishesContainingBlock: h,
1820
+ establishesContainingBlock: g,
1660
1821
  children: u
1661
1822
  }
1662
1823
  );
1663
1824
  let x = null;
1664
- if (s.mask !== void 0) {
1665
- const p = Ln(s.mask, t.id), w = (v) => {
1666
- const T = r.get(v);
1667
- return T ? T.kind === "frame" ? cn(T, T.id) : an(T, T.id) : null;
1825
+ if (a.mask !== void 0) {
1826
+ const p = Vn(a.mask, t.id), w = ($) => {
1827
+ const R = r.get($);
1828
+ return R ? R.kind === "frame" ? pn(R, R.id) : fn(R, R.id) : null;
1668
1829
  };
1669
- let $ = !1;
1830
+ let v = !1;
1670
1831
  if (p) {
1671
- const v = p.source;
1672
- if ((v.kind === "group" || v.kind === "shape") && typeof v.ref == "string") {
1673
- const T = r.get(v.ref);
1674
- $ = T ? ee(T) : !1;
1832
+ const $ = p.source;
1833
+ if (($.kind === "group" || $.kind === "shape") && typeof $.ref == "string") {
1834
+ const R = r.get($.ref);
1835
+ v = R ? oe(R) : !1;
1675
1836
  }
1676
1837
  }
1677
- x = p ? Hn(p, i, t.id, w, qt(s), $) : null;
1838
+ x = p ? Zn(p, i, t.id, w, Xt(a), v) : null;
1678
1839
  }
1679
1840
  const F = x !== null && x.style != null && "maskImage" in x.style;
1680
1841
  let k = A;
1681
1842
  x && F && (k = /* @__PURE__ */ f("div", { style: { width: "100%", height: "100%", ...x.style }, children: k }));
1682
- let y = /* @__PURE__ */ f(yn, { ...m, children: k });
1843
+ let y = /* @__PURE__ */ f(_n, { ...h, children: k });
1683
1844
  if (x && !F) {
1684
- const p = x.feather ? kt : 0;
1685
- y = /* @__PURE__ */ G(
1845
+ const p = x.feather ? wt : 0;
1846
+ y = /* @__PURE__ */ I(
1686
1847
  "div",
1687
1848
  {
1688
1849
  style: {
@@ -1699,7 +1860,7 @@ function Wn({ node: t, store: e }) {
1699
1860
  );
1700
1861
  }
1701
1862
  if (x && d) {
1702
- const p = Y(s.blendMode);
1863
+ const p = X(a.blendMode);
1703
1864
  y = /* @__PURE__ */ f(
1704
1865
  "div",
1705
1866
  {
@@ -1712,66 +1873,74 @@ function Wn({ node: t, store: e }) {
1712
1873
  }
1713
1874
  );
1714
1875
  }
1715
- return o.motionStyle && (y = /* @__PURE__ */ f(I.div, { "data-lumencast-bind-animate": t.id ?? "", style: o.motionStyle, children: y })), t.keyframes ? /* @__PURE__ */ f($n, { keyframes: t.keyframes, store: e, nodeId: t.id, children: y }) : y;
1876
+ return o.motionStyle && (y = /* @__PURE__ */ f(U.div, { "data-lumencast-bind-animate": t.id ?? "", style: o.motionStyle, children: y })), t.keyframes ? /* @__PURE__ */ f(On, { keyframes: t.keyframes, store: e, nodeId: t.id, children: y }) : y;
1716
1877
  }
1717
- function qn(t) {
1878
+ function tr(t) {
1718
1879
  if (typeof t != "object" || t === null) return;
1719
1880
  const e = t, n = {};
1720
1881
  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;
1721
1882
  }
1722
- function X(t) {
1883
+ function C(t) {
1723
1884
  return typeof t == "number" && Number.isFinite(t) ? t : void 0;
1724
1885
  }
1725
- function Gn(t) {
1726
- const e = X(t.x), n = X(t.y);
1886
+ function er(t) {
1887
+ let e = C(t.x), n = C(t.y);
1888
+ if (e === void 0 && n === void 0) {
1889
+ const i = t.position;
1890
+ i && typeof i == "object" && (e = C(i.x), n = C(i.y));
1891
+ }
1727
1892
  if (!(e === void 0 || n === void 0))
1728
1893
  return { x: e, y: n };
1729
1894
  }
1730
- function qt(t) {
1731
- const e = X(t.width), n = X(t.height);
1895
+ function Xt(t) {
1896
+ let e = C(t.width), n = C(t.height);
1897
+ if (e === void 0 && n === void 0) {
1898
+ const i = t.size;
1899
+ i && typeof i == "object" && (e = C(i.w), n = C(i.h));
1900
+ }
1732
1901
  if (!(e === void 0 && n === void 0))
1733
1902
  return { w: e, h: n };
1734
1903
  }
1735
- function Yn(t) {
1904
+ function nr(t) {
1736
1905
  if (t.kind === "frame") return !1;
1737
- 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;
1738
- return i && r;
1739
- }
1740
- function Xn({ node: t, store: e }) {
1741
- wt();
1742
- const n = St();
1743
- It(t);
1744
- const i = t.bindings?.items, r = i === void 0 ? [] : e.signal(q(n, i)).value ?? [];
1906
+ 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);
1907
+ return r && a;
1908
+ }
1909
+ function rr({ node: t, store: e }) {
1910
+ xt();
1911
+ const n = At();
1912
+ Zt(t);
1913
+ const i = t.bindings?.items, r = i === void 0 ? [] : e.signal(G(n, i)).value ?? [];
1745
1914
  if (!Array.isArray(r)) return null;
1746
- const s = t.children?.[0];
1747
- if (!s) return null;
1915
+ const a = t.children?.[0];
1916
+ if (!a) return null;
1748
1917
  const o = typeof t.stagger_ms == "number" ? t.stagger_ms : 0;
1749
- return /* @__PURE__ */ f(J, { children: r.map((a, l) => {
1750
- const c = xn(l, o), u = /* @__PURE__ */ f(gn, { prefix: `${i ?? ""}.${l}`, children: /* @__PURE__ */ f(le, { node: s, store: e }) }, l);
1751
- return c <= 0 ? u : /* @__PURE__ */ f(Mt.Provider, { value: c, children: u }, l);
1918
+ return /* @__PURE__ */ f(Q, { children: r.map((s, l) => {
1919
+ const c = Cn(l, o), u = /* @__PURE__ */ f(An, { prefix: `${i ?? ""}.${l}`, children: /* @__PURE__ */ f(pe, { node: a, store: e }) }, l);
1920
+ return c <= 0 ? u : /* @__PURE__ */ f(Ft.Provider, { value: c, children: u }, l);
1752
1921
  }) });
1753
1922
  }
1754
- function In(t, e, n) {
1923
+ function ir(t, e, n) {
1755
1924
  const i = { ...t.props ?? {} };
1756
1925
  if (t.bindings)
1757
- for (const [r, s] of Object.entries(t.bindings)) {
1758
- const o = q(n, s);
1926
+ for (const [r, a] of Object.entries(t.bindings)) {
1927
+ const o = G(n, a);
1759
1928
  i[r] = e.signal(o).value;
1760
1929
  }
1761
1930
  return i;
1762
1931
  }
1763
- function Kn(t, e, n) {
1932
+ function or(t, e, n) {
1764
1933
  if (!t.bindings) return [];
1765
1934
  const i = [];
1766
1935
  for (const r of Object.values(t.bindings))
1767
- i.push(e.signal(q(n, r)).value);
1936
+ i.push(e.signal(G(n, r)).value);
1768
1937
  return i;
1769
1938
  }
1770
1939
  export {
1771
- nr as A,
1772
- or as S,
1773
- le as T,
1774
- ir as b,
1775
- rr as r
1940
+ pr as A,
1941
+ mr as S,
1942
+ pe as T,
1943
+ gr as b,
1944
+ hr as r
1776
1945
  };
1777
- //# sourceMappingURL=tree-1coZ32nd.js.map
1946
+ //# sourceMappingURL=tree-BMxx5170.js.map