@wandelbots/wandelbots-js-react-components 4.3.0 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/3d.cjs.js +1 -1
  2. package/dist/3d.es.js +1 -1
  3. package/dist/{MotionGroupVisualizer-BgvrTXeT.js → MotionGroupVisualizer-Catdk92m.js} +339 -376
  4. package/dist/{MotionGroupVisualizer-BgvrTXeT.js.map → MotionGroupVisualizer-Catdk92m.js.map} +1 -1
  5. package/dist/MotionGroupVisualizer-DePl371W.cjs +2 -0
  6. package/dist/{MotionGroupVisualizer-C_fyiA-X.cjs.map → MotionGroupVisualizer-DePl371W.cjs.map} +1 -1
  7. package/dist/{auth0-spa-js.production.esm-mvPojIrB.js → auth0-spa-js.production.esm-DNao6_S5.js} +1478 -1457
  8. package/dist/auth0-spa-js.production.esm-DNao6_S5.js.map +1 -0
  9. package/dist/auth0-spa-js.production.esm-DaBMfOV8.cjs +5 -0
  10. package/dist/auth0-spa-js.production.esm-DaBMfOV8.cjs.map +1 -0
  11. package/dist/components/robots/MotionGroupVisualizer.d.ts.map +1 -1
  12. package/dist/core.cjs.js +1 -1
  13. package/dist/core.es.js +2 -2
  14. package/dist/index.cjs.js +1 -1
  15. package/dist/index.es.js +3 -3
  16. package/dist/{interpolation-6ZZN4S_x.js → interpolation-Chyc6Hfo.js} +3054 -2868
  17. package/dist/interpolation-Chyc6Hfo.js.map +1 -0
  18. package/dist/interpolation-CiEw5jkz.cjs +20 -0
  19. package/dist/interpolation-CiEw5jkz.cjs.map +1 -0
  20. package/dist/lib/ConnectedMotionGroup.d.ts +1 -0
  21. package/dist/lib/ConnectedMotionGroup.d.ts.map +1 -1
  22. package/dist/{theming-gUgI75AD.js → theming-CZbXnFej.js} +2 -2
  23. package/dist/{theming-gUgI75AD.js.map → theming-CZbXnFej.js.map} +1 -1
  24. package/dist/{theming-Cqo-msxF.cjs → theming-b98f6nXs.cjs} +2 -2
  25. package/dist/{theming-Cqo-msxF.cjs.map → theming-b98f6nXs.cjs.map} +1 -1
  26. package/package.json +2 -3
  27. package/src/components/robots/MotionGroupVisualizer.tsx +33 -75
  28. package/dist/MotionGroupVisualizer-C_fyiA-X.cjs +0 -2
  29. package/dist/auth0-spa-js.production.esm-D_IhPirK.cjs +0 -5
  30. package/dist/auth0-spa-js.production.esm-D_IhPirK.cjs.map +0 -1
  31. package/dist/auth0-spa-js.production.esm-mvPojIrB.js.map +0 -1
  32. package/dist/interpolation-6ZZN4S_x.js.map +0 -1
  33. package/dist/interpolation-CyO6DaVa.cjs +0 -20
  34. package/dist/interpolation-CyO6DaVa.cjs.map +0 -1
@@ -1,19 +1,19 @@
1
- import { j as t, e as I } from "./externalizeComponent-Dc3fViZA.js";
1
+ import { j as t, e as C } from "./externalizeComponent-Dc3fViZA.js";
2
2
  import * as x from "three";
