exodeui 2.6.31 → 2.6.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,26 +1,26 @@
1
1
  var MC = Object.defineProperty;
2
2
  var JC = (D, A, I) => A in D ? MC(D, A, { enumerable: !0, configurable: !0, writable: !0, value: I }) : D[A] = I;
3
- var z = (D, A, I) => JC(D, typeof A != "symbol" ? A + "" : A, I);
3
+ var AA = (D, A, I) => JC(D, typeof A != "symbol" ? A + "" : A, I);
4
4
  import { jsx as UC } from "react/jsx-runtime";
5
5
  import { forwardRef as RC, useRef as wI, useImperativeHandle as tC, useEffect as eA, useState as cC, useCallback as nA } from "react";
6
6
  var YC = /* @__PURE__ */ ((D) => (D.Equal = "Equal", D.NotEqual = "NotEqual", D.GreaterThan = "GreaterThan", D.LessThan = "LessThan", D.GreaterEqual = "GreaterEqual", D.LessEqual = "LessEqual", D.IsTrue = "IsTrue", D.IsFalse = "IsFalse", D))(YC || {}), VA = /* @__PURE__ */ ((D) => (D.AND = "AND", D.OR = "OR", D.NOT = "NOT", D.XOR = "XOR", D))(VA || {});
7
7
  let E;
8
- const v = new Array(128).fill(void 0);
9
- function j(D) {
10
- return v[D];
8
+ const z = new Array(128).fill(void 0);
9
+ function v(D) {
10
+ return z[D];
11
11
  }
12
- v.push(void 0, null, !0, !1);
13
- let II = v.length;
14
- function $(D) {
15
- II === v.length && v.push(v.length + 1);
12
+ z.push(void 0, null, !0, !1);
13
+ let II = z.length;
14
+ function CA(D) {
15
+ II === z.length && z.push(z.length + 1);
16
16
  const A = II;
17
- return II = v[A], v[A] = D, A;
17
+ return II = z[A], z[A] = D, A;
18
18
  }
19
19
  function hI(D, A) {
20
20
  try {
21
21
  return D.apply(this, A);
22
22
  } catch (I) {
23
- E.__wbindgen_export_0($(I));
23
+ E.__wbindgen_export_0(CA(I));
24
24
  }
25
25
  }
26
26
  const Wg = typeof TextDecoder < "u" ? new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }) : { decode: () => {
@@ -31,7 +31,7 @@ let zA = null;
31
31
  function OI(D, A) {
32
32
  return D >>>= 0, Wg.decode((zA !== null && zA.byteLength !== 0 || (zA = new Uint8Array(E.memory.buffer)), zA).subarray(D, D + A));
33
33
  }
34
- function n(D) {
34
+ function q(D) {
35
35
  return D == null;
36
36
  }
37
37
  let ZA = null;
@@ -39,18 +39,18 @@ function SA() {
39
39
  return (ZA === null || ZA.buffer.detached === !0 || ZA.buffer.detached === void 0 && ZA.buffer !== E.memory.buffer) && (ZA = new DataView(E.memory.buffer)), ZA;
40
40
  }
41
41
  function sI(D) {
42
- const A = j(D);
42
+ const A = v(D);
43
43
  return function(I) {
44
- I < 132 || (v[I] = II, II = I);
44
+ I < 132 || (z[I] = II, II = I);
45
45
  }(D), A;
46
46
  }
47
47
  function K(D, A) {
48
48
  if (!(D instanceof A)) throw new Error(`expected instance of ${A.name}`);
49
49
  }
50
- let CA = 128;
50
+ let BA = 128;
51
51
  function DA(D) {
52
- if (CA == 1) throw new Error("out of js stack");
53
- return v[--CA] = D, CA;
52
+ if (BA == 1) throw new Error("out of js stack");
53
+ return z[--BA] = D, BA;
54
54
  }
55
55
  let _A = null;
56
56
  function eC(D, A) {
@@ -100,84 +100,84 @@ class bA {
100
100
  castRay(A, I, C, g, Q, B, i, o, h, s, G, w) {
101
101
  try {
102
102
  K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, M);
103
- const a = E.rawbroadphase_castRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i, o, n(h) ? 4294967297 : h >>> 0, !n(s), n(s) ? 0 : s, !n(G), n(G) ? 0 : G, DA(w));
103
+ const a = E.rawbroadphase_castRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i, o, q(h) ? 4294967297 : h >>> 0, !q(s), q(s) ? 0 : s, !q(G), q(G) ? 0 : G, DA(w));
104
104
  return a === 0 ? void 0 : gg.__wrap(a);
105
105
  } finally {
106
- v[CA++] = void 0;
106
+ z[BA++] = void 0;
107
107
  }
108
108
  }
109
109
  castRayAndGetNormal(A, I, C, g, Q, B, i, o, h, s, G, w) {
110
110
  try {
111
111
  K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, M);
112
- const a = E.rawbroadphase_castRayAndGetNormal(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i, o, n(h) ? 4294967297 : h >>> 0, !n(s), n(s) ? 0 : s, !n(G), n(G) ? 0 : G, DA(w));
112
+ const a = E.rawbroadphase_castRayAndGetNormal(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i, o, q(h) ? 4294967297 : h >>> 0, !q(s), q(s) ? 0 : s, !q(G), q(G) ? 0 : G, DA(w));
113
113
  return a === 0 ? void 0 : JI.__wrap(a);
114
114
  } finally {
115
- v[CA++] = void 0;
115
+ z[BA++] = void 0;
116
116
  }
117
117
  }
118
118
  intersectionsWithRay(A, I, C, g, Q, B, i, o, h, s, G, w, a) {
119
119
  try {
120
- K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, M), E.rawbroadphase_intersectionsWithRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i, DA(o), h, n(s) ? 4294967297 : s >>> 0, !n(G), n(G) ? 0 : G, !n(w), n(w) ? 0 : w, DA(a));
120
+ K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, M), E.rawbroadphase_intersectionsWithRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i, DA(o), h, q(s) ? 4294967297 : s >>> 0, !q(G), q(G) ? 0 : G, !q(w), q(w) ? 0 : w, DA(a));
121
121
  } finally {
122
- v[CA++] = void 0, v[CA++] = void 0;
122
+ z[BA++] = void 0, z[BA++] = void 0;
123
123
  }
124
124
  }
125
125
  intersectionWithShape(A, I, C, g, Q, B, i, o, h, s, G) {
126
126
  try {
127
127
  const N = E.__wbindgen_add_to_stack_pointer(-16);
128
- K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, u), K(B, H), E.rawbroadphase_intersectionWithShape(N, this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i, n(o) ? 4294967297 : o >>> 0, !n(h), n(h) ? 0 : h, !n(s), n(s) ? 0 : s, DA(G));
128
+ K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, _), K(B, d), E.rawbroadphase_intersectionWithShape(N, this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i, q(o) ? 4294967297 : o >>> 0, !q(h), q(h) ? 0 : h, !q(s), q(s) ? 0 : s, DA(G));
129
129
  var w = SA().getInt32(N + 0, !0), a = SA().getFloat64(N + 8, !0);
130
130
  return w === 0 ? void 0 : a;
131
131
  } finally {
132
- E.__wbindgen_add_to_stack_pointer(16), v[CA++] = void 0;
132
+ E.__wbindgen_add_to_stack_pointer(16), z[BA++] = void 0;
133
133
  }
134
134
  }
135
135
  projectPoint(A, I, C, g, Q, B, i, o, h, s) {
136
136
  try {
137
137
  K(A, GA), K(I, EA), K(C, wA), K(g, M);
138
- const G = E.rawbroadphase_projectPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B, n(i) ? 4294967297 : i >>> 0, !n(o), n(o) ? 0 : o, !n(h), n(h) ? 0 : h, DA(s));
138
+ const G = E.rawbroadphase_projectPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B, q(i) ? 4294967297 : i >>> 0, !q(o), q(o) ? 0 : o, !q(h), q(h) ? 0 : h, DA(s));
139
139
  return G === 0 ? void 0 : GI.__wrap(G);
140
140
  } finally {
141
- v[CA++] = void 0;
141
+ z[BA++] = void 0;
142
142
  }
143
143
  }
144
144
  projectPointAndGetFeature(A, I, C, g, Q, B, i, o, h) {
145
145
  try {
146
146
  K(A, GA), K(I, EA), K(C, wA), K(g, M);
147
- const s = E.rawbroadphase_projectPointAndGetFeature(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, n(B) ? 4294967297 : B >>> 0, !n(i), n(i) ? 0 : i, !n(o), n(o) ? 0 : o, DA(h));
147
+ const s = E.rawbroadphase_projectPointAndGetFeature(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, q(B) ? 4294967297 : B >>> 0, !q(i), q(i) ? 0 : i, !q(o), q(o) ? 0 : o, DA(h));
148
148
  return s === 0 ? void 0 : GI.__wrap(s);
149
149
  } finally {
150
- v[CA++] = void 0;
150
+ z[BA++] = void 0;
151
151
  }
152
152
  }
153
153
  intersectionsWithPoint(A, I, C, g, Q, B, i, o, h, s) {
154
154
  try {
155
- K(A, GA), K(I, EA), K(C, wA), K(g, M), E.rawbroadphase_intersectionsWithPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, DA(Q), B, n(i) ? 4294967297 : i >>> 0, !n(o), n(o) ? 0 : o, !n(h), n(h) ? 0 : h, DA(s));
155
+ K(A, GA), K(I, EA), K(C, wA), K(g, M), E.rawbroadphase_intersectionsWithPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, DA(Q), B, q(i) ? 4294967297 : i >>> 0, !q(o), q(o) ? 0 : o, !q(h), q(h) ? 0 : h, DA(s));
156
156
  } finally {
157
- v[CA++] = void 0, v[CA++] = void 0;
157
+ z[BA++] = void 0, z[BA++] = void 0;
158
158
  }
159
159
  }
160
160
  castShape(A, I, C, g, Q, B, i, o, h, s, G, w, a, N, S) {
161
161
  try {
162
- K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, u), K(B, M), K(i, H);
163
- const k = E.rawbroadphase_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o, h, s, G, n(w) ? 4294967297 : w >>> 0, !n(a), n(a) ? 0 : a, !n(N), n(N) ? 0 : N, DA(S));
162
+ K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, _), K(B, M), K(i, d);
163
+ const k = E.rawbroadphase_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o, h, s, G, q(w) ? 4294967297 : w >>> 0, !q(a), q(a) ? 0 : a, !q(N), q(N) ? 0 : N, DA(S));
164
164
  return k === 0 ? void 0 : FI.__wrap(k);
165
165
  } finally {
166
- v[CA++] = void 0;
166
+ z[BA++] = void 0;
167
167
  }
168
168
  }
169
169
  intersectionsWithShape(A, I, C, g, Q, B, i, o, h, s, G, w) {
170
170
  try {
171
- K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, u), K(B, H), E.rawbroadphase_intersectionsWithShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, DA(i), o, n(h) ? 4294967297 : h >>> 0, !n(s), n(s) ? 0 : s, !n(G), n(G) ? 0 : G, DA(w));
171
+ K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, _), K(B, d), E.rawbroadphase_intersectionsWithShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, DA(i), o, q(h) ? 4294967297 : h >>> 0, !q(s), q(s) ? 0 : s, !q(G), q(G) ? 0 : G, DA(w));
172
172
  } finally {
173
- v[CA++] = void 0, v[CA++] = void 0;
173
+ z[BA++] = void 0, z[BA++] = void 0;
174
174
  }
175
175
  }
176
176
  collidersWithAabbIntersectingAabb(A, I, C, g, Q, B) {
177
177
  try {
178
178
  K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, M), E.rawbroadphase_collidersWithAabbIntersectingAabb(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, DA(B));
179
179
  } finally {
180
- v[CA++] = void 0;
180
+ z[BA++] = void 0;
181
181
  }
182
182
  }
183
183
  }
@@ -268,7 +268,7 @@ class wA {
268
268
  }
269
269
  coRotation(A) {
270
270
  const I = E.rawcolliderset_coRotation(this.__wbg_ptr, A);
271
- return u.__wrap(I);
271
+ return _.__wrap(I);
272
272
  }
