exodeui 2.6.16 → 2.6.18

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,12 +1,12 @@
1
1
  var NC = Object.defineProperty;
2
2
  var kC = (i, A, I) => A in i ? NC(i, A, { enumerable: !0, configurable: !0, writable: !0, value: I }) : i[A] = I;
3
- var _ = (i, A, I) => kC(i, typeof A != "symbol" ? A + "" : A, I);
3
+ var V = (i, A, I) => kC(i, typeof A != "symbol" ? A + "" : A, I);
4
4
  import { jsx as yC } from "react/jsx-runtime";
5
- import { forwardRef as FC, useRef as DI, useImperativeHandle as MC, useEffect as jA, useState as JC, useCallback as uA } from "react";
6
- var UC = /* @__PURE__ */ ((i) => (i.Equal = "Equal", i.NotEqual = "NotEqual", i.GreaterThan = "GreaterThan", i.LessThan = "LessThan", i.GreaterEqual = "GreaterEqual", i.LessEqual = "LessEqual", i.IsTrue = "IsTrue", i.IsFalse = "IsFalse", i))(UC || {}), PA = /* @__PURE__ */ ((i) => (i.AND = "AND", i.OR = "OR", i.NOT = "NOT", i.XOR = "XOR", i))(PA || {});
5
+ import { forwardRef as FC, useRef as DI, useImperativeHandle as MC, useEffect as jA, useState as JC, useCallback as xA } from "react";
6
+ var UC = /* @__PURE__ */ ((i) => (i.Equal = "Equal", i.NotEqual = "NotEqual", i.GreaterThan = "GreaterThan", i.LessThan = "LessThan", i.GreaterEqual = "GreaterEqual", i.LessEqual = "LessEqual", i.IsTrue = "IsTrue", i.IsFalse = "IsFalse", i))(UC || {}), VA = /* @__PURE__ */ ((i) => (i.AND = "AND", i.OR = "OR", i.NOT = "NOT", i.XOR = "XOR", i))(VA || {});
7
7
  let B;
8
8
  const f = new Array(128).fill(void 0);
9
- function H(i) {
9
+ function p(i) {
10
10
  return f[i];
11
11
  }
12
12
  f.push(void 0, null, !0, !1);
@@ -27,9 +27,9 @@ const Tg = typeof TextDecoder < "u" ? new TextDecoder("utf-8", { ignoreBOM: !0,
27
27
  throw Error("TextDecoder not available");
28
28
  } };
29
29
  typeof TextDecoder < "u" && Tg.decode();
30
- let VA = null;
30
+ let PA = null;
31
31
  function fI(i, A) {
32
- return i >>>= 0, Tg.decode((VA !== null && VA.byteLength !== 0 || (VA = new Uint8Array(B.memory.buffer)), VA).subarray(i, i + A));
32
+ return i >>>= 0, Tg.decode((PA !== null && PA.byteLength !== 0 || (PA = new Uint8Array(B.memory.buffer)), PA).subarray(i, i + A));
33
33
  }
34
34
  function Y(i) {
35
35
  return i == null;
@@ -39,7 +39,7 @@ function wA() {
39
39
  return (fA === null || fA.buffer.detached === !0 || fA.buffer.detached === void 0 && fA.buffer !== B.memory.buffer) && (fA = new DataView(B.memory.buffer)), fA;
40
40
  }
41
41
  function wI(i) {
42
- const A = H(i);
42
+ const A = p(i);
43
43
  return function(I) {
44
44
  I < 132 || (f[I] = AI, AI = I);
45
45
  }(i), A;
@@ -97,85 +97,85 @@ class dA {
97
97
  const A = B.rawbroadphase_new();
98
98
  return this.__wbg_ptr = A >>> 0, YI.register(this, this.__wbg_ptr, this), this;
99
99
  }
100
- castRay(A, I, g, C, Q, E, D, o, w, h, G, S) {
100
+ castRay(A, I, g, C, Q, E, D, o, w, G, h, K) {
101
101
  try {
102
- s(A, DA), s(I, P), s(g, gA), s(C, N), s(Q, N);
103
- const K = B.rawbroadphase_castRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E, D, o, Y(w) ? 4294967297 : w >>> 0, !Y(h), Y(h) ? 0 : h, !Y(G), Y(G) ? 0 : G, $(S));
104
- return K === 0 ? void 0 : _I.__wrap(K);
102
+ s(A, DA), s(I, P), s(g, gA), s(C, a), s(Q, a);
103
+ const N = B.rawbroadphase_castRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E, D, o, Y(w) ? 4294967297 : w >>> 0, !Y(G), Y(G) ? 0 : G, !Y(h), Y(h) ? 0 : h, $(K));
104
+ return N === 0 ? void 0 : _I.__wrap(N);
105
105
  } finally {
106
106
  f[X++] = void 0;
107
107
  }
108
108
  }
109
- castRayAndGetNormal(A, I, g, C, Q, E, D, o, w, h, G, S) {
109
+ castRayAndGetNormal(A, I, g, C, Q, E, D, o, w, G, h, K) {
110
110
  try {
111
- s(A, DA), s(I, P), s(g, gA), s(C, N), s(Q, N);
112
- const K = B.rawbroadphase_castRayAndGetNormal(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E, D, o, Y(w) ? 4294967297 : w >>> 0, !Y(h), Y(h) ? 0 : h, !Y(G), Y(G) ? 0 : G, $(S));
113
- return K === 0 ? void 0 : FI.__wrap(K);
111
+ s(A, DA), s(I, P), s(g, gA), s(C, a), s(Q, a);
112
+ const N = B.rawbroadphase_castRayAndGetNormal(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E, D, o, Y(w) ? 4294967297 : w >>> 0, !Y(G), Y(G) ? 0 : G, !Y(h), Y(h) ? 0 : h, $(K));
113
+ return N === 0 ? void 0 : FI.__wrap(N);
114
114
  } finally {
115
115
  f[X++] = void 0;
116
116
  }
117
117
  }
118
- intersectionsWithRay(A, I, g, C, Q, E, D, o, w, h, G, S, K) {
118
+ intersectionsWithRay(A, I, g, C, Q, E, D, o, w, G, h, K, N) {
119
119
  try {
120
- s(A, DA), s(I, P), s(g, gA), s(C, N), s(Q, N), B.rawbroadphase_intersectionsWithRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E, D, $(o), w, Y(h) ? 4294967297 : h >>> 0, !Y(G), Y(G) ? 0 : G, !Y(S), Y(S) ? 0 : S, $(K));
120
+ s(A, DA), s(I, P), s(g, gA), s(C, a), s(Q, a), B.rawbroadphase_intersectionsWithRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E, D, $(o), w, Y(G) ? 4294967297 : G >>> 0, !Y(h), Y(h) ? 0 : h, !Y(K), Y(K) ? 0 : K, $(N));
121
121
  } finally {
122
122
  f[X++] = void 0, f[X++] = void 0;
123
123
  }
124
124
  }
125
- intersectionWithShape(A, I, g, C, Q, E, D, o, w, h, G) {
125
+ intersectionWithShape(A, I, g, C, Q, E, D, o, w, G, h) {
126
126
  try {
127
127
  const M = B.__wbindgen_add_to_stack_pointer(-16);
128
- s(A, DA), s(I, P), s(g, gA), s(C, N), s(Q, b), s(E, e), B.rawbroadphase_intersectionWithShape(M, this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D, Y(o) ? 4294967297 : o >>> 0, !Y(w), Y(w) ? 0 : w, !Y(h), Y(h) ? 0 : h, $(G));
129
- var S = wA().getInt32(M + 0, !0), K = wA().getFloat64(M + 8, !0);
130
- return S === 0 ? void 0 : K;
128
+ s(A, DA), s(I, P), s(g, gA), s(C, a), s(Q, b), s(E, r), B.rawbroadphase_intersectionWithShape(M, this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D, Y(o) ? 4294967297 : o >>> 0, !Y(w), Y(w) ? 0 : w, !Y(G), Y(G) ? 0 : G, $(h));
129
+ var K = wA().getInt32(M + 0, !0), N = wA().getFloat64(M + 8, !0);
130
+ return K === 0 ? void 0 : N;
131
131
  } finally {
132
132
  B.__wbindgen_add_to_stack_pointer(16), f[X++] = void 0;
133
133
  }
134
134
  }
135
- projectPoint(A, I, g, C, Q, E, D, o, w, h) {
135
+ projectPoint(A, I, g, C, Q, E, D, o, w, G) {
136
136
  try {
137
- s(A, DA), s(I, P), s(g, gA), s(C, N);
138
- const G = B.rawbroadphase_projectPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q, E, Y(D) ? 4294967297 : D >>> 0, !Y(o), Y(o) ? 0 : o, !Y(w), Y(w) ? 0 : w, $(h));
139
- return G === 0 ? void 0 : GI.__wrap(G);
137
+ s(A, DA), s(I, P), s(g, gA), s(C, a);
138
+ const h = B.rawbroadphase_projectPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q, E, Y(D) ? 4294967297 : D >>> 0, !Y(o), Y(o) ? 0 : o, !Y(w), Y(w) ? 0 : w, $(G));
139
+ return h === 0 ? void 0 : GI.__wrap(h);
140
140
  } finally {
141
141
  f[X++] = void 0;
142
142
  }
143
143
  }
144
144
  projectPointAndGetFeature(A, I, g, C, Q, E, D, o, w) {
145
145
  try {
146
- s(A, DA), s(I, P), s(g, gA), s(C, N);
147
- const h = B.rawbroadphase_projectPointAndGetFeature(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q, Y(E) ? 4294967297 : E >>> 0, !Y(D), Y(D) ? 0 : D, !Y(o), Y(o) ? 0 : o, $(w));
148
- return h === 0 ? void 0 : GI.__wrap(h);
146
+ s(A, DA), s(I, P), s(g, gA), s(C, a);
147
+ const G = B.rawbroadphase_projectPointAndGetFeature(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q, Y(E) ? 4294967297 : E >>> 0, !Y(D), Y(D) ? 0 : D, !Y(o), Y(o) ? 0 : o, $(w));
148
+ return G === 0 ? void 0 : GI.__wrap(G);
149
149
  } finally {
150
150
  f[X++] = void 0;
151
151
  }
152
152
  }
153
- intersectionsWithPoint(A, I, g, C, Q, E, D, o, w, h) {
153
+ intersectionsWithPoint(A, I, g, C, Q, E, D, o, w, G) {
154
154
  try {
155
- s(A, DA), s(I, P), s(g, gA), s(C, N), B.rawbroadphase_intersectionsWithPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, $(Q), E, Y(D) ? 4294967297 : D >>> 0, !Y(o), Y(o) ? 0 : o, !Y(w), Y(w) ? 0 : w, $(h));
155
+ s(A, DA), s(I, P), s(g, gA), s(C, a), B.rawbroadphase_intersectionsWithPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, $(Q), E, Y(D) ? 4294967297 : D >>> 0, !Y(o), Y(o) ? 0 : o, !Y(w), Y(w) ? 0 : w, $(G));
156
156
  } finally {
157
157
  f[X++] = void 0, f[X++] = void 0;
158
158
  }
159
159
  }
160
- castShape(A, I, g, C, Q, E, D, o, w, h, G, S, K, M, F) {
160
+ castShape(A, I, g, C, Q, E, D, o, w, G, h, K, N, M, F) {
161
161
  try {
162
- s(A, DA), s(I, P), s(g, gA), s(C, N), s(Q, b), s(E, N), s(D, e);
163
- const J = B.rawbroadphase_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D.__wbg_ptr, o, w, h, G, Y(S) ? 4294967297 : S >>> 0, !Y(K), Y(K) ? 0 : K, !Y(M), Y(M) ? 0 : M, $(F));
162
+ s(A, DA), s(I, P), s(g, gA), s(C, a), s(Q, b), s(E, a), s(D, r);
163
+ const J = B.rawbroadphase_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D.__wbg_ptr, o, w, G, h, Y(K) ? 4294967297 : K >>> 0, !Y(N), Y(N) ? 0 : N, !Y(M), Y(M) ? 0 : M, $(F));
164
164
  return J === 0 ? void 0 : kI.__wrap(J);
165
165
  } finally {
166
166
  f[X++] = void 0;
167
167
  }
168
168
  }
169
- intersectionsWithShape(A, I, g, C, Q, E, D, o, w, h, G, S) {
169
+ intersectionsWithShape(A, I, g, C, Q, E, D, o, w, G, h, K) {
170
170
  try {
171
- s(A, DA), s(I, P), s(g, gA), s(C, N), s(Q, b), s(E, e), B.rawbroadphase_intersectionsWithShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, $(D), o, Y(w) ? 4294967297 : w >>> 0, !Y(h), Y(h) ? 0 : h, !Y(G), Y(G) ? 0 : G, $(S));
171
+ s(A, DA), s(I, P), s(g, gA), s(C, a), s(Q, b), s(E, r), B.rawbroadphase_intersectionsWithShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, $(D), o, Y(w) ? 4294967297 : w >>> 0, !Y(G), Y(G) ? 0 : G, !Y(h), Y(h) ? 0 : h, $(K));
172
172
  } finally {
173
173
  f[X++] = void 0, f[X++] = void 0;
174
174
  }
175
175
  }
176
176
  collidersWithAabbIntersectingAabb(A, I, g, C, Q, E) {
177
177
  try {
178
- s(A, DA), s(I, P), s(g, gA), s(C, N), s(Q, N), B.rawbroadphase_collidersWithAabbIntersectingAabb(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, $(E));
178
+ s(A, DA), s(I, P), s(g, gA), s(C, a), s(Q, a), B.rawbroadphase_collidersWithAabbIntersectingAabb(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, $(E));
179
179
  } finally {
180
180
  f[X++] = void 0;
181
181
  }
@@ -219,30 +219,30 @@ class Og {
219
219
  }
220
220
  translationDeltaApplied() {
221
221
  const A = B.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr);
222
- return N.__wrap(A);
222
+ return a.__wrap(A);
223
223
  }
224
224
  translationDeltaRemaining() {
225
225
  const A = B.rawcharactercollision_translationDeltaRemaining(this.__wbg_ptr);
226
- return N.__wrap(A);
226
+ return a.__wrap(A);
227
227
  }
228
228
  toi() {
229
229
  return B.rawcharactercollision_toi(this.__wbg_ptr);
230
230
  }
231
231
  worldWitness1() {
232
232
  const A = B.rawcharactercollision_worldWitness1(this.__wbg_ptr);
233
- return N.__wrap(A);
233
+ return a.__wrap(A);
234
234
  }
235
235
  worldWitness2() {
236
236
  const A = B.rawcharactercollision_worldWitness2(this.__wbg_ptr);
237
- return N.__wrap(A);
237
+ return a.__wrap(A);
238
238
  }
239
239
  worldNormal1() {
240
240
  const A = B.rawcharactercollision_worldNormal1(this.__wbg_ptr);
241
- return N.__wrap(A);
241
+ return a.__wrap(A);
242
242
  }
243
243
  worldNormal2() {
244
244
  const A = B.rawcharactercollision_worldNormal2(this.__wbg_ptr);
245
- return N.__wrap(A);
245
+ return a.__wrap(A);
246
246
  }
247
247
  }