3
- import { Matrix4 as w, Vector3 as L, Quaternion as z } from "three";
4
- import { ConvexGeometry as te } from "three-stdlib";
5
- import { useThree as ne, useFrame as re, Canvas as N } from "@react-three/fiber";
6
- import { Environment as ve, Lightformer as F, Line as O, useGLTF as Me, Bounds as H } from "@react-three/drei";
7
- import { useTheme as _e, Card as Te, Box as b, Typography as Y, Divider as q, Button as X } from "@mui/material";
8
- import { observer as ke } from "mobx-react-lite";
9
- import Le, { useRef as R, useEffect as _, useCallback as M, useState as k, Suspense as oe, useMemo as Fe } from "react";
10
- import { useTranslation as Ge } from "react-i18next";
11
- import { N as se, V as ie, c as ae, b as Z, M as v } from "./interpolation-6ZZN4S_x.js";
12
- import { ErrorBoundary as le } from "react-error-boundary";
13
- function Ve(e) {
3
+ import { Matrix4 as w, Vector3 as L, Quaternion as E } from "three";
4
+ import { ConvexGeometry as re } from "three-stdlib";
5
+ import { useThree as oe, useFrame as se, Canvas as q } from "@react-three/fiber";
6
+ import { Environment as Me, Lightformer as G, Line as J, useGLTF as _e, Bounds as X } from "@react-three/drei";
7
+ import { useTheme as Te, Card as Le, Box as b, Typography as K, Divider as Z, Button as Q } from "@mui/material";
8
+ import { observer as Ve } from "mobx-react-lite";
9
+ import Ge, { useRef as R, useEffect as M, useCallback as T, useState as V, Suspense as ie, useMemo as O } from "react";
10
+ import { useTranslation as Fe } from "react-i18next";
11
+ import { N as ke, V as ae, c as le, b as ee, M as v, J as I } from "./interpolation-Chyc6Hfo.js";
12
+ import { ErrorBoundary as ce } from "react-error-boundary";
13
+ function Pe(e) {
14
14
  switch (e.shape_type) {
15
15
  case "convex_hull":
16
- return new te(
16
+ return new re(
17
17
  e.vertices.map(
18
18
  (n) => new x.Vector3(
19
19
  n[0] / 1e3,
@@ -47,7 +47,7 @@ function Ve(e) {
47
47
  return console.warn(`${e.shape_type} is not supported`), new x.BufferGeometry();
48
48
  }
49
49
  }
50
- function Pe({
50
+ function Ae({
51
51
  name: e,
52
52
  collider: r,
53
53
  children: n
@@ -64,7 +64,7 @@ function Pe({
64
64
  i[2]
65
65
  ).divideScalar(1e3),
66
66
  rotation: new x.Euler(o[0], o[1], o[2], "XYZ"),
67
- geometry: Ve(r.shape),
67
+ geometry: Pe(r.shape),
68
68
  children: n
69
69
  }
70
70
  );
@@ -76,7 +76,7 @@ function Se({
76
76
  ...i
77
77
  }) {
78
78
  return /* @__PURE__ */ t.jsx("group", { name: e, ...i, children: Object.entries(r).map(([o, u]) => /* @__PURE__ */ t.jsx(
79
- Pe,
79
+ Ae,
80
80
  {
81
81
  name: o,
82
82
  collider: u,
@@ -85,7 +85,7 @@ function Se({
85
85
  o
86
86
  )) });
87
87
  }
88
- function rt({
88
+ function ot({
89
89
  scene: e,
90
90
  meshChildrenProvider: r
91
91
  }) {
@@ -98,13 +98,13 @@ function rt({
98
98
  }
99
99
  ) });
100
100
  }
101
- function Q() {
102
- return /* @__PURE__ */ t.jsx(ve, { children: /* @__PURE__ */ t.jsx(Ae, {}) });
101
+ function te() {
102
+ return /* @__PURE__ */ t.jsx(Me, { children: /* @__PURE__ */ t.jsx(Ie, {}) });
103
103
  }
104
- function Ae({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
104
+ function Ie({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
105
105
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
106
106
  /* @__PURE__ */ t.jsx(
107
- F,
107
+ G,
108
108
  {
109
109
  intensity: 5,
110
110
  "rotation-x": Math.PI / 2,
@@ -113,7 +113,7 @@ function Ae({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
113
113
  }
114
114
  ),
115
115
  /* @__PURE__ */ t.jsx("group", { rotation: [0, 0.5, 0], children: /* @__PURE__ */ t.jsx("group", { children: e.map((r, n) => /* @__PURE__ */ t.jsx(
116
- F,
116
+ G,
117
117
  {
118
118
  form: "circle",
119
119
  intensity: 5,
@@ -124,7 +124,7 @@ function Ae({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
124
124
  n
125
125
  )) }) }),
126
126
  /* @__PURE__ */ t.jsx(
127
- F,
127
+ G,
128
128
  {
129
129
  intensity: 40,
130
130
  "rotation-y": Math.PI / 2,
@@ -133,7 +133,7 @@ function Ae({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
133
133
  }
134
134
  ),
135
135
  /* @__PURE__ */ t.jsx(
136
- F,
136
+ G,
137
137
  {
138
138
  intensity: 20,
139
139
  "rotation-y": -Math.PI,
@@ -142,7 +142,7 @@ function Ae({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
142
142
  }
143
143
  ),
144
144
  /* @__PURE__ */ t.jsx(
145
- F,
145
+ G,
146
146
  {
147
147
  "rotation-y": Math.PI / 2,
148
148
  position: [-5, -1, -1],
@@ -151,7 +151,7 @@ function Ae({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
151
151
  }
152
152
  ),
153
153
  /* @__PURE__ */ t.jsx(
154
- F,
154
+ G,
155
155
  {
156
156
  "rotation-y": -Math.PI / 2,
157
157
  position: [10, 1, 0],
@@ -160,7 +160,7 @@ function Ae({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
160
160
  }
161
161
  ),
162
162
  /* @__PURE__ */ t.jsx(
163
- F,
163
+ G,
164
164
  {
165
165
  form: "ring",
166
166
  color: "white",
@@ -172,18 +172,18 @@ function Ae({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
172
172
  )
173
173
  ] });
174
174
  }
175
- function Ie(e) {
175
+ function Ce(e) {
176
176
  if (e.length < 3)
177
177
  return console.log("Not enough vertices to define a plane"), { isCoplanar: !1 };
178
178
  const r = new x.Vector3(e[0].x, e[0].y, e[0].z), n = new x.Vector3(e[1].x, e[1].y, e[1].z), i = new x.Vector3(e[2].x, e[2].y, e[2].z), o = new x.Vector3().subVectors(n, r), u = new x.Vector3().subVectors(i, r), a = new x.Vector3().crossVectors(o, u).normalize();
179
179
  for (let f = 3; f < e.length; f++) {
180
- const l = new x.Vector3(e[f].x, e[f].y, e[f].z), d = new x.Vector3().subVectors(l, r), m = a.dot(d);
181
- if (Math.abs(m) > 1e-6)
180
+ const c = new x.Vector3(e[f].x, e[f].y, e[f].z), d = new x.Vector3().subVectors(c, r), h = a.dot(d);
181
+ if (Math.abs(h) > 1e-6)
182
182
  return console.log("Vertices are not on the same plane"), { isCoplanar: !1 };
183
183
  }
184
184
  return { isCoplanar: !0, normal: a };
185
185
  }
186
- function ot({
186
+ function st({
187
187
  safetyZones: e,
188
188
  ...r
189
189
  }) {
@@ -192,20 +192,20 @@ function ot({
192
192
  return n.geometry && (n.geometry.compound ? o = n.geometry.compound.child_geometries : n.geometry.convex_hull && (o = [n.geometry])), o.map((u, a) => {
193
193
  if (!u.convex_hull) return null;
194
194
  const f = u.convex_hull.vertices.map(
195
- (m) => new x.Vector3(m.x / 1e3, m.y / 1e3, m.z / 1e3)
196
- ), l = Ie(f);
197
- if (l.isCoplanar && l.normal) {
195
+ (h) => new x.Vector3(h.x / 1e3, h.y / 1e3, h.z / 1e3)
196
+ ), c = Ce(f);
197
+ if (c.isCoplanar && c.normal) {
198
198
  const s = new x.Vector3().addVectors(
199
199
  f[0],
200
- l.normal.multiplyScalar(1e-4)
200
+ c.normal.multiplyScalar(1e-4)
201
201
  );
202
202
  f.push(s);
203
203
  }
204
204
  let d;
205
205
  try {
206
- d = new te(f);
207
- } catch (m) {
208
- return console.log("Error creating ConvexGeometry:", m), null;
206
+ d = new re(f);
207
+ } catch (h) {
208
+ return console.log("Error creating ConvexGeometry:", h), null;
209
209
  }
210
210
  return /* @__PURE__ */ t.jsx("mesh", { geometry: d, children: /* @__PURE__ */ t.jsx(
211
211
  "meshStandardMaterial",
@@ -224,7 +224,7 @@ function ot({
224
224
  });
225
225
  }) });
226
226
  }
227
- function st({
227
+ function it({
228
228
  trajectory: e,
229
229
  ...r
230
230
  }) {
@@ -235,7 +235,7 @@ function st({
235
235
  -o.tcp_pose.position.y / 1e3
236
236
  ) : null).filter((o) => o !== null)) || [];
237
237
  return /* @__PURE__ */ t.jsx("group", { ...r, children: n.length > 0 && /* @__PURE__ */ t.jsx(
238
- O,
238
+ J,
239
239
  {
240
240
  points: n,
241
241
  lineWidth: 3,
@@ -245,16 +245,16 @@ function st({
245
245
  }
246
246
  ) });
247
247
  }
248
- const D = /* @__PURE__ */ new Map();
249
- async function C(e, r) {
250
- if (D.has(e))
251
- return D.get(e);
248
+ const U = /* @__PURE__ */ new Map();
249
+ async function D(e, r) {
250
+ if (U.has(e))
251
+ return U.get(e);
252
252
  const n = (async () => {
253
253
  var a;
254
- const i = r || "", o = new se({ instanceUrl: i }), u = o.api.motionGroupModels;
254
+ const i = r || "", o = new ke({ instanceUrl: i }), u = o.api.motionGroupModels;
255
255
  (a = u.axios) != null && a.interceptors && u.axios.interceptors.request.use((f) => {
256
- var l;
257
- return (l = f.url) != null && l.includes("/glb") && (f.responseType = "blob"), f;
256
+ var c;
257
+ return (c = f.url) != null && c.includes("/glb") && (f.responseType = "blob"), f;
258
258
  });
259
259
  try {
260
260
  const f = await o.api.motionGroupModels.getMotionGroupGlbModel(e);
@@ -263,31 +263,31 @@ async function C(e, r) {
263
263
  throw console.error("Failed to fetch model:", f), f;
264
264
  }
265
265
  })();
266
- return D.set(e, n), n;
266
+ return U.set(e, n), n;
267
267
  }
268
- function ce(e) {
268
+ function ue(e) {
269
269
  function r(n) {
270
270
  return n.children.length === 0 ? [n] : [n, ...n.children.flatMap((i) => r(i))];
271
271
  }
272
- return r(e).filter((n) => fe(n));
272
+ return r(e).filter((n) => de(n));
273
273
  }
274
- function ue(e) {
274
+ function fe(e) {
275
275
  return e.name.endsWith("_FLG");
276
276
  }
277
- function fe(e) {
277
+ function de(e) {
278
278
  return /_J[0-9]+$/.test(e.name);
279
279
  }
280
- function Ce(e, r) {
280
+ function De(e, r) {
281
281
  let n;
282
282
  function i(o) {
283
- if (ue(o)) {
283
+ if (fe(o)) {
284
284
  if (n)
285
285
  throw Error(
286
286
  `Found multiple flange groups in robot model ${r}; first ${n.name} then ${o.name}. Only one _FLG group is allowed.`
287
287
  );
288
288
  n = o;
289
289
  }
290
- fe(o), o.children.map(i);
290
+ de(o), o.children.map(i);
291
291
  }
292
292
  if (i(e.scene), !n)
293
293
  throw Error(
@@ -295,121 +295,121 @@ function Ce(e, r) {
295
295
  );
296
296
  return { gltf: e };
297
297
  }
298
- function de({
298
+ function me({
299
299
  rapidlyChangingMotionState: e,
300
300
  dhParameters: r,
301
301
  onRotationChanged: n,
302
302
  children: i
303
303
  }) {
304
- const o = R([]), u = R([]), a = R(null), { invalidate: f } = ne();
305
- _(() => {
304
+ const o = R([]), u = R([]), a = R(null), { invalidate: f } = oe();
305
+ M(() => {
306
306
  const s = e.joint_position.filter(
307
- (c) => c !== void 0
307
+ (l) => l !== void 0
308
308
  );
309
- return a.current = new ie(s, {
309
+ return a.current = new ae(s, {
310
310
  tension: 120,
311
311
  // Controls spring stiffness - higher values create faster, more responsive motion
312
312
  friction: 20,
313
313
  // Controls damping - higher values reduce oscillation and create smoother settling
314
314
  threshold: 1e-3
315
315
  }), () => {
316
- var c;
317
- (c = a.current) == null || c.destroy();
316
+ var l;
317
+ (l = a.current) == null || l.destroy();
318
318
  };
319
- }, []), re((s, c) => {
319
+ }, []), se((s, l) => {
320
320
  if (a.current) {
321
- const h = a.current.update(c);
322
- d(), h || f();
321
+ const m = a.current.update(l);
322
+ d(), m || f();
323
323
  }
324
324
  });
325
- function l(s) {
326
- s && (u.current = ce(s), d(), f());
325
+ function c(s) {
326
+ s && (u.current = ue(s), d(), f());
327
327
  }
328
328
  function d() {
329
- var c;
330
- const s = ((c = a.current) == null ? void 0 : c.getCurrentValues()) || [];
329
+ var l;
330
+ const s = ((l = a.current) == null ? void 0 : l.getCurrentValues()) || [];
331
331
  if (n)
332
332
  n(u.current, s);
333
333
  else
334
- for (const [h, g] of u.current.entries()) {
335
- const p = r[h], j = p.theta || 0, y = p.reverse_rotation_direction ? -1 : 1;
336
- g.rotation.y = y * (s[h] || 0) + j;
334
+ for (const [m, y] of u.current.entries()) {
335
+ const p = r[m], j = p.theta || 0, g = p.reverse_rotation_direction ? -1 : 1;
336
+ y.rotation.y = g * (s[m] || 0) + j;
337
337
  }
338
338
  }
339
- const m = M(() => {
339
+ const h = T(() => {
340
340
  const s = e.joint_position.filter(
341
- (c) => c !== void 0
341
+ (l) => l !== void 0
342
342
  );
343
343
  requestAnimationFrame(() => {
344
- var c;
345
- o.current = s, (c = a.current) == null || c.setTarget(s);
344
+ var l;
345
+ o.current = s, (l = a.current) == null || l.setTarget(s);
346
346
  });
347
347
  }, [e]);
348
- return _(() => {
349
- m();
350
- }, [e, m]), ae(() => {
351
- m();
352
- }), /* @__PURE__ */ t.jsx("group", { ref: l, children: i });
348
+ return M(() => {
349
+ h();
350
+ }, [e, h]), le(() => {
351
+ h();
352
+ }), /* @__PURE__ */ t.jsx("group", { ref: c, children: i });
353
353
  }
354
- const Ue = "line", De = "mesh";
355
- function ze({
354
+ const ze = "line", Oe = "mesh";
355
+ function Ue({
356
356
  rapidlyChangingMotionState: e,
357
357
  dhParameters: r,
358
358
  ...n
359
359
  }) {
360
360
  const i = new w(), o = R([]), u = R([]);
361
- Le.useEffect(() => {
361
+ Ge.useEffect(() => {
362
362
  o.current = new Array(r.length).fill(null), u.current = new Array(r.length).fill(null);
363
363
  }, [r.length]);
364
- function a(d, m) {
365
- const s = new L(), c = new z(), h = new L();
366
- i.decompose(s, c, h);
367
- const g = s.clone(), p = new w().makeRotationY(
368
- d.theta + m * (d.reverse_rotation_direction ? -1 : 1)
364
+ function a(d, h) {
365
+ const s = new L(), l = new E(), m = new L();
366
+ i.decompose(s, l, m);
367
+ const y = s.clone(), p = new w().makeRotationY(
368
+ d.theta + h * (d.reverse_rotation_direction ? -1 : 1)
369
369
  ).multiply(new w().makeTranslation(0, d.d / 1e3, 0)).multiply(new w().makeTranslation(d.a / 1e3, 0, 0)).multiply(new w().makeRotationX(d.alpha));
370
- return i.multiply(p), i.decompose(s, c, h), { a: g, b: s };
370
+ return i.multiply(p), i.decompose(s, l, m), { a: y, b: s };
371
371
  }
372
- function f(d, m, s, c) {
372
+ function f(d, h, s, l) {
373
373
  if (!r)
374
374
  return;
375
- const h = r[d];
376
- if (!h)
375
+ const m = r[d];
376
+ if (!m)
377
377
  return;
378
- const { a: g, b: p } = a(h, c);
379
- m.geometry.setPositions([g.toArray(), p.toArray()].flat()), s.position.set(p.x, p.y, p.z);
378
+ const { a: y, b: p } = a(m, l);
379
+ h.geometry.setPositions([y.toArray(), p.toArray()].flat()), s.position.set(p.x, p.y, p.z);
380
380
  }
381
- function l(d, m) {
381
+ function c(d, h) {
382
382
  i.identity();
383
- for (let s = 0; s < Math.min(d.length, m.length); s++) {
384
- const c = o.current[s], h = u.current[s];
385
- c && h && f(s, c, h, m[s]);
383
+ for (let s = 0; s < Math.min(d.length, h.length); s++) {
384
+ const l = o.current[s], m = u.current[s];
385
+ l && m && f(s, l, m, h[s]);
386
386
  }
387
387
  }
388
388
  return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsx(
389
- de,
389
+ me,
390
390
  {
391
391
  rapidlyChangingMotionState: e,
392
392
  dhParameters: r,
393
- onRotationChanged: l,
393
+ onRotationChanged: c,
394
394
  children: /* @__PURE__ */ t.jsxs("group", { ...n, name: "Scene", children: [
395
395
  /* @__PURE__ */ t.jsxs("mesh", { children: [
396
396
  /* @__PURE__ */ t.jsx("sphereGeometry", { args: [0.01, 32, 32] }),
397
397
  /* @__PURE__ */ t.jsx("meshStandardMaterial", { color: "black", depthTest: !0 })
398
398
  ] }),
399
- r.map((d, m) => {
400
- const { a: s, b: c } = a(
399
+ r.map((d, h) => {
400
+ const { a: s, b: l } = a(
401
401
  d,
402
- e.joint_position[m] ?? 0
403
- ), h = `dhrobot_J0${m}`;
404
- return /* @__PURE__ */ t.jsxs("group", { name: h, children: [
402
+ e.joint_position[h] ?? 0
403
+ ), m = `dhrobot_J0${h}`;
404
+ return /* @__PURE__ */ t.jsxs("group", { name: m, children: [
405
405
  /* @__PURE__ */ t.jsx(
406
- O,
406
+ J,
407
407
  {
408
- ref: (g) => {
409
- o.current[m] = g;
408
+ ref: (y) => {
409
+ o.current[h] = y;
410
410
  },
411
- name: Ue,
412
- points: [s, c],
411
+ name: ze,
412
+ points: [s, l],
413
413
  color: "white",
414
414
  lineWidth: 5
415
415
  }
@@ -417,33 +417,33 @@ function ze({
417
417
  /* @__PURE__ */ t.jsxs(
418
418
  "mesh",
419
419
  {
420
- ref: (g) => {
421
- u.current[m] = g;
420
+ ref: (y) => {
421
+ u.current[h] = y;
422
422
  },
423
- name: De,
424
- position: c,
423
+ name: Oe,
424
+ position: l,
425
425
  children: [
426
426
  /* @__PURE__ */ t.jsx("sphereGeometry", { args: [0.01, 32, 32] }),
427
427
  /* @__PURE__ */ t.jsx("meshStandardMaterial", { color: "black", depthTest: !0 })
428
428
  ]
429
429
  },
430
- "mesh_" + m
430
+ "mesh_" + h
431
431
  )
432
- ] }, h);
432
+ ] }, m);
433
433
  })
434
434
  ] })
435
435
  }
436
436
  ) });
437
437
  }
438
- const Oe = console.warn;
439
- function me() {
440
- return _(() => {
438
+ const Ee = console.warn;
439
+ function he() {
440
+ return M(() => {
441
441
  console.warn = (e) => {
442
- e !== "Cannot call the manual advancement of rafz whilst frameLoop is not set as demand" && Oe(e);
442
+ e !== "Cannot call the manual advancement of rafz whilst frameLoop is not set as demand" && Ee(e);
443
443
  };
444
444
  }, []), /* @__PURE__ */ t.jsx(t.Fragment, {});
445
445
  }
446
- function Ee(e) {
446
+ function Je(e) {
447
447
  return e.type === "Mesh";
448
448
  }
449
449
  function Be({
@@ -452,56 +452,56 @@ function Be({
452
452
  postModelRender: n,
453
453
  ...i
454
454
  }) {
455
- const o = Me(e);
455
+ const o = _e(e);
456
456
  let u;
457
457
  try {
458
- u = Ce(o, "robot.glb").gltf;
459
- } catch (l) {
460
- throw l;
458
+ u = De(o, "robot.glb").gltf;
459
+ } catch (c) {
460
+ throw c;
461
461
  }
462
- const a = M(
463
- (l) => {
464
- l && n && n();
462
+ const a = T(
463
+ (c) => {
464
+ c && n && n();
465
465
  },
466
466
  [n]
467
467
  );
468
- function f(l) {
468
+ function f(c) {
469
469
  try {
470
- return Ee(l) ? l.geometry ? /* @__PURE__ */ t.jsx(
470
+ return Je(c) ? c.geometry ? /* @__PURE__ */ t.jsx(
471
471
  "mesh",
472
472
  {
473
- name: l.name,
474
- geometry: l.geometry,
475
- material: l.material,
476
- position: l.position,
477
- rotation: l.rotation
473
+ name: c.name,
474
+ geometry: c.geometry,
475
+ material: c.material,
476
+ position: c.position,
477
+ rotation: c.rotation
478
478
  },
479
- l.uuid
480
- ) : /* @__PURE__ */ t.jsx("group", { name: l.name, position: l.position, rotation: l.rotation }, l.uuid) : /* @__PURE__ */ t.jsx(
479
+ c.uuid
480
+ ) : /* @__PURE__ */ t.jsx("group", { name: c.name, position: c.position, rotation: c.rotation }, c.uuid) : /* @__PURE__ */ t.jsx(
481
481
  "group",
482
482
  {
483
- name: l.name,
484
- position: l.position,
485
- rotation: l.rotation,
486
- ref: ue(l) ? r : void 0,
487
- children: l.children.map(f)
483
+ name: c.name,
484
+ position: c.position,
485
+ rotation: c.rotation,
486
+ ref: fe(c) ? r : void 0,
487
+ children: c.children.map(f)
488
488
  },
489
- l.uuid
489
+ c.uuid
490
490
  );
491
491
  } catch (d) {
492
- return console.warn("Error rendering node", l.name, d), null;
492
+ return console.warn("Error rendering node", c.name, d), null;
493
493
  }
494
494
  }
495
495
  return /* @__PURE__ */ t.jsx("group", { ...i, dispose: null, ref: a, children: f(u.scene) });
496
496
  }
497
- function he({
497
+ function pe({
498
498
  modelURL: e,
499
499
  flangeRef: r,
500
500
  postModelRender: n,
501
501
  ...i
502
502
  }) {
503
- const [o, u] = k(null);
504
- return _(() => {
503
+ const [o, u] = V(null);
504
+ return M(() => {
505
505
  (async () => {
506
506
  try {
507
507
  if (typeof e == "string")
@@ -524,7 +524,7 @@ function he({
524
524
  }
525
525
  ) : null;
526
526
  }
527
- const pe = (e, r) => {
527
+ const xe = (e, r) => {
528
528
  e.userData.isGhost || (e.traverse((n) => {
529
529
  if (n instanceof x.Mesh) {
530
530
  n.material instanceof x.Material && (n.material.colorWrite = !1);
@@ -548,7 +548,7 @@ const pe = (e, r) => {
548
548
  }), o.userData.isGhost = !0, n.parent && (n.parent.add(i), n.parent.add(o));
549
549
  }
550
550
  }), e.userData.isGhost = !0);
551
- }, xe = (e) => {
551
+ }, ye = (e) => {
552
552
  if (!e.userData.isGhost) return;
553
553
  const r = [];
554
554
  e.traverse((n) => {
@@ -557,64 +557,64 @@ const pe = (e, r) => {
557
557
  }), r.forEach((n) => {
558
558
  n.parent && n.parent.remove(n);
559
559
  }), e.userData.isGhost = !1;
560
- }, ge = I(
560
+ }, ge = C(
561
561
  ({
562
562
  rapidlyChangingMotionState: e,
563
563
  modelFromController: r,
564
564
  dhParameters: n,
565
- getModel: i = C,
565
+ getModel: i = D,
566
566
  flangeRef: o,
567
567
  postModelRender: u,
568
568
  transparentColor: a,
569
569
  instanceUrl: f,
570
- ...l
570
+ ...c
571
571
  }) => {
572
- const [d, m] = k(null), s = M((h) => {
573
- m(h);
572
+ const [d, h] = V(null), s = T((m) => {
573
+ h(m);
574
574
  }, []);
575
- _(() => {
576
- d && (a ? pe(d, a) : xe(d));
575
+ M(() => {
576
+ d && (a ? xe(d, a) : ye(d));
577
577
  }, [d, a]);
578
- const c = /* @__PURE__ */ t.jsx(
579
- ze,
578
+ const l = /* @__PURE__ */ t.jsx(
579
+ Ue,
580
580
  {
581
581
  rapidlyChangingMotionState: e,
582
582
  dhParameters: n,
583
- ...l
583
+ ...c
584
584
  }
585
585
  );
586
586
  return /* @__PURE__ */ t.jsxs(
587
- le,
587
+ ce,
588
588
  {
589
- fallback: c,
590
- onError: (h) => {
591
- console.warn(h);
589
+ fallback: l,
590
+ onError: (m) => {
591
+ console.warn(m);
592
592
  },
593
593
  children: [
594
- /* @__PURE__ */ t.jsx(oe, { fallback: c, children: /* @__PURE__ */ t.jsx("group", { ref: s, children: /* @__PURE__ */ t.jsx(
595
- de,
594
+ /* @__PURE__ */ t.jsx(ie, { fallback: l, children: /* @__PURE__ */ t.jsx("group", { ref: s, children: /* @__PURE__ */ t.jsx(
595
+ me,
596
596
  {
597
597
  rapidlyChangingMotionState: e,
598
598
  dhParameters: n,
599
599
  children: /* @__PURE__ */ t.jsx(
600
- he,
600
+ pe,
601
601
  {
602
602
  modelURL: (() => {
603
- const h = i(r, f);
604
- if (!h) {
605
- const g = new Blob([], { type: "model/gltf-binary" }), p = new File([g], `${r}.glb`, { type: "model/gltf-binary" });
603
+ const m = i(r, f);
604
+ if (!m) {
605
+ const y = new Blob([], { type: "model/gltf-binary" }), p = new File([y], `${r}.glb`, { type: "model/gltf-binary" });
606
606
  return Promise.resolve(URL.createObjectURL(p));
607
607
  }
608
- return h;
608
+ return m;
609
609
  })(),
610
610
  postModelRender: u,
611
611
  flangeRef: o,
612
- ...l
612
+ ...c
613
613
  }
614
614
  )
615
615
  }
616
616
  ) }) }),
617
- /* @__PURE__ */ t.jsx(me, {})
617
+ /* @__PURE__ */ t.jsx(he, {})
618
618
  ]
619
619
  }
620
620
  );
@@ -622,7 +622,7 @@ const pe = (e, r) => {
622
622
  );
623
623
  function We({
624
624
  connectedMotionGroup: e,
625
- getModel: r = C,
625
+ getModel: r = D,
626
626
  flangeRef: n,
627
627
  transparentColor: i,
628
628
  postModelRender: o,
@@ -642,8 +642,8 @@ function We({
642
642
  }
643
643
  ) : null;
644
644
  }
645
- const it = I(
646
- ke(
645
+ const at = C(
646
+ Ve(
647
647
  ({
648
648
  robotName: e,
649
649
  programState: r,
@@ -653,57 +653,57 @@ const it = I(
653
653
  onDriveToHomePress: u,
654
654
  onDriveToHomeRelease: a,
655
655
  connectedMotionGroup: f,
656
- robotComponent: l = We,
656
+ robotComponent: c = We,
657
657
  customContentComponent: d,
658
- className: m
658
+ className: h
659
659
  }) => {
660
- var W;
661
- const s = _e(), { t: c } = Ge(), [h, g] = k(!1), p = R(null), j = R(null), [y, U] = k(!1), [G, be] = k({ width: 400, height: 600 }), [Je, Re] = k(0);
662
- _(() => {
663
- const A = () => {
660
+ var $;
661
+ const s = Te(), { t: l } = Fe(), [m, y] = V(!1), p = R(null), j = R(null), [g, z] = V(!1), [F, Re] = V({ width: 400, height: 600 }), [He, ve] = V(0);
662
+ M(() => {
663
+ const S = () => {
664
664
  if (j.current) {
665
- const { offsetWidth: J, offsetHeight: K } = j.current;
666
- U(J > K), be({ width: J, height: K });
665
+ const { offsetWidth: N, offsetHeight: Y } = j.current;
666
+ z(N > Y), Re({ width: N, height: Y });
667
667
  }
668
668
  };
669
- A();
670
- const $ = new ResizeObserver(A);
671
- return j.current && $.observe(j.current), () => {
672
- $.disconnect();
669
+ S();
670
+ const H = new ResizeObserver(S);
671
+ return j.current && H.observe(j.current), () => {
672
+ H.disconnect();
673
673
  };
674
674
  }, []);
675
- const E = M(() => {
676
- Re((A) => A + 1);
677
- }, []), V = M(() => {
678
- !o || !u || (g(!0), u());
679
- }, [o, u]), P = M(() => {
680
- !o || !a || (g(!1), a());
681
- }, [o, a]), B = M(() => {
682
- h && a && (g(!1), a());
683
- }, [h, a]), T = y ? G.width < 350 : G.height < 200, S = y ? G.height < 310 : G.height < 450;
675
+ const B = T(() => {
676
+ ve((S) => S + 1);
677
+ }, []), k = T(() => {
678
+ !o || !u || (y(!0), u());
679
+ }, [o, u]), P = T(() => {
680
+ !o || !a || (y(!1), a());
681
+ }, [o, a]), W = T(() => {
682
+ m && a && (y(!1), a());
683
+ }, [m, a]), _ = g ? F.width < 350 : F.height < 200, A = g ? F.height < 310 : F.height < 450;
684
684
  return /* @__PURE__ */ t.jsx(
685
- Te,
685
+ Le,
686
686
  {
687
687
  ref: j,
688
- className: m,
688
+ className: h,
689
689
  sx: {
690
690
  width: "100%",
691
691
  height: "100%",
692
692
  display: "flex",
693
- flexDirection: y ? "row" : "column",
693
+ flexDirection: g ? "row" : "column",
694
694
  position: "relative",
695
695
  overflow: "hidden",
696
696
  minWidth: { xs: 180, sm: 220, md: 250 },
697
- minHeight: y ? { xs: 200, sm: 240, md: 260 } : { xs: 150, sm: 180, md: 220 },
697
+ minHeight: g ? { xs: 200, sm: 240, md: 260 } : { xs: 150, sm: 180, md: 220 },
698
698
  // Allow progressive hiding in portrait mode
699
699
  border: `1px solid ${s.palette.divider}`,
700
700
  borderRadius: "18px",
701
701
  boxShadow: "none",
702
- backgroundColor: ((W = s.palette.backgroundPaperElevation) == null ? void 0 : W[8]) || "#2A2A3F",
702
+ backgroundColor: (($ = s.palette.backgroundPaperElevation) == null ? void 0 : $[8]) || "#2A2A3F",
703
703
  backgroundImage: "none"
704
704
  // Override any gradient from elevation
705
705
  },
706
- children: y ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
706
+ children: g ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
707
707
  /* @__PURE__ */ t.jsx(
708
708
  b,
709
709
  {
@@ -718,10 +718,10 @@ const it = I(
718
718
  mr: { xs: 0.75, sm: 1, md: 1.5 },
719
719
  overflow: "hidden",
720
720
  // Prevent content from affecting container size
721
- display: T ? "none" : "block"
721
+ display: _ ? "none" : "block"
722
722
  },
723
- children: !T && /* @__PURE__ */ t.jsxs(
724
- N,
723
+ children: !_ && /* @__PURE__ */ t.jsxs(
724
+ q,
725
725
  {
726
726
  orthographic: !0,
727
727
  camera: {
@@ -742,12 +742,12 @@ const it = I(
742
742
  dpr: [1, 2],
743
743
  gl: { alpha: !0, antialias: !0 },
744
744
  children: [
745
- /* @__PURE__ */ t.jsx(Q, {}),
746
- /* @__PURE__ */ t.jsx(H, { fit: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ t.jsx(
747
- l,
745
+ /* @__PURE__ */ t.jsx(te, {}),
746
+ /* @__PURE__ */ t.jsx(X, { fit: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ t.jsx(
747
+ c,
748
748
  {
749
749
  connectedMotionGroup: f,
750
- postModelRender: E
750
+ postModelRender: B
751
751
  }
752
752
  ) })
753
753
  ]
@@ -763,7 +763,7 @@ const it = I(
763
763
  display: "flex",
764
764
  flexDirection: "column",
765
765
  justifyContent: "flex-start",
766
- width: T ? "100%" : "50%"
766
+ width: _ ? "100%" : "50%"
767
767
  },
768
768
  children: [
769
769
  /* @__PURE__ */ t.jsxs(
@@ -775,9 +775,9 @@ const it = I(
775
775
  textAlign: "left"
776
776
  },
777
777
  children: [
778
- /* @__PURE__ */ t.jsx(Y, { variant: "h6", component: "h2", sx: { mb: 1 }, children: e }),
778
+ /* @__PURE__ */ t.jsx(K, { variant: "h6", component: "h2", sx: { mb: 1 }, children: e }),
779
779
  /* @__PURE__ */ t.jsx(
780
- Z,
780
+ ee,
781
781
  {
782
782
  programState: r,
783
783
  safetyState: n,
@@ -799,10 +799,10 @@ const it = I(
799
799
  justifyContent: "space-between"
800
800
  },
801
801
  children: [
802
- !S && d && /* @__PURE__ */ t.jsxs(b, { children: [
802
+ !A && d && /* @__PURE__ */ t.jsxs(b, { children: [
803
803
  /* @__PURE__ */ t.jsx(d, {}),
804
804
  /* @__PURE__ */ t.jsx(
805
- q,
805
+ Z,
806
806
  {
807
807
  sx: {
808
808
  mt: 1,
@@ -817,7 +817,7 @@ const it = I(
817
817
  b,
818
818
  {
819
819
  sx: {
820
- mt: !S && d ? "auto" : 0
820
+ mt: !A && d ? "auto" : 0
821
821
  },
822
822
  children: /* @__PURE__ */ t.jsx(
823
823
  b,
@@ -829,24 +829,24 @@ const it = I(
829
829
  mb: { xs: 0.5, sm: 0.75, md: 1 }
830
830
  },
831
831
  children: /* @__PURE__ */ t.jsx(
832
- X,
832
+ Q,
833
833
  {
834
834
  ref: p,
835
835
  variant: "contained",
836
836
  color: "secondary",
837
837
  size: "small",
838
838
  disabled: !o,
839
- onMouseDown: V,
839
+ onMouseDown: k,
840
840
  onMouseUp: P,
841
- onMouseLeave: B,
842
- onTouchStart: V,
841
+ onMouseLeave: W,
842
+ onTouchStart: k,
843
843
  onTouchEnd: P,
844
844
  sx: {
845
845
  textTransform: "none",
846
846
  px: 1.5,
847
847
  py: 0.5
848
848
  },
849
- children: c("RobotCard.DriveToHome.bt")
849
+ children: l("RobotCard.DriveToHome.bt")
850
850
  }
851
851
  )
852
852
  }
@@ -870,9 +870,9 @@ const it = I(
870
870
  },
871
871
  children: [
872
872
  /* @__PURE__ */ t.jsxs(b, { children: [
873
- /* @__PURE__ */ t.jsx(Y, { variant: "h6", component: "h2", sx: { mb: 1 }, children: e }),
873
+ /* @__PURE__ */ t.jsx(K, { variant: "h6", component: "h2", sx: { mb: 1 }, children: e }),
874
874
  /* @__PURE__ */ t.jsx(
875
- Z,
875
+ ee,
876
876
  {
877
877
  programState: r,
878
878
  safetyState: n,
@@ -884,16 +884,16 @@ const it = I(
884
884
  b,
885
885
  {
886
886
  sx: {
887
- flex: T ? 0 : 1,
887
+ flex: _ ? 0 : 1,
888
888
  position: "relative",
889
- minHeight: T ? 0 : { xs: 120, sm: 150, md: 200 },
890
- height: T ? 0 : "auto",
889
+ minHeight: _ ? 0 : { xs: 120, sm: 150, md: 200 },
890
+ height: _ ? 0 : "auto",
891
891
  borderRadius: 1,
892
892
  overflow: "hidden",
893
- display: T ? "none" : "block"
893
+ display: _ ? "none" : "block"
894
894
  },
895
- children: !T && /* @__PURE__ */ t.jsxs(
896
- N,
895
+ children: !_ && /* @__PURE__ */ t.jsxs(
896
+ q,
897
897
  {
898
898
  orthographic: !0,
899
899
  camera: {
@@ -912,12 +912,12 @@ const it = I(
912
912
  dpr: [1, 2],
913
913
  gl: { alpha: !0, antialias: !0 },
914
914
  children: [
915
- /* @__PURE__ */ t.jsx(Q, {}),
916
- /* @__PURE__ */ t.jsx(H, { fit: !0, clip: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ t.jsx(
917
- l,
915
+ /* @__PURE__ */ t.jsx(te, {}),
916
+ /* @__PURE__ */ t.jsx(X, { fit: !0, clip: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ t.jsx(
917
+ c,
918
918
  {
919
919
  connectedMotionGroup: f,
920
- postModelRender: E
920
+ postModelRender: B
921
921
  }
922
922
  ) })
923
923
  ]
@@ -926,10 +926,10 @@ const it = I(
926
926
  }
927
927
  ),
928
928
  /* @__PURE__ */ t.jsxs(b, { children: [
929
- !S && d && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
929
+ !A && d && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
930
930
  /* @__PURE__ */ t.jsx(d, {}),
931
931
  /* @__PURE__ */ t.jsx(
932
- q,
932
+ Z,
933
933
  {
934
934
  sx: {
935
935
  mt: 1,
@@ -946,28 +946,28 @@ const it = I(
946
946
  sx: {
947
947
  display: "flex",
948
948
  justifyContent: "flex-start",
949
- mt: !S && d ? { xs: 1, sm: 2, md: 5 } : { xs: 0.5, sm: 1, md: 2 },
949
+ mt: !A && d ? { xs: 1, sm: 2, md: 5 } : { xs: 0.5, sm: 1, md: 2 },
950
950
  mb: { xs: 0.5, sm: 0.75, md: 1 }
951
951
  },
952
952
  children: /* @__PURE__ */ t.jsx(
953
- X,
953
+ Q,
954
954
  {
955
955
  ref: p,
956
956
  variant: "contained",
957
957
  color: "secondary",
958
958
  size: "small",
959
959
  disabled: !o,
960
- onMouseDown: V,
960
+ onMouseDown: k,
961
961
  onMouseUp: P,
962
- onMouseLeave: B,
963
- onTouchStart: V,
962
+ onMouseLeave: W,
963
+ onTouchStart: k,
964
964
  onTouchEnd: P,
965
965
  sx: {
966
966
  textTransform: "none",
967
967
  px: 1.5,
968
968
  py: 0.5
969
969
  },
970
- children: c("RobotCard.DriveToHome.bt")
970
+ children: l("RobotCard.DriveToHome.bt")
971
971
  }
972
972
  )
973
973
  }
@@ -980,117 +980,117 @@ const it = I(
980
980
  );
981
981
  }
982
982
  )
983
- ), at = Array(6).fill(2 * Math.PI);
984
- function ye({
983
+ ), lt = Array(6).fill(2 * Math.PI);
984
+ function je({
985
985
  rapidlyChangingMotionState: e,
986
986
  dhParameters: r,
987
987
  onTranslationChanged: n,
988
988
  children: i
989
989
  }) {
990
- const o = R([]), u = R([]), a = R(null), { invalidate: f } = ne();
991
- _(() => {
990
+ const o = R([]), u = R([]), a = R(null), { invalidate: f } = oe();
991
+ M(() => {
992
992
  const s = e.joint_position.filter(
993
- (c) => c !== void 0
993
+ (l) => l !== void 0
994
994
  );
995
- return a.current = new ie(s, {
995
+ return a.current = new ae(s, {
996
996
  tension: 120,
997
997
  // Controls spring stiffness - higher values create faster, more responsive motion
998
998
  friction: 20,
999
999
  // Controls damping - higher values reduce oscillation and create smoother settling
1000
1000
  threshold: 1e-3
1001
1001
  }), () => {
1002
- var c;
1003
- (c = a.current) == null || c.destroy();
1002
+ var l;
1003
+ (l = a.current) == null || l.destroy();
1004
1004
  };
1005
- }, []), re((s, c) => {
1005
+ }, []), se((s, l) => {
1006
1006
  if (a.current) {
1007
- const h = a.current.update(c);
1008
- d(), h || f();
1007
+ const m = a.current.update(l);
1008
+ d(), m || f();
1009
1009
  }
1010
1010
  });
1011
- function l(s) {
1012
- s && (u.current = ce(s), d(), f());
1011
+ function c(s) {
1012
+ s && (u.current = ue(s), d(), f());
1013
1013
  }
1014
1014
  function d() {
1015
- var c;
1016
- const s = ((c = a.current) == null ? void 0 : c.getCurrentValues()) || [];
1015
+ var l;
1016
+ const s = ((l = a.current) == null ? void 0 : l.getCurrentValues()) || [];
1017
1017
  if (n)
1018
1018
  n(u.current, s);
1019
1019
  else
1020
- for (const [h, g] of u.current.entries()) {
1021
- const j = r[h].reverse_rotation_direction ? -1 : 1;
1022
- g.position.y = j * (s[h] || 0) / 1e3;
1020
+ for (const [m, y] of u.current.entries()) {
1021
+ const j = r[m].reverse_rotation_direction ? -1 : 1;
1022
+ y.position.y = j * (s[m] || 0) / 1e3;
1023
1023
  }
1024
1024
  }
1025
- const m = M(() => {
1025
+ const h = T(() => {
1026
1026
  const s = e.joint_position.filter(
1027
- (c) => c !== void 0
1027
+ (l) => l !== void 0
1028
1028
  );
1029
1029
  requestAnimationFrame(() => {
1030
- var c;
1031
- o.current = s, (c = a.current) == null || c.setTarget(s);
1030
+ var l;
1031
+ o.current = s, (l = a.current) == null || l.setTarget(s);
1032
1032
  });
1033
1033
  }, [e]);
1034
- return _(() => {
1035
- m();
1036
- }, [e, m]), ae(() => {
1037
- m();
1038
- }), /* @__PURE__ */ t.jsx("group", { ref: l, children: i });
1034
+ return M(() => {
1035
+ h();
1036
+ }, [e, h]), le(() => {
1037
+ h();
1038
+ }), /* @__PURE__ */ t.jsx("group", { ref: c, children: i });
1039
1039
  }
1040
- function je({
1040
+ function we({
1041
1041
  rapidlyChangingMotionState: e,
1042
1042
  dhParameters: r,
1043
1043
  ...n
1044
1044
  }) {
1045
1045
  const i = new w(), o = R(null), u = R(null);
1046
1046
  function a(d) {
1047
- const m = new w();
1048
- for (let g = 0; g < r.length; g++) {
1049
- const p = r[g], j = d[g] ?? 0, y = new w().makeRotationY(p.theta).multiply(
1047
+ const h = new w();
1048
+ for (let y = 0; y < r.length; y++) {
1049
+ const p = r[y], j = d[y] ?? 0, g = new w().makeRotationY(p.theta).multiply(
1050
1050
  new w().makeTranslation(
1051
1051
  p.a / 1e3,
1052
1052
  (p.d + j * (p.reverse_rotation_direction ? -1 : 1)) / 1e3,
1053
1053
  0
1054
1054
  )
1055
1055
  ).multiply(new w().makeRotationX(p.alpha));
1056
- m.multiply(y);
1056
+ h.multiply(g);
1057
1057
  }
1058
- const s = new L(), c = new z(), h = new L();
1059
- return m.decompose(s, c, h), s;
1058
+ const s = new L(), l = new E(), m = new L();
1059
+ return h.decompose(s, l, m), s;
1060
1060
  }
1061
1061
  const f = a(e.joint_position);
1062
- function l(d, m) {
1062
+ function c(d, h) {
1063
1063
  i.identity();
1064
1064
  let s = new L();
1065
1065
  for (let p = 0; p < r.length; p++) {
1066
- const j = m[p] ?? 0, y = r[p], U = new w().makeRotationY(y.theta).multiply(
1066
+ const j = h[p] ?? 0, g = r[p], z = new w().makeRotationY(g.theta).multiply(
1067
1067
  new w().makeTranslation(
1068
- y.a / 1e3,
1069
- (y.d + j * (y.reverse_rotation_direction ? -1 : 1)) / 1e3,
1068
+ g.a / 1e3,
1069
+ (g.d + j * (g.reverse_rotation_direction ? -1 : 1)) / 1e3,
1070
1070
  0
1071
1071
  )
1072
- ).multiply(new w().makeRotationX(y.alpha));
1073
- i.multiply(U);
1072
+ ).multiply(new w().makeRotationX(g.alpha));
1073
+ i.multiply(z);
1074
1074
  }
1075
- const c = new L(), h = new z(), g = new L();
1076
- if (i.decompose(c, h, g), s = c, o.current && o.current.position.set(s.x, s.y, s.z), u.current) {
1075
+ const l = new L(), m = new E(), y = new L();
1076
+ if (i.decompose(l, m, y), s = l, o.current && o.current.position.set(s.x, s.y, s.z), u.current) {
1077
1077
  const p = u.current.geometry;
1078
1078
  p && p.setPositions && p.setPositions([0, 0, 0, s.x, s.y, s.z]);
1079
1079
  }
1080
1080
  }
1081
1081
  return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsx(
1082
- ye,
1082
+ je,
1083
1083
  {
1084
1084
  rapidlyChangingMotionState: e,
1085
1085
  dhParameters: r,
1086
- onTranslationChanged: l,
1086
+ onTranslationChanged: c,
1087
1087
  children: /* @__PURE__ */ t.jsxs("group", { ...n, name: "Scene", children: [
1088
1088
  /* @__PURE__ */ t.jsxs("mesh", { name: "Base", position: [0, 0, 0], children: [
1089
1089
  /* @__PURE__ */ t.jsx("sphereGeometry", { args: [0.02, 32, 32] }),
1090
1090
  /* @__PURE__ */ t.jsx("meshStandardMaterial", { color: "green", depthTest: !0 })
1091
1091
  ] }),
1092
1092
  /* @__PURE__ */ t.jsx(
1093
- O,
1093
+ J,
1094
1094
  {
1095
1095
  ref: u,
1096
1096
  points: [new L(0, 0, 0), f],
@@ -1106,72 +1106,72 @@ function je({
1106
1106
  }
1107
1107
  ) });
1108
1108
  }
1109
- const we = I(
1109
+ const be = C(
1110
1110
  ({
1111
1111
  rapidlyChangingMotionState: e,
1112
1112
  modelFromController: r,
1113
1113
  dhParameters: n,
1114
- getModel: i = C,
1114
+ getModel: i = D,
1115
1115
  flangeRef: o,
1116
1116
  postModelRender: u,
1117
1117
  transparentColor: a,
1118
1118
  instanceUrl: f,
1119
- ...l
1119
+ ...c
1120
1120
  }) => {
1121
- const [d, m] = k(null), s = M((h) => {
1122
- m(h);
1121
+ const [d, h] = V(null), s = T((m) => {
1122
+ h(m);
1123
1123
  }, []);
1124
- _(() => {
1125
- d && (a ? pe(d, a) : xe(d));
1124
+ M(() => {
1125
+ d && (a ? xe(d, a) : ye(d));
1126
1126
  }, [d, a]);
1127
- const c = /* @__PURE__ */ t.jsx(
1128
- je,
1127
+ const l = /* @__PURE__ */ t.jsx(
1128
+ we,
1129
1129
  {
1130
1130
  rapidlyChangingMotionState: e,
1131
1131
  dhParameters: n,
1132
- ...l
1132
+ ...c
1133
1133
  }
1134
1134
  );
1135
1135
  return /* @__PURE__ */ t.jsxs(
1136
- le,
1136
+ ce,
1137
1137
  {
1138
- fallback: c,
1139
- onError: (h) => {
1140
- console.warn(h);
1138
+ fallback: l,
1139
+ onError: (m) => {
1140
+ console.warn(m);
1141
1141
  },
1142
1142
  children: [
1143
- /* @__PURE__ */ t.jsx(oe, { fallback: c, children: /* @__PURE__ */ t.jsx("group", { ref: s, children: /* @__PURE__ */ t.jsx(
1144
- ye,
1143
+ /* @__PURE__ */ t.jsx(ie, { fallback: l, children: /* @__PURE__ */ t.jsx("group", { ref: s, children: /* @__PURE__ */ t.jsx(
1144
+ je,
1145
1145
  {
1146
1146
  rapidlyChangingMotionState: e,
1147
1147
  dhParameters: n,
1148
1148
  children: /* @__PURE__ */ t.jsx(
1149
- he,
1149
+ pe,
1150
1150
  {
1151
1151
  modelURL: (() => {
1152
- const h = i(r, f);
1153
- if (!h) {
1154
- const g = new Blob([], { type: "model/gltf-binary" }), p = new File([g], `${r}.glb`, { type: "model/gltf-binary" });
1152
+ const m = i(r, f);
1153
+ if (!m) {
1154
+ const y = new Blob([], { type: "model/gltf-binary" }), p = new File([y], `${r}.glb`, { type: "model/gltf-binary" });
1155
1155
  return Promise.resolve(URL.createObjectURL(p));
1156
1156
  }
1157
- return h;
1157
+ return m;
1158
1158
  })(),
1159
1159
  postModelRender: u,
1160
1160
  flangeRef: o,
1161
- ...l
1161
+ ...c
1162
1162
  }
1163
1163
  )
1164
1164
  }
1165
1165
  ) }) }),
1166
- /* @__PURE__ */ t.jsx(me, {})
1166
+ /* @__PURE__ */ t.jsx(he, {})
1167
1167
  ]
1168
1168
  }
1169
1169
  );
1170
1170
  }
1171
1171
  );
1172
- function lt({
1172
+ function ct({
1173
1173
  connectedMotionGroup: e,
1174
- getModel: r = C,
1174
+ getModel: r = D,
1175
1175
  flangeRef: n,
1176
1176
  transparentColor: i,
1177
1177
  postModelRender: o,
@@ -1181,7 +1181,7 @@ function lt({
1181
1181
  return null;
1182
1182
  const a = e.modelFromController || "";
1183
1183
  return a && r(a) ? /* @__PURE__ */ t.jsx(
1184
- we,
1184
+ be,
1185
1185
  {
1186
1186
  rapidlyChangingMotionState: e.rapidlyChangingMotionState,
1187
1187
  modelFromController: a,
@@ -1193,7 +1193,7 @@ function lt({
1193
1193
  ...u
1194
1194
  }
1195
1195
  ) : /* @__PURE__ */ t.jsx(
1196
- je,
1196
+ we,
1197
1197
  {
1198
1198
  rapidlyChangingMotionState: e.rapidlyChangingMotionState,
1199
1199
  dhParameters: e.dhParameters,
@@ -1201,7 +1201,7 @@ function lt({
1201
1201
  }
1202
1202
  );
1203
1203
  }
1204
- const ee = {
1204
+ const ne = {
1205
1205
  [v.Abb]: [0, 0, 0, 0, Math.PI / 2, 0, 0],
1206
1206
  [v.Fanuc]: [0, 0, 0, 0, -Math.PI / 2, 0, 0],
1207
1207
  [v.Yaskawa]: [0, 0, 0, 0, -Math.PI / 2, 0, 0],
@@ -1241,74 +1241,37 @@ function $e(e) {
1241
1241
  return null;
1242
1242
  }
1243
1243
  }
1244
- function ct(e, r) {
1244
+ function ut(e, r) {
1245
1245
  const n = $e(e);
1246
- return n && n in ee ? ee[n] : r || null;
1246
+ return n && n in ne ? ne[n] : r || null;
1247
1247
  }
1248
- const ut = I((e) => {
1248
+ const ft = C((e) => {
1249
1249
  const {
1250
- instanceUrl: r,
1251
- inverseSolver: n,
1252
- modelFromController: i,
1253
- ...o
1254
- } = e, [u, a] = k(
1255
- n
1256
- ), [, f] = k(!1), l = M(async () => {
1257
- const m = new se({ instanceUrl: r });
1258
- try {
1259
- const s = await m.api.motionGroupModels.getMotionGroupKinematicModel(
1260
- i
1261
- );
1262
- a(s.inverse_solver);
1263
- } catch {
1264
- console.warn(
1265
- `Failed to fetch kinematic model from API for ${i}, falling back to local config`
1266
- );
1267
- } finally {
1268
- setTimeout(() => f(!0), 0);
1269
- }
1270
- }, [i, r]);
1271
- _(() => {
1272
- n === void 0 && !!i && !!r && l();
1273
- }, [n, i, l, r]);
1274
- const d = Fe(() => [
1275
- "KUKA_DKP250",
1276
- "KUKA_DKP500_2",
1277
- "Yaskawa_TURN1",
1278
- "Yaskawa_TURN2",
1279
- "Yaskawa_TURN3"
1280
- ].some((m) => m.toLowerCase() === i.toLowerCase()), [i]);
1281
- return u || d ? /* @__PURE__ */ t.jsx(
1282
- ge,
1283
- {
1284
- instanceUrl: r,
1285
- modelFromController: i,
1286
- ...o
1287
- }
1288
- ) : u === null ? /* @__PURE__ */ t.jsx(
1289
- we,
1290
- {
1291
- instanceUrl: r,
1292
- modelFromController: i,
1293
- ...o
1294
- }
1295
- ) : null;
1250
+ inverseSolver: r,
1251
+ dhParameters: n,
1252
+ ...i
1253
+ } = e, [o, u] = V(I.RevoluteJoint);
1254
+ M(() => {
1255
+ n.length && u(n[0].type ?? I.RevoluteJoint);
1256
+ }, [n]);
1257
+ const a = O(() => r === null && o === I.RevoluteJoint, [r, o]), f = O(() => r === null && o === I.PrismaticJoint, [r, o]);
1258
+ return O(() => !!r, [r]) || a ? /* @__PURE__ */ t.jsx(ge, { dhParameters: n, ...i }) : f ? /* @__PURE__ */ t.jsx(be, { dhParameters: n, ...i }) : /* @__PURE__ */ t.jsx(t.Fragment, {});
1296
1259
  });
1297
1260
  export {
1298
- rt as C,
1299
- lt as L,
1300
- ee as M,
1301
- Q as P,
1261
+ ot as C,
1262
+ ct as L,
1263
+ ne as M,
1264
+ te as P,
1302
1265
  We as R,
1303
- ot as S,
1304
- st as T,
1305
- ut as a,
1306
- it as b,
1307
- we as c,
1266
+ st as S,
1267
+ it as T,
1268
+ ft as a,
1269
+ at as b,
1270
+ be as c,
1308
1271
  ge as d,
1309
- at as e,
1310
- C as f,
1272
+ lt as e,
1273
+ D as f,
1311
1274
  $e as g,
1312
- ct as h
1275
+ ut as h
1313
1276
  };
1314
- //# sourceMappingURL=MotionGroupVisualizer-BgvrTXeT.js.map
1277
+ //# sourceMappingURL=MotionGroupVisualizer-Catdk92m.js.map