exodeui 6.3.19 → 6.3.20

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 (3) hide show
  1. package/dist/index.js +13 -13
  2. package/dist/index.mjs +681 -681
  3. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -41,14 +41,14 @@ function ps(p) {
41
41
  width: a = 200,
42
42
  letterSpacing: r = 0,
43
43
  paragraphSpacing: l = 0,
44
- paragraphIndent: f = 0,
44
+ paragraphIndent: h = 0,
45
45
  textCase: c = "none",
46
46
  segments: g = [],
47
- enableSegments: h = !1
47
+ enableSegments: f = !1
48
48
  } = p;
49
49
  let d = String(t || "");
50
50
  c === "uppercase" ? d = d.toUpperCase() : c === "lowercase" ? d = d.toLowerCase() : c === "capitalize" && (d = d.replace(/\b\w/g, (P) => P.toUpperCase())), p.hyphenation === !0 && (d = Ts(d));
51
- const u = `${i} ${e} ${o}px "${s}", sans-serif`, m = `${d}|${u}|${r}|${l}|${f}|${h}|${JSON.stringify(g)}|hyp:${!!p.hyphenation}|comp:${p.composer}|bal:${!!p.balanceRaggedLines}`;
51
+ const u = `${i} ${e} ${o}px "${s}", sans-serif`, m = `${d}|${u}|${r}|${l}|${h}|${f}|${JSON.stringify(g)}|hyp:${!!p.hyphenation}|comp:${p.composer}|bal:${!!p.balanceRaggedLines}`;
52
52
  let y = Ee.get(m);
53
53
  const v = typeof CanvasRenderingContext2D < "u" ? CanvasRenderingContext2D.prototype.measureText : null, b = function(P) {
54
54
  if (!v) return { width: 0, fontBoundingBoxAscent: 0, fontBoundingBoxDescent: 0 };
@@ -60,7 +60,7 @@ function ps(p) {
60
60
  };
61
61
  if (!y) {
62
62
  try {
63
- if (r !== 0 && typeof CanvasRenderingContext2D < "u" && (CanvasRenderingContext2D.prototype.measureText = b), h && g && g.length > 0) {
63
+ if (r !== 0 && typeof CanvasRenderingContext2D < "u" && (CanvasRenderingContext2D.prototype.measureText = b), f && g && g.length > 0) {
64
64
  const P = g.map((T) => {
65
65
  let W = T.text || "";
66
66
  const k = T.textCase || c || "none";
@@ -78,16 +78,16 @@ function ps(p) {
78
78
  const A = `${k.fontStyle || i} ${k.fontWeight || e} ${x}px "${k.fontFamily || s}", sans-serif`, $ = Ye(_, A);
79
79
  if ($ && $.widths)
80
80
  for (let O = 0; O < $.widths.length; O++) {
81
- const V = T + O;
82
- if (V < y.widths.length) {
83
- y.widths[V] = $.widths[O];
81
+ const z = T + O;
82
+ if (z < y.widths.length) {
83
+ y.widths[z] = $.widths[O];
84
84
  const H = $.kinds[O];
85
85
  if (H === 2) {
86
86
  const et = _[O];
87
87
  et === `
88
- ` || et === "\r" ? y.kinds[V] = 2 : y.kinds[V] = 0;
88
+ ` || et === "\r" ? y.kinds[z] = 2 : y.kinds[z] = 0;
89
89
  } else
90
- y.kinds[V] = H;
90
+ y.kinds[z] = H;
91
91
  }
92
92
  }
93
93
  T += _.length;
@@ -107,11 +107,11 @@ function ps(p) {
107
107
  P && Ee.delete(P);
108
108
  }
109
109
  }
110
- if (f > 0 && y && y.widths && !y.indentApplied) {
110
+ if (h > 0 && y && y.widths && !y.indentApplied) {
111
111
  const P = [...y.widths], T = y.fullText || d;
112
112
  let W = !0;
113
113
  for (let k = 0; k < T.length; k++)
114
- W && P[k] !== void 0 && (P[k] += f, W = !1), (T[k] === `
114
+ W && P[k] !== void 0 && (P[k] += h, W = !1), (T[k] === `
115
115
  ` || T[k] === "\r") && (W = !0, T[k] === "\r" && T[k + 1] === `
116
116
  ` && k++);
117
117
  y = { ...y, widths: P, indentApplied: !0 };
@@ -162,13 +162,13 @@ function es(p, t, s) {
162
162
  let n = t - (e.length - 1) * s, a = 0;
163
163
  if (e.forEach((r, l) => {
164
164
  if (r.endsWith("px")) {
165
- const f = parseFloat(r);
166
- i[l] = f, n -= f;
165
+ const h = parseFloat(r);
166
+ i[l] = h, n -= h;
167
167
  } else r.endsWith("fr") ? a += parseFloat(r) : r === "auto" && (i[l] = 100, n -= 100);
168
168
  }), a > 0 && n > 0) {
169
169
  const r = n / a;
170
- e.forEach((l, f) => {
171
- l.endsWith("fr") && (i[f] = r * parseFloat(l));
170
+ e.forEach((l, h) => {
171
+ l.endsWith("fr") && (i[h] = r * parseFloat(l));
172
172
  });
173
173
  }
174
174
  return i;
@@ -183,12 +183,12 @@ function ss(p, t, s) {
183
183
  }
184
184
  function Es(p, t, s) {
185
185
  var _, L;
186
- const o = p.autoLayout, { direction: e, spacing: i, padding: n, align: a, wrap: r } = o, l = e === "vertical", f = t.map((x) => {
186
+ const o = p.autoLayout, { direction: e, spacing: i, padding: n, align: a, wrap: r } = o, l = e === "vertical", h = t.map((x) => {
187
187
  const A = s(x.id), $ = x.geometry;
188
- let O = (A == null ? void 0 : A.width) ?? $.width ?? 100, V = (A == null ? void 0 : A.height) ?? $.height ?? 100;
188
+ let O = (A == null ? void 0 : A.width) ?? $.width ?? 100, z = (A == null ? void 0 : A.height) ?? $.height ?? 100;
189
189
  if ($.type === "Ellipse" || $.type === "Polygon" || $.type === "Star") {
190
190
  const H = (A == null ? void 0 : A.radius) ?? $.radius ?? (A == null ? void 0 : A.outer_radius) ?? $.outer_radius ?? 50;
191
- O = H * 2, V = H * 2;
191
+ O = H * 2, z = H * 2;
192
192
  } else if ($.type === "Text") {
193
193
  const H = ps({
194
194
  text: (A == null ? void 0 : A.text) ?? $.text ?? "",
@@ -205,17 +205,17 @@ function Es(p, t, s) {
205
205
  segments: $.segments,
206
206
  enableSegments: $.enableSegments
207
207
  });
208
- V = H.height, $.width || (O = H.width);
208
+ z = H.height, $.width || (O = H.width);
209
209
  }
210
- return O *= x.transform.scale_x || 1, V *= x.transform.scale_y || 1, { id: x.id, w: O, h: V, original: x };
210
+ return O *= x.transform.scale_x || 1, z *= x.transform.scale_y || 1, { id: x.id, w: O, h: z, original: x };
211
211
  });
212
212
  let c = p.width, g = p.height;
213
- const h = ((_ = p.layoutProps) == null ? void 0 : _.width) === "hug", d = ((L = p.layoutProps) == null ? void 0 : L.height) === "hug", u = [];
213
+ const f = ((_ = p.layoutProps) == null ? void 0 : _.width) === "hug", d = ((L = p.layoutProps) == null ? void 0 : L.height) === "hug", u = [];
214
214
  let m = [], y = 0, v = 0;
215
215
  const b = c - n.left - n.right, C = g - n.top - n.bottom;
216
- f.forEach((x) => {
216
+ h.forEach((x) => {
217
217
  r && m.length > 0 && (l ? v + i + x.h > C : y + i + x.w > b) ? (u.push({ children: m, width: y, height: v }), m = [x], y = x.w, v = x.h) : (m.push(x), l ? (y = Math.max(y, x.w), v += (m.length > 1 ? i : 0) + x.h) : (y += (m.length > 1 ? i : 0) + x.w, v = Math.max(v, x.h)));
218
- }), m.length > 0 && u.push({ children: m, width: y, height: v }), h && !l && (c = Math.max(...u.map((x) => x.width), 0) + n.left + n.right), d && l && (g = Math.max(...u.map((x) => x.height), 0) + n.top + n.bottom);
218
+ }), m.length > 0 && u.push({ children: m, width: y, height: v }), f && !l && (c = Math.max(...u.map((x) => x.width), 0) + n.left + n.right), d && l && (g = Math.max(...u.map((x) => x.height), 0) + n.top + n.bottom);
219
219
  const S = [];
220
220
  let I = n.left, w = n.top;
221
221
  const M = a.toLowerCase(), P = M === "center" || M.endsWith("-center"), T = M.endsWith("-right"), W = M === "center" || M.startsWith("center-"), k = M.startsWith("bottom-");
@@ -223,27 +223,27 @@ function Es(p, t, s) {
223
223
  let A = I, $ = w;
224
224
  l ? W ? $ = n.top + (g - n.top - n.bottom - x.height) / 2 : k && ($ = g - n.bottom - x.height) : P ? A = n.left + (c - n.left - n.right - x.width) / 2 : T && (A = c - n.right - x.width), x.children.forEach((O) => {
225
225
  var F, q;
226
- let V = A, H = $;
227
- l ? P ? V += (x.width - O.w) / 2 : T && (V += x.width - O.w) : W ? H += (x.height - O.h) / 2 : k && (H += x.height - O.h);
226
+ let z = A, H = $;
227
+ l ? P ? z += (x.width - O.w) / 2 : T && (z += x.width - O.w) : W ? H += (x.height - O.h) / 2 : k && (H += x.height - O.h);
228
228
  const et = ((F = O.original.layoutProps) == null ? void 0 : F.width) === "fill", E = ((q = O.original.layoutProps) == null ? void 0 : q.height) === "fill";
229
229
  S.push({
230
230
  id: O.id,
231
- x: V + O.w / 2 - c / 2,
231
+ x: z + O.w / 2 - c / 2,
232
232
  y: H + O.h / 2 - g / 2,
233
233
  width: et && l ? x.width : void 0,
234
234
  height: E ? l ? void 0 : x.height : void 0
235
235
  }), l ? $ += O.h + i : A += O.w + i;
236
236
  }), l ? I += x.width + i : w += x.height + i;
237
- }), { frameWidth: h ? c : void 0, frameHeight: d ? g : void 0, childUpdates: S };
237
+ }), { frameWidth: f ? c : void 0, frameHeight: d ? g : void 0, childUpdates: S };
238
238
  }
239
239
  function xs(p, t, s) {
240
240
  const o = p.autoLayout;
241
241
  if (!o) return { childUpdates: [] };
242
242
  const { gridColumns: e, gridRows: i, columnGap: n = 0, rowGap: a = 0, padding: r, align: l } = o;
243
- let f = p.width, c = p.height;
244
- const g = f - r.left - r.right, h = c - r.top - r.bottom, d = es(e || "1fr", g, n), u = es(i || "auto", h, a), m = d.length > 0 ? d.reduce((T, W) => T + W, 0) + (d.length - 1) * n : 0, y = u.length > 0 ? u.reduce((T, W) => T + W, 0) + (u.length - 1) * a : 0, v = l.toLowerCase(), b = v === "center" || v.endsWith("-center"), C = v.endsWith("-right"), S = v === "center" || v.startsWith("center-"), I = v.startsWith("bottom-");
243
+ let h = p.width, c = p.height;
244
+ const g = h - r.left - r.right, f = c - r.top - r.bottom, d = es(e || "1fr", g, n), u = es(i || "auto", f, a), m = d.length > 0 ? d.reduce((T, W) => T + W, 0) + (d.length - 1) * n : 0, y = u.length > 0 ? u.reduce((T, W) => T + W, 0) + (u.length - 1) * a : 0, v = l.toLowerCase(), b = v === "center" || v.endsWith("-center"), C = v.endsWith("-right"), S = v === "center" || v.startsWith("center-"), I = v.startsWith("bottom-");
245
245
  let w = 0, M = 0;
246
- b ? w = (g - m) / 2 : C && (w = g - m), S ? M = (h - y) / 2 : I && (M = h - y);
246
+ b ? w = (g - m) / 2 : C && (w = g - m), S ? M = (f - y) / 2 : I && (M = f - y);
247
247
  const P = [];
248
248
  return t.forEach((T, W) => {
249
249
  var q, Q;
@@ -251,17 +251,17 @@ function xs(p, t, s) {
251
251
  _ >= u.length && u.push(100);
252
252
  const L = d[k], x = u[_];
253
253
  let A = r.left + w + d.slice(0, k).reduce((it, dt) => it + dt + n, 0), $ = r.top + M + u.slice(0, _).reduce((it, dt) => it + dt + a, 0);
254
- const O = s(T.id), V = T.geometry;
255
- let H = (O == null ? void 0 : O.width) ?? V.width ?? 100, et = (O == null ? void 0 : O.height) ?? V.height ?? 100;
256
- if (V.type === "Ellipse" || V.type === "Polygon" || V.type === "Star") {
257
- const it = (O == null ? void 0 : O.radius) ?? V.radius ?? (O == null ? void 0 : O.outer_radius) ?? V.outer_radius ?? 50;
254
+ const O = s(T.id), z = T.geometry;
255
+ let H = (O == null ? void 0 : O.width) ?? z.width ?? 100, et = (O == null ? void 0 : O.height) ?? z.height ?? 100;
256
+ if (z.type === "Ellipse" || z.type === "Polygon" || z.type === "Star") {
257
+ const it = (O == null ? void 0 : O.radius) ?? z.radius ?? (O == null ? void 0 : O.outer_radius) ?? z.outer_radius ?? 50;
258
258
  H = it * 2, et = it * 2;
259
259
  }
260
260
  H *= T.transform.scale_x || 1, et *= T.transform.scale_y || 1;
261
261
  let E = A, F = $;
262
262
  b ? E += (L - H) / 2 : C && (E += L - H), S ? F += (x - et) / 2 : I && (F += x - et), P.push({
263
263
  id: T.id,
264
- x: E + H / 2 - f / 2,
264
+ x: E + H / 2 - h / 2,
265
265
  y: F + et / 2 - c / 2,
266
266
  width: ((q = T.layoutProps) == null ? void 0 : q.width) === "fill" ? L : void 0,
267
267
  height: ((Q = T.layoutProps) == null ? void 0 : Q.height) === "fill" ? x : void 0
@@ -371,20 +371,20 @@ class As {
371
371
  e && e.applyImpulse(new ae.Vector2(s, o), !0);
372
372
  }
373
373
  }
374
- const us = (p) => p, Os = (p) => p > 0 ? 1 : 0, Rs = (p) => p < 1 ? 0 : 1, is = (p) => p * p, ns = (p) => p * (2 - p), os = (p) => p < 0.5 ? 2 * p * p : -1 + (4 - 2 * p) * p, Ls = (p) => p * p * p, Fs = (p) => --p * p * p + 1, $s = (p) => p < 0.5 ? 4 * p * p * p : (p - 1) * (2 * p - 2) * (2 * p - 2) + 1, Ws = (p) => p * p * p * p, Bs = (p) => 1 - --p * p * p * p, Gs = (p) => p < 0.5 ? 8 * p * p * p * p : 1 - 8 * --p * p * p * p, Ys = (p) => p * p * p * p * p, Xs = (p) => 1 + --p * p * p * p * p, Ds = (p) => p < 0.5 ? 16 * p * p * p * p * p : 1 + 16 * --p * p * p * p * p, zs = (p) => 1 - Math.cos(p * Math.PI / 2), Vs = (p) => Math.sin(p * Math.PI / 2), Ns = (p) => -(Math.cos(Math.PI * p) - 1) / 2, Hs = (p) => p === 0 ? 0 : Math.pow(2, 10 * (p - 1)), Us = (p) => p === 1 ? 1 : 1 - Math.pow(2, -10 * p), qs = (p) => p === 0 ? 0 : p === 1 ? 1 : p < 0.5 ? Math.pow(2, 20 * p - 10) / 2 : (2 - Math.pow(2, -20 * p + 10)) / 2, Js = (p) => 1 - Math.sqrt(1 - p * p), Qs = (p) => Math.sqrt(1 - --p * p), Ks = (p) => p < 0.5 ? (1 - Math.sqrt(1 - 4 * p * p)) / 2 : (Math.sqrt(1 - (-2 * p + 2) * (-2 * p + 2)) + 1) / 2, Ge = 1.70158, $e = Ge * 1.525, gs = Ge + 1, Zs = (p) => gs * p * p * p - Ge * p * p, js = (p) => 1 + gs * Math.pow(p - 1, 3) + Ge * Math.pow(p - 1, 2), ti = (p) => p < 0.5 ? Math.pow(2 * p, 2) * (($e + 1) * 2 * p - $e) / 2 : (Math.pow(2 * p - 2, 2) * (($e + 1) * (p * 2 - 2) + $e) + 2) / 2, ms = 2 * Math.PI / 3, as = 2 * Math.PI / 4.5, ei = (p) => p === 0 ? 0 : p === 1 ? 1 : -Math.pow(2, 10 * p - 10) * Math.sin((p * 10 - 10.75) * ms), si = (p) => p === 0 ? 0 : p === 1 ? 1 : Math.pow(2, -10 * p) * Math.sin((p * 10 - 0.75) * ms) + 1, ii = (p) => p === 0 ? 0 : p === 1 ? 1 : p < 0.5 ? -(Math.pow(2, 20 * p - 10) * Math.sin((20 * p - 11.125) * as)) / 2 : Math.pow(2, -20 * p + 10) * Math.sin((20 * p - 11.125) * as) / 2 + 1, Be = (p) => p < 1 / 2.75 ? 7.5625 * p * p : p < 2 / 2.75 ? 7.5625 * (p -= 1.5 / 2.75) * p + 0.75 : p < 2.5 / 2.75 ? 7.5625 * (p -= 2.25 / 2.75) * p + 0.9375 : 7.5625 * (p -= 2.625 / 2.75) * p + 0.984375, ni = (p) => 1 - Be(1 - p), oi = Be, ai = (p) => p < 0.5 ? (1 - Be(1 - 2 * p)) / 2 : (1 + Be(2 * p - 1)) / 2, Xe = /* @__PURE__ */ new Map(), xe = (p, t, s, o) => {
374
+ const us = (p) => p, Os = (p) => p > 0 ? 1 : 0, Rs = (p) => p < 1 ? 0 : 1, is = (p) => p * p, ns = (p) => p * (2 - p), os = (p) => p < 0.5 ? 2 * p * p : -1 + (4 - 2 * p) * p, Ls = (p) => p * p * p, Fs = (p) => --p * p * p + 1, $s = (p) => p < 0.5 ? 4 * p * p * p : (p - 1) * (2 * p - 2) * (2 * p - 2) + 1, Ws = (p) => p * p * p * p, Bs = (p) => 1 - --p * p * p * p, Gs = (p) => p < 0.5 ? 8 * p * p * p * p : 1 - 8 * --p * p * p * p, Ys = (p) => p * p * p * p * p, Xs = (p) => 1 + --p * p * p * p * p, Ds = (p) => p < 0.5 ? 16 * p * p * p * p * p : 1 + 16 * --p * p * p * p * p, Vs = (p) => 1 - Math.cos(p * Math.PI / 2), zs = (p) => Math.sin(p * Math.PI / 2), Ns = (p) => -(Math.cos(Math.PI * p) - 1) / 2, Hs = (p) => p === 0 ? 0 : Math.pow(2, 10 * (p - 1)), Us = (p) => p === 1 ? 1 : 1 - Math.pow(2, -10 * p), qs = (p) => p === 0 ? 0 : p === 1 ? 1 : p < 0.5 ? Math.pow(2, 20 * p - 10) / 2 : (2 - Math.pow(2, -20 * p + 10)) / 2, Js = (p) => 1 - Math.sqrt(1 - p * p), Qs = (p) => Math.sqrt(1 - --p * p), Ks = (p) => p < 0.5 ? (1 - Math.sqrt(1 - 4 * p * p)) / 2 : (Math.sqrt(1 - (-2 * p + 2) * (-2 * p + 2)) + 1) / 2, Ge = 1.70158, $e = Ge * 1.525, gs = Ge + 1, Zs = (p) => gs * p * p * p - Ge * p * p, js = (p) => 1 + gs * Math.pow(p - 1, 3) + Ge * Math.pow(p - 1, 2), ti = (p) => p < 0.5 ? Math.pow(2 * p, 2) * (($e + 1) * 2 * p - $e) / 2 : (Math.pow(2 * p - 2, 2) * (($e + 1) * (p * 2 - 2) + $e) + 2) / 2, ms = 2 * Math.PI / 3, as = 2 * Math.PI / 4.5, ei = (p) => p === 0 ? 0 : p === 1 ? 1 : -Math.pow(2, 10 * p - 10) * Math.sin((p * 10 - 10.75) * ms), si = (p) => p === 0 ? 0 : p === 1 ? 1 : Math.pow(2, -10 * p) * Math.sin((p * 10 - 0.75) * ms) + 1, ii = (p) => p === 0 ? 0 : p === 1 ? 1 : p < 0.5 ? -(Math.pow(2, 20 * p - 10) * Math.sin((20 * p - 11.125) * as)) / 2 : Math.pow(2, -20 * p + 10) * Math.sin((20 * p - 11.125) * as) / 2 + 1, Be = (p) => p < 1 / 2.75 ? 7.5625 * p * p : p < 2 / 2.75 ? 7.5625 * (p -= 1.5 / 2.75) * p + 0.75 : p < 2.5 / 2.75 ? 7.5625 * (p -= 2.25 / 2.75) * p + 0.9375 : 7.5625 * (p -= 2.625 / 2.75) * p + 0.984375, ni = (p) => 1 - Be(1 - p), oi = Be, ai = (p) => p < 0.5 ? (1 - Be(1 - 2 * p)) / 2 : (1 + Be(2 * p - 1)) / 2, Xe = /* @__PURE__ */ new Map(), xe = (p, t, s, o) => {
375
375
  const e = `${p},${t},${s},${o}`;
376
376
  if (Xe.has(e)) return Xe.get(e);
377
- const i = (f) => (1 - 3 * s + 3 * p) * f * f * f + (3 * s - 6 * p) * f * f + 3 * p * f, n = (f) => (1 - 3 * o + 3 * t) * f * f * f + (3 * o - 6 * t) * f * f + 3 * t * f, a = (f) => 3 * (1 - 3 * s + 3 * p) * f * f + 2 * (3 * s - 6 * p) * f + 3 * p, r = (f) => {
378
- let c = f;
377
+ const i = (h) => (1 - 3 * s + 3 * p) * h * h * h + (3 * s - 6 * p) * h * h + 3 * p * h, n = (h) => (1 - 3 * o + 3 * t) * h * h * h + (3 * o - 6 * t) * h * h + 3 * t * h, a = (h) => 3 * (1 - 3 * s + 3 * p) * h * h + 2 * (3 * s - 6 * p) * h + 3 * p, r = (h) => {
378
+ let c = h;
379
379
  for (let g = 0; g < 8; g++) {
380
- const h = i(c) - f;
381
- if (Math.abs(h) < 1e-6) return c;
380
+ const f = i(c) - h;
381
+ if (Math.abs(f) < 1e-6) return c;
382
382
  const d = a(c);
383
383
  if (Math.abs(d) < 1e-6) break;
384
- c = c - h / d;
384
+ c = c - f / d;
385
385
  }
386
386
  return c;
387
- }, l = (f) => f === 0 ? 0 : f === 1 ? 1 : n(r(f));
387
+ }, l = (h) => h === 0 ? 0 : h === 1 ? 1 : n(r(h));
388
388
  return Xe.set(e, l), l;
389
389
  }, rs = (p) => {
390
390
  const t = p.match(/cubic-bezier\s*\(\s*([-?\d.]+)\s*,\s*([-?\d.]+)\s*,\s*([-?\d.]+)\s*,\s*([-?\d.]+)\s*\)/);
@@ -416,8 +416,8 @@ const us = (p) => p, Os = (p) => p > 0 ? 1 : 0, Rs = (p) => p < 1 ? 0 : 1, is =
416
416
  EaseOutQuint: Xs,
417
417
  EaseInOutQuint: Ds,
418
418
  // Sinusoidal
419
- EaseInSine: zs,
420
- EaseOutSine: Vs,
419
+ EaseInSine: Vs,
420
+ EaseOutSine: zs,
421
421
  EaseInOutSine: Ns,
422
422
  // Exponential
423
423
  EaseInExpo: Hs,
@@ -516,10 +516,10 @@ const us = (p) => p, Os = (p) => p > 0 ? 1 : 0, Rs = (p) => p < 1 ? 0 : 1, is =
516
516
  }
517
517
  }, li = (p, t, s, o, e) => {
518
518
  if (!p || !t || !s) return p;
519
- const i = o.scale_x ?? 1, n = o.scale_y ?? 1, a = (r, l, f) => {
519
+ const i = o.scale_x ?? 1, n = o.scale_y ?? 1, a = (r, l, h) => {
520
520
  let c = 0, g = 0;
521
- const h = o.rotation * Math.PI / 180, d = Math.cos(h), u = Math.sin(h), m = r * i * d - l * n * u + o.x, y = r * i * u + l * n * d + o.y;
522
- f.forEach((w) => {
521
+ const f = o.rotation * Math.PI / 180, d = Math.cos(f), u = Math.sin(f), m = r * i * d - l * n * u + o.x, y = r * i * u + l * n * d + o.y;
522
+ h.forEach((w) => {
523
523
  const M = e(w.boneId);
524
524
  if (!M) return;
525
525
  const P = {
@@ -538,15 +538,15 @@ const us = (p) => p, Os = (p) => p > 0 ? 1 : 0, Rs = (p) => p < 1 ? 0 : 1, is =
538
538
  };
539
539
  };
540
540
  return p.map((r, l) => {
541
- const f = t[l];
542
- if (!f || f.length === 0) return { ...r };
543
- const c = { ...r, ...a(r.x, r.y, f) };
541
+ const h = t[l];
542
+ if (!h || h.length === 0) return { ...r };
543
+ const c = { ...r, ...a(r.x, r.y, h) };
544
544
  if (r.in_x !== void 0 && r.in_y !== void 0) {
545
- const g = a(r.in_x, r.in_y, f);
545
+ const g = a(r.in_x, r.in_y, h);
546
546
  c.in_x = g.x, c.in_y = g.y;
547
547
  }
548
548
  if (r.out_x !== void 0 && r.out_y !== void 0) {
549
- const g = a(r.out_x, r.out_y, f);
549
+ const g = a(r.out_x, r.out_y, h);
550
550
  c.out_x = g.x, c.out_y = g.y;
551
551
  }
552
552
  return c;
@@ -820,9 +820,9 @@ class ci {
820
820
  }
821
821
  svgPathToPoints(t) {
822
822
  const s = /([MLHVCSQTAZmlhvcsqtaz])([^MLHVCSQTAZmlhvcsqtaz]*)/g, o = /[-+]?(?:\d*\.\d+|\d+)(?:[eE][-+]?\d+)?/g, e = [];
823
- let i = !1, n = 0, a = 0, r = 0, l = 0, f = 0, c = 0, g;
823
+ let i = !1, n = 0, a = 0, r = 0, l = 0, h = 0, c = 0, g;
824
824
  for (; (g = s.exec(t)) !== null; ) {
825
- const h = g[1], d = (g[2].match(o) || []).map(parseFloat), u = h === h.toLowerCase(), m = h.toUpperCase();
825
+ const f = g[1], d = (g[2].match(o) || []).map(parseFloat), u = f === f.toLowerCase(), m = f.toUpperCase();
826
826
  let y = 0;
827
827
  const v = (C) => {
828
828
  let S = d[y++];
@@ -831,7 +831,7 @@ class ci {
831
831
  switch (m) {
832
832
  case "M": {
833
833
  const C = b();
834
- for (f = n = C.x, c = a = C.y, e.push({ x: n, y: a, in_x: n, in_y: a, out_x: n, out_y: a, moveTo: !0 }); y < d.length; ) {
834
+ for (h = n = C.x, c = a = C.y, e.push({ x: n, y: a, in_x: n, in_y: a, out_x: n, out_y: a, moveTo: !0 }); y < d.length; ) {
835
835
  const S = b();
836
836
  n = S.x, a = S.y, e.push({ x: n, y: a, in_x: n, in_y: a, out_x: n, out_y: a });
837
837
  }
@@ -898,7 +898,7 @@ class ci {
898
898
  const S = [...e].reverse().find((I) => I.moveTo) || e[0];
899
899
  S && Math.hypot(S.x - C.x, S.y - C.y) < 0.1 && (S.in_x = C.in_x, S.in_y = C.in_y, e.pop(), e.length > 0 && (e[e.length - 1].closePath = !0));
900
900
  }
901
- n = f, a = c;
901
+ n = h, a = c;
902
902
  break;
903
903
  default:
904
904
  if (d.length >= 2) {
@@ -971,8 +971,8 @@ class ci {
971
971
  const o = [], e = /* @__PURE__ */ new Set(), i = (r) => {
972
972
  r && r.forEach((l) => {
973
973
  if (e.has(l.id)) return;
974
- const f = { ...l }, c = f.childrenObjects || [];
975
- e.add(f.id), o.push(f), i(c);
974
+ const h = { ...l }, c = h.childrenObjects || [];
975
+ e.add(h.id), o.push(h), i(c);
976
976
  });
977
977
  };
978
978
  if (i(s.objects || []), o.length > (s.objects || []).length && console.log(`[Engine] Flattened artboard from ${(s.objects || []).length} to ${o.length} objects.`), s.objects = o, this.artboard = s, this.currentTime = 0, this.objectStates.clear(), console.log(`[ExodeUIEngine] Loading artboard: "${(n = this.artboard) == null ? void 0 : n.name}" with ${(a = this.artboard) == null ? void 0 : a.objects.length} objects`), this.artboard && this.artboard.objects) {
@@ -981,8 +981,8 @@ class ci {
981
981
  r.set(l.id, l), l.children || (l.children = []);
982
982
  }), this.artboard.objects.forEach((l) => {
983
983
  if (l.parentId) {
984
- const f = r.get(l.parentId);
985
- f && (f.children || (f.children = []), f.children.includes(l.id) || f.children.push(l.id));
984
+ const h = r.get(l.parentId);
985
+ h && (h.children || (h.children = []), h.children.includes(l.id) || h.children.push(l.id));
986
986
  }
987
987
  });
988
988
  }
@@ -1032,11 +1032,11 @@ class ci {
1032
1032
  reset() {
1033
1033
  if (!this.artboard) return;
1034
1034
  if (this.objectStates.clear(), this.objectVelocities.clear(), this.currentTime = 0, this.inputs.clear(), this.inputNameMap.clear(), this.layerStates.clear(), this.logicNodeValues.clear(), this.justFiredTriggers.clear(), this.inputs.set("mouseX", 0), this.inputs.set("mouseY", 0), this.inputs.set("scrollX", 0), this.inputs.set("scrollY", 0), this.inputs.set("isMouseDown", !1), this.physicsEngine && (this.physicsEngine.destroy(), this.physicsEngine = null), this._layoutAnimCache.clear(), this._springChainState.clear(), this._emitterPools.clear(), this.artboard.objects.forEach((s) => {
1035
- var n, a, r, l, f, c, g;
1035
+ var n, a, r, l, h, c, g;
1036
1036
  const o = s.width ?? ((n = s.geometry) == null ? void 0 : n.width) ?? 0, e = s.height ?? ((a = s.geometry) == null ? void 0 : a.height) ?? 0, i = s.cornerRadius ?? s.corner_radius ?? ((r = s.geometry) == null ? void 0 : r.corner_radius) ?? ((l = s.geometry) == null ? void 0 : l.cornerRadius) ?? 0;
1037
1037
  this.objectStates.set(s.id, {
1038
1038
  ...s.transform || {},
1039
- x: ((f = s.transform) == null ? void 0 : f.x) ?? s.x ?? 0,
1039
+ x: ((h = s.transform) == null ? void 0 : h.x) ?? s.x ?? 0,
1040
1040
  y: ((c = s.transform) == null ? void 0 : c.y) ?? s.y ?? 0,
1041
1041
  width: o,
1042
1042
  height: e,
@@ -1117,8 +1117,8 @@ class ci {
1117
1117
  n.forEach((a) => {
1118
1118
  const r = this.objectStates.get(a.id);
1119
1119
  if (r) {
1120
- const l = Math.abs(r.x - a.x), f = Math.abs(r.y - a.y);
1121
- !t && (l > 20 || f > 20) ? (r.x += (a.x - r.x) * o, r.y += (a.y - r.y) * o) : (r.x = a.x, r.y = a.y), a.width !== void 0 && (r.width = a.width), a.height !== void 0 && (r.height = a.height);
1120
+ const l = Math.abs(r.x - a.x), h = Math.abs(r.y - a.y);
1121
+ !t && (l > 20 || h > 20) ? (r.x += (a.x - r.x) * o, r.y += (a.y - r.y) * o) : (r.x = a.x, r.y = a.y), a.width !== void 0 && (r.width = a.width), a.height !== void 0 && (r.height = a.height);
1122
1122
  }
1123
1123
  });
1124
1124
  };
@@ -1131,8 +1131,8 @@ class ci {
1131
1131
  if (n.type === "Frame" && ((a = n.autoLayout) != null && a.enabled) && n.children && n.children.length > 0) {
1132
1132
  const r = n.children.map((c) => s.get(c)).filter((c) => !!c), l = this.objectStates.get(n.id);
1133
1133
  if (!l) return;
1134
- const f = ss(l, r, (c) => this.objectStates.get(c));
1135
- f.frameWidth !== void 0 && (l.width = f.frameWidth), f.frameHeight !== void 0 && (l.height = f.frameHeight), e(f.childUpdates);
1134
+ const h = ss(l, r, (c) => this.objectStates.get(c));
1135
+ h.frameWidth !== void 0 && (l.width = h.frameWidth), h.frameHeight !== void 0 && (l.height = h.frameHeight), e(h.childUpdates);
1136
1136
  }
1137
1137
  });
1138
1138
  }
@@ -1183,15 +1183,15 @@ class ci {
1183
1183
  const a = this.activeStateMachine.layers.find((r) => r.name === t);
1184
1184
  if (a)
1185
1185
  for (const r of s) {
1186
- const l = a.states.find((f) => f.id === r);
1186
+ const l = a.states.find((h) => h.id === r);
1187
1187
  if (l) {
1188
- let f = null;
1189
- l.animationId && (f = this.artboard.animations.find((c) => c.id === l.animationId) || null), f || (f = this.artboard.animations.find(
1188
+ let h = null;
1189
+ l.animationId && (h = this.artboard.animations.find((c) => c.id === l.animationId) || null), h || (h = this.artboard.animations.find(
1190
1190
  (c) => {
1191
- var g, h;
1192
- return c.name === l.name || c.id === l.name || (l.name === "Entry" || l.id === "entry") && (((g = c.name) == null ? void 0 : g.toLowerCase()) === "onload" || ((h = c.name) == null ? void 0 : h.toLowerCase()) === "intro");
1191
+ var g, f;
1192
+ return c.name === l.name || c.id === l.name || (l.name === "Entry" || l.id === "entry") && (((g = c.name) == null ? void 0 : g.toLowerCase()) === "onload" || ((f = c.name) == null ? void 0 : f.toLowerCase()) === "intro");
1193
1193
  }
1194
- ) || null), f && ((n = this.artboard.animationFlow) != null && n.some((g) => (g.trigger === "on_load" || g.trigger === "after_delay") && g.targetAnimationId === (f == null ? void 0 : f.id)) || (e.push({ animation: f, state: l }), i = Math.max(i, f.duration)));
1194
+ ) || null), h && ((n = this.artboard.animationFlow) != null && n.some((g) => (g.trigger === "on_load" || g.trigger === "after_delay") && g.targetAnimationId === (h == null ? void 0 : h.id)) || (e.push({ animation: h, state: l }), i = Math.max(i, h.duration)));
1195
1195
  }
1196
1196
  }
1197
1197
  }
@@ -1237,13 +1237,13 @@ class ci {
1237
1237
  var n, a, r;
1238
1238
  let o;
1239
1239
  if (this.inputs.has(t)) {
1240
- const l = (n = this.activeStateMachine) == null ? void 0 : n.inputs.find((f) => f.id === t);
1240
+ const l = (n = this.activeStateMachine) == null ? void 0 : n.inputs.find((h) => h.id === t);
1241
1241
  l && typeof l.value == "object" && (o = l.value.type);
1242
1242
  } else {
1243
1243
  const l = this.inputNameMap.get(t);
1244
1244
  if (l && l.length > 0) {
1245
- const f = (a = this.activeStateMachine) == null ? void 0 : a.inputs.find((c) => c.id === l[0]);
1246
- f && typeof f.value == "object" && (o = f.value.type);
1245
+ const h = (a = this.activeStateMachine) == null ? void 0 : a.inputs.find((c) => c.id === l[0]);
1246
+ h && typeof h.value == "object" && (o = h.value.type);
1247
1247
  }
1248
1248
  }
1249
1249
  let e = s;
@@ -1251,8 +1251,8 @@ class ci {
1251
1251
  const i = this.inputNameMap.get(t);
1252
1252
  i && i.forEach((l) => this.setInternalInput(l, e)), o === "Trigger" && e === !0 && (this.justFiredTriggers.add(t), i && i.forEach((l) => this.justFiredTriggers.add(l))), Array.isArray(e) && ((r = this.artboard) == null || r.objects.forEach((l) => {
1253
1253
  if (l.inputId === t || l.name === t) {
1254
- const f = this.objectStates.get(l.id);
1255
- f && f.options && (l.type === "ListView" || l.variant === "listview" ? f.options.items = e : (l.type === "Dropdown" || l.variant === "dropdown") && (f.options.optionsList = e));
1254
+ const h = this.objectStates.get(l.id);
1255
+ h && h.options && (l.type === "ListView" || l.variant === "listview" ? h.options.items = e : (l.type === "Dropdown" || l.variant === "dropdown") && (h.options.optionsList = e));
1256
1256
  }
1257
1257
  })), this.evaluateTransitions(), this.evaluateVariableTriggers(t, e);
1258
1258
  }
@@ -1296,8 +1296,8 @@ class ci {
1296
1296
  break;
1297
1297
  }
1298
1298
  if (l) {
1299
- const f = i.delay || 0;
1300
- f <= 0 ? this.triggerGlobalAnimation(i.targetAnimationId, i.subAnimationIds, i.loop, i.id) : setTimeout(() => this.triggerGlobalAnimation(i.targetAnimationId, i.subAnimationIds, i.loop, i.id), f);
1299
+ const h = i.delay || 0;
1300
+ h <= 0 ? this.triggerGlobalAnimation(i.targetAnimationId, i.subAnimationIds, i.loop, i.id) : setTimeout(() => this.triggerGlobalAnimation(i.targetAnimationId, i.subAnimationIds, i.loop, i.id), h);
1301
1301
  }
1302
1302
  }
1303
1303
  });
@@ -1397,36 +1397,36 @@ class ci {
1397
1397
  });
1398
1398
  }
1399
1399
  evaluateLogicTree(t, s = null, o = /* @__PURE__ */ new Set()) {
1400
- var a, r, l, f, c, g;
1400
+ var a, r, l, h, c, g;
1401
1401
  if (o.has(t))
1402
1402
  return this.inputs.get(t) ?? this.logicNodeValues.get(t) ?? 0;
1403
1403
  o.add(t);
1404
- const e = (r = (a = this.activeStateMachine) == null ? void 0 : a.logicNodes) == null ? void 0 : r.find((h) => h.id === t);
1404
+ const e = (r = (a = this.activeStateMachine) == null ? void 0 : a.logicNodes) == null ? void 0 : r.find((f) => f.id === t);
1405
1405
  if (e) {
1406
- const h = (u, m) => {
1406
+ const f = (u, m) => {
1407
1407
  const y = e.inputs.find((v) => v.id === u);
1408
1408
  return y ? y.sourceId ? this.evaluateLogicTree(y.sourceId, y.sourceHandleId, o) : y.value !== void 0 ? y.value : m : m;
1409
1409
  };
1410
1410
  let d = 0;
1411
1411
  switch (e.op) {
1412
1412
  case Ct.AND:
1413
- d = h("a", !1) && h("b", !1);
1413
+ d = f("a", !1) && f("b", !1);
1414
1414
  break;
1415
1415
  case Ct.OR:
1416
- d = h("a", !1) || h("b", !1);
1416
+ d = f("a", !1) || f("b", !1);
1417
1417
  break;
1418
1418
  case Ct.NOT:
1419
- d = !h("in", !1);
1419
+ d = !f("in", !1);
1420
1420
  break;
1421
1421
  case Ct.XOR:
1422
- d = !!h("a", !1) != !!h("b", !1);
1422
+ d = !!f("a", !1) != !!f("b", !1);
1423
1423
  break;
1424
1424
  case Ct.OBJECT:
1425
1425
  d = e.name;
1426
1426
  break;
1427
1427
  case Ct.PROPERTY:
1428
1428
  case Ct.GET_PROPERTY: {
1429
- const u = h("id", "");
1429
+ const u = f("id", "");
1430
1430
  if (!u) {
1431
1431
  d = 0;
1432
1432
  break;
@@ -1445,7 +1445,7 @@ class ci {
1445
1445
  break;
1446
1446
  }
1447
1447
  case Ct.SET_PROPERTY: {
1448
- const u = h("id", ""), m = h("value", void 0);
1448
+ const u = f("id", ""), m = f("value", void 0);
1449
1449
  if (!u || m === void 0) {
1450
1450
  d = 0;
1451
1451
  break;
@@ -1475,76 +1475,76 @@ class ci {
1475
1475
  break;
1476
1476
  }
1477
1477
  case Ct.ADD:
1478
- d = h("a", 0) + h("b", 0);
1478
+ d = f("a", 0) + f("b", 0);
1479
1479
  break;
1480
1480
  case Ct.SUB:
1481
- d = h("a", 0) - h("b", 0);
1481
+ d = f("a", 0) - f("b", 0);
1482
1482
  break;
1483
1483
  case Ct.MUL:
1484
- d = h("a", 0) * h("b", 0);
1484
+ d = f("a", 0) * f("b", 0);
1485
1485
  break;
1486
1486
  case Ct.DIV: {
1487
- const u = h("b", 1);
1488
- d = u === 0 ? 0 : h("a", 0) / u;
1487
+ const u = f("b", 1);
1488
+ d = u === 0 ? 0 : f("a", 0) / u;
1489
1489
  break;
1490
1490
  }
1491
1491
  case Ct.MOD:
1492
- d = h("a", 0) % h("b", 1);
1492
+ d = f("a", 0) % f("b", 1);
1493
1493
  break;
1494
1494
  case Ct.POW:
1495
- d = Math.pow(h("a", 0), h("b", 1));
1495
+ d = Math.pow(f("a", 0), f("b", 1));
1496
1496
  break;
1497
1497
  case Ct.ABS:
1498
- d = Math.abs(h("in", 0));
1498
+ d = Math.abs(f("in", 0));
1499
1499
  break;
1500
1500
  case Ct.ROUND:
1501
- d = Math.round(h("in", 0));
1501
+ d = Math.round(f("in", 0));
1502
1502
  break;
1503
1503
  case Ct.FLOOR:
1504
- d = Math.floor(h("in", 0));
1504
+ d = Math.floor(f("in", 0));
1505
1505
  break;
1506
1506
  case Ct.CEIL:
1507
- d = Math.ceil(h("in", 0));
1507
+ d = Math.ceil(f("in", 0));
1508
1508
  break;
1509
1509
  case Ct.SIN:
1510
- d = Math.sin(h("in", 0));
1510
+ d = Math.sin(f("in", 0));
1511
1511
  break;
1512
1512
  case Ct.COS:
1513
- d = Math.cos(h("in", 0));
1513
+ d = Math.cos(f("in", 0));
1514
1514
  break;
1515
1515
  case Ct.TAN:
1516
- d = Math.tan(h("in", 0));
1516
+ d = Math.tan(f("in", 0));
1517
1517
  break;
1518
1518
  case Ct.CLAMP: {
1519
- const u = h("in", 0), m = h("min", 0), y = h("max", 1);
1519
+ const u = f("in", 0), m = f("min", 0), y = f("max", 1);
1520
1520
  d = Math.max(m, Math.min(y, u));
1521
1521
  break;
1522
1522
  }
1523
1523
  case Ct.REMAP: {
1524
- const u = h("in", 0), m = h("inMin", 0), y = h("inMax", 100), v = h("outMin", 0), b = h("outMax", 1);
1524
+ const u = f("in", 0), m = f("inMin", 0), y = f("inMax", 100), v = f("outMin", 0), b = f("outMax", 1);
1525
1525
  d = y === m ? v : v + (u - m) * (b - v) / (y - m);
1526
1526
  break;
1527
1527
  }
1528
1528
  case Ct.EQ:
1529
- d = h("a", 0) == h("b", 0);
1529
+ d = f("a", 0) == f("b", 0);
1530
1530
  break;
1531
1531
  case Ct.NEQ:
1532
- d = h("a", 0) != h("b", 0);
1532
+ d = f("a", 0) != f("b", 0);
1533
1533
  break;
1534
1534
  case Ct.GT:
1535
- d = h("a", 0) > h("b", 0);
1535
+ d = f("a", 0) > f("b", 0);
1536
1536
  break;
1537
1537
  case Ct.LT:
1538
- d = h("a", 0) < h("b", 0);
1538
+ d = f("a", 0) < f("b", 0);
1539
1539
  break;
1540
1540
  case Ct.GTE:
1541
- d = h("a", 0) >= h("b", 0);
1541
+ d = f("a", 0) >= f("b", 0);
1542
1542
  break;
1543
1543
  case Ct.LTE:
1544
- d = h("a", 0) <= h("b", 0);
1544
+ d = f("a", 0) <= f("b", 0);
1545
1545
  break;
1546
1546
  case Ct.IF_ELSE:
1547
- d = h("cond", !1) ? h("then", 0) : h("else", 0);
1547
+ d = f("cond", !1) ? f("then", 0) : f("else", 0);
1548
1548
  break;
1549
1549
  case Ct.VALUE:
1550
1550
  d = e.value !== void 0 ? e.value : 0;
@@ -1553,7 +1553,7 @@ class ci {
1553
1553
  d = this.inputs.get(e.name) ?? 0;
1554
1554
  break;
1555
1555
  case Ct.LOG: {
1556
- const u = h("in", "");
1556
+ const u = f("in", "");
1557
1557
  this.debugLog(`[User Logic] ${u}`), d = u;
1558
1558
  break;
1559
1559
  }
@@ -1573,7 +1573,7 @@ class ci {
1573
1573
  d = this.inputs.get("isMouseDown") ?? !1;
1574
1574
  break;
1575
1575
  case Ct.EFFECTOR: {
1576
- const u = h("id", ""), m = h("intensity", 1), y = h("trigger", !0);
1576
+ const u = f("id", ""), m = f("intensity", 1), y = f("trigger", !0);
1577
1577
  if (!u || !y) {
1578
1578
  d = 0;
1579
1579
  break;
@@ -1598,11 +1598,11 @@ class ci {
1598
1598
  break;
1599
1599
  }
1600
1600
  case Ct.MONITOR: {
1601
- d = h("in", 0);
1601
+ d = f("in", 0);
1602
1602
  break;
1603
1603
  }
1604
1604
  case Ct.SPRING_PULL: {
1605
- const u = h("objectId", ""), m = h("forceX", 0), y = h("forceY", 0);
1605
+ const u = f("objectId", ""), m = f("forceX", 0), y = f("forceY", 0);
1606
1606
  u && ((l = this.artboard) == null || l.objects.forEach((v) => {
1607
1607
  v.behaviors && v.behaviors.forEach((b) => {
1608
1608
  var C;
@@ -1626,10 +1626,10 @@ class ci {
1626
1626
  break;
1627
1627
  }
1628
1628
  case Ct.SPRING_SETTLE: {
1629
- const u = h("objectId", "");
1629
+ const u = f("objectId", "");
1630
1630
  let m = !0;
1631
1631
  if (u) {
1632
- const y = h("threshold", 1);
1632
+ const y = f("threshold", 1);
1633
1633
  this._springChainState.forEach((v) => {
1634
1634
  const b = v.get(u);
1635
1635
  b && (Math.abs(b.vx) > y || Math.abs(b.vy) > y) && (m = !1);
@@ -1639,8 +1639,8 @@ class ci {
1639
1639
  break;
1640
1640
  }
1641
1641
  case Ct.EMIT: {
1642
- const u = h("objectId", ""), m = h("count", 20);
1643
- u && ((f = this.artboard) == null || f.objects.forEach((y) => {
1642
+ const u = f("objectId", ""), m = f("count", 20);
1643
+ u && ((h = this.artboard) == null || h.objects.forEach((y) => {
1644
1644
  y.behaviors && y.behaviors.forEach((v) => {
1645
1645
  v.type === Y.ParticleEmitter && y.id === u && (v._pendingBurst = (v._pendingBurst || 0) + m);
1646
1646
  });
@@ -1652,7 +1652,7 @@ class ci {
1652
1652
  break;
1653
1653
  }
1654
1654
  if (this.logicNodeValues.set(t, d), e.op === Ct.DELAY) {
1655
- const u = h("delay", 0), m = h("in", 0);
1655
+ const u = f("delay", 0), m = f("in", 0);
1656
1656
  let y = this.logicNodeState.get(t);
1657
1657
  for (y || (y = { queue: [] }, this.logicNodeState.set(t, y)), y.queue.push({ time: this.currentTime + u, value: m }); y.queue.length > 0 && y.queue[0].time <= this.currentTime; )
1658
1658
  y.lastValue = y.queue.shift().value;
@@ -1660,16 +1660,16 @@ class ci {
1660
1660
  }
1661
1661
  return d;
1662
1662
  }
1663
- const i = (c = this.activeStateMachine) == null ? void 0 : c.inputs.find((h) => h.id === t || h.name === t);
1663
+ const i = (c = this.activeStateMachine) == null ? void 0 : c.inputs.find((f) => f.id === t || f.name === t);
1664
1664
  if (i && i.sourceId && !o.has(i.sourceId)) {
1665
- const h = this.evaluateLogicTree(i.sourceId, i.sourceHandleId, o);
1666
- return this.inputs.set(i.id, h), h;
1665
+ const f = this.evaluateLogicTree(i.sourceId, i.sourceHandleId, o);
1666
+ return this.inputs.set(i.id, f), f;
1667
1667
  }
1668
1668
  let n = this.inputs.get(t) ?? (i ? this.inputs.get(i.id) : void 0);
1669
1669
  if ((this.justFiredTriggers.has(t) || i && this.justFiredTriggers.has(i.id)) && (n = !0), s && n !== void 0) {
1670
- const h = (g = this.activeStateMachine) == null ? void 0 : g.inputs.find((d) => d.id === t);
1671
- if (h && h.value.type === "Number" && typeof n == "number") {
1672
- const d = h.value.defaultValue ?? h.value.value;
1670
+ const f = (g = this.activeStateMachine) == null ? void 0 : g.inputs.find((d) => d.id === t);
1671
+ if (f && f.value.type === "Number" && typeof n == "number") {
1672
+ const d = f.value.defaultValue ?? f.value.value;
1673
1673
  if (s === "source-greater") return n > d;
1674
1674
  if (s === "source-less") return n < d;
1675
1675
  if (s === "source-equal") return n === d;
@@ -1735,13 +1735,13 @@ class ci {
1735
1735
  }), s.forEach((o) => {
1736
1736
  this.layerStates.delete(o), this.debugLog(`[Engine] Cleaned up completed global layer: ${o}`);
1737
1737
  }), this.solveConstraints(t), this.solveBehaviors(t), this.activeTriggers.forEach((o, e) => {
1738
- var i, n, a, r, l, f, c;
1738
+ var i, n, a, r, l, h, c;
1739
1739
  if (o.phase === "entry")
1740
1740
  o.time += t, o.time >= o.animation.duration && ((a = (n = (i = this.artboard) == null ? void 0 : i.objects.find((g) => g.id === e)) == null ? void 0 : n.triggers) == null || a.find((g) => g.id === o.triggerId), o.phase = "hold", o.elapsedHold = 0, o.time = o.animation.duration), this.applyAnimation(o.animation, o.time, o.filterObjectIds || o.filterObjectId || void 0);
1741
1741
  else if (o.phase === "hold") {
1742
- const g = (f = (l = (r = this.artboard) == null ? void 0 : r.objects.find((u) => u.id === e)) == null ? void 0 : l.triggers) == null ? void 0 : f.find((u) => u.id === o.triggerId), h = (g == null ? void 0 : g.duration) || 0;
1742
+ const g = (h = (l = (r = this.artboard) == null ? void 0 : r.objects.find((u) => u.id === e)) == null ? void 0 : l.triggers) == null ? void 0 : h.find((u) => u.id === o.triggerId), f = (g == null ? void 0 : g.duration) || 0;
1743
1743
  o.elapsedHold += t * 1e3;
1744
- let d = o.elapsedHold >= h;
1744
+ let d = o.elapsedHold >= f;
1745
1745
  if ((g == null ? void 0 : g.eventType) === "hover" && !this.activeHoverIds.has(e) && (d = !0), ((g == null ? void 0 : g.eventType) === "onHold" || (g == null ? void 0 : g.eventType) === "pointerDown") && !this.isMouseDown && (d = !0), d)
1746
1746
  if (g != null && g.exitAnimationId) {
1747
1747
  const u = (c = this.artboard) == null ? void 0 : c.animations.find((m) => m.id === g.exitAnimationId);
@@ -1758,8 +1758,8 @@ class ci {
1758
1758
  if (o && o.isEnabled && o.triggerType === "visible") {
1759
1759
  const a = this.objectStates.get(s.id);
1760
1760
  if (a && a.visible !== !1) {
1761
- const r = this.getGlobalTransform(s.id), l = (((i = s.geometry) == null ? void 0 : i.width) || 100) * (r.scale_x || 1), f = (((n = s.geometry) == null ? void 0 : n.height) || 100) * (r.scale_y || 1), c = 50, g = r.x + l / 2 >= -this.canvasWidth / 2 - c && r.x - l / 2 <= this.canvasWidth / 2 + c && r.y + f / 2 >= -this.canvasHeight / 2 - c && r.y - f / 2 <= this.canvasHeight / 2 + c, h = `analytics_${s.id}`, d = this.wasInView.has(h);
1762
- g && !d && this.fireAnalyticsEvent(s.id, "visible"), g ? this.wasInView.add(h) : this.wasInView.delete(h);
1761
+ const r = this.getGlobalTransform(s.id), l = (((i = s.geometry) == null ? void 0 : i.width) || 100) * (r.scale_x || 1), h = (((n = s.geometry) == null ? void 0 : n.height) || 100) * (r.scale_y || 1), c = 50, g = r.x + l / 2 >= -this.canvasWidth / 2 - c && r.x - l / 2 <= this.canvasWidth / 2 + c && r.y + h / 2 >= -this.canvasHeight / 2 - c && r.y - h / 2 <= this.canvasHeight / 2 + c, f = `analytics_${s.id}`, d = this.wasInView.has(f);
1762
+ g && !d && this.fireAnalyticsEvent(s.id, "visible"), g ? this.wasInView.add(f) : this.wasInView.delete(f);
1763
1763
  }
1764
1764
  }
1765
1765
  }), this.artboard.objects.forEach((s) => {
@@ -1767,7 +1767,7 @@ class ci {
1767
1767
  o.length !== 0 && o.forEach((e) => {
1768
1768
  const i = e.triggers || [e.event || e.trigger];
1769
1769
  i && i.forEach((n) => {
1770
- var r, l, f;
1770
+ var r, l, h;
1771
1771
  const a = n.toLowerCase();
1772
1772
  if (a === "on interval" || a === "oninterval") {
1773
1773
  const c = e.intervalValue || 2e3, g = this.periodicTriggerTimes.get(e.id) || 0;
@@ -1780,12 +1780,12 @@ class ci {
1780
1780
  if (a === "scroll into view" || a === "scrollintoview") {
1781
1781
  const c = this.objectStates.get(s.id);
1782
1782
  if (c && c.visible !== !1) {
1783
- const g = this.getGlobalTransform(s.id), h = (((r = s.geometry) == null ? void 0 : r.width) || 100) * (g.scale_x || 1), d = (((l = s.geometry) == null ? void 0 : l.height) || 100) * (g.scale_y || 1), u = 50, m = g.x + h / 2 >= -this.canvasWidth / 2 - u && g.x - h / 2 <= this.canvasWidth / 2 + u && g.y + d / 2 >= -this.canvasHeight / 2 - u && g.y - d / 2 <= this.canvasHeight / 2 + u, y = this.wasInView.has(s.id);
1783
+ const g = this.getGlobalTransform(s.id), f = (((r = s.geometry) == null ? void 0 : r.width) || 100) * (g.scale_x || 1), d = (((l = s.geometry) == null ? void 0 : l.height) || 100) * (g.scale_y || 1), u = 50, m = g.x + f / 2 >= -this.canvasWidth / 2 - u && g.x - f / 2 <= this.canvasWidth / 2 + u && g.y + d / 2 >= -this.canvasHeight / 2 - u && g.y - d / 2 <= this.canvasHeight / 2 + u, y = this.wasInView.has(s.id);
1784
1784
  m && !y && (!e.conditions || this.checkConditions(e.conditions)) && this.fireEventForObject(s.id, "Scroll Into View"), m ? this.wasInView.add(s.id) : this.wasInView.delete(s.id);
1785
1785
  }
1786
1786
  }
1787
1787
  if (a === "scroll progress" || a === "scrollprogress") {
1788
- const c = Math.abs(this.scrollOffset.y) / (((f = this.artboard) == null ? void 0 : f.height) || 1e3), g = this.scrollProgressLastValue.get(e.id) || 0;
1788
+ const c = Math.abs(this.scrollOffset.y) / (((h = this.artboard) == null ? void 0 : h.height) || 1e3), g = this.scrollProgressLastValue.get(e.id) || 0;
1789
1789
  Math.abs(c - g) > 1e-3 && (this.scrollProgressLastValue.set(e.id, c), (e.action === "Set Input" || e.action === "setInput") && this.updateInput(e.targetInputId, c));
1790
1790
  }
1791
1791
  });
@@ -1799,8 +1799,8 @@ class ci {
1799
1799
  if (!o) return;
1800
1800
  const e = this.getGlobalTransform(s.id);
1801
1801
  if (s.constraints.forEach((i, n) => {
1802
- var f, c, g, h, d, u, m, y, v;
1803
- const a = ((f = o.constraints) == null ? void 0 : f[n]) || {}, r = { ...i, ...a }, l = r.strength ?? 1;
1802
+ var h, c, g, f, d, u, m, y, v;
1803
+ const a = ((h = o.constraints) == null ? void 0 : h[n]) || {}, r = { ...i, ...a }, l = r.strength ?? 1;
1804
1804
  if (r.type === "Translation") {
1805
1805
  const b = this.getGlobalTransform(r.targetId);
1806
1806
  if (b) {
@@ -1838,7 +1838,7 @@ class ci {
1838
1838
  C > 180 && (C -= 360), C < -180 && (C += 360), e.rotation = e.rotation + C * l, e.scale_x = e.scale_x + (b.scale_x - e.scale_x) * l, e.scale_y = e.scale_y + (b.scale_y - e.scale_y) * l;
1839
1839
  }
1840
1840
  } else if (r.type === "FollowPointer") {
1841
- const b = ((h = this._lastPointerPos) == null ? void 0 : h.x) ?? e.x, C = ((d = this._lastPointerPos) == null ? void 0 : d.y) ?? e.y, S = r.useSpring;
1841
+ const b = ((f = this._lastPointerPos) == null ? void 0 : f.x) ?? e.x, C = ((d = this._lastPointerPos) == null ? void 0 : d.y) ?? e.y, S = r.useSpring;
1842
1842
  if (S) {
1843
1843
  const w = this.objectVelocities.get(s.id) || { vx: 0, vy: 0 }, { x: M, y: P, vx: T, vy: W } = this.computeSpring(e.x, e.y, w.vx, w.vy, b, C, r, t);
1844
1844
  e.x = M, e.y = P, this.objectVelocities.set(s.id, { vx: T, vy: W });
@@ -1897,7 +1897,7 @@ class ci {
1897
1897
  const F = Math.cos(P.angle), q = Math.sin(P.angle), Q = F * C.scale_x * W - q * C.scale_y * k, it = F * C.scale_x * k + q * C.scale_y * W;
1898
1898
  x = Math.atan2(it, Q) * 180 / Math.PI + (r.offsetRotation || 0);
1899
1899
  }
1900
- const A = x * Math.PI / 180, $ = Math.cos(A), O = Math.sin(A), V = (r.offsetX || 0) * $ - (r.offsetY || 0) * O, H = (r.offsetX || 0) * O + (r.offsetY || 0) * $, et = C.x + _ + V, E = C.y + L + H;
1900
+ const A = x * Math.PI / 180, $ = Math.cos(A), O = Math.sin(A), z = (r.offsetX || 0) * $ - (r.offsetY || 0) * O, H = (r.offsetX || 0) * O + (r.offsetY || 0) * $, et = C.x + _ + z, E = C.y + L + H;
1901
1901
  if (e.x = e.x + (et - e.x) * l, e.y = e.y + (E - e.y) * l, r.orient) {
1902
1902
  let F = (x - e.rotation) % 360;
1903
1903
  F > 180 && (F -= 360), F < -180 && (F += 360), e.rotation = e.rotation + F * l;
@@ -1915,30 +1915,30 @@ class ci {
1915
1915
  });
1916
1916
  }
1917
1917
  getGlobalTransform(t) {
1918
- var f;
1918
+ var u;
1919
1919
  const s = this.objectStates.get(t);
1920
1920
  if (!s) return { x: 0, y: 0, rotation: 0, scale_x: 1, scale_y: 1 };
1921
- const o = (f = this.artboard) == null ? void 0 : f.objects.find((c) => c.id === t);
1921
+ const o = (u = this.artboard) == null ? void 0 : u.objects.find((m) => m.id === t), e = this.getAnimatedValue(t, "x", s.x), i = this.getAnimatedValue(t, "y", s.y), n = this.getAnimatedValue(t, "rotation", s.rotation), a = this.getAnimatedValue(t, "scale_x", s.scale_x ?? 1) * (s.flip_x ? -1 : 1), r = this.getAnimatedValue(t, "scale_y", s.scale_y ?? 1) * (s.flip_y ? -1 : 1);
1922
1922
  if (!o || !o.parentId)
1923
1923
  return {
1924
- x: s.x,
1925
- y: s.y,
1926
- rotation: s.rotation,
1927
- scale_x: (s.scale_x ?? 1) * (s.flip_x ? -1 : 1),
1928
- scale_y: (s.scale_y ?? 1) * (s.flip_y ? -1 : 1)
1924
+ x: e,
1925
+ y: i,
1926
+ rotation: n,
1927
+ scale_x: a,
1928
+ scale_y: r
1929
1929
  };
1930
- const e = this.getGlobalTransform(o.parentId), i = e.rotation * Math.PI / 180, n = Math.cos(i), a = Math.sin(i), r = e.x + (s.x * e.scale_x * n - s.y * e.scale_y * a), l = e.y + (s.x * e.scale_x * a + s.y * e.scale_y * n);
1930
+ const l = this.getGlobalTransform(o.parentId), h = l.rotation * Math.PI / 180, c = Math.cos(h), g = Math.sin(h), f = l.x + (e * l.scale_x * c - i * l.scale_y * g), d = l.y + (e * l.scale_x * g + i * l.scale_y * c);
1931
1931
  return {
1932
- x: r,
1933
- y: l,
1934
- rotation: e.rotation + s.rotation,
1935
- scale_x: e.scale_x * (s.scale_x ?? 1) * (s.flip_x ? -1 : 1),
1936
- scale_y: e.scale_y * (s.scale_y ?? 1) * (s.flip_y ? -1 : 1)
1932
+ x: f,
1933
+ y: d,
1934
+ rotation: l.rotation + n,
1935
+ scale_x: l.scale_x * a,
1936
+ scale_y: l.scale_y * r
1937
1937
  };
1938
1938
  }
1939
1939
  globalToLocal(t, s) {
1940
1940
  if (!t) return s;
1941
- const o = this.getGlobalTransform(t), e = o.scale_x === 0 ? 0 : 1 / o.scale_x, i = o.scale_y === 0 ? 0 : 1 / o.scale_y, n = -o.rotation * Math.PI / 180, a = Math.cos(n), r = Math.sin(n), l = s.x - o.x, f = s.y - o.y, c = (l * a - f * r) * e, g = (l * r + f * a) * i;
1941
+ const o = this.getGlobalTransform(t), e = o.scale_x === 0 ? 0 : 1 / o.scale_x, i = o.scale_y === 0 ? 0 : 1 / o.scale_y, n = -o.rotation * Math.PI / 180, a = Math.cos(n), r = Math.sin(n), l = s.x - o.x, h = s.y - o.y, c = (l * a - h * r) * e, g = (l * r + h * a) * i;
1942
1942
  return {
1943
1943
  x: c,
1944
1944
  y: g,
@@ -1951,7 +1951,7 @@ class ci {
1951
1951
  var l;
1952
1952
  const i = [];
1953
1953
  let n = t.id;
1954
- for (let f = 0; f < o && n; f++) {
1954
+ for (let h = 0; h < o && n; h++) {
1955
1955
  const c = (l = this.artboard) == null ? void 0 : l.objects.find((g) => g.id === n);
1956
1956
  if (!c) break;
1957
1957
  i.push({
@@ -1962,22 +1962,22 @@ class ci {
1962
1962
  }
1963
1963
  if (i.length < 2) return;
1964
1964
  const a = i.reverse(), r = 5;
1965
- for (let f = 0; f < r; f++) {
1965
+ for (let h = 0; h < r; h++) {
1966
1966
  const c = this.getGlobalTransform(t.id);
1967
1967
  for (let g = a.length - 2; g >= 0; g--) {
1968
- const h = a[g], d = this.getGlobalTransform(h.id), u = c.x - d.x, m = c.y - d.y, y = s.x - d.x, v = s.y - d.y, b = Math.sqrt(u * u + m * m), C = Math.sqrt(y * y + v * v);
1968
+ const f = a[g], d = this.getGlobalTransform(f.id), u = c.x - d.x, m = c.y - d.y, y = s.x - d.x, v = s.y - d.y, b = Math.sqrt(u * u + m * m), C = Math.sqrt(y * y + v * v);
1969
1969
  if (b > 1e-3 && C > 1e-3) {
1970
1970
  const S = Math.atan2(m, u);
1971
1971
  let w = (Math.atan2(v, y) - S) * 180 / Math.PI;
1972
1972
  w *= e;
1973
- const M = this.objectStates.get(h.id);
1973
+ const M = this.objectStates.get(f.id);
1974
1974
  M && (M.rotation += w);
1975
1975
  }
1976
1976
  }
1977
1977
  }
1978
1978
  }
1979
1979
  computeSpring(t, s, o, e, i, n, a, r) {
1980
- const l = a.stiffness ?? 100, f = a.damping ?? 10, c = a.mass ?? 1, g = -l * (t - i), h = -l * (s - n), d = -f * o, u = -f * e, m = (g + d) / c, y = (h + u) / c, v = o + m * r, b = e + y * r, C = t + v * r, S = s + b * r;
1980
+ const l = a.stiffness ?? 100, h = a.damping ?? 10, c = a.mass ?? 1, g = -l * (t - i), f = -l * (s - n), d = -h * o, u = -h * e, m = (g + d) / c, y = (f + u) / c, v = o + m * r, b = e + y * r, C = t + v * r, S = s + b * r;
1981
1981
  return { x: C, y: S, vx: v, vy: b };
1982
1982
  }
1983
1983
  handlePointerInput(t, s, o, e, i) {
@@ -2001,22 +2001,22 @@ class ci {
2001
2001
  this._totalScroll.x += t, this._totalScroll.y += s, this.scrollOffset = { x: this._totalScroll.x, y: this._totalScroll.y }, this.updateInput("scrollX", this._totalScroll.x), this.updateInput("scrollY", this._totalScroll.y);
2002
2002
  }
2003
2003
  handlePointerEvent(t, s, o) {
2004
- var r, l, f, c, g;
2004
+ var r, l, h, c, g;
2005
2005
  if (!this.artboard) return;
2006
2006
  t === "down" ? (this.isMouseDown = !0, this.updateInput("isMouseDown", !0)) : (t === "up" || t === "blur") && (this.isMouseDown = !1, this.updateInput("isMouseDown", !1));
2007
2007
  let e = null;
2008
- const i = (h, d) => {
2008
+ const i = (f, d) => {
2009
2009
  var C;
2010
2010
  let u = d;
2011
2011
  d === "click" ? u = "onClick" : d === "down" ? u = "onPointerDown" : d === "up" ? u = "onPointerUp" : d === "blur" && (u = "onPointerLeave");
2012
2012
  const m = /* @__PURE__ */ new Set([u]);
2013
2013
  d === "move" && m.add("onPointerEnter").add("hover").add("onPointerLeave").add("blur"), u === "onClick" && m.add("click"), u === "onPointerDown" && m.add("pointerDown"), u === "onPointerUp" && m.add("pointerUp");
2014
2014
  const y = ["button", "toggle", "toggle_button", "dropdown", "listview", "inputbox", "slider", "checkbox", "radiogroup"];
2015
- return !!(h.type === "Component" && y.includes(h.variant) || y.includes((C = h.type) == null ? void 0 : C.toLowerCase()) || (h.interactions || []).some((S) => m.has(S.event)) || (h.triggers || []).some((S) => m.has(S.eventType)));
2015
+ return !!(f.type === "Component" && y.includes(f.variant) || y.includes((C = f.type) == null ? void 0 : C.toLowerCase()) || (f.interactions || []).some((S) => m.has(S.event)) || (f.triggers || []).some((S) => m.has(S.eventType)));
2016
2016
  };
2017
2017
  let n = null;
2018
- for (let h = this.artboard.objects.length - 1; h >= 0; h--) {
2019
- const d = this.artboard.objects[h], u = this.objectStates.get(d.id);
2018
+ for (let f = this.artboard.objects.length - 1; f >= 0; f--) {
2019
+ const d = this.artboard.objects[f], u = this.objectStates.get(d.id);
2020
2020
  if (u && u.visible !== !1 && u.opacity > 0 && this.hitTest(d, s, o) && (n || (n = d), i(d, t))) {
2021
2021
  e = d;
2022
2022
  break;
@@ -2026,31 +2026,31 @@ class ci {
2026
2026
  const a = (e == null ? void 0 : e.id) || null;
2027
2027
  if (t === "move") {
2028
2028
  if (this.draggingSliderId) {
2029
- const h = this.artboard.objects.find((d) => d.id === this.draggingSliderId);
2030
- h && this.updateSliderValueFromPointer(h, s, o);
2029
+ const f = this.artboard.objects.find((d) => d.id === this.draggingSliderId);
2030
+ f && this.updateSliderValueFromPointer(f, s, o);
2031
2031
  return;
2032
2032
  }
2033
2033
  if (this.draggingListViewId) {
2034
- const h = this.artboard.objects.find((d) => d.id === this.draggingListViewId);
2035
- h && this.updateListViewScrollFromPointer(h);
2034
+ const f = this.artboard.objects.find((d) => d.id === this.draggingListViewId);
2035
+ f && this.updateListViewScrollFromPointer(f);
2036
2036
  return;
2037
2037
  }
2038
2038
  e && e.type === "Component" && e.variant === "listview" && this.updateListViewHoverFromPointer(e, s, o), this.isMouseDown && a && this.fireEventForObject(a, "Drag"), a !== this.lastHoveredObjectId && (console.log(`[Engine] HOVER CHANGE: ${this.lastHoveredObjectId} -> ${a}`), this.lastHoveredObjectId && this.fireEventForObject(this.lastHoveredObjectId, "onPointerLeave"), a && this.fireEventForObject(a, "onPointerEnter"), this.lastHoveredObjectId = a);
2039
2039
  return;
2040
2040
  }
2041
- if ((t === "up" || t === "blur") && (this.draggingSliderId = null, this.draggingListViewId = null, this.draggingBehaviors.clear(), this.pointerDownTimes.delete(a), this.activeObjectId = null), t === "down" && (this.pointerDownTimes.set(a, this.currentTime), this.activeObjectId = a, e && ((r = e.behaviors) != null && r.some((h) => h.type === Y.Draggable)) && this.draggingBehaviors.add(a)), t === "move" ? (a && !this.activeHoverIds.has(a) && this.activeHoverIds.add(a), this.activeHoverIds.forEach((h) => {
2042
- h !== a && this.activeHoverIds.delete(h);
2041
+ if ((t === "up" || t === "blur") && (this.draggingSliderId = null, this.draggingListViewId = null, this.draggingBehaviors.clear(), this.pointerDownTimes.delete(a), this.activeObjectId = null), t === "down" && (this.pointerDownTimes.set(a, this.currentTime), this.activeObjectId = a, e && ((r = e.behaviors) != null && r.some((f) => f.type === Y.Draggable)) && this.draggingBehaviors.add(a)), t === "move" ? (a && !this.activeHoverIds.has(a) && this.activeHoverIds.add(a), this.activeHoverIds.forEach((f) => {
2042
+ f !== a && this.activeHoverIds.delete(f);
2043
2043
  })) : t === "blur" && this.activeHoverIds.clear(), this.activeDropdownId && t === "down") {
2044
- const h = this.artboard.objects.find((d) => d.id === this.activeDropdownId);
2045
- if (h && (h.type === "Dropdown" || h.variant === "dropdown")) {
2046
- const d = this.objectStates.get(h.id), u = (d == null ? void 0 : d.options) || h.options || {}, m = h.geometry || {}, y = m.width ?? h.width ?? 200, v = m.height ?? h.height ?? 40, b = u.optionsList || [], C = u.itemHeight || 32, S = u.listPadding ?? 4, I = b.length * C + S * 2, w = this.getWorldTransform(h.id), M = y * Math.abs(w.scaleX), P = v * Math.abs(w.scaleY), T = w.y + P / 2 + 4, W = Math.abs(s - w.x) <= M / 2, k = o >= T && o <= T + I * Math.abs(w.scaleY);
2044
+ const f = this.artboard.objects.find((d) => d.id === this.activeDropdownId);
2045
+ if (f && (f.type === "Dropdown" || f.variant === "dropdown")) {
2046
+ const d = this.objectStates.get(f.id), u = (d == null ? void 0 : d.options) || f.options || {}, m = f.geometry || {}, y = m.width ?? f.width ?? 200, v = m.height ?? f.height ?? 40, b = u.optionsList || [], C = u.itemHeight || 32, S = u.listPadding ?? 4, I = b.length * C + S * 2, w = this.getWorldTransform(f.id), M = y * Math.abs(w.scaleX), P = v * Math.abs(w.scaleY), T = w.y + P / 2 + 4, W = Math.abs(s - w.x) <= M / 2, k = o >= T && o <= T + I * Math.abs(w.scaleY);
2047
2047
  if (W && k) {
2048
2048
  const _ = Math.abs(w.scaleY), L = o - (T + S * _), x = Math.floor(L / (C * _));
2049
2049
  if (x >= 0 && x < b.length) {
2050
2050
  const A = b[x];
2051
- u.selectedOption = A, u.isOpen = !1, this.activeDropdownId = null, h.inputId && this.setInternalInput(h.inputId, A), this.onComponentChange && this.onComponentChange({
2052
- objectId: h.id,
2053
- componentName: h.name,
2051
+ u.selectedOption = A, u.isOpen = !1, this.activeDropdownId = null, f.inputId && this.setInternalInput(f.inputId, A), this.onComponentChange && this.onComponentChange({
2052
+ objectId: f.id,
2053
+ componentName: f.name,
2054
2054
  variant: "dropdown",
2055
2055
  property: "selectedOption",
2056
2056
  value: A
@@ -2061,99 +2061,99 @@ class ci {
2061
2061
  }
2062
2062
  }
2063
2063
  if (e) {
2064
- let h = e, d = e;
2064
+ let f = e, d = e;
2065
2065
  for (; d && d.parentId; ) {
2066
2066
  const m = this.artboard.objects.find((y) => y.id === d.parentId);
2067
2067
  if (m && m.type === "Component") {
2068
- h = m;
2068
+ f = m;
2069
2069
  break;
2070
2070
  }
2071
2071
  d = m;
2072
2072
  }
2073
2073
  let u = t;
2074
- if (t === "click" ? u = "onClick" : t === "down" ? u = "onPointerDown" : t === "up" ? u = "onPointerUp" : t === "blur" && (u = "onPointerLeave"), this.fireEventForObject(e.id, u), h !== e && this.fireEventForObject(h.id, u), h.type === "Component" && h.variant === "toggle_button" && t === "down") {
2075
- const m = this.objectStates.get(h.id), y = (m == null ? void 0 : m.options) || h.options || {};
2076
- y.checked = !y.checked, h.inputId && this.setInternalInput(h.inputId, y.checked), this.onComponentChange && this.onComponentChange({
2077
- objectId: h.id,
2078
- componentName: h.name,
2074
+ if (t === "click" ? u = "onClick" : t === "down" ? u = "onPointerDown" : t === "up" ? u = "onPointerUp" : t === "blur" && (u = "onPointerLeave"), this.fireEventForObject(e.id, u), f !== e && this.fireEventForObject(f.id, u), f.type === "Component" && f.variant === "toggle_button" && t === "down") {
2075
+ const m = this.objectStates.get(f.id), y = (m == null ? void 0 : m.options) || f.options || {};
2076
+ y.checked = !y.checked, f.inputId && this.setInternalInput(f.inputId, y.checked), this.onComponentChange && this.onComponentChange({
2077
+ objectId: f.id,
2078
+ componentName: f.name,
2079
2079
  variant: "toggle_button",
2080
2080
  property: "checked",
2081
2081
  value: y.checked
2082
- }), this.fireEventForObject(h.id, "Toggle"), this.fireEventForObject(h.id, y.checked ? "Toggle True" : "Toggle False");
2082
+ }), this.fireEventForObject(f.id, "Toggle"), this.fireEventForObject(f.id, y.checked ? "Toggle True" : "Toggle False");
2083
2083
  }
2084
- if (h.type === "Component" && h.variant === "toggle" && t === "down") {
2085
- const m = this.objectStates.get(h.id), y = (m == null ? void 0 : m.options) || h.options || {};
2086
- y.checked = !y.checked, h.inputId && this.setInternalInput(h.inputId, y.checked), this.onComponentChange && this.onComponentChange({
2087
- objectId: h.id,
2088
- componentName: h.name,
2084
+ if (f.type === "Component" && f.variant === "toggle" && t === "down") {
2085
+ const m = this.objectStates.get(f.id), y = (m == null ? void 0 : m.options) || f.options || {};
2086
+ y.checked = !y.checked, f.inputId && this.setInternalInput(f.inputId, y.checked), this.onComponentChange && this.onComponentChange({
2087
+ objectId: f.id,
2088
+ componentName: f.name,
2089
2089
  variant: "toggle",
2090
2090
  property: "checked",
2091
2091
  value: y.checked
2092
- }), this.onToggle && this.onToggle(h.name, y.checked), this.fireEventForObject(h.id, "Toggle"), this.fireEventForObject(h.id, y.checked ? "Toggle True" : "Toggle False");
2092
+ }), this.onToggle && this.onToggle(f.name, y.checked), this.fireEventForObject(f.id, "Toggle"), this.fireEventForObject(f.id, y.checked ? "Toggle True" : "Toggle False");
2093
2093
  }
2094
- if (h.type === "Component" && h.variant === "dropdown" && t === "down") {
2095
- const m = this.objectStates.get(h.id), y = (m == null ? void 0 : m.options) || h.options || {}, v = !y.isOpen;
2096
- if (v && this.activeDropdownId && this.activeDropdownId !== h.id) {
2094
+ if (f.type === "Component" && f.variant === "dropdown" && t === "down") {
2095
+ const m = this.objectStates.get(f.id), y = (m == null ? void 0 : m.options) || f.options || {}, v = !y.isOpen;
2096
+ if (v && this.activeDropdownId && this.activeDropdownId !== f.id) {
2097
2097
  const b = this.artboard.objects.find((C) => C.id === this.activeDropdownId);
2098
2098
  b && b.options && (b.options.isOpen = !1);
2099
2099
  }
2100
- y.isOpen = v, this.activeDropdownId = v ? h.id : null;
2100
+ y.isOpen = v, this.activeDropdownId = v ? f.id : null;
2101
2101
  }
2102
- if (h.type === "Component" && h.variant === "button" && t === "down" && (this.onButtonClick && this.onButtonClick(h.name, h.id), this.onComponentChange && this.onComponentChange({
2103
- objectId: h.id,
2104
- componentName: h.name,
2102
+ if (f.type === "Component" && f.variant === "button" && t === "down" && (this.onButtonClick && this.onButtonClick(f.name, f.id), this.onComponentChange && this.onComponentChange({
2103
+ objectId: f.id,
2104
+ componentName: f.name,
2105
2105
  variant: "button",
2106
2106
  property: "click",
2107
2107
  value: !0
2108
- })), h.type === "Component" && h.variant === "listview" && t === "down") {
2109
- this.draggingListViewId = h.id;
2110
- const m = this.getListViewItemIndexAtPointer(h, s, o);
2108
+ })), f.type === "Component" && f.variant === "listview" && t === "down") {
2109
+ this.draggingListViewId = f.id;
2110
+ const m = this.getListViewItemIndexAtPointer(f, s, o);
2111
2111
  if (m !== null) {
2112
- const y = h.options || {};
2112
+ const y = f.options || {};
2113
2113
  y.activeItemIndex = m;
2114
- const v = this.objectStates.get(h.id);
2114
+ const v = this.objectStates.get(f.id);
2115
2115
  v && v.options && (v.options.activeItemIndex = m);
2116
2116
  const b = (y.items || [])[m], C = typeof b == "string" ? b : b.label || b.value || m;
2117
- v && v.options && (v.options.selectedValue = C), h.inputId && this.setInternalInput(h.inputId, C), this.onComponentChange && (this.onComponentChange({
2118
- objectId: h.id,
2119
- componentName: h.name,
2117
+ v && v.options && (v.options.selectedValue = C), f.inputId && this.setInternalInput(f.inputId, C), this.onComponentChange && (this.onComponentChange({
2118
+ objectId: f.id,
2119
+ componentName: f.name,
2120
2120
  variant: "listview",
2121
2121
  property: "activeItemIndex",
2122
2122
  value: m
2123
2123
  }), this.onComponentChange({
2124
- objectId: h.id,
2125
- componentName: h.name,
2124
+ objectId: f.id,
2125
+ componentName: f.name,
2126
2126
  variant: "listview",
2127
2127
  property: "selected",
2128
2128
  value: C
2129
2129
  }));
2130
2130
  }
2131
2131
  }
2132
- if (h.type === "Component" && h.variant === "slider" && t === "down" && (this.draggingSliderId = h.id, this.updateSliderValueFromPointer(h, s, o)), h.type === "Component" && h.variant === "checkbox" && t === "down") {
2133
- const m = this.objectStates.get(h.id), y = (m == null ? void 0 : m.options) || h.options || {};
2134
- y.checked = !y.checked, h.inputId && this.setInternalInput(h.inputId, y.checked), this.onComponentChange && this.onComponentChange({
2135
- objectId: h.id,
2136
- componentName: h.name,
2132
+ if (f.type === "Component" && f.variant === "slider" && t === "down" && (this.draggingSliderId = f.id, this.updateSliderValueFromPointer(f, s, o)), f.type === "Component" && f.variant === "checkbox" && t === "down") {
2133
+ const m = this.objectStates.get(f.id), y = (m == null ? void 0 : m.options) || f.options || {};
2134
+ y.checked = !y.checked, f.inputId && this.setInternalInput(f.inputId, y.checked), this.onComponentChange && this.onComponentChange({
2135
+ objectId: f.id,
2136
+ componentName: f.name,
2137
2137
  variant: "checkbox",
2138
2138
  property: "checked",
2139
2139
  value: y.checked
2140
- }), this.fireEventForObject(h.id, "Click"), this.fireEventForObject(h.id, y.checked ? "Checked" : "Unchecked");
2140
+ }), this.fireEventForObject(f.id, "Click"), this.fireEventForObject(f.id, y.checked ? "Checked" : "Unchecked");
2141
2141
  }
2142
- if (h.type === "Component" && h.variant === "radiogroup" && t === "down") {
2143
- const m = this.objectStates.get(h.id), y = (m == null ? void 0 : m.options) || h.options || {}, v = y.optionsList || [], b = this.getRadioGroupItemIndexAtPointer(h, s, o);
2142
+ if (f.type === "Component" && f.variant === "radiogroup" && t === "down") {
2143
+ const m = this.objectStates.get(f.id), y = (m == null ? void 0 : m.options) || f.options || {}, v = y.optionsList || [], b = this.getRadioGroupItemIndexAtPointer(f, s, o);
2144
2144
  if (b !== null && b >= 0 && b < v.length) {
2145
2145
  const C = v[b];
2146
- y.selectedValue = C, h.inputId && this.setInternalInput(h.inputId, C), this.onComponentChange && this.onComponentChange({
2147
- objectId: h.id,
2148
- componentName: h.name,
2146
+ y.selectedValue = C, f.inputId && this.setInternalInput(f.inputId, C), this.onComponentChange && this.onComponentChange({
2147
+ objectId: f.id,
2148
+ componentName: f.name,
2149
2149
  variant: "radiogroup",
2150
2150
  property: "selectedValue",
2151
2151
  value: C
2152
- }), this.fireEventForObject(h.id, "Click"), this.fireEventForObject(h.id, `Selected: ${C}`);
2152
+ }), this.fireEventForObject(f.id, "Click"), this.fireEventForObject(f.id, `Selected: ${C}`);
2153
2153
  }
2154
2154
  }
2155
- if (h.type === "LineGraph" && (t === "down" || t === "click")) {
2156
- const m = h.geometry, y = (m == null ? void 0 : m.datasets) || [], v = this.objectStates.get(h.id), b = (v == null ? void 0 : v.width) || (m == null ? void 0 : m.width) || 200, C = (v == null ? void 0 : v.height) || (m == null ? void 0 : m.height) || 150, S = this.getWorldTransform(h.id), I = 30, w = 20, M = b - I, P = C - w;
2155
+ if (f.type === "LineGraph" && (t === "down" || t === "click")) {
2156
+ const m = f.geometry, y = (m == null ? void 0 : m.datasets) || [], v = this.objectStates.get(f.id), b = (v == null ? void 0 : v.width) || (m == null ? void 0 : m.width) || 200, C = (v == null ? void 0 : v.height) || (m == null ? void 0 : m.height) || 150, S = this.getWorldTransform(f.id), I = 30, w = 20, M = b - I, P = C - w;
2157
2157
  let T = 1;
2158
2158
  y.forEach((_) => {
2159
2159
  const L = Math.max(..._.data || [0]);
@@ -2163,17 +2163,17 @@ class ci {
2163
2163
  y.forEach((_, L) => {
2164
2164
  const x = _.data || [], A = M / Math.max(x.length - 1, 1);
2165
2165
  x.forEach(($, O) => {
2166
- const V = S.x - b / 2 + I + O * A, H = S.y + C / 2 - w - $ / T * P, et = Math.sqrt((s - V) ** 2 + (o - H) ** 2);
2166
+ const z = S.x - b / 2 + I + O * A, H = S.y + C / 2 - w - $ / T * P, et = Math.sqrt((s - z) ** 2 + (o - H) ** 2);
2167
2167
  et < W && (W = et, k = { dIdx: L, pIdx: O, val: $, label: _.label || `Dataset ${L + 1}` });
2168
2168
  });
2169
- }), k && W < 20 && this.onGraphPointClick && this.onGraphPointClick({ objectId: h.id, componentName: h.name, datasetIndex: k.dIdx, pointIndex: k.pIdx, value: k.val, label: k.label }), this.onComponentChange && this.onComponentChange({ objectId: h.id, componentName: h.name, variant: "linegraph", property: "click", value: (k == null ? void 0 : k.val) ?? null });
2169
+ }), k && W < 20 && this.onGraphPointClick && this.onGraphPointClick({ objectId: f.id, componentName: f.name, datasetIndex: k.dIdx, pointIndex: k.pIdx, value: k.val, label: k.label }), this.onComponentChange && this.onComponentChange({ objectId: f.id, componentName: f.name, variant: "linegraph", property: "click", value: (k == null ? void 0 : k.val) ?? null });
2170
2170
  }
2171
2171
  if (t === "click") {
2172
2172
  const m = (l = this.artboard) == null ? void 0 : l.objects.find((b) => b.id === e.id), y = this.focusedId, v = (m == null ? void 0 : m.type) === "InputBox" || (m == null ? void 0 : m.type) === "Component" && m.variant === "inputbox";
2173
2173
  if (m && v) {
2174
2174
  if (this.focusedId = e.id, console.log(`[Engine] Focus set to: ${e.id}`), y !== this.focusedId) {
2175
2175
  if (y) {
2176
- const b = (f = this.artboard) == null ? void 0 : f.objects.find((C) => C.id === y);
2176
+ const b = (h = this.artboard) == null ? void 0 : h.objects.find((C) => C.id === y);
2177
2177
  b && this.onInputBlur && this.onInputBlur(b.name);
2178
2178
  }
2179
2179
  this.onInputFocus && this.onInputFocus(m.name);
@@ -2184,9 +2184,9 @@ class ci {
2184
2184
  }
2185
2185
  }
2186
2186
  } else if (t === "click") {
2187
- const h = this.focusedId;
2188
- if (this.focusedId = null, h) {
2189
- const d = (g = this.artboard) == null ? void 0 : g.objects.find((u) => u.id === h);
2187
+ const f = this.focusedId;
2188
+ if (this.focusedId = null, f) {
2189
+ const d = (g = this.artboard) == null ? void 0 : g.objects.find((u) => u.id === f);
2190
2190
  d && this.onInputBlur && this.onInputBlur(d.name);
2191
2191
  }
2192
2192
  }
@@ -2222,8 +2222,8 @@ class ci {
2222
2222
  }), this.onInputChange && this.onInputChange(s.name, i), this.onInputUpdate && this.onInputUpdate(this.focusedId, i);
2223
2223
  }
2224
2224
  fireEventForObject(t, s) {
2225
- var f, c, g, h, d;
2226
- const o = (f = this.artboard) == null ? void 0 : f.objects.find((u) => u.id === t);
2225
+ var h, c, g, f, d;
2226
+ const o = (h = this.artboard) == null ? void 0 : h.objects.find((u) => u.id === t);
2227
2227
  if (!o) return;
2228
2228
  const e = /* @__PURE__ */ new Set([s, s.toLowerCase()]), i = s.toLowerCase();
2229
2229
  i === "onclick" || i === "click" || i === "onpointerdown" || i === "pointerdown" ? this.fireAnalyticsEvent(t, "click") : (i === "onpointerenter" || i === "hover" || i === "move") && this.fireAnalyticsEvent(t, "hover"), i === "onclick" || i === "click" ? (e.add("click"), e.add("onclick")) : i === "onpointerdown" || i === "pointerdown" ? (e.add("pointerdown"), e.add("onpointerdown")) : i === "onpointerup" || i === "pointerup" ? (e.add("pointerup"), e.add("onpointerup")) : i === "onpointerenter" || i === "hover" || i === "move" ? (e.add("hover"), e.add("onpointerenter")) : i === "onpointerleave" || i === "blur" ? (e.add("onpointerleave"), e.add("blur")) : i === "drag" || i === "ondrag" ? (e.add("drag"), e.add("ondrag")) : i === "toggle" || i === "ontoggle" ? (e.add("toggle"), e.add("ontoggle")) : i === "toggle true" || i === "toggle_true" || i === "toggletrue" ? (e.add("toggle true"), e.add("toggle_true"), e.add("toggletrue")) : (i === "toggle false" || i === "toggle_false" || i === "togglefalse") && (e.add("toggle false"), e.add("toggle_false"), e.add("togglefalse"));
@@ -2277,7 +2277,7 @@ class ci {
2277
2277
  });
2278
2278
  if (l && l.entryAnimationId) {
2279
2279
  console.log(`[Engine] Trigger matched: ${s} (as ${l.eventType}) -> Animation ${l.entryAnimationId}`);
2280
- const u = (d = (h = this.artboard) == null ? void 0 : h.animations) == null ? void 0 : d.find((m) => m.id === l.entryAnimationId);
2280
+ const u = (d = (f = this.artboard) == null ? void 0 : f.animations) == null ? void 0 : d.find((m) => m.id === l.entryAnimationId);
2281
2281
  u && (this.activeTriggers.set(o.id, {
2282
2282
  triggerId: l.id,
2283
2283
  animation: u,
@@ -2290,31 +2290,31 @@ class ci {
2290
2290
  }
2291
2291
  fireAnalyticsEvent(t, s) {
2292
2292
  var r, l;
2293
- const o = (r = this.artboard) == null ? void 0 : r.objects.find((f) => f.id === t);
2293
+ const o = (r = this.artboard) == null ? void 0 : r.objects.find((h) => h.id === t);
2294
2294
  if (!o) return;
2295
2295
  const e = (l = o.style) == null ? void 0 : l.analytics;
2296
2296
  if (!e || !e.isEnabled || e.triggerType !== s) return;
2297
2297
  const i = e.eventName || `${o.name.toLowerCase().replace(/\s+/g, "_")}_interacted`, n = {};
2298
- e.parameters && Array.isArray(e.parameters) && e.parameters.forEach((f) => {
2299
- if (f.type === "literal")
2300
- n[f.key] = f.value;
2301
- else if (f.type === "variable") {
2302
- const c = this.inputs.get(f.value);
2303
- n[f.key] = c !== void 0 ? c : "";
2298
+ e.parameters && Array.isArray(e.parameters) && e.parameters.forEach((h) => {
2299
+ if (h.type === "literal")
2300
+ n[h.key] = h.value;
2301
+ else if (h.type === "variable") {
2302
+ const c = this.inputs.get(h.value);
2303
+ n[h.key] = c !== void 0 ? c : "";
2304
2304
  }
2305
2305
  }), console.log(`[ExodeUI Analytics] Dispatching event "${i}" via ${s} trigger:`, n);
2306
2306
  const a = e.platforms || { ga4: !0, meta: !0, mixpanel: !1 };
2307
2307
  if (a.ga4) {
2308
- const f = window;
2309
- typeof f.gtag == "function" ? (f.gtag("event", i, n), console.log(`[ExodeUI Analytics] GA4: Event "${i}" sent successfully.`)) : console.warn(`[ExodeUI Analytics] GA4: window.gtag is not a function. Event "${i}" skipped.`);
2308
+ const h = window;
2309
+ typeof h.gtag == "function" ? (h.gtag("event", i, n), console.log(`[ExodeUI Analytics] GA4: Event "${i}" sent successfully.`)) : console.warn(`[ExodeUI Analytics] GA4: window.gtag is not a function. Event "${i}" skipped.`);
2310
2310
  }
2311
2311
  if (a.meta) {
2312
- const f = window;
2313
- typeof f.fbq == "function" ? (f.fbq("track", i, n), console.log(`[ExodeUI Analytics] Meta Pixel: Event "${i}" sent successfully.`)) : console.warn(`[ExodeUI Analytics] Meta Pixel: window.fbq is not a function. Event "${i}" skipped.`);
2312
+ const h = window;
2313
+ typeof h.fbq == "function" ? (h.fbq("track", i, n), console.log(`[ExodeUI Analytics] Meta Pixel: Event "${i}" sent successfully.`)) : console.warn(`[ExodeUI Analytics] Meta Pixel: window.fbq is not a function. Event "${i}" skipped.`);
2314
2314
  }
2315
2315
  if (a.mixpanel) {
2316
- const f = window;
2317
- f.mixpanel && typeof f.mixpanel.track == "function" ? (f.mixpanel.track(i, n), console.log(`[ExodeUI Analytics] Mixpanel: Event "${i}" sent successfully.`)) : console.warn(`[ExodeUI Analytics] Mixpanel: window.mixpanel.track is not a function. Event "${i}" skipped.`);
2316
+ const h = window;
2317
+ h.mixpanel && typeof h.mixpanel.track == "function" ? (h.mixpanel.track(i, n), console.log(`[ExodeUI Analytics] Mixpanel: Event "${i}" sent successfully.`)) : console.warn(`[ExodeUI Analytics] Mixpanel: window.mixpanel.track is not a function. Event "${i}" skipped.`);
2318
2318
  }
2319
2319
  }
2320
2320
  initGlobalAnimationTriggers() {
@@ -2355,7 +2355,7 @@ class ci {
2355
2355
  var g;
2356
2356
  const s = this.objectStates.get(t);
2357
2357
  if (!s) return { x: 0, y: 0, scaleX: 1, scaleY: 1, rotation: 0 };
2358
- const o = (g = this.artboard) == null ? void 0 : g.objects.find((h) => h.id === t);
2358
+ const o = (g = this.artboard) == null ? void 0 : g.objects.find((f) => f.id === t);
2359
2359
  if (!o || !o.parentId)
2360
2360
  return {
2361
2361
  x: s.x,
@@ -2364,9 +2364,9 @@ class ci {
2364
2364
  scaleY: s.scale_y ?? 1,
2365
2365
  rotation: s.rotation ?? 0
2366
2366
  };
2367
- const e = this.getWorldTransform(o.parentId), i = e.rotation * (Math.PI / 180), n = Math.cos(i), a = Math.sin(i), r = s.x * e.scaleX, l = s.y * e.scaleY, f = e.x + (r * n - l * a), c = e.y + (r * a + l * n);
2367
+ const e = this.getWorldTransform(o.parentId), i = e.rotation * (Math.PI / 180), n = Math.cos(i), a = Math.sin(i), r = s.x * e.scaleX, l = s.y * e.scaleY, h = e.x + (r * n - l * a), c = e.y + (r * a + l * n);
2368
2368
  return {
2369
- x: f,
2369
+ x: h,
2370
2370
  y: c,
2371
2371
  scaleX: (s.scale_x ?? 1) * e.scaleX,
2372
2372
  scaleY: (s.scale_y ?? 1) * e.scaleY,
@@ -2376,15 +2376,15 @@ class ci {
2376
2376
  hitTest(t, s, o) {
2377
2377
  var b, C;
2378
2378
  if (!this.objectStates.get(t.id)) return !1;
2379
- const i = ((b = t.geometry) == null ? void 0 : b.width) ?? t.width ?? 100, n = ((C = t.geometry) == null ? void 0 : C.height) ?? t.height ?? 100, a = this.getWorldTransform(t.id), r = s - a.x, l = o - a.y, f = -a.rotation * (Math.PI / 180), c = Math.cos(f), g = Math.sin(f), h = r * c - l * g, d = r * g + l * c, u = a.scaleX, m = a.scaleY, y = i * Math.abs(u), v = n * Math.abs(m);
2380
- return Math.abs(h) <= y / 2 && Math.abs(d) <= v / 2;
2379
+ const i = ((b = t.geometry) == null ? void 0 : b.width) ?? t.width ?? 100, n = ((C = t.geometry) == null ? void 0 : C.height) ?? t.height ?? 100, a = this.getWorldTransform(t.id), r = s - a.x, l = o - a.y, h = -a.rotation * (Math.PI / 180), c = Math.cos(h), g = Math.sin(h), f = r * c - l * g, d = r * g + l * c, u = a.scaleX, m = a.scaleY, y = i * Math.abs(u), v = n * Math.abs(m);
2380
+ return Math.abs(f) <= y / 2 && Math.abs(d) <= v / 2;
2381
2381
  }
2382
2382
  updateSliderValueFromPointer(t, s, o) {
2383
2383
  var w;
2384
2384
  const e = this.objectStates.get(t.id);
2385
2385
  if (!e) return;
2386
- const i = t.options || {}, n = ((w = t.geometry) == null ? void 0 : w.width) ?? t.width ?? 200, a = this.getWorldTransform(t.id), r = s - a.x, l = o - a.y, f = -a.rotation * (Math.PI / 180), c = Math.cos(f), g = Math.sin(f), h = r * c - l * g, d = i.thumbWidth ?? 16, u = n - d;
2387
- let y = (h + u / 2) / u;
2386
+ const i = t.options || {}, n = ((w = t.geometry) == null ? void 0 : w.width) ?? t.width ?? 200, a = this.getWorldTransform(t.id), r = s - a.x, l = o - a.y, h = -a.rotation * (Math.PI / 180), c = Math.cos(h), g = Math.sin(h), f = r * c - l * g, d = i.thumbWidth ?? 16, u = n - d;
2387
+ let y = (f + u / 2) / u;
2388
2388
  y = Math.max(0, Math.min(1, y));
2389
2389
  const v = i.min ?? 0, b = i.max ?? 100, C = i.step || 1;
2390
2390
  let S = v + y * (b - v);
@@ -2400,7 +2400,7 @@ class ci {
2400
2400
  }
2401
2401
  applyAnimation(t, s, o) {
2402
2402
  !t || !t.tracks || t.tracks.forEach((e) => {
2403
- var c, g, h;
2403
+ var c, g, f;
2404
2404
  const i = e.object_id || e.objectId;
2405
2405
  if (o) {
2406
2406
  if (Array.isArray(o)) {
@@ -2417,10 +2417,10 @@ class ci {
2417
2417
  this.frameCount % 600 === 0 && this.debugLog(`Skipping track: Object ${i} not found in state`);
2418
2418
  return;
2419
2419
  }
2420
- const f = this.interpolate(e.keyframes, s);
2421
- if (f !== void 0) {
2420
+ const h = this.interpolate(e.keyframes, s);
2421
+ if (h !== void 0) {
2422
2422
  if (this.frameCount % 240 === 0) {
2423
- const d = (n == null ? void 0 : n.name) || i, u = typeof f == "object" ? JSON.stringify(f).slice(0, 50) : f;
2423
+ const d = (n == null ? void 0 : n.name) || i, u = typeof h == "object" ? JSON.stringify(h).slice(0, 50) : h;
2424
2424
  this.debugLog(`[Anim] Applying ${r} = ${u} to ${d}`);
2425
2425
  }
2426
2426
  if (r.includes(".")) {
@@ -2439,17 +2439,17 @@ class ci {
2439
2439
  }
2440
2440
  u = u[d[m]];
2441
2441
  }
2442
- u[d[d.length - 1]] = f, d[d.length - 1] === "color" && (d[d.length - 2] === "fill" || d[d.length - 2] === "stroke") && (u.type = "Solid");
2442
+ u[d[d.length - 1]] = h, d[d.length - 1] === "color" && (d[d.length - 2] === "fill" || d[d.length - 2] === "stroke") && (u.type = "Solid");
2443
2443
  } else
2444
- r === "fill" ? (l.style || (l.style = {}), l.style.fill = f) : r === "stroke" ? (l.style || (l.style = {}), l.style.stroke = f) : l[r] = f;
2445
- if (this.physicsEngine && ((h = n == null ? void 0 : n.physics) != null && h.enabled) && n.physics.bodyType === "Static")
2444
+ r === "fill" ? (l.style || (l.style = {}), l.style.fill = h) : r === "stroke" ? (l.style || (l.style = {}), l.style.stroke = h) : l[r] = h;
2445
+ if (this.physicsEngine && ((f = n == null ? void 0 : n.physics) != null && f.enabled) && n.physics.bodyType === "Static")
2446
2446
  if (r === "x") {
2447
2447
  const d = this.physicsEngine.getPosition(i);
2448
- d && this.physicsEngine.setPosition(i, f, d.y);
2448
+ d && this.physicsEngine.setPosition(i, h, d.y);
2449
2449
  } else if (r === "y") {
2450
2450
  const d = this.physicsEngine.getPosition(i);
2451
- d && this.physicsEngine.setPosition(i, d.x, f);
2452
- } else r === "rotation" && this.physicsEngine.setRotation(i, f * (Math.PI / 180));
2451
+ d && this.physicsEngine.setPosition(i, d.x, h);
2452
+ } else r === "rotation" && this.physicsEngine.setRotation(i, h * (Math.PI / 180));
2453
2453
  }
2454
2454
  });
2455
2455
  }
@@ -2483,8 +2483,8 @@ class ci {
2483
2483
  return this.interpolateFill(o.value, e.value, n);
2484
2484
  const a = {};
2485
2485
  return (/* @__PURE__ */ new Set([...Object.keys(o.value), ...Object.keys(e.value)])).forEach((l) => {
2486
- const f = o.value[l], c = e.value[l];
2487
- typeof f == "number" && typeof c == "number" ? a[l] = f + (c - f) * n : f === void 0 ? a[l] = c : c === void 0 ? a[l] = f : a[l] = n < 0.5 ? f : c;
2486
+ const h = o.value[l], c = e.value[l];
2487
+ typeof h == "number" && typeof c == "number" ? a[l] = h + (c - h) * n : h === void 0 ? a[l] = c : c === void 0 ? a[l] = h : a[l] = n < 0.5 ? h : c;
2488
2488
  }), a;
2489
2489
  }
2490
2490
  return typeof o.value == "number" && typeof e.value == "number" ? o.value + (e.value - o.value) * n : n < 0.5 ? o.value : e.value;
@@ -2503,11 +2503,11 @@ class ci {
2503
2503
  g: parseInt(y.substring(2, 4), 16),
2504
2504
  b: parseInt(y.substring(4, 6), 16)
2505
2505
  };
2506
- }, r = a(i), l = a(n), f = Math.round(r.r + (l.r - r.r) * o), c = Math.round(r.g + (l.g - r.g) * o), g = Math.round(r.b + (l.b - r.b) * o), h = (m) => {
2506
+ }, r = a(i), l = a(n), h = Math.round(r.r + (l.r - r.r) * o), c = Math.round(r.g + (l.g - r.g) * o), g = Math.round(r.b + (l.b - r.b) * o), f = (m) => {
2507
2507
  const y = Math.max(0, Math.min(255, m)).toString(16);
2508
2508
  return y.length === 1 ? "0" + y : y;
2509
2509
  };
2510
- return `#${h(f)}${h(c)}${h(g)}`;
2510
+ return `#${f(h)}${f(c)}${f(g)}`;
2511
2511
  }
2512
2512
  interpolateStops(t, s, o) {
2513
2513
  return !t || !s || t.length !== s.length ? o < 0.5 ? t : s : t.map((e, i) => {
@@ -2539,8 +2539,8 @@ class ci {
2539
2539
  return e.width = (t.width ?? 0) + ((s.width ?? 0) - (t.width ?? 0)) * o, e.opacity = (t.opacity ?? 1) + ((s.opacity ?? 1) - (t.opacity ?? 1)) * o, t.fill && s.fill ? e.fill = this.interpolateFill(t.fill, s.fill, o) : t.color && s.color && t.color.startsWith("#") && s.color.startsWith("#") && (e.color = this.interpolateColor(t.color, s.color, o)), e.trimStart = (t.trimStart ?? 0) + ((s.trimStart ?? 0) - (t.trimStart ?? 0)) * o, e.trimEnd = (t.trimEnd ?? 1) + ((s.trimEnd ?? 1) - (t.trimEnd ?? 1)) * o, e.trimOffset = (t.trimOffset ?? 0) + ((s.trimOffset ?? 0) - (t.trimOffset ?? 0)) * o, e.dashOffset = (t.dashOffset ?? 0) + ((s.dashOffset ?? 0) - (t.dashOffset ?? 0)) * o, e;
2540
2540
  }
2541
2541
  render(t, s, o) {
2542
- var f;
2543
- this.debug_objectsTotal = ((f = this.artboard) == null ? void 0 : f.objects.length) || 0, this.debug_objectsRendered = 0;
2542
+ var h;
2543
+ this.debug_objectsTotal = ((h = this.artboard) == null ? void 0 : h.objects.length) || 0, this.debug_objectsRendered = 0;
2544
2544
  const e = performance.now();
2545
2545
  if (this.canvasWidth = s, this.canvasHeight = o, !this.artboard)
2546
2546
  return;
@@ -2558,15 +2558,15 @@ class ci {
2558
2558
  let g = this.imageCache.get(c);
2559
2559
  if (g || (g = new Image(), g.src = c, this.imageCache.set(c, g)), g.complete && g.naturalWidth > 0) {
2560
2560
  t.save(), t.globalAlpha = this.normalizeOpacity(this.artboard.backgroundOpacity ?? 100);
2561
- const h = g.naturalWidth / g.naturalHeight, d = i / n;
2561
+ const f = g.naturalWidth / g.naturalHeight, d = i / n;
2562
2562
  let u, m, y, v;
2563
- d > h ? (u = i, m = i / h) : (m = n, u = n * h), y = -u / 2, v = -m / 2, t.drawImage(g, y, v, u, m), t.restore();
2563
+ d > f ? (u = i, m = i / f) : (m = n, u = n * f), y = -u / 2, v = -m / 2, t.drawImage(g, y, v, u, m), t.restore();
2564
2564
  }
2565
2565
  }
2566
2566
  t.beginPath(), t.rect(-i / 2, -n / 2, i, n), t.clip();
2567
2567
  const r = /* @__PURE__ */ new Map();
2568
2568
  this.artboard.objects.forEach((c) => r.set(c.id, c)), this.artboard.objects.filter((c) => !c.parentId).map((c, g) => {
2569
- const h = this.objectStates.get(c.id), d = (h == null ? void 0 : h.zIndex) ?? g;
2569
+ const f = this.objectStates.get(c.id), d = (f == null ? void 0 : f.zIndex) ?? g;
2570
2570
  return { obj: c, zIndex: d };
2571
2571
  }).sort((c, g) => c.zIndex - g.zIndex).forEach(({ obj: c }) => {
2572
2572
  this.renderObject(t, c, r);
@@ -2577,18 +2577,18 @@ class ci {
2577
2577
  }), this.lastRenderTime = performance.now() - e, this.debugMode && this.frameCount % 60 === 0 && console.log(`[Engine Debug] Rendered ${this.debug_objectsRendered}/${this.debug_objectsTotal} objects in ${this.lastRenderTime.toFixed(2)}ms`), t.restore();
2578
2578
  }
2579
2579
  isObjectInView(t, s, o, e, i, n = 0) {
2580
- const a = t.getTransform(), r = s * a.a + o * a.c + a.e, l = s * a.b + o * a.d + a.f, f = Math.sqrt(a.a * a.a + a.b * a.b), c = Math.sqrt(a.c * a.c + a.d * a.d), g = (e / 2 + n) * f, h = (i / 2 + n) * c;
2581
- return r + g >= 0 && r - g <= this.canvasWidth && l + h >= 0 && l - h <= this.canvasHeight;
2580
+ const a = t.getTransform(), r = s * a.a + o * a.c + a.e, l = s * a.b + o * a.d + a.f, h = Math.sqrt(a.a * a.a + a.b * a.b), c = Math.sqrt(a.c * a.c + a.d * a.d), g = (e / 2 + n) * h, f = (i / 2 + n) * c;
2581
+ return r + g >= 0 && r - g <= this.canvasWidth && l + f >= 0 && l - f <= this.canvasHeight;
2582
2582
  }
2583
2583
  calculateTransform(t, s, o, e, i, n) {
2584
2584
  let a = 1, r = 1, l = 1;
2585
- const f = o / e, c = t / s;
2585
+ const h = o / e, c = t / s;
2586
2586
  switch (i) {
2587
2587
  case "Contain":
2588
- c > f ? l = s / e : l = t / o, a = r = l;
2588
+ c > h ? l = s / e : l = t / o, a = r = l;
2589
2589
  break;
2590
2590
  case "Cover":
2591
- c > f ? l = t / o : l = s / e, a = r = l;
2591
+ c > h ? l = t / o : l = s / e, a = r = l;
2592
2592
  break;
2593
2593
  case "Fill":
2594
2594
  a = t / o, r = s / e;
@@ -2609,9 +2609,9 @@ class ci {
2609
2609
  a = r = 1;
2610
2610
  break;
2611
2611
  }
2612
- const g = o * a, h = e * r;
2612
+ const g = o * a, f = e * r;
2613
2613
  let d = 0, u = 0;
2614
- return n.includes("Left") ? d = 0 : n.includes("Right") ? d = t - g : d = (t - g) / 2, n.includes("Top") ? u = 0 : n.includes("Bottom") ? u = s - h : u = (s - h) / 2, { scaleX: a, scaleY: r, tx: d, ty: u };
2614
+ return n.includes("Left") ? d = 0 : n.includes("Right") ? d = t - g : d = (t - g) / 2, n.includes("Top") ? u = 0 : n.includes("Bottom") ? u = s - f : u = (s - f) / 2, { scaleX: a, scaleY: r, tx: d, ty: u };
2615
2615
  }
2616
2616
  mapFontWeight(t) {
2617
2617
  const s = t.toLowerCase();
@@ -2639,21 +2639,21 @@ class ci {
2639
2639
  console.warn("No state for object:", s.id);
2640
2640
  return;
2641
2641
  }
2642
- this.frameCount % 60, t.roundRect || (t.roundRect = (A, $, O, V, H) => (this.drawRoundRect(t, A, $, O, V, H), t));
2642
+ this.frameCount % 60, t.roundRect || (t.roundRect = (A, $, O, z, H) => (this.drawRoundRect(t, A, $, O, z, H), t));
2643
2643
  const i = e.geometry ? this.deepMerge(s.geometry, e.geometry) : s.geometry, n = e.style ? this.deepMerge(s.style, e.style) : s.style;
2644
2644
  let a = (i == null ? void 0 : i.width) || ((u = s.geometry) == null ? void 0 : u.width) || s.width || 0, r = (i == null ? void 0 : i.height) || ((m = s.geometry) == null ? void 0 : m.height) || s.height || 0;
2645
2645
  if ((a === 0 || r === 0) && (i != null && i.points) && Array.isArray(i.points) && i.points.length > 0) {
2646
- let A = 1 / 0, $ = -1 / 0, O = 1 / 0, V = -1 / 0;
2646
+ let A = 1 / 0, $ = -1 / 0, O = 1 / 0, z = -1 / 0;
2647
2647
  i.points.forEach((H) => {
2648
- A = Math.min(A, H.x), $ = Math.max($, H.x), O = Math.min(O, H.y), V = Math.max(V, H.y);
2649
- }), a === 0 && (a = $ - A), r === 0 && (r = V - O);
2648
+ A = Math.min(A, H.x), $ = Math.max($, H.x), O = Math.min(O, H.y), z = Math.max(z, H.y);
2649
+ }), a === 0 && (a = $ - A), r === 0 && (r = z - O);
2650
2650
  }
2651
2651
  const l = (A) => {
2652
2652
  if (A)
2653
2653
  return A.corner_radius ?? A.cornerRadius;
2654
- }, f = l(e) ?? l(n) ?? l(i) ?? l(s.style) ?? l(s.geometry) ?? 0;
2654
+ }, h = l(e) ?? l(n) ?? l(i) ?? l(s.style) ?? l(s.geometry) ?? 0;
2655
2655
  let c = { ...i, width: a, height: r };
2656
- if (delete c.cornerRadius, c.corner_radius = f, c.type === "Path" && s.weights && s.bindMatrices && c.points) {
2656
+ if (delete c.cornerRadius, c.corner_radius = h, c.type === "Path" && s.weights && s.bindMatrices && c.points) {
2657
2657
  const A = this.getGlobalTransform(s.id);
2658
2658
  if (A) {
2659
2659
  const $ = li(
@@ -2668,19 +2668,19 @@ class ci {
2668
2668
  }
2669
2669
  if (e.visible === !1)
2670
2670
  return;
2671
- const g = s.repeaterConfig, h = g && g.isEnabled && g.count > 1, d = h ? g.count : 1;
2671
+ const g = s.repeaterConfig, f = g && g.isEnabled && g.count > 1, d = f ? g.count : 1;
2672
2672
  for (let A = 0; A < d; A++) {
2673
- let $ = e.x, O = e.y, V = e.rotation, H = e.scale_x ?? 1, et = e.scale_y ?? 1;
2674
- if (h && A > 0) {
2673
+ let $ = e.x, O = e.y, z = e.rotation, H = e.scale_x ?? 1, et = e.scale_y ?? 1;
2674
+ if (f && A > 0) {
2675
2675
  if (g.type === "Linear") {
2676
2676
  const J = g.offsetX || 0, ft = g.offsetY || 0, U = g.rotation || 0, G = g.scale !== void 0 ? g.scale : 1;
2677
- $ += A * J, O += A * ft, V += A * U, H *= Math.pow(G, A), et *= Math.pow(G, A);
2677
+ $ += A * J, O += A * ft, z += A * U, H *= Math.pow(G, A), et *= Math.pow(G, A);
2678
2678
  } else if (g.type === "Grid") {
2679
2679
  const J = g.cols || Math.ceil(Math.sqrt(g.count)), ft = g.gapX || 0, U = g.gapY || 0, G = Math.floor(A / J), K = A % J, Z = a + ft, At = r + U;
2680
2680
  $ += K * Z, O += G * At;
2681
2681
  } else if (g.type === "Radial") {
2682
2682
  const J = g.radius || 100, ft = g.startAngle || 0, G = (g.endAngle || 360) - ft, K = g.count > 1 ? G / (G === 360 ? g.count : g.count - 1) : 0, Z = ft + A * K, At = Z * Math.PI / 180;
2683
- $ = e.x + J * Math.cos(At), O = e.y + J * Math.sin(At), V += Z;
2683
+ $ = e.x + J * Math.cos(At), O = e.y + J * Math.sin(At), z += Z;
2684
2684
  }
2685
2685
  }
2686
2686
  const E = s.type === "Group" || s.type === "Frame" || s.type === "Component", F = a > 0 && r > 0;
@@ -2799,7 +2799,7 @@ class ci {
2799
2799
  "screen"
2800
2800
  ].includes(J) && (t.globalCompositeOperation = J);
2801
2801
  }
2802
- const lt = t, zt = e.masks || (s.maskedBy ? [{
2802
+ const lt = t, Vt = e.masks || (s.maskedBy ? [{
2803
2803
  maskId: s.maskedBy,
2804
2804
  inverted: s.maskInverted === !0,
2805
2805
  type: s.maskType || "alpha",
@@ -2808,14 +2808,14 @@ class ci {
2808
2808
  isVisible: !0
2809
2809
  }] : []);
2810
2810
  let Mt = !1;
2811
- const Tt = zt.filter((J) => J.isVisible !== !1 && o.has(J.maskId));
2811
+ const Tt = Vt.filter((J) => J.isVisible !== !1 && o.has(J.maskId));
2812
2812
  if (Tt.length > 0) {
2813
2813
  const J = Tt[0], ft = o.get(J.maskId), U = this.objectStates.get(ft.id);
2814
2814
  U && U.visible !== !1 && (Mt = !0, (!this.maskBuffer || this.maskBuffer.width !== this.canvasWidth || this.maskBuffer.height !== this.canvasHeight) && (this.maskBuffer = document.createElement("canvas"), this.maskBuffer.width = this.canvasWidth, this.maskBuffer.height = this.canvasHeight, this.maskCtx = this.maskBuffer.getContext("2d", { willReadFrequently: !0 }), this.maskCtx && (this.maskCtx.imageSmoothingEnabled = !0, this.maskCtx.imageSmoothingQuality = "high")), this.maskCtx.setTransform(1, 0, 0, 1, 0, 0), this.maskCtx.globalCompositeOperation = "source-over", this.maskCtx.globalAlpha = 1, this.maskCtx.filter = "none", this.maskCtx.clearRect(0, 0, this.maskBuffer.width, this.maskBuffer.height), this.rootTransform && this.maskCtx.setTransform(this.rootTransform), s.parentId && this.applyAbsoluteTransform(this.maskCtx, s.parentId, o), this.maskCtx.save(), this.maskCtx.globalAlpha = 1, t = this.maskCtx, t.filter = lt.filter);
2815
2815
  }
2816
- t.translate(Math.round($), Math.round(O)), t.rotate(V * Math.PI / 180);
2817
- const Vt = e.skew_x || 0, Ut = e.skew_y || 0;
2818
- (Vt !== 0 || Ut !== 0) && t.transform(1, Math.tan(Ut * Math.PI / 180), Math.tan(Vt * Math.PI / 180), 1, 0, 0);
2816
+ t.translate(Math.round($), Math.round(O)), t.rotate(z * Math.PI / 180);
2817
+ const zt = e.skew_x || 0, Ut = e.skew_y || 0;
2818
+ (zt !== 0 || Ut !== 0) && t.transform(1, Math.tan(Ut * Math.PI / 180), Math.tan(zt * Math.PI / 180), 1, 0, 0);
2819
2819
  const Jt = e.rotate_x || 0, qt = e.rotate_y || 0, Qt = (e.flip_x === !0 ? -1 : 1) * Math.cos(qt * Math.PI / 180), oe = (e.flip_y === !0 ? -1 : 1) * Math.cos(Jt * Math.PI / 180);
2820
2820
  t.scale(
2821
2821
  H * Qt,
@@ -2860,12 +2860,12 @@ class ci {
2860
2860
  console.error("[ExodeUI] Image load failed:", K, `Src preview: ${J.substring(0, 100)}...`);
2861
2861
  }, ft.src = J, this.imageCache.set(J, ft));
2862
2862
  const U = n.stroke && n.stroke.width > 0 && n.stroke.isEnabled !== !1, G = (((k = n.stroke) == null ? void 0 : k.alignment) || "center").toLowerCase();
2863
- if (U && (G === "outside" || G === "center") && this.applyStrokeAlignment(t, n, c, a, r, f), n.fill && n.fill.type !== "None") {
2863
+ if (U && (G === "outside" || G === "center") && this.applyStrokeAlignment(t, n, c, a, r, h), n.fill && n.fill.type !== "None") {
2864
2864
  t.save();
2865
2865
  const K = t.globalAlpha, Z = this.createCanvasFill(t, n.fill, a, r);
2866
- t.fillStyle = Z || n.fill.color || "transparent", t.globalAlpha = K * this.normalizeOpacity(n.fill.opacity ?? 100), f !== 0 ? (this.drawRoundRect(t, -a / 2, -r / 2, a, r, f), t.fill()) : t.fillRect(-a / 2, -r / 2, a, r), t.globalAlpha = K, t.restore();
2866
+ t.fillStyle = Z || n.fill.color || "transparent", t.globalAlpha = K * this.normalizeOpacity(n.fill.opacity ?? 100), h !== 0 ? (this.drawRoundRect(t, -a / 2, -r / 2, a, r, h), t.fill()) : t.fillRect(-a / 2, -r / 2, a, r), t.globalAlpha = K, t.restore();
2867
2867
  }
2868
- ft.complete && ft.naturalWidth > 0 ? (f !== 0 ? (t.save(), this.drawRoundRect(t, -a / 2, -r / 2, a, r, f), t.clip(), t.drawImage(ft, -a / 2, -r / 2, a, r), t.restore()) : t.drawImage(ft, -a / 2, -r / 2, a, r), U && G === "inside" && this.applyStrokeAlignment(t, n, c, a, r, f)) : U && G === "inside" && this.applyStrokeAlignment(t, n, c, a, r, f);
2868
+ ft.complete && ft.naturalWidth > 0 ? (h !== 0 ? (t.save(), this.drawRoundRect(t, -a / 2, -r / 2, a, r, h), t.clip(), t.drawImage(ft, -a / 2, -r / 2, a, r), t.restore()) : t.drawImage(ft, -a / 2, -r / 2, a, r), U && G === "inside" && this.applyStrokeAlignment(t, n, c, a, r, h)) : U && G === "inside" && this.applyStrokeAlignment(t, n, c, a, r, h);
2869
2869
  }
2870
2870
  } else if (i.type === "SVG") {
2871
2871
  const J = i.svgContent;
@@ -2923,7 +2923,7 @@ class ci {
2923
2923
  }).join("");
2924
2924
  let vt = "";
2925
2925
  if (U.type === "LinearGradient" || U.type === "Linear") {
2926
- const gt = (wt, z) => Array.isArray(wt) ? wt[z] ?? (z === 0 ? 0 : 1) : wt && typeof wt == "object" ? wt[z === 0 ? "x" : "y"] ?? (z === 0 ? 0 : 1) : z === 0 ? 0 : 1, Rt = gt(U.start, 0) * 100, at = gt(U.start, 1) * 100, st = gt(U.end, 0) * 100, nt = gt(U.end, 1) * 100;
2926
+ const gt = (wt, V) => Array.isArray(wt) ? wt[V] ?? (V === 0 ? 0 : 1) : wt && typeof wt == "object" ? wt[V === 0 ? "x" : "y"] ?? (V === 0 ? 0 : 1) : V === 0 ? 0 : 1, Rt = gt(U.start, 0) * 100, at = gt(U.start, 1) * 100, st = gt(U.end, 0) * 100, nt = gt(U.end, 1) * 100;
2927
2927
  vt = `<linearGradient id="${ot}" x1="${Rt}%" y1="${at}%" x2="${st}%" y2="${nt}%" gradientUnits="objectBoundingBox">${bt}</linearGradient>`;
2928
2928
  } else {
2929
2929
  const gt = (nt, wt) => Array.isArray(nt) ? nt[wt] ?? 0.5 : nt && typeof nt == "object" ? nt[wt === 0 ? "x" : "y"] ?? 0.5 : 0.5, Rt = gt(U.center, 0) * 100, at = gt(U.center, 1) * 100, st = (U.radius ?? 0.5) * 100;
@@ -2934,12 +2934,12 @@ class ci {
2934
2934
  }
2935
2935
  const te = (ot, It, bt = 1) => {
2936
2936
  const vt = (ot.stops || []).map((nt) => {
2937
- const wt = nt.offset !== void 0 ? nt.offset : nt.pos ?? 0, z = this.normalizeOpacity(nt.opacity ?? 100) * bt;
2938
- return `<stop offset="${wt * 100}%" stop-color="${nt.color || "#000"}" stop-opacity="${z}"/>`;
2939
- }).join(""), gt = (nt, wt, z = 0.5) => Array.isArray(nt) ? nt[wt] ?? z : nt && typeof nt == "object" ? nt[wt === 0 ? "x" : "y"] ?? z : z;
2937
+ const wt = nt.offset !== void 0 ? nt.offset : nt.pos ?? 0, V = this.normalizeOpacity(nt.opacity ?? 100) * bt;
2938
+ return `<stop offset="${wt * 100}%" stop-color="${nt.color || "#000"}" stop-opacity="${V}"/>`;
2939
+ }).join(""), gt = (nt, wt, V = 0.5) => Array.isArray(nt) ? nt[wt] ?? V : nt && typeof nt == "object" ? nt[wt === 0 ? "x" : "y"] ?? V : V;
2940
2940
  if (ot.type === "LinearGradient" || ot.type === "Linear") {
2941
- const nt = gt(ot.start, 0, 0) * 100, wt = gt(ot.start, 1, 0) * 100, z = gt(ot.end, 0, 1) * 100, pt = gt(ot.end, 1, 1) * 100;
2942
- return `<linearGradient id="${It}" x1="${nt}%" y1="${wt}%" x2="${z}%" y2="${pt}%" gradientUnits="objectBoundingBox">${vt}</linearGradient>`;
2941
+ const nt = gt(ot.start, 0, 0) * 100, wt = gt(ot.start, 1, 0) * 100, V = gt(ot.end, 0, 1) * 100, pt = gt(ot.end, 1, 1) * 100;
2942
+ return `<linearGradient id="${It}" x1="${nt}%" y1="${wt}%" x2="${V}%" y2="${pt}%" gradientUnits="objectBoundingBox">${vt}</linearGradient>`;
2943
2943
  }
2944
2944
  const Rt = gt(ot.center, 0, 0.5) * 100, at = gt(ot.center, 1, 0.5) * 100, st = (ot.radius ?? 0.5) * 100;
2945
2945
  return `<radialGradient id="${It}" cx="${Rt}%" cy="${at}%" r="${st}%" gradientUnits="objectBoundingBox">${vt}</radialGradient>`;
@@ -2969,8 +2969,8 @@ class ci {
2969
2969
  const Ht = parseFloat(at[1]), se = parseFloat(at[2]);
2970
2970
  !isNaN(Ht) && !isNaN(se) && (gt = Ht, Rt = se);
2971
2971
  }
2972
- const st = Math.max(1e-3, a / gt), nt = Math.max(1e-3, r / Rt), wt = (st + nt) / 2, z = (G.width || 1) / wt;
2973
- R.match(/\bstroke-width\s*=\s*["']/i) ? R = R.replace(/\bstroke-width\s*=\s*["'][^"']*["']/gi, `stroke-width="${z}"`) : R = R.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-width="${z}"`), R = R.replace(/stroke-width\s*:\s*[^;"')]+/gi, `stroke-width:${z}`), R.match(/\bstroke-opacity\s*=\s*["']/i) ? R = R.replace(/\bstroke-opacity\s*=\s*["'][^"']*["']/gi, `stroke-opacity="${ot}"`) : R = R.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-opacity="${ot}"`), R = R.replace(/stroke-opacity\s*:\s*[^;"')]+/gi, `stroke-opacity:${ot}`);
2972
+ const st = Math.max(1e-3, a / gt), nt = Math.max(1e-3, r / Rt), wt = (st + nt) / 2, V = (G.width || 1) / wt;
2973
+ R.match(/\bstroke-width\s*=\s*["']/i) ? R = R.replace(/\bstroke-width\s*=\s*["'][^"']*["']/gi, `stroke-width="${V}"`) : R = R.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-width="${V}"`), R = R.replace(/stroke-width\s*:\s*[^;"')]+/gi, `stroke-width:${V}`), R.match(/\bstroke-opacity\s*=\s*["']/i) ? R = R.replace(/\bstroke-opacity\s*=\s*["'][^"']*["']/gi, `stroke-opacity="${ot}"`) : R = R.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-opacity="${ot}"`), R = R.replace(/stroke-opacity\s*:\s*[^;"')]+/gi, `stroke-opacity:${ot}`);
2974
2974
  const pt = G.lineCap || "round";
2975
2975
  R.match(/\bstroke-linecap\s*=\s*["']/i) ? R = R.replace(/\bstroke-linecap\s*=\s*["'][^"']*["']/gi, `stroke-linecap="${pt}"`) : R = R.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-linecap="${pt}"`), R = R.replace(/stroke-linecap\s*:\s*[^;"')]+/gi, `stroke-linecap:${pt}`);
2976
2976
  const ut = G.lineJoin || "round";
@@ -3003,7 +3003,7 @@ class ci {
3003
3003
  Ht = ` stroke-dasharray="${Pe} ${Re}"`, se = ` stroke-dashoffset="${Le}"`;
3004
3004
  }
3005
3005
  } else (_ = G.dashArray) != null && _.length && (Ht = ` stroke-dasharray="${G.dashArray.join(" ")}"`, G.dashOffset && (se = ` stroke-dashoffset="${G.dashOffset}"`));
3006
- const ue = ` stroke-linecap="${G.lineCap || "round"}"`, Me = ` stroke-linejoin="${G.lineJoin || "round"}"`, ke = `stroke="${bt}" stroke-width="${z}" stroke-opacity="${ot}"${ue}${Me}${Ht}${se}`;
3006
+ const ue = ` stroke-linecap="${G.lineCap || "round"}"`, Me = ` stroke-linejoin="${G.lineJoin || "round"}"`, ke = `stroke="${bt}" stroke-width="${V}" stroke-opacity="${ot}"${ue}${Me}${Ht}${se}`;
3007
3007
  R = R.replace(
3008
3008
  /(<svg[^>]*>)(\s*(?:<defs>[\s\S]*?<\/defs>)?)/i,
3009
3009
  (fe, re, le) => `${re}${le}<g ${ke}>`
@@ -3027,27 +3027,27 @@ class ci {
3027
3027
  this.maskBuffer || (this.maskBuffer = document.createElement("canvas"), this.maskCtx = this.maskBuffer.getContext("2d")), this.maskBuffer.width = R, this.maskBuffer.height = ct, this.maskCtx.setTransform(1, 0, 0, 1, 0, 0), this.maskCtx.globalCompositeOperation = "source-over", this.maskCtx.globalAlpha = 1, this.maskCtx.filter = "none", this.maskCtx.clearRect(0, 0, R, ct), this.maskCtx.drawImage(yt, 0, 0, R, ct), this.maskCtx.globalCompositeOperation = "source-in";
3028
3028
  const Xt = U.color || "#000000", xt = this.normalizeOpacity(U.opacity ?? 100);
3029
3029
  this.maskCtx.fillStyle = Xt, this.maskCtx.globalAlpha = xt, this.maskCtx.fillRect(0, 0, R, ct), t.drawImage(this.maskBuffer, -R / 2, -ct / 2, R, ct);
3030
- } else f !== 0 ? (t.save(), this.drawRoundRect(t, -R / 2, -ct / 2, R, ct, f), t.clip(), t.drawImage(yt, -R / 2, -ct / 2, R, ct), t.restore()) : t.drawImage(yt, -R / 2, -ct / 2, R, ct);
3030
+ } else h !== 0 ? (t.save(), this.drawRoundRect(t, -R / 2, -ct / 2, R, ct, h), t.clip(), t.drawImage(yt, -R / 2, -ct / 2, R, ct), t.restore()) : t.drawImage(yt, -R / 2, -ct / 2, R, ct);
3031
3031
  }
3032
3032
  }
3033
3033
  } else if (c.type === "LineGraph")
3034
3034
  this.renderLineGraph(t, c, a, r);
3035
3035
  else if (s.type === "Shape") {
3036
- if (this.applyPath(t, c, a, r, f), t.save(), n.blur && n.blur.amount > 0 && (t.filter = `blur(${n.blur.amount}px)`), n.fill) {
3036
+ if (this.applyPath(t, c, a, r, h), t.save(), n.blur && n.blur.amount > 0 && (t.filter = `blur(${n.blur.amount}px)`), n.fill) {
3037
3037
  const J = t.globalAlpha;
3038
3038
  if (((L = n.fill) == null ? void 0 : L.type) === "Image" && (n.fill.originalSrc || n.fill.src)) {
3039
3039
  const ft = n.fill.originalSrc || n.fill.src;
3040
3040
  let U = this.imageCache.get(ft);
3041
- U || (U = new Image(), U.src = ft, this.imageCache.set(ft, U)), U.complete && U.naturalWidth > 0 && (t.save(), this.applyPath(t, c, a, r, f), t.clip(), this.renderFittedImage(t, U, -a / 2, -r / 2, a, r, n.fill.fillMode), t.restore());
3041
+ U || (U = new Image(), U.src = ft, this.imageCache.set(ft, U)), U.complete && U.naturalWidth > 0 && (t.save(), this.applyPath(t, c, a, r, h), t.clip(), this.renderFittedImage(t, U, -a / 2, -r / 2, a, r, n.fill.fillMode), t.restore());
3042
3042
  } else {
3043
3043
  const ft = this.createCanvasFill(t, n.fill, a, r);
3044
- t.fillStyle = ft || (typeof n.fill == "string" ? n.fill : n.fill.color || "transparent"), t.globalAlpha = J * this.normalizeOpacity(n.fill.opacity ?? 100), this.applyPath(t, c, a, r, f), t.fill();
3044
+ t.fillStyle = ft || (typeof n.fill == "string" ? n.fill : n.fill.color || "transparent"), t.globalAlpha = J * this.normalizeOpacity(n.fill.opacity ?? 100), this.applyPath(t, c, a, r, h), t.fill();
3045
3045
  }
3046
3046
  t.globalAlpha = J;
3047
3047
  }
3048
- t.restore(), n.stroke && n.stroke.width > 0 && this.applyStrokeAlignment(t, n, c, a, r, f);
3048
+ t.restore(), n.stroke && n.stroke.width > 0 && this.applyStrokeAlignment(t, n, c, a, r, h);
3049
3049
  } else if (s.type === "Frame" || s.type === "Group" && !s.isStructuralGroup) {
3050
- const J = e.width ?? i.width ?? s.width ?? a, ft = e.height ?? i.height ?? s.height ?? r, U = f;
3050
+ const J = e.width ?? i.width ?? s.width ?? a, ft = e.height ?? i.height ?? s.height ?? r, U = h;
3051
3051
  if (t.save(), t.beginPath(), this.drawRoundRect(t, -J / 2, -ft / 2, J, ft, U), n.fill && n.fill.type !== "None") {
3052
3052
  const G = t.globalAlpha, K = this.createCanvasFill(t, n.fill, J, ft);
3053
3053
  t.fillStyle = K || n.fill.color || "transparent", t.globalAlpha = G * this.normalizeOpacity(n.fill.opacity ?? 100), t.fill(), t.globalAlpha = G;
@@ -3057,7 +3057,7 @@ class ci {
3057
3057
  this.applyStrokeAlignment(t, n, G, J, ft, U);
3058
3058
  }
3059
3059
  } else s.type === "Group" && s.isStructuralGroup || (s.type === "Component" && s.variant === "inputbox" ? this.renderInputBox(t, s) : s.type === "Component" && s.variant === "button" ? this.renderButton(t, s) : s.type === "Component" && s.variant === "toggle_button" ? this.renderToggleButton(t, s) : s.type === "Toggle" || s.type === "Component" && s.variant === "toggle" ? this.renderToggle(t, s) : s.type === "Slider" || s.type === "Component" && s.variant === "slider" ? this.renderSlider(t, s) : s.type === "Dropdown" || s.type === "Component" && s.variant === "dropdown" ? this.renderDropdown(t, s) : s.type === "ListView" || s.type === "Component" && s.variant === "listview" ? this.renderListView(t, s) : s.type === "Checkbox" || s.type === "Component" && s.variant === "checkbox" ? this.renderCheckbox(t, s) : s.type === "RadioGroup" || s.type === "Component" && s.variant === "radiogroup" ? this.renderRadioGroup(t, s) : s.type === "BarChart" || s.type === "Component" && s.variant === "barchart" ? this.renderBarChart(t, s) : s.type === "PieChart" || s.type === "Component" && s.variant === "piechart" ? this.renderPieChart(t, s) : this.frameCount % 60 === 0 && console.warn("[Engine] Unhandled object type in renderObject:", s.type, "Geo:", (x = s.geometry) == null ? void 0 : x.type));
3060
- if (this.applyArtEffectOverlay(t, s, c, a, r, f), dt && St === "BackgroundBlur" && this.applyBackgroundBlurGlass(t, c, a, r, f, it), ee && ee.enabled && t.restore(), s.children && s.children.length > 0) {
3060
+ if (this.applyArtEffectOverlay(t, s, c, a, r, h), dt && St === "BackgroundBlur" && this.applyBackgroundBlurGlass(t, c, a, r, h, it), ee && ee.enabled && t.restore(), s.children && s.children.length > 0) {
3061
3061
  const ft = s.type === "Frame", U = s.clipsContent !== void 0 ? s.clipsContent : s.clipContent !== void 0 ? s.clipContent : ft;
3062
3062
  if (t.save(), U) {
3063
3063
  t.beginPath();
@@ -3166,27 +3166,27 @@ class ci {
3166
3166
  }
3167
3167
  _renderText(t, s, o, e, i, n, a, r = !1, l = !1) {
3168
3168
  var St, ht, mt, rt, Lt, Gt, Pt, Dt, Yt;
3169
- let f = o.text || "";
3169
+ let h = o.text || "";
3170
3170
  if (o.textInputId && !r) {
3171
3171
  const B = this.inputs.get(o.textInputId);
3172
- B !== void 0 && (f = String(B), i.geometry && i.geometry.type === "Text" && (i.geometry.text = f));
3172
+ B !== void 0 && (h = String(B), i.geometry && i.geometry.type === "Text" && (i.geometry.text = h));
3173
3173
  }
3174
3174
  if (o.svgPath) {
3175
3175
  const B = o.svgPath;
3176
3176
  t.save();
3177
- const lt = ((St = e == null ? void 0 : e.fill) == null ? void 0 : St.color) || "#000000", zt = ((ht = e == null ? void 0 : e.fill) == null ? void 0 : ht.opacity) !== void 0 ? (mt = e == null ? void 0 : e.fill) == null ? void 0 : mt.opacity : 1;
3178
- t.fillStyle = lt, t.globalAlpha *= zt;
3177
+ const lt = ((St = e == null ? void 0 : e.fill) == null ? void 0 : St.color) || "#000000", Vt = ((ht = e == null ? void 0 : e.fill) == null ? void 0 : ht.opacity) !== void 0 ? (mt = e == null ? void 0 : e.fill) == null ? void 0 : mt.opacity : 1;
3178
+ t.fillStyle = lt, t.globalAlpha *= Vt;
3179
3179
  const Mt = new Path2D(B);
3180
3180
  t.fill(Mt), t.restore();
3181
3181
  return;
3182
3182
  }
3183
- let c = f || "";
3183
+ let c = h || "";
3184
3184
  o.enableSegments === !0 && o.segments && Array.isArray(o.segments) && (c = o.segments.map((B) => B && B.text ? B.text : "").join(""));
3185
3185
  const g = o.textCase || "none";
3186
3186
  g === "uppercase" ? c = c.toUpperCase() : g === "lowercase" ? c = c.toLowerCase() : g === "capitalize" && (c = c.replace(/\b\w/g, (B) => B.toUpperCase()));
3187
- let h = ((rt = o.fontWeight) == null ? void 0 : rt.toString()) || "400", d = o.fontStyle || "normal";
3188
- h.toLowerCase().includes("italic") && (d = "italic", h = h.replace(/italic/gi, "").trim() || "400");
3189
- const u = this.mapFontWeight(h), m = Math.max(1, o.fontSize || 32);
3187
+ let f = ((rt = o.fontWeight) == null ? void 0 : rt.toString()) || "400", d = o.fontStyle || "normal";
3188
+ f.toLowerCase().includes("italic") && (d = "italic", f = f.replace(/italic/gi, "").trim() || "400");
3189
+ const u = this.mapFontWeight(f), m = Math.max(1, o.fontSize || 32);
3190
3190
  let y = o.fontFamily || "Inter";
3191
3191
  const v = ["Bold", "SemiBold", "Medium", "Regular", "Light", "Thin", "ExtraBold", "Black", "Italic"];
3192
3192
  v.forEach((B) => {
@@ -3231,23 +3231,23 @@ class ci {
3231
3231
  hyphenation: o.hyphenation,
3232
3232
  composer: o.composer,
3233
3233
  balanceRaggedLines: o.balanceRaggedLines
3234
- }), O = $.lines || [], V = $.maxFontSize || m, H = this.fontLeadingFactors[y] ?? 0.5, et = (_ - m) * H;
3234
+ }), O = $.lines || [], z = $.maxFontSize || m, H = this.fontLeadingFactors[y] ?? 0.5, et = (_ - m) * H;
3235
3235
  let E = $.height, F = -E / 2;
3236
3236
  a > 0 && a > E && (I === "top" ? F = -a / 2 : I === "middle" || I === "center" ? F = -E / 2 : I === "bottom" && (F = a / 2 - E)), F += et;
3237
3237
  let q = null, Q = 0;
3238
3238
  if (o.pathId && this.artboard) {
3239
3239
  const B = this.artboard.objects.find((lt) => lt.id === o.pathId);
3240
3240
  if (B && B.type === "Shape" && ((Pt = B.geometry) == null ? void 0 : Pt.type) === "Path") {
3241
- const lt = this.objectStates.get(B.id), zt = lt != null && lt.geometry ? this.deepMerge(B.geometry, lt.geometry) : B.geometry, Mt = (lt == null ? void 0 : lt.scale_x) !== void 0 ? (B.width || 0) * lt.scale_x : B.width || 0, Tt = (lt == null ? void 0 : lt.scale_y) !== void 0 ? (B.height || 0) * lt.scale_y : B.height || 0;
3242
- q = { geo: zt, obj: B, w: Mt, h: Tt }, Q = this.getPerimeter(zt, Mt, Tt);
3241
+ const lt = this.objectStates.get(B.id), Vt = lt != null && lt.geometry ? this.deepMerge(B.geometry, lt.geometry) : B.geometry, Mt = (lt == null ? void 0 : lt.scale_x) !== void 0 ? (B.width || 0) * lt.scale_x : B.width || 0, Tt = (lt == null ? void 0 : lt.scale_y) !== void 0 ? (B.height || 0) * lt.scale_y : B.height || 0;
3242
+ q = { geo: Vt, obj: B, w: Mt, h: Tt }, Q = this.getPerimeter(Vt, Mt, Tt);
3243
3243
  }
3244
3244
  }
3245
3245
  const it = (B, lt) => {
3246
3246
  var Mt, Tt;
3247
3247
  if (M === 0 && (!o.enableSegments || !((Mt = o.segments) != null && Mt.length))) return t.measureText(B).width;
3248
- let zt = 0;
3249
- for (let Vt = 0; Vt < B.length; Vt++) {
3250
- const Ut = lt + Vt;
3248
+ let Vt = 0;
3249
+ for (let zt = 0; zt < B.length; zt++) {
3250
+ const Ut = lt + zt;
3251
3251
  let Jt = 0;
3252
3252
  if (o.enableSegments === !0 && ((Tt = o.segments) == null ? void 0 : Tt.length) > 0) {
3253
3253
  let qt = 0, Qt = null;
@@ -3262,20 +3262,20 @@ class ci {
3262
3262
  t.save();
3263
3263
  let oe = Qt.fontFamily || o.fontFamily || "Inter";
3264
3264
  const jt = this.mapFontWeight((Qt.fontWeight || o.fontWeight || "400").toString()), ee = Qt.fontStyle || d, J = Qt.fontSize || m;
3265
- t.font = `${ee} ${jt} ${J}px "${oe}", sans-serif`, Jt = t.measureText(B[Vt]).width, t.restore();
3265
+ t.font = `${ee} ${jt} ${J}px "${oe}", sans-serif`, Jt = t.measureText(B[zt]).width, t.restore();
3266
3266
  } else
3267
- Jt = t.measureText(B[Vt]).width;
3267
+ Jt = t.measureText(B[zt]).width;
3268
3268
  } else
3269
- Jt = t.measureText(B[Vt]).width;
3270
- zt += Jt + M;
3269
+ Jt = t.measureText(B[zt]).width;
3270
+ Vt += Jt + M;
3271
3271
  }
3272
- return zt - (B.length > 0 ? M : 0);
3273
- }, dt = (B, lt, zt, Mt, Tt) => {
3272
+ return Vt - (B.length > 0 ? M : 0);
3273
+ }, dt = (B, lt, Vt, Mt, Tt) => {
3274
3274
  var jt, ee;
3275
3275
  const Ut = (Tt === 0 || c[Tt - 1] === `
3276
3276
  ` || c[Tt - 1] === "\r") && o.paragraphIndent ? o.paragraphIndent : 0, Jt = (!r || l) && (s.behaviors || []).some(
3277
3277
  (J) => J.enabled && (J.type.toString().includes("Text") || ["Typewriter", "Scramble", "Wave", "Bounce", "GlitchText", "Reveal3D", "RevealSlide", "RevealBlur"].includes(J.type))
3278
- ), qt = !o.pathId && !Jt && (o.enableSegments !== !0 || !o.segments || o.segments.length === 0), Qt = o.baselineShift || 0, oe = zt + Qt;
3278
+ ), qt = !o.pathId && !Jt && (o.enableSegments !== !0 || !o.segments || o.segments.length === 0), Qt = o.baselineShift || 0, oe = Vt + Qt;
3279
3279
  if (qt)
3280
3280
  t.font = S, Mt ? t.strokeText(B, lt + Ut, oe) : t.fillText(B, lt + Ut, oe);
3281
3281
  else {
@@ -3345,91 +3345,91 @@ class ci {
3345
3345
  else if (at.type === Y.Wave)
3346
3346
  xt += Math.sin(this.currentTime * 5 * (st.speed || 1) + ct * (st.frequency || 1)) * (st.amplitude || 20) * nt;
3347
3347
  else if (at.type === Y.Bounce) {
3348
- const z = Math.max(0, this.currentTime % 2 - ct * (st.stagger || 0.1));
3349
- z < 1 && (xt -= Math.abs(Math.sin(z * Math.PI)) * (st.height || 50) * nt);
3348
+ const V = Math.max(0, this.currentTime % 2 - ct * (st.stagger || 0.1));
3349
+ V < 1 && (xt -= Math.abs(Math.sin(V * Math.PI)) * (st.height || 50) * nt);
3350
3350
  } else if (at.type === Y.TextTrail) {
3351
- const z = this.pointerHistory[Math.max(0, this.pointerHistory.length - 1 - ct * (st.delay || 5))];
3352
- z && (Xt += (z.x - (i.x + kt)) * nt * 0.2, xt += (z.y - (i.y + zt + xt)) * nt * 0.2);
3351
+ const V = this.pointerHistory[Math.max(0, this.pointerHistory.length - 1 - ct * (st.delay || 5))];
3352
+ V && (Xt += (V.x - (i.x + kt)) * nt * 0.2, xt += (V.y - (i.y + Vt + xt)) * nt * 0.2);
3353
3353
  } else if (at.type === Y.Reveal3D) {
3354
- const z = Math.max(0, Math.min(1, this.currentTime * (st.speed || 1) - ct * (st.stagger || 0.1)));
3355
- te *= z, $t *= z, Ft = z;
3354
+ const V = Math.max(0, Math.min(1, this.currentTime * (st.speed || 1) - ct * (st.stagger || 0.1)));
3355
+ te *= V, $t *= V, Ft = V;
3356
3356
  } else if (at.type === Y.RevealSlide) {
3357
- const z = Math.max(0, Math.min(1, this.currentTime * 1.5 - ct * 0.05)), pt = (1 - z) * (st.distance || 40) * nt, ut = st.direction || "up";
3358
- ut === "up" ? xt -= pt : ut === "down" ? xt += pt : ut === "left" ? Xt -= pt : ut === "right" && (Xt += pt), Ft = z;
3357
+ const V = Math.max(0, Math.min(1, this.currentTime * 1.5 - ct * 0.05)), pt = (1 - V) * (st.distance || 40) * nt, ut = st.direction || "up";
3358
+ ut === "up" ? xt -= pt : ut === "down" ? xt += pt : ut === "left" ? Xt -= pt : ut === "right" && (Xt += pt), Ft = V;
3359
3359
  } else if (at.type === Y.RevealBlur) {
3360
- const z = Math.max(0, Math.min(1, this.currentTime * 1.2 - ct * 0.1));
3361
- Ft = z, Xt += (1 - z) * 5;
3360
+ const V = Math.max(0, Math.min(1, this.currentTime * 1.2 - ct * 0.1));
3361
+ Ft = V, Xt += (1 - V) * 5;
3362
3362
  } else if (at.type === Y.TextLiquid) {
3363
- const z = Math.max(0, Math.sin(wt * 1e-3 * (st.speed || 1) + ct * 0.5));
3364
- xt += z * (st.amplitude || 10) * nt, $t *= 1 + z * 0.2;
3363
+ const V = Math.max(0, Math.sin(wt * 1e-3 * (st.speed || 1) + ct * 0.5));
3364
+ xt += V * (st.amplitude || 10) * nt, $t *= 1 + V * 0.2;
3365
3365
  } else if (at.type === Y.TextVortex) {
3366
- const z = wt * 2e-3 * (st.speed || 1) + ct * 0.2, pt = (1 - (Math.sin(wt * 1e-3) * 0.5 + 0.5)) * (st.radius || 50);
3367
- Xt += Math.cos(z) * pt * nt, xt += Math.sin(z) * pt * nt;
3366
+ const V = wt * 2e-3 * (st.speed || 1) + ct * 0.2, pt = (1 - (Math.sin(wt * 1e-3) * 0.5 + 0.5)) * (st.radius || 50);
3367
+ Xt += Math.cos(V) * pt * nt, xt += Math.sin(V) * pt * nt;
3368
3368
  } else if (at.type === Y.TextExplosion) {
3369
- const z = st.force || 1, pt = this.currentTime % 2;
3369
+ const V = st.force || 1, pt = this.currentTime % 2;
3370
3370
  if (pt < 1) {
3371
- const ut = (ct / B.length - 0.5) * Math.PI * 2, ce = pt * 100 * z;
3371
+ const ut = (ct / B.length - 0.5) * Math.PI * 2, ce = pt * 100 * V;
3372
3372
  Xt += Math.cos(ut) * ce * nt, xt += Math.sin(ut) * ce * nt, Ft = 1 - pt;
3373
3373
  }
3374
3374
  } else if (at.type === Y.TextRain) {
3375
- const z = st.speed || 1, pt = st.height || 100, ut = (wt * 1e-3 * z + ct * 0.1) % 1;
3375
+ const V = st.speed || 1, pt = st.height || 100, ut = (wt * 1e-3 * V + ct * 0.1) % 1;
3376
3376
  xt -= (1 - ut) * pt * nt, Ft = ut > 0.1 ? 1 : ut * 10;
3377
3377
  } else if (at.type === Y.TextGravity) {
3378
- const z = st.gravity || 9.8, pt = this.currentTime % 3 / 3, ut = 0.5 * z * Math.pow(pt * 10, 2);
3378
+ const V = st.gravity || 9.8, pt = this.currentTime % 3 / 3, ut = 0.5 * V * Math.pow(pt * 10, 2);
3379
3379
  ut < 100 ? xt += ut * nt : xt += 100 * nt;
3380
3380
  } else if (at.type === Y.TextMatrix) {
3381
- const z = st.speed || 1;
3382
- if (Math.random() < 0.1 * z) {
3381
+ const V = st.speed || 1;
3382
+ if (Math.random() < 0.1 * V) {
3383
3383
  const ut = "0123456789ABCDEF!@#$%^&*";
3384
3384
  ot = ut[Math.floor(Math.random() * ut.length)];
3385
3385
  }
3386
- Ft = 0.3 + (Math.sin(wt * 0.01 * z + ct) + 1) / 2 * 0.7;
3386
+ Ft = 0.3 + (Math.sin(wt * 0.01 * V + ct) + 1) / 2 * 0.7;
3387
3387
  } else if (at.type === Y.TextNeon) {
3388
- const z = Math.random() > 0.95 ? 0.5 : 1;
3389
- Ft = (0.7 + (Math.sin(wt * 5e-3) + 1) / 2 * 0.3) * z;
3388
+ const V = Math.random() > 0.95 ? 0.5 : 1;
3389
+ Ft = (0.7 + (Math.sin(wt * 5e-3) + 1) / 2 * 0.3) * V;
3390
3390
  } else if (at.type === Y.TextDissolve)
3391
3391
  Math.sin(ct * 1.5 + wt * 2e-3 * (st.speed || 1)) > 0.5 && (Ft = 0);
3392
3392
  else if (at.type === Y.TextOrganic) {
3393
- const z = st.speed || 1, pt = st.amplitude || 10;
3394
- Xt += Math.sin(wt * 2e-3 * z + ct) * pt * nt, xt += Math.cos(wt * 15e-4 * z + ct * 0.7) * pt * nt;
3393
+ const V = st.speed || 1, pt = st.amplitude || 10;
3394
+ Xt += Math.sin(wt * 2e-3 * V + ct) * pt * nt, xt += Math.cos(wt * 15e-4 * V + ct * 0.7) * pt * nt;
3395
3395
  } else if (at.type === Y.TextBreathe) {
3396
3396
  const pt = 1 + (Math.sin(wt * 3e-3 + ct * 0.2) + 1) / 2 * 0.2 * nt;
3397
3397
  te *= pt, $t *= pt;
3398
3398
  } else if (at.type === Y.TextSpin) {
3399
- const z = st.speed || 1;
3400
- Wt += wt * 0.01 * z + ct;
3399
+ const V = st.speed || 1;
3400
+ Wt += wt * 0.01 * V + ct;
3401
3401
  } else if (at.type === Y.TextMagnet) {
3402
- const z = this.pointerHistory[this.pointerHistory.length - 1];
3403
- if (z) {
3404
- const pt = z.x - (i.x + kt), ut = z.y - (i.y + zt);
3402
+ const V = this.pointerHistory[this.pointerHistory.length - 1];
3403
+ if (V) {
3404
+ const pt = V.x - (i.x + kt), ut = V.y - (i.y + Vt);
3405
3405
  Wt = Math.atan2(ut, pt);
3406
3406
  }
3407
3407
  } else if (at.type === Y.TextPerspective) {
3408
- const z = B.length / 2, pt = (ct - z) / z, ut = 1 - Math.abs(pt) * 0.3 * nt;
3408
+ const V = B.length / 2, pt = (ct - V) / V, ut = 1 - Math.abs(pt) * 0.3 * nt;
3409
3409
  te *= ut, $t *= ut, Xt += pt * 20 * nt;
3410
3410
  } else if (at.type === Y.TextMirror)
3411
3411
  Ft *= 0.8;
3412
3412
  else if (at.type === Y.TextFloral) {
3413
- const z = st.speed || 1, pt = st.stagger || 0.1, ut = (wt * 1e-3 * z + ct * pt) % 2;
3413
+ const V = st.speed || 1, pt = st.stagger || 0.1, ut = (wt * 1e-3 * V + ct * pt) % 2;
3414
3414
  ut < 1 && (te *= ut, $t *= ut, Wt += ut * Math.PI);
3415
3415
  } else if (at.type === Y.TextSmoke) {
3416
- const z = st.speed || 1, pt = st.height || 50, ut = (wt * 5e-4 * z + ct * 0.2) % 1;
3416
+ const V = st.speed || 1, pt = st.height || 50, ut = (wt * 5e-4 * V + ct * 0.2) % 1;
3417
3417
  xt -= ut * pt * nt, Xt += Math.sin(wt * 2e-3 + ct) * 5 * nt, Ft = 1 - ut;
3418
3418
  } else if (at.type === Y.TextVariable) {
3419
- const z = st.speed || 1, pt = st.intensity || 1.5, ut = (Math.sin(wt * 4e-3 * z + ct * 0.3) + 1) / 2;
3419
+ const V = st.speed || 1, pt = st.intensity || 1.5, ut = (Math.sin(wt * 4e-3 * V + ct * 0.3) + 1) / 2;
3420
3420
  te *= 1 + ut * (pt - 1) * nt;
3421
3421
  } else if (at.type === Y.TextZing) {
3422
- const z = st.speed || 2, pt = st.distance || 100, ut = (wt * 2e-3 * z + ct * 0.05) % 1;
3422
+ const V = st.speed || 2, pt = st.distance || 100, ut = (wt * 2e-3 * V + ct * 0.05) % 1;
3423
3423
  Xt += (1 - ut) * pt * nt, Ft = ut;
3424
3424
  } else if (at.type === Y.TextElastic) {
3425
- const z = st.stiffness || 0.2, pt = st.damping || 0.1, ut = Math.sin(wt * 0.01) * Math.exp(-wt * 1e-3 * pt);
3426
- $t *= 1 + ut * z * nt;
3425
+ const V = st.stiffness || 0.2, pt = st.damping || 0.1, ut = Math.sin(wt * 0.01) * Math.exp(-wt * 1e-3 * pt);
3426
+ $t *= 1 + ut * V * nt;
3427
3427
  } else if (at.type === Y.TextGlitch3D) {
3428
- const z = st.intensity || 5;
3429
- Math.random() < 0.2 && (Xt += (Math.random() - 0.5) * z, xt += (Math.random() - 0.5) * z, Ft = 0.8);
3428
+ const V = st.intensity || 5;
3429
+ Math.random() < 0.2 && (Xt += (Math.random() - 0.5) * V, xt += (Math.random() - 0.5) * V, Ft = 0.8);
3430
3430
  } else if (at.type === Y.GlitchText) {
3431
- const z = st.intensity || 5;
3432
- Math.random() < 0.1 && (Xt += (Math.random() - 0.5) * z, xt += (Math.random() - 0.5) * z, Math.random() < 0.05 && (Ft = 0.5));
3431
+ const V = st.intensity || 5;
3432
+ Math.random() < 0.1 && (Xt += (Math.random() - 0.5) * V, xt += (Math.random() - 0.5) * V, Math.random() < 0.05 && (Ft = 0.5));
3433
3433
  }
3434
3434
  });
3435
3435
  let It = null, bt = o.textDecoration || "none", vt = m;
@@ -3448,8 +3448,8 @@ class ci {
3448
3448
  const ut = new RegExp(`[\\s-]${pt}$`, "i");
3449
3449
  ut.test(nt) && (nt = nt.replace(ut, "").trim());
3450
3450
  });
3451
- const wt = this.mapFontWeight((st.fontWeight || o.fontWeight || "400").toString()), z = st.fontStyle || d;
3452
- vt = st.fontSize || m, t.font = `${z} ${wt} ${vt}px "${nt}", sans-serif`, st.fill && (It = st.fill), st.textDecoration && (bt = st.textDecoration), vt < V && (xt += (V - vt) * 0.85);
3451
+ const wt = this.mapFontWeight((st.fontWeight || o.fontWeight || "400").toString()), V = st.fontStyle || d;
3452
+ vt = st.fontSize || m, t.font = `${V} ${wt} ${vt}px "${nt}", sans-serif`, st.fill && (It = st.fill), st.textDecoration && (bt = st.textDecoration), vt < z && (xt += (z - vt) * 0.85);
3453
3453
  }
3454
3454
  } else
3455
3455
  t.font = S;
@@ -3457,10 +3457,10 @@ class ci {
3457
3457
  t.globalAlpha *= Ft, t.save();
3458
3458
  const Rt = t.measureText(ot).width;
3459
3459
  if (q && Q > 0) {
3460
- const at = kt - ft + Rt / 2, nt = (Ot + at) / Q, wt = this.getPointOnPath(q.geo, q.w, q.h, Math.abs(nt % 1)), z = wt.angle, pt = zt + xt + (o.pathOffsetY || 0), ut = o.pathSide === "right" ? -1 : 1, ce = Math.cos(z + Math.PI / 2) * pt * ut, me = Math.sin(z + Math.PI / 2) * pt * ut;
3461
- t.translate(wt.x + ce + Xt, wt.y + me), t.rotate(z + Wt + (ut === -1 ? Math.PI : 0));
3460
+ const at = kt - ft + Rt / 2, nt = (Ot + at) / Q, wt = this.getPointOnPath(q.geo, q.w, q.h, Math.abs(nt % 1)), V = wt.angle, pt = Vt + xt + (o.pathOffsetY || 0), ut = o.pathSide === "right" ? -1 : 1, ce = Math.cos(V + Math.PI / 2) * pt * ut, me = Math.sin(V + Math.PI / 2) * pt * ut;
3461
+ t.translate(wt.x + ce + Xt, wt.y + me), t.rotate(V + Wt + (ut === -1 ? Math.PI : 0));
3462
3462
  } else
3463
- t.translate(kt + Xt + Rt / 2, zt + xt), Wt !== 0 && t.rotate(Wt);
3463
+ t.translate(kt + Xt + Rt / 2, Vt + xt), Wt !== 0 && t.rotate(Wt);
3464
3464
  if (t.scale(te, $t), It && !r && !l) {
3465
3465
  const at = this.createCanvasFill(t, It, n, a);
3466
3466
  t.fillStyle = at || It.color || "#000000";
@@ -3479,16 +3479,16 @@ class ci {
3479
3479
  };
3480
3480
  if (r) {
3481
3481
  let B = 0, lt = F;
3482
- (O || []).forEach((zt) => {
3483
- const Mt = zt.text || "", Tt = c.indexOf(Mt, B);
3482
+ (O || []).forEach((Vt) => {
3483
+ const Mt = Vt.text || "", Tt = c.indexOf(Mt, B);
3484
3484
  Tt !== -1 && (B = Tt);
3485
- let Vt = -n / 2;
3486
- w === "center" ? Vt = 0 : w === "right" && (Vt = n / 2), dt(Mt, Vt, lt, !1, B), B += Mt.length, lt += _;
3485
+ let zt = -n / 2;
3486
+ w === "center" ? zt = 0 : w === "right" && (zt = n / 2), dt(Mt, zt, lt, !1, B), B += Mt.length, lt += _;
3487
3487
  });
3488
3488
  } else if (l) {
3489
3489
  let B = 0, lt = F;
3490
- (O || []).forEach((zt) => {
3491
- const Mt = zt.text || "";
3490
+ (O || []).forEach((Vt) => {
3491
+ const Mt = Vt.text || "";
3492
3492
  let Tt = -n / 2;
3493
3493
  w === "center" ? Tt = 0 : w === "right" && (Tt = n / 2), dt(Mt, Tt, lt, !1, B), B += Mt.length, B < c.length && (c[B] === `
3494
3494
  ` || c[B] === "\r") && (B++, c[B - 1] === "\r" && c[B] === `
@@ -3496,30 +3496,30 @@ class ci {
3496
3496
  });
3497
3497
  } else {
3498
3498
  if (e.fill) {
3499
- const lt = t.globalAlpha, zt = this.createCanvasFill(t, e.fill, n, a);
3500
- t.fillStyle = zt || e.fill.color || "#000000", t.globalAlpha = lt * this.normalizeOpacity(e.fill.opacity ?? 100);
3499
+ const lt = t.globalAlpha, Vt = this.createCanvasFill(t, e.fill, n, a);
3500
+ t.fillStyle = Vt || e.fill.color || "#000000", t.globalAlpha = lt * this.normalizeOpacity(e.fill.opacity ?? 100);
3501
3501
  const Mt = $.fullText || (o.enableSegments ? (o.segments || []).map((Ut) => {
3502
3502
  let Jt = Ut.text || "";
3503
3503
  const qt = Ut.textCase || o.textCase || "none";
3504
3504
  return qt === "uppercase" ? Jt.toUpperCase() : qt === "lowercase" ? Jt.toLowerCase() : qt === "capitalize" ? Jt.replace(/\b\w/g, (Qt) => Qt.toUpperCase()) : Jt;
3505
3505
  }).join("") : c);
3506
- let Tt = 0, Vt = F;
3506
+ let Tt = 0, zt = F;
3507
3507
  (O || []).forEach((Ut) => {
3508
3508
  const Jt = Ut.text || "";
3509
3509
  let qt = -n / 2;
3510
- w === "center" ? qt = 0 : w === "right" && (qt = n / 2), dt(Jt, qt, Vt, !1, Tt), Tt += Jt.length, Vt += _, Tt < Mt.length && (Mt[Tt] === `
3511
- ` || Mt[Tt] === "\r") && (W > 0 && (Vt += W), Tt++, Mt[Tt - 1] === "\r" && Mt[Tt] === `
3510
+ w === "center" ? qt = 0 : w === "right" && (qt = n / 2), dt(Jt, qt, zt, !1, Tt), Tt += Jt.length, zt += _, Tt < Mt.length && (Mt[Tt] === `
3511
+ ` || Mt[Tt] === "\r") && (W > 0 && (zt += W), Tt++, Mt[Tt - 1] === "\r" && Mt[Tt] === `
3512
3512
  ` && Tt++);
3513
3513
  }), t.globalAlpha = lt;
3514
3514
  }
3515
3515
  const B = o.paragraphRule;
3516
3516
  if (B && (((Dt = B.top) == null ? void 0 : Dt.width) > 0 || ((Yt = B.bottom) == null ? void 0 : Yt.width) > 0)) {
3517
3517
  let lt = 0;
3518
- (O || []).forEach((zt, Mt) => {
3518
+ (O || []).forEach((Vt, Mt) => {
3519
3519
  var Ut, Jt;
3520
- const Vt = lt === 0 || lt < c.length && (c[lt] === `
3520
+ const zt = lt === 0 || lt < c.length && (c[lt] === `
3521
3521
  ` || c[lt] === "\r");
3522
- if (Vt && Mt > 0 && lt++, Vt) {
3522
+ if (zt && Mt > 0 && lt++, zt) {
3523
3523
  if (((Ut = B.top) == null ? void 0 : Ut.width) > 0) {
3524
3524
  const qt = F + Mt * _ - B.top.offset;
3525
3525
  t.strokeStyle = B.top.color || "#000000", t.lineWidth = B.top.width, t.beginPath();
@@ -3533,16 +3533,16 @@ class ci {
3533
3533
  t.moveTo(Qt, qt), t.lineTo(n / 2 - _ * 0.2, qt), t.stroke();
3534
3534
  }
3535
3535
  }
3536
- lt += (zt.text || "").length;
3536
+ lt += (Vt.text || "").length;
3537
3537
  });
3538
3538
  }
3539
3539
  if (e.stroke && e.stroke.width > 0) {
3540
3540
  const lt = t.globalAlpha;
3541
3541
  e.fill && e.fill.type !== "None" && e.fill.isEnabled !== !1 && e.fill.opacity !== 0 && e.fill.color !== "transparent" && e.fill.color !== "rgba(0,0,0,0)" && (t.shadowColor = "transparent", t.shadowBlur = 0, t.shadowOffsetX = 0, t.shadowOffsetY = 0), t.strokeStyle = e.stroke.color, t.lineWidth = e.stroke.width, t.globalAlpha = lt * this.normalizeOpacity(e.stroke.opacity ?? 100);
3542
3542
  let Mt = 0, Tt = F;
3543
- (O || []).forEach((Vt) => {
3543
+ (O || []).forEach((zt) => {
3544
3544
  let Ut = -n / 2;
3545
- w === "center" ? Ut = 0 : w === "right" && (Ut = n / 2), dt(Vt.text, Ut, Tt, !0, Mt), Mt += (Vt.text || "").length, Tt += _, Mt < c.length && (c[Mt] === `
3545
+ w === "center" ? Ut = 0 : w === "right" && (Ut = n / 2), dt(zt.text, Ut, Tt, !0, Mt), Mt += (zt.text || "").length, Tt += _, Mt < c.length && (c[Mt] === `
3546
3546
  ` || c[Mt] === "\r") && (W > 0 && (Tt += W), Mt++, c[Mt - 1] === "\r" && c[Mt] === `
3547
3547
  ` && Mt++);
3548
3548
  }), t.globalAlpha = lt;
@@ -3559,11 +3559,11 @@ class ci {
3559
3559
  t.strokeStyle = a.color || "#000000";
3560
3560
  const c = t.globalAlpha;
3561
3561
  t.globalAlpha = c * this.normalizeOpacity(a.opacity ?? 100), t.lineWidth = r, t.lineCap = a.lineCap || "round", t.lineJoin = a.lineJoin || "round", a.miterLimit !== void 0 && (t.miterLimit = a.miterLimit);
3562
- const g = a.trimStart ?? 0, h = a.trimEnd ?? 1, d = a.trimOffset ?? 0, u = a.dashOffset ?? 0, m = a.dashArray || [];
3563
- if (g !== 0 || h !== 1 || d !== 0) {
3562
+ const g = a.trimStart ?? 0, f = a.trimEnd ?? 1, d = a.trimOffset ?? 0, u = a.dashOffset ?? 0, m = a.dashArray || [];
3563
+ if (g !== 0 || f !== 1 || d !== 0) {
3564
3564
  const y = this.getPerimeter(o, e, i);
3565
3565
  if (y > 0) {
3566
- const v = Math.max(0, Math.min(1, g)), b = Math.max(0, Math.min(1, h));
3566
+ const v = Math.max(0, Math.min(1, g)), b = Math.max(0, Math.min(1, f));
3567
3567
  if (v < b) {
3568
3568
  const C = y * (b - v), S = y - C, I = -(y * (v + d % 1));
3569
3569
  t.setLineDash([C, S]), t.lineDashOffset = I + u * y;
@@ -3586,8 +3586,8 @@ class ci {
3586
3586
  if (n >= 360 && a <= 0) return r;
3587
3587
  let l = n / 360 * r;
3588
3588
  if (a > 0) {
3589
- const f = Math.PI * (3 * (e * a + i * a) - Math.sqrt((3 * e * a + i * a) * (e * a + 3 * i * a)));
3590
- l += n / 360 * f, n < 360 && (l += 2 * Math.sqrt((e - e * a) ** 2 + (i - i * a) ** 2));
3589
+ const h = Math.PI * (3 * (e * a + i * a) - Math.sqrt((3 * e * a + i * a) * (e * a + 3 * i * a)));
3590
+ l += n / 360 * h, n < 360 && (l += 2 * Math.sqrt((e - e * a) ** 2 + (i - i * a) ** 2));
3591
3591
  } else n < 360 && (l += 2 * Math.max(e, i));
3592
3592
  return isNaN(l) ? 0 : l;
3593
3593
  }
@@ -3613,17 +3613,17 @@ class ci {
3613
3613
  n = l.x, a = l.y;
3614
3614
  continue;
3615
3615
  }
3616
- const f = n, c = a, g = e[r - 1].out_x, h = e[r - 1].out_y;
3616
+ const h = n, c = a, g = e[r - 1].out_x, f = e[r - 1].out_y;
3617
3617
  if (g !== void 0 || l.in_x !== void 0 ? i += this.getBezierLength(
3618
- f,
3618
+ h,
3619
3619
  c,
3620
- g ?? f,
3621
- h ?? c,
3620
+ g ?? h,
3621
+ f ?? c,
3622
3622
  l.in_x ?? l.x,
3623
3623
  l.in_y ?? l.y,
3624
3624
  l.x,
3625
3625
  l.y
3626
- ) : i += Math.sqrt((l.x - f) ** 2 + (l.y - c) ** 2), n = l.x, a = l.y, l.closePath || r === e.length - 1 && (t.is_closed || t.isClosed)) {
3626
+ ) : i += Math.sqrt((l.x - h) ** 2 + (l.y - c) ** 2), n = l.x, a = l.y, l.closePath || r === e.length - 1 && (t.is_closed || t.isClosed)) {
3627
3627
  const d = n, u = a, m = [...e.slice(0, r + 1)].reverse().find((w) => w.moveTo) || e[0], y = m.x, v = m.y, b = e[r].out_x, C = e[r].out_y, S = m.in_x, I = m.in_y;
3628
3628
  b !== void 0 || S !== void 0 ? i += this.getBezierLength(
3629
3629
  d,
@@ -3644,23 +3644,23 @@ class ci {
3644
3644
  }
3645
3645
  }
3646
3646
  getBezierLength(t, s, o, e, i, n, a, r, l = 10) {
3647
- let f = 0, c = t, g = s;
3648
- for (let h = 1; h <= l; h++) {
3649
- const d = h / l, u = 1 - d, m = d * d, y = u * u, v = y * u, b = m * d, C = v * t + 3 * y * d * o + 3 * u * m * i + b * a, S = v * s + 3 * y * d * e + 3 * u * m * n + b * r, I = C - c, w = S - g;
3650
- f += Math.sqrt(I * I + w * w), c = C, g = S;
3647
+ let h = 0, c = t, g = s;
3648
+ for (let f = 1; f <= l; f++) {
3649
+ const d = f / l, u = 1 - d, m = d * d, y = u * u, v = y * u, b = m * d, C = v * t + 3 * y * d * o + 3 * u * m * i + b * a, S = v * s + 3 * y * d * e + 3 * u * m * n + b * r, I = C - c, w = S - g;
3650
+ h += Math.sqrt(I * I + w * w), c = C, g = S;
3651
3651
  }
3652
- return f;
3652
+ return h;
3653
3653
  }
3654
- getBezierTAtLength(t, s, o, e, i, n, a, r, l, f = 20) {
3654
+ getBezierTAtLength(t, s, o, e, i, n, a, r, l, h = 20) {
3655
3655
  if (t <= 0) return 0;
3656
- let c = 0, g = s, h = o;
3657
- for (let d = 1; d <= f; d++) {
3658
- const u = d / f, m = 1 - u, y = u * u, v = m * m, b = v * m, C = y * u, S = b * s + 3 * v * u * e + 3 * m * y * n + C * r, I = b * o + 3 * v * u * i + 3 * m * y * a + C * l, w = S - g, M = I - h, P = Math.sqrt(w * w + M * M);
3656
+ let c = 0, g = s, f = o;
3657
+ for (let d = 1; d <= h; d++) {
3658
+ const u = d / h, m = 1 - u, y = u * u, v = m * m, b = v * m, C = y * u, S = b * s + 3 * v * u * e + 3 * m * y * n + C * r, I = b * o + 3 * v * u * i + 3 * m * y * a + C * l, w = S - g, M = I - f, P = Math.sqrt(w * w + M * M);
3659
3659
  if (c + P >= t) {
3660
3660
  const T = t - c, W = P === 0 ? 0 : T / P;
3661
- return (d - 1 + W) / f;
3661
+ return (d - 1 + W) / h;
3662
3662
  }
3663
- c += P, g = S, h = I;
3663
+ c += P, g = S, f = I;
3664
3664
  }
3665
3665
  return 1;
3666
3666
  }
@@ -3672,7 +3672,7 @@ class ci {
3672
3672
  i.forEach((v) => {
3673
3673
  typeof v.x == "number" && typeof v.y == "number" && (n = Math.min(n, v.x), a = Math.max(a, v.x), r = Math.min(r, v.y), l = Math.max(l, v.y), v.out_x !== void 0 && (n = Math.min(n, v.out_x), a = Math.max(a, v.out_x)), v.out_y !== void 0 && (r = Math.min(r, v.out_y), l = Math.max(l, v.out_y)), v.in_x !== void 0 && (n = Math.min(n, v.in_x), a = Math.max(a, v.in_x)), v.in_y !== void 0 && (r = Math.min(r, v.in_y), l = Math.max(l, v.in_y)));
3674
3674
  });
3675
- const f = (n + a) / 2, c = (r + l) / 2, h = this.getPerimeter(t, s, o) * e;
3675
+ const h = (n + a) / 2, c = (r + l) / 2, f = this.getPerimeter(t, s, o) * e;
3676
3676
  let d = 0;
3677
3677
  const u = [];
3678
3678
  let m = i[0], y = i[0];
@@ -3688,30 +3688,30 @@ class ci {
3688
3688
  const b = v.p0, C = v.p1;
3689
3689
  let S = 0;
3690
3690
  const I = b.out_x !== void 0 || C.in_x !== void 0;
3691
- if (I ? S = this.getBezierLength(b.x, b.y, b.out_x ?? b.x, b.out_y ?? b.y, C.in_x ?? C.x, C.in_y ?? C.y, C.x, C.y) : S = Math.sqrt((C.x - b.x) ** 2 + (C.y - b.y) ** 2), d + S >= h || v === u[u.length - 1]) {
3691
+ if (I ? S = this.getBezierLength(b.x, b.y, b.out_x ?? b.x, b.out_y ?? b.y, C.in_x ?? C.x, C.in_y ?? C.y, C.x, C.y) : S = Math.sqrt((C.x - b.x) ** 2 + (C.y - b.y) ** 2), d + S >= f || v === u[u.length - 1]) {
3692
3692
  let w = 0;
3693
3693
  if (I)
3694
- return w = this.getBezierTAtLength(h - d, b.x, b.y, b.out_x ?? b.x, b.out_y ?? b.y, C.in_x ?? C.x, C.in_y ?? C.y, C.x, C.y, 20), this.getBezierPointAndAngle(w, b, C, f, c);
3694
+ return w = this.getBezierTAtLength(f - d, b.x, b.y, b.out_x ?? b.x, b.out_y ?? b.y, C.in_x ?? C.x, C.in_y ?? C.y, C.x, C.y, 20), this.getBezierPointAndAngle(w, b, C, h, c);
3695
3695
  {
3696
- w = S === 0 ? 0 : (h - d) / S;
3697
- const M = b.x + (C.x - b.x) * w - f, P = b.y + (C.y - b.y) * w - c, T = Math.atan2(C.y - b.y, C.x - b.x);
3696
+ w = S === 0 ? 0 : (f - d) / S;
3697
+ const M = b.x + (C.x - b.x) * w - h, P = b.y + (C.y - b.y) * w - c, T = Math.atan2(C.y - b.y, C.x - b.x);
3698
3698
  return { x: M, y: P, angle: T };
3699
3699
  }
3700
3700
  }
3701
3701
  d += S;
3702
3702
  }
3703
3703
  } else if (t.type === "Ellipse") {
3704
- const i = Math.abs(s) / 2, n = Math.abs(o) / 2, a = t.sweepAngle ?? 360, l = ((t.startAngle ?? 0) + a * e) * Math.PI / 180, f = i * Math.cos(l), c = n * Math.sin(l), g = -i * Math.sin(l), h = n * Math.cos(l), d = Math.atan2(h, g);
3705
- return { x: f, y: c, angle: d };
3704
+ const i = Math.abs(s) / 2, n = Math.abs(o) / 2, a = t.sweepAngle ?? 360, l = ((t.startAngle ?? 0) + a * e) * Math.PI / 180, h = i * Math.cos(l), c = n * Math.sin(l), g = -i * Math.sin(l), f = n * Math.cos(l), d = Math.atan2(f, g);
3705
+ return { x: h, y: c, angle: d };
3706
3706
  } else if ((t == null ? void 0 : t.type) === "Rectangle") {
3707
3707
  const i = Math.abs(s), n = Math.abs(o), r = (i + n) * 2 * e;
3708
- let l = 0, f = 0, c = 0;
3709
- return r < i ? (l = -i / 2 + r, f = -n / 2, c = 0) : r < i + n ? (l = i / 2, f = -n / 2 + (r - i), c = Math.PI / 2) : r < 2 * i + n ? (l = i / 2 - (r - (i + n)), f = n / 2, c = Math.PI) : (l = -i / 2, f = n / 2 - (r - (2 * i + n)), c = -Math.PI / 2), { x: l, y: f, angle: c };
3708
+ let l = 0, h = 0, c = 0;
3709
+ return r < i ? (l = -i / 2 + r, h = -n / 2, c = 0) : r < i + n ? (l = i / 2, h = -n / 2 + (r - i), c = Math.PI / 2) : r < 2 * i + n ? (l = i / 2 - (r - (i + n)), h = n / 2, c = Math.PI) : (l = -i / 2, h = n / 2 - (r - (2 * i + n)), c = -Math.PI / 2), { x: l, y: h, angle: c };
3710
3710
  }
3711
3711
  return { x: 0, y: 0, angle: 0 };
3712
3712
  }
3713
3713
  getBezierPointAndAngle(t, s, o, e, i) {
3714
- const n = s.x, a = s.y, r = s.out_x ?? s.x, l = s.out_y ?? s.y, f = o.in_x ?? o.x, c = o.in_y ?? o.y, g = o.x, h = o.y, d = 1 - t, u = t * t, m = d * d, y = m * d, v = u * t, b = y * n + 3 * m * t * r + 3 * d * u * f + v * g - e, C = y * a + 3 * m * t * l + 3 * d * u * c + v * h - i, S = 3 * m * (r - n) + 6 * d * t * (f - r) + 3 * u * (g - f), I = 3 * m * (l - a) + 6 * d * t * (c - l) + 3 * u * (h - c), w = Math.atan2(I, S);
3714
+ const n = s.x, a = s.y, r = s.out_x ?? s.x, l = s.out_y ?? s.y, h = o.in_x ?? o.x, c = o.in_y ?? o.y, g = o.x, f = o.y, d = 1 - t, u = t * t, m = d * d, y = m * d, v = u * t, b = y * n + 3 * m * t * r + 3 * d * u * h + v * g - e, C = y * a + 3 * m * t * l + 3 * d * u * c + v * f - i, S = 3 * m * (r - n) + 6 * d * t * (h - r) + 3 * u * (g - h), I = 3 * m * (l - a) + 6 * d * t * (c - l) + 3 * u * (f - c), w = Math.atan2(I, S);
3715
3715
  return { x: b, y: C, angle: w };
3716
3716
  }
3717
3717
  applyAbsoluteTransform(t, s, o) {
@@ -3735,53 +3735,53 @@ class ci {
3735
3735
  t.scale(e, i);
3736
3736
  }
3737
3737
  applyArtEffectOverlay(t, s, o, e, i, n) {
3738
- var h, d, u, m, y;
3739
- const a = this.objectStates.get(s.id), r = ((h = a == null ? void 0 : a.style) == null ? void 0 : h.artEffect) || s.artEffect || ((d = s.style) == null ? void 0 : d.artEffect);
3738
+ var f, d, u, m, y;
3739
+ const a = this.objectStates.get(s.id), r = ((f = a == null ? void 0 : a.style) == null ? void 0 : f.artEffect) || s.artEffect || ((d = s.style) == null ? void 0 : d.artEffect);
3740
3740
  if (!r || !r.enabled) return;
3741
- const l = r.type, f = r.intensity ?? 0.5, c = r.speed ?? 1, g = r.scale ?? 10;
3741
+ const l = r.type, h = r.intensity ?? 0.5, c = r.speed ?? 1, g = r.scale ?? 10;
3742
3742
  if (l === "acid_gradient" || l === "acid_rave" || l === "shimmer" || l === "glint_overlay" || l === "halftone" || l === "noise" || l === "scanlines" || l === "chromatic_aberration" || l === "pixelate" || l === "glitch" || l === "fold_overlay" || l === "crumple_overlay") {
3743
3743
  if (t.save(), this.applyPath(t, o, e, i, n), t.clip(), l === "shimmer") {
3744
3744
  const b = this.currentTime * c % 2 / 2, C = t.createLinearGradient(-e, -i, e, i);
3745
- C.addColorStop(Math.max(0, b - 0.2), "rgba(255,255,255,0)"), C.addColorStop(b, `rgba(255,255,255,${f * 0.8})`), C.addColorStop(Math.min(1, b + 0.2), "rgba(255,255,255,0)"), t.fillStyle = C, t.globalCompositeOperation = "screen", t.fillRect(-e / 2, -i / 2, e, i), t.globalCompositeOperation = "source-over";
3745
+ C.addColorStop(Math.max(0, b - 0.2), "rgba(255,255,255,0)"), C.addColorStop(b, `rgba(255,255,255,${h * 0.8})`), C.addColorStop(Math.min(1, b + 0.2), "rgba(255,255,255,0)"), t.fillStyle = C, t.globalCompositeOperation = "screen", t.fillRect(-e / 2, -i / 2, e, i), t.globalCompositeOperation = "source-over";
3746
3746
  } else if (l === "glint_overlay") {
3747
3747
  let C = ((this._lastPointerPos || { x: 0 }).x - (((u = s.transform) == null ? void 0 : u.x) ?? 0) + 300) / 600;
3748
3748
  C = Math.max(-0.2, Math.min(1.2, C));
3749
3749
  const S = t.createLinearGradient(-e, -i, e, i);
3750
- S.addColorStop(Math.max(0, C - 0.15), "rgba(255,255,255,0)"), S.addColorStop(Math.max(0, Math.min(1, C)), `rgba(255,255,255,${f})`), S.addColorStop(Math.min(1, C + 0.15), "rgba(255,255,255,0)"), t.fillStyle = S, t.globalCompositeOperation = "screen", t.fillRect(-e / 2, -i / 2, e, i), t.globalCompositeOperation = "source-over";
3750
+ S.addColorStop(Math.max(0, C - 0.15), "rgba(255,255,255,0)"), S.addColorStop(Math.max(0, Math.min(1, C)), `rgba(255,255,255,${h})`), S.addColorStop(Math.min(1, C + 0.15), "rgba(255,255,255,0)"), t.fillStyle = S, t.globalCompositeOperation = "screen", t.fillRect(-e / 2, -i / 2, e, i), t.globalCompositeOperation = "source-over";
3751
3751
  } else if (l === "fold_overlay") {
3752
3752
  const v = this._lastPointerPos || { x: 0, y: 0 }, b = v.x - (((m = s.transform) == null ? void 0 : m.x) ?? 0), C = v.y - (((y = s.transform) == null ? void 0 : y.y) ?? 0), S = t.createLinearGradient(b > 0 ? -e / 2 : e / 2, C > 0 ? -i / 2 : i / 2, b > 0 ? e / 2 : -e / 2, C > 0 ? i / 2 : -i / 2);
3753
- S.addColorStop(0, `rgba(0,0,0,${f * 0.6})`), S.addColorStop(0.4, "rgba(0,0,0,0)"), S.addColorStop(0.5, `rgba(255,255,255,${f * 0.4})`), S.addColorStop(1, `rgba(0,0,0,${f * 0.2})`), t.fillStyle = S, t.globalCompositeOperation = "overlay", t.fillRect(-e / 2, -i / 2, e, i), t.globalCompositeOperation = "source-over", t.beginPath(), b > 0 && C > 0 ? (t.moveTo(e / 2 - 40, i / 2), t.lineTo(e / 2, i / 2 - 40), t.lineTo(e / 2 - 40, i / 2 - 40)) : b < 0 && C > 0 ? (t.moveTo(-e / 2 + 40, i / 2), t.lineTo(-e / 2, i / 2 - 40), t.lineTo(-e / 2 + 40, i / 2 - 40)) : b > 0 && C < 0 ? (t.moveTo(e / 2 - 40, -i / 2), t.lineTo(e / 2, -i / 2 + 40), t.lineTo(e / 2 - 40, -i / 2 + 40)) : (t.moveTo(-e / 2 + 40, -i / 2), t.lineTo(-e / 2, -i / 2 + 40), t.lineTo(-e / 2 + 40, -i / 2 + 40)), t.closePath(), t.fillStyle = "#ffffff", t.shadowColor = "rgba(0,0,0,0.5)", t.shadowBlur = 10, t.shadowOffsetX = b > 0 ? -2 : 2, t.shadowOffsetY = C > 0 ? -2 : 2, t.fill();
3753
+ S.addColorStop(0, `rgba(0,0,0,${h * 0.6})`), S.addColorStop(0.4, "rgba(0,0,0,0)"), S.addColorStop(0.5, `rgba(255,255,255,${h * 0.4})`), S.addColorStop(1, `rgba(0,0,0,${h * 0.2})`), t.fillStyle = S, t.globalCompositeOperation = "overlay", t.fillRect(-e / 2, -i / 2, e, i), t.globalCompositeOperation = "source-over", t.beginPath(), b > 0 && C > 0 ? (t.moveTo(e / 2 - 40, i / 2), t.lineTo(e / 2, i / 2 - 40), t.lineTo(e / 2 - 40, i / 2 - 40)) : b < 0 && C > 0 ? (t.moveTo(-e / 2 + 40, i / 2), t.lineTo(-e / 2, i / 2 - 40), t.lineTo(-e / 2 + 40, i / 2 - 40)) : b > 0 && C < 0 ? (t.moveTo(e / 2 - 40, -i / 2), t.lineTo(e / 2, -i / 2 + 40), t.lineTo(e / 2 - 40, -i / 2 + 40)) : (t.moveTo(-e / 2 + 40, -i / 2), t.lineTo(-e / 2, -i / 2 + 40), t.lineTo(-e / 2 + 40, -i / 2 + 40)), t.closePath(), t.fillStyle = "#ffffff", t.shadowColor = "rgba(0,0,0,0.5)", t.shadowBlur = 10, t.shadowOffsetX = b > 0 ? -2 : 2, t.shadowOffsetY = C > 0 ? -2 : 2, t.fill();
3754
3754
  } else if (l === "crumple_overlay") {
3755
3755
  const v = Math.floor(e / g), b = document.createElement("canvas");
3756
3756
  b.width = v, b.height = Math.floor(i / g);
3757
3757
  const C = b.getContext("2d"), S = C.createImageData(b.width, b.height);
3758
3758
  for (let I = 0; I < S.data.length; I += 4) {
3759
3759
  const w = Math.random() > 0.95 ? 150 : 255;
3760
- S.data[I] = w, S.data[I + 1] = w, S.data[I + 2] = w, S.data[I + 3] = 255 * f;
3760
+ S.data[I] = w, S.data[I + 1] = w, S.data[I + 2] = w, S.data[I + 3] = 255 * h;
3761
3761
  }
3762
3762
  C.putImageData(S, 0, 0), t.globalCompositeOperation = "multiply", t.imageSmoothingEnabled = !1, t.drawImage(b, -e / 2, -i / 2, e, i);
3763
3763
  } else if (l === "acid_gradient" || l === "acid_rave") {
3764
3764
  const v = this.currentTime * c, b = r.color1, C = r.color2, S = t.createLinearGradient(-e / 2, -i / 2, e / 2, i / 2);
3765
3765
  if (b && C) {
3766
3766
  const I = v * 60 % 360;
3767
- S.addColorStop(0, this._shiftHue(b, I, f * 0.7)), S.addColorStop(1, this._shiftHue(C, (I + 180) % 360, f * 0.7));
3767
+ S.addColorStop(0, this._shiftHue(b, I, h * 0.7)), S.addColorStop(1, this._shiftHue(C, (I + 180) % 360, h * 0.7));
3768
3768
  } else {
3769
3769
  const I = v * 100 % 360, w = (I + 180) % 360;
3770
- S.addColorStop(0, `hsla(${I}, 80%, 50%, ${f * 0.5})`), S.addColorStop(1, `hsla(${w}, 80%, 50%, ${f * 0.5})`);
3770
+ S.addColorStop(0, `hsla(${I}, 80%, 50%, ${h * 0.5})`), S.addColorStop(1, `hsla(${w}, 80%, 50%, ${h * 0.5})`);
3771
3771
  }
3772
3772
  t.fillStyle = S, t.globalCompositeOperation = "screen", t.fillRect(-e / 2, -i / 2, e, i);
3773
3773
  } else if (l === "halftone") {
3774
- const v = Math.max(2, g * (1 - f * 0.8)), b = document.createElement("canvas");
3774
+ const v = Math.max(2, g * (1 - h * 0.8)), b = document.createElement("canvas");
3775
3775
  b.width = v, b.height = v;
3776
3776
  const C = b.getContext("2d");
3777
3777
  if (C) {
3778
- C.fillStyle = "black", C.beginPath(), C.arc(v / 2, v / 2, v / 2 * f, 0, Math.PI * 2), C.fill();
3778
+ C.fillStyle = "black", C.beginPath(), C.arc(v / 2, v / 2, v / 2 * h, 0, Math.PI * 2), C.fill();
3779
3779
  const S = t.createPattern(b, "repeat");
3780
- S && (t.globalAlpha = 0.3 * f, t.fillStyle = S, t.fillRect(-e / 2, -i / 2, e, i));
3780
+ S && (t.globalAlpha = 0.3 * h, t.fillStyle = S, t.fillRect(-e / 2, -i / 2, e, i));
3781
3781
  }
3782
3782
  } else if (l === "noise") {
3783
- const v = Math.floor(e * i * f * 0.02);
3784
- t.globalAlpha = 0.4 * f;
3783
+ const v = Math.floor(e * i * h * 0.02);
3784
+ t.globalAlpha = 0.4 * h;
3785
3785
  for (let b = 0; b < v; b++) {
3786
3786
  const C = Math.random() > 0.5 ? 255 : 0;
3787
3787
  t.fillStyle = `rgba(${C}, ${C}, ${C}, ${0.5 + Math.random() * 0.5})`, t.fillRect(
@@ -3792,14 +3792,14 @@ class ci {
3792
3792
  );
3793
3793
  }
3794
3794
  } else if (l === "scanlines") {
3795
- t.globalAlpha = 0.2 * f, t.strokeStyle = "rgba(0,0,0,0.5)", t.lineWidth = 1;
3795
+ t.globalAlpha = 0.2 * h, t.strokeStyle = "rgba(0,0,0,0.5)", t.lineWidth = 1;
3796
3796
  for (let v = -i / 2; v < i / 2; v += 4)
3797
3797
  t.beginPath(), t.moveTo(-e / 2, v), t.lineTo(e / 2, v), t.stroke();
3798
3798
  } else if (l === "chromatic_aberration") {
3799
- const v = 5 * f;
3799
+ const v = 5 * h;
3800
3800
  t.globalCompositeOperation = "screen", t.globalAlpha = 0.5, t.fillStyle = "cyan", t.fillRect(-e / 2 - v, -i / 2, e, i), t.fillStyle = "magenta", t.fillRect(-e / 2 + v, -i / 2, e, i);
3801
3801
  } else if (l === "pixelate") {
3802
- const v = Math.max(2, Math.round(g * (1 - f * 0.5))), b = document.createElement("canvas"), C = Math.max(1, Math.ceil(e / v)), S = Math.max(1, Math.ceil(i / v));
3802
+ const v = Math.max(2, Math.round(g * (1 - h * 0.5))), b = document.createElement("canvas"), C = Math.max(1, Math.ceil(e / v)), S = Math.max(1, Math.ceil(i / v));
3803
3803
  b.width = C, b.height = S;
3804
3804
  const I = b.getContext("2d");
3805
3805
  if (I) {
@@ -3808,8 +3808,8 @@ class ci {
3808
3808
  I.drawImage(t.canvas, M, P, e, i, 0, 0, C, S), t.imageSmoothingEnabled = !1, t.drawImage(b, 0, 0, C, S, -e / 2, -i / 2, e, i), t.imageSmoothingEnabled = !0;
3809
3809
  }
3810
3810
  } else if (l === "glitch") {
3811
- const v = this.currentTime * c, b = r.chaosAmount ?? 0.2, C = Math.max(3, Math.floor(8 * f)), S = f * e * 0.15;
3812
- t.globalCompositeOperation = "screen", t.globalAlpha = f * 0.4;
3811
+ const v = this.currentTime * c, b = r.chaosAmount ?? 0.2, C = Math.max(3, Math.floor(8 * h)), S = h * e * 0.15;
3812
+ t.globalCompositeOperation = "screen", t.globalAlpha = h * 0.4;
3813
3813
  const I = S * 0.3;
3814
3814
  t.fillStyle = "rgba(255, 0, 0, 0.4)", t.fillRect(-e / 2 + I, -i / 2, e, i), t.fillStyle = "rgba(0, 255, 255, 0.4)", t.fillRect(-e / 2 - I, -i / 2, e, i), t.globalCompositeOperation = "source-over", t.globalAlpha = 1;
3815
3815
  const w = i / C;
@@ -3828,26 +3828,26 @@ class ci {
3828
3828
  _shiftHue(t, s, o) {
3829
3829
  let e = 0, i = 0, n = 0;
3830
3830
  if (t.startsWith("#")) {
3831
- const h = t.replace("#", "");
3832
- e = parseInt(h.substring(0, 2), 16) / 255, i = parseInt(h.substring(2, 4), 16) / 255, n = parseInt(h.substring(4, 6), 16) / 255;
3831
+ const f = t.replace("#", "");
3832
+ e = parseInt(f.substring(0, 2), 16) / 255, i = parseInt(f.substring(2, 4), 16) / 255, n = parseInt(f.substring(4, 6), 16) / 255;
3833
3833
  }
3834
3834
  const a = Math.max(e, i, n), r = Math.min(e, i, n);
3835
- let l = 0, f = 0, c = (a + r) / 2;
3835
+ let l = 0, h = 0, c = (a + r) / 2;
3836
3836
  if (a !== r) {
3837
- const h = a - r;
3838
- switch (f = c > 0.5 ? h / (2 - a - r) : h / (a + r), a) {
3837
+ const f = a - r;
3838
+ switch (h = c > 0.5 ? f / (2 - a - r) : f / (a + r), a) {
3839
3839
  case e:
3840
- l = ((i - n) / h + (i < n ? 6 : 0)) / 6;
3840
+ l = ((i - n) / f + (i < n ? 6 : 0)) / 6;
3841
3841
  break;
3842
3842
  case i:
3843
- l = ((n - e) / h + 2) / 6;
3843
+ l = ((n - e) / f + 2) / 6;
3844
3844
  break;
3845
3845
  case n:
3846
- l = ((e - i) / h + 4) / 6;
3846
+ l = ((e - i) / f + 4) / 6;
3847
3847
  break;
3848
3848
  }
3849
3849
  }
3850
- return `hsla(${(((l * 360 + s) % 360 + 360) % 360).toFixed(0)}, ${(f * 100).toFixed(0)}%, ${(c * 100).toFixed(0)}%, ${o})`;
3850
+ return `hsla(${(((l * 360 + s) % 360 + 360) % 360).toFixed(0)}, ${(h * 100).toFixed(0)}%, ${(c * 100).toFixed(0)}%, ${o})`;
3851
3851
  }
3852
3852
  /**
3853
3853
  * Simulate CSS `backdrop-filter: blur()` + glass overlay on Canvas2D.
@@ -3858,15 +3858,15 @@ class ci {
3858
3858
  * 4. Apply the overlay color tint, sheen highlight, noise grain, and glass border
3859
3859
  */
3860
3860
  applyBackgroundBlurGlass(t, s, o, e, i, n) {
3861
- const a = n.radius ?? 10, r = n.color ?? "rgba(255,255,255,0.2)", l = n.opacity ?? 0.5, f = n.noise ?? 0;
3861
+ const a = n.radius ?? 10, r = n.color ?? "rgba(255,255,255,0.2)", l = n.opacity ?? 0.5, h = n.noise ?? 0;
3862
3862
  t.save(), this.applyPath(t, s, o, e, i), t.clip();
3863
- const c = t.getTransform(), g = c.e - o / 2, h = c.f - e / 2;
3863
+ const c = t.getTransform(), g = c.e - o / 2, f = c.f - e / 2;
3864
3864
  try {
3865
3865
  const u = document.createElement("canvas");
3866
3866
  u.width = Math.max(1, Math.ceil(o)), u.height = Math.max(1, Math.ceil(e));
3867
3867
  const m = u.getContext("2d");
3868
3868
  if (m) {
3869
- m.drawImage(t.canvas, g, h, o, e, 0, 0, o, e), m.filter = `blur(${a}px)`;
3869
+ m.drawImage(t.canvas, g, f, o, e, 0, 0, o, e), m.filter = `blur(${a}px)`;
3870
3870
  const y = document.createElement("canvas");
3871
3871
  y.width = u.width, y.height = u.height;
3872
3872
  const v = y.getContext("2d");
@@ -3876,8 +3876,8 @@ class ci {
3876
3876
  }
3877
3877
  t.globalCompositeOperation = "source-over", t.globalAlpha = l, t.fillStyle = r, t.fillRect(-o / 2, -e / 2, o, e), t.globalAlpha = 1, t.globalCompositeOperation = "source-atop";
3878
3878
  const d = t.createLinearGradient(-o / 2, -e / 2, o / 2, e / 2);
3879
- if (d.addColorStop(0, "rgba(255,255,255,0.12)"), d.addColorStop(0.3, "rgba(255,255,255,0.04)"), d.addColorStop(0.5, "rgba(255,255,255,0.0)"), d.addColorStop(1, "rgba(255,255,255,0.0)"), t.fillStyle = d, t.fillRect(-o / 2, -e / 2, o, e), f > 0) {
3880
- if (t.globalAlpha = f / 100, !this._noiseTileCanvas) {
3879
+ if (d.addColorStop(0, "rgba(255,255,255,0.12)"), d.addColorStop(0.3, "rgba(255,255,255,0.04)"), d.addColorStop(0.5, "rgba(255,255,255,0.0)"), d.addColorStop(1, "rgba(255,255,255,0.0)"), t.fillStyle = d, t.fillRect(-o / 2, -e / 2, o, e), h > 0) {
3880
+ if (t.globalAlpha = h / 100, !this._noiseTileCanvas) {
3881
3881
  const m = document.createElement("canvas");
3882
3882
  m.width = 64, m.height = 64;
3883
3883
  const y = m.getContext("2d"), v = y.createImageData(64, 64), b = v.data;
@@ -3903,15 +3903,15 @@ class ci {
3903
3903
  } else if (s.type === "Line")
3904
3904
  t.moveTo(-o / 2, 0), t.lineTo(o / 2, 0);
3905
3905
  else if (s.type === "Ellipse") {
3906
- const { startAngle: n = 0, sweepAngle: a = 360, ratio: r = 0 } = s, l = o / 2, f = e / 2, c = n * Math.PI / 180, g = a * Math.PI / 180, h = c + g;
3907
- a >= 360 && r <= 0 ? t.ellipse(0, 0, l, f, 0, 0, Math.PI * 2) : (t.ellipse(0, 0, l, f, 0, c, h, !1), r > 0 ? t.ellipse(0, 0, l * r, f * r, 0, h, c, !0) : t.lineTo(0, 0), t.closePath());
3906
+ const { startAngle: n = 0, sweepAngle: a = 360, ratio: r = 0 } = s, l = o / 2, h = e / 2, c = n * Math.PI / 180, g = a * Math.PI / 180, f = c + g;
3907
+ a >= 360 && r <= 0 ? t.ellipse(0, 0, l, h, 0, 0, Math.PI * 2) : (t.ellipse(0, 0, l, h, 0, c, f, !1), r > 0 ? t.ellipse(0, 0, l * r, h * r, 0, f, c, !0) : t.lineTo(0, 0), t.closePath());
3908
3908
  } else if (s.type === "Triangle")
3909
3909
  t.moveTo(0, -e / 2), t.lineTo(o / 2, e / 2), t.lineTo(-o / 2, e / 2), t.closePath();
3910
3910
  else if (s.type === "Polygon") {
3911
3911
  const n = s.sides || 3, a = s.radius || Math.min(o, e) / 2;
3912
3912
  for (let r = 0; r < n; r++) {
3913
- const l = r * 2 * Math.PI / n - Math.PI / 2, f = a * Math.cos(l), c = a * Math.sin(l);
3914
- r === 0 ? t.moveTo(f, c) : t.lineTo(f, c);
3913
+ const l = r * 2 * Math.PI / n - Math.PI / 2, h = a * Math.cos(l), c = a * Math.sin(l);
3914
+ r === 0 ? t.moveTo(h, c) : t.lineTo(h, c);
3915
3915
  }
3916
3916
  t.closePath();
3917
3917
  } else if (s.type === "Star") {
@@ -3919,8 +3919,8 @@ class ci {
3919
3919
  let r = s.inner_radius;
3920
3920
  r == null ? r = a * 0.382 : r <= 1 && (r = a * r);
3921
3921
  for (let l = 0; l < n * 2; l++) {
3922
- const f = l * Math.PI / n - Math.PI / 2, c = l % 2 === 0 ? a : r, g = c * Math.cos(f), h = c * Math.sin(f);
3923
- l === 0 ? t.moveTo(g, h) : t.lineTo(g, h);
3922
+ const h = l * Math.PI / n - Math.PI / 2, c = l % 2 === 0 ? a : r, g = c * Math.cos(h), f = c * Math.sin(h);
3923
+ l === 0 ? t.moveTo(g, f) : t.lineTo(g, f);
3924
3924
  }
3925
3925
  t.closePath();
3926
3926
  } else if (((s == null ? void 0 : s.type) === "Path" || s.type === "Subtract" || s.type === "Union" || s.type === "Intersect" || s.type === "Exclude" || s.type === "BooleanOperation") && s.points) {
@@ -3929,28 +3929,28 @@ class ci {
3929
3929
  if (s.points.forEach((g) => {
3930
3930
  typeof g.x == "number" && typeof g.y == "number" && (n = Math.min(n, g.x), a = Math.max(a, g.x), r = Math.min(r, g.y), l = Math.max(l, g.y), g.out_x !== void 0 && (n = Math.min(n, g.out_x), a = Math.max(a, g.out_x)), g.out_y !== void 0 && (r = Math.min(r, g.out_y), l = Math.max(l, g.out_y)), g.in_x !== void 0 && (n = Math.min(n, g.in_x), a = Math.max(a, g.in_x)), g.in_y !== void 0 && (r = Math.min(r, g.in_y), l = Math.max(l, g.in_y)));
3931
3931
  }), n === 1 / 0) return;
3932
- const f = (n + a) / 2, c = (r + l) / 2;
3933
- if (isNaN(f) || isNaN(c)) {
3934
- console.warn("[Engine] Invalid path center:", f, c);
3932
+ const h = (n + a) / 2, c = (r + l) / 2;
3933
+ if (isNaN(h) || isNaN(c)) {
3934
+ console.warn("[Engine] Invalid path center:", h, c);
3935
3935
  return;
3936
3936
  }
3937
- s.points.forEach((g, h) => {
3938
- if (h === 0 || g.moveTo)
3939
- t.moveTo(g.x - f, g.y - c);
3937
+ s.points.forEach((g, f) => {
3938
+ if (f === 0 || g.moveTo)
3939
+ t.moveTo(g.x - h, g.y - c);
3940
3940
  else {
3941
- const d = s.points[h - 1];
3941
+ const d = s.points[f - 1];
3942
3942
  if (!d) return;
3943
- const u = (d.out_x ?? d.x) - f, m = (d.out_y ?? d.y) - c, y = (g.in_x ?? g.x) - f, v = (g.in_y ?? g.y) - c;
3944
- isNaN(u) || isNaN(y) || isNaN(g.x) ? t.lineTo(g.x - f, g.y - c) : t.bezierCurveTo(u, m, y, v, g.x - f, g.y - c);
3943
+ const u = (d.out_x ?? d.x) - h, m = (d.out_y ?? d.y) - c, y = (g.in_x ?? g.x) - h, v = (g.in_y ?? g.y) - c;
3944
+ isNaN(u) || isNaN(y) || isNaN(g.x) ? t.lineTo(g.x - h, g.y - c) : t.bezierCurveTo(u, m, y, v, g.x - h, g.y - c);
3945
3945
  }
3946
- if (g.closePath || h === s.points.length - 1 && (s.is_closed || s.isClosed)) {
3947
- const d = [...s.points.slice(0, h + 1)].reverse().find((u) => u.moveTo) || s.points[0];
3946
+ if (g.closePath || f === s.points.length - 1 && (s.is_closed || s.isClosed)) {
3947
+ const d = [...s.points.slice(0, f + 1)].reverse().find((u) => u.moveTo) || s.points[0];
3948
3948
  d && (g.out_x !== void 0 || d.in_x !== void 0) && t.bezierCurveTo(
3949
- (g.out_x ?? g.x) - f,
3949
+ (g.out_x ?? g.x) - h,
3950
3950
  (g.out_y ?? g.y) - c,
3951
- (d.in_x ?? d.x) - f,
3951
+ (d.in_x ?? d.x) - h,
3952
3952
  (d.in_y ?? d.y) - c,
3953
- d.x - f,
3953
+ d.x - h,
3954
3954
  d.y - c
3955
3955
  ), t.closePath();
3956
3956
  }
@@ -3960,35 +3960,35 @@ class ci {
3960
3960
  s.points.forEach((g) => {
3961
3961
  n = Math.min(n, g.x), a = Math.max(a, g.x), r = Math.min(r, g.y), l = Math.max(l, g.y);
3962
3962
  });
3963
- const f = (n + a) / 2, c = (r + l) / 2;
3964
- s.points.forEach((g, h) => {
3965
- if (h === 0) t.moveTo(g.x - f, g.y - c);
3963
+ const h = (n + a) / 2, c = (r + l) / 2;
3964
+ s.points.forEach((g, f) => {
3965
+ if (f === 0) t.moveTo(g.x - h, g.y - c);
3966
3966
  else {
3967
- const d = s.points[h - 1];
3967
+ const d = s.points[f - 1];
3968
3968
  d.out_x !== void 0 || g.in_x !== void 0 ? t.bezierCurveTo(
3969
- (d.out_x ?? d.x) - f,
3969
+ (d.out_x ?? d.x) - h,
3970
3970
  (d.out_y ?? d.y) - c,
3971
- (g.in_x ?? g.x) - f,
3971
+ (g.in_x ?? g.x) - h,
3972
3972
  (g.in_y ?? g.y) - c,
3973
- g.x - f,
3973
+ g.x - h,
3974
3974
  g.y - c
3975
- ) : t.lineTo(g.x - f, g.y - c);
3975
+ ) : t.lineTo(g.x - h, g.y - c);
3976
3976
  }
3977
- (g.closePath || h === s.points.length - 1 && (s.is_closed || s.isClosed)) && t.closePath();
3977
+ (g.closePath || f === s.points.length - 1 && (s.is_closed || s.isClosed)) && t.closePath();
3978
3978
  });
3979
3979
  }
3980
3980
  }
3981
3981
  }
3982
3982
  renderInputBox(t, s) {
3983
3983
  var dt, St;
3984
- const o = this.objectStates.get(s.id), e = (o == null ? void 0 : o.options) || s.options || {}, i = ((dt = s.geometry) == null ? void 0 : dt.width) || 250, n = ((St = s.geometry) == null ? void 0 : St.height) || 45, a = this.focusedId === s.id, r = this.lastHoveredObjectId === s.id, l = e.previewState || "default", f = l !== "default" ? l : a ? "focused" : r ? "hovered" : "default", c = e.label || { visible: !0, text: "Label" }, g = e.helperText || { visible: !1, text: "Helper text" }, h = e.leftIcon || { visible: !1 }, d = e.rightIcon || { visible: !1 }, u = e.multiline === !0, m = e.corner_radius ?? 8, y = e.corners || { tl: m, tr: m, bl: m, br: m }, v = [y.tl, y.tr, y.br, y.bl];
3984
+ const o = this.objectStates.get(s.id), e = (o == null ? void 0 : o.options) || s.options || {}, i = ((dt = s.geometry) == null ? void 0 : dt.width) || 250, n = ((St = s.geometry) == null ? void 0 : St.height) || 45, a = this.focusedId === s.id, r = this.lastHoveredObjectId === s.id, l = e.previewState || "default", h = l !== "default" ? l : a ? "focused" : r ? "hovered" : "default", c = e.label || { visible: !0, text: "Label" }, g = e.helperText || { visible: !1, text: "Helper text" }, f = e.leftIcon || { visible: !1 }, d = e.rightIcon || { visible: !1 }, u = e.multiline === !0, m = e.corner_radius ?? 8, y = e.corners || { tl: m, tr: m, bl: m, br: m }, v = [y.tl, y.tr, y.br, y.bl];
3985
3985
  let b = e.backgroundColor || "rgba(31, 41, 55, 1)", C = e.borderColor || "rgba(55, 65, 81, 1)", S = e.borderWidth ?? 1.5, I = e.color || "#ffffff", w = e.placeholderColor || "rgba(156, 163, 175, 1)", M = e.fontSize || 14;
3986
- const P = `${f}Style`, T = e[P];
3987
- T ? (T.backgroundColor !== void 0 && (b = T.backgroundColor), T.borderColor !== void 0 && (C = T.borderColor), T.borderWidth !== void 0 && (S = T.borderWidth), T.color !== void 0 && (I = T.color), T.placeholderColor !== void 0 && (w = T.placeholderColor), T.fontSize !== void 0 && (M = T.fontSize)) : f === "focused" ? (C = e.focusBorderColor || "rgba(59, 130, 246, 1)", S = Math.max(S, 2)) : f === "hovered" || f === "hover" ? (C = e.hoverBorderColor || C, b = e.hoverBackgroundColor || b) : f === "disabled" ? (b = e.disabledBackgroundColor || "rgba(31, 41, 55, 0.6)", C = e.disabledBorderColor || "rgba(55, 65, 81, 0.4)") : f === "error" && (C = "rgba(239, 68, 68, 1)", S = Math.max(S, 2)), t.beginPath(), this.drawRoundRect(t, -i / 2, -n / 2, i, n, v);
3986
+ const P = `${h}Style`, T = e[P];
3987
+ T ? (T.backgroundColor !== void 0 && (b = T.backgroundColor), T.borderColor !== void 0 && (C = T.borderColor), T.borderWidth !== void 0 && (S = T.borderWidth), T.color !== void 0 && (I = T.color), T.placeholderColor !== void 0 && (w = T.placeholderColor), T.fontSize !== void 0 && (M = T.fontSize)) : h === "focused" ? (C = e.focusBorderColor || "rgba(59, 130, 246, 1)", S = Math.max(S, 2)) : h === "hovered" || h === "hover" ? (C = e.hoverBorderColor || C, b = e.hoverBackgroundColor || b) : h === "disabled" ? (b = e.disabledBackgroundColor || "rgba(31, 41, 55, 0.6)", C = e.disabledBorderColor || "rgba(55, 65, 81, 0.4)") : h === "error" && (C = "rgba(239, 68, 68, 1)", S = Math.max(S, 2)), t.beginPath(), this.drawRoundRect(t, -i / 2, -n / 2, i, n, v);
3988
3988
  const W = this.createCanvasFill(t, b, i, n);
3989
3989
  if (W && (t.fillStyle = W, t.fill()), S > 0) {
3990
3990
  const ht = this.createCanvasFill(t, C, i, n);
3991
- if (ht && (t.strokeStyle = ht, t.lineWidth = S, t.stroke()), f === "focused" || f === "focus") {
3991
+ if (ht && (t.strokeStyle = ht, t.lineWidth = S, t.stroke()), h === "focused" || h === "focus") {
3992
3992
  t.save(), t.beginPath();
3993
3993
  const mt = v.map((rt) => rt + 2);
3994
3994
  this.drawRoundRect(t, -i / 2 - 2, -n / 2 - 2, i + 4, n + 4, mt), t.strokeStyle = "rgba(59, 130, 246, 0.3)", t.lineWidth = 2, t.stroke(), t.restore();
@@ -4003,10 +4003,10 @@ class ci {
4003
4003
  }
4004
4004
  t.restore();
4005
4005
  };
4006
- k(h, !0), k(d, !1);
4007
- const _ = e.text || "", L = e.placeholder || "Enter text...", x = !_, A = _ || L, $ = x ? w : I, O = M, V = e.fontFamily || "Inter", H = e.fontWeight || 400;
4008
- t.font = `${H} ${O}px "${V}", sans-serif`, t.fillStyle = $, t.textAlign = "left", t.textBaseline = u ? "top" : "middle";
4009
- const et = e.inputPadding ?? 16, E = h.visible ? (h.offset ?? 16) + (h.size || 14) / 2 + 8 : et, F = d.visible ? (d.offset ?? 16) + (d.size || 14) / 2 + 8 : et, q = -(i / 2) + E, Q = i - E - F, it = e.inputType === "password" ? "•".repeat(A.length) : A;
4006
+ k(f, !0), k(d, !1);
4007
+ const _ = e.text || "", L = e.placeholder || "Enter text...", x = !_, A = _ || L, $ = x ? w : I, O = M, z = e.fontFamily || "Inter", H = e.fontWeight || 400;
4008
+ t.font = `${H} ${O}px "${z}", sans-serif`, t.fillStyle = $, t.textAlign = "left", t.textBaseline = u ? "top" : "middle";
4009
+ const et = e.inputPadding ?? 16, E = f.visible ? (f.offset ?? 16) + (f.size || 14) / 2 + 8 : et, F = d.visible ? (d.offset ?? 16) + (d.size || 14) / 2 + 8 : et, q = -(i / 2) + E, Q = i - E - F, it = e.inputType === "password" ? "•".repeat(A.length) : A;
4010
4010
  if (t.save(), t.beginPath(), t.rect(q - 2, -n / 2 + 4, Q + 4, n - 8), t.clip(), u) {
4011
4011
  const ht = it.split(`
4012
4012
  `);
@@ -4032,19 +4032,19 @@ class ci {
4032
4032
  }
4033
4033
  if (t.restore(), c.visible !== !1) {
4034
4034
  const ht = c.text || "Label", mt = c.fontSize || 12, rt = c.color || "rgba(156, 163, 175, 1)", Lt = c.offset ?? 8;
4035
- t.font = `600 ${mt}px "${V}", sans-serif`, t.fillStyle = rt, t.textAlign = "left", t.textBaseline = "bottom";
4035
+ t.font = `600 ${mt}px "${z}", sans-serif`, t.fillStyle = rt, t.textAlign = "left", t.textBaseline = "bottom";
4036
4036
  const Gt = -(i / 2), Pt = -(n / 2) - Lt;
4037
4037
  t.fillText(ht, Gt, Pt);
4038
4038
  }
4039
4039
  if (g.visible === !0) {
4040
- const ht = g.text || "Helper text", mt = g.fontSize || 11, rt = f === "error" ? "rgba(239, 68, 68, 1)" : g.color || "rgba(156, 163, 175, 1)", Lt = g.offset ?? 6;
4041
- t.font = `400 ${mt}px "${V}", sans-serif`, t.fillStyle = rt, t.textAlign = "left", t.textBaseline = "top";
4040
+ const ht = g.text || "Helper text", mt = g.fontSize || 11, rt = h === "error" ? "rgba(239, 68, 68, 1)" : g.color || "rgba(156, 163, 175, 1)", Lt = g.offset ?? 6;
4041
+ t.font = `400 ${mt}px "${z}", sans-serif`, t.fillStyle = rt, t.textAlign = "left", t.textBaseline = "top";
4042
4042
  const Gt = -(i / 2), Pt = n / 2 + Lt;
4043
4043
  t.fillText(ht, Gt, Pt);
4044
4044
  }
4045
4045
  }
4046
4046
  renderSlider(t, s) {
4047
- const o = this.objectStates.get(s.id), e = (o == null ? void 0 : o.geometry) || s.geometry, i = (o == null ? void 0 : o.options) || s.options || {}, n = e.width || 200, a = i.value ?? 50, r = i.min ?? 0, f = (i.max ?? 100) - r, c = f === 0 ? 0 : (a - r) / f, g = i.trackHeight || 4, h = i.trackRoundedness ?? 2, d = i.trackShape ?? "Rectangle", u = i.trackPath || "", m = i.accentColor || "#3b82f6", y = i.inactiveColor || "#374151", v = i.thumbShape || "Ellipse", b = i.thumbWidth ?? 16, C = i.thumbHeight ?? 16, S = i.thumbRoundedness ?? 0, I = i.thumbColor || "#ffffff", w = i.thumbPath || "", M = i.thumbIcon || "", P = i.showValueTooltip ?? !1, T = i.tooltipBgColor || "#333333", W = i.tooltipColor || "#ffffff", k = i.tooltipOffsetX ?? 0, _ = i.tooltipOffsetY ?? -25, L = (Q, it, dt, St, ht, mt, rt) => {
4047
+ const o = this.objectStates.get(s.id), e = (o == null ? void 0 : o.geometry) || s.geometry, i = (o == null ? void 0 : o.options) || s.options || {}, n = e.width || 200, a = i.value ?? 50, r = i.min ?? 0, h = (i.max ?? 100) - r, c = h === 0 ? 0 : (a - r) / h, g = i.trackHeight || 4, f = i.trackRoundedness ?? 2, d = i.trackShape ?? "Rectangle", u = i.trackPath || "", m = i.accentColor || "#3b82f6", y = i.inactiveColor || "#374151", v = i.thumbShape || "Ellipse", b = i.thumbWidth ?? 16, C = i.thumbHeight ?? 16, S = i.thumbRoundedness ?? 0, I = i.thumbColor || "#ffffff", w = i.thumbPath || "", M = i.thumbIcon || "", P = i.showValueTooltip ?? !1, T = i.tooltipBgColor || "#333333", W = i.tooltipColor || "#ffffff", k = i.tooltipOffsetX ?? 0, _ = i.tooltipOffsetY ?? -25, L = (Q, it, dt, St, ht, mt, rt) => {
4048
4048
  if ((Q === "Custom" || Q === "Icon") && rt)
4049
4049
  try {
4050
4050
  const Lt = new Path2D(rt);
@@ -4082,14 +4082,14 @@ class ci {
4082
4082
  } else Q === "Line" && (t.moveTo(it - St / 2, dt), t.lineTo(it + St / 2, dt));
4083
4083
  t.fill();
4084
4084
  }, x = this.createCanvasFill(t, y, n, g);
4085
- x && (t.fillStyle = x, t.strokeStyle = x), d === "Line" ? (t.lineWidth = g, t.beginPath(), t.moveTo(-n / 2, 0), t.lineTo(n / 2, 0), t.stroke()) : L(d, 0, 0, n, g, h, u);
4085
+ x && (t.fillStyle = x, t.strokeStyle = x), d === "Line" ? (t.lineWidth = g, t.beginPath(), t.moveTo(-n / 2, 0), t.lineTo(n / 2, 0), t.stroke()) : L(d, 0, 0, n, g, f, u);
4086
4086
  const A = n - b, $ = -n / 2 + b / 2 + c * A, O = $ - -n / 2;
4087
4087
  if (O > 0) {
4088
4088
  const Q = this.createCanvasFill(t, m, n, g);
4089
- Q && (t.fillStyle = Q, t.strokeStyle = Q), d === "Line" ? (t.lineWidth = g, t.beginPath(), t.moveTo(-n / 2, 0), t.lineTo($, 0), t.stroke()) : d === "Rectangle" && (t.beginPath(), this.drawRoundRect(t, -n / 2, -g / 2, O, g, h), t.fill());
4089
+ Q && (t.fillStyle = Q, t.strokeStyle = Q), d === "Line" ? (t.lineWidth = g, t.beginPath(), t.moveTo(-n / 2, 0), t.lineTo($, 0), t.stroke()) : d === "Rectangle" && (t.beginPath(), this.drawRoundRect(t, -n / 2, -g / 2, O, g, f), t.fill());
4090
4090
  }
4091
4091
  t.save(), t.translate($, 0);
4092
- const V = t.getTransform(), H = Math.sqrt(V.a * V.a + V.b * V.b) || 1;
4092
+ const z = t.getTransform(), H = Math.sqrt(z.a * z.a + z.b * z.b) || 1;
4093
4093
  t.shadowColor = "rgba(0,0,0,0.2)", t.shadowBlur = 4 * H, t.shadowOffsetY = 1 * H;
4094
4094
  const et = this.createCanvasFill(t, I, b, C);
4095
4095
  if (et && (t.fillStyle = et), L(v, 0, 0, b, C, S, v === "Icon" ? M : w), t.restore(), P) {
@@ -4117,11 +4117,11 @@ class ci {
4117
4117
  var _;
4118
4118
  const o = this.objectStates.get(s.id);
4119
4119
  if (!o) return;
4120
- const e = o.options || s.options || {}, i = s.geometry.width || 160, n = s.geometry.height || 40, a = -i / 2, r = -n / 2, l = e.corner_radius ?? 6, f = e.disabled || e.previewState === "disabled", c = this.lastHoveredObjectId === s.id || e.previewState === "hover", g = (e.isOpen || e.previewState === "active") && !f;
4121
- let h = e.backgroundColor, d = e.borderColor, u = e.color || "#333333";
4122
- f ? (h = e.disabledBackgroundColor || "#f3f4f6", d = e.disabledBorderColor || "#e5e7eb", u = e.disabledColor || "#9ca3af") : g ? (h = e.activeBackgroundColor || h, d = e.activeBorderColor || d, u = e.activeColor || u) : c && (h = e.hoverBackgroundColor || h, d = e.hoverBorderColor || d, u = e.hoverColor || u), h || (h = "#ffffff"), d || (d = "#e5e7eb");
4120
+ const e = o.options || s.options || {}, i = s.geometry.width || 160, n = s.geometry.height || 40, a = -i / 2, r = -n / 2, l = e.corner_radius ?? 6, h = e.disabled || e.previewState === "disabled", c = this.lastHoveredObjectId === s.id || e.previewState === "hover", g = (e.isOpen || e.previewState === "active") && !h;
4121
+ let f = e.backgroundColor, d = e.borderColor, u = e.color || "#333333";
4122
+ h ? (f = e.disabledBackgroundColor || "#f3f4f6", d = e.disabledBorderColor || "#e5e7eb", u = e.disabledColor || "#9ca3af") : g ? (f = e.activeBackgroundColor || f, d = e.activeBorderColor || d, u = e.activeColor || u) : c && (f = e.hoverBackgroundColor || f, d = e.hoverBorderColor || d, u = e.hoverColor || u), f || (f = "#ffffff"), d || (d = "#e5e7eb");
4123
4123
  const m = t.globalAlpha;
4124
- t.globalAlpha = m * (e.opacity ?? 1), this.drawRoundRect(t, a, r, i, n, l), t.fillStyle = this.createCanvasFill(t, typeof h == "string" ? { type: "Solid", color: h } : h, i, n) || "#ffffff", t.fill();
4124
+ t.globalAlpha = m * (e.opacity ?? 1), this.drawRoundRect(t, a, r, i, n, l), t.fillStyle = this.createCanvasFill(t, typeof f == "string" ? { type: "Solid", color: f } : f, i, n) || "#ffffff", t.fill();
4125
4125
  const y = e.borderWidth ?? 1;
4126
4126
  y > 0 && (t.strokeStyle = this.createCanvasFill(t, typeof d == "string" ? { type: "Solid", color: d } : d, i, n) || "#e5e7eb", t.lineWidth = y, t.stroke());
4127
4127
  const v = 12, b = e.chevronType || "chevron", C = e.chevronSize || 16, S = (g ? e.openIconColor : e.closedIconColor) || e.chevronColor || "#6b7280";
@@ -4144,14 +4144,14 @@ class ci {
4144
4144
  }
4145
4145
  const I = e.selectedOption || e.placeholder || "Select...", w = e.fontSize || 14, M = e.fontWeight || 400, P = e.fontFamily || "Inter, sans-serif";
4146
4146
  t.font = `${M} ${w}px ${P}`;
4147
- const T = f ? e.disabledColor || "#9ca3af" : !e.selectedOption && e.placeholder ? "#9ca3af" : u;
4147
+ const T = h ? e.disabledColor || "#9ca3af" : !e.selectedOption && e.placeholder ? "#9ca3af" : u;
4148
4148
  t.fillStyle = this.createCanvasFill(t, typeof T == "string" ? { type: "Solid", color: T } : T, i, n) || "#333333", t.textAlign = "left", t.textBaseline = "middle";
4149
4149
  const W = b === "none" ? 0 : C + 8, k = i - v * 2 - W;
4150
- if (t.save(), t.beginPath(), t.rect(a + v, r, k, n), t.clip(), t.fillText(I, a + v, 0), t.restore(), g && !f) {
4151
- const L = r + n + 4, x = e.optionsList || [], A = e.itemHeight || 32, $ = e.listPadding ?? 4, O = x.length * A + $ * 2, V = e.listCornerRadius ?? l;
4150
+ if (t.save(), t.beginPath(), t.rect(a + v, r, k, n), t.clip(), t.fillText(I, a + v, 0), t.restore(), g && !h) {
4151
+ const L = r + n + 4, x = e.optionsList || [], A = e.itemHeight || 32, $ = e.listPadding ?? 4, O = x.length * A + $ * 2, z = e.listCornerRadius ?? l;
4152
4152
  t.save();
4153
4153
  const H = e.listShadow || {}, et = t.getTransform(), E = Math.sqrt(et.a * et.a + et.b * et.b) || 1;
4154
- t.shadowColor = typeof H.color == "string" ? H.color : ((_ = H.color) == null ? void 0 : _.color) || "rgba(0,0,0,0.15)", t.shadowBlur = (H.blur ?? 12) * E, t.shadowOffsetY = (H.offsetY ?? 6) * E, t.shadowOffsetX = (H.offsetX ?? 0) * E, t.beginPath(), this.drawRoundRect(t, a, L, i, O, V), t.fillStyle = this.createCanvasFill(t, typeof e.listBackgroundColor == "string" ? { type: "Solid", color: e.listBackgroundColor } : e.listBackgroundColor || { type: "Solid", color: "#ffffff" }, i, O) || "#ffffff", t.fill();
4154
+ t.shadowColor = typeof H.color == "string" ? H.color : ((_ = H.color) == null ? void 0 : _.color) || "rgba(0,0,0,0.15)", t.shadowBlur = (H.blur ?? 12) * E, t.shadowOffsetY = (H.offsetY ?? 6) * E, t.shadowOffsetX = (H.offsetX ?? 0) * E, t.beginPath(), this.drawRoundRect(t, a, L, i, O, z), t.fillStyle = this.createCanvasFill(t, typeof e.listBackgroundColor == "string" ? { type: "Solid", color: e.listBackgroundColor } : e.listBackgroundColor || { type: "Solid", color: "#ffffff" }, i, O) || "#ffffff", t.fill();
4155
4155
  const F = e.listBorderWidth ?? 1;
4156
4156
  F > 0 && (t.shadowColor = "transparent", t.strokeStyle = this.createCanvasFill(t, typeof e.listBorderColor == "string" ? { type: "Solid", color: e.listBorderColor } : e.listBorderColor || { type: "Solid", color: d }, i, O) || "#e5e7eb", t.lineWidth = F, t.stroke()), t.restore();
4157
4157
  const q = e.itemFontSize || w, Q = e.itemFontFamily || P;
@@ -4170,35 +4170,35 @@ class ci {
4170
4170
  }
4171
4171
  renderButton(t, s) {
4172
4172
  if (s.children && s.children.length > 0) return;
4173
- const o = this.objectStates.get(s.id), e = (o == null ? void 0 : o.options) || s.options || {}, i = s.geometry || {}, n = i.width || 120, a = i.height || 40, r = this.lastHoveredObjectId === s.id, l = this.activeObjectId === s.id, f = e.label || {}, c = e.hoverStyle || {}, g = e.activeStyle || {}, h = e.icon || { enabled: !1 };
4174
- let d = e.backgroundColor || "#3b82f6", u = f.color || "#ffffff", m = f.text || "Button", y = i.cornerRadius ?? 8, v = e.borderColor || "transparent", b = e.borderWidth || 0, C = 1;
4173
+ const o = this.objectStates.get(s.id), e = (o == null ? void 0 : o.options) || s.options || {}, i = s.geometry || {}, n = i.width || 120, a = i.height || 40, r = this.lastHoveredObjectId === s.id, l = this.activeObjectId === s.id, h = e.label || {}, c = e.hoverStyle || {}, g = e.activeStyle || {}, f = e.icon || { enabled: !1 };
4174
+ let d = e.backgroundColor || "#3b82f6", u = h.color || "#ffffff", m = h.text || "Button", y = i.cornerRadius ?? 8, v = e.borderColor || "transparent", b = e.borderWidth || 0, C = 1;
4175
4175
  l && g ? (d = g.backgroundColor || d, u = g.color || u, m = g.text || m, C = g.scale ?? 0.95, y = g.cornerRadius ?? y) : r && c && (d = c.backgroundColor || d, u = c.color || u, m = c.text || m, C = c.scale ?? 1, y = c.cornerRadius ?? y, v = c.borderColor || v);
4176
4176
  const S = -n / 2, I = -a / 2;
4177
4177
  t.save(), t.scale(C, C), t.beginPath(), this.drawRoundRect(t, S, I, n, a, y);
4178
4178
  const w = this.createCanvasFill(t, d, n, a);
4179
4179
  w && (t.fillStyle = w, t.fill()), (b > 0 || r && c.borderColor) && (t.strokeStyle = v, t.lineWidth = b || (r ? 1 : 0), t.stroke());
4180
- const M = f.fontSize || 14, P = f.fontFamily || "Inter", T = f.fontWeight || 600;
4180
+ const M = h.fontSize || 14, P = h.fontFamily || "Inter", T = h.fontWeight || 600;
4181
4181
  t.font = `${T} ${M}px "${P}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif`, t.fillStyle = u, t.textAlign = "center", t.textBaseline = "middle";
4182
4182
  let W = 0;
4183
- if (h.enabled && h.svgPath) {
4184
- const k = M * 1.1, _ = h.gap || 8, L = t.measureText(m), A = -(L.width + k + _) / 2, $ = h.position === "left" ? A + k / 2 : A + L.width + _ + k / 2;
4185
- W = h.position === "left" ? A + k + _ + L.width / 2 : A + L.width / 2, t.save(), t.translate($, 0);
4186
- const O = new Path2D(h.svgPath), V = k / 24;
4187
- t.scale(V, V), t.translate(-12, -12), t.fillStyle = u, t.fill(O), t.restore();
4183
+ if (f.enabled && f.svgPath) {
4184
+ const k = M * 1.1, _ = f.gap || 8, L = t.measureText(m), A = -(L.width + k + _) / 2, $ = f.position === "left" ? A + k / 2 : A + L.width + _ + k / 2;
4185
+ W = f.position === "left" ? A + k + _ + L.width / 2 : A + L.width / 2, t.save(), t.translate($, 0);
4186
+ const O = new Path2D(f.svgPath), z = k / 24;
4187
+ t.scale(z, z), t.translate(-12, -12), t.fillStyle = u, t.fill(O), t.restore();
4188
4188
  }
4189
4189
  t.fillText(m, W, 0), t.restore();
4190
4190
  }
4191
4191
  renderToggleButton(t, s) {
4192
4192
  var m, y;
4193
- const o = this.objectStates.get(s.id), e = (o == null ? void 0 : o.options) || s.options || {}, i = e.checked ?? !1, n = ((m = s.geometry) == null ? void 0 : m.width) || 120, a = ((y = s.geometry) == null ? void 0 : y.height) || 40, r = -n / 2, l = -a / 2, f = e.corner_radius ?? 8, c = e.label || {}, g = i ? e.accentColor || "#3b82f6" : e.inactiveColor || "#374151", h = i ? e.activeTextColor || "#ffffff" : e.inactiveTextColor || "#9ca3af";
4194
- t.save(), t.beginPath(), this.drawRoundRect(t, r, l, n, a, f), t.fillStyle = g, t.fill();
4193
+ const o = this.objectStates.get(s.id), e = (o == null ? void 0 : o.options) || s.options || {}, i = e.checked ?? !1, n = ((m = s.geometry) == null ? void 0 : m.width) || 120, a = ((y = s.geometry) == null ? void 0 : y.height) || 40, r = -n / 2, l = -a / 2, h = e.corner_radius ?? 8, c = e.label || {}, g = i ? e.accentColor || "#3b82f6" : e.inactiveColor || "#374151", f = i ? e.activeTextColor || "#ffffff" : e.inactiveTextColor || "#9ca3af";
4194
+ t.save(), t.beginPath(), this.drawRoundRect(t, r, l, n, a, h), t.fillStyle = g, t.fill();
4195
4195
  const d = c.fontSize || 14, u = c.fontFamily || "Inter";
4196
- t.font = `${c.fontWeight || 600} ${d}px "${u}", sans-serif`, t.fillStyle = h, t.textAlign = "center", t.textBaseline = "middle", t.fillText(c.text || "Toggle", 0, 0), t.restore();
4196
+ t.font = `${c.fontWeight || 600} ${d}px "${u}", sans-serif`, t.fillStyle = f, t.textAlign = "center", t.textBaseline = "middle", t.fillText(c.text || "Toggle", 0, 0), t.restore();
4197
4197
  }
4198
4198
  renderToggle(t, s) {
4199
- var V, H, et, E, F, q, Q, it, dt, St, ht, mt;
4200
- const o = this.objectStates.get(s.id), e = (o == null ? void 0 : o.options) || s.options || {}, i = ((V = s.geometry) == null ? void 0 : V.width) || 52, n = ((H = s.geometry) == null ? void 0 : H.height) || 30, a = -i / 2, r = -n / 2, l = e.checked ?? !1, f = e.cornerRadius ?? e.corner_radius ?? n / 2, c = e.toggleStyle || {}, g = c.backgroundColor || e.activeColor || "#10b981", h = c.borderColor || e.borderColor || "transparent", d = c.borderWidth ?? e.borderWidth ?? 0, u = c.knobColor || e.knobColor || "#ffffff", m = l ? g : e.inactiveColor || "#374151", y = l ? h : e.borderColor || "transparent", v = l ? d : e.borderWidth ?? 0, b = l ? u : e.knobColor || "#ffffff";
4201
- e.disabled && (t.globalAlpha *= 0.5), t.beginPath(), this.drawRoundRect(t, a, r, i, n, f);
4199
+ var z, H, et, E, F, q, Q, it, dt, St, ht, mt;
4200
+ const o = this.objectStates.get(s.id), e = (o == null ? void 0 : o.options) || s.options || {}, i = ((z = s.geometry) == null ? void 0 : z.width) || 52, n = ((H = s.geometry) == null ? void 0 : H.height) || 30, a = -i / 2, r = -n / 2, l = e.checked ?? !1, h = e.cornerRadius ?? e.corner_radius ?? n / 2, c = e.toggleStyle || {}, g = c.backgroundColor || e.activeColor || "#10b981", f = c.borderColor || e.borderColor || "transparent", d = c.borderWidth ?? e.borderWidth ?? 0, u = c.knobColor || e.knobColor || "#ffffff", m = l ? g : e.inactiveColor || "#374151", y = l ? f : e.borderColor || "transparent", v = l ? d : e.borderWidth ?? 0, b = l ? u : e.knobColor || "#ffffff";
4201
+ e.disabled && (t.globalAlpha *= 0.5), t.beginPath(), this.drawRoundRect(t, a, r, i, n, h);
4202
4202
  const C = this.createCanvasFill(t, m, i, n);
4203
4203
  if (C && (t.fillStyle = C, t.fill()), v > 0) {
4204
4204
  t.lineWidth = v;
@@ -4230,22 +4230,22 @@ class ci {
4230
4230
  }
4231
4231
  renderCheckbox(t, s) {
4232
4232
  var C, S;
4233
- const o = this.objectStates.get(s.id), e = (o == null ? void 0 : o.options) || s.options || {}, i = ((C = s.geometry) == null ? void 0 : C.width) || 20, n = ((S = s.geometry) == null ? void 0 : S.height) || 20, a = -i / 2, r = -n / 2, l = e.cornerRadius ?? 4, f = e.checked ?? !1, c = e.activeColor || "#3b82f6", g = e.inactiveColor || "transparent", h = e.checkColor || "#ffffff", d = e.borderColor || "#4b5563", u = e.borderWidth ?? 2, m = f ? c : g, y = f ? "transparent" : d, v = f ? 0 : u;
4233
+ const o = this.objectStates.get(s.id), e = (o == null ? void 0 : o.options) || s.options || {}, i = ((C = s.geometry) == null ? void 0 : C.width) || 20, n = ((S = s.geometry) == null ? void 0 : S.height) || 20, a = -i / 2, r = -n / 2, l = e.cornerRadius ?? 4, h = e.checked ?? !1, c = e.activeColor || "#3b82f6", g = e.inactiveColor || "transparent", f = e.checkColor || "#ffffff", d = e.borderColor || "#4b5563", u = e.borderWidth ?? 2, m = h ? c : g, y = h ? "transparent" : d, v = h ? 0 : u;
4234
4234
  e.disabled && (t.globalAlpha *= 0.5), t.beginPath(), this.drawRoundRect(t, a, r, i, n, l);
4235
4235
  const b = this.createCanvasFill(t, m, i, n);
4236
4236
  if (b && (t.fillStyle = b, t.fill()), v > 0) {
4237
4237
  t.lineWidth = v;
4238
4238
  const I = this.createCanvasFill(t, y, i, n);
4239
4239
  I && (t.strokeStyle = I, t.stroke());
4240
- } else if (f) {
4240
+ } else if (h) {
4241
4241
  t.lineWidth = 1;
4242
4242
  const I = this.createCanvasFill(t, c, i, n);
4243
4243
  I && (t.strokeStyle = I, t.stroke());
4244
4244
  }
4245
- if (f) {
4245
+ if (h) {
4246
4246
  t.save(), t.beginPath();
4247
- const I = this.createCanvasFill(t, h, i, n);
4248
- t.strokeStyle = I || h, t.lineWidth = Math.max(2, i * 0.12), t.lineCap = "round", t.lineJoin = "round";
4247
+ const I = this.createCanvasFill(t, f, i, n);
4248
+ t.strokeStyle = I || f, t.lineWidth = Math.max(2, i * 0.12), t.lineCap = "round", t.lineJoin = "round";
4249
4249
  const w = a + i * 0.25, M = r + n * 0.5, P = a + i * 0.45, T = r + n * 0.7, W = a + i * 0.75, k = r + n * 0.25;
4250
4250
  t.moveTo(w, M), t.lineTo(P, T), t.lineTo(W, k), t.stroke(), t.restore();
4251
4251
  }
@@ -4259,24 +4259,24 @@ class ci {
4259
4259
  }
4260
4260
  renderRadioGroup(t, s) {
4261
4261
  var S, I;
4262
- const o = this.objectStates.get(s.id), e = (o == null ? void 0 : o.options) || s.options || {}, i = ((S = s.geometry) == null ? void 0 : S.width) || 180, n = ((I = s.geometry) == null ? void 0 : I.height) || 100, a = -i / 2, r = -n / 2, l = e.selectedValue, f = e.optionsList || ["Option 1", "Option 2", "Option 3"], c = e.orientation || "vertical", g = e.itemGap !== void 0 ? e.itemGap : 16, h = e.activeColor || "#3b82f6", d = e.inactiveColor || "#4b5563", u = e.textColor || "#ffffff", m = e.fontSize || 14, y = e.fontFamily || "Inter", v = e.fontWeight || 400;
4262
+ const o = this.objectStates.get(s.id), e = (o == null ? void 0 : o.options) || s.options || {}, i = ((S = s.geometry) == null ? void 0 : S.width) || 180, n = ((I = s.geometry) == null ? void 0 : I.height) || 100, a = -i / 2, r = -n / 2, l = e.selectedValue, h = e.optionsList || ["Option 1", "Option 2", "Option 3"], c = e.orientation || "vertical", g = e.itemGap !== void 0 ? e.itemGap : 16, f = e.activeColor || "#3b82f6", d = e.inactiveColor || "#4b5563", u = e.textColor || "#ffffff", m = e.fontSize || 14, y = e.fontFamily || "Inter", v = e.fontWeight || 400;
4263
4263
  e.disabled && (t.globalAlpha *= 0.5);
4264
4264
  const b = 8, C = b * 2;
4265
4265
  if (t.save(), t.font = `${v} ${m}px "${y}", sans-serif`, t.textBaseline = "middle", t.textAlign = "left", c === "vertical") {
4266
4266
  const w = Math.max(C, m) + g;
4267
- f.forEach((M, P) => {
4267
+ h.forEach((M, P) => {
4268
4268
  const T = r + P * w + b;
4269
4269
  t.beginPath(), t.arc(a + b, T, b, 0, Math.PI * 2);
4270
- const W = l === M, k = this.createCanvasFill(t, h, C, C), _ = this.createCanvasFill(t, d, C, C);
4271
- W ? (t.strokeStyle = k || h, t.lineWidth = 2, t.stroke(), t.beginPath(), t.arc(a + b, T, b / 2, 0, Math.PI * 2), t.fillStyle = k || h, t.fill()) : (t.strokeStyle = _ || d, t.lineWidth = 1.5, t.stroke()), t.fillStyle = u, t.fillText(M, a + C + 8, T);
4270
+ const W = l === M, k = this.createCanvasFill(t, f, C, C), _ = this.createCanvasFill(t, d, C, C);
4271
+ W ? (t.strokeStyle = k || f, t.lineWidth = 2, t.stroke(), t.beginPath(), t.arc(a + b, T, b / 2, 0, Math.PI * 2), t.fillStyle = k || f, t.fill()) : (t.strokeStyle = _ || d, t.lineWidth = 1.5, t.stroke()), t.fillStyle = u, t.fillText(M, a + C + 8, T);
4272
4272
  });
4273
4273
  } else {
4274
4274
  let w = a;
4275
- f.forEach((M) => {
4275
+ h.forEach((M) => {
4276
4276
  const P = l === M, T = t.measureText(M).width;
4277
4277
  t.beginPath(), t.arc(w + b, 0, b, 0, Math.PI * 2);
4278
- const W = this.createCanvasFill(t, h, C, C), k = this.createCanvasFill(t, d, C, C);
4279
- P ? (t.strokeStyle = W || h, t.lineWidth = 2, t.stroke(), t.beginPath(), t.arc(w + b, 0, b / 2, 0, Math.PI * 2), t.fillStyle = W || h, t.fill()) : (t.strokeStyle = k || d, t.lineWidth = 1.5, t.stroke()), t.fillStyle = u, t.fillText(M, w + C + 6, 0), w += C + 6 + T + g;
4278
+ const W = this.createCanvasFill(t, f, C, C), k = this.createCanvasFill(t, d, C, C);
4279
+ P ? (t.strokeStyle = W || f, t.lineWidth = 2, t.stroke(), t.beginPath(), t.arc(w + b, 0, b / 2, 0, Math.PI * 2), t.fillStyle = W || f, t.fill()) : (t.strokeStyle = k || d, t.lineWidth = 1.5, t.stroke()), t.fillStyle = u, t.fillText(M, w + C + 6, 0), w += C + 6 + T + g;
4280
4280
  });
4281
4281
  }
4282
4282
  if (t.restore(), e.disabled && (t.globalAlpha *= 2), e.label && e.label.text) {
@@ -4326,8 +4326,8 @@ class ci {
4326
4326
  },
4327
4327
  _makeGradient: function(k, _, L, x, A, $) {
4328
4328
  if (!this._getPreset().barGradient && !this.barGradient) return _;
4329
- const V = k.createLinearGradient(L, x, A, $);
4330
- return V.addColorStop(0, _), V.addColorStop(1, _ + "44"), V;
4329
+ const z = k.createLinearGradient(L, x, A, $);
4330
+ return z.addColorStop(0, _), z.addColorStop(1, _ + "44"), z;
4331
4331
  },
4332
4332
  _drawRoundedBar: function(k, _, L, x, A, $, O) {
4333
4333
  if ($ = Math.min($, Math.min(Math.abs(x), Math.abs(A)) / 2), $ <= 0 || x === 0 || A === 0) {
@@ -4341,11 +4341,11 @@ class ci {
4341
4341
  t.save(), t.fillStyle = "rgba(99,102,241,0.7)", t.font = "bold 11px Inter, sans-serif", t.textAlign = "center", t.textBaseline = "middle", t.fillText("NO CHART DATA", 0, 0), t.restore();
4342
4342
  return;
4343
4343
  }
4344
- const f = i._getPreset();
4344
+ const h = i._getPreset();
4345
4345
  let c = -1 / 0, g = 1 / 0;
4346
- const h = i.categories.length, d = i.datasets.length;
4346
+ const f = i.categories.length, d = i.datasets.length;
4347
4347
  if (i.chartType === "stacked")
4348
- for (let k = 0; k < h; k++) {
4348
+ for (let k = 0; k < f; k++) {
4349
4349
  let _ = 0, L = 0;
4350
4350
  i.datasets.forEach((x) => {
4351
4351
  const A = x.data[k] ?? 0;
@@ -4362,18 +4362,18 @@ class ci {
4362
4362
  const u = c - g || 10;
4363
4363
  t.save(), t.font = `${i.axisLabelFontSize}px Inter, sans-serif`;
4364
4364
  const m = i.showYLabels ? t.measureText(c.toFixed(0)).width + 14 : 10, y = i.showXLabels ? i.axisLabelFontSize + 12 : 8, b = (i.showLegend && d > 0 ? i.legendFontSize + 10 : 0) + 8, C = 10, S = r + m, I = l + b, w = n - m - C, M = a - b - y;
4365
- if (t.beginPath(), t.roundRect(r, l, n, a, 10), t.fillStyle = f.cardBackground, t.fill(), t.strokeStyle = f.cardBorderColor, t.lineWidth = 1, t.stroke(), i.showLegend && d > 0) {
4365
+ if (t.beginPath(), t.roundRect(r, l, n, a, 10), t.fillStyle = h.cardBackground, t.fill(), t.strokeStyle = h.cardBorderColor, t.lineWidth = 1, t.stroke(), i.showLegend && d > 0) {
4366
4366
  t.font = `${i.legendFontSize}px Inter, sans-serif`, t.textBaseline = "middle";
4367
4367
  const k = l + 12;
4368
4368
  let _ = S;
4369
4369
  i.datasets.forEach((L, x) => {
4370
4370
  const A = i._resolveColor(L.color, x), $ = L.label || `Series ${x + 1}`, O = 7;
4371
- t.beginPath(), t.roundRect(_, k - O / 2, O, O, 2), t.fillStyle = A, t.fill(), t.fillStyle = f.legendColor, t.textAlign = "left", t.fillText($, _ + O + 4, k), _ += t.measureText($).width + O + 16;
4371
+ t.beginPath(), t.roundRect(_, k - O / 2, O, O, 2), t.fillStyle = A, t.fill(), t.fillStyle = h.legendColor, t.textAlign = "left", t.fillText($, _ + O + 4, k), _ += t.measureText($).width + O + 16;
4372
4372
  });
4373
4373
  }
4374
4374
  const P = 4;
4375
4375
  if (i.showGridLines) {
4376
- t.setLineDash([3, 4]), t.lineWidth = 1, t.strokeStyle = f.gridColor;
4376
+ t.setLineDash([3, 4]), t.lineWidth = 1, t.strokeStyle = h.gridColor;
4377
4377
  for (let k = 0; k <= P; k++) {
4378
4378
  const _ = I + k / P * M;
4379
4379
  t.beginPath(), t.moveTo(S, _), t.lineTo(S + w, _), t.stroke();
@@ -4381,37 +4381,37 @@ class ci {
4381
4381
  t.setLineDash([]);
4382
4382
  }
4383
4383
  if (i.showYLabels) {
4384
- t.font = `${i.axisLabelFontSize}px Inter, sans-serif`, t.textAlign = "right", t.textBaseline = "middle", t.fillStyle = f.axisLabelColor;
4384
+ t.font = `${i.axisLabelFontSize}px Inter, sans-serif`, t.textAlign = "right", t.textBaseline = "middle", t.fillStyle = h.axisLabelColor;
4385
4385
  for (let k = 0; k <= P; k++) {
4386
4386
  const _ = c - k / P * u, L = I + k / P * M;
4387
4387
  t.fillText(_.toFixed(0), S - 6, L);
4388
4388
  }
4389
4389
  }
4390
4390
  if (t.lineWidth = 1, t.setLineDash([]), i.showXAxis && (t.strokeStyle = i.xAxisColor, t.beginPath(), t.moveTo(S, I + M), t.lineTo(S + w, I + M), t.stroke()), i.showYAxis && (t.strokeStyle = i.yAxisColor, t.beginPath(), t.moveTo(S, I), t.lineTo(S, I + M), t.stroke()), i.chartType === "stacked") {
4391
- const k = w / h;
4392
- for (let _ = 0; _ < h; _++) {
4391
+ const k = w / f;
4392
+ for (let _ = 0; _ < f; _++) {
4393
4393
  const L = S + _ * k + k / 2;
4394
- i.showXLabels && (t.font = `${i.axisLabelFontSize}px Inter, sans-serif`, t.textAlign = "center", t.textBaseline = "top", t.fillStyle = f.axisLabelColor, t.fillText(i.categories[_] || "", L, I + M + 5));
4394
+ i.showXLabels && (t.font = `${i.axisLabelFontSize}px Inter, sans-serif`, t.textAlign = "center", t.textBaseline = "top", t.fillStyle = h.axisLabelColor, t.fillText(i.categories[_] || "", L, I + M + 5));
4395
4395
  let x = I + M;
4396
4396
  i.datasets.forEach((A, $) => {
4397
4397
  const O = A.data[_] ?? 0;
4398
4398
  if (O === 0) return;
4399
- const V = O / u * M, H = Math.min(i.barWidth * d + i.barGap, k - 8), et = L - H / 2, E = x - V;
4400
- x -= V;
4399
+ const z = O / u * M, H = Math.min(i.barWidth * d + i.barGap, k - 8), et = L - H / 2, E = x - z;
4400
+ x -= z;
4401
4401
  const F = i._resolveColor(A.color, $);
4402
- t.beginPath(), t.fillStyle = i._makeGradient(t, F, et, E, et, E + V), i._drawRoundedBar(t, et, E, H, V, $ === d - 1 ? i.barCornerRadius : 0, !0), t.fill();
4402
+ t.beginPath(), t.fillStyle = i._makeGradient(t, F, et, E, et, E + z), i._drawRoundedBar(t, et, E, H, z, $ === d - 1 ? i.barCornerRadius : 0, !0), t.fill();
4403
4403
  });
4404
4404
  }
4405
4405
  } else {
4406
- const k = w / h, _ = d * i.barWidth + Math.max(0, (d - 1) * i.barGap), L = I + M - (0 - g) / u * M;
4407
- for (let x = 0; x < h; x++) {
4406
+ const k = w / f, _ = d * i.barWidth + Math.max(0, (d - 1) * i.barGap), L = I + M - (0 - g) / u * M;
4407
+ for (let x = 0; x < f; x++) {
4408
4408
  const A = S + x * k + k / 2;
4409
- i.showXLabels && (t.font = `${i.axisLabelFontSize}px Inter, sans-serif`, t.textAlign = "center", t.textBaseline = "top", t.fillStyle = f.axisLabelColor, t.fillText(i.categories[x] || "", A, I + M + 5));
4409
+ i.showXLabels && (t.font = `${i.axisLabelFontSize}px Inter, sans-serif`, t.textAlign = "center", t.textBaseline = "top", t.fillStyle = h.axisLabelColor, t.fillText(i.categories[x] || "", A, I + M + 5));
4410
4410
  const $ = A - _ / 2;
4411
- i.datasets.forEach((O, V) => {
4411
+ i.datasets.forEach((O, z) => {
4412
4412
  const H = O.data[x] ?? 0, et = Math.abs(H / u * M);
4413
4413
  if (et < 1) return;
4414
- const E = $ + V * (i.barWidth + i.barGap), F = H >= 0 ? L - et : L, q = i._resolveColor(O.color, V);
4414
+ const E = $ + z * (i.barWidth + i.barGap), F = H >= 0 ? L - et : L, q = i._resolveColor(O.color, z);
4415
4415
  t.beginPath(), t.fillStyle = i._makeGradient(t, q, E, F, E, F + et), i._drawRoundedBar(t, E, F, i.barWidth, et, i.barCornerRadius, !0), t.fill(), i.showValueOnTop && H !== 0 && (t.font = `bold ${i.axisLabelFontSize}px Inter, sans-serif`, t.textAlign = "center", t.textBaseline = "bottom", t.fillStyle = q, t.fillText(H.toString(), E + i.barWidth / 2, F - 2));
4416
4416
  });
4417
4417
  }
@@ -4457,20 +4457,20 @@ class ci {
4457
4457
  }
4458
4458
  const l = i._getPreset();
4459
4459
  t.save(), t.beginPath(), t.roundRect(-n / 2, -a / 2, n, a, 10), t.fillStyle = l.cardBackground, t.fill(), t.strokeStyle = l.cardBorderColor, t.lineWidth = 1, t.stroke();
4460
- const f = i.showLegend ? Math.ceil(i.slices.length / 2) : 0, c = f > 0 ? f * (i.legendFontSize + 8) + 10 : 0, g = a - c - 16, h = Math.min(n - 24, g) / 2, d = 0, u = -c / 2;
4460
+ const h = i.showLegend ? Math.ceil(i.slices.length / 2) : 0, c = h > 0 ? h * (i.legendFontSize + 8) + 10 : 0, g = a - c - 16, f = Math.min(n - 24, g) / 2, d = 0, u = -c / 2;
4461
4461
  if (i.chartType === "rose") {
4462
- const v = Math.max(...i.slices.map((S) => S.value || 0)), b = Math.PI * 2 / i.slices.length, C = h > 0 ? i.sliceGap / h : 0;
4462
+ const v = Math.max(...i.slices.map((S) => S.value || 0)), b = Math.PI * 2 / i.slices.length, C = f > 0 ? i.sliceGap / f : 0;
4463
4463
  i.slices.forEach((S, I) => {
4464
4464
  const w = S.value || 0;
4465
4465
  if (w === 0) return;
4466
- const M = w / v * h, P = -Math.PI / 2 + I * b + C / 2, T = P + b - C, W = i._resolveSliceColor(S, I);
4466
+ const M = w / v * f, P = -Math.PI / 2 + I * b + C / 2, T = P + b - C, W = i._resolveSliceColor(S, I);
4467
4467
  if (t.beginPath(), t.moveTo(d, u), t.arc(d, u, M, P, T), t.closePath(), t.fillStyle = W + "cc", t.fill(), t.strokeStyle = W, t.lineWidth = 1.5, t.stroke(), i.showLabels) {
4468
4468
  const k = P + (T - P) / 2, _ = d + M * 0.65 * Math.cos(k), L = u + M * 0.65 * Math.sin(k), x = Math.round(w / r * 100);
4469
4469
  t.save(), t.font = `bold ${i.labelFontSize}px Inter, sans-serif`, t.fillStyle = l.labelColor, t.textAlign = "center", t.textBaseline = "middle", t.fillText(`${x}%`, _, L), t.restore();
4470
4470
  }
4471
4471
  });
4472
4472
  } else {
4473
- const v = i.chartType === "pie" ? 0 : i.innerRadius, b = h * Math.max(0, v), C = h > 0 ? i.sliceGap / h : 0;
4473
+ const v = i.chartType === "pie" ? 0 : i.innerRadius, b = f * Math.max(0, v), C = f > 0 ? i.sliceGap / f : 0;
4474
4474
  let S = -Math.PI / 2;
4475
4475
  if (i.slices.forEach((I, w) => {
4476
4476
  const M = I.value || 0;
@@ -4484,8 +4484,8 @@ class ci {
4484
4484
  return;
4485
4485
  }
4486
4486
  const k = i._resolveSliceColor(I, w);
4487
- if (t.beginPath(), t.fillStyle = k, b <= 0 ? (t.moveTo(d, u), t.arc(d, u, h, T, W), t.lineTo(d, u)) : (t.moveTo(d + h * Math.cos(T), u + h * Math.sin(T)), t.arc(d, u, h, T, W), t.arc(d, u, b, W, T, !0), t.closePath()), t.fill(), i.showLabels) {
4488
- const _ = T + (W - T) / 2, L = b + (h - b) / 2, x = d + L * Math.cos(_), A = u + L * Math.sin(_), $ = Math.round(M / r * 100);
4487
+ if (t.beginPath(), t.fillStyle = k, b <= 0 ? (t.moveTo(d, u), t.arc(d, u, f, T, W), t.lineTo(d, u)) : (t.moveTo(d + f * Math.cos(T), u + f * Math.sin(T)), t.arc(d, u, f, T, W), t.arc(d, u, b, W, T, !0), t.closePath()), t.fill(), i.showLabels) {
4488
+ const _ = T + (W - T) / 2, L = b + (f - b) / 2, x = d + L * Math.cos(_), A = u + L * Math.sin(_), $ = Math.round(M / r * 100);
4489
4489
  t.save(), t.font = `bold ${i.labelFontSize}px Inter, sans-serif`, t.fillStyle = l.labelColor, t.textAlign = "center", t.textBaseline = "middle", t.fillText(`${$}%`, x, A), t.restore();
4490
4490
  }
4491
4491
  S += P;
@@ -4513,9 +4513,9 @@ class ci {
4513
4513
  var M, P;
4514
4514
  const e = t.options || {}, i = this.objectStates.get(t.id) || {}, n = e.optionsList || [];
4515
4515
  if (n.length === 0) return null;
4516
- const a = i.width !== void 0 ? i.width : ((M = t.geometry) == null ? void 0 : M.width) || 180, r = i.height !== void 0 ? i.height : ((P = t.geometry) == null ? void 0 : P.height) || 100, l = e.orientation || "vertical", f = e.itemGap !== void 0 ? e.itemGap : 16, c = e.fontSize || 14, g = this.getWorldTransform(t.id), h = s - g.x, d = o - g.y, u = -g.rotation * (Math.PI / 180), m = Math.cos(u), y = Math.sin(u), v = h * m - d * y, b = h * y + d * m, S = 8 * 2, I = -a / 2, w = -r / 2;
4516
+ const a = i.width !== void 0 ? i.width : ((M = t.geometry) == null ? void 0 : M.width) || 180, r = i.height !== void 0 ? i.height : ((P = t.geometry) == null ? void 0 : P.height) || 100, l = e.orientation || "vertical", h = e.itemGap !== void 0 ? e.itemGap : 16, c = e.fontSize || 14, g = this.getWorldTransform(t.id), f = s - g.x, d = o - g.y, u = -g.rotation * (Math.PI / 180), m = Math.cos(u), y = Math.sin(u), v = f * m - d * y, b = f * y + d * m, S = 8 * 2, I = -a / 2, w = -r / 2;
4517
4517
  if (l === "vertical") {
4518
- const T = Math.max(S, c) + f;
4518
+ const T = Math.max(S, c) + h;
4519
4519
  for (let W = 0; W < n.length; W++) {
4520
4520
  const k = w + W * T;
4521
4521
  if (v >= I && v <= I + a && b >= k && b <= k + T)
@@ -4524,7 +4524,7 @@ class ci {
4524
4524
  } else {
4525
4525
  let T = I;
4526
4526
  for (let W = 0; W < n.length; W++) {
4527
- const _ = n[W].length * 8, L = S + 6 + _ + f;
4527
+ const _ = n[W].length * 8, L = S + 6 + _ + h;
4528
4528
  if (v >= T && v <= T + L && b >= w && b <= w + r)
4529
4529
  return W;
4530
4530
  T += L;
@@ -4569,11 +4569,11 @@ class ci {
4569
4569
  }
4570
4570
  u._resolvedData = m;
4571
4571
  }), r < 2) return;
4572
- const l = a - n, f = o / (r - 1), c = (u) => {
4572
+ const l = a - n, h = o / (r - 1), c = (u) => {
4573
4573
  const m = l === 0 ? 0.5 : (u - n) / l;
4574
4574
  return e / 2 - m * e;
4575
- }, g = (u) => u * f - o / 2, h = s.axisColor || "#333333";
4576
- if (s.showXAxis && (t.beginPath(), t.strokeStyle = s.xAxisColor || h, t.lineWidth = 1, t.moveTo(-o / 2, e / 2), t.lineTo(o / 2, e / 2), t.stroke()), s.showYAxis && (t.beginPath(), t.strokeStyle = s.yAxisColor || h, t.lineWidth = 1, t.moveTo(-o / 2, -e / 2), t.lineTo(-o / 2, e / 2), t.stroke()), t.fillStyle = s.axisLabelColor || "#333333", t.font = `${s.axisLabelFontSize || 10}px Inter, sans-serif`, s.showXLabels) {
4575
+ }, g = (u) => u * h - o / 2, f = s.axisColor || "#333333";
4576
+ if (s.showXAxis && (t.beginPath(), t.strokeStyle = s.xAxisColor || f, t.lineWidth = 1, t.moveTo(-o / 2, e / 2), t.lineTo(o / 2, e / 2), t.stroke()), s.showYAxis && (t.beginPath(), t.strokeStyle = s.yAxisColor || f, t.lineWidth = 1, t.moveTo(-o / 2, -e / 2), t.lineTo(-o / 2, e / 2), t.stroke()), t.fillStyle = s.axisLabelColor || "#333333", t.font = `${s.axisLabelFontSize || 10}px Inter, sans-serif`, s.showXLabels) {
4577
4577
  t.textAlign = "center", t.textBaseline = "top";
4578
4578
  for (let u = 0; u < r; u++) {
4579
4579
  const m = g(u);
@@ -4644,19 +4644,19 @@ class ci {
4644
4644
  if (!s || s.type === "None") return null;
4645
4645
  if (typeof s == "string") return s;
4646
4646
  if (s.type === "Solid" && s.color) {
4647
- const r = s.color, f = (((n = (i = this.artboard) == null ? void 0 : i.tokens) == null ? void 0 : n.colors) || {})[r] || r;
4648
- return t.fillStyle = f, f;
4647
+ const r = s.color, h = (((n = (i = this.artboard) == null ? void 0 : i.tokens) == null ? void 0 : n.colors) || {})[r] || r;
4648
+ return t.fillStyle = h, h;
4649
4649
  }
4650
4650
  if ((s.type === "LinearGradient" || s.type === "RadialGradient" || s.type === "AngularGradient" || s.type === "DiamondGradient") && s.stops) {
4651
- const r = (l, f = 100) => {
4651
+ const r = (l, h = 100) => {
4652
4652
  var C, S;
4653
- const g = (((S = (C = this.artboard) == null ? void 0 : C.tokens) == null ? void 0 : S.colors) || {})[l] || l, h = this.normalizeOpacity(s.opacity ?? 100), u = this.normalizeOpacity(f) * h;
4653
+ const g = (((S = (C = this.artboard) == null ? void 0 : C.tokens) == null ? void 0 : S.colors) || {})[l] || l, f = this.normalizeOpacity(s.opacity ?? 100), u = this.normalizeOpacity(h) * f;
4654
4654
  if (u >= 1 && g.startsWith("#")) return g;
4655
4655
  const m = g.startsWith("#") ? g.replace("#", "") : "ffffff", y = parseInt(m.substring(0, 2), 16), v = parseInt(m.substring(2, 4), 16), b = parseInt(m.substring(4, 6), 16);
4656
4656
  return `rgba(${y}, ${v}, ${b}, ${u})`;
4657
4657
  };
4658
4658
  if (s.type === "LinearGradient") {
4659
- const l = (u, m, y) => Array.isArray(u) ? u[m] ?? (m === 0 ? 0 : 1) : u && typeof u == "object" ? u[y] ?? (m === 0 ? 0 : 1) : m === 0 ? 0 : 1, f = l(s.start, 0, "x") * o - o / 2, c = l(s.start, 1, "y") * e - e / 2, g = l(s.end, 0, "x") * o - o / 2, h = l(s.end, 1, "y") * e - e / 2, d = t.createLinearGradient(f, c, g, h);
4659
+ const l = (u, m, y) => Array.isArray(u) ? u[m] ?? (m === 0 ? 0 : 1) : u && typeof u == "object" ? u[y] ?? (m === 0 ? 0 : 1) : m === 0 ? 0 : 1, h = l(s.start, 0, "x") * o - o / 2, c = l(s.start, 1, "y") * e - e / 2, g = l(s.end, 0, "x") * o - o / 2, f = l(s.end, 1, "y") * e - e / 2, d = t.createLinearGradient(h, c, g, f);
4660
4660
  if (s.stops.forEach((u) => {
4661
4661
  const m = u.offset !== void 0 ? u.offset : u.pos !== void 0 ? u.pos : u.position !== void 0 ? u.position : 0, y = r(u.color || "#000000", u.opacity ?? 100);
4662
4662
  d.addColorStop(Math.max(0, Math.min(1, m)), y);
@@ -4666,39 +4666,39 @@ class ci {
4666
4666
  }
4667
4667
  return d;
4668
4668
  } else if (s.type === "RadialGradient") {
4669
- const l = (d, u, m) => Array.isArray(d) ? d[u] ?? 0.5 : d && typeof d == "object" ? d[m] ?? 0.5 : 0.5, f = l(s.center, 0, "x") * o - o / 2, c = l(s.center, 1, "y") * e - e / 2, g = (s.radius ?? 0.5) * Math.max(o, e), h = t.createRadialGradient(f, c, 0, f, c, g);
4669
+ const l = (d, u, m) => Array.isArray(d) ? d[u] ?? 0.5 : d && typeof d == "object" ? d[m] ?? 0.5 : 0.5, h = l(s.center, 0, "x") * o - o / 2, c = l(s.center, 1, "y") * e - e / 2, g = (s.radius ?? 0.5) * Math.max(o, e), f = t.createRadialGradient(h, c, 0, h, c, g);
4670
4670
  if (s.stops.forEach((d) => {
4671
4671
  const u = d.offset !== void 0 ? d.offset : d.pos !== void 0 ? d.pos : d.position !== void 0 ? d.position : 0, m = r(d.color || "#000000", d.opacity ?? 100);
4672
- h.addColorStop(Math.max(0, Math.min(1, u)), m);
4673
- }), s.gradientTransform && h.setTransform) {
4672
+ f.addColorStop(Math.max(0, Math.min(1, u)), m);
4673
+ }), s.gradientTransform && f.setTransform) {
4674
4674
  const [d, u, m, y, v, b] = s.gradientTransform;
4675
- h.setTransform({ a: d, b: u, c: m, d: y, e: v, f: b });
4675
+ f.setTransform({ a: d, b: u, c: m, d: y, e: v, f: b });
4676
4676
  }
4677
- return h;
4677
+ return f;
4678
4678
  } else if (s.type === "AngularGradient") {
4679
- const l = (d, u, m) => Array.isArray(d) ? d[u] ?? 0.5 : d && typeof d == "object" ? d[m] ?? 0.5 : 0.5, f = l(s.center || [0.5, 0.5], 0, "x") * o - o / 2, c = l(s.center || [0.5, 0.5], 1, "y") * e - e / 2, g = (s.degree || s.angle || 0) * (Math.PI / 180), h = (a = t.createConicGradient) == null ? void 0 : a.call(t, g, f, c);
4680
- if (h) {
4679
+ const l = (d, u, m) => Array.isArray(d) ? d[u] ?? 0.5 : d && typeof d == "object" ? d[m] ?? 0.5 : 0.5, h = l(s.center || [0.5, 0.5], 0, "x") * o - o / 2, c = l(s.center || [0.5, 0.5], 1, "y") * e - e / 2, g = (s.degree || s.angle || 0) * (Math.PI / 180), f = (a = t.createConicGradient) == null ? void 0 : a.call(t, g, h, c);
4680
+ if (f) {
4681
4681
  if (s.stops.forEach((d) => {
4682
4682
  const u = d.offset !== void 0 ? d.offset : d.pos !== void 0 ? d.pos : d.position !== void 0 ? d.position : 0, m = r(d.color || "#000000", d.opacity ?? 100);
4683
- h.addColorStop(Math.max(0, Math.min(1, u)), m);
4684
- }), s.gradientTransform && h.setTransform) {
4683
+ f.addColorStop(Math.max(0, Math.min(1, u)), m);
4684
+ }), s.gradientTransform && f.setTransform) {
4685
4685
  const [d, u, m, y, v, b] = s.gradientTransform;
4686
- h.setTransform({ a: d, b: u, c: m, d: y, e: v, f: b });
4686
+ f.setTransform({ a: d, b: u, c: m, d: y, e: v, f: b });
4687
4687
  }
4688
- return h;
4688
+ return f;
4689
4689
  }
4690
4690
  } else if (s.type === "DiamondGradient") {
4691
- const l = (d, u, m) => Array.isArray(d) ? d[u] ?? 0.5 : d && typeof d == "object" ? d[m] ?? 0.5 : 0.5, f = l(s.center || [0.5, 0.5], 0, "x") * o - o / 2, c = l(s.center || [0.5, 0.5], 1, "y") * e - e / 2, g = (s.radius ?? 0.5) * Math.max(o, e);
4692
- t.save(), t.translate(f, c), t.rotate(Math.PI / 4);
4693
- const h = t.createRadialGradient(0, 0, 0, 0, 0, g);
4691
+ const l = (d, u, m) => Array.isArray(d) ? d[u] ?? 0.5 : d && typeof d == "object" ? d[m] ?? 0.5 : 0.5, h = l(s.center || [0.5, 0.5], 0, "x") * o - o / 2, c = l(s.center || [0.5, 0.5], 1, "y") * e - e / 2, g = (s.radius ?? 0.5) * Math.max(o, e);
4692
+ t.save(), t.translate(h, c), t.rotate(Math.PI / 4);
4693
+ const f = t.createRadialGradient(0, 0, 0, 0, 0, g);
4694
4694
  if (s.stops.forEach((d) => {
4695
4695
  const u = d.offset !== void 0 ? d.offset : d.pos !== void 0 ? d.pos : d.position !== void 0 ? d.position : 0, m = r(d.color || "#000000", d.opacity ?? 100);
4696
- h.addColorStop(Math.max(0, Math.min(1, u)), m);
4697
- }), s.gradientTransform && h.setTransform) {
4696
+ f.addColorStop(Math.max(0, Math.min(1, u)), m);
4697
+ }), s.gradientTransform && f.setTransform) {
4698
4698
  const [d, u, m, y, v, b] = s.gradientTransform;
4699
- h.setTransform({ a: d, b: u, c: m, d: y, e: v, f: b });
4699
+ f.setTransform({ a: d, b: u, c: m, d: y, e: v, f: b });
4700
4700
  }
4701
- return t.scale(1 / Math.SQRT2, 1 / Math.SQRT2), t.fillStyle = h, t.restore(), h;
4701
+ return t.scale(1 / Math.SQRT2, 1 / Math.SQRT2), t.fillStyle = f, t.restore(), f;
4702
4702
  }
4703
4703
  }
4704
4704
  if (s.type === "Pattern" && s.url) {
@@ -4706,8 +4706,8 @@ class ci {
4706
4706
  if (r || (r = new Image(), r.src = s.url, this.imageCache.set(s.url, r)), r.complete && r.naturalWidth > 0) {
4707
4707
  const l = t.createPattern(r, "repeat");
4708
4708
  if (l && (s.scaleX !== void 0 || s.offsetX !== void 0)) {
4709
- const f = new DOMMatrix(), c = s.scaleX ?? 1, g = s.scaleY ?? 1, h = s.offsetX ?? 0, d = s.offsetY ?? 0, u = s.rotation ?? 0;
4710
- f.translateSelf(h, d), f.rotateSelf(u), f.scaleSelf(c, g), l.setTransform(f);
4709
+ const h = new DOMMatrix(), c = s.scaleX ?? 1, g = s.scaleY ?? 1, f = s.offsetX ?? 0, d = s.offsetY ?? 0, u = s.rotation ?? 0;
4710
+ h.translateSelf(f, d), h.rotateSelf(u), h.scaleSelf(c, g), l.setTransform(h);
4711
4711
  }
4712
4712
  return l;
4713
4713
  }
@@ -4726,38 +4726,38 @@ class ci {
4726
4726
  } catch {
4727
4727
  a = parseFloat(a) || 0;
4728
4728
  }
4729
- let r = 0, l = 0, f = 0, c = 0;
4730
- typeof a == "number" ? r = l = f = c = a : Array.isArray(a) ? a.length === 1 ? r = l = f = c = a[0] : a.length === 2 ? (r = f = a[0], l = c = a[1]) : a.length === 3 ? (r = a[0], l = c = a[1], f = a[2]) : a.length >= 4 && (r = a[0], l = a[1], f = a[2], c = a[3]) : a && typeof a == "object" && (r = a.tl ?? a.corner_radius ?? a.cornerRadius ?? 0, l = a.tr ?? a.corner_radius ?? a.cornerRadius ?? 0, f = a.br ?? a.corner_radius ?? a.cornerRadius ?? 0, c = a.bl ?? a.corner_radius ?? a.cornerRadius ?? 0);
4729
+ let r = 0, l = 0, h = 0, c = 0;
4730
+ typeof a == "number" ? r = l = h = c = a : Array.isArray(a) ? a.length === 1 ? r = l = h = c = a[0] : a.length === 2 ? (r = h = a[0], l = c = a[1]) : a.length === 3 ? (r = a[0], l = c = a[1], h = a[2]) : a.length >= 4 && (r = a[0], l = a[1], h = a[2], c = a[3]) : a && typeof a == "object" && (r = a.tl ?? a.corner_radius ?? a.cornerRadius ?? 0, l = a.tr ?? a.corner_radius ?? a.cornerRadius ?? 0, h = a.br ?? a.corner_radius ?? a.cornerRadius ?? 0, c = a.bl ?? a.corner_radius ?? a.cornerRadius ?? 0);
4731
4731
  const g = Math.min(Math.abs(e) / 2, Math.abs(i) / 2);
4732
- if (r = Math.min(Math.max(0, r), g), l = Math.min(Math.max(0, l), g), f = Math.min(Math.max(0, f), g), c = Math.min(Math.max(0, c), g), t.roundRect) {
4733
- t.roundRect(s, o, e, i, [r, l, f, c]);
4732
+ if (r = Math.min(Math.max(0, r), g), l = Math.min(Math.max(0, l), g), h = Math.min(Math.max(0, h), g), c = Math.min(Math.max(0, c), g), t.roundRect) {
4733
+ t.roundRect(s, o, e, i, [r, l, h, c]);
4734
4734
  return;
4735
4735
  }
4736
- t.moveTo(s + r, o), t.lineTo(s + e - l, o), t.arcTo(s + e, o, s + e, o + l, l), t.lineTo(s + e, o + i - f), t.arcTo(s + e, o + i, s + e - f, o + i, f), t.lineTo(s + c, o + i), t.arcTo(s, o + i, s, o + i - c, c), t.lineTo(s, o + r), t.arcTo(s, o, s + r, o, r), t.closePath();
4736
+ t.moveTo(s + r, o), t.lineTo(s + e - l, o), t.arcTo(s + e, o, s + e, o + l, l), t.lineTo(s + e, o + i - h), t.arcTo(s + e, o + i, s + e - h, o + i, h), t.lineTo(s + c, o + i), t.arcTo(s, o + i, s, o + i - c, c), t.lineTo(s, o + r), t.arcTo(s, o, s + r, o, r), t.closePath();
4737
4737
  }
4738
4738
  renderListView(t, s) {
4739
4739
  var L, x, A, $;
4740
- const o = this.objectStates.get(s.id) || {}, e = o.options || s.options || {}, i = o.width !== void 0 ? o.width : ((L = s.geometry) == null ? void 0 : L.width) || 200, n = o.height !== void 0 ? o.height : ((x = s.geometry) == null ? void 0 : x.height) || 300, a = -i / 2, r = -n / 2, l = o.corner_radius !== void 0 ? o.corner_radius : e.corner_radius ?? 0, f = e.orientation || "vertical", c = e.items || [], g = e.itemGap ?? 10, h = e.itemHeight ?? 50, d = e.itemWidth ?? 200, u = e.scrollOffset ?? 0, m = e.padding ?? 0, y = e.glassEffect !== !1, v = e.accentColor || "#3b82f6", b = e.itemTextColor || "#333333", C = e.itemBackgroundColor || "#ffffff", S = e.hoveredIndex ?? null, I = e.activeItemIndex ?? null, w = e.glowIntensity ?? 0, M = e.glowColor || "#3b82f6", P = typeof M == "string" ? M : M.color || (($ = (A = M.stops) == null ? void 0 : A[0]) == null ? void 0 : $.color) || "#3b82f6", T = e.opacity !== void 0 ? e.opacity : s.opacity !== void 0 ? s.opacity : 1;
4740
+ const o = this.objectStates.get(s.id) || {}, e = o.options || s.options || {}, i = o.width !== void 0 ? o.width : ((L = s.geometry) == null ? void 0 : L.width) || 200, n = o.height !== void 0 ? o.height : ((x = s.geometry) == null ? void 0 : x.height) || 300, a = -i / 2, r = -n / 2, l = o.corner_radius !== void 0 ? o.corner_radius : e.corner_radius ?? 0, h = e.orientation || "vertical", c = e.items || [], g = e.itemGap ?? 10, f = e.itemHeight ?? 50, d = e.itemWidth ?? 200, u = e.scrollOffset ?? 0, m = e.padding ?? 0, y = e.glassEffect !== !1, v = e.accentColor || "#3b82f6", b = e.itemTextColor || "#333333", C = e.itemBackgroundColor || "#ffffff", S = e.hoveredIndex ?? null, I = e.activeItemIndex ?? null, w = e.glowIntensity ?? 0, M = e.glowColor || "#3b82f6", P = typeof M == "string" ? M : M.color || (($ = (A = M.stops) == null ? void 0 : A[0]) == null ? void 0 : $.color) || "#3b82f6", T = e.opacity !== void 0 ? e.opacity : s.opacity !== void 0 ? s.opacity : 1;
4741
4741
  if (t.save(), t.globalAlpha *= T, w > 0) {
4742
- const O = t.getTransform(), V = Math.sqrt(O.a * O.a + O.b * O.b) || 1;
4743
- t.shadowColor = P, t.shadowBlur = w * 2 * V, t.shadowOffsetX = 0, t.shadowOffsetY = 0;
4742
+ const O = t.getTransform(), z = Math.sqrt(O.a * O.a + O.b * O.b) || 1;
4743
+ t.shadowColor = P, t.shadowBlur = w * 2 * z, t.shadowOffsetX = 0, t.shadowOffsetY = 0;
4744
4744
  }
4745
4745
  if (y) {
4746
- const O = e.listBackgroundColor || "rgba(31, 41, 55, 0.4)", V = this.createCanvasFill(t, O, i, n);
4747
- t.fillStyle = V || "rgba(31, 41, 55, 0.4)", this.drawListViewRect(t, a, r, i, n, l), t.fill();
4746
+ const O = e.listBackgroundColor || "rgba(31, 41, 55, 0.4)", z = this.createCanvasFill(t, O, i, n);
4747
+ t.fillStyle = z || "rgba(31, 41, 55, 0.4)", this.drawListViewRect(t, a, r, i, n, l), t.fill();
4748
4748
  const H = t.createLinearGradient(a, r, a + i, r + n);
4749
4749
  H.addColorStop(0, "rgba(255, 255, 255, 0.15)"), H.addColorStop(0.5, "rgba(255, 255, 255, 0.08)"), H.addColorStop(1, "rgba(255, 255, 255, 0.03)"), t.fillStyle = H, this.drawListViewRect(t, a, r, i, n, l), t.fill(), t.strokeStyle = "rgba(255, 255, 255, 0.25)", t.lineWidth = 1, this.drawListViewRect(t, a, r, i, n, l), t.stroke();
4750
4750
  } else {
4751
- const O = e.listBackgroundColor || "transparent", V = this.createCanvasFill(t, O, i, n);
4752
- V && (t.fillStyle = V, this.drawListViewRect(t, a, r, i, n, l), t.fill());
4751
+ const O = e.listBackgroundColor || "transparent", z = this.createCanvasFill(t, O, i, n);
4752
+ z && (t.fillStyle = z, this.drawListViewRect(t, a, r, i, n, l), t.fill());
4753
4753
  const H = e.borderWidth ?? 0;
4754
4754
  H > 0 && (t.strokeStyle = e.borderColor || "#cccccc", t.lineWidth = H, this.drawListViewRect(t, a, r, i, n, l), t.stroke());
4755
4755
  }
4756
4756
  t.shadowBlur = 0, t.save(), this.drawListViewRect(t, a, r, i, n, l), t.clip();
4757
- const W = typeof m == "number" ? m : f === "vertical" ? m[0] : m[3];
4758
- let k = (f === "vertical" ? r : a) + u + W;
4759
- if (t.textBaseline = "middle", c.forEach((O, V) => {
4760
- const H = f === "vertical" ? i : d, et = f === "vertical" ? h : n, E = f === "vertical" ? a : k, F = f === "vertical" ? k : r, q = S === V, Q = I === V;
4757
+ const W = typeof m == "number" ? m : h === "vertical" ? m[0] : m[3];
4758
+ let k = (h === "vertical" ? r : a) + u + W;
4759
+ if (t.textBaseline = "middle", c.forEach((O, z) => {
4760
+ const H = h === "vertical" ? i : d, et = h === "vertical" ? f : n, E = h === "vertical" ? a : k, F = h === "vertical" ? k : r, q = S === z, Q = I === z;
4761
4761
  if (Q) {
4762
4762
  const mt = this.createCanvasFill(t, v, H, et);
4763
4763
  t.fillStyle = mt || v;
@@ -4770,18 +4770,18 @@ class ci {
4770
4770
  t.fillStyle = mt || C, t.fillRect(E, F, H, et);
4771
4771
  }
4772
4772
  if (Q || q) {
4773
- const mt = this.createCanvasFill(t, v, f === "vertical" ? 3 : H, f === "vertical" ? et : 3);
4774
- t.fillStyle = mt || v, f === "vertical" ? t.fillRect(E, F, 3, et) : t.fillRect(E, F + et - 3, H, 3);
4773
+ const mt = this.createCanvasFill(t, v, h === "vertical" ? 3 : H, h === "vertical" ? et : 3);
4774
+ t.fillStyle = mt || v, h === "vertical" ? t.fillRect(E, F, 3, et) : t.fillRect(E, F + et - 3, H, 3);
4775
4775
  }
4776
4776
  const it = Q ? "#ffffff" : y ? "rgba(255, 255, 255, 0.9)" : b;
4777
4777
  t.fillStyle = it, t.font = Q || q ? "600 14px Inter, sans-serif" : "400 14px Inter, sans-serif";
4778
- const dt = typeof O == "string" ? O : (O == null ? void 0 : O.label) || `Item ${V + 1}`, St = E + (f === "vertical" ? 16 : H / 2), ht = F + et / 2;
4779
- f === "horizontal" ? t.textAlign = "center" : t.textAlign = "left", t.fillText(dt, St, ht), k += (f === "vertical" ? h : d) + g;
4778
+ const dt = typeof O == "string" ? O : (O == null ? void 0 : O.label) || `Item ${z + 1}`, St = E + (h === "vertical" ? 16 : H / 2), ht = F + et / 2;
4779
+ h === "horizontal" ? t.textAlign = "center" : t.textAlign = "left", t.fillText(dt, St, ht), k += (h === "vertical" ? f : d) + g;
4780
4780
  }), t.restore(), e.showScrollbar !== !1) {
4781
- const O = (c.length || 0) * (f === "vertical" ? h : d) + ((c.length || 0) - 1) * g, V = f === "vertical" ? n : i;
4782
- if (O > V) {
4783
- const H = V / O, et = V * H, E = -u / O * V, F = e.scrollbarColor || "rgba(255,255,255,0.3)", q = e.scrollbarWidth || 4;
4784
- t.fillStyle = F, f === "vertical" ? t.fillRect(a + i - q - 2, r + E, q, et) : t.fillRect(a + E, r + n - q - 2, et, q);
4781
+ const O = (c.length || 0) * (h === "vertical" ? f : d) + ((c.length || 0) - 1) * g, z = h === "vertical" ? n : i;
4782
+ if (O > z) {
4783
+ const H = z / O, et = z * H, E = -u / O * z, F = e.scrollbarColor || "rgba(255,255,255,0.3)", q = e.scrollbarWidth || 4;
4784
+ t.fillStyle = F, h === "vertical" ? t.fillRect(a + i - q - 2, r + E, q, et) : t.fillRect(a + E, r + n - q - 2, et, q);
4785
4785
  }
4786
4786
  }
4787
4787
  t.restore();
@@ -4791,7 +4791,7 @@ class ci {
4791
4791
  if (!this._lastPointerPos || !this._prevPointerPos) return;
4792
4792
  const s = t.options || {}, o = s.orientation || "vertical", e = this._lastPointerPos.x - this._prevPointerPos.x, i = this._lastPointerPos.y - this._prevPointerPos.y;
4793
4793
  o === "vertical" ? s.scrollOffset = (s.scrollOffset || 0) + i : s.scrollOffset = (s.scrollOffset || 0) + e;
4794
- const n = this.objectStates.get(t.id) || {}, a = s.items || [], r = s.itemGap ?? 10, l = s.itemHeight ?? 50, f = s.itemWidth ?? 200, c = n.width !== void 0 ? n.width : ((m = t.geometry) == null ? void 0 : m.width) || 200, g = n.height !== void 0 ? n.height : ((y = t.geometry) == null ? void 0 : y.height) || 300, h = (a.length || 0) * (o === "vertical" ? l : f) + ((a.length || 0) - 1) * r, u = Math.max(0, h - (o === "vertical" ? g : c) + (s.padding * 2 || 0));
4794
+ const n = this.objectStates.get(t.id) || {}, a = s.items || [], r = s.itemGap ?? 10, l = s.itemHeight ?? 50, h = s.itemWidth ?? 200, c = n.width !== void 0 ? n.width : ((m = t.geometry) == null ? void 0 : m.width) || 200, g = n.height !== void 0 ? n.height : ((y = t.geometry) == null ? void 0 : y.height) || 300, f = (a.length || 0) * (o === "vertical" ? l : h) + ((a.length || 0) - 1) * r, u = Math.max(0, f - (o === "vertical" ? g : c) + (s.padding * 2 || 0));
4795
4795
  s.scrollOffset > 0 && (s.scrollOffset = 0), s.scrollOffset < -u && (s.scrollOffset = -u);
4796
4796
  }
4797
4797
  updateListViewHoverFromPointer(t, s, o) {
@@ -4802,13 +4802,13 @@ class ci {
4802
4802
  var W, k;
4803
4803
  const e = t.options || {}, i = this.objectStates.get(t.id) || {}, n = e.items || [];
4804
4804
  if (n.length === 0) return null;
4805
- const a = i.width !== void 0 ? i.width : ((W = t.geometry) == null ? void 0 : W.width) || 200, r = i.height !== void 0 ? i.height : ((k = t.geometry) == null ? void 0 : k.height) || 300, l = e.orientation || "vertical", f = e.itemGap ?? 10, c = e.itemHeight ?? 50, g = e.itemWidth ?? 200, h = e.scrollOffset ?? 0, d = e.padding ?? 0, u = this.getWorldTransform(t.id), m = s - u.x, y = o - u.y, v = -u.rotation * (Math.PI / 180), b = Math.cos(v), C = Math.sin(v), S = m * b - y * C, I = m * C + y * b, w = -a / 2, M = -r / 2, P = typeof d == "number" ? d : l === "vertical" ? d[0] : d[3];
4806
- let T = (l === "vertical" ? M : w) + h + P;
4805
+ const a = i.width !== void 0 ? i.width : ((W = t.geometry) == null ? void 0 : W.width) || 200, r = i.height !== void 0 ? i.height : ((k = t.geometry) == null ? void 0 : k.height) || 300, l = e.orientation || "vertical", h = e.itemGap ?? 10, c = e.itemHeight ?? 50, g = e.itemWidth ?? 200, f = e.scrollOffset ?? 0, d = e.padding ?? 0, u = this.getWorldTransform(t.id), m = s - u.x, y = o - u.y, v = -u.rotation * (Math.PI / 180), b = Math.cos(v), C = Math.sin(v), S = m * b - y * C, I = m * C + y * b, w = -a / 2, M = -r / 2, P = typeof d == "number" ? d : l === "vertical" ? d[0] : d[3];
4806
+ let T = (l === "vertical" ? M : w) + f + P;
4807
4807
  for (let _ = 0; _ < n.length; _++) {
4808
4808
  const L = l === "vertical" ? a : g, x = l === "vertical" ? c : r, A = l === "vertical" ? w : T, $ = l === "vertical" ? T : M;
4809
4809
  if (S >= A && S <= A + L && I >= $ && I <= $ + x)
4810
4810
  return _;
4811
- T += (l === "vertical" ? c : g) + f;
4811
+ T += (l === "vertical" ? c : g) + h;
4812
4812
  }
4813
4813
  return null;
4814
4814
  }
@@ -4826,28 +4826,28 @@ class ci {
4826
4826
  if (!e.behaviors || e.behaviors.length === 0) return;
4827
4827
  const i = this.objectStates.get(e.id);
4828
4828
  i && e.behaviors.forEach((n) => {
4829
- var g, h, d, u, m, y, v, b, C, S, I, w, M, P, T, W, k, _, L, x, A, $, O, V, H, et, E, F, q, Q, it, dt, St, ht, mt, rt, Lt, Gt, Pt, Dt, Yt, B, lt, zt, Mt, Tt, Vt, Ut, Jt, qt, Qt, oe, jt, ee, J, ft, U, G, K, Z, At, Ot, kt, Nt, yt, R, ct, Xt, xt, te, $t, Wt, Ft, ot, It, bt, vt, gt, Rt, at, st, nt, wt, z, pt, ut, ce, me, Ie, we, Te, Ht, se, ue, Me, ke, fe, re, le, ye, _e, Ae, Oe, Pe, Re, Le, De, ze, Ve, Ne, He, Ue, qe, Je, Qe, Ke, Ze, je;
4829
+ var g, f, d, u, m, y, v, b, C, S, I, w, M, P, T, W, k, _, L, x, A, $, O, z, H, et, E, F, q, Q, it, dt, St, ht, mt, rt, Lt, Gt, Pt, Dt, Yt, B, lt, Vt, Mt, Tt, zt, Ut, Jt, qt, Qt, oe, jt, ee, J, ft, U, G, K, Z, At, Ot, kt, Nt, yt, R, ct, Xt, xt, te, $t, Wt, Ft, ot, It, bt, vt, gt, Rt, at, st, nt, wt, V, pt, ut, ce, me, Ie, we, Te, Ht, se, ue, Me, ke, fe, re, le, ye, _e, Ae, Oe, Pe, Re, Le, De, Ve, ze, Ne, He, Ue, qe, Je, Qe, Ke, Ze, je;
4830
4830
  if (!n.enabled) return;
4831
4831
  const a = n.startTime || 0, r = n.endTime || 1 / 0;
4832
4832
  if (this.currentTime < a || this.currentTime > r) return;
4833
- const l = i.x - s, f = i.y - o, c = Math.sqrt(l * l + f * f);
4833
+ const l = i.x - s, h = i.y - o, c = Math.sqrt(l * l + h * h);
4834
4834
  if (this.frameCount % 240 === 0 && Math.random() < 0.1 && console.log(`[ExodeUI] Executing ${n.type} on ${e.name}`), n.type === Y.Proximity) {
4835
- const X = ((g = n.settings) == null ? void 0 : g.radius) || 300, N = ((h = n.settings) == null ? void 0 : h.falloff) || "smooth";
4835
+ const X = ((g = n.settings) == null ? void 0 : g.radius) || 300, N = ((f = n.settings) == null ? void 0 : f.falloff) || "smooth";
4836
4836
  let D = 0;
4837
4837
  c < X && (N === "linear" ? D = 1 - c / X : D = Math.pow(1 - c / X, 2)), n.sensors.forEach((j) => {
4838
- this.applyBehaviorSensor(i, j, D, t, n.settings, e, l, f, c);
4838
+ this.applyBehaviorSensor(i, j, D, t, n.settings, e, l, h, c);
4839
4839
  });
4840
4840
  } else if (n.type === Y.Magnetic) {
4841
4841
  const X = ((d = n.settings) == null ? void 0 : d.radius) || 400, N = ((u = n.settings) == null ? void 0 : u.strength) || 0.5;
4842
4842
  if (c < X && c > 5) {
4843
- const D = 1 - c / X, j = l * D * N, _t = f * D * N;
4843
+ const D = 1 - c / X, j = l * D * N, _t = h * D * N;
4844
4844
  i.x -= j * t * 10, i.y -= _t * t * 10;
4845
4845
  }
4846
4846
  } else if (n.type === Y.Repel) {
4847
4847
  const X = ((m = n.settings) == null ? void 0 : m.radius) || 300, N = ((y = n.settings) == null ? void 0 : y.strength) || 1;
4848
4848
  if (c < X) {
4849
4849
  const D = Math.pow(1 - c / X, 2);
4850
- i.x += l / (c || 1) * D * 60 * N * t * 5, i.y += f / (c || 1) * D * 60 * N * t * 5;
4850
+ i.x += l / (c || 1) * D * 60 * N * t * 5, i.y += h / (c || 1) * D * 60 * N * t * 5;
4851
4851
  }
4852
4852
  } else if (n.type === Y.Orbit) {
4853
4853
  const X = ((v = n.settings) == null ? void 0 : v.speed) || 1, N = ((b = n.settings) == null ? void 0 : b.radius) || 30, D = this.currentTime * X * Math.PI * 2;
@@ -4855,13 +4855,13 @@ class ci {
4855
4855
  } else if (n.type === Y.Vortex) {
4856
4856
  const X = ((C = n.settings) == null ? void 0 : C.radius) || 400, N = ((S = n.settings) == null ? void 0 : S.speed) || 2, D = ((I = n.settings) == null ? void 0 : I.strength) || 1;
4857
4857
  if (c < X) {
4858
- const j = Math.pow(1 - c / X, 1.5), _t = this.currentTime * N * Math.PI * 2, Et = Math.cos(_t) * 30 - l * 0.4, Bt = Math.sin(_t) * 30 - f * 0.4;
4858
+ const j = Math.pow(1 - c / X, 1.5), _t = this.currentTime * N * Math.PI * 2, Et = Math.cos(_t) * 30 - l * 0.4, Bt = Math.sin(_t) * 30 - h * 0.4;
4859
4859
  i.x += Et * j * D * t * 5, i.y += Bt * j * D * t * 5, i.rotation += 5 * j * D * t * 5, i.scale_x *= 1 - j * 0.1 * D * t, i.scale_y *= 1 - j * 0.1 * D * t;
4860
4860
  }
4861
4861
  } else if (n.type === Y.Fluid) {
4862
4862
  const X = ((w = n.settings) == null ? void 0 : w.radius) || 300, N = ((M = n.settings) == null ? void 0 : M.strength) || 1;
4863
4863
  if (c < X) {
4864
- const D = Math.pow(1 - c / X, 1.2), j = l / (c || 1) * D * 1.2 * N, _t = f / (c || 1) * D * 1.2 * N;
4864
+ const D = Math.pow(1 - c / X, 1.2), j = l / (c || 1) * D * 1.2 * N, _t = h / (c || 1) * D * 1.2 * N;
4865
4865
  i.x += j * 10 * t * 5, i.y += _t * 10 * t * 5, i.scale_x *= 1 + D * 0.3 * N * t, i.scale_y *= 1 + D * 0.3 * N * t;
4866
4866
  }
4867
4867
  } else if (n.type === Y.Elastic) {
@@ -4880,7 +4880,7 @@ class ci {
4880
4880
  const X = ((k = n.settings) == null ? void 0 : k.radius) || 80, N = ((_ = n.settings) == null ? void 0 : _.strength) || 1;
4881
4881
  if (c < X) {
4882
4882
  const D = Math.pow(1 - c / X, 2);
4883
- i.x -= l * D * N * t * 10, i.y -= f * D * N * t * 10, i.scale_x *= 1 - D * 0.1 * N * t, i.scale_y *= 1 - D * 0.1 * N * t;
4883
+ i.x -= l * D * N * t * 10, i.y -= h * D * N * t * 10, i.scale_x *= 1 - D * 0.1 * N * t, i.scale_y *= 1 - D * 0.1 * N * t;
4884
4884
  }
4885
4885
  } else if (n.type === Y.Dilation) {
4886
4886
  const X = ((L = n.settings) == null ? void 0 : L.size) || 120, N = ((x = n.settings) == null ? void 0 : x.strength) || 1;
@@ -4889,11 +4889,11 @@ class ci {
4889
4889
  i.scale_x *= 1 + D * 0.5 * N * t, i.scale_y *= 1 + D * 0.5 * N * t;
4890
4890
  }
4891
4891
  } else if (n.type === Y.Parallax) {
4892
- const X = ((A = n.settings) == null ? void 0 : A.factor) || 15, N = (($ = n.settings) == null ? void 0 : $.strength) || 1, D = this.canvasWidth / 2, j = this.canvasHeight / 2, _t = this._lastPointerPos || { x: D, y: j }, Et = (_t.x - D) / D, Bt = (_t.y - j) / j, Zt = (((O = e.transform) == null ? void 0 : O.x) ?? 0) + Et * X * N, he = (((V = e.transform) == null ? void 0 : V.y) ?? 0) + Bt * X * N, be = (((H = e.transform) == null ? void 0 : H.rotate_x) ?? 0) - Bt * X * 1.5 * N, ie = (((et = e.transform) == null ? void 0 : et.rotate_y) ?? 0) + Et * X * 1.5 * N, pe = Math.min(1, 10 * t);
4892
+ const X = ((A = n.settings) == null ? void 0 : A.factor) || 15, N = (($ = n.settings) == null ? void 0 : $.strength) || 1, D = this.canvasWidth / 2, j = this.canvasHeight / 2, _t = this._lastPointerPos || { x: D, y: j }, Et = (_t.x - D) / D, Bt = (_t.y - j) / j, Zt = (((O = e.transform) == null ? void 0 : O.x) ?? 0) + Et * X * N, he = (((z = e.transform) == null ? void 0 : z.y) ?? 0) + Bt * X * N, be = (((H = e.transform) == null ? void 0 : H.rotate_x) ?? 0) - Bt * X * 1.5 * N, ie = (((et = e.transform) == null ? void 0 : et.rotate_y) ?? 0) + Et * X * 1.5 * N, pe = Math.min(1, 10 * t);
4893
4893
  i.x = this.lerp(i.x ?? ((E = e.transform) == null ? void 0 : E.x) ?? 0, Zt, pe), i.y = this.lerp(i.y ?? ((F = e.transform) == null ? void 0 : F.y) ?? 0, he, pe), i.rotate_x = this.lerp(i.rotate_x ?? ((q = e.transform) == null ? void 0 : q.rotate_x) ?? 0, be, pe), i.rotate_y = this.lerp(i.rotate_y ?? ((Q = e.transform) == null ? void 0 : Q.rotate_y) ?? 0, ie, pe);
4894
4894
  } else if (n.type === Y.Fold) {
4895
4895
  if (c < 300) {
4896
- const X = 1 - c / 300, N = (l > 0 ? -1 : 1) * X * 10, D = 1 - X * 0.1, j = f / 300 * X * 20, _t = -(l / 300) * X * 20, Et = Math.min(1, 10 * t);
4896
+ const X = 1 - c / 300, N = (l > 0 ? -1 : 1) * X * 10, D = 1 - X * 0.1, j = h / 300 * X * 20, _t = -(l / 300) * X * 20, Et = Math.min(1, 10 * t);
4897
4897
  i.skew_x = this.lerp(i.skew_x ?? ((it = e.transform) == null ? void 0 : it.skew_x) ?? 0, N, Et), i.scale_y = this.lerp(i.scale_y ?? ((dt = e.transform) == null ? void 0 : dt.scale_y) ?? 1, (((St = e.transform) == null ? void 0 : St.scale_y) ?? 1) * D, Et), i.rotate_x = this.lerp(i.rotate_x ?? ((ht = e.transform) == null ? void 0 : ht.rotate_x) ?? 0, j, Et), i.rotate_y = this.lerp(i.rotate_y ?? ((mt = e.transform) == null ? void 0 : mt.rotate_y) ?? 0, _t, Et), i.style = i.style || { ...e.style }, i.style.artEffect = { enabled: !0, type: "fold_overlay", intensity: ((rt = n.settings) == null ? void 0 : rt.opacity) ?? 0.5 };
4898
4898
  }
4899
4899
  } else if (n.type === Y.Crumple) {
@@ -4902,8 +4902,8 @@ class ci {
4902
4902
  i.skew_x = this.lerp(i.skew_x ?? ((Lt = e.transform) == null ? void 0 : Lt.skew_x) ?? 0, N, j), i.scale_x = this.lerp(i.scale_x ?? ((Gt = e.transform) == null ? void 0 : Gt.scale_x) ?? 1, (((Pt = e.transform) == null ? void 0 : Pt.scale_x) ?? 1) * (1 + D), j), i.scale_y = this.lerp(i.scale_y ?? ((Dt = e.transform) == null ? void 0 : Dt.scale_y) ?? 1, (((Yt = e.transform) == null ? void 0 : Yt.scale_y) ?? 1) * (1 + D), j), i.style = i.style || { ...e.style }, i.style.artEffect = { enabled: !0, type: "crumple_overlay", intensity: ((B = n.settings) == null ? void 0 : B.intensity) ?? 1, scale: ((lt = n.settings) == null ? void 0 : lt.scale) ?? 2 };
4903
4903
  }
4904
4904
  } else if (n.type === Y.Squash) {
4905
- const X = ((zt = n.settings) == null ? void 0 : zt.strength) || 0.8;
4906
- c < (e.width || 100) && this.isMouseDown ? (i.scale_y = this.lerp(i.scale_y ?? 1, (((Mt = e.transform) == null ? void 0 : Mt.scale_y) ?? 1) * X, 0.3), i.scale_x = this.lerp(i.scale_x ?? 1, (((Tt = e.transform) == null ? void 0 : Tt.scale_x) ?? 1) * (1 + (1 - X) * 0.4), 0.3)) : (i.scale_y = this.lerp(i.scale_y ?? 1, ((Vt = e.transform) == null ? void 0 : Vt.scale_y) ?? 1, 0.2), i.scale_x = this.lerp(i.scale_x ?? 1, ((Ut = e.transform) == null ? void 0 : Ut.scale_x) ?? 1, 0.2));
4905
+ const X = ((Vt = n.settings) == null ? void 0 : Vt.strength) || 0.8;
4906
+ c < (e.width || 100) && this.isMouseDown ? (i.scale_y = this.lerp(i.scale_y ?? 1, (((Mt = e.transform) == null ? void 0 : Mt.scale_y) ?? 1) * X, 0.3), i.scale_x = this.lerp(i.scale_x ?? 1, (((Tt = e.transform) == null ? void 0 : Tt.scale_x) ?? 1) * (1 + (1 - X) * 0.4), 0.3)) : (i.scale_y = this.lerp(i.scale_y ?? 1, ((zt = e.transform) == null ? void 0 : zt.scale_y) ?? 1, 0.2), i.scale_x = this.lerp(i.scale_x ?? 1, ((Ut = e.transform) == null ? void 0 : Ut.scale_x) ?? 1, 0.2));
4907
4907
  } else if (n.type === Y.TextCounter) {
4908
4908
  const X = ((Jt = n.settings) == null ? void 0 : Jt.duration) || 2, N = ((qt = n.settings) == null ? void 0 : qt.from) || 0, D = ((Qt = n.settings) == null ? void 0 : Qt.to) || 100;
4909
4909
  n._runtimeStart === void 0 && (n._runtimeStart = this.currentTime);
@@ -4935,7 +4935,7 @@ class ci {
4935
4935
  const X = ((Ft = n.settings) == null ? void 0 : Ft.axis) || "vertical", N = ((ot = n.settings) == null ? void 0 : ot.factor) || 0.5, D = ((It = n.settings) == null ? void 0 : It.strength) || 1, j = ((bt = n.settings) == null ? void 0 : bt.scaleFactor) || 0;
4936
4936
  (X === "vertical" || X === "both") && (i.y += this.scrollOffset.y * N * D * t), (X === "horizontal" || X === "both") && (i.x += this.scrollOffset.x * N * D * t), j !== 0 && (i.scale_x *= 1 + this.scrollOffset.y * j * t, i.scale_y *= 1 + this.scrollOffset.y * j * t);
4937
4937
  } else if (n.type === Y.LookAt) {
4938
- const X = ((vt = n.settings) == null ? void 0 : vt.factor) || 1, N = ((gt = n.settings) == null ? void 0 : gt.strength) || 1, D = Math.atan2(-f, -l) * (180 / Math.PI), j = i.rotation, _t = (D - j + 180) % 360 - 180;
4938
+ const X = ((vt = n.settings) == null ? void 0 : vt.factor) || 1, N = ((gt = n.settings) == null ? void 0 : gt.strength) || 1, D = Math.atan2(-h, -l) * (180 / Math.PI), j = i.rotation, _t = (D - j + 180) % 360 - 180;
4939
4939
  i.rotation += _t * X * N * t * 10;
4940
4940
  } else if (n.type === Y.Scan) {
4941
4941
  const X = (((Rt = n.settings) == null ? void 0 : Rt.speed) || 1) * 4e-3, N = ((at = n.settings) == null ? void 0 : at.strength) || 1, D = (Math.sin(Date.now() * X) + 1) / 2;
@@ -4950,7 +4950,7 @@ class ci {
4950
4950
  const X = ((nt = n.settings) == null ? void 0 : nt.steps) || 12, N = (((wt = n.settings) == null ? void 0 : wt.speed) || 1) * 30, D = Math.floor(i.rotation / (360 / X)) * (360 / X);
4951
4951
  i.rotation = this.lerp(i.rotation, D + N * t, 0.1);
4952
4952
  } else if (n.type === Y.Jitter && c < 300) {
4953
- const X = ((z = n.settings) == null ? void 0 : z.strength) || 1, N = (((pt = n.settings) == null ? void 0 : pt.intensity) || 5) * X;
4953
+ const X = ((V = n.settings) == null ? void 0 : V.strength) || 1, N = (((pt = n.settings) == null ? void 0 : pt.intensity) || 5) * X;
4954
4954
  i.x += (Math.random() - 0.5) * N * t * 60, i.y += (Math.random() - 0.5) * N * t * 60, i.rotation += (Math.random() - 0.5) * N * t * 120;
4955
4955
  } else if (n.type === Y.Follower) {
4956
4956
  const X = (ut = n.settings) == null ? void 0 : ut.targetId;
@@ -5057,7 +5057,7 @@ class ci {
5057
5057
  }
5058
5058
  }
5059
5059
  } else if (n.type === Y.SpringChain) {
5060
- const X = ((De = n.settings) == null ? void 0 : De.connections) || [], N = ((ze = n.settings) == null ? void 0 : ze.globalDamping) || 0.3;
5060
+ const X = ((De = n.settings) == null ? void 0 : De.connections) || [], N = ((Ve = n.settings) == null ? void 0 : Ve.globalDamping) || 0.3;
5061
5061
  this._springChainState.has(e.id) || this._springChainState.set(e.id, /* @__PURE__ */ new Map());
5062
5062
  const D = this._springChainState.get(e.id);
5063
5063
  for (const _t of X) {
@@ -5086,7 +5086,7 @@ class ci {
5086
5086
  i.x += j.vx * t, i.y += j.vy * t;
5087
5087
  }
5088
5088
  } else if (n.type === Y.ParticleEmitter) {
5089
- const X = ((Ve = n.settings) == null ? void 0 : Ve.rate) || 10, N = ((Ne = n.settings) == null ? void 0 : Ne.speed) || 100, D = ((He = n.settings) == null ? void 0 : He.size) || 5, j = ((Ue = n.settings) == null ? void 0 : Ue.lifetime) || 2, _t = ((qe = n.settings) == null ? void 0 : qe.gravity) || 0, Et = ((Je = n.settings) == null ? void 0 : Je.color) || "#ffffff", Bt = ((Qe = n.settings) == null ? void 0 : Qe.maxParticles) || 200, Zt = (Ke = n.settings) != null && Ke.rateInputId ? this.inputs.get(n.settings.rateInputId) ?? X : X, he = (Ze = n.settings) != null && Ze.gravityInputId ? this.inputs.get(n.settings.gravityInputId) ?? _t : _t, be = (je = n.settings) != null && je.speedInputId ? this.inputs.get(n.settings.speedInputId) ?? N : N;
5089
+ const X = ((ze = n.settings) == null ? void 0 : ze.rate) || 10, N = ((Ne = n.settings) == null ? void 0 : Ne.speed) || 100, D = ((He = n.settings) == null ? void 0 : He.size) || 5, j = ((Ue = n.settings) == null ? void 0 : Ue.lifetime) || 2, _t = ((qe = n.settings) == null ? void 0 : qe.gravity) || 0, Et = ((Je = n.settings) == null ? void 0 : Je.color) || "#ffffff", Bt = ((Qe = n.settings) == null ? void 0 : Qe.maxParticles) || 200, Zt = (Ke = n.settings) != null && Ke.rateInputId ? this.inputs.get(n.settings.rateInputId) ?? X : X, he = (Ze = n.settings) != null && Ze.gravityInputId ? this.inputs.get(n.settings.gravityInputId) ?? _t : _t, be = (je = n.settings) != null && je.speedInputId ? this.inputs.get(n.settings.speedInputId) ?? N : N;
5090
5090
  this._emitterPools.has(e.id) || this._emitterPools.set(e.id, []);
5091
5091
  const ie = this._emitterPools.get(e.id);
5092
5092
  let pe = 0;
@@ -5115,87 +5115,87 @@ class ci {
5115
5115
  });
5116
5116
  }
5117
5117
  applyBehaviorSensor(t, s, o, e, i, n, a = 0, r = 0, l = 1) {
5118
- var d, u, m, y, v, b, C, S, I, w, M, P, T, W, k, _, L, x, A, $, O, V, H, et;
5119
- const f = (i == null ? void 0 : i.intensity) || (i == null ? void 0 : i.strength) || 1, c = Math.min(1, 15 * e), g = l > 0 ? a / l : 0, h = l > 0 ? r / l : 0;
5118
+ var d, u, m, y, v, b, C, S, I, w, M, P, T, W, k, _, L, x, A, $, O, z, H, et;
5119
+ const h = (i == null ? void 0 : i.intensity) || (i == null ? void 0 : i.strength) || 1, c = Math.min(1, 15 * e), g = l > 0 ? a / l : 0, f = l > 0 ? r / l : 0;
5120
5120
  switch (s) {
5121
5121
  case Kt.Scale: {
5122
- const E = ((d = n == null ? void 0 : n.transform) == null ? void 0 : d.scale_x) ?? 1, F = ((u = n == null ? void 0 : n.transform) == null ? void 0 : u.scale_y) ?? 1, q = E * (1 + o * f * 0.4), Q = F * (1 + o * f * 0.4);
5122
+ const E = ((d = n == null ? void 0 : n.transform) == null ? void 0 : d.scale_x) ?? 1, F = ((u = n == null ? void 0 : n.transform) == null ? void 0 : u.scale_y) ?? 1, q = E * (1 + o * h * 0.4), Q = F * (1 + o * h * 0.4);
5123
5123
  t.scale_x = (t.scale_x ?? E) * (1 - c) + q * c, t.scale_y = (t.scale_y ?? F) * (1 - c) + Q * c;
5124
5124
  break;
5125
5125
  }
5126
5126
  case Kt.Opacity: {
5127
- const E = ((m = n == null ? void 0 : n.transform) == null ? void 0 : m.opacity) ?? 100, F = Math.max(0, Math.min(100, E - o * f * 100));
5127
+ const E = ((m = n == null ? void 0 : n.transform) == null ? void 0 : m.opacity) ?? 100, F = Math.max(0, Math.min(100, E - o * h * 100));
5128
5128
  t.opacity = (t.opacity ?? E) * (1 - c) + F * c;
5129
5129
  break;
5130
5130
  }
5131
5131
  case Kt.RotateZ: {
5132
- const E = ((y = n == null ? void 0 : n.transform) == null ? void 0 : y.rotation) ?? 0, F = E + o * f * 45;
5132
+ const E = ((y = n == null ? void 0 : n.transform) == null ? void 0 : y.rotation) ?? 0, F = E + o * h * 45;
5133
5133
  t.rotation = (t.rotation ?? E) * (1 - c) + F * c;
5134
5134
  break;
5135
5135
  }
5136
5136
  case Kt.RotateX: {
5137
- const E = ((v = n == null ? void 0 : n.transform) == null ? void 0 : v.rotate_x) ?? 0, F = E - h * o * f * 60;
5137
+ const E = ((v = n == null ? void 0 : n.transform) == null ? void 0 : v.rotate_x) ?? 0, F = E - f * o * h * 60;
5138
5138
  t.rotate_x = (t.rotate_x ?? E) * (1 - c) + F * c;
5139
5139
  break;
5140
5140
  }
5141
5141
  case Kt.RotateY: {
5142
- const E = ((b = n == null ? void 0 : n.transform) == null ? void 0 : b.rotate_y) ?? 0, F = E + g * o * f * 60;
5142
+ const E = ((b = n == null ? void 0 : n.transform) == null ? void 0 : b.rotate_y) ?? 0, F = E + g * o * h * 60;
5143
5143
  t.rotate_y = (t.rotate_y ?? E) * (1 - c) + F * c;
5144
5144
  break;
5145
5145
  }
5146
5146
  case Kt.PositionX: {
5147
- const E = ((C = n == null ? void 0 : n.transform) == null ? void 0 : C.x) ?? 0, F = E - g * o * f * 40;
5147
+ const E = ((C = n == null ? void 0 : n.transform) == null ? void 0 : C.x) ?? 0, F = E - g * o * h * 40;
5148
5148
  t.x = (t.x ?? E) * (1 - c) + F * c;
5149
5149
  break;
5150
5150
  }
5151
5151
  case Kt.PositionY: {
5152
- const E = ((S = n == null ? void 0 : n.transform) == null ? void 0 : S.y) ?? 0, F = E - h * o * f * 40;
5152
+ const E = ((S = n == null ? void 0 : n.transform) == null ? void 0 : S.y) ?? 0, F = E - f * o * h * 40;
5153
5153
  t.y = (t.y ?? E) * (1 - c) + F * c;
5154
5154
  break;
5155
5155
  }
5156
5156
  case Kt.SkewX: {
5157
- const E = ((I = n == null ? void 0 : n.transform) == null ? void 0 : I.skew_x) ?? 0, F = E + g * o * f * 45;
5157
+ const E = ((I = n == null ? void 0 : n.transform) == null ? void 0 : I.skew_x) ?? 0, F = E + g * o * h * 45;
5158
5158
  t.skew_x = (t.skew_x ?? E) * (1 - c) + F * c, t.skew_x > 85 && (t.skew_x = 85), t.skew_x < -85 && (t.skew_x = -85);
5159
5159
  break;
5160
5160
  }
5161
5161
  case Kt.Blur: {
5162
5162
  t.style || (t.style = { ...n == null ? void 0 : n.style }), t.style.blur || (t.style.blur = { ...(w = n == null ? void 0 : n.style) == null ? void 0 : w.blur });
5163
- const E = ((P = (M = n == null ? void 0 : n.style) == null ? void 0 : M.blur) == null ? void 0 : P.amount) || 0, F = E + o * ((i == null ? void 0 : i.blur) || 20) * f;
5163
+ const E = ((P = (M = n == null ? void 0 : n.style) == null ? void 0 : M.blur) == null ? void 0 : P.amount) || 0, F = E + o * ((i == null ? void 0 : i.blur) || 20) * h;
5164
5164
  t.style.blur.amount = (t.style.blur.amount ?? E) * (1 - c) + F * c;
5165
5165
  break;
5166
5166
  }
5167
5167
  case Kt.Exposure: {
5168
5168
  t.style || (t.style = { ...n == null ? void 0 : n.style }), t.style.adjustments || (t.style.adjustments = { ...(T = n == null ? void 0 : n.style) == null ? void 0 : T.adjustments });
5169
- const E = ((k = (W = n == null ? void 0 : n.style) == null ? void 0 : W.adjustments) == null ? void 0 : k.exposure) || 0, F = E + o * ((i == null ? void 0 : i.exposure) || 50) * f;
5169
+ const E = ((k = (W = n == null ? void 0 : n.style) == null ? void 0 : W.adjustments) == null ? void 0 : k.exposure) || 0, F = E + o * ((i == null ? void 0 : i.exposure) || 50) * h;
5170
5170
  t.style.adjustments.exposure = (t.style.adjustments.exposure ?? E) * (1 - c) + F * c;
5171
5171
  break;
5172
5172
  }
5173
5173
  case Kt.HueShift: {
5174
5174
  t.style || (t.style = { ...n == null ? void 0 : n.style }), t.style.adjustments || (t.style.adjustments = { ...(_ = n == null ? void 0 : n.style) == null ? void 0 : _.adjustments });
5175
- const E = ((x = (L = n == null ? void 0 : n.style) == null ? void 0 : L.adjustments) == null ? void 0 : x.hue) || 0, F = E + o * ((i == null ? void 0 : i.hue) || 180) * f;
5175
+ const E = ((x = (L = n == null ? void 0 : n.style) == null ? void 0 : L.adjustments) == null ? void 0 : x.hue) || 0, F = E + o * ((i == null ? void 0 : i.hue) || 180) * h;
5176
5176
  t.style.adjustments.hue = (t.style.adjustments.hue ?? E) * (1 - c) + F * c;
5177
5177
  break;
5178
5178
  }
5179
5179
  case Kt.Negative: {
5180
5180
  t.style || (t.style = { ...n == null ? void 0 : n.style }), t.style.adjustments || (t.style.adjustments = { ...(A = n == null ? void 0 : n.style) == null ? void 0 : A.adjustments });
5181
- const E = ((O = ($ = n == null ? void 0 : n.style) == null ? void 0 : $.adjustments) == null ? void 0 : O.negative) || 0, F = E + o * ((i == null ? void 0 : i.negative) || 100) * f;
5181
+ const E = ((O = ($ = n == null ? void 0 : n.style) == null ? void 0 : $.adjustments) == null ? void 0 : O.negative) || 0, F = E + o * ((i == null ? void 0 : i.negative) || 100) * h;
5182
5182
  t.style.adjustments.negative = (t.style.adjustments.negative ?? E) * (1 - c) + F * c;
5183
5183
  break;
5184
5184
  }
5185
5185
  case Kt.CornerRadius: {
5186
- const E = ((V = n == null ? void 0 : n.transform) == null ? void 0 : V.corner_radius) || 0, F = E + o * f * 50;
5186
+ const E = ((z = n == null ? void 0 : n.transform) == null ? void 0 : z.corner_radius) || 0, F = E + o * h * 50;
5187
5187
  t.corner_radius = (t.corner_radius ?? E) * (1 - c) + F * c;
5188
5188
  break;
5189
5189
  }
5190
5190
  case Kt.StrokeWidth: {
5191
5191
  t.style || (t.style = { ...n == null ? void 0 : n.style });
5192
- const E = ((H = n == null ? void 0 : n.style) == null ? void 0 : H.borderWidth) || 0, F = E + o * f * 10;
5192
+ const E = ((H = n == null ? void 0 : n.style) == null ? void 0 : H.borderWidth) || 0, F = E + o * h * 10;
5193
5193
  t.style.borderWidth = (t.style.borderWidth ?? E) * (1 - c) + F * c;
5194
5194
  break;
5195
5195
  }
5196
5196
  case Kt.LetterSpacing: {
5197
5197
  t.geometry || (t.geometry = {});
5198
- const E = ((et = n == null ? void 0 : n.geometry) == null ? void 0 : et.letterSpacing) || 0, F = E + o * f * 10;
5198
+ const E = ((et = n == null ? void 0 : n.geometry) == null ? void 0 : et.letterSpacing) || 0, F = E + o * h * 10;
5199
5199
  t.geometry.letterSpacing = (t.geometry.letterSpacing ?? E) * (1 - c) + F * c;
5200
5200
  break;
5201
5201
  }
@@ -5220,7 +5220,7 @@ class ci {
5220
5220
  for (let r = 0; r < i.length - 1; r++) {
5221
5221
  const l = i[r];
5222
5222
  if (n[l] === void 0 || n[l] === null) {
5223
- const f = s, c = i.slice(0, r + 1).reduce((g, h) => g == null ? void 0 : g[h], f);
5223
+ const h = s, c = i.slice(0, r + 1).reduce((g, f) => g == null ? void 0 : g[f], h);
5224
5224
  n[l] = c !== void 0 ? { ...c } : {};
5225
5225
  }
5226
5226
  n = n[l];
@@ -5271,9 +5271,9 @@ class ci {
5271
5271
  return o;
5272
5272
  }
5273
5273
  renderFittedImage(t, s, o, e, i, n, a = "cover") {
5274
- const r = s.naturalWidth, l = s.naturalHeight, f = r / l, c = i / n;
5275
- let g = i, h = n, d = o, u = e;
5276
- a === "cover" ? f > c ? (g = n * f, d = o - (g - i) / 2) : (h = i / f, u = e - (h - n) / 2) : a === "contain" && (f > c ? (h = i / f, u = e + (n - h) / 2) : (g = n * f, d = o + (i - g) / 2)), t.drawImage(s, d, u, g, h);
5274
+ const r = s.naturalWidth, l = s.naturalHeight, h = r / l, c = i / n;
5275
+ let g = i, f = n, d = o, u = e;
5276
+ a === "cover" ? h > c ? (g = n * h, d = o - (g - i) / 2) : (f = i / h, u = e - (f - n) / 2) : a === "contain" && (h > c ? (f = i / h, u = e + (n - f) / 2) : (g = n * h, d = o + (i - g) / 2)), t.drawImage(s, d, u, g, f);
5277
5277
  }
5278
5278
  }
5279
5279
  const yi = Cs(({
@@ -5287,10 +5287,10 @@ const yi = Cs(({
5287
5287
  onTrigger: a,
5288
5288
  onInputUpdate: r,
5289
5289
  onComponentChange: l,
5290
- onToggle: f,
5290
+ onToggle: h,
5291
5291
  onInputChange: c,
5292
5292
  onInputFocus: g,
5293
- onInputBlur: h,
5293
+ onInputBlur: f,
5294
5294
  onLog: d,
5295
5295
  onLogicUpdate: u,
5296
5296
  onButtonClick: m,
@@ -5306,15 +5306,15 @@ const yi = Cs(({
5306
5306
  interactive: T = !0,
5307
5307
  onNavigation: W
5308
5308
  }, k) => {
5309
- const _ = ve(null), L = ve(new ci()), x = ve(void 0), A = ve(0), $ = ve(null), O = ve(b), [, V] = ds(p || null), H = ve(!0);
5309
+ const _ = ve(null), L = ve(new ci()), x = ve(void 0), A = ve(0), $ = ve(null), O = ve(b), [, z] = ds(p || null), H = ve(!0);
5310
5310
  Ss(k, () => _.current), Se(() => (H.current = !0, () => {
5311
5311
  H.current = !1, x.current && cancelAnimationFrame(x.current);
5312
5312
  }), []), Se(() => {
5313
5313
  L.current.setLayout(e, i);
5314
5314
  }, [e, i]), Se(() => {
5315
5315
  const E = L.current;
5316
- a && E.setTriggerCallback(a), r && E.setInputUpdateCallback((F, q) => r({ [F]: q })), l && E.setComponentChangeCallback((F) => l(F)), f && E.setToggleCallback(f), c && E.setInputChangeCallback(c), g && E.setInputFocusCallback(g), h && E.setInputBlurCallback(h), d && E.setOnLogCallback((F) => d(F, "info")), u && E.setLogicUpdateCallback(u), m && E.setButtonClickCallback(m), y && E.setGraphPointClickCallback((F) => y(F.objectId, F)), W && E.setNavigationCallback(W);
5317
- }, [a, r, l, f, c, g, h, d, u, m, y, W]), Se(() => {
5316
+ a && E.setTriggerCallback(a), r && E.setInputUpdateCallback((F, q) => r({ [F]: q })), l && E.setComponentChangeCallback((F) => l(F)), h && E.setToggleCallback(h), c && E.setInputChangeCallback(c), g && E.setInputFocusCallback(g), f && E.setInputBlurCallback(f), d && E.setOnLogCallback((F) => d(F, "info")), u && E.setLogicUpdateCallback(u), m && E.setButtonClickCallback(m), y && E.setGraphPointClickCallback((F) => y(F.objectId, F)), W && E.setNavigationCallback(W);
5317
+ }, [a, r, l, h, c, g, f, d, u, m, y, W]), Se(() => {
5318
5318
  (async () => {
5319
5319
  let F = p;
5320
5320
  if (t && !p)
@@ -5325,7 +5325,7 @@ const yi = Cs(({
5325
5325
  }
5326
5326
  if (F) {
5327
5327
  const q = L.current, Q = F.id || F.name || "default";
5328
- ($.current !== Q || O.current !== b) && (q.load(F), $.current = Q, O.current = b, V(F), A.current = 0, q.advance(0)), n && n(q);
5328
+ ($.current !== Q || O.current !== b) && (q.load(F), $.current = Q, O.current = b, z(F), A.current = 0, q.advance(0)), n && n(q);
5329
5329
  }
5330
5330
  })();
5331
5331
  }, [p == null ? void 0 : p.id, t, b]), Se(() => {
@@ -5399,9 +5399,9 @@ function bi() {
5399
5399
  p == null || p.setInputStringArray(c, g);
5400
5400
  }, [p]), r = ge((c, g) => {
5401
5401
  p == null || p.updateObjectOptions(c, g);
5402
- }, [p]), l = ge((c, g, h) => {
5403
- p == null || p.updateConstraint(c, g, h);
5404
- }, [p]), f = ge((c, g) => {
5402
+ }, [p]), l = ge((c, g, f) => {
5403
+ p == null || p.updateConstraint(c, g, f);
5404
+ }, [p]), h = ge((c, g) => {
5405
5405
  p == null || p.updateGraphData(c, g);
5406
5406
  }, [p]);
5407
5407
  return {
@@ -5415,7 +5415,7 @@ function bi() {
5415
5415
  setInputNumberArray: n,
5416
5416
  setInputStringArray: a,
5417
5417
  updateConstraint: l,
5418
- updateGraphData: f,
5418
+ updateGraphData: h,
5419
5419
  updateObjectOptions: r
5420
5420
  };
5421
5421
  }
@@ -5427,12 +5427,12 @@ const vi = ({ artboard: p, config: t }) => {
5427
5427
  let r = s.description;
5428
5428
  if (!r && o) {
5429
5429
  const c = p.objects.filter((g) => {
5430
- var h;
5431
- return ((h = g.geometry) == null ? void 0 : h.type) === "Text";
5430
+ var f;
5431
+ return ((f = g.geometry) == null ? void 0 : f.type) === "Text";
5432
5432
  }).sort(
5433
- (g, h) => {
5433
+ (g, f) => {
5434
5434
  var d, u;
5435
- return (((d = h.geometry.text) == null ? void 0 : d.length) || 0) - (((u = g.geometry.text) == null ? void 0 : u.length) || 0);
5435
+ return (((d = f.geometry.text) == null ? void 0 : d.length) || 0) - (((u = g.geometry.text) == null ? void 0 : u.length) || 0);
5436
5436
  }
5437
5437
  );
5438
5438
  c.length > 0 && (r = c[0].geometry.text);
@@ -5442,20 +5442,20 @@ const vi = ({ artboard: p, config: t }) => {
5442
5442
  l && e("property", "og:image", l), a && e("property", "og:title", a), e("property", "og:type", "website");
5443
5443
  }, [s, p, o]);
5444
5444
  const e = (a, r, l) => {
5445
- let f = document.querySelector(`meta[${a}="${r}"]`);
5446
- f || (f = document.createElement("meta"), f.setAttribute(a, r), document.head.appendChild(f)), f.setAttribute("content", l);
5445
+ let h = document.querySelector(`meta[${a}="${r}"]`);
5446
+ h || (h = document.createElement("meta"), h.setAttribute(a, r), document.head.appendChild(h)), h.setAttribute("content", l);
5447
5447
  }, i = () => {
5448
5448
  const a = [];
5449
- return a.push(/* @__PURE__ */ Ce("h1", { children: s.title || p.name }, "artboard-title")), p.objects.forEach((l, f) => {
5449
+ return a.push(/* @__PURE__ */ Ce("h1", { children: s.title || p.name }, "artboard-title")), p.objects.forEach((l, h) => {
5450
5450
  var c, g;
5451
5451
  if (!(l.visible === !1 || l.isVisible === !1))
5452
5452
  if (((c = l.geometry) == null ? void 0 : c.type) === "Text") {
5453
- const h = l.geometry.text;
5454
- h && (l.geometry.fontSize > 24 ? a.push(/* @__PURE__ */ Ce("h2", { children: h }, l.id || f)) : a.push(/* @__PURE__ */ Ce("p", { children: h }, l.id || f)));
5453
+ const f = l.geometry.text;
5454
+ f && (l.geometry.fontSize > 24 ? a.push(/* @__PURE__ */ Ce("h2", { children: f }, l.id || h)) : a.push(/* @__PURE__ */ Ce("p", { children: f }, l.id || h)));
5455
5455
  } else if (((g = l.geometry) == null ? void 0 : g.type) === "Image") {
5456
- const h = l.geometry.src, d = l.altText || l.name || "Illustration";
5457
- a.push(/* @__PURE__ */ Ce("img", { src: h, alt: d }, l.id || f));
5458
- } else l.type === "Button" && a.push(/* @__PURE__ */ Ce("button", { children: l.name || "Button" }, l.id || f));
5456
+ const f = l.geometry.src, d = l.altText || l.name || "Illustration";
5457
+ a.push(/* @__PURE__ */ Ce("img", { src: f, alt: d }, l.id || h));
5458
+ } else l.type === "Button" && a.push(/* @__PURE__ */ Ce("button", { children: l.name || "Button" }, l.id || h));
5459
5459
  }), a;
5460
5460
  }, n = s.jsonLd || {
5461
5461
  "@context": "https://schema.org",
@@ -5488,7 +5488,7 @@ const vi = ({ artboard: p, config: t }) => {
5488
5488
  ]
5489
5489
  }
5490
5490
  );
5491
- }, fi = "6.3.18", hi = {
5491
+ }, fi = "6.3.19", hi = {
5492
5492
  version: fi
5493
5493
  }, Ci = hi.version;
5494
5494
  export {