@wandelbots/wandelbots-js-react-components 6.0.0 → 6.1.0-pr.feat-integrate-kinematicChainOffset.635.bba0495

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