@wandelbots/wandelbots-js-react-components 5.5.2-pr.fix-performance-issues.594.c24b644 → 5.5.2

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.
@@ -1,26 +1,26 @@
1
- import { jsx as r, jsxs as w, Fragment as E } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as x, Fragment as C } from "react/jsx-runtime";
2
2
  import * as b from "three";
3
- import { Matrix4 as R, Vector3 as L, Quaternion as W } from "three";
4
- import { ConvexGeometry as se, RoundedBoxGeometry as Le } from "three-stdlib";
5
- import Se, { useMemo as A, useRef as M, useEffect as T, useState as S, useCallback as G, Suspense as ae } from "react";
6
- import { d as Ge, v as Pe, o as Ae, e as j } from "./externalizeComponent-D6S3WLFc.js";
7
- import { Environment as Ie, Lightformer as P, Line as $, useGLTF as Fe, Bounds as Z } from "@react-three/drei";
8
- import { useTheme as De } from "@mui/material/styles";
3
+ import { Matrix4 as R, Vector3 as G, Quaternion as W } from "three";
4
+ import { ConvexGeometry as ie, RoundedBoxGeometry as ke } from "three-stdlib";
5
+ import Le, { useMemo as j, useRef as M, useEffect as T, useCallback as L, useState as S, Suspense as se } from "react";
6
+ import { d as Ge, v as Se, o as Ae, e as E } from "./externalizeComponent-BuuzAqKe.js";
7
+ import { Environment as Fe, Lightformer as F, Line as $, useGLTF as Pe, Bounds as Z } from "@react-three/drei";
8
+ import { useTheme as Ie } from "@mui/material/styles";
9
9
  import v from "@mui/material/Box";
10
10
  import Q from "@mui/material/Button";
11
- import Oe from "@mui/material/Card";
11
+ import De from "@mui/material/Card";
12
12
  import z from "@mui/material/Divider";
13
13
  import ee from "@mui/material/Typography";
14
- import { useThree as le, useFrame as ce, Canvas as te } from "@react-three/fiber";
15
- import { observer as Ve } from "mobx-react-lite";
16
- import { useTranslation as Ue } from "react-i18next";
17
- import { V as ue, c as fe, b as re } from "./interpolation-D9WFd-j_.js";
18
- import { NovaClient as Ce, Manufacturer as _, JointTypeEnum as C } from "@wandelbots/nova-js/v2";
14
+ import { useThree as ae, useFrame as le, Canvas as te } from "@react-three/fiber";
15
+ import { observer as Oe } from "mobx-react-lite";
16
+ import { useTranslation as Ve } from "react-i18next";
17
+ import { V as ce, c as ue, b as re } from "./interpolation-BfD7X52s.js";
18
+ import { NovaClient as Ue, Manufacturer as _, JointTypeEnum as U } from "@wandelbots/nova-js/v2";
19
19
  import { ErrorBoundary as pe } from "react-error-boundary";
