@elucim/dsl 0.5.0 → 0.7.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.
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { easeOutBounce as ie, easeOutElastic as ne, easeOutBack as se, easeInBack as ce, easeInOutExpo as le, easeOutExpo as ue, easeInExpo as he, easeInOutSine as fe, easeOutSine as ge, easeInSine as oe, easeInOutQuart as ye, easeOutQuart as me, easeInQuart as be, easeInOutCubic as xe, easeOutCubic as ve, easeInCubic as de, easeInOutQuad as ke, easeOutQuad as we, easeInQuad as Ie, linear as Se, spring as $e, cubicBezier as Oe, Presentation as Ae, Scene as Ce, Player as ze, Slide as pe, Parallel as Ee, Stagger as Fe, Morph as Pe, Transform as Re, Write as Ne, Draw as Te, FadeOut as Me, FadeIn as We, BarChart as _e, LaTeX as De, Graph as Ve, Matrix as Le, VectorField as je, Vector as qe, FunctionPlot as Be, Axes as Ue, Image as He, Text as Ge, Polygon as Ke, Rect as Qe, Arrow as Xe, Line as Je, Circle as Ye, BezierCurve as Ze, Group as et, Sequence as tt } from "@elucim/core";
2
- import { jsx as s, jsxs as F } from "react/jsx-runtime";
3
- import U, { forwardRef as at, useRef as rt, useImperativeHandle as it } from "react";
4
- import { renderToStaticMarkup as nt } from "react-dom/server";
5
- const V = {
1
+ import { easeOutBounce as he, easeOutElastic as fe, easeOutBack as oe, easeInBack as ge, easeInOutExpo as me, easeOutExpo as ye, easeInExpo as be, easeInOutSine as xe, easeOutSine as ve, easeInSine as de, easeInOutQuart as we, easeOutQuart as ke, easeInQuart as Ie, easeInOutCubic as Se, easeOutCubic as $e, easeInCubic as Oe, easeInOutQuad as Ae, easeOutQuad as Ce, easeInQuad as ze, linear as pe, spring as Ee, cubicBezier as Re, Presentation as Fe, Scene as Pe, Player as Te, Slide as Me, Parallel as Ne, Stagger as _e, Morph as De, Transform as We, Write as Ve, Draw as Le, FadeOut as je, FadeIn as qe, BarChart as Be, LaTeX as Ue, Graph as He, Matrix as Ge, Text as L, VectorField as Ke, Vector as Qe, FunctionPlot as Xe, Axes as Je, Image as Ye, Polygon as Ze, Rect as et, Arrow as tt, Line as at, Circle as rt, BezierCurve as it, Group as nt, Sequence as st } from "@elucim/core";
2
+ import { jsx as c, jsxs as R } from "react/jsx-runtime";
3
+ import Q, { forwardRef as ct, useRef as lt, useImperativeHandle as ut, useSyncExternalStore as ht } from "react";
4
+ import { renderToStaticMarkup as ft } from "react-dom/server";
5
+ const B = {
6
6
  sin: Math.sin,
7
7
  cos: Math.cos,
8
8
  tan: Math.tan,
@@ -22,12 +22,12 @@ const V = {
22
22
  max: (...e) => Math.max(...e),
23
23
  sign: Math.sign,
24
24
  pow: Math.pow
25
- }, H = {
25
+ }, X = {
26
26
  PI: Math.PI,
27
27
  E: Math.E,
28
28
  TAU: Math.PI * 2
29
29
  };
30
- function q(e) {
30
+ function G(e) {
31
31
  const a = [];
32
32
  let t = 0;
33
33
  for (; t < e.length; ) {
@@ -38,18 +38,18 @@ function q(e) {
38
38
  }
39
39
  if (/[0-9]/.test(r) || r === "." && t + 1 < e.length && /[0-9]/.test(e[t + 1])) {
40
40
  let n = "";
41
- const h = t;
41
+ const s = t;
42
42
  for (; t < e.length && /[0-9.]/.test(e[t]); )
43
43
  n += e[t++];
44
- a.push({ type: "NUMBER", value: n, pos: h });
44
+ a.push({ type: "NUMBER", value: n, pos: s });
45
45
  continue;
46
46
  }
47
47
  if (/[a-zA-Z_]/.test(r)) {
48
48
  let n = "";
49
- const h = t;
49
+ const s = t;
50
50
  for (; t < e.length && /[a-zA-Z0-9_]/.test(e[t]); )
51
51
  n += e[t++];
52
- a.push({ type: "IDENT", value: n, pos: h });
52
+ a.push({ type: "IDENT", value: n, pos: s });
53
53
  continue;
54
54
  }
55
55
  const i = t;
@@ -85,12 +85,12 @@ function q(e) {
85
85
  a.push({ type: "COMMA", value: ",", pos: i });
86
86
  break;
87
87
  default:
88
- throw new I(`Unexpected character '${r}'`, i);
88
+ throw new S(`Unexpected character '${r}'`, i);
89
89
  }
90
90
  }
91
91
  return a.push({ type: "EOF", value: "", pos: t }), a;
92
92
  }
93
- class B {
93
+ class K {
94
94
  constructor(a) {
95
95
  this.pos = 0, this.tokens = a;
96
96
  }
@@ -104,7 +104,7 @@ class B {
104
104
  expect(a) {
105
105
  const t = this.peek();
106
106
  if (t.type !== a)
107
- throw new I(
107
+ throw new S(
108
108
  `Expected ${a} but got ${t.type} ('${t.value}')`,
109
109
  t.pos
110
110
  );
@@ -115,7 +115,7 @@ class B {
115
115
  const a = this.parseExpression();
116
116
  if (this.peek().type !== "EOF") {
117
117
  const t = this.peek();
118
- throw new I(
118
+ throw new S(
119
119
  `Unexpected token '${t.value}' after expression`,
120
120
  t.pos
121
121
  );
@@ -168,14 +168,14 @@ class B {
168
168
  if (this.peek().type !== "RPAREN")
169
169
  for (r.push(this.parseExpression()); this.peek().type === "COMMA"; )
170
170
  this.advance(), r.push(this.parseExpression());
171
- if (this.expect("RPAREN"), !Object.prototype.hasOwnProperty.call(V, t))
172
- throw new I(
173
- `Unknown function '${t}'. Available: ${Object.keys(V).join(", ")}`,
171
+ if (this.expect("RPAREN"), !Object.prototype.hasOwnProperty.call(B, t))
172
+ throw new S(
173
+ `Unknown function '${t}'. Available: ${Object.keys(B).join(", ")}`,
174
174
  a.pos
175
175
  );
176
176
  return { kind: "call", name: t, args: r };
177
177
  }
178
- return Object.prototype.hasOwnProperty.call(H, t) ? { kind: "number", value: H[t] } : { kind: "variable", name: t };
178
+ return Object.prototype.hasOwnProperty.call(X, t) ? { kind: "number", value: X[t] } : { kind: "variable", name: t };
179
179
  }
180
180
  if (a.type === "LPAREN") {
181
181
  this.advance();
@@ -190,7 +190,7 @@ class B {
190
190
  this.advance(), t.push(this.parseExpression());
191
191
  return this.expect("RBRACKET"), { kind: "array", elements: t };
192
192
  }
193
- throw new I(
193
+ throw new S(
194
194
  `Unexpected token '${a.value}'`,
195
195
  a.pos
196
196
  );
@@ -202,7 +202,7 @@ function z(e, a) {
202
202
  return e.value;
203
203
  case "variable":
204
204
  if (Object.prototype.hasOwnProperty.call(a, e.name)) return a[e.name];
205
- throw new I(`Unknown variable '${e.name}'`, 0);
205
+ throw new S(`Unknown variable '${e.name}'`, 0);
206
206
  case "unary":
207
207
  const t = z(e.operand, a);
208
208
  return e.op === "-" ? -t : t;
@@ -223,95 +223,95 @@ function z(e, a) {
223
223
  break;
224
224
  }
225
225
  case "call": {
226
- const r = V[e.name], i = e.args.map((n) => z(n, a));
226
+ const r = B[e.name], i = e.args.map((n) => z(n, a));
227
227
  return r(...i);
228
228
  }
229
229
  case "array":
230
230
  return e.elements.map((r) => z(r, a));
231
231
  }
232
- throw new I("Invalid AST node", 0);
232
+ throw new S("Invalid AST node", 0);
233
233
  }
234
- class I extends Error {
234
+ class S extends Error {
235
235
  constructor(a, t) {
236
236
  super(a), this.name = "ExpressionError", this.position = t;
237
237
  }
238
238
  }
239
- function st(e) {
240
- const a = q(e), t = new B(a).parse();
239
+ function ot(e) {
240
+ const a = G(e), t = new K(a).parse();
241
241
  return (r) => z(t, r);
242
242
  }
243
- function ct(e) {
244
- const a = q(e), t = new B(a).parse();
243
+ function gt(e) {
244
+ const a = G(e), t = new K(a).parse();
245
245
  if (t.kind !== "array" || t.elements.length !== 2)
246
- throw new I(
246
+ throw new S(
247
247
  'Vector expression must be an array of 2 elements, e.g. "[-y, x]"',
248
248
  0
249
249
  );
250
250
  return (r) => z(t, r);
251
251
  }
252
- function X(e) {
252
+ function ee(e) {
253
253
  try {
254
- const a = q(e);
255
- return new B(a).parse(), null;
254
+ const a = G(e);
255
+ return new K(a).parse(), null;
256
256
  } catch (a) {
257
- return a instanceof I ? `${a.message} (at position ${a.position})` : String(a);
258
- }
259
- }
260
- const L = {
261
- linear: Se,
262
- easeInQuad: Ie,
263
- easeOutQuad: we,
264
- easeInOutQuad: ke,
265
- easeInCubic: de,
266
- easeOutCubic: ve,
267
- easeInOutCubic: xe,
268
- easeInQuart: be,
269
- easeOutQuart: me,
270
- easeInOutQuart: ye,
271
- easeInSine: oe,
272
- easeOutSine: ge,
273
- easeInOutSine: fe,
274
- easeInExpo: he,
275
- easeOutExpo: ue,
276
- easeInOutExpo: le,
277
- easeInBack: ce,
278
- easeOutBack: se,
279
- easeOutElastic: ne,
280
- easeOutBounce: ie
257
+ return a instanceof S ? `${a.message} (at position ${a.position})` : String(a);
258
+ }
259
+ }
260
+ const U = {
261
+ linear: pe,
262
+ easeInQuad: ze,
263
+ easeOutQuad: Ce,
264
+ easeInOutQuad: Ae,
265
+ easeInCubic: Oe,
266
+ easeOutCubic: $e,
267
+ easeInOutCubic: Se,
268
+ easeInQuart: Ie,
269
+ easeOutQuart: ke,
270
+ easeInOutQuart: we,
271
+ easeInSine: de,
272
+ easeOutSine: ve,
273
+ easeInOutSine: xe,
274
+ easeInExpo: be,
275
+ easeOutExpo: ye,
276
+ easeInOutExpo: me,
277
+ easeInBack: ge,
278
+ easeOutBack: oe,
279
+ easeOutElastic: fe,
280
+ easeOutBounce: he
281
281
  };
282
- function f(e) {
282
+ function o(e) {
283
283
  if (e !== void 0) {
284
284
  if (typeof e == "string") {
285
- const a = L[e];
285
+ const a = U[e];
286
286
  if (!a) {
287
- const t = Object.keys(L), r = t.find((n) => n.toLowerCase() === e.toLowerCase()), i = r ? ` Did you mean '${r}'?` : "";
287
+ const t = Object.keys(U), r = t.find((n) => n.toLowerCase() === e.toLowerCase()), i = r ? ` Did you mean '${r}'?` : "";
288
288
  throw new Error(`Unknown easing '${e}'.${i} Available: ${t.join(", ")}`);
289
289
  }
290
290
  return a;
291
291
  }
292
292
  if (e.type === "spring")
293
- return $e({
293
+ return Ee({
294
294
  stiffness: e.stiffness,
295
295
  damping: e.damping,
296
296
  mass: e.mass
297
297
  });
298
298
  if (e.type === "cubicBezier")
299
- return Oe(e.x1, e.y1, e.x2, e.y2);
299
+ return Re(e.x1, e.y1, e.x2, e.y2);
300
300
  throw new Error(`Unknown easing type: ${e.type}`);
301
301
  }
302
302
  }
303
- const _ = Object.keys(L);
304
- function J(e) {
303
+ const j = Object.keys(U);
304
+ function te(e) {
305
305
  const a = [];
306
306
  if (!e || typeof e != "object")
307
307
  return a.push({ path: "", message: "Document must be an object", severity: "error" }), { valid: !1, errors: a };
308
308
  const t = e;
309
- return t.version !== "1.0" && a.push({ path: "version", message: `Expected version "1.0", got "${t.version}"`, severity: "error" }), !t.root || typeof t.root != "object" ? (a.push({ path: "root", message: 'Missing or invalid "root" node', severity: "error" }), { valid: a.filter((r) => r.severity === "error").length === 0, errors: a }) : (lt(t.root, "root", a), {
309
+ return t.version !== "1.0" && a.push({ path: "version", message: `Expected version "1.0", got "${t.version}"`, severity: "error" }), !t.root || typeof t.root != "object" ? (a.push({ path: "root", message: 'Missing or invalid "root" node', severity: "error" }), { valid: a.filter((r) => r.severity === "error").length === 0, errors: a }) : (mt(t.root, "root", a), {
310
310
  valid: a.filter((r) => r.severity === "error").length === 0,
311
311
  errors: a
312
312
  });
313
313
  }
314
- const G = ["scene", "player", "presentation"], T = ["card", "slide", "square"], D = [
314
+ const J = ["scene", "player", "presentation"], D = ["card", "slide", "square"], q = [
315
315
  "sequence",
316
316
  "group",
317
317
  "bezierCurve",
@@ -340,219 +340,219 @@ const G = ["scene", "player", "presentation"], T = ["card", "slide", "square"],
340
340
  "parallel",
341
341
  "player",
342
342
  "scene"
343
- ], K = ["none", "fade", "slide-left", "slide-up", "zoom"];
344
- function lt(e, a, t) {
343
+ ], Y = ["none", "fade", "slide-left", "slide-up", "zoom"];
344
+ function mt(e, a, t) {
345
345
  const r = e.type;
346
- if (!G.includes(r)) {
347
- t.push({ path: `${a}.type`, message: `Root type must be one of: ${G.join(", ")}. Got "${r}"`, severity: "error" });
346
+ if (!J.includes(r)) {
347
+ t.push({ path: `${a}.type`, message: `Root type must be one of: ${J.join(", ")}. Got "${r}"`, severity: "error" });
348
348
  return;
349
349
  }
350
- r === "scene" || r === "player" ? Y(e, a, r, t) : r === "presentation" && ut(e, a, t);
350
+ r === "scene" || r === "player" ? ae(e, a, r, t) : r === "presentation" && yt(e, a, t);
351
351
  }
352
- function Y(e, a, t, r) {
353
- Tt(e, "durationInFrames", a, r), y(e, "width", a, r), y(e, "height", a, r), y(e, "fps", a, r), $(e, "background", a, r), e.preset !== void 0 && (typeof e.preset != "string" || !T.includes(e.preset)) && r.push({ path: `${a}.preset`, message: `preset must be one of: ${T.join(", ")}. Got "${e.preset}"`, severity: "error" }), t === "player" && (N(e, "controls", a, r), N(e, "loop", a, r), N(e, "autoPlay", a, r)), O(e, a, r);
352
+ function ae(e, a, t, r) {
353
+ Lt(e, "durationInFrames", a, r), g(e, "width", a, r), g(e, "height", a, r), g(e, "fps", a, r), A(e, "background", a, r), e.preset !== void 0 && (typeof e.preset != "string" || !D.includes(e.preset)) && r.push({ path: `${a}.preset`, message: `preset must be one of: ${D.join(", ")}. Got "${e.preset}"`, severity: "error" }), t === "player" && (N(e, "controls", a, r), N(e, "loop", a, r), N(e, "autoPlay", a, r)), C(e, a, r);
354
354
  }
355
- function ut(e, a, t) {
356
- if (y(e, "width", a, t), y(e, "height", a, t), $(e, "background", a, t), y(e, "transitionDuration", a, t), N(e, "showHud", a, t), N(e, "showNotes", a, t), e.preset !== void 0 && (typeof e.preset != "string" || !T.includes(e.preset)) && t.push({ path: `${a}.preset`, message: `preset must be one of: ${T.join(", ")}. Got "${e.preset}"`, severity: "error" }), e.transition !== void 0 && (K.includes(e.transition) || t.push({
355
+ function yt(e, a, t) {
356
+ if (g(e, "width", a, t), g(e, "height", a, t), A(e, "background", a, t), g(e, "transitionDuration", a, t), N(e, "showHud", a, t), N(e, "showNotes", a, t), e.preset !== void 0 && (typeof e.preset != "string" || !D.includes(e.preset)) && t.push({ path: `${a}.preset`, message: `preset must be one of: ${D.join(", ")}. Got "${e.preset}"`, severity: "error" }), e.transition !== void 0 && (Y.includes(e.transition) || t.push({
357
357
  path: `${a}.transition`,
358
- message: `Invalid transition "${e.transition}". Must be one of: ${K.join(", ")}`,
358
+ message: `Invalid transition "${e.transition}". Must be one of: ${Y.join(", ")}`,
359
359
  severity: "error"
360
360
  })), !Array.isArray(e.slides)) {
361
361
  t.push({ path: `${a}.slides`, message: 'Presentation must have a "slides" array', severity: "error" });
362
362
  return;
363
363
  }
364
364
  e.slides.length === 0 && t.push({ path: `${a}.slides`, message: "Presentation must have at least one slide", severity: "warning" }), e.slides.forEach((r, i) => {
365
- ht(r, `${a}.slides[${i}]`, t);
365
+ bt(r, `${a}.slides[${i}]`, t);
366
366
  });
367
367
  }
368
- function ht(e, a, t) {
368
+ function bt(e, a, t) {
369
369
  if (!e || typeof e != "object") {
370
370
  t.push({ path: a, message: "Slide must be an object", severity: "error" });
371
371
  return;
372
372
  }
373
- $(e, "title", a, t), $(e, "notes", a, t), $(e, "background", a, t), e.children !== void 0 && (Array.isArray(e.children) ? e.children.forEach((r, i) => {
374
- Z(r, `${a}.children[${i}]`, t);
373
+ A(e, "title", a, t), A(e, "notes", a, t), A(e, "background", a, t), e.children !== void 0 && (Array.isArray(e.children) ? e.children.forEach((r, i) => {
374
+ re(r, `${a}.children[${i}]`, t);
375
375
  }) : t.push({ path: `${a}.children`, message: "Slide children must be an array", severity: "error" }));
376
376
  }
377
- function O(e, a, t) {
377
+ function C(e, a, t) {
378
378
  if (!Array.isArray(e.children)) {
379
379
  t.push({ path: `${a}.children`, message: 'Expected "children" array', severity: "error" });
380
380
  return;
381
381
  }
382
382
  e.children.forEach((r, i) => {
383
- Z(r, `${a}.children[${i}]`, t);
383
+ re(r, `${a}.children[${i}]`, t);
384
384
  });
385
385
  }
386
- function Z(e, a, t) {
386
+ function re(e, a, t) {
387
387
  if (!e || typeof e != "object") {
388
388
  t.push({ path: a, message: "Element must be an object", severity: "error" });
389
389
  return;
390
390
  }
391
391
  const r = e.type;
392
- if (!r || !D.includes(r)) {
393
- const i = r ? ee(r, D) : "";
392
+ if (!r || !q.includes(r)) {
393
+ const i = r ? ie(r, q) : "";
394
394
  t.push({
395
395
  path: `${a}.type`,
396
- message: `Unknown element type "${r}".${i} Valid types: ${D.join(", ")}`,
396
+ message: `Unknown element type "${r}".${i} Valid types: ${q.join(", ")}`,
397
397
  severity: "error"
398
398
  });
399
399
  return;
400
400
  }
401
401
  switch (r) {
402
402
  case "bezierCurve":
403
- ft(e, a, t);
403
+ xt(e, a, t);
404
404
  break;
405
405
  case "circle":
406
- gt(e, a, t);
406
+ vt(e, a, t);
407
407
  break;
408
408
  case "line":
409
- ot(e, a, t);
409
+ dt(e, a, t);
410
410
  break;
411
411
  case "arrow":
412
- yt(e, a, t);
412
+ wt(e, a, t);
413
413
  break;
414
414
  case "rect":
415
- mt(e, a, t);
415
+ kt(e, a, t);
416
416
  break;
417
417
  case "polygon":
418
- bt(e, a, t);
418
+ It(e, a, t);
419
419
  break;
420
420
  case "text":
421
- xt(e, a, t);
421
+ St(e, a, t);
422
422
  break;
423
423
  case "image":
424
- Pt(e, a, t);
424
+ Dt(e, a, t);
425
425
  break;
426
426
  case "axes":
427
- vt(e, a, t);
427
+ $t(e, a, t);
428
428
  break;
429
429
  case "functionPlot":
430
- dt(e, a, t);
430
+ Ot(e, a, t);
431
431
  break;
432
432
  case "vector":
433
- kt(e, a, t);
433
+ At(e, a, t);
434
434
  break;
435
435
  case "vectorField":
436
- wt(e, a, t);
436
+ Ct(e, a, t);
437
437
  break;
438
438
  case "matrix":
439
- It(e, a, t);
439
+ zt(e, a, t);
440
440
  break;
441
441
  case "graph":
442
- St(e, a, t);
442
+ pt(e, a, t);
443
443
  break;
444
444
  case "latex":
445
- $t(e, a, t);
445
+ Et(e, a, t);
446
446
  break;
447
447
  case "barChart":
448
- Nt(e, a, t);
448
+ Vt(e, a, t);
449
449
  break;
450
450
  case "sequence":
451
- Ot(e, a, t);
451
+ Rt(e, a, t);
452
452
  break;
453
453
  case "group":
454
- Rt(e, a, t);
454
+ Wt(e, a, t);
455
455
  break;
456
456
  case "parallel":
457
- O(e, a, t);
457
+ C(e, a, t);
458
458
  break;
459
459
  case "fadeIn":
460
460
  case "fadeOut":
461
461
  case "draw":
462
462
  case "write":
463
- At(e, a, t);
463
+ Ft(e, a, t);
464
464
  break;
465
465
  case "transform":
466
- Ct(e, a, t);
466
+ Pt(e, a, t);
467
467
  break;
468
468
  case "morph":
469
- zt(e, a, t);
469
+ Tt(e, a, t);
470
470
  break;
471
471
  case "stagger":
472
- pt(e, a, t);
472
+ Mt(e, a, t);
473
473
  break;
474
474
  case "scene":
475
475
  case "player":
476
- Y(e, a, r, t);
476
+ ae(e, a, r, t);
477
477
  break;
478
478
  }
479
479
  }
480
- function ft(e, a, t) {
481
- u(e, "x1", a, t), u(e, "y1", a, t), u(e, "cx1", a, t), u(e, "cy1", a, t), u(e, "x2", a, t), u(e, "y2", a, t), e.cx2 !== void 0 && P(e, "cx2", a, t), e.cy2 !== void 0 && P(e, "cy2", a, t), v(e, a, t);
480
+ function xt(e, a, t) {
481
+ h(e, "x1", a, t), h(e, "y1", a, t), h(e, "cx1", a, t), h(e, "cy1", a, t), h(e, "x2", a, t), h(e, "y2", a, t), e.cx2 !== void 0 && F(e, "cx2", a, t), e.cy2 !== void 0 && F(e, "cy2", a, t), v(e, a, t);
482
482
  }
483
- function gt(e, a, t) {
484
- u(e, "cx", a, t), u(e, "cy", a, t), p(e, "r", a, t), v(e, a, t);
483
+ function vt(e, a, t) {
484
+ h(e, "cx", a, t), h(e, "cy", a, t), p(e, "r", a, t), v(e, a, t);
485
485
  }
486
- function ot(e, a, t) {
487
- u(e, "x1", a, t), u(e, "y1", a, t), u(e, "x2", a, t), u(e, "y2", a, t), v(e, a, t);
486
+ function dt(e, a, t) {
487
+ h(e, "x1", a, t), h(e, "y1", a, t), h(e, "x2", a, t), h(e, "y2", a, t), v(e, a, t);
488
488
  }
489
- function yt(e, a, t) {
490
- u(e, "x1", a, t), u(e, "y1", a, t), u(e, "x2", a, t), u(e, "y2", a, t), v(e, a, t);
489
+ function wt(e, a, t) {
490
+ h(e, "x1", a, t), h(e, "y1", a, t), h(e, "x2", a, t), h(e, "y2", a, t), v(e, a, t);
491
491
  }
492
- function mt(e, a, t) {
493
- u(e, "x", a, t), u(e, "y", a, t), p(e, "width", a, t), p(e, "height", a, t), v(e, a, t);
492
+ function kt(e, a, t) {
493
+ h(e, "x", a, t), h(e, "y", a, t), p(e, "width", a, t), p(e, "height", a, t), v(e, a, t);
494
494
  }
495
- function bt(e, a, t) {
495
+ function It(e, a, t) {
496
496
  Array.isArray(e.points) ? e.points.length < 3 ? t.push({ path: `${a}.points`, message: "Polygon requires at least 3 points", severity: "error" }) : e.points.forEach((r, i) => {
497
497
  (!Array.isArray(r) || r.length !== 2 || typeof r[0] != "number" || typeof r[1] != "number") && t.push({ path: `${a}.points[${i}]`, message: "Each point must be [number, number]", severity: "error" });
498
498
  }) : t.push({ path: `${a}.points`, message: 'Polygon requires a "points" array', severity: "error" }), v(e, a, t);
499
499
  }
500
- function xt(e, a, t) {
501
- u(e, "x", a, t), u(e, "y", a, t), typeof e.content != "string" && t.push({ path: `${a}.content`, message: 'Text requires a "content" string', severity: "error" }), v(e, a, t);
500
+ function St(e, a, t) {
501
+ h(e, "x", a, t), h(e, "y", a, t), typeof e.content != "string" && t.push({ path: `${a}.content`, message: 'Text requires a "content" string', severity: "error" }), v(e, a, t);
502
502
  }
503
- function vt(e, a, t) {
504
- k(e, "domain", a, t), k(e, "range", a, t), k(e, "origin", a, t), M(e, a, t);
503
+ function $t(e, a, t) {
504
+ k(e, "domain", a, t), k(e, "range", a, t), k(e, "origin", a, t), W(e, a, t);
505
505
  }
506
- function dt(e, a, t) {
506
+ function Ot(e, a, t) {
507
507
  if (typeof e.fn != "string")
508
508
  t.push({ path: `${a}.fn`, message: 'FunctionPlot requires a "fn" expression string', severity: "error" });
509
509
  else {
510
- const r = X(e.fn);
510
+ const r = ee(e.fn);
511
511
  r && t.push({ path: `${a}.fn`, message: `Invalid expression: ${r}`, severity: "error" });
512
512
  }
513
- k(e, "domain", a, t), M(e, a, t);
513
+ k(e, "domain", a, t), W(e, a, t);
514
514
  }
515
- function kt(e, a, t) {
516
- (!Array.isArray(e.to) || e.to.length !== 2) && t.push({ path: `${a}.to`, message: 'Vector requires a "to" array of [number, number]', severity: "error" }), k(e, "from", a, t), M(e, a, t);
515
+ function At(e, a, t) {
516
+ (!Array.isArray(e.to) || e.to.length !== 2) && t.push({ path: `${a}.to`, message: 'Vector requires a "to" array of [number, number]', severity: "error" }), k(e, "from", a, t), W(e, a, t);
517
517
  }
518
- function wt(e, a, t) {
518
+ function Ct(e, a, t) {
519
519
  if (typeof e.fn != "string")
520
520
  t.push({ path: `${a}.fn`, message: 'VectorField requires a "fn" expression string', severity: "error" });
521
521
  else {
522
- const r = X(e.fn);
522
+ const r = ee(e.fn);
523
523
  r && t.push({ path: `${a}.fn`, message: `Invalid vector expression: ${r}`, severity: "error" });
524
524
  }
525
- k(e, "domain", a, t), k(e, "range", a, t), M(e, a, t);
525
+ k(e, "domain", a, t), k(e, "range", a, t), W(e, a, t);
526
526
  }
527
- function It(e, a, t) {
527
+ function zt(e, a, t) {
528
528
  Array.isArray(e.values) ? e.values.forEach((r, i) => {
529
529
  Array.isArray(r) || t.push({ path: `${a}.values[${i}]`, message: "Each matrix row must be an array", severity: "error" });
530
530
  }) : t.push({ path: `${a}.values`, message: 'Matrix requires a "values" 2D array', severity: "error" }), v(e, a, t);
531
531
  }
532
- function St(e, a, t) {
532
+ function pt(e, a, t) {
533
533
  if (!Array.isArray(e.nodes))
534
534
  t.push({ path: `${a}.nodes`, message: 'Graph requires a "nodes" array', severity: "error" });
535
535
  else {
536
536
  const r = /* @__PURE__ */ new Set();
537
537
  e.nodes.forEach((i, n) => {
538
- typeof i.id != "string" ? t.push({ path: `${a}.nodes[${n}].id`, message: 'Graph node requires a string "id"', severity: "error" }) : (r.has(i.id) && t.push({ path: `${a}.nodes[${n}].id`, message: `Duplicate node id "${i.id}"`, severity: "error" }), r.add(i.id)), u(i, "x", `${a}.nodes[${n}]`, t), u(i, "y", `${a}.nodes[${n}]`, t);
538
+ typeof i.id != "string" ? t.push({ path: `${a}.nodes[${n}].id`, message: 'Graph node requires a string "id"', severity: "error" }) : (r.has(i.id) && t.push({ path: `${a}.nodes[${n}].id`, message: `Duplicate node id "${i.id}"`, severity: "error" }), r.add(i.id)), h(i, "x", `${a}.nodes[${n}]`, t), h(i, "y", `${a}.nodes[${n}]`, t);
539
539
  }), Array.isArray(e.edges) && e.edges.forEach((i, n) => {
540
540
  (typeof i.from != "string" || !r.has(i.from)) && t.push({ path: `${a}.edges[${n}].from`, message: `Edge "from" references unknown node "${i.from}"`, severity: "error" }), (typeof i.to != "string" || !r.has(i.to)) && t.push({ path: `${a}.edges[${n}].to`, message: `Edge "to" references unknown node "${i.to}"`, severity: "error" });
541
541
  });
542
542
  }
543
543
  v(e, a, t);
544
544
  }
545
- function $t(e, a, t) {
546
- typeof e.expression != "string" && t.push({ path: `${a}.expression`, message: 'LaTeX requires an "expression" string', severity: "error" }), u(e, "x", a, t), u(e, "y", a, t), v(e, a, t);
545
+ function Et(e, a, t) {
546
+ typeof e.expression != "string" && t.push({ path: `${a}.expression`, message: 'LaTeX requires an "expression" string', severity: "error" }), h(e, "x", a, t), h(e, "y", a, t), v(e, a, t);
547
547
  }
548
- function Ot(e, a, t) {
549
- u(e, "from", a, t), Mt(e, "durationInFrames", a, t), O(e, a, t);
548
+ function Rt(e, a, t) {
549
+ h(e, "from", a, t), jt(e, "durationInFrames", a, t), C(e, a, t);
550
550
  }
551
- function At(e, a, t) {
552
- y(e, "duration", a, t), R(e, a, t), O(e, a, t);
551
+ function Ft(e, a, t) {
552
+ g(e, "duration", a, t), P(e, a, t), C(e, a, t);
553
553
  }
554
- function Ct(e, a, t) {
555
- if (y(e, "duration", a, t), R(e, a, t), e.translate !== void 0) {
554
+ function Pt(e, a, t) {
555
+ if (g(e, "duration", a, t), P(e, a, t), e.translate !== void 0) {
556
556
  const r = e.translate;
557
557
  (!r || typeof r != "object") && t.push({ path: `${a}.translate`, message: "translate must be { from: [x,y], to: [x,y] }", severity: "error" });
558
558
  }
@@ -568,51 +568,51 @@ function Ct(e, a, t) {
568
568
  const r = e.opacity;
569
569
  (!r || typeof r != "object" || typeof r.from != "number" || typeof r.to != "number") && t.push({ path: `${a}.opacity`, message: "opacity must be { from: number, to: number }", severity: "error" });
570
570
  }
571
- O(e, a, t);
571
+ C(e, a, t);
572
572
  }
573
- function zt(e, a, t) {
574
- y(e, "duration", a, t), R(e, a, t), $(e, "fromColor", a, t), $(e, "toColor", a, t), O(e, a, t);
573
+ function Tt(e, a, t) {
574
+ g(e, "duration", a, t), P(e, a, t), A(e, "fromColor", a, t), A(e, "toColor", a, t), C(e, a, t);
575
575
  }
576
- function pt(e, a, t) {
577
- y(e, "staggerDelay", a, t), R(e, a, t), O(e, a, t);
576
+ function Mt(e, a, t) {
577
+ g(e, "staggerDelay", a, t), P(e, a, t), C(e, a, t);
578
578
  }
579
579
  function v(e, a, t) {
580
- y(e, "fadeIn", a, t), y(e, "fadeOut", a, t), y(e, "draw", a, t), R(e, a, t), Et(e, a, t);
580
+ g(e, "fadeIn", a, t), g(e, "fadeOut", a, t), g(e, "draw", a, t), P(e, a, t), Nt(e, a, t);
581
581
  }
582
- function M(e, a, t) {
583
- y(e, "fadeIn", a, t), y(e, "fadeOut", a, t), y(e, "draw", a, t), R(e, a, t), Ft(e, a, t);
582
+ function W(e, a, t) {
583
+ g(e, "fadeIn", a, t), g(e, "fadeOut", a, t), g(e, "draw", a, t), P(e, a, t), _t(e, a, t);
584
584
  }
585
- const Q = ["none", "circle", "ellipse"];
586
- function Et(e, a, t) {
587
- if (P(e, "rotation", a, t), k(e, "rotationOrigin", a, t), k(e, "translate", a, t), P(e, "zIndex", a, t), e.scale !== void 0) {
585
+ const Z = ["none", "circle", "ellipse"];
586
+ function Nt(e, a, t) {
587
+ if (F(e, "rotation", a, t), k(e, "rotationOrigin", a, t), k(e, "translate", a, t), F(e, "zIndex", a, t), e.scale !== void 0) {
588
588
  const r = e.scale;
589
589
  typeof r == "number" || Array.isArray(r) && r.length === 2 && typeof r[0] == "number" && typeof r[1] == "number" || t.push({ path: `${a}.scale`, message: '"scale" must be a number or [number, number]', severity: "error" });
590
590
  }
591
591
  }
592
- function Ft(e, a, t) {
593
- P(e, "rotation", a, t), k(e, "rotationOrigin", a, t), k(e, "translate", a, t), P(e, "zIndex", a, t);
592
+ function _t(e, a, t) {
593
+ F(e, "rotation", a, t), k(e, "rotationOrigin", a, t), k(e, "translate", a, t), F(e, "zIndex", a, t);
594
594
  }
595
- function Pt(e, a, t) {
596
- typeof e.src != "string" && t.push({ path: `${a}.src`, message: 'Image requires a "src" string', severity: "error" }), u(e, "x", a, t), u(e, "y", a, t), p(e, "width", a, t), p(e, "height", a, t), $(e, "preserveAspectRatio", a, t), e.borderRadius !== void 0 && (typeof e.borderRadius != "number" || e.borderRadius < 0) && t.push({ path: `${a}.borderRadius`, message: '"borderRadius" must be a number >= 0', severity: "error" }), e.clipShape !== void 0 && (Q.includes(e.clipShape) || t.push({
595
+ function Dt(e, a, t) {
596
+ typeof e.src != "string" && t.push({ path: `${a}.src`, message: 'Image requires a "src" string', severity: "error" }), h(e, "x", a, t), h(e, "y", a, t), p(e, "width", a, t), p(e, "height", a, t), A(e, "preserveAspectRatio", a, t), e.borderRadius !== void 0 && (typeof e.borderRadius != "number" || e.borderRadius < 0) && t.push({ path: `${a}.borderRadius`, message: '"borderRadius" must be a number >= 0', severity: "error" }), e.clipShape !== void 0 && (Z.includes(e.clipShape) || t.push({
597
597
  path: `${a}.clipShape`,
598
- message: `Invalid clipShape "${e.clipShape}". Must be one of: ${Q.join(", ")}`,
598
+ message: `Invalid clipShape "${e.clipShape}". Must be one of: ${Z.join(", ")}`,
599
599
  severity: "error"
600
600
  })), v(e, a, t);
601
601
  }
602
- function Rt(e, a, t) {
603
- O(e, a, t), v(e, a, t);
602
+ function Wt(e, a, t) {
603
+ C(e, a, t), v(e, a, t);
604
604
  }
605
- function Nt(e, a, t) {
606
- u(e, "x", a, t), u(e, "y", a, t), p(e, "width", a, t), p(e, "height", a, t), Array.isArray(e.bars) || t.push({ path: `${a}.bars`, message: 'BarChart requires a "bars" array', severity: "error" }), v(e, a, t);
605
+ function Vt(e, a, t) {
606
+ h(e, "x", a, t), h(e, "y", a, t), p(e, "width", a, t), p(e, "height", a, t), Array.isArray(e.bars) || t.push({ path: `${a}.bars`, message: 'BarChart requires a "bars" array', severity: "error" }), v(e, a, t);
607
607
  }
608
- function R(e, a, t) {
608
+ function P(e, a, t) {
609
609
  if (e.easing !== void 0) {
610
610
  if (typeof e.easing == "string") {
611
- if (!_.includes(e.easing)) {
612
- const r = ee(e.easing, _);
611
+ if (!j.includes(e.easing)) {
612
+ const r = ie(e.easing, j);
613
613
  t.push({
614
614
  path: `${a}.easing`,
615
- message: `Unknown easing "${e.easing}".${r} Available: ${_.join(", ")}`,
615
+ message: `Unknown easing "${e.easing}".${r} Available: ${j.join(", ")}`,
616
616
  severity: "error"
617
617
  });
618
618
  }
@@ -632,27 +632,27 @@ function R(e, a, t) {
632
632
  t.push({ path: `${a}.easing`, message: 'Easing must be a string name or { type: "spring"|"cubicBezier", ... }', severity: "error" });
633
633
  }
634
634
  }
635
- function u(e, a, t, r) {
635
+ function h(e, a, t, r) {
636
636
  typeof e[a] != "number" && r.push({ path: `${t}.${a}`, message: `Required numeric field "${a}" is missing or not a number`, severity: "error" });
637
637
  }
638
638
  function p(e, a, t, r) {
639
639
  (typeof e[a] != "number" || e[a] <= 0) && r.push({ path: `${t}.${a}`, message: `"${a}" must be a positive number`, severity: "error" });
640
640
  }
641
- function Tt(e, a, t, r) {
641
+ function Lt(e, a, t, r) {
642
642
  const i = e[a];
643
643
  (typeof i != "number" || i <= 0 || !Number.isInteger(i)) && r.push({ path: `${t}.${a}`, message: `"${a}" must be a positive integer`, severity: "error" });
644
644
  }
645
- function y(e, a, t, r) {
645
+ function g(e, a, t, r) {
646
646
  e[a] !== void 0 && (typeof e[a] != "number" || e[a] <= 0) && r.push({ path: `${t}.${a}`, message: `"${a}" must be a positive number`, severity: "error" });
647
647
  }
648
- function Mt(e, a, t, r) {
648
+ function jt(e, a, t, r) {
649
649
  const i = e[a];
650
650
  i !== void 0 && (typeof i != "number" || i <= 0 || !Number.isInteger(i)) && r.push({ path: `${t}.${a}`, message: `"${a}" must be a positive integer`, severity: "error" });
651
651
  }
652
- function $(e, a, t, r) {
652
+ function A(e, a, t, r) {
653
653
  e[a] !== void 0 && typeof e[a] != "string" && r.push({ path: `${t}.${a}`, message: `"${a}" must be a string`, severity: "error" });
654
654
  }
655
- function P(e, a, t, r) {
655
+ function F(e, a, t, r) {
656
656
  e[a] !== void 0 && typeof e[a] != "number" && r.push({ path: `${t}.${a}`, message: `"${a}" must be a number`, severity: "error" });
657
657
  }
658
658
  function N(e, a, t, r) {
@@ -662,15 +662,17 @@ function k(e, a, t, r) {
662
662
  const i = e[a];
663
663
  i !== void 0 && (!Array.isArray(i) || i.length !== 2 || typeof i[0] != "number" || typeof i[1] != "number") && r.push({ path: `${t}.${a}`, message: `"${a}" must be [number, number]`, severity: "error" });
664
664
  }
665
- function ee(e, a) {
665
+ function ie(e, a) {
666
666
  const t = e.toLowerCase(), r = a.find((n) => n.toLowerCase() === t);
667
667
  if (r) return ` Did you mean '${r}'?`;
668
668
  const i = a.find((n) => n.toLowerCase().startsWith(t.slice(0, 4)));
669
669
  return i ? ` Did you mean '${i}'?` : "";
670
670
  }
671
- const te = {
672
- foreground: { cssVar: "--elucim-foreground", fallback: "#e0e0e0" },
673
- background: { cssVar: "--elucim-background", fallback: "#0f172a" },
671
+ const ne = {
672
+ foreground: { cssVar: "--elucim-foreground", fallback: "#c8d6e5" },
673
+ background: { cssVar: "--elucim-background", fallback: "#0a0a1e" },
674
+ title: { cssVar: "--elucim-title", fallback: "#e0e7ff" },
675
+ subtitle: { cssVar: "--elucim-subtitle", fallback: "#94a3b8" },
674
676
  accent: { cssVar: "--elucim-accent", fallback: "#4fc3f7" },
675
677
  muted: { cssVar: "--elucim-muted", fallback: "#64748b" },
676
678
  surface: { cssVar: "--elucim-surface", fallback: "#1e293b" },
@@ -681,31 +683,31 @@ const te = {
681
683
  success: { cssVar: "--elucim-success", fallback: "#34d399" },
682
684
  warning: { cssVar: "--elucim-warning", fallback: "#fbbf24" },
683
685
  error: { cssVar: "--elucim-error", fallback: "#f87171" }
684
- }, Qt = Object.keys(te);
685
- function l(e) {
686
+ }, ca = Object.keys(ne);
687
+ function u(e) {
686
688
  if (e === void 0) return;
687
689
  if (!e.startsWith("$")) return e;
688
- const a = e.slice(1), t = te[a];
690
+ const a = e.slice(1), t = ne[a];
689
691
  return t ? `var(${t.cssVar}, ${t.fallback})` : `var(--elucim-${a})`;
690
692
  }
691
- const Wt = {
693
+ const qt = {
692
694
  card: [640, 360],
693
695
  slide: [1280, 720],
694
696
  square: [600, 600]
695
697
  };
696
- function W(e, a, t) {
698
+ function V(e, a, t) {
697
699
  if (!e) return { width: a, height: t };
698
- const [r, i] = Wt[e];
700
+ const [r, i] = qt[e];
699
701
  return { width: a ?? r, height: t ?? i };
700
702
  }
701
- function ae(e, a) {
703
+ function se(e, a) {
702
704
  switch (e.type) {
703
705
  case "scene":
704
- return j(e, a);
706
+ return H(e, a);
705
707
  case "player":
706
708
  if ((a == null ? void 0 : a.frame) !== void 0) {
707
- const { width: t, height: r } = W(e.preset, e.width, e.height);
708
- return j(
709
+ const { width: t, height: r } = V(e.preset, e.width, e.height);
710
+ return H(
709
711
  {
710
712
  width: t,
711
713
  height: r,
@@ -717,37 +719,37 @@ function ae(e, a) {
717
719
  a
718
720
  );
719
721
  }
720
- return re(e, a);
722
+ return ce(e, a);
721
723
  case "presentation":
722
- return _t(e);
724
+ return Bt(e);
723
725
  }
724
726
  }
725
- function j(e, a) {
726
- const t = (a == null ? void 0 : a.frame) !== void 0, { width: r, height: i } = W(e.preset, e.width, e.height);
727
- return /* @__PURE__ */ s(
728
- Ce,
727
+ function H(e, a) {
728
+ const t = (a == null ? void 0 : a.frame) !== void 0, { width: r, height: i } = V(e.preset, e.width, e.height);
729
+ return /* @__PURE__ */ c(
730
+ Pe,
729
731
  {
730
732
  width: r,
731
733
  height: i,
732
734
  fps: e.fps,
733
735
  durationInFrames: e.durationInFrames,
734
- background: l(e.background),
736
+ background: u(e.background),
735
737
  ...t ? { frame: a.frame, autoPlay: !1 } : {},
736
- children: e.children.map((n, h) => x(n, h))
738
+ children: e.children.map((n, s) => x(n, s))
737
739
  }
738
740
  );
739
741
  }
740
- function re(e, a) {
741
- const { width: t, height: r } = W(e.preset, e.width, e.height);
742
- return /* @__PURE__ */ s(
743
- ze,
742
+ function ce(e, a) {
743
+ const { width: t, height: r } = V(e.preset, e.width, e.height);
744
+ return /* @__PURE__ */ c(
745
+ Te,
744
746
  {
745
747
  ref: a == null ? void 0 : a.playerRef,
746
748
  width: t,
747
749
  height: r,
748
750
  fps: e.fps,
749
751
  durationInFrames: e.durationInFrames,
750
- background: l(e.background),
752
+ background: u(e.background),
751
753
  controls: e.controls,
752
754
  loop: e.loop,
753
755
  autoPlay: e.autoPlay,
@@ -755,49 +757,50 @@ function re(e, a) {
755
757
  }
756
758
  );
757
759
  }
758
- function _t(e) {
759
- const { width: a, height: t } = W(e.preset, e.width, e.height);
760
- return /* @__PURE__ */ s(
761
- Ae,
760
+ function Bt(e) {
761
+ const { width: a, height: t } = V(e.preset, e.width, e.height);
762
+ return /* @__PURE__ */ c(
763
+ Fe,
762
764
  {
763
765
  width: a,
764
766
  height: t,
765
- background: l(e.background),
767
+ background: u(e.background),
766
768
  transition: e.transition,
767
769
  transitionDuration: e.transitionDuration,
768
770
  showHUD: e.showHud,
769
771
  showNotes: e.showNotes,
770
- children: e.slides.map((r, i) => Dt(r, i))
772
+ children: e.slides.map((r, i) => Ut(r, i))
771
773
  }
772
774
  );
773
775
  }
774
- function Dt(e, a) {
776
+ function Ut(e, a) {
775
777
  var t;
776
- return /* @__PURE__ */ s(pe, { title: e.title, notes: e.notes, background: l(e.background), children: (t = e.children) == null ? void 0 : t.map((r, i) => x(r, i)) }, a);
778
+ return /* @__PURE__ */ c(Me, { title: e.title, notes: e.notes, background: u(e.background), children: (t = e.children) == null ? void 0 : t.map((r, i) => x(r, i)) }, a);
777
779
  }
778
780
  function x(e, a) {
781
+ var t, r, i, n;
779
782
  switch (e.type) {
780
783
  case "sequence":
781
- return /* @__PURE__ */ s(tt, { from: e.from, durationInFrames: e.durationInFrames, name: e.name, children: e.children.map((t, r) => x(t, r)) }, a);
784
+ return /* @__PURE__ */ c(st, { from: e.from, durationInFrames: e.durationInFrames, name: e.name, children: e.children.map((s, l) => x(s, l)) }, a);
782
785
  case "group":
783
- return /* @__PURE__ */ s(
784
- et,
786
+ return /* @__PURE__ */ c(
787
+ nt,
785
788
  {
786
789
  fadeIn: e.fadeIn,
787
790
  fadeOut: e.fadeOut,
788
- easing: f(e.easing),
791
+ easing: o(e.easing),
789
792
  rotation: e.rotation,
790
793
  rotationOrigin: e.rotationOrigin,
791
794
  scale: e.scale,
792
795
  translate: e.translate,
793
796
  zIndex: e.zIndex,
794
- children: e.children.map((t, r) => x(t, r))
797
+ children: e.children.map((s, l) => x(s, l))
795
798
  },
796
799
  a
797
800
  );
798
801
  case "bezierCurve":
799
- return /* @__PURE__ */ s(
800
- Ze,
802
+ return /* @__PURE__ */ c(
803
+ it,
801
804
  {
802
805
  x1: e.x1,
803
806
  y1: e.y1,
@@ -807,15 +810,15 @@ function x(e, a) {
807
810
  cy2: e.cy2,
808
811
  x2: e.x2,
809
812
  y2: e.y2,
810
- stroke: l(e.stroke),
813
+ stroke: u(e.stroke),
811
814
  strokeWidth: e.strokeWidth,
812
- fill: l(e.fill),
815
+ fill: u(e.fill),
813
816
  strokeDasharray: e.strokeDasharray,
814
817
  opacity: e.opacity,
815
818
  fadeIn: e.fadeIn,
816
819
  fadeOut: e.fadeOut,
817
820
  draw: e.draw,
818
- easing: f(e.easing),
821
+ easing: o(e.easing),
819
822
  rotation: e.rotation,
820
823
  rotationOrigin: e.rotationOrigin,
821
824
  scale: e.scale,
@@ -825,20 +828,20 @@ function x(e, a) {
825
828
  a
826
829
  );
827
830
  case "circle":
828
- return /* @__PURE__ */ s(
829
- Ye,
831
+ return /* @__PURE__ */ c(
832
+ rt,
830
833
  {
831
834
  cx: e.cx,
832
835
  cy: e.cy,
833
836
  r: e.r,
834
- fill: l(e.fill),
835
- stroke: l(e.stroke),
837
+ fill: u(e.fill),
838
+ stroke: u(e.stroke),
836
839
  strokeWidth: e.strokeWidth,
837
840
  opacity: e.opacity,
838
841
  fadeIn: e.fadeIn,
839
842
  fadeOut: e.fadeOut,
840
843
  draw: e.draw,
841
- easing: f(e.easing),
844
+ easing: o(e.easing),
842
845
  rotation: e.rotation,
843
846
  rotationOrigin: e.rotationOrigin,
844
847
  scale: e.scale,
@@ -848,21 +851,21 @@ function x(e, a) {
848
851
  a
849
852
  );
850
853
  case "line":
851
- return /* @__PURE__ */ s(
852
- Je,
854
+ return /* @__PURE__ */ c(
855
+ at,
853
856
  {
854
857
  x1: e.x1,
855
858
  y1: e.y1,
856
859
  x2: e.x2,
857
860
  y2: e.y2,
858
- stroke: l(e.stroke),
861
+ stroke: u(e.stroke),
859
862
  strokeWidth: e.strokeWidth,
860
863
  strokeDasharray: e.strokeDasharray,
861
864
  opacity: e.opacity,
862
865
  fadeIn: e.fadeIn,
863
866
  fadeOut: e.fadeOut,
864
867
  draw: e.draw,
865
- easing: f(e.easing),
868
+ easing: o(e.easing),
866
869
  rotation: e.rotation,
867
870
  rotationOrigin: e.rotationOrigin,
868
871
  scale: e.scale,
@@ -872,14 +875,14 @@ function x(e, a) {
872
875
  a
873
876
  );
874
877
  case "arrow":
875
- return /* @__PURE__ */ s(
876
- Xe,
878
+ return /* @__PURE__ */ c(
879
+ tt,
877
880
  {
878
881
  x1: e.x1,
879
882
  y1: e.y1,
880
883
  x2: e.x2,
881
884
  y2: e.y2,
882
- stroke: l(e.stroke),
885
+ stroke: u(e.stroke),
883
886
  strokeWidth: e.strokeWidth,
884
887
  headSize: e.headSize,
885
888
  strokeDasharray: e.strokeDasharray,
@@ -887,7 +890,7 @@ function x(e, a) {
887
890
  fadeIn: e.fadeIn,
888
891
  fadeOut: e.fadeOut,
889
892
  draw: e.draw,
890
- easing: f(e.easing),
893
+ easing: o(e.easing),
891
894
  rotation: e.rotation,
892
895
  rotationOrigin: e.rotationOrigin,
893
896
  scale: e.scale,
@@ -897,15 +900,15 @@ function x(e, a) {
897
900
  a
898
901
  );
899
902
  case "rect":
900
- return /* @__PURE__ */ s(
901
- Qe,
903
+ return /* @__PURE__ */ c(
904
+ et,
902
905
  {
903
906
  x: e.x,
904
907
  y: e.y,
905
908
  width: e.width,
906
909
  height: e.height,
907
- fill: l(e.fill),
908
- stroke: l(e.stroke),
910
+ fill: u(e.fill),
911
+ stroke: u(e.stroke),
909
912
  strokeWidth: e.strokeWidth,
910
913
  rx: e.rx,
911
914
  ry: e.ry,
@@ -914,7 +917,7 @@ function x(e, a) {
914
917
  fadeIn: e.fadeIn,
915
918
  fadeOut: e.fadeOut,
916
919
  draw: e.draw,
917
- easing: f(e.easing),
920
+ easing: o(e.easing),
918
921
  rotation: e.rotation,
919
922
  rotationOrigin: e.rotationOrigin,
920
923
  scale: e.scale,
@@ -924,19 +927,19 @@ function x(e, a) {
924
927
  a
925
928
  );
926
929
  case "polygon":
927
- return /* @__PURE__ */ s(
928
- Ke,
930
+ return /* @__PURE__ */ c(
931
+ Ze,
929
932
  {
930
933
  points: e.points,
931
- fill: l(e.fill),
932
- stroke: l(e.stroke),
934
+ fill: u(e.fill),
935
+ stroke: u(e.stroke),
933
936
  strokeWidth: e.strokeWidth,
934
937
  closed: e.closed,
935
938
  opacity: e.opacity,
936
939
  fadeIn: e.fadeIn,
937
940
  fadeOut: e.fadeOut,
938
941
  draw: e.draw,
939
- easing: f(e.easing),
942
+ easing: o(e.easing),
940
943
  rotation: e.rotation,
941
944
  rotationOrigin: e.rotationOrigin,
942
945
  scale: e.scale,
@@ -946,12 +949,12 @@ function x(e, a) {
946
949
  a
947
950
  );
948
951
  case "text":
949
- return /* @__PURE__ */ s(
950
- Ge,
952
+ return /* @__PURE__ */ c(
953
+ L,
951
954
  {
952
955
  x: e.x,
953
956
  y: e.y,
954
- fill: l(e.fill),
957
+ fill: u(e.fill),
955
958
  fontSize: e.fontSize,
956
959
  fontFamily: e.fontFamily,
957
960
  fontWeight: e.fontWeight,
@@ -960,7 +963,7 @@ function x(e, a) {
960
963
  opacity: e.opacity,
961
964
  fadeIn: e.fadeIn,
962
965
  fadeOut: e.fadeOut,
963
- easing: f(e.easing),
966
+ easing: o(e.easing),
964
967
  rotation: e.rotation,
965
968
  rotationOrigin: e.rotationOrigin,
966
969
  scale: e.scale,
@@ -971,8 +974,8 @@ function x(e, a) {
971
974
  a
972
975
  );
973
976
  case "image":
974
- return /* @__PURE__ */ s(
975
- He,
977
+ return /* @__PURE__ */ c(
978
+ Ye,
976
979
  {
977
980
  src: e.src,
978
981
  x: e.x,
@@ -985,7 +988,7 @@ function x(e, a) {
985
988
  opacity: e.opacity,
986
989
  fadeIn: e.fadeIn,
987
990
  fadeOut: e.fadeOut,
988
- easing: f(e.easing),
991
+ easing: o(e.easing),
989
992
  rotation: e.rotation,
990
993
  rotationOrigin: e.rotationOrigin,
991
994
  scale: e.scale,
@@ -995,8 +998,8 @@ function x(e, a) {
995
998
  a
996
999
  );
997
1000
  case "axes":
998
- return /* @__PURE__ */ s(
999
- Ue,
1001
+ return /* @__PURE__ */ c(
1002
+ Je,
1000
1003
  {
1001
1004
  domain: e.domain,
1002
1005
  range: e.range,
@@ -1006,14 +1009,14 @@ function x(e, a) {
1006
1009
  showTicks: e.showTicks,
1007
1010
  showLabels: e.showLabels,
1008
1011
  tickStep: e.tickStep,
1009
- axisColor: l(e.axisColor),
1010
- gridColor: l(e.gridColor),
1011
- labelColor: l(e.labelColor),
1012
+ axisColor: u(e.axisColor),
1013
+ gridColor: u(e.gridColor),
1014
+ labelColor: u(e.labelColor),
1012
1015
  labelFontSize: e.labelFontSize,
1013
1016
  fadeIn: e.fadeIn,
1014
1017
  fadeOut: e.fadeOut,
1015
1018
  draw: e.draw,
1016
- easing: f(e.easing),
1019
+ easing: o(e.easing),
1017
1020
  rotation: e.rotation,
1018
1021
  rotationOrigin: e.rotationOrigin,
1019
1022
  translate: e.translate,
@@ -1022,20 +1025,36 @@ function x(e, a) {
1022
1025
  a
1023
1026
  );
1024
1027
  case "functionPlot": {
1025
- const t = st(e.fn);
1026
- return /* @__PURE__ */ s(
1027
- Be,
1028
+ let s;
1029
+ try {
1030
+ s = ot(e.fn);
1031
+ } catch {
1032
+ return /* @__PURE__ */ c(
1033
+ L,
1034
+ {
1035
+ x: ((t = e.origin) == null ? void 0 : t[0]) ?? 400,
1036
+ y: (((r = e.origin) == null ? void 0 : r[1]) ?? 300) - 20,
1037
+ fontSize: 14,
1038
+ fill: "red",
1039
+ opacity: 0.8,
1040
+ children: `⚠ f(x) = ${e.fn}`
1041
+ },
1042
+ a
1043
+ );
1044
+ }
1045
+ return /* @__PURE__ */ c(
1046
+ Xe,
1028
1047
  {
1029
- fn: (r) => t({ x: r }),
1048
+ fn: (l) => s({ x: l }),
1030
1049
  domain: e.domain,
1031
1050
  yClamp: e.yClamp,
1032
1051
  origin: e.origin,
1033
1052
  scale: e.scale,
1034
- color: l(e.color),
1053
+ color: u(e.color),
1035
1054
  strokeWidth: e.strokeWidth,
1036
1055
  samples: e.samples,
1037
1056
  draw: e.draw,
1038
- easing: f(e.easing),
1057
+ easing: o(e.easing),
1039
1058
  opacity: e.opacity,
1040
1059
  rotation: e.rotation,
1041
1060
  rotationOrigin: e.rotationOrigin,
@@ -1046,24 +1065,24 @@ function x(e, a) {
1046
1065
  );
1047
1066
  }
1048
1067
  case "vector":
1049
- return /* @__PURE__ */ s(
1050
- qe,
1068
+ return /* @__PURE__ */ c(
1069
+ Qe,
1051
1070
  {
1052
1071
  from: e.from,
1053
1072
  to: e.to,
1054
1073
  origin: e.origin,
1055
1074
  scale: e.scale,
1056
- color: l(e.color),
1075
+ color: u(e.color),
1057
1076
  strokeWidth: e.strokeWidth,
1058
1077
  headSize: e.headSize,
1059
1078
  label: e.label,
1060
1079
  labelOffset: e.labelOffset,
1061
- labelColor: l(e.labelColor),
1080
+ labelColor: u(e.labelColor),
1062
1081
  labelFontSize: e.labelFontSize,
1063
1082
  fadeIn: e.fadeIn,
1064
1083
  fadeOut: e.fadeOut,
1065
1084
  draw: e.draw,
1066
- easing: f(e.easing),
1085
+ easing: o(e.easing),
1067
1086
  rotation: e.rotation,
1068
1087
  rotationOrigin: e.rotationOrigin,
1069
1088
  translate: e.translate,
@@ -1072,25 +1091,41 @@ function x(e, a) {
1072
1091
  a
1073
1092
  );
1074
1093
  case "vectorField": {
1075
- const t = ct(e.fn);
1076
- return /* @__PURE__ */ s(
1077
- je,
1094
+ let s;
1095
+ try {
1096
+ s = gt(e.fn);
1097
+ } catch {
1098
+ return /* @__PURE__ */ c(
1099
+ L,
1100
+ {
1101
+ x: ((i = e.origin) == null ? void 0 : i[0]) ?? 400,
1102
+ y: (((n = e.origin) == null ? void 0 : n[1]) ?? 300) - 20,
1103
+ fontSize: 14,
1104
+ fill: "red",
1105
+ opacity: 0.8,
1106
+ children: `⚠ field = ${e.fn}`
1107
+ },
1108
+ a
1109
+ );
1110
+ }
1111
+ return /* @__PURE__ */ c(
1112
+ Ke,
1078
1113
  {
1079
- fn: (r, i) => t({ x: r, y: i }),
1114
+ fn: (l, $) => s({ x: l, y: $ }),
1080
1115
  domain: e.domain,
1081
1116
  range: e.range,
1082
1117
  step: e.step,
1083
1118
  origin: e.origin,
1084
1119
  scale: e.scale,
1085
1120
  arrowScale: e.arrowScale,
1086
- color: l(e.color),
1121
+ color: u(e.color),
1087
1122
  strokeWidth: e.strokeWidth,
1088
1123
  headSize: e.headSize,
1089
1124
  normalize: e.normalize,
1090
1125
  maxLength: e.maxLength,
1091
1126
  fadeIn: e.fadeIn,
1092
1127
  fadeOut: e.fadeOut,
1093
- easing: f(e.easing),
1128
+ easing: o(e.easing),
1094
1129
  rotation: e.rotation,
1095
1130
  rotationOrigin: e.rotationOrigin,
1096
1131
  translate: e.translate,
@@ -1100,19 +1135,19 @@ function x(e, a) {
1100
1135
  );
1101
1136
  }
1102
1137
  case "matrix":
1103
- return /* @__PURE__ */ s(
1104
- Le,
1138
+ return /* @__PURE__ */ c(
1139
+ Ge,
1105
1140
  {
1106
1141
  values: e.values,
1107
1142
  x: e.x,
1108
1143
  y: e.y,
1109
1144
  cellSize: e.cellSize,
1110
- color: l(e.color),
1111
- bracketColor: l(e.bracketColor),
1145
+ color: u(e.color),
1146
+ bracketColor: u(e.bracketColor),
1112
1147
  fontSize: e.fontSize,
1113
1148
  fadeIn: e.fadeIn,
1114
1149
  fadeOut: e.fadeOut,
1115
- easing: f(e.easing),
1150
+ easing: o(e.easing),
1116
1151
  rotation: e.rotation,
1117
1152
  rotationOrigin: e.rotationOrigin,
1118
1153
  scale: e.scale,
@@ -1122,20 +1157,20 @@ function x(e, a) {
1122
1157
  a
1123
1158
  );
1124
1159
  case "graph":
1125
- return /* @__PURE__ */ s(
1126
- Ve,
1160
+ return /* @__PURE__ */ c(
1161
+ He,
1127
1162
  {
1128
1163
  nodes: e.nodes,
1129
1164
  edges: e.edges,
1130
- nodeColor: l(e.nodeColor),
1165
+ nodeColor: u(e.nodeColor),
1131
1166
  nodeRadius: e.nodeRadius,
1132
- edgeColor: l(e.edgeColor),
1167
+ edgeColor: u(e.edgeColor),
1133
1168
  edgeWidth: e.edgeWidth,
1134
- labelColor: l(e.labelColor),
1169
+ labelColor: u(e.labelColor),
1135
1170
  labelFontSize: e.labelFontSize,
1136
1171
  fadeIn: e.fadeIn,
1137
1172
  fadeOut: e.fadeOut,
1138
- easing: f(e.easing),
1173
+ easing: o(e.easing),
1139
1174
  rotation: e.rotation,
1140
1175
  rotationOrigin: e.rotationOrigin,
1141
1176
  scale: e.scale,
@@ -1145,18 +1180,18 @@ function x(e, a) {
1145
1180
  a
1146
1181
  );
1147
1182
  case "latex":
1148
- return /* @__PURE__ */ s(
1149
- De,
1183
+ return /* @__PURE__ */ c(
1184
+ Ue,
1150
1185
  {
1151
1186
  expression: e.expression,
1152
1187
  x: e.x,
1153
1188
  y: e.y,
1154
- color: l(e.color),
1189
+ color: u(e.color),
1155
1190
  fontSize: e.fontSize,
1156
1191
  align: e.align,
1157
1192
  fadeIn: e.fadeIn,
1158
1193
  fadeOut: e.fadeOut,
1159
- easing: f(e.easing),
1194
+ easing: o(e.easing),
1160
1195
  rotation: e.rotation,
1161
1196
  rotationOrigin: e.rotationOrigin,
1162
1197
  scale: e.scale,
@@ -1166,16 +1201,16 @@ function x(e, a) {
1166
1201
  a
1167
1202
  );
1168
1203
  case "barChart":
1169
- return /* @__PURE__ */ s(
1170
- _e,
1204
+ return /* @__PURE__ */ c(
1205
+ Be,
1171
1206
  {
1172
1207
  bars: e.bars,
1173
1208
  x: e.x,
1174
1209
  y: e.y,
1175
1210
  width: e.width,
1176
1211
  height: e.height,
1177
- barColor: l(e.barColor),
1178
- labelColor: l(e.labelColor),
1212
+ barColor: u(e.barColor),
1213
+ labelColor: u(e.labelColor),
1179
1214
  labelFontSize: e.labelFontSize,
1180
1215
  showValues: e.showValues,
1181
1216
  maxValue: e.maxValue,
@@ -1183,7 +1218,7 @@ function x(e, a) {
1183
1218
  valueFormat: e.valueFormat,
1184
1219
  fadeIn: e.fadeIn,
1185
1220
  fadeOut: e.fadeOut,
1186
- easing: f(e.easing),
1221
+ easing: o(e.easing),
1187
1222
  rotation: e.rotation,
1188
1223
  rotationOrigin: e.rotationOrigin,
1189
1224
  scale: e.scale,
@@ -1193,139 +1228,206 @@ function x(e, a) {
1193
1228
  a
1194
1229
  );
1195
1230
  case "fadeIn":
1196
- return /* @__PURE__ */ s(We, { duration: e.duration, easing: f(e.easing), children: e.children.map((t, r) => x(t, r)) }, a);
1231
+ return /* @__PURE__ */ c(qe, { duration: e.duration, easing: o(e.easing), children: e.children.map((s, l) => x(s, l)) }, a);
1197
1232
  case "fadeOut":
1198
- return /* @__PURE__ */ s(Me, { duration: e.duration, totalFrames: e.totalFrames, easing: f(e.easing), children: e.children.map((t, r) => x(t, r)) }, a);
1233
+ return /* @__PURE__ */ c(je, { duration: e.duration, totalFrames: e.totalFrames, easing: o(e.easing), children: e.children.map((s, l) => x(s, l)) }, a);
1199
1234
  case "draw":
1200
- return /* @__PURE__ */ s(Te, { duration: e.duration, pathLength: e.pathLength, easing: f(e.easing), children: x(e.children[0], 0) }, a);
1235
+ return /* @__PURE__ */ c(Le, { duration: e.duration, pathLength: e.pathLength, easing: o(e.easing), children: x(e.children[0], 0) }, a);
1201
1236
  case "write":
1202
- return /* @__PURE__ */ s(Ne, { duration: e.duration, easing: f(e.easing), children: e.children.map((t, r) => x(t, r)) }, a);
1237
+ return /* @__PURE__ */ c(Ve, { duration: e.duration, easing: o(e.easing), children: e.children.map((s, l) => x(s, l)) }, a);
1203
1238
  case "transform":
1204
- return /* @__PURE__ */ s(
1205
- Re,
1239
+ return /* @__PURE__ */ c(
1240
+ We,
1206
1241
  {
1207
1242
  duration: e.duration,
1208
- easing: f(e.easing),
1243
+ easing: o(e.easing),
1209
1244
  translate: e.translate,
1210
1245
  scale: e.scale,
1211
1246
  rotate: e.rotate,
1212
1247
  opacity: e.opacity,
1213
- children: e.children.map((t, r) => x(t, r))
1248
+ children: e.children.map((s, l) => x(s, l))
1214
1249
  },
1215
1250
  a
1216
1251
  );
1217
1252
  case "morph":
1218
- return /* @__PURE__ */ s(
1219
- Pe,
1253
+ return /* @__PURE__ */ c(
1254
+ De,
1220
1255
  {
1221
1256
  duration: e.duration,
1222
- easing: f(e.easing),
1223
- fromColor: l(e.fromColor),
1224
- toColor: l(e.toColor),
1257
+ easing: o(e.easing),
1258
+ fromColor: u(e.fromColor),
1259
+ toColor: u(e.toColor),
1225
1260
  fromOpacity: e.fromOpacity,
1226
1261
  toOpacity: e.toOpacity,
1227
1262
  fromScale: e.fromScale,
1228
1263
  toScale: e.toScale,
1229
- children: e.children.map((t, r) => x(t, r))
1264
+ children: e.children.map((s, l) => x(s, l))
1230
1265
  },
1231
1266
  a
1232
1267
  );
1233
1268
  case "stagger":
1234
- return /* @__PURE__ */ s(Fe, { staggerDelay: e.staggerDelay, easing: f(e.easing), children: e.children.map((t, r) => x(t, r)) }, a);
1269
+ return /* @__PURE__ */ c(_e, { staggerDelay: e.staggerDelay, easing: o(e.easing), children: e.children.map((s, l) => x(s, l)) }, a);
1235
1270
  case "parallel":
1236
- return /* @__PURE__ */ s(Ee, { children: e.children.map((t, r) => x(t, r)) }, a);
1271
+ return /* @__PURE__ */ c(Ne, { children: e.children.map((s, l) => x(s, l)) }, a);
1237
1272
  case "scene":
1238
- return /* @__PURE__ */ s(U.Fragment, { children: j(e) }, a);
1273
+ return /* @__PURE__ */ c(Q.Fragment, { children: H(e) }, a);
1239
1274
  case "player":
1240
- return /* @__PURE__ */ s(U.Fragment, { children: re(e) }, a);
1275
+ return /* @__PURE__ */ c(Q.Fragment, { children: ce(e) }, a);
1241
1276
  default:
1242
1277
  return null;
1243
1278
  }
1244
1279
  }
1245
- function Vt(e) {
1280
+ const le = {
1281
+ background: "#0a0a1e",
1282
+ title: "#e0e7ff",
1283
+ subtitle: "#94a3b8",
1284
+ primary: "#4fc3f7",
1285
+ secondary: "#a78bfa",
1286
+ tertiary: "#f472b6",
1287
+ muted: "#64748b",
1288
+ text: "#c8d6e5",
1289
+ boxFill: "rgba(79,195,247,0.12)",
1290
+ boxStroke: "#4fc3f7",
1291
+ success: "#34d399",
1292
+ warning: "#fbbf24",
1293
+ error: "#f87171",
1294
+ palette: ["#4fc3f7", "#a78bfa", "#f472b6", "#34d399", "#fbbf24", "#fb923c", "#6366f1", "#22d3ee"]
1295
+ }, Ht = {
1296
+ background: "#f8fafc",
1297
+ title: "#1e293b",
1298
+ subtitle: "#64748b",
1299
+ primary: "#2563eb",
1300
+ secondary: "#7c3aed",
1301
+ tertiary: "#db2777",
1302
+ muted: "#94a3b8",
1303
+ text: "#334155",
1304
+ boxFill: "rgba(37,99,235,0.08)",
1305
+ boxStroke: "#2563eb",
1306
+ success: "#16a34a",
1307
+ warning: "#d97706",
1308
+ error: "#dc2626",
1309
+ palette: ["#2563eb", "#7c3aed", "#db2777", "#16a34a", "#d97706", "#ea580c", "#4f46e5", "#0891b2"]
1310
+ };
1311
+ function Gt(e) {
1246
1312
  if (!e) return {};
1247
1313
  const a = {};
1248
1314
  for (const [t, r] of Object.entries(e))
1249
1315
  r !== void 0 && (a[`--elucim-${t}`] = r);
1250
1316
  return a;
1251
1317
  }
1252
- const Xt = at(function({ dsl: a, className: t, style: r, theme: i, poster: n, onError: h }, m) {
1253
- const d = rt(null);
1254
- it(m, () => ({
1318
+ function ue(e) {
1319
+ return {
1320
+ "--elucim-foreground": e.text,
1321
+ "--elucim-background": e.background,
1322
+ "--elucim-title": e.title,
1323
+ "--elucim-subtitle": e.subtitle,
1324
+ "--elucim-accent": e.primary,
1325
+ "--elucim-muted": e.muted,
1326
+ "--elucim-surface": e.background,
1327
+ "--elucim-primary": e.primary,
1328
+ "--elucim-secondary": e.secondary,
1329
+ "--elucim-tertiary": e.tertiary,
1330
+ "--elucim-success": e.success,
1331
+ "--elucim-warning": e.warning,
1332
+ "--elucim-error": e.error
1333
+ };
1334
+ }
1335
+ const Kt = ue(le), Qt = ue(Ht);
1336
+ function Xt(e) {
1337
+ if (typeof window > "u" || typeof window.matchMedia != "function") return () => {
1338
+ };
1339
+ const a = window.matchMedia("(prefers-color-scheme: dark)");
1340
+ return a.addEventListener("change", e), () => a.removeEventListener("change", e);
1341
+ }
1342
+ function Jt() {
1343
+ return typeof window > "u" || typeof window.matchMedia != "function" ? !0 : window.matchMedia("(prefers-color-scheme: dark)").matches;
1344
+ }
1345
+ function Yt() {
1346
+ return !0;
1347
+ }
1348
+ function Zt() {
1349
+ return ht(Xt, Jt, Yt);
1350
+ }
1351
+ const la = ct(function({ dsl: a, className: t, style: r, theme: i, colorScheme: n, poster: s, onError: l }, $) {
1352
+ const d = lt(null), E = Zt();
1353
+ ut($, () => ({
1255
1354
  getSvgElement: () => {
1256
- var c;
1257
- return ((c = d.current) == null ? void 0 : c.getSvgElement()) ?? null;
1355
+ var f;
1356
+ return ((f = d.current) == null ? void 0 : f.getSvgElement()) ?? null;
1258
1357
  },
1259
- seekToFrame: (c) => {
1260
- var g;
1261
- return (g = d.current) == null ? void 0 : g.seekToFrame(c);
1358
+ seekToFrame: (f) => {
1359
+ var I;
1360
+ return (I = d.current) == null ? void 0 : I.seekToFrame(f);
1262
1361
  },
1263
1362
  getTotalFrames: () => {
1264
- var c;
1265
- return ((c = d.current) == null ? void 0 : c.getTotalFrames()) ?? 0;
1363
+ var f;
1364
+ return ((f = d.current) == null ? void 0 : f.getTotalFrames()) ?? 0;
1266
1365
  },
1267
1366
  play: () => {
1268
- var c;
1269
- return (c = d.current) == null ? void 0 : c.play();
1367
+ var f;
1368
+ return (f = d.current) == null ? void 0 : f.play();
1270
1369
  },
1271
1370
  pause: () => {
1272
- var c;
1273
- return (c = d.current) == null ? void 0 : c.pause();
1371
+ var f;
1372
+ return (f = d.current) == null ? void 0 : f.pause();
1274
1373
  },
1275
1374
  isPlaying: () => {
1276
- var c;
1277
- return ((c = d.current) == null ? void 0 : c.isPlaying()) ?? !1;
1375
+ var f;
1376
+ return ((f = d.current) == null ? void 0 : f.isPlaying()) ?? !1;
1278
1377
  }
1279
1378
  }));
1280
- const A = J(a);
1281
- if (!A.valid) {
1282
- const c = A.errors.filter((o) => o.severity === "error").map((o) => ({ path: o.path, message: o.message }));
1283
- h == null || h(c);
1284
- const g = /* @__PURE__ */ new Map();
1285
- for (const o of c) {
1286
- const w = o.path.split("."), S = w.length > 1 ? w.slice(0, -1).join(".") : o.path, C = g.get(S) ?? [];
1287
- C.push(o), g.set(S, C);
1379
+ const w = te(a);
1380
+ if (!w.valid) {
1381
+ const f = w.errors.filter((y) => y.severity === "error").map((y) => ({ path: y.path, message: y.message }));
1382
+ l == null || l(f);
1383
+ const I = /* @__PURE__ */ new Map();
1384
+ for (const y of f) {
1385
+ const T = y.path.split("."), M = T.length > 1 ? T.slice(0, -1).join(".") : y.path, _ = I.get(M) ?? [];
1386
+ _.push(y), I.set(M, _);
1288
1387
  }
1289
- return /* @__PURE__ */ F(
1388
+ return /* @__PURE__ */ R(
1290
1389
  "div",
1291
1390
  {
1292
1391
  className: t,
1293
1392
  style: { color: "#ff6b6b", fontFamily: "monospace", padding: 16, fontSize: 13, ...r },
1294
1393
  "data-testid": "dsl-error",
1295
1394
  children: [
1296
- /* @__PURE__ */ F("strong", { children: [
1395
+ /* @__PURE__ */ R("strong", { children: [
1297
1396
  "Elucim DSL Validation Errors (",
1298
- c.length,
1397
+ f.length,
1299
1398
  "):"
1300
1399
  ] }),
1301
- [...g.entries()].map(([o, w]) => /* @__PURE__ */ F("details", { open: !0, style: { marginTop: 8 }, children: [
1302
- /* @__PURE__ */ F("summary", { style: { cursor: "pointer", fontWeight: "bold" }, children: [
1303
- o,
1400
+ [...I.entries()].map(([y, T]) => /* @__PURE__ */ R("details", { open: !0, style: { marginTop: 8 }, children: [
1401
+ /* @__PURE__ */ R("summary", { style: { cursor: "pointer", fontWeight: "bold" }, children: [
1402
+ y,
1304
1403
  " (",
1305
- w.length,
1404
+ T.length,
1306
1405
  ")"
1307
1406
  ] }),
1308
- /* @__PURE__ */ s("ul", { style: { margin: "4px 0", paddingLeft: 20 }, children: w.map((S, C) => /* @__PURE__ */ F("li", { children: [
1309
- /* @__PURE__ */ s("code", { style: { color: "#ffa07a" }, children: S.path }),
1407
+ /* @__PURE__ */ c("ul", { style: { margin: "4px 0", paddingLeft: 20 }, children: T.map((M, _) => /* @__PURE__ */ R("li", { children: [
1408
+ /* @__PURE__ */ c("code", { style: { color: "#ffa07a" }, children: M.path }),
1310
1409
  ": ",
1311
- S.message
1312
- ] }, C)) })
1313
- ] }, o)),
1314
- /* @__PURE__ */ F("details", { style: { marginTop: 12 }, children: [
1315
- /* @__PURE__ */ s("summary", { style: { cursor: "pointer", opacity: 0.7 }, children: "Raw JSON" }),
1316
- /* @__PURE__ */ s("pre", { style: { fontSize: 11, maxHeight: 300, overflow: "auto", marginTop: 4, padding: 8, background: "rgba(0,0,0,0.3)", borderRadius: 4 }, children: JSON.stringify(a, null, 2) })
1410
+ M.message
1411
+ ] }, _)) })
1412
+ ] }, y)),
1413
+ /* @__PURE__ */ R("details", { style: { marginTop: 12 }, children: [
1414
+ /* @__PURE__ */ c("summary", { style: { cursor: "pointer", opacity: 0.7 }, children: "Raw JSON" }),
1415
+ /* @__PURE__ */ c("pre", { style: { fontSize: 11, maxHeight: 300, overflow: "auto", marginTop: 4, padding: 8, background: "rgba(0,0,0,0.3)", borderRadius: 4 }, children: JSON.stringify(a, null, 2) })
1317
1416
  ] })
1318
1417
  ]
1319
1418
  }
1320
1419
  );
1321
1420
  }
1322
- const E = Vt(i), b = n !== void 0 ? Lt(n, a) : void 0;
1323
- return /* @__PURE__ */ s("div", { className: t, style: { ...E, ...r }, "data-testid": "dsl-root", children: ae(a.root, {
1324
- frame: b == null ? void 0 : b.frame,
1421
+ const m = Gt(i);
1422
+ let b = {};
1423
+ n && (b = (n === "auto" ? E : n === "dark") ? Kt : Qt);
1424
+ const O = s !== void 0 ? ea(s, a) : void 0;
1425
+ return /* @__PURE__ */ c("div", { className: t, style: { ...b, ...m, ...r }, "data-testid": "dsl-root", children: se(a.root, {
1426
+ frame: O == null ? void 0 : O.frame,
1325
1427
  playerRef: d
1326
1428
  }) });
1327
1429
  });
1328
- function Lt(e, a) {
1430
+ function ea(e, a) {
1329
1431
  if (e === "first") return { frame: 0 };
1330
1432
  if (e === "last") {
1331
1433
  const r = a.root.durationInFrames ?? 1;
@@ -1333,22 +1435,22 @@ function Lt(e, a) {
1333
1435
  }
1334
1436
  return { frame: e };
1335
1437
  }
1336
- function Jt(e, a, t) {
1337
- const r = J(e);
1438
+ function ua(e, a, t) {
1439
+ const r = te(e);
1338
1440
  if (!r.valid) {
1339
- const h = r.errors.filter((m) => m.severity === "error");
1441
+ const s = r.errors.filter((l) => l.severity === "error");
1340
1442
  throw new Error(
1341
1443
  `DSL validation failed:
1342
- ${h.map((m) => ` ${m.path}: ${m.message}`).join(`
1444
+ ${s.map((l) => ` ${l.path}: ${l.message}`).join(`
1343
1445
  `)}`
1344
1446
  );
1345
1447
  }
1346
1448
  const i = { ...e.root };
1347
1449
  t != null && t.width && (i.width = t.width), t != null && t.height && (i.height = t.height);
1348
- const n = ae(i, { frame: a });
1349
- return nt(n);
1450
+ const n = se(i, { frame: a });
1451
+ return ft(n);
1350
1452
  }
1351
- class jt {
1453
+ class ta {
1352
1454
  constructor(a, t = 30, r = 900, i = 640) {
1353
1455
  this.elements = [], this.cursor = 0, this.theme = a, this._fps = t, this._width = r, this._height = i;
1354
1456
  }
@@ -1451,7 +1553,7 @@ class jt {
1451
1553
  }
1452
1554
  /** Add an arrow */
1453
1555
  arrow(a, t, r, i, n) {
1454
- const h = (n == null ? void 0 : n.fadeIn) ?? 12, m = {
1556
+ const s = (n == null ? void 0 : n.fadeIn) ?? 12, l = {
1455
1557
  type: "arrow",
1456
1558
  x1: a,
1457
1559
  y1: t,
@@ -1461,13 +1563,13 @@ class jt {
1461
1563
  strokeWidth: (n == null ? void 0 : n.strokeWidth) ?? 2,
1462
1564
  headSize: (n == null ? void 0 : n.headSize) ?? 8,
1463
1565
  strokeDasharray: n != null && n.dashed ? "6 3" : void 0,
1464
- fadeIn: h
1566
+ fadeIn: s
1465
1567
  };
1466
- return this.addAtCursor(m, (n == null ? void 0 : n.advance) ?? 3);
1568
+ return this.addAtCursor(l, (n == null ? void 0 : n.advance) ?? 3);
1467
1569
  }
1468
1570
  /** Add a line */
1469
1571
  line(a, t, r, i, n) {
1470
- const h = (n == null ? void 0 : n.fadeIn) ?? 12;
1572
+ const s = (n == null ? void 0 : n.fadeIn) ?? 12;
1471
1573
  return this.addAtCursor({
1472
1574
  type: "line",
1473
1575
  x1: a,
@@ -1477,12 +1579,12 @@ class jt {
1477
1579
  stroke: (n == null ? void 0 : n.color) ?? this.theme.muted,
1478
1580
  strokeWidth: (n == null ? void 0 : n.strokeWidth) ?? 1,
1479
1581
  strokeDasharray: n != null && n.dashed ? "6 3" : void 0,
1480
- fadeIn: h
1582
+ fadeIn: s
1481
1583
  }, (n == null ? void 0 : n.advance) ?? 3);
1482
1584
  }
1483
1585
  /** Add a rectangle */
1484
1586
  rect(a, t, r, i, n) {
1485
- const h = (n == null ? void 0 : n.fadeIn) ?? 12;
1587
+ const s = (n == null ? void 0 : n.fadeIn) ?? 12;
1486
1588
  return this.addAtCursor({
1487
1589
  type: "rect",
1488
1590
  x: a,
@@ -1494,7 +1596,7 @@ class jt {
1494
1596
  strokeWidth: (n == null ? void 0 : n.strokeWidth) ?? 1.5,
1495
1597
  rx: (n == null ? void 0 : n.rx) ?? 6,
1496
1598
  strokeDasharray: n != null && n.dashed ? "6 3" : void 0,
1497
- fadeIn: h
1599
+ fadeIn: s
1498
1600
  }, (n == null ? void 0 : n.advance) ?? 5);
1499
1601
  }
1500
1602
  /** Add a circle */
@@ -1567,33 +1669,33 @@ class jt {
1567
1669
  * Returns the box positions for follow-up arrows, etc.
1568
1670
  */
1569
1671
  boxRow(a, t) {
1570
- const r = (t == null ? void 0 : t.boxWidth) ?? 80, i = (t == null ? void 0 : t.boxHeight) ?? 40, n = (t == null ? void 0 : t.gap) ?? 12, h = (t == null ? void 0 : t.y) ?? 250, m = a.length * r + (a.length - 1) * n, d = (this._width - m) / 2;
1672
+ const r = (t == null ? void 0 : t.boxWidth) ?? 80, i = (t == null ? void 0 : t.boxHeight) ?? 40, n = (t == null ? void 0 : t.gap) ?? 12, s = (t == null ? void 0 : t.y) ?? 250, l = a.length * r + (a.length - 1) * n, $ = (this._width - l) / 2;
1571
1673
  t == null || t.fadeIn;
1572
- const A = a.map((b, c) => {
1573
- const g = d + c * (r + n);
1574
- return { x: g, y: h, w: r, h: i, cx: g + r / 2, cy: h + i / 2 };
1575
- }), E = a.map((b, c) => {
1576
- var S, C;
1577
- const g = A[c], o = ((S = t == null ? void 0 : t.colors) == null ? void 0 : S[c]) ?? this.theme.boxFill, w = ((C = t == null ? void 0 : t.strokeColors) == null ? void 0 : C[c]) ?? this.theme.boxStroke;
1674
+ const d = a.map((w, m) => {
1675
+ const b = $ + m * (r + n);
1676
+ return { x: b, y: s, w: r, h: i, cx: b + r / 2, cy: s + i / 2 };
1677
+ }), E = a.map((w, m) => {
1678
+ var I, y;
1679
+ const b = d[m], O = ((I = t == null ? void 0 : t.colors) == null ? void 0 : I[m]) ?? this.theme.boxFill, f = ((y = t == null ? void 0 : t.strokeColors) == null ? void 0 : y[m]) ?? this.theme.boxStroke;
1578
1680
  return {
1579
1681
  type: "group",
1580
1682
  children: [
1581
1683
  {
1582
1684
  type: "rect",
1583
- x: g.x,
1584
- y: g.y,
1685
+ x: b.x,
1686
+ y: b.y,
1585
1687
  width: r,
1586
1688
  height: i,
1587
- fill: o,
1588
- stroke: w,
1689
+ fill: O,
1690
+ stroke: f,
1589
1691
  strokeWidth: 1.5,
1590
1692
  rx: 6
1591
1693
  },
1592
1694
  {
1593
1695
  type: "text",
1594
- x: g.cx,
1595
- y: g.cy + 5,
1596
- content: b,
1696
+ x: b.cx,
1697
+ y: b.cy + 5,
1698
+ content: w,
1597
1699
  fontSize: (t == null ? void 0 : t.fontSize) ?? 13,
1598
1700
  fill: (t == null ? void 0 : t.textColor) ?? this.theme.text,
1599
1701
  textAnchor: "middle",
@@ -1606,38 +1708,38 @@ class jt {
1606
1708
  type: "stagger",
1607
1709
  staggerDelay: 3,
1608
1710
  children: E
1609
- }, 8 + a.length * 2), A;
1711
+ }, 8 + a.length * 2), d;
1610
1712
  }
1611
1713
  /**
1612
1714
  * Render a vertical stack of labeled boxes.
1613
1715
  */
1614
1716
  boxColumn(a, t) {
1615
- const r = (t == null ? void 0 : t.boxWidth) ?? 160, i = (t == null ? void 0 : t.boxHeight) ?? 36, n = (t == null ? void 0 : t.gap) ?? 8, h = (t == null ? void 0 : t.y) ?? 150, m = (t == null ? void 0 : t.x) ?? this.cx;
1717
+ const r = (t == null ? void 0 : t.boxWidth) ?? 160, i = (t == null ? void 0 : t.boxHeight) ?? 36, n = (t == null ? void 0 : t.gap) ?? 8, s = (t == null ? void 0 : t.y) ?? 150, l = (t == null ? void 0 : t.x) ?? this.cx;
1616
1718
  t == null || t.fadeIn;
1617
- const d = a.map((E, b) => {
1618
- const c = h + b * (i + n);
1619
- return { x: m - r / 2, y: c, w: r, h: i, cx: m, cy: c + i / 2 };
1620
- }), A = a.map((E, b) => {
1621
- var o, w;
1622
- const c = d[b], g = ((o = t == null ? void 0 : t.colors) == null ? void 0 : o[b]) ?? this.theme.boxFill;
1719
+ const $ = a.map((E, w) => {
1720
+ const m = s + w * (i + n);
1721
+ return { x: l - r / 2, y: m, w: r, h: i, cx: l, cy: m + i / 2 };
1722
+ }), d = a.map((E, w) => {
1723
+ var O, f;
1724
+ const m = $[w], b = ((O = t == null ? void 0 : t.colors) == null ? void 0 : O[w]) ?? this.theme.boxFill;
1623
1725
  return {
1624
1726
  type: "group",
1625
1727
  children: [
1626
1728
  {
1627
1729
  type: "rect",
1628
- x: c.x,
1629
- y: c.y,
1730
+ x: m.x,
1731
+ y: m.y,
1630
1732
  width: r,
1631
1733
  height: i,
1632
- fill: g,
1633
- stroke: (w = t == null ? void 0 : t.colors) != null && w[b] ? t.colors[b] : this.theme.boxStroke,
1734
+ fill: b,
1735
+ stroke: (f = t == null ? void 0 : t.colors) != null && f[w] ? t.colors[w] : this.theme.boxStroke,
1634
1736
  strokeWidth: 1.5,
1635
1737
  rx: 6
1636
1738
  },
1637
1739
  {
1638
1740
  type: "text",
1639
- x: c.cx,
1640
- y: c.cy + 5,
1741
+ x: m.cx,
1742
+ y: m.cy + 5,
1641
1743
  content: E,
1642
1744
  fontSize: (t == null ? void 0 : t.fontSize) ?? 13,
1643
1745
  fill: (t == null ? void 0 : t.textColor) ?? this.theme.text,
@@ -1649,8 +1751,8 @@ class jt {
1649
1751
  return this.addAtCursor({
1650
1752
  type: "stagger",
1651
1753
  staggerDelay: 3,
1652
- children: A
1653
- }, 8 + a.length * 2), d;
1754
+ children: d
1755
+ }, 8 + a.length * 2), $;
1654
1756
  }
1655
1757
  /**
1656
1758
  * Draw arrows connecting sequential positions (e.g., output of boxRow/boxColumn).
@@ -1658,13 +1760,13 @@ class jt {
1658
1760
  connectDown(a, t) {
1659
1761
  const r = [];
1660
1762
  for (let i = 0; i < a.length - 1; i++) {
1661
- const n = a[i], h = a[i + 1];
1763
+ const n = a[i], s = a[i + 1];
1662
1764
  r.push({
1663
1765
  type: "arrow",
1664
1766
  x1: n.cx,
1665
1767
  y1: n.y + n.h + 2,
1666
- x2: h.cx,
1667
- y2: h.y - 2,
1768
+ x2: s.cx,
1769
+ y2: s.y - 2,
1668
1770
  stroke: (t == null ? void 0 : t.color) ?? this.theme.muted,
1669
1771
  strokeWidth: 1.5,
1670
1772
  headSize: (t == null ? void 0 : t.headSize) ?? 6
@@ -1733,40 +1835,9 @@ class jt {
1733
1835
  return { elements: this.elements, durationInFrames: a };
1734
1836
  }
1735
1837
  }
1736
- const qt = {
1737
- background: "#0a0a1e",
1738
- title: "#e0e7ff",
1739
- subtitle: "#94a3b8",
1740
- primary: "#4fc3f7",
1741
- secondary: "#a78bfa",
1742
- tertiary: "#f472b6",
1743
- muted: "#64748b",
1744
- text: "#c8d6e5",
1745
- boxFill: "rgba(79,195,247,0.12)",
1746
- boxStroke: "#4fc3f7",
1747
- success: "#34d399",
1748
- warning: "#fbbf24",
1749
- error: "#f87171",
1750
- palette: ["#4fc3f7", "#a78bfa", "#f472b6", "#34d399", "#fbbf24", "#fb923c", "#6366f1", "#22d3ee"]
1751
- }, Yt = {
1752
- background: "#f8fafc",
1753
- title: "#1e293b",
1754
- subtitle: "#64748b",
1755
- primary: "#2563eb",
1756
- secondary: "#7c3aed",
1757
- tertiary: "#db2777",
1758
- muted: "#94a3b8",
1759
- text: "#334155",
1760
- boxFill: "rgba(37,99,235,0.08)",
1761
- boxStroke: "#2563eb",
1762
- success: "#16a34a",
1763
- warning: "#d97706",
1764
- error: "#dc2626",
1765
- palette: ["#2563eb", "#7c3aed", "#db2777", "#16a34a", "#d97706", "#ea580c", "#4f46e5", "#0891b2"]
1766
- };
1767
- class Bt {
1838
+ class aa {
1768
1839
  constructor(a, t, r) {
1769
- this._slides = [], this._title = a, this._theme = t ?? qt, this._opts = {
1840
+ this._slides = [], this._title = a, this._theme = t ?? le, this._opts = {
1770
1841
  width: 900,
1771
1842
  height: 640,
1772
1843
  fps: 30,
@@ -1784,14 +1855,14 @@ class Bt {
1784
1855
  /** Build the final ElucimDocument */
1785
1856
  build() {
1786
1857
  const a = this._slides.map((r) => {
1787
- const i = new jt(
1858
+ const i = new ta(
1788
1859
  this._theme,
1789
1860
  this._opts.fps,
1790
1861
  this._opts.width,
1791
1862
  this._opts.height
1792
1863
  );
1793
1864
  r.build(i);
1794
- const { elements: n, durationInFrames: h } = i._build();
1865
+ const { elements: n, durationInFrames: s } = i._build();
1795
1866
  return {
1796
1867
  type: "slide",
1797
1868
  title: r.title,
@@ -1802,7 +1873,7 @@ class Bt {
1802
1873
  width: this._opts.width,
1803
1874
  height: this._opts.height,
1804
1875
  fps: this._opts.fps,
1805
- durationInFrames: h,
1876
+ durationInFrames: s,
1806
1877
  controls: !1,
1807
1878
  loop: !1,
1808
1879
  autoPlay: !0,
@@ -1830,29 +1901,29 @@ class Bt {
1830
1901
  return JSON.stringify(this.build(), null, a ? 2 : void 0);
1831
1902
  }
1832
1903
  }
1833
- function Zt(e, a, t) {
1834
- return new Bt(e, a, t);
1904
+ function ha(e, a, t) {
1905
+ return new aa(e, a, t);
1835
1906
  }
1836
1907
  export {
1837
- Xt as DslRenderer,
1838
- Bt as PresentationBuilder,
1839
- te as SEMANTIC_TOKENS,
1840
- jt as SlideBuilder,
1841
- Qt as TOKEN_NAMES,
1842
- st as compileExpression,
1843
- ct as compileVectorExpression,
1844
- qt as darkTheme,
1845
- Yt as lightTheme,
1846
- Zt as presentation,
1908
+ la as DslRenderer,
1909
+ aa as PresentationBuilder,
1910
+ ne as SEMANTIC_TOKENS,
1911
+ ta as SlideBuilder,
1912
+ ca as TOKEN_NAMES,
1913
+ ot as compileExpression,
1914
+ gt as compileVectorExpression,
1915
+ le as darkTheme,
1916
+ Ht as lightTheme,
1917
+ ha as presentation,
1847
1918
  x as renderElement,
1848
- re as renderPlayer,
1849
- _t as renderPresentation,
1850
- ae as renderRoot,
1851
- j as renderScene,
1852
- Dt as renderSlide,
1853
- Jt as renderToSvgString,
1854
- l as resolveColor,
1855
- f as resolveEasing,
1856
- J as validate,
1857
- X as validateExpression
1919
+ ce as renderPlayer,
1920
+ Bt as renderPresentation,
1921
+ se as renderRoot,
1922
+ H as renderScene,
1923
+ Ut as renderSlide,
1924
+ ua as renderToSvgString,
1925
+ u as resolveColor,
1926
+ o as resolveEasing,
1927
+ te as validate,
1928
+ ee as validateExpression
1858
1929
  };