@wandelbots/wandelbots-js-react-components 5.10.0 → 6.0.0-pr.motion-smoothing-config.624.f0bfa13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +8 -16
  2. package/dist/3d.cjs +1 -1
  3. package/dist/3d.d.ts +1 -0
  4. package/dist/3d.js +13 -10
  5. package/dist/SafetyBar/index.cjs +1 -1
  6. package/dist/SafetyBar/index.js +1 -1
  7. package/dist/chunks/MotionGroupVisualizer-Cdruoxq4.cjs +1 -0
  8. package/dist/chunks/{MotionGroupVisualizer-BRec-k-p.js → MotionGroupVisualizer-DqUGHRK7.js} +445 -444
  9. package/dist/chunks/SafetyBar-Cy9DiXp9.js +453 -0
  10. package/dist/chunks/SafetyBar-DPrv_OQA.cjs +1 -0
  11. package/dist/chunks/{interpolation-DG8VTxzS.js → interpolation-jnKIUiIm.js} +5 -5
  12. package/dist/chunks/{theming-D4Vvwf6q.js → theming-AUvtT-C3.js} +948 -919
  13. package/dist/chunks/theming-BwZXb5-H.cjs +4 -0
  14. package/dist/components/robots/LinearAxisAnimator.d.ts +9 -1
  15. package/dist/components/robots/RobotAnimator.d.ts +8 -0
  16. package/dist/components/robots/SupportedLinearAxis.d.ts +9 -1
  17. package/dist/components/robots/SupportedRobot.d.ts +9 -1
  18. package/dist/components/utils/interpolation.d.ts +32 -1
  19. package/dist/core.cjs +1 -1
  20. package/dist/core.js +3 -3
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.d.ts +0 -1
  23. package/dist/index.js +60 -85
  24. package/package.json +1 -6
  25. package/dist/SafetyBar/icons/index.d.ts +0 -10
  26. package/dist/chunks/MotionGroupVisualizer-zDM0Lgd-.cjs +0 -1
  27. package/dist/chunks/SafetyBar-CxxIVVeR.js +0 -413
  28. package/dist/chunks/SafetyBar-VvOZ9aRM.cjs +0 -1
  29. package/dist/chunks/robot-Cy9ST5-m.js +0 -40
  30. package/dist/chunks/robot-SEtfVAmf.cjs +0 -1
  31. package/dist/chunks/safety-state-stop-CJW5CKkp.js +0 -55
  32. package/dist/chunks/safety-state-stop-CgPfwC18.cjs +0 -1
  33. package/dist/chunks/theming-DL6p0QAr.cjs +0 -4
  34. package/dist/chunks/wbLogo-CObCmqTw.js +0 -30
  35. package/dist/chunks/wbLogo-G_IfZ03l.cjs +0 -1
  36. package/dist/wb-icons.cjs +0 -1
  37. package/dist/wb-icons.d.ts +0 -2
  38. package/dist/wb-icons.js +0 -27
package/dist/index.js CHANGED
@@ -1,96 +1,71 @@
1
- import { C as e, L as s, M as t, h as r, P as n, b as i, R as c, S as l, c as g, f as u, T as d, a as p, d as S, e as I, g as f } from "./chunks/MotionGroupVisualizer-BRec-k-p.js";
2
- import { A as M, b as C, u as R, C as b, v as x, d as y, e as A, f as L, J as P, h as T, i as V, j as E, L as J, p as F, M as N, N as O, P as h, g as G, R as q, r as v, q as H, S as W, T as j, s as w, V as B, t as D, W as z, l as U, o as Z, m as _, k, a as X, c as Y, n as K, w as Q, x as $, y as aa, z as oa } from "./chunks/theming-D4Vvwf6q.js";
3
- import { a as sa, P as ta, b as ra, V as na, e as ia, c as ca, f as la, u as ga, d as ua } from "./chunks/interpolation-DG8VTxzS.js";
1
+ import { C as o, L as s, M as t, h as r, P as n, b as i, R as g, S as l, c as u, f as d, T as c, a as p, d as M, e as S, g as m } from "./chunks/MotionGroupVisualizer-DqUGHRK7.js";
2
+ import { a as f, P as R, b, V as x, f as L, d as V, u as A, c as P, e as T } from "./chunks/interpolation-jnKIUiIm.js";
3
+ import { A as J, b as y, u as I, C as G, v as N, d as v, e as F, f as h, J as q, h as j, i as w, j as D, L as H, p as W, M as z, N as B, P as O, g as U, R as _, r as k, q as Z, S as K, T as Q, s as X, V as Y, t as $, W as aa, l as ea, o as oa, m as sa, k as ta, a as ra, c as na, n as ia, w as ga, x as la, y as ua, z as da } from "./chunks/theming-AUvtT-C3.js";
4
4
  import { i as pa } from "./chunks/externalizeComponent-EDymnaGR.js";