273
273
  coTranslationWrtParent(A) {
274
274
  const I = E.rawcolliderset_coTranslationWrtParent(this.__wbg_ptr, A);
@@ -276,7 +276,7 @@ class wA {
276
276
  }
277
277
  coRotationWrtParent(A) {
278
278
  const I = E.rawcolliderset_coRotationWrtParent(this.__wbg_ptr, A);
279
- return I === 0 ? void 0 : u.__wrap(I);
279
+ return I === 0 ? void 0 : _.__wrap(I);
280
280
  }
281
281
  coSetTranslation(A, I, C) {
282
282
  E.rawcolliderset_coSetTranslation(this.__wbg_ptr, A, I, C);
@@ -454,7 +454,7 @@ class wA {
454
454
  return K(I, M), E.rawcolliderset_coContainsPoint(this.__wbg_ptr, A, I.__wbg_ptr) !== 0;
455
455
  }
456
456
  coCastShape(A, I, C, g, Q, B, i, o, h) {
457
- K(I, M), K(C, H), K(g, M), K(Q, u), K(B, M);
457
+ K(I, M), K(C, d), K(g, M), K(Q, _), K(B, M);
458
458
  const s = E.rawcolliderset_coCastShape(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i, o, h);
459
459
  return s === 0 ? void 0 : RI.__wrap(s);
460
460
  }
@@ -464,10 +464,10 @@ class wA {
464
464
  return o === 0 ? void 0 : FI.__wrap(o);
465
465
  }
466
466
  coIntersectsShape(A, I, C, g) {
467
- return K(I, H), K(C, M), K(g, u), E.rawcolliderset_coIntersectsShape(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr) !== 0;
467
+ return K(I, d), K(C, M), K(g, _), E.rawcolliderset_coIntersectsShape(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr) !== 0;
468
468
  }
469
469
  coContactShape(A, I, C, g, Q) {
470
- K(I, H), K(C, M), K(g, u);
470
+ K(I, d), K(C, M), K(g, _);
471
471
  const B = E.rawcolliderset_coContactShape(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q);
472
472
  return B === 0 ? void 0 : gI.__wrap(B);
473
473
  }
@@ -528,7 +528,7 @@ class wA {
528
528
  E.rawcolliderset_coSetActiveCollisionTypes(this.__wbg_ptr, A, I);
529
529
  }
530
530
  coSetShape(A, I) {
531
- K(I, H), E.rawcolliderset_coSetShape(this.__wbg_ptr, A, I.__wbg_ptr);
531
+ K(I, d), E.rawcolliderset_coSetShape(this.__wbg_ptr, A, I.__wbg_ptr);
532
532
  }
533
533
  coSetContactForceEventThreshold(A, I) {
534
534
  E.rawcolliderset_coSetContactForceEventThreshold(this.__wbg_ptr, A, I);
@@ -552,12 +552,12 @@ class wA {
552
552
  contains(A) {
553
553
  return E.rawcolliderset_contains(this.__wbg_ptr, A) !== 0;
554
554
  }
555
- createCollider(A, I, C, g, Q, B, i, o, h, s, G, w, a, N, S, k, y, U, c, t, J, R, e, Y) {
555
+ createCollider(A, I, C, g, Q, B, i, o, h, s, G, w, a, N, S, k, F, U, c, Y, J, R, e, t) {
556
556
  try {
557
- const b = E.__wbindgen_add_to_stack_pointer(-16);
558
- K(I, H), K(C, M), K(g, u), K(i, M), K(Y, EA), E.rawcolliderset_createCollider(b, this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B, i.__wbg_ptr, o, h, s, G, w, a, N, S, k, y, U, c, t, J, R, e, Y.__wbg_ptr);
559
- var r = SA().getInt32(b + 0, !0), L = SA().getFloat64(b + 8, !0);
560
- return r === 0 ? void 0 : L;
557
+ const T = E.__wbindgen_add_to_stack_pointer(-16);
558
+ K(I, d), K(C, M), K(g, _), K(i, M), K(t, EA), E.rawcolliderset_createCollider(T, this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B, i.__wbg_ptr, o, h, s, G, w, a, N, S, k, F, U, c, Y, J, R, e, t.__wbg_ptr);
559
+ var L = SA().getInt32(T + 0, !0), r = SA().getFloat64(T + 8, !0);
560
+ return L === 0 ? void 0 : r;
561
561
  } finally {
562
562
  E.__wbindgen_add_to_stack_pointer(16);
563
563
  }
@@ -572,7 +572,7 @@ class wA {
572
572
  try {
573
573
  E.rawcolliderset_forEachColliderHandle(this.__wbg_ptr, DA(A));
574
574
  } finally {
575
- v[CA++] = void 0;
575
+ z[BA++] = void 0;
576
576
  }
577
577
  }
578
578
  }
@@ -793,7 +793,7 @@ class rC {
793
793
  try {
794
794
  K(A, EA), K(I, wA), K(C, lA), K(g, HA), K(Q, GA), E.rawdebugrenderpipeline_render(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, DA(i));
795
795
  } finally {
796
- v[CA++] = void 0;
796
+ z[BA++] = void 0;
797
797
  }
798
798
  }
799
799
  }
@@ -871,14 +871,14 @@ class Xg {
871
871
  try {
872
872
  E.raweventqueue_drainCollisionEvents(this.__wbg_ptr, DA(A));
873
873
  } finally {
874
- v[CA++] = void 0;
874
+ z[BA++] = void 0;
875
875
  }
876
876
  }
877
877
  drainContactForceEvents(A) {
878
878
  try {
879
879
  E.raweventqueue_drainContactForceEvents(this.__wbg_ptr, DA(A));
880
880
  } finally {
881
- v[CA++] = void 0;
881
+ z[BA++] = void 0;
882
882
  }
883
883
  }
884
884
  clear() {
@@ -918,7 +918,7 @@ class MA {
918
918
  return i === 0 ? void 0 : MA.__wrap(i);
919
919
  }
920
920
  static fixed(A, I, C, g) {
921
- K(A, M), K(I, u), K(C, M), K(g, u);
921
+ K(A, M), K(I, _), K(C, M), K(g, _);
922
922
  const Q = E.rawgenericjoint_fixed(A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr);
923
923
  return MA.__wrap(Q);
924
924
  }
@@ -956,11 +956,11 @@ class lA {
956
956
  }
957
957
  jointFrameX1(A) {
958
958
  const I = E.rawimpulsejointset_jointFrameX1(this.__wbg_ptr, A);
959
- return u.__wrap(I);
959
+ return _.__wrap(I);
960
960
  }
961
961
  jointFrameX2(A) {
962
962
  const I = E.rawimpulsejointset_jointFrameX2(this.__wbg_ptr, A);
963
- return u.__wrap(I);
963
+ return _.__wrap(I);
964
964
  }
965
965
  jointAnchor1(A) {
966
966
  const I = E.rawimpulsejointset_jointAnchor1(this.__wbg_ptr, A);
@@ -1026,14 +1026,14 @@ class lA {
1026
1026
  try {
1027
1027
  E.rawimpulsejointset_forEachJointHandle(this.__wbg_ptr, DA(A));
1028
1028
  } finally {
1029
- v[CA++] = void 0;
1029
+ z[BA++] = void 0;
1030
1030
  }
1031
1031
  }
1032
1032
  forEachJointAttachedToRigidBody(A, I) {
1033
1033
  try {
1034
1034
  E.rawimpulsejointset_forEachJointAttachedToRigidBody(this.__wbg_ptr, A, DA(I));
1035
1035
  } finally {
1036
- v[CA++] = void 0;
1036
+ z[BA++] = void 0;
1037
1037
  }
1038
1038
  }
1039
1039
  }
@@ -1138,7 +1138,7 @@ class qA {
1138
1138
  try {
1139
1139
  E.rawislandmanager_forEachActiveRigidBodyHandle(this.__wbg_ptr, DA(A));
1140
1140
  } finally {
1141
- v[CA++] = void 0;
1141
+ z[BA++] = void 0;
1142
1142
  }
1143
1143
  }
1144
1144
  }
@@ -1231,9 +1231,9 @@ class LC {
1231
1231
  }
1232
1232
  computeColliderMovement(A, I, C, g, Q, B, i, o, h, s, G, w) {
1233
1233
  try {
1234
- K(I, bA), K(C, GA), K(g, EA), K(Q, wA), K(i, M), E.rawkinematiccharactercontroller_computeColliderMovement(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i.__wbg_ptr, o, n(h) ? 4294967297 : Math.fround(h), s, n(G) ? 4294967297 : G >>> 0, DA(w));
1234
+ K(I, bA), K(C, GA), K(g, EA), K(Q, wA), K(i, M), E.rawkinematiccharactercontroller_computeColliderMovement(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i.__wbg_ptr, o, q(h) ? 4294967297 : Math.fround(h), s, q(G) ? 4294967297 : G >>> 0, DA(w));
1235
1235
  } finally {
1236
- v[CA++] = void 0;
1236
+ z[BA++] = void 0;
1237
1237
  }
1238
1238
  }
1239
1239
  computedMovement() {
@@ -1272,11 +1272,11 @@ class HA {
1272
1272
  }
1273
1273
  jointFrameX1(A) {
1274
1274
  const I = E.rawmultibodyjointset_jointFrameX1(this.__wbg_ptr, A);
1275
- return u.__wrap(I);
1275
+ return _.__wrap(I);
1276
1276
  }
1277
1277
  jointFrameX2(A) {
1278
1278
  const I = E.rawmultibodyjointset_jointFrameX2(this.__wbg_ptr, A);
1279
- return u.__wrap(I);
1279
+ return _.__wrap(I);
1280
1280
  }
1281
1281
  jointAnchor1(A) {
1282
1282
  const I = E.rawmultibodyjointset_jointAnchor1(this.__wbg_ptr, A);
@@ -1318,14 +1318,14 @@ class HA {
1318
1318
  try {
1319
1319
  E.rawmultibodyjointset_forEachJointHandle(this.__wbg_ptr, DA(A));
1320
1320
  } finally {
1321
- v[CA++] = void 0;
1321
+ z[BA++] = void 0;
1322
1322
  }
1323
1323
  }
1324
1324
  forEachJointAttachedToRigidBody(A, I) {
1325
1325
  try {
1326
1326
  E.rawmultibodyjointset_forEachJointAttachedToRigidBody(this.__wbg_ptr, A, DA(I));
1327
1327
  } finally {
1328
- v[CA++] = void 0;
1328
+ z[BA++] = void 0;
1329
1329
  }
1330
1330
  }
1331
1331
  }
@@ -1351,14 +1351,14 @@ class GA {
1351
1351
  return this.__wbg_ptr = A >>> 0, fI.register(this, this.__wbg_ptr, this), this;
1352
1352
  }
1353
1353
  contact_pairs_with(A, I) {
1354
- E.rawnarrowphase_contact_pairs_with(this.__wbg_ptr, A, $(I));
1354
+ E.rawnarrowphase_contact_pairs_with(this.__wbg_ptr, A, CA(I));
1355
1355
  }
1356
1356
  contact_pair(A, I) {
1357
1357
  const C = E.rawnarrowphase_contact_pair(this.__wbg_ptr, A, I);
1358
1358
  return C === 0 ? void 0 : Ag.__wrap(C);
1359
1359
  }
1360
1360
  intersection_pairs_with(A, I) {
1361
- E.rawnarrowphase_intersection_pairs_with(this.__wbg_ptr, A, $(I));
1361
+ E.rawnarrowphase_intersection_pairs_with(this.__wbg_ptr, A, CA(I));
1362
1362
  }
1363
1363
  intersection_pair(A, I) {
1364
1364
  return E.rawnarrowphase_intersection_pair(this.__wbg_ptr, A, I) !== 0;
@@ -1438,7 +1438,7 @@ class nC {
1438
1438
  K(A, M), K(I, jA), K(C, qA), K(g, bA), K(Q, GA), K(B, EA), K(i, wA), K(o, lA), K(h, HA), K(s, WI), E.rawphysicspipeline_step(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o.__wbg_ptr, h.__wbg_ptr, s.__wbg_ptr);
1439
1439
  }
1440
1440
  stepWithEvents(A, I, C, g, Q, B, i, o, h, s, G, w, a, N) {
1441
- K(A, M), K(I, jA), K(C, qA), K(g, bA), K(Q, GA), K(B, EA), K(i, wA), K(o, lA), K(h, HA), K(s, WI), K(G, Xg), E.rawphysicspipeline_stepWithEvents(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o.__wbg_ptr, h.__wbg_ptr, s.__wbg_ptr, G.__wbg_ptr, $(w), $(a), $(N));
1441
+ K(A, M), K(I, jA), K(C, qA), K(g, bA), K(Q, GA), K(B, EA), K(i, wA), K(o, lA), K(h, HA), K(s, WI), K(G, Xg), E.rawphysicspipeline_stepWithEvents(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o.__wbg_ptr, h.__wbg_ptr, s.__wbg_ptr, G.__wbg_ptr, CA(w), CA(a), CA(N));
1442
1442
  }
1443
1443
  }
1444
1444
  const Lg = typeof FinalizationRegistry > "u" ? { register: () => {
@@ -1661,7 +1661,7 @@ class EA {
1661
1661
  }
1662
1662
  rbRotation(A) {
1663
1663
  const I = E.rawrigidbodyset_rbRotation(this.__wbg_ptr, A);
1664
- return u.__wrap(I);
1664
+ return _.__wrap(I);
1665
1665
  }
1666
1666
  rbSleep(A) {
1667
1667
  E.rawrigidbodyset_rbSleep(this.__wbg_ptr, A);
@@ -1678,7 +1678,7 @@ class EA {
1678
1678
  }
1679
1679
  rbNextRotation(A) {
1680
1680
  const I = E.rawrigidbodyset_rbNextRotation(this.__wbg_ptr, A);
1681
- return u.__wrap(I);
1681
+ return _.__wrap(I);
1682
1682
  }
1683
1683
  rbSetTranslation(A, I, C, g) {
1684
1684
  E.rawrigidbodyset_rbSetTranslation(this.__wbg_ptr, A, I, C, g);
@@ -1871,8 +1871,8 @@ class EA {
1871
1871
  const A = E.rawrigidbodyset_new();
1872
1872
  return this.__wbg_ptr = A >>> 0, bI.register(this, this.__wbg_ptr, this), this;
1873
1873
  }
1874
- createRigidBody(A, I, C, g, Q, B, i, o, h, s, G, w, a, N, S, k, y, U, c, t, J, R) {
1875
- return K(I, M), K(C, u), K(i, M), K(o, M), E.rawrigidbodyset_createRigidBody(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g, Q, B, i.__wbg_ptr, o.__wbg_ptr, h, s, G, w, a, N, S, k, y, U, c, t, J, R);
1874
+ createRigidBody(A, I, C, g, Q, B, i, o, h, s, G, w, a, N, S, k, F, U, c, Y, J, R) {
1875
+ return K(I, M), K(C, _), K(i, M), K(o, M), E.rawrigidbodyset_createRigidBody(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g, Q, B, i.__wbg_ptr, o.__wbg_ptr, h, s, G, w, a, N, S, k, F, U, c, Y, J, R);
1876
1876
  }
1877
1877
  remove(A, I, C, g, Q) {
1878
1878
  K(I, qA), K(C, wA), K(g, lA), K(Q, HA), E.rawrigidbodyset_remove(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr);
@@ -1887,7 +1887,7 @@ class EA {
1887
1887
  try {
1888
1888
  E.rawrigidbodyset_forEachRigidBodyHandle(this.__wbg_ptr, DA(A));
1889
1889
  } finally {
1890
- v[CA++] = void 0;
1890
+ z[BA++] = void 0;
1891
1891
  }
1892
1892
  }
1893
1893
  propagateModifiedBodyPositionsToColliders(A) {
@@ -1897,10 +1897,10 @@ class EA {
1897
1897
  const dg = typeof FinalizationRegistry > "u" ? { register: () => {
1898
1898
  }, unregister: () => {
1899
1899
  } } : new FinalizationRegistry((D) => E.__wbg_rawrotation_free(D >>> 0, 1));
1900
- class u {
1900
+ class _ {
1901
1901
  static __wrap(A) {
1902
1902
  A >>>= 0;
1903
- const I = Object.create(u.prototype);
1903
+ const I = Object.create(_.prototype);
1904
1904
  return I.__wbg_ptr = A, dg.register(I, I.__wbg_ptr, I), I;
1905
1905
  }
1906
1906
  __destroy_into_raw() {
@@ -1913,11 +1913,11 @@ class u {
1913
1913
  }
1914
1914
  static identity() {
1915
1915
  const A = E.rawrotation_identity();
1916
- return u.__wrap(A);
1916
+ return _.__wrap(A);
1917
1917
  }
1918
1918
  static fromAngle(A) {
1919
1919
  const I = E.rawrotation_fromAngle(A);
1920
- return u.__wrap(I);
1920
+ return _.__wrap(I);
1921
1921
  }
1922
1922
  get im() {
1923
1923
  return E.rawkinematiccharactercontroller_offset(this.__wbg_ptr);
@@ -1949,17 +1949,17 @@ class qC {
1949
1949
  return K(A, M), K(I, jA), K(C, qA), K(g, bA), K(Q, GA), K(B, EA), K(i, wA), K(o, lA), K(h, HA), sI(E.rawserializationpipeline_serializeAll(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o.__wbg_ptr, h.__wbg_ptr));
1950
1950
  }
1951
1951
  deserializeAll(A) {
1952
- const I = E.rawserializationpipeline_deserializeAll(this.__wbg_ptr, $(A));
1952
+ const I = E.rawserializationpipeline_deserializeAll(this.__wbg_ptr, CA(A));
1953
1953
  return I === 0 ? void 0 : Ig.__wrap(I);
1954
1954
  }
1955
1955
  }
1956
1956
  const bg = typeof FinalizationRegistry > "u" ? { register: () => {
1957
1957
  }, unregister: () => {
1958
1958
  } } : new FinalizationRegistry((D) => E.__wbg_rawshape_free(D >>> 0, 1));
1959
- class H {
1959
+ class d {
1960
1960
  static __wrap(A) {
1961
1961
  A >>>= 0;
1962
- const I = Object.create(H.prototype);
1962
+ const I = Object.create(d.prototype);
1963
1963
  return I.__wbg_ptr = A, bg.register(I, I.__wbg_ptr, I), I;
1964
1964
  }
1965
1965
  __destroy_into_raw() {
@@ -1972,109 +1972,109 @@ class H {
1972
1972
  }
1973
1973
  static cuboid(A, I) {
1974
1974
  const C = E.rawshape_cuboid(A, I);
1975
- return H.__wrap(C);
1975
+ return d.__wrap(C);
1976
1976
  }
1977
1977
  static roundCuboid(A, I, C) {
1978
1978
  const g = E.rawshape_roundCuboid(A, I, C);
1979
- return H.__wrap(g);
1979
+ return d.__wrap(g);
1980
1980
  }
1981
1981
  static ball(A) {
1982
1982
  const I = E.rawshape_ball(A);
1983
- return H.__wrap(I);
1983
+ return d.__wrap(I);
1984
1984
  }
1985
1985
  static halfspace(A) {
1986
1986
  K(A, M);
1987
1987
  const I = E.rawshape_halfspace(A.__wbg_ptr);
1988
- return H.__wrap(I);
1988
+ return d.__wrap(I);
1989
1989
  }
1990
1990
  static capsule(A, I) {
1991
1991
  const C = E.rawshape_capsule(A, I);
1992
- return H.__wrap(C);
1992
+ return d.__wrap(C);
1993
1993
  }
1994
1994
  static voxels(A, I) {
1995
1995
  K(A, M);
1996
1996
  const C = LI(I, E.__wbindgen_export_2), g = UA, Q = E.rawshape_voxels(A.__wbg_ptr, C, g);
1997
- return H.__wrap(Q);
1997
+ return d.__wrap(Q);
1998
1998
  }
1999
1999
  static voxelsFromPoints(A, I) {
2000
2000
  K(A, M);
2001
2001
  const C = dA(I, E.__wbindgen_export_2), g = UA, Q = E.rawshape_voxelsFromPoints(A.__wbg_ptr, C, g);
2002
- return H.__wrap(Q);
2002
+ return d.__wrap(Q);
2003
2003
  }
2004
2004
  static polyline(A, I) {
2005
2005
  const C = dA(A, E.__wbindgen_export_2), g = UA, Q = LI(I, E.__wbindgen_export_2), B = UA, i = E.rawshape_polyline(C, g, Q, B);
2006
- return H.__wrap(i);
2006
+ return d.__wrap(i);
2007
2007
  }
2008
2008
  static trimesh(A, I, C) {
2009
2009
  const g = dA(A, E.__wbindgen_export_2), Q = UA, B = LI(I, E.__wbindgen_export_2), i = UA, o = E.rawshape_trimesh(g, Q, B, i, C);
2010
- return o === 0 ? void 0 : H.__wrap(o);
2010
+ return o === 0 ? void 0 : d.__wrap(o);
2011
2011
  }
2012
2012
  static heightfield(A, I) {
2013
2013
  const C = dA(A, E.__wbindgen_export_2), g = UA;
2014
2014
  K(I, M);
2015
2015
  const Q = E.rawshape_heightfield(C, g, I.__wbg_ptr);
2016
- return H.__wrap(Q);
2016
+ return d.__wrap(Q);
2017
2017
  }
2018
2018
  static segment(A, I) {
2019
2019
  K(A, M), K(I, M);
2020
2020
  const C = E.rawshape_segment(A.__wbg_ptr, I.__wbg_ptr);
2021
- return H.__wrap(C);
2021
+ return d.__wrap(C);
2022
2022
  }
2023
2023
  static triangle(A, I, C) {
2024
2024
  K(A, M), K(I, M), K(C, M);
2025
2025
  const g = E.rawshape_triangle(A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr);
2026
- return H.__wrap(g);
2026
+ return d.__wrap(g);
2027
2027
  }
2028
2028
  static roundTriangle(A, I, C, g) {
2029
2029
  K(A, M), K(I, M), K(C, M);
2030
2030
  const Q = E.rawshape_roundTriangle(A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g);
2031
- return H.__wrap(Q);
2031
+ return d.__wrap(Q);
2032
2032
  }
2033
2033
  static convexHull(A) {
2034
2034
  const I = dA(A, E.__wbindgen_export_2), C = UA, g = E.rawshape_convexHull(I, C);
2035
- return g === 0 ? void 0 : H.__wrap(g);
2035
+ return g === 0 ? void 0 : d.__wrap(g);
2036
2036
  }
2037
2037
  static roundConvexHull(A, I) {
2038
2038
  const C = dA(A, E.__wbindgen_export_2), g = UA, Q = E.rawshape_roundConvexHull(C, g, I);
2039
- return Q === 0 ? void 0 : H.__wrap(Q);
2039
+ return Q === 0 ? void 0 : d.__wrap(Q);
2040
2040
  }
2041
2041
  static convexPolyline(A) {
2042
2042
  const I = dA(A, E.__wbindgen_export_2), C = UA, g = E.rawshape_convexPolyline(I, C);
2043
- return g === 0 ? void 0 : H.__wrap(g);
2043
+ return g === 0 ? void 0 : d.__wrap(g);
2044
2044
  }
2045
2045
  static roundConvexPolyline(A, I) {
2046
2046
  const C = dA(A, E.__wbindgen_export_2), g = UA, Q = E.rawshape_roundConvexPolyline(C, g, I);
2047
- return Q === 0 ? void 0 : H.__wrap(Q);
2047
+ return Q === 0 ? void 0 : d.__wrap(Q);
2048
2048
  }
2049
2049
  castShape(A, I, C, g, Q, B, i, o, h, s) {
2050
- K(A, M), K(I, u), K(C, M), K(g, H), K(Q, M), K(B, u), K(i, M);
2050
+ K(A, M), K(I, _), K(C, M), K(g, d), K(Q, M), K(B, _), K(i, M);
2051
2051
  const G = E.rawshape_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o, h, s);
2052
2052
  return G === 0 ? void 0 : RI.__wrap(G);
2053
2053
  }
2054
2054
  intersectsShape(A, I, C, g, Q) {
2055
- return K(A, M), K(I, u), K(C, H), K(g, M), K(Q, u), E.rawshape_intersectsShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr) !== 0;
2055
+ return K(A, M), K(I, _), K(C, d), K(g, M), K(Q, _), E.rawshape_intersectsShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr) !== 0;
2056
2056
  }
2057
2057
  contactShape(A, I, C, g, Q, B) {
2058
- K(A, M), K(I, u), K(C, H), K(g, M), K(Q, u);
2058
+ K(A, M), K(I, _), K(C, d), K(g, M), K(Q, _);
2059
2059
  const i = E.rawshape_contactShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B);
2060
2060
  return i === 0 ? void 0 : gI.__wrap(i);
2061
2061
  }
2062
2062
  containsPoint(A, I, C) {
2063
- return K(A, M), K(I, u), K(C, M), E.rawshape_containsPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr) !== 0;
2063
+ return K(A, M), K(I, _), K(C, M), E.rawshape_containsPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr) !== 0;
2064
2064
  }
2065
2065
  projectPoint(A, I, C, g) {
2066
- K(A, M), K(I, u), K(C, M);
2066
+ K(A, M), K(I, _), K(C, M);
2067
2067
  const Q = E.rawshape_projectPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g);
2068
2068
  return MI.__wrap(Q);
2069
2069
  }
2070
2070
  intersectsRay(A, I, C, g, Q) {
2071
- return K(A, M), K(I, u), K(C, M), K(g, M), E.rawshape_intersectsRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q) !== 0;
2071
+ return K(A, M), K(I, _), K(C, M), K(g, M), E.rawshape_intersectsRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q) !== 0;
2072
2072
  }
2073
2073
  castRay(A, I, C, g, Q, B) {
2074
- return K(A, M), K(I, u), K(C, M), K(g, M), E.rawshape_castRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B);
2074
+ return K(A, M), K(I, _), K(C, M), K(g, M), E.rawshape_castRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B);
2075
2075
  }
2076
2076
  castRayAndGetNormal(A, I, C, g, Q, B) {
2077
- K(A, M), K(I, u), K(C, M), K(g, M);
2077
+ K(A, M), K(I, _), K(C, M), K(g, M);
2078
2078
  const i = E.rawshape_castRayAndGetNormal(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B);
2079
2079
  return i === 0 ? void 0 : UI.__wrap(i);
2080
2080
  }
@@ -2205,79 +2205,79 @@ async function vg(D) {
2205
2205
  const A = function() {
2206
2206
  const g = { wbg: {} };
2207
2207
  return g.wbg.__wbg_bind_c8359b1cba058168 = function(Q, B, i, o) {
2208
- return $(j(Q).bind(j(B), j(i), j(o)));
2208
+ return CA(v(Q).bind(v(B), v(i), v(o)));
2209
2209
  }, g.wbg.__wbg_buffer_609cc3eee51ed158 = function(Q) {
2210
- return $(j(Q).buffer);
2210
+ return CA(v(Q).buffer);
2211
2211
  }, g.wbg.__wbg_call_672a4d21634d4a24 = function() {
2212
2212
  return hI(function(Q, B) {
2213
- return $(j(Q).call(j(B)));
2213
+ return CA(v(Q).call(v(B)));
2214
2214
  }, arguments);
2215
2215
  }, g.wbg.__wbg_call_7cccdd69e0791ae2 = function() {
2216
2216
  return hI(function(Q, B, i) {
2217
- return $(j(Q).call(j(B), j(i)));
2217
+ return CA(v(Q).call(v(B), v(i)));
2218
2218
  }, arguments);
2219
2219
  }, g.wbg.__wbg_call_833bed5770ea2041 = function() {
2220
2220
  return hI(function(Q, B, i, o) {
2221
- return $(j(Q).call(j(B), j(i), j(o)));
2221
+ return CA(v(Q).call(v(B), v(i), v(o)));
2222
2222
  }, arguments);
2223
2223
  }, g.wbg.__wbg_call_b8adc8b1d0a0d8eb = function() {
2224
2224
  return hI(function(Q, B, i, o, h) {
2225
- return $(j(Q).call(j(B), j(i), j(o), j(h)));
2225
+ return CA(v(Q).call(v(B), v(i), v(o), v(h)));
2226
2226
  }, arguments);
2227
2227
  }, g.wbg.__wbg_length_3b4f022188ae8db6 = function(Q) {
2228
- return j(Q).length;
2228
+ return v(Q).length;
2229
2229
  }, g.wbg.__wbg_length_a446193dc22c12f8 = function(Q) {
2230
- return j(Q).length;
2230
+ return v(Q).length;
2231
2231
  }, g.wbg.__wbg_new_a12002a7f91c75be = function(Q) {
2232
- return $(new Uint8Array(j(Q)));
2232
+ return CA(new Uint8Array(v(Q)));
2233
2233
  }, g.wbg.__wbg_newnoargs_105ed471475aaf50 = function(Q, B) {
2234
- return $(new Function(OI(Q, B)));
2234
+ return CA(new Function(OI(Q, B)));
2235
2235
  }, g.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(Q, B, i) {
2236
- return $(new Uint8Array(j(Q), B >>> 0, i >>> 0));
2236
+ return CA(new Uint8Array(v(Q), B >>> 0, i >>> 0));
2237
2237
  }, g.wbg.__wbg_newwithbyteoffsetandlength_e6b7e69acd4c7354 = function(Q, B, i) {
2238
- return $(new Float32Array(j(Q), B >>> 0, i >>> 0));
2238
+ return CA(new Float32Array(v(Q), B >>> 0, i >>> 0));
2239
2239
  }, g.wbg.__wbg_newwithlength_5a5efe313cfd59f1 = function(Q) {
2240
- return $(new Float32Array(Q >>> 0));
2240
+ return CA(new Float32Array(Q >>> 0));
2241
2241
  }, g.wbg.__wbg_now_2c95c9de01293173 = function(Q) {
2242
- return j(Q).now();
2242
+ return v(Q).now();
2243
2243
  }, g.wbg.__wbg_performance_7a3ffd0b17f663ad = function(Q) {
2244
- return $(j(Q).performance);
2244
+ return CA(v(Q).performance);
2245
2245
  }, g.wbg.__wbg_rawcontactforceevent_new = function(Q) {
2246
- return $(_I.__wrap(Q));
2246
+ return CA(_I.__wrap(Q));
2247
2247
  }, g.wbg.__wbg_rawraycolliderintersection_new = function(Q) {
2248
- return $(JI.__wrap(Q));
2248
+ return CA(JI.__wrap(Q));
2249
2249
  }, g.wbg.__wbg_set_10bad9bee0e9c58b = function(Q, B, i) {
2250
- j(Q).set(j(B), i >>> 0);
2250
+ v(Q).set(v(B), i >>> 0);
2251
2251
  }, g.wbg.__wbg_set_65595bdd868b3009 = function(Q, B, i) {
2252
- j(Q).set(j(B), i >>> 0);
2252
+ v(Q).set(v(B), i >>> 0);
2253
2253
  }, g.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
2254
2254
  const Q = typeof global > "u" ? null : global;
2255
- return n(Q) ? 0 : $(Q);
2255
+ return q(Q) ? 0 : CA(Q);
2256
2256
  }, g.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
2257
2257
  const Q = typeof globalThis > "u" ? null : globalThis;
2258
- return n(Q) ? 0 : $(Q);
2258
+ return q(Q) ? 0 : CA(Q);
2259
2259
  }, g.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
2260
2260
  const Q = typeof self > "u" ? null : self;
2261
- return n(Q) ? 0 : $(Q);
2261
+ return q(Q) ? 0 : CA(Q);
2262
2262
  }, g.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
2263
2263
  const Q = typeof window > "u" ? null : window;
2264
- return n(Q) ? 0 : $(Q);
2264
+ return q(Q) ? 0 : CA(Q);
2265
2265
  }, g.wbg.__wbindgen_boolean_get = function(Q) {
2266
- const B = j(Q);
2266
+ const B = v(Q);
2267
2267
  return typeof B == "boolean" ? B ? 1 : 0 : 2;
2268
2268
  }, g.wbg.__wbindgen_is_function = function(Q) {
2269
- return typeof j(Q) == "function";
2269
+ return typeof v(Q) == "function";
2270
2270
  }, g.wbg.__wbindgen_is_undefined = function(Q) {
2271
- return j(Q) === void 0;
2271
+ return v(Q) === void 0;
2272
2272
  }, g.wbg.__wbindgen_memory = function() {
2273
- return $(E.memory);
2273
+ return CA(E.memory);
2274
2274
  }, g.wbg.__wbindgen_number_get = function(Q, B) {
2275
- const i = j(B), o = typeof i == "number" ? i : void 0;
2276
- SA().setFloat64(Q + 8, n(o) ? 0 : o, !0), SA().setInt32(Q + 0, !n(o), !0);
2275
+ const i = v(B), o = typeof i == "number" ? i : void 0;
2276
+ SA().setFloat64(Q + 8, q(o) ? 0 : o, !0), SA().setInt32(Q + 0, !q(o), !0);
2277
2277
  }, g.wbg.__wbindgen_number_new = function(Q) {
2278
- return $(Q);
2278
+ return CA(Q);
2279
2279
  }, g.wbg.__wbindgen_object_clone_ref = function(Q) {
2280
- return $(j(Q));
2280
+ return CA(v(Q));
2281
2281
  }, g.wbg.__wbindgen_object_drop_ref = function(Q) {
2282
2282
  sI(Q);
2283
2283
  }, g.wbg.__wbindgen_throw = function(Q, B) {
@@ -2310,16 +2310,16 @@ class ug {
2310
2310
  this.x = A, this.y = I;
2311
2311
  }
2312
2312
  }
2313
- class F {
2313
+ class y {
2314
2314
  static new(A, I) {
2315
2315
  return new ug(A, I);
2316
2316
  }
2317
2317
  static zeros() {
2318
- return F.new(0, 0);
2318
+ return y.new(0, 0);
2319
2319
  }
2320
2320
  static fromRaw(A) {
2321
2321
  if (!A) return null;
2322
- let I = F.new(A.x, A.y);
2322
+ let I = y.new(A.x, A.y);
2323
2323
  return A.free(), I;
2324
2324
  }
2325
2325
  static intoRaw(A) {
@@ -2329,7 +2329,7 @@ class F {
2329
2329
  A.x = I.x, A.y = I.y;
2330
2330
  }
2331
2331
  }
2332
- class AA {
2332
+ class QA {
2333
2333
  static identity() {
2334
2334
  return 0;
2335
2335
  }
@@ -2339,7 +2339,7 @@ class AA {
2339
2339
  return A.free(), I;
2340
2340
  }
2341
2341
  static intoRaw(A) {
2342
- return u.fromAngle(A);
2342
+ return _.fromAngle(A);
2343
2343
  }
2344
2344
  }
2345
2345
  var YA, RA, jI, mI, CI, vA, kA, xI, XI, aI, KI, vI, uI, SI, WA;
@@ -2391,25 +2391,25 @@ class PI {
2391
2391
  }
2392
2392
  translation() {
2393
2393
  let A = this.rawSet.rbTranslation(this.handle);
2394
- return F.fromRaw(A);
2394
+ return y.fromRaw(A);
2395
2395
  }
2396
2396
  rotation() {
2397
2397
  let A = this.rawSet.rbRotation(this.handle);
2398
- return AA.fromRaw(A);
2398
+ return QA.fromRaw(A);
2399
2399
  }
2400
2400
  nextTranslation() {
2401
2401
  let A = this.rawSet.rbNextTranslation(this.handle);
2402
- return F.fromRaw(A);
2402
+ return y.fromRaw(A);
2403
2403
  }
2404
2404
  nextRotation() {
2405
2405
  let A = this.rawSet.rbNextRotation(this.handle);
2406
- return AA.fromRaw(A);
2406
+ return QA.fromRaw(A);
2407
2407
  }
2408
2408
  setTranslation(A, I) {
2409
2409
  this.rawSet.rbSetTranslation(this.handle, A.x, A.y, I);
2410
2410
  }
2411
2411
  setLinvel(A, I) {
2412
- let C = F.intoRaw(A);
2412
+ let C = y.intoRaw(A);
2413
2413
  this.rawSet.rbSetLinvel(this.handle, C, I), C.free();
2414
2414
  }
2415
2415
  gravityScale() {
@@ -2431,11 +2431,11 @@ class PI {
2431
2431
  this.rawSet.rbSetNextKinematicRotation(this.handle, A);
2432
2432
  }
2433
2433
  linvel() {
2434
- return F.fromRaw(this.rawSet.rbLinvel(this.handle));
2434
+ return y.fromRaw(this.rawSet.rbLinvel(this.handle));
2435
2435
  }
2436
2436
  velocityAtPoint(A) {
2437
- const I = F.intoRaw(A);
2438
- let C = F.fromRaw(this.rawSet.rbVelocityAtPoint(this.handle, I));
2437
+ const I = y.intoRaw(A);
2438
+ let C = y.fromRaw(this.rawSet.rbVelocityAtPoint(this.handle, I));
2439
2439
  return I.free(), C;
2440
2440
  }
2441
2441
  angvel() {
@@ -2445,16 +2445,16 @@ class PI {
2445
2445
  return this.rawSet.rbMass(this.handle);
2446
2446
  }
2447
2447
  effectiveInvMass() {
2448
- return F.fromRaw(this.rawSet.rbEffectiveInvMass(this.handle));
2448
+ return y.fromRaw(this.rawSet.rbEffectiveInvMass(this.handle));
2449
2449
  }
2450
2450
  invMass() {
2451
2451
  return this.rawSet.rbInvMass(this.handle);
2452
2452
  }
2453
2453
  localCom() {
2454
- return F.fromRaw(this.rawSet.rbLocalCom(this.handle));
2454
+ return y.fromRaw(this.rawSet.rbLocalCom(this.handle));
2455
2455
  }
2456
2456
  worldCom() {
2457
- return F.fromRaw(this.rawSet.rbWorldCom(this.handle));
2457
+ return y.fromRaw(this.rawSet.rbWorldCom(this.handle));
2458
2458
  }
2459
2459
  invPrincipalInertia() {
2460
2460
  return this.rawSet.rbInvPrincipalInertia(this.handle);
@@ -2526,7 +2526,7 @@ class PI {
2526
2526
  this.rawSet.rbSetAdditionalMass(this.handle, A, I);
2527
2527
  }
2528
2528
  setAdditionalMassProperties(A, I, C, g) {
2529
- let Q = F.intoRaw(I);
2529
+ let Q = y.intoRaw(I);
2530
2530
  this.rawSet.rbSetAdditionalMassProperties(this.handle, A, Q, C, g), Q.free();
2531
2531
  }
2532
2532
  setAngularDamping(A) {
@@ -2539,11 +2539,11 @@ class PI {
2539
2539
  this.rawSet.rbResetTorques(this.handle, A);
2540
2540
  }
2541
2541
  addForce(A, I) {
2542
- const C = F.intoRaw(A);
2542
+ const C = y.intoRaw(A);
2543
2543
  this.rawSet.rbAddForce(this.handle, C, I), C.free();
2544
2544
  }
2545
2545
  applyImpulse(A, I) {
2546
- const C = F.intoRaw(A);
2546
+ const C = y.intoRaw(A);
2547
2547
  this.rawSet.rbApplyImpulse(this.handle, C, I), C.free();
2548
2548
  }
2549
2549
  addTorque(A, I) {
@@ -2553,15 +2553,15 @@ class PI {
2553
2553
  this.rawSet.rbApplyTorqueImpulse(this.handle, A, I);
2554
2554
  }
2555
2555
  addForceAtPoint(A, I, C) {
2556
- const g = F.intoRaw(A), Q = F.intoRaw(I);
2556
+ const g = y.intoRaw(A), Q = y.intoRaw(I);
2557
2557
  this.rawSet.rbAddForceAtPoint(this.handle, g, Q, C), g.free(), Q.free();
2558
2558
  }
2559
2559
  applyImpulseAtPoint(A, I, C) {
2560
- const g = F.intoRaw(A), Q = F.intoRaw(I);
2560
+ const g = y.intoRaw(A), Q = y.intoRaw(I);
2561
2561
  this.rawSet.rbApplyImpulseAtPoint(this.handle, g, Q, C), g.free(), Q.free();
2562
2562
  }
2563
2563
  userForce() {
2564
- return F.fromRaw(this.rawSet.rbUserForce(this.handle));
2564
+ return y.fromRaw(this.rawSet.rbUserForce(this.handle));
2565
2565
  }
2566
2566
  userTorque() {
2567
2567
  return this.rawSet.rbUserTorque(this.handle);
@@ -2569,7 +2569,7 @@ class PI {
2569
2569
  }
2570
2570
  class rA {
2571
2571
  constructor(A) {
2572
- this.enabled = !0, this.status = A, this.translation = F.zeros(), this.rotation = AA.identity(), this.gravityScale = 1, this.linvel = F.zeros(), this.mass = 0, this.massOnly = !1, this.centerOfMass = F.zeros(), this.translationsEnabledX = !0, this.translationsEnabledY = !0, this.angvel = 0, this.principalAngularInertia = 0, this.rotationsEnabled = !0, this.linearDamping = 0, this.angularDamping = 0, this.canSleep = !0, this.sleeping = !1, this.ccdEnabled = !1, this.softCcdPrediction = 0, this.dominanceGroup = 0, this.additionalSolverIterations = 0;
2572
+ this.enabled = !0, this.status = A, this.translation = y.zeros(), this.rotation = QA.identity(), this.gravityScale = 1, this.linvel = y.zeros(), this.mass = 0, this.massOnly = !1, this.centerOfMass = y.zeros(), this.translationsEnabledX = !0, this.translationsEnabledY = !0, this.angvel = 0, this.principalAngularInertia = 0, this.rotationsEnabled = !0, this.linearDamping = 0, this.angularDamping = 0, this.canSleep = !0, this.sleeping = !1, this.ccdEnabled = !1, this.softCcdPrediction = 0, this.dominanceGroup = 0, this.additionalSolverIterations = 0;
2573
2573
  }
2574
2574
  static dynamic() {
2575
2575
  return new rA(YA.Dynamic);
@@ -2625,7 +2625,7 @@ class rA {
2625
2625
  return this.angvel = A, this;
2626
2626
  }
2627
2627
  setAdditionalMassProperties(A, I, C) {
2628
- return this.mass = A, F.copy(this.centerOfMass, I), this.principalAngularInertia = C, this.massOnly = !1, this;
2628
+ return this.mass = A, y.copy(this.centerOfMass, I), this.principalAngularInertia = C, this.massOnly = !1, this;
2629
2629
  }
2630
2630
  enabledTranslations(A, I) {
2631
2631
  return this.translationsEnabledX = A, this.translationsEnabledY = I, this;
@@ -2707,7 +2707,7 @@ class Pg {
2707
2707
  this.map.forEach((I) => I.finalizeDeserialization(A));
2708
2708
  }
2709
2709
  createRigidBody(A, I) {
2710
- let C = F.intoRaw(I.translation), g = AA.intoRaw(I.rotation), Q = F.intoRaw(I.linvel), B = F.intoRaw(I.centerOfMass), i = this.raw.createRigidBody(I.enabled, C, g, I.gravityScale, I.mass, I.massOnly, B, Q, I.angvel, I.principalAngularInertia, I.translationsEnabledX, I.translationsEnabledY, I.rotationsEnabled, I.linearDamping, I.angularDamping, I.status, I.canSleep, I.sleeping, I.softCcdPrediction, I.ccdEnabled, I.dominanceGroup, I.additionalSolverIterations);
2710
+ let C = y.intoRaw(I.translation), g = QA.intoRaw(I.rotation), Q = y.intoRaw(I.linvel), B = y.intoRaw(I.centerOfMass), i = this.raw.createRigidBody(I.enabled, C, g, I.gravityScale, I.mass, I.massOnly, B, Q, I.angvel, I.principalAngularInertia, I.translationsEnabledX, I.translationsEnabledY, I.rotationsEnabled, I.linearDamping, I.angularDamping, I.status, I.canSleep, I.sleeping, I.softCcdPrediction, I.ccdEnabled, I.dominanceGroup, I.additionalSolverIterations);
2711
2711
  C.free(), g.free(), Q.free(), B.free();
2712
2712
  const o = new PI(this.raw, A, i);
2713
2713
  return o.userData = I.userData, this.map.set(i, o), o;
@@ -2842,17 +2842,17 @@ class pA {
2842
2842
  return this.rawSet.jointType(this.handle);
2843
2843
  }
2844
2844
  anchor1() {
2845
- return F.fromRaw(this.rawSet.jointAnchor1(this.handle));
2845
+ return y.fromRaw(this.rawSet.jointAnchor1(this.handle));
2846
2846
  }
2847
2847
  anchor2() {
2848
- return F.fromRaw(this.rawSet.jointAnchor2(this.handle));
2848
+ return y.fromRaw(this.rawSet.jointAnchor2(this.handle));
2849
2849
  }
2850
2850
  setAnchor1(A) {
2851
- const I = F.intoRaw(A);
2851
+ const I = y.intoRaw(A);
2852
2852
  this.rawSet.jointSetAnchor1(this.handle, I), I.free();
2853
2853
  }
2854
2854
  setAnchor2(A) {
2855
- const I = F.intoRaw(A);
2855
+ const I = y.intoRaw(A);
2856
2856
  this.rawSet.jointSetAnchor2(this.handle, I), I.free();
2857
2857
  }
2858
2858
  setContactsEnabled(A) {
@@ -2928,10 +2928,10 @@ class OA {
2928
2928
  return g.anchor1 = A, g.anchor2 = I, g.axis = C, g.jointType = RA.Prismatic, g;
2929
2929
  }
2930
2930
  intoRaw() {
2931
- let A, I, C = F.intoRaw(this.anchor1), g = F.intoRaw(this.anchor2), Q = !1, B = 0, i = 0;
2931
+ let A, I, C = y.intoRaw(this.anchor1), g = y.intoRaw(this.anchor2), Q = !1, B = 0, i = 0;
2932
2932
  switch (this.jointType) {
2933
2933
  case RA.Fixed:
2934
- let o = AA.intoRaw(this.frame1), h = AA.intoRaw(this.frame2);
2934
+ let o = QA.intoRaw(this.frame1), h = QA.intoRaw(this.frame2);
2935
2935
  I = MA.fixed(C, o, g, h), o.free(), h.free();
2936
2936
  break;
2937
2937
  case RA.Spring:
@@ -2941,7 +2941,7 @@ class OA {
2941
2941
  I = MA.rope(this.length, C, g);
2942
2942
  break;
2943
2943
  case RA.Prismatic:
2944
- A = F.intoRaw(this.axis), this.limitsEnabled && (Q = !0, B = this.limits[0], i = this.limits[1]), I = MA.prismatic(C, g, A, Q, B, i), A.free();
2944
+ A = y.intoRaw(this.axis), this.limitsEnabled && (Q = !0, B = this.limits[0], i = this.limits[1]), I = MA.prismatic(C, g, A, Q, B, i), A.free();
2945
2945
  break;
2946
2946
  case RA.Revolute:
2947
2947
  I = MA.revolute(C, g);
@@ -3111,7 +3111,7 @@ class EI {
3111
3111
  }
3112
3112
  static fromRaw(A) {
3113
3113
  if (!A) return null;
3114
- const I = new EI(A.time_of_impact(), F.fromRaw(A.normal()), A.featureType(), A.featureId());
3114
+ const I = new EI(A.time_of_impact(), y.fromRaw(A.normal()), A.featureType(), A.featureId());
3115
3115
  return A.free(), I;
3116
3116
  }
3117
3117
  }
@@ -3121,7 +3121,7 @@ class QI {
3121
3121
  }
3122
3122
  static fromRaw(A, I) {
3123
3123
  if (!I) return null;
3124
- const C = new QI(A.get(I.colliderHandle()), I.time_of_impact(), F.fromRaw(I.normal()), I.featureType(), I.featureId());
3124
+ const C = new QI(A.get(I.colliderHandle()), I.time_of_impact(), y.fromRaw(I.normal()), I.featureType(), I.featureId());
3125
3125
  return I.free(), C;
3126
3126
  }
3127
3127
  }
@@ -3141,7 +3141,7 @@ class iI {
3141
3141
  }
3142
3142
  static fromRaw(A) {
3143
3143
  if (!A) return null;
3144
- const I = new iI(F.fromRaw(A.point()), A.isInside());
3144
+ const I = new iI(y.fromRaw(A.point()), A.isInside());
3145
3145
  return A.free(), I;
3146
3146
  }
3147
3147
  }
@@ -3151,7 +3151,7 @@ class BI {
3151
3151
  }
3152
3152
  static fromRaw(A, I) {
3153
3153
  if (!I) return null;
3154
- const C = new BI(A.get(I.colliderHandle()), F.fromRaw(I.point()), I.isInside(), I.featureType(), I.featureId());
3154
+ const C = new BI(A.get(I.colliderHandle()), y.fromRaw(I.point()), I.isInside(), I.featureType(), I.featureId());
3155
3155
  return I.free(), C;
3156
3156
  }
3157
3157
  }
@@ -3161,7 +3161,7 @@ class PA {
3161
3161
  }
3162
3162
  static fromRaw(A, I) {
3163
3163
  if (!I) return null;
3164
- const C = new PA(I.time_of_impact(), F.fromRaw(I.witness1()), F.fromRaw(I.witness2()), F.fromRaw(I.normal1()), F.fromRaw(I.normal2()));
3164
+ const C = new PA(I.time_of_impact(), y.fromRaw(I.witness1()), y.fromRaw(I.witness2()), y.fromRaw(I.normal1()), y.fromRaw(I.normal2()));
3165
3165
  return I.free(), C;
3166
3166
  }
3167
3167
  }
@@ -3171,7 +3171,7 @@ class DI extends PA {
3171
3171
  }
3172
3172
  static fromRaw(A, I) {
3173
3173
  if (!I) return null;
3174
- const C = new DI(A.get(I.colliderHandle()), I.time_of_impact(), F.fromRaw(I.witness1()), F.fromRaw(I.witness2()), F.fromRaw(I.normal1()), F.fromRaw(I.normal2()));
3174
+ const C = new DI(A.get(I.colliderHandle()), I.time_of_impact(), y.fromRaw(I.witness1()), y.fromRaw(I.witness2()), y.fromRaw(I.normal1()), y.fromRaw(I.normal2()));
3175
3175
  return I.free(), C;
3176
3176
  }
3177
3177
  }
@@ -3183,43 +3183,43 @@ class oC {
3183
3183
  this.raw && this.raw.free(), this.raw = void 0;
3184
3184
  }
3185
3185
  castRay(A, I, C, g, Q, B, i, o, h, s, G) {
3186
- let w = F.intoRaw(g.origin), a = F.intoRaw(g.dir), N = cI.fromRaw(C, this.raw.castRay(A.raw, I.raw, C.raw, w, a, Q, B, i, o, h, s, G));
3186
+ let w = y.intoRaw(g.origin), a = y.intoRaw(g.dir), N = cI.fromRaw(C, this.raw.castRay(A.raw, I.raw, C.raw, w, a, Q, B, i, o, h, s, G));
3187
3187
  return w.free(), a.free(), N;
3188
3188
  }
3189
3189
  castRayAndGetNormal(A, I, C, g, Q, B, i, o, h, s, G) {
3190
- let w = F.intoRaw(g.origin), a = F.intoRaw(g.dir), N = QI.fromRaw(C, this.raw.castRayAndGetNormal(A.raw, I.raw, C.raw, w, a, Q, B, i, o, h, s, G));
3190
+ let w = y.intoRaw(g.origin), a = y.intoRaw(g.dir), N = QI.fromRaw(C, this.raw.castRayAndGetNormal(A.raw, I.raw, C.raw, w, a, Q, B, i, o, h, s, G));
3191
3191
  return w.free(), a.free(), N;
3192
3192
  }
3193
3193
  intersectionsWithRay(A, I, C, g, Q, B, i, o, h, s, G, w) {
3194
- let a = F.intoRaw(g.origin), N = F.intoRaw(g.dir);
3194
+ let a = y.intoRaw(g.origin), N = y.intoRaw(g.dir);
3195
3195
  this.raw.intersectionsWithRay(A.raw, I.raw, C.raw, a, N, Q, B, (S) => i(QI.fromRaw(C, S)), o, h, s, G, w), a.free(), N.free();
3196
3196
  }
3197
3197
  intersectionWithShape(A, I, C, g, Q, B, i, o, h, s, G) {
3198
- let w = F.intoRaw(g), a = AA.intoRaw(Q), N = B.intoRaw(), S = this.raw.intersectionWithShape(A.raw, I.raw, C.raw, w, a, N, i, o, h, s, G);
3198
+ let w = y.intoRaw(g), a = QA.intoRaw(Q), N = B.intoRaw(), S = this.raw.intersectionWithShape(A.raw, I.raw, C.raw, w, a, N, i, o, h, s, G);
3199
3199
  return w.free(), a.free(), N.free(), S;
3200
3200
  }
3201
3201
  projectPoint(A, I, C, g, Q, B, i, o, h, s) {
3202
- let G = F.intoRaw(g), w = BI.fromRaw(C, this.raw.projectPoint(A.raw, I.raw, C.raw, G, Q, B, i, o, h, s));
3202
+ let G = y.intoRaw(g), w = BI.fromRaw(C, this.raw.projectPoint(A.raw, I.raw, C.raw, G, Q, B, i, o, h, s));
3203
3203
  return G.free(), w;
3204
3204
  }
3205
3205
  projectPointAndGetFeature(A, I, C, g, Q, B, i, o, h) {
3206
- let s = F.intoRaw(g), G = BI.fromRaw(C, this.raw.projectPointAndGetFeature(A.raw, I.raw, C.raw, s, Q, B, i, o, h));
3206
+ let s = y.intoRaw(g), G = BI.fromRaw(C, this.raw.projectPointAndGetFeature(A.raw, I.raw, C.raw, s, Q, B, i, o, h));
3207
3207
  return s.free(), G;
3208
3208
  }
3209
3209
  intersectionsWithPoint(A, I, C, g, Q, B, i, o, h, s) {
3210
- let G = F.intoRaw(g);
3210
+ let G = y.intoRaw(g);
3211
3211
  this.raw.intersectionsWithPoint(A.raw, I.raw, C.raw, G, Q, B, i, o, h, s), G.free();
3212
3212
  }
3213
3213
  castShape(A, I, C, g, Q, B, i, o, h, s, G, w, a, N, S) {
3214
- let k = F.intoRaw(g), y = AA.intoRaw(Q), U = F.intoRaw(B), c = i.intoRaw(), t = DI.fromRaw(C, this.raw.castShape(A.raw, I.raw, C.raw, k, y, U, c, o, h, s, G, w, a, N, S));
3215
- return k.free(), y.free(), U.free(), c.free(), t;
3214
+ let k = y.intoRaw(g), F = QA.intoRaw(Q), U = y.intoRaw(B), c = i.intoRaw(), Y = DI.fromRaw(C, this.raw.castShape(A.raw, I.raw, C.raw, k, F, U, c, o, h, s, G, w, a, N, S));
3215
+ return k.free(), F.free(), U.free(), c.free(), Y;
3216
3216
  }
3217
3217
  intersectionsWithShape(A, I, C, g, Q, B, i, o, h, s, G, w) {
3218
- let a = F.intoRaw(g), N = AA.intoRaw(Q), S = B.intoRaw();
3218
+ let a = y.intoRaw(g), N = QA.intoRaw(Q), S = B.intoRaw();
3219
3219
  this.raw.intersectionsWithShape(A.raw, I.raw, C.raw, a, N, S, i, o, h, s, G, w), a.free(), N.free(), S.free();
3220
3220
  }
3221
3221
  collidersWithAabbIntersectingAabb(A, I, C, g, Q, B) {
3222
- let i = F.intoRaw(g), o = F.intoRaw(Q);
3222
+ let i = y.intoRaw(g), o = y.intoRaw(Q);
3223
3223
  this.raw.collidersWithAabbIntersectingAabb(A.raw, I.raw, C.raw, i, o, B), i.free(), o.free();
3224
3224
  }
3225
3225
  }
@@ -3257,13 +3257,13 @@ class hC {
3257
3257
  this.raw && this.raw.free(), this.raw = void 0;
3258
3258
  }
3259
3259
  normal() {
3260
- return F.fromRaw(this.raw.normal());
3260
+ return y.fromRaw(this.raw.normal());
3261
3261
  }
3262
3262
  localNormal1() {
3263
- return F.fromRaw(this.raw.local_n1());
3263
+ return y.fromRaw(this.raw.local_n1());
3264
3264
  }
3265
3265
  localNormal2() {
3266
- return F.fromRaw(this.raw.local_n2());
3266
+ return y.fromRaw(this.raw.local_n2());
3267
3267
  }
3268
3268
  subshape1() {
3269
3269
  return this.raw.subshape1();
@@ -3275,10 +3275,10 @@ class hC {
3275
3275
  return this.raw.num_contacts();
3276
3276
  }
3277
3277
  localContactPoint1(A) {
3278
- return F.fromRaw(this.raw.contact_local_p1(A));
3278
+ return y.fromRaw(this.raw.contact_local_p1(A));
3279
3279
  }
3280
3280
  localContactPoint2(A) {
3281
- return F.fromRaw(this.raw.contact_local_p2(A));
3281
+ return y.fromRaw(this.raw.contact_local_p2(A));
3282
3282
  }
3283
3283
  contactDist(A) {
3284
3284
  return this.raw.contact_dist(A);
@@ -3299,7 +3299,7 @@ class hC {
3299
3299
  return this.raw.num_solver_contacts();
3300
3300
  }
3301
3301
  solverContactPoint(A) {
3302
- return F.fromRaw(this.raw.solver_contact_point(A));
3302
+ return y.fromRaw(this.raw.solver_contact_point(A));
3303
3303
  }
3304
3304
  solverContactDist(A) {
3305
3305
  return this.raw.solver_contact_dist(A);
@@ -3311,7 +3311,7 @@ class hC {
3311
3311
  return this.raw.solver_contact_restitution(A);
3312
3312
  }
3313
3313
  solverContactTangentVelocity(A) {
3314
- return F.fromRaw(this.raw.solver_contact_tangent_velocity(A));
3314
+ return y.fromRaw(this.raw.solver_contact_tangent_velocity(A));
3315
3315
  }
3316
3316
  }
3317
3317
  class uA {
@@ -3320,7 +3320,7 @@ class uA {
3320
3320
  }
3321
3321
  static fromRaw(A) {
3322
3322
  if (!A) return null;
3323
- const I = new uA(A.distance(), F.fromRaw(A.point1()), F.fromRaw(A.point2()), F.fromRaw(A.normal1()), F.fromRaw(A.normal2()));
3323
+ const I = new uA(A.distance(), y.fromRaw(A.point1()), y.fromRaw(A.point2()), y.fromRaw(A.normal1()), y.fromRaw(A.normal2()));
3324
3324
  return A.free(), I;
3325
3325
  }
3326
3326
  }
@@ -3338,15 +3338,15 @@ class yA {
3338
3338
  case FA.Capsule:
3339
3339
  return o = A.coHalfHeight(I), h = A.coRadius(I), new og(o, h);
3340
3340
  case FA.Segment:
3341
- return B = A.coVertices(I), new wg(F.new(B[0], B[1]), F.new(B[2], B[3]));
3341
+ return B = A.coVertices(I), new wg(y.new(B[0], B[1]), y.new(B[2], B[3]));
3342
3342
  case FA.Polyline:
3343
3343
  return B = A.coVertices(I), i = A.coIndices(I), new Gg(B, i);
3344
3344
  case FA.Triangle:
3345
- return B = A.coVertices(I), new hg(F.new(B[0], B[1]), F.new(B[2], B[3]), F.new(B[4], B[5]));
3345
+ return B = A.coVertices(I), new hg(y.new(B[0], B[1]), y.new(B[2], B[3]), y.new(B[4], B[5]));
3346
3346
  case FA.RoundTriangle:
3347
- return B = A.coVertices(I), Q = A.coRoundRadius(I), new sg(F.new(B[0], B[1]), F.new(B[2], B[3]), F.new(B[4], B[5]), Q);
3347
+ return B = A.coVertices(I), Q = A.coRoundRadius(I), new sg(y.new(B[0], B[1]), y.new(B[2], B[3]), y.new(B[4], B[5]), Q);
3348
3348
  case FA.HalfSpace:
3349
- return s = F.fromRaw(A.coHalfspaceNormal(I)), new Eg(s);
3349
+ return s = y.fromRaw(A.coHalfspaceNormal(I)), new Eg(s);
3350
3350
  case FA.Voxels:
3351
3351
  const G = A.coVoxelData(I), w = A.coVoxelSize(I);
3352
3352
  return new ag(G, w);
@@ -3366,35 +3366,35 @@ class yA {
3366
3366
  }
3367
3367
  }
3368
3368
  castShape(A, I, C, g, Q, B, i, o, h, s) {
3369
- let G = F.intoRaw(A), w = AA.intoRaw(I), a = F.intoRaw(C), N = F.intoRaw(Q), S = AA.intoRaw(B), k = F.intoRaw(i), y = this.intoRaw(), U = g.intoRaw(), c = PA.fromRaw(null, y.castShape(G, w, a, U, N, S, k, o, h, s));
3370
- return G.free(), w.free(), a.free(), N.free(), S.free(), k.free(), y.free(), U.free(), c;
3369
+ let G = y.intoRaw(A), w = QA.intoRaw(I), a = y.intoRaw(C), N = y.intoRaw(Q), S = QA.intoRaw(B), k = y.intoRaw(i), F = this.intoRaw(), U = g.intoRaw(), c = PA.fromRaw(null, F.castShape(G, w, a, U, N, S, k, o, h, s));
3370
+ return G.free(), w.free(), a.free(), N.free(), S.free(), k.free(), F.free(), U.free(), c;
3371
3371
  }
3372
3372
  intersectsShape(A, I, C, g, Q) {
3373
- let B = F.intoRaw(A), i = AA.intoRaw(I), o = F.intoRaw(g), h = AA.intoRaw(Q), s = this.intoRaw(), G = C.intoRaw(), w = s.intersectsShape(B, i, G, o, h);
3373
+ let B = y.intoRaw(A), i = QA.intoRaw(I), o = y.intoRaw(g), h = QA.intoRaw(Q), s = this.intoRaw(), G = C.intoRaw(), w = s.intersectsShape(B, i, G, o, h);
3374
3374
  return B.free(), i.free(), o.free(), h.free(), s.free(), G.free(), w;
3375
3375
  }
3376
3376
  contactShape(A, I, C, g, Q, B) {
3377
- let i = F.intoRaw(A), o = AA.intoRaw(I), h = F.intoRaw(g), s = AA.intoRaw(Q), G = this.intoRaw(), w = C.intoRaw(), a = uA.fromRaw(G.contactShape(i, o, w, h, s, B));
3377
+ let i = y.intoRaw(A), o = QA.intoRaw(I), h = y.intoRaw(g), s = QA.intoRaw(Q), G = this.intoRaw(), w = C.intoRaw(), a = uA.fromRaw(G.contactShape(i, o, w, h, s, B));
3378
3378
  return i.free(), o.free(), h.free(), s.free(), G.free(), w.free(), a;
3379
3379
  }
3380
3380
  containsPoint(A, I, C) {
3381
- let g = F.intoRaw(A), Q = AA.intoRaw(I), B = F.intoRaw(C), i = this.intoRaw(), o = i.containsPoint(g, Q, B);
3381
+ let g = y.intoRaw(A), Q = QA.intoRaw(I), B = y.intoRaw(C), i = this.intoRaw(), o = i.containsPoint(g, Q, B);
3382
3382
  return g.free(), Q.free(), B.free(), i.free(), o;
3383
3383
  }
3384
3384
  projectPoint(A, I, C, g) {
3385
- let Q = F.intoRaw(A), B = AA.intoRaw(I), i = F.intoRaw(C), o = this.intoRaw(), h = iI.fromRaw(o.projectPoint(Q, B, i, g));
3385
+ let Q = y.intoRaw(A), B = QA.intoRaw(I), i = y.intoRaw(C), o = this.intoRaw(), h = iI.fromRaw(o.projectPoint(Q, B, i, g));
3386
3386
  return Q.free(), B.free(), i.free(), o.free(), h;
3387
3387
  }
3388
3388
  intersectsRay(A, I, C, g) {
3389
- let Q = F.intoRaw(I), B = AA.intoRaw(C), i = F.intoRaw(A.origin), o = F.intoRaw(A.dir), h = this.intoRaw(), s = h.intersectsRay(Q, B, i, o, g);
3389
+ let Q = y.intoRaw(I), B = QA.intoRaw(C), i = y.intoRaw(A.origin), o = y.intoRaw(A.dir), h = this.intoRaw(), s = h.intersectsRay(Q, B, i, o, g);
3390
3390
  return Q.free(), B.free(), i.free(), o.free(), h.free(), s;
3391
3391
  }
3392
3392
  castRay(A, I, C, g, Q) {
3393
- let B = F.intoRaw(I), i = AA.intoRaw(C), o = F.intoRaw(A.origin), h = F.intoRaw(A.dir), s = this.intoRaw(), G = s.castRay(B, i, o, h, g, Q);
3393
+ let B = y.intoRaw(I), i = QA.intoRaw(C), o = y.intoRaw(A.origin), h = y.intoRaw(A.dir), s = this.intoRaw(), G = s.castRay(B, i, o, h, g, Q);
3394
3394
  return B.free(), i.free(), o.free(), h.free(), s.free(), G;
3395
3395
  }
3396
3396
  castRayAndGetNormal(A, I, C, g, Q) {
3397
- let B = F.intoRaw(I), i = AA.intoRaw(C), o = F.intoRaw(A.origin), h = F.intoRaw(A.dir), s = this.intoRaw(), G = EI.fromRaw(s.castRayAndGetNormal(B, i, o, h, g, Q));
3397
+ let B = y.intoRaw(I), i = QA.intoRaw(C), o = y.intoRaw(A.origin), h = y.intoRaw(A.dir), s = this.intoRaw(), G = EI.fromRaw(s.castRayAndGetNormal(B, i, o, h, g, Q));
3398
3398
  return B.free(), i.free(), o.free(), h.free(), s.free(), G;
3399
3399
  }
3400
3400
  }
@@ -3408,7 +3408,7 @@ class Bg extends yA {
3408
3408
  super(), this.type = kA.Ball, this.radius = A;
3409
3409
  }
3410
3410
  intoRaw() {
3411
- return H.ball(this.radius);
3411
+ return d.ball(this.radius);
3412
3412
  }
3413
3413
  }
3414
3414
  class Eg extends yA {
@@ -3416,24 +3416,24 @@ class Eg extends yA {
3416
3416
  super(), this.type = kA.HalfSpace, this.normal = A;
3417
3417
  }
3418
3418
  intoRaw() {
3419
- let A = F.intoRaw(this.normal), I = H.halfspace(A);
3419
+ let A = y.intoRaw(this.normal), I = d.halfspace(A);
3420
3420
  return A.free(), I;
3421
3421
  }
3422
3422
  }
3423
3423
  class ig extends yA {
3424
3424
  constructor(A, I) {
3425
- super(), this.type = kA.Cuboid, this.halfExtents = F.new(A, I);
3425
+ super(), this.type = kA.Cuboid, this.halfExtents = y.new(A, I);
3426
3426
  }
3427
3427
  intoRaw() {
3428
- return H.cuboid(this.halfExtents.x, this.halfExtents.y);
3428
+ return d.cuboid(this.halfExtents.x, this.halfExtents.y);
3429
3429
  }
3430
3430
  }
3431
3431
  class Dg extends yA {
3432
3432
  constructor(A, I, C) {
3433
- super(), this.type = kA.RoundCuboid, this.halfExtents = F.new(A, I), this.borderRadius = C;
3433
+ super(), this.type = kA.RoundCuboid, this.halfExtents = y.new(A, I), this.borderRadius = C;
3434
3434
  }
3435
3435
  intoRaw() {
3436
- return H.roundCuboid(this.halfExtents.x, this.halfExtents.y, this.borderRadius);
3436
+ return d.roundCuboid(this.halfExtents.x, this.halfExtents.y, this.borderRadius);
3437
3437
  }
3438
3438
  }
3439
3439
  class og extends yA {
@@ -3441,7 +3441,7 @@ class og extends yA {
3441
3441
  super(), this.type = kA.Capsule, this.halfHeight = A, this.radius = I;
3442
3442
  }
3443
3443
  intoRaw() {
3444
- return H.capsule(this.halfHeight, this.radius);
3444
+ return d.capsule(this.halfHeight, this.radius);
3445
3445
  }
3446
3446
  }
3447
3447
  class wg extends yA {
@@ -3449,7 +3449,7 @@ class wg extends yA {
3449
3449
  super(), this.type = kA.Segment, this.a = A, this.b = I;
3450
3450
  }
3451
3451
  intoRaw() {
3452
- let A = F.intoRaw(this.a), I = F.intoRaw(this.b), C = H.segment(A, I);
3452
+ let A = y.intoRaw(this.a), I = y.intoRaw(this.b), C = d.segment(A, I);
3453
3453
  return A.free(), I.free(), C;
3454
3454
  }
3455
3455
  }
@@ -3458,7 +3458,7 @@ class hg extends yA {
3458
3458
  super(), this.type = kA.Triangle, this.a = A, this.b = I, this.c = C;
3459
3459
  }
3460
3460
  intoRaw() {
3461
- let A = F.intoRaw(this.a), I = F.intoRaw(this.b), C = F.intoRaw(this.c), g = H.triangle(A, I, C);
3461
+ let A = y.intoRaw(this.a), I = y.intoRaw(this.b), C = y.intoRaw(this.c), g = d.triangle(A, I, C);
3462
3462
  return A.free(), I.free(), C.free(), g;
3463
3463
  }
3464
3464
  }
@@ -3467,7 +3467,7 @@ class sg extends yA {
3467
3467
  super(), this.type = kA.RoundTriangle, this.a = A, this.b = I, this.c = C, this.borderRadius = g;
3468
3468
  }
3469
3469
  intoRaw() {
3470
- let A = F.intoRaw(this.a), I = F.intoRaw(this.b), C = F.intoRaw(this.c), g = H.roundTriangle(A, I, C, this.borderRadius);
3470
+ let A = y.intoRaw(this.a), I = y.intoRaw(this.b), C = y.intoRaw(this.c), g = d.roundTriangle(A, I, C, this.borderRadius);
3471
3471
  return A.free(), I.free(), C.free(), g;
3472
3472
  }
3473
3473
  }
@@ -3476,7 +3476,7 @@ class Gg extends yA {
3476
3476
  super(), this.type = kA.Polyline, this.vertices = A, this.indices = I ?? new Uint32Array(0);
3477
3477
  }
3478
3478
  intoRaw() {
3479
- return H.polyline(this.vertices, this.indices);
3479
+ return d.polyline(this.vertices, this.indices);
3480
3480
  }
3481
3481
  }
3482
3482
  class ag extends yA {
@@ -3484,8 +3484,8 @@ class ag extends yA {
3484
3484
  super(), this.type = kA.Voxels, this.data = A, this.voxelSize = I;
3485
3485
  }
3486
3486
  intoRaw() {
3487
- let A, I = F.intoRaw(this.voxelSize);
3488
- return A = this.data instanceof Int32Array ? H.voxels(I, this.data) : H.voxelsFromPoints(I, this.data), I.free(), A;
3487
+ let A, I = y.intoRaw(this.voxelSize);
3488
+ return A = this.data instanceof Int32Array ? d.voxels(I, this.data) : d.voxelsFromPoints(I, this.data), I.free(), A;
3489
3489
  }
3490
3490
  }
3491
3491
  class Kg extends yA {
@@ -3493,7 +3493,7 @@ class Kg extends yA {
3493
3493
  super(), this.type = kA.TriMesh, this.vertices = A, this.indices = I, this.flags = C;
3494
3494
  }
3495
3495
  intoRaw() {
3496
- return H.trimesh(this.vertices, this.indices, this.flags);
3496
+ return d.trimesh(this.vertices, this.indices, this.flags);
3497
3497
  }
3498
3498
  }
3499
3499
  class NI extends yA {
@@ -3501,7 +3501,7 @@ class NI extends yA {
3501
3501
  super(), this.type = kA.ConvexPolygon, this.vertices = A, this.skipConvexHullComputation = !!I;
3502
3502
  }
3503
3503
  intoRaw() {
3504
- return this.skipConvexHullComputation ? H.convexPolyline(this.vertices) : H.convexHull(this.vertices);
3504
+ return this.skipConvexHullComputation ? d.convexPolyline(this.vertices) : d.convexHull(this.vertices);
3505
3505
  }
3506
3506
  }
3507
3507
  class kI extends yA {
@@ -3509,7 +3509,7 @@ class kI extends yA {
3509
3509
  super(), this.type = kA.RoundConvexPolygon, this.vertices = A, this.borderRadius = I, this.skipConvexHullComputation = !!C;
3510
3510
  }
3511
3511
  intoRaw() {
3512
- return this.skipConvexHullComputation ? H.roundConvexPolyline(this.vertices, this.borderRadius) : H.roundConvexHull(this.vertices, this.borderRadius);
3512
+ return this.skipConvexHullComputation ? d.roundConvexPolyline(this.vertices, this.borderRadius) : d.roundConvexHull(this.vertices, this.borderRadius);
3513
3513
  }
3514
3514
  }
3515
3515
  class Sg extends yA {
@@ -3517,7 +3517,7 @@ class Sg extends yA {
3517
3517
  super(), this.type = kA.HeightField, this.heights = A, this.scale = I;
3518
3518
  }
3519
3519
  intoRaw() {
3520
- let A = F.intoRaw(this.scale), I = H.heightfield(this.heights, A);
3520
+ let A = y.intoRaw(this.scale), I = d.heightfield(this.heights, A);
3521
3521
  return A.free(), I;
3522
3522
  }
3523
3523
  }
@@ -3529,7 +3529,7 @@ class sC {
3529
3529
  this.raw && this.raw.free(), this.raw = void 0;
3530
3530
  }
3531
3531
  step(A, I, C, g, Q, B, i, o, h, s, G, w) {
3532
- let a = F.intoRaw(A);
3532
+ let a = y.intoRaw(A);
3533
3533
  G ? this.raw.stepWithEvents(a, I.raw, C.raw, g.raw, Q.raw, B.raw, i.raw, o.raw, h.raw, s.raw, G.raw, w, w ? w.filterContactPair : null, w ? w.filterIntersectionPair : null) : this.raw.step(a, I.raw, C.raw, g.raw, Q.raw, B.raw, i.raw, o.raw, h.raw, s.raw), a.free();
3534
3534
  }
3535
3535
  }
@@ -3541,7 +3541,7 @@ class VI {
3541
3541
  this.raw && this.raw.free(), this.raw = void 0;
3542
3542
  }
3543
3543
  serializeAll(A, I, C, g, Q, B, i, o, h) {
3544
- let s = F.intoRaw(A);
3544
+ let s = y.intoRaw(A);
3545
3545
  const G = this.raw.serializeAll(s, I.raw, C.raw, g.raw, Q.raw, B.raw, i.raw, o.raw, h.raw);
3546
3546
  return s.free(), G;
3547
3547
  }
@@ -3578,7 +3578,7 @@ class SC {
3578
3578
  return this.raw.up();
3579
3579
  }
3580
3580
  setUp(A) {
3581
- let I = F.intoRaw(A);
3581
+ let I = y.intoRaw(A);
3582
3582
  return this.raw.setUp(I);
3583
3583
  }
3584
3584
  applyImpulsesToDynamicBodies() {
@@ -3654,11 +3654,11 @@ class SC {
3654
3654
  return this.raw.snapToGroundEnabled();
3655
3655
  }
3656
3656
  computeColliderMovement(A, I, C, g, Q) {
3657
- let B = F.intoRaw(I);
3657
+ let B = y.intoRaw(I);
3658
3658
  this.raw.computeColliderMovement(this.params.dt, this.broadPhase.raw, this.narrowPhase.raw, this.bodies.raw, this.colliders.raw, A.handle, B, this._applyImpulsesToDynamicBodies, this._characterMass, C, g, this.colliders.castClosure(Q)), B.free();
3659
3659
  }
3660
3660
  computedMovement() {
3661
- return F.fromRaw(this.raw.computedMovement());
3661
+ return y.fromRaw(this.raw.computedMovement());
3662
3662
  }
3663
3663
  computedGrounded() {
3664
3664
  return this.raw.computedGrounded();
@@ -3669,7 +3669,7 @@ class SC {
3669
3669
  computedCollision(A, I) {
3670
3670
  if (this.raw.computedCollision(A, this.rawCharacterCollision)) {
3671
3671
  let C = this.rawCharacterCollision;
3672
- return (I = I ?? new KC()).translationDeltaApplied = F.fromRaw(C.translationDeltaApplied()), I.translationDeltaRemaining = F.fromRaw(C.translationDeltaRemaining()), I.toi = C.toi(), I.witness1 = F.fromRaw(C.worldWitness1()), I.witness2 = F.fromRaw(C.worldWitness2()), I.normal1 = F.fromRaw(C.worldNormal1()), I.normal2 = F.fromRaw(C.worldNormal2()), I.collider = this.colliders.get(C.handle()), I;
3672
+ return (I = I ?? new KC()).translationDeltaApplied = y.fromRaw(C.translationDeltaApplied()), I.translationDeltaRemaining = y.fromRaw(C.translationDeltaRemaining()), I.toi = C.toi(), I.witness1 = y.fromRaw(C.worldWitness1()), I.witness2 = y.fromRaw(C.worldWitness2()), I.normal1 = y.fromRaw(C.worldNormal1()), I.normal2 = y.fromRaw(C.worldNormal2()), I.collider = this.colliders.get(C.handle()), I;
3673
3673
  }
3674
3674
  return null;
3675
3675
  }
@@ -3700,15 +3700,15 @@ class NC {
3700
3700
  this.raw.reset_integrals();
3701
3701
  }
3702
3702
  applyLinearCorrection(A, I, C) {
3703
- let g = F.intoRaw(I), Q = F.intoRaw(C);
3703
+ let g = y.intoRaw(I), Q = y.intoRaw(C);
3704
3704
  this.raw.apply_linear_correction(this.params.dt, this.bodies.raw, A.handle, g, Q), g.free(), Q.free();
3705
3705
  }
3706
3706
  applyAngularCorrection(A, I, C) {
3707
3707
  this.raw.apply_angular_correction(this.params.dt, this.bodies.raw, A.handle, I, C);
3708
3708
  }
3709
3709
  linearCorrection(A, I, C) {
3710
- let g = F.intoRaw(I), Q = F.intoRaw(C), B = this.raw.linear_correction(this.params.dt, this.bodies.raw, A.handle, g, Q);
3711
- return g.free(), Q.free(), F.fromRaw(B);
3710
+ let g = y.intoRaw(I), Q = y.intoRaw(C), B = this.raw.linear_correction(this.params.dt, this.bodies.raw, A.handle, g, Q);
3711
+ return g.free(), Q.free(), y.fromRaw(B);
3712
3712
  }
3713
3713
  angularCorrection(A, I, C) {
3714
3714
  return this.raw.angular_correction(this.params.dt, this.bodies.raw, A.handle, I, C);
@@ -3722,7 +3722,7 @@ class YI {
3722
3722
  this.integrationParameters.free(), this.islands.free(), this.broadPhase.free(), this.narrowPhase.free(), this.bodies.free(), this.colliders.free(), this.impulseJoints.free(), this.multibodyJoints.free(), this.ccdSolver.free(), this.physicsPipeline.free(), this.serializationPipeline.free(), this.debugRenderPipeline.free(), this.characterControllers.forEach((A) => A.free()), this.pidControllers.forEach((A) => A.free()), this.integrationParameters = void 0, this.islands = void 0, this.broadPhase = void 0, this.narrowPhase = void 0, this.bodies = void 0, this.colliders = void 0, this.ccdSolver = void 0, this.impulseJoints = void 0, this.multibodyJoints = void 0, this.physicsPipeline = void 0, this.serializationPipeline = void 0, this.debugRenderPipeline = void 0, this.characterControllers = void 0, this.pidControllers = void 0;
3723
3723
  }
3724
3724
  static fromRaw(A) {
3725
- return A ? new YI(F.fromRaw(A.takeGravity()), A.takeIntegrationParameters(), A.takeIslandManager(), A.takeBroadPhase(), A.takeNarrowPhase(), A.takeBodies(), A.takeColliders(), A.takeImpulseJoints(), A.takeMultibodyJoints()) : null;
3725
+ return A ? new YI(y.fromRaw(A.takeGravity()), A.takeIntegrationParameters(), A.takeIslandManager(), A.takeBroadPhase(), A.takeNarrowPhase(), A.takeBodies(), A.takeColliders(), A.takeImpulseJoints(), A.takeMultibodyJoints()) : null;
3726
3726
  }
3727
3727
  takeSnapshot() {
3728
3728
  return this.serializationPipeline.serializeAll(this.gravity, this.integrationParameters, this.islands, this.broadPhase, this.narrowPhase, this.bodies, this.colliders, this.impulseJoints, this.multibodyJoints);
@@ -3941,13 +3941,13 @@ class kC {
3941
3941
  return this.raw.collider2();
3942
3942
  }
3943
3943
  totalForce() {
3944
- return F.fromRaw(this.raw.total_force());
3944
+ return y.fromRaw(this.raw.total_force());
3945
3945
  }
3946
3946
  totalForceMagnitude() {
3947
3947
  return this.raw.total_force_magnitude();
3948
3948
  }
3949
3949
  maxForceDirection() {
3950
- return F.fromRaw(this.raw.max_force_direction());
3950
+ return y.fromRaw(this.raw.max_force_direction());
3951
3951
  }
3952
3952
  maxForceMagnitude() {
3953
3953
  return this.raw.max_force_magnitude();
@@ -4002,16 +4002,16 @@ class zI {
4002
4002
  return this.colliderSet.raw.contains(this.handle);
4003
4003
  }
4004
4004
  translation() {
4005
- return F.fromRaw(this.colliderSet.raw.coTranslation(this.handle));
4005
+ return y.fromRaw(this.colliderSet.raw.coTranslation(this.handle));
4006
4006
  }
4007
4007
  translationWrtParent() {
4008
- return F.fromRaw(this.colliderSet.raw.coTranslationWrtParent(this.handle));
4008
+ return y.fromRaw(this.colliderSet.raw.coTranslationWrtParent(this.handle));
4009
4009
  }
4010
4010
  rotation() {
4011
- return AA.fromRaw(this.colliderSet.raw.coRotation(this.handle));
4011
+ return QA.fromRaw(this.colliderSet.raw.coRotation(this.handle));
4012
4012
  }
4013
4013
  rotationWrtParent() {
4014
- return AA.fromRaw(this.colliderSet.raw.coRotationWrtParent(this.handle));
4014
+ return QA.fromRaw(this.colliderSet.raw.coRotationWrtParent(this.handle));
4015
4015
  }
4016
4016
  isSensor() {
4017
4017
  return this.colliderSet.raw.coIsSensor(this.handle);
@@ -4090,7 +4090,7 @@ class zI {
4090
4090
  this.colliderSet.raw.coSetMass(this.handle, A);
4091
4091
  }
4092
4092
  setMassProperties(A, I, C) {
4093
- let g = F.intoRaw(I);
4093
+ let g = y.intoRaw(I);
4094
4094
  this.colliderSet.raw.coSetMassProperties(this.handle, A, g, C), g.free();
4095
4095
  }
4096
4096
  setTranslation(A) {
@@ -4109,10 +4109,10 @@ class zI {
4109
4109
  return this.colliderSet.raw.coShapeType(this.handle);
4110
4110
  }
4111
4111
  halfExtents() {
4112
- return F.fromRaw(this.colliderSet.raw.coHalfExtents(this.handle));
4112
+ return y.fromRaw(this.colliderSet.raw.coHalfExtents(this.handle));
4113
4113
  }
4114
4114
  setHalfExtents(A) {
4115
- const I = F.intoRaw(A);
4115
+ const I = y.intoRaw(A);
4116
4116
  this.colliderSet.raw.coSetHalfExtents(this.handle, I);
4117
4117
  }
4118
4118
  radius() {
@@ -4153,7 +4153,7 @@ class zI {
4153
4153
  }
4154
4154
  heightfieldScale() {
4155
4155
  let A = this.colliderSet.raw.coHeightfieldScale(this.handle);
4156
- return F.fromRaw(A);
4156
+ return y.fromRaw(A);
4157
4157
  }
4158
4158
  parent() {
4159
4159
  return this._parent;
@@ -4180,42 +4180,42 @@ class zI {
4180
4180
  return this.colliderSet.raw.coSolverGroups(this.handle);
4181
4181
  }
4182
4182
  containsPoint(A) {
4183
- let I = F.intoRaw(A), C = this.colliderSet.raw.coContainsPoint(this.handle, I);
4183
+ let I = y.intoRaw(A), C = this.colliderSet.raw.coContainsPoint(this.handle, I);
4184
4184
  return I.free(), C;
4185
4185
  }
4186
4186
  projectPoint(A, I) {
4187
- let C = F.intoRaw(A), g = iI.fromRaw(this.colliderSet.raw.coProjectPoint(this.handle, C, I));
4187
+ let C = y.intoRaw(A), g = iI.fromRaw(this.colliderSet.raw.coProjectPoint(this.handle, C, I));
4188
4188
  return C.free(), g;
4189
4189
  }
4190
4190
  intersectsRay(A, I) {
4191
- let C = F.intoRaw(A.origin), g = F.intoRaw(A.dir), Q = this.colliderSet.raw.coIntersectsRay(this.handle, C, g, I);
4191
+ let C = y.intoRaw(A.origin), g = y.intoRaw(A.dir), Q = this.colliderSet.raw.coIntersectsRay(this.handle, C, g, I);
4192
4192
  return C.free(), g.free(), Q;
4193
4193
  }
4194
4194
  castShape(A, I, C, g, Q, B, i, o) {
4195
- let h = F.intoRaw(A), s = F.intoRaw(C), G = AA.intoRaw(g), w = F.intoRaw(Q), a = I.intoRaw(), N = PA.fromRaw(this.colliderSet, this.colliderSet.raw.coCastShape(this.handle, h, a, s, G, w, B, i, o));
4195
+ let h = y.intoRaw(A), s = y.intoRaw(C), G = QA.intoRaw(g), w = y.intoRaw(Q), a = I.intoRaw(), N = PA.fromRaw(this.colliderSet, this.colliderSet.raw.coCastShape(this.handle, h, a, s, G, w, B, i, o));
4196
4196
  return h.free(), s.free(), G.free(), w.free(), a.free(), N;
4197
4197
  }
4198
4198
  castCollider(A, I, C, g, Q, B) {
4199
- let i = F.intoRaw(A), o = F.intoRaw(C), h = DI.fromRaw(this.colliderSet, this.colliderSet.raw.coCastCollider(this.handle, i, I.handle, o, g, Q, B));
4199
+ let i = y.intoRaw(A), o = y.intoRaw(C), h = DI.fromRaw(this.colliderSet, this.colliderSet.raw.coCastCollider(this.handle, i, I.handle, o, g, Q, B));
4200
4200
  return i.free(), o.free(), h;
4201
4201
  }
4202
4202
  intersectsShape(A, I, C) {
4203
- let g = F.intoRaw(I), Q = AA.intoRaw(C), B = A.intoRaw(), i = this.colliderSet.raw.coIntersectsShape(this.handle, B, g, Q);
4203
+ let g = y.intoRaw(I), Q = QA.intoRaw(C), B = A.intoRaw(), i = this.colliderSet.raw.coIntersectsShape(this.handle, B, g, Q);
4204
4204
  return g.free(), Q.free(), B.free(), i;
4205
4205
  }
4206
4206
  contactShape(A, I, C, g) {
4207
- let Q = F.intoRaw(I), B = AA.intoRaw(C), i = A.intoRaw(), o = uA.fromRaw(this.colliderSet.raw.coContactShape(this.handle, i, Q, B, g));
4207
+ let Q = y.intoRaw(I), B = QA.intoRaw(C), i = A.intoRaw(), o = uA.fromRaw(this.colliderSet.raw.coContactShape(this.handle, i, Q, B, g));
4208
4208
  return Q.free(), B.free(), i.free(), o;
4209
4209
  }
4210
4210
  contactCollider(A, I) {
4211
4211
  return uA.fromRaw(this.colliderSet.raw.coContactCollider(this.handle, A.handle, I));
4212
4212
  }
4213
4213
  castRay(A, I, C) {
4214
- let g = F.intoRaw(A.origin), Q = F.intoRaw(A.dir), B = this.colliderSet.raw.coCastRay(this.handle, g, Q, I, C);
4214
+ let g = y.intoRaw(A.origin), Q = y.intoRaw(A.dir), B = this.colliderSet.raw.coCastRay(this.handle, g, Q, I, C);
4215
4215
  return g.free(), Q.free(), B;
4216
4216
  }
4217
4217
  castRayAndGetNormal(A, I, C) {
4218
- let g = F.intoRaw(A.origin), Q = F.intoRaw(A.dir), B = EI.fromRaw(this.colliderSet.raw.coCastRayAndGetNormal(this.handle, g, Q, I, C));
4218
+ let g = y.intoRaw(A.origin), Q = y.intoRaw(A.dir), B = EI.fromRaw(this.colliderSet.raw.coCastRayAndGetNormal(this.handle, g, Q, I, C));
4219
4219
  return g.free(), Q.free(), B;
4220
4220
  }
4221
4221
  }
@@ -4224,7 +4224,7 @@ class zI {
4224
4224
  })(WA || (WA = {}));
4225
4225
  class KA {
4226
4226
  constructor(A) {
4227
- this.enabled = !0, this.shape = A, this.massPropsMode = WA.Density, this.density = 1, this.friction = 0.5, this.restitution = 0, this.rotation = AA.identity(), this.translation = F.zeros(), this.isSensor = !1, this.collisionGroups = 4294967295, this.solverGroups = 4294967295, this.frictionCombineRule = CI.Average, this.restitutionCombineRule = CI.Average, this.activeCollisionTypes = SI.DEFAULT, this.activeEvents = aI.NONE, this.activeHooks = KI.NONE, this.mass = 0, this.centerOfMass = F.zeros(), this.contactForceEventThreshold = 0, this.contactSkin = 0, this.principalAngularInertia = 0, this.rotationsEnabled = !0;
4227
+ this.enabled = !0, this.shape = A, this.massPropsMode = WA.Density, this.density = 1, this.friction = 0.5, this.restitution = 0, this.rotation = QA.identity(), this.translation = y.zeros(), this.isSensor = !1, this.collisionGroups = 4294967295, this.solverGroups = 4294967295, this.frictionCombineRule = CI.Average, this.restitutionCombineRule = CI.Average, this.activeCollisionTypes = SI.DEFAULT, this.activeEvents = aI.NONE, this.activeHooks = KI.NONE, this.mass = 0, this.centerOfMass = y.zeros(), this.contactForceEventThreshold = 0, this.contactSkin = 0, this.principalAngularInertia = 0, this.rotationsEnabled = !0;
4228
4228
  }
4229
4229
  static ball(A) {
4230
4230
  const I = new Bg(A);
@@ -4313,7 +4313,7 @@ class KA {
4313
4313
  return this.massPropsMode = WA.Mass, this.mass = A, this;
4314
4314
  }
4315
4315
  setMassProperties(A, I, C) {
4316
- return this.massPropsMode = WA.MassProps, this.mass = A, F.copy(this.centerOfMass, I), this.principalAngularInertia = C, this;
4316
+ return this.massPropsMode = WA.MassProps, this.mass = A, y.copy(this.centerOfMass, I), this.principalAngularInertia = C, this;
4317
4317
  }
4318
4318
  setRestitution(A) {
4319
4319
  return this.restitution = A, this;
@@ -4364,7 +4364,7 @@ class yC {
4364
4364
  createCollider(A, I, C) {
4365
4365
  let g = C != null && C != null;
4366
4366
  if (g && isNaN(C)) throw Error("Cannot create a collider with a parent rigid-body handle that is not a number.");
4367
- let Q = I.shape.intoRaw(), B = F.intoRaw(I.translation), i = AA.intoRaw(I.rotation), o = F.intoRaw(I.centerOfMass), h = this.raw.createCollider(I.enabled, Q, B, i, I.massPropsMode, I.mass, o, I.principalAngularInertia, I.density, I.friction, I.restitution, I.frictionCombineRule, I.restitutionCombineRule, I.isSensor, I.collisionGroups, I.solverGroups, I.activeCollisionTypes, I.activeHooks, I.activeEvents, I.contactForceEventThreshold, I.contactSkin, g, g ? C : 0, A.raw);
4367
+ let Q = I.shape.intoRaw(), B = y.intoRaw(I.translation), i = QA.intoRaw(I.rotation), o = y.intoRaw(I.centerOfMass), h = this.raw.createCollider(I.enabled, Q, B, i, I.massPropsMode, I.mass, o, I.principalAngularInertia, I.density, I.friction, I.restitution, I.frictionCombineRule, I.restitutionCombineRule, I.isSensor, I.collisionGroups, I.solverGroups, I.activeCollisionTypes, I.activeHooks, I.activeEvents, I.contactForceEventThreshold, I.contactSkin, g, g ? C : 0, A.raw);
4368
4368
  Q.free(), B.free(), i.free(), o.free();
4369
4369
  let s = g ? A.get(C) : null, G = new zI(this, h, s, I.shape);
4370
4370
  return this.map.set(h, G), G;
@@ -4462,7 +4462,7 @@ function jC(D) {
4462
4462
  A = D, E.reserve_memory(A);
4463
4463
  }
4464
4464
  tA[45] = 62, tA[95] = 63;
4465
- var JA = Object.freeze({ __proto__: null, version: WC, reserveMemory: jC, Vector2: ug, VectorOps: F, RotationOps: AA, get RigidBodyType() {
4465
+ var JA = Object.freeze({ __proto__: null, version: WC, reserveMemory: jC, Vector2: ug, VectorOps: y, RotationOps: QA, get RigidBodyType() {
4466
4466
  return YA;
4467
4467
  }, RigidBody: PI, RigidBodyDesc: rA, RigidBodySet: Pg, IntegrationParameters: Vg, get JointType() {
4468
4468
  return RA;
@@ -4495,10 +4495,10 @@ var JA = Object.freeze({ __proto__: null, version: WC, reserveMemory: jC, Vector
4495
4495
  }, PidController: NC });
4496
4496
  class mC {
4497
4497
  constructor() {
4498
- z(this, "world", null);
4499
- z(this, "bodies", /* @__PURE__ */ new Map());
4500
- z(this, "colliders", /* @__PURE__ */ new Map());
4501
- z(this, "initialized", !1);
4498
+ AA(this, "world", null);
4499
+ AA(this, "bodies", /* @__PURE__ */ new Map());
4500
+ AA(this, "colliders", /* @__PURE__ */ new Map());
4501
+ AA(this, "initialized", !1);
4502
4502
  }
4503
4503
  async init(A) {
4504
4504
  this.initialized || (await JA.init(), this.world = new JA.World(new JA.Vector2(A.x, A.y)), this.initialized = !0);
@@ -4598,42 +4598,44 @@ class mC {
4598
4598
  }
4599
4599
  class xC {
4600
4600
  constructor() {
4601
- z(this, "artboard", null);
4602
- z(this, "objectStates", /* @__PURE__ */ new Map());
4601
+ AA(this, "artboard", null);
4602
+ AA(this, "objectStates", /* @__PURE__ */ new Map());
4603
4603
  // Physics State
4604
- z(this, "physicsEngine", null);
4604
+ AA(this, "physicsEngine", null);
4605
4605
  // State Machine State
4606
- z(this, "activeStateMachine", null);
4607
- z(this, "inputs", /* @__PURE__ */ new Map());
4606
+ AA(this, "activeStateMachine", null);
4607
+ AA(this, "inputs", /* @__PURE__ */ new Map());
4608
4608
  // id -> value
4609
- z(this, "inputNameMap", /* @__PURE__ */ new Map());
4609
+ AA(this, "inputNameMap", /* @__PURE__ */ new Map());
4610
4610
  // name -> id[] mapping
4611
- z(this, "layerStates", /* @__PURE__ */ new Map());
4612
- z(this, "imageCache", /* @__PURE__ */ new Map());
4613
- z(this, "layout", { fit: "Contain", alignment: "Center" });
4614
- z(this, "onTrigger");
4615
- z(this, "onInputUpdate");
4616
- z(this, "onComponentChange");
4611
+ AA(this, "layerStates", /* @__PURE__ */ new Map());
4612
+ AA(this, "imageCache", /* @__PURE__ */ new Map());
4613
+ AA(this, "fontCache", /* @__PURE__ */ new Set());
4614
+ AA(this, "shadowBuffer", null);
4615
+ AA(this, "layout", { fit: "Contain", alignment: "Center" });
4616
+ AA(this, "onTrigger");
4617
+ AA(this, "onInputUpdate");
4618
+ AA(this, "onComponentChange");
4617
4619
  // Specific Component Listeners
4618
- z(this, "onToggle");
4619
- z(this, "onInputChange");
4620
- z(this, "onInputFocus");
4621
- z(this, "onInputBlur");
4620
+ AA(this, "onToggle");
4621
+ AA(this, "onInputChange");
4622
+ AA(this, "onInputFocus");
4623
+ AA(this, "onInputBlur");
4622
4624
  // Track triggers that were just fired in the current frame
4623
- z(this, "justFiredTriggers", /* @__PURE__ */ new Set());
4625
+ AA(this, "justFiredTriggers", /* @__PURE__ */ new Set());
4624
4626
  // Track currently hovered object for Enter/Leave events
4625
- z(this, "lastHoveredObjectId", null);
4626
- z(this, "_lastPointerPos", null);
4627
- z(this, "_prevPointerPos", null);
4627
+ AA(this, "lastHoveredObjectId", null);
4628
+ AA(this, "_lastPointerPos", null);
4629
+ AA(this, "_prevPointerPos", null);
4628
4630
  // Interaction State
4629
- z(this, "focusedId", null);
4630
- z(this, "draggingSliderId", null);
4631
- z(this, "activeDropdownId", null);
4632
- z(this, "draggingListViewId", null);
4631
+ AA(this, "focusedId", null);
4632
+ AA(this, "draggingSliderId", null);
4633
+ AA(this, "activeDropdownId", null);
4634
+ AA(this, "draggingListViewId", null);
4633
4635
  // Physics/Animation State
4634
- z(this, "objectVelocities", /* @__PURE__ */ new Map());
4636
+ AA(this, "objectVelocities", /* @__PURE__ */ new Map());
4635
4637
  // Trigger Management
4636
- z(this, "activeTriggers", /* @__PURE__ */ new Map());
4638
+ AA(this, "activeTriggers", /* @__PURE__ */ new Map());
4637
4639
  }
4638
4640
  setTriggerCallback(A) {
4639
4641
  this.onTrigger = A;
@@ -5053,8 +5055,8 @@ class xC {
5053
5055
  if (w) {
5054
5056
  const a = g.useSpring, N = this.objectVelocities.get(I.id) || { vx: 0, vy: 0 };
5055
5057
  if (a) {
5056
- const { x: S, y: k, vx: y, vy: U } = this.computeSpring(C.x, C.y, N.vx, N.vy, w.x, w.y, g, A);
5057
- g.copyX && (C.x = S), g.copyY && (C.y = k), this.objectVelocities.set(I.id, { vx: y, vy: U });
5058
+ const { x: S, y: k, vx: F, vy: U } = this.computeSpring(C.x, C.y, N.vx, N.vy, w.x, w.y, g, A);
5059
+ g.copyX && (C.x = S), g.copyY && (C.y = k), this.objectVelocities.set(I.id, { vx: F, vy: U });
5058
5060
  } else
5059
5061
  g.copyX && (C.x = C.x + (w.x - C.x) * Q), g.copyY && (C.y = C.y + (w.y - C.y) * Q);
5060
5062
  (B = g.limitX) != null && B.enabled && (C.x = Math.max(g.limitX.min, Math.min(g.limitX.max, C.x))), (i = g.limitY) != null && i.enabled && (C.y = Math.max(g.limitY.min, Math.min(g.limitY.max, C.y)));
@@ -5062,8 +5064,8 @@ class xC {
5062
5064
  } else if (g.type === "FollowPointer") {
5063
5065
  const w = ((o = this._lastPointerPos) == null ? void 0 : o.x) ?? C.x, a = ((h = this._lastPointerPos) == null ? void 0 : h.y) ?? C.y;
5064
5066
  if (g.useSpring) {
5065
- const S = this.objectVelocities.get(I.id) || { vx: 0, vy: 0 }, { x: k, y, vx: U, vy: c } = this.computeSpring(C.x, C.y, S.vx, S.vy, w, a, g, A);
5066
- C.x = k, C.y = y, this.objectVelocities.set(I.id, { vx: U, vy: c });
5067
+ const S = this.objectVelocities.get(I.id) || { vx: 0, vy: 0 }, { x: k, y: F, vx: U, vy: c } = this.computeSpring(C.x, C.y, S.vx, S.vy, w, a, g, A);
5068
+ C.x = k, C.y = F, this.objectVelocities.set(I.id, { vx: U, vy: c });
5067
5069
  } else
5068
5070
  C.x = C.x + (w - C.x) * Q, C.y = C.y + (a - C.y) * Q;
5069
5071
  (s = g.limitX) != null && s.enabled && (C.x = Math.max(g.limitX.min, Math.min(g.limitX.max, C.x))), (G = g.limitY) != null && G.enabled && (C.y = Math.max(g.limitY.min, Math.min(g.limitY.max, C.y)));
@@ -5071,33 +5073,33 @@ class xC {
5071
5073
  const w = this.objectStates.get(g.targetId);
5072
5074
  if (w) {
5073
5075
  const a = C.x - w.x, N = C.y - w.y, S = Math.sqrt(a * a + N * N), k = g.distance || 0;
5074
- let y = S;
5076
+ let F = S;
5075
5077
  switch (g.mode) {
5076
5078
  case "exact":
5077
- y = k;
5079
+ F = k;
5078
5080
  break;
5079
5081
  case "minimum":
5080
- y = Math.max(k, S);
5082
+ F = Math.max(k, S);
5081
5083
  break;
5082
5084
  case "maximum":
5083
- y = Math.min(k, S);
5085
+ F = Math.min(k, S);
5084
5086
  break;
5085
5087
  case "clamped":
5086
- y = Math.max(0, Math.min(k, S));
5088
+ F = Math.max(0, Math.min(k, S));
5087
5089
  break;
5088
5090
  }
5089
5091
  if (S > 0) {
5090
- const U = y / S;
5092
+ const U = F / S;
5091
5093
  C.x = w.x + a * U, C.y = w.y + N * U;
5092
- } else S === 0 && y > 0 && (C.x = w.x + y);
5094
+ } else S === 0 && F > 0 && (C.x = w.x + F);
5093
5095
  }
5094
5096
  }
5095
5097
  });
5096
5098
  });
5097
5099
  }
5098
5100
  computeSpring(A, I, C, g, Q, B, i, o) {
5099
- const h = i.stiffness ?? 100, s = i.damping ?? 10, G = i.mass ?? 1, w = -h * (A - Q), a = -h * (I - B), N = -s * C, S = -s * g, k = (w + N) / G, y = (a + S) / G, U = C + k * o, c = g + y * o, t = A + U * o, J = I + c * o;
5100
- return { x: t, y: J, vx: U, vy: c };
5101
+ const h = i.stiffness ?? 100, s = i.damping ?? 10, G = i.mass ?? 1, w = -h * (A - Q), a = -h * (I - B), N = -s * C, S = -s * g, k = (w + N) / G, F = (a + S) / G, U = C + k * o, c = g + F * o, Y = A + U * o, J = I + c * o;
5102
+ return { x: Y, y: J, vx: U, vy: c };
5101
5103
  }
5102
5104
  handlePointerInput(A, I, C, g, Q) {
5103
5105
  if (!this.artboard) return;
@@ -5122,7 +5124,7 @@ class xC {
5122
5124
  const S = /* @__PURE__ */ new Set([N]);
5123
5125
  a === "move" && S.add("onPointerEnter").add("hover").add("onPointerLeave").add("blur"), N === "onClick" && S.add("click"), N === "onPointerDown" && S.add("pointerDown"), N === "onPointerUp" && S.add("pointerUp");
5124
5126
  const k = ["button", "toggle", "toggle_button", "dropdown", "listview", "inputbox", "slider"];
5125
- return !!(w.type === "Component" && k.includes(w.variant) || k.includes((c = w.type) == null ? void 0 : c.toLowerCase()) || (w.interactions || []).some((t) => S.has(t.event)) || (w.triggers || []).some((t) => S.has(t.eventType)));
5127
+ return !!(w.type === "Component" && k.includes(w.variant) || k.includes((c = w.type) == null ? void 0 : c.toLowerCase()) || (w.interactions || []).some((Y) => S.has(Y.event)) || (w.triggers || []).some((Y) => S.has(Y.eventType)));
5126
5128
  };
5127
5129
  let B = null;
5128
5130
  for (let w = this.artboard.objects.length - 1; w >= 0; w--) {
@@ -5151,17 +5153,17 @@ class xC {
5151
5153
  if ((A === "up" || A === "blur") && (this.draggingSliderId = null, this.draggingListViewId = null), this.activeDropdownId && A === "down") {
5152
5154
  const w = this.artboard.objects.find((a) => a.id === this.activeDropdownId);
5153
5155
  if (w && (w.type === "Dropdown" || w.variant === "dropdown")) {
5154
- const a = this.objectStates.get(w.id), N = (a == null ? void 0 : a.options) || w.options || {}, S = w.geometry || {}, k = S.width ?? w.width ?? 200, y = S.height ?? w.height ?? 40, U = N.optionsList || [], c = N.itemHeight || 32, t = N.listPadding ?? 4, J = U.length * c + t * 2, R = this.getWorldTransform(w.id), e = k * Math.abs(R.scaleX), Y = y * Math.abs(R.scaleY), r = R.y + Y / 2 + 4, L = Math.abs(I - R.x) <= e / 2, b = C >= r && C <= r + J * Math.abs(R.scaleY);
5155
- if (L && b) {
5156
- const P = Math.abs(R.scaleY), IA = C - (r + t * P), m = Math.floor(IA / (c * P));
5157
- if (m >= 0 && m < U.length) {
5158
- const QA = U[m];
5159
- N.selectedOption = QA, N.isOpen = !1, this.activeDropdownId = null, w.inputId && this.setInternalInput(w.inputId, QA), this.onComponentChange && this.onComponentChange({
5156
+ const a = this.objectStates.get(w.id), N = (a == null ? void 0 : a.options) || w.options || {}, S = w.geometry || {}, k = S.width ?? w.width ?? 200, F = S.height ?? w.height ?? 40, U = N.optionsList || [], c = N.itemHeight || 32, Y = N.listPadding ?? 4, J = U.length * c + Y * 2, R = this.getWorldTransform(w.id), e = k * Math.abs(R.scaleX), t = F * Math.abs(R.scaleY), L = R.y + t / 2 + 4, r = Math.abs(I - R.x) <= e / 2, T = C >= L && C <= L + J * Math.abs(R.scaleY);
5157
+ if (r && T) {
5158
+ const W = Math.abs(R.scaleY), V = C - (L + Y * W), n = Math.floor(V / (c * W));
5159
+ if (n >= 0 && n < U.length) {
5160
+ const IA = U[n];
5161
+ N.selectedOption = IA, N.isOpen = !1, this.activeDropdownId = null, w.inputId && this.setInternalInput(w.inputId, IA), this.onComponentChange && this.onComponentChange({
5160
5162
  objectId: w.id,
5161
5163
  componentName: w.name,
5162
5164
  variant: "dropdown",
5163
5165
  property: "selectedOption",
5164
- value: QA
5166
+ value: IA
5165
5167
  });
5166
5168
  }
5167
5169
  return;
@@ -5200,12 +5202,12 @@ class xC {
5200
5202
  }), this.onToggle && this.onToggle(w.name, k.checked);
5201
5203
  }
5202
5204
  if (w.type === "Component" && w.variant === "dropdown" && A === "down") {
5203
- const S = this.objectStates.get(w.id), k = (S == null ? void 0 : S.options) || w.options || {}, y = !k.isOpen;
5204
- if (y && this.activeDropdownId && this.activeDropdownId !== w.id) {
5205
+ const S = this.objectStates.get(w.id), k = (S == null ? void 0 : S.options) || w.options || {}, F = !k.isOpen;
5206
+ if (F && this.activeDropdownId && this.activeDropdownId !== w.id) {
5205
5207
  const U = this.artboard.objects.find((c) => c.id === this.activeDropdownId);
5206
5208
  U && U.options && (U.options.isOpen = !1);
5207
5209
  }
5208
- k.isOpen = y, this.activeDropdownId = y ? w.id : null;
5210
+ k.isOpen = F, this.activeDropdownId = F ? w.id : null;
5209
5211
  }
5210
5212
  if (g.type === "Component" && g.variant === "button" && A === "down" && this.onComponentChange && this.onComponentChange({
5211
5213
  objectId: g.id,
@@ -5219,10 +5221,10 @@ class xC {
5219
5221
  if (S !== null) {
5220
5222
  const k = g.options || {};
5221
5223
  k.activeItemIndex = S;
5222
- const y = this.objectStates.get(g.id);
5223
- y && y.options && (y.options.activeItemIndex = S);
5224
+ const F = this.objectStates.get(g.id);
5225
+ F && F.options && (F.options.activeItemIndex = S);
5224
5226
  const U = (k.items || [])[S], c = typeof U == "string" ? U : U.label || U.value || S;
5225
- y && y.options && (y.options.selectedValue = c), g.inputId && this.setInternalInput(g.inputId, c), this.onComponentChange && (this.onComponentChange({
5227
+ F && F.options && (F.options.selectedValue = c), g.inputId && this.setInternalInput(g.inputId, c), this.onComponentChange && (this.onComponentChange({
5226
5228
  objectId: g.id,
5227
5229
  componentName: g.name,
5228
5230
  variant: "listview",
@@ -5238,18 +5240,18 @@ class xC {
5238
5240
  }
5239
5241
  }
5240
5242
  if (g.type === "Component" && g.variant === "slider" && A === "down" && (this.draggingSliderId = g.id, this.updateSliderValueFromPointer(g, I, C)), A === "click") {
5241
- const S = (o = this.artboard) == null ? void 0 : o.objects.find((y) => y.id === g.id), k = this.focusedId;
5243
+ const S = (o = this.artboard) == null ? void 0 : o.objects.find((F) => F.id === g.id), k = this.focusedId;
5242
5244
  if ((S == null ? void 0 : S.type) === "Component" && S.variant === "inputbox") {
5243
5245
  if (this.focusedId = g.id, console.log(`[Engine] Focus set to: ${g.id}`), k !== this.focusedId) {
5244
5246
  if (k) {
5245
- const y = (h = this.artboard) == null ? void 0 : h.objects.find((U) => U.id === k);
5246
- y && this.onInputBlur && this.onInputBlur(y.name);
5247
+ const F = (h = this.artboard) == null ? void 0 : h.objects.find((U) => U.id === k);
5248
+ F && this.onInputBlur && this.onInputBlur(F.name);
5247
5249
  }
5248
5250
  this.onInputFocus && this.onInputFocus(S.name);
5249
5251
  }
5250
5252
  } else if (this.focusedId = null, k) {
5251
- const y = (s = this.artboard) == null ? void 0 : s.objects.find((U) => U.id === k);
5252
- y && this.onInputBlur && this.onInputBlur(y.name);
5253
+ const F = (s = this.artboard) == null ? void 0 : s.objects.find((U) => U.id === k);
5254
+ F && this.onInputBlur && this.onInputBlur(F.name);
5253
5255
  }
5254
5256
  }
5255
5257
  } else if (A === "click") {
@@ -5339,21 +5341,21 @@ class xC {
5339
5341
  };
5340
5342
  }
5341
5343
  hitTest(A, I, C) {
5342
- var c, t;
5344
+ var c, Y;
5343
5345
  if (!this.objectStates.get(A.id)) return !1;
5344
- const Q = ((c = A.geometry) == null ? void 0 : c.width) ?? A.width ?? 100, B = ((t = A.geometry) == null ? void 0 : t.height) ?? A.height ?? 100, i = this.getWorldTransform(A.id), o = I - i.x, h = C - i.y, s = -i.rotation * (Math.PI / 180), G = Math.cos(s), w = Math.sin(s), a = o * G - h * w, N = o * w + h * G, S = i.scaleX, k = i.scaleY, y = Q * Math.abs(S), U = B * Math.abs(k);
5345
- return Math.abs(a) <= y / 2 && Math.abs(N) <= U / 2;
5346
+ const Q = ((c = A.geometry) == null ? void 0 : c.width) ?? A.width ?? 100, B = ((Y = A.geometry) == null ? void 0 : Y.height) ?? A.height ?? 100, i = this.getWorldTransform(A.id), o = I - i.x, h = C - i.y, s = -i.rotation * (Math.PI / 180), G = Math.cos(s), w = Math.sin(s), a = o * G - h * w, N = o * w + h * G, S = i.scaleX, k = i.scaleY, F = Q * Math.abs(S), U = B * Math.abs(k);
5347
+ return Math.abs(a) <= F / 2 && Math.abs(N) <= U / 2;
5346
5348
  }
5347
5349
  updateSliderValueFromPointer(A, I, C) {
5348
5350
  var e;
5349
5351
  const g = this.objectStates.get(A.id);
5350
5352
  if (!g) return;
5351
5353
  const Q = A.options || {}, B = ((e = A.geometry) == null ? void 0 : e.width) ?? A.width ?? 200, i = this.getWorldTransform(A.id), o = I - i.x, h = C - i.y, s = -i.rotation * (Math.PI / 180), G = Math.cos(s), w = Math.sin(s), a = o * G - h * w, N = Q.thumbWidth ?? 16, S = B - N;
5352
- let y = (a + S / 2) / S;
5353
- y = Math.max(0, Math.min(1, y));
5354
- const U = Q.min ?? 0, c = Q.max ?? 100, t = Q.step || 1;
5355
- let J = U + y * (c - U);
5356
- t > 0 && (J = Math.round(J / t) * t), J = Math.max(U, Math.min(c, J));
5354
+ let F = (a + S / 2) / S;
5355
+ F = Math.max(0, Math.min(1, F));
5356
+ const U = Q.min ?? 0, c = Q.max ?? 100, Y = Q.step || 1;
5357
+ let J = U + F * (c - U);
5358
+ Y > 0 && (J = Math.round(J / Y) * Y), J = Math.max(U, Math.min(c, J));
5357
5359
  const R = g.options || {};
5358
5360
  R.value !== J && (g.options = { ...R, value: J }, A.inputId && this.setInternalInput(A.inputId, J), this.onComponentChange && this.onComponentChange({
5359
5361
  objectId: A.id,
@@ -5423,19 +5425,19 @@ class xC {
5423
5425
  var N, S;
5424
5426
  const g = ((S = (N = this.artboard) == null ? void 0 : N.tokens) == null ? void 0 : S.colors) || {}, Q = g[A] || A, B = g[I] || I, i = (k) => {
5425
5427
  if (!k) return { r: 0, g: 0, b: 0 };
5426
- const y = k.startsWith("#") ? k.replace("#", "") : "000000";
5427
- return y.length === 3 ? {
5428
- r: parseInt(y[0] + y[0], 16),
5429
- g: parseInt(y[1] + y[1], 16),
5430
- b: parseInt(y[2] + y[2], 16)
5428
+ const F = k.startsWith("#") ? k.replace("#", "") : "000000";
5429
+ return F.length === 3 ? {
5430
+ r: parseInt(F[0] + F[0], 16),
5431
+ g: parseInt(F[1] + F[1], 16),
5432
+ b: parseInt(F[2] + F[2], 16)
5431
5433
  } : {
5432
- r: parseInt(y.substring(0, 2), 16),
5433
- g: parseInt(y.substring(2, 4), 16),
5434
- b: parseInt(y.substring(4, 6), 16)
5434
+ r: parseInt(F.substring(0, 2), 16),
5435
+ g: parseInt(F.substring(2, 4), 16),
5436
+ b: parseInt(F.substring(4, 6), 16)
5435
5437
  };
5436
5438
  }, o = i(Q), h = i(B), s = Math.round(o.r + (h.r - o.r) * C), G = Math.round(o.g + (h.g - o.g) * C), w = Math.round(o.b + (h.b - o.b) * C), a = (k) => {
5437
- const y = Math.max(0, Math.min(255, k)).toString(16);
5438
- return y.length === 1 ? "0" + y : y;
5439
+ const F = Math.max(0, Math.min(255, k)).toString(16);
5440
+ return F.length === 1 ? "0" + F : F;
5439
5441
  };
5440
5442
  return `#${a(s)}${a(G)}${a(w)}`;
5441
5443
  }
@@ -5542,20 +5544,20 @@ class xC {
5542
5544
  return /^\d+$/.test(I) ? I : I.includes("thin") ? "100" : I.includes("extra light") || I.includes("extralight") ? "200" : I.includes("light") ? "300" : I.includes("medium") ? "500" : I.includes("semibold") || I.includes("semi bold") ? "600" : I.includes("bold") ? "700" : I.includes("extra bold") || I.includes("extrabold") ? "800" : I.includes("black") || I.includes("heavy") ? "900" : "400";
5543
5545
  }
5544
5546
  renderObject(A, I, C) {
5545
- var U, c, t;
5547
+ var U, c, Y;
5546
5548
  const g = this.objectStates.get(I.id);
5547
5549
  if (!g) {
5548
5550
  console.warn("No state for object:", I.id);
5549
5551
  return;
5550
5552
  }
5551
- A.roundRect || (A.roundRect = (J, R, e, Y, r) => (this.drawRoundRect(A, J, R, e, Y, r), A));
5553
+ A.roundRect || (A.roundRect = (J, R, e, t, L) => (this.drawRoundRect(A, J, R, e, t, L), A));
5552
5554
  const Q = g.geometry ? { ...I.geometry, ...g.geometry } : I.geometry, B = g.style ? { ...I.style, ...g.style } : I.style;
5553
5555
  let i = (Q == null ? void 0 : Q.width) || ((U = I.geometry) == null ? void 0 : U.width) || I.width || 0, o = (Q == null ? void 0 : Q.height) || ((c = I.geometry) == null ? void 0 : c.height) || I.height || 0;
5554
5556
  if ((i === 0 || o === 0) && (Q != null && Q.points) && Array.isArray(Q.points) && Q.points.length > 0) {
5555
- let J = 1 / 0, R = -1 / 0, e = 1 / 0, Y = -1 / 0;
5556
- Q.points.forEach((r) => {
5557
- J = Math.min(J, r.x), R = Math.max(R, r.x), e = Math.min(e, r.y), Y = Math.max(Y, r.y);
5558
- }), i === 0 && (i = R - J), o === 0 && (o = Y - e);
5557
+ let J = 1 / 0, R = -1 / 0, e = 1 / 0, t = -1 / 0;
5558
+ Q.points.forEach((L) => {
5559
+ J = Math.min(J, L.x), R = Math.max(R, L.x), e = Math.min(e, L.y), t = Math.max(t, L.y);
5560
+ }), i === 0 && (i = R - J), o === 0 && (o = t - e);
5559
5561
  }
5560
5562
  const h = (J) => {
5561
5563
  if (J)
@@ -5604,88 +5606,88 @@ class xC {
5604
5606
  if (A.translate(w, a), A.rotate(g.rotation * Math.PI / 180), A.scale(g.scale_x, g.scale_y), Q.type === "Text") {
5605
5607
  let J = Q.text || "";
5606
5608
  if (Q.textInputId) {
5607
- const p = this.inputs.get(Q.textInputId);
5608
- p !== void 0 && (J = String(p), g.geometry && g.geometry.type === "Text" && (g.geometry.text = J));
5609
+ const f = this.inputs.get(Q.textInputId);
5610
+ f !== void 0 && (J = String(f), g.geometry && g.geometry.type === "Text" && (g.geometry.text = J));
5609
5611
  }
5610
5612
  let R = J || "";
5611
- Q.segments && Array.isArray(Q.segments) && (R = Q.segments.map((p) => p && p.text ? p.text : "").join(""));
5613
+ Q.segments && Array.isArray(Q.segments) && (R = Q.segments.map((f) => f && f.text ? f.text : "").join(""));
5612
5614
  const e = Q.textCase || "none";
5613
- e === "uppercase" ? R = R.toUpperCase() : e === "lowercase" ? R = R.toLowerCase() : e === "capitalize" && (R = R.replace(/\b\w/g, (p) => p.toUpperCase()));
5614
- let Y = ((t = Q.fontWeight) == null ? void 0 : t.toString()) || "400", r = "normal";
5615
- Y.toLowerCase().includes("italic") && (r = "italic", Y = Y.replace(/italic/gi, "").trim() || "400");
5616
- const L = this.mapFontWeight(Y), b = Math.max(1, Q.fontSize || 16);
5617
- A.font = `${r} ${L} ${b}px "${Q.fontFamily || "Inter"}", sans-serif`;
5618
- const P = Q.textVerticalAlign || "top";
5619
- let IA = -o / 2;
5620
- P === "middle" || P === "center" ? (A.textBaseline = "middle", IA = 0) : P === "bottom" ? (A.textBaseline = "bottom", IA = o / 2) : (A.textBaseline = "top", IA = -o / 2);
5621
- const m = Q.textAlign || "left";
5622
- A.textAlign = m;
5623
- let QA = -i / 2;
5624
- m === "center" && (QA = 0), m === "right" && (QA = i / 2);
5625
- const _ = Q.letterSpacing || 0, BA = Q.paragraphSpacing || 0, X = (Q.lineHeight || 1.16) * b, gA = Q.width || i || 200, O = (p) => {
5626
- if (_ === 0) return A.measureText(p).width;
5615
+ e === "uppercase" ? R = R.toUpperCase() : e === "lowercase" ? R = R.toLowerCase() : e === "capitalize" && (R = R.replace(/\b\w/g, (f) => f.toUpperCase()));
5616
+ let t = ((Y = Q.fontWeight) == null ? void 0 : Y.toString()) || "400", L = "normal";
5617
+ t.toLowerCase().includes("italic") && (L = "italic", t = t.replace(/italic/gi, "").trim() || "400");
5618
+ const r = this.mapFontWeight(t), T = Math.max(1, Q.fontSize || 16);
5619
+ A.font = `${L} ${r} ${T}px "${Q.fontFamily || "Inter"}", sans-serif`;
5620
+ const W = Q.textVerticalAlign || "top";
5621
+ let V = -o / 2;
5622
+ W === "middle" || W === "center" ? (A.textBaseline = "middle", V = 0) : W === "bottom" ? (A.textBaseline = "bottom", V = o / 2) : (A.textBaseline = "top", V = -o / 2);
5623
+ const n = Q.textAlign || "left";
5624
+ A.textAlign = n;
5625
+ let IA = -i / 2;
5626
+ n === "center" && (IA = 0), n === "right" && (IA = i / 2);
5627
+ const O = Q.letterSpacing || 0, u = Q.paragraphSpacing || 0, l = (Q.lineHeight || 1.16) * T, $ = Q.width || i || 200, j = (f) => {
5628
+ if (O === 0) return A.measureText(f).width;
5627
5629
  let iA = 0;
5628
- for (let d = 0; d < p.length; d++)
5629
- iA += A.measureText(p[d]).width + _;
5630
- return iA - _;
5631
- }, q = [], W = String(R || "").split(`
5630
+ for (let b = 0; b < f.length; b++)
5631
+ iA += A.measureText(f[b]).width + O;
5632
+ return iA - O;
5633
+ }, H = [], m = String(R || "").split(`
5632
5634
  `);
5633
- W.forEach((p, iA) => {
5634
- const d = String(p || "").split(" ");
5635
- let l = "";
5636
- for (let Z = 0; Z < d.length; Z++) {
5637
- let x = d[Z];
5638
- const aA = l + x + " ";
5639
- if (O(aA.trim()) <= gA)
5640
- l = aA;
5635
+ m.forEach((f, iA) => {
5636
+ const b = String(f || "").split(" ");
5637
+ let p = "";
5638
+ for (let X = 0; X < b.length; X++) {
5639
+ let P = b[X];
5640
+ const aA = p + P + " ";
5641
+ if (j(aA.trim()) <= $)
5642
+ p = aA;
5641
5643
  else {
5642
- if (l !== "") {
5644
+ if (p !== "") {
5643
5645
  let sA = -1;
5644
- for (let oA = 0; oA < x.length; oA++) {
5645
- const NA = l + x.substring(0, oA + 1);
5646
- if (O(NA) <= gA)
5646
+ for (let oA = 0; oA < P.length; oA++) {
5647
+ const NA = p + P.substring(0, oA + 1);
5648
+ if (j(NA) <= $)
5647
5649
  sA = oA;
5648
5650
  else
5649
5651
  break;
5650
5652
  }
5651
5653
  if (sA !== -1) {
5652
- const oA = x.substring(0, sA + 1), NA = x.substring(sA + 1);
5653
- q.push({ text: l + oA, isParaEnd: !1 }), l = "", d[Z] = NA, Z--;
5654
+ const oA = P.substring(0, sA + 1), NA = P.substring(sA + 1);
5655
+ H.push({ text: p + oA, isParaEnd: !1 }), p = "", b[X] = NA, X--;
5654
5656
  continue;
5655
5657
  } else {
5656
- q.push({ text: l.trim(), isParaEnd: !1 }), l = "", Z--;
5658
+ H.push({ text: p.trim(), isParaEnd: !1 }), p = "", X--;
5657
5659
  continue;
5658
5660
  }
5659
5661
  }
5660
5662
  let hA = "";
5661
- for (let sA = 0; sA < x.length; sA++) {
5662
- const oA = hA + x[sA];
5663
- O(oA) > gA && hA !== "" ? (q.push({ text: hA, isParaEnd: !1 }), hA = x[sA]) : hA = oA;
5663
+ for (let sA = 0; sA < P.length; sA++) {
5664
+ const oA = hA + P[sA];
5665
+ j(oA) > $ && hA !== "" ? (H.push({ text: hA, isParaEnd: !1 }), hA = P[sA]) : hA = oA;
5664
5666
  }
5665
- l = hA + " ";
5667
+ p = hA + " ";
5666
5668
  }
5667
5669
  }
5668
- q.push({ text: l.trim(), isParaEnd: iA < W.length - 1 });
5670
+ H.push({ text: p.trim(), isParaEnd: iA < m.length - 1 });
5669
5671
  });
5670
- let f = IA, T = q.length * X;
5671
- if (BA > 0) {
5672
- const p = q.filter((iA, d) => iA.isParaEnd && d < q.length - 1).length;
5673
- T += p * BA;
5672
+ let Z = V, x = H.length * l;
5673
+ if (u > 0) {
5674
+ const f = H.filter((iA, b) => iA.isParaEnd && b < H.length - 1).length;
5675
+ x += f * u;
5674
5676
  }
5675
- P === "middle" || P === "center" ? f -= T / 2 - b / 2 : P === "bottom" && (f -= T - b);
5676
- const V = (p, iA, d, l, Z) => {
5677
- var x, aA;
5678
- if (_ === 0 && (Q.enableSegments !== !0 || !Q.segments || Q.segments.length === 0))
5679
- l ? A.strokeText(p, iA, d) : A.fillText(p, iA, d);
5677
+ W === "middle" || W === "center" ? Z -= x / 2 - T / 2 : W === "bottom" && (Z -= x - T);
5678
+ const gA = (f, iA, b, p, X) => {
5679
+ var P, aA;
5680
+ if (O === 0 && (Q.enableSegments !== !0 || !Q.segments || Q.segments.length === 0))
5681
+ p ? A.strokeText(f, iA, b) : A.fillText(f, iA, b);
5680
5682
  else {
5681
- const hA = O(p);
5683
+ const hA = j(f);
5682
5684
  let sA = iA;
5683
- m === "center" ? sA -= hA / 2 : m === "right" && (sA -= hA);
5685
+ n === "center" ? sA -= hA / 2 : n === "right" && (sA -= hA);
5684
5686
  let oA = sA;
5685
- for (let NA = 0; NA < p.length; NA++) {
5686
- const xA = p[NA];
5687
+ for (let NA = 0; NA < f.length; NA++) {
5688
+ const xA = f[NA];
5687
5689
  if (Q.enableSegments === !0 && Q.segments && Q.segments.length > 0) {
5688
- const eI = Z + NA;
5690
+ const eI = X + NA;
5689
5691
  let oI = 0;
5690
5692
  const cA = Q.segments.find((TA) => {
5691
5693
  if (!TA || typeof TA.text != "string") return !1;
@@ -5694,36 +5696,36 @@ class xC {
5694
5696
  });
5695
5697
  if (cA) {
5696
5698
  if (cA.fill) {
5697
- const TA = ((aA = (x = g == null ? void 0 : g.style) == null ? void 0 : x.fill) == null ? void 0 : aA.color) || null;
5698
- l ? A.strokeStyle = cA.fill.color || A.strokeStyle : A.fillStyle = TA || cA.fill.color || A.fillStyle;
5699
+ const TA = ((aA = (P = g == null ? void 0 : g.style) == null ? void 0 : P.fill) == null ? void 0 : aA.color) || null;
5700
+ p ? A.strokeStyle = cA.fill.color || A.strokeStyle : A.fillStyle = TA || cA.fill.color || A.fillStyle;
5699
5701
  }
5700
5702
  if (cA.fontSize || cA.fontFamily || cA.fontWeight) {
5701
- const TA = cA.fontWeight ? this.mapFontWeight(cA.fontWeight.toString()) : L, rI = cA.fontSize || b, FC = cA.fontFamily || Q.fontFamily || "Inter";
5702
- A.font = `${r} ${TA} ${rI}px "${FC}", sans-serif`;
5703
+ const TA = cA.fontWeight ? this.mapFontWeight(cA.fontWeight.toString()) : r, rI = cA.fontSize || T, FC = cA.fontFamily || Q.fontFamily || "Inter";
5704
+ A.font = `${L} ${TA} ${rI}px "${FC}", sans-serif`;
5703
5705
  }
5704
5706
  }
5705
5707
  }
5706
- l ? A.strokeText(xA, oA, d) : A.fillText(xA, oA, d), Q.enableSegments === !0 && Q.segments && Q.segments.length > 0 && (A.font = `${r} ${L} ${b}px "${Q.fontFamily || "Inter"}", sans-serif`), oA += A.measureText(xA).width + _;
5708
+ p ? A.strokeText(xA, oA, b) : A.fillText(xA, oA, b), Q.enableSegments === !0 && Q.segments && Q.segments.length > 0 && (A.font = `${L} ${r} ${T}px "${Q.fontFamily || "Inter"}", sans-serif`), oA += A.measureText(xA).width + O;
5707
5709
  }
5708
5710
  }
5709
5711
  };
5710
5712
  if (B.fill) {
5711
- const p = A.globalAlpha, iA = this.createCanvasFill(A, B.fill, i, o);
5712
- A.fillStyle = iA || B.fill.color || "#000000", A.globalAlpha = p * this.normalizeOpacity(B.fill.opacity ?? 100);
5713
- let d = 0, l = f;
5714
- q.forEach((Z) => {
5715
- const x = R.indexOf(Z.text, d);
5716
- x !== -1 && (V(Z.text, QA, l, !1, x), d = x + Z.text.length, l += X + (Z.isParaEnd ? BA : 0));
5717
- }), A.globalAlpha = p;
5713
+ const f = A.globalAlpha, iA = this.createCanvasFill(A, B.fill, i, o);
5714
+ A.fillStyle = iA || B.fill.color || "#000000", A.globalAlpha = f * this.normalizeOpacity(B.fill.opacity ?? 100);
5715
+ let b = 0, p = Z;
5716
+ H.forEach((X) => {
5717
+ const P = R.indexOf(X.text, b);
5718
+ P !== -1 && (gA(X.text, IA, p, !1, P), b = P + X.text.length, p += l + (X.isParaEnd ? u : 0));
5719
+ }), A.globalAlpha = f;
5718
5720
  }
5719
5721
  if (B.stroke && B.stroke.width > 0) {
5720
- const p = A.globalAlpha;
5721
- A.strokeStyle = B.stroke.color, A.lineWidth = B.stroke.width, A.globalAlpha = p * this.normalizeOpacity(B.stroke.opacity ?? 100);
5722
- let iA = 0, d = f;
5723
- q.forEach((l) => {
5724
- const Z = R.indexOf(l.text, iA);
5725
- Z !== -1 && (V(l.text, QA, d, !0, Z), iA = Z + l.text.length, d += X + (l.isParaEnd ? BA : 0));
5726
- }), A.globalAlpha = p;
5722
+ const f = A.globalAlpha;
5723
+ A.strokeStyle = B.stroke.color, A.lineWidth = B.stroke.width, A.globalAlpha = f * this.normalizeOpacity(B.stroke.opacity ?? 100);
5724
+ let iA = 0, b = Z;
5725
+ H.forEach((p) => {
5726
+ const X = R.indexOf(p.text, iA);
5727
+ X !== -1 && (gA(p.text, IA, b, !0, X), iA = X + p.text.length, b += l + (p.isParaEnd ? u : 0));
5728
+ }), A.globalAlpha = f;
5727
5729
  }
5728
5730
  } else if (Q.type === "Image") {
5729
5731
  const J = Q.src;
@@ -5738,54 +5740,64 @@ class xC {
5738
5740
  const J = Q.svgContent;
5739
5741
  if (J) {
5740
5742
  const R = B.palette || [], e = I.id + "_" + R.join("_");
5741
- let Y = this.imageCache.get(e);
5742
- if (!Y) {
5743
- Y = new Image();
5744
- let r = J;
5745
- Q.colors && Q.colors.length > 0 && R.length > 0 && Q.colors.forEach((P, IA) => {
5746
- if (R[IA]) {
5747
- const m = P.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), QA = new RegExp(m, "gi");
5748
- r = r.replace(QA, R[IA]);
5743
+ let t = this.imageCache.get(e);
5744
+ if (!t) {
5745
+ t = new Image();
5746
+ let L = J;
5747
+ Q.colors && Q.colors.length > 0 && R.length > 0 && Q.colors.forEach((W, V) => {
5748
+ if (R[V]) {
5749
+ const n = W.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), IA = new RegExp(n, "gi");
5750
+ L = L.replace(IA, R[V]);
5749
5751
  }
5750
5752
  });
5751
- const L = new Blob([r], { type: "image/svg+xml" }), b = URL.createObjectURL(L);
5752
- Y.onload = () => {
5753
+ const r = new Blob([L], { type: "image/svg+xml" }), T = URL.createObjectURL(r);
5754
+ t.onload = () => {
5753
5755
  this.artboard && this.reset();
5754
- }, Y.src = b, this.imageCache.set(e, Y);
5756
+ }, t.src = T, this.imageCache.set(e, t);
5755
5757
  }
5756
- Y.complete && Y.naturalWidth > 0 && (s !== 0 ? (A.save(), this.drawRoundRect(A, -i / 2, -o / 2, i, o, s), A.clip(), A.drawImage(Y, -i / 2, -o / 2, i, o), A.restore()) : A.drawImage(Y, -i / 2, -o / 2, i, o));
5758
+ t.complete && t.naturalWidth > 0 && (s !== 0 ? (A.save(), this.drawRoundRect(A, -i / 2, -o / 2, i, o, s), A.clip(), A.drawImage(t, -i / 2, -o / 2, i, o), A.restore()) : A.drawImage(t, -i / 2, -o / 2, i, o));
5757
5759
  }
5758
5760
  } else if (G.type === "LineGraph")
5759
5761
  this.renderLineGraph(A, G, i, o);
5760
5762
  else if (I.type === "Shape") {
5761
- if (this.applyPath(A, G, i, o, s), A.save(), B.shadow && B.shadow.opacity > 0) {
5762
- const J = B.shadow.color || "#000000", R = B.shadow.opacity ?? 1;
5763
- let e = J;
5764
- if (J.startsWith("#")) {
5765
- const Y = parseInt(J.slice(1, 3), 16), r = parseInt(J.slice(3, 5), 16), L = parseInt(J.slice(5, 7), 16);
5766
- e = `rgba(${Y}, ${r}, ${L}, ${R})`;
5767
- } else J.startsWith("rgba") && (e = J.replace(/[\d.]+\)$/g, `${R})`));
5768
- A.shadowColor = e, A.shadowBlur = B.shadow.blur, A.shadowOffsetX = B.shadow.offsetX, A.shadowOffsetY = B.shadow.offsetY;
5763
+ this.applyPath(A, G, i, o, s);
5764
+ const J = B.shadow;
5765
+ if (J && J.isEnabled !== !1) {
5766
+ const R = J.color || "#000000", e = this.normalizeOpacity(J.opacity ?? 100), t = J.spread || 0, r = (J.blur || 0) + t * 1.5, T = Math.max(r * 3, Math.abs(J.offsetX || 0) + r, Math.abs(J.offsetY || 0) + r), W = Math.ceil(i + T * 2), V = Math.ceil(o + T * 2);
5767
+ this.shadowBuffer || (this.shadowBuffer = document.createElement("canvas")), (this.shadowBuffer.width < W || this.shadowBuffer.height < V) && (this.shadowBuffer.width = Math.max(this.shadowBuffer.width, W), this.shadowBuffer.height = Math.max(this.shadowBuffer.height, V));
5768
+ const n = this.shadowBuffer.getContext("2d", { willReadFrequently: !0 });
5769
+ n.clearRect(0, 0, W, V), n.save(), n.translate(W / 2, V / 2);
5770
+ let IA = R;
5771
+ if (R.startsWith("#")) {
5772
+ const O = R.replace("#", ""), u = parseInt(O.substring(0, 2), 16), l = parseInt(O.substring(2, 4), 16), $ = parseInt(O.substring(4, 6), 16);
5773
+ IA = `rgba(${u}, ${l}, ${$}, ${e})`;
5774
+ } else R.startsWith("rgba") && (IA = R.replace(/[\d.]+\)$/g, `${e})`));
5775
+ n.shadowColor = IA, n.shadowBlur = r, n.shadowOffsetX = J.offsetX || 0, n.shadowOffsetY = J.offsetY || 0, n.fillStyle = "#000000", n.beginPath(), this._tracePath(n, G, i, o, s), n.fill(), n.shadowColor = "transparent", n.shadowBlur = 0, n.globalCompositeOperation = "destination-out", n.beginPath(), this._tracePath(n, G, i, o, s), n.fill(), n.restore(), A.drawImage(this.shadowBuffer, 0, 0, W, V, -W / 2, -V / 2, W, V);
5769
5776
  }
5770
- if (B.blur && B.blur.amount > 0 && (A.filter = `blur(${B.blur.amount}px)`), B.fill) {
5771
- const J = A.globalAlpha, R = this.createCanvasFill(A, B.fill, i, o);
5772
- R ? A.fillStyle = R : A.fillStyle = B.fill.color || "transparent", A.globalAlpha = J * this.normalizeOpacity(B.fill.opacity ?? 100), A.fill(), A.globalAlpha = J;
5777
+ if (A.save(), B.blur && B.blur.amount > 0 && (A.filter = `blur(${B.blur.amount}px)`), B.fill) {
5778
+ const R = A.globalAlpha, e = this.createCanvasFill(A, B.fill, i, o);
5779
+ e ? A.fillStyle = e : A.fillStyle = B.fill.color || "transparent", A.globalAlpha = R * this.normalizeOpacity(B.fill.opacity ?? 100), this.applyPath(A, G, i, o, s), A.fill(), A.globalAlpha = R;
5773
5780
  }
5774
- A.restore(), B.stroke && B.stroke.width > 0 && this.applyStrokeAlignment(A, B, G, i, o);
5781
+ A.restore(), B.stroke && B.stroke.width > 0 && this.applyStrokeAlignment(A, B, G, i, o, s);
5775
5782
  } else if (I.type === "Frame" || I.type === "Group" && !I.isStructuralGroup) {
5776
5783
  const J = g.width ?? Q.width ?? I.width ?? i, R = g.height ?? Q.height ?? I.height ?? o, e = s;
5777
- if (A.save(), B.shadow && B.shadow.opacity > 0) {
5778
- const r = B.shadow.color || "#000000", L = B.shadow.opacity ?? 1;
5779
- let b = r;
5784
+ A.save();
5785
+ const t = B.shadow;
5786
+ if (t && t.isEnabled !== !1) {
5787
+ const r = t.color || "#000000", T = this.normalizeOpacity(t.opacity ?? 100), W = t.spread || 0, n = (t.blur || 0) + W * 1.5, IA = Math.max(n * 3, Math.abs(t.offsetX || 0) + n, Math.abs(t.offsetY || 0) + n), O = Math.ceil(J + IA * 2), u = Math.ceil(R + IA * 2);
5788
+ this.shadowBuffer || (this.shadowBuffer = document.createElement("canvas")), (this.shadowBuffer.width < O || this.shadowBuffer.height < u) && (this.shadowBuffer.width = Math.max(this.shadowBuffer.width, O), this.shadowBuffer.height = Math.max(this.shadowBuffer.height, u));
5789
+ const l = this.shadowBuffer.getContext("2d", { willReadFrequently: !0 });
5790
+ l.clearRect(0, 0, O, u), l.save(), l.translate(O / 2, u / 2);
5791
+ let $ = r;
5780
5792
  if (r.startsWith("#")) {
5781
- const P = parseInt(r.slice(1, 3), 16), IA = parseInt(r.slice(3, 5), 16), m = parseInt(r.slice(5, 7), 16);
5782
- b = `rgba(${P}, ${IA}, ${m}, ${L})`;
5783
- }
5784
- A.shadowColor = b, A.shadowBlur = B.shadow.blur, A.shadowOffsetX = B.shadow.offsetX, A.shadowOffsetY = B.shadow.offsetY;
5793
+ const j = r.replace("#", ""), H = parseInt(j.substring(0, 2), 16), m = parseInt(j.substring(2, 4), 16), Z = parseInt(j.substring(4, 6), 16);
5794
+ $ = `rgba(${H}, ${m}, ${Z}, ${T})`;
5795
+ } else r.startsWith("rgba") && ($ = r.replace(/[\d.]+\)$/g, `${T})`));
5796
+ l.shadowColor = $, l.shadowBlur = n, l.shadowOffsetX = t.offsetX || 0, l.shadowOffsetY = t.offsetY || 0, l.fillStyle = "#000000", l.beginPath(), this.drawRoundRect(l, -J / 2, -R / 2, J, R, e), l.fill(), l.shadowColor = "transparent", l.shadowBlur = 0, l.globalCompositeOperation = "destination-out", l.beginPath(), this.drawRoundRect(l, -J / 2, -R / 2, J, R, e), l.fill(), l.restore(), A.drawImage(this.shadowBuffer, 0, 0, O, u, -O / 2, -u / 2, O, u);
5785
5797
  }
5786
5798
  if (A.beginPath(), this.drawRoundRect(A, -J / 2, -R / 2, J, R, e), B.fill && B.fill.type !== "None") {
5787
- const r = A.globalAlpha, L = this.createCanvasFill(A, B.fill, J, R);
5788
- A.fillStyle = L || B.fill.color || "transparent", A.globalAlpha = r * this.normalizeOpacity(B.fill.opacity ?? 100), A.fill(), A.globalAlpha = r;
5799
+ const r = A.globalAlpha, T = this.createCanvasFill(A, B.fill, J, R);
5800
+ A.fillStyle = T || B.fill.color || "transparent", A.globalAlpha = r * this.normalizeOpacity(B.fill.opacity ?? 100), A.fill(), A.globalAlpha = r;
5789
5801
  }
5790
5802
  if (A.restore(), B.stroke && B.stroke.width > 0 && B.stroke.isEnabled !== !1) {
5791
5803
  const r = { type: "Rectangle" };
@@ -5793,47 +5805,48 @@ class xC {
5793
5805
  }
5794
5806
  (I.clipsContent !== !1 || I.clipContent === !0) && I.children && I.children.length > 0 && (A.save(), A.beginPath(), this.drawRoundRect(A, -J / 2, -R / 2, J, R, e), A.clip());
5795
5807
  } else I.type === "Component" && I.variant === "inputbox" ? this.renderInputBox(A, I) : I.type === "Component" && I.variant === "button" ? this.renderButton(A, I) : I.type === "Component" && I.variant === "toggle_button" ? this.renderToggleButton(A, I) : I.type === "Toggle" || I.type === "Component" && I.variant === "toggle" ? this.renderToggle(A, I) : I.type === "Slider" || I.type === "Component" && I.variant === "slider" ? this.renderSlider(A, I) : I.type === "Dropdown" || I.type === "Component" && I.variant === "dropdown" ? this.renderDropdown(A, I) : (I.type === "ListView" || I.type === "Component" && I.variant === "listview") && this.renderListView(A, I);
5796
- const y = (I.type === "Frame" || I.type === "Group" && !I.isStructuralGroup) && (I.clipsContent !== !1 || I.clipContent === !0) && I.children && I.children.length > 0;
5808
+ const F = (I.type === "Frame" || I.type === "Group" && !I.isStructuralGroup) && (I.clipsContent !== !1 || I.clipContent === !0) && I.children && I.children.length > 0;
5797
5809
  if (I.children && I.children.length > 0) {
5798
5810
  let J = 0;
5799
5811
  for (I.children.forEach((R) => {
5800
5812
  const e = C.get(R);
5801
5813
  if (!e) return;
5802
- const Y = this.objectStates.get(R), r = (Y == null ? void 0 : Y.geometry) || e.geometry;
5803
- if (r && r.isMask && (Y == null ? void 0 : Y.visible) !== !1) {
5804
- const L = r.width || 0, b = r.height || 0;
5814
+ const t = this.objectStates.get(R), L = (t == null ? void 0 : t.geometry) || e.geometry;
5815
+ if (L && L.isMask && (t == null ? void 0 : t.visible) !== !1) {
5816
+ const r = L.width || 0, T = L.height || 0;
5805
5817
  this.applyObjectTransform(A, R);
5806
- const P = (Y == null ? void 0 : Y.corner_radius) ?? (r == null ? void 0 : r.corner_radius) ?? 0;
5807
- this.applyPath(A, r, L, b, P), A.clip(), J++;
5818
+ const W = (t == null ? void 0 : t.corner_radius) ?? (L == null ? void 0 : L.corner_radius) ?? 0;
5819
+ this.applyPath(A, L, r, T, W), A.clip(), J++;
5808
5820
  } else
5809
5821
  this.renderObject(A, e, C);
5810
5822
  }); J > 0; )
5811
5823
  A.restore(), J--;
5812
5824
  }
5813
- y && A.restore(), A.restore();
5825
+ F && A.restore(), A.restore();
5814
5826
  }
5815
5827
  applyStrokeAlignment(A, I, C, g, Q, B) {
5816
5828
  if (!I.stroke || I.stroke.width <= 0 || I.stroke.isEnabled === !1) return;
5817
- const i = A.globalAlpha, o = I.stroke.width, h = I.stroke.alignment || "center", s = I.stroke;
5818
- if (A.save(), s.fill) {
5819
- const k = this.createCanvasFill(A, s.fill, g, Q);
5820
- k ? A.strokeStyle = k : A.strokeStyle = s.color || "#000000";
5829
+ const i = I.stroke, o = i.width, h = (i.alignment || "center").toLowerCase();
5830
+ if (A.save(), i.fill) {
5831
+ const k = this.createCanvasFill(A, i.fill, g, Q);
5832
+ k ? A.strokeStyle = k : A.strokeStyle = i.color || "#000000";
5821
5833
  } else
5822
- A.strokeStyle = s.color || "#000000";
5823
- A.globalAlpha = i * this.normalizeOpacity(s.opacity ?? 100), A.lineCap = s.lineCap || "round", A.lineJoin = s.lineJoin || "round", s.miterLimit !== void 0 && (A.miterLimit = s.miterLimit);
5824
- const G = s.trimStart ?? 0, w = s.trimEnd ?? 1, a = s.trimOffset ?? 0, N = s.dashOffset ?? 0, S = s.dashArray || [];
5834
+ A.strokeStyle = i.color || "#000000";
5835
+ const s = A.globalAlpha;
5836
+ A.globalAlpha = s * this.normalizeOpacity(i.opacity ?? 100), A.lineWidth = o, A.lineCap = i.lineCap || "round", A.lineJoin = i.lineJoin || "round", i.miterLimit !== void 0 && (A.miterLimit = i.miterLimit);
5837
+ const G = i.trimStart ?? 0, w = i.trimEnd ?? 1, a = i.trimOffset ?? 0, N = i.dashOffset ?? 0, S = i.dashArray || [];
5825
5838
  if (G !== 0 || w !== 1 || a !== 0) {
5826
5839
  const k = this.getPerimeter(C, g, Q);
5827
5840
  if (k > 0) {
5828
- const y = Math.max(0, Math.min(1, G)), U = Math.max(0, Math.min(1, w));
5829
- if (y < U) {
5830
- const c = k * (U - y), t = k - c, J = -(k * (y + a % 1 + N % 1));
5831
- A.setLineDash([c, t]), A.lineDashOffset = J;
5841
+ const F = Math.max(0, Math.min(1, G)), U = Math.max(0, Math.min(1, w));
5842
+ if (F < U) {
5843
+ const c = k * (U - F), Y = k - c, J = -(k * (F + a % 1 + N % 1));
5844
+ A.setLineDash([c, Y]), A.lineDashOffset = J;
5832
5845
  } else
5833
5846
  A.setLineDash([0, k]);
5834
5847
  }
5835
5848
  } else S.length > 0 && (A.setLineDash(S), A.lineDashOffset = N);
5836
- h === "inside" ? (A.lineWidth = o * 2, this.applyPath(A, C, g, Q, B), A.clip(), A.stroke()) : h === "outside" ? (A.lineWidth = o * 2, this.applyPath(A, C, g, Q, B), A.stroke(), A.save(), A.globalCompositeOperation = "destination-out", this.applyPath(A, C, g, Q, B), A.fill(), A.restore()) : (A.lineWidth = o, this.applyPath(A, C, g, Q, B), A.stroke()), A.restore(), A.globalAlpha = i;
5849
+ h === "inside" ? (A.lineWidth = o * 2, A.save(), this.applyPath(A, C, g, Q, B), A.clip(), A.stroke(), A.restore()) : h === "outside" ? (A.lineWidth = o * 2, this.applyPath(A, C, g, Q, B), A.stroke(), A.save(), A.globalCompositeOperation = "destination-out", this.applyPath(A, C, g, Q, B), A.fill(), A.restore()) : (A.lineWidth = o, this.applyPath(A, C, g, Q, B), A.stroke()), A.restore();
5837
5850
  }
5838
5851
  getPerimeter(A, I, C) {
5839
5852
  switch (A.type) {
@@ -5908,8 +5921,8 @@ class xC {
5908
5921
  if (a === 0)
5909
5922
  A.moveTo(w.x - s, w.y - G);
5910
5923
  else {
5911
- const N = I.points[a - 1], S = (N.out_x ?? N.x) - s, k = (N.out_y ?? N.y) - G, y = (w.in_x ?? w.x) - s, U = (w.in_y ?? w.y) - G;
5912
- A.bezierCurveTo(S, k, y, U, w.x - s, w.y - G);
5924
+ const N = I.points[a - 1], S = (N.out_x ?? N.x) - s, k = (N.out_y ?? N.y) - G, F = (w.in_x ?? w.x) - s, U = (w.in_y ?? w.y) - G;
5925
+ A.bezierCurveTo(S, k, F, U, w.x - s, w.y - G);
5913
5926
  }
5914
5927
  }), I.is_closed && A.closePath();
5915
5928
  } else if (I.points && Array.isArray(I.points)) {
@@ -5935,121 +5948,121 @@ class xC {
5935
5948
  }
5936
5949
  }
5937
5950
  renderInputBox(A, I) {
5938
- var p, iA;
5939
- const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((p = I.geometry) == null ? void 0 : p.width) || 250, B = ((iA = I.geometry) == null ? void 0 : iA.height) || 45, i = this.focusedId === I.id, o = this.lastHoveredObjectId === I.id, h = g.previewState || "default", s = h !== "default" ? h : i ? "focused" : o ? "hovered" : "default", G = g.label || { visible: !0, text: "Label" }, w = g.helperText || { visible: !1, text: "Helper text" }, a = g.leftIcon || { visible: !1 }, N = g.rightIcon || { visible: !1 }, S = g.multiline === !0, k = g.corner_radius ?? 8, y = g.corners || { tl: k, tr: k, bl: k, br: k }, U = [y.tl, y.tr, y.br, y.bl];
5940
- let c = g.backgroundColor || "rgba(31, 41, 55, 1)", t = g.borderColor || "rgba(55, 65, 81, 1)", J = g.borderWidth ?? 1.5, R = g.color || "#ffffff", e = g.placeholderColor || "rgba(156, 163, 175, 1)", Y = g.fontSize || 14;
5941
- const r = `${s}Style`, L = g[r];
5942
- if (L ? (L.backgroundColor !== void 0 && (c = L.backgroundColor), L.borderColor !== void 0 && (t = L.borderColor), L.borderWidth !== void 0 && (J = L.borderWidth), L.color !== void 0 && (R = L.color), L.placeholderColor !== void 0 && (e = L.placeholderColor), L.fontSize !== void 0 && (Y = L.fontSize)) : s === "focused" ? (t = g.focusBorderColor || "rgba(59, 130, 246, 1)", J = Math.max(J, 2)) : s === "hovered" || s === "hover" ? (t = g.hoverBorderColor || t, c = g.hoverBackgroundColor || c) : s === "disabled" ? (c = g.disabledBackgroundColor || "rgba(31, 41, 55, 0.6)", t = g.disabledBorderColor || "rgba(55, 65, 81, 0.4)") : s === "error" && (t = "rgba(239, 68, 68, 1)", J = Math.max(J, 2)), A.beginPath(), this.drawRoundRect(A, -Q / 2, -B / 2, Q, B, U), A.fillStyle = c, A.fill(), J > 0 && (A.strokeStyle = t, A.lineWidth = J, A.stroke(), s === "focused" || s === "focus")) {
5951
+ var f, iA;
5952
+ const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((f = I.geometry) == null ? void 0 : f.width) || 250, B = ((iA = I.geometry) == null ? void 0 : iA.height) || 45, i = this.focusedId === I.id, o = this.lastHoveredObjectId === I.id, h = g.previewState || "default", s = h !== "default" ? h : i ? "focused" : o ? "hovered" : "default", G = g.label || { visible: !0, text: "Label" }, w = g.helperText || { visible: !1, text: "Helper text" }, a = g.leftIcon || { visible: !1 }, N = g.rightIcon || { visible: !1 }, S = g.multiline === !0, k = g.corner_radius ?? 8, F = g.corners || { tl: k, tr: k, bl: k, br: k }, U = [F.tl, F.tr, F.br, F.bl];
5953
+ let c = g.backgroundColor || "rgba(31, 41, 55, 1)", Y = g.borderColor || "rgba(55, 65, 81, 1)", J = g.borderWidth ?? 1.5, R = g.color || "#ffffff", e = g.placeholderColor || "rgba(156, 163, 175, 1)", t = g.fontSize || 14;
5954
+ const L = `${s}Style`, r = g[L];
5955
+ if (r ? (r.backgroundColor !== void 0 && (c = r.backgroundColor), r.borderColor !== void 0 && (Y = r.borderColor), r.borderWidth !== void 0 && (J = r.borderWidth), r.color !== void 0 && (R = r.color), r.placeholderColor !== void 0 && (e = r.placeholderColor), r.fontSize !== void 0 && (t = r.fontSize)) : s === "focused" ? (Y = g.focusBorderColor || "rgba(59, 130, 246, 1)", J = Math.max(J, 2)) : s === "hovered" || s === "hover" ? (Y = g.hoverBorderColor || Y, c = g.hoverBackgroundColor || c) : s === "disabled" ? (c = g.disabledBackgroundColor || "rgba(31, 41, 55, 0.6)", Y = g.disabledBorderColor || "rgba(55, 65, 81, 0.4)") : s === "error" && (Y = "rgba(239, 68, 68, 1)", J = Math.max(J, 2)), A.beginPath(), this.drawRoundRect(A, -Q / 2, -B / 2, Q, B, U), A.fillStyle = c, A.fill(), J > 0 && (A.strokeStyle = Y, A.lineWidth = J, A.stroke(), s === "focused" || s === "focus")) {
5943
5956
  A.save(), A.beginPath();
5944
- const d = U.map((l) => l + 2);
5945
- this.drawRoundRect(A, -Q / 2 - 2, -B / 2 - 2, Q + 4, B + 4, d), A.strokeStyle = "rgba(59, 130, 246, 0.3)", A.lineWidth = 2, A.stroke(), A.restore();
5957
+ const b = U.map((p) => p + 2);
5958
+ this.drawRoundRect(A, -Q / 2 - 2, -B / 2 - 2, Q + 4, B + 4, b), A.strokeStyle = "rgba(59, 130, 246, 0.3)", A.lineWidth = 2, A.stroke(), A.restore();
5946
5959
  }
5947
- const b = (d, l) => {
5948
- if (!d.visible || !d.svgPath) return;
5949
- const Z = d.size || 14, x = d.offset ?? 16, aA = d.color || "#ffffff", hA = l ? -(Q / 2) + x : Q / 2 - x, sA = d.svgPath;
5960
+ const T = (b, p) => {
5961
+ if (!b.visible || !b.svgPath) return;
5962
+ const X = b.size || 14, P = b.offset ?? 16, aA = b.color || "#ffffff", hA = p ? -(Q / 2) + P : Q / 2 - P, sA = b.svgPath;
5950
5963
  if (A.save(), A.translate(hA, 0), !sA.startsWith("<svg")) {
5951
- const oA = new Path2D(sA), NA = Z / 24;
5964
+ const oA = new Path2D(sA), NA = X / 24;
5952
5965
  A.scale(NA, NA), A.translate(-12, -12), A.fillStyle = aA, A.fill(oA);
5953
5966
  }
5954
5967
  A.restore();
5955
5968
  };
5956
- b(a, !0), b(N, !1);
5957
- const P = g.text || "", IA = g.placeholder || "Enter text...", m = !P, QA = P || IA, _ = m ? e : R, BA = Y, X = g.fontFamily || "Inter", gA = g.fontWeight || 400;
5958
- A.font = `${gA} ${BA}px "${X}", sans-serif`, A.fillStyle = _, A.textAlign = "left", A.textBaseline = S ? "top" : "middle";
5959
- const O = g.inputPadding ?? 16, q = a.visible ? (a.offset ?? 16) + (a.size || 14) / 2 + 8 : O, W = N.visible ? (N.offset ?? 16) + (N.size || 14) / 2 + 8 : O, f = -(Q / 2) + q, T = Q - q - W, V = g.inputType === "password" ? "•".repeat(QA.length) : QA;
5960
- if (A.save(), A.beginPath(), A.rect(f - 2, -B / 2 + 4, T + 4, B - 8), A.clip(), S) {
5961
- const d = V.split(`
5969
+ T(a, !0), T(N, !1);
5970
+ const W = g.text || "", V = g.placeholder || "Enter text...", n = !W, IA = W || V, O = n ? e : R, u = t, l = g.fontFamily || "Inter", $ = g.fontWeight || 400;
5971
+ A.font = `${$} ${u}px "${l}", sans-serif`, A.fillStyle = O, A.textAlign = "left", A.textBaseline = S ? "top" : "middle";
5972
+ const j = g.inputPadding ?? 16, H = a.visible ? (a.offset ?? 16) + (a.size || 14) / 2 + 8 : j, m = N.visible ? (N.offset ?? 16) + (N.size || 14) / 2 + 8 : j, Z = -(Q / 2) + H, x = Q - H - m, gA = g.inputType === "password" ? "•".repeat(IA.length) : IA;
5973
+ if (A.save(), A.beginPath(), A.rect(Z - 2, -B / 2 + 4, x + 4, B - 8), A.clip(), S) {
5974
+ const b = gA.split(`
5962
5975
  `);
5963
- let l = -B / 2 + O;
5964
- const Z = BA * 1.2;
5965
- let x = 0;
5966
- d.forEach((aA, hA) => {
5976
+ let p = -B / 2 + j;
5977
+ const X = u * 1.2;
5978
+ let P = 0;
5979
+ b.forEach((aA, hA) => {
5967
5980
  const sA = aA.split(" ");
5968
5981
  let oA = "";
5969
5982
  for (let NA = 0; NA < sA.length; NA++) {
5970
5983
  const xA = oA + sA[NA] + " ";
5971
- A.measureText(xA).width > T && NA > 0 ? (A.fillText(oA, f, l), oA = sA[NA] + " ", l += Z) : oA = xA;
5984
+ A.measureText(xA).width > x && NA > 0 ? (A.fillText(oA, Z, p), oA = sA[NA] + " ", p += X) : oA = xA;
5972
5985
  }
5973
- A.fillText(oA, f, l), x = A.measureText(oA).width, hA < d.length - 1 && (l += Z, x = 0);
5974
- }), i && !m && Math.floor(performance.now() / 500) % 2 === 0 && A.fillRect(f + x, l, 1.5, BA);
5986
+ A.fillText(oA, Z, p), P = A.measureText(oA).width, hA < b.length - 1 && (p += X, P = 0);
5987
+ }), i && !n && Math.floor(performance.now() / 500) % 2 === 0 && A.fillRect(Z + P, p, 1.5, u);
5975
5988
  } else {
5976
- const l = A.measureText(V).width;
5977
- let Z = 0;
5978
- if (l > T && (Z = l - T), A.fillText(V, f - Z, 0), i && !m && Math.floor(performance.now() / 500) % 2 === 0) {
5979
- const aA = f + l - Z;
5980
- A.fillRect(aA, -(BA / 2), 1.5, BA);
5989
+ const p = A.measureText(gA).width;
5990
+ let X = 0;
5991
+ if (p > x && (X = p - x), A.fillText(gA, Z - X, 0), i && !n && Math.floor(performance.now() / 500) % 2 === 0) {
5992
+ const aA = Z + p - X;
5993
+ A.fillRect(aA, -(u / 2), 1.5, u);
5981
5994
  }
5982
5995
  }
5983
5996
  if (A.restore(), G.visible !== !1) {
5984
- const d = G.text || "Label", l = G.fontSize || 12, Z = G.color || "rgba(156, 163, 175, 1)", x = G.offset ?? 8;
5985
- A.font = `600 ${l}px "${X}", sans-serif`, A.fillStyle = Z, A.textAlign = "left", A.textBaseline = "bottom";
5986
- const aA = -(Q / 2), hA = -(B / 2) - x;
5987
- A.fillText(d, aA, hA);
5997
+ const b = G.text || "Label", p = G.fontSize || 12, X = G.color || "rgba(156, 163, 175, 1)", P = G.offset ?? 8;
5998
+ A.font = `600 ${p}px "${l}", sans-serif`, A.fillStyle = X, A.textAlign = "left", A.textBaseline = "bottom";
5999
+ const aA = -(Q / 2), hA = -(B / 2) - P;
6000
+ A.fillText(b, aA, hA);
5988
6001
  }
5989
6002
  if (w.visible === !0) {
5990
- const d = w.text || "Helper text", l = w.fontSize || 11, Z = s === "error" ? "rgba(239, 68, 68, 1)" : w.color || "rgba(156, 163, 175, 1)", x = w.offset ?? 6;
5991
- A.font = `400 ${l}px "${X}", sans-serif`, A.fillStyle = Z, A.textAlign = "left", A.textBaseline = "top";
5992
- const aA = -(Q / 2), hA = B / 2 + x;
5993
- A.fillText(d, aA, hA);
6003
+ const b = w.text || "Helper text", p = w.fontSize || 11, X = s === "error" ? "rgba(239, 68, 68, 1)" : w.color || "rgba(156, 163, 175, 1)", P = w.offset ?? 6;
6004
+ A.font = `400 ${p}px "${l}", sans-serif`, A.fillStyle = X, A.textAlign = "left", A.textBaseline = "top";
6005
+ const aA = -(Q / 2), hA = B / 2 + P;
6006
+ A.fillText(b, aA, hA);
5994
6007
  }
5995
6008
  }
5996
6009
  renderSlider(A, I) {
5997
- const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.geometry) || I.geometry, Q = (C == null ? void 0 : C.options) || I.options || {}, B = g.width || 200, i = Q.value ?? 50, o = Q.min ?? 0, s = (Q.max ?? 100) - o, G = s === 0 ? 0 : (i - o) / s, w = Q.trackHeight || 4, a = Q.trackRoundedness ?? 2, N = Q.trackShape ?? "Rectangle", S = Q.trackPath || "", k = Q.activeColor || "#3b82f6", y = Q.inactiveColor || "#374151", U = Q.thumbShape || "Ellipse", c = Q.thumbWidth ?? 16, t = Q.thumbHeight ?? 16, J = Q.thumbRoundedness ?? 0, R = Q.thumbColor || "#ffffff", e = Q.thumbPath || "", Y = Q.thumbIcon || "", r = Q.showValueTooltip ?? !1, L = Q.tooltipBgColor || "#333333", b = Q.tooltipColor || "#ffffff", P = Q.tooltipOffsetX ?? 0, IA = Q.tooltipOffsetY ?? -25, m = (q, W, f, T, V, p, iA) => {
5998
- if ((q === "Custom" || q === "Icon") && iA)
6010
+ const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.geometry) || I.geometry, Q = (C == null ? void 0 : C.options) || I.options || {}, B = g.width || 200, i = Q.value ?? 50, o = Q.min ?? 0, s = (Q.max ?? 100) - o, G = s === 0 ? 0 : (i - o) / s, w = Q.trackHeight || 4, a = Q.trackRoundedness ?? 2, N = Q.trackShape ?? "Rectangle", S = Q.trackPath || "", k = Q.activeColor || "#3b82f6", F = Q.inactiveColor || "#374151", U = Q.thumbShape || "Ellipse", c = Q.thumbWidth ?? 16, Y = Q.thumbHeight ?? 16, J = Q.thumbRoundedness ?? 0, R = Q.thumbColor || "#ffffff", e = Q.thumbPath || "", t = Q.thumbIcon || "", L = Q.showValueTooltip ?? !1, r = Q.tooltipBgColor || "#333333", T = Q.tooltipColor || "#ffffff", W = Q.tooltipOffsetX ?? 0, V = Q.tooltipOffsetY ?? -25, n = (H, m, Z, x, gA, f, iA) => {
6011
+ if ((H === "Custom" || H === "Icon") && iA)
5999
6012
  try {
6000
- const d = new Path2D(iA);
6001
- if (A.save(), A.translate(W, f), q === "Icon") {
6002
- const l = Math.min(T, V) / 24;
6003
- A.scale(l, l), A.translate(-12, -12);
6013
+ const b = new Path2D(iA);
6014
+ if (A.save(), A.translate(m, Z), H === "Icon") {
6015
+ const p = Math.min(x, gA) / 24;
6016
+ A.scale(p, p), A.translate(-12, -12);
6004
6017
  }
6005
- A.fill(d), A.restore();
6018
+ A.fill(b), A.restore();
6006
6019
  return;
6007
- } catch (d) {
6008
- console.error("Error drawing slider shape in engine:", d);
6020
+ } catch (b) {
6021
+ console.error("Error drawing slider shape in engine:", b);
6009
6022
  }
6010
- if (A.beginPath(), q === "Ellipse")
6011
- A.ellipse(W, f, T / 2, V / 2, 0, 0, Math.PI * 2);
6012
- else if (q === "Rectangle")
6013
- this.drawRoundRect(A, W - T / 2, f - V / 2, T, V, p);
6014
- else if (q === "Triangle")
6015
- A.moveTo(W, f - V / 2), A.lineTo(W + T / 2, f + V / 2), A.lineTo(W - T / 2, f + V / 2), A.closePath();
6016
- else if (q === "Diamond")
6017
- A.moveTo(W, f - V / 2), A.lineTo(W + T / 2, f), A.lineTo(W, f + V / 2), A.lineTo(W - T / 2, f), A.closePath();
6018
- else if (q === "Star") {
6019
- const l = Math.min(T, V) / 2, Z = l / 2;
6020
- for (let x = 0; x < 5 * 2; x++) {
6021
- const aA = x % 2 === 0 ? l : Z, hA = x * Math.PI / 5 - Math.PI / 2;
6022
- A.lineTo(W + aA * Math.cos(hA), f + aA * Math.sin(hA));
6023
+ if (A.beginPath(), H === "Ellipse")
6024
+ A.ellipse(m, Z, x / 2, gA / 2, 0, 0, Math.PI * 2);
6025
+ else if (H === "Rectangle")
6026
+ this.drawRoundRect(A, m - x / 2, Z - gA / 2, x, gA, f);
6027
+ else if (H === "Triangle")
6028
+ A.moveTo(m, Z - gA / 2), A.lineTo(m + x / 2, Z + gA / 2), A.lineTo(m - x / 2, Z + gA / 2), A.closePath();
6029
+ else if (H === "Diamond")
6030
+ A.moveTo(m, Z - gA / 2), A.lineTo(m + x / 2, Z), A.lineTo(m, Z + gA / 2), A.lineTo(m - x / 2, Z), A.closePath();
6031
+ else if (H === "Star") {
6032
+ const p = Math.min(x, gA) / 2, X = p / 2;
6033
+ for (let P = 0; P < 5 * 2; P++) {
6034
+ const aA = P % 2 === 0 ? p : X, hA = P * Math.PI / 5 - Math.PI / 2;
6035
+ A.lineTo(m + aA * Math.cos(hA), Z + aA * Math.sin(hA));
6023
6036
  }
6024
6037
  A.closePath();
6025
- } else q === "Line" && (A.moveTo(W - T / 2, f), A.lineTo(W + T / 2, f));
6038
+ } else H === "Line" && (A.moveTo(m - x / 2, Z), A.lineTo(m + x / 2, Z));
6026
6039
  A.fill();
6027
6040
  };
6028
- A.fillStyle = y, N === "Line" ? (A.strokeStyle = y, A.lineWidth = w, A.beginPath(), A.moveTo(-B / 2, 0), A.lineTo(B / 2, 0), A.stroke()) : m(N, 0, 0, B, w, a, S);
6029
- const QA = B - c, _ = -B / 2 + c / 2 + G * QA, BA = _ - -B / 2;
6030
- if (BA > 0 && (A.fillStyle = k, N === "Line" ? (A.strokeStyle = k, A.lineWidth = w, A.beginPath(), A.moveTo(-B / 2, 0), A.lineTo(_, 0), A.stroke()) : N === "Rectangle" && (A.beginPath(), this.drawRoundRect(A, -B / 2, -w / 2, BA, w, a), A.fill())), A.save(), A.translate(_, 0), A.shadowColor = "rgba(0,0,0,0.2)", A.shadowBlur = 4, A.shadowOffsetY = 1, A.fillStyle = R, m(U, 0, 0, c, t, J, U === "Icon" ? Y : e), A.restore(), r) {
6031
- A.save(), A.translate(_ + P, IA);
6032
- const q = Math.round(i).toString();
6041
+ A.fillStyle = F, N === "Line" ? (A.strokeStyle = F, A.lineWidth = w, A.beginPath(), A.moveTo(-B / 2, 0), A.lineTo(B / 2, 0), A.stroke()) : n(N, 0, 0, B, w, a, S);
6042
+ const IA = B - c, O = -B / 2 + c / 2 + G * IA, u = O - -B / 2;
6043
+ if (u > 0 && (A.fillStyle = k, N === "Line" ? (A.strokeStyle = k, A.lineWidth = w, A.beginPath(), A.moveTo(-B / 2, 0), A.lineTo(O, 0), A.stroke()) : N === "Rectangle" && (A.beginPath(), this.drawRoundRect(A, -B / 2, -w / 2, u, w, a), A.fill())), A.save(), A.translate(O, 0), A.shadowColor = "rgba(0,0,0,0.2)", A.shadowBlur = 4, A.shadowOffsetY = 1, A.fillStyle = R, n(U, 0, 0, c, Y, J, U === "Icon" ? t : e), A.restore(), L) {
6044
+ A.save(), A.translate(O + W, V);
6045
+ const H = Math.round(i).toString();
6033
6046
  A.font = "10px Inter, sans-serif";
6034
- const W = A.measureText(q), f = 6, T = 4, V = W.width + f * 2, p = 14 + T;
6035
- A.beginPath(), this.drawRoundRect(A, -V / 2, -p / 2, V, p, 4), A.fillStyle = L, A.fill(), A.fillStyle = b, A.textAlign = "center", A.textBaseline = "middle", A.fillText(q, 0, 0), A.restore();
6047
+ const m = A.measureText(H), Z = 6, x = 4, gA = m.width + Z * 2, f = 14 + x;
6048
+ A.beginPath(), this.drawRoundRect(A, -gA / 2, -f / 2, gA, f, 4), A.fillStyle = r, A.fill(), A.fillStyle = T, A.textAlign = "center", A.textBaseline = "middle", A.fillText(H, 0, 0), A.restore();
6036
6049
  }
6037
- const X = Q.label || {}, gA = Q.helperText || {}, O = Q.fontFamily || "Inter";
6038
- if (X.visible !== !1) {
6039
- const q = X.text || "Label", W = X.fontSize || 12, f = X.color || "rgba(156, 163, 175, 1)", T = X.offset ?? 8;
6040
- A.font = `600 ${W}px "${O}", sans-serif`, A.fillStyle = f, A.textAlign = "left", A.textBaseline = "bottom";
6041
- const V = -(B / 2), p = -(w / 2) - T;
6042
- A.fillText(q, V, p);
6050
+ const l = Q.label || {}, $ = Q.helperText || {}, j = Q.fontFamily || "Inter";
6051
+ if (l.visible !== !1) {
6052
+ const H = l.text || "Label", m = l.fontSize || 12, Z = l.color || "rgba(156, 163, 175, 1)", x = l.offset ?? 8;
6053
+ A.font = `600 ${m}px "${j}", sans-serif`, A.fillStyle = Z, A.textAlign = "left", A.textBaseline = "bottom";
6054
+ const gA = -(B / 2), f = -(w / 2) - x;
6055
+ A.fillText(H, gA, f);
6043
6056
  }
6044
- if (gA.visible === !0) {
6045
- const q = gA.text || "Helper text", W = gA.fontSize || 11, f = gA.color || "rgba(156, 163, 175, 1)", T = gA.offset ?? 6;
6046
- A.font = `400 ${W}px "${O}", sans-serif`, A.fillStyle = f, A.textAlign = "left", A.textBaseline = "top";
6047
- const V = -(B / 2), p = w / 2 + T;
6048
- A.fillText(q, V, p);
6057
+ if ($.visible === !0) {
6058
+ const H = $.text || "Helper text", m = $.fontSize || 11, Z = $.color || "rgba(156, 163, 175, 1)", x = $.offset ?? 6;
6059
+ A.font = `400 ${m}px "${j}", sans-serif`, A.fillStyle = Z, A.textAlign = "left", A.textBaseline = "top";
6060
+ const gA = -(B / 2), f = w / 2 + x;
6061
+ A.fillText(H, gA, f);
6049
6062
  }
6050
6063
  }
6051
6064
  renderDropdown(A, I) {
6052
- var IA;
6065
+ var V;
6053
6066
  const C = this.objectStates.get(I.id);
6054
6067
  if (!C) return;
6055
6068
  const g = C.options || I.options || {}, Q = I.geometry.width || 160, B = I.geometry.height || 40, i = -Q / 2, o = -B / 2, h = g.corner_radius ?? 6, s = g.disabled || g.previewState === "disabled", G = this.lastHoveredObjectId === I.id || g.previewState === "hover", w = (g.isOpen || g.previewState === "active") && !s;
@@ -6057,70 +6070,70 @@ class xC {
6057
6070
  s ? (a = g.disabledBackgroundColor || "#f3f4f6", N = g.disabledBorderColor || "#e5e7eb", S = g.disabledColor || "#9ca3af") : w ? (a = g.activeBackgroundColor || a, N = g.activeBorderColor || N, S = g.activeColor || S) : G && (a = g.hoverBackgroundColor || a, N = g.hoverBorderColor || N, S = g.hoverColor || S), a || (a = "#ffffff"), N || (N = "#e5e7eb");
6058
6071
  const k = A.globalAlpha;
6059
6072
  A.globalAlpha = k * (g.opacity ?? 1), this.drawRoundRect(A, i, o, Q, B, h), A.fillStyle = this.createCanvasFill(A, typeof a == "string" ? { type: "Solid", color: a } : a, Q, B) || "#ffffff", A.fill();
6060
- const y = g.borderWidth ?? 1;
6061
- y > 0 && (A.strokeStyle = this.createCanvasFill(A, typeof N == "string" ? { type: "Solid", color: N } : N, Q, B) || "#e5e7eb", A.lineWidth = y, A.stroke());
6062
- const U = 12, c = g.chevronType || "chevron", t = g.chevronSize || 16, J = (w ? g.openIconColor : g.closedIconColor) || g.chevronColor || "#6b7280";
6073
+ const F = g.borderWidth ?? 1;
6074
+ F > 0 && (A.strokeStyle = this.createCanvasFill(A, typeof N == "string" ? { type: "Solid", color: N } : N, Q, B) || "#e5e7eb", A.lineWidth = F, A.stroke());
6075
+ const U = 12, c = g.chevronType || "chevron", Y = g.chevronSize || 16, J = (w ? g.openIconColor : g.closedIconColor) || g.chevronColor || "#6b7280";
6063
6076
  if (c !== "none") {
6064
- const m = i + Q - U - t / 2;
6065
- A.save(), A.translate(m, 0);
6066
- const QA = w ? g.openIconAngle ?? 180 : g.closedIconAngle ?? 0;
6067
- if (A.rotate(QA * Math.PI / 180), A.strokeStyle = J, A.fillStyle = J, A.lineWidth = 1.5, A.lineCap = "round", A.lineJoin = "round", c === "chevron")
6068
- A.beginPath(), A.moveTo(-t / 2, -t * 0.2), A.lineTo(0, t * 0.2), A.lineTo(t / 2, -t * 0.2), A.stroke();
6077
+ const n = i + Q - U - Y / 2;
6078
+ A.save(), A.translate(n, 0);
6079
+ const IA = w ? g.openIconAngle ?? 180 : g.closedIconAngle ?? 0;
6080
+ if (A.rotate(IA * Math.PI / 180), A.strokeStyle = J, A.fillStyle = J, A.lineWidth = 1.5, A.lineCap = "round", A.lineJoin = "round", c === "chevron")
6081
+ A.beginPath(), A.moveTo(-Y / 2, -Y * 0.2), A.lineTo(0, Y * 0.2), A.lineTo(Y / 2, -Y * 0.2), A.stroke();
6069
6082
  else if (c === "custom" || c === "path") {
6070
- const _ = w && g.openIconPath || g.closedIconPath;
6071
- if (_) {
6072
- const BA = new Path2D(_);
6083
+ const O = w && g.openIconPath || g.closedIconPath;
6084
+ if (O) {
6085
+ const u = new Path2D(O);
6073
6086
  A.save();
6074
- const X = t / 24;
6075
- A.scale(X, X), A.translate(-12, -12), A.fill(BA), A.restore();
6087
+ const l = Y / 24;
6088
+ A.scale(l, l), A.translate(-12, -12), A.fill(u), A.restore();
6076
6089
  }
6077
6090
  }
6078
6091
  A.restore();
6079
6092
  }
6080
- const R = g.selectedOption || g.placeholder || "Select...", e = g.fontSize || 14, Y = g.fontWeight || 400, r = g.fontFamily || "Inter, sans-serif";
6081
- A.font = `${Y} ${e}px ${r}`;
6082
- const L = s ? g.disabledColor || "#9ca3af" : !g.selectedOption && g.placeholder ? "#9ca3af" : S;
6083
- A.fillStyle = this.createCanvasFill(A, typeof L == "string" ? { type: "Solid", color: L } : L, Q, B) || "#333333", A.textAlign = "left", A.textBaseline = "middle";
6084
- const b = c === "none" ? 0 : t + 8, P = Q - U * 2 - b;
6085
- if (A.save(), A.beginPath(), A.rect(i + U, o, P, B), A.clip(), A.fillText(R, i + U, 0), A.restore(), w && !s) {
6086
- const m = o + B + 4, QA = g.optionsList || [], _ = g.itemHeight || 32, BA = g.listPadding ?? 4, X = QA.length * _ + BA * 2, gA = g.listCornerRadius ?? h;
6093
+ const R = g.selectedOption || g.placeholder || "Select...", e = g.fontSize || 14, t = g.fontWeight || 400, L = g.fontFamily || "Inter, sans-serif";
6094
+ A.font = `${t} ${e}px ${L}`;
6095
+ const r = s ? g.disabledColor || "#9ca3af" : !g.selectedOption && g.placeholder ? "#9ca3af" : S;
6096
+ A.fillStyle = this.createCanvasFill(A, typeof r == "string" ? { type: "Solid", color: r } : r, Q, B) || "#333333", A.textAlign = "left", A.textBaseline = "middle";
6097
+ const T = c === "none" ? 0 : Y + 8, W = Q - U * 2 - T;
6098
+ if (A.save(), A.beginPath(), A.rect(i + U, o, W, B), A.clip(), A.fillText(R, i + U, 0), A.restore(), w && !s) {
6099
+ const n = o + B + 4, IA = g.optionsList || [], O = g.itemHeight || 32, u = g.listPadding ?? 4, l = IA.length * O + u * 2, $ = g.listCornerRadius ?? h;
6087
6100
  A.save();
6088
- const O = g.listShadow || {};
6089
- A.shadowColor = typeof O.color == "string" ? O.color : ((IA = O.color) == null ? void 0 : IA.color) || "rgba(0,0,0,0.15)", A.shadowBlur = O.blur ?? 12, A.shadowOffsetY = O.offsetY ?? 6, A.beginPath(), this.drawRoundRect(A, i, m, Q, X, gA), A.fillStyle = this.createCanvasFill(A, typeof g.listBackgroundColor == "string" ? { type: "Solid", color: g.listBackgroundColor } : g.listBackgroundColor || { type: "Solid", color: "#ffffff" }, Q, X) || "#ffffff", A.fill();
6090
- const q = g.listBorderWidth ?? 1;
6091
- q > 0 && (A.shadowColor = "transparent", A.strokeStyle = this.createCanvasFill(A, typeof g.listBorderColor == "string" ? { type: "Solid", color: g.listBorderColor } : g.listBorderColor || { type: "Solid", color: N }, Q, X) || "#e5e7eb", A.lineWidth = q, A.stroke()), A.restore();
6092
- const W = g.itemFontSize || e, f = g.itemFontFamily || r;
6093
- A.font = `${Y} ${W}px ${f}`, QA.forEach((T, V) => {
6094
- const p = m + BA + V * _;
6095
- if (T === g.selectedOption)
6096
- A.fillStyle = this.createCanvasFill(A, typeof g.itemSelectedBackgroundColor == "string" ? { type: "Solid", color: g.itemSelectedBackgroundColor } : g.itemSelectedBackgroundColor || { type: "Solid", color: "#f3f4f6" }, Q, _) || "#f3f4f6", A.fillRect(i + q, p, Q - q * 2, _), A.fillStyle = g.itemSelectedColor || g.activeColor || S || "#374151";
6101
+ const j = g.listShadow || {};
6102
+ A.shadowColor = typeof j.color == "string" ? j.color : ((V = j.color) == null ? void 0 : V.color) || "rgba(0,0,0,0.15)", A.shadowBlur = j.blur ?? 12, A.shadowOffsetY = j.offsetY ?? 6, A.beginPath(), this.drawRoundRect(A, i, n, Q, l, $), A.fillStyle = this.createCanvasFill(A, typeof g.listBackgroundColor == "string" ? { type: "Solid", color: g.listBackgroundColor } : g.listBackgroundColor || { type: "Solid", color: "#ffffff" }, Q, l) || "#ffffff", A.fill();
6103
+ const H = g.listBorderWidth ?? 1;
6104
+ H > 0 && (A.shadowColor = "transparent", A.strokeStyle = this.createCanvasFill(A, typeof g.listBorderColor == "string" ? { type: "Solid", color: g.listBorderColor } : g.listBorderColor || { type: "Solid", color: N }, Q, l) || "#e5e7eb", A.lineWidth = H, A.stroke()), A.restore();
6105
+ const m = g.itemFontSize || e, Z = g.itemFontFamily || L;
6106
+ A.font = `${t} ${m}px ${Z}`, IA.forEach((x, gA) => {
6107
+ const f = n + u + gA * O;
6108
+ if (x === g.selectedOption)
6109
+ A.fillStyle = this.createCanvasFill(A, typeof g.itemSelectedBackgroundColor == "string" ? { type: "Solid", color: g.itemSelectedBackgroundColor } : g.itemSelectedBackgroundColor || { type: "Solid", color: "#f3f4f6" }, Q, O) || "#f3f4f6", A.fillRect(i + H, f, Q - H * 2, O), A.fillStyle = g.itemSelectedColor || g.activeColor || S || "#374151";
6097
6110
  else if (A.fillStyle = g.listTextColor || S || "#333333", this.activeDropdownId === I.id && this._lastPointerPos) {
6098
- const d = this._lastPointerPos.y - (m + BA), l = Math.floor(d / _);
6099
- V === l && (A.fillStyle = this.createCanvasFill(A, typeof g.itemHoverBackgroundColor == "string" ? { type: "Solid", color: g.itemHoverBackgroundColor } : g.itemHoverBackgroundColor || { type: "Solid", color: "#f9fafb" }, Q, _) || "#f9fafb", A.fillRect(i + q, p, Q - q * 2, _), A.fillStyle = g.itemHoverColor || S);
6111
+ const b = this._lastPointerPos.y - (n + u), p = Math.floor(b / O);
6112
+ gA === p && (A.fillStyle = this.createCanvasFill(A, typeof g.itemHoverBackgroundColor == "string" ? { type: "Solid", color: g.itemHoverBackgroundColor } : g.itemHoverBackgroundColor || { type: "Solid", color: "#f9fafb" }, Q, O) || "#f9fafb", A.fillRect(i + H, f, Q - H * 2, O), A.fillStyle = g.itemHoverColor || S);
6100
6113
  }
6101
- A.fillText(T, i + U, p + _ / 2);
6114
+ A.fillText(x, i + U, f + O / 2);
6102
6115
  });
6103
6116
  }
6104
6117
  A.globalAlpha = k;
6105
6118
  }
6106
6119
  renderButton(A, I) {
6107
- var c, t, J, R;
6108
- const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((c = I.geometry) == null ? void 0 : c.width) || 120, B = ((t = I.geometry) == null ? void 0 : t.height) || 40, i = -Q / 2, o = -B / 2, h = this.lastHoveredObjectId === I.id, s = g.corner_radius ?? 8, G = g.bgShape || "Rectangle", w = h ? ((J = g.hoverStyle) == null ? void 0 : J.backgroundColor) || g.buttonBgColor || "#3b82f6" : g.buttonBgColor || "#3b82f6", a = g.label || {}, N = h ? ((R = g.hoverStyle) == null ? void 0 : R.textColor) || a.color || "#ffffff" : a.color || "#ffffff", S = g.icon || { enabled: !1 };
6120
+ var c, Y, J, R;
6121
+ const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((c = I.geometry) == null ? void 0 : c.width) || 120, B = ((Y = I.geometry) == null ? void 0 : Y.height) || 40, i = -Q / 2, o = -B / 2, h = this.lastHoveredObjectId === I.id, s = g.corner_radius ?? 8, G = g.bgShape || "Rectangle", w = h ? ((J = g.hoverStyle) == null ? void 0 : J.backgroundColor) || g.buttonBgColor || "#3b82f6" : g.buttonBgColor || "#3b82f6", a = g.label || {}, N = h ? ((R = g.hoverStyle) == null ? void 0 : R.textColor) || a.color || "#ffffff" : a.color || "#ffffff", S = g.icon || { enabled: !1 };
6109
6122
  A.save(), A.beginPath(), G === "Rectangle" ? this.drawRoundRect(A, i, o, Q, B, s) : G === "Ellipse" || G === "Circle" ? A.ellipse(0, 0, Q / 2, B / 2, 0, 0, Math.PI * 2) : G === "Pill" && this.drawRoundRect(A, i, o, Q, B, B / 2), A.fillStyle = w, A.fill();
6110
- const k = a.fontSize || 14, y = a.fontFamily || "Inter";
6111
- A.font = `${a.fontWeight || 400} ${k}px "${y}", sans-serif`, A.fillStyle = N, A.textAlign = "center", A.textBaseline = "middle";
6123
+ const k = a.fontSize || 14, F = a.fontFamily || "Inter";
6124
+ A.font = `${a.fontWeight || 400} ${k}px "${F}", sans-serif`, A.fillStyle = N, A.textAlign = "center", A.textBaseline = "middle";
6112
6125
  let U = 0;
6113
6126
  if (S.enabled && S.svgPath) {
6114
- const e = S.size || 16, Y = S.gap || 8, r = S.position === "left" ? -(A.measureText(a.text || "").width / 2 + e / 2 + Y / 2) : A.measureText(a.text || "").width / 2 + e / 2 + Y / 2;
6115
- A.save(), A.translate(r, 0);
6116
- const L = new Path2D(S.svgPath), b = e / 24;
6117
- A.scale(b, b), A.translate(-12, -12), A.fillStyle = S.color || N, A.fill(L), A.restore(), U = S.position === "left" ? e / 2 + Y / 2 : -(e / 2 + Y / 2);
6127
+ const e = S.size || 16, t = S.gap || 8, L = S.position === "left" ? -(A.measureText(a.text || "").width / 2 + e / 2 + t / 2) : A.measureText(a.text || "").width / 2 + e / 2 + t / 2;
6128
+ A.save(), A.translate(L, 0);
6129
+ const r = new Path2D(S.svgPath), T = e / 24;
6130
+ A.scale(T, T), A.translate(-12, -12), A.fillStyle = S.color || N, A.fill(r), A.restore(), U = S.position === "left" ? e / 2 + t / 2 : -(e / 2 + t / 2);
6118
6131
  }
6119
6132
  A.fillText(a.text || "Button", U, 0), A.restore();
6120
6133
  }
6121
6134
  renderToggleButton(A, I) {
6122
- var k, y;
6123
- const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = g.checked ?? !1, B = ((k = I.geometry) == null ? void 0 : k.width) || 120, i = ((y = I.geometry) == null ? void 0 : y.height) || 40, o = -B / 2, h = -i / 2, s = g.corner_radius ?? 8, G = g.label || {}, w = Q ? g.activeColor || "#3b82f6" : g.inactiveColor || "#374151", a = Q ? g.activeTextColor || "#ffffff" : g.inactiveTextColor || "#9ca3af";
6135
+ var k, F;
6136
+ const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = g.checked ?? !1, B = ((k = I.geometry) == null ? void 0 : k.width) || 120, i = ((F = I.geometry) == null ? void 0 : F.height) || 40, o = -B / 2, h = -i / 2, s = g.corner_radius ?? 8, G = g.label || {}, w = Q ? g.activeColor || "#3b82f6" : g.inactiveColor || "#374151", a = Q ? g.activeTextColor || "#ffffff" : g.inactiveTextColor || "#9ca3af";
6124
6137
  A.save(), A.beginPath(), this.drawRoundRect(A, o, h, B, i, s), A.fillStyle = w, A.fill();
6125
6138
  const N = G.fontSize || 14, S = G.fontFamily || "Inter";
6126
6139
  A.font = `${G.fontWeight || 600} ${N}px "${S}", sans-serif`, A.fillStyle = a, A.textAlign = "center", A.textBaseline = "middle", A.fillText(G.text || "Toggle", 0, 0), A.restore();
@@ -6129,13 +6142,13 @@ class xC {
6129
6142
  var U, c;
6130
6143
  const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((U = I.geometry) == null ? void 0 : U.width) || 52, B = ((c = I.geometry) == null ? void 0 : c.height) || 30, i = -Q / 2, o = -B / 2, h = g.checked ?? !1, s = g.corner_radius ?? B / 2;
6131
6144
  A.beginPath(), this.drawRoundRect(A, i, o, Q, B, s), A.fillStyle = h ? g.activeColor || "#10b981" : g.inactiveColor || "#374151", g.disabled && (A.globalAlpha *= 0.5), A.fill();
6132
- const G = 3, w = B - G * 2, a = w / 2, N = i + G, S = i + Q - G - w, k = h ? S : N, y = o + G;
6133
- if (A.beginPath(), A.arc(k + a, y + a, a, 0, Math.PI * 2), A.fillStyle = g.knobColor || "#ffffff", A.fill(), g.disabled && (A.globalAlpha *= 2), g.label && g.label.text) {
6134
- const t = g.label, J = t.fontSize || 14, R = t.fontWeight || 400, e = t.fontFamily || "Inter";
6135
- A.font = `${R} ${J}px "${e}", sans-serif`, A.fillStyle = t.color || "#f3f4f6", A.textBaseline = "middle";
6136
- const Y = t.gap || 10;
6137
- let r = 0, L = 0;
6138
- t.position === "left" ? (A.textAlign = "right", r = i - Y, L = 0) : t.position === "right" ? (A.textAlign = "left", r = i + Q + Y, L = 0) : t.position === "top" ? (A.textAlign = "center", r = 0, L = o - Y, A.textBaseline = "bottom") : t.position === "bottom" ? (A.textAlign = "center", r = 0, L = o + B + Y, A.textBaseline = "top") : (A.textAlign = "left", r = i + Q + Y, L = 0), A.fillText(t.text, r, L);
6145
+ const G = 3, w = B - G * 2, a = w / 2, N = i + G, S = i + Q - G - w, k = h ? S : N, F = o + G;
6146
+ if (A.beginPath(), A.arc(k + a, F + a, a, 0, Math.PI * 2), A.fillStyle = g.knobColor || "#ffffff", A.fill(), g.disabled && (A.globalAlpha *= 2), g.label && g.label.text) {
6147
+ const Y = g.label, J = Y.fontSize || 14, R = Y.fontWeight || 400, e = Y.fontFamily || "Inter";
6148
+ A.font = `${R} ${J}px "${e}", sans-serif`, A.fillStyle = Y.color || "#f3f4f6", A.textBaseline = "middle";
6149
+ const t = Y.gap || 10;
6150
+ let L = 0, r = 0;
6151
+ Y.position === "left" ? (A.textAlign = "right", L = i - t, r = 0) : Y.position === "right" ? (A.textAlign = "left", L = i + Q + t, r = 0) : Y.position === "top" ? (A.textAlign = "center", L = 0, r = o - t, A.textBaseline = "bottom") : Y.position === "bottom" ? (A.textAlign = "center", L = 0, r = o + B + t, A.textBaseline = "top") : (A.textAlign = "left", L = i + Q + t, r = 0), A.fillText(Y.text, L, r);
6139
6152
  }
6140
6153
  }
6141
6154
  renderLineGraph(A, I, C, g) {
@@ -6162,16 +6175,16 @@ class xC {
6162
6175
  if (Q.forEach((S) => {
6163
6176
  let k = S.data;
6164
6177
  if (S.isVarEnabled && S.inputId) {
6165
- let y = this.inputs.get(S.inputId);
6166
- if (y === void 0) {
6178
+ let F = this.inputs.get(S.inputId);
6179
+ if (F === void 0) {
6167
6180
  const U = this.inputNameMap.get(S.inputId);
6168
- U && U.length > 0 && (y = this.inputs.get(U[0]));
6181
+ U && U.length > 0 && (F = this.inputs.get(U[0]));
6169
6182
  }
6170
- y && Array.isArray(y) && (k = y);
6183
+ F && Array.isArray(F) && (k = F);
6171
6184
  }
6172
6185
  if (k && k.length > 0) {
6173
- const y = k.filter((U) => typeof U == "number" && !isNaN(U));
6174
- y.length > 0 && (B = Math.min(B, ...y), i = Math.max(i, ...y), o = Math.max(o, k.length));
6186
+ const F = k.filter((U) => typeof U == "number" && !isNaN(U));
6187
+ F.length > 0 && (B = Math.min(B, ...F), i = Math.max(i, ...F), o = Math.max(o, k.length));
6175
6188
  }
6176
6189
  S._resolvedData = k;
6177
6190
  }), o < 2) return;
@@ -6198,40 +6211,40 @@ class xC {
6198
6211
  if (S.showArea) {
6199
6212
  if (A.beginPath(), A.moveTo(w(0), g / 2), A.lineTo(w(0), G(k[0])), S.smoothing && k.length > 2)
6200
6213
  for (let U = 0; U < k.length - 1; U++) {
6201
- const c = k[U === 0 ? U : U - 1], t = k[U], J = k[U + 1], R = k[U + 1 === k.length - 1 ? U + 1 : U + 2];
6214
+ const c = k[U === 0 ? U : U - 1], Y = k[U], J = k[U + 1], R = k[U + 1 === k.length - 1 ? U + 1 : U + 2];
6202
6215
  for (let e = 1; e <= N; e++) {
6203
- const Y = e / N, r = this._catmullRom(c, t, J, R, Y);
6204
- A.lineTo(w(U + Y), G(r));
6216
+ const t = e / N, L = this._catmullRom(c, Y, J, R, t);
6217
+ A.lineTo(w(U + t), G(L));
6205
6218
  }
6206
6219
  }
6207
6220
  else
6208
6221
  for (let U = 1; U < k.length; U++)
6209
6222
  A.lineTo(w(U), G(k[U]));
6210
6223
  A.lineTo(w(k.length - 1), g / 2), A.closePath();
6211
- const y = A.globalAlpha;
6212
- A.globalAlpha = y * (I.areaOpacity ?? 0.3), A.fillStyle = S.areaColor || "rgba(139, 92, 246, 0.2)", A.fill(), A.globalAlpha = y;
6224
+ const F = A.globalAlpha;
6225
+ A.globalAlpha = F * (I.areaOpacity ?? 0.3), A.fillStyle = S.areaColor || "rgba(139, 92, 246, 0.2)", A.fill(), A.globalAlpha = F;
6213
6226
  }
6214
6227
  if (A.beginPath(), A.strokeStyle = S.lineColor || "#3b82f6", A.lineWidth = S.lineWidth || 2, A.lineJoin = "round", A.lineCap = "round", A.moveTo(w(0), G(k[0])), S.smoothing && k.length > 2)
6215
- for (let y = 0; y < k.length - 1; y++) {
6216
- const U = k[y === 0 ? y : y - 1], c = k[y], t = k[y + 1], J = k[y + 1 === k.length - 1 ? y + 1 : y + 2];
6228
+ for (let F = 0; F < k.length - 1; F++) {
6229
+ const U = k[F === 0 ? F : F - 1], c = k[F], Y = k[F + 1], J = k[F + 1 === k.length - 1 ? F + 1 : F + 2];
6217
6230
  for (let R = 1; R <= N; R++) {
6218
- const e = R / N, Y = this._catmullRom(U, c, t, J, e);
6219
- A.lineTo(w(y + e), G(Y));
6231
+ const e = R / N, t = this._catmullRom(U, c, Y, J, e);
6232
+ A.lineTo(w(F + e), G(t));
6220
6233
  }
6221
6234
  }
6222
6235
  else
6223
- for (let y = 1; y < k.length; y++)
6224
- A.lineTo(w(y), G(k[y]));
6225
- A.stroke(), S.showPoints && k.forEach((y, U) => {
6226
- const c = w(U), t = G(y);
6227
- A.beginPath(), A.arc(c, t, (S.pointSize || 6) / 2, 0, Math.PI * 2), A.fillStyle = S.pointFill || "#ffffff", A.fill(), A.strokeStyle = S.pointStrokeColor || S.lineColor || "#3b82f6", A.lineWidth = S.pointStrokeWidth || 1, A.stroke();
6236
+ for (let F = 1; F < k.length; F++)
6237
+ A.lineTo(w(F), G(k[F]));
6238
+ A.stroke(), S.showPoints && k.forEach((F, U) => {
6239
+ const c = w(U), Y = G(F);
6240
+ A.beginPath(), A.arc(c, Y, (S.pointSize || 6) / 2, 0, Math.PI * 2), A.fillStyle = S.pointFill || "#ffffff", A.fill(), A.strokeStyle = S.pointStrokeColor || S.lineColor || "#3b82f6", A.lineWidth = S.pointStrokeWidth || 1, A.stroke();
6228
6241
  });
6229
6242
  }
6230
6243
  }), I.showLegend && Q.length > 0) {
6231
6244
  const S = C / 2 - 10;
6232
6245
  let k = -g / 2 + 15;
6233
- const y = I.legendFontSize || 10, U = y + 5;
6234
- A.font = `${y}px Inter, sans-serif`, A.textAlign = "right", A.textBaseline = "alphabetic", Q.forEach((c) => {
6246
+ const F = I.legendFontSize || 10, U = F + 5;
6247
+ A.font = `${F}px Inter, sans-serif`, A.textAlign = "right", A.textBaseline = "alphabetic", Q.forEach((c) => {
6235
6248
  const J = c.label || "Series", R = A.measureText(J).width;
6236
6249
  A.beginPath(), A.rect(S - R - 8 - 5, k - (8 / 2 + 2), 8, 8), A.fillStyle = c.lineColor || "#3b82f6", A.fill(), A.fillStyle = I.legendColor || "#333333", A.fillText(J, S, k), k += U;
6237
6250
  });
@@ -6252,11 +6265,11 @@ class xC {
6252
6265
  return I.color;
6253
6266
  if ((I.type === "LinearGradient" || I.type === "RadialGradient" || I.type === "AngularGradient" || I.type === "DiamondGradient") && I.stops) {
6254
6267
  const B = (i, o = 100) => {
6255
- var k, y;
6256
- const s = (((y = (k = this.artboard) == null ? void 0 : k.tokens) == null ? void 0 : y.colors) || {})[i] || i, G = this.normalizeOpacity(o);
6257
- if (G >= 1 && s.startsWith("#")) return s;
6258
- const w = s.startsWith("#") ? s.replace("#", "") : "ffffff", a = parseInt(w.substring(0, 2), 16), N = parseInt(w.substring(2, 4), 16), S = parseInt(w.substring(4, 6), 16);
6259
- return `rgba(${a}, ${N}, ${S}, ${G})`;
6268
+ var U, c;
6269
+ const s = (((c = (U = this.artboard) == null ? void 0 : U.tokens) == null ? void 0 : c.colors) || {})[i] || i, G = this.normalizeOpacity(I.opacity ?? 100), a = this.normalizeOpacity(o) * G;
6270
+ if (a >= 1 && s.startsWith("#")) return s;
6271
+ const N = s.startsWith("#") ? s.replace("#", "") : "ffffff", S = parseInt(N.substring(0, 2), 16), k = parseInt(N.substring(2, 4), 16), F = parseInt(N.substring(4, 6), 16);
6272
+ return `rgba(${S}, ${k}, ${F}, ${a})`;
6260
6273
  };
6261
6274
  if (I.type === "LinearGradient") {
6262
6275
  const i = (a, N, S) => Array.isArray(a) ? a[N] ?? (N === 0 ? 0 : 1) : a && typeof a == "object" ? a[S] ?? (N === 0 ? 0 : 1) : N === 0 ? 0 : 1, o = i(I.start, 0, "x") * C - C / 2, h = i(I.start, 1, "y") * g - g / 2, s = i(I.end, 0, "x") * C - C / 2, G = i(I.end, 1, "y") * g - g / 2, w = A.createLinearGradient(o, h, s, G);
@@ -6264,8 +6277,8 @@ class xC {
6264
6277
  const N = a.offset !== void 0 ? a.offset : a.pos !== void 0 ? a.pos : a.position !== void 0 ? a.position : 0, S = B(a.color || "#000000", a.opacity ?? 100);
6265
6278
  w.addColorStop(Math.max(0, Math.min(1, N)), S);
6266
6279
  }), I.gradientTransform && w.setTransform) {
6267
- const [a, N, S, k, y, U] = I.gradientTransform;
6268
- w.setTransform({ a, b: N, c: S, d: k, e: y, f: U });
6280
+ const [a, N, S, k, F, U] = I.gradientTransform;
6281
+ w.setTransform({ a, b: N, c: S, d: k, e: F, f: U });
6269
6282
  }
6270
6283
  return w;
6271
6284
  } else if (I.type === "RadialGradient") {
@@ -6274,8 +6287,8 @@ class xC {
6274
6287
  const a = w.offset !== void 0 ? w.offset : w.pos !== void 0 ? w.pos : w.position !== void 0 ? w.position : 0, N = B(w.color || "#000000", w.opacity ?? 100);
6275
6288
  G.addColorStop(Math.max(0, Math.min(1, a)), N);
6276
6289
  }), I.gradientTransform && G.setTransform) {
6277
- const [w, a, N, S, k, y] = I.gradientTransform;
6278
- G.setTransform({ a: w, b: a, c: N, d: S, e: k, f: y });
6290
+ const [w, a, N, S, k, F] = I.gradientTransform;
6291
+ G.setTransform({ a: w, b: a, c: N, d: S, e: k, f: F });
6279
6292
  }
6280
6293
  return G;
6281
6294
  } else if (I.type === "AngularGradient") {
@@ -6285,21 +6298,23 @@ class xC {
6285
6298
  const a = w.offset !== void 0 ? w.offset : w.pos !== void 0 ? w.pos : w.position !== void 0 ? w.position : 0, N = B(w.color || "#000000", w.opacity ?? 100);
6286
6299
  G.addColorStop(Math.max(0, Math.min(1, a)), N);
6287
6300
  }), I.gradientTransform && G.setTransform) {
6288
- const [w, a, N, S, k, y] = I.gradientTransform;
6289
- G.setTransform({ a: w, b: a, c: N, d: S, e: k, f: y });
6301
+ const [w, a, N, S, k, F] = I.gradientTransform;
6302
+ G.setTransform({ a: w, b: a, c: N, d: S, e: k, f: F });
6290
6303
  }
6291
6304
  return G;
6292
6305
  }
6293
6306
  } else if (I.type === "DiamondGradient") {
6294
- const i = (w, a, N) => Array.isArray(w) ? w[a] ?? 0.5 : w && typeof w == "object" ? w[N] ?? 0.5 : 0.5, o = i(I.center || [0.5, 0.5], 0, "x") * C - C / 2, h = i(I.center || [0.5, 0.5], 1, "y") * g - g / 2, s = (I.radius ?? 0.5) * Math.max(C, g), G = A.createRadialGradient(o, h, 0, o, h, s);
6307
+ const i = (w, a, N) => Array.isArray(w) ? w[a] ?? 0.5 : w && typeof w == "object" ? w[N] ?? 0.5 : 0.5, o = i(I.center || [0.5, 0.5], 0, "x") * C - C / 2, h = i(I.center || [0.5, 0.5], 1, "y") * g - g / 2, s = (I.radius ?? 0.5) * Math.max(C, g);
6308
+ A.save(), A.translate(o, h), A.rotate(Math.PI / 4);
6309
+ const G = A.createRadialGradient(0, 0, 0, 0, 0, s);
6295
6310
  if (I.stops.forEach((w) => {
6296
6311
  const a = w.offset !== void 0 ? w.offset : w.pos !== void 0 ? w.pos : w.position !== void 0 ? w.position : 0, N = B(w.color || "#000000", w.opacity ?? 100);
6297
6312
  G.addColorStop(Math.max(0, Math.min(1, a)), N);
6298
6313
  }), I.gradientTransform && G.setTransform) {
6299
- const [w, a, N, S, k, y] = I.gradientTransform;
6300
- G.setTransform({ a: w, b: a, c: N, d: S, e: k, f: y });
6314
+ const [w, a, N, S, k, F] = I.gradientTransform;
6315
+ G.setTransform({ a: w, b: a, c: N, d: S, e: k, f: F });
6301
6316
  }
6302
- return G;
6317
+ return A.scale(1 / Math.SQRT2, 1 / Math.SQRT2), A.fillStyle = G, A.restore(), G;
6303
6318
  }
6304
6319
  }
6305
6320
  if (I.type === "Pattern" && I.url) {
@@ -6337,58 +6352,58 @@ class xC {
6337
6352
  A.moveTo(I + o, C), A.lineTo(I + g - h, C), A.arcTo(I + g, C, I + g, C + h, h), A.lineTo(I + g, C + Q - s), A.arcTo(I + g, C + Q, I + g - s, C + Q, s), A.lineTo(I + G, C + Q), A.arcTo(I, C + Q, I, C + Q - G, G), A.lineTo(I, C + o), A.arcTo(I, C, I + o, C, o), A.closePath();
6338
6353
  }
6339
6354
  renderListView(A, I) {
6340
- var m, QA, _, BA;
6341
- const C = this.objectStates.get(I.id) || {}, g = C.options || I.options || {}, Q = C.width !== void 0 ? C.width : ((m = I.geometry) == null ? void 0 : m.width) || 200, B = C.height !== void 0 ? C.height : ((QA = I.geometry) == null ? void 0 : QA.height) || 300, i = -Q / 2, o = -B / 2, h = C.corner_radius !== void 0 ? C.corner_radius : g.corner_radius ?? 0, s = g.orientation || "vertical", G = g.items || [], w = g.itemGap ?? 10, a = g.itemHeight ?? 50, N = g.itemWidth ?? 200, S = g.scrollOffset ?? 0, k = g.padding ?? 0, y = g.glassEffect !== !1, U = g.accentColor || "#3b82f6", c = g.itemTextColor || "#333333", t = g.itemBackgroundColor || "#ffffff", J = g.hoveredIndex ?? null, R = g.activeItemIndex ?? null, e = g.glowIntensity ?? 0, Y = g.glowColor || "#3b82f6", r = typeof Y == "string" ? Y : Y.color || ((BA = (_ = Y.stops) == null ? void 0 : _[0]) == null ? void 0 : BA.color) || "#3b82f6", L = g.opacity !== void 0 ? g.opacity : I.opacity !== void 0 ? I.opacity : 1;
6342
- if (A.save(), A.globalAlpha *= L, e > 0 && (A.shadowColor = r, A.shadowBlur = e * 2, A.shadowOffsetX = 0, A.shadowOffsetY = 0), y) {
6343
- const X = g.listBackgroundColor || "rgba(31, 41, 55, 0.4)", gA = this.createCanvasFill(A, X, Q, B);
6344
- A.fillStyle = gA || "rgba(31, 41, 55, 0.4)", this.drawListViewRect(A, i, o, Q, B, h), A.fill();
6345
- const O = A.createLinearGradient(i, o, i + Q, o + B);
6346
- O.addColorStop(0, "rgba(255, 255, 255, 0.15)"), O.addColorStop(0.5, "rgba(255, 255, 255, 0.08)"), O.addColorStop(1, "rgba(255, 255, 255, 0.03)"), A.fillStyle = O, this.drawListViewRect(A, i, o, Q, B, h), A.fill(), A.strokeStyle = "rgba(255, 255, 255, 0.25)", A.lineWidth = 1, this.drawListViewRect(A, i, o, Q, B, h), A.stroke();
6355
+ var n, IA, O, u;
6356
+ const C = this.objectStates.get(I.id) || {}, g = C.options || I.options || {}, Q = C.width !== void 0 ? C.width : ((n = I.geometry) == null ? void 0 : n.width) || 200, B = C.height !== void 0 ? C.height : ((IA = I.geometry) == null ? void 0 : IA.height) || 300, i = -Q / 2, o = -B / 2, h = C.corner_radius !== void 0 ? C.corner_radius : g.corner_radius ?? 0, s = g.orientation || "vertical", G = g.items || [], w = g.itemGap ?? 10, a = g.itemHeight ?? 50, N = g.itemWidth ?? 200, S = g.scrollOffset ?? 0, k = g.padding ?? 0, F = g.glassEffect !== !1, U = g.accentColor || "#3b82f6", c = g.itemTextColor || "#333333", Y = g.itemBackgroundColor || "#ffffff", J = g.hoveredIndex ?? null, R = g.activeItemIndex ?? null, e = g.glowIntensity ?? 0, t = g.glowColor || "#3b82f6", L = typeof t == "string" ? t : t.color || ((u = (O = t.stops) == null ? void 0 : O[0]) == null ? void 0 : u.color) || "#3b82f6", r = g.opacity !== void 0 ? g.opacity : I.opacity !== void 0 ? I.opacity : 1;
6357
+ if (A.save(), A.globalAlpha *= r, e > 0 && (A.shadowColor = L, A.shadowBlur = e * 2, A.shadowOffsetX = 0, A.shadowOffsetY = 0), F) {
6358
+ const l = g.listBackgroundColor || "rgba(31, 41, 55, 0.4)", $ = this.createCanvasFill(A, l, Q, B);
6359
+ A.fillStyle = $ || "rgba(31, 41, 55, 0.4)", this.drawListViewRect(A, i, o, Q, B, h), A.fill();
6360
+ const j = A.createLinearGradient(i, o, i + Q, o + B);
6361
+ j.addColorStop(0, "rgba(255, 255, 255, 0.15)"), j.addColorStop(0.5, "rgba(255, 255, 255, 0.08)"), j.addColorStop(1, "rgba(255, 255, 255, 0.03)"), A.fillStyle = j, this.drawListViewRect(A, i, o, Q, B, h), A.fill(), A.strokeStyle = "rgba(255, 255, 255, 0.25)", A.lineWidth = 1, this.drawListViewRect(A, i, o, Q, B, h), A.stroke();
6347
6362
  } else {
6348
- const X = g.listBackgroundColor || "transparent", gA = this.createCanvasFill(A, X, Q, B);
6349
- gA && (A.fillStyle = gA, this.drawListViewRect(A, i, o, Q, B, h), A.fill());
6350
- const O = g.borderWidth ?? 0;
6351
- O > 0 && (A.strokeStyle = g.borderColor || "#cccccc", A.lineWidth = O, this.drawListViewRect(A, i, o, Q, B, h), A.stroke());
6363
+ const l = g.listBackgroundColor || "transparent", $ = this.createCanvasFill(A, l, Q, B);
6364
+ $ && (A.fillStyle = $, this.drawListViewRect(A, i, o, Q, B, h), A.fill());
6365
+ const j = g.borderWidth ?? 0;
6366
+ j > 0 && (A.strokeStyle = g.borderColor || "#cccccc", A.lineWidth = j, this.drawListViewRect(A, i, o, Q, B, h), A.stroke());
6352
6367
  }
6353
6368
  A.shadowBlur = 0, A.save(), this.drawListViewRect(A, i, o, Q, B, h), A.clip();
6354
- const b = typeof k == "number" ? k : s === "vertical" ? k[0] : k[3];
6355
- let P = (s === "vertical" ? o : i) + S + b;
6356
- if (A.textBaseline = "middle", G.forEach((X, gA) => {
6357
- const O = s === "vertical" ? Q : N, q = s === "vertical" ? a : B, W = s === "vertical" ? i : P, f = s === "vertical" ? P : o, T = J === gA, V = R === gA;
6358
- if (V) {
6359
- const Z = this.createCanvasFill(A, U, O, q);
6360
- A.fillStyle = Z || U;
6361
- const x = A.globalAlpha;
6362
- A.globalAlpha = x * 0.8, A.fillRect(W, f, O, q), A.globalAlpha = x;
6363
- } else if (T)
6364
- A.fillStyle = y ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.05)", A.fillRect(W, f, O, q);
6365
- else if (t !== "transparent") {
6366
- const Z = this.createCanvasFill(A, t, O, q);
6367
- A.fillStyle = Z || t, A.fillRect(W, f, O, q);
6369
+ const T = typeof k == "number" ? k : s === "vertical" ? k[0] : k[3];
6370
+ let W = (s === "vertical" ? o : i) + S + T;
6371
+ if (A.textBaseline = "middle", G.forEach((l, $) => {
6372
+ const j = s === "vertical" ? Q : N, H = s === "vertical" ? a : B, m = s === "vertical" ? i : W, Z = s === "vertical" ? W : o, x = J === $, gA = R === $;
6373
+ if (gA) {
6374
+ const X = this.createCanvasFill(A, U, j, H);
6375
+ A.fillStyle = X || U;
6376
+ const P = A.globalAlpha;
6377
+ A.globalAlpha = P * 0.8, A.fillRect(m, Z, j, H), A.globalAlpha = P;
6378
+ } else if (x)
6379
+ A.fillStyle = F ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.05)", A.fillRect(m, Z, j, H);
6380
+ else if (Y !== "transparent") {
6381
+ const X = this.createCanvasFill(A, Y, j, H);
6382
+ A.fillStyle = X || Y, A.fillRect(m, Z, j, H);
6368
6383
  }
6369
- if (V || T) {
6370
- const Z = this.createCanvasFill(A, U, s === "vertical" ? 3 : O, s === "vertical" ? q : 3);
6371
- A.fillStyle = Z || U, s === "vertical" ? A.fillRect(W, f, 3, q) : A.fillRect(W, f + q - 3, O, 3);
6384
+ if (gA || x) {
6385
+ const X = this.createCanvasFill(A, U, s === "vertical" ? 3 : j, s === "vertical" ? H : 3);
6386
+ A.fillStyle = X || U, s === "vertical" ? A.fillRect(m, Z, 3, H) : A.fillRect(m, Z + H - 3, j, 3);
6372
6387
  }
6373
- const p = V ? "#ffffff" : y ? "rgba(255, 255, 255, 0.9)" : c;
6374
- A.fillStyle = p, A.font = V || T ? "600 14px Inter, sans-serif" : "400 14px Inter, sans-serif";
6375
- const iA = typeof X == "string" ? X : (X == null ? void 0 : X.label) || `Item ${gA + 1}`, d = W + (s === "vertical" ? 16 : O / 2), l = f + q / 2;
6376
- s === "horizontal" ? A.textAlign = "center" : A.textAlign = "left", A.fillText(iA, d, l), P += (s === "vertical" ? a : N) + w;
6388
+ const f = gA ? "#ffffff" : F ? "rgba(255, 255, 255, 0.9)" : c;
6389
+ A.fillStyle = f, A.font = gA || x ? "600 14px Inter, sans-serif" : "400 14px Inter, sans-serif";
6390
+ const iA = typeof l == "string" ? l : (l == null ? void 0 : l.label) || `Item ${$ + 1}`, b = m + (s === "vertical" ? 16 : j / 2), p = Z + H / 2;
6391
+ s === "horizontal" ? A.textAlign = "center" : A.textAlign = "left", A.fillText(iA, b, p), W += (s === "vertical" ? a : N) + w;
6377
6392
  }), A.restore(), g.showScrollbar !== !1) {
6378
- const X = (G.length || 0) * (s === "vertical" ? a : N) + ((G.length || 0) - 1) * w, gA = s === "vertical" ? B : Q;
6379
- if (X > gA) {
6380
- const O = gA / X, q = gA * O, W = -S / X * gA, f = g.scrollbarColor || "rgba(255,255,255,0.3)", T = g.scrollbarWidth || 4;
6381
- A.fillStyle = f, s === "vertical" ? A.fillRect(i + Q - T - 2, o + W, T, q) : A.fillRect(i + W, o + B - T - 2, q, T);
6393
+ const l = (G.length || 0) * (s === "vertical" ? a : N) + ((G.length || 0) - 1) * w, $ = s === "vertical" ? B : Q;
6394
+ if (l > $) {
6395
+ const j = $ / l, H = $ * j, m = -S / l * $, Z = g.scrollbarColor || "rgba(255,255,255,0.3)", x = g.scrollbarWidth || 4;
6396
+ A.fillStyle = Z, s === "vertical" ? A.fillRect(i + Q - x - 2, o + m, x, H) : A.fillRect(i + m, o + B - x - 2, H, x);
6382
6397
  }
6383
6398
  }
6384
6399
  A.restore();
6385
6400
  }
6386
6401
  updateListViewScrollFromPointer(A) {
6387
- var k, y;
6402
+ var k, F;
6388
6403
  if (!this._lastPointerPos || !this._prevPointerPos) return;
6389
6404
  const I = A.options || {}, C = I.orientation || "vertical", g = this._lastPointerPos.x - this._prevPointerPos.x, Q = this._lastPointerPos.y - this._prevPointerPos.y;
6390
6405
  C === "vertical" ? I.scrollOffset = (I.scrollOffset || 0) + Q : I.scrollOffset = (I.scrollOffset || 0) + g;
6391
- const B = this.objectStates.get(A.id) || {}, i = I.items || [], o = I.itemGap ?? 10, h = I.itemHeight ?? 50, s = I.itemWidth ?? 200, G = B.width !== void 0 ? B.width : ((k = A.geometry) == null ? void 0 : k.width) || 200, w = B.height !== void 0 ? B.height : ((y = A.geometry) == null ? void 0 : y.height) || 300, a = (i.length || 0) * (C === "vertical" ? h : s) + ((i.length || 0) - 1) * o, S = Math.max(0, a - (C === "vertical" ? w : G) + (I.padding * 2 || 0));
6406
+ const B = this.objectStates.get(A.id) || {}, i = I.items || [], o = I.itemGap ?? 10, h = I.itemHeight ?? 50, s = I.itemWidth ?? 200, G = B.width !== void 0 ? B.width : ((k = A.geometry) == null ? void 0 : k.width) || 200, w = B.height !== void 0 ? B.height : ((F = A.geometry) == null ? void 0 : F.height) || 300, a = (i.length || 0) * (C === "vertical" ? h : s) + ((i.length || 0) - 1) * o, S = Math.max(0, a - (C === "vertical" ? w : G) + (I.padding * 2 || 0));
6392
6407
  I.scrollOffset > 0 && (I.scrollOffset = 0), I.scrollOffset < -S && (I.scrollOffset = -S);
6393
6408
  }
6394
6409
  updateListViewHoverFromPointer(A, I, C) {
@@ -6396,16 +6411,16 @@ class xC {
6396
6411
  Q.hoveredIndex !== g && (Q.hoveredIndex = g);
6397
6412
  }
6398
6413
  getListViewItemIndexAtPointer(A, I, C) {
6399
- var b, P;
6414
+ var T, W;
6400
6415
  const g = A.options || {}, Q = this.objectStates.get(A.id) || {}, B = g.items || [];
6401
6416
  if (B.length === 0) return null;
6402
- const i = Q.width !== void 0 ? Q.width : ((b = A.geometry) == null ? void 0 : b.width) || 200, o = Q.height !== void 0 ? Q.height : ((P = A.geometry) == null ? void 0 : P.height) || 300, h = g.orientation || "vertical", s = g.itemGap ?? 10, G = g.itemHeight ?? 50, w = g.itemWidth ?? 200, a = g.scrollOffset ?? 0, N = g.padding ?? 0, S = this.getWorldTransform(A.id), k = I - S.x, y = C - S.y, U = -S.rotation * (Math.PI / 180), c = Math.cos(U), t = Math.sin(U), J = k * c - y * t, R = k * t + y * c, e = -i / 2, Y = -o / 2, r = typeof N == "number" ? N : h === "vertical" ? N[0] : N[3];
6403
- let L = (h === "vertical" ? Y : e) + a + r;
6404
- for (let IA = 0; IA < B.length; IA++) {
6405
- const m = h === "vertical" ? i : w, QA = h === "vertical" ? G : o, _ = h === "vertical" ? e : L, BA = h === "vertical" ? L : Y;
6406
- if (J >= _ && J <= _ + m && R >= BA && R <= BA + QA)
6407
- return IA;
6408
- L += (h === "vertical" ? G : w) + s;
6417
+ const i = Q.width !== void 0 ? Q.width : ((T = A.geometry) == null ? void 0 : T.width) || 200, o = Q.height !== void 0 ? Q.height : ((W = A.geometry) == null ? void 0 : W.height) || 300, h = g.orientation || "vertical", s = g.itemGap ?? 10, G = g.itemHeight ?? 50, w = g.itemWidth ?? 200, a = g.scrollOffset ?? 0, N = g.padding ?? 0, S = this.getWorldTransform(A.id), k = I - S.x, F = C - S.y, U = -S.rotation * (Math.PI / 180), c = Math.cos(U), Y = Math.sin(U), J = k * c - F * Y, R = k * Y + F * c, e = -i / 2, t = -o / 2, L = typeof N == "number" ? N : h === "vertical" ? N[0] : N[3];
6418
+ let r = (h === "vertical" ? t : e) + a + L;
6419
+ for (let V = 0; V < B.length; V++) {
6420
+ const n = h === "vertical" ? i : w, IA = h === "vertical" ? G : o, O = h === "vertical" ? e : r, u = h === "vertical" ? r : t;
6421
+ if (J >= O && J <= O + n && R >= u && R <= u + IA)
6422
+ return V;
6423
+ r += (h === "vertical" ? G : w) + s;
6409
6424
  }
6410
6425
  return null;
6411
6426
  }
@@ -6431,55 +6446,55 @@ const PC = RC(
6431
6446
  onInputFocus: a,
6432
6447
  onInputBlur: N
6433
6448
  }, S) => {
6434
- const k = wI(null), y = wI(new xC()), U = wI(), c = wI(0);
6449
+ const k = wI(null), F = wI(new xC()), U = wI(), c = wI(0);
6435
6450
  tC(S, () => k.current), eA(() => {
6436
- console.log("[ExodeUI] Layout Effect - Component Updated/Mounted"), y.current.setLayout(Q, B);
6451
+ console.log("[ExodeUI] Layout Effect - Component Updated/Mounted"), F.current.setLayout(Q, B);
6437
6452
  }, [Q, B]), eA(() => {
6438
- o && y.current.setTriggerCallback(o);
6453
+ o && F.current.setTriggerCallback(o);
6439
6454
  }, [o]), eA(() => {
6440
- h && y.current.setInputUpdateCallback(h);
6455
+ h && F.current.setInputUpdateCallback(h);
6441
6456
  }, [h]), eA(() => {
6442
- s && y.current.setComponentChangeCallback(s);
6457
+ s && F.current.setComponentChangeCallback(s);
6443
6458
  }, [s]), eA(() => {
6444
- G && y.current.setToggleCallback(G);
6459
+ G && F.current.setToggleCallback(G);
6445
6460
  }, [G]), eA(() => {
6446
- w && y.current.setInputChangeCallback(w);
6461
+ w && F.current.setInputChangeCallback(w);
6447
6462
  }, [w]), eA(() => {
6448
- a && y.current.setInputFocusCallback(a);
6463
+ a && F.current.setInputFocusCallback(a);
6449
6464
  }, [a]), eA(() => {
6450
- N && y.current.setInputBlurCallback(N);
6465
+ N && F.current.setInputBlurCallback(N);
6451
6466
  }, [N]), eA(() => {
6452
6467
  (async () => {
6453
- const R = y.current;
6468
+ const R = F.current;
6454
6469
  let e = D;
6455
6470
  if (!e && A)
6456
6471
  try {
6457
6472
  e = await (await fetch(A)).json();
6458
- } catch (Y) {
6459
- console.error("Failed to load ExodeUI animation:", Y);
6473
+ } catch (t) {
6474
+ console.error("Failed to load ExodeUI animation:", t);
6460
6475
  return;
6461
6476
  }
6462
6477
  e && (R.load(e), i && i(R));
6463
6478
  })();
6464
6479
  }, [D, A]), eA(() => {
6465
- const J = y.current, R = k.current;
6480
+ const J = F.current, R = k.current;
6466
6481
  if (!R) return;
6467
6482
  const e = R.getContext("2d");
6468
6483
  if (!e) return;
6469
- const Y = (r) => {
6470
- c.current || (c.current = r);
6471
- const L = (r - c.current) / 1e3;
6472
- c.current = r, g && J.advance(L);
6473
- const b = window.devicePixelRatio || 1, P = R.getBoundingClientRect(), IA = Math.floor(P.width * b), m = Math.floor(P.height * b);
6474
- (R.width !== IA || R.height !== m) && (R.width = IA, R.height = m), J.render(e, IA, m), U.current = requestAnimationFrame(Y);
6484
+ const t = (L) => {
6485
+ c.current || (c.current = L);
6486
+ const r = (L - c.current) / 1e3;
6487
+ c.current = L, g && J.advance(r);
6488
+ const T = window.devicePixelRatio || 1, W = R.getBoundingClientRect(), V = Math.floor(W.width * T), n = Math.floor(W.height * T);
6489
+ (R.width !== V || R.height !== n) && (R.width = V, R.height = n), J.render(e, V, n), U.current = requestAnimationFrame(t);
6475
6490
  };
6476
- return U.current = requestAnimationFrame(Y), () => {
6491
+ return U.current = requestAnimationFrame(t), () => {
6477
6492
  U.current && cancelAnimationFrame(U.current);
6478
6493
  };
6479
6494
  }, [g]);
6480
- const t = (J, R) => {
6481
- const e = J.currentTarget.getBoundingClientRect(), Y = J.clientX - e.left, r = J.clientY - e.top, L = e.width, b = e.height;
6482
- y.current.handlePointerInput(R, Y, r, L, b);
6495
+ const Y = (J, R) => {
6496
+ const e = J.currentTarget.getBoundingClientRect(), t = J.clientX - e.left, L = J.clientY - e.top, r = e.width, T = e.height;
6497
+ F.current.handlePointerInput(R, t, L, r, T);
6483
6498
  };
6484
6499
  return /* @__PURE__ */ UC(
6485
6500
  "canvas",
@@ -6490,14 +6505,14 @@ const PC = RC(
6490
6505
  tabIndex: 0,
6491
6506
  onPointerDown: (J) => {
6492
6507
  var R;
6493
- t(J, "down"), (R = k.current) == null || R.focus();
6508
+ Y(J, "down"), (R = k.current) == null || R.focus();
6494
6509
  },
6495
- onPointerUp: (J) => t(J, "up"),
6496
- onPointerMove: (J) => t(J, "move"),
6497
- onPointerLeave: (J) => t(J, "blur"),
6498
- onClick: (J) => t(J, "click"),
6510
+ onPointerUp: (J) => Y(J, "up"),
6511
+ onPointerMove: (J) => Y(J, "move"),
6512
+ onPointerLeave: (J) => Y(J, "blur"),
6513
+ onClick: (J) => Y(J, "click"),
6499
6514
  onKeyDown: (J) => {
6500
- J.key === "Backspace" || J.key === "Enter" || J.key, y.current.handleKeyDown(J.nativeEvent);
6515
+ J.key === "Backspace" || J.key === "Enter" || J.key, F.current.handleKeyDown(J.nativeEvent);
6501
6516
  }
6502
6517
  }
6503
6518
  );