20
- function Ee(e) {
20
+ function Ce(e) {
21
21
  switch (e.shape_type) {
22
22
  case "convex_hull":
23
- return new se(
23
+ return new ie(
24
24
  e.vertices.map(
25
25
  (t) => new b.Vector3(
26
26
  t[0] / 1e3,
@@ -59,46 +59,46 @@ function je({
59
59
  collider: n,
60
60
  children: t
61
61
  }) {
62
- var f, c;
63
- const l = ((f = n.pose) == null ? void 0 : f.position) ?? [0, 0, 0], i = ((c = n.pose) == null ? void 0 : c.orientation) ?? [0, 0, 0];
62
+ var p, u;
63
+ const a = ((p = n.pose) == null ? void 0 : p.position) ?? [0, 0, 0], i = ((u = n.pose) == null ? void 0 : u.orientation) ?? [0, 0, 0];
64
64
  return n.margin && console.warn(`${e} margin is not supported`), /* @__PURE__ */ r(
65
65
  "mesh",
66
66
  {
67
67
  name: e,
68
68
  position: new b.Vector3(
69
- l[0],
70
- l[1],
71
- l[2]
69
+ a[0],
70
+ a[1],
71
+ a[2]
72
72
  ).divideScalar(1e3),
73
73
  rotation: new b.Euler(i[0], i[1], i[2], "XYZ"),
74
- geometry: Ee(n.shape),
74
+ geometry: Ce(n.shape),
75
75
  children: t
76
76
  }
77
77
  );
78
78
  }
79
- function Je({
79
+ function Ee({
80
80
  name: e,
81
81
  colliders: n,
82
82
  meshChildrenProvider: t,
83
- ...l
83
+ ...a
84
84
  }) {
85
- return /* @__PURE__ */ r("group", { name: e, ...l, children: Object.entries(n).map(([i, f]) => /* @__PURE__ */ r(
85
+ return /* @__PURE__ */ r("group", { name: e, ...a, children: Object.entries(n).map(([i, p]) => /* @__PURE__ */ r(
86
86
  je,
87
87
  {
88
88
  name: i,
89
- collider: f,
90
- children: t(i, f)
89
+ collider: p,
90
+ children: t(i, p)
91
91
  },
92
92
  i
93
93
  )) });
94
94
  }
95
- function bt({
95
+ function yt({
96
96
  scene: e,
97
97
  meshChildrenProvider: n
98
98
  }) {
99
99
  const t = e.colliders;
100
100
  return /* @__PURE__ */ r("group", { children: t && /* @__PURE__ */ r(
101
- Je,
101
+ Ee,
102
102
  {
103
103
  meshChildrenProvider: n,
104
104
  colliders: t
@@ -106,13 +106,12 @@ function bt({
106
106
  ) });
107
107
  }
108
108
  function ne() {
109
- return /* @__PURE__ */ r(Ie, { frames: 1, children: /* @__PURE__ */ r(We, {}) });
109
+ return /* @__PURE__ */ r(Fe, { children: /* @__PURE__ */ r(Je, {}) });
110
110
  }
111
- const Be = [2, 0, 2, 0, 2, 0, 2, 0];
112
- function We({ positions: e = Be }) {
113
- return /* @__PURE__ */ w(E, { children: [
111
+ function Je({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
112
+ return /* @__PURE__ */ x(C, { children: [
114
113
  /* @__PURE__ */ r(
115
- P,
114
+ F,
116
115
  {
117
116
  intensity: 5,
118
117
  "rotation-x": Math.PI / 2,
@@ -121,7 +120,7 @@ function We({ positions: e = Be }) {
121
120
  }
122
121
  ),
123
122
  /* @__PURE__ */ r("group", { rotation: [0, 0.5, 0], children: /* @__PURE__ */ r("group", { children: e.map((n, t) => /* @__PURE__ */ r(
124
- P,
123
+ F,
125
124
  {
126
125
  form: "circle",
127
126
  intensity: 5,
@@ -132,7 +131,7 @@ function We({ positions: e = Be }) {
132
131
  t
133
132
  )) }) }),
134
133
  /* @__PURE__ */ r(
135
- P,
134
+ F,
136
135
  {
137
136
  intensity: 40,
138
137
  "rotation-y": Math.PI / 2,
@@ -141,7 +140,7 @@ function We({ positions: e = Be }) {
141
140
  }
142
141
  ),
143
142
  /* @__PURE__ */ r(
144
- P,
143
+ F,
145
144
  {
146
145
  intensity: 20,
147
146
  "rotation-y": -Math.PI,
@@ -150,7 +149,7 @@ function We({ positions: e = Be }) {
150
149
  }
151
150
  ),
152
151
  /* @__PURE__ */ r(
153
- P,
152
+ F,
154
153
  {
155
154
  "rotation-y": Math.PI / 2,
156
155
  position: [-5, -1, -1],
@@ -159,7 +158,7 @@ function We({ positions: e = Be }) {
159
158
  }
160
159
  ),
161
160
  /* @__PURE__ */ r(
162
- P,
161
+ F,
163
162
  {
164
163
  "rotation-y": -Math.PI / 2,
165
164
  position: [10, 1, 0],
@@ -168,7 +167,7 @@ function We({ positions: e = Be }) {
168
167
  }
169
168
  ),
170
169
  /* @__PURE__ */ r(
171
- P,
170
+ F,
172
171
  {
173
172
  form: "ring",
174
173
  color: "white",
@@ -180,59 +179,55 @@ function We({ positions: e = Be }) {
180
179
  )
181
180
  ] });
182
181
  }
183
- const oe = {
184
- attach: "material",
185
- color: "#009f4d",
186
- opacity: 0.2,
187
- depthTest: !1,
188
- depthWrite: !1,
189
- transparent: !0,
190
- polygonOffset: !0
191
- };
192
- function wt({
182
+ function gt({
193
183
  safetyZones: e,
194
184
  dhParameters: n,
195
185
  ...t
196
186
  }) {
197
- const l = A(
198
- () => Ge(n ?? []),
199
- [n]
200
- ), i = (c, o) => {
201
- var u, d;
202
- if (!((u = o == null ? void 0 : o.pose) != null && u.position) || !((d = o == null ? void 0 : o.pose) != null && d.orientation))
187
+ const a = {
188
+ attach: "material",
189
+ color: "#009f4d",
190
+ opacity: 0.2,
191
+ depthTest: !1,
192
+ depthWrite: !1,
193
+ transparent: !0,
194
+ polygonOffset: !0
195
+ }, i = Ge(n ?? []), p = (h, l) => {
196
+ var d, y;
197
+ if (!((d = l == null ? void 0 : l.pose) != null && d.position) || !((y = l == null ? void 0 : l.pose) != null && y.orientation))
203
198
  return null;
204
- const y = new b.Vector3(
205
- o.pose.position[0] / 1e3,
206
- o.pose.position[1] / 1e3,
207
- o.pose.position[2] / 1e3
208
- ), s = new b.Vector3(
209
- o.pose.orientation[0],
210
- o.pose.orientation[1],
211
- o.pose.orientation[2]
199
+ const s = new b.Vector3(
200
+ l.pose.position[0] / 1e3,
201
+ l.pose.position[1] / 1e3,
202
+ l.pose.position[2] / 1e3
203
+ ), m = new b.Vector3(
204
+ l.pose.orientation[0],
205
+ l.pose.orientation[1],
206
+ l.pose.orientation[2]
212
207
  );
213
- let m;
214
- const a = o.shape.shape_type === "plane" ? { ...oe, side: b.DoubleSide } : { ...oe, side: b.FrontSide };
215
- switch (o.shape.shape_type) {
208
+ let o;
209
+ const c = l.shape.shape_type === "plane" ? { ...a, side: b.DoubleSide } : { ...a, side: b.FrontSide };
210
+ switch (l.shape.shape_type) {
216
211
  /**
217
212
  * Plane shape, uses DH parameters to calculate the size of the plane (reach distance of a robot)
218
213
  */
219
214
  case "plane":
220
- m = /* @__PURE__ */ r("planeGeometry", { args: [l, l] });
215
+ o = /* @__PURE__ */ r("planeGeometry", { args: [i, i] });
221
216
  break;
222
217
  /**
223
218
  * Sphere shape
224
219
  */
225
220
  case "sphere": {
226
- const p = (o == null ? void 0 : o.shape).radius / 1e3;
227
- m = /* @__PURE__ */ r("sphereGeometry", { args: [p] });
221
+ const f = (l == null ? void 0 : l.shape).radius / 1e3;
222
+ o = /* @__PURE__ */ r("sphereGeometry", { args: [f] });
228
223
  break;
229
224
  }
230
225
  /**
231
226
  * Capsule shape
232
227
  */
233
228
  case "capsule": {
234
- const p = (o == null ? void 0 : o.shape).radius / 1e3, h = (o == null ? void 0 : o.shape).cylinder_height / 1e3;
235
- m = /* @__PURE__ */ r("capsuleGeometry", { args: [p, h] });
229
+ const f = (l == null ? void 0 : l.shape).radius / 1e3, w = (l == null ? void 0 : l.shape).cylinder_height / 1e3;
230
+ o = /* @__PURE__ */ r("capsuleGeometry", { args: [f, w] });
236
231
  break;
237
232
  }
238
233
  /**
@@ -240,21 +235,21 @@ function wt({
240
235
  * renderer to be able to visualize the convex hull.
241
236
  */
242
237
  case "convex_hull": {
243
- const p = (o == null ? void 0 : o.shape).vertices.map(
238
+ const f = (l == null ? void 0 : l.shape).vertices.map(
244
239
  (g) => new b.Vector3(g[0] / 1e3, g[1] / 1e3, g[2] / 1e3)
245
- ), h = Pe(p);
246
- if (h.isCoplanar && h.normal) {
247
- const x = new b.Vector3().addVectors(
248
- p[0],
249
- h.normal.multiplyScalar(1e-4)
240
+ ), w = Se(f);
241
+ if (w.isCoplanar && w.normal) {
242
+ const A = new b.Vector3().addVectors(
243
+ f[0],
244
+ w.normal.multiplyScalar(1e-4)
250
245
  );
251
- p.push(x);
246
+ f.push(A);
252
247
  }
253
248
  try {
254
- m = /* @__PURE__ */ r(
249
+ o = /* @__PURE__ */ r(
255
250
  "primitive",
256
251
  {
257
- object: new se(p),
252
+ object: new ie(f),
258
253
  attach: "geometry"
259
254
  }
260
255
  );
@@ -271,11 +266,11 @@ function wt({
271
266
  * Basically a rounded box with a rectangular cross-section.
272
267
  */
273
268
  case "rectangular_capsule": {
274
- const p = o.shape, h = p.radius / 1e3, g = p.sphere_center_distance_x / 1e3, x = p.sphere_center_distance_y / 1e3, I = h * 2;
275
- m = /* @__PURE__ */ r(
269
+ const f = l.shape, w = f.radius / 1e3, g = f.sphere_center_distance_x / 1e3, A = f.sphere_center_distance_y / 1e3, P = w * 2;
270
+ o = /* @__PURE__ */ r(
276
271
  "primitive",
277
272
  {
278
- object: new Le(g, x, I, 2, h),
273
+ object: new ke(g, A, P, 2, w),
279
274
  attach: "geometry"
280
275
  }
281
276
  );
@@ -284,39 +279,39 @@ function wt({
284
279
  default:
285
280
  console.warn(
286
281
  "Unsupported safety zone shape type:",
287
- o.shape.shape_type
288
- ), m = null;
282
+ l.shape.shape_type
283
+ ), o = null;
289
284
  }
290
- return /* @__PURE__ */ w(
285
+ return /* @__PURE__ */ x(
291
286
  "mesh",
292
287
  {
293
- renderOrder: c,
294
- position: y,
295
- quaternion: Ae(s),
288
+ renderOrder: h,
289
+ position: s,
290
+ quaternion: Ae(m),
296
291
  children: [
297
- m,
298
- /* @__PURE__ */ r("meshStandardMaterial", { ...a, polygonOffsetFactor: -c })
292
+ o,
293
+ /* @__PURE__ */ r("meshStandardMaterial", { ...c, polygonOffsetFactor: -h })
299
294
  ]
300
295
  },
301
- `safety-zone-${o.shape.shape_type}-${c}`
296
+ `safety-zone-${l.shape.shape_type}-${h}`
302
297
  );
303
- }, f = A(() => Object.values(e ?? {}).map(
304
- (c, o) => i(o, c)
305
- ), [e, l]);
306
- return /* @__PURE__ */ r("group", { ...t, children: f });
298
+ }, u = j(() => Object.values(e ?? {}).map(
299
+ (h, l) => p(l, h)
300
+ ), [e, i]);
301
+ return /* @__PURE__ */ r("group", { ...t, children: u });
307
302
  }
308
- function xt({
303
+ function bt({
309
304
  trajectory: e,
310
305
  ...n
311
306
  }) {
312
- const t = (e == null ? void 0 : e.map((l) => {
313
- if (l.position && l.position.length >= 3) {
314
- const [i, f, c] = l.position;
315
- if (Number.isFinite(i) && Number.isFinite(f) && Number.isFinite(c))
316
- return new b.Vector3(i / 1e3, c / 1e3, -f / 1e3);
307
+ const t = (e == null ? void 0 : e.map((a) => {
308
+ if (a.position && a.position.length >= 3) {
309
+ const [i, p, u] = a.position;
310
+ if (Number.isFinite(i) && Number.isFinite(p) && Number.isFinite(u))
311
+ return new b.Vector3(i / 1e3, u / 1e3, -p / 1e3);
317
312
  }
318
313
  return null;
319
- }).filter((l) => l !== null)) || [];
314
+ }).filter((a) => a !== null)) || [];
320
315
  return /* @__PURE__ */ r("group", { ...n, children: t.length > 0 && /* @__PURE__ */ r(
321
316
  $,
322
317
  {
@@ -333,178 +328,180 @@ async function J(e, n) {
333
328
  if (B.has(e))
334
329
  return B.get(e);
335
330
  const t = (async () => {
336
- var c;
337
- const l = n || "", i = new Ce({ instanceUrl: l }), f = i.api.motionGroupModels;
338
- (c = f.axios) != null && c.interceptors && f.axios.interceptors.request.use((o) => {
339
- var y;
340
- return (y = o.url) != null && y.includes("/glb") && (o.responseType = "blob"), o;
331
+ var u;
332
+ const a = n || "", i = new Ue({ instanceUrl: a }), p = i.api.motionGroupModels;
333
+ (u = p.axios) != null && u.interceptors && p.axios.interceptors.request.use((h) => {
334
+ var l;
335
+ return (l = h.url) != null && l.includes("/glb") && (h.responseType = "blob"), h;
341
336
  });
342
337
  try {
343
- const o = await i.api.motionGroupModels.getMotionGroupGlbModel(
338
+ const h = await i.api.motionGroupModels.getMotionGroupGlbModel(
344
339
  e
345
340
  );
346
- return URL.createObjectURL(o);
347
- } catch (o) {
348
- throw console.error("Failed to fetch model:", o), o;
341
+ return URL.createObjectURL(h);
342
+ } catch (h) {
343
+ throw console.error("Failed to fetch model:", h), h;
349
344
  }
350
345
  })();
351
346
  return B.set(e, t), t;
352
347
  }
353
- function de(e) {
348
+ function fe(e) {
354
349
  function n(t) {
355
- return t.children.length === 0 ? [t] : [t, ...t.children.flatMap((l) => n(l))];
350
+ return t.children.length === 0 ? [t] : [t, ...t.children.flatMap((a) => n(a))];
356
351
  }
357
- return n(e).filter((t) => me(t));
352
+ return n(e).filter((t) => he(t));
358
353
  }
359
- function he(e) {
354
+ function de(e) {
360
355
  return e.name.endsWith("_FLG");
361
356
  }
362
- function me(e) {
357
+ function he(e) {
363
358
  return /_J[0-9]+$/.test(e.name);
364
359
  }
365
- function $e(e, n) {
360
+ function Be(e, n) {
366
361
  let t;
367
- function l(i) {
368
- if (he(i)) {
362
+ function a(i) {
363
+ if (de(i)) {
369
364
  if (t)
370
365
  throw Error(
371
366
  `Found multiple flange groups in robot model ${n}; first ${t.name} then ${i.name}. Only one _FLG group is allowed.`
372
367
  );
373
368
  t = i;
374
369
  }
375
- me(i), i.children.map(l);
370
+ he(i), i.children.map(a);
376
371
  }
377
- if (l(e.scene), !t)
372
+ if (a(e.scene), !t)
378
373
  throw Error(
379
374
  `No flange group found in robot model ${n}. Flange must be identified with a name ending in _FLG.`
380
375
  );
381
376
  return { gltf: e };
382
377
  }
383
- function ye({
378
+ function me({
384
379
  rapidlyChangingMotionState: e,
385
380
  dhParameters: n,
386
381
  onRotationChanged: t,
387
- children: l
382
+ children: a
388
383
  }) {
389
- const i = M([]), f = M(null), { invalidate: c } = le(), o = M(e);
390
- o.current = e, T(() => {
391
- const a = e.joint_position.filter(
392
- (u) => u !== void 0
384
+ const i = M([]), p = M([]), u = M(null), { invalidate: h } = ae();
385
+ T(() => {
386
+ const o = e.joint_position.filter(
387
+ (c) => c !== void 0
393
388
  );
394
- return f.current = new ue(a, {
389
+ return u.current = new ce(o, {
395
390
  tension: 120,
396
391
  // Controls spring stiffness - higher values create faster, more responsive motion
397
392
  friction: 20,
398
393
  // Controls damping - higher values reduce oscillation and create smoother settling
399
394
  threshold: 1e-3
400
395
  }), () => {
401
- var u;
402
- (u = f.current) == null || u.destroy();
396
+ var c;
397
+ (c = u.current) == null || c.destroy();
403
398
  };
404
- }, []), ce((a, u) => {
405
- if (f.current) {
406
- const d = f.current.update(u);
407
- s(), d || c();
399
+ }, []), le((o, c) => {
400
+ if (u.current) {
401
+ const d = u.current.update(c);
402
+ s(), d || h();
408
403
  }
409
404
  });
410
- function y(a) {
411
- a && (i.current = de(a), s(), c());
405
+ function l(o) {
406
+ o && (p.current = fe(o), s(), h());
412
407
  }
413
408
  function s() {
414
- var u;
415
- const a = ((u = f.current) == null ? void 0 : u.getCurrentValues()) || [];
409
+ var c;
410
+ const o = ((c = u.current) == null ? void 0 : c.getCurrentValues()) || [];
416
411
  if (t)
417
- t(i.current, a);
412
+ t(p.current, o);
418
413
  else
419
- for (const [d, p] of i.current.entries()) {
420
- const h = n[d], g = h.theta || 0, x = h.reverse_rotation_direction ? -1 : 1;
421
- p.rotation.y = x * (a[d] || 0) + g;
414
+ for (const [d, y] of p.current.entries()) {
415
+ const f = n[d], w = f.theta || 0, g = f.reverse_rotation_direction ? -1 : 1;
416
+ y.rotation.y = g * (o[d] || 0) + w;
422
417
  }
423
418
  }
424
- function m(a) {
425
- var d;
426
- const u = a.joint_position.filter(
427
- (p) => p !== void 0
419
+ const m = L(() => {
420
+ const o = e.joint_position.filter(
421
+ (c) => c !== void 0
428
422
  );
429
- (d = f.current) == null || d.setTarget(u), c();
430
- }
431
- return fe(() => {
432
- m(o.current);
433
- }), T(() => {
434
- m(e);
435
- }, [e]), /* @__PURE__ */ r("group", { ref: y, children: l });
423
+ requestAnimationFrame(() => {
424
+ var c;
425
+ i.current = o, (c = u.current) == null || c.setTarget(o);
426
+ });
427
+ }, [e]);
428
+ return T(() => {
429
+ m();
430
+ }, [e, m]), ue(() => {
431
+ m();
432
+ }), /* @__PURE__ */ r("group", { ref: l, children: a });
436
433
  }
437
- const Ne = "line", He = "mesh";
438
- function Ye({
434
+ const We = "line", $e = "mesh";
435
+ function Ne({
439
436
  rapidlyChangingMotionState: e,
440
437
  dhParameters: n,
441
438
  ...t
442
439
  }) {
443
- const l = new R(), i = M([]), f = M([]);
444
- Se.useEffect(() => {
445
- i.current = new Array(n.length).fill(null), f.current = new Array(n.length).fill(null);
440
+ const a = new R(), i = M([]), p = M([]);
441
+ Le.useEffect(() => {
442
+ i.current = new Array(n.length).fill(null), p.current = new Array(n.length).fill(null);
446
443
  }, [n.length]);
447
- function c(s, m) {
448
- const a = new L(), u = new W(), d = new L();
449
- l.decompose(a, u, d);
450
- const p = a.clone(), h = new R().makeRotationY(
444
+ function u(s, m) {
445
+ const o = new G(), c = new W(), d = new G();
446
+ a.decompose(o, c, d);
447
+ const y = o.clone(), f = new R().makeRotationY(
451
448
  s.theta + m * (s.reverse_rotation_direction ? -1 : 1)
452
449
  ).multiply(new R().makeTranslation(0, s.d / 1e3, 0)).multiply(new R().makeTranslation(s.a / 1e3, 0, 0)).multiply(new R().makeRotationX(s.alpha));
453
- return l.multiply(h), l.decompose(a, u, d), { a: p, b: a };
450
+ return a.multiply(f), a.decompose(o, c, d), { a: y, b: o };
454
451
  }
455
- function o(s, m, a, u) {
452
+ function h(s, m, o, c) {
456
453
  if (!n)
457
454
  return;
458
455
  const d = n[s];
459
456
  if (!d)
460
457
  return;
461
- const { a: p, b: h } = c(d, u);
462
- m.geometry.setPositions([p.toArray(), h.toArray()].flat()), a.position.set(h.x, h.y, h.z);
458
+ const { a: y, b: f } = u(d, c);
459
+ m.geometry.setPositions([y.toArray(), f.toArray()].flat()), o.position.set(f.x, f.y, f.z);
463
460
  }
464
- function y(s, m) {
465
- l.identity();
466
- for (let a = 0; a < Math.min(s.length, m.length); a++) {
467
- const u = i.current[a], d = f.current[a];
468
- u && d && o(a, u, d, m[a]);
461
+ function l(s, m) {
462
+ a.identity();
463
+ for (let o = 0; o < Math.min(s.length, m.length); o++) {
464
+ const c = i.current[o], d = p.current[o];
465
+ c && d && h(o, c, d, m[o]);
469
466
  }
470
467
  }
471
468
  return /* @__PURE__ */ r(
472
- ye,
469
+ me,
473
470
  {
474
471
  rapidlyChangingMotionState: e,
475
472
  dhParameters: n,
476
- onRotationChanged: y,
477
- children: /* @__PURE__ */ w("group", { ...t, name: "Scene", children: [
478
- /* @__PURE__ */ w("mesh", { children: [
473
+ onRotationChanged: l,
474
+ children: /* @__PURE__ */ x("group", { ...t, name: "Scene", children: [
475
+ /* @__PURE__ */ x("mesh", { children: [
479
476
  /* @__PURE__ */ r("sphereGeometry", { args: [0.01, 32, 32] }),
480
477
  /* @__PURE__ */ r("meshStandardMaterial", { color: "black", depthTest: !0 })
481
478
  ] }),
482
479
  n == null ? void 0 : n.map((s, m) => {
483
- const { a, b: u } = c(
480
+ const { a: o, b: c } = u(
484
481
  s,
485
482
  e.joint_position[m] ?? 0
486
483
  ), d = `dhrobot_J0${m}`;
487
- return /* @__PURE__ */ w("group", { name: d, children: [
484
+ return /* @__PURE__ */ x("group", { name: d, children: [
488
485
  /* @__PURE__ */ r(
489
486
  $,
490
487
  {
491
- ref: (p) => {
492
- i.current[m] = p;
488
+ ref: (y) => {
489
+ i.current[m] = y;
493
490
  },
494
- name: Ne,
495
- points: [a, u],
491
+ name: We,
492
+ points: [o, c],
496
493
  color: "white",
497
494
  lineWidth: 5
498
495
  }
499
496
  ),
500
- /* @__PURE__ */ w(
497
+ /* @__PURE__ */ x(
501
498
  "mesh",
502
499
  {
503
- ref: (p) => {
504
- f.current[m] = p;
500
+ ref: (y) => {
501
+ p.current[m] = y;
505
502
  },
506
- name: He,
507
- position: u,
503
+ name: $e,
504
+ position: c,
508
505
  children: [
509
506
  /* @__PURE__ */ r("sphereGeometry", { args: [0.01, 32, 32] }),
510
507
  /* @__PURE__ */ r("meshStandardMaterial", { color: "black", depthTest: !0 })
@@ -518,32 +515,32 @@ function Ye({
518
515
  }
519
516
  );
520
517
  }
521
- const qe = console.warn;
522
- function ge() {
518
+ const He = console.warn;
519
+ function ye() {
523
520
  return T(() => {
524
521
  console.warn = (e) => {
525
- e !== "Cannot call the manual advancement of rafz whilst frameLoop is not set as demand" && qe(e);
522
+ e !== "Cannot call the manual advancement of rafz whilst frameLoop is not set as demand" && He(e);
526
523
  };
527
524
  }, []), null;
528
525
  }
529
- function Xe(e) {
526
+ function qe(e) {
530
527
  return e.type === "Mesh";
531
528
  }
532
- function Ke({
529
+ function Ye({
533
530
  url: e,
534
531
  flangeRef: n,
535
532
  postModelRender: t,
536
- ...l
533
+ ...a
537
534
  }) {
538
- const i = Fe(e), c = $e(i, "robot.glb").gltf, o = G(
535
+ const i = Pe(e), u = Be(i, "robot.glb").gltf, h = L(
539
536
  (s) => {
540
537
  s && t && t();
541
538
  },
542
539
  [t]
543
540
  );
544
- function y(s) {
541
+ function l(s) {
545
542
  try {
546
- return Xe(s) ? s.geometry ? /* @__PURE__ */ r(
543
+ return qe(s) ? s.geometry ? /* @__PURE__ */ r(
547
544
  "mesh",
548
545
  {
549
546
  name: s.name,
@@ -567,8 +564,8 @@ function Ke({
567
564
  name: s.name,
568
565
  position: s.position,
569
566
  rotation: s.rotation,
570
- ref: he(s) ? n : void 0,
571
- children: s.children.map(y)
567
+ ref: de(s) ? n : void 0,
568
+ children: s.children.map(l)
572
569
  },
573
570
  s.uuid
574
571
  );
@@ -576,50 +573,51 @@ function Ke({
576
573
  return console.warn("Error rendering node", s.name, m), null;
577
574
  }
578
575
  }
579
- return /* @__PURE__ */ r("group", { ...l, dispose: null, ref: o, children: y(c.scene) });
576
+ return /* @__PURE__ */ r("group", { ...a, dispose: null, ref: h, children: l(u.scene) });
580
577
  }
581
- function be({
578
+ function ge({
582
579
  modelURL: e,
583
580
  flangeRef: n,
584
581
  postModelRender: t,
585
- ...l
582
+ ...a
586
583
  }) {
587
- const [i, f] = S(null);
584
+ const [i, p] = S(null);
588
585
  return T(() => {
589
- let c = !1;
590
- return (async () => {
586
+ (async () => {
591
587
  try {
592
- const y = typeof e == "string" ? e : await e;
593
- c || f((s) => s === y ? s : y);
594
- } catch (y) {
595
- console.error("Failed to resolve model URL:", y);
588
+ if (typeof e == "string")
589
+ p(e);
590
+ else {
591
+ const h = await e;
592
+ p(h);
593
+ }
594
+ } catch (h) {
595
+ console.error("Failed to resolve model URL:", h);
596
596
  }
597
- })(), () => {
598
- c = !0;
599
- };
597
+ })();
600
598
  }, [e]), i ? /* @__PURE__ */ r(
601
- Ke,
599
+ Ye,
602
600
  {
603
601
  url: i,
604
602
  flangeRef: n,
605
603
  postModelRender: t,
606
- ...l
604
+ ...a
607
605
  }
608
606
  ) : null;
609
607
  }
610
- const we = (e, n) => {
608
+ const be = (e, n) => {
611
609
  e.userData.isGhost || (e.traverse((t) => {
612
610
  if (t instanceof b.Mesh) {
613
611
  t.material instanceof b.Material && (t.material.colorWrite = !1);
614
- const l = t.clone(), i = t.clone();
615
- l.material = new b.MeshStandardMaterial({
612
+ const a = t.clone(), i = t.clone();
613
+ a.material = new b.MeshStandardMaterial({
616
614
  depthTest: !0,
617
615
  depthWrite: !0,
618
616
  colorWrite: !1,
619
617
  polygonOffset: !0,
620
618
  polygonOffsetFactor: -1,
621
619
  side: b.DoubleSide
622
- }), l.userData.isGhost = !0, i.material = new b.MeshStandardMaterial({
620
+ }), a.userData.isGhost = !0, i.material = new b.MeshStandardMaterial({
623
621
  color: n,
624
622
  opacity: 0.3,
625
623
  depthTest: !0,
@@ -628,169 +626,169 @@ const we = (e, n) => {
628
626
  polygonOffset: !0,
629
627
  polygonOffsetFactor: -2,
630
628
  side: b.DoubleSide
631
- }), i.userData.isGhost = !0, t.parent && (t.parent.add(l), t.parent.add(i));
629
+ }), i.userData.isGhost = !0, t.parent && (t.parent.add(a), t.parent.add(i));
632
630
  }
633
631
  }), e.userData.isGhost = !0);
634
- }, xe = (e) => {
632
+ }, we = (e) => {
635
633
  if (!e.userData.isGhost) return;
636
634
  const n = [];
637
635
  e.traverse((t) => {
638
- var l;
639
- t instanceof b.Mesh && ((l = t.userData) != null && l.isGhost ? n.push(t) : t.material instanceof b.Material && (t.material.colorWrite = !0));
636
+ var a;
637
+ t instanceof b.Mesh && ((a = t.userData) != null && a.isGhost ? n.push(t) : t.material instanceof b.Material && (t.material.colorWrite = !0));
640
638
  }), n.forEach((t) => {
641
639
  t.parent && t.parent.remove(t);
642
640
  }), e.userData.isGhost = !1;
643
- }, Re = j(
641
+ }, xe = E(
644
642
  ({
645
643
  rapidlyChangingMotionState: e,
646
644
  modelFromController: n,
647
645
  dhParameters: t,
648
- getModel: l = J,
646
+ getModel: a = J,
649
647
  flangeRef: i,
650
- postModelRender: f,
651
- transparentColor: c,
652
- instanceUrl: o,
653
- ...y
648
+ postModelRender: p,
649
+ transparentColor: u,
650
+ instanceUrl: h,
651
+ ...l
654
652
  }) => {
655
- const [s, m] = S(null), a = G((p) => {
656
- m(p);
653
+ const [s, m] = S(null), o = L((d) => {
654
+ m(d);
657
655
  }, []);
658
656
  T(() => {
659
- s && (c ? we(s, c) : xe(s));
660
- }, [s, c]);
661
- const u = A(() => {
662
- const p = l(n, o);
663
- if (!p) {
664
- const h = new Blob([], { type: "model/gltf-binary" }), g = new File(
665
- [h],
666
- `${n}.glb`,
667
- { type: "model/gltf-binary" }
668
- );
669
- return Promise.resolve(URL.createObjectURL(g));
670
- }
671
- return p;
672
- }, [n, o, l]), d = /* @__PURE__ */ r(
673
- Ye,
657
+ s && (u ? be(s, u) : we(s));
658
+ }, [s, u]);
659
+ const c = /* @__PURE__ */ r(
660
+ Ne,
674
661
  {
675
662
  rapidlyChangingMotionState: e,
676
663
  dhParameters: t,
677
- ...y
664
+ ...l
678
665
  }
679
666
  );
680
- return /* @__PURE__ */ w(
667
+ return /* @__PURE__ */ x(
681
668
  pe,
682
669
  {
683
- fallback: d,
684
- onError: (p) => {
685
- console.warn(p);
670
+ fallback: c,
671
+ onError: (d) => {
672
+ console.warn(d);
686
673
  },
687
674
  children: [
688
- /* @__PURE__ */ r(ae, { fallback: d, children: /* @__PURE__ */ r("group", { ref: a, children: /* @__PURE__ */ r(
689
- ye,
675
+ /* @__PURE__ */ r(se, { fallback: c, children: /* @__PURE__ */ r("group", { ref: o, children: /* @__PURE__ */ r(
676
+ me,
690
677
  {
691
678
  rapidlyChangingMotionState: e,
692
679
  dhParameters: t,
693
680
  children: /* @__PURE__ */ r(
694
- be,
681
+ ge,
695
682
  {
696
- modelURL: u,
697
- postModelRender: f,
683
+ modelURL: (() => {
684
+ const d = a(n, h);
685
+ if (!d) {
686
+ const y = new Blob([], { type: "model/gltf-binary" }), f = new File(
687
+ [y],
688
+ `${n}.glb`,
689
+ { type: "model/gltf-binary" }
690
+ );
691
+ return Promise.resolve(URL.createObjectURL(f));
692
+ }
693
+ return d;
694
+ })(),
695
+ postModelRender: p,
698
696
  flangeRef: i,
699
- ...y
697
+ ...l
700
698
  }
701
699
  )
702
700
  }
703
701
  ) }) }),
704
- /* @__PURE__ */ r(ge, {})
702
+ /* @__PURE__ */ r(ye, {})
705
703
  ]
706
704
  }
707
705
  );
708
706
  }
709
707
  );
710
- function Ze({
708
+ function Xe({
711
709
  connectedMotionGroup: e,
712
710
  getModel: n = J,
713
711
  flangeRef: t,
714
- transparentColor: l,
712
+ transparentColor: a,
715
713
  postModelRender: i,
716
- ...f
714
+ ...p
717
715
  }) {
718
716
  return e.dhParameters ? /* @__PURE__ */ r(
719
- Re,
717
+ xe,
720
718
  {
721
719
  rapidlyChangingMotionState: e.rapidlyChangingMotionState,
722
720
  modelFromController: e.modelFromController || "",
723
721
  dhParameters: e.dhParameters,
724
722
  getModel: n,
725
723
  flangeRef: t,
726
- transparentColor: l,
724
+ transparentColor: a,
727
725
  postModelRender: i,
728
- ...f
726
+ ...p
729
727
  }
730
728
  ) : null;
731
729
  }
732
- const Rt = j(
733
- Ve(
730
+ const wt = E(
731
+ Oe(
734
732
  ({
735
733
  robotName: e,
736
734
  programState: n,
737
735
  safetyState: t,
738
- operationMode: l,
736
+ operationMode: a,
739
737
  driveToHomeEnabled: i = !1,
740
- onDriveToHomePress: f,
741
- onDriveToHomeRelease: c,
742
- connectedMotionGroup: o,
743
- robotComponent: y = Ze,
738
+ onDriveToHomePress: p,
739
+ onDriveToHomeRelease: u,
740
+ connectedMotionGroup: h,
741
+ robotComponent: l = Xe,
744
742
  customContentComponent: s,
745
743
  className: m
746
744
  }) => {
747
- var Y;
748
- const a = De(), { t: u } = Ue(), [d, p] = S(!1), h = M(null), g = M(null), [x, I] = S(!1), [F, Te] = S({ width: 400, height: 600 }), [ze, ke] = S(0);
745
+ var q;
746
+ const o = Ie(), { t: c } = Ve(), [d, y] = S(!1), f = M(null), w = M(null), [g, A] = S(!1), [P, _e] = S({ width: 400, height: 600 }), [Ze, Te] = S(0);
749
747
  T(() => {
750
- const U = () => {
751
- if (g.current) {
752
- const { offsetWidth: X, offsetHeight: K } = g.current;
753
- I(X > K), Te({ width: X, height: K });
748
+ const V = () => {
749
+ if (w.current) {
750
+ const { offsetWidth: X, offsetHeight: K } = w.current;
751
+ A(X > K), _e({ width: X, height: K });
754
752
  }
755
753
  };
756
- U();
757
- const q = new ResizeObserver(U);
758
- return g.current && q.observe(g.current), () => {
759
- q.disconnect();
754
+ V();
755
+ const Y = new ResizeObserver(V);
756
+ return w.current && Y.observe(w.current), () => {
757
+ Y.disconnect();
760
758
  };
761
759
  }, []);
762
- const N = G(() => {
763
- ke((U) => U + 1);
764
- }, []), D = G(() => {
765
- !i || !f || (p(!0), f());
766
- }, [i, f]), O = G(() => {
767
- !i || !c || (p(!1), c());
768
- }, [i, c]), H = G(() => {
769
- d && c && (p(!1), c());
770
- }, [d, c]), k = x ? F.width < 350 : F.height < 200, V = x ? F.height < 310 : F.height < 450;
760
+ const N = L(() => {
761
+ Te((V) => V + 1);
762
+ }, []), I = L(() => {
763
+ !i || !p || (y(!0), p());
764
+ }, [i, p]), D = L(() => {
765
+ !i || !u || (y(!1), u());
766
+ }, [i, u]), H = L(() => {
767
+ d && u && (y(!1), u());
768
+ }, [d, u]), k = g ? P.width < 350 : P.height < 200, O = g ? P.height < 310 : P.height < 450;
771
769
  return /* @__PURE__ */ r(
772
- Oe,
770
+ De,
773
771
  {
774
- ref: g,
772
+ ref: w,
775
773
  className: m,
776
774
  sx: {
777
775
  width: "100%",
778
776
  height: "100%",
779
777
  display: "flex",
780
- flexDirection: x ? "row" : "column",
778
+ flexDirection: g ? "row" : "column",
781
779
  position: "relative",
782
780
  overflow: "hidden",
783
781
  minWidth: { xs: 180, sm: 220, md: 250 },
784
- minHeight: x ? { xs: 200, sm: 240, md: 260 } : { xs: 150, sm: 180, md: 220 },
782
+ minHeight: g ? { xs: 200, sm: 240, md: 260 } : { xs: 150, sm: 180, md: 220 },
785
783
  // Allow progressive hiding in portrait mode
786
- border: `1px solid ${a.palette.divider}`,
784
+ border: `1px solid ${o.palette.divider}`,
787
785
  borderRadius: "18px",
788
786
  boxShadow: "none",
789
- backgroundColor: ((Y = a.palette.backgroundPaperElevation) == null ? void 0 : Y[8]) || "#2A2A3F",
787
+ backgroundColor: ((q = o.palette.backgroundPaperElevation) == null ? void 0 : q[8]) || "#2A2A3F",
790
788
  backgroundImage: "none"
791
789
  // Override any gradient from elevation
792
790
  },
793
- children: x ? /* @__PURE__ */ w(E, { children: [
791
+ children: g ? /* @__PURE__ */ x(C, { children: [
794
792
  /* @__PURE__ */ r(
795
793
  v,
796
794
  {
@@ -807,7 +805,7 @@ const Rt = j(
807
805
  // Prevent content from affecting container size
808
806
  display: k ? "none" : "block"
809
807
  },
810
- children: !k && /* @__PURE__ */ w(
808
+ children: !k && /* @__PURE__ */ x(
811
809
  te,
812
810
  {
813
811
  orthographic: !0,
@@ -818,7 +816,7 @@ const Rt = j(
818
816
  shadows: !0,
819
817
  frameloop: "demand",
820
818
  style: {
821
- borderRadius: a.shape.borderRadius,
819
+ borderRadius: o.shape.borderRadius,
822
820
  width: "100%",
823
821
  height: "100%",
824
822
  background: "transparent",
@@ -831,9 +829,9 @@ const Rt = j(
831
829
  children: [
832
830
  /* @__PURE__ */ r(ne, {}),
833
831
  /* @__PURE__ */ r(Z, { fit: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ r(
834
- y,
832
+ l,
835
833
  {
836
- connectedMotionGroup: o,
834
+ connectedMotionGroup: h,
837
835
  postModelRender: N
838
836
  }
839
837
  ) })
@@ -842,7 +840,7 @@ const Rt = j(
842
840
  )
843
841
  }
844
842
  ),
845
- /* @__PURE__ */ w(
843
+ /* @__PURE__ */ x(
846
844
  v,
847
845
  {
848
846
  sx: {
@@ -853,7 +851,7 @@ const Rt = j(
853
851
  width: k ? "100%" : "50%"
854
852
  },
855
853
  children: [
856
- /* @__PURE__ */ w(
854
+ /* @__PURE__ */ x(
857
855
  v,
858
856
  {
859
857
  sx: {
@@ -868,13 +866,13 @@ const Rt = j(
868
866
  {
869
867
  programState: n,
870
868
  safetyState: t,
871
- operationMode: l
869
+ operationMode: a
872
870
  }
873
871
  )
874
872
  ]
875
873
  }
876
874
  ),
877
- /* @__PURE__ */ w(
875
+ /* @__PURE__ */ x(
878
876
  v,
879
877
  {
880
878
  sx: {
@@ -886,7 +884,7 @@ const Rt = j(
886
884
  justifyContent: "space-between"
887
885
  },
888
886
  children: [
889
- !V && s && /* @__PURE__ */ w(v, { children: [
887
+ !O && s && /* @__PURE__ */ x(v, { children: [
890
888
  /* @__PURE__ */ r(s, {}),
891
889
  /* @__PURE__ */ r(
892
890
  z,
@@ -894,7 +892,7 @@ const Rt = j(
894
892
  sx: {
895
893
  mt: 1,
896
894
  mb: 0,
897
- borderColor: a.palette.divider,
895
+ borderColor: o.palette.divider,
898
896
  opacity: 0.5
899
897
  }
900
898
  }
@@ -904,7 +902,7 @@ const Rt = j(
904
902
  v,
905
903
  {
906
904
  sx: {
907
- mt: !V && s ? "auto" : 0
905
+ mt: !O && s ? "auto" : 0
908
906
  },
909
907
  children: /* @__PURE__ */ r(
910
908
  v,
@@ -918,22 +916,22 @@ const Rt = j(
918
916
  children: /* @__PURE__ */ r(
919
917
  Q,
920
918
  {
921
- ref: h,
919
+ ref: f,
922
920
  variant: "contained",
923
921
  color: "secondary",
924
922
  size: "small",
925
923
  disabled: !i,
926
- onMouseDown: D,
927
- onMouseUp: O,
924
+ onMouseDown: I,
925
+ onMouseUp: D,
928
926
  onMouseLeave: H,
929
- onTouchStart: D,
930
- onTouchEnd: O,
927
+ onTouchStart: I,
928
+ onTouchEnd: D,
931
929
  sx: {
932
930
  textTransform: "none",
933
931
  px: 1.5,
934
932
  py: 0.5
935
933
  },
936
- children: u("RobotCard.DriveToHome.bt")
934
+ children: c("RobotCard.DriveToHome.bt")
937
935
  }
938
936
  )
939
937
  }
@@ -946,7 +944,7 @@ const Rt = j(
946
944
  ]
947
945
  }
948
946
  )
949
- ] }) : /* @__PURE__ */ r(E, { children: /* @__PURE__ */ w(
947
+ ] }) : /* @__PURE__ */ r(C, { children: /* @__PURE__ */ x(
950
948
  v,
951
949
  {
952
950
  sx: {
@@ -956,14 +954,14 @@ const Rt = j(
956
954
  flexDirection: "column"
957
955
  },
958
956
  children: [
959
- /* @__PURE__ */ w(v, { children: [
957
+ /* @__PURE__ */ x(v, { children: [
960
958
  /* @__PURE__ */ r(ee, { variant: "h6", component: "h2", sx: { mb: 1 }, children: e }),
961
959
  /* @__PURE__ */ r(
962
960
  re,
963
961
  {
964
962
  programState: n,
965
963
  safetyState: t,
966
- operationMode: l
964
+ operationMode: a
967
965
  }
968
966
  )
969
967
  ] }),
@@ -979,7 +977,7 @@ const Rt = j(
979
977
  overflow: "hidden",
980
978
  display: k ? "none" : "block"
981
979
  },
982
- children: !k && /* @__PURE__ */ w(
980
+ children: !k && /* @__PURE__ */ x(
983
981
  te,
984
982
  {
985
983
  orthographic: !0,
@@ -990,7 +988,7 @@ const Rt = j(
990
988
  shadows: !0,
991
989
  frameloop: "demand",
992
990
  style: {
993
- borderRadius: a.shape.borderRadius,
991
+ borderRadius: o.shape.borderRadius,
994
992
  width: "100%",
995
993
  height: "100%",
996
994
  background: "transparent",
@@ -1001,9 +999,9 @@ const Rt = j(
1001
999
  children: [
1002
1000
  /* @__PURE__ */ r(ne, {}),
1003
1001
  /* @__PURE__ */ r(Z, { fit: !0, clip: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ r(
1004
- y,
1002
+ l,
1005
1003
  {
1006
- connectedMotionGroup: o,
1004
+ connectedMotionGroup: h,
1007
1005
  postModelRender: N
1008
1006
  }
1009
1007
  ) })
@@ -1012,8 +1010,8 @@ const Rt = j(
1012
1010
  )
1013
1011
  }
1014
1012
  ),
1015
- /* @__PURE__ */ w(v, { children: [
1016
- !V && s && /* @__PURE__ */ w(E, { children: [
1013
+ /* @__PURE__ */ x(v, { children: [
1014
+ !O && s && /* @__PURE__ */ x(C, { children: [
1017
1015
  /* @__PURE__ */ r(s, {}),
1018
1016
  /* @__PURE__ */ r(
1019
1017
  z,
@@ -1021,7 +1019,7 @@ const Rt = j(
1021
1019
  sx: {
1022
1020
  mt: 1,
1023
1021
  mb: 0,
1024
- borderColor: a.palette.divider,
1022
+ borderColor: o.palette.divider,
1025
1023
  opacity: 0.5
1026
1024
  }
1027
1025
  }
@@ -1033,28 +1031,28 @@ const Rt = j(
1033
1031
  sx: {
1034
1032
  display: "flex",
1035
1033
  justifyContent: "flex-start",
1036
- mt: !V && s ? { xs: 1, sm: 2, md: 5 } : { xs: 0.5, sm: 1, md: 2 },
1034
+ mt: !O && s ? { xs: 1, sm: 2, md: 5 } : { xs: 0.5, sm: 1, md: 2 },
1037
1035
  mb: { xs: 0.5, sm: 0.75, md: 1 }
1038
1036
  },
1039
1037
  children: /* @__PURE__ */ r(
1040
1038
  Q,
1041
1039
  {
1042
- ref: h,
1040
+ ref: f,
1043
1041
  variant: "contained",
1044
1042
  color: "secondary",
1045
1043
  size: "small",
1046
1044
  disabled: !i,
1047
- onMouseDown: D,
1048
- onMouseUp: O,
1045
+ onMouseDown: I,
1046
+ onMouseUp: D,
1049
1047
  onMouseLeave: H,
1050
- onTouchStart: D,
1051
- onTouchEnd: O,
1048
+ onTouchStart: I,
1049
+ onTouchEnd: D,
1052
1050
  sx: {
1053
1051
  textTransform: "none",
1054
1052
  px: 1.5,
1055
1053
  py: 0.5
1056
1054
  },
1057
- children: u("RobotCard.DriveToHome.bt")
1055
+ children: c("RobotCard.DriveToHome.bt")
1058
1056
  }
1059
1057
  )
1060
1058
  }
@@ -1067,138 +1065,138 @@ const Rt = j(
1067
1065
  );
1068
1066
  }
1069
1067
  )
1070
- ), vt = Array(6).fill(2 * Math.PI);
1071
- function ve({
1068
+ ), xt = Array(6).fill(2 * Math.PI);
1069
+ function Re({
1072
1070
  rapidlyChangingMotionState: e,
1073
1071
  dhParameters: n,
1074
1072
  onTranslationChanged: t,
1075
- children: l
1073
+ children: a
1076
1074
  }) {
1077
- const i = M([]), f = M([]), c = M(null), { invalidate: o } = le();
1075
+ const i = M([]), p = M([]), u = M(null), { invalidate: h } = ae();
1078
1076
  T(() => {
1079
- const a = e.joint_position.filter(
1080
- (u) => u !== void 0
1077
+ const o = e.joint_position.filter(
1078
+ (c) => c !== void 0
1081
1079
  );
1082
- return c.current = new ue(a, {
1080
+ return u.current = new ce(o, {
1083
1081
  tension: 120,
1084
1082
  // Controls spring stiffness - higher values create faster, more responsive motion
1085
1083
  friction: 20,
1086
1084
  // Controls damping - higher values reduce oscillation and create smoother settling
1087
1085
  threshold: 1e-3
1088
1086
  }), () => {
1089
- var u;
1090
- (u = c.current) == null || u.destroy();
1087
+ var c;
1088
+ (c = u.current) == null || c.destroy();
1091
1089
  };
1092
- }, []), ce((a, u) => {
1093
- if (c.current) {
1094
- const d = c.current.update(u);
1095
- s(), d || o();
1090
+ }, []), le((o, c) => {
1091
+ if (u.current) {
1092
+ const d = u.current.update(c);
1093
+ s(), d || h();
1096
1094
  }
1097
1095
  });
1098
- function y(a) {
1099
- a && (f.current = de(a), s(), o());
1096
+ function l(o) {
1097
+ o && (p.current = fe(o), s(), h());
1100
1098
  }
1101
1099
  function s() {
1102
- var u;
1103
- const a = ((u = c.current) == null ? void 0 : u.getCurrentValues()) || [];
1100
+ var c;
1101
+ const o = ((c = u.current) == null ? void 0 : c.getCurrentValues()) || [];
1104
1102
  if (t)
1105
- t(f.current, a);
1103
+ t(p.current, o);
1106
1104
  else
1107
- for (const [d, p] of f.current.entries()) {
1108
- const g = n[d].reverse_rotation_direction ? -1 : 1;
1109
- p.position.y = g * (a[d] || 0) / 1e3;
1105
+ for (const [d, y] of p.current.entries()) {
1106
+ const w = n[d].reverse_rotation_direction ? -1 : 1;
1107
+ y.position.y = w * (o[d] || 0) / 1e3;
1110
1108
  }
1111
1109
  }
1112
- const m = G(() => {
1113
- const a = e.joint_position.filter(
1114
- (u) => u !== void 0
1110
+ const m = L(() => {
1111
+ const o = e.joint_position.filter(
1112
+ (c) => c !== void 0
1115
1113
  );
1116
1114
  requestAnimationFrame(() => {
1117
- var u;
1118
- i.current = a, (u = c.current) == null || u.setTarget(a);
1115
+ var c;
1116
+ i.current = o, (c = u.current) == null || c.setTarget(o);
1119
1117
  });
1120
1118
  }, [e]);
1121
1119
  return T(() => {
1122
1120
  m();
1123
- }, [e, m]), fe(() => {
1121
+ }, [e, m]), ue(() => {
1124
1122
  m();
1125
- }), /* @__PURE__ */ r("group", { ref: y, children: l });
1123
+ }), /* @__PURE__ */ r("group", { ref: l, children: a });
1126
1124
  }
1127
- function Me({
1125
+ function ve({
1128
1126
  rapidlyChangingMotionState: e,
1129
1127
  dhParameters: n,
1130
1128
  ...t
1131
1129
  }) {
1132
- const l = new R(), i = M(null), f = M(null);
1133
- function c(s) {
1130
+ const a = new R(), i = M(null), p = M(null);
1131
+ function u(s) {
1134
1132
  const m = new R();
1135
- for (let p = 0; p < n.length; p++) {
1136
- const h = n[p], g = s[p] ?? 0, x = new R().makeRotationY(h.theta).multiply(
1133
+ for (let y = 0; y < n.length; y++) {
1134
+ const f = n[y], w = s[y] ?? 0, g = new R().makeRotationY(f.theta).multiply(
1137
1135
  new R().makeTranslation(
1138
- h.a / 1e3,
1139
- (h.d + g * (h.reverse_rotation_direction ? -1 : 1)) / 1e3,
1136
+ f.a / 1e3,
1137
+ (f.d + w * (f.reverse_rotation_direction ? -1 : 1)) / 1e3,
1140
1138
  0
1141
1139
  )
1142
- ).multiply(new R().makeRotationX(h.alpha));
1143
- m.multiply(x);
1140
+ ).multiply(new R().makeRotationX(f.alpha));
1141
+ m.multiply(g);
1144
1142
  }
1145
- const a = new L(), u = new W(), d = new L();
1146
- return m.decompose(a, u, d), a;
1143
+ const o = new G(), c = new W(), d = new G();
1144
+ return m.decompose(o, c, d), o;
1147
1145
  }
1148
- const o = c(
1146
+ const h = u(
1149
1147
  e.joint_position
1150
1148
  );
1151
- function y(s, m) {
1152
- l.identity();
1153
- let a = new L();
1154
- for (let h = 0; h < n.length; h++) {
1155
- const g = m[h] ?? 0, x = n[h], I = new R().makeRotationY(x.theta).multiply(
1149
+ function l(s, m) {
1150
+ a.identity();
1151
+ let o = new G();
1152
+ for (let f = 0; f < n.length; f++) {
1153
+ const w = m[f] ?? 0, g = n[f], A = new R().makeRotationY(g.theta).multiply(
1156
1154
  new R().makeTranslation(
1157
- x.a / 1e3,
1158
- (x.d + g * (x.reverse_rotation_direction ? -1 : 1)) / 1e3,
1155
+ g.a / 1e3,
1156
+ (g.d + w * (g.reverse_rotation_direction ? -1 : 1)) / 1e3,
1159
1157
  0
1160
1158
  )
1161
- ).multiply(new R().makeRotationX(x.alpha));
1162
- l.multiply(I);
1159
+ ).multiply(new R().makeRotationX(g.alpha));
1160
+ a.multiply(A);
1163
1161
  }
1164
- const u = new L(), d = new W(), p = new L();
1165
- if (l.decompose(u, d, p), a = u, i.current && i.current.position.set(
1166
- a.x,
1167
- a.y,
1168
- a.z
1169
- ), f.current) {
1170
- const h = f.current.geometry;
1171
- h != null && h.setPositions && h.setPositions([
1162
+ const c = new G(), d = new W(), y = new G();
1163
+ if (a.decompose(c, d, y), o = c, i.current && i.current.position.set(
1164
+ o.x,
1165
+ o.y,
1166
+ o.z
1167
+ ), p.current) {
1168
+ const f = p.current.geometry;
1169
+ f != null && f.setPositions && f.setPositions([
1172
1170
  0,
1173
1171
  0,
1174
1172
  0,
1175
- a.x,
1176
- a.y,
1177
- a.z
1173
+ o.x,
1174
+ o.y,
1175
+ o.z
1178
1176
  ]);
1179
1177
  }
1180
1178
  }
1181
1179
  return /* @__PURE__ */ r(
1182
- ve,
1180
+ Re,
1183
1181
  {
1184
1182
  rapidlyChangingMotionState: e,
1185
1183
  dhParameters: n,
1186
- onTranslationChanged: y,
1187
- children: /* @__PURE__ */ w("group", { ...t, name: "Scene", children: [
1188
- /* @__PURE__ */ w("mesh", { name: "Base", position: [0, 0, 0], children: [
1184
+ onTranslationChanged: l,
1185
+ children: /* @__PURE__ */ x("group", { ...t, name: "Scene", children: [
1186
+ /* @__PURE__ */ x("mesh", { name: "Base", position: [0, 0, 0], children: [
1189
1187
  /* @__PURE__ */ r("sphereGeometry", { args: [0.02, 32, 32] }),
1190
1188
  /* @__PURE__ */ r("meshStandardMaterial", { color: "green", depthTest: !0 })
1191
1189
  ] }),
1192
1190
  /* @__PURE__ */ r(
1193
1191
  $,
1194
1192
  {
1195
- ref: f,
1196
- points: [new L(0, 0, 0), o],
1193
+ ref: p,
1194
+ points: [new G(0, 0, 0), h],
1197
1195
  color: "White",
1198
1196
  lineWidth: 5
1199
1197
  }
1200
1198
  ),
1201
- /* @__PURE__ */ w("mesh", { ref: i, name: "TCP", position: o, children: [
1199
+ /* @__PURE__ */ x("mesh", { ref: i, name: "TCP", position: h, children: [
1202
1200
  /* @__PURE__ */ r("sphereGeometry", { args: [0.025, 32, 32] }),
1203
1201
  /* @__PURE__ */ r("meshStandardMaterial", { color: "red", depthTest: !0 })
1204
1202
  ] })
@@ -1206,106 +1204,106 @@ function Me({
1206
1204
  }
1207
1205
  );
1208
1206
  }
1209
- const _e = j(
1207
+ const Me = E(
1210
1208
  ({
1211
1209
  rapidlyChangingMotionState: e,
1212
1210
  modelFromController: n,
1213
1211
  dhParameters: t,
1214
- getModel: l = J,
1212
+ getModel: a = J,
1215
1213
  flangeRef: i,
1216
- postModelRender: f,
1217
- transparentColor: c,
1218
- instanceUrl: o,
1219
- ...y
1214
+ postModelRender: p,
1215
+ transparentColor: u,
1216
+ instanceUrl: h,
1217
+ ...l
1220
1218
  }) => {
1221
- const [s, m] = S(null), a = G((d) => {
1219
+ const [s, m] = S(null), o = L((d) => {
1222
1220
  m(d);
1223
1221
  }, []);
1224
1222
  T(() => {
1225
- s && (c ? we(s, c) : xe(s));
1226
- }, [s, c]);
1227
- const u = /* @__PURE__ */ r(
1228
- Me,
1223
+ s && (u ? be(s, u) : we(s));
1224
+ }, [s, u]);
1225
+ const c = /* @__PURE__ */ r(
1226
+ ve,
1229
1227
  {
1230
1228
  rapidlyChangingMotionState: e,
1231
1229
  dhParameters: t,
1232
- ...y
1230
+ ...l
1233
1231
  }
1234
1232
  );
1235
- return /* @__PURE__ */ w(
1233
+ return /* @__PURE__ */ x(
1236
1234
  pe,
1237
1235
  {
1238
- fallback: u,
1236
+ fallback: c,
1239
1237
  onError: (d) => {
1240
1238
  console.warn(d);
1241
1239
  },
1242
1240
  children: [
1243
- /* @__PURE__ */ r(ae, { fallback: u, children: /* @__PURE__ */ r("group", { ref: a, children: /* @__PURE__ */ r(
1244
- ve,
1241
+ /* @__PURE__ */ r(se, { fallback: c, children: /* @__PURE__ */ r("group", { ref: o, children: /* @__PURE__ */ r(
1242
+ Re,
1245
1243
  {
1246
1244
  rapidlyChangingMotionState: e,
1247
1245
  dhParameters: t,
1248
1246
  children: /* @__PURE__ */ r(
1249
- be,
1247
+ ge,
1250
1248
  {
1251
1249
  modelURL: (() => {
1252
- const d = l(n, o);
1250
+ const d = a(n, h);
1253
1251
  if (!d) {
1254
- const p = new Blob([], { type: "model/gltf-binary" }), h = new File(
1255
- [p],
1252
+ const y = new Blob([], { type: "model/gltf-binary" }), f = new File(
1253
+ [y],
1256
1254
  `${n}.glb`,
1257
1255
  { type: "model/gltf-binary" }
1258
1256
  );
1259
- return Promise.resolve(URL.createObjectURL(h));
1257
+ return Promise.resolve(URL.createObjectURL(f));
1260
1258
  }
1261
1259
  return d;
1262
1260
  })(),
1263
- postModelRender: f,
1261
+ postModelRender: p,
1264
1262
  flangeRef: i,
1265
- ...y
1263
+ ...l
1266
1264
  }
1267
1265
  )
1268
1266
  }
1269
1267
  ) }) }),
1270
- /* @__PURE__ */ r(ge, {})
1268
+ /* @__PURE__ */ r(ye, {})
1271
1269
  ]
1272
1270
  }
1273
1271
  );
1274
1272
  }
1275
1273
  );
1276
- function Mt({
1274
+ function Rt({
1277
1275
  connectedMotionGroup: e,
1278
1276
  getModel: n = J,
1279
1277
  flangeRef: t,
1280
- transparentColor: l,
1278
+ transparentColor: a,
1281
1279
  postModelRender: i,
1282
- ...f
1280
+ ...p
1283
1281
  }) {
1284
1282
  if (!e.dhParameters)
1285
1283
  return null;
1286
- const c = e.modelFromController || "";
1287
- return c && n(c) ? /* @__PURE__ */ r(
1288
- _e,
1284
+ const u = e.modelFromController || "";
1285
+ return u && n(u) ? /* @__PURE__ */ r(
1286
+ Me,
1289
1287
  {
1290
1288
  rapidlyChangingMotionState: e.rapidlyChangingMotionState,
1291
- modelFromController: c,
1289
+ modelFromController: u,
1292
1290
  dhParameters: e.dhParameters,
1293
1291
  getModel: n,
1294
1292
  flangeRef: t,
1295
- transparentColor: l,
1293
+ transparentColor: a,
1296
1294
  postModelRender: i,
1297
- ...f
1295
+ ...p
1298
1296
  }
1299
1297
  ) : /* @__PURE__ */ r(
1300
- Me,
1298
+ ve,
1301
1299
  {
1302
1300
  rapidlyChangingMotionState: e.rapidlyChangingMotionState,
1303
1301
  dhParameters: e.dhParameters,
1304
- ...f
1302
+ ...p
1305
1303
  }
1306
1304
  );
1307
1305
  }
1308
- const ie = {
1306
+ const oe = {
1309
1307
  [_.Abb]: [0, 0, 0, 0, Math.PI / 2, 0, 0],
1310
1308
  [_.Fanuc]: [0, 0, 0, 0, -Math.PI / 2, 0, 0],
1311
1309
  [_.Yaskawa]: [0, 0, 0, 0, -Math.PI / 2, 0, 0],
@@ -1328,7 +1326,7 @@ const ie = {
1328
1326
  0
1329
1327
  ]
1330
1328
  };
1331
- function Qe(e) {
1329
+ function Ke(e) {
1332
1330
  const [n] = e.split("_");
1333
1331
  switch (n) {
1334
1332
  case "ABB":
@@ -1345,34 +1343,34 @@ function Qe(e) {
1345
1343
  return null;
1346
1344
  }
1347
1345
  }
1348
- function _t(e, n) {
1349
- const t = Qe(e);
1350
- return t && t in ie ? ie[t] : n || null;
1346
+ function vt(e, n) {
1347
+ const t = Ke(e);
1348
+ return t && t in oe ? oe[t] : n || null;
1351
1349
  }
1352
- const Tt = j((e) => {
1353
- const { inverseSolver: n, dhParameters: t, ...l } = e, [i, f] = S(
1354
- C.RevoluteJoint
1350
+ const Mt = E((e) => {
1351
+ const { inverseSolver: n, dhParameters: t, ...a } = e, [i, p] = S(
1352
+ U.RevoluteJoint
1355
1353
  );
1356
1354
  T(() => {
1357
- t.length && f(t[0].type ?? C.RevoluteJoint);
1355
+ t.length && p(t[0].type ?? U.RevoluteJoint);
1358
1356
  }, [t]);
1359
- const c = A(() => n === null && i === C.RevoluteJoint, [n, i]), o = A(() => n === null && i === C.PrismaticJoint, [n, i]);
1360
- return A(() => !!n, [n]) || c ? /* @__PURE__ */ r(Re, { dhParameters: t, ...l }) : o ? /* @__PURE__ */ r(_e, { dhParameters: t, ...l }) : null;
1357
+ const u = j(() => n === null && i === U.RevoluteJoint, [n, i]), h = j(() => n === null && i === U.PrismaticJoint, [n, i]);
1358
+ return j(() => !!n, [n]) || u ? /* @__PURE__ */ r(xe, { dhParameters: t, ...a }) : h ? /* @__PURE__ */ r(Me, { dhParameters: t, ...a }) : null;
1361
1359
  });
1362
1360
  export {
1363
- bt as C,
1364
- Mt as L,
1365
- ie as M,
1361
+ yt as C,
1362
+ Rt as L,
1363
+ oe as M,
1366
1364
  ne as P,
1367
- Rt as R,
1368
- wt as S,
1369
- xt as T,
1370
- vt as a,
1371
- Ze as b,
1372
- _e as c,
1365
+ wt as R,
1366
+ gt as S,
1367
+ bt as T,
1368
+ xt as a,
1369
+ Xe as b,
1370
+ Me as c,
1373
1371
  J as d,
1374
- Qe as e,
1375
- Re as f,
1376
- _t as g,
1377
- Tt as h
1372
+ Ke as e,
1373
+ xe as f,
1374
+ vt as g,
1375
+ Mt as h
1378
1376
  };