5
- import { S as Ia } from "./chunks/SafetyBar-CxxIVVeR.js";
6
- import { F as ma, a as Ma, b as Ca, c as Ra, d as ba, e as xa, f as ya } from "./chunks/robot-Cy9ST5-m.js";
7
- import { F as La, a as Pa, b as Ta, c as Va, d as Ea } from "./chunks/wbLogo-CObCmqTw.js";
8
- import { F as Fa, a as Na, b as Oa, c as ha, d as Ga, e as qa, f as va, g as Ha, h as Wa, i as ja } from "./chunks/safety-state-stop-CJW5CKkp.js";
5
+ import { S as Sa } from "./chunks/SafetyBar-Cy9DiXp9.js";
9
6
  export {
10
- M as AdornedTextField,
11
- C as AppHeader,
12
- ma as AxisXIcon,
13
- Ma as AxisYIcon,
14
- Ca as AxisZIcon,
15
- e as CollisionSceneRenderer,
16
- R as ConnectedMotionGroup,
17
- Fa as ControllerTypePhysicalIcon,
18
- Na as ControllerTypeVirtualIcon,
19
- b as CycleTimer,
20
- La as HomeIcon,
21
- Ra as JogMinusIcon,
22
- ba as JogPlusIcon,
23
- x as JoggerConnection,
24
- y as JoggingCartesianAxisControl,
25
- Pa as JoggingIcon,
26
- A as JoggingJointValueControl,
27
- L as JoggingPanel,
28
- P as JoggingStore,
7
+ J as AdornedTextField,
8
+ y as AppHeader,
9
+ o as CollisionSceneRenderer,
10
+ I as ConnectedMotionGroup,
11
+ G as CycleTimer,
12
+ N as JoggerConnection,
13
+ v as JoggingCartesianAxisControl,
14
+ F as JoggingJointValueControl,
15
+ h as JoggingPanel,
16
+ q as JoggingStore,
29
17
  s as LinearAxis,
30
- T as LoadingCover,
31
- V as LoadingErrorMessage,
32
- E as LogPanel,
33
- J as LogStore,
34
- F as LogViewer,
18
+ j as LoadingCover,
19
+ w as LoadingErrorMessage,
20
+ D as LogPanel,
21
+ H as LogStore,
22
+ W as LogViewer,
35
23
  t as MANUFACTURER_HOME_CONFIGS,
36
24
  r as MotionGroupVisualizer,
37
- N as MotionStreamConnection,
38
- O as NoMotionGroupModal,
39
- Oa as OperationModeAutomaticIcon,
40
- ha as OperationModeErrorIcon,
41
- Ga as OperationModeManualIcon,
42
- Ta as OrientationCoordSystemIcon,
43
- Va as OrientationToolIcon,
44
- h as PoseCartesianValues,
45
- G as PoseJointValues,
25
+ z as MotionStreamConnection,
26
+ B as NoMotionGroupModal,
27
+ O as PoseCartesianValues,
28
+ U as PoseJointValues,
46
29
  n as PresetEnvironment,
47
- sa as ProgramControl,
48
- ta as ProgramState,
49
- ra as ProgramStateIndicator,
30
+ f as ProgramControl,
31
+ R as ProgramState,
32
+ b as ProgramStateIndicator,
50
33
  i as Robot,
51
- c as RobotCard,
52
- xa as RobotIcon,
53
- q as RobotListItem,
54
- v as RobotSetupReadinessIndicator,
55
- H as RobotSetupReadinessState,
56
- ya as RotationIcon,
57
- Ia as SafetyBar,
58
- qa as SafetyStateErrorIcon,
59
- va as SafetyStateEstopIcon,
60
- Ha as SafetyStateManualActionRequiredIcon,
61
- Wa as SafetyStateNormalIcon,
62
- ja as SafetyStateStopIcon,
34
+ g as RobotCard,
35
+ _ as RobotListItem,
36
+ k as RobotSetupReadinessIndicator,
37
+ Z as RobotSetupReadinessState,
38
+ Sa as SafetyBar,
63
39
  l as SafetyZonesRenderer,
64
- W as SelectableFab,
65
- g as SupportedLinearAxis,
66
- u as SupportedRobot,
67
- j as TabBar,
68
- w as Timer,
69
- d as TrajectoryRenderer,
70
- na as ValueInterpolator,
71
- B as VelocitySlider,
72
- D as VelocitySliderLabel,
73
- Ea as WBLogoIcon,
74
- z as WandelbotsDataGrid,
75
- U as createDebugMessage,
76
- Z as createErrorMessage,
77
- _ as createInfoMessage,
78
- k as createLogMessage,
79
- X as createNovaMuiTheme,
80
- Y as createNovaTheme,
81
- K as createWarningMessage,
40
+ K as SelectableFab,
41
+ u as SupportedLinearAxis,
42
+ d as SupportedRobot,
43
+ Q as TabBar,
44
+ X as Timer,
45
+ c as TrajectoryRenderer,
46
+ x as ValueInterpolator,
47
+ Y as VelocitySlider,
48
+ $ as VelocitySliderLabel,
49
+ aa as WandelbotsDataGrid,
50
+ ea as createDebugMessage,
51
+ oa as createErrorMessage,
52
+ sa as createInfoMessage,
53
+ ta as createLogMessage,
54
+ ra as createNovaMuiTheme,
55
+ na as createNovaTheme,
56
+ ia as createWarningMessage,
82
57
  p as defaultAxisConfig,
83
- S as defaultGetModel,
84
- I as extractManufacturer,
85
- f as getDefaultHomeConfig,
58
+ M as defaultGetModel,
59
+ S as extractManufacturer,
60
+ m as getDefaultHomeConfig,
86
61
  pa as i18n,
87
- Q as jointValuesEqual,
88
- $ as poseEqual,
89
- aa as tcpMotionEqual,
90
- oa as unwrapRotationVector,
91
- ia as useAnimationFrame,
92
- ca as useAutorun,
93
- la as useInterpolation,
94
- ga as useMounted,
95
- ua as useReaction
62
+ ga as jointValuesEqual,
63
+ la as poseEqual,
64
+ ua as tcpMotionEqual,
65
+ da as unwrapRotationVector,
66
+ L as useAnimationFrame,
67
+ V as useAutorun,
68
+ A as useInterpolation,
69
+ P as useMounted,
70
+ T as useReaction
96
71
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wandelbots/wandelbots-js-react-components",
3
- "version": "5.10.0",
3
+ "version": "6.0.0-pr.motion-smoothing-config.624.f0bfa13",
4
4
  "description": "React UI toolkit for building applications on top of the Wandelbots platform",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -27,11 +27,6 @@
27
27
  "import": "./dist/3d.js",
28
28
  "require": "./dist/3d.cjs"
29
29
  },
30
- "./wb-icons": {
31
- "types": "./dist/wb-icons.d.ts",
32
- "import": "./dist/wb-icons.js",
33
- "require": "./dist/wb-icons.cjs"
34
- },
35
30
  "./package.json": "./package.json",
