@wandelbots/wandelbots-js-react-components 5.10.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -8
- package/dist/SafetyBar/index.cjs +1 -1
- package/dist/SafetyBar/index.js +1 -1
- package/dist/chunks/SafetyBar-Cy9DiXp9.js +453 -0
- package/dist/chunks/SafetyBar-DPrv_OQA.cjs +1 -0
- package/dist/chunks/{theming-D4Vvwf6q.js → theming-B2dYJ4Ca.js} +948 -919
- package/dist/chunks/theming-BwZXb5-H.cjs +4 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +48 -73
- package/package.json +1 -6
- package/dist/SafetyBar/icons/index.d.ts +0 -10
- package/dist/chunks/SafetyBar-CxxIVVeR.js +0 -413
- package/dist/chunks/SafetyBar-VvOZ9aRM.cjs +0 -1
- package/dist/chunks/robot-Cy9ST5-m.js +0 -40
- package/dist/chunks/robot-SEtfVAmf.cjs +0 -1
- package/dist/chunks/safety-state-stop-CJW5CKkp.js +0 -55
- package/dist/chunks/safety-state-stop-CgPfwC18.cjs +0 -1
- package/dist/chunks/theming-DL6p0QAr.cjs +0 -4
- package/dist/chunks/wbLogo-CObCmqTw.js +0 -30
- package/dist/chunks/wbLogo-G_IfZ03l.cjs +0 -1
- package/dist/wb-icons.cjs +0 -1
- package/dist/wb-icons.d.ts +0 -2
- package/dist/wb-icons.js +0 -27
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";const o=require("react/jsx-runtime"),J=require("@mui/material/styles"),et=require("@mui/material/TextField"),tt=require("@mui/material/AppBar"),Ae=require("@mui/material/Backdrop"),w=require("@mui/material/Box"),G=require("@mui/material/IconButton"),nt=require("@mui/material/Menu"),U=require("@mui/material/MenuItem"),ot=require("@mui/material/Toolbar"),R=require("@mui/material/Typography"),D=require("mobx-react-lite"),h=require("react"),B=require("./externalizeComponent-OO4jcrz5.cjs"),it=require("@mui/material/SvgIcon"),W=require("@mui/material/Fade"),rt=require("@mui/x-charts/Gauge"),z=require("react-i18next"),ee=require("./interpolation-C9sLsved.cjs"),at=require("@mui/icons-material/Clear"),st=require("@mui/icons-material/FilterList"),Me=require("@mui/icons-material/Search"),N=require("@mui/material/Divider"),$=require("@mui/x-data-grid"),lt=require("@mui/icons-material/OpenWith"),ct=require("@mui/icons-material/Share"),_=require("@mui/material/Stack"),Oe=require("@mui/material/Tab"),De=require("@mui/material/Tabs"),q=require("@wandelbots/nova-js/v2"),he=require("lodash-es"),k=require("mobx"),L=require("@wandelbots/nova-js"),de=require("three/src/math/Vector3.js"),Je=require("@mui/material/CircularProgress"),dt=require("@mui/material/utils"),ut=require("./SafetyBar-DPrv_OQA.cjs"),gt=require("@mui/material/Alert"),pt=require("@mui/material/AlertTitle"),Y=require("@mui/material/Button"),Ie=require("@mui/material/ToggleButton"),ht=require("lodash-es/isEqual.js"),mt=require("@mui/material/InputAdornment"),ft=require("@mui/material/FormControl"),xt=require("@mui/material/InputLabel"),bt=require("@mui/material/Select"),oe=require("lodash-es/keyBy.js"),yt=require("lodash-es/uniqueId.js"),St=require("@mui/material/ToggleButtonGroup"),Le=require("@mui/material/Slider"),vt=require("lodash-es/isNumber.js"),Ct=require("@mui/icons-material/ChevronLeft"),jt=require("@mui/icons-material/ChevronRight"),wt=require("lodash-es/throttle.js"),Tt=require("@mui/material/Tooltip"),Mt=require("@mui/icons-material/ContentCopy"),It=require("@mui/icons-material/DescriptionOutlined"),kt=require("@mui/icons-material/ExpandLess"),Rt=require("@mui/icons-material/ExpandMore"),Et=require("@mui/material/Paper"),Pt=require("@mui/material/Dialog"),_t=require("@mui/material/DialogActions"),At=require("@mui/material/DialogContent"),Ot=require("@mui/material/DialogTitle"),Dt=require("@mui/icons-material/Error"),Jt=require("@mui/material/Chip"),Lt=require("@mui/material/Fab"),Ft=require("@mui/material/Badge"),Bt=require("@mui/x-charts"),ue=require("three"),zt=require("@wandelbots/mui"),H=require("@wandelbots/design-tokens");require("@mui/x-data-grid/themeAugmentation");function Fe(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const A=Fe(h),ke=Fe(ue),$t=J.styled(et,{shouldForwardProp:t=>t!=="adornedSize"})(({theme:t,adornedSize:e="medium"})=>({"&.MuiTextField-root":{".MuiInputBase-root":{background:t.palette.secondary.dark,borderRadius:"10px"},".MuiInputBase-input":{"&::placeholder":{opacity:"1",color:t.palette.text.disabled}},".MuiInputBase-root .MuiInputBase-input":{padding:e==="small"?"8px 16px":"16px 14px"},".MuiFormLabel-root + .MuiInputBase-root .MuiInputBase-input":{padding:e==="small"?"8px 16px":"24px 14px 8px"},label:{transform:"translate(14px, 8px) scale(0.75)"},":hover":{fieldset:{border:`1px solid ${t.palette.action.hover}`}},".Mui-focused":{fieldset:{border:`1px solid ${t.palette.primary.main}`,legend:{width:0}}},fieldset:{borderRadius:"10px",border:"1px solid transparent",legend:{width:0}}}})),Vt=({adornedSize:t="medium",...e})=>{var n;return o.jsx($t,{adornedSize:t,...e,slotProps:{...e.slotProps,inputLabel:{...(n=e.slotProps)==null?void 0:n.inputLabel,shrink:!0}}})},qt=t=>o.jsx(it,{...t,viewBox:"0 0 10 8",children:o.jsx("path",{d:"M8.825 0.9125L5 4.72917L1.175 0.9125L0 2.0875L5 7.0875L10 2.0875L8.825 0.9125Z",fill:"currentColor",fillOpacity:"0.56"})}),Nt=B.externalizeComponent(D.observer(t=>{const{appIcon:e,appName:n,apps:r=[],onAppSelect:a,disabled:i=!1,sx:c}=t,[s,l]=h.useState(null),d=!!s,m=u=>{l(u.currentTarget)},g=()=>{l(null)},p=u=>{g(),u.onClick?u.onClick():u.href&&(window.location.href=u.href),a==null||a(u)};return o.jsxs(o.Fragment,{children:[o.jsx(tt,{position:"static",sx:{boxShadow:"none",backgroundImage:"none","& .MuiAppBar-root":{backgroundImage:"none",backgroundColor:"transparent"},...c},children:o.jsxs(ot,{sx:{minHeight:"62px !important"},children:[o.jsx(w,{sx:{mr:1,display:"flex",alignItems:"center"},children:e}),o.jsxs(w,{sx:{display:"flex",alignItems:"center",flexGrow:1},children:[o.jsx(R,{component:"h1",sx:{fontWeight:"bold",fontSize:"1rem"},children:n}),r.length>0&&o.jsx(G,{color:"inherit","aria-label":"switch app","aria-controls":"app-menu","aria-haspopup":"true",onClick:m,disabled:i,sx:{ml:1,width:28,height:28,borderRadius:"6px",padding:0,backgroundColor:u=>J.alpha(u.palette.common.white,.1),opacity:1,"&:hover":{backgroundColor:u=>J.alpha(u.palette.common.white,.16)},"& .MuiSvgIcon-root":{fontSize:"8px",width:"8px",height:"6px"}},children:o.jsx(qt,{})})]})]})}),o.jsx(Ae,{open:d,onClick:g,sx:{backdropFilter:"blur(4px)",backgroundColor:"rgba(0, 0, 0, 0.3)",zIndex:u=>u.zIndex.modal-1}}),o.jsx(nt,{id:"app-menu",anchorEl:s,open:d,onClose:g,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},sx:{zIndex:u=>u.zIndex.modal,"& .MuiPaper-root":{minWidth:200,mt:1}},children:r.map(u=>o.jsxs(U,{onClick:()=>p(u),children:[o.jsx(w,{sx:{display:"flex",alignItems:"center"},children:u.icon}),o.jsx(R,{variant:"body1",sx:{ml:2},children:u.name})]},u.id))})]})})),Wt=t=>{const e=Math.floor(t/86400),n=Math.floor(t%86400/3600),r=Math.floor(t%3600/60),a=t%60,i=[];return e>0?(i.push(e.toString()),i.push(n.toString().padStart(2,"0")),i.push(r.toString().padStart(2,"0")),i.push(a.toString().padStart(2,"0"))):n>0?(i.push(n.toString()),i.push(r.toString().padStart(2,"0")),i.push(a.toString().padStart(2,"0"))):(i.push(r.toString()),i.push(a.toString().padStart(2,"0"))),i.join(":")},V=(t,e)=>{const n=Math.floor(t/86400),r=Math.floor(t%86400/3600),a=Math.floor(t%3600/60),i=t%60;if(typeof Intl<"u"&&"DurationFormat"in Intl)try{const s={};return n>0&&(s.days=n),r>0&&(s.hours=r),a>0&&(s.minutes=a),(i>0||Object.keys(s).length===0)&&(s.seconds=i),new Intl.DurationFormat(e,{style:"narrow"}).format(s)}catch{}const c=[];return n>0&&c.push(`${n}d`),r>0&&c.push(`${r}h`),a>0&&c.push(`${a}m`),(i>0||c.length===0)&&c.push(`${i}s`),c.join(" ")},Gt=(t,e,n)=>t==="countdown"&&n!==null?Math.min(100,e/n*100):t==="measuring"?e/60%1*100:0,Ht=({timerState:t,animationState:e,hasError:n,className:r})=>{var x,j;const{t:a,i18n:i}=z.useTranslation(),c=J.useTheme(),{currentState:s,remainingTime:l,maxTime:d,currentProgress:m}=t,{showErrorAnimation:g,showPauseAnimation:p,showPulsatingText:u,pulsatingFinished:b,showLabels:S,showMainText:y,showIdlePulsating:f,idleDotsCount:v}=e;return o.jsxs(w,{className:r,sx:{position:"relative",width:264,height:264,display:"flex",alignItems:"center",justifyContent:"center"},children:[o.jsx(rt.Gauge,{width:264,height:264,value:s==="idle"?0:m,valueMin:0,valueMax:100,innerRadius:"85%",outerRadius:"100%",margin:0,skipAnimation:!0,text:()=>"",sx:{opacity:p||g?.6:1,transition:"opacity 0.5s ease-out","& .MuiGauge-valueArc":{fill:n?c.palette.error.light:c.palette.success.main,transition:"fill 0.5s ease-out"},"& .MuiGauge-referenceArc":{fill:(x=c.palette.backgroundPaperElevation)==null?void 0:x[2],stroke:"transparent",strokeWidth:0,transition:"fill 0.5s ease-out, stroke 0.5s ease-out, stroke-width 0.5s ease-out"},"& .MuiGauge-valueText":{display:"none"},"& .MuiGauge-text":{display:"none"}}}),o.jsxs(w,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:225,height:225,borderRadius:"50%",backgroundColor:(j=c.palette.backgroundPaperElevation)==null?void 0:j[8],display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",gap:1,transition:"background-color 0.5s ease-out"},children:[o.jsx(w,{sx:{height:"16px",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:1},children:o.jsx(W,{in:S&&!n&&s!=="idle"&&s!=="success",timeout:300,children:o.jsx(R,{variant:"body2",sx:{fontSize:"12px",color:s==="measured"&&(u||b)?c.palette.success.main:c.palette.text.secondary,transition:"color 0.8s ease-in-out"},children:o.jsx("span",{style:{opacity:s==="measured"&&b?u?1:.6:1,transition:"opacity 2s ease-in-out"},children:s==="measuring"||s==="measured"?a("CycleTimer.CycleTime.lb","Cycle Time"):s==="countdown"?a("CycleTimer.RemainingTime.lb","Remaining Time"):""})})})}),o.jsxs(w,{sx:{position:"relative",height:"48px",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:.5},children:[o.jsx(W,{in:y&&s==="idle"&&!n,timeout:200,children:o.jsxs(R,{variant:"body2",sx:{position:"absolute",fontSize:"12px",fontWeight:400,color:c.palette.text.secondary,lineHeight:"166%",letterSpacing:"0.17px",textAlign:"center",width:"200px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center"},children:[o.jsx("span",{style:{opacity:f?1:.6,transition:"opacity 2s ease-in-out"},children:a("CycleTimer.WaitingForCycle.lb","Waiting for program cycle")}),o.jsx("span",{style:{display:"inline-block",width:"18px",textAlign:"left",opacity:f?1:.6,transition:"opacity 2s ease-in-out"},children:".".repeat(v)})]})}),o.jsx(W,{in:y&&n,timeout:200,children:o.jsx(R,{variant:"h3",sx:{position:"absolute",fontSize:"40px",fontWeight:400,color:c.palette.text.primary,lineHeight:"116.7%"},children:a("CycleTimer.Error.lb","Error")})}),o.jsx(W,{in:y&&!n&&s!=="idle"&&s!=="success",timeout:300,children:o.jsx(R,{variant:"h1",sx:{position:"absolute",fontSize:"48px",fontWeight:500,color:c.palette.text.primary,lineHeight:1,transition:"color 0.8s ease-in-out"},children:o.jsx("span",{style:{opacity:1,transition:"opacity 2s ease-in-out"},children:Wt(l)})})})]}),o.jsx(w,{sx:{height:"16px",display:"flex",marginTop:.5,alignItems:"center",justifyContent:"center"},children:o.jsx(W,{in:S&&!n&&s!=="idle"&&s!=="success",timeout:300,children:o.jsx(R,{variant:"body2",sx:{fontSize:"12px",color:s==="measured"&&(u||b)?c.palette.success.main:c.palette.text.secondary,transition:"color 0.8s ease-in-out"},children:o.jsx("span",{style:{opacity:s==="measured"&&b?u?1:.6:1,transition:"opacity 2s ease-in-out"},children:s==="measuring"?a("CycleTimer.Measuring.lb","measuring..."):s==="measured"?a("CycleTimer.Determined.lb","determined"):s==="countdown"&&d!==null?a("CycleTimer.OfTime.lb",{time:V(d,i.language)}):""})})})})]})]})},Ut=({timerState:t,animationState:e,hasError:n,compact:r,className:a})=>{const{t:i,i18n:c}=z.useTranslation(),s=J.useTheme(),{currentState:l,remainingTime:d,maxTime:m}=t,{showErrorAnimation:g,showPauseAnimation:p,showPulsatingText:u,pulsatingFinished:b,showIdlePulsating:S,idleDotsCount:y}=e;return r&&l==="idle"?o.jsx(w,{className:a,sx:{display:"flex",alignItems:"center",m:0},children:o.jsx(R,{variant:"body2",sx:{color:n?s.palette.error.light:s.palette.text.primary,fontSize:"14px",transition:"color 0.5s ease-out"},children:n?i("CycleTimer.Error.lb","Error"):l==="idle"?"0s":V(d,c.language)})}):o.jsxs(w,{className:a,sx:{display:"flex",alignItems:"center",m:0,gap:1},children:[!(l==="idle"&&r)&&o.jsx(w,{sx:{width:20,height:20,display:"flex",alignItems:"center",justifyContent:"center",opacity:p||g?.6:1,transition:"opacity 0.5s ease-out"},children:o.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",style:{transform:"rotate(-90deg)"},role:"img","aria-label":"Timer progress",children:[o.jsx("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:n?s.palette.error.light:l==="measured"?u||b?s.palette.success.main:s.palette.text.secondary:s.palette.success.main,strokeWidth:"2",opacity:l==="measured"&&b?u?1:.6:.3,style:{transition:"stroke 0.8s ease-in-out, opacity 2s ease-in-out"}}),o.jsx("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:n?s.palette.error.light:l==="measured"?u||b?s.palette.success.main:s.palette.text.secondary:s.palette.success.main,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:`${2*Math.PI*8}`,strokeDashoffset:`${2*Math.PI*8*(1-(l==="idle"?0:t.currentProgress)/100)}`,style:{opacity:l==="measured"&&b?u?1:.6:1,transition:"stroke-dashoffset 0.1s ease-out, stroke 0.8s ease-in-out, opacity 2s ease-in-out"}})]})}),o.jsx(R,{variant:"body2",sx:{color:n?s.palette.error.light:l==="idle"?s.palette.text.secondary:l==="measured"?u||b?s.palette.success.main:s.palette.text.secondary:s.palette.text.primary,fontSize:"14px",lineHeight:"normal",letterSpacing:"normal",opacity:l==="idle"?S?1:.6:l==="measured"&&b?u?1:.6:1,transition:"color 0.8s ease-in-out, font-size 0.3s ease-out, opacity 2s ease-in-out"},children:n?i("CycleTimer.Error.lb","Error"):l==="idle"?o.jsxs(o.Fragment,{children:[o.jsx("span",{children:i("CycleTimer.WaitingForCycle.lb","Waiting for program cycle")}),o.jsx("span",{style:{display:"inline-block",width:"18px",textAlign:"left"},children:".".repeat(y)})]}):l==="measuring"?r?V(d,c.language):`${V(d,c.language)} / ${i("CycleTimer.Measuring.lb","measuring...")}`:l==="measured"?r?V(d,c.language):`${V(d,c.language)} / ${i("CycleTimer.Determined.lb","determined")}`:l==="countdown"&&m!==null?r?V(d,c.language):`${V(d,c.language)} / ${i("CycleTimer.Time.lb",{time:V(m,c.language)})}`:V(d,c.language)})]})},Yt=()=>{const[t,e]=h.useState({showPauseAnimation:!1,showErrorAnimation:!1,showPulsatingText:!1,pulsatingFinished:!1,showLabels:!0,showMainText:!0,showIdlePulsating:!1,idleDotsCount:0}),n=h.useRef(null),r=h.useRef(null),a=h.useRef(null),i=h.useRef(null),c=h.useRef(0),s=h.useRef(null),l=h.useRef(null),d=h.useCallback(()=>{e(x=>({...x,showPauseAnimation:!0})),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{e(x=>({...x,showPauseAnimation:!1}))},800)},[]),m=h.useCallback(()=>{e(x=>({...x,showErrorAnimation:!0})),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{e(x=>({...x,showErrorAnimation:!1}))},600)},[]),g=h.useCallback(()=>{e(x=>({...x,showErrorAnimation:!1})),r.current&&clearTimeout(r.current)},[]),p=h.useCallback(x=>{c.current=0,e(j=>({...j,showPulsatingText:!0,pulsatingFinished:!1})),setTimeout(()=>{e(j=>({...j,pulsatingFinished:!0})),a.current=setInterval(()=>{e(j=>({...j,showPulsatingText:!j.showPulsatingText}))},2e3),x&&x()},800)},[]),u=h.useCallback(()=>{a.current&&(clearInterval(a.current),a.current=null),e(x=>({...x,showPulsatingText:!1,pulsatingFinished:!1})),c.current=0},[]),b=h.useCallback(()=>{e(x=>({...x,showIdlePulsating:!0})),s.current=setInterval(()=>{e(x=>({...x,showIdlePulsating:!x.showIdlePulsating}))},2e3),l.current=setInterval(()=>{e(x=>({...x,idleDotsCount:(x.idleDotsCount+1)%4}))},800)},[]),S=h.useCallback(()=>{s.current&&(clearInterval(s.current),s.current=null),l.current&&(clearInterval(l.current),l.current=null),e(x=>({...x,showIdlePulsating:!1,idleDotsCount:0}))},[]),y=h.useCallback(()=>{e(x=>({...x,showLabels:!1,showMainText:!1})),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{e(x=>({...x,showLabels:!0,showMainText:!0}))},200)},[]),f=h.useCallback(()=>{e(x=>({...x,showLabels:!0,showMainText:!0}))},[]),v=h.useCallback(()=>{n.current&&clearTimeout(n.current),r.current&&clearTimeout(r.current),i.current&&clearTimeout(i.current),a.current&&clearInterval(a.current),s.current&&clearInterval(s.current),l.current&&clearInterval(l.current)},[]);return{animationState:t,triggerPauseAnimation:d,triggerErrorAnimation:m,clearErrorAnimation:g,startPulsatingAnimation:p,stopPulsatingAnimation:u,startIdleAnimations:b,stopIdleAnimations:S,triggerFadeTransition:y,setInitialAnimationState:f,cleanup:v}},Zt=({autoStart:t,onCycleEnd:e,onMeasuringComplete:n,hasError:r,onPauseAnimation:a,onErrorAnimation:i,onClearErrorAnimation:c,onStartPulsating:s})=>{const[l,d]=h.useState({currentState:"idle",remainingTime:0,maxTime:null,isRunning:!1,isPausedState:!1,currentProgress:0,wasRunningBeforeError:!1}),m=h.useRef(null),g=h.useRef(null),p=h.useRef(0),[u]=ee.useInterpolation([0],{tension:80,friction:18,onChange:([C])=>{d(T=>({...T,currentProgress:C}))}}),b=h.useCallback(()=>{d(C=>({...C,currentState:"idle",maxTime:null,isRunning:!1,isPausedState:!1,currentProgress:0})),p.current=0,g.current=null,u.setImmediate([0])},[u]),S=h.useCallback((C=0)=>{const T=C/60%1*100;d(M=>({...M,currentState:"measuring",maxTime:null,remainingTime:C,isPausedState:!1,currentProgress:T})),p.current=0,u.setImmediate([T]),t?(g.current=Date.now()-C*1e3,d(M=>({...M,isRunning:!0}))):g.current=null},[t,u]),y=h.useCallback((C,T=0)=>{d(I=>({...I,isRunning:!1})),g.current=null,d(I=>({...I,currentState:"countdown",maxTime:C,isPausedState:!1})),p.current=0;const M=Math.max(0,C-T),E=T>0?T/C*100:0;d(I=>({...I,remainingTime:M,currentProgress:E})),u.setImmediate([E]),M===0?(d(I=>({...I,isRunning:!1})),g.current=null,e&&queueMicrotask(()=>e())):t?setTimeout(()=>{g.current=Date.now()-T*1e3,d(I=>({...I,isRunning:!0}))},0):g.current=null},[t,e,u]),f=h.useCallback(()=>{d(C=>({...C,isRunning:!1,currentState:"measured"})),g.current=null,s(()=>{n&&n()})},[s,n]),v=h.useCallback(()=>{if(g.current&&l.isRunning){const T=Date.now()-g.current;p.current+=T;const M=p.current/1e3,E=Gt(l.currentState,M,l.maxTime);u.setTarget([E])}d(C=>({...C,isRunning:!1,isPausedState:!0})),a()},[l.isRunning,l.currentState,l.maxTime,u,a]),x=h.useCallback(()=>{l.isPausedState&&(l.remainingTime>0||l.currentState!=="countdown")&&(g.current=Date.now(),d(C=>({...C,isRunning:!0,isPausedState:!1})))},[l.isPausedState,l.remainingTime,l.currentState]),j=h.useCallback(()=>l.isPausedState,[l.isPausedState]);return h.useEffect(()=>{r?(l.isRunning&&!l.isPausedState&&(d(C=>({...C,wasRunningBeforeError:!0})),v()),i()):(l.wasRunningBeforeError&&l.isPausedState&&(d(C=>({...C,wasRunningBeforeError:!1})),x()),c())},[r,l.isRunning,l.isPausedState,l.wasRunningBeforeError,v,x,i,c]),h.useEffect(()=>{if(l.isRunning){const C=()=>{if(g.current){const M=(Date.now()-g.current+p.current)/1e3;if(l.currentState==="countdown"&&l.maxTime!==null){const E=Math.max(0,l.maxTime-M);d(P=>({...P,remainingTime:Math.ceil(E)}));const I=Math.min(100,M/l.maxTime*100);if(u.setTarget([I]),E<=0){d(P=>({...P,isRunning:!1,remainingTime:0})),g.current=null,u.setTarget([100]),e&&queueMicrotask(()=>e());return}}else if(l.currentState==="measuring"){d(I=>({...I,remainingTime:Math.floor(M)}));const E=M/60%1*100;u.setTarget([E])}l.isRunning&&(m.current=requestAnimationFrame(C))}};m.current=requestAnimationFrame(C)}else m.current&&(cancelAnimationFrame(m.current),m.current=null);return()=>{m.current&&cancelAnimationFrame(m.current)}},[l.isRunning,e,l.currentState,l.maxTime,u]),h.useEffect(()=>{let C=null;const T=()=>{u.update(1/60),C=requestAnimationFrame(T)};return C=requestAnimationFrame(T),()=>{C&&cancelAnimationFrame(C)}},[u]),{timerState:l,controls:{startNewCycle:y,startMeasuring:S,setIdle:b,completeMeasuring:f,pause:v,resume:x,isPaused:j}}},Xt=B.externalizeComponent(D.observer(({onCycleComplete:t,onCycleEnd:e,onMeasuringComplete:n,autoStart:r=!0,variant:a="default",compact:i=!1,className:c,hasError:s=!1})=>{const l=h.useRef(void 0),{animationState:d,triggerPauseAnimation:m,triggerErrorAnimation:g,clearErrorAnimation:p,startPulsatingAnimation:u,stopPulsatingAnimation:b,startIdleAnimations:S,stopIdleAnimations:y,triggerFadeTransition:f,setInitialAnimationState:v,cleanup:x}=Yt(),{timerState:j,controls:C}=Zt({autoStart:r,onCycleEnd:e,onMeasuringComplete:n,hasError:s,onPauseAnimation:m,onErrorAnimation:g,onClearErrorAnimation:p,onStartPulsating:u});return h.useEffect(()=>{const T=l.current;l.current!==void 0&&T!==j.currentState?(T==="measured"&&b(),T==="idle"&&y(),f()):v(),j.currentState==="idle"&&S(),l.current=j.currentState},[j.currentState,b,y,S,f,v]),h.useEffect(()=>{let T=!0;const M=setTimeout(()=>{T&&t(C)},0);return()=>{T=!1,clearTimeout(M)}},[t,C]),h.useEffect(()=>x,[x]),a==="small"?o.jsx(Ut,{timerState:j,animationState:d,hasError:s,compact:i,className:c}):o.jsx(Ht,{timerState:j,animationState:d,hasError:s,className:c})})),Be=B.externalizeComponent(D.observer(({data:t,columns:e,getRowData:n,onRowClick:r,selectedItem:a,getItemId:i,title:c,showCount:s=!0,searchPlaceholder:l="Search programs",dataGridProps:d,CustomToolbar:m,selectFirstByDefault:g=!1,sx:p})=>{var E;const u=J.useTheme(),b=$.useGridApiRef(),S=h.useRef(null),[y,f]=h.useState(null),v=h.useMemo(()=>t.map(n),[t,n]);h.useEffect(()=>{b.current&&v.length>0&&b.current.autosizeColumns({includeOutliers:!0,includeHeaders:!0,expand:!0,columns:e.map(I=>I.field)})},[v,e,b]),h.useEffect(()=>{if(!S.current||!b.current)return;const I=new ResizeObserver(()=>{setTimeout(()=>{b.current&&v.length>0&&b.current.autosizeColumns({includeOutliers:!0,includeHeaders:!0,expand:!0,columns:e.map(P=>P.field)})},100)});return I.observe(S.current),()=>{I.disconnect()}},[b,v.length,e]);const x=h.useMemo(()=>{if(a!==void 0)return a;if(y!==null)return y;if(g&&t.length>0){const I=t[0];return f(I),I}return null},[g,t,a,y]),j=I=>{const P=t.find(F=>n(F).id===I.id);P&&(a===void 0&&f(P),r&&r(P,I))},C=h.useMemo(()=>!x||!i?null:i(x),[x,i]);function T(){return o.jsx($.Toolbar,{children:o.jsxs(w,{sx:{display:"flex",width:"100%",gap:1,p:.5,alignItems:"center"},children:[c&&o.jsxs(R,{variant:"h6",sx:{fontWeight:500,color:"white"},children:[c,s&&` (${t.length})`]}),o.jsxs(w,{sx:{ml:"auto",display:"flex",gap:.5,alignItems:"center",pr:1},children:[o.jsx($.FilterPanelTrigger,{render:o.jsx($.ToolbarButton,{"aria-label":"Show filters",children:o.jsx(st,{fontSize:"small"})})}),o.jsx(N,{orientation:"vertical",flexItem:!0,sx:{height:"24px",alignSelf:"center"}}),o.jsx($.QuickFilter,{render:(I,P)=>{var F;return o.jsxs(w,{...I,sx:{display:"flex",overflow:"hidden"},children:[!P.expanded&&o.jsx($.QuickFilterTrigger,{render:o.jsx($.ToolbarButton,{"aria-label":"Search",children:o.jsx(Me,{fontSize:"small"})})}),o.jsxs(w,{sx:{display:"flex",overflow:"hidden",transition:"all 0.3s ease-in-out",width:P.expanded?"200px":"0px",position:"relative"},children:[o.jsxs(w,{sx:{flex:1,position:"relative","& .MuiInputBase-root":{height:"32px",borderRadius:"16px",backgroundColor:(F=u.palette.backgroundPaperElevation)==null?void 0:F[2],paddingLeft:"40px",paddingRight:P.expanded&&P.value!==""?"40px":"12px",color:"white",fontSize:"14px",border:"none !important",outline:"none !important",boxShadow:"none !important","&::before":{display:"none !important",border:"none !important"},"&::after":{display:"none !important",border:"none !important"},"&:hover":{"&::before":{display:"none !important",border:"none !important"},"&::after":{display:"none !important",border:"none !important"}},"&:focus-within":{outline:"none !important",boxShadow:"none !important","&::before":{display:"none !important",border:"none !important"},"&::after":{display:"none !important",border:"none !important"}},"&.Mui-focused":{outline:"none !important",boxShadow:"none !important","&::before":{display:"none !important",border:"none !important"},"&::after":{display:"none !important",border:"none !important"}},"& .MuiInputBase-input":{padding:"8px 0",border:"none !important",outline:"none !important",boxShadow:"none !important","&:focus":{outline:"none !important",boxShadow:"none !important",border:"none !important"},"&::placeholder":{color:"rgba(255, 255, 255, 0.3)",opacity:1}},"& fieldset":{border:"none !important",display:"none !important"},"& .MuiOutlinedInput-notchedOutline":{border:"none !important",display:"none !important"}}},children:[P.expanded&&o.jsx(Me,{fontSize:"small",sx:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:"rgba(255, 255, 255, 0.6)",zIndex:1,pointerEvents:"none"}}),o.jsx($.QuickFilterControl,{placeholder:l})]}),P.expanded&&P.value!==""&&o.jsx($.QuickFilterClear,{render:o.jsx(w,{sx:{position:"absolute",right:"8px",top:"50%",transform:"translateY(-50%)",zIndex:1},children:o.jsx(w,{sx:{minWidth:"24px",width:"24px",height:"24px",padding:0,color:"rgba(255, 255, 255, 0.6)","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.1)"}},children:o.jsx($.ToolbarButton,{"aria-label":"Clear",children:o.jsx(at,{fontSize:"small"})})})})})]})]})}})]})]})})}const M=m||T;return o.jsx(w,{ref:S,sx:{height:"100%",display:"flex",flexDirection:"column","& *":{scrollbarWidth:"none",msOverflowStyle:"none","&::-webkit-scrollbar":{display:"none"}},"&:hover *":{scrollbarWidth:"thin",scrollbarColor:`${u.palette.divider} transparent`,"&::-webkit-scrollbar":{display:"block",width:"8px",height:"8px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:u.palette.divider,borderRadius:"4px"},"&::-webkit-scrollbar-thumb:hover":{background:u.palette.action.hover}},...p},children:o.jsx($.DataGrid,{apiRef:b,rows:v,columns:e,onRowClick:j,disableColumnMenu:!1,disableRowSelectionOnClick:!0,disableMultipleRowSelection:!0,hideFooterSelectedRowCount:!0,filterMode:"client",sortingOrder:["desc","asc"],hideFooter:!1,showToolbar:!0,slots:{toolbar:M},initialState:{sorting:{sortModel:[]},filter:{filterModel:{items:[]}},...d==null?void 0:d.initialState},...d,autosizeOnMount:!0,autosizeOptions:{...(d==null?void 0:d.autosizeOptions)||{},includeOutliers:!0,includeHeaders:!0,expand:!0,columns:((E=d==null?void 0:d.autosizeOptions)==null?void 0:E.columns)||e.map(I=>I.field)},sx:{border:"none",width:"100%","& .MuiPaper-root":{boxShadow:"none !important"},"& .MuiDataGrid-overlay":{},"& .MuiDataGrid-main":{border:"none","& .MuiPaper-root":{}},"& .MuiDataGrid-container--top [role=row]":{},"& .MuiDataGrid-topContainer":{borderBottom:"none !important"},"& .MuiDataGrid-columnHeaders":{border:"none",borderBottom:"none !important"},"& .MuiDataGrid-row":{cursor:r?"pointer":"default",border:"none",margin:"1px 0",position:"relative",backgroundColor:"transparent !important","&:hover":{backgroundColor:"transparent !important","&::before":{content:'""',position:"absolute",top:0,left:"16px",right:"16px",bottom:0,backgroundColor:"action.hover",borderRadius:"16px",zIndex:0}},"&.Mui-selected":{backgroundColor:"transparent !important","&:hover":{backgroundColor:"transparent !important"}},...C!==null&&{[`&[data-id="${C}"]`]:{backgroundColor:"transparent !important","&::before":{content:'""',position:"absolute",top:0,left:"16px",right:"16px",bottom:0,backgroundColor:`${u.palette.action.hover} !important`,borderRadius:"16px",zIndex:0},"&:hover":{backgroundColor:"transparent !important"},"&:hover::before":{backgroundColor:`${u.palette.divider} !important`}}}},"& .MuiDataGrid-cell--textLeft":{paddingLeft:"40px"},"& .MuiDataGrid-cell":{border:"none",position:"relative",zIndex:1,"&:focus":{outline:"none"},"&:focus-within":{outline:"none"},"&:hover":{backgroundColor:"transparent !important"}},"& .MuiDataGrid-columnHeader":{border:"none",paddingLeft:"40px",paddingRight:"40px","& .MuiDataGrid-columnHeaderTitle":{color:"rgba(255, 255, 255, 0.6)"}},"& .MuiDataGrid-toolbarContainer":{padding:"8px",border:"none !important",borderBottom:"none !important","& .MuiBox-root":{},"& .MuiFormControl-root":{},"& .MuiInputBase-root":{},"& .MuiPaper-root":{boxShadow:"none !important"},"& *":{borderBottom:"none !important"}},"& .MuiDataGrid-toolbar":{borderBottom:"none !important"},"& .MuiDataGrid-toolbarFilterList":{border:"none"},"& .MuiDataGrid-withBorderColor":{borderColor:"transparent !important"},"& .MuiDataGrid-columnSeparator":{display:"none"},"& .MuiDataGrid-footerContainer":{display:"none"},"& .MuiDataGrid-filler":{border:"none !important",borderTop:"none !important",borderBottom:"none !important",borderLeft:"none !important",borderRight:"none !important","--rowBorderColor":"none !important"},"& .MuiBackdrop-root":{},"& .MuiModal-backdrop":{},...d==null?void 0:d.sx}})})}));Be.displayName="WandelbotsDataGrid";const Qt=({title:t,titleId:e,...n},r)=>A.createElement("svg",{width:21,height:21,viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":e,...n},t?A.createElement("title",{id:e},t):null,A.createElement("g",{id:"JogMinus"},A.createElement("path",{id:"Minus",d:"M0 13V8H21V13H0Z",fill:"white"}))),Kt=h.forwardRef(Qt),en=({title:t,titleId:e,...n},r)=>A.createElement("svg",{width:21,height:21,viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":e,...n},t?A.createElement("title",{id:e},t):null,A.createElement("g",{id:"JogPlus"},A.createElement("g",{id:"Plus"},A.createElement("path",{d:"M0 13V8H8V13H0Z",fill:"white"}),A.createElement("path",{d:"M8 0L13 2.18557e-07L13 21H8L8 0Z",fill:"white"}),A.createElement("path",{d:"M13 13V8H21V13H13Z",fill:"white"})))),tn=h.forwardRef(en),ge=B.externalizeComponent(D.observer(({colors:t,label:e,getDisplayedValue:n,startJogging:r,stopJogging:a,disabled:i,activeJoggingDirection:c,...s})=>{var x,j,C,T,M,E,I;ee.useAnimationFrame(()=>{const P=n(),F=p.current;F&&(F.textContent=P)});const l=J.useTheme(),[d,m]=h.useState(null);h.useEffect(()=>{i&&v()},[i]);const g=c||d,p=h.useRef(null);t||(t={color:"#fff",backgroundColor:"#000",borderColor:"#000",buttonBackgroundColor:{disabled:"#000",default:"#000",hovered:"#000",pressed:"#000"},labelColor:"#000"});const u=g?(x=t.buttonBackgroundColor)==null?void 0:x.pressed:t.borderColor,b={width:"55px",color:t.color,path:{fill:t.color},alignContent:"center",fontSize:"37px",svg:{pointerEvents:"none"}},S={...b,backgroundColor:(j=t.buttonBackgroundColor)==null?void 0:j.default,":hover":{backgroundColor:(C=t.buttonBackgroundColor)==null?void 0:C.hovered},":active":{backgroundColor:(T=t.buttonBackgroundColor)==null?void 0:T.pressed,color:t.backgroundColor,path:{fill:t.backgroundColor}},":disabled":{backgroundColor:(M=t.buttonBackgroundColor)==null?void 0:M.disabled,"svg path":{fill:l.palette.action.disabled}}},y={...b,backgroundColor:(E=t.buttonBackgroundColor)==null?void 0:E.pressed,color:t.backgroundColor,path:{fill:t.backgroundColor},":disabled":{backgroundColor:(I=t.buttonBackgroundColor)==null?void 0:I.pressed,"svg path":{fill:l.palette.action.disabled}}};function f(P,F){i||P.button===0&&(m(F),r(F))}function v(){m(null),a()}return o.jsxs(_,{height:"64px",direction:"row",justifyContent:"center",...s,children:[o.jsx(G,{disabled:i,disableRipple:!0,onPointerDown:P=>f(P,"-"),onPointerUp:v,onPointerOut:v,size:"large",sx:{...g==="-"?y:S,borderRadius:"16px 0px 0px 16px",borderLeft:`2px solid ${u??"#fff"}`,borderBottom:`2px solid ${u??"#fff"}`,borderTop:`2px solid ${u??"#fff"}`},children:o.jsx(Kt,{})}),o.jsxs(_,{spacing:"6px",sx:{width:"150px",backgroundColor:t.backgroundColor,alignItems:"center",justifyContent:"center",opacity:"0.9",borderBottom:`2px solid ${u??"#fff"}`,borderTop:`2px solid ${u??"#fff"}`},children:[o.jsx(_,{height:"22px",direction:"row",alignItems:"center",justifyItems:"center",spacing:1,sx:{userSelect:"none",color:t.color,".MuiTypography-root":{fontWeight:700,...i?{color:l.palette.action.disabled}:{}},...i?{"svg path":{fill:l.palette.action.disabled}}:{}},children:e}),o.jsx(R,{height:"22px",sx:{fontSize:"15px",color:i?l.palette.action.disabled:t.color,fontWeight:700,fontVariantNumeric:"tabular-nums",minWidth:"80px",textAlign:"center"},ref:p,children:n()})]}),o.jsx(G,{disableRipple:!0,disabled:i,onPointerDown:P=>f(P,"+"),onPointerUp:v,onPointerOut:v,size:"large",sx:{...g==="+"?y:S,borderRadius:"0px 16px 16px 0px",borderRight:`2px solid ${u??"#fff"}`,borderBottom:`2px solid ${u??"#fff"}`,borderTop:`2px solid ${u??"#fff"}`},children:o.jsx(tn,{})})]})})),ze=B.externalizeComponent(D.observer(({startJogging:t,stopJogging:e,lowerLimit:n,upperLimit:r,useDegree:a,getValue:i,disabled:c,...s})=>{var T,M,E,I,P,F,Z,ne,ye,Se,ve,Ce,je,we,Te;const{t:l}=z.useTranslation(),[d,m]=h.useState(),g=J.useTheme(),p={background:(T=g.palette.backgroundPaperElevation)==null?void 0:T[4],color:(M=g.palette.backgroundPaperElevation)==null?void 0:M[11]},u=D.useLocalObservable(()=>({activeJoggingDir:null,startJogging(O){this.activeJoggingDir=O,t(O)},stopJogging(){this.activeJoggingDir=null,e()}})),b=wt(()=>{const O=a?S(i()):i();(O===void 0||d===void 0||Math.abs(d-O)>1e-9)&&m(O)},50);ee.useAnimationFrame(b);function S(O){if(O!==void 0)return L.radiansToDegrees(O)}function y(O){O.button===0&&u.startJogging("-")}function f(O){O.button===0&&u.startJogging("+")}function v(O){u.stopJogging()}function x(O){u.stopJogging()}function j(O,X=1){if(O===void 0||Number.isNaN(O))return"";const Q=l("General.degree.variable",{amount:O.toFixed(X)});return O>0&&X===0?`+${Q}`:Q}function C(O,X=1){if(O===void 0||Number.isNaN(O))return"";const Q=l("General.mm.variable",{amount:O.toFixed(X)});return O>0&&X===0?`+${Q}`:Q}return o.jsxs(_,{height:"64px",width:"100%",maxWidth:"260px",direction:"row",...s,sx:{"& .MuiIconButton-root":{width:"52px",color:g.palette.text.primary,alignContent:"center",backgroundColor:(E=g.palette.backgroundPaperElevation)==null?void 0:E[11],"& svg":{width:"42px",height:"42px"},"&.Mui-disabled":{backgroundColor:(I=g.palette.backgroundPaperElevation)==null?void 0:I[11],color:g.palette.action.disabled,opacity:1},"&:hover":{backgroundColor:(P=g.palette.backgroundPaperElevation)==null?void 0:P[9]},"&:active":{...p}}},children:[o.jsx(G,{onPointerDown:y,onPointerUp:v,onPointerOut:x,disabled:c,disableRipple:!0,sx:{borderRadius:"16px 0px 0px 16px",...u.activeJoggingDir==="-"?p:{}},children:o.jsx(Ct,{sx:{pointerEvents:"none",color:(ye=(ne=(Z=(F=g.componentsExt)==null?void 0:F.JoggingPanel)==null?void 0:Z.JoggingJoint)==null?void 0:ne.Joint)==null?void 0:ye.arrowColor}})}),o.jsxs(_,{flexGrow:1,alignItems:"center",justifyContent:"center",sx:{borderStyle:"solid",borderLeftWidth:0,borderRightWidth:0,border:"none",backgroundColor:(Se=g.palette.backgroundPaperElevation)==null?void 0:Se[11],paddingLeft:"20px",paddingRight:"20px",zIndex:1},children:[o.jsx(R,{sx:{fontSize:"15px",fontWeight:700,position:"relative",top:"5px",fontVariantNumeric:"tabular-nums",minWidth:"80px",textAlign:"center",color:c?g.palette.action.disabled:g.palette.text.primary},children:a?j(d):C(d)}),o.jsx(Le,{disabled:!0,"aria-label":"Joint position",min:a?S(n):n,max:a?S(r):r,value:d||0,track:!1,sx:{"& .MuiSlider-mark":{display:"none"},"& .MuiSlider-thumb":{width:"5px",height:"12px",borderRadius:"2px",color:c?g.palette.action.disabled:g.palette.text.primary},"& .MuiSlider-markLabel":{top:"20px",fontSize:"12px",color:c?g.palette.action.disabled:g.palette.text.secondary},"& .MuiSlider-rail":{backgroundColor:(ve=g.palette.backgroundPaperElevation)==null?void 0:ve[5],opacity:1}},marks:n!==void 0&&r!==void 0&&[{value:a?S(n):n,label:a?j(S(n),0):C(n)},{value:a?S(r):r,label:a?j(S(r),0):C(r)}]})]}),o.jsx(G,{onPointerDown:f,onPointerUp:v,onPointerOut:x,disabled:c,disableRipple:!0,sx:{borderRadius:"0px 16px 16px 0px",...u.activeJoggingDir==="+"?p:{}},children:o.jsx(jt,{sx:{pointerEvents:"none",color:(Te=(we=(je=(Ce=g.componentsExt)==null?void 0:Ce.JoggingPanel)==null?void 0:je.JoggingJoint)==null?void 0:we.Joint)==null?void 0:Te.arrowColor}})})]})}));function me(t,e,n){if(e.length!==t.length)return!0;for(let r=0;r<e.length;r++)if(Math.abs(e[r]-t[r])>n)return!1;return!0}function $e(t,e,n){if(t===void 0&&e||t&&e===void 0||(t==null?void 0:t.orientation)===void 0||(e==null?void 0:e.orientation)===void 0||(t==null?void 0:t.position)===void 0||(e==null?void 0:e.position)===void 0)return!1;if(t===void 0||e===void 0)return!0;let r=0;return r+=Math.abs(t.orientation[0]-e.orientation[0]),r+=Math.abs(t.orientation[1]-e.orientation[1]),r+=Math.abs(t.orientation[2]-e.orientation[2]),r+=Math.abs(t.position[0]-e.position[0]),r+=Math.abs(t.position[1]-e.position[1]),r+=Math.abs(t.position[2]-e.position[2]),r<=n}function fe(t,e,n){return t.coordinate_system===e.coordinate_system&&t.tcp===e.tcp&&$e(t.tcp_pose,e.tcp_pose,n)}function Ve(t,e){const n=new ue.Vector3(e[0],e[1],e[2]),r=new ue.Vector3(t[0],t[1],t[2]),a=n.length(),i=n.normalize();let c=r.length(),s=r.normalize();s.dot(i)<0&&(c=-c,s=s.multiplyScalar(-1));let l=c-a;return l-=2*Math.PI*Math.floor((l+Math.PI)/(2*Math.PI)),c=a+l,[...s.multiplyScalar(c)]}function nn(t){return"cellId"in t.api}function re(t){if(!nn(t))return t;const e=t,n=e.api.cellId,r=new Proxy(e.api,{get(a,i){const c=Reflect.get(a,i);return!c||typeof c!="object"?c:new Proxy(c,{get(s,l){const d=Reflect.get(s,l);return typeof d!="function"?d:(...m)=>m.length>0&&m[0]===n?d.apply(s,m.slice(1)):d.apply(s,m)}})}});return new Proxy(e,{get(a,i){return i==="api"?r:i==="openReconnectingWebsocket"?c=>a.openReconnectingWebsocket(c.replace(/^\/cells\/[^/]+/,"")):Reflect.get(a,i)}})}const Re=1e-4;class se{constructor(e,n,r,a,i,c,s="cell"){this.controller=n,this.motionGroup=r,this.description=a,this.initialMotionState=i,this.motionStateSocket=c,this.cellId=s,this.nova=re(e),this.rapidlyChangingMotionState=i,c.addEventListener("message",l=>{var p;const d=(p=L.tryParseJson(l.data))==null?void 0:p.result;if(!d)throw new Error(`Failed to get motion state for ${this.motionGroupId}: ${l.data}`);me(this.rapidlyChangingMotionState.joint_position,d.joint_position,Re)||k.runInAction(()=>{this.rapidlyChangingMotionState.joint_position=d.joint_position}),fe(this.rapidlyChangingMotionState,d,Re)||k.runInAction(()=>{var u,b,S;this.rapidlyChangingMotionState.tcp_pose==null?this.rapidlyChangingMotionState.tcp_pose=d.tcp_pose:(u=d.tcp_pose)!=null&&u.orientation&&((b=d.tcp_pose)!=null&&b.position)&&((S=this.rapidlyChangingMotionState.tcp_pose)!=null&&S.orientation)?this.rapidlyChangingMotionState.tcp_pose={position:d.tcp_pose.position,orientation:Ve(d.tcp_pose.orientation,this.rapidlyChangingMotionState.tcp_pose.orientation)}:console.warn("Received incomplete tcp_pose, ignoring",d.tcp_pose)}),d.tcp!==void 0&&this.rapidlyChangingMotionState.tcp!==d.tcp&&k.runInAction(()=>{this.rapidlyChangingMotionState.tcp=d.tcp}),this.rapidlyChangingMotionState.standstill!==d.standstill&&k.runInAction(()=>{this.rapidlyChangingMotionState.standstill=d.standstill});const m=this.rapidlyChangingMotionState.joint_limit_reached.limit_reached,g=d.joint_limit_reached.limit_reached;m.some((u,b)=>u!==g[b])&&k.runInAction(()=>{this.rapidlyChangingMotionState.joint_limit_reached=d.joint_limit_reached}),this.rapidlyChangingMotionState.execute!==d.execute&&k.runInAction(()=>{this.rapidlyChangingMotionState.execute=d.execute})}),k.makeAutoObservable(this)}static async open(e,n,r={}){var b;const a=re(e),i=r.cellId??"cell",[c,s]=n.split("@"),l=await a.api.controller.getCurrentRobotControllerState(i,s),d=l==null?void 0:l.motion_groups.find(S=>S.motion_group===n);if(!l||!d)throw new Error(`Controller ${s} or motion group ${n} not found`);const m=a.openReconnectingWebsocket(`/cells/${i}/controllers/${s}/motion-groups/${n}/state-stream`),g=await m.firstMessage(),p=(b=L.tryParseJson(g.data))==null?void 0:b.result;if(!p)throw new Error(`Unable to parse initial motion state message ${g.data}`);console.log(`Connected motion state websocket to motion group ${d.motion_group}. Initial state:
|
|
2
|
+
`,p);const u=await a.api.motionGroup.getMotionGroupDescription(i,s,d.motion_group);return new se(a,l,d,u,p,m,i)}get motionGroupId(){return this.motionGroup.motion_group}get controllerId(){return this.controller.controller}get joints(){return this.initialMotionState.joint_position.map((e,n)=>({index:n}))}dispose(){this.motionStateSocket.close()}}const Ee="Movement request rejected. Another client is currently executing a 'Jogging' motion!";class le{constructor(e,n={}){this.motionStream=e,this.options=n,this.DEFAULT_MODE="off",this.DEFAULT_TCP="Flange",this.NO_TCP=void 0,this.DEFAULT_INIT_TIMEOUT=5e3,this.DEFAULT_ORIENTATION="coordsys",this.mode="off",this.joggingSocket=null,this.trajectorySocket=null,this.timeout=this.DEFAULT_INIT_TIMEOUT,this.tcp=(n==null?void 0:n.tcp)||e.motionGroup.tcp||this.getDefaultTcp(e),this.orientation=(n==null?void 0:n.orientation)||this.DEFAULT_ORIENTATION,this.timeout=(n==null?void 0:n.timeout)||this.DEFAULT_INIT_TIMEOUT,this.mode=(n==null?void 0:n.mode)||this.DEFAULT_MODE,this.onError=n==null?void 0:n.onError}static async open(e,n,r={}){const a=await se.open(e,n,{cellId:r.cellId}),i=new le(a,r);return await i.setJoggingMode(i.mode),i}getDefaultTcp(e){var r,a;const n=(a=(r=e.description.dh_parameters)==null?void 0:r[0])==null?void 0:a.type;return e.joints.length<6&&(n===q.JointTypeEnum.RevoluteJoint||n===q.JointTypeEnum.PrismaticJoint)?this.NO_TCP:this.DEFAULT_TCP}async setOptions(e){e.tcp&&(this.tcp=e.tcp),e.orientation&&(this.orientation=e.orientation),e.timeout&&(this.timeout=e.timeout),e.mode&&(this.mode=e.mode),e.onError&&(this.onError=e.onError),this.setJoggingMode(this.mode,!1)}get motionGroupId(){return this.motionStream.motionGroupId}get nova(){return this.motionStream.nova}get cellId(){return this.motionStream.cellId}get numJoints(){return this.motionStream.joints.length}async stop(){if(this.joggingSocket){const e=new Array(this.numJoints).fill(0);this.joggingSocket.sendJson({message_type:"JointVelocityRequest",velocity:e})}this.trajectorySocket&&this.trajectorySocket.sendJson({message_type:"PauseMovementRequest"})}async dispose(){const e=[this.joggingSocket,this.trajectorySocket].filter(n=>n!==null);return e.forEach(n=>{n.dispose()}),this.joggingSocket=null,this.trajectorySocket=null,Promise.all(e.map(n=>n.closed()))}async setJoggingMode(e,n=!0){if(!(this.mode===e&&n)&&(this.dispose(),this.mode=e,this.mode==="jogging"))return this.initializeJoggingWebsocket()}async initializeJoggingWebsocket(){return new Promise((e,n)=>{const r=setTimeout(()=>{n(new Error(`Jogging initialization timeout after ${this.timeout} seconds`))},this.timeout);this.joggingSocket=this.nova.openReconnectingWebsocket(`/cells/${this.cellId}/controllers/${this.motionStream.controllerId}/execution/jogging`),this.joggingSocket.addEventListener("message",a=>{var c,s,l,d;const i=L.tryParseJson(a.data);if(((c=i==null?void 0:i.result)==null?void 0:c.kind)==="INITIALIZE_RECEIVED"){clearTimeout(r),e();return}if(((s=i==null?void 0:i.result)==null?void 0:s.kind)==="MOTION_ERROR")if(clearTimeout(r),this.onBlocked&&((l=i==null?void 0:i.result)!=null&&l.message.includes(Ee))){(d=this.joggingSocket)==null||d.dispose(),this.onBlocked();return}else this.onError?this.onError(a.data):n(new Error(a.data))}),this.joggingSocket.sendJson({message_type:"InitializeJoggingRequest",motion_group:this.motionGroupId,...this.tcp?{tcp:this.tcp}:{}})})}async rotateJoints({joint:e,direction:n,velocityValue:r,velocityUnit:a}){if(!this.joggingSocket||this.mode!=="jogging")throw new Error("Joint jogging websocket not connected; create one by setting jogging mode to 'jogging'");const i=new Array(this.numJoints).fill(0);i[e]=n==="-"?-r:r,this.joggingSocket.sendJson({message_type:"JointVelocityRequest",velocity:i})}async translateTCP({axis:e,direction:n,velocityMmPerSec:r}){if(!this.joggingSocket||this.mode!=="jogging")throw new Error("Continuous jogging websocket not connected; create one by setting jogging mode to 'jogging'");const a=[0,0,0],i=[0,0,0];i[L.XYZ_TO_VECTOR[e]]=n==="-"?-r:r,this.joggingSocket.sendJson({message_type:"TcpVelocityRequest",translation:i,rotation:a,use_tool_coordinate_system:this.orientation==="tool"})}async rotateTCP({axis:e,direction:n,velocityRadsPerSec:r}){if(!this.joggingSocket||this.mode!=="jogging")throw new Error("Continuous jogging websocket not connected; create one by setting jogging mode to 'jogging'");const a=[0,0,0],i=[0,0,0];a[L.XYZ_TO_VECTOR[e]]=n==="-"?-r:r,this.joggingSocket.sendJson({message_type:"TcpVelocityRequest",translation:i,rotation:a,use_tool_coordinate_system:this.orientation==="tool"})}async runIncrementalCartesianMotion({currentTcpPose:e,currentJoints:n,velocityInRelevantUnits:r,axis:a,direction:i,motion:c}){const s=[];if(this.mode!=="trajectory")throw new Error("Set jogging mode to 'trajectory' to run incremental cartesian motions");if(c.type==="translate"){if(!e.position)throw new Error("Current pose has no position, cannot perform translation");const y=[...e.position];y[L.XYZ_TO_VECTOR[a]]+=c.distanceMm*(i==="-"?-1:1),s.push({limits_override:{tcp_velocity_limit:r},path:{path_definition_name:"PathLine",target_pose:{position:y,orientation:e.orientation}}})}else if(c.type==="rotate"){if(!e.orientation)throw new Error("Current pose has no orientation, cannot perform rotation");const y=new de.Vector3(e.orientation[0],e.orientation[1],e.orientation[2]),f=y.length(),v=y.clone().normalize(),x=c.distanceRads*(i==="-"?-1:1),j=new de.Vector3(0,0,0);j[a]=1;const C=Math.cos(.5*x)*Math.cos(.5*f),T=Math.sin(.5*x)*Math.sin(.5*f),M=Math.sin(.5*x)*Math.cos(.5*f),E=Math.cos(.5*x)*Math.sin(.5*f),I=j.dot(v),P=j.clone().cross(v),F=2*Math.acos(C-T*I),Z=F/Math.sin(.5*F),ne=new de.Vector3().addScaledVector(P,T).addScaledVector(j,M).addScaledVector(v,E).multiplyScalar(Z);s.push({limits_override:{tcp_orientation_velocity_limit:r},path:{path_definition_name:"PathLine",target_pose:{position:e.position,orientation:[...ne]}}})}const l=this.motionStream.description;if(l.cycle_time===void 0){console.warn("Current motion group has no cycle time, cannot plan jogging motion");return}const d={motion_group_model:l.motion_group_model,cycle_time:l.cycle_time,mounting:l.mounting,global:l.operation_limits.auto_limits},m=await this.nova.api.trajectoryPlanning.planTrajectory(this.cellId,{motion_group_setup:d,start_joint_position:n,motion_commands:s}),g=m.response;if(!g)throw new Error(`Failed to plan jogging increment motion ${JSON.stringify(m)}`);this.trajectorySocket&&(console.warn("Trajectory jogging websocket already open; will close"),this.trajectorySocket.dispose()),this.trajectorySocket=this.nova.openReconnectingWebsocket(`/cells/${this.cellId}/controllers/${this.motionStream.controllerId}/execution/trajectory`);const p=y=>{var f;if(!y||y.add_trajectory_error||y.message)if(this.onError)this.onError(y);else throw new Error(((f=y==null?void 0:y.add_trajectory_error)==null?void 0:f.message)||(y==null?void 0:y.message)||"Failed to execute trajectory, unknown error");if(!this.trajectorySocket)throw new Error("Failed to execute trajectory, websocket not available anymore");this.trajectorySocket.sendJson({message_type:"StartMovementRequest",direction:"DIRECTION_FORWARD"})},u=async()=>{var y;await k.when(()=>!this.motionStream.rapidlyChangingMotionState.standstill),await k.when(()=>this.motionStream.rapidlyChangingMotionState.standstill),(y=this.trajectorySocket)==null||y.dispose(),this.trajectorySocket=null},b=async()=>{var y;await k.when(()=>this.motionStream.rapidlyChangingMotionState.standstill),(y=this.trajectorySocket)==null||y.dispose(),this.trajectorySocket=null},S=async y=>{if(y!=null&&y.message)if(this.onError){this.onError(y);return}else throw new Error(y.message||"Failed to execute trajectory, unknown error");this.motionStream.rapidlyChangingMotionState.standstill?await u():await b()};this.trajectorySocket.addEventListener("message",y=>{var v,x;const f=L.tryParseJson(y.data);if(!((v=f==null?void 0:f.result)!=null&&v.kind))throw new Error(`Failed to execute trajectory: Received invalid message ${y.data}`);if(this.onBlocked&&((x=f.result.message)!=null&&x.includes(Ee))){this.onBlocked();return}if(f.result.kind==="INITIALIZE_RECEIVED")p(f.result);else if(f.result.kind==="START_RECEIVED")S(f);else if(f.result.kind!=="PAUSE_RECEIVED")if(f.result.kind==="MOTION_ERROR"&&f.result.message)if(this.onError){this.onError(f);return}else throw new Error(f.result.message);else throw new Error(`Failed to execute trajectory, cannot handle message type "${f.result.kind}"`)}),this.trajectorySocket.sendJson({message_type:"InitializeMovementRequest",trajectory:{message_type:"TrajectoryData",motion_group:this.motionGroupId,data:g,tcp:this.tcp}})}}const qe=t=>{const e=t.softTimeout||3e3,[n,r]=h.useState(!1),a=J.useTheme();return h.useEffect(()=>{const i=setTimeout(()=>{r(!0)},e);return()=>clearTimeout(i)}),o.jsx(_,{width:"100%",height:"100%",alignItems:"center",justifyContent:"center",sx:{color:a.palette.text.primary},children:t.error?o.jsx(Ne,{loadingMessage:t.message,error:t.error}):o.jsxs(o.Fragment,{children:[o.jsx(Je,{sx:{marginBottom:"24px"}}),!!t.message&&o.jsx("div",{children:t.message}),o.jsx(_,{sx:{visibility:n?"visible":"hidden",marginTop:"1rem",color:a.palette.text.secondary},children:"This is taking longer than expected..."})]})})},Ne=t=>{const e=ut.makeErrorMessage(t.error),n=t.error instanceof Error?t.error.stack:null,r=J.useTheme();return o.jsxs(_,{sx:{maxHeight:"100%",maxWidth:"min(100%, 800px)",padding:2,overflow:"auto",color:r.palette.error.main,"& pre":{whiteSpace:"pre-wrap",wordBreak:"break-word",paddingBottom:"3rem"}},children:[(t.loadingMessage?`Error while ${he.lowerFirst(dt.capitalize(t.loadingMessage))} - `:"")+e,o.jsx("br",{}),n&&o.jsx("pre",{children:n})]})},on=D.observer(({store:t})=>{const{t:e}=z.useTranslation();return o.jsx(Ae,{"data-testid":"jogging-blocked","aria-label":"jogging-blocked",open:!0,sx:{position:"absolute",zIndex:n=>n.zIndex.drawer+1,color:"#fff",background:"rgba(15, 15, 15, 0.88)",justifyContent:"flex-start",alignItems:"flex-start"},children:o.jsxs(_,{sx:{m:2,width:"100%"},children:[o.jsxs(gt,{severity:"error",sx:{mb:2},children:[o.jsx(pt,{children:e("Jogging.Blocked.ti")}),e("Jogging.Blocked.lb")]}),o.jsx(Y,{variant:"contained",color:"secondary",onClick:()=>t.unblock(),children:e("Jogging.Blocked.Reenable.bt")})]})})}),rn=({title:t,titleId:e,...n},r)=>A.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:19,height:10,fill:"none",ref:r,"aria-labelledby":e,...n},t?A.createElement("title",{id:e},t):null,A.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M5.131.312a.9.9 0 0 1 0 1.272L3.07 3.645h12.44l-2.06-2.061A.9.9 0 0 1 14.72.313l3.596 3.596a.9.9 0 0 1 0 1.271l-3.596 3.597a.9.9 0 0 1-1.271-1.272l2.061-2.062H3.07L5.13 7.505A.9.9 0 0 1 3.86 8.777L.263 5.18a.9.9 0 0 1 0-1.271L3.86.312a.9.9 0 0 1 1.271 0",clipRule:"evenodd"})),an=h.forwardRef(rn),sn=({title:t,titleId:e,...n},r)=>A.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:19,height:10,fill:"none",ref:r,"aria-labelledby":e,...n},t?A.createElement("title",{id:e},t):null,A.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M5.131.312a.9.9 0 0 1 0 1.272L3.07 3.645h12.44l-2.06-2.061A.9.9 0 0 1 14.72.313l3.596 3.596a.9.9 0 0 1 0 1.271l-3.596 3.597a.9.9 0 0 1-1.271-1.272l2.061-2.062H3.07L5.13 7.505A.9.9 0 0 1 3.86 8.777L.263 5.18a.9.9 0 0 1 0-1.271L3.86.312a.9.9 0 0 1 1.271 0",clipRule:"evenodd"})),ln=h.forwardRef(sn),cn=({title:t,titleId:e,...n},r)=>A.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:10,height:19,fill:"none",ref:r,"aria-labelledby":e,...n},t?A.createElement("title",{id:e},t):null,A.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M9.522 14.811A.899.899 0 1 0 8.25 13.54L6.19 15.601V3.16L8.25 5.221A.9.9 0 0 0 9.522 3.95L5.926.354a.9.9 0 0 0-1.272 0L1.058 3.95a.9.9 0 1 0 1.271 1.271L4.391 3.16v12.442L2.329 13.54a.899.899 0 1 0-1.271 1.271l3.596 3.597a.9.9 0 0 0 1.272 0z",clipRule:"evenodd"})),dn=h.forwardRef(cn),un=({title:t,titleId:e,...n},r)=>A.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":e,...n},t?A.createElement("title",{id:e},t):null,A.createElement("path",{d:"M8 16C5.76667 16 3.875 15.225 2.325 13.675C0.775 12.125 0 10.2333 0 8C0 5.76667 0.775 3.875 2.325 2.325C3.875 0.775 5.76667 0 8 0C9.15 0 10.25 0.2375 11.3 0.7125C12.35 1.1875 13.25 1.86667 14 2.75V0H16V7H9V5H13.2C12.6667 4.06667 11.9375 3.33333 11.0125 2.8C10.0875 2.26667 9.08333 2 8 2C6.33333 2 4.91667 2.58333 3.75 3.75C2.58333 4.91667 2 6.33333 2 8C2 9.66667 2.58333 11.0833 3.75 12.25C4.91667 13.4167 6.33333 14 8 14C9.28333 14 10.4417 13.6333 11.475 12.9C11.0583 14.1 12.5083 12.1667 11.475 12.9L12.9 14.325C11.4667 15.4417 9.83333 16 8 16Z",fill:"white"})),gn=h.forwardRef(un),We=D.observer(({store:t})=>{const{t:e}=z.useTranslation(),[n,r]=h.useState(t.jogger.motionStream.rapidlyChangingMotionState.joint_limit_reached.limit_reached),a=h.useRef(n);ee.useAnimationFrame(()=>{const c=t.jogger.motionStream.rapidlyChangingMotionState.joint_limit_reached.limit_reached;ht(a.current,c)||(a.current=c,r(c))});const i=[];for(const[c,s]of n.entries())s&&i.push(c);return o.jsx(w,{sx:{display:"flex",flexDirection:"row",justifyContent:"center"},children:o.jsx(R,{"data-testid":"jogging-joint-limit-detector","aria-label":"jogging-joint-limit-detector",color:"error",variant:"body2",sx:{fontSize:"0.75rem",lineHeight:1.2,visibility:i.length?"visible":"hidden"},children:e("Jogging.JointLimitsReached.lb",{jointNumbers:i.map(c=>c+1).join(", ")})})})}),pn=J.styled(ft)(({theme:t})=>({"&.MuiFormControl-root":{".MuiSelect-select":{paddingTop:"20px",paddingLeft:"12px"},label:{pointerEvents:"none",fontSize:"16px"},".MuiInputLabel-root":{"&.Mui-focused":{color:t.palette.text.primary}}}}));function ie({labelValue:t,...e}){return o.jsxs(pn,{fullWidth:!0,variant:"filled",children:[o.jsx(xt,{id:e.labelId,children:t}),o.jsx(bt,{...e})]})}const pe=[{id:"0.1",mm:.1,degrees:.05},{id:"1",mm:1,degrees:.5},{id:"5",mm:5,degrees:2.5},{id:"10",mm:10,degrees:5}],hn=[{id:"continuous"},...pe],mn=["coordsys","tool"];class ce{constructor(e,n,r,a,i){var c,s,l;this.jogger=e,this.coordSystems=n,this.motionGroupDescription=r,this.tcps=a,this.inverseSolverValue=i,this.selectedTabId="cartesian",this.locks=new Set,this.blocked=!1,this.selectedCoordSystemId="world",this.selectedTcpId="",this.tcpChangeInProgress=!1,this.selectedOrientation="coordsys",this.selectedIncrementId="continuous",this.selectedCartesianMotionType="translate",this.incrementJogInProgress=null,this.translationVelocityMmPerSec=10,this.rotationVelocityDegPerSec=1,this.minTranslationVelocityMmPerSec=5,this.maxTranslationVelocityMmPerSec=250,this.minRotationVelocityDegPerSec=1,this.maxRotationVelocityDegPerSec=60,this.showCoordSystemSelect=!1,this.showTcpSelect=!0,this.showOrientationSelect=!0,this.showIncrementSelect=!0,this.showTabIcons=!1,this.showVelocitySliderLabel=!0,this.showVelocityLegend=!1,this.showJointsLegend=!1,this.disposers=[],this.inverseSolver=void 0,this.jointType=q.JointTypeEnum.RevoluteJoint;for(const d of n)if(d.coordinate_system===""){d.coordinate_system="world";break}this.selectedCoordSystemId=((c=n[0])==null?void 0:c.coordinate_system)||"world",this.selectedTcpId=e.motionStream.rapidlyChangingMotionState.tcp??"",this.tcpChangeInProgress=this.tcps.length>0&&!this.selectedTcpId,this.inverseSolver=i,this.jointType=((l=(s=r==null?void 0:r.dh_parameters)==null?void 0:s[0])==null?void 0:l.type)??q.JointTypeEnum.RevoluteJoint,k.makeAutoObservable(this,{},{autoBind:!0}),this.jogger.onBlocked=()=>{this.block()},this.loadFromLocalStorage(),this.disposers.push(k.autorun(()=>this.saveToLocalStorage())),this.disposers.push(k.autorun(()=>{const d=this.jogger.motionStream.rapidlyChangingMotionState.tcp;d&&d!==this.selectedTcpId&&k.runInAction(()=>{this.selectedTcpId=d,this.tcpChangeInProgress=!1})})),window.joggingStore=this}static async loadFor(e){const{nova:n,cellId:r}=e,[a,i]=await Promise.all([n.api.controller.listCoordinateSystems(r,e.motionStream.controllerId,"ROTATION_VECTOR"),n.api.motionGroup.getMotionGroupDescription(r,e.motionStream.controllerId,e.motionGroupId)]),c=await n.api.motionGroupModels.getMotionGroupKinematicModel(i.motion_group_model),s=Object.entries(i.tcps||{}).map(([l,d])=>({id:l,readable_name:d.name,position:d.pose.position,orientation:d.pose.orientation}));return new ce(e,a||[],i,s,c.inverse_solver)}dispose(){for(const e of this.disposers)e();this.jogger.dispose()}get coordSystemCountByName(){return he.countBy(this.coordSystems,e=>e.name)}async deactivate(){this.jogger.mode==="jogging"&&await this.jogger.setJoggingMode("off")}async activate(){return this.currentTab.id==="cartesian"?((this.jogger.tcp!==this.selectedTcpId||this.jogger.orientation!==this.selectedOrientation)&&await this.jogger.setOptions({tcp:this.selectedTcpId||void 0,orientation:this.selectedOrientation}),this.activeDiscreteIncrement?this.jogger.setJoggingMode("trajectory"):this.jogger.setJoggingMode("jogging")):this.jogger.setJoggingMode("jogging"),this.jogger}loadFromLocalStorage(){const e=L.tryParseJson(localStorage.getItem("joggingToolStore"));e&&(this.tabsById[e.selectedTabId]&&(this.selectedTabId=e.selectedTabId),this.coordSystemsById[e.selectedCoordSystemId]&&(this.selectedCoordSystemId=e.selectedCoordSystemId),this.incrementOptionsById[e.selectedIncrementId]&&(this.selectedIncrementId=e.selectedIncrementId),["translate","rotate"].includes(e.selectedCartesianMotionType)&&(this.selectedCartesianMotionType=e.selectedCartesianMotionType),["coordsys","tool"].includes(e.selectedOrientation)&&(this.selectedOrientation=e.selectedOrientation))}saveToLocalStorage(){localStorage.setItem("joggingToolStore",JSON.stringify(this.localStorageSave))}get isLocked(){return this.locks.size>0}get localStorageSave(){return{selectedTabId:this.selectedTabId,selectedCoordSystemId:this.selectedCoordSystemId,selectedOrientation:this.selectedOrientation,selectedIncrementId:this.selectedIncrementId,selectedCartesianMotionType:this.selectedCartesianMotionType}}get tabs(){const e=[{id:"joint",label:"Joints"}];return this.inverseSolver!==null&&e.unshift({id:"cartesian",label:"Cartesian"}),e}get incrementOptions(){return hn}get discreteIncrementOptions(){return pe}get incrementOptionsById(){return oe(this.incrementOptions,e=>e.id)}get tabsById(){return oe(this.tabs,e=>e.id)}get currentTab(){return this.tabsById[this.selectedTabId]||this.tabs[0]}get tabIndex(){return this.tabs.indexOf(this.currentTab)}get coordSystemsById(){return oe(this.coordSystems,e=>e.coordinate_system)}get activeCoordSystemId(){return this.selectedOrientation==="tool"?"tool":this.selectedCoordSystemId}get tcpsById(){return oe(this.tcps,e=>e.id)}get activeDiscreteIncrement(){return this.selectedOrientation==="tool"?void 0:pe.find(e=>e.id===this.selectedIncrementId)}get rotationVelocityRadsPerSec(){return this.rotationVelocityDegPerSec*Math.PI/180}velocityInDisplayUnits(e){return e?this.rotationVelocityDegPerSec:this.translationVelocityMmPerSec}minVelocityInDisplayUnits(e){return e?this.minRotationVelocityDegPerSec:this.minTranslationVelocityMmPerSec}maxVelocityInDisplayUnits(e){return e?this.maxRotationVelocityDegPerSec:this.maxTranslationVelocityMmPerSec}onTabChange(e,n){const r=this.tabs[n]||this.tabs[0];this.selectedTabId=r.id}setSelectedCoordSystemId(e){this.selectedCoordSystemId=e}setSelectedTcpId(e){this.requestTcpChange(e).catch(n=>{console.error("Failed to change TCP:",n)})}async requestTcpChange(e){if(e===this.selectedTcpId)return;this.tcpChangeInProgress=!0;const n=this.jogger.tcp,r=this.jogger.mode!=="jogging";try{this.jogger.tcp=e,r?await this.jogger.setJoggingMode("jogging"):await this.jogger.setJoggingMode("jogging",!1);let a=await this.waitForTcpConfirmation(e,1e3);r&&await this.jogger.setJoggingMode("off"),a||(a=await this.waitForTcpConfirmation(e,2e3)),k.runInAction(()=>{a?this.selectedTcpId=e:(this.jogger.tcp=n,this.selectedTcpId=this.jogger.motionStream.rapidlyChangingMotionState.tcp??"")})}catch(a){throw r&&await this.jogger.setJoggingMode("off").catch(()=>{}),k.runInAction(()=>{this.jogger.tcp=n,this.selectedTcpId=this.jogger.motionStream.rapidlyChangingMotionState.tcp??""}),a}finally{k.runInAction(()=>{this.tcpChangeInProgress=!1})}}waitForTcpConfirmation(e,n){return new Promise(r=>{const a=setTimeout(()=>{i(),r(!1)},n),i=k.when(()=>this.jogger.motionStream.rapidlyChangingMotionState.tcp===e,()=>{clearTimeout(a),r(!0)})})}setSelectedOrientation(e){this.selectedOrientation=e}setSelectedIncrementId(e){this.selectedIncrementId=e}setCurrentIncrementJog(e){this.incrementJogInProgress=e}setVelocityFromSlider(e,n){n?this.rotationVelocityDegPerSec=e:this.translationVelocityMmPerSec=e}setSelectedCartesianMotionType(e){this.selectedCartesianMotionType=e}lock(e){this.locks.add(e)}unlock(e){this.locks.delete(e)}block(){this.blocked=!0}unblock(){this.blocked=!1,this.jogger.mode==="jogging"&&this.jogger.initializeJoggingWebsocket()}async withMotionLock(e){const n=yt();this.lock(n);try{return await e()}finally{this.unlock(n)}}}const fn=D.observer(({store:t,useDegree:e})=>{var c;const{t:n}=z.useTranslation(),r=h.useId(),a=[];function i(s){switch(s){case"coordsys":return n("Jogging.Orientation.coordsys");case"tool":return n("Jogging.Orientation.tool");default:return s}}return t.showCoordSystemSelect&&a.push(o.jsx(ie,{labelId:`jogging-coord-select-${r}`,labelValue:n("Jogging.CoordinateSystem.hlb"),value:t.selectedCoordSystemId,size:"small",variant:"filled",displayEmpty:!0,onChange:s=>t.setSelectedCoordSystemId(s.target.value),children:t.coordSystems.map(s=>o.jsx(U,{value:s.coordinate_system,children:s.name&&t.coordSystemCountByName[s.name]>1?`${s.name} / ${s.coordinate_system}`:s.name||s.coordinate_system},s.coordinate_system))},"coord")),t.showTcpSelect&&a.push(o.jsx(ie,{labelId:`jogging-tcp-select-${r}`,labelValue:"TCP",value:t.selectedTcpId,size:"small",variant:"filled",displayEmpty:t.tcpChangeInProgress,onChange:s=>{t.requestTcpChange(s.target.value).catch(l=>{console.error("Failed to change TCP:",l)})},disabled:t.tcpChangeInProgress,endAdornment:t.tcpChangeInProgress?o.jsx(mt,{position:"end",children:o.jsx(Je,{size:16})}):void 0,children:t.tcps.map(s=>o.jsx(U,{value:s.id,children:s.id},s.id))},"tcp")),t.showOrientationSelect&&a.push(o.jsx(ie,{labelValue:n("Jogging.Cartesian.Orientation.lb"),labelId:`orientation-select-${r}`,value:t.selectedOrientation,onChange:s=>t.setSelectedOrientation(s.target.value),children:mn.map(s=>o.jsx(U,{value:s,children:i(s)},s))},"orientation")),t.showIncrementSelect&&a.push(o.jsxs(ie,{labelValue:n("Jogging.Increment.hlb"),labelId:`jogging-increment-select-${r}`,size:"small",variant:"filled",value:((c=t.activeDiscreteIncrement)==null?void 0:c.id)||"continuous",onChange:s=>t.setSelectedIncrementId(s.target.value),children:[o.jsx(U,{value:"continuous",children:n("Jogging.Increment.Continuous.dd")},"continuous"),t.selectedOrientation==="tool"?null:t.discreteIncrementOptions.map(s=>o.jsx(U,{value:s.id,children:e?`${s.degrees}°`:`${s.mm}mm`},s.id))]},"increment")),o.jsx(w,{component:"div","data-testid":"jogging-options","aria-label":"jogging-options",sx:{display:"grid",gap:"16px",gridTemplateColumns:"1fr 1fr",gridAutoRows:"min-content","& label":{opacity:.7,fontSize:"12px",marginBottom:"4px"}},children:a.map((s,l)=>o.jsx(w,{sx:{gridColumn:a.length%2===1&&l===a.length-1?"span 2":"auto"},children:s},l))})}),xn=J.styled(St)(({theme:t})=>{var e;return{"&.MuiToggleButtonGroup-root":{background:(e=t.palette.backgroundPaperElevation)==null?void 0:e[8],borderRadius:"8px",padding:"4px",gap:"4px",button:{border:"none",borderRadius:"4px",flex:"1 1 0px",minWidth:0,"&.MuiToggleButtonGroup-firstButton":{borderRadius:"8px 4px 4px 8px"},"&.MuiToggleButtonGroup-lastButton":{borderRadius:"4px 8px 8px 4px"}}}}}),Ge=D.observer(t=>{var i,c,s;const e=J.useTheme(),{store:n}=t,{t:r}=z.useTranslation();function a(l,d){d===t.velocity||!vt(d)||t.onVelocityChange(d,t.useDegree)}return o.jsxs(_,{direction:"row",gap:2,alignItems:"center","data-testid":"velocity-slider","aria-label":"velocity-slider",children:[n.showVelocityLegend&&o.jsx(R,{sx:{color:(s=(c=(i=e.componentsExt)==null?void 0:i.JoggingPanel)==null?void 0:c.VelocitySlider)==null?void 0:s.sliderLegendColor,fontSize:"14px"},children:r("Jogging.Velocity.bt")}),o.jsx(Le,{value:t.velocity,color:"secondary",onChange:a,min:t.min,max:t.max,"aria-labelledby":"input-slider",disabled:t.disabled,sx:{"& .MuiSlider-valueLabelOpen":{zIndex:100,backgroundColor:"transparent",top:"0px"}}}),n.showVelocitySliderLabel&&(t.renderValue?t.renderValue(t.velocity):o.jsx(xe,{value:t.velocity.toString()}))]})});function xe({value:t,sx:e}){var r;const n=J.useTheme();return o.jsx(_,{direction:"row",justifyContent:"center",alignItems:"center",gap:"5px",sx:{padding:"6px 12px",background:(r=n.palette.backgroundPaperElevation)==null?void 0:r[8],borderRadius:"10px",minWidth:"111px",...e},children:o.jsx(R,{component:"span",sx:{textAlign:"right",fontSize:"14px",opacity:.8,color:n.palette.text.primary,whiteSpace:"nowrap"},children:t})})}const He=D.observer(({store:t,useDegree:e})=>{const{t:n}=z.useTranslation();function r(a,i){return i?`ω = ${n("Jogging.Cartesian.Rotation.velocityDegPerSec.lb",{amount:a})}`:`v = ${n("Jogging.Cartesian.Translation.velocityMmPerSec.lb",{amount:a})}`}return o.jsx(Ge,{store:t,velocity:t.velocityInDisplayUnits(e),min:t.minVelocityInDisplayUnits(e),max:t.maxVelocityInDisplayUnits(e),onVelocityChange:t.setVelocityFromSlider,useDegree:e,disabled:t.isLocked,renderValue:a=>o.jsx(xe,{value:r(a,e),sx:{minWidth:"111px",span:{transform:"translateY(-1.5px)"}}})})}),Ue=D.observer(({store:t})=>{var a,i,c;const{t:e}=z.useTranslation(),n=J.useTheme(),r=((c=(i=(a=t.jogger.motionStream.rapidlyChangingMotionState.execute)==null?void 0:a.details)==null?void 0:i.state)==null?void 0:c.kind)??"KIND_UNKNOWN";return o.jsxs(w,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",color:n.palette.text.primary},children:[o.jsx(R,{variant:"body2",sx:{fontSize:"0.75rem",lineHeight:1.2},children:e("Jogging.StreamStateSection.lb")}),o.jsx(R,{variant:"body2",sx:{fontSize:"0.75rem",lineHeight:1.2},"data-testid":r,children:e(`Jogging.StreamStateSection.${r}.lb`)})]})}),bn=D.observer(({store:t,children:e})=>{const{t:n}=z.useTranslation(),r=J.useTheme();function a(p,u){(u==="translate"||u==="rotate")&&t.setSelectedCartesianMotionType(u)}async function i(p,u){const b=await t.activate(),S=b.motionStream.rapidlyChangingMotionState.tcp_pose,y=b.motionStream.rapidlyChangingMotionState.joint_position;S&&await t.withMotionLock(async()=>{try{t.setCurrentIncrementJog({axis:p.axis,direction:p.direction}),await t.jogger.runIncrementalCartesianMotion({currentTcpPose:S,currentJoints:y,coordSystemId:t.activeCoordSystemId,velocityInRelevantUnits:t.selectedCartesianMotionType==="translate"?t.translationVelocityMmPerSec:t.rotationVelocityRadsPerSec,axis:p.axis,direction:p.direction,motion:t.selectedCartesianMotionType==="translate"?{type:"translate",distanceMm:u.mm}:{type:"rotate",distanceRads:L.degreesToRadians(u.degrees)}})}finally{t.setCurrentIncrementJog(null),await t.deactivate()}})}async function c(p){if(!t.isLocked){if(await t.activate(),t.activeDiscreteIncrement)return i(p,t.activeDiscreteIncrement);p.motionType==="translate"?await t.jogger.translateTCP({axis:p.axis,direction:p.direction,velocityMmPerSec:t.translationVelocityMmPerSec}):await t.jogger.rotateTCP({axis:p.axis,direction:p.direction,velocityRadsPerSec:t.rotationVelocityRadsPerSec})}}async function s(){t.isLocked||t.activeDiscreteIncrement||await t.deactivate()}function l(p,u,b){var y,f,v;const S=(v=(f=(y=b.componentsExt)==null?void 0:y.JoggingPanel)==null?void 0:f.JoggingCartesian)==null?void 0:v.Axis;if(S)return u==="translate"?S[p]:S.CustomRotation??S[p]}const d=[{id:"x",icon:o.jsx(an,{}),colors:l("X",t.selectedCartesianMotionType,r)},{id:"y",icon:o.jsx(ln,{}),colors:l("Y",t.selectedCartesianMotionType,r)},{id:"z",icon:o.jsx(dn,{}),colors:l("Z",t.selectedCartesianMotionType,r)}];function m(p){return n("General.mm.variable",{amount:p.toFixed(1)})}function g(p){return n("General.degree.variable",{amount:L.radiansToDegrees(p).toFixed(1)})}return o.jsxs(_,{"data-testid":"jogging-cartesian-tab","aria-label":"jogging-cartesian-tab",flexGrow:1,gap:2,sx:{padding:"18px 24px"},children:[o.jsxs(_,{gap:2,children:[o.jsx(fn,{store:t,useDegree:t.selectedCartesianMotionType==="rotate"}),o.jsx(He,{store:t,useDegree:t.selectedCartesianMotionType==="rotate"}),o.jsx(N,{})]}),o.jsx(_,{marginLeft:"auto",marginRight:"auto",gap:"24px",justifyContent:"center",sx:{flexGrow:"1"},children:o.jsxs(_,{alignItems:"center",justifyContent:"center",gap:"24px",sx:{flexGrow:1},children:[o.jsxs(xn,{value:t.selectedCartesianMotionType,onChange:a,exclusive:!0,"aria-label":n("Jogging.Cartesian.MotionType.lb"),sx:{justifyContent:"center"},children:[o.jsx(Ie,{value:"translate",children:n("Jogging.Cartesian.Translation.bt")}),o.jsx(Ie,{value:"rotate",children:n("Jogging.Cartesian.Rotation.bt")})]}),t.selectedCartesianMotionType==="translate"&&d.map(p=>{var u,b;return o.jsx(ge,{"data-testid":`jogging-cartesian-axis-control-${p.id}`,"aria-label":`jogging-cartesian-axis-control-${p.id}`,colors:p.colors,disabled:t.isLocked,activeJoggingDirection:((u=t.incrementJogInProgress)==null?void 0:u.axis)===p.id?t.incrementJogInProgress.direction:void 0,label:o.jsxs(o.Fragment,{children:[p.icon,o.jsx(R,{sx:{fontSize:"24px",color:((b=p.colors)==null?void 0:b.labelColor)??r.palette.text.primary},children:p.id.toUpperCase()})]}),getDisplayedValue:()=>{var S,y;return m(((y=(S=t.jogger.motionStream.rapidlyChangingMotionState.tcp_pose)==null?void 0:S.position)==null?void 0:y[L.XYZ_TO_VECTOR[p.id]])||0)},startJogging:S=>c({axis:p.id,motionType:"translate",direction:S}),stopJogging:s},p.id)}),t.selectedCartesianMotionType==="rotate"&&d.map(p=>{var u,b;return o.jsx(ge,{"data-testid":`jogging-cartesian-axis-control-${p.id}`,"aria-label":`jogging-cartesian-axis-control-${p.id}`,colors:p.colors,disabled:t.isLocked,activeJoggingDirection:((u=t.incrementJogInProgress)==null?void 0:u.axis)===p.id?t.incrementJogInProgress.direction:void 0,label:o.jsxs(o.Fragment,{children:[o.jsx(gn,{}),o.jsx(R,{sx:{fontSize:"24px",color:((b=p.colors)==null?void 0:b.labelColor)??r.palette.text.primary},children:p.id.toUpperCase()})]}),getDisplayedValue:()=>{var S,y;return g(((y=(S=t.jogger.motionStream.rapidlyChangingMotionState.tcp_pose)==null?void 0:S.orientation)==null?void 0:y[L.XYZ_TO_VECTOR[p.id]])||0)},startJogging:S=>c({axis:p.id,motionType:"rotate",direction:S}),stopJogging:s},p.id)})]})}),o.jsx(We,{store:t}),o.jsx(N,{}),o.jsx(Ue,{store:t}),e&&o.jsx(N,{}),e]})}),yn=D.observer(({store:t,children:e})=>{const n=J.useTheme();async function r(i){await t.activate(),await t.jogger.rotateJoints({joint:i.joint,direction:i.direction,velocityUnit:t.jointType===q.JointTypeEnum.PrismaticJoint?"mm/s":"rad/s",velocityValue:t.jointType===q.JointTypeEnum.PrismaticJoint?t.translationVelocityMmPerSec:t.rotationVelocityRadsPerSec})}async function a(){await t.jogger.stop(),await t.deactivate()}return o.jsxs(_,{"data-testid":"jogging-joint-tab","aria-label":"jogging-joint-tab",flexGrow:1,gap:2,sx:{padding:"18px 24px"},children:[o.jsx(He,{store:t,useDegree:t.jointType===q.JointTypeEnum.RevoluteJoint}),o.jsx(N,{}),o.jsx(_,{justifyContent:"center",alignItems:"stretch",sx:{flexGrow:"1"},children:o.jsx(_,{"data-testid":"jogging-joint-value-controls-wrapper","aria-label":"jogging-joint-value-controls-wrapper",alignItems:"center",gap:"24px",children:t.jogger.motionStream.joints.map(i=>{var s,l,d;const c=(d=(l=(s=t.motionGroupDescription.operation_limits.auto_limits)==null?void 0:s.joints)==null?void 0:l[i.index])==null?void 0:d.position;return o.jsxs(_,{"data-testid":`jogging-joint-value-control-${i.index}`,"aria-label":`jogging-joint-value-control-${i.index}`,direction:"row",alignItems:"center",justifyContent:"center",spacing:1.5,width:"100%",children:[t.showJointsLegend&&o.jsx(R,{color:t.isLocked?n.palette.text.disabled:n.palette.text.secondary,children:`G${i.index+1}`}),o.jsx(ze,{disabled:t.isLocked,lowerLimit:c==null?void 0:c.lower_limit,upperLimit:c==null?void 0:c.upper_limit,useDegree:t.jointType===q.JointTypeEnum.RevoluteJoint,getValue:()=>{const m=t.jogger.motionStream.rapidlyChangingMotionState.joint_position[i.index];return m!==void 0?m:void 0},startJogging:m=>r({joint:i.index,direction:m}),stopJogging:a})]},`joint-${i.index}`)})})}),o.jsx(We,{store:t}),o.jsx(N,{}),o.jsx(Ue,{store:t}),e&&o.jsx(N,{}),e]})}),Sn=B.externalizeComponent(D.observer(t=>{const e=he.isString(t.nova)?new q.Nova({instanceUrl:t.nova}):t.nova,n=D.useLocalObservable(()=>({joggingStore:null,loadingError:null}));async function r(){k.runInAction(()=>{n.loadingError=null,n.joggingStore=null});try{let a=t.store;if(!a){const i=await le.open(e,t.motionGroupId,{cellId:t.cellId});a=await ce.loadFor(i)}k.runInAction(()=>{n.joggingStore=a}),t.onSetup&&t.onSetup(a)}catch(a){n.loadingError=a}}return h.useEffect(()=>(r(),t.store?()=>null:()=>{var a;(a=n.joggingStore)==null||a.dispose()}),[t.store,t.nova,t.motionGroupId,t.cellId]),h.useEffect(()=>{const a=n.joggingStore;a&&(t.locked?a.lock("external"):a.unlock("external"))},[n.joggingStore,t.locked]),o.jsx(_,{"data-testid":"jogging-panel","aria-label":"jogging-panel",sx:{maxWidth:"460px",minWidth:"320px",position:"relative",...t.sx},children:n.joggingStore?o.jsx(vn,{store:n.joggingStore,children:t.children}):o.jsx(qe,{message:"Loading jogging",error:n.loadingError})})})),vn=D.observer(({store:t,children:e})=>{const{t:n}=z.useTranslation();function r(){if(t.currentTab.id==="cartesian")return o.jsx(bn,{store:t,children:e});if(t.currentTab.id==="joint")return o.jsx(yn,{store:t,children:e})}return o.jsxs(_,{flexGrow:1,sx:{overflow:"hidden"},children:[o.jsx(De,{"data-testid":"jogging-tabs","aria-label":"jogging-tabs",value:t.tabIndex,onChange:t.onTabChange,variant:"fullWidth",children:t.tabs.map(a=>{const i=a.label==="Cartesian"?n("Jogging.Cartesian.bt"):n("Jogging.Joints.bt"),c=a.label==="cartesian"?o.jsx(lt,{fontSize:"small",sx:{mr:1}}):o.jsx(ct,{fontSize:"small",sx:{mr:1}});return o.jsx(Oe,{"data-testid":`jogging-tab-${a.id}`,"aria-label":`jogging-tab-${a.id}`,label:t.showTabIcons?o.jsxs(_,{direction:"row",alignItems:"center",children:[c,i]}):i,id:`jogging-tab-${a.id}`,"aria-controls":`jogging-tab-${a.id}`},a.id)})}),o.jsx(_,{flexGrow:1,position:"relative",sx:{overflowY:"auto",overflowX:"hidden"},children:r()}),t.blocked&&o.jsx(on,{store:t})]})}),Ye=t=>{var s;const{value:e,ref:n}=t,r=J.useTheme(),[a,i]=h.useState(!1);async function c(){if(!n||!("current"in n))return console.warn("No copy target found"),!1;try{return await navigator.clipboard.writeText(e),console.log("Copied!"),i(!0),!0}catch(l){console.error(l);const d=window.getSelection();if(d&&n&&"current"in n&&n.current){const m=document.createRange();m.selectNodeContents(n.current),d.removeAllRanges(),d.addRange(m)}}return!1}return h.useEffect(()=>{if(!a)return;const l=setTimeout(()=>i(!1),3e3);return()=>{l&&clearTimeout(l)}},[a]),o.jsx(Tt,{open:a,title:"Copied!",children:o.jsx(_,{justifyContent:"center",sx:{height:"100%",boxSizing:"border-box",padding:"6px 12px",background:(s=r.palette.backgroundPaperElevation)==null?void 0:s[8],borderRadius:"10px",minWidth:"0",cursor:"pointer"},onClick:()=>c(),children:o.jsx(R,{ref:n,align:"center",sx:{pointerEvents:"none",fontSize:"12px",color:r.palette.text.primary,whiteSpace:"nowrap",minWidth:0,textOverflow:"ellipsis",width:"100%",overflow:"hidden"},children:e})})})},Cn=B.externalizeComponent(D.observer(({tcpPose:t,showCopyButton:e=!1})=>{const[n,r]=h.useState(null),a=q.poseToWandelscriptString(t),i=async()=>{try{await navigator.clipboard.writeText(a),r("Copied!"),setTimeout(()=>r(null),2e3)}catch{r("Copy failed"),setTimeout(()=>r(null),2e3)}};return o.jsxs(_,{direction:"row",alignItems:"center",spacing:1,sx:{flexGrow:1,minWidth:0,overflow:"hidden"},"data-testid":"pose-cartesian-values",children:[o.jsx(Ye,{value:a}),e&&o.jsx(Y,{variant:"contained",color:"secondary",size:"small",onClick:i,sx:{flexShrink:0},children:n||"Copy"})]})})),jn=B.externalizeComponent(D.observer(({joints:t,showCopyButton:e=!1})=>{const[n,r]=h.useState(null),a=`[${t.map(c=>parseFloat(c.toFixed(4))).join(", ")}]`,i=async()=>{try{await navigator.clipboard.writeText(a),r("Copied!"),setTimeout(()=>r(null),2e3)}catch{r("Copy failed"),setTimeout(()=>r(null),2e3)}};return o.jsxs(_,{direction:"row",alignItems:"center",spacing:1,sx:{flexGrow:1,minWidth:0,overflow:"hidden"},"data-testid":"pose-joint-values",children:[o.jsx(Ye,{value:a}),e&&o.jsx(Y,{variant:"contained",color:"secondary",size:"small",onClick:i,sx:{flexShrink:0},children:n||"Copy"})]})}));class Ze{constructor(){this.messages=[],this.addMessage=(e,n="info")=>{const r={id:Math.random().toString(36).substring(2,11),timestamp:new Date,message:e,level:n};this.messages.push(r)},this.clearMessages=()=>{this.messages=[]},this.addInfo=e=>{this.addMessage(e,"info")},this.addWarning=e=>{this.addMessage(e,"warning")},this.addError=e=>{this.addMessage(e,"error")},this.addDebug=e=>{this.addMessage(e,"debug")},k.makeObservable(this,{messages:k.observable,addMessage:k.action,clearMessages:k.action})}}const te=(t,e,n)=>({id:n||`${Date.now()}-${Math.random().toString(36).substring(2,11)}`,timestamp:new Date,message:t,level:e}),wn=(t,e)=>te(t,"debug",e),Tn=(t,e)=>te(t,"info",e),Mn=(t,e)=>te(t,"warning",e),In=(t,e)=>te(t,"error",e),Xe=B.externalizeComponent(D.observer(t=>{var m;const{messages:e=[],onClear:n,height:r=400,sx:a}=t,i=J.useTheme(),c=h.useRef(null);h.useEffect(()=>{if(e.length===0)return;const g=c.current;if(!g)return;const p=setTimeout(()=>{g.scrollTop=g.scrollHeight},10);return()=>clearTimeout(p)},[e.length]);const s=g=>g.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),l=g=>{switch(g){case"error":return i.palette.error.main;case"warning":return i.palette.warning.main;case"info":return i.palette.info.main;case"debug":return i.palette.text.disabled;default:return i.palette.text.secondary}},d=({message:g})=>{const[p,u]=h.useState(!1),[b,S]=h.useState(!1),[y,f]=h.useState(!1),v=g.message.length>150,x=async()=>{try{await navigator.clipboard.writeText(g.message),S(!0),setTimeout(()=>S(!1),2e3)}catch(C){console.error("Failed to copy message:",C)}},j=v&&!p?`${g.message.substring(0,150)}...`:g.message;return o.jsx(w,{onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),sx:{display:"flex",gap:1,fontFamily:"monospace",flexDirection:"column","&:hover":{backgroundColor:i.palette.action.hover},borderRadius:"4px",padding:"2px 4px",margin:"-2px -4px"},children:o.jsxs(w,{sx:{display:"flex",gap:1},children:[o.jsxs(R,{component:"span",sx:{fontWeight:400,fontSize:"12px",lineHeight:"18px",letterSpacing:"0.4px",color:i.palette.text.disabled,whiteSpace:"nowrap",flexShrink:0},children:["[",s(g.timestamp),"]"]}),o.jsx(R,{component:"span",sx:{fontWeight:400,fontSize:"12px",lineHeight:"18px",letterSpacing:"0.4px",color:l(g.level),wordBreak:"break-word",overflowWrap:"anywhere",hyphens:"auto",flex:1,whiteSpace:"pre-wrap"},children:j}),o.jsxs(w,{sx:{display:"flex",alignItems:"flex-start",gap:.5,opacity:y?1:0,transition:"opacity 0.2s ease-in-out",visibility:y?"visible":"hidden"},children:[o.jsx(G,{size:"small",onClick:x,sx:{padding:"2px",color:i.palette.text.secondary,"&:hover":{backgroundColor:i.palette.action.hover}},title:b?"Copied!":"Copy message",children:o.jsx(Mt,{sx:{fontSize:12}})}),v&&o.jsx(G,{size:"small",onClick:()=>u(!p),sx:{padding:"2px",color:i.palette.text.secondary,"&:hover":{backgroundColor:i.palette.action.hover}},title:p?"Collapse":"Expand",children:p?o.jsx(kt,{sx:{fontSize:12}}):o.jsx(Rt,{sx:{fontSize:12}})})]})]})},g.id)};return o.jsxs(Et,{sx:{backgroundColor:((m=i.palette.backgroundPaperElevation)==null?void 0:m[2])||"#171927",backgroundImage:"none",height:r,display:"flex",flexDirection:"column",overflow:"hidden",...a},children:[o.jsxs(w,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px"},children:[o.jsxs(w,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.jsx(It,{sx:{fontSize:16,color:i.palette.action.active,opacity:.56}}),o.jsx(R,{sx:{fontWeight:500,fontSize:"14px",lineHeight:"143%",letterSpacing:"0.17px",color:i.palette.text.primary},children:"Log"})]}),o.jsx(Y,{onClick:n,variant:"text",sx:{fontWeight:500,fontSize:"13px",lineHeight:"22px",letterSpacing:"0.46px",color:i.palette.primary.main,textTransform:"none",minWidth:"auto",padding:"4px 8px","&:hover":{backgroundColor:`${i.palette.primary.main}14`}},children:"Clear"})]}),o.jsx(w,{ref:c,sx:{flex:1,overflow:"auto",padding:"8px 16px",display:"flex",flexDirection:"column",gap:"2px",scrollbarWidth:"thin",scrollbarColor:`${i.palette.divider} transparent`,"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:i.palette.divider,borderRadius:"3px","&:hover":{backgroundColor:i.palette.divider}}},children:e.length===0?o.jsx(R,{sx:{color:i.palette.text.disabled,fontSize:"12px",fontStyle:"italic",textAlign:"center",marginTop:2},children:"No log messages"}):e.map(g=>o.jsx(d,{message:g},g.id))})]})})),kn=B.externalizeComponent(D.observer(t=>{const{store:e,onStoreReady:n,...r}=t,a=h.useRef(n);h.useEffect(()=>{a.current=n},[n]);const i=h.useMemo(()=>{var l;const s=e||new Ze;return(l=a.current)==null||l.call(a,s),s},[e]),c=()=>{i.clearMessages()};return o.jsx(Xe,{...r,messages:i.messages,onClear:c})}));function Rn(){const t=window.location.href;return t.substring(0,t.indexOf("/",t.indexOf("//")+2))}function En({baseUrl:t=Rn(),...e}){return o.jsxs(Pt,{"aria-labelledby":"no-motion-group-modal-title",open:!0,fullWidth:!0,sx:{"& .MuiModal-backdrop":{backdropFilter:"blur(10px)"},"& .MuiDialog-paper":{"::before":{content:'""',height:"8px",width:"100%",background:"linear-gradient(90deg, #FF0E65 0%, #47D3FF 100%)"},background:"#101629"}},children:[o.jsx(Ot,{id:"no-motion-group-modal-title",children:"No motion group found"}),o.jsxs(At,{sx:{marginTop:"3rem",marginBottom:"1.5rem",textAlign:"center"},children:[o.jsx(R,{color:"#fff",children:"Found no devices to connect to."}),o.jsx(R,{color:"#fff",children:"Please ensure a motion group has been created."})]}),o.jsx(_t,{children:o.jsxs(_,{width:"100%",maxWidth:"300px",margin:"auto",marginBottom:"2rem",children:[o.jsx(Y,{href:`${t}/settings`,variant:"contained",sx:{borderRadius:"8px",width:"100%"},children:"Go to settings app"}),o.jsx(Y,{href:`${t}`,variant:"text",sx:{marginTop:"1rem",color:"#fff",textDecoration:"underline",fontSize:"0.75rem"},children:"Back to Homescreen"})]})})]})}const Pn=({title:t,titleId:e,...n},r)=>A.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:18,height:18,fill:"none",ref:r,"aria-labelledby":e,...n},t?A.createElement("title",{id:e},t):null,A.createElement("path",{fill:"#38C6F4",fillRule:"evenodd",d:"M6.359 14.25v2.934h7.63v-3.521L10.196 9.87 9 8.674l.859-.859.337-.337.858-.858.565.565.631.63.565.565 1.196-1.195.543-.544 1.196-1.195-1.196-1.196-2.304-2.304L11.054.75 9.86 1.946 3.446 8.359 2.25 9.554l1.196 1.196 2.913 2.913zm1.69 0v1.244h4.249v-1.13L7.804 9.87 6.608 8.674l1.196-1.196L9.86 5.424l.007-.008-.543-.543-4.681 4.681 2.912 2.913.496.496v.113h2.124l1.174 1.174zm3.005-10.022-.294.294-.543-.543.837-.837 2.304 2.304-.543.543-.565-.565z",clipRule:"evenodd"})),_n=h.forwardRef(Pn);var be=(t=>(t.PRECONDITION_NOT_FULFILLED="PRECONDITION_NOT_FULFILLED",t.ROBOT_DISCONNECTED="ROBOT_DISCONNECTED",t.CELL_OPEN="CELL_OPEN",t.E_STOP="E_STOP",t.MANUAL_MODE="MANUAL_MODE",t.READY="READY",t))(be||{});const Qe=B.externalizeComponent(D.observer(({setupState:t,className:e})=>{const n=J.useTheme(),{t:r}=z.useTranslation(),a=()=>{var d,m,g,p,u,b,S;switch(t){case"READY":return{label:r("RobotSetupReadinessIndicator.Ready.lb"),indicatorColor:((d=n.palette.tertiary)==null?void 0:d.main)||n.palette.primary.main,backgroundColor:((m=n.palette.backgroundPaperElevation)==null?void 0:m[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case"ROBOT_DISCONNECTED":return{label:r("RobotSetupReadinessIndicator.RobotDisconnected.lb"),indicatorColor:n.palette.error.main,backgroundColor:((g=n.palette.backgroundPaperElevation)==null?void 0:g[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case"CELL_OPEN":return{label:r("RobotSetupReadinessIndicator.CellOpen.lb"),indicatorColor:n.palette.error.main,backgroundColor:((p=n.palette.backgroundPaperElevation)==null?void 0:p[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case"E_STOP":return{label:r("RobotSetupReadinessIndicator.EStop.lb"),indicatorColor:n.palette.error.main,backgroundColor:((u=n.palette.backgroundPaperElevation)==null?void 0:u[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case"MANUAL_MODE":return{label:r("RobotSetupReadinessIndicator.ManualMode.lb"),indicatorColor:n.palette.error.main,backgroundColor:((b=n.palette.backgroundPaperElevation)==null?void 0:b[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText};default:return{label:r("RobotSetupReadinessIndicator.PreconditionNotFulfilled.lb"),indicatorColor:n.palette.error.main,backgroundColor:((S=n.palette.backgroundPaperElevation)==null?void 0:S[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText}}},{label:i,indicatorColor:c,backgroundColor:s,textColor:l}=a();return o.jsx(Jt,{className:e,label:o.jsxs(w,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.jsx(w,{sx:{width:8,height:8,borderRadius:"50%",backgroundColor:c,flexShrink:0}}),o.jsx(R,{variant:"body2",sx:{color:l,fontSize:"0.75rem",lineHeight:1.2},children:i})]}),variant:"filled",sx:{backgroundColor:s,color:n.palette.getContrastText(s),fontWeight:500,height:"auto","& .MuiChip-label":{paddingX:1.5,paddingY:.5}}})})),An=B.externalizeComponent(D.observer(({robotName:t,robotType:e,setupState:n,PreconditionComponent:r=Qe,className:a})=>{var l;const i=J.useTheme(),c=e||"Robot",s=n===be.READY;return o.jsxs(w,{className:a,sx:{border:`1px solid ${i.palette.divider}`,background:((l=i.palette.backgroundPaperElevation)==null?void 0:l[8])||"#292B3F",borderRadius:"8px",padding:"20px",display:"flex",alignItems:"center",justifyContent:"space-between",opacity:1},children:[o.jsxs(w,{sx:{display:"flex",alignItems:"center",gap:2,flex:1},children:[s?o.jsx(w,{sx:{fontSize:24,display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,"& svg":{fill:`${i.palette.primary.main} !important`},"& svg path":{fill:`${i.palette.primary.main} !important`}},children:o.jsx(_n,{})}):o.jsx(Dt,{sx:{color:i.palette.error.main,fontSize:24}}),o.jsx(R,{variant:"body1",sx:{fontWeight:500,color:i.palette.text.primary},children:t}),o.jsx(N,{orientation:"vertical",flexItem:!0,sx:{backgroundColor:i.palette.text.secondary,opacity:.3,width:"1px"}}),o.jsx(R,{variant:"body2",sx:{color:i.palette.text.secondary},children:c})]}),r&&o.jsx(r,{setupState:n})]})})),On=J.styled(Lt,{shouldForwardProp:t=>t!=="selected"})(({theme:t})=>{var e,n,r;return{borderRadius:"20px","&:hover":{background:(e=t.palette.backgroundPaperElevation)==null?void 0:e[7]},variants:[{props:({selected:a})=>!a,style:{background:(n=t.palette.backgroundPaperElevation)==null?void 0:n[0],color:t.palette.action.disabled,"> img":{opacity:.4}}},{props:({selected:a})=>a,style:{background:(r=t.palette.backgroundPaperElevation)==null?void 0:r[11],border:`1px solid ${t.palette.divider}`,color:t.palette.primary.contrastText}}]}}),Dn=t=>{const{ref:e,...n}=t;return o.jsx(On,{ref:e,selected:t.selected,...n,color:"secondary",variant:"circular"})};function Jn(t){const{children:e,value:n,index:r,...a}=t;return o.jsx("div",{role:"tabpanel",hidden:n!==r,id:`tabpanel-${r}`,"aria-labelledby":`tab-${r}`,...a,children:n===r&&o.jsx(w,{children:e})})}function Ln({children:t,...e}){const{fullWidth:n,indicator:r,onChange:a,orientation:i,scrollButtons:c,selectionFollowsFocus:s,textColor:l,value:d,variant:m,...g}=e;return o.jsx(w,{...g,children:t})}const Fn=B.externalizeComponent(D.observer(t=>{const{items:e,activeTab:n,defaultActiveTab:r=0,onTabChange:a,sx:i,ref:c}=t,s=n!==void 0,[l,d]=h.useState(r),m=s?n:l;h.useEffect(()=>{s||e.length!==0&&(l<0||l>e.length-1)&&d(0)},[e.length,s,l]);const g=(p,u)=>{s||d(u),a==null||a(u)};return o.jsxs(w,{ref:c,sx:{height:"100%",display:"flex",flexDirection:"column",...i},children:[o.jsx(w,{sx:{px:0,py:0,overflow:"visible",position:"relative",paddingTop:p=>p.spacing(2),paddingRight:p=>p.spacing(2.5)},children:o.jsx(De,{value:m,onChange:g,sx:{minHeight:"32px",backgroundColor:"transparent",overflow:"visible","& .MuiTabs-indicator":{display:"none"},"& .MuiTabs-flexContainer":{gap:2,overflow:"visible",paddingTop:0,paddingBottom:0},"& .MuiTabs-scroller":{overflow:"visible !important"},"& .MuiTab-root":{overflow:"visible"}},children:e.map((p,u)=>{var j,C,T;const b=()=>{if(!p.badge)return;const M=p.badge.content,E=p.badge.max;return typeof M=="number"&&E&&M>E?`${E}+`:M},S=()=>{if(!p.badge)return!1;const M=p.badge.content,E=p.badge.showZero;return!(M===0&&!E)},y=b(),f=S(),v=()=>{s||d(u),a==null||a(u)},x=o.jsx(Oe,{label:p.label,icon:p.icon,iconPosition:"start",disableRipple:!0,onClick:v,sx:{minHeight:"32px",height:"32px",padding:"0px 10px",borderRadius:"12px",backgroundColor:M=>{var E;return((E=M.palette.backgroundPaperElevation)==null?void 0:E[11])||"#32344B"},color:"text.primary",opacity:m===u?1:.38,fontSize:"13px",transition:"all 0.2s ease-in-out",position:"relative",overflow:"visible","&:hover":{opacity:m===u?1:.6},"&.Mui-selected":{opacity:1,backgroundColor:M=>{var E;return((E=M.palette.backgroundPaperElevation)==null?void 0:E[11])||"#32344B"},color:"text.primary"},"&:focus":{outline:"none"},"&:active":{transform:"none"}}},p.id);return f?o.jsx(Ln,{component:"span",sx:{display:"inline-flex"},children:o.jsx(Ft,{badgeContent:y,color:((j=p.badge)==null?void 0:j.color)||"error",max:(C=p.badge)==null?void 0:C.max,showZero:(T=p.badge)==null?void 0:T.showZero,anchorOrigin:{vertical:"top",horizontal:"right"},overlap:"rectangular",sx:{"& .MuiBadge-badge":{opacity:"1 !important"}},children:x})},p.id):x})})}),o.jsx(w,{sx:{mt:p=>p.spacing(2),borderBottom:1,borderColor:"divider"}}),o.jsx(w,{sx:{flex:1,overflow:"auto"},children:e.map((p,u)=>o.jsx(Jn,{value:m,index:u,children:p.content},p.id))})]})})),Bn=t=>{const e=Math.floor(t/86400),n=Math.floor(t%86400/3600),r=Math.floor(t%3600/60),a=t%60,i=[];return e>0?(i.push(e.toString()),i.push(n.toString().padStart(2,"0")),i.push(r.toString().padStart(2,"0")),i.push(a.toString().padStart(2,"0"))):n>0?(i.push(n.toString()),i.push(r.toString().padStart(2,"0")),i.push(a.toString().padStart(2,"0"))):(i.push(r.toString()),i.push(a.toString().padStart(2,"0"))),i.join(":")},Pe=(t,e)=>{const n=Math.floor(t/86400),r=Math.floor(t%86400/3600),a=Math.floor(t%3600/60),i=t%60;if(typeof Intl<"u"&&"DurationFormat"in Intl)try{const s={};return n>0&&(s.days=n),r>0&&(s.hours=r),a>0&&(s.minutes=a),(i>0||Object.keys(s).length===0)&&(s.seconds=i),new Intl.DurationFormat(e,{style:"narrow"}).format(s)}catch{}const c=[];return n>0&&c.push(`${n}d`),r>0&&c.push(`${r}h`),a>0&&c.push(`${a}m`),(i>0||c.length===0)&&c.push(`${i}s`),c.join(" ")},zn=({timerState:t,animationState:e,hasError:n,className:r})=>{var g,p;const{t:a}=z.useTranslation(),i=J.useTheme(),{elapsedTime:c,currentProgress:s}=t,{showErrorAnimation:l,showPauseAnimation:d,showMainText:m}=e;return o.jsxs(w,{className:r,sx:{position:"relative",width:264,height:264,display:"flex",alignItems:"center",justifyContent:"center"},children:[o.jsx(Bt.Gauge,{width:264,height:264,value:s,valueMin:0,valueMax:100,innerRadius:"85%",outerRadius:"100%",margin:0,skipAnimation:!0,text:()=>"",sx:{opacity:d||l?.6:1,transition:"opacity 0.5s ease-out","& .MuiGauge-valueArc":{fill:n?i.palette.error.light:i.palette.success.main,transition:"fill 0.5s ease-out"},"& .MuiGauge-referenceArc":{fill:(g=i.palette.backgroundPaperElevation)==null?void 0:g[2],stroke:"transparent",strokeWidth:0,transition:"fill 0.5s ease-out, stroke 0.5s ease-out, stroke-width 0.5s ease-out"},"& .MuiGauge-valueText":{display:"none"},"& .MuiGauge-text":{display:"none"}}}),o.jsx(w,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:225,height:225,borderRadius:"50%",backgroundColor:(p=i.palette.backgroundPaperElevation)==null?void 0:p[8],display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",gap:1,transition:"background-color 0.5s ease-out"},children:o.jsxs(w,{sx:{position:"relative",height:"48px",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:.5},children:[o.jsx(W,{in:m&&n,timeout:200,children:o.jsx(R,{variant:"h6",sx:{position:"absolute",fontSize:"16px",fontWeight:500,color:i.palette.error.light},children:a("timer.error")})}),o.jsx(W,{in:m&&!n,timeout:300,children:o.jsx(R,{variant:"h1",sx:{position:"absolute",fontSize:"48px",fontWeight:500,color:i.palette.text.primary,lineHeight:1,letterSpacing:"-0.5px"},children:Bn(c)})})]})})]})},$n=({timerState:t,animationState:e,hasError:n,compact:r,className:a})=>{const{t:i,i18n:c}=z.useTranslation(),s=J.useTheme(),{elapsedTime:l,currentProgress:d}=t,{showErrorAnimation:m,showPauseAnimation:g}=e;return r?o.jsx(w,{className:a,sx:{display:"flex",alignItems:"center",m:0},children:o.jsx(R,{variant:"body2",sx:{color:n?s.palette.error.light:s.palette.text.primary,fontSize:"14px",transition:"color 0.5s ease-out"},children:n?i("timer.error"):Pe(l,c.language)})}):o.jsxs(w,{className:a,sx:{display:"flex",alignItems:"center",m:0,gap:1},children:[o.jsx(w,{sx:{width:20,height:20,display:"flex",alignItems:"center",justifyContent:"center",opacity:g||m?.6:1,transition:"opacity 0.5s ease-out"},children:o.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",style:{transform:"rotate(-90deg)"},role:"img","aria-label":"Timer progress",children:[o.jsx("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:n?s.palette.error.light:s.palette.success.main,strokeWidth:"2",opacity:.3,style:{transition:"stroke 0.8s ease-in-out, opacity 2s ease-in-out"}}),o.jsx("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:n?s.palette.error.light:s.palette.success.main,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:`${2*Math.PI*8}`,strokeDashoffset:`${2*Math.PI*8*(1-d/100)}`,style:{transition:"stroke-dashoffset 0.1s ease-out, stroke 0.8s ease-in-out, opacity 2s ease-in-out"}})]})}),o.jsx(R,{variant:"body2",sx:{color:n?s.palette.error.light:s.palette.text.primary,fontSize:"14px",lineHeight:"normal",letterSpacing:"normal",transition:"color 0.8s ease-in-out, font-size 0.3s ease-out, opacity 2s ease-in-out"},children:n?i("timer.error"):Pe(l,c.language)})]})},Vn=()=>{const[t,e]=h.useState({showPauseAnimation:!1,showErrorAnimation:!1,showMainText:!0}),n=h.useRef(null),r=h.useRef(null),a=h.useRef(null),i=h.useCallback(()=>{e(g=>({...g,showPauseAnimation:!0})),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{e(g=>({...g,showPauseAnimation:!1}))},800)},[]),c=h.useCallback(()=>{e(g=>({...g,showErrorAnimation:!0})),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{e(g=>({...g,showErrorAnimation:!1}))},600)},[]),s=h.useCallback(()=>{e(g=>({...g,showErrorAnimation:!1})),r.current&&clearTimeout(r.current)},[]),l=h.useCallback(()=>{e(g=>({...g,showMainText:!1})),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{e(g=>({...g,showMainText:!0}))},200)},[]),d=h.useCallback(()=>{e(g=>({...g,showMainText:!0}))},[]),m=h.useCallback(()=>{n.current&&clearTimeout(n.current),r.current&&clearTimeout(r.current),a.current&&clearTimeout(a.current)},[]);return{animationState:t,triggerPauseAnimation:i,triggerErrorAnimation:c,clearErrorAnimation:s,triggerFadeTransition:l,setInitialAnimationState:d,cleanup:m}},qn=({autoStart:t,hasError:e,onPauseAnimation:n,onErrorAnimation:r,onClearErrorAnimation:a})=>{const[i,c]=h.useState({elapsedTime:0,isRunning:!1,isPausedState:!1,currentProgress:0,wasRunningBeforeError:!1}),s=h.useRef(null),l=h.useRef(null),d=h.useRef(0),m=h.useRef(0),[g]=ee.useInterpolation([0],{tension:80,friction:18,onChange:([f])=>{c(v=>({...v,currentProgress:f}))}}),p=h.useCallback((f=0)=>{const v=f/60%1*100;c(x=>({...x,elapsedTime:f,isPausedState:!1,currentProgress:v})),d.current=0,m.current=v,g.setImmediate([v]),t?(l.current=Date.now()-f*1e3,c(x=>({...x,isRunning:!0}))):l.current=null},[t,g]),u=h.useCallback(()=>{if(l.current&&i.isRunning){const v=(Date.now()-l.current)/1e3+d.current,x=v/60%1*100;g.setTarget([x]),c(j=>({...j,elapsedTime:Math.floor(v)}))}c(f=>({...f,isRunning:!1,isPausedState:!0})),n()},[i.isRunning,g,n]),b=h.useCallback(()=>{i.isPausedState&&(d.current=i.elapsedTime,l.current=Date.now(),c(f=>({...f,isRunning:!0,isPausedState:!1})))},[i.isPausedState,i.elapsedTime]),S=h.useCallback(()=>{c(f=>({...f,elapsedTime:0,isRunning:!1,isPausedState:!1,currentProgress:0})),d.current=0,l.current=null,m.current=0,g.setImmediate([0])},[g]),y=h.useCallback(()=>i.isPausedState,[i.isPausedState]);return h.useEffect(()=>{e?(i.isRunning&&(c(f=>({...f,wasRunningBeforeError:!0})),u()),r()):(i.wasRunningBeforeError&&!i.isRunning&&(c(f=>({...f,wasRunningBeforeError:!1})),b()),a())},[e,i.isRunning,i.wasRunningBeforeError,u,b,r,a]),h.useEffect(()=>{if(i.isRunning){const f=()=>{if(l.current){const x=(Date.now()-l.current)/1e3+d.current,j=x/60%1*100;c(T=>({...T,elapsedTime:Math.floor(x)})),Math.abs(j-m.current)>.1&&(g.setTarget([j]),m.current=j)}s.current=requestAnimationFrame(f)};s.current=requestAnimationFrame(f)}else s.current&&(cancelAnimationFrame(s.current),s.current=null);return()=>{s.current&&(cancelAnimationFrame(s.current),s.current=null)}},[i.isRunning,g]),h.useEffect(()=>{let f=null;const v=()=>{g.update(),f=requestAnimationFrame(v)};return f=requestAnimationFrame(v),()=>{f&&cancelAnimationFrame(f)}},[g]),{timerState:i,controls:{start:p,pause:u,resume:b,reset:S,isPaused:y}}},Nn=B.externalizeComponent(D.observer(({onTimerReady:t,autoStart:e=!0,variant:n="default",compact:r=!1,className:a,hasError:i=!1})=>{const{animationState:c,triggerPauseAnimation:s,triggerErrorAnimation:l,clearErrorAnimation:d,setInitialAnimationState:m,cleanup:g}=Vn(),{timerState:p,controls:u}=qn({autoStart:e,hasError:i,onPauseAnimation:s,onErrorAnimation:l,onClearErrorAnimation:d});return h.useEffect(()=>{m()},[m]),h.useEffect(()=>{let b=!0;const S=setTimeout(()=>{b&&t(u)},0);return()=>{b=!1,clearTimeout(S)}},[t,u]),h.useEffect(()=>g,[g]),n==="small"?o.jsx($n,{timerState:p,animationState:c,hasError:i,compact:r,className:a}):o.jsx(zn,{timerState:p,animationState:c,hasError:i,className:a})})),_e=1e-4,Wn={a:0,d:0,alpha:0,theta:0,reverse_rotation_direction:!1};class ae{constructor(e,n,r,a,i,c,s,l,d,m,g="cell"){this.controller=n,this.motionGroup=r,this.initialMotionState=a,this.motionStateSocket=i,this.isVirtual=c,this.tcps=s,this.description=l,this.initialControllerState=d,this.controllerStateSocket=m,this.cellId=g,this.connectedJoggingSocket=null,this.joggingVelocity=10,this.activationState="inactive",this.nova=re(e),this.rapidlyChangingMotionState=a,this.controllerState=d,m.addEventListener("message",p=>{var b;const u=(b=L.tryParseJson(p.data))==null?void 0:b.result;u&&k.runInAction(()=>{this.controllerState=u})}),i.addEventListener("message",p=>{var b;const u=(b=L.tryParseJson(p.data))==null?void 0:b.result;if(!u)throw new Error(`Failed to get motion state for ${this.motionGroupId}: ${p.data}`);me(this.rapidlyChangingMotionState.joint_position,u.joint_position,_e)||k.runInAction(()=>{this.rapidlyChangingMotionState.joint_position=u.joint_position}),fe(this.rapidlyChangingMotionState,u,_e)||k.runInAction(()=>{this.rapidlyChangingMotionState.tcp_pose=u.tcp_pose}),u.tcp!==void 0&&this.rapidlyChangingMotionState.tcp!==u.tcp&&k.runInAction(()=>{this.rapidlyChangingMotionState.tcp=u.tcp}),this.rapidlyChangingMotionState.standstill!==u.standstill&&k.runInAction(()=>{this.rapidlyChangingMotionState.standstill=u.standstill})}),k.makeAutoObservable(this)}static async connectMultiple(e,n,r={}){return Promise.all(n.map(a=>ae.connect(e,a,r)))}static async connect(e,n,r={}){var j,C;const a=re(e),i=r.cellId??"cell",[c,s]=n.split("@"),l=await a.api.controller.getCurrentRobotControllerState(i,s),d=l==null?void 0:l.motion_groups.find(T=>T.motion_group===n);if(!l||!d)throw new Error(`Controller ${s} or motion group ${n} not found`);const m=a.openReconnectingWebsocket(`/cells/${i}/controllers/${s}/motion-groups/${n}/state-stream`),g=await m.firstMessage(),p=(j=L.tryParseJson(g.data))==null?void 0:j.result;if(!p)throw new Error(`Unable to parse initial motion state message ${g.data}`);console.log(`Connected motion state websocket to motion group ${d.motion_group}. Initial state:
|
|
3
|
+
`,p);const b=(await a.api.controller.getRobotController(i,l.controller)).configuration.kind==="VirtualController",S=await a.api.motionGroup.getMotionGroupDescription(i,s,d.motion_group),y=Object.entries(S.tcps||{}).map(([T,M])=>({id:T,readable_name:M.name,position:M.pose.position,orientation:M.pose.orientation})),f=a.openReconnectingWebsocket(`/cells/${i}/controllers/${l.controller}/state-stream?response_rate=1000`),v=await f.firstMessage(),x=(C=L.tryParseJson(v.data))==null?void 0:C.result;if(!x)throw new Error(`Unable to parse initial controller state message ${v.data}`);return console.log(`Connected controller state websocket to controller ${l.controller}. Initial state:
|
|
4
|
+
`,x),new ae(a,l,d,p,m,b,y,S,x,f,i)}get motionGroupId(){return this.motionGroup.motion_group}get controllerId(){return this.controller.controller}get modelFromController(){return this.description.motion_group_model}get joggingVelocityRads(){return this.joggingVelocity*Math.PI/180}get joints(){return this.initialMotionState.joint_position.map((e,n)=>({index:n}))}get dhParameters(){if(this.description.dh_parameters!==void 0)return this.description.dh_parameters.map(e=>({...Wn,...e}))}get safetyZones(){return this.description.safety_zones}get mountingPosition(){var e,n,r;return this.description.mounting?[(((e=this.description.mounting.position)==null?void 0:e[0])||0)/1e3,(((n=this.description.mounting.position)==null?void 0:n[1])||0)/1e3,(((r=this.description.mounting.position)==null?void 0:r[2])||0)/1e3]:[0,0,0]}get mountingQuaternion(){var a,i,c,s,l,d;const e=new ke.Vector3(((i=(a=this.description.mounting)==null?void 0:a.orientation)==null?void 0:i[0])||0,((s=(c=this.description.mounting)==null?void 0:c.orientation)==null?void 0:s[1])||0,((d=(l=this.description.mounting)==null?void 0:l.orientation)==null?void 0:d[2])||0),n=e.length(),r=e.normalize();return new ke.Quaternion().setFromAxisAngle(r,n)}get isEstopActive(){return["SAFETY_STATE_ROBOT_EMERGENCY_STOP","SAFETY_STATE_DEVICE_EMERGENCY_STOP"].includes(this.controllerState.safety_state)}get isMoveableSafetyState(){return["SAFETY_STATE_NORMAL","SAFETY_STATE_REDUCED"].includes(this.controllerState.safety_state)}get isMoveableOperationMode(){return["OPERATION_MODE_AUTO","OPERATION_MODE_MANUAL","OPERATION_MODE_MANUAL_T1","OPERATION_MODE_MANUAL_T2"].includes(this.controllerState.operation_mode)}get canBeMoved(){return this.isMoveableSafetyState&&this.isMoveableOperationMode&&this.activationState==="active"}async deactivate(){if(this.activationState!=="active"){console.error("Tried to deactivate while already deactivating");return}k.runInAction(()=>{this.activationState="deactivating"});try{await this.nova.api.controller.setDefaultMode(this.cellId,this.controllerId,"ROBOT_SYSTEM_MODE_MONITOR"),k.runInAction(()=>{this.activationState="inactive"})}catch(e){throw k.runInAction(()=>{this.activationState="active"}),e}}async activate(){if(this.activationState!=="inactive"){console.error("Tried to activate while already activating");return}k.runInAction(()=>{this.activationState="activating"});try{await this.nova.api.controller.setDefaultMode(this.cellId,this.controllerId,"ROBOT_SYSTEM_MODE_CONTROL"),k.runInAction(()=>{this.activationState="active"})}catch(e){throw k.runInAction(()=>{this.activationState="inactive"}),e}}toggleActivation(){this.activationState==="inactive"?this.activate():this.activationState==="active"&&this.deactivate()}dispose(){this.motionStateSocket.close(),this.connectedJoggingSocket&&this.connectedJoggingSocket.close()}setJoggingVelocity(e){this.joggingVelocity=e}}const K="rgba(255, 255, 255, 1)",Gn={components:{MuiCssBaseline:{styleOverrides:{".MuiDataGrid-panelContent":{borderRadius:"16px !important","& .MuiPaper-root":{borderRadius:"16px !important"}},".MuiDataGrid-filterForm":{borderRadius:"16px !important","& .MuiInputBase-root":{borderRadius:"16px !important","& fieldset":{borderRadius:"16px !important"},"& .MuiOutlinedInput-notchedOutline":{borderRadius:"16px !important"}},"& .MuiTextField-root":{"& .MuiInputBase-root":{borderRadius:"16px !important","& fieldset":{borderRadius:"16px !important"},"& .MuiOutlinedInput-notchedOutline":{borderRadius:"16px !important"}}}},".MuiDataGrid-filterFormValueInput":{"& .MuiInputBase-root":{borderRadius:"16px !important","& fieldset":{borderRadius:"16px !important"},"& .MuiOutlinedInput-notchedOutline":{borderRadius:"16px !important"}}}}},MuiDataGrid:{styleOverrides:{panelContent:{borderRadius:"16px !important"},filterForm:{"& .MuiInputBase-root":{borderRadius:`${H.RadiusSm} !important`,"& fieldset":{borderRadius:`${H.RadiusSm} !important`},"& .MuiOutlinedInput-notchedOutline":{borderRadius:`${H.RadiusSm} !important`}}},filterFormValueInput:{"& .MuiInputBase-root":{borderRadius:`${H.RadiusSm} !important`,"& fieldset":{borderRadius:`${H.RadiusSm} !important`},"& .MuiOutlinedInput-notchedOutline":{borderRadius:`${H.RadiusSm} !important`}}}}}},componentsExt:{JoggingPanel:{JoggingCartesian:{Axis:{X:{backgroundColor:"rgba(215, 66, 56, 1)",borderColor:"rgba(215, 66, 56, 1)",buttonBackgroundColor:{default:"rgba(241, 77, 66, 1)",pressed:"rgba(138, 41, 35, 1)",hovered:"rgba(241, 77, 66, 1)",disabled:"rgba(241, 77, 66, 1)"},color:"rgba(255, 198, 198, 1)",labelColor:K},Y:{backgroundColor:"rgba(20, 151, 108, 1)",borderColor:"rgba(20, 151, 108, 1)",buttonBackgroundColor:{default:"rgba(28, 188, 135, 1)",pressed:"rgba(11, 89, 63, 1)",disabled:"rgba(28, 188, 135, 1)",hovered:"rgba(28, 188, 135, 1)"},color:"rgba(215, 255, 242, 1)",labelColor:K},Z:{backgroundColor:"rgba(1, 87, 155, 1)",borderColor:"rgba(1, 87, 155, 1)",buttonBackgroundColor:{default:"rgba(2, 136, 209, 1)",pressed:"rgba(2, 64, 114, 1)",disabled:"rgba(2, 136, 209, 1)",hovered:"rgba(2, 136, 209, 1)"},color:"rgba(210, 239, 255, 1)",labelColor:K}}},JoggingJoint:{Joint:{arrowColor:K}},VelocitySlider:{sliderLegendColor:K}}}};function Ke(...t){const e=t.map(n=>{var r;if(((r=n==null?void 0:n.palette)==null?void 0:r.mode)==="light"){console.warn("[createNovaTheme] palette.mode 'light' is not supported — light tokens are not yet available. Falling back to dark mode. Remove palette.mode from your theme options to silence this warning.");const{mode:a,...i}=n.palette;return{...n,palette:i}}return n});return zt.createNovaMuiTheme(Gn,...e)}function Hn(t={}){return Ke(t)}exports.AdornedTextField=Vt;exports.AppHeader=Nt;exports.ConnectedMotionGroup=ae;exports.CycleTimer=Xt;exports.JoggerConnection=le;exports.JoggingCartesianAxisControl=ge;exports.JoggingJointValueControl=ze;exports.JoggingPanel=Sn;exports.JoggingStore=ce;exports.LoadingCover=qe;exports.LoadingErrorMessage=Ne;exports.LogPanel=kn;exports.LogStore=Ze;exports.LogViewer=Xe;exports.MotionStreamConnection=se;exports.NoMotionGroupModal=En;exports.PoseCartesianValues=Cn;exports.PoseJointValues=jn;exports.RobotListItem=An;exports.RobotSetupReadinessIndicator=Qe;exports.RobotSetupReadinessState=be;exports.SelectableFab=Dn;exports.TabBar=Fn;exports.Timer=Nn;exports.VelocitySlider=Ge;exports.VelocitySliderLabel=xe;exports.WandelbotsDataGrid=Be;exports.createDebugMessage=wn;exports.createErrorMessage=In;exports.createInfoMessage=Tn;exports.createLogMessage=te;exports.createNovaMuiTheme=Hn;exports.createNovaTheme=Ke;exports.createWarningMessage=Mn;exports.jointValuesEqual=me;exports.poseEqual=$e;exports.tcpMotionEqual=fe;exports.unwrapRotationVector=Ve;
|
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/theming-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/theming-BwZXb5-H.cjs"),o=require("./chunks/interpolation-C9sLsved.cjs"),t=require("./chunks/externalizeComponent-OO4jcrz5.cjs"),a=require("./chunks/SafetyBar-DPrv_OQA.cjs");exports.AdornedTextField=e.AdornedTextField;exports.AppHeader=e.AppHeader;exports.ConnectedMotionGroup=e.ConnectedMotionGroup;exports.CycleTimer=e.CycleTimer;exports.JoggerConnection=e.JoggerConnection;exports.JoggingCartesianAxisControl=e.JoggingCartesianAxisControl;exports.JoggingJointValueControl=e.JoggingJointValueControl;exports.JoggingPanel=e.JoggingPanel;exports.JoggingStore=e.JoggingStore;exports.LoadingCover=e.LoadingCover;exports.LoadingErrorMessage=e.LoadingErrorMessage;exports.LogPanel=e.LogPanel;exports.LogStore=e.LogStore;exports.LogViewer=e.LogViewer;exports.MotionStreamConnection=e.MotionStreamConnection;exports.NoMotionGroupModal=e.NoMotionGroupModal;exports.PoseCartesianValues=e.PoseCartesianValues;exports.PoseJointValues=e.PoseJointValues;exports.RobotListItem=e.RobotListItem;exports.RobotSetupReadinessIndicator=e.RobotSetupReadinessIndicator;exports.RobotSetupReadinessState=e.RobotSetupReadinessState;exports.SelectableFab=e.SelectableFab;exports.TabBar=e.TabBar;exports.Timer=e.Timer;exports.VelocitySlider=e.VelocitySlider;exports.VelocitySliderLabel=e.VelocitySliderLabel;exports.WandelbotsDataGrid=e.WandelbotsDataGrid;exports.createDebugMessage=e.createDebugMessage;exports.createErrorMessage=e.createErrorMessage;exports.createInfoMessage=e.createInfoMessage;exports.createLogMessage=e.createLogMessage;exports.createNovaMuiTheme=e.createNovaMuiTheme;exports.createNovaTheme=e.createNovaTheme;exports.createWarningMessage=e.createWarningMessage;exports.jointValuesEqual=e.jointValuesEqual;exports.poseEqual=e.poseEqual;exports.tcpMotionEqual=e.tcpMotionEqual;exports.unwrapRotationVector=e.unwrapRotationVector;exports.ProgramControl=o.ProgramControl;exports.ProgramState=o.ProgramState;exports.ProgramStateIndicator=o.ProgramStateIndicator;exports.ValueInterpolator=o.ValueInterpolator;exports.useAnimationFrame=o.useAnimationFrame;exports.useAutorun=o.useAutorun;exports.useInterpolation=o.useInterpolation;exports.useMounted=o.useMounted;exports.useReaction=o.useReaction;exports.i18n=t.i18n;exports.SafetyBar=a.SafetyBar;
|
package/dist/core.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as o, b as s, u as t, C as r, v as n, d as i, e as g, f as l, J as u, h as c, i as d, j as m, L as p, p as M, M as S, N as b, P as C, g as V, R as L, r as P, q as f, S as J, T as R, s as x, V as T, t as A, W as I, l as y, o as E, m as q, k as v, a as N, c as h, n as w, w as F, x as G, y as W, z as j } from "./chunks/theming-
|
|
1
|
+
import { A as o, b as s, u as t, C as r, v as n, d as i, e as g, f as l, J as u, h as c, i as d, j as m, L as p, p as M, M as S, N as b, P as C, g as V, R as L, r as P, q as f, S as J, T as R, s as x, V as T, t as A, W as I, l as y, o as E, m as q, k as v, a as N, c as h, n as w, w as F, x as G, y as W, z as j } from "./chunks/theming-B2dYJ4Ca.js";
|
|
2
2
|
import { a as D, P as k, b as z, V as H, e as K, c as O, f as Q, u as U, d as X } from "./chunks/interpolation-DG8VTxzS.js";
|
|
3
3
|
import { i as Z } from "./chunks/externalizeComponent-EDymnaGR.js";
|
|
4
|
-
import { S as $ } from "./chunks/SafetyBar-
|
|
4
|
+
import { S as $ } from "./chunks/SafetyBar-Cy9DiXp9.js";
|
|
5
5
|
export {
|
|
6
6
|
o as AdornedTextField,
|
|
7
7
|
s as AppHeader,
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./chunks/MotionGroupVisualizer-zDM0Lgd-.cjs"),e=require("./chunks/theming-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./chunks/MotionGroupVisualizer-zDM0Lgd-.cjs"),e=require("./chunks/theming-BwZXb5-H.cjs"),t=require("./chunks/interpolation-C9sLsved.cjs"),r=require("./chunks/externalizeComponent-OO4jcrz5.cjs"),a=require("./chunks/SafetyBar-DPrv_OQA.cjs");exports.CollisionSceneRenderer=o.CollisionSceneRenderer;exports.LinearAxis=o.LinearAxis;exports.MANUFACTURER_HOME_CONFIGS=o.MANUFACTURER_HOME_CONFIGS;exports.MotionGroupVisualizer=o.MotionGroupVisualizer;exports.PresetEnvironment=o.PresetEnvironment;exports.Robot=o.Robot;exports.RobotCard=o.RobotCard;exports.SafetyZonesRenderer=o.SafetyZonesRenderer;exports.SupportedLinearAxis=o.SupportedLinearAxis;exports.SupportedRobot=o.SupportedRobot;exports.TrajectoryRenderer=o.TrajectoryRenderer;exports.defaultAxisConfig=o.defaultAxisConfig;exports.defaultGetModel=o.defaultGetModel;exports.extractManufacturer=o.extractManufacturer;exports.getDefaultHomeConfig=o.getDefaultHomeConfig;exports.AdornedTextField=e.AdornedTextField;exports.AppHeader=e.AppHeader;exports.ConnectedMotionGroup=e.ConnectedMotionGroup;exports.CycleTimer=e.CycleTimer;exports.JoggerConnection=e.JoggerConnection;exports.JoggingCartesianAxisControl=e.JoggingCartesianAxisControl;exports.JoggingJointValueControl=e.JoggingJointValueControl;exports.JoggingPanel=e.JoggingPanel;exports.JoggingStore=e.JoggingStore;exports.LoadingCover=e.LoadingCover;exports.LoadingErrorMessage=e.LoadingErrorMessage;exports.LogPanel=e.LogPanel;exports.LogStore=e.LogStore;exports.LogViewer=e.LogViewer;exports.MotionStreamConnection=e.MotionStreamConnection;exports.NoMotionGroupModal=e.NoMotionGroupModal;exports.PoseCartesianValues=e.PoseCartesianValues;exports.PoseJointValues=e.PoseJointValues;exports.RobotListItem=e.RobotListItem;exports.RobotSetupReadinessIndicator=e.RobotSetupReadinessIndicator;exports.RobotSetupReadinessState=e.RobotSetupReadinessState;exports.SelectableFab=e.SelectableFab;exports.TabBar=e.TabBar;exports.Timer=e.Timer;exports.VelocitySlider=e.VelocitySlider;exports.VelocitySliderLabel=e.VelocitySliderLabel;exports.WandelbotsDataGrid=e.WandelbotsDataGrid;exports.createDebugMessage=e.createDebugMessage;exports.createErrorMessage=e.createErrorMessage;exports.createInfoMessage=e.createInfoMessage;exports.createLogMessage=e.createLogMessage;exports.createNovaMuiTheme=e.createNovaMuiTheme;exports.createNovaTheme=e.createNovaTheme;exports.createWarningMessage=e.createWarningMessage;exports.jointValuesEqual=e.jointValuesEqual;exports.poseEqual=e.poseEqual;exports.tcpMotionEqual=e.tcpMotionEqual;exports.unwrapRotationVector=e.unwrapRotationVector;exports.ProgramControl=t.ProgramControl;exports.ProgramState=t.ProgramState;exports.ProgramStateIndicator=t.ProgramStateIndicator;exports.ValueInterpolator=t.ValueInterpolator;exports.useAnimationFrame=t.useAnimationFrame;exports.useAutorun=t.useAutorun;exports.useInterpolation=t.useInterpolation;exports.useMounted=t.useMounted;exports.useReaction=t.useReaction;exports.i18n=r.i18n;exports.SafetyBar=a.SafetyBar;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,96 +1,71 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { A as
|
|
3
|
-
import { a as sa, P as ta, b as ra, V as na, e as ia, c as
|
|
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-BRec-k-p.js";
|
|
2
|
+
import { A as f, b as R, u as b, C as x, v as L, d as V, e as A, f as P, J as T, h as E, i as J, j as y, L as I, p as G, M as N, N as v, P as F, g as h, R as q, r as j, q as w, S as D, T as H, s as W, V as z, t as B, W as O, l as U, o as _, m as k, k as Z, a as K, c as Q, n as X, w as Y, x as $, y as aa, z as ea } from "./chunks/theming-B2dYJ4Ca.js";
|
|
3
|
+
import { a as sa, P as ta, b as ra, V as na, e as ia, c as ga, f as la, u as ua, d as da } from "./chunks/interpolation-DG8VTxzS.js";
|
|
4
4
|
import { i as pa } from "./chunks/externalizeComponent-EDymnaGR.js";
|
|
5
|
-
import { S as
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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,
|
|
7
|
+
f as AdornedTextField,
|
|
8
|
+
R as AppHeader,
|
|
9
|
+
o as CollisionSceneRenderer,
|
|
10
|
+
b as ConnectedMotionGroup,
|
|
11
|
+
x as CycleTimer,
|
|
12
|
+
L as JoggerConnection,
|
|
13
|
+
V as JoggingCartesianAxisControl,
|
|
26
14
|
A as JoggingJointValueControl,
|
|
27
|
-
|
|
28
|
-
|
|
15
|
+
P as JoggingPanel,
|
|
16
|
+
T as JoggingStore,
|
|
29
17
|
s as LinearAxis,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
18
|
+
E as LoadingCover,
|
|
19
|
+
J as LoadingErrorMessage,
|
|
20
|
+
y as LogPanel,
|
|
21
|
+
I as LogStore,
|
|
22
|
+
G as LogViewer,
|
|
35
23
|
t as MANUFACTURER_HOME_CONFIGS,
|
|
36
24
|
r as MotionGroupVisualizer,
|
|
37
25
|
N as MotionStreamConnection,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
Ga as OperationModeManualIcon,
|
|
42
|
-
Ta as OrientationCoordSystemIcon,
|
|
43
|
-
Va as OrientationToolIcon,
|
|
44
|
-
h as PoseCartesianValues,
|
|
45
|
-
G as PoseJointValues,
|
|
26
|
+
v as NoMotionGroupModal,
|
|
27
|
+
F as PoseCartesianValues,
|
|
28
|
+
h as PoseJointValues,
|
|
46
29
|
n as PresetEnvironment,
|
|
47
30
|
sa as ProgramControl,
|
|
48
31
|
ta as ProgramState,
|
|
49
32
|
ra as ProgramStateIndicator,
|
|
50
33
|
i as Robot,
|
|
51
|
-
|
|
52
|
-
xa as RobotIcon,
|
|
34
|
+
g as RobotCard,
|
|
53
35
|
q as RobotListItem,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
Ia as SafetyBar,
|
|
58
|
-
qa as SafetyStateErrorIcon,
|
|
59
|
-
va as SafetyStateEstopIcon,
|
|
60
|
-
Ha as SafetyStateManualActionRequiredIcon,
|
|
61
|
-
Wa as SafetyStateNormalIcon,
|
|
62
|
-
ja as SafetyStateStopIcon,
|
|
36
|
+
j as RobotSetupReadinessIndicator,
|
|
37
|
+
w as RobotSetupReadinessState,
|
|
38
|
+
Sa as SafetyBar,
|
|
63
39
|
l as SafetyZonesRenderer,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
40
|
+
D as SelectableFab,
|
|
41
|
+
u as SupportedLinearAxis,
|
|
42
|
+
d as SupportedRobot,
|
|
43
|
+
H as TabBar,
|
|
44
|
+
W as Timer,
|
|
45
|
+
c as TrajectoryRenderer,
|
|
70
46
|
na as ValueInterpolator,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
z as WandelbotsDataGrid,
|
|
47
|
+
z as VelocitySlider,
|
|
48
|
+
B as VelocitySliderLabel,
|
|
49
|
+
O as WandelbotsDataGrid,
|
|
75
50
|
U as createDebugMessage,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
51
|
+
_ as createErrorMessage,
|
|
52
|
+
k as createInfoMessage,
|
|
53
|
+
Z as createLogMessage,
|
|
54
|
+
K as createNovaMuiTheme,
|
|
55
|
+
Q as createNovaTheme,
|
|
56
|
+
X as createWarningMessage,
|
|
82
57
|
p as defaultAxisConfig,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
58
|
+
M as defaultGetModel,
|
|
59
|
+
S as extractManufacturer,
|
|
60
|
+
m as getDefaultHomeConfig,
|
|
86
61
|
pa as i18n,
|
|
87
|
-
|
|
62
|
+
Y as jointValuesEqual,
|
|
88
63
|
$ as poseEqual,
|
|
89
64
|
aa as tcpMotionEqual,
|
|
90
|
-
|
|
65
|
+
ea as unwrapRotationVector,
|
|
91
66
|
ia as useAnimationFrame,
|
|
92
|
-
|
|
67
|
+
ga as useAutorun,
|
|
93
68
|
la as useInterpolation,
|
|
94
|
-
|
|
95
|
-
|
|
69
|
+
ua as useMounted,
|
|
70
|
+
da as useReaction
|
|
96
71
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wandelbots/wandelbots-js-react-components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
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";
|