248
248
  const eI = typeof FinalizationRegistry > "u" ? { register: () => {
@@ -264,7 +264,7 @@ class gA {
264
264
  }
265
265
  coTranslation(A) {
266
266
  const I = B.rawcolliderset_coTranslation(this.__wbg_ptr, A);
267
- return N.__wrap(I);
267
+ return a.__wrap(I);
268
268
  }
269
269
  coRotation(A) {
270
270
  const I = B.rawcolliderset_coRotation(this.__wbg_ptr, A);
@@ -272,7 +272,7 @@ class gA {
272
272
  }
273
273
  coTranslationWrtParent(A) {
274
274
  const I = B.rawcolliderset_coTranslationWrtParent(this.__wbg_ptr, A);
275
- return I === 0 ? void 0 : N.__wrap(I);
275
+ return I === 0 ? void 0 : a.__wrap(I);
276
276
  }
277
277
  coRotationWrtParent(A) {
278
278
  const I = B.rawcolliderset_coRotationWrtParent(this.__wbg_ptr, A);
@@ -298,14 +298,14 @@ class gA {
298
298
  }
299
299
  coHalfspaceNormal(A) {
300
300
  const I = B.rawcolliderset_coHalfspaceNormal(this.__wbg_ptr, A);
301
- return I === 0 ? void 0 : N.__wrap(I);
301
+ return I === 0 ? void 0 : a.__wrap(I);
302
302
  }
303
303
  coHalfExtents(A) {
304
304
  const I = B.rawcolliderset_coHalfExtents(this.__wbg_ptr, A);
305
- return I === 0 ? void 0 : N.__wrap(I);
305
+ return I === 0 ? void 0 : a.__wrap(I);
306
306
  }
307
307
  coSetHalfExtents(A, I) {
308
- s(I, N), B.rawcolliderset_coSetHalfExtents(this.__wbg_ptr, A, I.__wbg_ptr);
308
+ s(I, a), B.rawcolliderset_coSetHalfExtents(this.__wbg_ptr, A, I.__wbg_ptr);
309
309
  }
310
310
  coRadius(A) {
311
311
  const I = B.rawcolliderset_coRadius(this.__wbg_ptr, A);
@@ -341,7 +341,7 @@ class gA {
341
341
  }
342
342
  coVoxelSize(A) {
343
343
  const I = B.rawcolliderset_coVoxelSize(this.__wbg_ptr, A);
344
- return I === 0 ? void 0 : N.__wrap(I);
344
+ return I === 0 ? void 0 : a.__wrap(I);
345
345
  }
346
346
  coSetVoxel(A, I, g, C) {
347
347
  B.rawcolliderset_coSetVoxel(this.__wbg_ptr, A, I, g, C);
@@ -393,7 +393,7 @@ class gA {
393
393
  }
394
394
  coHeightfieldScale(A) {
395
395
  const I = B.rawcolliderset_coHeightfieldScale(this.__wbg_ptr, A);
396
- return I === 0 ? void 0 : N.__wrap(I);
396
+ return I === 0 ? void 0 : a.__wrap(I);
397
397
  }
398
398
  coParent(A) {
399
399
  try {
@@ -451,23 +451,23 @@ class gA {
451
451
  return B.rawcolliderset_coContactForceEventThreshold(this.__wbg_ptr, A);
452
452
  }
453
453
  coContainsPoint(A, I) {
454
- return s(I, N), B.rawcolliderset_coContainsPoint(this.__wbg_ptr, A, I.__wbg_ptr) !== 0;
454
+ return s(I, a), B.rawcolliderset_coContainsPoint(this.__wbg_ptr, A, I.__wbg_ptr) !== 0;
455
455
  }
456
456
  coCastShape(A, I, g, C, Q, E, D, o, w) {
457
- s(I, N), s(g, e), s(C, N), s(Q, b), s(E, N);
458
- const h = B.rawcolliderset_coCastShape(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D, o, w);
459
- return h === 0 ? void 0 : JI.__wrap(h);
457
+ s(I, a), s(g, r), s(C, a), s(Q, b), s(E, a);
458
+ const G = B.rawcolliderset_coCastShape(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D, o, w);
459
+ return G === 0 ? void 0 : JI.__wrap(G);
460
460
  }
461
461
  coCastCollider(A, I, g, C, Q, E, D) {
462
- s(I, N), s(C, N);
462
+ s(I, a), s(C, a);
463
463
  const o = B.rawcolliderset_coCastCollider(this.__wbg_ptr, A, I.__wbg_ptr, g, C.__wbg_ptr, Q, E, D);
464
464
  return o === 0 ? void 0 : kI.__wrap(o);
465
465
  }
466
466
  coIntersectsShape(A, I, g, C) {
467
- return s(I, e), s(g, N), s(C, b), B.rawcolliderset_coIntersectsShape(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr) !== 0;
467
+ return s(I, r), s(g, a), s(C, b), B.rawcolliderset_coIntersectsShape(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr) !== 0;
468
468
  }
469
469
  coContactShape(A, I, g, C, Q) {
470
- s(I, e), s(g, N), s(C, b);
470
+ s(I, r), s(g, a), s(C, b);
471
471
  const E = B.rawcolliderset_coContactShape(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q);
472
472
  return E === 0 ? void 0 : II.__wrap(E);
473
473
  }
@@ -476,18 +476,18 @@ class gA {
476
476
  return C === 0 ? void 0 : II.__wrap(C);
477
477
  }
478
478
  coProjectPoint(A, I, g) {
479
- s(I, N);
479
+ s(I, a);
480
480
  const C = B.rawcolliderset_coProjectPoint(this.__wbg_ptr, A, I.__wbg_ptr, g);
481
481
  return yI.__wrap(C);
482
482
  }
483
483
  coIntersectsRay(A, I, g, C) {
484
- return s(I, N), s(g, N), B.rawcolliderset_coIntersectsRay(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C) !== 0;
484
+ return s(I, a), s(g, a), B.rawcolliderset_coIntersectsRay(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C) !== 0;
485
485
  }
486
486
  coCastRay(A, I, g, C, Q) {
487
- return s(I, N), s(g, N), B.rawcolliderset_coCastRay(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C, Q);
487
+ return s(I, a), s(g, a), B.rawcolliderset_coCastRay(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C, Q);
488
488
  }
489
489
  coCastRayAndGetNormal(A, I, g, C, Q) {
490
- s(I, N), s(g, N);
490
+ s(I, a), s(g, a);
491
491
  const E = B.rawcolliderset_coCastRayAndGetNormal(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C, Q);
492
492
  return E === 0 ? void 0 : MI.__wrap(E);
493
493
  }
@@ -528,7 +528,7 @@ class gA {
528
528
  B.rawcolliderset_coSetActiveCollisionTypes(this.__wbg_ptr, A, I);
529
529
  }
530
530
  coSetShape(A, I) {
531
- s(I, e), B.rawcolliderset_coSetShape(this.__wbg_ptr, A, I.__wbg_ptr);
531
+ s(I, r), B.rawcolliderset_coSetShape(this.__wbg_ptr, A, I.__wbg_ptr);
532
532
  }
533
533
  coSetContactForceEventThreshold(A, I) {
534
534
  B.rawcolliderset_coSetContactForceEventThreshold(this.__wbg_ptr, A, I);
@@ -540,7 +540,7 @@ class gA {
540
540
  B.rawcolliderset_coSetMass(this.__wbg_ptr, A, I);
541
541
  }
542
542
  coSetMassProperties(A, I, g, C) {
543
- s(g, N), B.rawcolliderset_coSetMassProperties(this.__wbg_ptr, A, I, g.__wbg_ptr, C);
543
+ s(g, a), B.rawcolliderset_coSetMassProperties(this.__wbg_ptr, A, I, g.__wbg_ptr, C);
544
544
  }
545
545
  constructor() {
546
546
  const A = B.rawcolliderset_new();
@@ -552,10 +552,10 @@ class gA {
552
552
  contains(A) {
553
553
  return B.rawcolliderset_contains(this.__wbg_ptr, A) !== 0;
554
554
  }
555
- createCollider(A, I, g, C, Q, E, D, o, w, h, G, S, K, M, F, J, k, y, U, R, c, L, r, p) {
555
+ createCollider(A, I, g, C, Q, E, D, o, w, G, h, K, N, M, F, J, y, k, U, R, c, e, L, H) {
556
556
  try {
557
557
  const GA = B.__wbindgen_add_to_stack_pointer(-16);
558
- s(I, e), s(g, N), s(C, b), s(D, N), s(p, P), B.rawcolliderset_createCollider(GA, this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q, E, D.__wbg_ptr, o, w, h, G, S, K, M, F, J, k, y, U, R, c, L, r, p.__wbg_ptr);
558
+ s(I, r), s(g, a), s(C, b), s(D, a), s(H, P), B.rawcolliderset_createCollider(GA, this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q, E, D.__wbg_ptr, o, w, G, h, K, N, M, F, J, y, k, U, R, c, e, L, H.__wbg_ptr);
559
559
  var q = wA().getInt32(GA + 0, !0), AA = wA().getFloat64(GA + 8, !0);
560
560
  return q === 0 ? void 0 : AA;
561
561
  } finally {
@@ -601,19 +601,19 @@ class kI {
601
601
  }
602
602
  witness1() {
603
603
  const A = B.rawcollidershapecasthit_witness1(this.__wbg_ptr);
604
- return N.__wrap(A);
604
+ return a.__wrap(A);
605
605
  }
606
606
  witness2() {
607
607
  const A = B.rawcollidershapecasthit_witness2(this.__wbg_ptr);
608
- return N.__wrap(A);
608
+ return a.__wrap(A);
609
609
  }
610
610
  normal1() {
611
611
  const A = B.rawcollidershapecasthit_normal1(this.__wbg_ptr);
612
- return N.__wrap(A);
612
+ return a.__wrap(A);
613
613
  }
614
614
  normal2() {
615
615
  const A = B.rawcollidershapecasthit_normal2(this.__wbg_ptr);
616
- return N.__wrap(A);
616
+ return a.__wrap(A);
617
617
  }
618
618
  }
619
619
  const kg = typeof FinalizationRegistry > "u" ? { register: () => {
@@ -641,14 +641,14 @@ class uI {
641
641
  }
642
642
  total_force() {
643
643
  const A = B.rawcontactforceevent_total_force(this.__wbg_ptr);
644
- return N.__wrap(A);
644
+ return a.__wrap(A);
645
645
  }
646
646
  total_force_magnitude() {
647
647
  return B.rawcontactforceevent_total_force_magnitude(this.__wbg_ptr);
648
648
  }
649
649
  max_force_direction() {
650
650
  const A = B.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr);
651
- return N.__wrap(A);
651
+ return a.__wrap(A);
652
652
  }
653
653
  max_force_magnitude() {
654
654
  return B.rawcontactforceevent_max_force_magnitude(this.__wbg_ptr);
@@ -657,10 +657,10 @@ class uI {
657
657
  const yg = typeof FinalizationRegistry > "u" ? { register: () => {
658
658
  }, unregister: () => {
659
659
  } } : new FinalizationRegistry((i) => B.__wbg_rawcontactmanifold_free(i >>> 0, 1));
660
- class PI {
660
+ class VI {
661
661
  static __wrap(A) {
662
662
  A >>>= 0;
663
- const I = Object.create(PI.prototype);
663
+ const I = Object.create(VI.prototype);
664
664
  return I.__wbg_ptr = A, yg.register(I, I.__wbg_ptr, I), I;
665
665
  }
666
666
  __destroy_into_raw() {
@@ -673,15 +673,15 @@ class PI {
673
673
  }
674
674
  normal() {
675
675
  const A = B.rawcontactmanifold_normal(this.__wbg_ptr);
676
- return N.__wrap(A);
676
+ return a.__wrap(A);
677
677
  }
678
678
  local_n1() {
679
679
  const A = B.rawcontactmanifold_local_n1(this.__wbg_ptr);
680
- return N.__wrap(A);
680
+ return a.__wrap(A);
681
681
  }
682
682
  local_n2() {
683
683
  const A = B.rawcontactmanifold_local_n2(this.__wbg_ptr);
684
- return N.__wrap(A);
684
+ return a.__wrap(A);
685
685
  }
686
686
  subshape1() {
687
687
  return B.rawcontactmanifold_subshape1(this.__wbg_ptr) >>> 0;
@@ -694,11 +694,11 @@ class PI {
694
694
  }
695
695
  contact_local_p1(A) {
696
696
  const I = B.rawcontactmanifold_contact_local_p1(this.__wbg_ptr, A);
697
- return I === 0 ? void 0 : N.__wrap(I);
697
+ return I === 0 ? void 0 : a.__wrap(I);
698
698
  }
699
699
  contact_local_p2(A) {
700
700
  const I = B.rawcontactmanifold_contact_local_p2(this.__wbg_ptr, A);
701
- return I === 0 ? void 0 : N.__wrap(I);
701
+ return I === 0 ? void 0 : a.__wrap(I);
702
702
  }
703
703
  contact_dist(A) {
704
704
  return B.rawcontactmanifold_contact_dist(this.__wbg_ptr, A);
@@ -720,7 +720,7 @@ class PI {
720
720
  }
721
721
  solver_contact_point(A) {
722
722
  const I = B.rawcontactmanifold_solver_contact_point(this.__wbg_ptr, A);
723
- return I === 0 ? void 0 : N.__wrap(I);
723
+ return I === 0 ? void 0 : a.__wrap(I);
724
724
  }
725
725
  solver_contact_dist(A) {
726
726
  return B.rawcontactmanifold_solver_contact_dist(this.__wbg_ptr, A);
@@ -733,16 +733,16 @@ class PI {
733
733
  }
734
734
  solver_contact_tangent_velocity(A) {
735
735
  const I = B.rawcontactmanifold_solver_contact_tangent_velocity(this.__wbg_ptr, A);
736
- return N.__wrap(I);
736
+ return a.__wrap(I);
737
737
  }
738
738
  }
739
739
  const Fg = typeof FinalizationRegistry > "u" ? { register: () => {
740
740
  }, unregister: () => {
741
741
  } } : new FinalizationRegistry((i) => B.__wbg_rawcontactpair_free(i >>> 0, 1));
742
- class VI {
742
+ class PI {
743
743
  static __wrap(A) {
744
744
  A >>>= 0;
745
- const I = Object.create(VI.prototype);
745
+ const I = Object.create(PI.prototype);
746
746
  return I.__wbg_ptr = A, Fg.register(I, I.__wbg_ptr, I), I;
747
747
  }
748
748
  __destroy_into_raw() {
@@ -764,7 +764,7 @@ class VI {
764
764
  }
765
765
  contactManifold(A) {
766
766
  const I = B.rawcontactpair_contactManifold(this.__wbg_ptr, A);
767
- return I === 0 ? void 0 : PI.__wrap(I);
767
+ return I === 0 ? void 0 : VI.__wrap(I);
768
768
  }
769
769
  }
770
770
  const Mg = typeof FinalizationRegistry > "u" ? { register: () => {
@@ -816,7 +816,7 @@ class zI {
816
816
  }
817
817
  takeGravity() {
818
818
  const A = B.rawdeserializedworld_takeGravity(this.__wbg_ptr);
819
- return A === 0 ? void 0 : N.__wrap(A);
819
+ return A === 0 ? void 0 : a.__wrap(A);
820
820
  }
821
821
  takeIntegrationParameters() {
822
822
  const A = B.rawdeserializedworld_takeIntegrationParameters(this.__wbg_ptr);
@@ -903,27 +903,27 @@ class NA {
903
903
  B.__wbg_rawgenericjoint_free(A, 0);
904
904
  }
905
905
  static spring(A, I, g, C, Q) {
906
- s(C, N), s(Q, N);
906
+ s(C, a), s(Q, a);
907
907
  const E = B.rawgenericjoint_spring(A, I, g, C.__wbg_ptr, Q.__wbg_ptr);
908
908
  return NA.__wrap(E);
909
909
  }
910
910
  static rope(A, I, g) {
911
- s(I, N), s(g, N);
911
+ s(I, a), s(g, a);
912
912
  const C = B.rawgenericjoint_rope(A, I.__wbg_ptr, g.__wbg_ptr);
913
913
  return NA.__wrap(C);
914
914
  }
915
915
  static prismatic(A, I, g, C, Q, E) {
916
- s(A, N), s(I, N), s(g, N);
916
+ s(A, a), s(I, a), s(g, a);
917
917
  const D = B.rawgenericjoint_prismatic(A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C, Q, E);
918
918
  return D === 0 ? void 0 : NA.__wrap(D);
919
919
  }
920
920
  static fixed(A, I, g, C) {
921
- s(A, N), s(I, b), s(g, N), s(C, b);
921
+ s(A, a), s(I, b), s(g, a), s(C, b);
922
922
  const Q = B.rawgenericjoint_fixed(A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr);
923
923
  return NA.__wrap(Q);
924
924
  }
925
925
  static revolute(A, I) {
926
- s(A, N), s(I, N);
926
+ s(A, a), s(I, a);
927
927
  const g = B.rawgenericjoint_revolute(A.__wbg_ptr, I.__wbg_ptr);
928
928
  return g === 0 ? void 0 : NA.__wrap(g);
929
929
  }
@@ -964,17 +964,17 @@ class rA {
964
964
  }
965
965
  jointAnchor1(A) {
966
966
  const I = B.rawimpulsejointset_jointAnchor1(this.__wbg_ptr, A);
967
- return N.__wrap(I);
967
+ return a.__wrap(I);
968
968
  }
969
969
  jointAnchor2(A) {
970
970
  const I = B.rawimpulsejointset_jointAnchor2(this.__wbg_ptr, A);
971
- return N.__wrap(I);
971
+ return a.__wrap(I);
972
972
  }
973
973
  jointSetAnchor1(A, I) {
974
- s(I, N), B.rawimpulsejointset_jointSetAnchor1(this.__wbg_ptr, A, I.__wbg_ptr);
974
+ s(I, a), B.rawimpulsejointset_jointSetAnchor1(this.__wbg_ptr, A, I.__wbg_ptr);
975
975
  }
976
976
  jointSetAnchor2(A, I) {
977
- s(I, N), B.rawimpulsejointset_jointSetAnchor2(this.__wbg_ptr, A, I.__wbg_ptr);
977
+ s(I, a), B.rawimpulsejointset_jointSetAnchor2(this.__wbg_ptr, A, I.__wbg_ptr);
978
978
  }
979
979
  jointContactsEnabled(A) {
980
980
  return B.rawimpulsejointset_jointContactsEnabled(this.__wbg_ptr, A) !== 0;
@@ -1160,10 +1160,10 @@ class tC {
1160
1160
  }
1161
1161
  up() {
1162
1162
  const A = B.rawcollidershapecasthit_normal2(this.__wbg_ptr);
1163
- return N.__wrap(A);
1163
+ return a.__wrap(A);
1164
1164
  }
1165
1165
  setUp(A) {
1166
- s(A, N), B.rawkinematiccharactercontroller_setUp(this.__wbg_ptr, A.__wbg_ptr);
1166
+ s(A, a), B.rawkinematiccharactercontroller_setUp(this.__wbg_ptr, A.__wbg_ptr);
1167
1167
  }
1168
1168
  normalNudgeFactor() {
1169
1169
  return B.rawkinematiccharactercontroller_normalNudgeFactor(this.__wbg_ptr);
@@ -1229,16 +1229,16 @@ class tC {
1229
1229
  snapToGroundEnabled() {
1230
1230
  return B.rawkinematiccharactercontroller_snapToGroundEnabled(this.__wbg_ptr) !== 0;
1231
1231
  }
1232
- computeColliderMovement(A, I, g, C, Q, E, D, o, w, h, G, S) {
1232
+ computeColliderMovement(A, I, g, C, Q, E, D, o, w, G, h, K) {
1233
1233
  try {
1234
- s(I, dA), s(g, DA), s(C, P), s(Q, gA), s(D, N), B.rawkinematiccharactercontroller_computeColliderMovement(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E, D.__wbg_ptr, o, Y(w) ? 4294967297 : Math.fround(w), h, Y(G) ? 4294967297 : G >>> 0, $(S));
1234
+ s(I, dA), s(g, DA), s(C, P), s(Q, gA), s(D, a), B.rawkinematiccharactercontroller_computeColliderMovement(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E, D.__wbg_ptr, o, Y(w) ? 4294967297 : Math.fround(w), G, Y(h) ? 4294967297 : h >>> 0, $(K));
1235
1235
  } finally {
1236
1236
  f[X++] = void 0;
1237
1237
  }
1238
1238
  }
1239
1239
  computedMovement() {
1240
1240
  const A = B.rawkinematiccharactercontroller_computedMovement(this.__wbg_ptr);
1241
- return N.__wrap(A);
1241
+ return a.__wrap(A);
1242
1242
  }
1243
1243
  computedGrounded() {
1244
1244
  return B.rawkinematiccharactercontroller_computedGrounded(this.__wbg_ptr) !== 0;
@@ -1280,11 +1280,11 @@ class lA {
1280
1280
  }
1281
1281
  jointAnchor1(A) {
1282
1282
  const I = B.rawmultibodyjointset_jointAnchor1(this.__wbg_ptr, A);
1283
- return N.__wrap(I);
1283
+ return a.__wrap(I);
1284
1284
  }
1285
1285
  jointAnchor2(A) {
1286
1286
  const I = B.rawmultibodyjointset_jointAnchor2(this.__wbg_ptr, A);
1287
- return N.__wrap(I);
1287
+ return a.__wrap(I);
1288
1288
  }
1289
1289
  jointContactsEnabled(A) {
1290
1290
  return B.rawmultibodyjointset_jointContactsEnabled(this.__wbg_ptr, A) !== 0;
@@ -1355,7 +1355,7 @@ class DA {
1355
1355
  }
1356
1356
  contact_pair(A, I) {
1357
1357
  const g = B.rawnarrowphase_contact_pair(this.__wbg_ptr, A, I);
1358
- return g === 0 ? void 0 : VI.__wrap(g);
1358
+ return g === 0 ? void 0 : PI.__wrap(g);
1359
1359
  }
1360
1360
  intersection_pairs_with(A, I) {
1361
1361
  B.rawnarrowphase_intersection_pairs_with(this.__wbg_ptr, A, O(I));
@@ -1434,11 +1434,11 @@ class YC {
1434
1434
  timing_user_changes() {
1435
1435
  return B.rawphysicspipeline_timing_user_changes(this.__wbg_ptr);
1436
1436
  }
1437
- step(A, I, g, C, Q, E, D, o, w, h) {
1438
- s(A, N), s(I, ZA), s(g, qA), s(C, dA), s(Q, DA), s(E, P), s(D, gA), s(o, rA), s(w, lA), s(h, bI), B.rawphysicspipeline_step(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D.__wbg_ptr, o.__wbg_ptr, w.__wbg_ptr, h.__wbg_ptr);
1437
+ step(A, I, g, C, Q, E, D, o, w, G) {
1438
+ s(A, a), s(I, ZA), s(g, qA), s(C, dA), s(Q, DA), s(E, P), s(D, gA), s(o, rA), s(w, lA), s(G, bI), B.rawphysicspipeline_step(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D.__wbg_ptr, o.__wbg_ptr, w.__wbg_ptr, G.__wbg_ptr);
1439
1439
  }
1440
- stepWithEvents(A, I, g, C, Q, E, D, o, w, h, G, S, K, M) {
1441
- s(A, N), s(I, ZA), s(g, qA), s(C, dA), s(Q, DA), s(E, P), s(D, gA), s(o, rA), s(w, lA), s(h, bI), s(G, jg), B.rawphysicspipeline_stepWithEvents(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D.__wbg_ptr, o.__wbg_ptr, w.__wbg_ptr, h.__wbg_ptr, G.__wbg_ptr, O(S), O(K), O(M));
1440
+ stepWithEvents(A, I, g, C, Q, E, D, o, w, G, h, K, N, M) {
1441
+ s(A, a), s(I, ZA), s(g, qA), s(C, dA), s(Q, DA), s(E, P), s(D, gA), s(o, rA), s(w, lA), s(G, bI), s(h, jg), B.rawphysicspipeline_stepWithEvents(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D.__wbg_ptr, o.__wbg_ptr, w.__wbg_ptr, G.__wbg_ptr, h.__wbg_ptr, O(K), O(N), O(M));
1442
1442
  }
1443
1443
  }
1444
1444
  const Yg = typeof FinalizationRegistry > "u" ? { register: () => {
@@ -1473,15 +1473,15 @@ class eC {
1473
1473
  B.rawpidcontroller_reset_integrals(this.__wbg_ptr);
1474
1474
  }
1475
1475
  apply_linear_correction(A, I, g, C, Q) {
1476
- s(I, P), s(C, N), s(Q, N), B.rawpidcontroller_apply_linear_correction(this.__wbg_ptr, A, I.__wbg_ptr, g, C.__wbg_ptr, Q.__wbg_ptr);
1476
+ s(I, P), s(C, a), s(Q, a), B.rawpidcontroller_apply_linear_correction(this.__wbg_ptr, A, I.__wbg_ptr, g, C.__wbg_ptr, Q.__wbg_ptr);
1477
1477
  }
1478
1478
  apply_angular_correction(A, I, g, C, Q) {
1479
1479
  s(I, P), B.rawpidcontroller_apply_angular_correction(this.__wbg_ptr, A, I.__wbg_ptr, g, C, Q);
1480
1480
  }
1481
1481
  linear_correction(A, I, g, C, Q) {
1482
- s(I, P), s(C, N), s(Q, N);
1482
+ s(I, P), s(C, a), s(Q, a);
1483
1483
  const E = B.rawpidcontroller_linear_correction(this.__wbg_ptr, A, I.__wbg_ptr, g, C.__wbg_ptr, Q.__wbg_ptr);
1484
- return N.__wrap(E);
1484
+ return a.__wrap(E);
1485
1485
  }
1486
1486
  angular_correction(A, I, g, C, Q) {
1487
1487
  return s(I, P), B.rawpidcontroller_angular_correction(this.__wbg_ptr, A, I.__wbg_ptr, g, C, Q);
@@ -1509,7 +1509,7 @@ class GI {
1509
1509
  }
1510
1510
  point() {
1511
1511
  const A = B.rawpointcolliderprojection_point(this.__wbg_ptr);
1512
- return N.__wrap(A);
1512
+ return a.__wrap(A);
1513
1513
  }
1514
1514
  isInside() {
1515
1515
  return B.rawpointcolliderprojection_isInside(this.__wbg_ptr) !== 0;
@@ -1541,7 +1541,7 @@ class yI {
1541
1541
  }
1542
1542
  point() {
1543
1543
  const A = B.rawpointprojection_point(this.__wbg_ptr);
1544
- return N.__wrap(A);
1544
+ return a.__wrap(A);
1545
1545
  }
1546
1546
  isInside() {
1547
1547
  return B.rawpointprojection_isInside(this.__wbg_ptr) !== 0;
@@ -1593,7 +1593,7 @@ class FI {
1593
1593
  }
1594
1594
  normal() {
1595
1595
  const A = B.rawcollidershapecasthit_witness1(this.__wbg_ptr);
1596
- return N.__wrap(A);
1596
+ return a.__wrap(A);
1597
1597
  }
1598
1598
  time_of_impact() {
1599
1599
  return B.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr);
@@ -1625,7 +1625,7 @@ class MI {
1625
1625
  }
1626
1626
  normal() {
1627
1627
  const A = B.rawcollidershapecasthit_witness1(this.__wbg_ptr);
1628
- return N.__wrap(A);
1628
+ return a.__wrap(A);
1629
1629
  }
1630
1630
  time_of_impact() {
1631
1631
  return B.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr);
@@ -1657,7 +1657,7 @@ class P {
1657
1657
  }
1658
1658
  rbTranslation(A) {
1659
1659
  const I = B.rawrigidbodyset_rbTranslation(this.__wbg_ptr, A);
1660
- return N.__wrap(I);
1660
+ return a.__wrap(I);
1661
1661
  }
1662
1662
  rbRotation(A) {
1663
1663
  const I = B.rawrigidbodyset_rbRotation(this.__wbg_ptr, A);
@@ -1674,7 +1674,7 @@ class P {
1674
1674
  }
1675
1675
  rbNextTranslation(A) {
1676
1676
  const I = B.rawrigidbodyset_rbNextTranslation(this.__wbg_ptr, A);
1677
- return N.__wrap(I);
1677
+ return a.__wrap(I);
1678
1678
  }
1679
1679
  rbNextRotation(A) {
1680
1680
  const I = B.rawrigidbodyset_rbNextRotation(this.__wbg_ptr, A);
@@ -1687,7 +1687,7 @@ class P {
1687
1687
  B.rawrigidbodyset_rbSetRotation(this.__wbg_ptr, A, I, g);
1688
1688
  }
1689
1689
  rbSetLinvel(A, I, g) {
1690
- s(I, N), B.rawrigidbodyset_rbSetLinvel(this.__wbg_ptr, A, I.__wbg_ptr, g);
1690
+ s(I, a), B.rawrigidbodyset_rbSetLinvel(this.__wbg_ptr, A, I.__wbg_ptr, g);
1691
1691
  }
1692
1692
  rbSetAngvel(A, I, g) {
1693
1693
  B.rawrigidbodyset_rbSetAngvel(this.__wbg_ptr, A, I, g);
@@ -1705,19 +1705,19 @@ class P {
1705
1705
  B.rawrigidbodyset_rbSetAdditionalMass(this.__wbg_ptr, A, I, g);
1706
1706
  }
1707
1707
  rbSetAdditionalMassProperties(A, I, g, C, Q) {
1708
- s(g, N), B.rawrigidbodyset_rbSetAdditionalMassProperties(this.__wbg_ptr, A, I, g.__wbg_ptr, C, Q);
1708
+ s(g, a), B.rawrigidbodyset_rbSetAdditionalMassProperties(this.__wbg_ptr, A, I, g.__wbg_ptr, C, Q);
1709
1709
  }
1710
1710
  rbLinvel(A) {
1711
1711
  const I = B.rawrigidbodyset_rbLinvel(this.__wbg_ptr, A);
1712
- return N.__wrap(I);
1712
+ return a.__wrap(I);
1713
1713
  }
1714
1714
  rbAngvel(A) {
1715
1715
  return B.rawrigidbodyset_rbAngvel(this.__wbg_ptr, A);
1716
1716
  }
1717
1717
  rbVelocityAtPoint(A, I) {
1718
- s(I, N);
1718
+ s(I, a);
1719
1719
  const g = B.rawrigidbodyset_rbVelocityAtPoint(this.__wbg_ptr, A, I.__wbg_ptr);
1720
- return N.__wrap(g);
1720
+ return a.__wrap(g);
1721
1721
  }
1722
1722
  rbLockTranslations(A, I, g) {
1723
1723
  B.rawrigidbodyset_rbLockTranslations(this.__wbg_ptr, A, I, g);
@@ -1748,15 +1748,15 @@ class P {
1748
1748
  }
1749
1749
  rbEffectiveInvMass(A) {
1750
1750
  const I = B.rawrigidbodyset_rbEffectiveInvMass(this.__wbg_ptr, A);
1751
- return N.__wrap(I);
1751
+ return a.__wrap(I);
1752
1752
  }
1753
1753
  rbLocalCom(A) {
1754
1754
  const I = B.rawrigidbodyset_rbLocalCom(this.__wbg_ptr, A);
1755
- return N.__wrap(I);
1755
+ return a.__wrap(I);
1756
1756
  }
1757
1757
  rbWorldCom(A) {
1758
1758
  const I = B.rawrigidbodyset_rbWorldCom(this.__wbg_ptr, A);
1759
- return N.__wrap(I);
1759
+ return a.__wrap(I);
1760
1760
  }
1761
1761
  rbInvPrincipalInertia(A) {
1762
1762
  return B.rawrigidbodyset_rbInvPrincipalInertia(this.__wbg_ptr, A);
@@ -1831,10 +1831,10 @@ class P {
1831
1831
  B.rawrigidbodyset_rbResetTorques(this.__wbg_ptr, A, I);
1832
1832
  }
1833
1833
  rbAddForce(A, I, g) {
1834
- s(I, N), B.rawrigidbodyset_rbAddForce(this.__wbg_ptr, A, I.__wbg_ptr, g);
1834
+ s(I, a), B.rawrigidbodyset_rbAddForce(this.__wbg_ptr, A, I.__wbg_ptr, g);
1835
1835
  }
1836
1836
  rbApplyImpulse(A, I, g) {
1837
- s(I, N), B.rawrigidbodyset_rbApplyImpulse(this.__wbg_ptr, A, I.__wbg_ptr, g);
1837
+ s(I, a), B.rawrigidbodyset_rbApplyImpulse(this.__wbg_ptr, A, I.__wbg_ptr, g);
1838
1838
  }
1839
1839
  rbAddTorque(A, I, g) {
1840
1840
  B.rawrigidbodyset_rbAddTorque(this.__wbg_ptr, A, I, g);
@@ -1843,10 +1843,10 @@ class P {
1843
1843
  B.rawrigidbodyset_rbApplyTorqueImpulse(this.__wbg_ptr, A, I, g);
1844
1844
  }
1845
1845
  rbAddForceAtPoint(A, I, g, C) {
1846
- s(I, N), s(g, N), B.rawrigidbodyset_rbAddForceAtPoint(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C);
1846
+ s(I, a), s(g, a), B.rawrigidbodyset_rbAddForceAtPoint(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C);
1847
1847
  }
1848
1848
  rbApplyImpulseAtPoint(A, I, g, C) {
1849
- s(I, N), s(g, N), B.rawrigidbodyset_rbApplyImpulseAtPoint(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C);
1849
+ s(I, a), s(g, a), B.rawrigidbodyset_rbApplyImpulseAtPoint(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C);
1850
1850
  }
1851
1851
  rbAdditionalSolverIterations(A) {
1852
1852
  return B.rawrigidbodyset_rbAdditionalSolverIterations(this.__wbg_ptr, A) >>> 0;
@@ -1862,7 +1862,7 @@ class P {
1862
1862
  }
1863
1863
  rbUserForce(A) {
1864
1864
  const I = B.rawrigidbodyset_rbUserForce(this.__wbg_ptr, A);
1865
- return N.__wrap(I);
1865
+ return a.__wrap(I);
1866
1866
  }
1867
1867
  rbUserTorque(A) {
1868
1868
  return B.rawrigidbodyset_rbUserTorque(this.__wbg_ptr, A);
@@ -1871,8 +1871,8 @@ class P {
1871
1871
  const A = B.rawrigidbodyset_new();
1872
1872
  return this.__wbg_ptr = A >>> 0, HI.register(this, this.__wbg_ptr, this), this;
1873
1873
  }
1874
- createRigidBody(A, I, g, C, Q, E, D, o, w, h, G, S, K, M, F, J, k, y, U, R, c, L) {
1875
- return s(I, N), s(g, b), s(D, N), s(o, N), B.rawrigidbodyset_createRigidBody(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C, Q, E, D.__wbg_ptr, o.__wbg_ptr, w, h, G, S, K, M, F, J, k, y, U, R, c, L);
1874
+ createRigidBody(A, I, g, C, Q, E, D, o, w, G, h, K, N, M, F, J, y, k, U, R, c, e) {
1875
+ return s(I, a), s(g, b), s(D, a), s(o, a), B.rawrigidbodyset_createRigidBody(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C, Q, E, D.__wbg_ptr, o.__wbg_ptr, w, G, h, K, N, M, F, J, y, k, U, R, c, e);
1876
1876
  }
1877
1877
  remove(A, I, g, C, Q) {
1878
1878
  s(I, qA), s(g, gA), s(C, rA), s(Q, lA), B.rawrigidbodyset_remove(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr);
@@ -1946,7 +1946,7 @@ class LC {
1946
1946
  return this.__wbg_ptr = A >>> 0, Hg.register(this, this.__wbg_ptr, this), this;
1947
1947
  }
1948
1948
  serializeAll(A, I, g, C, Q, E, D, o, w) {
1949
- return s(A, N), s(I, ZA), s(g, qA), s(C, dA), s(Q, DA), s(E, P), s(D, gA), s(o, rA), s(w, lA), wI(B.rawserializationpipeline_serializeAll(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D.__wbg_ptr, o.__wbg_ptr, w.__wbg_ptr));
1949
+ return s(A, a), s(I, ZA), s(g, qA), s(C, dA), s(Q, DA), s(E, P), s(D, gA), s(o, rA), s(w, lA), wI(B.rawserializationpipeline_serializeAll(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D.__wbg_ptr, o.__wbg_ptr, w.__wbg_ptr));
1950
1950
  }
1951
1951
  deserializeAll(A) {
1952
1952
  const I = B.rawserializationpipeline_deserializeAll(this.__wbg_ptr, O(A));
@@ -1956,10 +1956,10 @@ class LC {
1956
1956
  const pg = typeof FinalizationRegistry > "u" ? { register: () => {
1957
1957
  }, unregister: () => {
1958
1958
  } } : new FinalizationRegistry((i) => B.__wbg_rawshape_free(i >>> 0, 1));
1959
- class e {
1959
+ class r {
1960
1960
  static __wrap(A) {
1961
1961
  A >>>= 0;
1962
- const I = Object.create(e.prototype);
1962
+ const I = Object.create(r.prototype);
1963
1963
  return I.__wbg_ptr = A, pg.register(I, I.__wbg_ptr, I), I;
1964
1964
  }
1965
1965
  __destroy_into_raw() {
@@ -1972,109 +1972,109 @@ class e {
1972
1972
  }
1973
1973
  static cuboid(A, I) {
1974
1974
  const g = B.rawshape_cuboid(A, I);
1975
- return e.__wrap(g);
1975
+ return r.__wrap(g);
1976
1976
  }
1977
1977
  static roundCuboid(A, I, g) {
1978
1978
  const C = B.rawshape_roundCuboid(A, I, g);
1979
- return e.__wrap(C);
1979
+ return r.__wrap(C);
1980
1980
  }
1981
1981
  static ball(A) {
1982
1982
  const I = B.rawshape_ball(A);
1983
- return e.__wrap(I);
1983
+ return r.__wrap(I);
1984
1984
  }
1985
1985
  static halfspace(A) {
1986
- s(A, N);
1986
+ s(A, a);
1987
1987
  const I = B.rawshape_halfspace(A.__wbg_ptr);
1988
- return e.__wrap(I);
1988
+ return r.__wrap(I);
1989
1989
  }
1990
1990
  static capsule(A, I) {
1991
1991
  const g = B.rawshape_capsule(A, I);
1992
- return e.__wrap(g);
1992
+ return r.__wrap(g);
1993
1993
  }
1994
1994
  static voxels(A, I) {
1995
- s(A, N);
1995
+ s(A, a);
1996
1996
  const g = tI(I, B.__wbindgen_export_2), C = MA, Q = B.rawshape_voxels(A.__wbg_ptr, g, C);
1997
- return e.__wrap(Q);
1997
+ return r.__wrap(Q);
1998
1998
  }
1999
1999
  static voxelsFromPoints(A, I) {
2000
- s(A, N);
2000
+ s(A, a);
2001
2001
  const g = HA(I, B.__wbindgen_export_2), C = MA, Q = B.rawshape_voxelsFromPoints(A.__wbg_ptr, g, C);
2002
- return e.__wrap(Q);
2002
+ return r.__wrap(Q);
2003
2003
  }
2004
2004
  static polyline(A, I) {
2005
2005
  const g = HA(A, B.__wbindgen_export_2), C = MA, Q = tI(I, B.__wbindgen_export_2), E = MA, D = B.rawshape_polyline(g, C, Q, E);
2006
- return e.__wrap(D);
2006
+ return r.__wrap(D);
2007
2007
  }
2008
2008
  static trimesh(A, I, g) {
2009
2009
  const C = HA(A, B.__wbindgen_export_2), Q = MA, E = tI(I, B.__wbindgen_export_2), D = MA, o = B.rawshape_trimesh(C, Q, E, D, g);
2010
- return o === 0 ? void 0 : e.__wrap(o);
2010
+ return o === 0 ? void 0 : r.__wrap(o);
2011
2011
  }
2012
2012
  static heightfield(A, I) {
2013
2013
  const g = HA(A, B.__wbindgen_export_2), C = MA;
2014
- s(I, N);
2014
+ s(I, a);
2015
2015
  const Q = B.rawshape_heightfield(g, C, I.__wbg_ptr);
2016
- return e.__wrap(Q);
2016
+ return r.__wrap(Q);
2017
2017
  }
2018
2018
  static segment(A, I) {
2019
- s(A, N), s(I, N);
2019
+ s(A, a), s(I, a);
2020
2020
  const g = B.rawshape_segment(A.__wbg_ptr, I.__wbg_ptr);
2021
- return e.__wrap(g);
2021
+ return r.__wrap(g);
2022
2022
  }
2023
2023
  static triangle(A, I, g) {
2024
- s(A, N), s(I, N), s(g, N);
2024
+ s(A, a), s(I, a), s(g, a);
2025
2025
  const C = B.rawshape_triangle(A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr);
2026
- return e.__wrap(C);
2026
+ return r.__wrap(C);
2027
2027
  }
2028
2028
  static roundTriangle(A, I, g, C) {
2029
- s(A, N), s(I, N), s(g, N);
2029
+ s(A, a), s(I, a), s(g, a);
2030
2030
  const Q = B.rawshape_roundTriangle(A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C);
2031
- return e.__wrap(Q);
2031
+ return r.__wrap(Q);
2032
2032
  }
2033
2033
  static convexHull(A) {
2034
2034
  const I = HA(A, B.__wbindgen_export_2), g = MA, C = B.rawshape_convexHull(I, g);
2035
- return C === 0 ? void 0 : e.__wrap(C);
2035
+ return C === 0 ? void 0 : r.__wrap(C);
2036
2036
  }
2037
2037
  static roundConvexHull(A, I) {
2038
2038
  const g = HA(A, B.__wbindgen_export_2), C = MA, Q = B.rawshape_roundConvexHull(g, C, I);
2039
- return Q === 0 ? void 0 : e.__wrap(Q);
2039
+ return Q === 0 ? void 0 : r.__wrap(Q);
2040
2040
  }
2041
2041
  static convexPolyline(A) {
2042
2042
  const I = HA(A, B.__wbindgen_export_2), g = MA, C = B.rawshape_convexPolyline(I, g);
2043
- return C === 0 ? void 0 : e.__wrap(C);
2043
+ return C === 0 ? void 0 : r.__wrap(C);
2044
2044
  }
2045
2045
  static roundConvexPolyline(A, I) {
2046
2046
  const g = HA(A, B.__wbindgen_export_2), C = MA, Q = B.rawshape_roundConvexPolyline(g, C, I);
2047
- return Q === 0 ? void 0 : e.__wrap(Q);
2047
+ return Q === 0 ? void 0 : r.__wrap(Q);
2048
2048
  }
2049
- castShape(A, I, g, C, Q, E, D, o, w, h) {
2050
- s(A, N), s(I, b), s(g, N), s(C, e), s(Q, N), s(E, b), s(D, N);
2051
- const G = B.rawshape_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D.__wbg_ptr, o, w, h);
2052
- return G === 0 ? void 0 : JI.__wrap(G);
2049
+ castShape(A, I, g, C, Q, E, D, o, w, G) {
2050
+ s(A, a), s(I, b), s(g, a), s(C, r), s(Q, a), s(E, b), s(D, a);
2051
+ const h = B.rawshape_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D.__wbg_ptr, o, w, G);
2052
+ return h === 0 ? void 0 : JI.__wrap(h);
2053
2053
  }
2054
2054
  intersectsShape(A, I, g, C, Q) {
2055
- return s(A, N), s(I, b), s(g, e), s(C, N), s(Q, b), B.rawshape_intersectsShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr) !== 0;
2055
+ return s(A, a), s(I, b), s(g, r), s(C, a), s(Q, b), B.rawshape_intersectsShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr) !== 0;
2056
2056
  }
2057
2057
  contactShape(A, I, g, C, Q, E) {
2058
- s(A, N), s(I, b), s(g, e), s(C, N), s(Q, b);
2058
+ s(A, a), s(I, b), s(g, r), s(C, a), s(Q, b);
2059
2059
  const D = B.rawshape_contactShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E);
2060
2060
  return D === 0 ? void 0 : II.__wrap(D);
2061
2061
  }
2062
2062
  containsPoint(A, I, g) {
2063
- return s(A, N), s(I, b), s(g, N), B.rawshape_containsPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr) !== 0;
2063
+ return s(A, a), s(I, b), s(g, a), B.rawshape_containsPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr) !== 0;
2064
2064
  }
2065
2065
  projectPoint(A, I, g, C) {
2066
- s(A, N), s(I, b), s(g, N);
2066
+ s(A, a), s(I, b), s(g, a);
2067
2067
  const Q = B.rawshape_projectPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C);
2068
2068
  return yI.__wrap(Q);
2069
2069
  }
2070
2070
  intersectsRay(A, I, g, C, Q) {
2071
- return s(A, N), s(I, b), s(g, N), s(C, N), B.rawshape_intersectsRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q) !== 0;
2071
+ return s(A, a), s(I, b), s(g, a), s(C, a), B.rawshape_intersectsRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q) !== 0;
2072
2072
  }
2073
2073
  castRay(A, I, g, C, Q, E) {
2074
- return s(A, N), s(I, b), s(g, N), s(C, N), B.rawshape_castRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q, E);
2074
+ return s(A, a), s(I, b), s(g, a), s(C, a), B.rawshape_castRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q, E);
2075
2075
  }
2076
2076
  castRayAndGetNormal(A, I, g, C, Q, E) {
2077
- s(A, N), s(I, b), s(g, N), s(C, N);
2077
+ s(A, a), s(I, b), s(g, a), s(C, a);
2078
2078
  const D = B.rawshape_castRayAndGetNormal(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q, E);
2079
2079
  return D === 0 ? void 0 : MI.__wrap(D);
2080
2080
  }
@@ -2101,19 +2101,19 @@ class JI {
2101
2101
  }
2102
2102
  witness1() {
2103
2103
  const A = B.rawshapecasthit_witness1(this.__wbg_ptr);
2104
- return N.__wrap(A);
2104
+ return a.__wrap(A);
2105
2105
  }
2106
2106
  witness2() {
2107
2107
  const A = B.rawcollidershapecasthit_witness1(this.__wbg_ptr);
2108
- return N.__wrap(A);
2108
+ return a.__wrap(A);
2109
2109
  }
2110
2110
  normal1() {
2111
2111
  const A = B.rawcollidershapecasthit_witness2(this.__wbg_ptr);
2112
- return N.__wrap(A);
2112
+ return a.__wrap(A);
2113
2113
  }
2114
2114
  normal2() {
2115
2115
  const A = B.rawcollidershapecasthit_normal1(this.__wbg_ptr);
2116
- return N.__wrap(A);
2116
+ return a.__wrap(A);
2117
2117
  }
2118
2118
  }
2119
2119
  const fg = typeof FinalizationRegistry > "u" ? { register: () => {
@@ -2138,28 +2138,28 @@ class II {
2138
2138
  }
2139
2139
  point1() {
2140
2140
  const A = B.rawpointprojection_point(this.__wbg_ptr);
2141
- return N.__wrap(A);
2141
+ return a.__wrap(A);
2142
2142
  }
2143
2143
  point2() {
2144
2144
  const A = B.rawpointcolliderprojection_point(this.__wbg_ptr);
2145
- return N.__wrap(A);
2145
+ return a.__wrap(A);
2146
2146
  }
2147
2147
  normal1() {
2148
2148
  const A = B.rawcontactforceevent_total_force(this.__wbg_ptr);
2149
- return N.__wrap(A);
2149
+ return a.__wrap(A);
2150
2150
  }
2151
2151
  normal2() {
2152
2152
  const A = B.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr);
2153
- return N.__wrap(A);
2153
+ return a.__wrap(A);
2154
2154
  }
2155
2155
  }
2156
2156
  const pI = typeof FinalizationRegistry > "u" ? { register: () => {
2157
2157
  }, unregister: () => {
2158
2158
  } } : new FinalizationRegistry((i) => B.__wbg_rawvector_free(i >>> 0, 1));
2159
- class N {
2159
+ class a {
2160
2160
  static __wrap(A) {
2161
2161
  A >>>= 0;
2162
- const I = Object.create(N.prototype);
2162
+ const I = Object.create(a.prototype);
2163
2163
  return I.__wbg_ptr = A, pI.register(I, I.__wbg_ptr, I), I;
2164
2164
  }
2165
2165
  __destroy_into_raw() {
@@ -2172,7 +2172,7 @@ class N {
2172
2172
  }
2173
2173
  static zero() {
2174
2174
  const A = B.rawvector_zero();
2175
- return N.__wrap(A);
2175
+ return a.__wrap(A);
2176
2176
  }
2177
2177
  constructor(A, I) {
2178
2178
  const g = B.rawvector_new(A, I);
@@ -2192,11 +2192,11 @@ class N {
2192
2192
  }
2193
2193
  xy() {
2194
2194
  const A = B.rawvector_xy(this.__wbg_ptr);
2195
- return N.__wrap(A);
2195
+ return a.__wrap(A);
2196
2196
  }
2197
2197
  yx() {
2198
2198
  const A = B.rawvector_yx(this.__wbg_ptr);
2199
- return N.__wrap(A);
2199
+ return a.__wrap(A);
2200
2200
  }
2201
2201
  }
2202
2202
  async function xg(i) {
@@ -2205,51 +2205,51 @@ async function xg(i) {
2205
2205
  const A = function() {
2206
2206
  const C = { wbg: {} };
2207
2207
  return C.wbg.__wbg_bind_c8359b1cba058168 = function(Q, E, D, o) {
2208
- return O(H(Q).bind(H(E), H(D), H(o)));
2208
+ return O(p(Q).bind(p(E), p(D), p(o)));
2209
2209
  }, C.wbg.__wbg_buffer_609cc3eee51ed158 = function(Q) {
2210
- return O(H(Q).buffer);
2210
+ return O(p(Q).buffer);
2211
2211
  }, C.wbg.__wbg_call_672a4d21634d4a24 = function() {
2212
2212
  return oI(function(Q, E) {
2213
- return O(H(Q).call(H(E)));
2213
+ return O(p(Q).call(p(E)));
2214
2214
  }, arguments);
2215
2215
  }, C.wbg.__wbg_call_7cccdd69e0791ae2 = function() {
2216
2216
  return oI(function(Q, E, D) {
2217
- return O(H(Q).call(H(E), H(D)));
2217
+ return O(p(Q).call(p(E), p(D)));
2218
2218
  }, arguments);
2219
2219
  }, C.wbg.__wbg_call_833bed5770ea2041 = function() {
2220
2220
  return oI(function(Q, E, D, o) {
2221
- return O(H(Q).call(H(E), H(D), H(o)));
2221
+ return O(p(Q).call(p(E), p(D), p(o)));
2222
2222
  }, arguments);
2223
2223
  }, C.wbg.__wbg_call_b8adc8b1d0a0d8eb = function() {
2224
2224
  return oI(function(Q, E, D, o, w) {
2225
- return O(H(Q).call(H(E), H(D), H(o), H(w)));
2225
+ return O(p(Q).call(p(E), p(D), p(o), p(w)));
2226
2226
  }, arguments);
2227
2227
  }, C.wbg.__wbg_length_3b4f022188ae8db6 = function(Q) {
2228
- return H(Q).length;
2228
+ return p(Q).length;
2229
2229
  }, C.wbg.__wbg_length_a446193dc22c12f8 = function(Q) {
2230
- return H(Q).length;
2230
+ return p(Q).length;
2231
2231
  }, C.wbg.__wbg_new_a12002a7f91c75be = function(Q) {
2232
- return O(new Uint8Array(H(Q)));
2232
+ return O(new Uint8Array(p(Q)));
2233
2233
  }, C.wbg.__wbg_newnoargs_105ed471475aaf50 = function(Q, E) {
2234
2234
  return O(new Function(fI(Q, E)));
2235
2235
  }, C.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(Q, E, D) {
2236
- return O(new Uint8Array(H(Q), E >>> 0, D >>> 0));
2236
+ return O(new Uint8Array(p(Q), E >>> 0, D >>> 0));
2237
2237
  }, C.wbg.__wbg_newwithbyteoffsetandlength_e6b7e69acd4c7354 = function(Q, E, D) {
2238
- return O(new Float32Array(H(Q), E >>> 0, D >>> 0));
2238
+ return O(new Float32Array(p(Q), E >>> 0, D >>> 0));
2239
2239
  }, C.wbg.__wbg_newwithlength_5a5efe313cfd59f1 = function(Q) {
2240
2240
  return O(new Float32Array(Q >>> 0));
2241
2241
  }, C.wbg.__wbg_now_2c95c9de01293173 = function(Q) {
2242
- return H(Q).now();
2242
+ return p(Q).now();
2243
2243
  }, C.wbg.__wbg_performance_7a3ffd0b17f663ad = function(Q) {
2244
- return O(H(Q).performance);
2244
+ return O(p(Q).performance);
2245
2245
  }, C.wbg.__wbg_rawcontactforceevent_new = function(Q) {
2246
2246
  return O(uI.__wrap(Q));
2247
2247
  }, C.wbg.__wbg_rawraycolliderintersection_new = function(Q) {
2248
2248
  return O(FI.__wrap(Q));
2249
2249
  }, C.wbg.__wbg_set_10bad9bee0e9c58b = function(Q, E, D) {
2250
- H(Q).set(H(E), D >>> 0);
2250
+ p(Q).set(p(E), D >>> 0);
2251
2251
  }, C.wbg.__wbg_set_65595bdd868b3009 = function(Q, E, D) {
2252
- H(Q).set(H(E), D >>> 0);
2252
+ p(Q).set(p(E), D >>> 0);
2253
2253
  }, C.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
2254
2254
  const Q = typeof global > "u" ? null : global;
2255
2255
  return Y(Q) ? 0 : O(Q);
@@ -2263,21 +2263,21 @@ async function xg(i) {
2263
2263
  const Q = typeof window > "u" ? null : window;
2264
2264
  return Y(Q) ? 0 : O(Q);
2265
2265
  }, C.wbg.__wbindgen_boolean_get = function(Q) {
2266
- const E = H(Q);
2266
+ const E = p(Q);
2267
2267
  return typeof E == "boolean" ? E ? 1 : 0 : 2;
2268
2268
  }, C.wbg.__wbindgen_is_function = function(Q) {
2269
- return typeof H(Q) == "function";
2269
+ return typeof p(Q) == "function";
2270
2270
  }, C.wbg.__wbindgen_is_undefined = function(Q) {
2271
- return H(Q) === void 0;
2271
+ return p(Q) === void 0;
2272
2272
  }, C.wbg.__wbindgen_memory = function() {
2273
2273
  return O(B.memory);
2274
2274
  }, C.wbg.__wbindgen_number_get = function(Q, E) {
2275
- const D = H(E), o = typeof D == "number" ? D : void 0;
2275
+ const D = p(E), o = typeof D == "number" ? D : void 0;
2276
2276
  wA().setFloat64(Q + 8, Y(o) ? 0 : o, !0), wA().setInt32(Q + 0, !Y(o), !0);
2277
2277
  }, C.wbg.__wbindgen_number_new = function(Q) {
2278
2278
  return O(Q);
2279
2279
  }, C.wbg.__wbindgen_object_clone_ref = function(Q) {
2280
- return O(H(Q));
2280
+ return O(p(Q));
2281
2281
  }, C.wbg.__wbindgen_object_drop_ref = function(Q) {
2282
2282
  wI(Q);
2283
2283
  }, C.wbg.__wbindgen_throw = function(Q, E) {
@@ -2302,7 +2302,7 @@ async function xg(i) {
2302
2302
  }
2303
2303
  }(await i, A);
2304
2304
  return function(C, Q) {
2305
- return B = C.exports, xg.__wbindgen_wasm_module = Q, fA = null, _A = null, zA = null, $A = null, VA = null, B;
2305
+ return B = C.exports, xg.__wbindgen_wasm_module = Q, fA = null, _A = null, zA = null, $A = null, PA = null, B;
2306
2306
  }(I, g);
2307
2307
  }
2308
2308
  class mg {
@@ -2310,20 +2310,20 @@ class mg {
2310
2310
  this.x = A, this.y = I;
2311
2311
  }
2312
2312
  }
2313
- class a {
2313
+ class S {
2314
2314
  static new(A, I) {
2315
2315
  return new mg(A, I);
2316
2316
  }
2317
2317
  static zeros() {
2318
- return a.new(0, 0);
2318
+ return S.new(0, 0);
2319
2319
  }
2320
2320
  static fromRaw(A) {
2321
2321
  if (!A) return null;
2322
- let I = a.new(A.x, A.y);
2322
+ let I = S.new(A.x, A.y);
2323
2323
  return A.free(), I;
2324
2324
  }
2325
2325
  static intoRaw(A) {
2326
- return new N(A.x, A.y);
2326
+ return new a(A.x, A.y);
2327
2327
  }
2328
2328
  static copy(A, I) {
2329
2329
  A.x = I.x, A.y = I.y;
@@ -2342,7 +2342,7 @@ class j {
2342
2342
  return b.fromAngle(A);
2343
2343
  }
2344
2344
  }
2345
- var cA, JA, TI, ZI, gI, mA, sA, WI, OI, hI, sI, jI, xI, KI, TA;
2345
+ var cA, JA, TI, ZI, gI, XA, sA, WI, OI, hI, sI, jI, xI, KI, TA;
2346
2346
  (function(i) {
2347
2347
  i[i.Dynamic = 0] = "Dynamic", i[i.Fixed = 1] = "Fixed", i[i.KinematicPositionBased = 2] = "KinematicPositionBased", i[i.KinematicVelocityBased = 3] = "KinematicVelocityBased";
2348
2348
  })(cA || (cA = {}));
@@ -2391,7 +2391,7 @@ class mI {
2391
2391
  }
2392
2392
  translation() {
2393
2393
  let A = this.rawSet.rbTranslation(this.handle);
2394
- return a.fromRaw(A);
2394
+ return S.fromRaw(A);
2395
2395
  }
2396
2396
  rotation() {
2397
2397
  let A = this.rawSet.rbRotation(this.handle);
@@ -2399,7 +2399,7 @@ class mI {
2399
2399
  }
2400
2400
  nextTranslation() {
2401
2401
  let A = this.rawSet.rbNextTranslation(this.handle);
2402
- return a.fromRaw(A);
2402
+ return S.fromRaw(A);
2403
2403
  }
2404
2404
  nextRotation() {
2405
2405
  let A = this.rawSet.rbNextRotation(this.handle);
@@ -2409,7 +2409,7 @@ class mI {
2409
2409
  this.rawSet.rbSetTranslation(this.handle, A.x, A.y, I);
2410
2410
  }
2411
2411
  setLinvel(A, I) {
2412
- let g = a.intoRaw(A);
2412
+ let g = S.intoRaw(A);
2413
2413
  this.rawSet.rbSetLinvel(this.handle, g, I), g.free();
2414
2414
  }
2415
2415
  gravityScale() {
@@ -2431,11 +2431,11 @@ class mI {
2431
2431
  this.rawSet.rbSetNextKinematicRotation(this.handle, A);
2432
2432
  }
2433
2433
  linvel() {
2434
- return a.fromRaw(this.rawSet.rbLinvel(this.handle));
2434
+ return S.fromRaw(this.rawSet.rbLinvel(this.handle));
2435
2435
  }
2436
2436
  velocityAtPoint(A) {
2437
- const I = a.intoRaw(A);
2438
- let g = a.fromRaw(this.rawSet.rbVelocityAtPoint(this.handle, I));
2437
+ const I = S.intoRaw(A);
2438
+ let g = S.fromRaw(this.rawSet.rbVelocityAtPoint(this.handle, I));
2439
2439
  return I.free(), g;
2440
2440
  }
2441
2441
  angvel() {
@@ -2445,16 +2445,16 @@ class mI {
2445
2445
  return this.rawSet.rbMass(this.handle);
2446
2446
  }
2447
2447
  effectiveInvMass() {
2448
- return a.fromRaw(this.rawSet.rbEffectiveInvMass(this.handle));
2448
+ return S.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 a.fromRaw(this.rawSet.rbLocalCom(this.handle));
2454
+ return S.fromRaw(this.rawSet.rbLocalCom(this.handle));
2455
2455
  }
2456
2456
  worldCom() {
2457
- return a.fromRaw(this.rawSet.rbWorldCom(this.handle));
2457
+ return S.fromRaw(this.rawSet.rbWorldCom(this.handle));
2458
2458
  }
2459
2459
  invPrincipalInertia() {
2460
2460
  return this.rawSet.rbInvPrincipalInertia(this.handle);
@@ -2526,7 +2526,7 @@ class mI {
2526
2526
  this.rawSet.rbSetAdditionalMass(this.handle, A, I);
2527
2527
  }
2528
2528
  setAdditionalMassProperties(A, I, g, C) {
2529
- let Q = a.intoRaw(I);
2529
+ let Q = S.intoRaw(I);
2530
2530
  this.rawSet.rbSetAdditionalMassProperties(this.handle, A, Q, g, C), Q.free();
2531
2531
  }
2532
2532
  setAngularDamping(A) {
@@ -2539,11 +2539,11 @@ class mI {
2539
2539
  this.rawSet.rbResetTorques(this.handle, A);
2540
2540
  }
2541
2541
  addForce(A, I) {
2542
- const g = a.intoRaw(A);
2542
+ const g = S.intoRaw(A);
2543
2543
  this.rawSet.rbAddForce(this.handle, g, I), g.free();
2544
2544
  }
2545
2545
  applyImpulse(A, I) {
2546
- const g = a.intoRaw(A);
2546
+ const g = S.intoRaw(A);
2547
2547
  this.rawSet.rbApplyImpulse(this.handle, g, I), g.free();
2548
2548
  }
2549
2549
  addTorque(A, I) {
@@ -2553,15 +2553,15 @@ class mI {
2553
2553
  this.rawSet.rbApplyTorqueImpulse(this.handle, A, I);
2554
2554
  }
2555
2555
  addForceAtPoint(A, I, g) {
2556
- const C = a.intoRaw(A), Q = a.intoRaw(I);
2556
+ const C = S.intoRaw(A), Q = S.intoRaw(I);
2557
2557
  this.rawSet.rbAddForceAtPoint(this.handle, C, Q, g), C.free(), Q.free();
2558
2558
  }
2559
2559
  applyImpulseAtPoint(A, I, g) {
2560
- const C = a.intoRaw(A), Q = a.intoRaw(I);
2560
+ const C = S.intoRaw(A), Q = S.intoRaw(I);
2561
2561
  this.rawSet.rbApplyImpulseAtPoint(this.handle, C, Q, g), C.free(), Q.free();
2562
2562
  }
2563
2563
  userForce() {
2564
- return a.fromRaw(this.rawSet.rbUserForce(this.handle));
2564
+ return S.fromRaw(this.rawSet.rbUserForce(this.handle));
2565
2565
  }
2566
2566
  userTorque() {
2567
2567
  return this.rawSet.rbUserTorque(this.handle);
@@ -2569,7 +2569,7 @@ class mI {
2569
2569
  }
2570
2570
  class eA {
2571
2571
  constructor(A) {
2572
- this.enabled = !0, this.status = A, this.translation = a.zeros(), this.rotation = j.identity(), this.gravityScale = 1, this.linvel = a.zeros(), this.mass = 0, this.massOnly = !1, this.centerOfMass = a.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 = S.zeros(), this.rotation = j.identity(), this.gravityScale = 1, this.linvel = S.zeros(), this.mass = 0, this.massOnly = !1, this.centerOfMass = S.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 eA(cA.Dynamic);
@@ -2625,7 +2625,7 @@ class eA {
2625
2625
  return this.angvel = A, this;
2626
2626
  }
2627
2627
  setAdditionalMassProperties(A, I, g) {
2628
- return this.mass = A, a.copy(this.centerOfMass, I), this.principalAngularInertia = g, this.massOnly = !1, this;
2628
+ return this.mass = A, S.copy(this.centerOfMass, I), this.principalAngularInertia = g, 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 Xg {
2707
2707
  this.map.forEach((I) => I.finalizeDeserialization(A));
2708
2708
  }
2709
2709
  createRigidBody(A, I) {
2710
- let g = a.intoRaw(I.translation), C = j.intoRaw(I.rotation), Q = a.intoRaw(I.linvel), E = a.intoRaw(I.centerOfMass), D = this.raw.createRigidBody(I.enabled, g, C, I.gravityScale, I.mass, I.massOnly, E, 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 g = S.intoRaw(I.translation), C = j.intoRaw(I.rotation), Q = S.intoRaw(I.linvel), E = S.intoRaw(I.centerOfMass), D = this.raw.createRigidBody(I.enabled, g, C, I.gravityScale, I.mass, I.massOnly, E, 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
  g.free(), C.free(), Q.free(), E.free();
2712
2712
  const o = new mI(this.raw, A, D);
2713
2713
  return o.userData = I.userData, this.map.set(D, o), o;
@@ -2819,9 +2819,9 @@ class nA {
2819
2819
  case pA.Fixed:
2820
2820
  return new ug(A, I, g);
2821
2821
  case pA.Spring:
2822
- return new Vg(A, I, g);
2823
- case pA.Rope:
2824
2822
  return new Pg(A, I, g);
2823
+ case pA.Rope:
2824
+ return new Vg(A, I, g);
2825
2825
  default:
2826
2826
  return new nA(A, I, g);
2827
2827
  }
@@ -2842,17 +2842,17 @@ class nA {
2842
2842
  return this.rawSet.jointType(this.handle);
2843
2843
  }
2844
2844
  anchor1() {
2845
- return a.fromRaw(this.rawSet.jointAnchor1(this.handle));
2845
+ return S.fromRaw(this.rawSet.jointAnchor1(this.handle));
2846
2846
  }
2847
2847
  anchor2() {
2848
- return a.fromRaw(this.rawSet.jointAnchor2(this.handle));
2848
+ return S.fromRaw(this.rawSet.jointAnchor2(this.handle));
2849
2849
  }
2850
2850
  setAnchor1(A) {
2851
- const I = a.intoRaw(A);
2851
+ const I = S.intoRaw(A);
2852
2852
  this.rawSet.jointSetAnchor1(this.handle, I), I.free();
2853
2853
  }
2854
2854
  setAnchor2(A) {
2855
- const I = a.intoRaw(A);
2855
+ const I = S.intoRaw(A);
2856
2856
  this.rawSet.jointSetAnchor2(this.handle, I), I.free();
2857
2857
  }
2858
2858
  setContactsEnabled(A) {
@@ -2890,10 +2890,10 @@ class $I extends nA {
2890
2890
  }
2891
2891
  class ug extends nA {
2892
2892
  }
2893
- class Pg extends nA {
2894
- }
2895
2893
  class Vg extends nA {
2896
2894
  }
2895
+ class Pg extends nA {
2896
+ }
2897
2897
  class zg extends $I {
2898
2898
  rawAxis() {
2899
2899
  return NI.LinX;
@@ -2928,7 +2928,7 @@ class bA {
2928
2928
  return C.anchor1 = A, C.anchor2 = I, C.axis = g, C.jointType = JA.Prismatic, C;
2929
2929
  }
2930
2930
  intoRaw() {
2931
- let A, I, g = a.intoRaw(this.anchor1), C = a.intoRaw(this.anchor2), Q = !1, E = 0, D = 0;
2931
+ let A, I, g = S.intoRaw(this.anchor1), C = S.intoRaw(this.anchor2), Q = !1, E = 0, D = 0;
2932
2932
  switch (this.jointType) {
2933
2933
  case JA.Fixed:
2934
2934
  let o = j.intoRaw(this.frame1), w = j.intoRaw(this.frame2);
@@ -2941,7 +2941,7 @@ class bA {
2941
2941
  I = NA.rope(this.length, g, C);
2942
2942
  break;
2943
2943
  case JA.Prismatic:
2944
- A = a.intoRaw(this.axis), this.limitsEnabled && (Q = !0, E = this.limits[0], D = this.limits[1]), I = NA.prismatic(g, C, A, Q, E, D), A.free();
2944
+ A = S.intoRaw(this.axis), this.limitsEnabled && (Q = !0, E = this.limits[0], D = this.limits[1]), I = NA.prismatic(g, C, A, Q, E, D), A.free();
2945
2945
  break;
2946
2946
  case JA.Revolute:
2947
2947
  I = NA.revolute(g, C);
@@ -3096,7 +3096,7 @@ class BC {
3096
3096
  }
3097
3097
  (function(i) {
3098
3098
  i[i.Vertex = 0] = "Vertex", i[i.Face = 1] = "Face", i[i.Unknown = 2] = "Unknown";
3099
- })(mA || (mA = {}));
3099
+ })(XA || (XA = {}));
3100
3100
  class rC {
3101
3101
  constructor(A, I) {
3102
3102
  this.origin = A, this.dir = I;
@@ -3107,21 +3107,21 @@ class rC {
3107
3107
  }
3108
3108
  class BI {
3109
3109
  constructor(A, I, g, C) {
3110
- this.featureType = mA.Unknown, this.featureId = void 0, this.timeOfImpact = A, this.normal = I, C !== void 0 && (this.featureId = C), g !== void 0 && (this.featureType = g);
3110
+ this.featureType = XA.Unknown, this.featureId = void 0, this.timeOfImpact = A, this.normal = I, C !== void 0 && (this.featureId = C), g !== void 0 && (this.featureType = g);
3111
3111
  }
3112
3112
  static fromRaw(A) {
3113
3113
  if (!A) return null;
3114
- const I = new BI(A.time_of_impact(), a.fromRaw(A.normal()), A.featureType(), A.featureId());
3114
+ const I = new BI(A.time_of_impact(), S.fromRaw(A.normal()), A.featureType(), A.featureId());
3115
3115
  return A.free(), I;
3116
3116
  }
3117
3117
  }
3118
3118
  class CI {
3119
3119
  constructor(A, I, g, C, Q) {
3120
- this.featureType = mA.Unknown, this.featureId = void 0, this.collider = A, this.timeOfImpact = I, this.normal = g, Q !== void 0 && (this.featureId = Q), C !== void 0 && (this.featureType = C);
3120
+ this.featureType = XA.Unknown, this.featureId = void 0, this.collider = A, this.timeOfImpact = I, this.normal = g, Q !== void 0 && (this.featureId = Q), C !== void 0 && (this.featureType = C);
3121
3121
  }
3122
3122
  static fromRaw(A, I) {
3123
3123
  if (!I) return null;
3124
- const g = new CI(A.get(I.colliderHandle()), I.time_of_impact(), a.fromRaw(I.normal()), I.featureType(), I.featureId());
3124
+ const g = new CI(A.get(I.colliderHandle()), I.time_of_impact(), S.fromRaw(I.normal()), I.featureType(), I.featureId());
3125
3125
  return I.free(), g;
3126
3126
  }
3127
3127
  }
@@ -3141,37 +3141,37 @@ class EI {
3141
3141
  }
3142
3142
  static fromRaw(A) {
3143
3143
  if (!A) return null;
3144
- const I = new EI(a.fromRaw(A.point()), A.isInside());
3144
+ const I = new EI(S.fromRaw(A.point()), A.isInside());
3145
3145
  return A.free(), I;
3146
3146
  }
3147
3147
  }
3148
3148
  class QI {
3149
3149
  constructor(A, I, g, C, Q) {
3150
- this.featureType = mA.Unknown, this.featureId = void 0, this.collider = A, this.point = I, this.isInside = g, Q !== void 0 && (this.featureId = Q), C !== void 0 && (this.featureType = C);
3150
+ this.featureType = XA.Unknown, this.featureId = void 0, this.collider = A, this.point = I, this.isInside = g, Q !== void 0 && (this.featureId = Q), C !== void 0 && (this.featureType = C);
3151
3151
  }
3152
3152
  static fromRaw(A, I) {
3153
3153
  if (!I) return null;
3154
- const g = new QI(A.get(I.colliderHandle()), a.fromRaw(I.point()), I.isInside(), I.featureType(), I.featureId());
3154
+ const g = new QI(A.get(I.colliderHandle()), S.fromRaw(I.point()), I.isInside(), I.featureType(), I.featureId());
3155
3155
  return I.free(), g;
3156
3156
  }
3157
3157
  }
3158
- class vA {
3158
+ class uA {
3159
3159
  constructor(A, I, g, C, Q) {
3160
3160
  this.time_of_impact = A, this.witness1 = I, this.witness2 = g, this.normal1 = C, this.normal2 = Q;
3161
3161
  }
3162
3162
  static fromRaw(A, I) {
3163
3163
  if (!I) return null;
3164
- const g = new vA(I.time_of_impact(), a.fromRaw(I.witness1()), a.fromRaw(I.witness2()), a.fromRaw(I.normal1()), a.fromRaw(I.normal2()));
3164
+ const g = new uA(I.time_of_impact(), S.fromRaw(I.witness1()), S.fromRaw(I.witness2()), S.fromRaw(I.normal1()), S.fromRaw(I.normal2()));
3165
3165
  return I.free(), g;
3166
3166
  }
3167
3167
  }
3168
- class iI extends vA {
3168
+ class iI extends uA {
3169
3169
  constructor(A, I, g, C, Q, E) {
3170
3170
  super(I, g, C, Q, E), this.collider = A;
3171
3171
  }
3172
3172
  static fromRaw(A, I) {
3173
3173
  if (!I) return null;
3174
- const g = new iI(A.get(I.colliderHandle()), I.time_of_impact(), a.fromRaw(I.witness1()), a.fromRaw(I.witness2()), a.fromRaw(I.normal1()), a.fromRaw(I.normal2()));
3174
+ const g = new iI(A.get(I.colliderHandle()), I.time_of_impact(), S.fromRaw(I.witness1()), S.fromRaw(I.witness2()), S.fromRaw(I.normal1()), S.fromRaw(I.normal2()));
3175
3175
  return I.free(), g;
3176
3176
  }
3177
3177
  }
@@ -3182,44 +3182,44 @@ class EC {
3182
3182
  free() {
3183
3183
  this.raw && this.raw.free(), this.raw = void 0;
3184
3184
  }
3185
- castRay(A, I, g, C, Q, E, D, o, w, h, G) {
3186
- let S = a.intoRaw(C.origin), K = a.intoRaw(C.dir), M = RI.fromRaw(g, this.raw.castRay(A.raw, I.raw, g.raw, S, K, Q, E, D, o, w, h, G));
3187
- return S.free(), K.free(), M;
3185
+ castRay(A, I, g, C, Q, E, D, o, w, G, h) {
3186
+ let K = S.intoRaw(C.origin), N = S.intoRaw(C.dir), M = RI.fromRaw(g, this.raw.castRay(A.raw, I.raw, g.raw, K, N, Q, E, D, o, w, G, h));
3187
+ return K.free(), N.free(), M;
3188
3188
  }
3189
- castRayAndGetNormal(A, I, g, C, Q, E, D, o, w, h, G) {
3190
- let S = a.intoRaw(C.origin), K = a.intoRaw(C.dir), M = CI.fromRaw(g, this.raw.castRayAndGetNormal(A.raw, I.raw, g.raw, S, K, Q, E, D, o, w, h, G));
3191
- return S.free(), K.free(), M;
3189
+ castRayAndGetNormal(A, I, g, C, Q, E, D, o, w, G, h) {
3190
+ let K = S.intoRaw(C.origin), N = S.intoRaw(C.dir), M = CI.fromRaw(g, this.raw.castRayAndGetNormal(A.raw, I.raw, g.raw, K, N, Q, E, D, o, w, G, h));
3191
+ return K.free(), N.free(), M;
3192
3192
  }
3193
- intersectionsWithRay(A, I, g, C, Q, E, D, o, w, h, G, S) {
3194
- let K = a.intoRaw(C.origin), M = a.intoRaw(C.dir);
3195
- this.raw.intersectionsWithRay(A.raw, I.raw, g.raw, K, M, Q, E, (F) => D(CI.fromRaw(g, F)), o, w, h, G, S), K.free(), M.free();
3193
+ intersectionsWithRay(A, I, g, C, Q, E, D, o, w, G, h, K) {
3194
+ let N = S.intoRaw(C.origin), M = S.intoRaw(C.dir);
3195
+ this.raw.intersectionsWithRay(A.raw, I.raw, g.raw, N, M, Q, E, (F) => D(CI.fromRaw(g, F)), o, w, G, h, K), N.free(), M.free();
3196
3196
  }
3197
- intersectionWithShape(A, I, g, C, Q, E, D, o, w, h, G) {
3198
- let S = a.intoRaw(C), K = j.intoRaw(Q), M = E.intoRaw(), F = this.raw.intersectionWithShape(A.raw, I.raw, g.raw, S, K, M, D, o, w, h, G);
3199
- return S.free(), K.free(), M.free(), F;
3197
+ intersectionWithShape(A, I, g, C, Q, E, D, o, w, G, h) {
3198
+ let K = S.intoRaw(C), N = j.intoRaw(Q), M = E.intoRaw(), F = this.raw.intersectionWithShape(A.raw, I.raw, g.raw, K, N, M, D, o, w, G, h);
3199
+ return K.free(), N.free(), M.free(), F;
3200
3200
  }
3201
- projectPoint(A, I, g, C, Q, E, D, o, w, h) {
3202
- let G = a.intoRaw(C), S = QI.fromRaw(g, this.raw.projectPoint(A.raw, I.raw, g.raw, G, Q, E, D, o, w, h));
3203
- return G.free(), S;
3201
+ projectPoint(A, I, g, C, Q, E, D, o, w, G) {
3202
+ let h = S.intoRaw(C), K = QI.fromRaw(g, this.raw.projectPoint(A.raw, I.raw, g.raw, h, Q, E, D, o, w, G));
3203
+ return h.free(), K;
3204
3204
  }
3205
3205
  projectPointAndGetFeature(A, I, g, C, Q, E, D, o, w) {
3206
- let h = a.intoRaw(C), G = QI.fromRaw(g, this.raw.projectPointAndGetFeature(A.raw, I.raw, g.raw, h, Q, E, D, o, w));
3207
- return h.free(), G;
3206
+ let G = S.intoRaw(C), h = QI.fromRaw(g, this.raw.projectPointAndGetFeature(A.raw, I.raw, g.raw, G, Q, E, D, o, w));
3207
+ return G.free(), h;
3208
3208
  }
3209
- intersectionsWithPoint(A, I, g, C, Q, E, D, o, w, h) {
3210
- let G = a.intoRaw(C);
3211
- this.raw.intersectionsWithPoint(A.raw, I.raw, g.raw, G, Q, E, D, o, w, h), G.free();
3209
+ intersectionsWithPoint(A, I, g, C, Q, E, D, o, w, G) {
3210
+ let h = S.intoRaw(C);
3211
+ this.raw.intersectionsWithPoint(A.raw, I.raw, g.raw, h, Q, E, D, o, w, G), h.free();
3212
3212
  }
3213
- castShape(A, I, g, C, Q, E, D, o, w, h, G, S, K, M, F) {
3214
- let J = a.intoRaw(C), k = j.intoRaw(Q), y = a.intoRaw(E), U = D.intoRaw(), R = iI.fromRaw(g, this.raw.castShape(A.raw, I.raw, g.raw, J, k, y, U, o, w, h, G, S, K, M, F));
3215
- return J.free(), k.free(), y.free(), U.free(), R;
3213
+ castShape(A, I, g, C, Q, E, D, o, w, G, h, K, N, M, F) {
3214
+ let J = S.intoRaw(C), y = j.intoRaw(Q), k = S.intoRaw(E), U = D.intoRaw(), R = iI.fromRaw(g, this.raw.castShape(A.raw, I.raw, g.raw, J, y, k, U, o, w, G, h, K, N, M, F));
3215
+ return J.free(), y.free(), k.free(), U.free(), R;
3216
3216
  }
3217
- intersectionsWithShape(A, I, g, C, Q, E, D, o, w, h, G, S) {
3218
- let K = a.intoRaw(C), M = j.intoRaw(Q), F = E.intoRaw();
3219
- this.raw.intersectionsWithShape(A.raw, I.raw, g.raw, K, M, F, D, o, w, h, G, S), K.free(), M.free(), F.free();
3217
+ intersectionsWithShape(A, I, g, C, Q, E, D, o, w, G, h, K) {
3218
+ let N = S.intoRaw(C), M = j.intoRaw(Q), F = E.intoRaw();
3219
+ this.raw.intersectionsWithShape(A.raw, I.raw, g.raw, N, M, F, D, o, w, G, h, K), N.free(), M.free(), F.free();
3220
3220
  }
3221
3221
  collidersWithAabbIntersectingAabb(A, I, g, C, Q, E) {
3222
- let D = a.intoRaw(C), o = a.intoRaw(Q);
3222
+ let D = S.intoRaw(C), o = S.intoRaw(Q);
3223
3223
  this.raw.collidersWithAabbIntersectingAabb(A.raw, I.raw, g.raw, D, o, E), D.free(), o.free();
3224
3224
  }
3225
3225
  }
@@ -3257,13 +3257,13 @@ class DC {
3257
3257
  this.raw && this.raw.free(), this.raw = void 0;
3258
3258
  }
3259
3259
  normal() {
3260
- return a.fromRaw(this.raw.normal());
3260
+ return S.fromRaw(this.raw.normal());
3261
3261
  }
3262
3262
  localNormal1() {
3263
- return a.fromRaw(this.raw.local_n1());
3263
+ return S.fromRaw(this.raw.local_n1());
3264
3264
  }
3265
3265
  localNormal2() {
3266
- return a.fromRaw(this.raw.local_n2());
3266
+ return S.fromRaw(this.raw.local_n2());
3267
3267
  }
3268
3268
  subshape1() {
3269
3269
  return this.raw.subshape1();
@@ -3275,10 +3275,10 @@ class DC {
3275
3275
  return this.raw.num_contacts();
3276
3276
  }
3277
3277
  localContactPoint1(A) {
3278
- return a.fromRaw(this.raw.contact_local_p1(A));
3278
+ return S.fromRaw(this.raw.contact_local_p1(A));
3279
3279
  }
3280
3280
  localContactPoint2(A) {
3281
- return a.fromRaw(this.raw.contact_local_p2(A));
3281
+ return S.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 DC {
3299
3299
  return this.raw.num_solver_contacts();
3300
3300
  }
3301
3301
  solverContactPoint(A) {
3302
- return a.fromRaw(this.raw.solver_contact_point(A));
3302
+ return S.fromRaw(this.raw.solver_contact_point(A));
3303
3303
  }
3304
3304
  solverContactDist(A) {
3305
3305
  return this.raw.solver_contact_dist(A);
@@ -3311,23 +3311,23 @@ class DC {
3311
3311
  return this.raw.solver_contact_restitution(A);
3312
3312
  }
3313
3313
  solverContactTangentVelocity(A) {
3314
- return a.fromRaw(this.raw.solver_contact_tangent_velocity(A));
3314
+ return S.fromRaw(this.raw.solver_contact_tangent_velocity(A));
3315
3315
  }
3316
3316
  }
3317
- class XA {
3317
+ class vA {
3318
3318
  constructor(A, I, g, C, Q) {
3319
3319
  this.distance = A, this.point1 = I, this.point2 = g, this.normal1 = C, this.normal2 = Q;
3320
3320
  }
3321
3321
  static fromRaw(A) {
3322
3322
  if (!A) return null;
3323
- const I = new XA(A.distance(), a.fromRaw(A.point1()), a.fromRaw(A.point2()), a.fromRaw(A.normal1()), a.fromRaw(A.normal2()));
3323
+ const I = new vA(A.distance(), S.fromRaw(A.point1()), S.fromRaw(A.point2()), S.fromRaw(A.normal1()), S.fromRaw(A.normal2()));
3324
3324
  return A.free(), I;
3325
3325
  }
3326
3326
  }
3327
3327
  class SA {
3328
3328
  static fromRaw(A, I) {
3329
3329
  const g = A.coShapeType(I);
3330
- let C, Q, E, D, o, w, h;
3330
+ let C, Q, E, D, o, w, G;
3331
3331
  switch (g) {
3332
3332
  case aA.Ball:
3333
3333
  return new Ig(A.coRadius(I));
@@ -3338,22 +3338,22 @@ class SA {
3338
3338
  case aA.Capsule:
3339
3339
  return o = A.coHalfHeight(I), w = A.coRadius(I), new Bg(o, w);
3340
3340
  case aA.Segment:
3341
- return E = A.coVertices(I), new Eg(a.new(E[0], E[1]), a.new(E[2], E[3]));
3341
+ return E = A.coVertices(I), new Eg(S.new(E[0], E[1]), S.new(E[2], E[3]));
3342
3342
  case aA.Polyline:
3343
3343
  return E = A.coVertices(I), D = A.coIndices(I), new og(E, D);
3344
3344
  case aA.Triangle:
3345
- return E = A.coVertices(I), new ig(a.new(E[0], E[1]), a.new(E[2], E[3]), a.new(E[4], E[5]));
3345
+ return E = A.coVertices(I), new ig(S.new(E[0], E[1]), S.new(E[2], E[3]), S.new(E[4], E[5]));
3346
3346
  case aA.RoundTriangle:
3347
- return E = A.coVertices(I), Q = A.coRoundRadius(I), new Dg(a.new(E[0], E[1]), a.new(E[2], E[3]), a.new(E[4], E[5]), Q);
3347
+ return E = A.coVertices(I), Q = A.coRoundRadius(I), new Dg(S.new(E[0], E[1]), S.new(E[2], E[3]), S.new(E[4], E[5]), Q);
3348
3348
  case aA.HalfSpace:
3349
- return h = a.fromRaw(A.coHalfspaceNormal(I)), new gg(h);
3349
+ return G = S.fromRaw(A.coHalfspaceNormal(I)), new gg(G);
3350
3350
  case aA.Voxels:
3351
- const G = A.coVoxelData(I), S = A.coVoxelSize(I);
3352
- return new wg(G, S);
3351
+ const h = A.coVoxelData(I), K = A.coVoxelSize(I);
3352
+ return new wg(h, K);
3353
3353
  case aA.TriMesh:
3354
3354
  E = A.coVertices(I), D = A.coIndices(I);
3355
- const K = A.coTriMeshFlags(I);
3356
- return new Gg(E, D, K);
3355
+ const N = A.coTriMeshFlags(I);
3356
+ return new Gg(E, D, N);
3357
3357
  case aA.HeightField:
3358
3358
  const M = A.coHeightfieldScale(I), F = A.coHeightfieldHeights(I);
3359
3359
  return new hg(F, M);
@@ -3365,37 +3365,37 @@ class SA {
3365
3365
  throw new Error("unknown shape type: " + g);
3366
3366
  }
3367
3367
  }
3368
- castShape(A, I, g, C, Q, E, D, o, w, h) {
3369
- let G = a.intoRaw(A), S = j.intoRaw(I), K = a.intoRaw(g), M = a.intoRaw(Q), F = j.intoRaw(E), J = a.intoRaw(D), k = this.intoRaw(), y = C.intoRaw(), U = vA.fromRaw(null, k.castShape(G, S, K, y, M, F, J, o, w, h));
3370
- return G.free(), S.free(), K.free(), M.free(), F.free(), J.free(), k.free(), y.free(), U;
3368
+ castShape(A, I, g, C, Q, E, D, o, w, G) {
3369
+ let h = S.intoRaw(A), K = j.intoRaw(I), N = S.intoRaw(g), M = S.intoRaw(Q), F = j.intoRaw(E), J = S.intoRaw(D), y = this.intoRaw(), k = C.intoRaw(), U = uA.fromRaw(null, y.castShape(h, K, N, k, M, F, J, o, w, G));
3370
+ return h.free(), K.free(), N.free(), M.free(), F.free(), J.free(), y.free(), k.free(), U;
3371
3371
  }
3372
3372
  intersectsShape(A, I, g, C, Q) {
3373
- let E = a.intoRaw(A), D = j.intoRaw(I), o = a.intoRaw(C), w = j.intoRaw(Q), h = this.intoRaw(), G = g.intoRaw(), S = h.intersectsShape(E, D, G, o, w);
3374
- return E.free(), D.free(), o.free(), w.free(), h.free(), G.free(), S;
3373
+ let E = S.intoRaw(A), D = j.intoRaw(I), o = S.intoRaw(C), w = j.intoRaw(Q), G = this.intoRaw(), h = g.intoRaw(), K = G.intersectsShape(E, D, h, o, w);
3374
+ return E.free(), D.free(), o.free(), w.free(), G.free(), h.free(), K;
3375
3375
  }
3376
3376
  contactShape(A, I, g, C, Q, E) {
3377
- let D = a.intoRaw(A), o = j.intoRaw(I), w = a.intoRaw(C), h = j.intoRaw(Q), G = this.intoRaw(), S = g.intoRaw(), K = XA.fromRaw(G.contactShape(D, o, S, w, h, E));
3378
- return D.free(), o.free(), w.free(), h.free(), G.free(), S.free(), K;
3377
+ let D = S.intoRaw(A), o = j.intoRaw(I), w = S.intoRaw(C), G = j.intoRaw(Q), h = this.intoRaw(), K = g.intoRaw(), N = vA.fromRaw(h.contactShape(D, o, K, w, G, E));
3378
+ return D.free(), o.free(), w.free(), G.free(), h.free(), K.free(), N;
3379
3379
  }
3380
3380
  containsPoint(A, I, g) {
3381
- let C = a.intoRaw(A), Q = j.intoRaw(I), E = a.intoRaw(g), D = this.intoRaw(), o = D.containsPoint(C, Q, E);
3381
+ let C = S.intoRaw(A), Q = j.intoRaw(I), E = S.intoRaw(g), D = this.intoRaw(), o = D.containsPoint(C, Q, E);
3382
3382
  return C.free(), Q.free(), E.free(), D.free(), o;
3383
3383
  }
3384
3384
  projectPoint(A, I, g, C) {
3385
- let Q = a.intoRaw(A), E = j.intoRaw(I), D = a.intoRaw(g), o = this.intoRaw(), w = EI.fromRaw(o.projectPoint(Q, E, D, C));
3385
+ let Q = S.intoRaw(A), E = j.intoRaw(I), D = S.intoRaw(g), o = this.intoRaw(), w = EI.fromRaw(o.projectPoint(Q, E, D, C));
3386
3386
  return Q.free(), E.free(), D.free(), o.free(), w;
3387
3387
  }
3388
3388
  intersectsRay(A, I, g, C) {
3389
- let Q = a.intoRaw(I), E = j.intoRaw(g), D = a.intoRaw(A.origin), o = a.intoRaw(A.dir), w = this.intoRaw(), h = w.intersectsRay(Q, E, D, o, C);
3390
- return Q.free(), E.free(), D.free(), o.free(), w.free(), h;
3389
+ let Q = S.intoRaw(I), E = j.intoRaw(g), D = S.intoRaw(A.origin), o = S.intoRaw(A.dir), w = this.intoRaw(), G = w.intersectsRay(Q, E, D, o, C);
3390
+ return Q.free(), E.free(), D.free(), o.free(), w.free(), G;
3391
3391
  }
3392
3392
  castRay(A, I, g, C, Q) {
3393
- let E = a.intoRaw(I), D = j.intoRaw(g), o = a.intoRaw(A.origin), w = a.intoRaw(A.dir), h = this.intoRaw(), G = h.castRay(E, D, o, w, C, Q);
3394
- return E.free(), D.free(), o.free(), w.free(), h.free(), G;
3393
+ let E = S.intoRaw(I), D = j.intoRaw(g), o = S.intoRaw(A.origin), w = S.intoRaw(A.dir), G = this.intoRaw(), h = G.castRay(E, D, o, w, C, Q);
3394
+ return E.free(), D.free(), o.free(), w.free(), G.free(), h;
3395
3395
  }
3396
3396
  castRayAndGetNormal(A, I, g, C, Q) {
3397
- let E = a.intoRaw(I), D = j.intoRaw(g), o = a.intoRaw(A.origin), w = a.intoRaw(A.dir), h = this.intoRaw(), G = BI.fromRaw(h.castRayAndGetNormal(E, D, o, w, C, Q));
3398
- return E.free(), D.free(), o.free(), w.free(), h.free(), G;
3397
+ let E = S.intoRaw(I), D = j.intoRaw(g), o = S.intoRaw(A.origin), w = S.intoRaw(A.dir), G = this.intoRaw(), h = BI.fromRaw(G.castRayAndGetNormal(E, D, o, w, C, Q));
3398
+ return E.free(), D.free(), o.free(), w.free(), G.free(), h;
3399
3399
  }
3400
3400
  }
3401
3401
  (function(i) {
@@ -3408,7 +3408,7 @@ class Ig extends SA {
3408
3408
  super(), this.type = sA.Ball, this.radius = A;
3409
3409
  }
3410
3410
  intoRaw() {
3411
- return e.ball(this.radius);
3411
+ return r.ball(this.radius);
3412
3412
  }
3413
3413
  }
3414
3414
  class gg extends SA {
@@ -3416,24 +3416,24 @@ class gg extends SA {
3416
3416
  super(), this.type = sA.HalfSpace, this.normal = A;
3417
3417
  }
3418
3418
  intoRaw() {
3419
- let A = a.intoRaw(this.normal), I = e.halfspace(A);
3419
+ let A = S.intoRaw(this.normal), I = r.halfspace(A);
3420
3420
  return A.free(), I;
3421
3421
  }
3422
3422
  }
3423
3423
  class Cg extends SA {
3424
3424
  constructor(A, I) {
3425
- super(), this.type = sA.Cuboid, this.halfExtents = a.new(A, I);
3425
+ super(), this.type = sA.Cuboid, this.halfExtents = S.new(A, I);
3426
3426
  }
3427
3427
  intoRaw() {
3428
- return e.cuboid(this.halfExtents.x, this.halfExtents.y);
3428
+ return r.cuboid(this.halfExtents.x, this.halfExtents.y);
3429
3429
  }
3430
3430
  }
3431
3431
  class Qg extends SA {
3432
3432
  constructor(A, I, g) {
3433
- super(), this.type = sA.RoundCuboid, this.halfExtents = a.new(A, I), this.borderRadius = g;
3433
+ super(), this.type = sA.RoundCuboid, this.halfExtents = S.new(A, I), this.borderRadius = g;
3434
3434
  }
3435
3435
  intoRaw() {
3436
- return e.roundCuboid(this.halfExtents.x, this.halfExtents.y, this.borderRadius);
3436
+ return r.roundCuboid(this.halfExtents.x, this.halfExtents.y, this.borderRadius);
3437
3437
  }
3438
3438
  }
3439
3439
  class Bg extends SA {
@@ -3441,7 +3441,7 @@ class Bg extends SA {
3441
3441
  super(), this.type = sA.Capsule, this.halfHeight = A, this.radius = I;
3442
3442
  }
3443
3443
  intoRaw() {
3444
- return e.capsule(this.halfHeight, this.radius);
3444
+ return r.capsule(this.halfHeight, this.radius);
3445
3445
  }
3446
3446
  }
3447
3447
  class Eg extends SA {
@@ -3449,7 +3449,7 @@ class Eg extends SA {
3449
3449
  super(), this.type = sA.Segment, this.a = A, this.b = I;
3450
3450
  }
3451
3451
  intoRaw() {
3452
- let A = a.intoRaw(this.a), I = a.intoRaw(this.b), g = e.segment(A, I);
3452
+ let A = S.intoRaw(this.a), I = S.intoRaw(this.b), g = r.segment(A, I);
3453
3453
  return A.free(), I.free(), g;
3454
3454
  }
3455
3455
  }
@@ -3458,7 +3458,7 @@ class ig extends SA {
3458
3458
  super(), this.type = sA.Triangle, this.a = A, this.b = I, this.c = g;
3459
3459
  }
3460
3460
  intoRaw() {
3461
- let A = a.intoRaw(this.a), I = a.intoRaw(this.b), g = a.intoRaw(this.c), C = e.triangle(A, I, g);
3461
+ let A = S.intoRaw(this.a), I = S.intoRaw(this.b), g = S.intoRaw(this.c), C = r.triangle(A, I, g);
3462
3462
  return A.free(), I.free(), g.free(), C;
3463
3463
  }
3464
3464
  }
@@ -3467,7 +3467,7 @@ class Dg extends SA {
3467
3467
  super(), this.type = sA.RoundTriangle, this.a = A, this.b = I, this.c = g, this.borderRadius = C;
3468
3468
  }
3469
3469
  intoRaw() {
3470
- let A = a.intoRaw(this.a), I = a.intoRaw(this.b), g = a.intoRaw(this.c), C = e.roundTriangle(A, I, g, this.borderRadius);
3470
+ let A = S.intoRaw(this.a), I = S.intoRaw(this.b), g = S.intoRaw(this.c), C = r.roundTriangle(A, I, g, this.borderRadius);
3471
3471
  return A.free(), I.free(), g.free(), C;
3472
3472
  }
3473
3473
  }
@@ -3476,7 +3476,7 @@ class og extends SA {
3476
3476
  super(), this.type = sA.Polyline, this.vertices = A, this.indices = I ?? new Uint32Array(0);
3477
3477
  }
3478
3478
  intoRaw() {
3479
- return e.polyline(this.vertices, this.indices);
3479
+ return r.polyline(this.vertices, this.indices);
3480
3480
  }
3481
3481
  }
3482
3482
  class wg extends SA {
@@ -3484,8 +3484,8 @@ class wg extends SA {
3484
3484
  super(), this.type = sA.Voxels, this.data = A, this.voxelSize = I;
3485
3485
  }
3486
3486
  intoRaw() {
3487
- let A, I = a.intoRaw(this.voxelSize);
3488
- return A = this.data instanceof Int32Array ? e.voxels(I, this.data) : e.voxelsFromPoints(I, this.data), I.free(), A;
3487
+ let A, I = S.intoRaw(this.voxelSize);
3488
+ return A = this.data instanceof Int32Array ? r.voxels(I, this.data) : r.voxelsFromPoints(I, this.data), I.free(), A;
3489
3489
  }
3490
3490
  }
3491
3491
  class Gg extends SA {
@@ -3493,7 +3493,7 @@ class Gg extends SA {
3493
3493
  super(), this.type = sA.TriMesh, this.vertices = A, this.indices = I, this.flags = g;
3494
3494
  }
3495
3495
  intoRaw() {
3496
- return e.trimesh(this.vertices, this.indices, this.flags);
3496
+ return r.trimesh(this.vertices, this.indices, this.flags);
3497
3497
  }
3498
3498
  }
3499
3499
  class SI extends SA {
@@ -3501,7 +3501,7 @@ class SI extends SA {
3501
3501
  super(), this.type = sA.ConvexPolygon, this.vertices = A, this.skipConvexHullComputation = !!I;
3502
3502
  }
3503
3503
  intoRaw() {
3504
- return this.skipConvexHullComputation ? e.convexPolyline(this.vertices) : e.convexHull(this.vertices);
3504
+ return this.skipConvexHullComputation ? r.convexPolyline(this.vertices) : r.convexHull(this.vertices);
3505
3505
  }
3506
3506
  }
3507
3507
  class aI extends SA {
@@ -3509,7 +3509,7 @@ class aI extends SA {
3509
3509
  super(), this.type = sA.RoundConvexPolygon, this.vertices = A, this.borderRadius = I, this.skipConvexHullComputation = !!g;
3510
3510
  }
3511
3511
  intoRaw() {
3512
- return this.skipConvexHullComputation ? e.roundConvexPolyline(this.vertices, this.borderRadius) : e.roundConvexHull(this.vertices, this.borderRadius);
3512
+ return this.skipConvexHullComputation ? r.roundConvexPolyline(this.vertices, this.borderRadius) : r.roundConvexHull(this.vertices, this.borderRadius);
3513
3513
  }
3514
3514
  }
3515
3515
  class hg extends SA {
@@ -3517,7 +3517,7 @@ class hg extends SA {
3517
3517
  super(), this.type = sA.HeightField, this.heights = A, this.scale = I;
3518
3518
  }
3519
3519
  intoRaw() {
3520
- let A = a.intoRaw(this.scale), I = e.heightfield(this.heights, A);
3520
+ let A = S.intoRaw(this.scale), I = r.heightfield(this.heights, A);
3521
3521
  return A.free(), I;
3522
3522
  }
3523
3523
  }
@@ -3528,9 +3528,9 @@ class oC {
3528
3528
  free() {
3529
3529
  this.raw && this.raw.free(), this.raw = void 0;
3530
3530
  }
3531
- step(A, I, g, C, Q, E, D, o, w, h, G, S) {
3532
- let K = a.intoRaw(A);
3533
- G ? this.raw.stepWithEvents(K, I.raw, g.raw, C.raw, Q.raw, E.raw, D.raw, o.raw, w.raw, h.raw, G.raw, S, S ? S.filterContactPair : null, S ? S.filterIntersectionPair : null) : this.raw.step(K, I.raw, g.raw, C.raw, Q.raw, E.raw, D.raw, o.raw, w.raw, h.raw), K.free();
3531
+ step(A, I, g, C, Q, E, D, o, w, G, h, K) {
3532
+ let N = S.intoRaw(A);
3533
+ h ? this.raw.stepWithEvents(N, I.raw, g.raw, C.raw, Q.raw, E.raw, D.raw, o.raw, w.raw, G.raw, h.raw, K, K ? K.filterContactPair : null, K ? K.filterIntersectionPair : null) : this.raw.step(N, I.raw, g.raw, C.raw, Q.raw, E.raw, D.raw, o.raw, w.raw, G.raw), N.free();
3534
3534
  }
3535
3535
  }
3536
3536
  class XI {
@@ -3541,9 +3541,9 @@ class XI {
3541
3541
  this.raw && this.raw.free(), this.raw = void 0;
3542
3542
  }
3543
3543
  serializeAll(A, I, g, C, Q, E, D, o, w) {
3544
- let h = a.intoRaw(A);
3545
- const G = this.raw.serializeAll(h, I.raw, g.raw, C.raw, Q.raw, E.raw, D.raw, o.raw, w.raw);
3546
- return h.free(), G;
3544
+ let G = S.intoRaw(A);
3545
+ const h = this.raw.serializeAll(G, I.raw, g.raw, C.raw, Q.raw, E.raw, D.raw, o.raw, w.raw);
3546
+ return G.free(), h;
3547
3547
  }
3548
3548
  deserializeAll(A) {
3549
3549
  return cI.fromRaw(this.raw.deserializeAll(A));
@@ -3578,7 +3578,7 @@ class sC {
3578
3578
  return this.raw.up();
3579
3579
  }
3580
3580
  setUp(A) {
3581
- let I = a.intoRaw(A);
3581
+ let I = S.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, g, C, Q) {
3657
- let E = a.intoRaw(I);
3657
+ let E = S.intoRaw(I);
3658
3658
  this.raw.computeColliderMovement(this.params.dt, this.broadPhase.raw, this.narrowPhase.raw, this.bodies.raw, this.colliders.raw, A.handle, E, this._applyImpulsesToDynamicBodies, this._characterMass, g, C, this.colliders.castClosure(Q)), E.free();
3659
3659
  }
3660
3660
  computedMovement() {
3661
- return a.fromRaw(this.raw.computedMovement());
3661
+ return S.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 g = this.rawCharacterCollision;
3672
- return (I = I ?? new hC()).translationDeltaApplied = a.fromRaw(g.translationDeltaApplied()), I.translationDeltaRemaining = a.fromRaw(g.translationDeltaRemaining()), I.toi = g.toi(), I.witness1 = a.fromRaw(g.worldWitness1()), I.witness2 = a.fromRaw(g.worldWitness2()), I.normal1 = a.fromRaw(g.worldNormal1()), I.normal2 = a.fromRaw(g.worldNormal2()), I.collider = this.colliders.get(g.handle()), I;
3672
+ return (I = I ?? new hC()).translationDeltaApplied = S.fromRaw(g.translationDeltaApplied()), I.translationDeltaRemaining = S.fromRaw(g.translationDeltaRemaining()), I.toi = g.toi(), I.witness1 = S.fromRaw(g.worldWitness1()), I.witness2 = S.fromRaw(g.worldWitness2()), I.normal1 = S.fromRaw(g.worldNormal1()), I.normal2 = S.fromRaw(g.worldNormal2()), I.collider = this.colliders.get(g.handle()), I;
3673
3673
  }
3674
3674
  return null;
3675
3675
  }
@@ -3700,29 +3700,29 @@ class KC {
3700
3700
  this.raw.reset_integrals();
3701
3701
  }
3702
3702
  applyLinearCorrection(A, I, g) {
3703
- let C = a.intoRaw(I), Q = a.intoRaw(g);
3703
+ let C = S.intoRaw(I), Q = S.intoRaw(g);
3704
3704
  this.raw.apply_linear_correction(this.params.dt, this.bodies.raw, A.handle, C, Q), C.free(), Q.free();
3705
3705
  }
3706
3706
  applyAngularCorrection(A, I, g) {
3707
3707
  this.raw.apply_angular_correction(this.params.dt, this.bodies.raw, A.handle, I, g);
3708
3708
  }
3709
3709
  linearCorrection(A, I, g) {
3710
- let C = a.intoRaw(I), Q = a.intoRaw(g), E = this.raw.linear_correction(this.params.dt, this.bodies.raw, A.handle, C, Q);
3711
- return C.free(), Q.free(), a.fromRaw(E);
3710
+ let C = S.intoRaw(I), Q = S.intoRaw(g), E = this.raw.linear_correction(this.params.dt, this.bodies.raw, A.handle, C, Q);
3711
+ return C.free(), Q.free(), S.fromRaw(E);
3712
3712
  }
3713
3713
  angularCorrection(A, I, g) {
3714
3714
  return this.raw.angular_correction(this.params.dt, this.bodies.raw, A.handle, I, g);
3715
3715
  }
3716
3716
  }
3717
3717
  class cI {
3718
- constructor(A, I, g, C, Q, E, D, o, w, h, G, S, K) {
3719
- this.gravity = A, this.integrationParameters = new vg(I), this.islands = new BC(g), this.broadPhase = new EC(C), this.narrowPhase = new iC(Q), this.bodies = new Xg(E), this.colliders = new aC(D), this.impulseJoints = new $g(o), this.multibodyJoints = new CC(w), this.ccdSolver = new QC(h), this.physicsPipeline = new oC(G), this.serializationPipeline = new XI(S), this.debugRenderPipeline = new GC(K), this.characterControllers = /* @__PURE__ */ new Set(), this.pidControllers = /* @__PURE__ */ new Set(), this.impulseJoints.finalizeDeserialization(this.bodies), this.bodies.finalizeDeserialization(this.colliders), this.colliders.finalizeDeserialization(this.bodies);
3718
+ constructor(A, I, g, C, Q, E, D, o, w, G, h, K, N) {
3719
+ this.gravity = A, this.integrationParameters = new vg(I), this.islands = new BC(g), this.broadPhase = new EC(C), this.narrowPhase = new iC(Q), this.bodies = new Xg(E), this.colliders = new aC(D), this.impulseJoints = new $g(o), this.multibodyJoints = new CC(w), this.ccdSolver = new QC(G), this.physicsPipeline = new oC(h), this.serializationPipeline = new XI(K), this.debugRenderPipeline = new GC(N), this.characterControllers = /* @__PURE__ */ new Set(), this.pidControllers = /* @__PURE__ */ new Set(), this.impulseJoints.finalizeDeserialization(this.bodies), this.bodies.finalizeDeserialization(this.colliders), this.colliders.finalizeDeserialization(this.bodies);
3720
3720
  }
3721
3721
  free() {
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 cI(a.fromRaw(A.takeGravity()), A.takeIntegrationParameters(), A.takeIslandManager(), A.takeBroadPhase(), A.takeNarrowPhase(), A.takeBodies(), A.takeColliders(), A.takeImpulseJoints(), A.takeMultibodyJoints()) : null;
3725
+ return A ? new cI(S.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);
@@ -3851,8 +3851,8 @@ class cI {
3851
3851
  intersectionsWithPoint(A, I, g, C, Q, E, D) {
3852
3852
  this.broadPhase.intersectionsWithPoint(this.narrowPhase, this.bodies, this.colliders, A, this.colliders.castClosure(I), g, C, Q ? Q.handle : null, E ? E.handle : null, this.colliders.castClosure(D));
3853
3853
  }
3854
- castShape(A, I, g, C, Q, E, D, o, w, h, G, S) {
3855
- return this.broadPhase.castShape(this.narrowPhase, this.bodies, this.colliders, A, I, g, C, Q, E, D, o, w, h ? h.handle : null, G ? G.handle : null, this.colliders.castClosure(S));
3854
+ castShape(A, I, g, C, Q, E, D, o, w, G, h, K) {
3855
+ return this.broadPhase.castShape(this.narrowPhase, this.bodies, this.colliders, A, I, g, C, Q, E, D, o, w, G ? G.handle : null, h ? h.handle : null, this.colliders.castClosure(K));
3856
3856
  }
3857
3857
  intersectionsWithShape(A, I, g, C, Q, E, D, o, w) {
3858
3858
  this.broadPhase.intersectionsWithShape(this.narrowPhase, this.bodies, this.colliders, A, I, g, this.colliders.castClosure(C), Q, E, D ? D.handle : null, o ? o.handle : null, this.colliders.castClosure(w));
@@ -3941,13 +3941,13 @@ class SC {
3941
3941
  return this.raw.collider2();
3942
3942
  }
3943
3943
  totalForce() {
3944
- return a.fromRaw(this.raw.total_force());
3944
+ return S.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 a.fromRaw(this.raw.max_force_direction());
3950
+ return S.fromRaw(this.raw.max_force_direction());
3951
3951
  }
3952
3952
  maxForceMagnitude() {
3953
3953
  return this.raw.max_force_magnitude();
@@ -4002,10 +4002,10 @@ class vI {
4002
4002
  return this.colliderSet.raw.contains(this.handle);
4003
4003
  }
4004
4004
  translation() {
4005
- return a.fromRaw(this.colliderSet.raw.coTranslation(this.handle));
4005
+ return S.fromRaw(this.colliderSet.raw.coTranslation(this.handle));
4006
4006
  }
4007
4007
  translationWrtParent() {
4008
- return a.fromRaw(this.colliderSet.raw.coTranslationWrtParent(this.handle));
4008
+ return S.fromRaw(this.colliderSet.raw.coTranslationWrtParent(this.handle));
4009
4009
  }
4010
4010
  rotation() {
4011
4011
  return j.fromRaw(this.colliderSet.raw.coRotation(this.handle));
@@ -4090,7 +4090,7 @@ class vI {
4090
4090
  this.colliderSet.raw.coSetMass(this.handle, A);
4091
4091
  }
4092
4092
  setMassProperties(A, I, g) {
4093
- let C = a.intoRaw(I);
4093
+ let C = S.intoRaw(I);
4094
4094
  this.colliderSet.raw.coSetMassProperties(this.handle, A, C, g), C.free();
4095
4095
  }
4096
4096
  setTranslation(A) {
@@ -4109,10 +4109,10 @@ class vI {
4109
4109
  return this.colliderSet.raw.coShapeType(this.handle);
4110
4110
  }
4111
4111
  halfExtents() {
4112
- return a.fromRaw(this.colliderSet.raw.coHalfExtents(this.handle));
4112
+ return S.fromRaw(this.colliderSet.raw.coHalfExtents(this.handle));
4113
4113
  }
4114
4114
  setHalfExtents(A) {
4115
- const I = a.intoRaw(A);
4115
+ const I = S.intoRaw(A);
4116
4116
  this.colliderSet.raw.coSetHalfExtents(this.handle, I);
4117
4117
  }
4118
4118
  radius() {
@@ -4153,7 +4153,7 @@ class vI {
4153
4153
  }
4154
4154
  heightfieldScale() {
4155
4155
  let A = this.colliderSet.raw.coHeightfieldScale(this.handle);
4156
- return a.fromRaw(A);
4156
+ return S.fromRaw(A);
4157
4157
  }
4158
4158
  parent() {
4159
4159
  return this._parent;
@@ -4180,42 +4180,42 @@ class vI {
4180
4180
  return this.colliderSet.raw.coSolverGroups(this.handle);
4181
4181
  }
4182
4182
  containsPoint(A) {
4183
- let I = a.intoRaw(A), g = this.colliderSet.raw.coContainsPoint(this.handle, I);
4183
+ let I = S.intoRaw(A), g = this.colliderSet.raw.coContainsPoint(this.handle, I);
4184
4184
  return I.free(), g;
4185
4185
  }
4186
4186
  projectPoint(A, I) {
4187
- let g = a.intoRaw(A), C = EI.fromRaw(this.colliderSet.raw.coProjectPoint(this.handle, g, I));
4187
+ let g = S.intoRaw(A), C = EI.fromRaw(this.colliderSet.raw.coProjectPoint(this.handle, g, I));
4188
4188
  return g.free(), C;
4189
4189
  }
4190
4190
  intersectsRay(A, I) {
4191
- let g = a.intoRaw(A.origin), C = a.intoRaw(A.dir), Q = this.colliderSet.raw.coIntersectsRay(this.handle, g, C, I);
4191
+ let g = S.intoRaw(A.origin), C = S.intoRaw(A.dir), Q = this.colliderSet.raw.coIntersectsRay(this.handle, g, C, I);
4192
4192
  return g.free(), C.free(), Q;
4193
4193
  }
4194
4194
  castShape(A, I, g, C, Q, E, D, o) {
4195
- let w = a.intoRaw(A), h = a.intoRaw(g), G = j.intoRaw(C), S = a.intoRaw(Q), K = I.intoRaw(), M = vA.fromRaw(this.colliderSet, this.colliderSet.raw.coCastShape(this.handle, w, K, h, G, S, E, D, o));
4196
- return w.free(), h.free(), G.free(), S.free(), K.free(), M;
4195
+ let w = S.intoRaw(A), G = S.intoRaw(g), h = j.intoRaw(C), K = S.intoRaw(Q), N = I.intoRaw(), M = uA.fromRaw(this.colliderSet, this.colliderSet.raw.coCastShape(this.handle, w, N, G, h, K, E, D, o));
4196
+ return w.free(), G.free(), h.free(), K.free(), N.free(), M;
4197
4197
  }
4198
4198
  castCollider(A, I, g, C, Q, E) {
4199
- let D = a.intoRaw(A), o = a.intoRaw(g), w = iI.fromRaw(this.colliderSet, this.colliderSet.raw.coCastCollider(this.handle, D, I.handle, o, C, Q, E));
4199
+ let D = S.intoRaw(A), o = S.intoRaw(g), w = iI.fromRaw(this.colliderSet, this.colliderSet.raw.coCastCollider(this.handle, D, I.handle, o, C, Q, E));
4200
4200
  return D.free(), o.free(), w;
4201
4201
  }
4202
4202
  intersectsShape(A, I, g) {
4203
- let C = a.intoRaw(I), Q = j.intoRaw(g), E = A.intoRaw(), D = this.colliderSet.raw.coIntersectsShape(this.handle, E, C, Q);
4203
+ let C = S.intoRaw(I), Q = j.intoRaw(g), E = A.intoRaw(), D = this.colliderSet.raw.coIntersectsShape(this.handle, E, C, Q);
4204
4204
  return C.free(), Q.free(), E.free(), D;
4205
4205
  }
4206
4206
  contactShape(A, I, g, C) {
4207
- let Q = a.intoRaw(I), E = j.intoRaw(g), D = A.intoRaw(), o = XA.fromRaw(this.colliderSet.raw.coContactShape(this.handle, D, Q, E, C));
4207
+ let Q = S.intoRaw(I), E = j.intoRaw(g), D = A.intoRaw(), o = vA.fromRaw(this.colliderSet.raw.coContactShape(this.handle, D, Q, E, C));
4208
4208
  return Q.free(), E.free(), D.free(), o;
4209
4209
  }
4210
4210
  contactCollider(A, I) {
4211
- return XA.fromRaw(this.colliderSet.raw.coContactCollider(this.handle, A.handle, I));
4211
+ return vA.fromRaw(this.colliderSet.raw.coContactCollider(this.handle, A.handle, I));
4212
4212
  }
4213
4213
  castRay(A, I, g) {
4214
- let C = a.intoRaw(A.origin), Q = a.intoRaw(A.dir), E = this.colliderSet.raw.coCastRay(this.handle, C, Q, I, g);
4214
+ let C = S.intoRaw(A.origin), Q = S.intoRaw(A.dir), E = this.colliderSet.raw.coCastRay(this.handle, C, Q, I, g);
4215
4215
  return C.free(), Q.free(), E;
4216
4216
  }
4217
4217
  castRayAndGetNormal(A, I, g) {
4218
- let C = a.intoRaw(A.origin), Q = a.intoRaw(A.dir), E = BI.fromRaw(this.colliderSet.raw.coCastRayAndGetNormal(this.handle, C, Q, I, g));
4218
+ let C = S.intoRaw(A.origin), Q = S.intoRaw(A.dir), E = BI.fromRaw(this.colliderSet.raw.coCastRayAndGetNormal(this.handle, C, Q, I, g));
4219
4219
  return C.free(), Q.free(), E;
4220
4220
  }
4221
4221
  }
@@ -4224,7 +4224,7 @@ class vI {
4224
4224
  })(TA || (TA = {}));
4225
4225
  class oA {
4226
4226
  constructor(A) {
4227
- this.enabled = !0, this.shape = A, this.massPropsMode = TA.Density, this.density = 1, this.friction = 0.5, this.restitution = 0, this.rotation = j.identity(), this.translation = a.zeros(), this.isSensor = !1, this.collisionGroups = 4294967295, this.solverGroups = 4294967295, this.frictionCombineRule = gI.Average, this.restitutionCombineRule = gI.Average, this.activeCollisionTypes = KI.DEFAULT, this.activeEvents = hI.NONE, this.activeHooks = sI.NONE, this.mass = 0, this.centerOfMass = a.zeros(), this.contactForceEventThreshold = 0, this.contactSkin = 0, this.principalAngularInertia = 0, this.rotationsEnabled = !0;
4227
+ this.enabled = !0, this.shape = A, this.massPropsMode = TA.Density, this.density = 1, this.friction = 0.5, this.restitution = 0, this.rotation = j.identity(), this.translation = S.zeros(), this.isSensor = !1, this.collisionGroups = 4294967295, this.solverGroups = 4294967295, this.frictionCombineRule = gI.Average, this.restitutionCombineRule = gI.Average, this.activeCollisionTypes = KI.DEFAULT, this.activeEvents = hI.NONE, this.activeHooks = sI.NONE, this.mass = 0, this.centerOfMass = S.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 Ig(A);
@@ -4313,7 +4313,7 @@ class oA {
4313
4313
  return this.massPropsMode = TA.Mass, this.mass = A, this;
4314
4314
  }
4315
4315
  setMassProperties(A, I, g) {
4316
- return this.massPropsMode = TA.MassProps, this.mass = A, a.copy(this.centerOfMass, I), this.principalAngularInertia = g, this;
4316
+ return this.massPropsMode = TA.MassProps, this.mass = A, S.copy(this.centerOfMass, I), this.principalAngularInertia = g, this;
4317
4317
  }
4318
4318
  setRestitution(A) {
4319
4319
  return this.restitution = A, this;
@@ -4364,10 +4364,10 @@ class aC {
4364
4364
  createCollider(A, I, g) {
4365
4365
  let C = g != null && g != null;
4366
4366
  if (C && isNaN(g)) throw Error("Cannot create a collider with a parent rigid-body handle that is not a number.");
4367
- let Q = I.shape.intoRaw(), E = a.intoRaw(I.translation), D = j.intoRaw(I.rotation), o = a.intoRaw(I.centerOfMass), w = this.raw.createCollider(I.enabled, Q, E, D, 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, C, C ? g : 0, A.raw);
4367
+ let Q = I.shape.intoRaw(), E = S.intoRaw(I.translation), D = j.intoRaw(I.rotation), o = S.intoRaw(I.centerOfMass), w = this.raw.createCollider(I.enabled, Q, E, D, 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, C, C ? g : 0, A.raw);
4368
4368
  Q.free(), E.free(), D.free(), o.free();
4369
- let h = C ? A.get(g) : null, G = new vI(this, w, h, I.shape);
4370
- return this.map.set(w, G), G;
4369
+ let G = C ? A.get(g) : null, h = new vI(this, w, G, I.shape);
4370
+ return this.map.set(w, h), h;
4371
4371
  }
4372
4372
  remove(A, I, g, C) {
4373
4373
  this.raw.remove(A, I.raw, g.raw, C), this.unmap(A);
@@ -4396,21 +4396,21 @@ function lC(i, A, I, g) {
4396
4396
  function E(w) {
4397
4397
  try {
4398
4398
  o(g.next(w));
4399
- } catch (h) {
4400
- Q(h);
4399
+ } catch (G) {
4400
+ Q(G);
4401
4401
  }
4402
4402
  }
4403
4403
  function D(w) {
4404
4404
  try {
4405
4405
  o(g.throw(w));
4406
- } catch (h) {
4407
- Q(h);
4406
+ } catch (G) {
4407
+ Q(G);
4408
4408
  }
4409
4409
  }
4410
4410
  function o(w) {
4411
- var h;
4412
- w.done ? C(w.value) : (h = w.value, h instanceof I ? h : new I(function(G) {
4413
- G(h);
4411
+ var G;
4412
+ w.done ? C(w.value) : (G = w.value, G instanceof I ? G : new I(function(h) {
4413
+ h(G);
4414
4414
  })).then(E, D);
4415
4415
  }
4416
4416
  o((g = g.apply(i, [])).next());
@@ -4420,15 +4420,15 @@ for (var nC = { byteLength: function(i) {
4420
4420
  var A = bg(i), I = A[0], g = A[1];
4421
4421
  return 3 * (I + g) / 4 - g;
4422
4422
  }, toByteArray: function(i) {
4423
- var A, I, g = bg(i), C = g[0], Q = g[1], E = new HC(function(w, h, G) {
4424
- return 3 * (h + G) / 4 - G;
4423
+ var A, I, g = bg(i), C = g[0], Q = g[1], E = new HC(function(w, G, h) {
4424
+ return 3 * (G + h) / 4 - h;
4425
4425
  }(0, C, Q)), D = 0, o = Q > 0 ? C - 4 : C;
4426
4426
  for (I = 0; I < o; I += 4) A = UA[i.charCodeAt(I)] << 18 | UA[i.charCodeAt(I + 1)] << 12 | UA[i.charCodeAt(I + 2)] << 6 | UA[i.charCodeAt(I + 3)], E[D++] = A >> 16 & 255, E[D++] = A >> 8 & 255, E[D++] = 255 & A;
4427
4427
  return Q === 2 && (A = UA[i.charCodeAt(I)] << 2 | UA[i.charCodeAt(I + 1)] >> 4, E[D++] = 255 & A), Q === 1 && (A = UA[i.charCodeAt(I)] << 10 | UA[i.charCodeAt(I + 1)] << 4 | UA[i.charCodeAt(I + 2)] >> 2, E[D++] = A >> 8 & 255, E[D++] = 255 & A), E;
4428
4428
  }, fromByteArray: function(i) {
4429
4429
  for (var A, I = i.length, g = I % 3, C = [], Q = 16383, E = 0, D = I - g; E < D; E += Q) C.push(dC(i, E, E + Q > D ? D : E + Q));
4430
4430
  return g === 1 ? (A = i[I - 1], C.push(LA[A >> 2] + LA[A << 4 & 63] + "==")) : g === 2 && (A = (i[I - 2] << 8) + i[I - 1], C.push(LA[A >> 10] + LA[A >> 4 & 63] + LA[A << 2 & 63] + "=")), C.join("");
4431
- } }, LA = [], UA = [], HC = typeof Uint8Array < "u" ? Uint8Array : Array, dI = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", xA = 0, pC = dI.length; xA < pC; ++xA) LA[xA] = dI[xA], UA[dI.charCodeAt(xA)] = xA;
4431
+ } }, LA = [], UA = [], HC = typeof Uint8Array < "u" ? Uint8Array : Array, dI = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", mA = 0, pC = dI.length; mA < pC; ++mA) LA[mA] = dI[mA], UA[dI.charCodeAt(mA)] = mA;
4432
4432
  function bg(i) {
4433
4433
  var A = i.length;
4434
4434
  if (A % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4");
@@ -4462,7 +4462,7 @@ function TC(i) {
4462
4462
  A = i, B.reserve_memory(A);
4463
4463
  }
4464
4464
  UA[45] = 62, UA[95] = 63;
4465
- var FA = Object.freeze({ __proto__: null, version: bC, reserveMemory: TC, Vector2: mg, VectorOps: a, RotationOps: j, get RigidBodyType() {
4465
+ var FA = Object.freeze({ __proto__: null, version: bC, reserveMemory: TC, Vector2: mg, VectorOps: S, RotationOps: j, get RigidBodyType() {
4466
4466
  return cA;
4467
4467
  }, RigidBody: mI, RigidBodyDesc: eA, RigidBodySet: Xg, IntegrationParameters: vg, get JointType() {
4468
4468
  return JA;
@@ -4470,7 +4470,7 @@ var FA = Object.freeze({ __proto__: null, version: bC, reserveMemory: TC, Vector
4470
4470
  return TI;
4471
4471
  }, get JointAxesMask() {
4472
4472
  return ZI;
4473
- }, ImpulseJoint: nA, UnitImpulseJoint: $I, FixedImpulseJoint: ug, RopeImpulseJoint: Pg, SpringImpulseJoint: Vg, PrismaticImpulseJoint: zg, RevoluteImpulseJoint: _g, JointData: bA, ImpulseJointSet: $g, MultibodyJoint: WA, UnitMultibodyJoint: Ag, FixedMultibodyJoint: AC, PrismaticMultibodyJoint: IC, RevoluteMultibodyJoint: gC, MultibodyJointSet: CC, get CoefficientCombineRule() {
4473
+ }, ImpulseJoint: nA, UnitImpulseJoint: $I, FixedImpulseJoint: ug, RopeImpulseJoint: Vg, SpringImpulseJoint: Pg, PrismaticImpulseJoint: zg, RevoluteImpulseJoint: _g, JointData: bA, ImpulseJointSet: $g, MultibodyJoint: WA, UnitMultibodyJoint: Ag, FixedMultibodyJoint: AC, PrismaticMultibodyJoint: IC, RevoluteMultibodyJoint: gC, MultibodyJointSet: CC, get CoefficientCombineRule() {
4474
4474
  return gI;
4475
4475
  }, CCDSolver: QC, IslandManager: BC, BroadPhase: EC, NarrowPhase: iC, TempContactManifold: DC, Shape: SA, get ShapeType() {
4476
4476
  return sA;
@@ -4481,8 +4481,8 @@ var FA = Object.freeze({ __proto__: null, version: bC, reserveMemory: TC, Vector
4481
4481
  }, Collider: vI, get MassPropsMode() {
4482
4482
  return TA;
4483
4483
  }, ColliderDesc: oA, ColliderSet: aC, get FeatureType() {
4484
- return mA;
4485
- }, Ray: rC, RayIntersection: BI, RayColliderIntersection: CI, RayColliderHit: RI, PointProjection: EI, PointColliderProjection: QI, ShapeCastHit: vA, ColliderShapeCastHit: iI, ShapeContact: XA, World: cI, PhysicsPipeline: oC, SerializationPipeline: XI, get ActiveEvents() {
4484
+ return XA;
4485
+ }, Ray: rC, RayIntersection: BI, RayColliderIntersection: CI, RayColliderHit: RI, PointProjection: EI, PointColliderProjection: QI, ShapeCastHit: uA, ColliderShapeCastHit: iI, ShapeContact: vA, World: cI, PhysicsPipeline: oC, SerializationPipeline: XI, get ActiveEvents() {
4486
4486
  return hI;
4487
4487
  }, TempContactForceEvent: SC, EventQueue: qC, get ActiveHooks() {
4488
4488
  return sI;
@@ -4495,10 +4495,10 @@ var FA = Object.freeze({ __proto__: null, version: bC, reserveMemory: TC, Vector
4495
4495
  }, PidController: KC });
4496
4496
  class ZC {
4497
4497
  constructor() {
4498
- _(this, "world", null);
4499
- _(this, "bodies", /* @__PURE__ */ new Map());
4500
- _(this, "colliders", /* @__PURE__ */ new Map());
4501
- _(this, "initialized", !1);
4498
+ V(this, "world", null);
4499
+ V(this, "bodies", /* @__PURE__ */ new Map());
4500
+ V(this, "colliders", /* @__PURE__ */ new Map());
4501
+ V(this, "initialized", !1);
4502
4502
  }
4503
4503
  async init(A) {
4504
4504
  this.initialized || (await FA.init(), this.world = new FA.World(new FA.Vector2(A.x, A.y)), this.initialized = !0);
@@ -4598,33 +4598,35 @@ class ZC {
4598
4598
  }
4599
4599
  class WC {
4600
4600
  constructor() {
4601
- _(this, "artboard", null);
4602
- _(this, "objectStates", /* @__PURE__ */ new Map());
4601
+ V(this, "artboard", null);
4602
+ V(this, "objectStates", /* @__PURE__ */ new Map());
4603
4603
  // Physics State
4604
- _(this, "physicsEngine", null);
4604
+ V(this, "physicsEngine", null);
4605
4605
  // State Machine State
4606
- _(this, "activeStateMachine", null);
4607
- _(this, "inputs", /* @__PURE__ */ new Map());
4606
+ V(this, "activeStateMachine", null);
4607
+ V(this, "inputs", /* @__PURE__ */ new Map());
4608
4608
  // id -> value
4609
- _(this, "inputNameMap", /* @__PURE__ */ new Map());
4609
+ V(this, "inputNameMap", /* @__PURE__ */ new Map());
4610
4610
  // name -> id[] mapping
4611
- _(this, "layerStates", /* @__PURE__ */ new Map());
4612
- _(this, "imageCache", /* @__PURE__ */ new Map());
4613
- _(this, "layout", { fit: "Contain", alignment: "Center" });
4614
- _(this, "onTrigger");
4615
- _(this, "onInputUpdate");
4616
- _(this, "onComponentChange");
4611
+ V(this, "layerStates", /* @__PURE__ */ new Map());
4612
+ V(this, "imageCache", /* @__PURE__ */ new Map());
4613
+ V(this, "layout", { fit: "Contain", alignment: "Center" });
4614
+ V(this, "onTrigger");
4615
+ V(this, "onInputUpdate");
4616
+ V(this, "onComponentChange");
4617
4617
  // Track triggers that were just fired in the current frame
4618
- _(this, "justFiredTriggers", /* @__PURE__ */ new Set());
4618
+ V(this, "justFiredTriggers", /* @__PURE__ */ new Set());
4619
4619
  // Track currently hovered object for Enter/Leave events
4620
- _(this, "lastHoveredObjectId", null);
4621
- _(this, "_lastPointerPos", null);
4620
+ V(this, "lastHoveredObjectId", null);
4621
+ V(this, "_lastPointerPos", null);
4622
4622
  // Interaction State
4623
- _(this, "focusedId", null);
4624
- _(this, "draggingSliderId", null);
4625
- _(this, "activeDropdownId", null);
4623
+ V(this, "focusedId", null);
4624
+ V(this, "draggingSliderId", null);
4625
+ V(this, "activeDropdownId", null);
4626
+ // Physics/Animation State
4627
+ V(this, "objectVelocities", /* @__PURE__ */ new Map());
4626
4628
  // Trigger Management
4627
- _(this, "activeTriggers", /* @__PURE__ */ new Map());
4629
+ V(this, "activeTriggers", /* @__PURE__ */ new Map());
4628
4630
  }
4629
4631
  setTriggerCallback(A) {
4630
4632
  this.onTrigger = A;
@@ -4635,6 +4637,11 @@ class WC {
4635
4637
  setComponentChangeCallback(A) {
4636
4638
  this.onComponentChange = A;
4637
4639
  }
4640
+ updateConstraint(A, I, g) {
4641
+ var Q;
4642
+ const C = (Q = this.artboard) == null ? void 0 : Q.objects.find((E) => E.id === A);
4643
+ C && C.constraints && C.constraints[I] && (C.constraints[I] = { ...C.constraints[I], ...g }, g.useSpring === !1 && this.objectVelocities.delete(A));
4644
+ }
4638
4645
  // ... (setLayout, getActiveStateIds, load, reset skipped for brevity if not changing) ...
4639
4646
  // Helper to update Map AND notify listener
4640
4647
  setInternalInput(A, I) {
@@ -4655,9 +4662,12 @@ class WC {
4655
4662
  }
4656
4663
  reset() {
4657
4664
  if (!this.artboard) return;
4658
- if (this.objectStates.clear(), this.inputs.clear(), this.inputNameMap.clear(), this.layerStates.clear(), this.physicsEngine && (this.physicsEngine.destroy(), this.physicsEngine = null), this.artboard.objects.forEach((I) => {
4665
+ if (this.objectStates.clear(), this.objectVelocities.clear(), this.inputs.clear(), this.inputNameMap.clear(), this.layerStates.clear(), this.physicsEngine && (this.physicsEngine.destroy(), this.physicsEngine = null), this.artboard.objects.forEach((I) => {
4659
4666
  this.objectStates.set(I.id, {
4660
4667
  ...I.transform,
4668
+ width: I.width,
4669
+ height: I.height,
4670
+ cornerRadius: I.cornerRadius ?? I.corner_radius,
4661
4671
  opacity: I.opacity !== void 0 ? I.opacity : 1,
4662
4672
  visible: I.visible !== void 0 ? I.visible : I.isVisible !== void 0 ? I.isVisible : !0,
4663
4673
  blendMode: I.blendMode || "Normal",
@@ -4759,7 +4769,7 @@ class WC {
4759
4769
  const o = E.states.find((w) => w.id === D);
4760
4770
  if (o) {
4761
4771
  let w = null;
4762
- o.animationId && (w = this.artboard.animations.find((h) => h.id === o.animationId) || null), w || (w = this.artboard.animations.find((h) => h.name === o.name || h.id === o.name || o.name === "Entry" && h.name === "Rotate") || null), w && (C.push({ animation: w, state: o }), Q = Math.max(Q, w.duration));
4772
+ o.animationId && (w = this.artboard.animations.find((G) => G.id === o.animationId) || null), w || (w = this.artboard.animations.find((G) => G.name === o.name || G.id === o.name || o.name === "Entry" && G.name === "Rotate") || null), w && (C.push({ animation: w, state: o }), Q = Math.max(Q, w.duration));
4763
4773
  }
4764
4774
  }
4765
4775
  }
@@ -4795,7 +4805,7 @@ class WC {
4795
4805
  } else {
4796
4806
  const o = this.inputNameMap.get(A);
4797
4807
  if (o && o.length > 0) {
4798
- const w = (D = this.activeStateMachine) == null ? void 0 : D.inputs.find((h) => h.id === o[0]);
4808
+ const w = (D = this.activeStateMachine) == null ? void 0 : D.inputs.find((G) => G.id === o[0]);
4799
4809
  w && typeof w.value == "object" && (g = w.value.type);
4800
4810
  }
4801
4811
  }
@@ -4816,11 +4826,11 @@ class WC {
4816
4826
  let D = !1;
4817
4827
  for (const o of E.transitions)
4818
4828
  this.checkConditions(o.conditions) && (g.push(o.targetStateId), D = !0, C = !0, o.conditions && o.conditions.forEach((w) => {
4819
- var G;
4820
- const h = (G = this.activeStateMachine) == null ? void 0 : G.inputs.find((S) => S.id === w.inputId);
4821
- if (h && typeof h.value == "object" && h.value.type === "Number" && (this.setInternalInput(w.inputId, 0), this.inputNameMap.has(h.name))) {
4822
- const S = this.inputNameMap.get(h.name);
4823
- S == null || S.forEach((K) => this.setInternalInput(K, 0));
4829
+ var h;
4830
+ const G = (h = this.activeStateMachine) == null ? void 0 : h.inputs.find((K) => K.id === w.inputId);
4831
+ if (G && typeof G.value == "object" && G.value.type === "Number" && (this.setInternalInput(w.inputId, 0), this.inputNameMap.has(G.name))) {
4832
+ const K = this.inputNameMap.get(G.name);
4833
+ K == null || K.forEach((N) => this.setInternalInput(N, 0));
4824
4834
  }
4825
4835
  }));
4826
4836
  D || g.push(Q);
@@ -4832,7 +4842,7 @@ class WC {
4832
4842
  const D = (o = this.activeStateMachine) == null ? void 0 : o.inputs.find((w) => w.id === E.inputId);
4833
4843
  if (D && typeof D.value == "object" && D.value.type === "Number" && (this.setInternalInput(E.inputId, 0), this.inputNameMap.has(D.name))) {
4834
4844
  const w = this.inputNameMap.get(D.name);
4835
- w == null || w.forEach((h) => this.setInternalInput(h, 0));
4845
+ w == null || w.forEach((G) => this.setInternalInput(G, 0));
4836
4846
  }
4837
4847
  }));
4838
4848
  }
@@ -4908,18 +4918,18 @@ class WC {
4908
4918
  g.add(A);
4909
4919
  const C = (D = (E = this.activeStateMachine) == null ? void 0 : E.logicNodes) == null ? void 0 : D.find((w) => w.id === A);
4910
4920
  if (C) {
4911
- const w = (h, G) => {
4912
- const S = C.inputs.find((K) => K.id === h);
4913
- return S ? S.sourceId ? this.evaluateLogicTree(S.sourceId, S.sourceHandleId, g) : S.value !== void 0 ? S.value : G : G;
4921
+ const w = (G, h) => {
4922
+ const K = C.inputs.find((N) => N.id === G);
4923
+ return K ? K.sourceId ? this.evaluateLogicTree(K.sourceId, K.sourceHandleId, g) : K.value !== void 0 ? K.value : h : h;
4914
4924
  };
4915
4925
  switch (C.op) {
4916
- case PA.AND:
4926
+ case VA.AND:
4917
4927
  return w("a", !1) && w("b", !1);
4918
- case PA.OR:
4928
+ case VA.OR:
4919
4929
  return w("a", !1) || w("b", !1);
4920
- case PA.NOT:
4930
+ case VA.NOT:
4921
4931
  return !w("in", !1);
4922
- case PA.XOR:
4932
+ case VA.XOR:
4923
4933
  return !!w("a", !1) != !!w("b", !1);
4924
4934
  default:
4925
4935
  return 0;
@@ -4927,12 +4937,12 @@ class WC {
4927
4937
  }
4928
4938
  let Q = this.inputs.get(A);
4929
4939
  if (this.justFiredTriggers.has(A) && (Q = !0), I && Q !== void 0) {
4930
- const w = (o = this.activeStateMachine) == null ? void 0 : o.inputs.find((h) => h.id === A);
4940
+ const w = (o = this.activeStateMachine) == null ? void 0 : o.inputs.find((G) => G.id === A);
4931
4941
  if (w && w.value.type === "Number" && typeof Q == "number") {
4932
- const h = w.value.defaultValue ?? w.value.value;
4933
- if (I === "source-greater") return Q > h;
4934
- if (I === "source-less") return Q < h;
4935
- if (I === "source-equal") return Q === h;
4942
+ const G = w.value.defaultValue ?? w.value.value;
4943
+ if (I === "source-greater") return Q > G;
4944
+ if (I === "source-less") return Q < G;
4945
+ if (I === "source-equal") return Q === G;
4936
4946
  }
4937
4947
  if (I === "source-true") return Q === !0;
4938
4948
  if (I === "source-false") return Q === !1;
@@ -4955,57 +4965,62 @@ class WC {
4955
4965
  }) ? I.time %= I.duration : I.time = I.duration), I.animations.forEach((g) => {
4956
4966
  this.applyAnimation(g.animation, I.time);
4957
4967
  }));
4958
- })), this.solveConstraints(), this.activeTriggers.forEach((I, g) => {
4959
- var C, Q, E, D, o, w, h;
4968
+ })), this.solveConstraints(A), this.activeTriggers.forEach((I, g) => {
4969
+ var C, Q, E, D, o, w, G;
4960
4970
  if (I.phase === "entry")
4961
- I.time += A, I.time >= I.animation.duration && ((E = (Q = (C = this.artboard) == null ? void 0 : C.objects.find((G) => G.id === g)) == null ? void 0 : Q.triggers) == null || E.find((G) => G.id === I.triggerId), I.phase = "hold", I.elapsedHold = 0, I.time = I.animation.duration), this.applyAnimation(I.animation, I.time);
4971
+ I.time += A, I.time >= I.animation.duration && ((E = (Q = (C = this.artboard) == null ? void 0 : C.objects.find((h) => h.id === g)) == null ? void 0 : Q.triggers) == null || E.find((h) => h.id === I.triggerId), I.phase = "hold", I.elapsedHold = 0, I.time = I.animation.duration), this.applyAnimation(I.animation, I.time);
4962
4972
  else if (I.phase === "hold") {
4963
- const G = (w = (o = (D = this.artboard) == null ? void 0 : D.objects.find((K) => K.id === g)) == null ? void 0 : o.triggers) == null ? void 0 : w.find((K) => K.id === I.triggerId), S = (G == null ? void 0 : G.duration) || 0;
4964
- if (I.elapsedHold += A * 1e3, I.elapsedHold >= S)
4965
- if (G != null && G.exitAnimationId) {
4966
- const K = (h = this.artboard) == null ? void 0 : h.animations.find((M) => M.id === G.exitAnimationId);
4967
- K ? (I.phase = "exit", I.animation = K, I.time = 0) : this.activeTriggers.delete(g);
4973
+ const h = (w = (o = (D = this.artboard) == null ? void 0 : D.objects.find((N) => N.id === g)) == null ? void 0 : o.triggers) == null ? void 0 : w.find((N) => N.id === I.triggerId), K = (h == null ? void 0 : h.duration) || 0;
4974
+ if (I.elapsedHold += A * 1e3, I.elapsedHold >= K)
4975
+ if (h != null && h.exitAnimationId) {
4976
+ const N = (G = this.artboard) == null ? void 0 : G.animations.find((M) => M.id === h.exitAnimationId);
4977
+ N ? (I.phase = "exit", I.animation = N, I.time = 0) : this.activeTriggers.delete(g);
4968
4978
  } else
4969
4979
  this.activeTriggers.delete(g);
4970
4980
  } else I.phase === "exit" && (I.time += A, I.time >= I.animation.duration ? this.activeTriggers.delete(g) : this.applyAnimation(I.animation, I.time));
4971
4981
  }));
4972
4982
  }
4973
- solveConstraints() {
4974
- this.artboard && this.artboard.objects.forEach((A) => {
4975
- if (!A.constraints || A.constraints.length === 0) return;
4976
- const I = this.objectStates.get(A.id);
4977
- I && A.constraints.forEach((g) => {
4978
- var Q, E, D, o, w, h;
4979
- const C = g.strength ?? 1;
4980
- if (g.type === "Translation") {
4981
- const G = this.objectStates.get(g.targetId);
4982
- G && (g.copyX && (I.x = I.x + (G.x - I.x) * C), g.copyY && (I.y = I.y + (G.y - I.y) * C), (Q = g.limitX) != null && Q.enabled && (I.x = Math.max(g.limitX.min, Math.min(g.limitX.max, I.x))), (E = g.limitY) != null && E.enabled && (I.y = Math.max(g.limitY.min, Math.min(g.limitY.max, I.y))));
4983
- } else if (g.type === "FollowPointer") {
4984
- const G = ((D = this._lastPointerPos) == null ? void 0 : D.x) ?? I.x, S = ((o = this._lastPointerPos) == null ? void 0 : o.y) ?? I.y;
4985
- I.x = I.x + (G - I.x) * C, I.y = I.y + (S - I.y) * C, (w = g.limitX) != null && w.enabled && (I.x = Math.max(g.limitX.min, Math.min(g.limitX.max, I.x))), (h = g.limitY) != null && h.enabled && (I.y = Math.max(g.limitY.min, Math.min(g.limitY.max, I.y)));
4986
- } else if (g.type === "Distance") {
4987
- const G = this.objectStates.get(g.targetId);
4988
- if (G) {
4989
- const S = I.x - G.x, K = I.y - G.y, M = Math.sqrt(S * S + K * K), F = g.distance || 0;
4990
- let J = M;
4991
- switch (g.mode) {
4983
+ solveConstraints(A) {
4984
+ this.artboard && this.artboard.objects.forEach((I) => {
4985
+ if (!I.constraints || I.constraints.length === 0) return;
4986
+ const g = this.objectStates.get(I.id);
4987
+ g && I.constraints.forEach((C) => {
4988
+ var E, D, o, w, G, h;
4989
+ const Q = C.strength ?? 1;
4990
+ if (C.type === "Translation") {
4991
+ const K = this.objectStates.get(C.targetId);
4992
+ K && (C.copyX && (g.x = g.x + (K.x - g.x) * Q), C.copyY && (g.y = g.y + (K.y - g.y) * Q), (E = C.limitX) != null && E.enabled && (g.x = Math.max(C.limitX.min, Math.min(C.limitX.max, g.x))), (D = C.limitY) != null && D.enabled && (g.y = Math.max(C.limitY.min, Math.min(C.limitY.max, g.y))));
4993
+ } else if (C.type === "FollowPointer") {
4994
+ const K = ((o = this._lastPointerPos) == null ? void 0 : o.x) ?? g.x, N = ((w = this._lastPointerPos) == null ? void 0 : w.y) ?? g.y;
4995
+ if (C.useSpring) {
4996
+ const F = C.stiffness ?? 100, J = C.damping ?? 10, y = C.mass ?? 1, k = this.objectVelocities.get(I.id) || { vx: 0, vy: 0 }, U = -F * (g.x - K), R = -F * (g.y - N), c = -J * k.vx, e = -J * k.vy, L = (U + c) / y, H = (R + e) / y;
4997
+ k.vx += L * A, k.vy += H * A, g.x += k.vx * A, g.y += k.vy * A, this.objectVelocities.set(I.id, k);
4998
+ } else
4999
+ g.x = g.x + (K - g.x) * Q, g.y = g.y + (N - g.y) * Q;
5000
+ (G = C.limitX) != null && G.enabled && (g.x = Math.max(C.limitX.min, Math.min(C.limitX.max, g.x))), (h = C.limitY) != null && h.enabled && (g.y = Math.max(C.limitY.min, Math.min(C.limitY.max, g.y)));
5001
+ } else if (C.type === "Distance") {
5002
+ const K = this.objectStates.get(C.targetId);
5003
+ if (K) {
5004
+ const N = g.x - K.x, M = g.y - K.y, F = Math.sqrt(N * N + M * M), J = C.distance || 0;
5005
+ let y = F;
5006
+ switch (C.mode) {
4992
5007
  case "exact":
4993
- J = F;
5008
+ y = J;
4994
5009
  break;
4995
5010
  case "minimum":
4996
- J = Math.max(F, M);
5011
+ y = Math.max(J, F);
4997
5012
  break;
4998
5013
  case "maximum":
4999
- J = Math.min(F, M);
5014
+ y = Math.min(J, F);
5000
5015
  break;
5001
5016
  case "clamped":
5002
- J = Math.max(0, Math.min(F, M));
5017
+ y = Math.max(0, Math.min(J, F));
5003
5018
  break;
5004
5019
  }
5005
- if (M > 0) {
5006
- const k = J / M;
5007
- I.x = G.x + S * k, I.y = G.y + K * k;
5008
- } else M === 0 && J > 0 && (I.x = G.x + J);
5020
+ if (F > 0) {
5021
+ const k = y / F;
5022
+ g.x = K.x + N * k, g.y = K.y + M * k;
5023
+ } else F === 0 && y > 0 && (g.x = K.x + y);
5009
5024
  }
5010
5025
  }
5011
5026
  });
@@ -5027,17 +5042,17 @@ class WC {
5027
5042
  var o, w;
5028
5043
  if (!this.artboard) return;
5029
5044
  let C = null;
5030
- const Q = (h, G) => {
5031
- let S = G;
5032
- G === "click" ? S = "onClick" : G === "down" ? S = "onPointerDown" : G === "up" ? S = "onPointerUp" : G === "blur" && (S = "onPointerLeave");
5033
- const K = /* @__PURE__ */ new Set([S]);
5034
- return G === "move" && K.add("onPointerEnter").add("hover").add("onPointerLeave").add("blur"), S === "onClick" && K.add("click"), S === "onPointerDown" && K.add("pointerDown"), S === "onPointerUp" && K.add("pointerUp"), !!((h.interactions || []).some((J) => K.has(J.event)) || (h.triggers || []).some((J) => K.has(J.eventType)));
5045
+ const Q = (G, h) => {
5046
+ let K = h;
5047
+ h === "click" ? K = "onClick" : h === "down" ? K = "onPointerDown" : h === "up" ? K = "onPointerUp" : h === "blur" && (K = "onPointerLeave");
5048
+ const N = /* @__PURE__ */ new Set([K]);
5049
+ return h === "move" && N.add("onPointerEnter").add("hover").add("onPointerLeave").add("blur"), K === "onClick" && N.add("click"), K === "onPointerDown" && N.add("pointerDown"), K === "onPointerUp" && N.add("pointerUp"), !!((G.interactions || []).some((J) => N.has(J.event)) || (G.triggers || []).some((J) => N.has(J.eventType)));
5035
5050
  };
5036
5051
  let E = null;
5037
- for (let h = this.artboard.objects.length - 1; h >= 0; h--) {
5038
- const G = this.artboard.objects[h];
5039
- if (this.hitTest(G, I, g) && (E || (E = G), Q(G, A))) {
5040
- C = G;
5052
+ for (let G = this.artboard.objects.length - 1; G >= 0; G--) {
5053
+ const h = this.artboard.objects[G];
5054
+ if (this.hitTest(h, I, g) && (E || (E = h), Q(h, A))) {
5055
+ C = h;
5041
5056
  break;
5042
5057
  }
5043
5058
  }
@@ -5045,44 +5060,44 @@ class WC {
5045
5060
  const D = (C == null ? void 0 : C.id) || null;
5046
5061
  if (A === "move") {
5047
5062
  if (this.draggingSliderId) {
5048
- const h = this.artboard.objects.find((G) => G.id === this.draggingSliderId);
5049
- h && this.updateSliderValueFromPointer(h, I, g);
5063
+ const G = this.artboard.objects.find((h) => h.id === this.draggingSliderId);
5064
+ G && this.updateSliderValueFromPointer(G, I, g);
5050
5065
  return;
5051
5066
  }
5052
5067
  D !== this.lastHoveredObjectId && (console.log(`[Engine] HOVER CHANGE: ${this.lastHoveredObjectId} -> ${D}`), this.lastHoveredObjectId && this.fireEventForObject(this.lastHoveredObjectId, "onPointerLeave"), D && this.fireEventForObject(D, "onPointerEnter"), this.lastHoveredObjectId = D);
5053
5068
  return;
5054
5069
  }
5055
5070
  if ((A === "up" || A === "blur") && (this.draggingSliderId = null), C) {
5056
- let h = A;
5057
- if (A === "click" ? h = "onClick" : A === "down" ? h = "onPointerDown" : A === "up" ? h = "onPointerUp" : A === "blur" && (h = "onPointerLeave"), this.fireEventForObject(C.id, h), C.type === "Component" && C.variant === "toggle_button" && A === "down") {
5058
- const G = C.options || {};
5059
- G.checked = !G.checked, C.inputId && this.setInternalInput(C.inputId, G.checked), this.onComponentChange && this.onComponentChange({
5071
+ let G = A;
5072
+ if (A === "click" ? G = "onClick" : A === "down" ? G = "onPointerDown" : A === "up" ? G = "onPointerUp" : A === "blur" && (G = "onPointerLeave"), this.fireEventForObject(C.id, G), C.type === "Component" && C.variant === "toggle_button" && A === "down") {
5073
+ const h = C.options || {};
5074
+ h.checked = !h.checked, C.inputId && this.setInternalInput(C.inputId, h.checked), this.onComponentChange && this.onComponentChange({
5060
5075
  objectId: C.id,
5061
5076
  componentName: C.name,
5062
5077
  variant: "toggle_button",
5063
5078
  property: "checked",
5064
- value: G.checked
5079
+ value: h.checked
5065
5080
  });
5066
5081
  }
5067
5082
  if (C.type === "Component" && C.variant === "toggle" && A === "down") {
5068
- const G = C.options || {};
5069
- G.checked = !G.checked, C.inputId && this.setInternalInput(C.inputId, G.checked), this.onComponentChange && this.onComponentChange({
5083
+ const h = C.options || {};
5084
+ h.checked = !h.checked, C.inputId && this.setInternalInput(C.inputId, h.checked), this.onComponentChange && this.onComponentChange({
5070
5085
  objectId: C.id,
5071
5086
  componentName: C.name,
5072
5087
  variant: "toggle",
5073
5088
  property: "checked",
5074
- value: G.checked
5089
+ value: h.checked
5075
5090
  });
5076
5091
  }
5077
5092
  if (C.type === "Component" && C.variant === "dropdown" && A === "down") {
5078
- const G = C.options || {}, S = !G.isOpen;
5079
- if (G.isOpen) {
5080
- const K = ((o = C.geometry) == null ? void 0 : o.height) ?? C.height ?? 40, M = G.optionsList || [], F = G.itemHeight || 32, J = G.listPadding ?? 4, k = this.getWorldTransform(C.id), y = g - (k.y + K / 2 + 4);
5081
- if (y >= 0) {
5082
- const U = Math.floor((y - J) / F);
5093
+ const h = C.options || {}, K = !h.isOpen;
5094
+ if (h.isOpen) {
5095
+ const N = ((o = C.geometry) == null ? void 0 : o.height) ?? C.height ?? 40, M = h.optionsList || [], F = h.itemHeight || 32, J = h.listPadding ?? 4, y = this.getWorldTransform(C.id), k = g - (y.y + N / 2 + 4);
5096
+ if (k >= 0) {
5097
+ const U = Math.floor((k - J) / F);
5083
5098
  if (U >= 0 && U < M.length) {
5084
5099
  const R = M[U];
5085
- G.selectedOption = R, G.isOpen = !1, this.activeDropdownId = null, C.inputId && this.setInternalInput(C.inputId, R), this.onComponentChange && this.onComponentChange({
5100
+ h.selectedOption = R, h.isOpen = !1, this.activeDropdownId = null, C.inputId && this.setInternalInput(C.inputId, R), this.onComponentChange && this.onComponentChange({
5086
5101
  objectId: C.id,
5087
5102
  componentName: C.name,
5088
5103
  variant: "dropdown",
@@ -5093,11 +5108,11 @@ class WC {
5093
5108
  }
5094
5109
  }
5095
5110
  }
5096
- if (S && this.activeDropdownId && this.activeDropdownId !== C.id) {
5097
- const K = this.artboard.objects.find((M) => M.id === this.activeDropdownId);
5098
- K && K.options && (K.options.isOpen = !1);
5111
+ if (K && this.activeDropdownId && this.activeDropdownId !== C.id) {
5112
+ const N = this.artboard.objects.find((M) => M.id === this.activeDropdownId);
5113
+ N && N.options && (N.options.isOpen = !1);
5099
5114
  }
5100
- G.isOpen = S, this.activeDropdownId = S ? C.id : null;
5115
+ h.isOpen = K, this.activeDropdownId = K ? C.id : null;
5101
5116
  }
5102
5117
  if (C.type === "Component" && C.variant === "button" && A === "down" && this.onComponentChange && this.onComponentChange({
5103
5118
  objectId: C.id,
@@ -5106,8 +5121,8 @@ class WC {
5106
5121
  property: "click",
5107
5122
  value: !0
5108
5123
  }), A === "click") {
5109
- const G = (w = this.artboard) == null ? void 0 : w.objects.find((S) => S.id === C.id);
5110
- (G == null ? void 0 : G.type) === "Component" && G.variant === "inputbox" ? (this.focusedId = C.id, console.log(`[Engine] Focus set to: ${C.id}`)) : this.focusedId = null;
5124
+ const h = (w = this.artboard) == null ? void 0 : w.objects.find((K) => K.id === C.id);
5125
+ (h == null ? void 0 : h.type) === "Component" && h.variant === "inputbox" ? (this.focusedId = C.id, console.log(`[Engine] Focus set to: ${C.id}`)) : this.focusedId = null;
5111
5126
  }
5112
5127
  } else A === "click" && (this.focusedId = null);
5113
5128
  }
@@ -5157,7 +5172,7 @@ class WC {
5157
5172
  const o = (g.triggers || []).find((w) => C.has(w.eventType));
5158
5173
  if (o && o.entryAnimationId) {
5159
5174
  console.log(`[Engine] Trigger matched: ${I} (as ${o.eventType}) -> Animation ${o.entryAnimationId}`);
5160
- const w = this.artboard.animations.find((h) => h.id === o.entryAnimationId);
5175
+ const w = this.artboard.animations.find((G) => G.id === o.entryAnimationId);
5161
5176
  w && (this.activeTriggers.set(g.id, {
5162
5177
  triggerId: o.id,
5163
5178
  animation: w,
@@ -5168,10 +5183,10 @@ class WC {
5168
5183
  }
5169
5184
  }
5170
5185
  getWorldTransform(A) {
5171
- var S;
5186
+ var K;
5172
5187
  const I = this.objectStates.get(A);
5173
5188
  if (!I) return { x: 0, y: 0, scaleX: 1, scaleY: 1, rotation: 0 };
5174
- const g = (S = this.artboard) == null ? void 0 : S.objects.find((K) => K.id === A);
5189
+ const g = (K = this.artboard) == null ? void 0 : K.objects.find((N) => N.id === A);
5175
5190
  if (!g || !g.parentId)
5176
5191
  return {
5177
5192
  x: I.x,
@@ -5180,10 +5195,10 @@ class WC {
5180
5195
  scaleY: I.scale_y ?? 1,
5181
5196
  rotation: I.rotation ?? 0
5182
5197
  };
5183
- const C = this.getWorldTransform(g.parentId), Q = C.rotation * (Math.PI / 180), E = Math.cos(Q), D = Math.sin(Q), o = I.x * C.scaleX, w = I.y * C.scaleY, h = C.x + (o * E - w * D), G = C.y + (o * D + w * E);
5198
+ const C = this.getWorldTransform(g.parentId), Q = C.rotation * (Math.PI / 180), E = Math.cos(Q), D = Math.sin(Q), o = I.x * C.scaleX, w = I.y * C.scaleY, G = C.x + (o * E - w * D), h = C.y + (o * D + w * E);
5184
5199
  return {
5185
- x: h,
5186
- y: G,
5200
+ x: G,
5201
+ y: h,
5187
5202
  scaleX: (I.scale_x ?? 1) * C.scaleX,
5188
5203
  scaleY: (I.scale_y ?? 1) * C.scaleY,
5189
5204
  rotation: C.rotation + (I.rotation ?? 0)
@@ -5192,18 +5207,18 @@ class WC {
5192
5207
  hitTest(A, I, g) {
5193
5208
  var U, R;
5194
5209
  if (!this.objectStates.get(A.id)) return !1;
5195
- const Q = ((U = A.geometry) == null ? void 0 : U.width) ?? A.width ?? 100, E = ((R = A.geometry) == null ? void 0 : R.height) ?? A.height ?? 100, D = this.getWorldTransform(A.id), o = I - D.x, w = g - D.y, h = -D.rotation * (Math.PI / 180), G = Math.cos(h), S = Math.sin(h), K = o * G - w * S, M = o * S + w * G, F = D.scaleX, J = D.scaleY, k = Q * Math.abs(F), y = E * Math.abs(J);
5196
- return Math.abs(K) <= k / 2 && Math.abs(M) <= y / 2;
5210
+ const Q = ((U = A.geometry) == null ? void 0 : U.width) ?? A.width ?? 100, E = ((R = A.geometry) == null ? void 0 : R.height) ?? A.height ?? 100, D = this.getWorldTransform(A.id), o = I - D.x, w = g - D.y, G = -D.rotation * (Math.PI / 180), h = Math.cos(G), K = Math.sin(G), N = o * h - w * K, M = o * K + w * h, F = D.scaleX, J = D.scaleY, y = Q * Math.abs(F), k = E * Math.abs(J);
5211
+ return Math.abs(N) <= y / 2 && Math.abs(M) <= k / 2;
5197
5212
  }
5198
5213
  updateSliderValueFromPointer(A, I, g) {
5199
- var L;
5214
+ var e;
5200
5215
  if (!this.objectStates.get(A.id)) return;
5201
- const Q = A.options || {}, E = ((L = A.geometry) == null ? void 0 : L.width) ?? A.width ?? 200, D = this.getWorldTransform(A.id), o = I - D.x, w = g - D.y, h = -D.rotation * (Math.PI / 180), G = Math.cos(h), S = Math.sin(h), K = o * G - w * S, M = Q.thumbWidth ?? 16, F = E - M;
5202
- let k = (K + F / 2) / F;
5203
- k = Math.max(0, Math.min(1, k));
5204
- const y = Q.min ?? 0, U = Q.max ?? 100, R = Q.step || 1;
5205
- let c = y + k * (U - y);
5206
- R > 0 && (c = Math.round(c / R) * R), c = Math.max(y, Math.min(U, c)), Q.value !== c && (Q.value = c, A.inputId && this.setInternalInput(A.inputId, c), this.onComponentChange && this.onComponentChange({
5216
+ const Q = A.options || {}, E = ((e = A.geometry) == null ? void 0 : e.width) ?? A.width ?? 200, D = this.getWorldTransform(A.id), o = I - D.x, w = g - D.y, G = -D.rotation * (Math.PI / 180), h = Math.cos(G), K = Math.sin(G), N = o * h - w * K, M = Q.thumbWidth ?? 16, F = E - M;
5217
+ let y = (N + F / 2) / F;
5218
+ y = Math.max(0, Math.min(1, y));
5219
+ const k = Q.min ?? 0, U = Q.max ?? 100, R = Q.step || 1;
5220
+ let c = k + y * (U - k);
5221
+ R > 0 && (c = Math.round(c / R) * R), c = Math.max(k, Math.min(U, c)), Q.value !== c && (Q.value = c, A.inputId && this.setInternalInput(A.inputId, c), this.onComponentChange && this.onComponentChange({
5207
5222
  objectId: A.id,
5208
5223
  componentName: A.name,
5209
5224
  variant: "slider",
@@ -5213,35 +5228,35 @@ class WC {
5213
5228
  }
5214
5229
  applyAnimation(A, I) {
5215
5230
  A.tracks.forEach((g) => {
5216
- var o, w, h;
5217
- const C = (o = this.artboard) == null ? void 0 : o.objects.find((G) => G.id === g.object_id);
5231
+ var o, w, G;
5232
+ const C = (o = this.artboard) == null ? void 0 : o.objects.find((h) => h.id === g.object_id);
5218
5233
  if (((w = C == null ? void 0 : C.physics) == null ? void 0 : w.enabled) && C.physics.bodyType !== "Static" && (["x", "y", "rotation"].includes(g.property) || g.property.startsWith("transform.")))
5219
5234
  return;
5220
5235
  const E = this.objectStates.get(g.object_id);
5221
5236
  if (!E) return;
5222
5237
  const D = this.interpolate(g.keyframes, I);
5223
5238
  if (g.property.includes(".")) {
5224
- const G = (g.property || "").split(".");
5225
- let S = E;
5226
- for (let K = 0; K < G.length - 1; K++) {
5227
- if (!S[G[K]]) {
5239
+ const h = (g.property || "").split(".");
5240
+ let K = E;
5241
+ for (let N = 0; N < h.length - 1; N++) {
5242
+ if (!K[h[N]]) {
5228
5243
  let M = C;
5229
- for (let F = 0; F <= K; F++)
5230
- M = M ? M[G[F]] : null;
5231
- S[G[K]] = M ? JSON.parse(JSON.stringify(M)) : {};
5244
+ for (let F = 0; F <= N; F++)
5245
+ M = M ? M[h[F]] : null;
5246
+ K[h[N]] = M ? JSON.parse(JSON.stringify(M)) : {};
5232
5247
  }
5233
- S = S[G[K]];
5248
+ K = K[h[N]];
5234
5249
  }
5235
- S[G[G.length - 1]] = D;
5250
+ K[h[h.length - 1]] = D;
5236
5251
  } else
5237
5252
  E[g.property] = D;
5238
- if (this.physicsEngine && ((h = C == null ? void 0 : C.physics) != null && h.enabled) && C.physics.bodyType === "Static")
5253
+ if (this.physicsEngine && ((G = C == null ? void 0 : C.physics) != null && G.enabled) && C.physics.bodyType === "Static")
5239
5254
  if (g.property === "x" || g.property === "transform.x") {
5240
- const G = this.physicsEngine.getPosition(g.object_id);
5241
- G && this.physicsEngine.setPosition(g.object_id, D, G.y);
5255
+ const h = this.physicsEngine.getPosition(g.object_id);
5256
+ h && this.physicsEngine.setPosition(g.object_id, D, h.y);
5242
5257
  } else if (g.property === "y" || g.property === "transform.y") {
5243
- const G = this.physicsEngine.getPosition(g.object_id);
5244
- G && this.physicsEngine.setPosition(g.object_id, G.x, D);
5258
+ const h = this.physicsEngine.getPosition(g.object_id);
5259
+ h && this.physicsEngine.setPosition(g.object_id, h.x, D);
5245
5260
  } else (g.property === "rotation" || g.property === "transform.rotation") && this.physicsEngine.setRotation(g.object_id, D * (Math.PI / 180));
5246
5261
  });
5247
5262
  }
@@ -5265,18 +5280,18 @@ class WC {
5265
5280
  return g.value + (C.value - g.value) * E;
5266
5281
  }
5267
5282
  interpolateColor(A, I, g) {
5268
- const C = (G) => {
5269
- const S = G.replace("#", "");
5283
+ const C = (h) => {
5284
+ const K = h.replace("#", "");
5270
5285
  return {
5271
- r: parseInt(S.substring(0, 2), 16),
5272
- g: parseInt(S.substring(2, 4), 16),
5273
- b: parseInt(S.substring(4, 6), 16)
5286
+ r: parseInt(K.substring(0, 2), 16),
5287
+ g: parseInt(K.substring(2, 4), 16),
5288
+ b: parseInt(K.substring(4, 6), 16)
5274
5289
  };
5275
- }, Q = C(A), E = C(I), D = Math.round(Q.r + (E.r - Q.r) * g), o = Math.round(Q.g + (E.g - Q.g) * g), w = Math.round(Q.b + (E.b - Q.b) * g), h = (G) => {
5276
- const S = Math.max(0, Math.min(255, G)).toString(16);
5277
- return S.length === 1 ? "0" + S : S;
5290
+ }, Q = C(A), E = C(I), D = Math.round(Q.r + (E.r - Q.r) * g), o = Math.round(Q.g + (E.g - Q.g) * g), w = Math.round(Q.b + (E.b - Q.b) * g), G = (h) => {
5291
+ const K = Math.max(0, Math.min(255, h)).toString(16);
5292
+ return K.length === 1 ? "0" + K : K;
5278
5293
  };
5279
- return `#${h(D)}${h(o)}${h(w)}`;
5294
+ return `#${G(D)}${G(o)}${G(w)}`;
5280
5295
  }
5281
5296
  render(A, I, g) {
5282
5297
  if (!this.artboard)
@@ -5292,12 +5307,12 @@ class WC {
5292
5307
  );
5293
5308
  if (A.save(), A.translate(E.tx, E.ty), A.scale(E.scaleX, E.scaleY), A.translate(C / 2, Q / 2), A.fillStyle = this.artboard.backgroundColor || "#000000", A.fillRect(-C / 2, -Q / 2, C, Q), this.artboard.backgroundImage) {
5294
5309
  const w = this.artboard.backgroundImage;
5295
- let h = this.imageCache.get(w);
5296
- if (h || (h = new Image(), h.src = w, this.imageCache.set(w, h)), h.complete && h.naturalWidth > 0) {
5310
+ let G = this.imageCache.get(w);
5311
+ if (G || (G = new Image(), G.src = w, this.imageCache.set(w, G)), G.complete && G.naturalWidth > 0) {
5297
5312
  A.save(), A.globalAlpha = this.artboard.backgroundOpacity ?? 1;
5298
- const G = h.naturalWidth / h.naturalHeight, S = C / Q;
5299
- let K, M, F, J;
5300
- S > G ? (K = C, M = C / G) : (M = Q, K = Q * G), F = -K / 2, J = -M / 2, A.drawImage(h, F, J, K, M), A.restore();
5313
+ const h = G.naturalWidth / G.naturalHeight, K = C / Q;
5314
+ let N, M, F, J;
5315
+ K > h ? (N = C, M = C / h) : (M = Q, N = Q * h), F = -N / 2, J = -M / 2, A.drawImage(G, F, J, N, M), A.restore();
5301
5316
  }
5302
5317
  }
5303
5318
  A.beginPath(), A.rect(-C / 2, -Q / 2, C, Q), A.clip();
@@ -5306,11 +5321,11 @@ class WC {
5306
5321
  let o = 0;
5307
5322
  for (this.artboard.objects.forEach((w) => {
5308
5323
  if (!w.parentId) {
5309
- const h = this.objectStates.get(w.id), G = (h == null ? void 0 : h.geometry) || w.geometry;
5310
- if (G && G.isMask && (h == null ? void 0 : h.visible) !== !1) {
5324
+ const G = this.objectStates.get(w.id), h = (G == null ? void 0 : G.geometry) || w.geometry;
5325
+ if (h && h.isMask && (G == null ? void 0 : G.visible) !== !1) {
5311
5326
  A.save(), this.applyObjectTransform(A, w.id);
5312
- const S = G.width || 0, K = G.height || 0;
5313
- this.applyPath(A, G, S, K), A.clip(), o++;
5327
+ const K = h.width || 0, N = h.height || 0;
5328
+ this.applyPath(A, h, K, N), A.clip(), o++;
5314
5329
  } else
5315
5330
  this.renderObject(A, w, D);
5316
5331
  }
@@ -5320,13 +5335,13 @@ class WC {
5320
5335
  }
5321
5336
  calculateTransform(A, I, g, C, Q, E) {
5322
5337
  let D = 1, o = 1, w = 1;
5323
- const h = g / C, G = A / I;
5338
+ const G = g / C, h = A / I;
5324
5339
  switch (Q) {
5325
5340
  case "Contain":
5326
- G > h ? w = I / C : w = A / g, D = o = w;
5341
+ h > G ? w = I / C : w = A / g, D = o = w;
5327
5342
  break;
5328
5343
  case "Cover":
5329
- G > h ? w = A / g : w = I / C, D = o = w;
5344
+ h > G ? w = A / g : w = I / C, D = o = w;
5330
5345
  break;
5331
5346
  case "Fill":
5332
5347
  D = A / g, o = I / C;
@@ -5347,9 +5362,9 @@ class WC {
5347
5362
  D = o = 1;
5348
5363
  break;
5349
5364
  }
5350
- const S = g * D, K = C * o;
5365
+ const K = g * D, N = C * o;
5351
5366
  let M = 0, F = 0;
5352
- return E.includes("Left") ? M = 0 : E.includes("Right") ? M = A - S : M = (A - S) / 2, E.includes("Top") ? F = 0 : E.includes("Bottom") ? F = I - K : F = (I - K) / 2, { scaleX: D, scaleY: o, tx: M, ty: F };
5367
+ return E.includes("Left") ? M = 0 : E.includes("Right") ? M = A - K : M = (A - K) / 2, E.includes("Top") ? F = 0 : E.includes("Bottom") ? F = I - N : F = (I - N) / 2, { scaleX: D, scaleY: o, tx: M, ty: F };
5353
5368
  }
5354
5369
  mapFontWeight(A) {
5355
5370
  const I = A.toLowerCase();
@@ -5362,56 +5377,54 @@ class WC {
5362
5377
  console.warn("No state for object:", I.id);
5363
5378
  return;
5364
5379
  }
5365
- A.roundRect || (A.roundRect = (k, y, U, R, c) => (this.drawRoundRect(A, k, y, U, R, c), A));
5366
- const Q = C.geometry || I.geometry;
5380
+ A.roundRect || (A.roundRect = (y, k, U, R, c) => (this.drawRoundRect(A, y, k, U, R, c), A));
5381
+ const Q = C.geometry ? { ...I.geometry, ...C.geometry } : I.geometry, E = C.style ? { ...I.style, ...C.style } : I.style;
5367
5382
  if (C.visible === !1)
5368
5383
  return;
5369
- const E = Q.width || 0, D = Q.height || 0, o = C.x, w = C.y;
5384
+ const D = Q.width || 0, o = Q.height || 0, w = C.x, G = C.y;
5370
5385
  A.save();
5371
- const h = A.globalAlpha, G = C.opacity !== void 0 ? C.opacity : 1;
5372
- A.globalAlpha = h * G;
5373
- const S = C.compositeOperation || C.blendMode;
5374
- if (S && S !== "Normal") {
5375
- const k = S.toLowerCase();
5376
- ["multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"].includes(k) && (A.globalCompositeOperation = k);
5386
+ const h = A.globalAlpha, K = C.opacity !== void 0 ? C.opacity : 1;
5387
+ A.globalAlpha = h * K;
5388
+ const N = C.compositeOperation || C.blendMode;
5389
+ if (N && N !== "Normal") {
5390
+ const y = N.toLowerCase();
5391
+ ["multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"].includes(y) && (A.globalCompositeOperation = y);
5377
5392
  }
5378
- A.translate(o, w), A.rotate(C.rotation * Math.PI / 180), A.scale(C.scale_x, C.scale_y);
5379
- const K = C.style || I.style;
5380
- if (Q.type === "Text") {
5381
- let k = Q.text || "";
5393
+ if (A.translate(w, G), A.rotate(C.rotation * Math.PI / 180), A.scale(C.scale_x, C.scale_y), Q.type === "Text") {
5394
+ let y = Q.text || "";
5382
5395
  if (Q.textInputId) {
5383
5396
  const t = this.inputs.get(Q.textInputId);
5384
- t !== void 0 && (k = String(t), C.geometry && C.geometry.type === "Text" && (C.geometry.text = k));
5397
+ t !== void 0 && (y = String(t), C.geometry && C.geometry.type === "Text" && (C.geometry.text = y));
5385
5398
  }
5386
- let y = k || "";
5387
- Q.segments && Array.isArray(Q.segments) && (y = Q.segments.map((t) => t && t.text ? t.text : "").join(""));
5399
+ let k = y || "";
5400
+ Q.segments && Array.isArray(Q.segments) && (k = Q.segments.map((t) => t && t.text ? t.text : "").join(""));
5388
5401
  const U = Q.textCase || "none";
5389
- U === "uppercase" ? y = y.toUpperCase() : U === "lowercase" ? y = y.toLowerCase() : U === "capitalize" && (y = y.replace(/\b\w/g, (t) => t.toUpperCase()));
5402
+ U === "uppercase" ? k = k.toUpperCase() : U === "lowercase" ? k = k.toLowerCase() : U === "capitalize" && (k = k.replace(/\b\w/g, (t) => t.toUpperCase()));
5390
5403
  let R = ((J = Q.fontWeight) == null ? void 0 : J.toString()) || "400", c = "normal";
5391
5404
  R.toLowerCase().includes("italic") && (c = "italic", R = R.replace(/italic/gi, "").trim() || "400");
5392
- const L = this.mapFontWeight(R), r = Math.max(1, Q.fontSize || 16);
5393
- A.font = `${c} ${L} ${r}px "${Q.fontFamily || "Inter"}", sans-serif`;
5394
- const p = Q.textVerticalAlign || "top";
5395
- let q = -D / 2;
5396
- p === "middle" || p === "center" ? (A.textBaseline = "middle", q = 0) : p === "bottom" ? (A.textBaseline = "bottom", q = D / 2) : (A.textBaseline = "top", q = -D / 2);
5405
+ const e = this.mapFontWeight(R), L = Math.max(1, Q.fontSize || 16);
5406
+ A.font = `${c} ${e} ${L}px "${Q.fontFamily || "Inter"}", sans-serif`;
5407
+ const H = Q.textVerticalAlign || "top";
5408
+ let q = -o / 2;
5409
+ H === "middle" || H === "center" ? (A.textBaseline = "middle", q = 0) : H === "bottom" ? (A.textBaseline = "bottom", q = o / 2) : (A.textBaseline = "top", q = -o / 2);
5397
5410
  const AA = Q.textAlign || "left";
5398
5411
  A.textAlign = AA;
5399
- let GA = -E / 2;
5400
- AA === "center" && (GA = 0), AA === "right" && (GA = E / 2);
5401
- const v = Q.letterSpacing || 0, W = Q.paragraphSpacing || 0, T = (Q.lineHeight || 1.2) * r, IA = (Q.width || E || 200) + 15, x = (t) => {
5412
+ let GA = -D / 2;
5413
+ AA === "center" && (GA = 0), AA === "right" && (GA = D / 2);
5414
+ const v = Q.letterSpacing || 0, W = Q.paragraphSpacing || 0, T = (Q.lineHeight || 1.2) * L, IA = (Q.width || D || 200) + 15, x = (t) => {
5402
5415
  if (v === 0) return A.measureText(t).width;
5403
5416
  let n = 0;
5404
5417
  for (let l = 0; l < t.length; l++)
5405
5418
  n += A.measureText(t[l]).width + v;
5406
5419
  return n - v;
5407
- }, d = [], hA = String(y || "").split(`
5420
+ }, d = [], hA = String(k || "").split(`
5408
5421
  `);
5409
5422
  hA.forEach((t, n) => {
5410
5423
  const l = String(t || "").split(" ");
5411
5424
  let Z = "";
5412
- for (let V = 0; V < l.length; V++) {
5413
- const BA = Z + l[V] + " ";
5414
- x(BA.trim()) > IA && V > 0 ? (d.push({ text: Z.trim(), isParaEnd: !1 }), Z = l[V] + " ") : Z = BA;
5425
+ for (let z = 0; z < l.length; z++) {
5426
+ const BA = Z + l[z] + " ";
5427
+ x(BA.trim()) > IA && z > 0 ? (d.push({ text: Z.trim(), isParaEnd: !1 }), Z = l[z] + " ") : Z = BA;
5415
5428
  }
5416
5429
  d.push({ text: Z.trim(), isParaEnd: n < hA.length - 1 });
5417
5430
  });
@@ -5420,20 +5433,20 @@ class WC {
5420
5433
  const t = d.filter((n, l) => n.isParaEnd && l < d.length - 1).length;
5421
5434
  u += t * W;
5422
5435
  }
5423
- p === "middle" || p === "center" ? kA -= u / 2 - r / 2 : p === "bottom" && (kA -= u - r);
5424
- const m = (t, n, l, Z, V) => {
5436
+ H === "middle" || H === "center" ? kA -= u / 2 - L / 2 : H === "bottom" && (kA -= u - L);
5437
+ const m = (t, n, l, Z, z) => {
5425
5438
  var BA, RA;
5426
5439
  if (v === 0 && (Q.enableSegments !== !0 || !Q.segments || Q.segments.length === 0))
5427
5440
  Z ? A.strokeText(t, n, l) : A.fillText(t, n, l);
5428
5441
  else {
5429
5442
  const CA = x(t);
5430
- let z = n;
5431
- AA === "center" ? z -= CA / 2 : AA === "right" && (z -= CA);
5432
- let EA = z;
5443
+ let _ = n;
5444
+ AA === "center" ? _ -= CA / 2 : AA === "right" && (_ -= CA);
5445
+ let EA = _;
5433
5446
  for (let iA = 0; iA < t.length; iA++) {
5434
5447
  const yA = t[iA];
5435
5448
  if (Q.enableSegments === !0 && Q.segments && Q.segments.length > 0) {
5436
- const tA = V + iA;
5449
+ const tA = z + iA;
5437
5450
  let YA = 0;
5438
5451
  const QA = Q.segments.find((KA) => {
5439
5452
  if (!KA || typeof KA.text != "string") return !1;
@@ -5446,120 +5459,120 @@ class WC {
5446
5459
  Z ? A.strokeStyle = QA.fill.color || A.strokeStyle : A.fillStyle = KA || QA.fill.color || A.fillStyle;
5447
5460
  }
5448
5461
  if (QA.fontSize || QA.fontFamily || QA.fontWeight) {
5449
- const KA = QA.fontWeight ? this.mapFontWeight(QA.fontWeight.toString()) : L, OA = QA.fontSize || r, sg = QA.fontFamily || Q.fontFamily || "Inter";
5462
+ const KA = QA.fontWeight ? this.mapFontWeight(QA.fontWeight.toString()) : e, OA = QA.fontSize || L, sg = QA.fontFamily || Q.fontFamily || "Inter";
5450
5463
  A.font = `${c} ${KA} ${OA}px "${sg}", sans-serif`;
5451
5464
  }
5452
5465
  }
5453
5466
  }
5454
- Z ? A.strokeText(yA, EA, l) : A.fillText(yA, EA, l), Q.enableSegments === !0 && Q.segments && Q.segments.length > 0 && (A.font = `${c} ${L} ${r}px "${Q.fontFamily || "Inter"}", sans-serif`), EA += A.measureText(yA).width + v;
5467
+ Z ? A.strokeText(yA, EA, l) : A.fillText(yA, EA, l), Q.enableSegments === !0 && Q.segments && Q.segments.length > 0 && (A.font = `${c} ${e} ${L}px "${Q.fontFamily || "Inter"}", sans-serif`), EA += A.measureText(yA).width + v;
5455
5468
  }
5456
5469
  }
5457
5470
  };
5458
- if (K.fill) {
5459
- const t = A.globalAlpha, n = this.createCanvasFill(A, K.fill, E, D);
5460
- A.fillStyle = n || K.fill.color || "#000000", A.globalAlpha = t * (K.fill.opacity ?? 1);
5471
+ if (E.fill) {
5472
+ const t = A.globalAlpha, n = this.createCanvasFill(A, E.fill, D, o);
5473
+ A.fillStyle = n || E.fill.color || "#000000", A.globalAlpha = t * (E.fill.opacity ?? 1);
5461
5474
  let l = 0, Z = kA;
5462
- d.forEach((V) => {
5463
- const BA = y.indexOf(V.text, l);
5464
- BA !== -1 && (m(V.text, GA, Z, !1, BA), l = BA + V.text.length, Z += T + (V.isParaEnd ? W : 0));
5475
+ d.forEach((z) => {
5476
+ const BA = k.indexOf(z.text, l);
5477
+ BA !== -1 && (m(z.text, GA, Z, !1, BA), l = BA + z.text.length, Z += T + (z.isParaEnd ? W : 0));
5465
5478
  }), A.globalAlpha = t;
5466
5479
  }
5467
- if (K.stroke && K.stroke.width > 0) {
5480
+ if (E.stroke && E.stroke.width > 0) {
5468
5481
  const t = A.globalAlpha;
5469
- A.strokeStyle = K.stroke.color, A.lineWidth = K.stroke.width, A.globalAlpha = t * (K.stroke.opacity ?? 1);
5482
+ A.strokeStyle = E.stroke.color, A.lineWidth = E.stroke.width, A.globalAlpha = t * (E.stroke.opacity ?? 1);
5470
5483
  let n = 0, l = kA;
5471
5484
  d.forEach((Z) => {
5472
- const V = y.indexOf(Z.text, n);
5473
- V !== -1 && (m(Z.text, GA, l, !0, V), n = V + Z.text.length, l += T + (Z.isParaEnd ? W : 0));
5485
+ const z = k.indexOf(Z.text, n);
5486
+ z !== -1 && (m(Z.text, GA, l, !0, z), n = z + Z.text.length, l += T + (Z.isParaEnd ? W : 0));
5474
5487
  }), A.globalAlpha = t;
5475
5488
  }
5476
5489
  } else if (Q.type === "Image") {
5477
- const k = Q.src;
5478
- if (k) {
5479
- let y = this.imageCache.get(k);
5480
- if (y || (y = new Image(), y.onload = () => {
5481
- }, y.onerror = () => {
5482
- console.error(`[ExodeUI] Image load failed: ${k.substring(0, 100)}${k.length > 100 ? "..." : ""}`);
5483
- }, y.src = k, this.imageCache.set(k, y)), y.complete && y.naturalWidth > 0) {
5490
+ const y = Q.src;
5491
+ if (y) {
5492
+ let k = this.imageCache.get(y);
5493
+ if (k || (k = new Image(), k.onload = () => {
5494
+ }, k.onerror = () => {
5495
+ console.error(`[ExodeUI] Image load failed: ${y.substring(0, 100)}${y.length > 100 ? "..." : ""}`);
5496
+ }, k.src = y, this.imageCache.set(y, k)), k.complete && k.naturalWidth > 0) {
5484
5497
  const U = Q.corner_radius ?? Q.cornerRadius ?? 0;
5485
- U !== 0 ? (A.save(), this.applyPath(A, { type: "Rectangle", corner_radius: U }, E, D), A.clip(), A.drawImage(y, -E / 2, -D / 2, E, D), A.restore()) : A.drawImage(y, -E / 2, -D / 2, E, D);
5498
+ U !== 0 ? (A.save(), this.applyPath(A, { type: "Rectangle", corner_radius: U }, D, o), A.clip(), A.drawImage(k, -D / 2, -o / 2, D, o), A.restore()) : A.drawImage(k, -D / 2, -o / 2, D, o);
5486
5499
  }
5487
5500
  }
5488
5501
  } else if (Q.type === "SVG") {
5489
- const k = Q.svgContent;
5490
- if (k) {
5491
- const y = K.palette || [], U = I.id + "_" + y.join("_");
5502
+ const y = Q.svgContent;
5503
+ if (y) {
5504
+ const k = E.palette || [], U = I.id + "_" + k.join("_");
5492
5505
  let R = this.imageCache.get(U);
5493
5506
  if (!R) {
5494
5507
  R = new Image();
5495
- let c = k;
5496
- Q.colors && Q.colors.length > 0 && y.length > 0 && Q.colors.forEach((p, q) => {
5497
- if (y[q]) {
5498
- const AA = p.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), GA = new RegExp(AA, "gi");
5499
- c = c.replace(GA, y[q]);
5508
+ let c = y;
5509
+ Q.colors && Q.colors.length > 0 && k.length > 0 && Q.colors.forEach((H, q) => {
5510
+ if (k[q]) {
5511
+ const AA = H.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), GA = new RegExp(AA, "gi");
5512
+ c = c.replace(GA, k[q]);
5500
5513
  }
5501
5514
  });
5502
- const L = new Blob([c], { type: "image/svg+xml" }), r = URL.createObjectURL(L);
5503
- R.src = r, this.imageCache.set(U, R);
5515
+ const e = new Blob([c], { type: "image/svg+xml" }), L = URL.createObjectURL(e);
5516
+ R.src = L, this.imageCache.set(U, R);
5504
5517
  }
5505
5518
  if (R.complete && R.naturalWidth > 0) {
5506
5519
  const c = Q.corner_radius ?? Q.cornerRadius ?? 0;
5507
- c !== 0 ? (A.save(), this.applyPath(A, { type: "Rectangle", corner_radius: c }, E, D), A.clip(), A.drawImage(R, -E / 2, -D / 2, E, D), A.restore()) : A.drawImage(R, -E / 2, -D / 2, E, D);
5520
+ c !== 0 ? (A.save(), this.applyPath(A, { type: "Rectangle", corner_radius: c }, D, o), A.clip(), A.drawImage(R, -D / 2, -o / 2, D, o), A.restore()) : A.drawImage(R, -D / 2, -o / 2, D, o);
5508
5521
  }
5509
5522
  }
5510
5523
  } else if (Q.type === "LineGraph")
5511
- this.renderLineGraph(A, Q, E, D);
5524
+ this.renderLineGraph(A, Q, D, o);
5512
5525
  else if (I.type === "Shape") {
5513
- if (this.applyPath(A, Q, E, D), A.save(), K.shadow && K.shadow.opacity > 0) {
5514
- if (A.shadowColor = K.shadow.color, K.shadow.opacity < 1 && K.shadow.color.startsWith("#")) {
5515
- const k = parseInt(K.shadow.color.slice(1, 3), 16), y = parseInt(K.shadow.color.slice(3, 5), 16), U = parseInt(K.shadow.color.slice(5, 7), 16);
5516
- A.shadowColor = `rgba(${k}, ${y}, ${U}, ${K.shadow.opacity})`;
5526
+ if (this.applyPath(A, Q, D, o), A.save(), E.shadow && E.shadow.opacity > 0) {
5527
+ if (A.shadowColor = E.shadow.color, E.shadow.opacity < 1 && E.shadow.color.startsWith("#")) {
5528
+ const y = parseInt(E.shadow.color.slice(1, 3), 16), k = parseInt(E.shadow.color.slice(3, 5), 16), U = parseInt(E.shadow.color.slice(5, 7), 16);
5529
+ A.shadowColor = `rgba(${y}, ${k}, ${U}, ${E.shadow.opacity})`;
5517
5530
  }
5518
- A.shadowBlur = K.shadow.blur, A.shadowOffsetX = K.shadow.offsetX, A.shadowOffsetY = K.shadow.offsetY;
5531
+ A.shadowBlur = E.shadow.blur, A.shadowOffsetX = E.shadow.offsetX, A.shadowOffsetY = E.shadow.offsetY;
5519
5532
  }
5520
- if (K.blur && K.blur.amount > 0 && (A.filter = `blur(${K.blur.amount}px)`), K.fill) {
5521
- const k = A.globalAlpha, y = this.createCanvasFill(A, K.fill, E, D);
5522
- y ? A.fillStyle = y : A.fillStyle = K.fill.color || "transparent", A.globalAlpha = k * (K.fill.opacity ?? 1), A.fill(), A.globalAlpha = k;
5533
+ if (E.blur && E.blur.amount > 0 && (A.filter = `blur(${E.blur.amount}px)`), E.fill) {
5534
+ const y = A.globalAlpha, k = this.createCanvasFill(A, E.fill, D, o);
5535
+ k ? A.fillStyle = k : A.fillStyle = E.fill.color || "transparent", A.globalAlpha = y * (E.fill.opacity ?? 1), A.fill(), A.globalAlpha = y;
5523
5536
  }
5524
- if (K.stroke && K.stroke.width > 0) {
5525
- const k = A.globalAlpha;
5526
- A.strokeStyle = K.stroke.color, A.lineWidth = K.stroke.width, A.globalAlpha = k * (K.stroke.opacity ?? 1), A.stroke(), A.globalAlpha = k;
5537
+ if (E.stroke && E.stroke.width > 0) {
5538
+ const y = A.globalAlpha;
5539
+ A.strokeStyle = E.stroke.color, A.lineWidth = E.stroke.width, A.globalAlpha = y * (E.stroke.opacity ?? 1), A.stroke(), A.globalAlpha = y;
5527
5540
  }
5528
5541
  A.restore();
5529
5542
  } else if (I.type === "Frame" || I.type === "Group" && !I.isStructuralGroup) {
5530
- const k = I.width || E, y = I.height || D, U = I.cornerRadius ?? I.corner_radius ?? 0;
5531
- if (A.save(), K.shadow && K.shadow.opacity > 0) {
5532
- if (A.shadowColor = K.shadow.color, K.shadow.opacity < 1 && K.shadow.color.startsWith("#")) {
5533
- const c = parseInt(K.shadow.color.slice(1, 3), 16), L = parseInt(K.shadow.color.slice(3, 5), 16), r = parseInt(K.shadow.color.slice(5, 7), 16);
5534
- A.shadowColor = `rgba(${c}, ${L}, ${r}, ${K.shadow.opacity})`;
5543
+ const y = C.width !== void 0 ? C.width : I.width || D, k = C.height !== void 0 ? C.height : I.height || o, U = C.cornerRadius !== void 0 ? C.cornerRadius : I.cornerRadius ?? I.corner_radius ?? 0;
5544
+ if (A.save(), E.shadow && E.shadow.opacity > 0) {
5545
+ if (A.shadowColor = E.shadow.color, E.shadow.opacity < 1 && E.shadow.color.startsWith("#")) {
5546
+ const c = parseInt(E.shadow.color.slice(1, 3), 16), e = parseInt(E.shadow.color.slice(3, 5), 16), L = parseInt(E.shadow.color.slice(5, 7), 16);
5547
+ A.shadowColor = `rgba(${c}, ${e}, ${L}, ${E.shadow.opacity})`;
5535
5548
  }
5536
- A.shadowBlur = K.shadow.blur, A.shadowOffsetX = K.shadow.offsetX, A.shadowOffsetY = K.shadow.offsetY;
5549
+ A.shadowBlur = E.shadow.blur, A.shadowOffsetX = E.shadow.offsetX, A.shadowOffsetY = E.shadow.offsetY;
5537
5550
  }
5538
- if (A.beginPath(), A.roundRect(-k / 2, -y / 2, k, y, U), K.fill && K.fill.type !== "None") {
5539
- const c = A.globalAlpha, L = this.createCanvasFill(A, K.fill, k, y);
5540
- A.fillStyle = L || K.fill.color || "transparent", A.globalAlpha = c * (K.fill.opacity ?? 1), A.fill(), A.globalAlpha = c;
5551
+ if (A.beginPath(), A.roundRect(-y / 2, -k / 2, y, k, U), E.fill && E.fill.type !== "None") {
5552
+ const c = A.globalAlpha, e = this.createCanvasFill(A, E.fill, y, k);
5553
+ A.fillStyle = e || E.fill.color || "transparent", A.globalAlpha = c * (E.fill.opacity ?? 1), A.fill(), A.globalAlpha = c;
5541
5554
  }
5542
- if (K.stroke && K.stroke.width > 0 && K.stroke.isEnabled !== !1) {
5555
+ if (E.stroke && E.stroke.width > 0 && E.stroke.isEnabled !== !1) {
5543
5556
  const c = A.globalAlpha;
5544
- A.strokeStyle = K.stroke.color || "#000000", A.lineWidth = K.stroke.width, A.globalAlpha = c * (K.stroke.opacity ?? 1), A.stroke(), A.globalAlpha = c;
5557
+ A.strokeStyle = E.stroke.color || "#000000", A.lineWidth = E.stroke.width, A.globalAlpha = c * (E.stroke.opacity ?? 1), A.stroke(), A.globalAlpha = c;
5545
5558
  }
5546
- A.restore(), (I.clipsContent !== !1 || I.clipContent === !0) && I.children && I.children.length > 0 && (A.save(), A.beginPath(), A.roundRect(-k / 2, -y / 2, k, y, U), A.clip());
5559
+ A.restore(), (I.clipsContent !== !1 || I.clipContent === !0) && I.children && I.children.length > 0 && (A.save(), A.beginPath(), A.roundRect(-y / 2, -k / 2, y, k, U), A.clip());
5547
5560
  } 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 === "Component" && I.variant === "toggle" ? this.renderToggle(A, I) : I.type === "Component" && I.variant === "slider" ? this.renderSlider(A, I) : I.type === "Component" && I.variant === "dropdown" && this.renderDropdown(A, I);
5548
5561
  const M = (I.type === "Frame" || I.type === "Group" && !I.isStructuralGroup) && (I.clipsContent !== !1 || I.clipContent === !0) && I.children && I.children.length > 0;
5549
5562
  if (I.children && I.children.length > 0) {
5550
- let k = 0;
5551
- for (I.children.forEach((y) => {
5552
- const U = g.get(y);
5563
+ let y = 0;
5564
+ for (I.children.forEach((k) => {
5565
+ const U = g.get(k);
5553
5566
  if (!U) return;
5554
- const R = this.objectStates.get(y), c = (R == null ? void 0 : R.geometry) || U.geometry;
5567
+ const R = this.objectStates.get(k), c = (R == null ? void 0 : R.geometry) || U.geometry;
5555
5568
  if (c && c.isMask && (R == null ? void 0 : R.visible) !== !1) {
5556
- A.save(), this.applyObjectTransform(A, y);
5557
- const L = c.width || 0, r = c.height || 0;
5558
- this.applyPath(A, c, L, r), A.clip(), k++;
5569
+ A.save(), this.applyObjectTransform(A, k);
5570
+ const e = c.width || 0, L = c.height || 0;
5571
+ this.applyPath(A, c, e, L), A.clip(), y++;
5559
5572
  } else
5560
5573
  this.renderObject(A, U, g);
5561
- }); k > 0; )
5562
- A.restore(), k--;
5574
+ }); y > 0; )
5575
+ A.restore(), y--;
5563
5576
  }
5564
5577
  const F = I.clipsContent !== !1 || I.clipContent === !0;
5565
5578
  (M || F) && M && A.restore(), A.restore();
@@ -5570,7 +5583,7 @@ class WC {
5570
5583
  }
5571
5584
  applyPath(A, I, g, C) {
5572
5585
  if (A.beginPath(), I.type === "Rectangle") {
5573
- const Q = I.corner_radius ?? I.cornerRadius ?? 0;
5586
+ const Q = I.cornerRadius ?? I.corner_radius ?? 0;
5574
5587
  A.roundRect(-g / 2, -C / 2, g, C, Q);
5575
5588
  } else if (I.type === "Ellipse")
5576
5589
  A.ellipse(0, 0, g / 2, C / 2, 0, 0, Math.PI * 2);
@@ -5579,8 +5592,8 @@ class WC {
5579
5592
  else if (I.type === "Star") {
5580
5593
  const Q = I.inner_radius || 20, E = I.outer_radius || 50, D = I.points || 5;
5581
5594
  for (let o = 0; o < D * 2; o++) {
5582
- const w = o * Math.PI / D - Math.PI / 2, h = o % 2 === 0 ? E : Q, G = h * Math.cos(w), S = h * Math.sin(w);
5583
- o === 0 ? A.moveTo(G, S) : A.lineTo(G, S);
5595
+ const w = o * Math.PI / D - Math.PI / 2, G = o % 2 === 0 ? E : Q, h = G * Math.cos(w), K = G * Math.sin(w);
5596
+ o === 0 ? A.moveTo(h, K) : A.lineTo(h, K);
5584
5597
  }
5585
5598
  A.closePath();
5586
5599
  } else I.type === "Path" && I.points && (I.points.forEach((Q, E) => {
@@ -5588,28 +5601,28 @@ class WC {
5588
5601
  }), I.is_closed && A.closePath());
5589
5602
  }
5590
5603
  renderInputBox(A, I) {
5591
- var Z, V, BA, RA;
5592
- const g = ((V = (Z = I.objectStates) == null ? void 0 : Z.get(I.id)) == null ? void 0 : V.options) || I.options || {}, C = ((BA = I.geometry) == null ? void 0 : BA.width) || 250, Q = ((RA = I.geometry) == null ? void 0 : RA.height) || 45, E = this.focusedId === I.id, D = this.lastHoveredObjectId === I.id, o = g.previewState || "default", w = o !== "default" ? o : E ? "focused" : D ? "hovered" : "default", h = g.label || { visible: !0, text: "Label" }, G = g.helperText || { visible: !1, text: "Helper text" }, S = g.leftIcon || { visible: !1 }, K = g.rightIcon || { visible: !1 }, M = g.multiline === !0, F = g.cornerRadius ?? 8, J = g.corners || { tl: F, tr: F, bl: F, br: F }, k = [J.tl, J.tr, J.br, J.bl];
5593
- let y = g.backgroundColor || "rgba(31, 41, 55, 1)", U = g.borderColor || "rgba(55, 65, 81, 1)", R = g.borderWidth ?? 1.5, c = g.color || "#ffffff", L = g.placeholderColor || "rgba(156, 163, 175, 1)", r = g.fontSize || 14;
5594
- const p = `${w}Style`, q = g[p];
5595
- q ? (q.backgroundColor !== void 0 && (y = q.backgroundColor), q.borderColor !== void 0 && (U = q.borderColor), q.borderWidth !== void 0 && (R = q.borderWidth), q.color !== void 0 && (c = q.color), q.placeholderColor !== void 0 && (L = q.placeholderColor), q.fontSize !== void 0 && (r = q.fontSize)) : w === "focused" ? (U = g.focusBorderColor || "rgba(59, 130, 246, 1)", R = Math.max(R, 2)) : w === "hovered" || w === "hover" ? (U = g.hoverBorderColor || U, y = g.hoverBackgroundColor || y) : w === "disabled" ? (y = g.disabledBackgroundColor || "rgba(31, 41, 55, 0.6)", U = g.disabledBorderColor || "rgba(55, 65, 81, 0.4)") : w === "error" && (U = "rgba(239, 68, 68, 1)", R = Math.max(R, 2)), A.beginPath(), A.roundRect(-C / 2, -Q / 2, C, Q, k), A.fillStyle = y, A.fill(), R > 0 && (A.strokeStyle = U, A.lineWidth = R, A.stroke(), (w === "focused" || w === "focus") && (A.save(), A.beginPath(), A.roundRect(-C / 2 - 2, -Q / 2 - 2, C + 4, Q + 4, k.map((CA) => CA + 2)), A.strokeStyle = "rgba(59, 130, 246, 0.3)", A.lineWidth = 2, A.stroke(), A.restore()));
5596
- const AA = (CA, z) => {
5604
+ var Z, z, BA, RA;
5605
+ const g = ((z = (Z = I.objectStates) == null ? void 0 : Z.get(I.id)) == null ? void 0 : z.options) || I.options || {}, C = ((BA = I.geometry) == null ? void 0 : BA.width) || 250, Q = ((RA = I.geometry) == null ? void 0 : RA.height) || 45, E = this.focusedId === I.id, D = this.lastHoveredObjectId === I.id, o = g.previewState || "default", w = o !== "default" ? o : E ? "focused" : D ? "hovered" : "default", G = g.label || { visible: !0, text: "Label" }, h = g.helperText || { visible: !1, text: "Helper text" }, K = g.leftIcon || { visible: !1 }, N = g.rightIcon || { visible: !1 }, M = g.multiline === !0, F = g.cornerRadius ?? 8, J = g.corners || { tl: F, tr: F, bl: F, br: F }, y = [J.tl, J.tr, J.br, J.bl];
5606
+ let k = g.backgroundColor || "rgba(31, 41, 55, 1)", U = g.borderColor || "rgba(55, 65, 81, 1)", R = g.borderWidth ?? 1.5, c = g.color || "#ffffff", e = g.placeholderColor || "rgba(156, 163, 175, 1)", L = g.fontSize || 14;
5607
+ const H = `${w}Style`, q = g[H];
5608
+ q ? (q.backgroundColor !== void 0 && (k = q.backgroundColor), q.borderColor !== void 0 && (U = q.borderColor), q.borderWidth !== void 0 && (R = q.borderWidth), q.color !== void 0 && (c = q.color), q.placeholderColor !== void 0 && (e = q.placeholderColor), q.fontSize !== void 0 && (L = q.fontSize)) : w === "focused" ? (U = g.focusBorderColor || "rgba(59, 130, 246, 1)", R = Math.max(R, 2)) : w === "hovered" || w === "hover" ? (U = g.hoverBorderColor || U, k = g.hoverBackgroundColor || k) : w === "disabled" ? (k = g.disabledBackgroundColor || "rgba(31, 41, 55, 0.6)", U = g.disabledBorderColor || "rgba(55, 65, 81, 0.4)") : w === "error" && (U = "rgba(239, 68, 68, 1)", R = Math.max(R, 2)), A.beginPath(), A.roundRect(-C / 2, -Q / 2, C, Q, y), A.fillStyle = k, A.fill(), R > 0 && (A.strokeStyle = U, A.lineWidth = R, A.stroke(), (w === "focused" || w === "focus") && (A.save(), A.beginPath(), A.roundRect(-C / 2 - 2, -Q / 2 - 2, C + 4, Q + 4, y.map((CA) => CA + 2)), A.strokeStyle = "rgba(59, 130, 246, 0.3)", A.lineWidth = 2, A.stroke(), A.restore()));
5609
+ const AA = (CA, _) => {
5597
5610
  if (!CA.visible || !CA.svgPath) return;
5598
- const EA = CA.size || 14, iA = CA.offset ?? 16, yA = CA.color || "#ffffff", tA = z ? -(C / 2) + iA : C / 2 - iA, YA = CA.svgPath;
5611
+ const EA = CA.size || 14, iA = CA.offset ?? 16, yA = CA.color || "#ffffff", tA = _ ? -(C / 2) + iA : C / 2 - iA, YA = CA.svgPath;
5599
5612
  if (A.save(), A.translate(tA, 0), !YA.startsWith("<svg")) {
5600
5613
  const QA = new Path2D(YA), KA = EA / 24;
5601
5614
  A.scale(KA, KA), A.translate(-12, -12), A.fillStyle = yA, A.fill(QA);
5602
5615
  }
5603
5616
  A.restore();
5604
5617
  };
5605
- AA(S, !0), AA(K, !1);
5606
- const GA = g.text || "", v = g.placeholder || "Enter text...", W = !GA, T = GA || v, IA = W ? L : c, x = r, d = g.fontFamily || "Inter", hA = g.fontWeight || 400;
5618
+ AA(K, !0), AA(N, !1);
5619
+ const GA = g.text || "", v = g.placeholder || "Enter text...", W = !GA, T = GA || v, IA = W ? e : c, x = L, d = g.fontFamily || "Inter", hA = g.fontWeight || 400;
5607
5620
  A.font = `${hA} ${x}px "${d}", sans-serif`, A.fillStyle = IA, A.textAlign = "left", A.textBaseline = M ? "top" : "middle";
5608
- const kA = g.inputPadding ?? 16, u = S.visible ? (S.offset ?? 16) + (S.size || 14) / 2 + 8 : kA, m = K.visible ? (K.offset ?? 16) + (K.size || 14) / 2 + 8 : kA, t = -(C / 2) + u, n = C - u - m, l = g.inputType === "password" ? "•".repeat(T.length) : T;
5621
+ const kA = g.inputPadding ?? 16, u = K.visible ? (K.offset ?? 16) + (K.size || 14) / 2 + 8 : kA, m = N.visible ? (N.offset ?? 16) + (N.size || 14) / 2 + 8 : kA, t = -(C / 2) + u, n = C - u - m, l = g.inputType === "password" ? "•".repeat(T.length) : T;
5609
5622
  if (A.save(), A.beginPath(), A.rect(t - 2, -Q / 2 + 4, n + 4, Q - 8), A.clip(), M) {
5610
5623
  const CA = l.split(`
5611
5624
  `);
5612
- let z = -Q / 2 + kA;
5625
+ let _ = -Q / 2 + kA;
5613
5626
  const EA = x * 1.2;
5614
5627
  let iA = 0;
5615
5628
  CA.forEach((yA, tA) => {
@@ -5617,36 +5630,36 @@ class WC {
5617
5630
  let QA = "";
5618
5631
  for (let KA = 0; KA < YA.length; KA++) {
5619
5632
  const OA = QA + YA[KA] + " ";
5620
- A.measureText(OA).width > n && KA > 0 ? (A.fillText(QA, t, z), QA = YA[KA] + " ", z += EA) : QA = OA;
5633
+ A.measureText(OA).width > n && KA > 0 ? (A.fillText(QA, t, _), QA = YA[KA] + " ", _ += EA) : QA = OA;
5621
5634
  }
5622
- A.fillText(QA, t, z), iA = A.measureText(QA).width, tA < CA.length - 1 && (z += EA, iA = 0);
5623
- }), E && !W && Math.floor(performance.now() / 500) % 2 === 0 && A.fillRect(t + iA, z, 1.5, x);
5635
+ A.fillText(QA, t, _), iA = A.measureText(QA).width, tA < CA.length - 1 && (_ += EA, iA = 0);
5636
+ }), E && !W && Math.floor(performance.now() / 500) % 2 === 0 && A.fillRect(t + iA, _, 1.5, x);
5624
5637
  } else {
5625
- const z = A.measureText(l).width;
5638
+ const _ = A.measureText(l).width;
5626
5639
  let EA = 0;
5627
- if (z > n && (EA = z - n), A.fillText(l, t - EA, 0), E && !W && Math.floor(performance.now() / 500) % 2 === 0) {
5628
- const yA = t + z - EA;
5640
+ if (_ > n && (EA = _ - n), A.fillText(l, t - EA, 0), E && !W && Math.floor(performance.now() / 500) % 2 === 0) {
5641
+ const yA = t + _ - EA;
5629
5642
  A.fillRect(yA, -(x / 2), 1.5, x);
5630
5643
  }
5631
5644
  }
5632
- if (A.restore(), h.visible !== !1) {
5633
- const CA = h.text || "Label", z = h.fontSize || 12, EA = h.color || "rgba(156, 163, 175, 1)", iA = h.offset ?? 8;
5634
- A.font = `600 ${z}px "${d}", sans-serif`, A.fillStyle = EA, A.textAlign = "left", A.textBaseline = "bottom";
5645
+ if (A.restore(), G.visible !== !1) {
5646
+ const CA = G.text || "Label", _ = G.fontSize || 12, EA = G.color || "rgba(156, 163, 175, 1)", iA = G.offset ?? 8;
5647
+ A.font = `600 ${_}px "${d}", sans-serif`, A.fillStyle = EA, A.textAlign = "left", A.textBaseline = "bottom";
5635
5648
  const yA = -(C / 2), tA = -(Q / 2) - iA;
5636
5649
  A.fillText(CA, yA, tA);
5637
5650
  }
5638
- if (G.visible === !0) {
5639
- const CA = G.text || "Helper text", z = G.fontSize || 11, EA = w === "error" ? "rgba(239, 68, 68, 1)" : G.color || "rgba(156, 163, 175, 1)", iA = G.offset ?? 6;
5640
- A.font = `400 ${z}px "${d}", sans-serif`, A.fillStyle = EA, A.textAlign = "left", A.textBaseline = "top";
5651
+ if (h.visible === !0) {
5652
+ const CA = h.text || "Helper text", _ = h.fontSize || 11, EA = w === "error" ? "rgba(239, 68, 68, 1)" : h.color || "rgba(156, 163, 175, 1)", iA = h.offset ?? 6;
5653
+ A.font = `400 ${_}px "${d}", sans-serif`, A.fillStyle = EA, A.textAlign = "left", A.textBaseline = "top";
5641
5654
  const yA = -(C / 2), tA = Q / 2 + iA;
5642
5655
  A.fillText(CA, yA, tA);
5643
5656
  }
5644
5657
  }
5645
5658
  renderSlider(A, I) {
5646
- const { geometry: g, options: C } = I, Q = g.width || 200, E = C || {}, D = E.value ?? 50, o = E.min ?? 0, h = (E.max ?? 100) - o, G = h === 0 ? 0 : (D - o) / h, S = E.trackHeight || 4, K = E.trackRoundedness ?? 2, M = E.trackShape ?? "Rectangle", F = E.trackPath || "", J = E.activeColor || "#3b82f6", k = E.inactiveColor || "#374151", y = E.thumbShape || "Ellipse", U = E.thumbWidth ?? 16, R = E.thumbHeight ?? 16, c = E.thumbRoundedness ?? 0, L = E.thumbColor || "#ffffff", r = E.thumbPath || "", p = E.thumbIcon || "", q = E.showValueTooltip ?? !1, AA = E.tooltipBgColor || "#333333", GA = E.tooltipColor || "#ffffff", v = E.tooltipOffsetX ?? 0, W = E.tooltipOffsetY ?? -25, T = (u, m, t, n, l, Z, V) => {
5647
- if ((u === "Custom" || u === "Icon") && V)
5659
+ const { geometry: g, options: C } = I, Q = g.width || 200, E = C || {}, D = E.value ?? 50, o = E.min ?? 0, G = (E.max ?? 100) - o, h = G === 0 ? 0 : (D - o) / G, K = E.trackHeight || 4, N = E.trackRoundedness ?? 2, M = E.trackShape ?? "Rectangle", F = E.trackPath || "", J = E.activeColor || "#3b82f6", y = E.inactiveColor || "#374151", k = E.thumbShape || "Ellipse", U = E.thumbWidth ?? 16, R = E.thumbHeight ?? 16, c = E.thumbRoundedness ?? 0, e = E.thumbColor || "#ffffff", L = E.thumbPath || "", H = E.thumbIcon || "", q = E.showValueTooltip ?? !1, AA = E.tooltipBgColor || "#333333", GA = E.tooltipColor || "#ffffff", v = E.tooltipOffsetX ?? 0, W = E.tooltipOffsetY ?? -25, T = (u, m, t, n, l, Z, z) => {
5660
+ if ((u === "Custom" || u === "Icon") && z)
5648
5661
  try {
5649
- const BA = new Path2D(V);
5662
+ const BA = new Path2D(z);
5650
5663
  if (A.save(), A.translate(m, t), u === "Icon") {
5651
5664
  const RA = Math.min(n, l) / 24;
5652
5665
  A.scale(RA, RA), A.translate(-12, -12);
@@ -5666,17 +5679,17 @@ class WC {
5666
5679
  A.moveTo(m, t - l / 2), A.lineTo(m + n / 2, t), A.lineTo(m, t + l / 2), A.lineTo(m - n / 2, t), A.closePath();
5667
5680
  else if (u === "Star") {
5668
5681
  const RA = Math.min(n, l) / 2, CA = RA / 2;
5669
- for (let z = 0; z < 5 * 2; z++) {
5670
- const EA = z % 2 === 0 ? RA : CA, iA = z * Math.PI / 5 - Math.PI / 2;
5682
+ for (let _ = 0; _ < 5 * 2; _++) {
5683
+ const EA = _ % 2 === 0 ? RA : CA, iA = _ * Math.PI / 5 - Math.PI / 2;
5671
5684
  A.lineTo(m + EA * Math.cos(iA), t + EA * Math.sin(iA));
5672
5685
  }
5673
5686
  A.closePath();
5674
5687
  } else u === "Line" && (A.moveTo(m - n / 2, t), A.lineTo(m + n / 2, t));
5675
5688
  A.fill();
5676
5689
  };
5677
- A.fillStyle = k, M === "Line" ? (A.strokeStyle = k, A.lineWidth = S, A.beginPath(), A.moveTo(-Q / 2, 0), A.lineTo(Q / 2, 0), A.stroke()) : T(M, 0, 0, Q, S, K, F);
5678
- const IA = Q * G, x = -Q / 2 + IA;
5679
- if (IA > 0 && (A.fillStyle = J, M === "Line" ? (A.strokeStyle = J, A.lineWidth = S, A.beginPath(), A.moveTo(-Q / 2, 0), A.lineTo(x, 0), A.stroke()) : M === "Rectangle" && (A.beginPath(), A.roundRect(-Q / 2, -S / 2, IA, S, K), A.fill())), A.save(), A.translate(x, 0), A.shadowColor = "rgba(0,0,0,0.2)", A.shadowBlur = 4, A.shadowOffsetY = 1, A.fillStyle = L, T(y, 0, 0, U, R, c, y === "Icon" ? p : r), A.restore(), q) {
5690
+ A.fillStyle = y, M === "Line" ? (A.strokeStyle = y, A.lineWidth = K, A.beginPath(), A.moveTo(-Q / 2, 0), A.lineTo(Q / 2, 0), A.stroke()) : T(M, 0, 0, Q, K, N, F);
5691
+ const IA = Q * h, x = -Q / 2 + IA;
5692
+ if (IA > 0 && (A.fillStyle = J, M === "Line" ? (A.strokeStyle = J, A.lineWidth = K, A.beginPath(), A.moveTo(-Q / 2, 0), A.lineTo(x, 0), A.stroke()) : M === "Rectangle" && (A.beginPath(), A.roundRect(-Q / 2, -K / 2, IA, K, N), A.fill())), A.save(), A.translate(x, 0), A.shadowColor = "rgba(0,0,0,0.2)", A.shadowBlur = 4, A.shadowOffsetY = 1, A.fillStyle = e, T(k, 0, 0, U, R, c, k === "Icon" ? H : L), A.restore(), q) {
5680
5693
  A.save(), A.translate(x + v, W);
5681
5694
  const u = Math.round(D).toString();
5682
5695
  A.font = "10px Inter, sans-serif";
@@ -5687,36 +5700,36 @@ class WC {
5687
5700
  if (d.visible !== !1) {
5688
5701
  const u = d.text || "Label", m = d.fontSize || 12, t = d.color || "rgba(156, 163, 175, 1)", n = d.offset ?? 8;
5689
5702
  A.font = `600 ${m}px "${kA}", sans-serif`, A.fillStyle = t, A.textAlign = "left", A.textBaseline = "bottom";
5690
- const l = -(Q / 2), Z = -(S / 2) - n;
5703
+ const l = -(Q / 2), Z = -(K / 2) - n;
5691
5704
  A.fillText(u, l, Z);
5692
5705
  }
5693
5706
  if (hA.visible === !0) {
5694
5707
  const u = hA.text || "Helper text", m = hA.fontSize || 11, t = hA.color || "rgba(156, 163, 175, 1)", n = hA.offset ?? 6;
5695
5708
  A.font = `400 ${m}px "${kA}", sans-serif`, A.fillStyle = t, A.textAlign = "left", A.textBaseline = "top";
5696
- const l = -(Q / 2), Z = S / 2 + n;
5709
+ const l = -(Q / 2), Z = K / 2 + n;
5697
5710
  A.fillText(u, l, Z);
5698
5711
  }
5699
5712
  }
5700
5713
  renderDropdown(A, I) {
5701
5714
  if (!this.objectStates.get(I.id)) return;
5702
- const C = I.options || {}, Q = I.geometry.width || 160, E = I.geometry.height || 40, D = -Q / 2, o = -E / 2, w = C.cornerRadius ?? 6, h = C.isOpen || !1, G = C.disabled || !1, S = this.lastHoveredObjectId === I.id;
5703
- let K = C.backgroundColor || "#ffffff", M = C.borderColor || "#e5e7eb", F = C.color || "#333333";
5704
- G ? (K = C.disabledBackgroundColor || "#f3f4f6", M = C.disabledBorderColor || "#e5e7eb", F = C.disabledColor || "#9ca3af") : h ? (K = C.activeBackgroundColor || K, M = C.activeBorderColor || M, F = C.activeColor || F) : S && (K = C.hoverBackgroundColor || K, M = C.hoverBorderColor || M, F = C.hoverColor || F), A.beginPath();
5715
+ const C = I.options || {}, Q = I.geometry.width || 160, E = I.geometry.height || 40, D = -Q / 2, o = -E / 2, w = C.cornerRadius ?? 6, G = C.isOpen || !1, h = C.disabled || !1, K = this.lastHoveredObjectId === I.id;
5716
+ let N = C.backgroundColor || "#ffffff", M = C.borderColor || "#e5e7eb", F = C.color || "#333333";
5717
+ h ? (N = C.disabledBackgroundColor || "#f3f4f6", M = C.disabledBorderColor || "#e5e7eb", F = C.disabledColor || "#9ca3af") : G ? (N = C.activeBackgroundColor || N, M = C.activeBorderColor || M, F = C.activeColor || F) : K && (N = C.hoverBackgroundColor || N, M = C.hoverBorderColor || M, F = C.hoverColor || F), A.beginPath();
5705
5718
  const J = (v, W, T, IA, x, d) => {
5706
5719
  IA < 0 && (IA = 0), x < 0 && (x = 0), d = Math.min(d, Math.min(IA, x) / 2), v.moveTo(W + d, T), v.lineTo(W + IA - d, T), v.arcTo(W + IA, T, W + IA, T + d, d), v.lineTo(W + IA, T + x - d), v.arcTo(W + IA, T + x, W + IA - d, T + x, d), v.lineTo(W + d, T + x), v.arcTo(W, T + x, W, T + x - d, d), v.lineTo(W, T + d), v.arcTo(W, T, W + d, T, d), v.closePath();
5707
5720
  };
5708
- J(A, D, o, Q, E, w), A.fillStyle = K, A.fill();
5709
- const k = C.borderWidth ?? 1;
5710
- k > 0 && (A.strokeStyle = M, A.lineWidth = k, A.stroke());
5711
- const y = 12, U = C.chevronType || "chevron", R = C.chevronSize || 16, c = (h ? C.openIconColor : C.closedIconColor) || C.chevronColor || "#6b7280";
5721
+ J(A, D, o, Q, E, w), A.fillStyle = N, A.fill();
5722
+ const y = C.borderWidth ?? 1;
5723
+ y > 0 && (A.strokeStyle = M, A.lineWidth = y, A.stroke());
5724
+ const k = 12, U = C.chevronType || "chevron", R = C.chevronSize || 16, c = (G ? C.openIconColor : C.closedIconColor) || C.chevronColor || "#6b7280";
5712
5725
  if (U !== "none") {
5713
- const v = D + Q - y - R / 2;
5726
+ const v = D + Q - k - R / 2;
5714
5727
  A.save(), A.translate(v, 0);
5715
- const W = h ? C.openIconAngle ?? 180 : C.closedIconAngle ?? 0;
5728
+ const W = G ? C.openIconAngle ?? 180 : C.closedIconAngle ?? 0;
5716
5729
  if (A.rotate(W * Math.PI / 180), A.strokeStyle = c, A.fillStyle = c, A.lineWidth = 1.5, A.lineCap = "round", A.lineJoin = "round", U === "chevron")
5717
5730
  A.beginPath(), A.moveTo(-R / 2, -R * 0.2), A.lineTo(0, R * 0.2), A.lineTo(R / 2, -R * 0.2), A.stroke();
5718
5731
  else if (U === "custom" || U === "path") {
5719
- const T = h && C.openIconPath || C.closedIconPath;
5732
+ const T = G && C.openIconPath || C.closedIconPath;
5720
5733
  if (T) {
5721
5734
  const IA = new Path2D(T);
5722
5735
  A.save();
@@ -5726,63 +5739,63 @@ class WC {
5726
5739
  }
5727
5740
  A.restore();
5728
5741
  }
5729
- const L = C.selectedOption || C.placeholder || "Select...", r = C.fontSize || 14, p = C.fontWeight || 400, q = C.fontFamily || "Inter, sans-serif";
5730
- A.font = `${p} ${r}px ${q}`, A.fillStyle = !C.selectedOption && C.placeholder ? "#9ca3af" : F, G && (A.fillStyle = C.disabledColor || "#9ca3af"), A.textAlign = "left", A.textBaseline = "middle";
5731
- const AA = U === "none" ? 0 : R + 8, GA = Q - y * 2 - AA;
5732
- if (A.save(), A.beginPath(), A.rect(D + y, o, GA, E), A.clip(), A.fillText(L, D + y, 0), A.restore(), h && !G) {
5742
+ const e = C.selectedOption || C.placeholder || "Select...", L = C.fontSize || 14, H = C.fontWeight || 400, q = C.fontFamily || "Inter, sans-serif";
5743
+ A.font = `${H} ${L}px ${q}`, A.fillStyle = !C.selectedOption && C.placeholder ? "#9ca3af" : F, h && (A.fillStyle = C.disabledColor || "#9ca3af"), A.textAlign = "left", A.textBaseline = "middle";
5744
+ const AA = U === "none" ? 0 : R + 8, GA = Q - k * 2 - AA;
5745
+ if (A.save(), A.beginPath(), A.rect(D + k, o, GA, E), A.clip(), A.fillText(e, D + k, 0), A.restore(), G && !h) {
5733
5746
  const v = o + E + 4, W = C.optionsList || [], T = C.itemHeight || 32, IA = C.listPadding ?? 4, x = W.length * T + IA * 2, d = C.listCornerRadius ?? w;
5734
5747
  A.save(), A.shadowColor = "rgba(0,0,0,0.15)", A.shadowBlur = 12, A.shadowOffsetY = 6, A.beginPath(), J(A, D, v, Q, x, d), A.fillStyle = C.listBackgroundColor || "#ffffff", A.fill();
5735
5748
  const hA = C.listBorderWidth ?? 1;
5736
5749
  hA > 0 && (A.shadowColor = "transparent", A.strokeStyle = C.listBorderColor || M, A.lineWidth = hA, A.stroke()), A.restore();
5737
- const kA = C.itemFontSize || r, u = C.itemFontFamily || q;
5738
- A.font = `${p} ${kA}px ${u}`, W.forEach((m, t) => {
5750
+ const kA = C.itemFontSize || L, u = C.itemFontFamily || q;
5751
+ A.font = `${H} ${kA}px ${u}`, W.forEach((m, t) => {
5739
5752
  const n = v + IA + t * T;
5740
5753
  if (m === C.selectedOption)
5741
5754
  A.fillStyle = C.itemSelectedBackgroundColor || C.listHoverColor || "#f3f4f6", A.fillRect(D + hA, n, Q - hA * 2, T), A.fillStyle = C.itemSelectedColor || C.activeColor || F || "#374151";
5742
5755
  else if (A.fillStyle = C.listTextColor || F || "#333333", this.activeDropdownId === I.id && this._lastPointerPos) {
5743
5756
  const Z = this.objectStates.get(I.id);
5744
5757
  if (Z) {
5745
- const V = this._lastPointerPos.y - (Z.y + E / 2 + 4 + IA), BA = Math.floor(V / T);
5758
+ const z = this._lastPointerPos.y - (Z.y + E / 2 + 4 + IA), BA = Math.floor(z / T);
5746
5759
  t === BA && (A.fillStyle = C.itemHoverBackgroundColor || C.listHoverColor || "#f9fafb", A.fillRect(D + hA, n, Q - hA * 2, T), A.fillStyle = C.itemHoverColor || F);
5747
5760
  }
5748
5761
  }
5749
- A.fillText(m, D + y, n + T / 2);
5762
+ A.fillText(m, D + k, n + T / 2);
5750
5763
  });
5751
5764
  }
5752
5765
  }
5753
5766
  renderButton(A, I) {
5754
- var y, U, R, c;
5755
- const g = I.options || {}, C = ((y = I.geometry) == null ? void 0 : y.width) || 120, Q = ((U = I.geometry) == null ? void 0 : U.height) || 40, E = -C / 2, D = -Q / 2, o = this.lastHoveredObjectId === I.id, w = g.cornerRadius ?? 8, h = g.bgShape || "Rectangle", G = o ? ((R = g.hoverStyle) == null ? void 0 : R.backgroundColor) || g.buttonBgColor || "#3b82f6" : g.buttonBgColor || "#3b82f6", S = g.label || {}, K = o ? ((c = g.hoverStyle) == null ? void 0 : c.textColor) || S.color || "#ffffff" : S.color || "#ffffff", M = g.icon || { enabled: !1 };
5756
- A.save(), A.beginPath(), h === "Rectangle" ? A.roundRect(E, D, C, Q, w) : h === "Ellipse" || h === "Circle" ? A.ellipse(0, 0, C / 2, Q / 2, 0, 0, Math.PI * 2) : h === "Pill" && A.roundRect(E, D, C, Q, Q / 2), A.fillStyle = G, A.fill();
5757
- const F = S.fontSize || 14, J = S.fontFamily || "Inter";
5758
- A.font = `${S.fontWeight || 400} ${F}px "${J}", sans-serif`, A.fillStyle = K, A.textAlign = "center", A.textBaseline = "middle";
5759
- let k = 0;
5767
+ var k, U, R, c;
5768
+ const g = I.options || {}, C = ((k = I.geometry) == null ? void 0 : k.width) || 120, Q = ((U = I.geometry) == null ? void 0 : U.height) || 40, E = -C / 2, D = -Q / 2, o = this.lastHoveredObjectId === I.id, w = g.cornerRadius ?? 8, G = g.bgShape || "Rectangle", h = o ? ((R = g.hoverStyle) == null ? void 0 : R.backgroundColor) || g.buttonBgColor || "#3b82f6" : g.buttonBgColor || "#3b82f6", K = g.label || {}, N = o ? ((c = g.hoverStyle) == null ? void 0 : c.textColor) || K.color || "#ffffff" : K.color || "#ffffff", M = g.icon || { enabled: !1 };
5769
+ A.save(), A.beginPath(), G === "Rectangle" ? A.roundRect(E, D, C, Q, w) : G === "Ellipse" || G === "Circle" ? A.ellipse(0, 0, C / 2, Q / 2, 0, 0, Math.PI * 2) : G === "Pill" && A.roundRect(E, D, C, Q, Q / 2), A.fillStyle = h, A.fill();
5770
+ const F = K.fontSize || 14, J = K.fontFamily || "Inter";
5771
+ A.font = `${K.fontWeight || 400} ${F}px "${J}", sans-serif`, A.fillStyle = N, A.textAlign = "center", A.textBaseline = "middle";
5772
+ let y = 0;
5760
5773
  if (M.enabled && M.svgPath) {
5761
- const L = M.size || 16, r = M.gap || 8, p = M.position === "left" ? -(A.measureText(S.text || "").width / 2 + L / 2 + r / 2) : A.measureText(S.text || "").width / 2 + L / 2 + r / 2;
5762
- A.save(), A.translate(p, 0);
5763
- const q = new Path2D(M.svgPath), AA = L / 24;
5764
- A.scale(AA, AA), A.translate(-12, -12), A.fillStyle = M.color || K, A.fill(q), A.restore(), k = M.position === "left" ? L / 2 + r / 2 : -(L / 2 + r / 2);
5774
+ const e = M.size || 16, L = M.gap || 8, H = M.position === "left" ? -(A.measureText(K.text || "").width / 2 + e / 2 + L / 2) : A.measureText(K.text || "").width / 2 + e / 2 + L / 2;
5775
+ A.save(), A.translate(H, 0);
5776
+ const q = new Path2D(M.svgPath), AA = e / 24;
5777
+ A.scale(AA, AA), A.translate(-12, -12), A.fillStyle = M.color || N, A.fill(q), A.restore(), y = M.position === "left" ? e / 2 + L / 2 : -(e / 2 + L / 2);
5765
5778
  }
5766
- A.fillText(S.text || "Button", k, 0), A.restore();
5779
+ A.fillText(K.text || "Button", y, 0), A.restore();
5767
5780
  }
5768
5781
  renderToggleButton(A, I) {
5769
5782
  var F, J;
5770
- const g = I.options || {}, C = g.checked ?? !1, Q = ((F = I.geometry) == null ? void 0 : F.width) || 120, E = ((J = I.geometry) == null ? void 0 : J.height) || 40, D = -Q / 2, o = -E / 2, w = g.cornerRadius ?? 8, h = g.label || {}, G = C ? g.activeColor || "#3b82f6" : g.inactiveColor || "#374151", S = C ? g.activeTextColor || "#ffffff" : g.inactiveTextColor || "#9ca3af";
5771
- A.save(), A.beginPath(), A.roundRect(D, o, Q, E, w), A.fillStyle = G, A.fill();
5772
- const K = h.fontSize || 14, M = h.fontFamily || "Inter";
5773
- A.font = `${h.fontWeight || 600} ${K}px "${M}", sans-serif`, A.fillStyle = S, A.textAlign = "center", A.textBaseline = "middle", A.fillText(h.text || "Toggle", 0, 0), A.restore();
5783
+ const g = I.options || {}, C = g.checked ?? !1, Q = ((F = I.geometry) == null ? void 0 : F.width) || 120, E = ((J = I.geometry) == null ? void 0 : J.height) || 40, D = -Q / 2, o = -E / 2, w = g.cornerRadius ?? 8, G = g.label || {}, h = C ? g.activeColor || "#3b82f6" : g.inactiveColor || "#374151", K = C ? g.activeTextColor || "#ffffff" : g.inactiveTextColor || "#9ca3af";
5784
+ A.save(), A.beginPath(), A.roundRect(D, o, Q, E, w), A.fillStyle = h, A.fill();
5785
+ const N = G.fontSize || 14, M = G.fontFamily || "Inter";
5786
+ A.font = `${G.fontWeight || 600} ${N}px "${M}", sans-serif`, A.fillStyle = K, A.textAlign = "center", A.textBaseline = "middle", A.fillText(G.text || "Toggle", 0, 0), A.restore();
5774
5787
  }
5775
5788
  renderToggle(A, I) {
5776
- var k, y;
5777
- const g = I.options || {}, C = ((k = I.geometry) == null ? void 0 : k.width) || 52, Q = ((y = I.geometry) == null ? void 0 : y.height) || 30, E = -C / 2, D = -Q / 2, o = g.checked ?? !1, w = g.cornerRadius ?? Q / 2;
5789
+ var y, k;
5790
+ const g = I.options || {}, C = ((y = I.geometry) == null ? void 0 : y.width) || 52, Q = ((k = I.geometry) == null ? void 0 : k.height) || 30, E = -C / 2, D = -Q / 2, o = g.checked ?? !1, w = g.cornerRadius ?? Q / 2;
5778
5791
  A.beginPath(), A.roundRect(E, D, C, Q, w), A.fillStyle = o ? g.activeColor || "#10b981" : g.inactiveColor || "#374151", g.disabled && (A.globalAlpha *= 0.5), A.fill();
5779
- const h = 3, G = Q - h * 2, S = G / 2, K = E + h, M = E + C - h - G, F = o ? M : K, J = D + h;
5780
- if (A.beginPath(), A.arc(F + S, J + S, S, 0, Math.PI * 2), A.fillStyle = g.knobColor || "#ffffff", A.fill(), g.disabled && (A.globalAlpha *= 2), g.label && g.label.text) {
5781
- const U = g.label, R = U.fontSize || 14, c = U.fontWeight || 400, L = U.fontFamily || "Inter";
5782
- A.font = `${c} ${R}px "${L}", sans-serif`, A.fillStyle = U.color || "#f3f4f6", A.textBaseline = "middle";
5783
- const r = U.gap || 10;
5784
- let p = 0, q = 0;
5785
- U.position === "left" ? (A.textAlign = "right", p = E - r, q = 0) : U.position === "right" ? (A.textAlign = "left", p = E + C + r, q = 0) : U.position === "top" ? (A.textAlign = "center", p = 0, q = D - r, A.textBaseline = "bottom") : U.position === "bottom" ? (A.textAlign = "center", p = 0, q = D + Q + r, A.textBaseline = "top") : (A.textAlign = "left", p = E + C + r, q = 0), A.fillText(U.text, p, q);
5792
+ const G = 3, h = Q - G * 2, K = h / 2, N = E + G, M = E + C - G - h, F = o ? M : N, J = D + G;
5793
+ if (A.beginPath(), A.arc(F + K, J + K, K, 0, Math.PI * 2), A.fillStyle = g.knobColor || "#ffffff", A.fill(), g.disabled && (A.globalAlpha *= 2), g.label && g.label.text) {
5794
+ const U = g.label, R = U.fontSize || 14, c = U.fontWeight || 400, e = U.fontFamily || "Inter";
5795
+ A.font = `${c} ${R}px "${e}", sans-serif`, A.fillStyle = U.color || "#f3f4f6", A.textBaseline = "middle";
5796
+ const L = U.gap || 10;
5797
+ let H = 0, q = 0;
5798
+ U.position === "left" ? (A.textAlign = "right", H = E - L, q = 0) : U.position === "right" ? (A.textAlign = "left", H = E + C + L, q = 0) : U.position === "top" ? (A.textAlign = "center", H = 0, q = D - L, A.textBaseline = "bottom") : U.position === "bottom" ? (A.textAlign = "center", H = 0, q = D + Q + L, A.textBaseline = "top") : (A.textAlign = "left", H = E + C + L, q = 0), A.fillText(U.text, H, q);
5786
5799
  }
5787
5800
  }
5788
5801
  renderLineGraph(A, I, g, C) {
@@ -5809,78 +5822,78 @@ class WC {
5809
5822
  if (Q.forEach((F) => {
5810
5823
  let J = F.data;
5811
5824
  if (F.isVarEnabled && F.inputId) {
5812
- let k = this.inputs.get(F.inputId);
5813
- if (k === void 0) {
5814
- const y = this.inputNameMap.get(F.inputId);
5815
- y && y.length > 0 && (k = this.inputs.get(y[0]));
5825
+ let y = this.inputs.get(F.inputId);
5826
+ if (y === void 0) {
5827
+ const k = this.inputNameMap.get(F.inputId);
5828
+ k && k.length > 0 && (y = this.inputs.get(k[0]));
5816
5829
  }
5817
- k && Array.isArray(k) && (J = k);
5830
+ y && Array.isArray(y) && (J = y);
5818
5831
  }
5819
5832
  if (J && J.length > 0) {
5820
- const k = J.filter((y) => typeof y == "number" && !isNaN(y));
5821
- k.length > 0 && (E = Math.min(E, ...k), D = Math.max(D, ...k), o = Math.max(o, J.length));
5833
+ const y = J.filter((k) => typeof k == "number" && !isNaN(k));
5834
+ y.length > 0 && (E = Math.min(E, ...y), D = Math.max(D, ...y), o = Math.max(o, J.length));
5822
5835
  }
5823
5836
  F._resolvedData = J;
5824
5837
  }), o < 2) return;
5825
- const w = D - E, h = g / (o - 1), G = (F) => {
5838
+ const w = D - E, G = g / (o - 1), h = (F) => {
5826
5839
  const J = w === 0 ? 0.5 : (F - E) / w;
5827
5840
  return C / 2 - J * C;
5828
- }, S = (F) => F * h - g / 2, K = I.axisColor || "#333333";
5829
- if (I.showXAxis && (A.beginPath(), A.strokeStyle = I.xAxisColor || K, A.lineWidth = 1, A.moveTo(-g / 2, C / 2), A.lineTo(g / 2, C / 2), A.stroke()), I.showYAxis && (A.beginPath(), A.strokeStyle = I.yAxisColor || K, A.lineWidth = 1, A.moveTo(-g / 2, -C / 2), A.lineTo(-g / 2, C / 2), A.stroke()), A.fillStyle = I.axisLabelColor || "#333333", A.font = `${I.axisLabelFontSize || 10}px Inter, sans-serif`, I.showXLabels) {
5841
+ }, K = (F) => F * G - g / 2, N = I.axisColor || "#333333";
5842
+ if (I.showXAxis && (A.beginPath(), A.strokeStyle = I.xAxisColor || N, A.lineWidth = 1, A.moveTo(-g / 2, C / 2), A.lineTo(g / 2, C / 2), A.stroke()), I.showYAxis && (A.beginPath(), A.strokeStyle = I.yAxisColor || N, A.lineWidth = 1, A.moveTo(-g / 2, -C / 2), A.lineTo(-g / 2, C / 2), A.stroke()), A.fillStyle = I.axisLabelColor || "#333333", A.font = `${I.axisLabelFontSize || 10}px Inter, sans-serif`, I.showXLabels) {
5830
5843
  A.textAlign = "center", A.textBaseline = "top";
5831
5844
  for (let F = 0; F < o; F++) {
5832
- const J = S(F);
5845
+ const J = K(F);
5833
5846
  A.fillText(`${F + 1}`, J, C / 2 + 5);
5834
5847
  }
5835
5848
  }
5836
5849
  if (I.showYLabels) {
5837
5850
  A.textAlign = "right", A.textBaseline = "middle";
5838
5851
  const F = -g / 2 - 5, J = (D + E) / 2;
5839
- A.fillText(D.toFixed(1), F, G(D)), A.fillText(J.toFixed(1), F, G(J)), A.fillText(E.toFixed(1), F, G(E));
5852
+ A.fillText(D.toFixed(1), F, h(D)), A.fillText(J.toFixed(1), F, h(J)), A.fillText(E.toFixed(1), F, h(E));
5840
5853
  }
5841
5854
  const M = 10;
5842
5855
  if (Q.forEach((F) => {
5843
5856
  const J = F._resolvedData;
5844
5857
  if (!(!J || J.length < 2)) {
5845
5858
  if (F.showArea) {
5846
- if (A.beginPath(), A.moveTo(S(0), C / 2), A.lineTo(S(0), G(J[0])), F.smoothing && J.length > 2)
5847
- for (let y = 0; y < J.length - 1; y++) {
5848
- const U = J[y === 0 ? y : y - 1], R = J[y], c = J[y + 1], L = J[y + 1 === J.length - 1 ? y + 1 : y + 2];
5849
- for (let r = 1; r <= M; r++) {
5850
- const p = r / M, q = this._catmullRom(U, R, c, L, p);
5851
- A.lineTo(S(y + p), G(q));
5859
+ if (A.beginPath(), A.moveTo(K(0), C / 2), A.lineTo(K(0), h(J[0])), F.smoothing && J.length > 2)
5860
+ for (let k = 0; k < J.length - 1; k++) {
5861
+ const U = J[k === 0 ? k : k - 1], R = J[k], c = J[k + 1], e = J[k + 1 === J.length - 1 ? k + 1 : k + 2];
5862
+ for (let L = 1; L <= M; L++) {
5863
+ const H = L / M, q = this._catmullRom(U, R, c, e, H);
5864
+ A.lineTo(K(k + H), h(q));
5852
5865
  }
5853
5866
  }
5854
5867
  else
5855
- for (let y = 1; y < J.length; y++)
5856
- A.lineTo(S(y), G(J[y]));
5857
- A.lineTo(S(J.length - 1), C / 2), A.closePath();
5858
- const k = A.globalAlpha;
5859
- A.globalAlpha = k * (I.areaOpacity ?? 0.3), A.fillStyle = F.areaColor || "rgba(139, 92, 246, 0.2)", A.fill(), A.globalAlpha = k;
5868
+ for (let k = 1; k < J.length; k++)
5869
+ A.lineTo(K(k), h(J[k]));
5870
+ A.lineTo(K(J.length - 1), C / 2), A.closePath();
5871
+ const y = A.globalAlpha;
5872
+ A.globalAlpha = y * (I.areaOpacity ?? 0.3), A.fillStyle = F.areaColor || "rgba(139, 92, 246, 0.2)", A.fill(), A.globalAlpha = y;
5860
5873
  }
5861
- if (A.beginPath(), A.strokeStyle = F.lineColor || "#3b82f6", A.lineWidth = F.lineWidth || 2, A.lineJoin = "round", A.lineCap = "round", A.moveTo(S(0), G(J[0])), F.smoothing && J.length > 2)
5862
- for (let k = 0; k < J.length - 1; k++) {
5863
- const y = J[k === 0 ? k : k - 1], U = J[k], R = J[k + 1], c = J[k + 1 === J.length - 1 ? k + 1 : k + 2];
5864
- for (let L = 1; L <= M; L++) {
5865
- const r = L / M, p = this._catmullRom(y, U, R, c, r);
5866
- A.lineTo(S(k + r), G(p));
5874
+ if (A.beginPath(), A.strokeStyle = F.lineColor || "#3b82f6", A.lineWidth = F.lineWidth || 2, A.lineJoin = "round", A.lineCap = "round", A.moveTo(K(0), h(J[0])), F.smoothing && J.length > 2)
5875
+ for (let y = 0; y < J.length - 1; y++) {
5876
+ const k = J[y === 0 ? y : y - 1], U = J[y], R = J[y + 1], c = J[y + 1 === J.length - 1 ? y + 1 : y + 2];
5877
+ for (let e = 1; e <= M; e++) {
5878
+ const L = e / M, H = this._catmullRom(k, U, R, c, L);
5879
+ A.lineTo(K(y + L), h(H));
5867
5880
  }
5868
5881
  }
5869
5882
  else
5870
- for (let k = 1; k < J.length; k++)
5871
- A.lineTo(S(k), G(J[k]));
5872
- A.stroke(), F.showPoints && J.forEach((k, y) => {
5873
- const U = S(y), R = G(k);
5883
+ for (let y = 1; y < J.length; y++)
5884
+ A.lineTo(K(y), h(J[y]));
5885
+ A.stroke(), F.showPoints && J.forEach((y, k) => {
5886
+ const U = K(k), R = h(y);
5874
5887
  A.beginPath(), A.arc(U, R, (F.pointSize || 6) / 2, 0, Math.PI * 2), A.fillStyle = F.pointFill || "#ffffff", A.fill(), A.strokeStyle = F.pointStrokeColor || F.lineColor || "#3b82f6", A.lineWidth = F.pointStrokeWidth || 1, A.stroke();
5875
5888
  });
5876
5889
  }
5877
5890
  }), I.showLegend && Q.length > 0) {
5878
5891
  const F = g / 2 - 10;
5879
5892
  let J = -C / 2 + 15;
5880
- const k = I.legendFontSize || 10, y = k + 5;
5881
- A.font = `${k}px Inter, sans-serif`, A.textAlign = "right", A.textBaseline = "alphabetic", Q.forEach((U) => {
5882
- const c = U.label || "Series", L = A.measureText(c).width;
5883
- A.beginPath(), A.rect(F - L - 8 - 5, J - (8 / 2 + 2), 8, 8), A.fillStyle = U.lineColor || "#3b82f6", A.fill(), A.fillStyle = I.legendColor || "#333333", A.fillText(c, F, J), J += y;
5893
+ const y = I.legendFontSize || 10, k = y + 5;
5894
+ A.font = `${y}px Inter, sans-serif`, A.textAlign = "right", A.textBaseline = "alphabetic", Q.forEach((U) => {
5895
+ const c = U.label || "Series", e = A.measureText(c).width;
5896
+ A.beginPath(), A.rect(F - e - 8 - 5, J - (8 / 2 + 2), 8, 8), A.fillStyle = U.lineColor || "#3b82f6", A.fill(), A.fillStyle = I.legendColor || "#333333", A.fillText(c, F, J), J += k;
5884
5897
  });
5885
5898
  }
5886
5899
  }
@@ -5889,27 +5902,27 @@ class WC {
5889
5902
  return (2 * I - 2 * g + E + D) * w + (-3 * I + 3 * g - 2 * E - D) * o + E * Q + I;
5890
5903
  }
5891
5904
  createCanvasFill(A, I, g, C) {
5892
- var Q, E, D, o, w, h;
5905
+ var Q, E, D, o, w, G;
5893
5906
  if (!I || I.type === "None") return null;
5894
5907
  if (I.type === "Solid")
5895
5908
  return I.color;
5896
5909
  if (I.type === "LinearGradient" && I.stops) {
5897
- const G = (((Q = I.start) == null ? void 0 : Q[0]) ?? 0) * g - g / 2, S = (((E = I.start) == null ? void 0 : E[1]) ?? 0) * C - C / 2, K = (((D = I.end) == null ? void 0 : D[0]) ?? 1) * g - g / 2, M = (((o = I.end) == null ? void 0 : o[1]) ?? 0) * C - C / 2, F = A.createLinearGradient(G, S, K, M);
5910
+ const h = (((Q = I.start) == null ? void 0 : Q[0]) ?? 0) * g - g / 2, K = (((E = I.start) == null ? void 0 : E[1]) ?? 0) * C - C / 2, N = (((D = I.end) == null ? void 0 : D[0]) ?? 1) * g - g / 2, M = (((o = I.end) == null ? void 0 : o[1]) ?? 0) * C - C / 2, F = A.createLinearGradient(h, K, N, M);
5898
5911
  return I.stops.forEach((J) => F.addColorStop(J.offset, J.color)), F;
5899
5912
  }
5900
5913
  if (I.type === "RadialGradient" && I.stops) {
5901
- const G = (((w = I.center) == null ? void 0 : w[0]) ?? 0.5) * g - g / 2, S = (((h = I.center) == null ? void 0 : h[1]) ?? 0.5) * C - C / 2, K = (I.radius ?? 0.5) * Math.max(g, C), M = A.createRadialGradient(G, S, 0, G, S, K);
5914
+ const h = (((w = I.center) == null ? void 0 : w[0]) ?? 0.5) * g - g / 2, K = (((G = I.center) == null ? void 0 : G[1]) ?? 0.5) * C - C / 2, N = (I.radius ?? 0.5) * Math.max(g, C), M = A.createRadialGradient(h, K, 0, h, K, N);
5902
5915
  return I.stops.forEach((F) => M.addColorStop(F.offset, F.color)), M;
5903
5916
  }
5904
5917
  if (I.type === "Pattern" && I.url) {
5905
- let G = this.imageCache.get(I.url);
5906
- if (G || (G = new Image(), G.src = I.url, this.imageCache.set(I.url, G)), G.complete && G.naturalWidth > 0) {
5907
- const S = A.createPattern(G, "repeat");
5908
- if (S && (I.scaleX !== void 0 || I.offsetX !== void 0)) {
5909
- const K = new DOMMatrix(), M = I.scaleX ?? 1, F = I.scaleY ?? 1, J = I.offsetX ?? 0, k = I.offsetY ?? 0, y = I.rotation ?? 0;
5910
- K.translateSelf(J, k), K.rotateSelf(y), K.scaleSelf(M, F), S.setTransform(K);
5918
+ let h = this.imageCache.get(I.url);
5919
+ if (h || (h = new Image(), h.src = I.url, this.imageCache.set(I.url, h)), h.complete && h.naturalWidth > 0) {
5920
+ const K = A.createPattern(h, "repeat");
5921
+ if (K && (I.scaleX !== void 0 || I.offsetX !== void 0)) {
5922
+ const N = new DOMMatrix(), M = I.scaleX ?? 1, F = I.scaleY ?? 1, J = I.offsetX ?? 0, y = I.offsetY ?? 0, k = I.rotation ?? 0;
5923
+ N.translateSelf(J, y), N.rotateSelf(k), N.scaleSelf(M, F), K.setTransform(N);
5911
5924
  }
5912
- return S;
5925
+ return K;
5913
5926
  }
5914
5927
  }
5915
5928
  return I.color || null;
@@ -5924,24 +5937,24 @@ class WC {
5924
5937
  }
5925
5938
  let o = [0, 0, 0, 0];
5926
5939
  typeof D == "number" ? o = [D, D, D, D] : Array.isArray(D) && (D.length === 1 ? o = [D[0], D[0], D[0], D[0]] : D.length === 2 ? o = [D[0], D[1], D[0], D[1]] : D.length === 4 && (o = D));
5927
- const w = Math.min(Math.abs(C) / 2, Math.abs(Q) / 2), h = Math.max(0, Math.min(Number(o[0]) || 0, w)), G = Math.max(0, Math.min(Number(o[1]) || 0, w)), S = Math.max(0, Math.min(Number(o[2]) || 0, w)), K = Math.max(0, Math.min(Number(o[3]) || 0, w));
5928
- A.moveTo(I + h, g), A.lineTo(I + C - G, g), G > 0 ? A.arcTo(I + C, g, I + C, g + G, G) : A.lineTo(I + C, g), A.lineTo(I + C, g + Q - S), S > 0 ? A.arcTo(I + C, g + Q, I + C - S, g + Q, S) : A.lineTo(I + C, g + Q), A.lineTo(I + K, g + Q), K > 0 ? A.arcTo(I, g + Q, I, g + Q - K, K) : A.lineTo(I, g + Q), A.lineTo(I, g + h), h > 0 ? A.arcTo(I, g, I + h, g, h) : A.lineTo(I, g), A.closePath();
5940
+ const w = Math.min(Math.abs(C) / 2, Math.abs(Q) / 2), G = Math.max(0, Math.min(Number(o[0]) || 0, w)), h = Math.max(0, Math.min(Number(o[1]) || 0, w)), K = Math.max(0, Math.min(Number(o[2]) || 0, w)), N = Math.max(0, Math.min(Number(o[3]) || 0, w));
5941
+ A.moveTo(I + G, g), A.lineTo(I + C - h, g), h > 0 ? A.arcTo(I + C, g, I + C, g + h, h) : A.lineTo(I + C, g), A.lineTo(I + C, g + Q - K), K > 0 ? A.arcTo(I + C, g + Q, I + C - K, g + Q, K) : A.lineTo(I + C, g + Q), A.lineTo(I + N, g + Q), N > 0 ? A.arcTo(I, g + Q, I, g + Q - N, N) : A.lineTo(I, g + Q), A.lineTo(I, g + G), G > 0 ? A.arcTo(I, g, I + G, g, G) : A.lineTo(I, g), A.closePath();
5929
5942
  }
5930
5943
  }
5931
5944
  const XC = FC(
5932
- ({ artboard: i, src: A, className: I, style: g, autoPlay: C = !0, fit: Q = "Contain", alignment: E = "Center", onReady: D, onTrigger: o, onInputUpdate: w, onComponentChange: h }, G) => {
5933
- const S = DI(null), K = DI(new WC()), M = DI(), F = DI(0);
5934
- MC(G, () => S.current), jA(() => {
5935
- console.log("[ExodeUI] Layout Effect - Component Updated/Mounted"), K.current.setLayout(Q, E);
5945
+ ({ artboard: i, src: A, className: I, style: g, autoPlay: C = !0, fit: Q = "Contain", alignment: E = "Center", onReady: D, onTrigger: o, onInputUpdate: w, onComponentChange: G }, h) => {
5946
+ const K = DI(null), N = DI(new WC()), M = DI(), F = DI(0);
5947
+ MC(h, () => K.current), jA(() => {
5948
+ console.log("[ExodeUI] Layout Effect - Component Updated/Mounted"), N.current.setLayout(Q, E);
5936
5949
  }, [Q, E]), jA(() => {
5937
- o && K.current.setTriggerCallback(o);
5950
+ o && N.current.setTriggerCallback(o);
5938
5951
  }, [o]), jA(() => {
5939
- w && K.current.setInputUpdateCallback(w);
5952
+ w && N.current.setInputUpdateCallback(w);
5940
5953
  }, [w]), jA(() => {
5941
- h && K.current.setComponentChangeCallback(h);
5942
- }, [h]), jA(() => {
5954
+ G && N.current.setComponentChangeCallback(G);
5955
+ }, [G]), jA(() => {
5943
5956
  (async () => {
5944
- const y = K.current;
5957
+ const k = N.current;
5945
5958
  let U = i;
5946
5959
  if (!U && A)
5947
5960
  try {
@@ -5950,61 +5963,63 @@ const XC = FC(
5950
5963
  console.error("Failed to load ExodeUI animation:", R);
5951
5964
  return;
5952
5965
  }
5953
- U && (y.load(U), D && D(y));
5966
+ U && (k.load(U), D && D(k));
5954
5967
  })();
5955
5968
  }, [i, A]), jA(() => {
5956
- const k = K.current, y = S.current;
5957
- if (!y) return;
5958
- const U = y.getContext("2d");
5969
+ const y = N.current, k = K.current;
5970
+ if (!k) return;
5971
+ const U = k.getContext("2d");
5959
5972
  if (!U) return;
5960
5973
  const R = (c) => {
5961
5974
  F.current || (F.current = c);
5962
- const L = (c - F.current) / 1e3;
5963
- F.current = c, C && k.advance(L);
5964
- const r = window.devicePixelRatio || 1, p = y.getBoundingClientRect(), q = Math.floor(p.width * r), AA = Math.floor(p.height * r);
5965
- (y.width !== q || y.height !== AA) && (y.width = q, y.height = AA), k.render(U, q, AA), M.current = requestAnimationFrame(R);
5975
+ const e = (c - F.current) / 1e3;
5976
+ F.current = c, C && y.advance(e);
5977
+ const L = window.devicePixelRatio || 1, H = k.getBoundingClientRect(), q = Math.floor(H.width * L), AA = Math.floor(H.height * L);
5978
+ (k.width !== q || k.height !== AA) && (k.width = q, k.height = AA), y.render(U, q, AA), M.current = requestAnimationFrame(R);
5966
5979
  };
5967
5980
  return M.current = requestAnimationFrame(R), () => {
5968
5981
  M.current && cancelAnimationFrame(M.current);
5969
5982
  };
5970
5983
  }, [C]);
5971
- const J = (k, y) => {
5972
- const U = k.currentTarget.getBoundingClientRect(), R = k.clientX - U.left, c = k.clientY - U.top, L = U.width, r = U.height;
5973
- K.current.handlePointerInput(y, R, c, L, r);
5984
+ const J = (y, k) => {
5985
+ const U = y.currentTarget.getBoundingClientRect(), R = y.clientX - U.left, c = y.clientY - U.top, e = U.width, L = U.height;
5986
+ N.current.handlePointerInput(k, R, c, e, L);
5974
5987
  };
5975
5988
  return /* @__PURE__ */ yC(
5976
5989
  "canvas",
5977
5990
  {
5978
- ref: S,
5991
+ ref: K,
5979
5992
  style: { width: "100%", height: "100%", outline: "none", ...g },
5980
5993
  className: I,
5981
5994
  tabIndex: 0,
5982
- onPointerDown: (k) => {
5983
- var y;
5984
- J(k, "down"), (y = S.current) == null || y.focus();
5995
+ onPointerDown: (y) => {
5996
+ var k;
5997
+ J(y, "down"), (k = K.current) == null || k.focus();
5985
5998
  },
5986
- onPointerUp: (k) => J(k, "up"),
5987
- onPointerMove: (k) => J(k, "move"),
5988
- onPointerLeave: (k) => J(k, "blur"),
5989
- onClick: (k) => J(k, "click"),
5990
- onKeyDown: (k) => {
5991
- k.key === "Backspace" || k.key === "Enter" || k.key, K.current.handleKeyDown(k.nativeEvent);
5999
+ onPointerUp: (y) => J(y, "up"),
6000
+ onPointerMove: (y) => J(y, "move"),
6001
+ onPointerLeave: (y) => J(y, "blur"),
6002
+ onClick: (y) => J(y, "click"),
6003
+ onKeyDown: (y) => {
6004
+ y.key === "Backspace" || y.key === "Enter" || y.key, N.current.handleKeyDown(y.nativeEvent);
5992
6005
  }
5993
6006
  }
5994
6007
  );
5995
6008
  }
5996
6009
  );
5997
6010
  function vC() {
5998
- const [i, A] = JC(null), I = uA((D, o) => {
5999
- i == null || i.setInputBool(D, o);
6000
- }, [i]), g = uA((D, o) => {
6001
- i == null || i.setInputNumber(D, o);
6002
- }, [i]), C = uA((D) => {
6003
- i == null || i.fireTrigger(D);
6004
- }, [i]), Q = uA((D, o) => {
6005
- i == null || i.setInputText(D, o);
6006
- }, [i]), E = uA((D, o) => {
6007
- i == null || i.setInputNumberArray(D, o);
6011
+ const [i, A] = JC(null), I = xA((o, w) => {
6012
+ i == null || i.setInputBool(o, w);
6013
+ }, [i]), g = xA((o, w) => {
6014
+ i == null || i.setInputNumber(o, w);
6015
+ }, [i]), C = xA((o) => {
6016
+ i == null || i.fireTrigger(o);
6017
+ }, [i]), Q = xA((o, w) => {
6018
+ i == null || i.setInputText(o, w);
6019
+ }, [i]), E = xA((o, w) => {
6020
+ i == null || i.setInputNumberArray(o, w);
6021
+ }, [i]), D = xA((o, w, G) => {
6022
+ i == null || i.updateConstraint(o, w, G);
6008
6023
  }, [i]);
6009
6024
  return {
6010
6025
  setEngine: A,
@@ -6014,13 +6029,14 @@ function vC() {
6014
6029
  setInputNumber: g,
6015
6030
  fireTrigger: C,
6016
6031
  setInputText: Q,
6017
- setInputNumberArray: E
6032
+ setInputNumberArray: E,
6033
+ updateConstraint: D
6018
6034
  };
6019
6035
  }
6020
6036
  export {
6021
6037
  UC as ConditionOp,
6022
6038
  XC as ExodeUICanvas,
6023
6039
  WC as ExodeUIEngine,
6024
- PA as LogicOp,
6040
+ VA as LogicOp,
6025
6041
  vC as useExodeUI
6026
6042
  };