36
31
  "./*": {
37
32
  "types": "./dist/*/index.d.ts",
@@ -1,10 +0,0 @@
1
- export { default as ControllerTypePhysicalIcon } from "./controller-type-physical.svg";
2
- export { default as ControllerTypeVirtualIcon } from "./controller-type-virtual.svg";
3
- export { default as OperationModeAutomaticIcon } from "./operation-mode-automatic.svg";
4
- export { default as OperationModeErrorIcon } from "./operation-mode-error.svg";
5
- export { default as OperationModeManualIcon } from "./operation-mode-manual.svg";
6
- export { default as SafetyStateErrorIcon } from "./safety-state-error.svg";
7
- export { default as SafetyStateEstopIcon } from "./safety-state-estop.svg";
8
- export { default as SafetyStateManualActionRequiredIcon } from "./safety-state-manual-action-required.svg";
9
- export { default as SafetyStateNormalIcon } from "./safety-state-normal.svg";
10
- export { default as SafetyStateStopIcon } from "./safety-state-stop.svg";
@@ -1 +0,0 @@
1
- "use strict";const e=require("react/jsx-runtime"),b=require("three"),O=require("three-stdlib"),l=require("react"),L=require("./externalizeComponent-OO4jcrz5.cjs"),M=require("@react-three/drei"),he=require("@mui/material/styles"),v=require("@mui/material/Box"),X=require("@mui/material/Button"),me=require("@mui/material/Card"),Z=require("@mui/material/Divider"),K=require("@mui/material/Typography"),k=require("@react-three/fiber"),xe=require("mobx-react-lite"),ye=require("react-i18next"),E=require("./interpolation-C9sLsved.cjs"),R=require("@wandelbots/nova-js/v2"),ee=require("react-error-boundary");function ge(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return n.default=t,Object.freeze(n)}const w=ge(b);function je(t){switch(t.shape_type){case"convex_hull":return new O.ConvexGeometry(t.vertices.map(r=>new w.Vector3(r[0]/1e3,r[1]/1e3,r[2]/1e3)));case"box":return new w.BoxGeometry(t.size_x/1e3,t.size_y/1e3,t.size_z/1e3);case"sphere":return new w.SphereGeometry(t.radius/1e3);case"capsule":return new w.CapsuleGeometry(t.radius/1e3,t.cylinder_height/1e3);case"cylinder":return new w.CylinderGeometry(t.radius/1e3,t.radius/1e3,t.height/1e3);case"rectangle":return new w.BoxGeometry(t.size_x/1e3,t.size_y/1e3,0);default:return console.warn(`${t.shape_type} is not supported`),new w.BufferGeometry}}function be({name:t,collider:n,children:r}){var d,c;const o=((d=n.pose)==null?void 0:d.position)??[0,0,0],a=((c=n.pose)==null?void 0:c.orientation)??[0,0,0];return n.margin&&console.warn(`${t} margin is not supported`),e.jsx("mesh",{name:t,position:new w.Vector3(o[0],o[1],o[2]).divideScalar(1e3),rotation:new w.Euler(a[0],a[1],a[2],"XYZ"),geometry:je(n.shape),children:r})}function we({name:t,colliders:n,meshChildrenProvider:r,...o}){return e.jsx("group",{name:t,...o,children:Object.entries(n).map(([a,d])=>e.jsx(be,{name:a,collider:d,children:r(a,d)},a))})}function Re({scene:t,meshChildrenProvider:n}){const r=t.colliders;return e.jsx("group",{children:r&&e.jsx(we,{meshChildrenProvider:n,colliders:r})})}function D(){return e.jsx(M.Environment,{frames:1,children:e.jsx(ve,{})})}const Me=[2,0,2,0,2,0,2,0];function ve({positions:t=Me}){return e.jsxs(e.Fragment,{children:[e.jsx(M.Lightformer,{intensity:5,"rotation-x":Math.PI/2,position:[0,5,-9],scale:[10,10,1]}),e.jsx("group",{rotation:[0,.5,0],children:e.jsx("group",{children:t.map((n,r)=>e.jsx(M.Lightformer,{form:"circle",intensity:5,rotation:[Math.PI/2,0,0],position:[n,4,r*4],scale:[3,1,1]},r))})}),e.jsx(M.Lightformer,{intensity:40,"rotation-y":Math.PI/2,position:[-5,1,-1],scale:[20,.1,1]}),e.jsx(M.Lightformer,{intensity:20,"rotation-y":-Math.PI,position:[-5,-2,-1],scale:[20,.1,1]}),e.jsx(M.Lightformer,{"rotation-y":Math.PI/2,position:[-5,-1,-1],scale:[20,.5,1],intensity:5}),e.jsx(M.Lightformer,{"rotation-y":-Math.PI/2,position:[10,1,0],scale:[20,1,1],intensity:10}),e.jsx(M.Lightformer,{form:"ring",color:"white",intensity:5,scale:10,position:[-15,4,-18],target:[0,0,0]})]})}const z={attach:"material",color:"#009f4d",opacity:.2,depthTest:!1,depthWrite:!1,transparent:!0,polygonOffset:!0};function Se({safetyZones:t,dhParameters:n,...r}){const o=l.useMemo(()=>L.dhParametersToPlaneSize(n??[]),[n]),a=(c,s)=>{var p,y;if(!((p=s==null?void 0:s.pose)!=null&&p.position)||!((y=s==null?void 0:s.pose)!=null&&y.orientation))return null;const g=new w.Vector3(s.pose.position[0]/1e3,s.pose.position[1]/1e3,s.pose.position[2]/1e3),i=new w.Vector3(s.pose.orientation[0],s.pose.orientation[1],s.pose.orientation[2]);let m;const u=s.shape.shape_type==="plane"?{...z,side:w.DoubleSide}:{...z,side:w.FrontSide};switch(s.shape.shape_type){case"plane":m=e.jsx("planeGeometry",{args:[o,o]});break;case"sphere":{const x=(s==null?void 0:s.shape).radius/1e3;m=e.jsx("sphereGeometry",{args:[x]});break}case"capsule":{const x=(s==null?void 0:s.shape).radius/1e3,f=(s==null?void 0:s.shape).cylinder_height/1e3;m=e.jsx("capsuleGeometry",{args:[x,f]});break}case"convex_hull":{const x=(s==null?void 0:s.shape).vertices.map(h=>new w.Vector3(h[0]/1e3,h[1]/1e3,h[2]/1e3)),f=L.verticesToCoplanarity(x);if(f.isCoplanar&&f.normal){const j=new w.Vector3().addVectors(x[0],f.normal.multiplyScalar(1e-4));x.push(j)}try{m=e.jsx("primitive",{object:new O.ConvexGeometry(x),attach:"geometry"})}catch(h){return console.log("Error creating ConvexGeometry:",h),null}break}case"rectangular_capsule":{const x=s.shape,f=x.radius/1e3,h=x.sphere_center_distance_x/1e3,j=x.sphere_center_distance_y/1e3,S=f*2;m=e.jsx("primitive",{object:new O.RoundedBoxGeometry(h,j,S,2,f),attach:"geometry"});break}default:console.warn("Unsupported safety zone shape type:",s.shape.shape_type),m=null}return e.jsxs("mesh",{renderOrder:c,position:g,quaternion:L.orientationToQuaternion(i),children:[m,e.jsx("meshStandardMaterial",{...u,polygonOffsetFactor:-c})]},`safety-zone-${s.shape.shape_type}-${c}`)},d=l.useMemo(()=>Object.values(t??{}).map((c,s)=>a(s,c)),[t,o]);return e.jsx("group",{...r,children:d})}function _e({trajectory:t,...n}){const r=(t==null?void 0:t.map(o=>{if(o.position&&o.position.length>=3){const[a,d,c]=o.position;if(Number.isFinite(a)&&Number.isFinite(d)&&Number.isFinite(c))return new w.Vector3(a/1e3,c/1e3,-d/1e3)}return null}).filter(o=>o!==null))||[];return e.jsx("group",{...n,children:r.length>0&&e.jsx(M.Line,{points:r,lineWidth:3,polygonOffset:!0,polygonOffsetFactor:10,polygonOffsetUnits:10})})}const V=new Map;async function G(t,n){if(V.has(t))return V.get(t);const r=(async()=>{var c;const o=n||"",a=new R.Nova({instanceUrl:o}),d=a.api.motionGroupModels;(c=d.axios)!=null&&c.interceptors&&d.axios.interceptors.request.use(s=>{var g;return(g=s.url)!=null&&g.includes("/glb")&&(s.responseType="blob"),s});try{const s=await a.api.motionGroupModels.getMotionGroupGlbModel(t);return URL.createObjectURL(s)}catch(s){throw console.error("Failed to fetch model:",s),s}})();return V.set(t,r),r}function te(t){function n(r){return r.children.length===0?[r]:[r,...r.children.flatMap(o=>n(o))]}return n(t).filter(r=>ne(r))}function re(t){return t.name.endsWith("_FLG")}function ne(t){return/_J[0-9]+$/.test(t.name)}function Te(t,n){let r;function o(a){if(re(a)){if(r)throw Error(`Found multiple flange groups in robot model ${n}; first ${r.name} then ${a.name}. Only one _FLG group is allowed.`);r=a}ne(a),a.children.map(o)}if(o(t.scene),!r)throw Error(`No flange group found in robot model ${n}. Flange must be identified with a name ending in _FLG.`);return{gltf:t}}const se=l.forwardRef(function({rapidlyChangingMotionState:n,dhParameters:r,onRotationChanged:o,children:a},d){const c=l.useRef(null),s=l.useRef([]),g=l.useRef(null),{invalidate:i}=k.useThree(),m=l.useRef(n);m.current=n,l.useEffect(()=>{const f=n.joint_position.filter(h=>h!==void 0);return g.current=new E.ValueInterpolator(f,{tension:120,friction:20,threshold:.001}),()=>{var h;(h=g.current)==null||h.destroy()}},[]),k.useFrame((f,h)=>{if(!g.current)return;s.current.length===0&&c.current&&p();const j=g.current.update(h);y(),j||i()});function u(f){c.current=f,f&&p()}function p(){c.current&&(s.current=te(c.current),y(),i())}l.useImperativeHandle(d,()=>({recollectJoints:p}));function y(){var h;const f=((h=g.current)==null?void 0:h.getCurrentValues())||[];if(o)o(s.current,f);else for(const[j,S]of s.current.entries()){const T=r[j],F=T.theta||0,B=T.reverse_rotation_direction?-1:1;S.rotation.y=B*(f[j]||0)+F}}function x(f){var j;const h=f.joint_position.filter(S=>S!==void 0);(j=g.current)==null||j.setTarget(h),i()}return E.useAutorun(()=>{x(m.current)}),l.useEffect(()=>{x(n)},[n]),e.jsx("group",{ref:u,children:a})}),Le="line",ke="mesh";function Ee({rapidlyChangingMotionState:t,dhParameters:n,...r}){const o=new b.Matrix4,a=l.useRef([]),d=l.useRef([]);l.useEffect(()=>{a.current=new Array(n.length).fill(null),d.current=new Array(n.length).fill(null)},[n.length]);function c(i,m){const u=new b.Vector3,p=new b.Quaternion,y=new b.Vector3;o.decompose(u,p,y);const x=u.clone(),f=new b.Matrix4().makeRotationY(i.theta+m*(i.reverse_rotation_direction?-1:1)).multiply(new b.Matrix4().makeTranslation(0,i.d/1e3,0)).multiply(new b.Matrix4().makeTranslation(i.a/1e3,0,0)).multiply(new b.Matrix4().makeRotationX(i.alpha));return o.multiply(f),o.decompose(u,p,y),{a:x,b:u}}function s(i,m,u,p){if(!n)return;const y=n[i];if(!y)return;const{a:x,b:f}=c(y,p);m.geometry.setPositions([x.toArray(),f.toArray()].flat()),u.position.set(f.x,f.y,f.z)}function g(i,m){o.identity();for(let u=0;u<Math.min(i.length,m.length);u++){const p=a.current[u],y=d.current[u];p&&y&&s(u,p,y,m[u])}}return e.jsx(se,{rapidlyChangingMotionState:t,dhParameters:n,onRotationChanged:g,children:e.jsxs("group",{...r,name:"Scene",children:[e.jsxs("mesh",{children:[e.jsx("sphereGeometry",{args:[.01,32,32]}),e.jsx("meshStandardMaterial",{color:"black",depthTest:!0})]}),n==null?void 0:n.map((i,m)=>{const{a:u,b:p}=c(i,t.joint_position[m]??0),y=`dhrobot_J0${m}`;return e.jsxs("group",{name:y,children:[e.jsx(M.Line,{ref:x=>{a.current[m]=x},name:Le,points:[u,p],color:"white",lineWidth:5}),e.jsxs("mesh",{ref:x=>{d.current[m]=x},name:ke,position:p,children:[e.jsx("sphereGeometry",{args:[.01,32,32]}),e.jsx("meshStandardMaterial",{color:"black",depthTest:!0})]},`mesh_${m}`)]},y)})]})})}const Ge=console.warn;function oe(){return l.useEffect(()=>{console.warn=t=>{t!=="Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"&&Ge(t)}},[]),null}function Ce(t){return t.type==="Mesh"}function Ie({url:t,flangeRef:n,postModelRender:r,...o}){const a=M.useGLTF(t),c=Te(a,"robot.glb").gltf,s=l.useCallback(i=>{i&&r&&r()},[r]);function g(i){try{return Ce(i)?i.geometry?e.jsx("mesh",{name:i.name,geometry:i.geometry,material:i.material,position:i.position,rotation:i.rotation},i.uuid):e.jsx("group",{name:i.name,position:i.position,rotation:i.rotation},i.uuid):e.jsx("group",{name:i.name,position:i.position,rotation:i.rotation,ref:re(i)?n:void 0,children:i.children.map(g)},i.uuid)}catch(m){return console.warn("Error rendering node",i.name,m),null}}return e.jsx("group",{...o,dispose:null,ref:s,children:g(c.scene)})}function ie({modelURL:t,flangeRef:n,postModelRender:r,...o}){const[a,d]=l.useState(null);return l.useEffect(()=>{let c=!1;return(async()=>{try{const g=typeof t=="string"?t:await t;c||d(i=>i===g?i:g)}catch(g){console.error("Failed to resolve model URL:",g)}})(),()=>{c=!0}},[t]),a?e.jsx(Ie,{url:a,flangeRef:n,postModelRender:r,...o}):null}const ae=(t,n)=>{t.userData.isGhost||(t.traverse(r=>{if(r instanceof w.Mesh){r.material instanceof w.Material&&(r.material.colorWrite=!1);const o=r.clone(),a=r.clone();o.material=new w.MeshStandardMaterial({depthTest:!0,depthWrite:!0,colorWrite:!1,polygonOffset:!0,polygonOffsetFactor:-1,side:w.DoubleSide}),o.userData.isGhost=!0,a.material=new w.MeshStandardMaterial({color:n,opacity:.3,depthTest:!0,depthWrite:!1,transparent:!0,polygonOffset:!0,polygonOffsetFactor:-2,side:w.DoubleSide}),a.userData.isGhost=!0,r.parent&&(r.parent.add(o),r.parent.add(a))}}),t.userData.isGhost=!0)},ce=t=>{if(!t.userData.isGhost)return;const n=[];t.traverse(r=>{var o;r instanceof w.Mesh&&((o=r.userData)!=null&&o.isGhost?n.push(r):r.material instanceof w.Material&&(r.material.colorWrite=!0))}),n.forEach(r=>{r.parent&&r.parent.remove(r)}),t.userData.isGhost=!1},J=L.externalizeComponent(({rapidlyChangingMotionState:t,modelFromController:n,dhParameters:r,getModel:o=G,flangeRef:a,postModelRender:d,transparentColor:c,instanceUrl:s,...g})=>{const[i,m]=l.useState(null),u=l.useRef(null),p=l.useCallback(h=>{m(h)},[]),y=l.useCallback(()=>{var h;(h=u.current)==null||h.recollectJoints(),d==null||d()},[d]);l.useEffect(()=>{i&&(c?ae(i,c):ce(i))},[i,c]);const x=l.useMemo(()=>{const h=o(n,s);if(!h)throw new Error(`No model found for robot "${n}". Ensure the model is available or provide a custom getModel function.`);return h},[n,s,o]),f=e.jsx(Ee,{rapidlyChangingMotionState:t,dhParameters:r,...g});return e.jsxs(ee.ErrorBoundary,{fallback:f,onError:h=>{console.warn(h)},children:[e.jsx(l.Suspense,{fallback:f,children:e.jsx("group",{ref:p,children:e.jsx(se,{ref:u,rapidlyChangingMotionState:t,dhParameters:r,children:e.jsx(ie,{modelURL:x,postModelRender:y,flangeRef:a,...g})})})}),e.jsx(oe,{})]})});function ue({connectedMotionGroup:t,getModel:n=G,flangeRef:r,transparentColor:o,postModelRender:a,...d}){return t.dhParameters?e.jsx(J,{rapidlyChangingMotionState:t.rapidlyChangingMotionState,modelFromController:t.modelFromController||"",dhParameters:t.dhParameters,getModel:n,flangeRef:r,transparentColor:o,postModelRender:a,...d}):null}const Ae=L.externalizeComponent(xe.observer(({robotName:t,programState:n,safetyState:r,operationMode:o,driveToHomeEnabled:a=!1,onDriveToHomePress:d,onDriveToHomeRelease:c,connectedMotionGroup:s,robotComponent:g=ue,customContentComponent:i,className:m})=>{var H;const u=he.useTheme(),{t:p}=ye.useTranslation(),[y,x]=l.useState(!1),f=l.useRef(null),h=l.useRef(null),[j,S]=l.useState(!1),[T,F]=l.useState({width:400,height:600}),[B,pe]=l.useState(0);l.useEffect(()=>{const P=()=>{if(h.current){const{offsetWidth:Y,offsetHeight:Q}=h.current;S(Y>Q),F({width:Y,height:Q})}};P();const $=new ResizeObserver(P);return h.current&&$.observe(h.current),()=>{$.disconnect()}},[]);const N=l.useCallback(()=>{pe(P=>P+1)},[]),C=l.useCallback(()=>{!a||!d||(x(!0),d())},[a,d]),I=l.useCallback(()=>{!a||!c||(x(!1),c())},[a,c]),W=l.useCallback(()=>{y&&c&&(x(!1),c())},[y,c]),_=j?T.width<350:T.height<200,A=j?T.height<310:T.height<450;return e.jsx(me,{ref:h,className:m,sx:{width:"100%",height:"100%",display:"flex",flexDirection:j?"row":"column",position:"relative",overflow:"hidden",minWidth:{xs:180,sm:220,md:250},minHeight:j?{xs:200,sm:240,md:260}:{xs:150,sm:180,md:220},border:`1px solid ${u.palette.divider}`,borderRadius:"18px",boxShadow:"none",backgroundColor:((H=u.palette.backgroundPaperElevation)==null?void 0:H[8])||"#292B3F",backgroundImage:"none"},children:j?e.jsxs(e.Fragment,{children:[e.jsx(v,{sx:{flex:"0 0 50%",position:"relative",height:"100%",minHeight:"100%",maxHeight:"100%",borderRadius:1,m:{xs:1.5,sm:2,md:3},mr:{xs:.75,sm:1,md:1.5},overflow:"hidden",display:_?"none":"block"},children:!_&&e.jsxs(k.Canvas,{orthographic:!0,camera:{position:[3,2,3],zoom:1},shadows:!0,frameloop:"demand",style:{borderRadius:u.shape.borderRadius,width:"100%",height:"100%",background:"transparent",position:"absolute",top:0,left:0},dpr:[1,2],gl:{alpha:!0,antialias:!0},children:[e.jsx(D,{}),e.jsx(M.Bounds,{fit:!0,observe:!0,margin:1,maxDuration:1,children:e.jsx(g,{connectedMotionGroup:s,postModelRender:N})})]})}),e.jsxs(v,{sx:{flex:"1",display:"flex",flexDirection:"column",justifyContent:"flex-start",width:_?"100%":"50%"},children:[e.jsxs(v,{sx:{p:{xs:1.5,sm:2,md:3},pb:{xs:1,sm:1.5,md:2},textAlign:"left"},children:[e.jsx(K,{variant:"h6",component:"h2",sx:{mb:1},children:t}),e.jsx(E.ProgramStateIndicator,{programState:n,safetyState:r,operationMode:o})]}),e.jsxs(v,{sx:{p:{xs:1.5,sm:2,md:3},pt:0,flex:"1",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[!A&&i&&e.jsxs(v,{children:[e.jsx(i,{}),e.jsx(Z,{sx:{mt:1,mb:0,borderColor:u.palette.divider,opacity:.5}})]}),e.jsx(v,{sx:{mt:!A&&i?"auto":0},children:e.jsx(v,{sx:{display:"flex",justifyContent:"flex-start",mt:{xs:1,sm:1.5,md:2},mb:{xs:.5,sm:.75,md:1}},children:e.jsx(X,{ref:f,variant:"contained",color:"secondary",size:"small",disabled:!a,onMouseDown:C,onMouseUp:I,onMouseLeave:W,onTouchStart:C,onTouchEnd:I,sx:{textTransform:"none",px:1.5,py:.5},children:p("RobotCard.DriveToHome.bt")})})})]})]})]}):e.jsx(e.Fragment,{children:e.jsxs(v,{sx:{p:3,height:"100%",display:"flex",flexDirection:"column"},children:[e.jsxs(v,{children:[e.jsx(K,{variant:"h6",component:"h2",sx:{mb:1},children:t}),e.jsx(E.ProgramStateIndicator,{programState:n,safetyState:r,operationMode:o})]}),e.jsx(v,{sx:{flex:_?0:1,position:"relative",minHeight:_?0:{xs:120,sm:150,md:200},height:_?0:"auto",borderRadius:1,overflow:"hidden",display:_?"none":"block"},children:!_&&e.jsxs(k.Canvas,{orthographic:!0,camera:{position:[3,2,3],zoom:1},shadows:!0,frameloop:"demand",style:{borderRadius:u.shape.borderRadius,width:"100%",height:"100%",background:"transparent",position:"absolute"},dpr:[1,2],gl:{alpha:!0,antialias:!0},children:[e.jsx(D,{}),e.jsx(M.Bounds,{fit:!0,clip:!0,observe:!0,margin:1,maxDuration:1,children:e.jsx(g,{connectedMotionGroup:s,postModelRender:N})})]})}),e.jsxs(v,{children:[!A&&i&&e.jsxs(e.Fragment,{children:[e.jsx(i,{}),e.jsx(Z,{sx:{mt:1,mb:0,borderColor:u.palette.divider,opacity:.5}})]}),e.jsx(v,{sx:{display:"flex",justifyContent:"flex-start",mt:!A&&i?{xs:1,sm:2,md:5}:{xs:.5,sm:1,md:2},mb:{xs:.5,sm:.75,md:1}},children:e.jsx(X,{ref:f,variant:"contained",color:"secondary",size:"small",disabled:!a,onMouseDown:C,onMouseUp:I,onMouseLeave:W,onTouchStart:C,onTouchEnd:I,sx:{textTransform:"none",px:1.5,py:.5},children:p("RobotCard.DriveToHome.bt")})})]})]})})})})),Pe=Array(6).fill(2*Math.PI);function le({rapidlyChangingMotionState:t,dhParameters:n,onTranslationChanged:r,children:o}){const a=l.useRef([]),d=l.useRef([]),c=l.useRef(null),{invalidate:s}=k.useThree();l.useEffect(()=>{const u=t.joint_position.filter(p=>p!==void 0);return c.current=new E.ValueInterpolator(u,{tension:120,friction:20,threshold:.001}),()=>{var p;(p=c.current)==null||p.destroy()}},[]),k.useFrame((u,p)=>{if(c.current){const y=c.current.update(p);i(),y||s()}});function g(u){u&&(d.current=te(u),i(),s())}function i(){var p;const u=((p=c.current)==null?void 0:p.getCurrentValues())||[];if(r)r(d.current,u);else for(const[y,x]of d.current.entries()){const h=n[y].reverse_rotation_direction?-1:1;x.position.y=h*(u[y]||0)/1e3}}const m=l.useCallback(()=>{const u=t.joint_position.filter(p=>p!==void 0);requestAnimationFrame(()=>{var p;a.current=u,(p=c.current)==null||p.setTarget(u)})},[t]);return l.useEffect(()=>{m()},[t,m]),E.useAutorun(()=>{m()}),e.jsx("group",{ref:g,children:o})}function fe({rapidlyChangingMotionState:t,dhParameters:n,...r}){const o=new b.Matrix4,a=l.useRef(null),d=l.useRef(null);function c(i){const m=new b.Matrix4;for(let x=0;x<n.length;x++){const f=n[x],h=i[x]??0,j=new b.Matrix4().makeRotationY(f.theta).multiply(new b.Matrix4().makeTranslation(f.a/1e3,(f.d+h*(f.reverse_rotation_direction?-1:1))/1e3,0)).multiply(new b.Matrix4().makeRotationX(f.alpha));m.multiply(j)}const u=new b.Vector3,p=new b.Quaternion,y=new b.Vector3;return m.decompose(u,p,y),u}const s=c(t.joint_position);function g(i,m){o.identity();let u=new b.Vector3;for(let f=0;f<n.length;f++){const h=m[f]??0,j=n[f],S=new b.Matrix4().makeRotationY(j.theta).multiply(new b.Matrix4().makeTranslation(j.a/1e3,(j.d+h*(j.reverse_rotation_direction?-1:1))/1e3,0)).multiply(new b.Matrix4().makeRotationX(j.alpha));o.multiply(S)}const p=new b.Vector3,y=new b.Quaternion,x=new b.Vector3;if(o.decompose(p,y,x),u=p,a.current&&a.current.position.set(u.x,u.y,u.z),d.current){const f=d.current.geometry;f!=null&&f.setPositions&&f.setPositions([0,0,0,u.x,u.y,u.z])}}return e.jsx(le,{rapidlyChangingMotionState:t,dhParameters:n,onTranslationChanged:g,children:e.jsxs("group",{...r,name:"Scene",children:[e.jsxs("mesh",{name:"Base",position:[0,0,0],children:[e.jsx("sphereGeometry",{args:[.02,32,32]}),e.jsx("meshStandardMaterial",{color:"green",depthTest:!0})]}),e.jsx(M.Line,{ref:d,points:[new b.Vector3(0,0,0),s],color:"White",lineWidth:5}),e.jsxs("mesh",{ref:a,name:"TCP",position:s,children:[e.jsx("sphereGeometry",{args:[.025,32,32]}),e.jsx("meshStandardMaterial",{color:"red",depthTest:!0})]})]})})}const U=L.externalizeComponent(({rapidlyChangingMotionState:t,modelFromController:n,dhParameters:r,getModel:o=G,flangeRef:a,postModelRender:d,transparentColor:c,instanceUrl:s,...g})=>{const[i,m]=l.useState(null),u=l.useCallback(y=>{m(y)},[]);l.useEffect(()=>{i&&(c?ae(i,c):ce(i))},[i,c]);const p=e.jsx(fe,{rapidlyChangingMotionState:t,dhParameters:r,...g});return e.jsxs(ee.ErrorBoundary,{fallback:p,onError:y=>{console.warn(y)},children:[e.jsx(l.Suspense,{fallback:p,children:e.jsx("group",{ref:u,children:e.jsx(le,{rapidlyChangingMotionState:t,dhParameters:r,children:e.jsx(ie,{modelURL:(()=>{const y=o(n,s);if(!y){const x=new Blob([],{type:"model/gltf-binary"}),f=new File([x],`${n}.glb`,{type:"model/gltf-binary"});return Promise.resolve(URL.createObjectURL(f))}return y})(),postModelRender:d,flangeRef:a,...g})})})}),e.jsx(oe,{})]})});function Fe({connectedMotionGroup:t,getModel:n=G,flangeRef:r,transparentColor:o,postModelRender:a,...d}){if(!t.dhParameters)return null;const c=t.modelFromController||"";return c&&n(c)?e.jsx(U,{rapidlyChangingMotionState:t.rapidlyChangingMotionState,modelFromController:c,dhParameters:t.dhParameters,getModel:n,flangeRef:r,transparentColor:o,postModelRender:a,...d}):e.jsx(fe,{rapidlyChangingMotionState:t.rapidlyChangingMotionState,dhParameters:t.dhParameters,...d})}const q={[R.Manufacturer.Abb]:[0,0,0,0,Math.PI/2,0,0],[R.Manufacturer.Fanuc]:[0,0,0,0,-Math.PI/2,0,0],[R.Manufacturer.Yaskawa]:[0,0,0,0,-Math.PI/2,0,0],[R.Manufacturer.Kuka]:[0,-Math.PI/2,Math.PI/2,0,Math.PI/2,0,0],[R.Manufacturer.Universalrobots]:[0,-Math.PI/2,-Math.PI/2,-Math.PI/2,Math.PI/2,-Math.PI/2,0],[R.Manufacturer.Staubli]:[0,-Math.PI/2,Math.PI/2,0,0,0,0]};function de(t){const[n]=t.split("_");switch(n){case"ABB":return R.Manufacturer.Abb;case"FANUC":return R.Manufacturer.Fanuc;case"YASKAWA":return R.Manufacturer.Yaskawa;case"KUKA":return R.Manufacturer.Kuka;case"UniversalRobots":return R.Manufacturer.Universalrobots;case"STAUBLI":return R.Manufacturer.Staubli;default:return null}}function Ve(t,n){const r=de(t);return r&&r in q?q[r]:n||null}const Oe=L.externalizeComponent(t=>{const{inverseSolver:n,dhParameters:r,...o}=t,[a,d]=l.useState(R.JointTypeEnum.RevoluteJoint);l.useEffect(()=>{r.length&&d(r[0].type??R.JointTypeEnum.RevoluteJoint)},[r]);const c=l.useMemo(()=>n===null&&a===R.JointTypeEnum.RevoluteJoint,[n,a]),s=l.useMemo(()=>n===null&&a===R.JointTypeEnum.PrismaticJoint,[n,a]);return l.useMemo(()=>!!n,[n])||c?e.jsx(J,{dhParameters:r,...o}):s?e.jsx(U,{dhParameters:r,...o}):null});exports.CollisionSceneRenderer=Re;exports.LinearAxis=Fe;exports.MANUFACTURER_HOME_CONFIGS=q;exports.MotionGroupVisualizer=Oe;exports.PresetEnvironment=D;exports.Robot=ue;exports.RobotCard=Ae;exports.SafetyZonesRenderer=Se;exports.SupportedLinearAxis=U;exports.SupportedRobot=J;exports.TrajectoryRenderer=_e;exports.defaultAxisConfig=Pe;exports.defaultGetModel=G;exports.extractManufacturer=de;exports.getDefaultHomeConfig=Ve;
@@ -1,413 +0,0 @@
1
- import { jsxs as f, Fragment as B, jsx as t } from "react/jsx-runtime";
2
- import h from "@mui/material/Divider";
3
- import y from "@mui/material/Stack";
4
- import { observer as d, useLocalObservable as M } from "mobx-react-lite";
5
- import { t as v, e as O } from "./externalizeComponent-EDymnaGR.js";
6
- import { useTheme as E } from "@mui/material/styles";
7
- import { useId as T } from "react";
8
- import { useTranslation as m, Trans as s } from "react-i18next";
9
- import { a as F, F as R, c as w, d as $, b as P, e as g, g as N, i as I, f as Y, h as C } from "./safety-state-stop-CJW5CKkp.js";
10
- import K from "@mui/material/Popover";
11
- import V from "@mui/material/SvgIcon";
12
- import u from "@mui/material/Typography";
13
- import { AxiosError as b } from "axios";
14
- function U(a, o) {
15
- throw new Error(`${o} ${JSON.stringify(a)}`);
16
- }
17
- function oe(a) {
18
- var o, r, n, e;
19
- return a instanceof b && a.code === "ERR_NETWORK" ? "Failed to connect to the server. Please check your internet connection." : a instanceof b && a.response ? `${(o = a.response) == null ? void 0 : o.status} ${(r = a.response) == null ? void 0 : r.statusText} from ${(n = a.response) == null ? void 0 : n.config.url}: ${JSON.stringify((e = a.response) == null ? void 0 : e.data)}` : a instanceof Error ? a.message : `Unexpected error: ${v(a) || a}`;
20
- }
21
- const p = d(
22
- ({
23
- id: a,
24
- icon: o,
25
- color: r,
26
- title: n,
27
- name: e,
28
- label: l,
29
- explanation: i,
30
- literalValue: S,
31
- anchorOrigin: A,
32
- transformOrigin: _
33
- }) => {
34
- const c = M(() => ({
35
- anchorEl: null,
36
- get isPopoverOpen() {
37
- return !!c.anchorEl;
38
- },
39
- openPopover(x) {
40
- c.anchorEl = x.currentTarget;
41
- },
42
- closePopover() {
43
- c.anchorEl = null;
44
- }
45
- }));
46
- return /* @__PURE__ */ f(B, { children: [
47
- /* @__PURE__ */ f(
48
- y,
49
- {
50
- "aria-owns": c.isPopoverOpen ? a : void 0,
51
- "aria-haspopup": "true",
52
- onMouseEnter: c.openPopover,
53
- onMouseLeave: c.closePopover,
54
- direction: "row",
55
- spacing: 1,
56
- sx: {
57
- cursor: "pointer"
58
- },
59
- children: [
60
- /* @__PURE__ */ t(
61
- V,
62
- {
63
- component: o,
64
- sx: {
65
- color: r
66
- }
67
- }
68
- ),
69
- l && /* @__PURE__ */ t(
70
- "div",
71
- {
72
- style: {
73
- color: r
74
- },
75
- children: l
76
- }
77
- )
78
- ]
79
- }
80
- ),
81
- /* @__PURE__ */ t(
82
- K,
83
- {
84
- id: a,
85
- sx: {
86
- pointerEvents: "none"
87
- },
88
- open: c.isPopoverOpen,
89
- anchorEl: c.anchorEl,
90
- anchorOrigin: A ?? {
91
- vertical: "bottom",
92
- horizontal: "left"
93
- },
94
- transformOrigin: _ ?? {
95
- vertical: "top",
96
- horizontal: "left"
97
- },
98
- onClose: c.closePopover,
99
- disableRestoreFocus: !0,
100
- children: /* @__PURE__ */ f(
101
- y,
102
- {
103
- gap: "1rem",
104
- padding: 2,
105
- maxWidth: "450px",
106
- sx: {
107
- wordWrap: "break-word"
108
- },
109
- children: [
110
- /* @__PURE__ */ f("div", { children: [
111
- n && /* @__PURE__ */ t(u, { component: "span", fontSize: "14px", children: `${n}: ` }),
112
- /* @__PURE__ */ t(
113
- u,
114
- {
115
- component: "span",
116
- color: r,
117
- fontWeight: "bold",
118
- fontSize: "14px",
119
- children: e
120
- }
121
- )
122
- ] }),
123
- /* @__PURE__ */ t(u, { fontSize: "14px", children: i }),
124
- S && /* @__PURE__ */ t(u, { fontSize: "12px", children: S })
125
- ]
126
- }
127
- )
128
- }
129
- )
130
- ] });
131
- }
132
- ), D = d(
133
- ({
134
- isVirtual: a,
135
- motionGroupId: o,
136
- anchorOrigin: r,
137
- transformOrigin: n,
138
- compact: e
139
- }) => {
140
- const l = E(), i = T(), { t: S } = m();
141
- return a ? /* @__PURE__ */ t(
142
- p,
143
- {
144
- id: `motion-group-virtual-${i}`,
145
- icon: F,
146
- color: l.palette.tertiary.main,
147
- name: S("SafetyBar.ControllerType.Virtual.lb"),
148
- label: e ? null : S("SafetyBar.ControllerType.Virtual.lb"),
149
- explanation: /* @__PURE__ */ f(
150
- s,
151
- {
152
- i18nKey: "SafetyBar.MotionGroup.Virtual.Explanation.lb",
153
- values: {
154
- motionGroupId: o
155
- },
156
- children: [
157
- "Motion group ",
158
- /* @__PURE__ */ t("code", { children: o }),
159
- " refers to a virtual robot with no physical counterpart. It can be freely manipulated without special safety precautions."
160
- ]
161
- }
162
- ),
163
- anchorOrigin: r,
164
- transformOrigin: n
165
- }
166
- ) : /* @__PURE__ */ t(
167
- p,
168
- {
169
- id: `motion-group-physical-${i}`,
170
- icon: R,
171
- color: l.palette.primary.main,
172
- name: S("SafetyBar.ControllerType.Physical.lb"),
173
- label: e ? null : S("SafetyBar.ControllerType.Physical.lb"),
174
- explanation: /* @__PURE__ */ t(
175
- s,
176
- {
177
- i18nKey: "SafetyBar.MotionGroup.Physical.Explanation.lb",
178
- values: {
179
- motionGroupId: o
180
- },
181
- components: { code: /* @__PURE__ */ t("code", {}), strong: /* @__PURE__ */ t("strong", {}) }
182
- }
183
- ),
184
- anchorOrigin: r,
185
- transformOrigin: n
186
- }
187
- );
188
- }
189
- ), L = d(
190
- ({
191
- operationMode: a,
192
- anchorOrigin: o,
193
- transformOrigin: r,
194
- compact: n
195
- }) => {
196
- const { t: e } = m(), l = E(), i = T();
197
- switch (a) {
198
- case "OPERATION_MODE_AUTO":
199
- return /* @__PURE__ */ t(
200
- p,
201
- {
202
- id: `operation-mode-auto-${i}`,
203
- icon: P,
204
- title: e("SafetyBar.OperationMode.ti"),
205
- name: e("SafetyBar.OperationMode.Automatic.ti"),
206
- label: n ? null : e("SafetyBar.OperationMode.Automatic.ti"),
207
- color: l.palette.text.secondary,
208
- explanation: /* @__PURE__ */ t(s, { i18nKey: "SafetyBar.OperationMode.Auto.Explanation.lb", children: "The robot controller is in automatic operation mode. Automated movement without manual confirmation is possible in this mode." }),
209
- anchorOrigin: o,
210
- transformOrigin: r
211
- }
212
- );
213
- case "OPERATION_MODE_MANUAL":
214
- case "OPERATION_MODE_MANUAL_T1":
215
- case "OPERATION_MODE_MANUAL_T2":
216
- return /* @__PURE__ */ t(
217
- p,
218
- {
219
- id: `operation-mode-manual-${i}`,
220
- icon: $,
221
- color: l.palette.warning.main,
222
- title: e("SafetyBar.OperationMode.ti"),
223
- name: e("SafetyBar.OperationMode.Manual.lb"),
224
- label: n ? null : e("SafetyBar.OperationMode.Manual.lb"),
225
- explanation: /* @__PURE__ */ t(s, { i18nKey: "SafetyBar.OperationMode.Manual.Explanation.lb", children: "The robot controller is in manual operation mode. On a physical robot, this generally indicates that an enabling switch must be held for the robot to move successfully." }),
226
- literalValue: a,
227
- anchorOrigin: o,
228
- transformOrigin: r
229
- }
230
- );
231
- default:
232
- return /* @__PURE__ */ t(
233
- p,
234
- {
235
- id: `operation-mode-error-${i}`,
236
- icon: w,
237
- color: l.palette.warning.main,
238
- title: e("SafetyBar.OperationMode.ti"),
239
- name: e("SafetyBar.OperationMode.Error.lb"),
240
- label: n ? null : e("SafetyBar.OperationMode.Error.lb"),
241
- explanation: /* @__PURE__ */ t(s, { i18nKey: "SafetyBar.OperationMode.Error.Explanation.lb", children: "The robot controller has entered an unexpected operation mode. Motion group movement may not be possible." }),
242
- literalValue: a,
243
- anchorOrigin: o,
244
- transformOrigin: r
245
- }
246
- );
247
- }
248
- }
249
- ), z = d(
250
- ({
251
- safetyState: a,
252
- anchorOrigin: o,
253
- transformOrigin: r,
254
- compact: n
255
- }) => {
256
- const { t: e } = m(), l = E(), i = T();
257
- switch (a) {
258
- // Normal state, robot can move
259
- case "SAFETY_STATE_NORMAL":
260
- return /* @__PURE__ */ t(
261
- p,
262
- {
263
- id: `safety-state-normal-${i}`,
264
- title: e("SafetyBar.SafetyState.ti"),
265
- name: e("SafetyBar.SafetyState.Normal.lb"),
266
- label: n ? null : e("SafetyBar.SafetyState.Normal.lb"),
267
- icon: C,
268
- color: l.palette.text.secondary,
269
- explanation: /* @__PURE__ */ t(s, { i18nKey: "SafetyBar.SafetyState.Normal.Explanation.lb", children: "The robot controller is in a normal safety state. Movement is not prevented by this state." }),
270
- anchorOrigin: o,
271
- transformOrigin: r
272
- }
273
- );
274
- // Estop
275
- case "SAFETY_STATE_DEVICE_EMERGENCY_STOP":
276
- case "SAFETY_STATE_ROBOT_EMERGENCY_STOP":
277
- return /* @__PURE__ */ t(
278
- p,
279
- {
280
- id: `safety-state-estop-${i}`,
281
- title: e("SafetyBar.SafetyState.ti"),
282
- name: e("SafetyBar.SafetyState.Estop.lb"),
283
- label: n ? null : e("SafetyBar.SafetyState.Estop.lb"),
284
- icon: Y,
285
- color: l.palette.error.main,
286
- explanation: /* @__PURE__ */ t(s, { i18nKey: "SafetyBar.StopState.Estop.Explanation.lb", children: "An emergency stop of the robot controller has been triggered. Movement of the robot is no longer possible until the estop is released." }),
287
- literalValue: a,
288
- anchorOrigin: o,
289
- transformOrigin: r
290
- }
291
- );
292
- // General stop
293
- case "SAFETY_STATE_STOP_0":
294
- case "SAFETY_STATE_STOP_1":
295
- case "SAFETY_STATE_STOP_2":
296
- case "SAFETY_STATE_PROTECTIVE_STOP":
297
- case "SAFETY_STATE_STOP":
298
- return /* @__PURE__ */ t(
299
- p,
300
- {
301
- id: `safety-state-stop-${i}`,
302
- icon: I,
303
- title: e("SafetyBar.SafetyState.ti"),
304
- name: e("SafetyBar.SafetyState.Stop.lb"),
305
- label: n ? null : e("SafetyBar.SafetyState.Stop.lb"),
306
- color: l.palette.warning.main,
307
- explanation: /* @__PURE__ */ t(s, { i18nKey: "SafetyBar.SafetyState.Stop.Explanation.lb", children: "The robot controller has entered a stop state. Movement is no longer possible until the stop state is resolved." }),
308
- literalValue: a,
309
- anchorOrigin: o,
310
- transformOrigin: r
311
- }
312
- );
313
- // Manual action required
314
- case "SAFETY_STATE_REDUCED":
315
- case "SAFETY_STATE_MASTERING":
316
- case "SAFETY_STATE_CONFIRM_SAFETY":
317
- case "SAFETY_STATE_OPERATOR_SAFETY":
318
- case "SAFETY_STATE_RECOVERY":
319
- case "SAFETY_STATE_VIOLATION":
320
- return /* @__PURE__ */ t(
321
- p,
322
- {
323
- id: `safety-state-manual-action-required-${i}`,
324
- icon: N,
325
- color: l.palette.warning.main,
326
- title: e("SafetyBar.SafetyState.ti"),
327
- name: e("SafetyBar.SafetyState.ManualActionRequired.lb"),
328
- label: n ? null : e("SafetyBar.SafetyState.ManualActionRequired.lb"),
329
- explanation: /* @__PURE__ */ t(s, { i18nKey: "SafetyBar.SafetyState.ManualActionRequired.Explanation.lb", children: "The robot controller has entered a safety state requiring manual action to resolve." }),
330
- literalValue: a,
331
- anchorOrigin: o,
332
- transformOrigin: r
333
- }
334
- );
335
- // Error
336
- case "SAFETY_STATE_UNKNOWN":
337
- case "SAFETY_STATE_FAULT":
338
- return /* @__PURE__ */ t(
339
- p,
340
- {
341
- id: `safety-state-error-${i}`,
342
- icon: g,
343
- color: l.palette.error.main,
344
- title: e("SafetyBar.SafetyState.ti"),
345
- name: e("SafetyBar.SafetyState.Error.lb"),
346
- label: n ? null : e("SafetyBar.SafetyState.Error.lb"),
347
- explanation: /* @__PURE__ */ t(s, { i18nKey: "SafetyBar.SafetyState.Error.Explanation.lb", children: "The robot controller has entered an unexpected safety state." }),
348
- literalValue: a,
349
- anchorOrigin: o,
350
- transformOrigin: r
351
- }
352
- );
353
- default:
354
- U(a, `Unknown safety state ${a}`);
355
- }
356
- }
357
- ), re = O(
358
- d(
359
- ({
360
- isVirtual: a,
361
- motionGroupId: o,
362
- operationMode: r,
363
- safetyState: n,
364
- anchorOrigin: e,
365
- transformOrigin: l,
366
- compact: i = !0
367
- }) => /* @__PURE__ */ f(
368
- y,
369
- {
370
- direction: "row",
371
- gap: i ? 1 : 2,
372
- alignItems: "center",
373
- sx: { height: "24px" },
374
- children: [
375
- /* @__PURE__ */ t(
376
- z,
377
- {
378
- safetyState: n,
379
- anchorOrigin: e,
380
- transformOrigin: l,
381
- compact: i
382
- }
383
- ),
384
- /* @__PURE__ */ t(h, { orientation: "vertical", flexItem: !0 }),
385
- /* @__PURE__ */ t(
386
- L,
387
- {
388
- operationMode: r,
389
- anchorOrigin: e,
390
- transformOrigin: l,
391
- compact: i
392
- }
393
- ),
394
- /* @__PURE__ */ t(h, { orientation: "vertical", flexItem: !0 }),
395
- /* @__PURE__ */ t(
396
- D,
397
- {
398
- isVirtual: a,
399
- motionGroupId: o,
400
- anchorOrigin: e,
401
- transformOrigin: l,
402
- compact: i
403
- }
404
- )
405
- ]
406
- }
407
- )
408
- )
409
- );
410
- export {
411
- re as S,
412
- oe as m
413
- };