@wandelbots/wandelbots-js-react-components 2.35.0 → 2.36.0-pr.feature-design-pass.378.e01a6c5
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 +141 -151
- package/dist/components/CopyableText.d.ts +3 -2
- package/dist/components/CopyableText.d.ts.map +1 -1
- package/dist/components/SelectableFab.d.ts +2 -1
- package/dist/components/SelectableFab.d.ts.map +1 -1
- package/dist/components/TabBar.d.ts +2 -0
- package/dist/components/TabBar.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +221 -223
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/components/AppHeader.tsx +1 -1
- package/src/components/CopyableText.tsx +70 -73
- package/src/components/LogViewer.tsx +1 -1
- package/src/components/ProgramControl.tsx +4 -4
- package/src/components/SelectableFab.tsx +14 -15
- package/src/components/TabBar.tsx +12 -11
package/dist/index.cjs
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
22
|
<%s key={someKey} {...props} />`,xe,me,Z,me),se[me+xe]=!0)}if(me=null,le!==void 0&&(r(le),me=""+le),s(X)&&(r(X.key),me=""+X.key),"key"in X){le={};for(var ie in X)ie!=="key"&&(le[ie]=X[ie])}else le=X;return me&&i(le,typeof H=="function"?H.displayName||H.name||"Unknown":H),c(H,me,ae,Le,o(),le,be,Se)}function d(H){typeof H=="object"&&H!==null&&H.$$typeof===p&&H._store&&(H._store.validated=1)}var h=J,p=Symbol.for("react.transitional.element"),f=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),O=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),y=Symbol.for("react.client.reference"),R=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=Object.prototype.hasOwnProperty,I=Array.isArray,G=console.createTask?console.createTask:function(){return null};h={"react-stack-bottom-frame":function(H){return H()}};var oe,re={},te=h["react-stack-bottom-frame"].bind(h,a)(),ee=G(n(a)),se={};Dn.Fragment=m,Dn.jsx=function(H,X,le,xe,Le){var ae=1e4>R.recentlyCreatedOwnerStacks++;return u(H,X,le,!1,xe,Le,ae?Error("react-stack-top-frame"):te,ae?G(n(H)):ee)},Dn.jsxs=function(H,X,le,xe,Le){var ae=1e4>R.recentlyCreatedOwnerStacks++;return u(H,X,le,!0,xe,Le,ae?Error("react-stack-top-frame"):te,ae?G(n(H)):ee)}}()),Dn}var kc;function Cg(){return kc||(kc=1,process.env.NODE_ENV==="production"?Go.exports=Og():Go.exports=wg()),Go.exports}var g=Cg();function Ni(){return g.jsx(ut.Environment,{children:g.jsx(Pg,{})})}function Pg({positions:e=[2,0,2,0,2,0,2,0]}){return g.jsxs(g.Fragment,{children:[g.jsx(ut.Lightformer,{intensity:5,"rotation-x":Math.PI/2,position:[0,5,-9],scale:[10,10,1]}),g.jsx("group",{rotation:[0,.5,0],children:g.jsx("group",{children:e.map((t,r)=>g.jsx(ut.Lightformer,{form:"circle",intensity:5,rotation:[Math.PI/2,0,0],position:[t,4,r*4],scale:[3,1,1]},r))})}),g.jsx(ut.Lightformer,{intensity:40,"rotation-y":Math.PI/2,position:[-5,1,-1],scale:[20,.1,1]}),g.jsx(ut.Lightformer,{intensity:20,"rotation-y":-Math.PI,position:[-5,-2,-1],scale:[20,.1,1]}),g.jsx(ut.Lightformer,{"rotation-y":Math.PI/2,position:[-5,-1,-1],scale:[20,.5,1],intensity:5}),g.jsx(ut.Lightformer,{"rotation-y":-Math.PI/2,position:[10,1,0],scale:[20,1,1],intensity:10}),g.jsx(ut.Lightformer,{form:"ring",color:"white",intensity:5,scale:10,position:[-15,4,-18],target:[0,0,0]})]})}function Tg(e){if(e.length<3)return console.log("Not enough vertices to define a plane"),{isCoplanar:!1};const t=new Be.Vector3(e[0].x,e[0].y,e[0].z),r=new Be.Vector3(e[1].x,e[1].y,e[1].z),n=new Be.Vector3(e[2].x,e[2].y,e[2].z),o=new Be.Vector3().subVectors(r,t),a=new Be.Vector3().subVectors(n,t),s=new Be.Vector3().crossVectors(o,a).normalize();for(let i=3;i<e.length;i++){const l=new Be.Vector3(e[i].x,e[i].y,e[i].z),c=new Be.Vector3().subVectors(l,t),u=s.dot(c);if(Math.abs(u)>1e-6)return console.log("Vertices are not on the same plane"),{isCoplanar:!1}}return{isCoplanar:!0,normal:s}}function Rg({safetyZones:e,...t}){return g.jsx("group",{...t,children:e.map((r,n)=>{let o=[];return r.geometry&&(r.geometry.compound?o=r.geometry.compound.child_geometries:r.geometry.convex_hull&&(o=[r.geometry])),o.map((a,s)=>{if(!a.convex_hull)return null;const i=a.convex_hull.vertices.map(u=>new Be.Vector3(u.x/1e3,u.y/1e3,u.z/1e3)),l=Tg(i);if(l.isCoplanar&&l.normal){const d=new Be.Vector3().addVectors(i[0],l.normal.multiplyScalar(1e-4));i.push(d)}let c;try{c=new fg.ConvexGeometry(i)}catch(u){return console.log("Error creating ConvexGeometry:",u),null}return g.jsx("mesh",{geometry:c,children:g.jsx("meshStandardMaterial",{attach:"material",color:"#009f4d",opacity:.2,depthTest:!1,depthWrite:!1,transparent:!0,polygonOffset:!0,polygonOffsetFactor:-s},n)},`${n}-${s}`)})})})}function Ag({trajectory:e,...t}){var n;const r=((n=e.trajectory)==null?void 0:n.map(o=>o.tcp_pose?new Be.Vector3(o.tcp_pose.position.x/1e3,o.tcp_pose.position.z/1e3,-o.tcp_pose.position.y/1e3):null).filter(o=>o!==null))||[];return g.jsx("group",{...t,children:r.length>0&&g.jsx(ut.Line,{points:r,lineWidth:3,polygonOffset:!0,polygonOffsetFactor:10,polygonOffsetUnits:10})})}const _g={"Jogging.Cartesian.Translation.velocityMmPerSec.lb":"{{amount}} mm/s","Jogging.Cartesian.Rotation.velocityDegPerSec.lb":"{{amount}}°/s","Jogging.Velocity.lb":"Geschwindigkeit","General.degree.variable":"{{amount}}°","General.mm.variable":"{{amount}} mm","Jogging.Cartesian.MotionType.lb":"Bewegungstyp","Jogging.Cartesian.Translation.bt":"Translation","Jogging.Cartesian.Rotation.bt":"Rotation","Jogging.Joints.JointValues.lb":"Gelenkwerte","Jogging.Increment.Continuous.dd":"Fortlaufend","Jogging.Cartesian.Orientation.lb":"Orientierung","Jogging.JointLimitsReached.lb":"Gelenkgrenzen für Gelenk {{jointNumbers}} erreicht","Jogging.Orientation.coordsys":"Roboterbasis","Jogging.Orientation.tool":"Werkzeug","SafetyBar.ActivationToggle.Activate.bt":"Aktivieren","SafetyBar.ActivationToggle.Activated.bt":"Aktiviert","SafetyBar.ActivationToggle.Activating.bt":"Wird aktiviert…","SafetyBar.ActivationToggle.Deactivating.bt":"Wird deaktiviert…","SafetyBar.ControllerType.Physical.lb":"Physisch","SafetyBar.ControllerType.Virtual.lb":"Virtuell","SafetyBar.MotionGroup.Physical.Explanation.lb":"<code>{{motionGroupId}}</code> ist ein physische Robotersteuerung. Für die Bewegung dieses Roboters sind <strong>Sicherheitsmaßnahmen</strong> aktiv.","SafetyBar.MotionGroup.Virtual.Explanation.lb":"<1>{{motionGroupId}}</1> ist eine virtuelle Robotersteuerung ohne physisches Gegenstück. Der Roboter kann ohne Sicherheitsmaßnahmen bewegt werden.","SafetyBar.OperationMode.Auto.Explanation.lb":"Automatischer Betriebsmodus der Robotersteuerung aktiv. Automatisierte Bewegung ohne manuelle Bestätigung freigegeben.","SafetyBar.OperationMode.Automatic.ti":"Automatisch","SafetyBar.OperationMode.Error.Explanation.lb":"Fehler beim Abrufen des Betriebsmodus. Originalhandbediengerät des Roboters verwenden, um Fehler zu lösen.","SafetyBar.OperationMode.Error.lb":"Fehler","SafetyBar.OperationMode.Manual.Explanation.lb":`Die Robotersteuerung befindet sich im manuellen Betriebsmodus.
|
|
23
|
-
Bei einem physischen Roboter bedeutet dies im Allgemeinen, dass ein Freigabeschalter gedrückt werden muss, damit sich der Roboter erfolgreich bewegen kann.`,"SafetyBar.OperationMode.Manual.lb":"Manuell","SafetyBar.OperationMode.ti":"Betriebsmodus","SafetyBar.SafetyState.Error.Explanation.lb":"Die Robotersteuerung ist in einen unerwarteten Sicherheitszustand eingetreten.","SafetyBar.SafetyState.Error.lb":"Fehler","SafetyBar.SafetyState.Estop.lb":"NOT-AUS","SafetyBar.SafetyState.ManualActionRequired.Explanation.lb":"Die Robotersteuerung ist in einen Sicherheitszustand eingetreten, der manuelle Maßnahmen zur Behebung erfordert.","SafetyBar.SafetyState.ManualActionRequired.lb":"Aktion erforderlich","SafetyBar.SafetyState.Normal.Explanation.lb":"Die Robotersteuerung befindet sich in einem sicheren Zustand. Roboterbewegungen sind möglich.","SafetyBar.SafetyState.Normal.lb":"Sicher","SafetyBar.SafetyState.Stop.Explanation.lb":"Die Robotersteuerung ist in einen Stoppzustand übergegangen. Bis der Stoppzustand aufgelöst ist, ist keine Bewegung mehr möglich.","SafetyBar.SafetyState.Stop.lb":"Stopp","SafetyBar.SafetyState.ti":"Sicherheitszustand","SafetyBar.StopState.Estop.Explanation.lb":"NOT-AUS aktiviert. NOT-AUS freischalten, um Roboter zu bewegen.","Jogging.Increment.hlb":"Schrittgröße","Jogging.CoordinateSystem.hlb":"Koordinatensystem","Jogging.Cartesian.bt":"Kartesisch","Jogging.Joints.bt":"Gelenke","Jogging.Velocity.bt":"Geschwindigkeit","CycleTimer.RemainingTime.lb":"Verbleibende Zeit","CycleTimer.OfTime.lb":"von {{time}} min.","CycleTimer.Time.lb":"{{time}} min.","CycleTimer.Error.lb":"Fehler","ProgramControl.Start.bt":"Start","ProgramControl.Resume.bt":"Weiter","ProgramControl.Retry.bt":"Wiederholen","ProgramControl.Pause.bt":"Pause","ProgramControl.Stop.bt":"Stopp","ProgramStateIndicator.Running.lb":"In Betrieb","ProgramStateIndicator.Error.lb":"Fehler","ProgramStateIndicator.EStop.lb":"Not-Aus","ProgramStateIndicator.Idle.lb":"Leerlauf","ProgramStateIndicator.Paused.lb":"Pausiert","ProgramStateIndicator.Ready.lb":"Bereit","ProgramStateIndicator.Stopped.lb":"Gestoppt","ProgramStateIndicator.Auto.lb":"Auto","ProgramStateIndicator.Manual.lb":"Manuell","ProgramStateIndicator.ManualT1.lb":"Manuell T1","ProgramStateIndicator.ManualT2.lb":"Manuell T2","RobotSetupReadinessIndicator.Ready.lb":"Bereit","RobotSetupReadinessIndicator.RobotDisconnected.lb":"Roboter getrennt","RobotSetupReadinessIndicator.PreconditionNotFulfilled.lb":"Voraussetzung nicht erfüllt","RobotCard.Runtime.lb":"Laufzeit","RobotCard.DriveToHome.bt":"Zur Home-Position fahren"},Eg={"Jogging.Cartesian.Translation.velocityMmPerSec.lb":"{{amount}} mm/s","Jogging.Cartesian.Rotation.velocityDegPerSec.lb":"{{amount}}°/s","Jogging.Velocity.lb":"Velocity","General.degree.variable":"{{amount}}°","General.mm.variable":"{{amount}} mm","Jogging.Cartesian.MotionType.lb":"Motion type","Jogging.Cartesian.Translation.bt":"Translation","Jogging.Cartesian.Rotation.bt":"Rotation","Jogging.Joints.JointValues.lb":"Joint values","Jogging.Increment.Continuous.dd":"Continuous","Jogging.Cartesian.Orientation.lb":"Orientation","Jogging.Activating.lb":"Activating jogging","Jogging.JointLimitsReached.lb":"Joint limit reached for joint {{jointNumbers}}","Jogging.Orientation.coordsys":"Robot base","Jogging.Orientation.tool":"Tool","SafetyBar.ActivationToggle.Activate.bt":"Activate","SafetyBar.ActivationToggle.Activated.bt":"Activated","SafetyBar.ActivationToggle.Activating.bt":"Activating","SafetyBar.ActivationToggle.Deactivating.bt":"Deactivating","SafetyBar.ControllerType.Physical.lb":"Physical","SafetyBar.ControllerType.Virtual.lb":"Virtual","SafetyBar.MotionGroup.Physical.Explanation.lb":"<code>{{motionGroupId}}</code> is a physical robot controller. <strong>Safety precautions</strong> are active for the movement of this robot.","SafetyBar.MotionGroup.Virtual.Explanation.lb":"<1>{{motionGroupId}}</1> is a virtual robot controller with no physical counterpart. It can be freely manipulated without safety precautions.","SafetyBar.OperationMode.Auto.Explanation.lb":"Automatic operation mode active. Automated movement without manual confirmation enabled.","SafetyBar.OperationMode.Automatic.ti":"Automatic","SafetyBar.OperationMode.Error.Explanation.lb":"Failed to get operation mode. Use the original control panel to resolve the error.","SafetyBar.OperationMode.Error.lb":"Error","SafetyBar.OperationMode.Manual.Explanation.lb":"The robot controller is in manual operation mode. On a physical robot, this generally indicates that an enabling switch must be held for the robot to move successfully.","SafetyBar.OperationMode.Manual.lb":"Manual","SafetyBar.OperationMode.ti":"Operation mode","SafetyBar.SafetyState.Error.Explanation.lb":"The robot controller has entered an unexpected safety state.","SafetyBar.SafetyState.Error.lb":"Error","SafetyBar.SafetyState.Estop.lb":"E-Stop","SafetyBar.SafetyState.ManualActionRequired.Explanation.lb":"The robot controller has entered a safety state requiring manual action to resolve.","SafetyBar.SafetyState.ManualActionRequired.lb":"Action required","SafetyBar.SafetyState.Normal.Explanation.lb":"The robot controller is in a safe state. Robot movement is enabled.","SafetyBar.SafetyState.Normal.lb":"Safe","SafetyBar.SafetyState.Stop.Explanation.lb":"The robot controller has entered a stop state. Movement is no longer possible until the stop state is resolved.","SafetyBar.SafetyState.Stop.lb":"Stop","SafetyBar.SafetyState.ti":"Safety state","SafetyBar.StopState.Estop.Explanation.lb":"An emergency stop of the robot controller has been triggered. Movement of the robot is no longer possible until the estop is released.","Jogging.Increment.hlb":"Increment","Jogging.CoordinateSystem.hlb":"Coordinate system","Jogging.Cartesian.bt":"Cartesian","Jogging.Joints.bt":"Joints","Jogging.Velocity.bt":"Velocity","CycleTimer.RemainingTime.lb":"Time remaining","CycleTimer.OfTime.lb":"of {{time}} min.","CycleTimer.Time.lb":"{{time}} min.","CycleTimer.Error.lb":"Error","ProgramControl.Start.bt":"Start","ProgramControl.Resume.bt":"Resume","ProgramControl.Retry.bt":"Retry","ProgramControl.Pause.bt":"Pause","ProgramControl.Stop.bt":"Stop","ProgramStateIndicator.Running.lb":"Running","ProgramStateIndicator.Error.lb":"Error","ProgramStateIndicator.EStop.lb":"E-Stop","ProgramStateIndicator.Idle.lb":"Idle","ProgramStateIndicator.Paused.lb":"Paused","ProgramStateIndicator.Ready.lb":"Ready","ProgramStateIndicator.Stopped.lb":"Stopped","ProgramStateIndicator.Auto.lb":"Auto","ProgramStateIndicator.Manual.lb":"Manual","ProgramStateIndicator.ManualT1.lb":"Manual T1","ProgramStateIndicator.ManualT2.lb":"Manual T2","RobotSetupReadinessIndicator.Ready.lb":"Ready","RobotSetupReadinessIndicator.RobotDisconnected.lb":"Robot disconnected","RobotSetupReadinessIndicator.PreconditionNotFulfilled.lb":"Precondition not fulfilled","RobotCard.Runtime.lb":"Runtime","RobotCard.DriveToHome.bt":"Drive to Home"},_l=gg.createInstance();_l.use(yg).init({supportedLngs:["en","de"],resources:{en:{translations:Eg},de:{translations:_g}},ns:["translations"],defaultNS:"translations",detection:{order:["navigator","htmlTag"]}});function Xe(e){return r=>g.jsx(Ig,{children:g.jsx(e,{...r})})}const Ig=({children:e})=>g.jsx(_e.I18nextProvider,{i18n:_l,children:e}),Vg=e=>g.jsx(P.SvgIcon,{...e,viewBox:"0 0 10 8",children:g.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"})}),Mg=Xe(Oe.observer(e=>{const{appIcon:t,appName:r,apps:n=[],onAppSelect:o,sx:a}=e,[s,i]=J.useState(null),l=!!s,c=h=>{i(h.currentTarget)},u=()=>{i(null)},d=h=>{u(),h.onClick?h.onClick():h.href&&(window.location.href=h.href),o==null||o(h)};return g.jsxs(g.Fragment,{children:[g.jsx(P.AppBar,{position:"static",sx:{boxShadow:"none",backgroundImage:"none","& .MuiAppBar-root":{backgroundImage:"none",backgroundColor:"transparent"},...a},children:g.jsxs(P.Toolbar,{sx:{minHeight:"64px !important"},children:[g.jsx(P.Box,{sx:{mr:2,display:"flex",alignItems:"center"},children:t}),g.jsxs(P.Box,{sx:{display:"flex",alignItems:"center",flexGrow:1},children:[g.jsx(P.Typography,{variant:"h6",component:"div",sx:{fontWeight:700,fontSize:"20px",lineHeight:"24px",letterSpacing:0},children:r}),n.length>0&&g.jsx(P.IconButton,{color:"inherit","aria-label":"switch app","aria-controls":"app-menu","aria-haspopup":"true",onClick:c,sx:{ml:2,width:30,height:30,borderRadius:"8px",padding:"5px",backgroundColor:h=>P.alpha(h.palette.common.white,.1),opacity:1,"&:hover":{backgroundColor:h=>P.alpha(h.palette.common.white,.16)},"& .MuiSvgIcon-root":{fontSize:"10px",width:"10px",height:"8px"}},children:g.jsx(Vg,{})})]})]})}),g.jsx(P.Backdrop,{open:l,onClick:u,sx:{backdropFilter:"blur(4px)",backgroundColor:"rgba(0, 0, 0, 0.3)",zIndex:h=>h.zIndex.modal-1}}),g.jsx(P.Menu,{id:"app-menu",anchorEl:s,open:l,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},sx:{zIndex:h=>h.zIndex.modal,"& .MuiPaper-root":{minWidth:200,mt:1}},children:n.map(h=>g.jsxs(P.MenuItem,{onClick:()=>d(h),sx:{display:"flex",alignItems:"center",gap:2,py:1.5,px:2},children:[g.jsx(P.Box,{sx:{display:"flex",alignItems:"center"},children:h.icon}),g.jsx(P.Typography,{variant:"body1",children:h.name})]},h.id))})]})}));function K(){return K=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},K.apply(null,arguments)}function cr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function es(e,t,r=void 0){const n={};for(const o in e){const a=e[o];let s="",i=!0;for(let l=0;l<a.length;l+=1){const c=a[l];c&&(s+=(i===!0?"":" ")+t(c),i=!1,r&&r[c]&&(s+=" "+r[c]))}n[o]=s}return n}function Uh(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=Uh(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Pt(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=Uh(e))&&(n&&(n+=" "),n+=t);return n}function ur(e,...t){const r=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(n=>r.searchParams.append("args[]",n)),`Minified MUI error #${e}; visit ${r} for the full message.`}const Dh="$$material";function jg(e){for(var t=0,r,n=0,o=e.length;o>=4;++n,o-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var kg={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function $g(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Ug=/[A-Z]|^ms/g,Dg=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Lh=function(t){return t.charCodeAt(1)===45},$c=function(t){return t!=null&&typeof t!="boolean"},Zs=$g(function(e){return Lh(e)?e:e.replace(Ug,"-$&").toLowerCase()}),Uc=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(Dg,function(n,o,a){return ir={name:o,styles:a,next:ir},o})}return kg[t]!==1&&!Lh(t)&&typeof r=="number"&&r!==0?r+"px":r};function Aa(e,t,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var o=r;if(o.anim===1)return ir={name:o.name,styles:o.styles,next:ir},o.name;var a=r;if(a.styles!==void 0){var s=a.next;if(s!==void 0)for(;s!==void 0;)ir={name:s.name,styles:s.styles,next:ir},s=s.next;var i=a.styles+";";return i}return Lg(e,t,r)}}var l=r;return l}function Lg(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o++)n+=Aa(e,t,r[o])+";";else for(var a in r){var s=r[a];if(typeof s!="object"){var i=s;$c(i)&&(n+=Zs(a)+":"+Uc(a,i)+";")}else if(Array.isArray(s)&&typeof s[0]=="string"&&t==null)for(var l=0;l<s.length;l++)$c(s[l])&&(n+=Zs(a)+":"+Uc(a,s[l])+";");else{var c=Aa(e,t,s);switch(a){case"animation":case"animationName":{n+=Zs(a)+":"+c+";";break}default:n+=a+"{"+c+"}"}}}return n}var Dc=/label:\s*([^\s;{]+)\s*(;|$)/g,ir;function Bg(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,o="";ir=void 0;var a=e[0];if(a==null||a.raw===void 0)n=!1,o+=Aa(r,t,a);else{var s=a;o+=s[0]}for(var i=1;i<e.length;i++)if(o+=Aa(r,t,e[i]),n){var l=a;o+=l[i]}Dc.lastIndex=0;for(var c="",u;(u=Dc.exec(o))!==null;)c+="-"+u[1];var d=jg(o)+c;return{name:d,styles:o,next:ir}}/**
|
|
23
|
+
Bei einem physischen Roboter bedeutet dies im Allgemeinen, dass ein Freigabeschalter gedrückt werden muss, damit sich der Roboter erfolgreich bewegen kann.`,"SafetyBar.OperationMode.Manual.lb":"Manuell","SafetyBar.OperationMode.ti":"Betriebsmodus","SafetyBar.SafetyState.Error.Explanation.lb":"Die Robotersteuerung ist in einen unerwarteten Sicherheitszustand eingetreten.","SafetyBar.SafetyState.Error.lb":"Fehler","SafetyBar.SafetyState.Estop.lb":"NOT-AUS","SafetyBar.SafetyState.ManualActionRequired.Explanation.lb":"Die Robotersteuerung ist in einen Sicherheitszustand eingetreten, der manuelle Maßnahmen zur Behebung erfordert.","SafetyBar.SafetyState.ManualActionRequired.lb":"Aktion erforderlich","SafetyBar.SafetyState.Normal.Explanation.lb":"Die Robotersteuerung befindet sich in einem sicheren Zustand. Roboterbewegungen sind möglich.","SafetyBar.SafetyState.Normal.lb":"Sicher","SafetyBar.SafetyState.Stop.Explanation.lb":"Die Robotersteuerung ist in einen Stoppzustand übergegangen. Bis der Stoppzustand aufgelöst ist, ist keine Bewegung mehr möglich.","SafetyBar.SafetyState.Stop.lb":"Stopp","SafetyBar.SafetyState.ti":"Sicherheitszustand","SafetyBar.StopState.Estop.Explanation.lb":"NOT-AUS aktiviert. NOT-AUS freischalten, um Roboter zu bewegen.","Jogging.Increment.hlb":"Schrittgröße","Jogging.CoordinateSystem.hlb":"Koordinatensystem","Jogging.Cartesian.bt":"Kartesisch","Jogging.Joints.bt":"Gelenke","Jogging.Velocity.bt":"Geschwindigkeit","CycleTimer.RemainingTime.lb":"Verbleibende Zeit","CycleTimer.OfTime.lb":"von {{time}} min.","CycleTimer.Time.lb":"{{time}} min.","CycleTimer.Error.lb":"Fehler","ProgramControl.Start.bt":"Start","ProgramControl.Resume.bt":"Weiter","ProgramControl.Retry.bt":"Wiederholen","ProgramControl.Pause.bt":"Pause","ProgramControl.Stop.bt":"Stopp","ProgramStateIndicator.Running.lb":"In Betrieb","ProgramStateIndicator.Error.lb":"Fehler","ProgramStateIndicator.EStop.lb":"Not-Aus","ProgramStateIndicator.Idle.lb":"Leerlauf","ProgramStateIndicator.Paused.lb":"Pausiert","ProgramStateIndicator.Ready.lb":"Bereit","ProgramStateIndicator.Stopped.lb":"Gestoppt","ProgramStateIndicator.Auto.lb":"Auto","ProgramStateIndicator.Manual.lb":"Manuell","ProgramStateIndicator.ManualT1.lb":"Manuell T1","ProgramStateIndicator.ManualT2.lb":"Manuell T2","RobotSetupReadinessIndicator.Ready.lb":"Bereit","RobotSetupReadinessIndicator.RobotDisconnected.lb":"Roboter getrennt","RobotSetupReadinessIndicator.PreconditionNotFulfilled.lb":"Voraussetzung nicht erfüllt","RobotCard.Runtime.lb":"Laufzeit","RobotCard.DriveToHome.bt":"Zur Home-Position fahren"},Eg={"Jogging.Cartesian.Translation.velocityMmPerSec.lb":"{{amount}} mm/s","Jogging.Cartesian.Rotation.velocityDegPerSec.lb":"{{amount}}°/s","Jogging.Velocity.lb":"Velocity","General.degree.variable":"{{amount}}°","General.mm.variable":"{{amount}} mm","Jogging.Cartesian.MotionType.lb":"Motion type","Jogging.Cartesian.Translation.bt":"Translation","Jogging.Cartesian.Rotation.bt":"Rotation","Jogging.Joints.JointValues.lb":"Joint values","Jogging.Increment.Continuous.dd":"Continuous","Jogging.Cartesian.Orientation.lb":"Orientation","Jogging.Activating.lb":"Activating jogging","Jogging.JointLimitsReached.lb":"Joint limit reached for joint {{jointNumbers}}","Jogging.Orientation.coordsys":"Robot base","Jogging.Orientation.tool":"Tool","SafetyBar.ActivationToggle.Activate.bt":"Activate","SafetyBar.ActivationToggle.Activated.bt":"Activated","SafetyBar.ActivationToggle.Activating.bt":"Activating","SafetyBar.ActivationToggle.Deactivating.bt":"Deactivating","SafetyBar.ControllerType.Physical.lb":"Physical","SafetyBar.ControllerType.Virtual.lb":"Virtual","SafetyBar.MotionGroup.Physical.Explanation.lb":"<code>{{motionGroupId}}</code> is a physical robot controller. <strong>Safety precautions</strong> are active for the movement of this robot.","SafetyBar.MotionGroup.Virtual.Explanation.lb":"<1>{{motionGroupId}}</1> is a virtual robot controller with no physical counterpart. It can be freely manipulated without safety precautions.","SafetyBar.OperationMode.Auto.Explanation.lb":"Automatic operation mode active. Automated movement without manual confirmation enabled.","SafetyBar.OperationMode.Automatic.ti":"Automatic","SafetyBar.OperationMode.Error.Explanation.lb":"Failed to get operation mode. Use the original control panel to resolve the error.","SafetyBar.OperationMode.Error.lb":"Error","SafetyBar.OperationMode.Manual.Explanation.lb":"The robot controller is in manual operation mode. On a physical robot, this generally indicates that an enabling switch must be held for the robot to move successfully.","SafetyBar.OperationMode.Manual.lb":"Manual","SafetyBar.OperationMode.ti":"Operation mode","SafetyBar.SafetyState.Error.Explanation.lb":"The robot controller has entered an unexpected safety state.","SafetyBar.SafetyState.Error.lb":"Error","SafetyBar.SafetyState.Estop.lb":"E-Stop","SafetyBar.SafetyState.ManualActionRequired.Explanation.lb":"The robot controller has entered a safety state requiring manual action to resolve.","SafetyBar.SafetyState.ManualActionRequired.lb":"Action required","SafetyBar.SafetyState.Normal.Explanation.lb":"The robot controller is in a safe state. Robot movement is enabled.","SafetyBar.SafetyState.Normal.lb":"Safe","SafetyBar.SafetyState.Stop.Explanation.lb":"The robot controller has entered a stop state. Movement is no longer possible until the stop state is resolved.","SafetyBar.SafetyState.Stop.lb":"Stop","SafetyBar.SafetyState.ti":"Safety state","SafetyBar.StopState.Estop.Explanation.lb":"An emergency stop of the robot controller has been triggered. Movement of the robot is no longer possible until the estop is released.","Jogging.Increment.hlb":"Increment","Jogging.CoordinateSystem.hlb":"Coordinate system","Jogging.Cartesian.bt":"Cartesian","Jogging.Joints.bt":"Joints","Jogging.Velocity.bt":"Velocity","CycleTimer.RemainingTime.lb":"Time remaining","CycleTimer.OfTime.lb":"of {{time}} min.","CycleTimer.Time.lb":"{{time}} min.","CycleTimer.Error.lb":"Error","ProgramControl.Start.bt":"Start","ProgramControl.Resume.bt":"Resume","ProgramControl.Retry.bt":"Retry","ProgramControl.Pause.bt":"Pause","ProgramControl.Stop.bt":"Stop","ProgramStateIndicator.Running.lb":"Running","ProgramStateIndicator.Error.lb":"Error","ProgramStateIndicator.EStop.lb":"E-Stop","ProgramStateIndicator.Idle.lb":"Idle","ProgramStateIndicator.Paused.lb":"Paused","ProgramStateIndicator.Ready.lb":"Ready","ProgramStateIndicator.Stopped.lb":"Stopped","ProgramStateIndicator.Auto.lb":"Auto","ProgramStateIndicator.Manual.lb":"Manual","ProgramStateIndicator.ManualT1.lb":"Manual T1","ProgramStateIndicator.ManualT2.lb":"Manual T2","RobotSetupReadinessIndicator.Ready.lb":"Ready","RobotSetupReadinessIndicator.RobotDisconnected.lb":"Robot disconnected","RobotSetupReadinessIndicator.PreconditionNotFulfilled.lb":"Precondition not fulfilled","RobotCard.Runtime.lb":"Runtime","RobotCard.DriveToHome.bt":"Drive to Home"},_l=gg.createInstance();_l.use(yg).init({supportedLngs:["en","de"],resources:{en:{translations:Eg},de:{translations:_g}},ns:["translations"],defaultNS:"translations",detection:{order:["navigator","htmlTag"]}});function Xe(e){return r=>g.jsx(Ig,{children:g.jsx(e,{...r})})}const Ig=({children:e})=>g.jsx(_e.I18nextProvider,{i18n:_l,children:e}),Vg=e=>g.jsx(P.SvgIcon,{...e,viewBox:"0 0 10 8",children:g.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"})}),Mg=Xe(Oe.observer(e=>{const{appIcon:t,appName:r,apps:n=[],onAppSelect:o,sx:a}=e,[s,i]=J.useState(null),l=!!s,c=h=>{i(h.currentTarget)},u=()=>{i(null)},d=h=>{u(),h.onClick?h.onClick():h.href&&(window.location.href=h.href),o==null||o(h)};return g.jsxs(g.Fragment,{children:[g.jsx(P.AppBar,{position:"static",sx:{boxShadow:"none",backgroundImage:"none","& .MuiAppBar-root":{backgroundImage:"none",backgroundColor:"transparent"},...a},children:g.jsxs(P.Toolbar,{sx:{minHeight:"62px !important"},children:[g.jsx(P.Box,{sx:{mr:2,display:"flex",alignItems:"center"},children:t}),g.jsxs(P.Box,{sx:{display:"flex",alignItems:"center",flexGrow:1},children:[g.jsx(P.Typography,{variant:"h6",component:"div",sx:{fontWeight:700,fontSize:"20px",lineHeight:"24px",letterSpacing:0},children:r}),n.length>0&&g.jsx(P.IconButton,{color:"inherit","aria-label":"switch app","aria-controls":"app-menu","aria-haspopup":"true",onClick:c,sx:{ml:2,width:30,height:30,borderRadius:"8px",padding:"5px",backgroundColor:h=>P.alpha(h.palette.common.white,.1),opacity:1,"&:hover":{backgroundColor:h=>P.alpha(h.palette.common.white,.16)},"& .MuiSvgIcon-root":{fontSize:"10px",width:"10px",height:"8px"}},children:g.jsx(Vg,{})})]})]})}),g.jsx(P.Backdrop,{open:l,onClick:u,sx:{backdropFilter:"blur(4px)",backgroundColor:"rgba(0, 0, 0, 0.3)",zIndex:h=>h.zIndex.modal-1}}),g.jsx(P.Menu,{id:"app-menu",anchorEl:s,open:l,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},sx:{zIndex:h=>h.zIndex.modal,"& .MuiPaper-root":{minWidth:200,mt:1}},children:n.map(h=>g.jsxs(P.MenuItem,{onClick:()=>d(h),sx:{display:"flex",alignItems:"center",gap:2,py:1.5,px:2},children:[g.jsx(P.Box,{sx:{display:"flex",alignItems:"center"},children:h.icon}),g.jsx(P.Typography,{variant:"body1",children:h.name})]},h.id))})]})}));function K(){return K=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},K.apply(null,arguments)}function cr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function es(e,t,r=void 0){const n={};for(const o in e){const a=e[o];let s="",i=!0;for(let l=0;l<a.length;l+=1){const c=a[l];c&&(s+=(i===!0?"":" ")+t(c),i=!1,r&&r[c]&&(s+=" "+r[c]))}n[o]=s}return n}function Uh(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=Uh(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Pt(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=Uh(e))&&(n&&(n+=" "),n+=t);return n}function ur(e,...t){const r=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(n=>r.searchParams.append("args[]",n)),`Minified MUI error #${e}; visit ${r} for the full message.`}const Dh="$$material";function jg(e){for(var t=0,r,n=0,o=e.length;o>=4;++n,o-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var kg={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function $g(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Ug=/[A-Z]|^ms/g,Dg=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Lh=function(t){return t.charCodeAt(1)===45},$c=function(t){return t!=null&&typeof t!="boolean"},Zs=$g(function(e){return Lh(e)?e:e.replace(Ug,"-$&").toLowerCase()}),Uc=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(Dg,function(n,o,a){return ir={name:o,styles:a,next:ir},o})}return kg[t]!==1&&!Lh(t)&&typeof r=="number"&&r!==0?r+"px":r};function Aa(e,t,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var o=r;if(o.anim===1)return ir={name:o.name,styles:o.styles,next:ir},o.name;var a=r;if(a.styles!==void 0){var s=a.next;if(s!==void 0)for(;s!==void 0;)ir={name:s.name,styles:s.styles,next:ir},s=s.next;var i=a.styles+";";return i}return Lg(e,t,r)}}var l=r;return l}function Lg(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o++)n+=Aa(e,t,r[o])+";";else for(var a in r){var s=r[a];if(typeof s!="object"){var i=s;$c(i)&&(n+=Zs(a)+":"+Uc(a,i)+";")}else if(Array.isArray(s)&&typeof s[0]=="string"&&t==null)for(var l=0;l<s.length;l++)$c(s[l])&&(n+=Zs(a)+":"+Uc(a,s[l])+";");else{var c=Aa(e,t,s);switch(a){case"animation":case"animationName":{n+=Zs(a)+":"+c+";";break}default:n+=a+"{"+c+"}"}}}return n}var Dc=/label:\s*([^\s;{]+)\s*(;|$)/g,ir;function Bg(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,o="";ir=void 0;var a=e[0];if(a==null||a.raw===void 0)n=!1,o+=Aa(r,t,a);else{var s=a;o+=s[0]}for(var i=1;i<e.length;i++)if(o+=Aa(r,t,e[i]),n){var l=a;o+=l[i]}Dc.lastIndex=0;for(var c="",u;(u=Dc.exec(o))!==null;)c+="-"+u[1];var d=jg(o)+c;return{name:d,styles:o,next:ir}}/**
|
|
24
24
|
* @mui/styled-engine v7.1.1
|
|
25
25
|
*
|
|
26
26
|
* @license MIT
|
|
@@ -151,5 +151,5 @@ and limitations under the License.
|
|
|
151
151
|
`,h);const f=(yield t.api.controller.getRobotController(l.controller)).configuration.kind==="VirtualController",m=yield Ve(this,null,function*(){try{return yield t.api.motionGroupInfos.getMounting(c.motion_group)}catch(C){return console.error(`Error fetching mounting for ${c.motion_group}`,C),null}}),b=t.openReconnectingWebsocket(`/controllers/${l.controller}/state-stream?response_rate=1000`),S=yield b.firstMessage(),E=(a=lr(S.data))==null?void 0:a.result;if(!E)throw new Error(`Unable to parse initial controller state message ${S.data}`);console.log(`Connected controller state websocket to controller ${l.controller}. Initial state:
|
|
152
152
|
`,E);const{tcps:O}=yield t.api.motionGroupInfos.listTcps(r),w=yield t.api.motionGroupInfos.getMotionGroupSpecification(r),A=yield t.api.motionGroupInfos.getSafetySetup(r);return new Sf(t,l,c,h,u,f,O,w,A,m,E,b)})}get motionGroupId(){return this.motionGroup.motion_group}get controllerId(){return this.controller.controller}get modelFromController(){return this.motionGroup.model_from_controller}get wandelscriptIdentifier(){const t=this.motionGroupId.split("@")[0];return`${this.controllerId.replaceAll("-","_")}_${t}`}get joggingVelocityRads(){return this.joggingVelocity*Math.PI/180}get joints(){return this.initialMotionState.state.joint_position.joints.map((t,r)=>({index:r}))}get dhParameters(){return this.motionGroupSpecification.dh_parameters}get safetyZones(){return this.safetySetup.safety_zones}get mountingPosition(){return this.mounting?[this.mounting.pose.position.x/1e3,this.mounting.pose.position.y/1e3,this.mounting.pose.position.z/1e3]:[0,0,0]}get mountingQuaternion(){var t,r,n,o,a,s;const i=new Be.Vector3(((r=(t=this.mounting)==null?void 0:t.pose.orientation)==null?void 0:r.x)||0,((o=(n=this.mounting)==null?void 0:n.pose.orientation)==null?void 0:o.y)||0,((s=(a=this.mounting)==null?void 0:a.pose.orientation)==null?void 0:s.z)||0),l=i.length(),c=i.normalize();return new Be.Quaternion().setFromAxisAngle(c,l)}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"}deactivate(){return Ve(this,null,function*(){if(this.activationState!=="active"){console.error("Tried to deactivate while already deactivating");return}$e.runInAction(()=>{this.activationState="deactivating"});try{yield this.nova.api.controller.setDefaultMode(this.controllerId,"MODE_MONITOR"),$e.runInAction(()=>{this.activationState="inactive"})}catch(t){throw $e.runInAction(()=>{this.activationState="active"}),t}})}activate(){return Ve(this,null,function*(){if(this.activationState!=="inactive"){console.error("Tried to activate while already activating");return}$e.runInAction(()=>{this.activationState="activating"});try{yield this.nova.api.controller.setDefaultMode(this.controllerId,"MODE_CONTROL"),$e.runInAction(()=>{this.activationState="active"})}catch(t){throw $e.runInAction(()=>{this.activationState="inactive"}),t}})}toggleActivation(){this.activationState==="inactive"?this.activate():this.activationState==="active"&&this.deactivate()}dispose(){this.motionStateSocket.close(),this.connectedJoggingCartesianSocket&&this.connectedJoggingCartesianSocket.close(),this.connectedJoggingJointsSocket&&this.connectedJoggingJointsSocket.close()}setJoggingVelocity(t){this.joggingVelocity=t}},z2=class Of{constructor(t,r={}){this.motionStream=t,this.opts=r,this.cartesianWebsocket=null,this.jointWebsocket=null,this.cartesianJoggingOpts={}}static open(t,r){return Ve(this,arguments,function*(n,o,a={}){const s=yield n.connectMotionStream(o);return new Of(s,a)})}get motionGroupId(){return this.motionStream.motionGroupId}get nova(){return this.motionStream.nova}get numJoints(){return this.motionStream.joints.length}get activeJoggingMode(){return this.cartesianWebsocket?"cartesian":this.jointWebsocket?"joint":"increment"}get activeWebsocket(){return this.cartesianWebsocket||this.jointWebsocket}stop(){return Ve(this,null,function*(){this.cartesianWebsocket&&this.cartesianWebsocket.sendJson({motion_group:this.motionGroupId,position_direction:{x:0,y:0,z:0},rotation_direction:{x:0,y:0,z:0},position_velocity:0,rotation_velocity:0,tcp:this.cartesianJoggingOpts.tcpId,coordinate_system:this.cartesianJoggingOpts.coordSystemId}),this.jointWebsocket&&this.jointWebsocket.sendJson({motion_group:this.motionGroupId,joint_velocities:new Array(this.numJoints).fill(0)})})}dispose(){this.cartesianWebsocket&&this.cartesianWebsocket.dispose(),this.jointWebsocket&&this.jointWebsocket.dispose()}setJoggingMode(t,r){console.log("Setting jogging mode to",t),r&&(WA(this.cartesianJoggingOpts,r)||this.cartesianWebsocket&&(this.cartesianWebsocket.dispose(),this.cartesianWebsocket=null),this.cartesianJoggingOpts=r),t!=="cartesian"&&this.cartesianWebsocket&&(this.cartesianWebsocket.dispose(),this.cartesianWebsocket=null),t!=="joint"&&this.jointWebsocket&&(this.jointWebsocket.dispose(),this.jointWebsocket=null),t==="cartesian"&&!this.cartesianWebsocket&&(this.cartesianWebsocket=this.nova.openReconnectingWebsocket("/motion-groups/move-tcp"),this.cartesianWebsocket.addEventListener("message",n=>{const o=lr(n.data);if(o&&"error"in o)if(this.opts.onError)this.opts.onError(n.data);else throw new Error(n.data)})),t==="joint"&&!this.jointWebsocket&&(this.jointWebsocket=this.nova.openReconnectingWebsocket("/motion-groups/move-joint"),this.jointWebsocket.addEventListener("message",n=>{const o=lr(n.data);if(o&&"error"in o)if(this.opts.onError)this.opts.onError(n.data);else throw new Error(n.data)}))}startJointRotation(t){return Ve(this,arguments,function*({joint:r,direction:n,velocityRadsPerSec:o}){if(!this.jointWebsocket)throw new Error("Joint jogging websocket not connected; call setJoggingMode first");const a=new Array(this.numJoints).fill(0);a[r]=n==="-"?-o:o,this.jointWebsocket.sendJson({motion_group:this.motionGroupId,joint_velocities:a})})}startTCPTranslation(t){return Ve(this,arguments,function*({axis:r,direction:n,velocityMmPerSec:o}){if(!this.cartesianWebsocket)throw new Error("Cartesian jogging websocket not connected; call setJoggingMode first");const a={x:0,y:0,z:0},s=Object.assign({},a);s[r]=n==="-"?-1:1,this.cartesianWebsocket.sendJson({motion_group:this.motionGroupId,position_direction:s,rotation_direction:a,position_velocity:o,rotation_velocity:0,tcp:this.cartesianJoggingOpts.tcpId,coordinate_system:this.cartesianJoggingOpts.coordSystemId})})}startTCPRotation(t){return Ve(this,arguments,function*({axis:r,direction:n,velocityRadsPerSec:o}){if(!this.cartesianWebsocket)throw new Error("Cartesian jogging websocket not connected; call setJoggingMode first");const a={x:0,y:0,z:0},s=Object.assign({},a);s[r]=n==="-"?-1:1,this.cartesianWebsocket.sendJson({motion_group:this.motionGroupId,position_direction:a,rotation_direction:s,position_velocity:0,rotation_velocity:o,tcp:this.cartesianJoggingOpts.tcpId,coordinate_system:this.cartesianJoggingOpts.coordSystemId})})}runIncrementalCartesianMotion(t){return Ve(this,arguments,function*({currentTcpPose:r,currentJoints:n,coordSystemId:o,velocityInRelevantUnits:a,axis:s,direction:i,motion:l}){var c;const u=[];if(!c_(r.coordinate_system,o))throw new Error(`Current TCP pose coordinate system ${r.coordinate_system} does not match target coordinate system ${o}`);if(l.type==="translate"){const p=Object.assign({},r.position);p[s]+=l.distanceMm*(i==="-"?-1:1),u.push({settings:{limits_override:{tcp_velocity_limit:a}},line:{position:p,orientation:r.orientation,coordinate_system:o}})}else if(l.type==="rotate"){const p=new pn(r.orientation.x,r.orientation.y,r.orientation.z),f=p.length(),m=p.clone().normalize(),b=l.distanceRads*(i==="-"?-1:1),S=new pn(0,0,0);S[s]=1;const E=Math.cos(.5*b)*Math.cos(.5*f),O=Math.sin(.5*b)*Math.sin(.5*f),w=Math.sin(.5*b)*Math.cos(.5*f),A=Math.cos(.5*b)*Math.sin(.5*f),C=S.dot(m),T=S.clone().cross(m),V=2*Math.acos(E-O*C),j=V/Math.sin(.5*V),y=new pn().addScaledVector(T,O).addScaledVector(S,w).addScaledVector(m,A).multiplyScalar(j);u.push({settings:{limits_override:{tcp_orientation_velocity_limit:a}},line:{position:r.position,orientation:y,coordinate_system:o}})}const d=yield this.nova.api.motion.planMotion({motion_group:this.motionGroupId,start_joint_position:n,tcp:this.cartesianJoggingOpts.tcpId,commands:u}),h=(c=d.plan_successful_response)==null?void 0:c.motion;if(!h)throw new Error(`Failed to plan jogging increment motion ${JSON.stringify(d)}`);yield this.nova.api.motion.streamMoveForward(h,100,void 0,void 0,void 0,{timeout:1e3*60})})}runIncrementalJointRotation(t){return Ve(this,arguments,function*({joint:r,currentJoints:n,velocityRadsPerSec:o,direction:a,distanceRads:s}){var i;const l=[...n.joints];l[r]+=s*(a==="-"?-1:1);const c=new Array(n.joints.length).fill(o),u=yield this.nova.api.motion.planMotion({motion_group:this.motionGroupId,start_joint_position:n,commands:[{settings:{limits_override:{joint_velocity_limits:{joints:c}}},joint_ptp:{joints:l}}]}),d=(i=u.plan_successful_response)==null?void 0:i.motion;if(!d){console.error("Failed to plan jogging increment motion",u);return}yield this.nova.api.motion.streamMoveForward(d,100,void 0,void 0,void 0,{timeout:1e3*60})})}},sh=1e-4;function G2(e,t){const r=new Ot.Vector3(t.x,t.y,t.z),n=new Ot.Vector3(e.x,e.y,e.z),o=r.length(),a=r.normalize();let s=n.length(),i=n.normalize();i.dot(a)<0&&(s=-s,i=i.multiplyScalar(-1));let l=s-o;return l-=2*Math.PI*Math.floor((l+Math.PI)/(2*Math.PI)),s=o+l,i.multiplyScalar(s)}var H2=class wf{constructor(t,r,n,o,a){this.nova=t,this.controller=r,this.motionGroup=n,this.initialMotionState=o,this.motionStateSocket=a,this.rapidlyChangingMotionState=o,a.addEventListener("message",s=>{var i;const l=(i=lr(s.data))==null?void 0:i.result;if(!l)throw new Error(`Failed to get motion state for ${this.motionGroupId}: ${s.data}`);xf(this.rapidlyChangingMotionState.state.joint_position.joints,l.state.joint_position.joints,sh)||$e.runInAction(()=>{this.rapidlyChangingMotionState.state=l.state}),vf(this.rapidlyChangingMotionState.tcp_pose,l.tcp_pose,sh)||$e.runInAction(()=>{this.rapidlyChangingMotionState.tcp_pose==null?this.rapidlyChangingMotionState.tcp_pose=l.tcp_pose:this.rapidlyChangingMotionState.tcp_pose={position:l.tcp_pose.position,orientation:G2(l.tcp_pose.orientation,this.rapidlyChangingMotionState.tcp_pose.orientation),tcp:l.tcp_pose.tcp,coordinate_system:l.tcp_pose.coordinate_system}})}),$e.makeAutoObservable(this)}static open(t,r){return Ve(this,null,function*(){var n;const{instances:o}=yield t.api.controller.listControllers(),[a,s]=r.split("@"),i=o.find(h=>h.controller===s),l=i==null?void 0:i.physical_motion_groups.find(h=>h.motion_group===r);if(!i||!l)throw new Error(`Controller ${s} or motion group ${r} not found`);const c=t.openReconnectingWebsocket(`/motion-groups/${r}/state-stream`),u=yield c.firstMessage();console.log("got first message",u);const d=(n=lr(u.data))==null?void 0:n.result;if(!d)throw new Error(`Unable to parse initial motion state message ${u.data}`);return console.log(`Connected motion state websocket to motion group ${l.motion_group}. Initial state:
|
|
153
153
|
`,d),new wf(t,i,l,d,c)})}get motionGroupId(){return this.motionGroup.motion_group}get controllerId(){return this.controller.controller}get modelFromController(){return this.motionGroup.model_from_controller}get wandelscriptIdentifier(){const t=this.motionGroupId.split("@")[0];return`${this.controllerId.replaceAll("-","_")}_${t}`}get joints(){return this.initialMotionState.state.joint_position.joints.map((t,r)=>({index:r}))}dispose(){this.motionStateSocket.close()}},q2=class{constructor(e,t){this.cellId=e,this.opts=t,this.system=this.withUnwrappedResponsesOnly(_2),this.cell=this.withUnwrappedResponsesOnly(HE),this.deviceConfig=this.withCellId(ZE),this.motionGroup=this.withCellId(d2),this.motionGroupInfos=this.withCellId(p2),this.controller=this.withCellId(WE),this.program=this.withCellId(x2),this.programValues=this.withCellId(S2),this.controllerIOs=this.withCellId(YE),this.motionGroupKinematic=this.withCellId(y2),this.motion=this.withCellId(c2),this.coordinateSystems=this.withCellId(QE),this.application=this.withCellId(rh),this.applicationGlobal=this.withUnwrappedResponsesOnly(rh),this.motionGroupJogging=this.withCellId(f2),this.virtualRobot=this.withCellId(I2),this.virtualRobotSetup=this.withCellId(U2),this.virtualRobotMode=this.withCellId(k2),this.virtualRobotBehavior=this.withCellId(M2),this.libraryProgramMetadata=this.withCellId(n2),this.libraryProgram=this.withCellId(t2),this.libraryRecipeMetadata=this.withCellId(i2),this.libraryRecipe=this.withCellId(a2),this.storeObject=this.withCellId(R2),this.storeCollisionComponents=this.withCellId(w2),this.storeCollisionScenes=this.withCellId(P2)}withCellId(e){var t,r;const n=new e(dl(ln({},this.opts),{isJsonMime:o=>o==="application/json"}),(t=this.opts.basePath)!=null?t:"",(r=this.opts.axiosInstance)!=null?r:_.create());for(const o of Reflect.ownKeys(Reflect.getPrototypeOf(n)))if(o!=="constructor"&&typeof n[o]=="function"){const a=n[o];n[o]=(...s)=>a.apply(n,[this.cellId,...s]).then(i=>i.data)}return n}withUnwrappedResponsesOnly(e){var t,r;const n=new e(dl(ln({},this.opts),{isJsonMime:o=>o==="application/json"}),(t=this.opts.basePath)!=null?t:"",(r=this.opts.axiosInstance)!=null?r:_.create());for(const o of Reflect.ownKeys(Reflect.getPrototypeOf(n)))if(o!=="constructor"&&typeof n[o]=="function"){const a=n[o];n[o]=(...s)=>a.apply(n,s).then(i=>i.data)}return n}},W2=class{constructor(){this.connections=[]}handleAPIRequest(e){return Ve(this,null,function*(){var t,r,n;const o=[{method:"GET",path:"/cells/:cellId/controllers",handle(){return{instances:[{controller:"mock-ur5e",model_name:"UniversalRobots::Controller",host:"mock-ur5e",allow_software_install_on_controller:!0,physical_motion_groups:[{motion_group:"0@mock-ur5e",name_from_controller:"UR5e",active:!1,model_from_controller:"UniversalRobots_UR5e"}],has_error:!1,error_details:""}]}}},{method:"GET",path:"/cells/:cellId/controllers/:controllerId",handle(){return{configuration:{kind:"VirtualController",manufacturer:"universalrobots",position:"[0,-1.571,-1.571,-1.571,1.571,-1.571,0]",type:"universalrobots-ur5e"},name:"mock-ur5"}}},{method:"GET",path:"/cells/:cellId/motion-groups/:motionGroupId/specification",handle(){return{dh_parameters:[{alpha:1.5707963267948966,theta:0,a:0,d:162.25,reverse_rotation_direction:!1},{alpha:0,theta:0,a:-425,d:0,reverse_rotation_direction:!1},{alpha:0,theta:0,a:-392.2,d:0,reverse_rotation_direction:!1},{alpha:1.5707963267948966,theta:0,a:0,d:133.3,reverse_rotation_direction:!1},{alpha:-1.5707963267948966,theta:0,a:0,d:99.7,reverse_rotation_direction:!1},{alpha:0,theta:0,a:0,d:99.6,reverse_rotation_direction:!1}],mechanical_joint_limits:[{joint:"JOINTNAME_AXIS_1",lower_limit:-6.335545063018799,upper_limit:6.335545063018799,unlimited:!1},{joint:"JOINTNAME_AXIS_2",lower_limit:-6.335545063018799,upper_limit:6.335545063018799,unlimited:!1},{joint:"JOINTNAME_AXIS_3",lower_limit:-6.335545063018799,upper_limit:6.335545063018799,unlimited:!1},{joint:"JOINTNAME_AXIS_4",lower_limit:-6.335545063018799,upper_limit:6.335545063018799,unlimited:!1},{joint:"JOINTNAME_AXIS_5",lower_limit:-6.335545063018799,upper_limit:6.335545063018799,unlimited:!1},{joint:"JOINTNAME_AXIS_6",lower_limit:-6.335545063018799,upper_limit:6.335545063018799,unlimited:!1}]}}},{method:"GET",path:"/cells/:cellId/motion-groups/:motionGroupId/safety-setup",handle(){return{safety_settings:[{safety_state:"SAFETY_NORMAL",settings:{joint_position_limits:[{joint:"JOINTNAME_AXIS_1",lower_limit:-2.96705961227417,upper_limit:2.96705961227417,unlimited:!1},{joint:"JOINTNAME_AXIS_2",lower_limit:-1.7453292608261108,upper_limit:2.7925267219543457,unlimited:!1},{joint:"JOINTNAME_AXIS_3",lower_limit:-3.3161256313323975,upper_limit:.40142571926116943,unlimited:!1},{joint:"JOINTNAME_AXIS_4",lower_limit:-3.4906585216522217,upper_limit:3.4906585216522217,unlimited:!1},{joint:"JOINTNAME_AXIS_5",lower_limit:-2.4434609413146973,upper_limit:2.4434609413146973,unlimited:!1},{joint:"JOINTNAME_AXIS_6",lower_limit:-4.71238899230957,upper_limit:4.71238899230957,unlimited:!1}],joint_velocity_limits:[{joint:"JOINTNAME_AXIS_1",limit:3.1415927410125732},{joint:"JOINTNAME_AXIS_2",limit:3.1415927410125732},{joint:"JOINTNAME_AXIS_3",limit:3.4906585216522217},{joint:"JOINTNAME_AXIS_4",limit:6.108652591705322},{joint:"JOINTNAME_AXIS_5",limit:6.108652591705322},{joint:"JOINTNAME_AXIS_6",limit:6.981317043304443}],joint_acceleration_limits:[],joint_torque_limits:[],tcp_velocity_limit:1800}}],safety_zones:[{id:1,priority:0,geometry:{compound:{child_geometries:[{convex_hull:{vertices:[{x:-800,y:-1330,z:-1820},{x:1650,y:-1330,z:-1820},{x:1650,y:1330,z:-1820},{x:-800,y:1330,z:-1820}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"box"},{convex_hull:{vertices:[{x:-800,y:-1330,z:-1820},{x:1650,y:-1330,z:-1820},{x:1650,y:-1330,z:1500},{x:-800,y:-1330,z:1500}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"box"},{convex_hull:{vertices:[{x:-800,y:-1330,z:-1820},{x:-800,y:1330,z:-1820},{x:-800,y:1330,z:1500},{x:-800,y:-1330,z:1500}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"box"},{convex_hull:{vertices:[{x:1650,y:1330,z:1500},{x:-800,y:1330,z:1500},{x:-800,y:-1330,z:1500},{x:1650,y:-1330,z:1500}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"box"},{convex_hull:{vertices:[{x:1650,y:1330,z:1500},{x:-800,y:1330,z:1500},{x:-800,y:1330,z:-1820},{x:1650,y:1330,z:-1820}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"box"},{convex_hull:{vertices:[{x:1650,y:1330,z:1500},{x:1650,y:-1330,z:1500},{x:1650,y:-1330,z:-1820},{x:1650,y:1330,z:-1820}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"box"}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"Cell workzone"},motion_group_uid:1},{id:2,priority:0,geometry:{convex_hull:{vertices:[{x:1650,y:1330,z:-1850},{x:865,y:1330,z:-1850},{x:865,y:-720,z:-1850},{x:1650,y:-720,z:-1850},{x:1650,y:1330,z:-920},{x:865,y:1330,z:-920},{x:865,y:-720,z:-920},{x:1650,y:-720,z:-920}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"Transport"},motion_group_uid:1},{id:3,priority:0,geometry:{convex_hull:{vertices:[{x:1650,y:1330,z:-600},{x:865,y:1330,z:-600},{x:865,y:430,z:-600},{x:1650,y:430,z:-600},{x:1650,y:1330,z:-1250},{x:865,y:1330,z:-1250},{x:865,y:430,z:-1250},{x:1650,y:430,z:-1250}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"Tunel"},motion_group_uid:1},{id:4,priority:0,geometry:{convex_hull:{vertices:[{x:1650,y:-760,z:-440},{x:900,y:-760,z:-440},{x:900,y:-1330,z:-440},{x:1650,y:-1330,z:-440},{x:1650,y:-760,z:-1800},{x:900,y:-760,z:-1800},{x:900,y:-1330,z:-1800},{x:1650,y:-1330,z:-1800}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"Fanuc controller"},motion_group_uid:1},{id:6,priority:0,geometry:{convex_hull:{vertices:[{x:-200,y:-200,z:-1900},{x:200,y:-200,z:-1900},{x:200,y:200,z:-1900},{x:-200,y:200,z:-1900},{x:-200,y:-200,z:-350},{x:200,y:-200,z:-350},{x:200,y:200,z:-350},{x:-200,y:200,z:-350}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"Robot base"},motion_group_uid:1}],robot_model_geometries:[{link_index:1,geometry:{sphere:{radius:270},init_pose:{position:{x:-70,y:-70,z:-50},orientation:{x:0,y:0,z:0,w:1}},id:"link1_sphere"}},{link_index:2,geometry:{capsule:{radius:160,cylinder_height:800},init_pose:{position:{x:-450,y:40,z:170},orientation:{x:0,y:-.7071067811865475,z:0,w:.7071067811865476}},id:"link2_capsule"}},{link_index:3,geometry:{sphere:{radius:270},init_pose:{position:{x:-110,y:10,z:-100},orientation:{x:0,y:0,z:0,w:1}},id:"link3_sphere"}},{link_index:4,geometry:{capsule:{radius:110,cylinder_height:600},init_pose:{position:{x:0,y:300,z:40},orientation:{x:-.7071067811865475,y:0,z:0,w:.7071067811865476}},id:"link4_capsule"}},{link_index:5,geometry:{sphere:{radius:75},init_pose:{position:{x:0,y:0,z:-50},orientation:{x:0,y:0,z:0,w:1}},id:"link5_sphere"}}],tool_geometries:[]}}},{method:"GET",path:"/cells/:cellId/coordinate-systems",handle(){return{coordinatesystems:[{coordinate_system:"",name:"world",reference_uid:"",position:{x:0,y:0,z:0},rotation:{angles:[0,0,0],type:"ROTATION_VECTOR"}}]}}},{method:"GET",path:"/cells/:cellId/motion-groups/:motionGroupId/tcps",handle(){return{tcps:[{id:"Flange",readable_name:"Default-Flange",position:{x:0,y:0,z:0},rotation:{angles:[0,0,0,0],type:"ROTATION_VECTOR"}},{id:"complex-tcp-position",readable_name:"Complex TCP Position",position:{x:-200,y:300,z:150},rotation:{angles:[-.12139440409113832,-.06356210998212003,-.2023240068185639,0],type:"ROTATION_VECTOR"}}]}}}],a=((t=e.method)==null?void 0:t.toUpperCase())||"GET",s="/cells"+((n=(r=e.url)==null?void 0:r.split("/cells")[1])==null?void 0:n.split("?")[0]);for(const i of o){const l=N2.match(i.path)(s||"");if(a===i.method&&l){const c=i.handle();return{status:200,statusText:"Success",data:JSON.stringify(c),headers:{},config:e,request:{responseURL:e.url}}}}throw new bl(`No mock handler matched this request: ${a} ${s}`,"404",e)})}handleWebsocketConnection(e){this.connections.push(e),setTimeout(()=>{e.dispatchEvent(new Event("open")),console.log("Websocket connection opened from",e.url),e.url.includes("/state-stream")&&e.dispatchEvent(new MessageEvent("message",{data:JSON.stringify(J2)})),e.url.includes("/move-joint")&&e.dispatchEvent(new MessageEvent("message",{data:JSON.stringify({result:{motion_group:"0@ur",state:{controller:"ur",operation_mode:"OPERATION_MODE_AUTO",safety_state:"SAFETY_STATE_NORMAL",timestamp:"2024-09-18T12:48:26.096266444Z",velocity_override:100,motion_groups:[{motion_group:"0@ur",controller:"ur",joint_position:{joints:[1.3492152690887451,-1.5659207105636597,1.6653711795806885,-1.0991662740707397,-1.829018235206604,1.264623761177063]},joint_velocity:{joints:[0,0,0,0,0,0]},flange_pose:{position:{x:6.437331889439328,y:-628.4123774830913,z:577.0569957147832},orientation:{x:-1.683333649797158,y:-1.9783363827298732,z:-.4928031860165713},coordinate_system:""},tcp_pose:{position:{x:6.437331889439328,y:-628.4123774830913,z:577.0569957147832},orientation:{x:-1.683333649797158,y:-1.9783363827298732,z:-.4928031860165713},coordinate_system:"",tcp:"Flange"},velocity:{linear:{x:0,y:0,z:0},angular:{x:-0,y:0,z:0},coordinate_system:""},force:{force:{x:0,y:0,z:0},moment:{x:0,y:0,z:0},coordinate_system:""},joint_limit_reached:{limit_reached:[!1,!1,!1,!1,!1,!1]},joint_current:{joints:[0,0,0,0,0,0]},sequence_number:"671259"}],sequence_number:"671259"},movement_state:"MOVEMENT_STATE_MOVING"}})})),e.url.includes("/move-tcp")&&e.dispatchEvent(new MessageEvent("message",{data:JSON.stringify({result:{motion_group:"0@ur",state:{controller:"ur",operation_mode:"OPERATION_MODE_AUTO",safety_state:"SAFETY_STATE_NORMAL",timestamp:"2024-09-18T12:43:12.188335774Z",velocity_override:100,motion_groups:[{motion_group:"0@ur",controller:"ur",joint_position:{joints:[1.3352527618408203,-1.5659207105636597,1.6653711795806885,-1.110615611076355,-1.829018235206604,1.264623761177063]},joint_velocity:{joints:[0,0,0,0,0,0]},flange_pose:{position:{x:-2.763015284002938,y:-630.2151479701106,z:577.524509114342},orientation:{x:-1.704794877102097,y:-1.9722372952861567,z:-.4852079204210754},coordinate_system:""},tcp_pose:{position:{x:-2.763015284002938,y:-630.2151479701106,z:577.524509114342},orientation:{x:-1.704794877102097,y:-1.9722372952861567,z:-.4852079204210754},coordinate_system:"",tcp:"Flange"},velocity:{linear:{x:0,y:0,z:0},angular:{x:-0,y:0,z:0},coordinate_system:""},force:{force:{x:0,y:0,z:0},moment:{x:0,y:0,z:0},coordinate_system:""},joint_limit_reached:{limit_reached:[!1,!1,!1,!1,!1,!1]},joint_current:{joints:[0,0,0,0,0,0]},sequence_number:"627897"}],sequence_number:"627897"},movement_state:"MOVEMENT_STATE_MOVING"}})}))},10)}handleWebsocketMessage(e,t){console.log(`Received message on ${e.url}`,t)}},J2={result:{state:{motion_group:"0@universalrobots-ur5e",controller:"universalrobots-ur5e",joint_position:{joints:[1.1699999570846558,-1.5700000524520874,1.3600000143051147,1.0299999713897705,1.2899999618530273,1.2799999713897705]},joint_velocity:{joints:[0,0,0,0,0,0]},flange_pose:{position:{x:1.3300010259703043,y:-409.2680714682808,z:531.0203477065281},orientation:{x:1.7564919306270736,y:-1.7542521568325058,z:.7326972590614671},coordinate_system:""},tcp_pose:{position:{x:1.3300010259703043,y:-409.2680714682808,z:531.0203477065281},orientation:{x:1.7564919306270736,y:-1.7542521568325058,z:.7326972590614671},coordinate_system:"",tcp:"Flange"},velocity:{linear:{x:0,y:0,z:0},angular:{x:0,y:0,z:0},coordinate_system:""},force:{force:{x:0,y:0,z:0},moment:{x:0,y:0,z:0},coordinate_system:""},joint_limit_reached:{limit_reached:[!1,!1,!1,!1,!1,!1]},joint_current:{joints:[0,0,0,0,0,0]},sequence_number:"1"},tcp_pose:{position:{x:302.90748476115556,y:-152.87065869452337,z:424.0454619321661},orientation:{x:2.3403056115045353,y:-1.1706836379431356,z:.9772511964246311},coordinate_system:"",tcp:"Flange"}}},Y2=class{constructor(e){this.authPromise=null,this.accessToken=null;var t;const r=(t=e.cellId)!=null?t:"cell";this.config=ln({cellId:r},e),this.accessToken=e.accessToken||_i.getString("wbjs.access_token")||null,this.config.instanceUrl==="https://mock.example.com"&&(this.mock=new W2);const n=_.create({baseURL:$i(this.config.instanceUrl,"/api/v1"),headers:{"User-Agent":"Wandelbots-Nova-JS-SDK"}});n.interceptors.request.use(o=>Ve(this,null,function*(){return o.headers.Authorization||(this.accessToken?o.headers.Authorization=`Bearer ${this.accessToken}`:this.config.username&&this.config.password&&(o.headers.Authorization=`Basic ${btoa(e.username+":"+e.password)}`)),o})),typeof window<"u"&&n.interceptors.response.use(o=>o,o=>Ve(this,null,function*(){var a,s;if(NE(o))if(((a=o.response)==null?void 0:a.status)===401)try{if(yield this.renewAuthentication(),o.config)return this.accessToken?o.config.headers.Authorization=`Bearer ${this.accessToken}`:delete o.config.headers.Authorization,n.request(o.config)}catch(i){return Promise.reject(i)}else((s=o.response)==null?void 0:s.status)===503&&(yield fetch(window.location.href)).status===503&&window.location.reload();return Promise.reject(o)})),this.api=new q2(r,dl(ln({},e),{basePath:$i(this.config.instanceUrl,"/api/v1"),isJsonMime:o=>o==="application/json",baseOptions:ln(ln({},this.mock?{adapter:o=>this.mock.handleAPIRequest(o)}:{}),e.baseOptions),axiosInstance:n}))}renewAuthentication(){return Ve(this,null,function*(){if(!this.authPromise){this.authPromise=d_(this.config.instanceUrl);try{this.accessToken=yield this.authPromise,this.accessToken?_i.setString("wbjs.access_token",this.accessToken):_i.delete("wbjs.access_token")}finally{this.authPromise=null}}})}makeWebsocketURL(e){const t=new URL($i(this.config.instanceUrl,`/api/v1/cells/${this.config.cellId}`,e));return t.protocol=t.protocol.replace("http","ws"),t.protocol=t.protocol.replace("https","wss"),this.accessToken?t.searchParams.append("token",this.accessToken):this.config.username&&this.config.password&&(t.username=this.config.username,t.password=this.config.password),t.toString()}openReconnectingWebsocket(e){return new i_(this.makeWebsocketURL(e),{mock:this.mock})}connectMotionStream(e){return Ve(this,null,function*(){return yield H2.open(this,e)})}connectJogger(e){return Ve(this,null,function*(){return yield z2.open(this,e)})}connectMotionGroups(e){return Ve(this,null,function*(){const{instances:t}=yield this.api.controller.listControllers();return Promise.all(e.map(r=>F2.connect(this,r,t)))})}connectMotionGroup(e){return Ve(this,null,function*(){return(yield this.connectMotionGroups([e]))[0]})}};function K2(e){try{return JSON.stringify(e)}catch{return}}function Q2(e,t){throw new Error(t+` ${JSON.stringify(e)}`)}function X2(e){var t,r,n,o;return e instanceof bl&&e.code==="ERR_NETWORK"?"Failed to connect to the server. Please check your internet connection.":e instanceof bl&&e.response?`${(t=e.response)==null?void 0:t.status} ${(r=e.response)==null?void 0:r.statusText} from ${(n=e.response)==null?void 0:n.config.url}: ${JSON.stringify((o=e.response)==null?void 0:o.data)}`:e instanceof Error?e.message:`Unexpected error: ${K2(e)||e}`}const Cc=e=>{const t=e.softTimeout||3e3,[r,n]=J.useState(!1),o=P.useTheme();return J.useEffect(()=>{const a=setTimeout(()=>{n(!0)},t);return()=>clearTimeout(a)}),g.jsx(P.Stack,{width:"100%",height:"100%",alignItems:"center",justifyContent:"center",sx:{color:o.palette.text.primary},children:e.error?g.jsx(Cf,{loadingMessage:e.message,error:e.error}):g.jsxs(g.Fragment,{children:[g.jsx(P.CircularProgress,{sx:{marginBottom:"24px"}}),!!e.message&&g.jsx("div",{children:e.message}),g.jsx(P.Stack,{sx:{visibility:r?"visible":"hidden",marginTop:"1rem",color:o.palette.text.secondary},children:"This is taking longer than expected..."})]})})},Cf=e=>{const t=X2(e.error),r=e.error instanceof Error?e.error.stack:null,n=P.useTheme();return g.jsxs(P.Stack,{sx:{maxHeight:"100%",maxWidth:"min(100%, 800px)",padding:2,overflow:"auto",color:n.palette.error.main,"& pre":{whiteSpace:"pre-wrap",wordBreak:"break-word",paddingBottom:"3rem"}},children:[(e.loadingMessage?`Error while ${Al.lowerFirst(P.capitalize(e.loadingMessage))} - `:"")+t,g.jsx("br",{}),r&&g.jsx("pre",{children:r})]})},Z2=({title:e,titleId:t,...r},n)=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:19,height:10,fill:"none",ref:n,"aria-labelledby":t,...r},e?F.createElement("title",{id:t},e):null,F.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"})),eI=J.forwardRef(Z2),tI=({title:e,titleId:t,...r},n)=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:19,height:10,fill:"none",ref:n,"aria-labelledby":t,...r},e?F.createElement("title",{id:t},e):null,F.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"})),rI=J.forwardRef(tI),nI=({title:e,titleId:t,...r},n)=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:10,height:19,fill:"none",ref:n,"aria-labelledby":t,...r},e?F.createElement("title",{id:t},e):null,F.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"})),oI=J.forwardRef(nI),aI=({title:e,titleId:t,...r},n)=>F.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:n,"aria-labelledby":t,...r},e?F.createElement("title",{id:t},e):null,F.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"})),sI=J.forwardRef(aI);function iI(){this.__data__=[],this.size=0}function Pf(e,t){return e===t||e!==e&&t!==t}function Fs(e,t){for(var r=e.length;r--;)if(Pf(e[r][0],t))return r;return-1}var lI=Array.prototype,cI=lI.splice;function uI(e){var t=this.__data__,r=Fs(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():cI.call(t,r,1),--this.size,!0}function dI(e){var t=this.__data__,r=Fs(t,e);return r<0?void 0:t[r][1]}function hI(e){return Fs(this.__data__,e)>-1}function pI(e,t){var r=this.__data__,n=Fs(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function Zt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Zt.prototype.clear=iI;Zt.prototype.delete=uI;Zt.prototype.get=dI;Zt.prototype.has=hI;Zt.prototype.set=pI;function mI(){this.__data__=new Zt,this.size=0}function fI(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function gI(e){return this.__data__.get(e)}function yI(e){return this.__data__.has(e)}var bI="[object AsyncFunction]",xI="[object Function]",vI="[object GeneratorFunction]",SI="[object Proxy]";function Tf(e){if(!_r(e))return!1;var t=Lr(e);return t==xI||t==vI||t==bI||t==SI}var Ui=Dt["__core-js_shared__"],ih=function(){var e=/[^.]+$/.exec(Ui&&Ui.keys&&Ui.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function OI(e){return!!ih&&ih in e}var wI=Function.prototype,CI=wI.toString;function Nr(e){if(e!=null){try{return CI.call(e)}catch{}try{return e+""}catch{}}return""}var PI=/[\\^$.*+?()[\]{}|]/g,TI=/^\[object .+?Constructor\]$/,RI=Function.prototype,AI=Object.prototype,_I=RI.toString,EI=AI.hasOwnProperty,II=RegExp("^"+_I.call(EI).replace(PI,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function VI(e){if(!_r(e)||OI(e))return!1;var t=Tf(e)?II:TI;return t.test(Nr(e))}function MI(e,t){return e==null?void 0:e[t]}function Fr(e,t){var r=MI(e,t);return VI(r)?r:void 0}var Co=Fr(Dt,"Map"),Po=Fr(Object,"create");function jI(){this.__data__=Po?Po(null):{},this.size=0}function kI(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var $I="__lodash_hash_undefined__",UI=Object.prototype,DI=UI.hasOwnProperty;function LI(e){var t=this.__data__;if(Po){var r=t[e];return r===$I?void 0:r}return DI.call(t,e)?t[e]:void 0}var BI=Object.prototype,NI=BI.hasOwnProperty;function FI(e){var t=this.__data__;return Po?t[e]!==void 0:NI.call(t,e)}var zI="__lodash_hash_undefined__";function GI(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Po&&t===void 0?zI:t,this}function Vr(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Vr.prototype.clear=jI;Vr.prototype.delete=kI;Vr.prototype.get=LI;Vr.prototype.has=FI;Vr.prototype.set=GI;function HI(){this.size=0,this.__data__={hash:new Vr,map:new(Co||Zt),string:new Vr}}function qI(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function zs(e,t){var r=e.__data__;return qI(t)?r[typeof t=="string"?"string":"hash"]:r.map}function WI(e){var t=zs(this,e).delete(e);return this.size-=t?1:0,t}function JI(e){return zs(this,e).get(e)}function YI(e){return zs(this,e).has(e)}function KI(e,t){var r=zs(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function er(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}er.prototype.clear=HI;er.prototype.delete=WI;er.prototype.get=JI;er.prototype.has=YI;er.prototype.set=KI;var QI=200;function XI(e,t){var r=this.__data__;if(r instanceof Zt){var n=r.__data__;if(!Co||n.length<QI-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new er(n)}return r.set(e,t),this.size=r.size,this}function qt(e){var t=this.__data__=new Zt(e);this.size=t.size}qt.prototype.clear=mI;qt.prototype.delete=fI;qt.prototype.get=gI;qt.prototype.has=yI;qt.prototype.set=XI;var ZI="__lodash_hash_undefined__";function eV(e){return this.__data__.set(e,ZI),this}function tV(e){return this.__data__.has(e)}function Xa(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new er;++t<r;)this.add(e[t])}Xa.prototype.add=Xa.prototype.push=eV;Xa.prototype.has=tV;function rV(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function nV(e,t){return e.has(t)}var oV=1,aV=2;function Rf(e,t,r,n,o,a){var s=r&oV,i=e.length,l=t.length;if(i!=l&&!(s&&l>i))return!1;var c=a.get(e),u=a.get(t);if(c&&u)return c==t&&u==e;var d=-1,h=!0,p=r&aV?new Xa:void 0;for(a.set(e,t),a.set(t,e);++d<i;){var f=e[d],m=t[d];if(n)var b=s?n(m,f,d,t,e,a):n(f,m,d,e,t,a);if(b!==void 0){if(b)continue;h=!1;break}if(p){if(!rV(t,function(S,E){if(!nV(p,E)&&(f===S||o(f,S,r,n,a)))return p.push(E)})){h=!1;break}}else if(!(f===m||o(f,m,r,n,a))){h=!1;break}}return a.delete(e),a.delete(t),h}var lh=Dt.Uint8Array;function sV(e){var t=-1,r=Array(e.size);return e.forEach(function(n,o){r[++t]=[o,n]}),r}function iV(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var lV=1,cV=2,uV="[object Boolean]",dV="[object Date]",hV="[object Error]",pV="[object Map]",mV="[object Number]",fV="[object RegExp]",gV="[object Set]",yV="[object String]",bV="[object Symbol]",xV="[object ArrayBuffer]",vV="[object DataView]",ch=hr?hr.prototype:void 0,Di=ch?ch.valueOf:void 0;function SV(e,t,r,n,o,a,s){switch(r){case vV:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case xV:return!(e.byteLength!=t.byteLength||!a(new lh(e),new lh(t)));case uV:case dV:case mV:return Pf(+e,+t);case hV:return e.name==t.name&&e.message==t.message;case fV:case yV:return e==t+"";case pV:var i=sV;case gV:var l=n&lV;if(i||(i=iV),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;n|=cV,s.set(e,t);var u=Rf(i(e),i(t),n,o,a,s);return s.delete(e),u;case bV:if(Di)return Di.call(e)==Di.call(t)}return!1}function OV(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}var Ut=Array.isArray;function wV(e,t,r){var n=t(e);return Ut(e)?n:OV(n,r(e))}function CV(e,t){for(var r=-1,n=e==null?0:e.length,o=0,a=[];++r<n;){var s=e[r];t(s,r,e)&&(a[o++]=s)}return a}function PV(){return[]}var TV=Object.prototype,RV=TV.propertyIsEnumerable,uh=Object.getOwnPropertySymbols,AV=uh?function(e){return e==null?[]:(e=Object(e),CV(uh(e),function(t){return RV.call(e,t)}))}:PV;function _V(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var EV="[object Arguments]";function dh(e){return Er(e)&&Lr(e)==EV}var Af=Object.prototype,IV=Af.hasOwnProperty,VV=Af.propertyIsEnumerable,_f=dh(function(){return arguments}())?dh:function(e){return Er(e)&&IV.call(e,"callee")&&!VV.call(e,"callee")};function MV(){return!1}var Ef=typeof exports=="object"&&exports&&!exports.nodeType&&exports,hh=Ef&&typeof module=="object"&&module&&!module.nodeType&&module,jV=hh&&hh.exports===Ef,ph=jV?Dt.Buffer:void 0,kV=ph?ph.isBuffer:void 0,vl=kV||MV,$V=9007199254740991,UV=/^(?:0|[1-9]\d*)$/;function If(e,t){var r=typeof e;return t=t??$V,!!t&&(r=="number"||r!="symbol"&&UV.test(e))&&e>-1&&e%1==0&&e<t}var DV=9007199254740991;function Pc(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=DV}var LV="[object Arguments]",BV="[object Array]",NV="[object Boolean]",FV="[object Date]",zV="[object Error]",GV="[object Function]",HV="[object Map]",qV="[object Number]",WV="[object Object]",JV="[object RegExp]",YV="[object Set]",KV="[object String]",QV="[object WeakMap]",XV="[object ArrayBuffer]",ZV="[object DataView]",eM="[object Float32Array]",tM="[object Float64Array]",rM="[object Int8Array]",nM="[object Int16Array]",oM="[object Int32Array]",aM="[object Uint8Array]",sM="[object Uint8ClampedArray]",iM="[object Uint16Array]",lM="[object Uint32Array]",Ie={};Ie[eM]=Ie[tM]=Ie[rM]=Ie[nM]=Ie[oM]=Ie[aM]=Ie[sM]=Ie[iM]=Ie[lM]=!0;Ie[LV]=Ie[BV]=Ie[XV]=Ie[NV]=Ie[ZV]=Ie[FV]=Ie[zV]=Ie[GV]=Ie[HV]=Ie[qV]=Ie[WV]=Ie[JV]=Ie[YV]=Ie[KV]=Ie[QV]=!1;function cM(e){return Er(e)&&Pc(e.length)&&!!Ie[Lr(e)]}function uM(e){return function(t){return e(t)}}var Vf=typeof exports=="object"&&exports&&!exports.nodeType&&exports,lo=Vf&&typeof module=="object"&&module&&!module.nodeType&&module,dM=lo&&lo.exports===Vf,Li=dM&&Em.process,mh=function(){try{var e=lo&&lo.require&&lo.require("util").types;return e||Li&&Li.binding&&Li.binding("util")}catch{}}(),fh=mh&&mh.isTypedArray,Mf=fh?uM(fh):cM,hM=Object.prototype,pM=hM.hasOwnProperty;function mM(e,t){var r=Ut(e),n=!r&&_f(e),o=!r&&!n&&vl(e),a=!r&&!n&&!o&&Mf(e),s=r||n||o||a,i=s?_V(e.length,String):[],l=i.length;for(var c in e)pM.call(e,c)&&!(s&&(c=="length"||o&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||If(c,l)))&&i.push(c);return i}var fM=Object.prototype;function gM(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||fM;return e===r}function yM(e,t){return function(r){return e(t(r))}}var bM=yM(Object.keys,Object),xM=Object.prototype,vM=xM.hasOwnProperty;function SM(e){if(!gM(e))return bM(e);var t=[];for(var r in Object(e))vM.call(e,r)&&r!="constructor"&&t.push(r);return t}function jf(e){return e!=null&&Pc(e.length)&&!Tf(e)}function Tc(e){return jf(e)?mM(e):SM(e)}function gh(e){return wV(e,Tc,AV)}var OM=1,wM=Object.prototype,CM=wM.hasOwnProperty;function PM(e,t,r,n,o,a){var s=r&OM,i=gh(e),l=i.length,c=gh(t),u=c.length;if(l!=u&&!s)return!1;for(var d=l;d--;){var h=i[d];if(!(s?h in t:CM.call(t,h)))return!1}var p=a.get(e),f=a.get(t);if(p&&f)return p==t&&f==e;var m=!0;a.set(e,t),a.set(t,e);for(var b=s;++d<l;){h=i[d];var S=e[h],E=t[h];if(n)var O=s?n(E,S,h,t,e,a):n(S,E,h,e,t,a);if(!(O===void 0?S===E||o(S,E,r,n,a):O)){m=!1;break}b||(b=h=="constructor")}if(m&&!b){var w=e.constructor,A=t.constructor;w!=A&&"constructor"in e&&"constructor"in t&&!(typeof w=="function"&&w instanceof w&&typeof A=="function"&&A instanceof A)&&(m=!1)}return a.delete(e),a.delete(t),m}var Sl=Fr(Dt,"DataView"),Ol=Fr(Dt,"Promise"),wl=Fr(Dt,"Set"),Cl=Fr(Dt,"WeakMap"),yh="[object Map]",TM="[object Object]",bh="[object Promise]",xh="[object Set]",vh="[object WeakMap]",Sh="[object DataView]",RM=Nr(Sl),AM=Nr(Co),_M=Nr(Ol),EM=Nr(wl),IM=Nr(Cl),sr=Lr;(Sl&&sr(new Sl(new ArrayBuffer(1)))!=Sh||Co&&sr(new Co)!=yh||Ol&&sr(Ol.resolve())!=bh||wl&&sr(new wl)!=xh||Cl&&sr(new Cl)!=vh)&&(sr=function(e){var t=Lr(e),r=t==TM?e.constructor:void 0,n=r?Nr(r):"";if(n)switch(n){case RM:return Sh;case AM:return yh;case _M:return bh;case EM:return xh;case IM:return vh}return t});var VM=1,Oh="[object Arguments]",wh="[object Array]",da="[object Object]",MM=Object.prototype,Ch=MM.hasOwnProperty;function jM(e,t,r,n,o,a){var s=Ut(e),i=Ut(t),l=s?wh:sr(e),c=i?wh:sr(t);l=l==Oh?da:l,c=c==Oh?da:c;var u=l==da,d=c==da,h=l==c;if(h&&vl(e)){if(!vl(t))return!1;s=!0,u=!1}if(h&&!u)return a||(a=new qt),s||Mf(e)?Rf(e,t,r,n,o,a):SV(e,t,l,r,n,o,a);if(!(r&VM)){var p=u&&Ch.call(e,"__wrapped__"),f=d&&Ch.call(t,"__wrapped__");if(p||f){var m=p?e.value():e,b=f?t.value():t;return a||(a=new qt),o(m,b,r,n,a)}}return h?(a||(a=new qt),PM(e,t,r,n,o,a)):!1}function Gs(e,t,r,n,o){return e===t?!0:e==null||t==null||!Er(e)&&!Er(t)?e!==e&&t!==t:jM(e,t,r,n,Gs,o)}function kM(e,t){return Gs(e,t)}const kf=({store:e})=>{const{t}=_e.useTranslation(),[r,n]=J.useState(e.jogger.motionStream.rapidlyChangingMotionState.state.joint_limit_reached.limit_reached),o=J.useRef(r);Rn(()=>{const s=e.jogger.motionStream.rapidlyChangingMotionState.state.joint_limit_reached.limit_reached;kM(o.current,s)||(o.current=s,n(s))});const a=[];for(const[s,i]of r.entries())i&&a.push(s);return g.jsx(P.Typography,{color:"error",sx:{margin:"0.5rem 1rem",textAlign:"center",minHeight:"1.5rem",visibility:a.length?"visible":"hidden"},children:t("Jogging.JointLimitsReached.lb",{jointNumbers:a.map(s=>s+1).join(", ")})})},$M=P.styled(P.FormControl)(({theme:e})=>({"&.MuiFormControl-root":{".MuiSelect-select":{paddingTop:"20px",paddingLeft:"12px"},label:{pointerEvents:"none",fontSize:"16px"},".MuiInputLabel-root":{"&.Mui-focused":{color:e.palette.text.primary}}}}));function ha({labelValue:e,...t}){return g.jsxs($M,{fullWidth:!0,variant:"filled",children:[g.jsx(P.InputLabel,{id:t.labelId,children:e}),g.jsx(P.Select,{...t})]})}var Ph=function(){try{var e=Fr(Object,"defineProperty");return e({},"",{}),e}catch{}}();function UM(e,t,r){t=="__proto__"&&Ph?Ph(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function DM(e,t,r,n){for(var o=-1,a=e==null?0:e.length;++o<a;){var s=e[o];t(n,s,r(s),e)}return n}function LM(e){return function(t,r,n){for(var o=-1,a=Object(t),s=n(t),i=s.length;i--;){var l=s[++o];if(r(a[l],l,a)===!1)break}return t}}var BM=LM();function NM(e,t){return e&&BM(e,t,Tc)}function FM(e,t){return function(r,n){if(r==null)return r;if(!jf(r))return e(r,n);for(var o=r.length,a=-1,s=Object(r);++a<o&&n(s[a],a,s)!==!1;);return r}}var zM=FM(NM);function GM(e,t,r,n){return zM(e,function(o,a,s){t(n,o,r(o),s)}),n}var HM=1,qM=2;function WM(e,t,r,n){var o=r.length,a=o;if(e==null)return!a;for(e=Object(e);o--;){var s=r[o];if(s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o<a;){s=r[o];var i=s[0],l=e[i],c=s[1];if(s[2]){if(l===void 0&&!(i in e))return!1}else{var u=new qt,d;if(!(d===void 0?Gs(c,l,HM|qM,n,u):d))return!1}}return!0}function $f(e){return e===e&&!_r(e)}function JM(e){for(var t=Tc(e),r=t.length;r--;){var n=t[r],o=e[n];t[r]=[n,o,$f(o)]}return t}function Uf(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}function YM(e){var t=JM(e);return t.length==1&&t[0][2]?Uf(t[0][0],t[0][1]):function(r){return r===e||WM(r,e,t)}}var KM=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,QM=/^\w*$/;function Rc(e,t){if(Ut(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Vs(e)?!0:QM.test(e)||!KM.test(e)||t!=null&&e in Object(t)}var XM="Expected a function";function Ac(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(XM);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var s=e.apply(this,n);return r.cache=a.set(o,s)||a,s};return r.cache=new(Ac.Cache||er),r}Ac.Cache=er;var ZM=500;function e5(e){var t=Ac(e,function(n){return r.size===ZM&&r.clear(),n}),r=t.cache;return t}var t5=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r5=/\\(\\)?/g,n5=e5(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(t5,function(r,n,o,a){t.push(o?a.replace(r5,"$1"):n||r)}),t});function o5(e,t){for(var r=-1,n=e==null?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}var Th=hr?hr.prototype:void 0,Rh=Th?Th.toString:void 0;function Df(e){if(typeof e=="string")return e;if(Ut(e))return o5(e,Df)+"";if(Vs(e))return Rh?Rh.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Lf(e){return e==null?"":Df(e)}function Bf(e,t){return Ut(e)?e:Rc(e,t)?[e]:n5(Lf(e))}function Hs(e){if(typeof e=="string"||Vs(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Nf(e,t){t=Bf(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[Hs(t[r++])];return r&&r==n?e:void 0}function a5(e,t,r){var n=e==null?void 0:Nf(e,t);return n===void 0?r:n}function s5(e,t){return e!=null&&t in Object(e)}function i5(e,t,r){t=Bf(t,e);for(var n=-1,o=t.length,a=!1;++n<o;){var s=Hs(t[n]);if(!(a=e!=null&&r(e,s)))break;e=e[s]}return a||++n!=o?a:(o=e==null?0:e.length,!!o&&Pc(o)&&If(s,o)&&(Ut(e)||_f(e)))}function l5(e,t){return e!=null&&i5(e,t,s5)}var c5=1,u5=2;function d5(e,t){return Rc(e)&&$f(t)?Uf(Hs(e),t):function(r){var n=a5(r,e);return n===void 0&&n===t?l5(r,e):Gs(t,n,c5|u5)}}function h5(e){return e}function p5(e){return function(t){return t==null?void 0:t[e]}}function m5(e){return function(t){return Nf(t,e)}}function f5(e){return Rc(e)?p5(Hs(e)):m5(e)}function g5(e){return typeof e=="function"?e:e==null?h5:typeof e=="object"?Ut(e)?d5(e[0],e[1]):YM(e):f5(e)}function y5(e,t){return function(r,n){var o=Ut(r)?DM:GM,a={};return o(r,e,g5(n),a)}}var pa=y5(function(e,t,r){UM(e,r,t)}),b5=0;function x5(e){var t=++b5;return Lf(e)+t}const Pl=[{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}],v5=[{id:"continuous"},...Pl],S5=["coordsys","tool"];class qs{constructor(t,r,n,o){var a,s;this.jogger=t,this.motionGroupSpec=r,this.coordSystems=n,this.tcps=o,this.selectedTabId="cartesian",this.activationState="inactive",this.activationError=null,this.activationCounter=0,this.locks=new Set,this.selectedCoordSystemId="world",this.selectedTcpId="",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=!0,this.showTcpSelect=!0,this.showOrientationSelect=!0,this.showIncrementSelect=!0,this.showTabIcons=!1,this.showVelocitySliderLabel=!0,this.showVelocityLegend=!1,this.showJointsLegend=!1,this.disposers=[];for(const i of n)if(i.coordinate_system===""){i.coordinate_system="world";break}this.selectedCoordSystemId=((a=n[0])==null?void 0:a.coordinate_system)||"world",this.selectedTcpId=((s=o[0])==null?void 0:s.id)||"",$e.makeAutoObservable(this,{},{autoBind:!0}),this.loadFromLocalStorage(),this.disposers.push($e.autorun(()=>this.saveToLocalStorage())),window.joggingStore=this}static async loadFor(t){const{nova:r}=t,[n,{coordinatesystems:o},{tcps:a}]=await Promise.all([r.api.motionGroupInfos.getMotionGroupSpecification(t.motionGroupId),r.api.coordinateSystems.listCoordinateSystems("ROTATION_VECTOR"),r.api.motionGroupInfos.listTcps(t.motionGroupId,"ROTATION_VECTOR")]);return new qs(t,n,o||[],a||[])}dispose(){for(const t of this.disposers)t();this.jogger.dispose()}get coordSystemCountByName(){return Al.countBy(this.coordSystems,t=>t.name)}async deactivate(){const t=this.jogger.activeWebsocket;this.jogger.setJoggingMode("increment"),t&&await t.closed()}async activate(){if(this.currentTab.id==="cartesian"){const t={tcpId:this.selectedTcpId,coordSystemId:this.activeCoordSystemId};this.activeDiscreteIncrement?this.jogger.setJoggingMode("increment",t):this.jogger.setJoggingMode("cartesian",t)}else this.jogger.setJoggingMode("joint");return this.jogger}loadFromLocalStorage(){const t=Cr.tryParseJson(localStorage.getItem("joggingToolStore"));t&&(this.tabsById[t.selectedTabId]&&(this.selectedTabId=t.selectedTabId),this.coordSystemsById[t.selectedCoordSystemId]&&(this.selectedCoordSystemId=t.selectedCoordSystemId),this.tcpsById[t.selectedTcpId]&&(this.selectedTcpId=t.selectedTcpId),this.incrementOptionsById[t.selectedIncrementId]&&(this.selectedIncrementId=t.selectedIncrementId),["translate","rotate"].includes(t.selectedCartesianMotionType)&&(this.selectedCartesianMotionType=t.selectedCartesianMotionType),["coordsys","tool"].includes(t.selectedOrientation)&&(this.selectedOrientation=t.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,selectedTcpId:this.selectedTcpId,selectedOrientation:this.selectedOrientation,selectedIncrementId:this.selectedIncrementId,selectedCartesianMotionType:this.selectedCartesianMotionType}}get tabs(){return[{id:"cartesian",label:"cartesian"},{id:"joint",label:"joint"}]}get incrementOptions(){return v5}get discreteIncrementOptions(){return Pl}get incrementOptionsById(){return pa(this.incrementOptions,t=>t.id)}get tabsById(){return pa(this.tabs,t=>t.id)}get currentTab(){return this.tabsById[this.selectedTabId]||this.tabs[0]}get tabIndex(){return this.tabs.indexOf(this.currentTab)}get coordSystemsById(){return pa(this.coordSystems,t=>t.coordinate_system)}get selectedCoordSystem(){return this.coordSystemsById[this.selectedCoordSystemId]}get activeCoordSystemId(){return this.selectedOrientation==="tool"?"tool":this.selectedCoordSystemId}get tcpsById(){return pa(this.tcps,t=>t.id)}get activeDiscreteIncrement(){return this.selectedOrientation==="tool"?void 0:Pl.find(t=>t.id===this.selectedIncrementId)}get rotationVelocityRadsPerSec(){return this.rotationVelocityDegPerSec*Math.PI/180}get velocityInDisplayUnits(){return this.currentMotionType==="translate"?this.translationVelocityMmPerSec:this.rotationVelocityDegPerSec}get minVelocityInDisplayUnits(){return this.currentMotionType==="translate"?this.minTranslationVelocityMmPerSec:this.minRotationVelocityDegPerSec}get maxVelocityInDisplayUnits(){return this.currentMotionType==="translate"?this.maxTranslationVelocityMmPerSec:this.maxRotationVelocityDegPerSec}get currentMotionType(){return this.selectedTabId==="cartesian"&&this.selectedCartesianMotionType==="translate"?"translate":"rotate"}onTabChange(t,r){const n=this.tabs[r]||this.tabs[0];this.selectedTabId=n.id}setSelectedCoordSystemId(t){this.selectedCoordSystemId=t}setSelectedTcpId(t){this.selectedTcpId=t}setSelectedOrientation(t){this.selectedOrientation=t}setSelectedIncrementId(t){this.selectedIncrementId=t}setCurrentIncrementJog(t){this.incrementJogInProgress=t}setVelocityFromSlider(t){this.currentMotionType==="translate"?this.translationVelocityMmPerSec=t:this.rotationVelocityDegPerSec=t}setSelectedCartesianMotionType(t){this.selectedCartesianMotionType=t}lock(t){this.locks.add(t)}unlock(t){this.locks.delete(t)}async withMotionLock(t){const r=x5();this.lock(r);try{return await t()}finally{this.unlock(r)}}}const O5=Oe.observer(({store:e})=>{var o;const{t}=_e.useTranslation(),r=[];function n(a){switch(a){case"coordsys":return t("Jogging.Orientation.coordsys");case"tool":return t("Jogging.Orientation.tool");default:return a}}return e.showCoordSystemSelect&&r.push(g.jsx(ha,{labelId:"jogging-coord-select",labelValue:t("Jogging.CoordinateSystem.hlb"),value:e.selectedCoordSystemId,size:"small",variant:"filled",displayEmpty:!0,onChange:a=>e.setSelectedCoordSystemId(a.target.value),disabled:e.isLocked,children:e.coordSystems.map(a=>g.jsx(P.MenuItem,{value:a.coordinate_system,children:a.name&&e.coordSystemCountByName[a.name]>1?`${a.name} / ${a.coordinate_system}`:a.name||a.coordinate_system},a.coordinate_system))},"coord")),e.showTcpSelect&&r.push(g.jsx(ha,{labelId:"jogging-tcp-select",labelValue:"TCP",value:e.selectedTcpId,size:"small",variant:"filled",onChange:a=>e.setSelectedTcpId(a.target.value),disabled:e.isLocked,children:e.tcps.map(a=>g.jsx(P.MenuItem,{value:a.id,children:a.id},a.id))},"tcp")),e.showOrientationSelect&&r.push(g.jsx(ha,{labelValue:t("Jogging.Cartesian.Orientation.lb"),id:"orientation-select",labelId:"orientation-select",value:e.selectedOrientation,onChange:a=>e.setSelectedOrientation(a.target.value),disabled:e.isLocked,children:S5.map(a=>g.jsx(P.MenuItem,{value:a,children:n(a)},a))},"orientation")),e.showIncrementSelect&&r.push(g.jsxs(ha,{labelValue:t("Jogging.Increment.hlb"),labelId:"jogging-increment-select",size:"small",variant:"filled",value:((o=e.activeDiscreteIncrement)==null?void 0:o.id)||"continuous",onChange:a=>e.setSelectedIncrementId(a.target.value),disabled:e.isLocked,children:[g.jsx(P.MenuItem,{value:"continuous",children:t("Jogging.Increment.Continuous.dd")},"continuous"),e.selectedOrientation==="tool"?null:e.discreteIncrementOptions.map(a=>g.jsx(P.MenuItem,{value:a.id,children:e.currentMotionType==="translate"?`${a.mm}mm`:`${a.degrees}°`},a.id))]},"increment")),g.jsx(P.Box,{component:"div",sx:{display:"grid",gap:"16px",gridTemplateColumns:"1fr 1fr",gridAutoRows:"min-content","& label":{opacity:.7,fontSize:"12px",marginBottom:"4px"}},children:r.map((a,s)=>g.jsx(P.Box,{sx:{gridColumn:r.length%2===1&&s===r.length-1?"span 2":"auto"},children:a},s))})}),w5=P.styled(P.ToggleButtonGroup)(({theme:e})=>{var t;return{"&.MuiToggleButtonGroup-root":{background:(t=e.palette.backgroundPaperElevation)==null?void 0:t[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"}}}}});function Ah(e,t){return process.env.NODE_ENV==="production"?()=>null:function(...n){return e(...n)||t(...n)}}function C5(e){return typeof e=="string"}function P5(e,t,r){return e===void 0||C5(e)?t:{...t,ownerState:{...t.ownerState,...r}}}function Pa(e,t=[]){if(e===void 0)return{};const r={};return Object.keys(e).filter(n=>n.match(/^on[A-Z]/)&&typeof e[n]=="function"&&!t.includes(n)).forEach(n=>{r[n]=e[n]}),r}function _h(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(r=>!(r.match(/^on[A-Z]/)&&typeof e[r]=="function")).forEach(r=>{t[r]=e[r]}),t}function T5(e){const{getSlotProps:t,additionalProps:r,externalSlotProps:n,externalForwardedProps:o,className:a}=e;if(!t){const p=Pt(r==null?void 0:r.className,a,o==null?void 0:o.className,n==null?void 0:n.className),f={...r==null?void 0:r.style,...o==null?void 0:o.style,...n==null?void 0:n.style},m={...r,...o,...n};return p.length>0&&(m.className=p),Object.keys(f).length>0&&(m.style=f),{props:m,internalRef:void 0}}const s=Pa({...o,...n}),i=_h(n),l=_h(o),c=t(s),u=Pt(c==null?void 0:c.className,r==null?void 0:r.className,a,o==null?void 0:o.className,n==null?void 0:n.className),d={...c==null?void 0:c.style,...r==null?void 0:r.style,...o==null?void 0:o.style,...n==null?void 0:n.style},h={...c,...r,...l,...i};return u.length>0&&(h.className=u),Object.keys(d).length>0&&(h.style=d),{props:h,internalRef:c.ref}}function R5(e,t,r){return typeof e=="function"?e(t,r):e}function ar(e){var d;const{elementType:t,externalSlotProps:r,ownerState:n,skipResolvingSlotProps:o=!1,...a}=e,s=o?{}:R5(r,n),{props:i,internalRef:l}=T5({...a,externalSlotProps:s}),c=ps(l,s==null?void 0:s.ref,(d=e.additionalProps)==null?void 0:d.ref);return P5(t,{...i,ref:c},n)}function Eh(e){try{return e.matches(":focus-visible")}catch{process.env.NODE_ENV!=="production"&&!/jsdom/.test(window.navigator.userAgent)&&console.warn(["MUI: The `:focus-visible` pseudo class is not supported in this browser.","Some components rely on this feature to work properly."].join(`
|
|
154
|
-
`))}return!1}const A5={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function _5(e,t,r=(n,o)=>n===o){return e.length===t.length&&e.every((n,o)=>r(n,t[o]))}const E5=2;function on(e,t,r,n,o){return r===1?Math.min(e+t,o):Math.max(e-t,n)}function Ff(e,t){return e-t}function Ih(e,t){const{index:r}=e.reduce((n,o,a)=>{const s=Math.abs(t-o);return n===null||s<n.distance||s===n.distance?{distance:s,index:a}:n},null)??{};return r}function ma(e,t){if(t.current!==void 0&&e.changedTouches){const r=e;for(let n=0;n<r.changedTouches.length;n+=1){const o=r.changedTouches[n];if(o.identifier===t.current)return{x:o.clientX,y:o.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function Za(e,t,r){return(e-t)*100/(r-t)}function I5(e,t,r){return(r-t)*e+t}function V5(e){if(Math.abs(e)<1){const r=e.toExponential().split("e-"),n=r[0].split(".")[1];return(n?n.length:0)+parseInt(r[1],10)}const t=e.toString().split(".")[1];return t?t.length:0}function M5(e,t,r){const n=Math.round((e-r)/t)*t+r;return Number(n.toFixed(V5(t)))}function Vh({values:e,newValue:t,index:r}){const n=e.slice();return n[r]=t,n.sort(Ff)}function fa({sliderRef:e,activeIndex:t,setActive:r}){var o,a,s;const n=ao(e.current);(!((o=e.current)!=null&&o.contains(n.activeElement))||Number((a=n==null?void 0:n.activeElement)==null?void 0:a.getAttribute("data-index"))!==t)&&((s=e.current)==null||s.querySelector(`[type="range"][data-index="${t}"]`).focus()),r&&r(t)}function ga(e,t){return typeof e=="number"&&typeof t=="number"?e===t:typeof e=="object"&&typeof t=="object"?_5(e,t):!1}const j5={horizontal:{offset:e=>({left:`${e}%`}),leap:e=>({width:`${e}%`})},"horizontal-reverse":{offset:e=>({right:`${e}%`}),leap:e=>({width:`${e}%`})},vertical:{offset:e=>({bottom:`${e}%`}),leap:e=>({height:`${e}%`})}},k5=e=>e;let ya;function Mh(){return ya===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?ya=CSS.supports("touch-action","none"):ya=!0),ya}function $5(e){const{"aria-labelledby":t,defaultValue:r,disabled:n=!1,disableSwap:o=!1,isRtl:a=!1,marks:s=!1,max:i=100,min:l=0,name:c,onChange:u,onChangeCommitted:d,orientation:h="horizontal",rootRef:p,scale:f=k5,step:m=1,shiftStep:b=10,tabIndex:S,value:E}=e,O=F.useRef(void 0),[w,A]=F.useState(-1),[C,T]=F.useState(-1),[V,j]=F.useState(!1),y=F.useRef(0),R=F.useRef(null),[z,I]=Yw({controlled:E,default:r??l,name:"Slider"}),G=u&&((Q,ne,ce)=>{const ye=Q.nativeEvent||Q,Te=new ye.constructor(ye.type,ye);Object.defineProperty(Te,"target",{writable:!0,value:{value:ne,name:c}}),R.current=ne,u(Te,ne,ce)}),oe=Array.isArray(z);let re=oe?z.slice().sort(Ff):[z];re=re.map(Q=>Q==null?l:an(Q,l,i));const te=s===!0&&m!==null?[...Array(Math.floor((i-l)/m)+1)].map((Q,ne)=>({value:l+m*ne})):s||[],ee=te.map(Q=>Q.value),[se,H]=F.useState(-1),X=F.useRef(null),le=ps(p,X),xe=Q=>ne=>{var ye;const ce=Number(ne.currentTarget.getAttribute("data-index"));Eh(ne.target)&&H(ce),T(ce),(ye=Q==null?void 0:Q.onFocus)==null||ye.call(Q,ne)},Le=Q=>ne=>{var ce;Eh(ne.target)||H(-1),T(-1),(ce=Q==null?void 0:Q.onBlur)==null||ce.call(Q,ne)},ae=(Q,ne)=>{const ce=Number(Q.currentTarget.getAttribute("data-index")),ye=re[ce],Te=ee.indexOf(ye);let ue=ne;if(te&&m==null){const We=ee[ee.length-1];ue>=We?ue=We:ue<=ee[0]?ue=ee[0]:ue=ue<ye?ee[Te-1]:ee[Te+1]}if(ue=an(ue,l,i),oe){o&&(ue=an(ue,re[ce-1]||-1/0,re[ce+1]||1/0));const We=ue;ue=Vh({values:re,newValue:ue,index:ce});let tt=ce;o||(tt=ue.indexOf(We)),fa({sliderRef:X,activeIndex:tt})}I(ue),H(ce),G&&!ga(ue,z)&&G(Q,ue,ce),d&&d(Q,R.current??ue)},be=Q=>ne=>{var ce;if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(ne.key)){ne.preventDefault();const ye=Number(ne.currentTarget.getAttribute("data-index")),Te=re[ye];let ue=null;if(m!=null){const We=ne.shiftKey?b:m;switch(ne.key){case"ArrowUp":ue=on(Te,We,1,l,i);break;case"ArrowRight":ue=on(Te,We,a?-1:1,l,i);break;case"ArrowDown":ue=on(Te,We,-1,l,i);break;case"ArrowLeft":ue=on(Te,We,a?1:-1,l,i);break;case"PageUp":ue=on(Te,b,1,l,i);break;case"PageDown":ue=on(Te,b,-1,l,i);break;case"Home":ue=l;break;case"End":ue=i;break}}else if(te){const We=ee[ee.length-1],tt=ee.indexOf(Te),ze=[a?"ArrowRight":"ArrowLeft","ArrowDown","PageDown","Home"],mt=[a?"ArrowLeft":"ArrowRight","ArrowUp","PageUp","End"];ze.includes(ne.key)?tt===0?ue=ee[0]:ue=ee[tt-1]:mt.includes(ne.key)&&(tt===ee.length-1?ue=We:ue=ee[tt+1])}ue!=null&&ae(ne,ue)}(ce=Q==null?void 0:Q.onKeyDown)==null||ce.call(Q,ne)};$t(()=>{var Q;n&&X.current.contains(document.activeElement)&&((Q=document.activeElement)==null||Q.blur())},[n]),n&&w!==-1&&A(-1),n&&se!==-1&&H(-1);const Se=Q=>ne=>{var ce;(ce=Q.onChange)==null||ce.call(Q,ne),ae(ne,ne.target.valueAsNumber)},me=F.useRef(void 0);let Z=h;a&&h==="horizontal"&&(Z+="-reverse");const ie=({finger:Q,move:ne=!1})=>{const{current:ce}=X,{width:ye,height:Te,bottom:ue,left:We}=ce.getBoundingClientRect();let tt;Z.startsWith("vertical")?tt=(ue-Q.y)/Te:tt=(Q.x-We)/ye,Z.includes("-reverse")&&(tt=1-tt);let ze;if(ze=I5(tt,l,i),m)ze=M5(ze,m,l);else{const kn=Ih(ee,ze);ze=ee[kn]}ze=an(ze,l,i);let mt=0;if(oe){ne?mt=me.current:mt=Ih(re,ze),o&&(ze=an(ze,re[mt-1]||-1/0,re[mt+1]||1/0));const kn=ze;ze=Vh({values:re,newValue:ze,index:mt}),o&&ne||(mt=ze.indexOf(kn),me.current=mt)}return{newValue:ze,activeIndex:mt}},de=Ht(Q=>{const ne=ma(Q,O);if(!ne)return;if(y.current+=1,Q.type==="mousemove"&&Q.buttons===0){Y(Q);return}const{newValue:ce,activeIndex:ye}=ie({finger:ne,move:!0});fa({sliderRef:X,activeIndex:ye,setActive:A}),I(ce),!V&&y.current>E5&&j(!0),G&&!ga(ce,z)&&G(Q,ce,ye)}),Y=Ht(Q=>{const ne=ma(Q,O);if(j(!1),!ne)return;const{newValue:ce}=ie({finger:ne,move:!0});A(-1),Q.type==="touchend"&&T(-1),d&&d(Q,R.current??ce),O.current=void 0,ge()}),we=Ht(Q=>{if(n)return;Mh()||Q.preventDefault();const ne=Q.changedTouches[0];ne!=null&&(O.current=ne.identifier);const ce=ma(Q,O);if(ce!==!1){const{newValue:Te,activeIndex:ue}=ie({finger:ce});fa({sliderRef:X,activeIndex:ue,setActive:A}),I(Te),G&&!ga(Te,z)&&G(Q,Te,ue)}y.current=0;const ye=ao(X.current);ye.addEventListener("touchmove",de,{passive:!0}),ye.addEventListener("touchend",Y,{passive:!0})}),ge=F.useCallback(()=>{const Q=ao(X.current);Q.removeEventListener("mousemove",de),Q.removeEventListener("mouseup",Y),Q.removeEventListener("touchmove",de),Q.removeEventListener("touchend",Y)},[Y,de]);F.useEffect(()=>{const{current:Q}=X;return Q.addEventListener("touchstart",we,{passive:Mh()}),()=>{Q.removeEventListener("touchstart",we),ge()}},[ge,we]),F.useEffect(()=>{n&&ge()},[n,ge]);const Ye=Q=>ne=>{var Te;if((Te=Q.onMouseDown)==null||Te.call(Q,ne),n||ne.defaultPrevented||ne.button!==0)return;ne.preventDefault();const ce=ma(ne,O);if(ce!==!1){const{newValue:ue,activeIndex:We}=ie({finger:ce});fa({sliderRef:X,activeIndex:We,setActive:A}),I(ue),G&&!ga(ue,z)&&G(ne,ue,We)}y.current=0;const ye=ao(X.current);ye.addEventListener("mousemove",de,{passive:!0}),ye.addEventListener("mouseup",Y)},qe=Za(oe?re[0]:l,l,i),ke=Za(re[re.length-1],l,i)-qe,tr=(Q={})=>{const ne=Pa(Q),ce={onMouseDown:Ye(ne||{})},ye={...ne,...ce};return{...Q,ref:le,...ye}},Do=Q=>ne=>{var ye;(ye=Q.onMouseOver)==null||ye.call(Q,ne);const ce=Number(ne.currentTarget.getAttribute("data-index"));T(ce)},Lo=Q=>ne=>{var ce;(ce=Q.onMouseLeave)==null||ce.call(Q,ne),T(-1)},Bo=(Q={})=>{const ne=Pa(Q),ce={onMouseOver:Do(ne||{}),onMouseLeave:Lo(ne||{})};return{...Q,...ne,...ce}},No=Q=>({pointerEvents:w!==-1&&w!==Q?"none":void 0});let zr;return h==="vertical"&&(zr=a?"vertical-rl":"vertical-lr"),{active:w,axis:Z,axisProps:j5,dragging:V,focusedThumbIndex:se,getHiddenInputProps:(Q={})=>{const ne=Pa(Q),ce={onChange:Se(ne||{}),onFocus:xe(ne||{}),onBlur:Le(ne||{}),onKeyDown:be(ne||{})},ye={...ne,...ce};return{tabIndex:S,"aria-labelledby":t,"aria-orientation":h,"aria-valuemax":f(i),"aria-valuemin":f(l),name:c,type:"range",min:e.min,max:e.max,step:e.step===null&&e.marks?"any":e.step??void 0,disabled:n,...Q,...ye,style:{...A5,direction:a?"rtl":"ltr",width:"100%",height:"100%",writingMode:zr}}},getRootProps:tr,getThumbProps:Bo,marks:te,open:C,range:oe,rootRef:le,trackLeap:ke,trackOffset:qe,values:re,getThumbStyle:No}}function Ta(e){return typeof e=="string"}const U5=e=>!e||!Ta(e);function D5(e){return typeof e.main=="string"}function L5(e,t=[]){if(!D5(e))return!1;for(const r of t)if(!e.hasOwnProperty(r)||typeof e[r]!="string")return!1;return!0}function _c(e=[]){return([,t])=>t&&L5(t,e)}function B5(e){return wn("MuiSlider",e)}const bt=Il("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),N5=e=>{const{open:t}=e;return{offset:Pt(t&&bt.valueLabelOpen),circle:bt.valueLabelCircle,label:bt.valueLabelLabel}};function zf(e){const{children:t,className:r,value:n}=e,o=N5(e);return t?F.cloneElement(t,{className:t.props.className},g.jsxs(F.Fragment,{children:[t.props.children,g.jsx("span",{className:Pt(o.offset,r),"aria-hidden":!0,children:g.jsx("span",{className:o.circle,children:g.jsx("span",{className:o.label,children:n})})})]})):null}process.env.NODE_ENV!=="production"&&(zf.propTypes={children:x.element.isRequired,className:x.string,value:x.node});function jh(e){return e}const F5=pt("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`color${rt(r.color)}`],r.size!=="medium"&&t[`size${rt(r.size)}`],r.marked&&t.marked,r.orientation==="vertical"&&t.vertical,r.track==="inverted"&&t.trackInverted,r.track===!1&&t.trackFalse]}})(Dr(({theme:e})=>({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${bt.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${bt.dragging}`]:{[`& .${bt.thumb}, & .${bt.track}`]:{transition:"none"}},variants:[...Object.entries(e.palette).filter(_c()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}))),z5=pt("span",{name:"MuiSlider",slot:"Rail"})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),G5=pt("span",{name:"MuiSlider",slot:"Track"})(Dr(({theme:e})=>({display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:e.transitions.create(["left","width","bottom","height"],{duration:e.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.entries(e.palette).filter(_c()).map(([t])=>({props:{color:t,track:"inverted"},style:{...e.vars?{backgroundColor:e.vars.palette.Slider[`${t}Track`],borderColor:e.vars.palette.Slider[`${t}Track`]}:{backgroundColor:uo(e.palette[t].main,.62),borderColor:uo(e.palette[t].main,.62),...e.applyStyles("dark",{backgroundColor:co(e.palette[t].main,.5)}),...e.applyStyles("dark",{borderColor:co(e.palette[t].main,.5)})}}}))]}))),H5=pt("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.thumb,t[`thumbColor${rt(r.color)}`],r.size!=="medium"&&t[`thumbSize${rt(r.size)}`]]}})(Dr(({theme:e})=>({position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:e.transitions.create(["box-shadow","left","bottom"],{duration:e.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(e.vars||e).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${bt.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}},...Object.entries(e.palette).filter(_c()).map(([t])=>({props:{color:t},style:{[`&:hover, &.${bt.focusVisible}`]:{...e.vars?{boxShadow:`0px 0px 0px 8px rgba(${e.vars.palette[t].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${zi(e.palette[t].main,.16)}`},"@media (hover: none)":{boxShadow:"none"}},[`&.${bt.active}`]:{...e.vars?{boxShadow:`0px 0px 0px 14px rgba(${e.vars.palette[t].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 14px ${zi(e.palette[t].main,.16)}`}}}}))]}))),Gf=pt(zf,{name:"MuiSlider",slot:"ValueLabel"})(Dr(({theme:e})=>({zIndex:1,whiteSpace:"nowrap",...e.typography.body2,fontWeight:500,transition:e.transitions.create(["transform"],{duration:e.transitions.duration.shortest}),position:"absolute",backgroundColor:(e.vars||e).palette.grey[600],borderRadius:2,color:(e.vars||e).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${bt.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${bt.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:e.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]})));process.env.NODE_ENV!=="production"&&(Gf.propTypes={children:x.element.isRequired,index:x.number.isRequired,open:x.bool.isRequired,value:x.node});const q5=pt("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>jl(e)&&e!=="markActive",overridesResolver:(e,t)=>{const{markActive:r}=e;return[t.mark,r&&t.markActive]}})(Dr(({theme:e})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(e.vars||e).palette.background.paper,opacity:.8}}]}))),W5=pt("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>jl(e)&&e!=="markLabelActive"})(Dr(({theme:e})=>({...e.typography.body2,color:(e.vars||e).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(e.vars||e).palette.text.primary}}]}))),J5=e=>{const{disabled:t,dragging:r,marked:n,orientation:o,track:a,classes:s,color:i,size:l}=e,c={root:["root",t&&"disabled",r&&"dragging",n&&"marked",o==="vertical"&&"vertical",a==="inverted"&&"trackInverted",a===!1&&"trackFalse",i&&`color${rt(i)}`,l&&`size${rt(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",l&&`thumbSize${rt(l)}`,i&&`thumbColor${rt(i)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return es(c,B5,s)},Y5=({children:e})=>e,Hf=F.forwardRef(function(t,r){const n=vc({props:t,name:"MuiSlider"}),o=hy(),{"aria-label":a,"aria-valuetext":s,"aria-labelledby":i,component:l="span",components:c={},componentsProps:u={},color:d="primary",classes:h,className:p,disableSwap:f=!1,disabled:m=!1,getAriaLabel:b,getAriaValueText:S,marks:E=!1,max:O=100,min:w=0,name:A,onChange:C,onChangeCommitted:T,orientation:V="horizontal",shiftStep:j=10,size:y="medium",step:R=1,scale:z=jh,slotProps:I,slots:G,tabIndex:oe,track:re="normal",value:te,valueLabelDisplay:ee="off",valueLabelFormat:se=jh,...H}=n,X={...n,isRtl:o,max:O,min:w,classes:h,disabled:m,disableSwap:f,orientation:V,marks:E,color:d,size:y,step:R,shiftStep:j,scale:z,track:re,valueLabelDisplay:ee,valueLabelFormat:se},{axisProps:le,getRootProps:xe,getHiddenInputProps:Le,getThumbProps:ae,open:be,active:Se,axis:me,focusedThumbIndex:Z,range:ie,dragging:de,marks:Y,values:we,trackOffset:ge,trackLeap:Ye,getThumbStyle:qe}=$5({...X,rootRef:r});X.marked=Y.length>0&&Y.some(Fe=>Fe.label),X.dragging=de,X.focusedThumbIndex=Z;const ke=J5(X),tr=(G==null?void 0:G.root)??c.Root??F5,Do=(G==null?void 0:G.rail)??c.Rail??z5,Lo=(G==null?void 0:G.track)??c.Track??G5,Bo=(G==null?void 0:G.thumb)??c.Thumb??H5,No=(G==null?void 0:G.valueLabel)??c.ValueLabel??Gf,zr=(G==null?void 0:G.mark)??c.Mark??q5,Fo=(G==null?void 0:G.markLabel)??c.MarkLabel??W5,Q=(G==null?void 0:G.input)??c.Input??"input",ne=(I==null?void 0:I.root)??u.root,ce=(I==null?void 0:I.rail)??u.rail,ye=(I==null?void 0:I.track)??u.track,Te=(I==null?void 0:I.thumb)??u.thumb,ue=(I==null?void 0:I.valueLabel)??u.valueLabel,We=(I==null?void 0:I.mark)??u.mark,tt=(I==null?void 0:I.markLabel)??u.markLabel,ze=(I==null?void 0:I.input)??u.input,mt=ar({elementType:tr,getSlotProps:xe,externalSlotProps:ne,externalForwardedProps:H,additionalProps:{...U5(tr)&&{as:l}},ownerState:{...X,...ne==null?void 0:ne.ownerState},className:[ke.root,p]}),kn=ar({elementType:Do,externalSlotProps:ce,ownerState:X,className:ke.rail}),ag=ar({elementType:Lo,externalSlotProps:ye,additionalProps:{style:{...le[me].offset(ge),...le[me].leap(Ye)}},ownerState:{...X,...ye==null?void 0:ye.ownerState},className:ke.track}),Ws=ar({elementType:Bo,getSlotProps:ae,externalSlotProps:Te,ownerState:{...X,...Te==null?void 0:Te.ownerState},className:ke.thumb}),sg=ar({elementType:No,externalSlotProps:ue,ownerState:{...X,...ue==null?void 0:ue.ownerState},className:ke.valueLabel}),Js=ar({elementType:zr,externalSlotProps:We,ownerState:X,className:ke.mark}),Ys=ar({elementType:Fo,externalSlotProps:tt,ownerState:X,className:ke.markLabel}),ig=ar({elementType:Q,getSlotProps:Le,externalSlotProps:ze,ownerState:X});return g.jsxs(tr,{...mt,children:[g.jsx(Do,{...kn}),g.jsx(Lo,{...ag}),Y.filter(Fe=>Fe.value>=w&&Fe.value<=O).map((Fe,Ke)=>{const Ks=Za(Fe.value,w,O),zo=le[me].offset(Ks);let Lt;return re===!1?Lt=we.includes(Fe.value):Lt=re==="normal"&&(ie?Fe.value>=we[0]&&Fe.value<=we[we.length-1]:Fe.value<=we[0])||re==="inverted"&&(ie?Fe.value<=we[0]||Fe.value>=we[we.length-1]:Fe.value>=we[0]),g.jsxs(F.Fragment,{children:[g.jsx(zr,{"data-index":Ke,...Js,...!Ta(zr)&&{markActive:Lt},style:{...zo,...Js.style},className:Pt(Js.className,Lt&&ke.markActive)}),Fe.label!=null?g.jsx(Fo,{"aria-hidden":!0,"data-index":Ke,...Ys,...!Ta(Fo)&&{markLabelActive:Lt},style:{...zo,...Ys.style},className:Pt(ke.markLabel,Ys.className,Lt&&ke.markLabelActive),children:Fe.label}):null]},Ke)}),we.map((Fe,Ke)=>{const Ks=Za(Fe,w,O),zo=le[me].offset(Ks),Lt=ee==="off"?Y5:No;return g.jsx(Lt,{...!Ta(Lt)&&{valueLabelFormat:se,valueLabelDisplay:ee,value:typeof se=="function"?se(z(Fe),Ke):se,index:Ke,open:be===Ke||Se===Ke||ee==="on",disabled:m},...sg,children:g.jsx(Bo,{"data-index":Ke,...Ws,className:Pt(ke.thumb,Ws.className,Se===Ke&&ke.active,Z===Ke&&ke.focusVisible),style:{...zo,...qe(Ke),...Ws.style},children:g.jsx(Q,{"data-index":Ke,"aria-label":b?b(Ke):a,"aria-valuenow":z(Fe),"aria-labelledby":i,"aria-valuetext":S?S(z(Fe),Ke):s,value:we[Ke],...ig})})},Ke)})]})});process.env.NODE_ENV!=="production"&&(Hf.propTypes={"aria-label":Ah(x.string,e=>Array.isArray(e.value||e.defaultValue)&&e["aria-label"]!=null?new Error("MUI: You need to use the `getAriaLabel` prop instead of `aria-label` when using a range slider."):null),"aria-labelledby":x.string,"aria-valuetext":Ah(x.string,e=>Array.isArray(e.value||e.defaultValue)&&e["aria-valuetext"]!=null?new Error("MUI: You need to use the `getAriaValueText` prop instead of `aria-valuetext` when using a range slider."):null),children:x.node,classes:x.object,className:x.string,color:x.oneOfType([x.oneOf(["primary","secondary","error","info","success","warning"]),x.string]),components:x.shape({Input:x.elementType,Mark:x.elementType,MarkLabel:x.elementType,Rail:x.elementType,Root:x.elementType,Thumb:x.elementType,Track:x.elementType,ValueLabel:x.elementType}),componentsProps:x.shape({input:x.oneOfType([x.func,x.object]),mark:x.oneOfType([x.func,x.object]),markLabel:x.oneOfType([x.func,x.object]),rail:x.oneOfType([x.func,x.object]),root:x.oneOfType([x.func,x.object]),thumb:x.oneOfType([x.func,x.object]),track:x.oneOfType([x.func,x.object]),valueLabel:x.oneOfType([x.func,x.shape({children:x.element,className:x.string,open:x.bool,style:x.object,value:x.node,valueLabelDisplay:x.oneOf(["auto","off","on"])})])}),defaultValue:x.oneOfType([x.arrayOf(x.number),x.number]),disabled:x.bool,disableSwap:x.bool,getAriaLabel:x.func,getAriaValueText:x.func,marks:x.oneOfType([x.arrayOf(x.shape({label:x.node,value:x.number.isRequired})),x.bool]),max:x.number,min:x.number,name:x.string,onChange:x.func,onChangeCommitted:x.func,orientation:x.oneOf(["horizontal","vertical"]),scale:x.func,shiftStep:x.number,size:x.oneOfType([x.oneOf(["small","medium"]),x.string]),slotProps:x.shape({input:x.oneOfType([x.func,x.object]),mark:x.oneOfType([x.func,x.object]),markLabel:x.oneOfType([x.func,x.object]),rail:x.oneOfType([x.func,x.object]),root:x.oneOfType([x.func,x.object]),thumb:x.oneOfType([x.func,x.object]),track:x.oneOfType([x.func,x.object]),valueLabel:x.oneOfType([x.func,x.shape({children:x.element,className:x.string,open:x.bool,style:x.object,value:x.node,valueLabelDisplay:x.oneOf(["auto","off","on"])})])}),slots:x.shape({input:x.elementType,mark:x.elementType,markLabel:x.elementType,rail:x.elementType,root:x.elementType,thumb:x.elementType,track:x.elementType,valueLabel:x.elementType}),step:x.number,sx:x.oneOfType([x.arrayOf(x.oneOfType([x.func,x.object,x.bool])),x.func,x.object]),tabIndex:x.number,track:x.oneOf(["inverted","normal",!1]),value:x.oneOfType([x.arrayOf(x.number),x.number]),valueLabelDisplay:x.oneOf(["auto","off","on"]),valueLabelFormat:x.oneOfType([x.func,x.string])});var K5="[object Number]";function Q5(e){return typeof e=="number"||Er(e)&&Lr(e)==K5}const qf=Oe.observer(e=>{var a,s,i;const t=P.useTheme(),{store:r}=e,{t:n}=_e.useTranslation();function o(l,c){c===e.velocity||!Q5(c)||e.onVelocityChange(c)}return g.jsxs(P.Stack,{direction:"row",gap:2,alignItems:"center",children:[r.showVelocityLegend&&g.jsx(P.Typography,{sx:{color:(i=(s=(a=t.componentsExt)==null?void 0:a.JoggingPanel)==null?void 0:s.VelocitySlider)==null?void 0:i.sliderLegendColor,fontSize:"14px"},children:n("Jogging.Velocity.bt")}),g.jsx(Hf,{value:e.velocity,color:"secondary",onChange:o,min:e.min,max:e.max,"aria-labelledby":"input-slider",disabled:e.disabled,sx:{"& .MuiSlider-valueLabelOpen":{zIndex:100,backgroundColor:"transparent",top:"0px"}}}),r.showVelocitySliderLabel&&(e.renderValue?e.renderValue(e.velocity):g.jsx(Ec,{value:e.velocity.toString()}))]})});function Ec({value:e,sx:t}){var n;const r=P.useTheme();return g.jsx(P.Stack,{direction:"row",justifyContent:"center",alignItems:"center",gap:"5px",sx:{padding:"6px 12px",background:(n=r.palette.backgroundPaperElevation)==null?void 0:n[8],borderRadius:"10px",minWidth:"111px",...t},children:g.jsx(P.Typography,{component:"span",sx:{textAlign:"right",fontSize:"14px",opacity:.8,color:r.palette.text.primary,whiteSpace:"nowrap"},children:e})})}const Wf=Oe.observer(({store:e})=>{const{t}=_e.useTranslation(),r=Oe.useLocalObservable(()=>({get valueLabelFormat(){return e.currentMotionType==="translate"?n=>`v = ${t("Jogging.Cartesian.Translation.velocityMmPerSec.lb",{amount:n})}`:n=>`ω = ${t("Jogging.Cartesian.Rotation.velocityDegPerSec.lb",{amount:n})}`}}));return g.jsx(qf,{store:e,velocity:e.velocityInDisplayUnits,min:e.minVelocityInDisplayUnits,max:e.maxVelocityInDisplayUnits,onVelocityChange:e.setVelocityFromSlider,disabled:e.isLocked,renderValue:n=>g.jsx(Ec,{value:r.valueLabelFormat(n),sx:{minWidth:"111px",span:{transform:"translateY(-1.5px)"}}})})}),X5=Oe.observer(({store:e,children:t})=>{const{t:r}=_e.useTranslation(),n=P.useTheme();function o(h,p){(p==="translate"||p==="rotate")&&e.setSelectedCartesianMotionType(p)}_m(()=>[e.selectedCoordSystemId,e.selectedTcpId],()=>{e.jogger.motionStream.motionStateSocket.changeUrl(e.jogger.nova.makeWebsocketURL(`/motion-groups/${e.jogger.motionGroupId}/state-stream?tcp=${e.selectedTcpId}&response_coordinate_system=${e.selectedCoordSystemId}`))},{fireImmediately:!0});async function a(h,p){const f=await e.activate(),m=f.motionStream.rapidlyChangingMotionState.tcp_pose,b=f.motionStream.rapidlyChangingMotionState.state.joint_position;m&&await e.withMotionLock(async()=>{try{e.setCurrentIncrementJog({axis:h.axis,direction:h.direction}),await e.jogger.runIncrementalCartesianMotion({currentTcpPose:m,currentJoints:b,coordSystemId:e.activeCoordSystemId,velocityInRelevantUnits:e.selectedCartesianMotionType==="translate"?e.translationVelocityMmPerSec:e.rotationVelocityRadsPerSec,axis:h.axis,direction:h.direction,motion:e.selectedCartesianMotionType==="translate"?{type:"translate",distanceMm:p.mm}:{type:"rotate",distanceRads:Cr.degreesToRadians(p.degrees)}})}finally{e.setCurrentIncrementJog(null),await e.deactivate()}})}async function s(h){if(!e.isLocked){if(await e.activate(),e.activeDiscreteIncrement)return a(h,e.activeDiscreteIncrement);h.motionType==="translate"?await e.jogger.startTCPTranslation({axis:h.axis,direction:h.direction,velocityMmPerSec:e.translationVelocityMmPerSec}):await e.jogger.startTCPRotation({axis:h.axis,direction:h.direction,velocityRadsPerSec:e.rotationVelocityRadsPerSec})}}async function i(){e.isLocked||e.activeDiscreteIncrement||await e.deactivate()}function l(h,p,f){var b,S,E;const m=(E=(S=(b=f.componentsExt)==null?void 0:b.JoggingPanel)==null?void 0:S.JoggingCartesian)==null?void 0:E.Axis;if(m)return p==="translate"?m[h]:m.CustomRotation??m[h]}const c=[{id:"x",icon:g.jsx(eI,{}),colors:l("X",e.selectedCartesianMotionType,n)},{id:"y",icon:g.jsx(rI,{}),colors:l("Y",e.selectedCartesianMotionType,n)},{id:"z",icon:g.jsx(oI,{}),colors:l("Z",e.selectedCartesianMotionType,n)}];function u(h){return r("General.mm.variable",{amount:h.toFixed(1)})}function d(h){return r("General.degree.variable",{amount:Cr.radiansToDegrees(h).toFixed(1)})}return g.jsxs(P.Stack,{flexGrow:1,gap:2,sx:{padding:"18px 24px"},children:[g.jsxs(P.Stack,{gap:2,children:[g.jsx(O5,{store:e}),g.jsx(Wf,{store:e}),g.jsx(P.Divider,{})]}),g.jsx(P.Stack,{marginLeft:"auto",marginRight:"auto",gap:"24px",justifyContent:"center",sx:{flexGrow:"1"},children:g.jsxs(P.Stack,{alignItems:"center",justifyContent:"center",gap:"24px",sx:{flexGrow:1},children:[g.jsxs(w5,{value:e.selectedCartesianMotionType,onChange:o,exclusive:!0,"aria-label":r("Jogging.Cartesian.MotionType.lb"),sx:{justifyContent:"center"},children:[g.jsx(P.ToggleButton,{value:"translate",children:r("Jogging.Cartesian.Translation.bt")}),g.jsx(P.ToggleButton,{value:"rotate",children:r("Jogging.Cartesian.Rotation.bt")})]}),e.selectedCartesianMotionType==="translate"&&c.map(h=>{var p,f;return g.jsx(ol,{colors:h.colors,disabled:e.isLocked,activeJoggingDirection:((p=e.incrementJogInProgress)==null?void 0:p.axis)===h.id?e.incrementJogInProgress.direction:void 0,label:g.jsxs(g.Fragment,{children:[h.icon,g.jsx(P.Typography,{sx:{fontSize:"24px",color:((f=h.colors)==null?void 0:f.labelColor)??n.palette.text.primary},children:h.id.toUpperCase()})]}),getDisplayedValue:()=>{var m;return u(((m=e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose)==null?void 0:m.position[h.id])||0)},startJogging:m=>s({axis:h.id,motionType:"translate",direction:m}),stopJogging:i},h.id)}),e.selectedCartesianMotionType==="rotate"&&c.map(h=>{var p,f;return g.jsx(ol,{colors:h.colors,disabled:e.isLocked,activeJoggingDirection:((p=e.incrementJogInProgress)==null?void 0:p.axis)===h.id?e.incrementJogInProgress.direction:void 0,label:g.jsxs(g.Fragment,{children:[g.jsx(sI,{}),g.jsx(P.Typography,{sx:{fontSize:"24px",color:((f=h.colors)==null?void 0:f.labelColor)??n.palette.text.primary},children:h.id.toUpperCase()})]}),getDisplayedValue:()=>{var m,b;return d(((b=(m=e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose)==null?void 0:m.orientation)==null?void 0:b[h.id])||0)},startJogging:m=>s({axis:h.id,motionType:"rotate",direction:m}),stopJogging:i},h.id)})]})}),g.jsx(kf,{store:e}),t&&g.jsx(P.Divider,{}),t]})}),Z5=Oe.observer(({store:e,children:t})=>{const r=P.useTheme();async function n(a){await e.activate(),await e.jogger.startJointRotation({joint:a.joint,direction:a.direction,velocityRadsPerSec:e.rotationVelocityRadsPerSec})}async function o(){await e.jogger.stop(),await e.deactivate()}return g.jsxs(P.Stack,{flexGrow:1,gap:2,sx:{padding:"18px 24px"},children:[g.jsx(Wf,{store:e}),g.jsx(P.Divider,{}),g.jsx(P.Stack,{justifyContent:"center",alignItems:"stretch",sx:{flexGrow:"1"},id:"JointControls",children:g.jsx(P.Stack,{alignItems:"center",gap:"24px",children:e.jogger.motionStream.joints.map(a=>{var c;const s=(c=e.motionGroupSpec.mechanical_joint_limits)==null?void 0:c[a.index],i=(s==null?void 0:s.lower_limit)!==void 0?Cr.radiansToDegrees(s.lower_limit):void 0,l=(s==null?void 0:s.upper_limit)!==void 0?Cr.radiansToDegrees(s.upper_limit):void 0;return g.jsxs(P.Stack,{direction:"row",alignItems:"center",justifyContent:"center",spacing:1.5,width:"100%",children:[e.showJointsLegend&&g.jsx(P.Typography,{color:e.isLocked?r.palette.text.disabled:r.palette.text.secondary,children:`G${a.index+1}`}),g.jsx(Vm,{disabled:e.isLocked,lowerLimitDegs:i,upperLimitDegs:l,getValueDegs:()=>{const u=e.jogger.motionStream.rapidlyChangingMotionState.state.joint_position.joints[a.index];return u!==void 0?Cr.radiansToDegrees(u):void 0},startJogging:u=>n({joint:a.index,direction:u}),stopJogging:o})]},`joint-${a.index}`)})})}),g.jsx(kf,{store:e}),t&&g.jsx(P.Divider,{}),t]})}),e3=Xe(Oe.observer(e=>{const t=Al.isString(e.nova)?new Y2({instanceUrl:e.nova}):e.nova,r=Oe.useLocalObservable(()=>({joggingStore:null,loadingError:null}));async function n(){$e.runInAction(()=>{r.loadingError=null,r.joggingStore=null});try{let o=e.store;if(!o){const a=await t.connectJogger(e.motionGroupId);o=await qs.loadFor(a)}$e.runInAction(()=>{r.joggingStore=o}),e.onSetup&&e.onSetup(o)}catch(o){r.loadingError=o}}return J.useEffect(()=>(n(),e.store?()=>null:()=>{var o;(o=r.joggingStore)==null||o.dispose()}),[e.store,e.nova,e.motionGroupId]),J.useEffect(()=>{const o=r.joggingStore;o&&(e.locked?o.lock("external"):o.unlock("external"))},[r.joggingStore,e.locked]),g.jsx(P.Stack,{sx:{maxWidth:"460px",minWidth:"320px",position:"relative",...e.sx},children:r.joggingStore?g.jsx(t3,{store:r.joggingStore,children:e.children}):g.jsx(Cc,{message:"Loading jogging",error:r.loadingError})})})),t3=Oe.observer(({store:e,children:t})=>{const{t:r}=_e.useTranslation();function n(){if(e.currentTab.id==="cartesian")return g.jsx(g.Fragment,{children:g.jsx(X5,{store:e,children:t})});if(e.currentTab.id==="joint")return g.jsx(g.Fragment,{children:g.jsx(Z5,{store:e,children:t})})}return g.jsxs(P.Stack,{flexGrow:1,sx:{overflow:"hidden"},children:[g.jsx(P.Tabs,{value:e.tabIndex,onChange:e.onTabChange,variant:"fullWidth",children:e.tabs.map(o=>{const a=o.label==="cartesian"?r("Jogging.Cartesian.bt"):r("Jogging.Joints.bt"),s=o.label==="cartesian"?g.jsx(AC,{fontSize:"small",sx:{mr:1}}):g.jsx(_C,{fontSize:"small",sx:{mr:1}});return g.jsx(P.Tab,{label:e.showTabIcons?g.jsxs(P.Stack,{direction:"row",alignItems:"center",children:[s,a]}):a,id:`jogging-tab-${o.id}`,"aria-controls":`jogging-tab-${o.id}`},o.id)})}),g.jsx(P.Stack,{flexGrow:1,position:"relative",sx:{overflowY:"auto",overflowX:"hidden"},children:n()})]})}),Jf=J.forwardRef(({label:e,value:t},r)=>{var i;const n=P.useTheme(),[o,a]=J.useState(!1);async function s(){if(!r||!("current"in r))return console.warn("No copy target found"),!1;try{return await navigator.clipboard.writeText(t),console.log("Copied!"),a(!0),!0}catch(l){console.error(l);const c=window.getSelection(),u=document.createRange();u.selectNodeContents(r.current),c.removeAllRanges(),c.addRange(u)}return!1}return J.useEffect(()=>{if(!o)return;const l=setTimeout(()=>a(!1),3e3);return()=>{l&&clearTimeout(l)}},[o]),g.jsx(P.Tooltip,{open:o,title:"Copied!",children:g.jsx(P.Stack,{justifyContent:"center",sx:{height:"100%",boxSizing:"border-box",padding:"6px 12px",background:(i=n.palette.backgroundPaperElevation)==null?void 0:i[8],borderRadius:"10px",minWidth:"0",cursor:"pointer"},onClick:()=>s(),children:g.jsx(P.Typography,{ref:r,align:"center",sx:{pointerEvents:"none",fontSize:"12px",color:n.palette.text.primary,whiteSpace:"nowrap",minWidth:0,textOverflow:"ellipsis",width:"100%",overflow:"hidden"},children:t})})})}),r3=Oe.observer(({motionStream:e})=>{const t=J.useRef(null);function r(){const n=e.rapidlyChangingMotionState.tcp_pose;return n?Cr.poseToWandelscriptString(n):""}return Rn(()=>{if(!t.current)return;const n=r();t.current.textContent!==n&&(t.current.textContent=n)}),g.jsx(P.Stack,{alignItems:"left",spacing:2,sx:{flexGrow:1,minWidth:0,overflow:"hidden"},children:g.jsx(Jf,{value:r(),ref:t})})}),n3=Oe.observer(({motionStream:e})=>{const t=J.useRef(null);function r(){const{joints:n}=e.rapidlyChangingMotionState.state.joint_position;return`[${n.map(o=>parseFloat(o.toFixed(4))).join(", ")}]`}return Rn(()=>{if(!t.current)return;const n=r();t.current.textContent!==n&&(t.current.textContent=n)}),g.jsx(P.Stack,{alignItems:"left",spacing:2,sx:{flexGrow:1,minWidth:0,overflow:"hidden"},children:g.jsx(Jf,{value:r(),ref:t})})});class Yf{constructor(){this.messages=[],this.addMessage=(t,r="info")=>{const n={id:Math.random().toString(36).substring(2,11),timestamp:new Date,message:t,level:r};this.messages.push(n)},this.clearMessages=()=>{this.messages=[]},this.addInfo=t=>{this.addMessage(t,"info")},this.addWarning=t=>{this.addMessage(t,"warning")},this.addError=t=>{this.addMessage(t,"error")},this.addDebug=t=>{this.addMessage(t,"debug")},$e.makeObservable(this,{messages:$e.observable,addMessage:$e.action,clearMessages:$e.action})}}const Uo=(e,t,r)=>({id:r||`${Date.now()}-${Math.random().toString(36).substr(2,9)}`,timestamp:new Date,message:e,level:t}),o3=(e,t)=>Uo(e,"debug",t),a3=(e,t)=>Uo(e,"info",t),s3=(e,t)=>Uo(e,"warning",t),i3=(e,t)=>Uo(e,"error",t),Kf=Xe(Oe.observer(e=>{var u;const{messages:t=[],onClear:r,height:n=400,sx:o}=e,a=P.useTheme(),s=J.useRef(null);J.useEffect(()=>{if(t.length===0)return;const d=s.current;if(!d)return;const h=setTimeout(()=>{d.scrollTop=d.scrollHeight},10);return()=>clearTimeout(h)},[t.length]);const i=d=>d.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),l=d=>{switch(d){case"error":return a.palette.error.main;case"warning":return a.palette.warning.main;case"info":return a.palette.info.main;case"debug":return a.palette.text.disabled;default:return a.palette.text.secondary}},c=({message:d})=>{const[h,p]=J.useState(!1),[f,m]=J.useState(!1),[b,S]=J.useState(!1),E=d.message.length>150,O=async()=>{try{await navigator.clipboard.writeText(d.message),m(!0),setTimeout(()=>m(!1),2e3)}catch(A){console.error("Failed to copy message:",A)}},w=E&&!h?d.message.substring(0,150)+"...":d.message;return g.jsx(P.Box,{onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),sx:{display:"flex",gap:1,fontFamily:"monospace",flexDirection:"column","&:hover":{backgroundColor:a.palette.action.hover},borderRadius:"4px",padding:"2px 4px",margin:"-2px -4px"},children:g.jsxs(P.Box,{sx:{display:"flex",gap:1},children:[g.jsxs(P.Typography,{component:"span",sx:{fontWeight:400,fontSize:"12px",lineHeight:"18px",letterSpacing:"0.4px",color:a.palette.text.disabled,whiteSpace:"nowrap",flexShrink:0},children:["[",i(d.timestamp),"]"]}),g.jsx(P.Typography,{component:"span",sx:{fontWeight:400,fontSize:"12px",lineHeight:"18px",letterSpacing:"0.4px",color:l(d.level),wordBreak:"break-word",overflowWrap:"anywhere",hyphens:"auto",flex:1,whiteSpace:"pre-wrap"},children:w}),g.jsxs(P.Box,{sx:{display:"flex",alignItems:"flex-start",gap:.5,opacity:b?1:0,transition:"opacity 0.2s ease-in-out",visibility:b?"visible":"hidden"},children:[g.jsx(P.IconButton,{size:"small",onClick:O,sx:{padding:"2px",color:a.palette.text.secondary,"&:hover":{backgroundColor:a.palette.action.hover}},title:f?"Copied!":"Copy message",children:g.jsx(Ft.ContentCopy,{sx:{fontSize:12}})}),E&&g.jsx(P.IconButton,{size:"small",onClick:()=>p(!h),sx:{padding:"2px",color:a.palette.text.secondary,"&:hover":{backgroundColor:a.palette.action.hover}},title:h?"Collapse":"Expand",children:h?g.jsx(Ft.ExpandLess,{sx:{fontSize:12}}):g.jsx(Ft.ExpandMore,{sx:{fontSize:12}})})]})]})},d.id)};return g.jsxs(P.Paper,{sx:{backgroundColor:((u=a.palette.backgroundPaperElevation)==null?void 0:u[2])||"#171927",backgroundImage:"none",height:n,display:"flex",flexDirection:"column",overflow:"hidden",...o},children:[g.jsxs(P.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px"},children:[g.jsxs(P.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[g.jsx(Ft.DescriptionOutlined,{sx:{fontSize:16,color:a.palette.action.active,opacity:.56}}),g.jsx(P.Typography,{sx:{fontWeight:500,fontSize:"14px",lineHeight:"143%",letterSpacing:"0.17px",color:a.palette.text.primary},children:"Log"})]}),g.jsx(P.Button,{onClick:r,variant:"text",sx:{fontWeight:500,fontSize:"13px",lineHeight:"22px",letterSpacing:"0.46px",color:a.palette.primary.main,textTransform:"none",minWidth:"auto",padding:"4px 8px","&:hover":{backgroundColor:a.palette.primary.main+"14"}},children:"Clear"})]}),g.jsx(P.Box,{ref:s,sx:{flex:1,overflow:"auto",padding:"8px 16px",display:"flex",flexDirection:"column",gap:"2px",scrollbarWidth:"thin",scrollbarColor:`${a.palette.divider} transparent`,"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:a.palette.divider,borderRadius:"3px","&:hover":{backgroundColor:a.palette.divider}}},children:t.length===0?g.jsx(P.Typography,{sx:{color:a.palette.text.disabled,fontSize:"12px",fontStyle:"italic",textAlign:"center",marginTop:2},children:"No log messages"}):t.map(d=>g.jsx(c,{message:d},d.id))})]})})),l3=Xe(Oe.observer(e=>{const{store:t,onStoreReady:r,...n}=e,o=J.useRef(r);J.useEffect(()=>{o.current=r},[r]);const a=J.useMemo(()=>{var l;const i=t||new Yf;return(l=o.current)==null||l.call(o,i),i},[t]),s=()=>{a.clearMessages()};return g.jsx(Kf,{...n,messages:a.messages,onClear:s})}));function c3(){const e=window.location.href;return e.substring(0,e.indexOf("/",e.indexOf("//")+2))}function u3({baseUrl:e=c3(),...t}){return g.jsxs(P.Dialog,{"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:[g.jsx(P.DialogTitle,{id:"no-motion-group-modal-title",children:"No motion group found"}),g.jsxs(P.DialogContent,{sx:{marginTop:"3rem",marginBottom:"1.5rem",textAlign:"center"},children:[g.jsx(P.Typography,{color:"#fff",children:"Found no devices to connect to."}),g.jsx(P.Typography,{color:"#fff",children:"Please ensure a motion group has been created."})]}),g.jsx(P.DialogActions,{children:g.jsxs(P.Stack,{width:"100%",maxWidth:"300px",margin:"auto",marginBottom:"2rem",children:[g.jsx(P.Button,{href:`${e}/settings`,variant:"contained",sx:{borderRadius:"8px",width:"100%"},children:"Go to settings app"}),g.jsx(P.Button,{href:`${e}`,variant:"text",sx:{marginTop:"1rem",color:"#fff",textDecoration:"underline",fontSize:"0.75rem"},children:"Back to Homescreen"})]})})]})}var vr=(e=>(e.IDLE="idle",e.RUNNING="running",e.PAUSED="paused",e.STOPPING="stopping",e.ERROR="error",e))(vr||{});const d3=Xe(Oe.observer(({state:e,onRun:t,onPause:r,onStop:n,onReset:o,requiresManualReset:a=!1,variant:s="with_pause",className:i})=>{const l=P.useTheme(),{t:c}=_e.useTranslation(),u=()=>{const p={run:{enabled:e==="idle"||e==="paused"||e==="error",label:c(e==="paused"?"ProgramControl.Resume.bt":e==="error"?"ProgramControl.Retry.bt":"ProgramControl.Start.bt"),color:l.palette.success.main,onClick:t},pause:{enabled:e==="running",label:c("ProgramControl.Pause.bt"),color:"#FFFFFF33",onClick:r||(()=>{})},stop:{enabled:e==="running"||e==="paused",label:c("ProgramControl.Stop.bt"),color:l.palette.error.main,onClick:n}};return s==="without_pause"?[p.run,p.stop]:[p.run,p.pause,p.stop]},d=p=>{const f={sx:{fontSize:"55px"}};if(s==="without_pause")return p===0?g.jsx(Ft.PlayArrow,{...f}):g.jsx(Ft.Stop,{...f});switch(p){case 0:return g.jsx(Ft.PlayArrow,{...f});case 1:return g.jsx(Ft.Pause,{...f});case 2:return g.jsx(Ft.Stop,{...f});default:return null}},h=u();return g.jsx(P.Box,{className:i,sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:g.jsx(P.Box,{sx:{display:"flex",gap:"40px",flexWrap:"wrap",justifyContent:"center",alignItems:"center"},children:h.map((p,f)=>g.jsxs(P.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1},children:[g.jsx(P.Button,{variant:"contained",disabled:!p.enabled||e==="stopping"&&!a,onClick:p.onClick,sx:{width:"110px",height:"110px",borderRadius:"110px",backgroundColor:p.color,opacity:p.enabled&&!(e==="stopping"&&!a)?1:.3,"&:hover":{backgroundColor:p.color,opacity:p.enabled&&!(e==="stopping"&&!a)?.8:.3},"&:disabled":{backgroundColor:p.color,opacity:.3},minWidth:"110px",flexShrink:0},children:d(f)}),g.jsx(P.Typography,{variant:"body1",sx:{color:p.enabled&&!(e==="stopping"&&!a)?p.color:l.palette.text.disabled,textAlign:"center",opacity:p.enabled&&!(e==="stopping"&&!a)?1:.3},children:p.label})]},p.label))})})})),Tl=Xe(Oe.observer(({programState:e,safetyState:t,operationMode:r,className:n})=>{const o=P.useTheme(),{t:a}=_e.useTranslation(),s=()=>{if(t==="SAFETY_STATE_DEVICE_EMERGENCY_STOP"||t==="SAFETY_STATE_ROBOT_EMERGENCY_STOP"||t==="SAFETY_STATE_STOP_0"||t==="SAFETY_STATE_STOP_1"||t==="SAFETY_STATE_STOP_2"||t==="SAFETY_STATE_PROTECTIVE_STOP"||t==="SAFETY_STATE_STOP"||t==="SAFETY_STATE_REDUCED"||t==="SAFETY_STATE_MASTERING"||t==="SAFETY_STATE_CONFIRM_SAFETY"||t==="SAFETY_STATE_OPERATOR_SAFETY"||t==="SAFETY_STATE_RECOVERY"||t==="SAFETY_STATE_VIOLATION")return{label:a("ProgramStateIndicator.EStop.lb"),color:o.palette.error.main};if(t==="SAFETY_STATE_UNKNOWN"||t==="SAFETY_STATE_FAULT")return{label:a("ProgramStateIndicator.Error.lb"),color:o.palette.error.main};if(t==="SAFETY_STATE_NORMAL")switch(e){case vr.RUNNING:return{label:a("ProgramStateIndicator.Running.lb"),color:o.palette.success.main};case vr.PAUSED:return{label:a("ProgramStateIndicator.Paused.lb"),color:o.palette.grey[600]};case vr.STOPPING:return{label:a("ProgramStateIndicator.Stopped.lb"),color:o.palette.error.main};case vr.ERROR:return{label:a("ProgramStateIndicator.Error.lb"),color:o.palette.error.main};case vr.IDLE:default:return{label:a("ProgramStateIndicator.Ready.lb"),color:o.palette.success.main}}return{label:a("ProgramStateIndicator.Idle.lb"),color:o.palette.grey[600]}},{label:i,color:l}=s(),u=`${i} / ${(()=>{switch(r){case"OPERATION_MODE_AUTO":return a("ProgramStateIndicator.Auto.lb");case"OPERATION_MODE_MANUAL":return a("ProgramStateIndicator.Manual.lb");case"OPERATION_MODE_MANUAL_T1":return a("ProgramStateIndicator.ManualT1.lb");case"OPERATION_MODE_MANUAL_T2":return a("ProgramStateIndicator.ManualT2.lb");default:return a("ProgramStateIndicator.Auto.lb")}})()}`;return g.jsx(P.Chip,{className:n,label:g.jsx(P.Typography,{variant:"body2",sx:{fontSize:"0.75rem",lineHeight:1.2},children:u}),variant:"filled",sx:{backgroundColor:l,color:o.palette.getContrastText(l),fontWeight:500,height:"auto","& .MuiChip-label":{paddingX:1.5,paddingY:.5}}})})),kh="0.0.0-semantically-released";function Ic(e){let t=kh;return kh.startsWith("0.")&&(t=""),`https://cdn.jsdelivr.net/gh/wandelbotsgmbh/wandelbots-js-react-components${t?`@${t}`:""}/public/models/${e}.glb`}function h3(e){function t(r){return r.children.length===0?[r]:[r,...r.children.flatMap(n=>t(n))]}return t(e).filter(r=>Xf(r))}function Qf(e){return e.name.endsWith("_FLG")}function Xf(e){return/_J[0-9]+$/.test(e.name)}function p3(e,t){let r;function n(o){if(Qf(o)){if(r)throw Error(`Found multiple flange groups in robot model ${t}; first ${r.name} then ${o.name}. Only one _FLG group is allowed.`);r=o}Xf(o),o.children.map(n)}if(n(e.scene),!r)throw Error(`No flange group found in robot model ${t}. Flange must be identified with a name ending in _FLG.`);return{gltf:e}}function Zf({rapidlyChangingMotionState:e,dhParameters:t,onRotationChanged:r,children:n}){const o=J.useRef([]),a=J.useRef([]),s=J.useRef(null),{invalidate:i}=Ra.useThree();J.useEffect(()=>{const d=e.state.joint_position.joints.filter(h=>h!==void 0);return s.current=new xc(d,{tension:120,friction:20,threshold:.001}),()=>{var h;(h=s.current)==null||h.destroy()}},[]),Ra.useFrame((d,h)=>{if(s.current){const p=s.current.update(h);u(),p||i()}});function l(d){d&&(a.current=h3(d),u(),i())}function c(d){var h;o.current=d,(h=s.current)==null||h.setTarget(d)}function u(){var h;const d=((h=s.current)==null?void 0:h.getCurrentValues())||[];if(r)r(a.current,d);else for(const[p,f]of a.current.entries()){const m=t[p],b=m.theta||0,S=m.reverse_rotation_direction?-1:1;f.rotation.y=S*(d[p]||0)+b}}return Am(()=>{const d=e.state.joint_position.joints.filter(h=>h!==void 0);requestAnimationFrame(()=>c(d))}),g.jsx("group",{ref:l,children:n})}const m3="line",f3="mesh";function g3({rapidlyChangingMotionState:e,dhParameters:t,...r}){const n=new Ot.Matrix4,o=J.useRef([]),a=J.useRef([]);J.useEffect(()=>{o.current=new Array(t.length).fill(null),a.current=new Array(t.length).fill(null)},[t.length]);function s(c,u){const d=new Ot.Vector3,h=new Ot.Quaternion,p=new Ot.Vector3;n.decompose(d,h,p);const f=d.clone(),m=new Ot.Matrix4().makeRotationY(c.theta+u*(c.reverse_rotation_direction?-1:1)).multiply(new Ot.Matrix4().makeTranslation(0,c.d/1e3,0)).multiply(new Ot.Matrix4().makeTranslation(c.a/1e3,0,0)).multiply(new Ot.Matrix4().makeRotationX(c.alpha));return n.multiply(m),n.decompose(d,h,p),{a:f,b:d}}function i(c,u,d,h){if(!t)return;const p=t[c];if(!p)return;const{a:f,b:m}=s(p,h);u.geometry.setPositions([f.toArray(),m.toArray()].flat()),d.position.set(m.x,m.y,m.z)}function l(c,u){n.identity();for(let d=0;d<Math.min(c.length,u.length);d++){const h=o.current[d],p=a.current[d];h&&p&&i(d,h,p,u[d])}}return g.jsx(g.Fragment,{children:g.jsx(Zf,{rapidlyChangingMotionState:e,dhParameters:t,onRotationChanged:l,children:g.jsxs("group",{...r,name:"Scene",children:[g.jsxs("mesh",{children:[g.jsx("sphereGeometry",{args:[.01,32,32]}),g.jsx("meshStandardMaterial",{color:"black",depthTest:!0})]}),t.map((c,u)=>{const{a:d,b:h}=s(c,e.state.joint_position.joints[u]??0),p=`dhrobot_J0${u}`;return g.jsxs("group",{name:p,children:[g.jsx(ut.Line,{ref:f=>{o.current[u]=f},name:m3,points:[d,h],color:"white",lineWidth:5}),g.jsxs("mesh",{ref:f=>{a.current[u]=f},name:f3,position:h,children:[g.jsx("sphereGeometry",{args:[.01,32,32]}),g.jsx("meshStandardMaterial",{color:"black",depthTest:!0})]},"mesh_"+u)]},p)})]})})})}const y3=console.warn;function b3(){return J.useEffect(()=>{console.warn=e=>{e!=="Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"&&y3(e)}},[]),g.jsx(g.Fragment,{})}function x3(e){return e.type==="Mesh"}function v3({modelURL:e,flangeRef:t,postModelRender:r,...n}){const{gltf:o}=p3(ut.useGLTF(e),e.split("/").pop()||e),a=J.useCallback(i=>{i&&r&&r()},[e]);function s(i){return x3(i)?g.jsx("mesh",{name:i.name,geometry:i.geometry,material:i.material,position:i.position,rotation:i.rotation},i.uuid):g.jsx("group",{name:i.name,position:i.position,rotation:i.rotation,ref:Qf(i)?t:void 0,children:i.children.map(s)},i.uuid)}return g.jsx("group",{...n,dispose:null,ref:a,children:s(o.scene)})}const S3=(e,t)=>{e.userData.isGhost||(e.traverse(r=>{if(r instanceof Be.Mesh){r.material instanceof Be.Material&&(r.material.colorWrite=!1);const n=r.clone(),o=r.clone();n.material=new Be.MeshStandardMaterial({depthTest:!0,depthWrite:!0,colorWrite:!1,polygonOffset:!0,polygonOffsetFactor:-1,side:Be.DoubleSide}),n.userData.isGhost=!0,o.material=new Be.MeshStandardMaterial({color:t,opacity:.3,depthTest:!0,depthWrite:!1,transparent:!0,polygonOffset:!0,polygonOffsetFactor:-2,side:Be.DoubleSide}),o.userData.isGhost=!0,r.parent&&(r.parent.add(n),r.parent.add(o))}}),e.userData.isGhost=!0)},O3=e=>{if(!e.userData.isGhost)return;const t=[];e.traverse(r=>{var n;r instanceof Be.Mesh&&((n=r.userData)!=null&&n.isGhost?t.push(r):r.material instanceof Be.Material&&(r.material.colorWrite=!0))}),t.forEach(r=>{r.parent&&r.parent.remove(r)}),e.userData.isGhost=!1},eg=Xe(({rapidlyChangingMotionState:e,modelFromController:t,dhParameters:r,getModel:n=Ic,flangeRef:o,postModelRender:a,transparentColor:s,...i})=>{const[l,c]=J.useState(null),u=J.useCallback(h=>{c(h)},[]);J.useEffect(()=>{l&&(s?S3(l,s):O3(l))},[l,s]);const d=g.jsx(g3,{rapidlyChangingMotionState:e,dhParameters:r,...i});return g.jsxs(vg.ErrorBoundary,{fallback:d,onError:h=>{console.error(h)},children:[g.jsx(J.Suspense,{fallback:d,children:g.jsx("group",{ref:u,children:g.jsx(Zf,{rapidlyChangingMotionState:e,dhParameters:r,children:g.jsx(v3,{modelURL:n(t),postModelRender:a,flangeRef:o,...i})})})}),g.jsx(b3,{})]})});function tg({connectedMotionGroup:e,getModel:t=Ic,flangeRef:r,transparentColor:n,postModelRender:o,...a}){return e.dhParameters?g.jsx(eg,{rapidlyChangingMotionState:e.rapidlyChangingMotionState,modelFromController:e.modelFromController||"",dhParameters:e.dhParameters,getModel:t,flangeRef:r,transparentColor:n,postModelRender:o,...a}):null}const w3=Xe(Oe.observer(({robotName:e,programState:t,safetyState:r,operationMode:n,driveToHomeEnabled:o=!1,onDriveToHomePress:a,onDriveToHomeRelease:s,connectedMotionGroup:i,robotComponent:l=tg,cycleTimerComponent:c=Tm,onCycleTimerReady:u,onCycleEnd:d,cycleTimerAutoStart:h=!0,cycleTimerHasError:p=!1,className:f})=>{var se;const m=P.useTheme(),{t:b}=_e.useTranslation(),[S,E]=J.useState(!1),O=J.useRef(null),w=J.useRef(null),[A,C]=J.useState(!1),[T,V]=J.useState({width:400,height:600}),[j,y]=J.useState(0),R=J.useRef(null);J.useEffect(()=>{const H=()=>{if(w.current){const{offsetWidth:le,offsetHeight:xe}=w.current;C(le>xe),V({width:le,height:xe})}};H();const X=new ResizeObserver(H);return w.current&&X.observe(w.current),()=>{X.disconnect()}},[]);const z=J.useCallback(()=>{y(H=>H+1)},[]),I=J.useCallback(()=>{!o||!a||(E(!0),a())},[o,a]),G=J.useCallback(()=>{!o||!s||(E(!1),s())},[o,s]),oe=J.useCallback(()=>{S&&s&&(E(!1),s())},[S,s]),re=J.useCallback(H=>{R.current=H,u&&u(H)},[u]),te=A?T.width<350:T.height<200,ee=A?T.height<310:T.height<450;return g.jsx(P.Card,{ref:w,className:f,sx:{width:"100%",height:"100%",display:"flex",flexDirection:A?"row":"column",position:"relative",overflow:"hidden",minWidth:{xs:180,sm:220,md:250},minHeight:A?{xs:200,sm:240,md:260}:{xs:150,sm:180,md:220},border:`1px solid ${m.palette.divider}`,borderRadius:"18px",boxShadow:"none",backgroundColor:((se=m.palette.backgroundPaperElevation)==null?void 0:se[8])||"#2A2A3F",backgroundImage:"none"},children:A?g.jsxs(g.Fragment,{children:[g.jsx(P.Box,{sx:{flex:"0 0 50%",position:"relative",height:"100%",minHeight:"100%",maxHeight:"100%",borderRadius:1,m:{xs:1.5,sm:2,md:3},mr:{xs:.75,sm:1,md:1.5},overflow:"hidden",display:te?"none":"block"},children:!te&&g.jsxs(Ra.Canvas,{orthographic:!0,camera:{position:[3,2,3],zoom:1},shadows:!0,frameloop:"demand",style:{borderRadius:m.shape.borderRadius,width:"100%",height:"100%",background:"transparent",position:"absolute",top:0,left:0},dpr:[1,2],gl:{alpha:!0,antialias:!0},children:[g.jsx(Ni,{}),g.jsx(ut.Bounds,{fit:!0,observe:!0,margin:1,maxDuration:1,children:g.jsx(l,{connectedMotionGroup:i,postModelRender:z})})]})}),g.jsxs(P.Box,{sx:{flex:"1",display:"flex",flexDirection:"column",justifyContent:"flex-start",width:te?"100%":"50%"},children:[g.jsxs(P.Box,{sx:{p:{xs:1.5,sm:2,md:3},pb:{xs:1,sm:1.5,md:2},textAlign:"left"},children:[g.jsx(P.Typography,{variant:"h6",component:"h2",sx:{mb:1},children:e}),g.jsx(Tl,{programState:t,safetyState:r,operationMode:n})]}),g.jsxs(P.Box,{sx:{p:{xs:1.5,sm:2,md:3},pt:0,flex:"1",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[!ee&&g.jsxs(P.Box,{children:[g.jsx(P.Typography,{variant:"body1",sx:{mb:0,color:m.palette.text.secondary,textAlign:"left"},children:b("RobotCard.Runtime.lb")}),g.jsx(P.Box,{sx:{textAlign:"left"},children:g.jsx(c,{variant:"small",compact:!0,onCycleComplete:re,onCycleEnd:d,autoStart:h,hasError:p})}),g.jsx(P.Divider,{sx:{mt:1,mb:0,borderColor:m.palette.divider,opacity:.5}})]}),g.jsx(P.Box,{sx:{mt:ee?0:"auto"},children:g.jsx(P.Box,{sx:{display:"flex",justifyContent:"flex-start",mt:{xs:1,sm:1.5,md:2},mb:{xs:.5,sm:.75,md:1}},children:g.jsx(P.Button,{ref:O,variant:"contained",color:"secondary",size:"small",disabled:!o,onMouseDown:I,onMouseUp:G,onMouseLeave:oe,onTouchStart:I,onTouchEnd:G,sx:{textTransform:"none",px:1.5,py:.5},children:b("RobotCard.DriveToHome.bt")})})})]})]})]}):g.jsx(g.Fragment,{children:g.jsxs(P.Box,{sx:{p:3,height:"100%",display:"flex",flexDirection:"column"},children:[g.jsxs(P.Box,{children:[g.jsx(P.Typography,{variant:"h6",component:"h2",sx:{mb:1},children:e}),g.jsx(Tl,{programState:t,safetyState:r,operationMode:n})]}),g.jsx(P.Box,{sx:{flex:te?0:1,position:"relative",minHeight:te?0:{xs:120,sm:150,md:200},height:te?0:"auto",borderRadius:1,overflow:"hidden",display:te?"none":"block"},children:!te&&g.jsxs(Ra.Canvas,{orthographic:!0,camera:{position:[3,2,3],zoom:1},shadows:!0,frameloop:"demand",style:{borderRadius:m.shape.borderRadius,width:"100%",height:"100%",background:"transparent",position:"absolute"},dpr:[1,2],gl:{alpha:!0,antialias:!0},children:[g.jsx(Ni,{}),g.jsx(ut.Bounds,{fit:!0,clip:!0,observe:!0,margin:1,maxDuration:1,children:g.jsx(l,{connectedMotionGroup:i,postModelRender:z})})]})}),g.jsxs(P.Box,{children:[!ee&&g.jsxs(g.Fragment,{children:[g.jsx(P.Typography,{variant:"body1",sx:{mb:0,color:m.palette.text.secondary},children:b("RobotCard.Runtime.lb")}),g.jsx(c,{variant:"small",compact:!0,onCycleComplete:re,onCycleEnd:d,autoStart:h,hasError:p}),g.jsx(P.Divider,{sx:{mt:1,mb:0,borderColor:m.palette.divider,opacity:.5}})]}),g.jsx(P.Box,{sx:{display:"flex",justifyContent:"flex-start",mt:ee?{xs:.5,sm:1,md:2}:{xs:1,sm:2,md:5},mb:{xs:.5,sm:.75,md:1}},children:g.jsx(P.Button,{ref:O,variant:"contained",color:"secondary",size:"small",disabled:!o,onMouseDown:I,onMouseUp:G,onMouseLeave:oe,onTouchStart:I,onTouchEnd:G,sx:{textTransform:"none",px:1.5,py:.5},children:b("RobotCard.DriveToHome.bt")})})]})]})})})})),C3=fr(g.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error"),P3=({title:e,titleId:t,...r},n)=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:18,height:18,fill:"none",ref:n,"aria-labelledby":t,...r},e?F.createElement("title",{id:t},e):null,F.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"})),T3=J.forwardRef(P3);var Vc=(e=>(e.PRECONDITION_NOT_FULFILLED="PRECONDITION_NOT_FULFILLED",e.ROBOT_DISCONNECTED="ROBOT_DISCONNECTED",e.READY="READY",e))(Vc||{});const rg=Xe(Oe.observer(({setupState:e,className:t})=>{const r=P.useTheme(),{t:n}=_e.useTranslation(),o=()=>{var c,u,d,h;switch(e){case"READY":return{label:n("RobotSetupReadinessIndicator.Ready.lb"),indicatorColor:((c=r.palette.tertiary)==null?void 0:c.main)||r.palette.primary.main,backgroundColor:((u=r.palette.backgroundPaperElevation)==null?void 0:u[11])||r.palette.background.paper,textColor:r.palette.secondary.contrastText};case"ROBOT_DISCONNECTED":return{label:n("RobotSetupReadinessIndicator.RobotDisconnected.lb"),indicatorColor:r.palette.error.main,backgroundColor:((d=r.palette.backgroundPaperElevation)==null?void 0:d[11])||r.palette.background.paper,textColor:r.palette.secondary.contrastText};case"PRECONDITION_NOT_FULFILLED":default:return{label:n("RobotSetupReadinessIndicator.PreconditionNotFulfilled.lb"),indicatorColor:r.palette.error.main,backgroundColor:((h=r.palette.backgroundPaperElevation)==null?void 0:h[11])||r.palette.background.paper,textColor:r.palette.secondary.contrastText}}},{label:a,indicatorColor:s,backgroundColor:i,textColor:l}=o();return g.jsx(P.Chip,{className:t,label:g.jsxs(P.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[g.jsx(P.Box,{sx:{width:8,height:8,borderRadius:"50%",backgroundColor:s,flexShrink:0}}),g.jsx(P.Typography,{variant:"body2",sx:{color:l,fontSize:"0.75rem",lineHeight:1.2},children:a})]}),variant:"filled",sx:{backgroundColor:i,color:r.palette.getContrastText(i),fontWeight:500,height:"auto","& .MuiChip-label":{paddingX:1.5,paddingY:.5}}})})),R3=Xe(Oe.observer(({robotName:e,robotType:t,setupState:r,PreconditionComponent:n=rg,className:o})=>{var l;const a=P.useTheme(),s=t||"Robot",i=r===Vc.READY;return g.jsxs(P.Box,{className:o,sx:{border:`1px solid ${a.palette.divider}`,background:((l=a.palette.backgroundPaperElevation)==null?void 0:l[8])||"#292B3F",borderRadius:"8px",padding:"20px",display:"flex",alignItems:"center",justifyContent:"space-between",opacity:1},children:[g.jsxs(P.Box,{sx:{display:"flex",alignItems:"center",gap:2,flex:1},children:[i?g.jsx(P.Box,{sx:{fontSize:24,display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,"& svg":{fill:`${a.palette.primary.main} !important`},"& svg path":{fill:`${a.palette.primary.main} !important`}},children:g.jsx(T3,{})}):g.jsx(C3,{sx:{color:a.palette.error.main,fontSize:24}}),g.jsx(P.Typography,{variant:"body1",sx:{fontWeight:500,color:a.palette.text.primary},children:e}),g.jsx(P.Divider,{orientation:"vertical",flexItem:!0,sx:{backgroundColor:a.palette.text.secondary,opacity:.3,width:"1px"}}),g.jsx(P.Typography,{variant:"body2",sx:{color:a.palette.text.secondary},children:s})]}),n&&g.jsx(n,{setupState:r})]})})),A3=Array(6).fill(2*Math.PI),Rl={[Mt.Abb]:[0,0,0,0,Math.PI/2,0,0],[Mt.Fanuc]:[0,0,0,0,-Math.PI/2,0,0],[Mt.Yaskawa]:[0,0,0,0,-Math.PI/2,0,0],[Mt.Kuka]:[0,-Math.PI/2,Math.PI/2,0,Math.PI/2,0,0],[Mt.Universalrobots]:[0,-Math.PI/2,-Math.PI/2,-Math.PI/2,Math.PI/2,-Math.PI/2,0]};function ng(e){const[t]=e.split("_");switch(t){case"ABB":return Mt.Abb;case"FANUC":return Mt.Fanuc;case"YASKAWA":return Mt.Yaskawa;case"KUKA":return Mt.Kuka;case"UniversalRobots":return Mt.Universalrobots;default:return null}}function _3(e,t){const r=ng(e);return r&&r in Rl?Rl[r]:t||null}const E3=({title:e,titleId:t,...r},n)=>F.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:n,"aria-labelledby":t,...r},e?F.createElement("title",{id:t},e):null,F.createElement("path",{d:"M5.248 21c-.334 0-.619-.116-.853-.35a1.153 1.153 0 0 1-.351-.848c0-.333.117-.616.351-.85.234-.233.519-.35.853-.35H7.24L4.558 9.87a2.881 2.881 0 0 1-1.126-1.042A2.77 2.77 0 0 1 3 7.317c0-.793.28-1.467.838-2.023a2.774 2.774 0 0 1 2.033-.834 2.71 2.71 0 0 1 1.728.585c.494.389.832.887 1.014 1.493h3.58V5.239c0-.22.076-.406.226-.555a.76.76 0 0 1 .558-.224c.136 0 .263.035.381.104.118.07.209.167.273.292v.14l1.835-1.702a.979.979 0 0 1 .52-.279.881.881 0 0 1 .58.091l4.01 1.85a.74.74 0 0 1 .36.364.537.537 0 0 1-.002.474.592.592 0 0 1-.366.323.657.657 0 0 1-.477-.039l-3.858-1.774L13.76 6.59v1.454l2.473 2.233 3.858-1.774a.648.648 0 0 1 .485-.03.571.571 0 0 1 .358.314.513.513 0 0 1 .01.482.79.79 0 0 1-.367.357l-4.011 1.882a.881.881 0 0 1-.58.09.979.979 0 0 1-.52-.278L13.63 9.638v.14a.92.92 0 0 1-.273.275.665.665 0 0 1-.381.12.76.76 0 0 1-.558-.224.752.752 0 0 1-.225-.555V8.096h-3.58a2.82 2.82 0 0 1-.215.54 2.552 2.552 0 0 1-.323.479l5.139 9.488h2.673c.335 0 .62.116.854.35.234.233.35.516.35.849 0 .332-.116.615-.35.849a1.167 1.167 0 0 1-.854.349H5.248Zm.623-12.385c.362 0 .67-.126.924-.378a1.25 1.25 0 0 0 .38-.92 1.25 1.25 0 0 0-.38-.92 1.261 1.261 0 0 0-.924-.379 1.26 1.26 0 0 0-.925.379 1.25 1.25 0 0 0-.38.92c0 .36.127.667.38.92.254.252.562.378.925.378Z"})),I3=J.forwardRef(E3),V3=({title:e,titleId:t,...r},n)=>F.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:n,"aria-labelledby":t,...r},e?F.createElement("title",{id:t},e):null,F.createElement("path",{d:"m13.37 9.12 1.69 1.69 2.99-2.99-3.73-3.73-.95-.95-7.66 7.66-.95.95 3.99 3.99v3.44h7.55v-3.55l-4.72-4.72 1.79-1.79Zm-.91-2.99.91-.91 2.6 2.6-.91.91-2.6-2.6Zm-2.25 10.24h3.74l-1.34-1.34-.04-.04h-2.5l-3.25-3.25 4.59-4.59.92.92L9.5 10.9l5.33 5.33v1.48H10.2v-1.35l.01.01ZM2 2v4.99h1.41V3.4h3.58V2H2ZM22.21 2h-4.98v1.41h3.59v3.58h1.4V2h-.01ZM20.81 20.65h-3.58v1.4h4.98v-4.99h-1.4v3.59ZM3.4 17.06H2v4.98h4.99v-1.4H3.4v-3.58Z"})),M3=J.forwardRef(V3),jt=Oe.observer(({id:e,icon:t,color:r,title:n,name:o,label:a,explanation:s,literalValue:i,anchorOrigin:l,transformOrigin:c})=>{const u=Oe.useLocalObservable(()=>({anchorEl:null,get isPopoverOpen(){return!!u.anchorEl},openPopover(d){u.anchorEl=d.currentTarget},closePopover(){u.anchorEl=null}}));return g.jsxs(g.Fragment,{children:[g.jsxs(P.Stack,{"aria-owns":u.isPopoverOpen?e:void 0,"aria-haspopup":"true",onMouseEnter:u.openPopover,onMouseLeave:u.closePopover,direction:"row",spacing:1,sx:{cursor:"pointer"},children:[g.jsx(P.SvgIcon,{component:t,sx:{color:r}}),a&&g.jsx("div",{style:{color:r},children:a})]}),g.jsx(P.Popover,{id:e,sx:{pointerEvents:"none"},open:u.isPopoverOpen,anchorEl:u.anchorEl,anchorOrigin:l??{vertical:"bottom",horizontal:"left"},transformOrigin:c??{vertical:"top",horizontal:"left"},onClose:u.closePopover,disableRestoreFocus:!0,children:g.jsxs(P.Stack,{gap:"1rem",padding:2,maxWidth:"450px",sx:{wordWrap:"break-word"},children:[g.jsxs("div",{children:[n&&g.jsx(P.Typography,{component:"span",fontSize:"14px",children:`${n}: `}),g.jsx(P.Typography,{component:"span",color:r,fontWeight:"bold",fontSize:"14px",children:o})]}),g.jsx(P.Typography,{fontSize:"14px",children:s}),i&&g.jsx(P.Typography,{fontSize:"12px",children:i})]})})]})}),j3=Oe.observer(({isVirtual:e,motionGroupId:t,anchorOrigin:r,transformOrigin:n,compact:o})=>{const a=P.useTheme(),{t:s}=_e.useTranslation();return e?g.jsx(jt,{id:"motion-group-virtual",icon:M3,color:a.palette.tertiary.main,name:s("SafetyBar.ControllerType.Virtual.lb"),label:o?null:s("SafetyBar.ControllerType.Virtual.lb"),explanation:g.jsxs(_e.Trans,{i18nKey:"SafetyBar.MotionGroup.Virtual.Explanation.lb",values:{motionGroupId:t},children:["Motion group ",g.jsx("code",{children:t})," refers to a virtual robot with no physical counterpart. It can be freely manipulated without special safety precautions."]}),anchorOrigin:r,transformOrigin:n}):g.jsx(jt,{id:"motion-group-physical",icon:I3,color:a.palette.primary.main,name:s("SafetyBar.ControllerType.Physical.lb"),label:o?null:s("SafetyBar.ControllerType.Physical.lb"),explanation:g.jsx(_e.Trans,{i18nKey:"SafetyBar.MotionGroup.Physical.Explanation.lb",values:{motionGroupId:t},components:{code:g.jsx("code",{}),strong:g.jsx("strong",{})}}),anchorOrigin:r,transformOrigin:n})}),k3=({title:e,titleId:t,...r},n)=>F.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:n,"aria-labelledby":t,...r},e?F.createElement("title",{id:t},e):null,F.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.306 2.768c0-.424.344-.768.768-.768h.406C19.53 2 22 4.551 22 7.699c0 3.237-2.51 5.587-5.31 5.703-.84 1.595-2.478 2.677-4.36 2.677a4.845 4.845 0 0 1-3.146-1.163c-.6 1.783 0 3.922 1.79 4.99 1.929 1.149 4.395.467 5.508-1.524l.212-.378a.75.75 0 1 1 1.308.732l-.231.414c-1.524 2.725-4.9 3.66-7.54 2.085-2.716-1.618-3.432-5.037-2.129-7.599a5.22 5.22 0 0 1-.73-2.677c0-2.192 1.335-4.063 3.212-4.793-1.195-1.427-3.29-1.96-5.08-.892-1.928 1.15-2.589 3.696-1.475 5.687l.231.413a.75.75 0 0 1-1.308.732l-.212-.377c-1.524-2.726-.62-6.211 2.02-7.785 2.716-1.619 5.943-.55 7.44 1.897l.13-.001c2.739 0 4.96 2.292 4.96 5.12 0 .284-.023.563-.066.834 1.795-.354 3.288-1.96 3.288-4.095 0-2.3-1.805-4.163-4.032-4.163h-.406a.768.768 0 0 1-.768-.768Zm.496 8.191c0 .286-.033.564-.094.831a3.62 3.62 0 0 1-.672 1.415 3.425 3.425 0 0 1-2.706 1.338 3.402 3.402 0 0 1-2.384-.98 3.598 3.598 0 0 1-.852-1.306 3.677 3.677 0 0 1-.235-1.298c0-1.623 1.046-2.994 2.48-3.435a3.37 3.37 0 0 1 1.522-.107c1.665.264 2.94 1.75 2.94 3.542Z"})),$3=J.forwardRef(k3),U3=({title:e,titleId:t,...r},n)=>F.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:n,"aria-labelledby":t,...r},e?F.createElement("title",{id:t},e):null,F.createElement("path",{d:"M19.763 16.432 13.516 5.864c-.674-1.152-2.358-1.152-3.049 0l-6.23 10.568C3.563 17.567 4.405 19 5.753 19H18.23c1.364 0 2.206-1.432 1.532-2.568ZM12 8.498c.539 0 .96.428.96.938v.066l-.32 4.708a.639.639 0 0 1-.64.592.639.639 0 0 1-.64-.592l-.32-4.708A.953.953 0 0 1 12 8.498Zm0 8.79c-.556 0-1.01-.444-1.01-.987 0-.544.454-.988 1.01-.988s1.01.444 1.01.988c0 .542-.454.987-1.01.987Z",fill:"#fff",fillOpacity:.56})),D3=J.forwardRef(U3),L3=({title:e,titleId:t,...r},n)=>F.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:n,"aria-labelledby":t,...r},e?F.createElement("title",{id:t},e):null,F.createElement("path",{d:"M12.953 5.09a1.497 1.497 0 0 0-1.653-.518l-1.35.43a1.504 1.504 0 0 0-1.726-.376L2.858 6.97c-.736.321-1.06 1.155-.726 1.862.334.707 1.202 1.02 1.937.698l4.27-1.865 1.466 1.973v.402c0 .873-.627 1.63-1.512 1.827l-2.56.567c-1.329.295-2.27 1.431-2.27 2.74v.107c0 .26.22.469.489.469h11.117c1.329 0 2.618.435 3.656 1.233l1.665 1.28A1 1 0 0 0 22 17.47V11.062c0-.312-.108-.616-.308-.863l-3.415-4.218a1.5 1.5 0 0 0-1.618-.471l-.378.12-.866-.475a1.516 1.516 0 0 0-1.188-.114l-1.06.338-.214-.289Z"})),B3=J.forwardRef(L3),N3=Oe.observer(({operationMode:e,anchorOrigin:t,transformOrigin:r,compact:n})=>{const{t:o}=_e.useTranslation(),a=P.useTheme();switch(e){case"OPERATION_MODE_AUTO":return g.jsx(jt,{id:"operation-mode-auto",icon:$3,title:o("SafetyBar.OperationMode.ti"),name:o("SafetyBar.OperationMode.Automatic.ti"),label:n?null:o("SafetyBar.OperationMode.Automatic.ti"),color:a.palette.text.secondary,explanation:g.jsx(_e.Trans,{i18nKey:"SafetyBar.OperationMode.Auto.Explanation.lb",children:"The robot controller is in automatic operation mode. Automated movement without manual confirmation is possible in this mode."}),anchorOrigin:t,transformOrigin:r});case"OPERATION_MODE_MANUAL":case"OPERATION_MODE_MANUAL_T1":case"OPERATION_MODE_MANUAL_T2":return g.jsx(jt,{id:"operation-mode-manual",icon:B3,color:a.palette.warning.main,title:o("SafetyBar.OperationMode.ti"),name:o("SafetyBar.OperationMode.Manual.lb"),label:n?null:o("SafetyBar.OperationMode.Manual.lb"),explanation:g.jsx(_e.Trans,{i18nKey:"SafetyBar.OperationMode.Manual.Explanation.lb",children:"The robot controller is in manual operation mode. On a physical robot, this generally indicates that an enabling switch must be held for the robot to move successfully."}),literalValue:e,anchorOrigin:t,transformOrigin:r});default:return g.jsx(jt,{id:"operation-mode-error",icon:D3,color:a.palette.warning.main,title:o("SafetyBar.OperationMode.ti"),name:o("SafetyBar.OperationMode.Error.lb"),label:n?null:o("SafetyBar.OperationMode.Error.lb"),explanation:g.jsx(_e.Trans,{i18nKey:"SafetyBar.OperationMode.Error.Explanation.lb",children:"The robot controller has entered an unexpected operation mode. Motion group movement may not be possible."}),literalValue:e,anchorOrigin:t,transformOrigin:r})}}),F3=({title:e,titleId:t,...r},n)=>F.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:n,"aria-labelledby":t,...r},e?F.createElement("title",{id:t},e):null,F.createElement("path",{d:"M19.763 16.432 13.516 5.864c-.674-1.152-2.358-1.152-3.049 0l-6.23 10.568C3.563 17.567 4.405 19 5.753 19H18.23c1.364 0 2.206-1.432 1.532-2.568ZM12 8.498c.539 0 .96.428.96.938v.066l-.32 4.708a.639.639 0 0 1-.64.592.639.639 0 0 1-.64-.592l-.32-4.708A.953.953 0 0 1 12 8.498Zm0 8.79c-.556 0-1.01-.444-1.01-.987 0-.544.454-.988 1.01-.988s1.01.444 1.01.988c0 .542-.454.987-1.01.987Z"})),z3=J.forwardRef(F3),G3=({title:e,titleId:t,...r},n)=>F.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:n,"aria-labelledby":t,...r},e?F.createElement("title",{id:t},e):null,F.createElement("path",{d:"M10.24 10.636 12 13.764l1.76-3.128h-3.52Z"}),F.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.364 12a6.364 6.364 0 1 1-12.728 0 6.364 6.364 0 0 1 12.728 0ZM7.909 9.273 12 16.546l4.09-7.273H7.91Z"}),F.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-1.364 0a8.636 8.636 0 1 1-17.273 0 8.636 8.636 0 0 1 17.273 0Z"})),H3=J.forwardRef(G3),q3=({title:e,titleId:t,...r},n)=>F.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:n,"aria-labelledby":t,...r},e?F.createElement("title",{id:t},e):null,F.createElement("path",{d:"M9.057 15.115c-1.681 0-3.111-.59-4.29-1.768C3.59 12.17 3 10.74 3 9.057c0-.29.021-.582.064-.876a4.1 4.1 0 0 1 .214-.844.78.78 0 0 1 .273-.36c.115-.077.244-.133.389-.168a.857.857 0 0 1 .437.008c.146.04.28.12.4.24l2.806 2.787 2.26-2.261-2.775-2.786a.903.903 0 0 1-.241-.405.875.875 0 0 1-.008-.442 1.13 1.13 0 0 1 .174-.389.82.82 0 0 1 .355-.273c.268-.107.548-.182.838-.224.29-.043.581-.064.871-.064 1.682 0 3.112.59 4.29 1.768 1.179 1.178 1.768 2.608 1.768 4.29 0 .444-.042.858-.126 1.241-.084.384-.21.755-.377 1.113l5.726 5.692A2.2 2.2 0 0 1 21 18.721a2.2 2.2 0 0 1-.662 1.617A2.2 2.2 0 0 1 18.72 21a2.173 2.173 0 0 1-1.617-.679l-5.692-5.709c-.372.161-.75.285-1.133.372-.383.087-.79.13-1.222.13Z",fill:"#fff",fillOpacity:.56})),W3=J.forwardRef(q3),J3=({title:e,titleId:t,...r},n)=>F.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:n,"aria-labelledby":t,...r},e?F.createElement("title",{id:t},e):null,F.createElement("path",{d:"m10.6 13.8-2.15-2.15a.948.948 0 0 0-.7-.275.948.948 0 0 0-.7.275.948.948 0 0 0-.275.7c0 .283.092.517.275.7L9.9 15.9c.2.2.433.3.7.3.267 0 .5-.1.7-.3l5.65-5.65a.948.948 0 0 0 .275-.7.948.948 0 0 0-.275-.7.948.948 0 0 0-.7-.275.948.948 0 0 0-.7.275L10.6 13.8ZM12 22a9.738 9.738 0 0 1-3.9-.788 10.099 10.099 0 0 1-3.175-2.137c-.9-.9-1.612-1.958-2.137-3.175A9.738 9.738 0 0 1 2 12c0-1.383.263-2.683.788-3.9a10.099 10.099 0 0 1 2.137-3.175c.9-.9 1.958-1.612 3.175-2.137A9.738 9.738 0 0 1 12 2c1.383 0 2.683.263 3.9.788a10.098 10.098 0 0 1 3.175 2.137c.9.9 1.613 1.958 2.137 3.175A9.738 9.738 0 0 1 22 12a9.738 9.738 0 0 1-.788 3.9 10.098 10.098 0 0 1-2.137 3.175c-.9.9-1.958 1.613-3.175 2.137A9.738 9.738 0 0 1 12 22Zm0-2c2.233 0 4.125-.775 5.675-2.325C19.225 16.125 20 14.233 20 12c0-2.233-.775-4.125-2.325-5.675C16.125 4.775 14.233 4 12 4c-2.233 0-4.125.775-5.675 2.325C4.775 7.875 4 9.767 4 12c0 2.233.775 4.125 2.325 5.675C7.875 19.225 9.767 20 12 20Z"})),Y3=J.forwardRef(J3),K3=({title:e,titleId:t,...r},n)=>F.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:n,"aria-labelledby":t,...r},e?F.createElement("title",{id:t},e):null,F.createElement("path",{d:"M9 16h6c.283 0 .52-.096.713-.287A.968.968 0 0 0 16 15V9a.967.967 0 0 0-.287-.713A.968.968 0 0 0 15 8H9a.968.968 0 0 0-.713.287A.968.968 0 0 0 8 9v6c0 .283.096.52.287.713.192.191.43.287.713.287Zm3 6a9.738 9.738 0 0 1-3.9-.788 10.099 10.099 0 0 1-3.175-2.137c-.9-.9-1.612-1.958-2.137-3.175A9.738 9.738 0 0 1 2 12c0-1.383.263-2.683.788-3.9a10.099 10.099 0 0 1 2.137-3.175c.9-.9 1.958-1.612 3.175-2.137A9.738 9.738 0 0 1 12 2c1.383 0 2.683.263 3.9.788a10.098 10.098 0 0 1 3.175 2.137c.9.9 1.613 1.958 2.137 3.175A9.738 9.738 0 0 1 22 12a9.738 9.738 0 0 1-.788 3.9 10.098 10.098 0 0 1-2.137 3.175c-.9.9-1.958 1.613-3.175 2.137A9.738 9.738 0 0 1 12 22Zm0-2c2.233 0 4.125-.775 5.675-2.325C19.225 16.125 20 14.233 20 12c0-2.233-.775-4.125-2.325-5.675C16.125 4.775 14.233 4 12 4c-2.233 0-4.125.775-5.675 2.325C4.775 7.875 4 9.767 4 12c0 2.233.775 4.125 2.325 5.675C7.875 19.225 9.767 20 12 20Z"})),Q3=J.forwardRef(K3),X3=Oe.observer(({safetyState:e,anchorOrigin:t,transformOrigin:r,compact:n})=>{const{t:o}=_e.useTranslation(),a=P.useTheme();switch(e){case"SAFETY_STATE_NORMAL":return g.jsx(jt,{id:"safety-state-normal",title:o("SafetyBar.SafetyState.ti"),name:o("SafetyBar.SafetyState.Normal.lb"),label:n?null:o("SafetyBar.SafetyState.Normal.lb"),icon:Y3,color:a.palette.text.secondary,explanation:g.jsx(_e.Trans,{i18nKey:"SafetyBar.SafetyState.Normal.Explanation.lb",children:"The robot controller is in a normal safety state. Movement is not prevented by this state."}),anchorOrigin:t,transformOrigin:r});case"SAFETY_STATE_DEVICE_EMERGENCY_STOP":case"SAFETY_STATE_ROBOT_EMERGENCY_STOP":return g.jsx(jt,{id:"safety-state-estop",title:o("SafetyBar.SafetyState.ti"),name:o("SafetyBar.SafetyState.Estop.lb"),label:n?null:o("SafetyBar.SafetyState.Estop.lb"),icon:H3,color:a.palette.error.main,explanation:g.jsx(_e.Trans,{i18nKey:"SafetyBar.StopState.Estop.Explanation.lb",children:"An emergency stop of the robot controller has been triggered. Movement of the robot is no longer possible until the estop is released."}),literalValue:e,anchorOrigin:t,transformOrigin:r});case"SAFETY_STATE_STOP_0":case"SAFETY_STATE_STOP_1":case"SAFETY_STATE_STOP_2":case"SAFETY_STATE_PROTECTIVE_STOP":case"SAFETY_STATE_STOP":return g.jsx(jt,{id:"safety-state-stop",icon:Q3,title:o("SafetyBar.SafetyState.ti"),name:o("SafetyBar.SafetyState.Stop.lb"),label:n?null:o("SafetyBar.SafetyState.Stop.lb"),color:a.palette.warning.main,explanation:g.jsx(_e.Trans,{i18nKey:"SafetyBar.SafetyState.Stop.Explanation.lb",children:"The robot controller has entered a stop state. Movement is no longer possible until the stop state is resolved."}),literalValue:e,anchorOrigin:t,transformOrigin:r});case"SAFETY_STATE_REDUCED":case"SAFETY_STATE_MASTERING":case"SAFETY_STATE_CONFIRM_SAFETY":case"SAFETY_STATE_OPERATOR_SAFETY":case"SAFETY_STATE_RECOVERY":case"SAFETY_STATE_VIOLATION":return g.jsx(jt,{id:"safety-state-manual-action-required",icon:W3,color:a.palette.warning.main,title:o("SafetyBar.SafetyState.ti"),name:o("SafetyBar.SafetyState.ManualActionRequired.lb"),label:n?null:o("SafetyBar.SafetyState.ManualActionRequired.lb"),explanation:g.jsx(_e.Trans,{i18nKey:"SafetyBar.SafetyState.ManualActionRequired.Explanation.lb",children:"The robot controller has entered a safety state requiring manual action to resolve."}),literalValue:e,anchorOrigin:t,transformOrigin:r});case"SAFETY_STATE_UNKNOWN":case"SAFETY_STATE_FAULT":return g.jsx(jt,{id:"safety-state-error",icon:z3,color:a.palette.error.main,title:o("SafetyBar.SafetyState.ti"),name:o("SafetyBar.SafetyState.Error.lb"),label:n?null:o("SafetyBar.SafetyState.Error.lb"),explanation:g.jsx(_e.Trans,{i18nKey:"SafetyBar.SafetyState.Error.Explanation.lb",children:"The robot controller has entered an unexpected safety state."}),literalValue:e,anchorOrigin:t,transformOrigin:r});default:Q2(e,`Unknown safety state ${e}`)}}),Z3=Xe(Oe.observer(({isVirtual:e,motionGroupId:t,operationMode:r,safetyState:n,anchorOrigin:o,transformOrigin:a,compact:s=!0})=>{const i=s?1:2;return g.jsxs(P.Stack,{direction:"row",gap:i,alignItems:"center",sx:{height:"24px"},children:[g.jsx(X3,{safetyState:n,anchorOrigin:o,transformOrigin:a,compact:s}),g.jsx(P.Divider,{orientation:"vertical",flexItem:!0}),g.jsx(N3,{operationMode:r,anchorOrigin:o,transformOrigin:a,compact:s}),g.jsx(P.Divider,{orientation:"vertical",flexItem:!0}),g.jsx(j3,{isVirtual:e,motionGroupId:t,anchorOrigin:o,transformOrigin:a,compact:s})]})})),ej=P.styled(P.Fab,{shouldForwardProp:e=>e!=="selected"})(({theme:e})=>{var t,r,n;return{borderRadius:"20px","&:hover":{background:(t=e.palette.backgroundPaperElevation)==null?void 0:t[7]},variants:[{props:({selected:o})=>!o,style:{background:(r=e.palette.backgroundPaperElevation)==null?void 0:r[0],color:e.palette.action.disabled,"> img":{opacity:.4}}},{props:({selected:o})=>o,style:{background:(n=e.palette.backgroundPaperElevation)==null?void 0:n[11],border:`1px solid ${e.palette.divider}`,color:e.palette.primary.contrastText}}]}}),tj=J.forwardRef((e,t)=>g.jsx(ej,{ref:t,selected:e.selected,...e,color:"secondary",variant:"circular"}));function rj(e){const{children:t,value:r,index:n,...o}=e;return g.jsx("div",{role:"tabpanel",hidden:r!==n,id:`tabpanel-${n}`,"aria-labelledby":`tab-${n}`,...o,children:r===n&&g.jsx(P.Box,{children:t})})}const nj=Xe(Oe.observer(e=>{const{items:t,defaultActiveTab:r=0,onTabChange:n,sx:o}=e,[a,s]=J.useState(r),i=(l,c)=>{s(c),n==null||n(c)};return g.jsxs(P.Box,{sx:{height:"100%",display:"flex",flexDirection:"column",...o},children:[g.jsx(P.Box,{sx:{px:3,pt:3,pb:3},children:g.jsx(P.Tabs,{value:a,onChange:i,sx:{minHeight:"auto",backgroundColor:"transparent",mt:3,"& .MuiTabs-indicator":{display:"none"},"& .MuiTabs-flexContainer":{gap:2}},children:t.map((l,c)=>g.jsx(P.Tab,{label:l.label,icon:l.icon,iconPosition:"start",disableRipple:!0,sx:{minHeight:"auto",minWidth:"auto",padding:"4px 8px",borderRadius:"10px",backgroundColor:u=>{var d;return((d=u.palette.backgroundPaperElevation)==null?void 0:d[11])||"#32344B"},color:"text.primary",opacity:a===c?1:.38,textTransform:"none",fontWeight:500,transition:"all 0.2s ease-in-out","&:hover":{opacity:a===c?1:.6},"&.Mui-selected":{opacity:1,backgroundColor:u=>{var d;return((d=u.palette.backgroundPaperElevation)==null?void 0:d[11])||"#32344B"},color:"text.primary"},"&:focus":{outline:"none"},"&:active":{transform:"none"}}},l.id))})}),g.jsx(P.Box,{sx:{mx:3,borderBottom:1,borderColor:"divider"}}),g.jsx(P.Box,{sx:{flex:1,overflow:"auto"},children:t.map((l,c)=>g.jsx(rj,{value:a,index:c,children:l.content},l.id))})]})})),oj={$schema:"https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",name:"wandelscript",patterns:[{include:"#keywords"},{include:"#strings"},{include:"#comments"},{include:"#functions"}],repository:{keywords:{patterns:[{name:"keyword.control.flow.wandelscript",match:"\\b(move|via|to|interrupt|def|False|True|for|if|else|elif|while|return|switch|activate|deactivate|print|and|or|not)\\b"}]},strings:{name:"string.quoted.double.wandelscript",begin:'"',end:'"',patterns:[{name:"constant.character.escape.wandelscript",match:"\\\\."}]},comments:{patterns:[{begin:"#",beginCaptures:{0:{name:"punctuation.definition.comment.wandelscript"}},end:"$",name:"comment.line.number-sign.wandelscript"}]},functions:{patterns:[{match:"[a-zA-Z_-]+\\(",name:"entity.name.function.wandelscript"}]}},scopeName:"source.wandelscript"},aj=J.lazy(()=>import("@monaco-editor/react"));let Bi=null;async function sj(){if(!Bi){const[{createHighlighter:e},{shikiToMonaco:t}]=await Promise.all([import("shiki"),import("@shikijs/monaco")]);Bi={shiki:await e({langs:[oj],themes:["dark-plus","light-plus"]}),shikiToMonaco:t}}return Bi}const ij=Xe(e=>{const t=P.useTheme(),[r,n]=J.useState("dark-plus"),o=t.palette.mode==="dark"?"dark-plus":"light-plus";async function a(s){var c,u;s.languages.register({id:"wandelscript"}),s.languages.setLanguageConfiguration("wandelscript",{comments:{lineComment:"#"},brackets:[["(",")"],["[","]"]],autoClosingPairs:[{open:"[",close:"]"},{open:"(",close:")"}],surroundingPairs:[{open:"[",close:"]"},{open:"(",close:")"}]});const{shiki:i,shikiToMonaco:l}=await sj();l(i,s),s.editor.defineTheme(o,((u=(c=t.componentsExt)==null?void 0:c.WandelscriptEditor)==null?void 0:u.monacoTheme)??{base:t.palette.mode==="dark"?"vs-dark":"vs",inherit:!0,rules:[],colors:{}}),e.monacoSetup&&e.monacoSetup(s),n(o)}return g.jsx(J.Suspense,{fallback:g.jsx(Cc,{}),children:g.jsx(aj,{value:e.code,onMount:(s,i)=>{a(i)},onChange:e.onChange,defaultLanguage:"wandelscript",theme:r,options:{minimap:{enabled:!1},wordWrap:"on",automaticLayout:!0,...e.monacoOptions}})})});function og(){var t,r,n,o,a,s,i;const e=P.createTheme({palette:{mode:"dark",text:{primary:"rgba(255, 255, 255, 1)",secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.38)"},primary:{main:"rgba(142, 86, 252, 1)",dark:"rgba(136, 58, 255, 1)",light:"rgba(157, 131, 246, 1)",contrastText:"rgba(255, 255, 255, 0.87)"},secondary:{main:"rgba(255, 255, 255, 1)",dark:"rgba(255, 255, 255, 0.06)",contrastText:"rgba(255, 255, 255, 0.87)"},tertiary:{main:"rgba(100, 255, 218, 1)",dark:"rgba(38, 166, 154, 1)",light:"rgba(167, 255, 235, 1)",contrastText:"rgba(0, 0, 0, 1)"},error:{main:"rgba(239, 83, 80, 1)",dark:"rgba(229, 57, 53, 1)",light:"rgba(239, 154, 154, 1)",contrastText:"rgba(255, 255, 255, 1)"},warning:{main:"rgba(255, 171, 64, 1)",dark:"rgba(255, 145, 0, 1)",light:"rgba(255, 209, 128, 1)",contrastText:"rgba(0, 0, 0, 0.87)"},success:{main:"rgba(38, 166, 154, 1)",dark:"rgba(0, 121, 107, 1)",light:"rgba(128, 203, 196, 1)",contrastText:"rgba(255, 255, 255, 0.87)"},background:{default:"rgba(2, 6, 23, 1)",paper:"rgba(17, 19, 31, 1)"},action:{active:"rgba(255, 255, 255, 0.56)",hover:"rgba(255, 255, 255, 0.08)",selected:"rgba(255, 255, 255, 0.16)",disabledBackground:"rgba(255, 255, 255, 0.12)",focus:"rgba(255, 255, 255, 0.12)",disabled:"rgba(255, 255, 255, 0.38)"},common:{white:"rgba(255, 255, 255, 1)",black:"rgba(0, 0, 0, 1)"},divider:"rgba(255, 255, 255, 0.12)",backgroundPaperElevation:{0:"rgba(17,19,31,1.0)",1:"rgba(20,22,35,1.0)",2:"rgba(23,25,39,1.0)",3:"rgba(26,28,43,1.0)",4:"rgba(29,31,47,1.0)",5:"rgba(32,34,51,1.0)",6:"rgba(35,37,55,1.0)",7:"rgba(38,40,59,1.0)",8:"rgba(41,43,63,1.0)",9:"rgba(44,46,67,1.0)",10:"rgba(47,49,71,1.0)",11:"rgba(50,52,75,1.0)",12:"rgba(53,55,79,1.0)",13:"rgba(56,58,83,1.0)",14:"rgba(59,61,87,1.0)",15:"rgba(62,64,91,1.0)",16:"rgba(57,63,87,1.0)"}},paletteExt:{primary:{hover:"rgba(142, 86, 252, 0.08)",selected:"rgba(142, 86, 252, 0.16)",focus:"rgba(142, 86, 252, 0.12)",focusVisible:"rgba(142, 86, 252, 0.3)",outlineBorder:"rgba(142, 86, 252, 0.5)"},secondary:{tonal:"rgba(255,255,255,0.1)"}}});return{...e,components:{MuiCssBaseline:{styleOverrides:{"html, body, *":{scrollbarWidth:"none",msOverflowStyle:"none"},"html:hover, body:hover, *:hover":{scrollbarWidth:"thin",scrollbarColor:`${e.palette.divider} transparent`},".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:{root:{},panelContent:{borderRadius:"16px !important"},filterForm:{"& .MuiInputBase-root":{borderRadius:"10px !important","& fieldset":{borderRadius:"10px !important"},"& .MuiOutlinedInput-notchedOutline":{borderRadius:"10px !important"}}},filterFormValueInput:{"& .MuiInputBase-root":{borderRadius:"10px !important","& fieldset":{borderRadius:"10px !important"},"& .MuiOutlinedInput-notchedOutline":{borderRadius:"10px !important"}}}}},MuiButton:{styleOverrides:{root:{textTransform:"none",borderRadius:"10px"}},variants:[{props:{color:"secondary",variant:"contained"},style:{border:`1px solid ${e.palette.divider}`,background:(n=(r=(t=e.paletteExt)==null?void 0:t.secondary)==null?void 0:r.tonal)==null?void 0:n.toString()}},{props:{color:"secondary",variant:"outlined"},style:{border:`1px solid ${e.palette.divider}`}}]},MuiTab:{styleOverrides:{root:{textTransform:"none",color:e.palette.text.secondary,"&.Mui-selected":{color:e.palette.text.primary}}}},MuiTabs:{styleOverrides:{root:{background:(o=e.palette.backgroundPaperElevation)==null?void 0:o[1]}}},MuiToggleButtonGroup:{styleOverrides:{root:{".MuiToggleButtonGroup-firstButton":{borderRadius:"10px 0 0 10px"},".MuiToggleButtonGroup-lastButton":{borderRadius:"0 10px 10px 0"}}}},MuiToggleButton:{styleOverrides:{root:{textTransform:"none",padding:"6px 16px"}}},MuiSelect:{variants:[{props:{variant:"filled"},style:{borderRadius:"10px","::before, ::after":{visibility:"collapse"},".MuiInputBase-input":{padding:"6px 16px",borderRadius:"10px"}}}]},MuiDrawer:{styleOverrides:{paper:{border:"none",boxShadow:"4px 0 8px -4px rgba(0, 0, 0, 0.3)"}}},MuiFab:{styleOverrides:{root:{background:(s=(a=e.paletteExt)==null?void 0:a.secondary)==null?void 0:s.tonal}},variants:[{props:{color:"primary"},style:{background:e.palette.primary.main}}]}},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:e.palette.text.primary},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:e.palette.text.primary},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:e.palette.text.primary}}},JoggingJoint:{Joint:{arrowColor:e.palette.text.primary}},VelocitySlider:{sliderLegendColor:e.palette.text.primary}},WandelscriptEditor:{monacoTheme:{base:"vs-dark",inherit:!0,rules:[{token:"keyword",foreground:"#b349a9ff"}],colors:{"editor.background":P.rgbToHex(((i=e.palette.backgroundPaperElevation)==null?void 0:i[5])??""),"editor.foreground":"#d4d4d4","editorLineNumber.foreground":"#797979","editorLineNumber.activeForeground":"#e9e9e9","editor.lineHighlightBorder":"#e9e9e911"}}}}}}function lj(){const e=og();return e.palette.mode="light",e}function cj(e){var n,o,a,s;let t=!0;((n=e.palette)==null?void 0:n.mode)==="light"?t=!1:((o=e.palette)==null?void 0:o.mode)!=="dark"&&(t=!(typeof window<"u"&&((s=(a=window.matchMedia)==null?void 0:a.call(window,"(prefers-color-scheme: light)"))==null?void 0:s.matches)));const r=t?og():lj();return np(r,e)}exports.AppHeader=Mg;exports.CycleTimer=Tm;exports.JoggingCartesianAxisControl=ol;exports.JoggingJointRotationControl=Vm;exports.JoggingPanel=e3;exports.JoggingStore=qs;exports.LoadingCover=Cc;exports.LoadingErrorMessage=Cf;exports.LogPanel=l3;exports.LogStore=Yf;exports.LogViewer=Kf;exports.MANUFACTURER_HOME_CONFIGS=Rl;exports.NoMotionGroupModal=u3;exports.PoseCartesianValues=r3;exports.PoseJointValues=n3;exports.PresetEnvironment=Ni;exports.ProgramControl=d3;exports.ProgramState=vr;exports.ProgramStateIndicator=Tl;exports.Robot=tg;exports.RobotCard=w3;exports.RobotListItem=R3;exports.RobotSetupReadinessIndicator=rg;exports.RobotSetupReadinessState=Vc;exports.SafetyBar=Z3;exports.SafetyZonesRenderer=Rg;exports.SelectableFab=tj;exports.SupportedRobot=eg;exports.TabBar=nj;exports.TrajectoryRenderer=Ag;exports.ValueInterpolator=xc;exports.VelocitySlider=qf;exports.VelocitySliderLabel=Ec;exports.WandelbotsDataGrid=Rm;exports.WandelscriptEditor=ij;exports.createDebugMessage=o3;exports.createErrorMessage=i3;exports.createInfoMessage=a3;exports.createLogMessage=Uo;exports.createNovaMuiTheme=cj;exports.createWarningMessage=s3;exports.defaultAxisConfig=A3;exports.defaultGetModel=Ic;exports.extractManufacturer=ng;exports.getDefaultHomeConfig=_3;exports.i18n=_l;exports.useAnimationFrame=Rn;exports.useAutorun=Am;exports.useInterpolation=Pm;exports.useMounted=Is;exports.useReaction=_m;
|
|
154
|
+
`))}return!1}const A5={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function _5(e,t,r=(n,o)=>n===o){return e.length===t.length&&e.every((n,o)=>r(n,t[o]))}const E5=2;function on(e,t,r,n,o){return r===1?Math.min(e+t,o):Math.max(e-t,n)}function Ff(e,t){return e-t}function Ih(e,t){const{index:r}=e.reduce((n,o,a)=>{const s=Math.abs(t-o);return n===null||s<n.distance||s===n.distance?{distance:s,index:a}:n},null)??{};return r}function ma(e,t){if(t.current!==void 0&&e.changedTouches){const r=e;for(let n=0;n<r.changedTouches.length;n+=1){const o=r.changedTouches[n];if(o.identifier===t.current)return{x:o.clientX,y:o.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function Za(e,t,r){return(e-t)*100/(r-t)}function I5(e,t,r){return(r-t)*e+t}function V5(e){if(Math.abs(e)<1){const r=e.toExponential().split("e-"),n=r[0].split(".")[1];return(n?n.length:0)+parseInt(r[1],10)}const t=e.toString().split(".")[1];return t?t.length:0}function M5(e,t,r){const n=Math.round((e-r)/t)*t+r;return Number(n.toFixed(V5(t)))}function Vh({values:e,newValue:t,index:r}){const n=e.slice();return n[r]=t,n.sort(Ff)}function fa({sliderRef:e,activeIndex:t,setActive:r}){var o,a,s;const n=ao(e.current);(!((o=e.current)!=null&&o.contains(n.activeElement))||Number((a=n==null?void 0:n.activeElement)==null?void 0:a.getAttribute("data-index"))!==t)&&((s=e.current)==null||s.querySelector(`[type="range"][data-index="${t}"]`).focus()),r&&r(t)}function ga(e,t){return typeof e=="number"&&typeof t=="number"?e===t:typeof e=="object"&&typeof t=="object"?_5(e,t):!1}const j5={horizontal:{offset:e=>({left:`${e}%`}),leap:e=>({width:`${e}%`})},"horizontal-reverse":{offset:e=>({right:`${e}%`}),leap:e=>({width:`${e}%`})},vertical:{offset:e=>({bottom:`${e}%`}),leap:e=>({height:`${e}%`})}},k5=e=>e;let ya;function Mh(){return ya===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?ya=CSS.supports("touch-action","none"):ya=!0),ya}function $5(e){const{"aria-labelledby":t,defaultValue:r,disabled:n=!1,disableSwap:o=!1,isRtl:a=!1,marks:s=!1,max:i=100,min:l=0,name:c,onChange:u,onChangeCommitted:d,orientation:h="horizontal",rootRef:p,scale:f=k5,step:m=1,shiftStep:b=10,tabIndex:S,value:E}=e,O=F.useRef(void 0),[w,A]=F.useState(-1),[C,T]=F.useState(-1),[V,j]=F.useState(!1),y=F.useRef(0),R=F.useRef(null),[z,I]=Yw({controlled:E,default:r??l,name:"Slider"}),G=u&&((Q,ne,ce)=>{const ye=Q.nativeEvent||Q,Te=new ye.constructor(ye.type,ye);Object.defineProperty(Te,"target",{writable:!0,value:{value:ne,name:c}}),R.current=ne,u(Te,ne,ce)}),oe=Array.isArray(z);let re=oe?z.slice().sort(Ff):[z];re=re.map(Q=>Q==null?l:an(Q,l,i));const te=s===!0&&m!==null?[...Array(Math.floor((i-l)/m)+1)].map((Q,ne)=>({value:l+m*ne})):s||[],ee=te.map(Q=>Q.value),[se,H]=F.useState(-1),X=F.useRef(null),le=ps(p,X),xe=Q=>ne=>{var ye;const ce=Number(ne.currentTarget.getAttribute("data-index"));Eh(ne.target)&&H(ce),T(ce),(ye=Q==null?void 0:Q.onFocus)==null||ye.call(Q,ne)},Le=Q=>ne=>{var ce;Eh(ne.target)||H(-1),T(-1),(ce=Q==null?void 0:Q.onBlur)==null||ce.call(Q,ne)},ae=(Q,ne)=>{const ce=Number(Q.currentTarget.getAttribute("data-index")),ye=re[ce],Te=ee.indexOf(ye);let ue=ne;if(te&&m==null){const We=ee[ee.length-1];ue>=We?ue=We:ue<=ee[0]?ue=ee[0]:ue=ue<ye?ee[Te-1]:ee[Te+1]}if(ue=an(ue,l,i),oe){o&&(ue=an(ue,re[ce-1]||-1/0,re[ce+1]||1/0));const We=ue;ue=Vh({values:re,newValue:ue,index:ce});let tt=ce;o||(tt=ue.indexOf(We)),fa({sliderRef:X,activeIndex:tt})}I(ue),H(ce),G&&!ga(ue,z)&&G(Q,ue,ce),d&&d(Q,R.current??ue)},be=Q=>ne=>{var ce;if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(ne.key)){ne.preventDefault();const ye=Number(ne.currentTarget.getAttribute("data-index")),Te=re[ye];let ue=null;if(m!=null){const We=ne.shiftKey?b:m;switch(ne.key){case"ArrowUp":ue=on(Te,We,1,l,i);break;case"ArrowRight":ue=on(Te,We,a?-1:1,l,i);break;case"ArrowDown":ue=on(Te,We,-1,l,i);break;case"ArrowLeft":ue=on(Te,We,a?1:-1,l,i);break;case"PageUp":ue=on(Te,b,1,l,i);break;case"PageDown":ue=on(Te,b,-1,l,i);break;case"Home":ue=l;break;case"End":ue=i;break}}else if(te){const We=ee[ee.length-1],tt=ee.indexOf(Te),ze=[a?"ArrowRight":"ArrowLeft","ArrowDown","PageDown","Home"],mt=[a?"ArrowLeft":"ArrowRight","ArrowUp","PageUp","End"];ze.includes(ne.key)?tt===0?ue=ee[0]:ue=ee[tt-1]:mt.includes(ne.key)&&(tt===ee.length-1?ue=We:ue=ee[tt+1])}ue!=null&&ae(ne,ue)}(ce=Q==null?void 0:Q.onKeyDown)==null||ce.call(Q,ne)};$t(()=>{var Q;n&&X.current.contains(document.activeElement)&&((Q=document.activeElement)==null||Q.blur())},[n]),n&&w!==-1&&A(-1),n&&se!==-1&&H(-1);const Se=Q=>ne=>{var ce;(ce=Q.onChange)==null||ce.call(Q,ne),ae(ne,ne.target.valueAsNumber)},me=F.useRef(void 0);let Z=h;a&&h==="horizontal"&&(Z+="-reverse");const ie=({finger:Q,move:ne=!1})=>{const{current:ce}=X,{width:ye,height:Te,bottom:ue,left:We}=ce.getBoundingClientRect();let tt;Z.startsWith("vertical")?tt=(ue-Q.y)/Te:tt=(Q.x-We)/ye,Z.includes("-reverse")&&(tt=1-tt);let ze;if(ze=I5(tt,l,i),m)ze=M5(ze,m,l);else{const kn=Ih(ee,ze);ze=ee[kn]}ze=an(ze,l,i);let mt=0;if(oe){ne?mt=me.current:mt=Ih(re,ze),o&&(ze=an(ze,re[mt-1]||-1/0,re[mt+1]||1/0));const kn=ze;ze=Vh({values:re,newValue:ze,index:mt}),o&&ne||(mt=ze.indexOf(kn),me.current=mt)}return{newValue:ze,activeIndex:mt}},de=Ht(Q=>{const ne=ma(Q,O);if(!ne)return;if(y.current+=1,Q.type==="mousemove"&&Q.buttons===0){Y(Q);return}const{newValue:ce,activeIndex:ye}=ie({finger:ne,move:!0});fa({sliderRef:X,activeIndex:ye,setActive:A}),I(ce),!V&&y.current>E5&&j(!0),G&&!ga(ce,z)&&G(Q,ce,ye)}),Y=Ht(Q=>{const ne=ma(Q,O);if(j(!1),!ne)return;const{newValue:ce}=ie({finger:ne,move:!0});A(-1),Q.type==="touchend"&&T(-1),d&&d(Q,R.current??ce),O.current=void 0,ge()}),we=Ht(Q=>{if(n)return;Mh()||Q.preventDefault();const ne=Q.changedTouches[0];ne!=null&&(O.current=ne.identifier);const ce=ma(Q,O);if(ce!==!1){const{newValue:Te,activeIndex:ue}=ie({finger:ce});fa({sliderRef:X,activeIndex:ue,setActive:A}),I(Te),G&&!ga(Te,z)&&G(Q,Te,ue)}y.current=0;const ye=ao(X.current);ye.addEventListener("touchmove",de,{passive:!0}),ye.addEventListener("touchend",Y,{passive:!0})}),ge=F.useCallback(()=>{const Q=ao(X.current);Q.removeEventListener("mousemove",de),Q.removeEventListener("mouseup",Y),Q.removeEventListener("touchmove",de),Q.removeEventListener("touchend",Y)},[Y,de]);F.useEffect(()=>{const{current:Q}=X;return Q.addEventListener("touchstart",we,{passive:Mh()}),()=>{Q.removeEventListener("touchstart",we),ge()}},[ge,we]),F.useEffect(()=>{n&&ge()},[n,ge]);const Ye=Q=>ne=>{var Te;if((Te=Q.onMouseDown)==null||Te.call(Q,ne),n||ne.defaultPrevented||ne.button!==0)return;ne.preventDefault();const ce=ma(ne,O);if(ce!==!1){const{newValue:ue,activeIndex:We}=ie({finger:ce});fa({sliderRef:X,activeIndex:We,setActive:A}),I(ue),G&&!ga(ue,z)&&G(ne,ue,We)}y.current=0;const ye=ao(X.current);ye.addEventListener("mousemove",de,{passive:!0}),ye.addEventListener("mouseup",Y)},qe=Za(oe?re[0]:l,l,i),ke=Za(re[re.length-1],l,i)-qe,tr=(Q={})=>{const ne=Pa(Q),ce={onMouseDown:Ye(ne||{})},ye={...ne,...ce};return{...Q,ref:le,...ye}},Do=Q=>ne=>{var ye;(ye=Q.onMouseOver)==null||ye.call(Q,ne);const ce=Number(ne.currentTarget.getAttribute("data-index"));T(ce)},Lo=Q=>ne=>{var ce;(ce=Q.onMouseLeave)==null||ce.call(Q,ne),T(-1)},Bo=(Q={})=>{const ne=Pa(Q),ce={onMouseOver:Do(ne||{}),onMouseLeave:Lo(ne||{})};return{...Q,...ne,...ce}},No=Q=>({pointerEvents:w!==-1&&w!==Q?"none":void 0});let zr;return h==="vertical"&&(zr=a?"vertical-rl":"vertical-lr"),{active:w,axis:Z,axisProps:j5,dragging:V,focusedThumbIndex:se,getHiddenInputProps:(Q={})=>{const ne=Pa(Q),ce={onChange:Se(ne||{}),onFocus:xe(ne||{}),onBlur:Le(ne||{}),onKeyDown:be(ne||{})},ye={...ne,...ce};return{tabIndex:S,"aria-labelledby":t,"aria-orientation":h,"aria-valuemax":f(i),"aria-valuemin":f(l),name:c,type:"range",min:e.min,max:e.max,step:e.step===null&&e.marks?"any":e.step??void 0,disabled:n,...Q,...ye,style:{...A5,direction:a?"rtl":"ltr",width:"100%",height:"100%",writingMode:zr}}},getRootProps:tr,getThumbProps:Bo,marks:te,open:C,range:oe,rootRef:le,trackLeap:ke,trackOffset:qe,values:re,getThumbStyle:No}}function Ta(e){return typeof e=="string"}const U5=e=>!e||!Ta(e);function D5(e){return typeof e.main=="string"}function L5(e,t=[]){if(!D5(e))return!1;for(const r of t)if(!e.hasOwnProperty(r)||typeof e[r]!="string")return!1;return!0}function _c(e=[]){return([,t])=>t&&L5(t,e)}function B5(e){return wn("MuiSlider",e)}const bt=Il("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),N5=e=>{const{open:t}=e;return{offset:Pt(t&&bt.valueLabelOpen),circle:bt.valueLabelCircle,label:bt.valueLabelLabel}};function zf(e){const{children:t,className:r,value:n}=e,o=N5(e);return t?F.cloneElement(t,{className:t.props.className},g.jsxs(F.Fragment,{children:[t.props.children,g.jsx("span",{className:Pt(o.offset,r),"aria-hidden":!0,children:g.jsx("span",{className:o.circle,children:g.jsx("span",{className:o.label,children:n})})})]})):null}process.env.NODE_ENV!=="production"&&(zf.propTypes={children:x.element.isRequired,className:x.string,value:x.node});function jh(e){return e}const F5=pt("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`color${rt(r.color)}`],r.size!=="medium"&&t[`size${rt(r.size)}`],r.marked&&t.marked,r.orientation==="vertical"&&t.vertical,r.track==="inverted"&&t.trackInverted,r.track===!1&&t.trackFalse]}})(Dr(({theme:e})=>({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${bt.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${bt.dragging}`]:{[`& .${bt.thumb}, & .${bt.track}`]:{transition:"none"}},variants:[...Object.entries(e.palette).filter(_c()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}))),z5=pt("span",{name:"MuiSlider",slot:"Rail"})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),G5=pt("span",{name:"MuiSlider",slot:"Track"})(Dr(({theme:e})=>({display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:e.transitions.create(["left","width","bottom","height"],{duration:e.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.entries(e.palette).filter(_c()).map(([t])=>({props:{color:t,track:"inverted"},style:{...e.vars?{backgroundColor:e.vars.palette.Slider[`${t}Track`],borderColor:e.vars.palette.Slider[`${t}Track`]}:{backgroundColor:uo(e.palette[t].main,.62),borderColor:uo(e.palette[t].main,.62),...e.applyStyles("dark",{backgroundColor:co(e.palette[t].main,.5)}),...e.applyStyles("dark",{borderColor:co(e.palette[t].main,.5)})}}}))]}))),H5=pt("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.thumb,t[`thumbColor${rt(r.color)}`],r.size!=="medium"&&t[`thumbSize${rt(r.size)}`]]}})(Dr(({theme:e})=>({position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:e.transitions.create(["box-shadow","left","bottom"],{duration:e.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(e.vars||e).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${bt.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}},...Object.entries(e.palette).filter(_c()).map(([t])=>({props:{color:t},style:{[`&:hover, &.${bt.focusVisible}`]:{...e.vars?{boxShadow:`0px 0px 0px 8px rgba(${e.vars.palette[t].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${zi(e.palette[t].main,.16)}`},"@media (hover: none)":{boxShadow:"none"}},[`&.${bt.active}`]:{...e.vars?{boxShadow:`0px 0px 0px 14px rgba(${e.vars.palette[t].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 14px ${zi(e.palette[t].main,.16)}`}}}}))]}))),Gf=pt(zf,{name:"MuiSlider",slot:"ValueLabel"})(Dr(({theme:e})=>({zIndex:1,whiteSpace:"nowrap",...e.typography.body2,fontWeight:500,transition:e.transitions.create(["transform"],{duration:e.transitions.duration.shortest}),position:"absolute",backgroundColor:(e.vars||e).palette.grey[600],borderRadius:2,color:(e.vars||e).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${bt.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${bt.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:e.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]})));process.env.NODE_ENV!=="production"&&(Gf.propTypes={children:x.element.isRequired,index:x.number.isRequired,open:x.bool.isRequired,value:x.node});const q5=pt("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>jl(e)&&e!=="markActive",overridesResolver:(e,t)=>{const{markActive:r}=e;return[t.mark,r&&t.markActive]}})(Dr(({theme:e})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(e.vars||e).palette.background.paper,opacity:.8}}]}))),W5=pt("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>jl(e)&&e!=="markLabelActive"})(Dr(({theme:e})=>({...e.typography.body2,color:(e.vars||e).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(e.vars||e).palette.text.primary}}]}))),J5=e=>{const{disabled:t,dragging:r,marked:n,orientation:o,track:a,classes:s,color:i,size:l}=e,c={root:["root",t&&"disabled",r&&"dragging",n&&"marked",o==="vertical"&&"vertical",a==="inverted"&&"trackInverted",a===!1&&"trackFalse",i&&`color${rt(i)}`,l&&`size${rt(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",l&&`thumbSize${rt(l)}`,i&&`thumbColor${rt(i)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return es(c,B5,s)},Y5=({children:e})=>e,Hf=F.forwardRef(function(t,r){const n=vc({props:t,name:"MuiSlider"}),o=hy(),{"aria-label":a,"aria-valuetext":s,"aria-labelledby":i,component:l="span",components:c={},componentsProps:u={},color:d="primary",classes:h,className:p,disableSwap:f=!1,disabled:m=!1,getAriaLabel:b,getAriaValueText:S,marks:E=!1,max:O=100,min:w=0,name:A,onChange:C,onChangeCommitted:T,orientation:V="horizontal",shiftStep:j=10,size:y="medium",step:R=1,scale:z=jh,slotProps:I,slots:G,tabIndex:oe,track:re="normal",value:te,valueLabelDisplay:ee="off",valueLabelFormat:se=jh,...H}=n,X={...n,isRtl:o,max:O,min:w,classes:h,disabled:m,disableSwap:f,orientation:V,marks:E,color:d,size:y,step:R,shiftStep:j,scale:z,track:re,valueLabelDisplay:ee,valueLabelFormat:se},{axisProps:le,getRootProps:xe,getHiddenInputProps:Le,getThumbProps:ae,open:be,active:Se,axis:me,focusedThumbIndex:Z,range:ie,dragging:de,marks:Y,values:we,trackOffset:ge,trackLeap:Ye,getThumbStyle:qe}=$5({...X,rootRef:r});X.marked=Y.length>0&&Y.some(Fe=>Fe.label),X.dragging=de,X.focusedThumbIndex=Z;const ke=J5(X),tr=(G==null?void 0:G.root)??c.Root??F5,Do=(G==null?void 0:G.rail)??c.Rail??z5,Lo=(G==null?void 0:G.track)??c.Track??G5,Bo=(G==null?void 0:G.thumb)??c.Thumb??H5,No=(G==null?void 0:G.valueLabel)??c.ValueLabel??Gf,zr=(G==null?void 0:G.mark)??c.Mark??q5,Fo=(G==null?void 0:G.markLabel)??c.MarkLabel??W5,Q=(G==null?void 0:G.input)??c.Input??"input",ne=(I==null?void 0:I.root)??u.root,ce=(I==null?void 0:I.rail)??u.rail,ye=(I==null?void 0:I.track)??u.track,Te=(I==null?void 0:I.thumb)??u.thumb,ue=(I==null?void 0:I.valueLabel)??u.valueLabel,We=(I==null?void 0:I.mark)??u.mark,tt=(I==null?void 0:I.markLabel)??u.markLabel,ze=(I==null?void 0:I.input)??u.input,mt=ar({elementType:tr,getSlotProps:xe,externalSlotProps:ne,externalForwardedProps:H,additionalProps:{...U5(tr)&&{as:l}},ownerState:{...X,...ne==null?void 0:ne.ownerState},className:[ke.root,p]}),kn=ar({elementType:Do,externalSlotProps:ce,ownerState:X,className:ke.rail}),ag=ar({elementType:Lo,externalSlotProps:ye,additionalProps:{style:{...le[me].offset(ge),...le[me].leap(Ye)}},ownerState:{...X,...ye==null?void 0:ye.ownerState},className:ke.track}),Ws=ar({elementType:Bo,getSlotProps:ae,externalSlotProps:Te,ownerState:{...X,...Te==null?void 0:Te.ownerState},className:ke.thumb}),sg=ar({elementType:No,externalSlotProps:ue,ownerState:{...X,...ue==null?void 0:ue.ownerState},className:ke.valueLabel}),Js=ar({elementType:zr,externalSlotProps:We,ownerState:X,className:ke.mark}),Ys=ar({elementType:Fo,externalSlotProps:tt,ownerState:X,className:ke.markLabel}),ig=ar({elementType:Q,getSlotProps:Le,externalSlotProps:ze,ownerState:X});return g.jsxs(tr,{...mt,children:[g.jsx(Do,{...kn}),g.jsx(Lo,{...ag}),Y.filter(Fe=>Fe.value>=w&&Fe.value<=O).map((Fe,Ke)=>{const Ks=Za(Fe.value,w,O),zo=le[me].offset(Ks);let Lt;return re===!1?Lt=we.includes(Fe.value):Lt=re==="normal"&&(ie?Fe.value>=we[0]&&Fe.value<=we[we.length-1]:Fe.value<=we[0])||re==="inverted"&&(ie?Fe.value<=we[0]||Fe.value>=we[we.length-1]:Fe.value>=we[0]),g.jsxs(F.Fragment,{children:[g.jsx(zr,{"data-index":Ke,...Js,...!Ta(zr)&&{markActive:Lt},style:{...zo,...Js.style},className:Pt(Js.className,Lt&&ke.markActive)}),Fe.label!=null?g.jsx(Fo,{"aria-hidden":!0,"data-index":Ke,...Ys,...!Ta(Fo)&&{markLabelActive:Lt},style:{...zo,...Ys.style},className:Pt(ke.markLabel,Ys.className,Lt&&ke.markLabelActive),children:Fe.label}):null]},Ke)}),we.map((Fe,Ke)=>{const Ks=Za(Fe,w,O),zo=le[me].offset(Ks),Lt=ee==="off"?Y5:No;return g.jsx(Lt,{...!Ta(Lt)&&{valueLabelFormat:se,valueLabelDisplay:ee,value:typeof se=="function"?se(z(Fe),Ke):se,index:Ke,open:be===Ke||Se===Ke||ee==="on",disabled:m},...sg,children:g.jsx(Bo,{"data-index":Ke,...Ws,className:Pt(ke.thumb,Ws.className,Se===Ke&&ke.active,Z===Ke&&ke.focusVisible),style:{...zo,...qe(Ke),...Ws.style},children:g.jsx(Q,{"data-index":Ke,"aria-label":b?b(Ke):a,"aria-valuenow":z(Fe),"aria-labelledby":i,"aria-valuetext":S?S(z(Fe),Ke):s,value:we[Ke],...ig})})},Ke)})]})});process.env.NODE_ENV!=="production"&&(Hf.propTypes={"aria-label":Ah(x.string,e=>Array.isArray(e.value||e.defaultValue)&&e["aria-label"]!=null?new Error("MUI: You need to use the `getAriaLabel` prop instead of `aria-label` when using a range slider."):null),"aria-labelledby":x.string,"aria-valuetext":Ah(x.string,e=>Array.isArray(e.value||e.defaultValue)&&e["aria-valuetext"]!=null?new Error("MUI: You need to use the `getAriaValueText` prop instead of `aria-valuetext` when using a range slider."):null),children:x.node,classes:x.object,className:x.string,color:x.oneOfType([x.oneOf(["primary","secondary","error","info","success","warning"]),x.string]),components:x.shape({Input:x.elementType,Mark:x.elementType,MarkLabel:x.elementType,Rail:x.elementType,Root:x.elementType,Thumb:x.elementType,Track:x.elementType,ValueLabel:x.elementType}),componentsProps:x.shape({input:x.oneOfType([x.func,x.object]),mark:x.oneOfType([x.func,x.object]),markLabel:x.oneOfType([x.func,x.object]),rail:x.oneOfType([x.func,x.object]),root:x.oneOfType([x.func,x.object]),thumb:x.oneOfType([x.func,x.object]),track:x.oneOfType([x.func,x.object]),valueLabel:x.oneOfType([x.func,x.shape({children:x.element,className:x.string,open:x.bool,style:x.object,value:x.node,valueLabelDisplay:x.oneOf(["auto","off","on"])})])}),defaultValue:x.oneOfType([x.arrayOf(x.number),x.number]),disabled:x.bool,disableSwap:x.bool,getAriaLabel:x.func,getAriaValueText:x.func,marks:x.oneOfType([x.arrayOf(x.shape({label:x.node,value:x.number.isRequired})),x.bool]),max:x.number,min:x.number,name:x.string,onChange:x.func,onChangeCommitted:x.func,orientation:x.oneOf(["horizontal","vertical"]),scale:x.func,shiftStep:x.number,size:x.oneOfType([x.oneOf(["small","medium"]),x.string]),slotProps:x.shape({input:x.oneOfType([x.func,x.object]),mark:x.oneOfType([x.func,x.object]),markLabel:x.oneOfType([x.func,x.object]),rail:x.oneOfType([x.func,x.object]),root:x.oneOfType([x.func,x.object]),thumb:x.oneOfType([x.func,x.object]),track:x.oneOfType([x.func,x.object]),valueLabel:x.oneOfType([x.func,x.shape({children:x.element,className:x.string,open:x.bool,style:x.object,value:x.node,valueLabelDisplay:x.oneOf(["auto","off","on"])})])}),slots:x.shape({input:x.elementType,mark:x.elementType,markLabel:x.elementType,rail:x.elementType,root:x.elementType,thumb:x.elementType,track:x.elementType,valueLabel:x.elementType}),step:x.number,sx:x.oneOfType([x.arrayOf(x.oneOfType([x.func,x.object,x.bool])),x.func,x.object]),tabIndex:x.number,track:x.oneOf(["inverted","normal",!1]),value:x.oneOfType([x.arrayOf(x.number),x.number]),valueLabelDisplay:x.oneOf(["auto","off","on"]),valueLabelFormat:x.oneOfType([x.func,x.string])});var K5="[object Number]";function Q5(e){return typeof e=="number"||Er(e)&&Lr(e)==K5}const qf=Oe.observer(e=>{var a,s,i;const t=P.useTheme(),{store:r}=e,{t:n}=_e.useTranslation();function o(l,c){c===e.velocity||!Q5(c)||e.onVelocityChange(c)}return g.jsxs(P.Stack,{direction:"row",gap:2,alignItems:"center",children:[r.showVelocityLegend&&g.jsx(P.Typography,{sx:{color:(i=(s=(a=t.componentsExt)==null?void 0:a.JoggingPanel)==null?void 0:s.VelocitySlider)==null?void 0:i.sliderLegendColor,fontSize:"14px"},children:n("Jogging.Velocity.bt")}),g.jsx(Hf,{value:e.velocity,color:"secondary",onChange:o,min:e.min,max:e.max,"aria-labelledby":"input-slider",disabled:e.disabled,sx:{"& .MuiSlider-valueLabelOpen":{zIndex:100,backgroundColor:"transparent",top:"0px"}}}),r.showVelocitySliderLabel&&(e.renderValue?e.renderValue(e.velocity):g.jsx(Ec,{value:e.velocity.toString()}))]})});function Ec({value:e,sx:t}){var n;const r=P.useTheme();return g.jsx(P.Stack,{direction:"row",justifyContent:"center",alignItems:"center",gap:"5px",sx:{padding:"6px 12px",background:(n=r.palette.backgroundPaperElevation)==null?void 0:n[8],borderRadius:"10px",minWidth:"111px",...t},children:g.jsx(P.Typography,{component:"span",sx:{textAlign:"right",fontSize:"14px",opacity:.8,color:r.palette.text.primary,whiteSpace:"nowrap"},children:e})})}const Wf=Oe.observer(({store:e})=>{const{t}=_e.useTranslation(),r=Oe.useLocalObservable(()=>({get valueLabelFormat(){return e.currentMotionType==="translate"?n=>`v = ${t("Jogging.Cartesian.Translation.velocityMmPerSec.lb",{amount:n})}`:n=>`ω = ${t("Jogging.Cartesian.Rotation.velocityDegPerSec.lb",{amount:n})}`}}));return g.jsx(qf,{store:e,velocity:e.velocityInDisplayUnits,min:e.minVelocityInDisplayUnits,max:e.maxVelocityInDisplayUnits,onVelocityChange:e.setVelocityFromSlider,disabled:e.isLocked,renderValue:n=>g.jsx(Ec,{value:r.valueLabelFormat(n),sx:{minWidth:"111px",span:{transform:"translateY(-1.5px)"}}})})}),X5=Oe.observer(({store:e,children:t})=>{const{t:r}=_e.useTranslation(),n=P.useTheme();function o(h,p){(p==="translate"||p==="rotate")&&e.setSelectedCartesianMotionType(p)}_m(()=>[e.selectedCoordSystemId,e.selectedTcpId],()=>{e.jogger.motionStream.motionStateSocket.changeUrl(e.jogger.nova.makeWebsocketURL(`/motion-groups/${e.jogger.motionGroupId}/state-stream?tcp=${e.selectedTcpId}&response_coordinate_system=${e.selectedCoordSystemId}`))},{fireImmediately:!0});async function a(h,p){const f=await e.activate(),m=f.motionStream.rapidlyChangingMotionState.tcp_pose,b=f.motionStream.rapidlyChangingMotionState.state.joint_position;m&&await e.withMotionLock(async()=>{try{e.setCurrentIncrementJog({axis:h.axis,direction:h.direction}),await e.jogger.runIncrementalCartesianMotion({currentTcpPose:m,currentJoints:b,coordSystemId:e.activeCoordSystemId,velocityInRelevantUnits:e.selectedCartesianMotionType==="translate"?e.translationVelocityMmPerSec:e.rotationVelocityRadsPerSec,axis:h.axis,direction:h.direction,motion:e.selectedCartesianMotionType==="translate"?{type:"translate",distanceMm:p.mm}:{type:"rotate",distanceRads:Cr.degreesToRadians(p.degrees)}})}finally{e.setCurrentIncrementJog(null),await e.deactivate()}})}async function s(h){if(!e.isLocked){if(await e.activate(),e.activeDiscreteIncrement)return a(h,e.activeDiscreteIncrement);h.motionType==="translate"?await e.jogger.startTCPTranslation({axis:h.axis,direction:h.direction,velocityMmPerSec:e.translationVelocityMmPerSec}):await e.jogger.startTCPRotation({axis:h.axis,direction:h.direction,velocityRadsPerSec:e.rotationVelocityRadsPerSec})}}async function i(){e.isLocked||e.activeDiscreteIncrement||await e.deactivate()}function l(h,p,f){var b,S,E;const m=(E=(S=(b=f.componentsExt)==null?void 0:b.JoggingPanel)==null?void 0:S.JoggingCartesian)==null?void 0:E.Axis;if(m)return p==="translate"?m[h]:m.CustomRotation??m[h]}const c=[{id:"x",icon:g.jsx(eI,{}),colors:l("X",e.selectedCartesianMotionType,n)},{id:"y",icon:g.jsx(rI,{}),colors:l("Y",e.selectedCartesianMotionType,n)},{id:"z",icon:g.jsx(oI,{}),colors:l("Z",e.selectedCartesianMotionType,n)}];function u(h){return r("General.mm.variable",{amount:h.toFixed(1)})}function d(h){return r("General.degree.variable",{amount:Cr.radiansToDegrees(h).toFixed(1)})}return g.jsxs(P.Stack,{flexGrow:1,gap:2,sx:{padding:"18px 24px"},children:[g.jsxs(P.Stack,{gap:2,children:[g.jsx(O5,{store:e}),g.jsx(Wf,{store:e}),g.jsx(P.Divider,{})]}),g.jsx(P.Stack,{marginLeft:"auto",marginRight:"auto",gap:"24px",justifyContent:"center",sx:{flexGrow:"1"},children:g.jsxs(P.Stack,{alignItems:"center",justifyContent:"center",gap:"24px",sx:{flexGrow:1},children:[g.jsxs(w5,{value:e.selectedCartesianMotionType,onChange:o,exclusive:!0,"aria-label":r("Jogging.Cartesian.MotionType.lb"),sx:{justifyContent:"center"},children:[g.jsx(P.ToggleButton,{value:"translate",children:r("Jogging.Cartesian.Translation.bt")}),g.jsx(P.ToggleButton,{value:"rotate",children:r("Jogging.Cartesian.Rotation.bt")})]}),e.selectedCartesianMotionType==="translate"&&c.map(h=>{var p,f;return g.jsx(ol,{colors:h.colors,disabled:e.isLocked,activeJoggingDirection:((p=e.incrementJogInProgress)==null?void 0:p.axis)===h.id?e.incrementJogInProgress.direction:void 0,label:g.jsxs(g.Fragment,{children:[h.icon,g.jsx(P.Typography,{sx:{fontSize:"24px",color:((f=h.colors)==null?void 0:f.labelColor)??n.palette.text.primary},children:h.id.toUpperCase()})]}),getDisplayedValue:()=>{var m;return u(((m=e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose)==null?void 0:m.position[h.id])||0)},startJogging:m=>s({axis:h.id,motionType:"translate",direction:m}),stopJogging:i},h.id)}),e.selectedCartesianMotionType==="rotate"&&c.map(h=>{var p,f;return g.jsx(ol,{colors:h.colors,disabled:e.isLocked,activeJoggingDirection:((p=e.incrementJogInProgress)==null?void 0:p.axis)===h.id?e.incrementJogInProgress.direction:void 0,label:g.jsxs(g.Fragment,{children:[g.jsx(sI,{}),g.jsx(P.Typography,{sx:{fontSize:"24px",color:((f=h.colors)==null?void 0:f.labelColor)??n.palette.text.primary},children:h.id.toUpperCase()})]}),getDisplayedValue:()=>{var m,b;return d(((b=(m=e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose)==null?void 0:m.orientation)==null?void 0:b[h.id])||0)},startJogging:m=>s({axis:h.id,motionType:"rotate",direction:m}),stopJogging:i},h.id)})]})}),g.jsx(kf,{store:e}),t&&g.jsx(P.Divider,{}),t]})}),Z5=Oe.observer(({store:e,children:t})=>{const r=P.useTheme();async function n(a){await e.activate(),await e.jogger.startJointRotation({joint:a.joint,direction:a.direction,velocityRadsPerSec:e.rotationVelocityRadsPerSec})}async function o(){await e.jogger.stop(),await e.deactivate()}return g.jsxs(P.Stack,{flexGrow:1,gap:2,sx:{padding:"18px 24px"},children:[g.jsx(Wf,{store:e}),g.jsx(P.Divider,{}),g.jsx(P.Stack,{justifyContent:"center",alignItems:"stretch",sx:{flexGrow:"1"},id:"JointControls",children:g.jsx(P.Stack,{alignItems:"center",gap:"24px",children:e.jogger.motionStream.joints.map(a=>{var c;const s=(c=e.motionGroupSpec.mechanical_joint_limits)==null?void 0:c[a.index],i=(s==null?void 0:s.lower_limit)!==void 0?Cr.radiansToDegrees(s.lower_limit):void 0,l=(s==null?void 0:s.upper_limit)!==void 0?Cr.radiansToDegrees(s.upper_limit):void 0;return g.jsxs(P.Stack,{direction:"row",alignItems:"center",justifyContent:"center",spacing:1.5,width:"100%",children:[e.showJointsLegend&&g.jsx(P.Typography,{color:e.isLocked?r.palette.text.disabled:r.palette.text.secondary,children:`G${a.index+1}`}),g.jsx(Vm,{disabled:e.isLocked,lowerLimitDegs:i,upperLimitDegs:l,getValueDegs:()=>{const u=e.jogger.motionStream.rapidlyChangingMotionState.state.joint_position.joints[a.index];return u!==void 0?Cr.radiansToDegrees(u):void 0},startJogging:u=>n({joint:a.index,direction:u}),stopJogging:o})]},`joint-${a.index}`)})})}),g.jsx(kf,{store:e}),t&&g.jsx(P.Divider,{}),t]})}),e3=Xe(Oe.observer(e=>{const t=Al.isString(e.nova)?new Y2({instanceUrl:e.nova}):e.nova,r=Oe.useLocalObservable(()=>({joggingStore:null,loadingError:null}));async function n(){$e.runInAction(()=>{r.loadingError=null,r.joggingStore=null});try{let o=e.store;if(!o){const a=await t.connectJogger(e.motionGroupId);o=await qs.loadFor(a)}$e.runInAction(()=>{r.joggingStore=o}),e.onSetup&&e.onSetup(o)}catch(o){r.loadingError=o}}return J.useEffect(()=>(n(),e.store?()=>null:()=>{var o;(o=r.joggingStore)==null||o.dispose()}),[e.store,e.nova,e.motionGroupId]),J.useEffect(()=>{const o=r.joggingStore;o&&(e.locked?o.lock("external"):o.unlock("external"))},[r.joggingStore,e.locked]),g.jsx(P.Stack,{sx:{maxWidth:"460px",minWidth:"320px",position:"relative",...e.sx},children:r.joggingStore?g.jsx(t3,{store:r.joggingStore,children:e.children}):g.jsx(Cc,{message:"Loading jogging",error:r.loadingError})})})),t3=Oe.observer(({store:e,children:t})=>{const{t:r}=_e.useTranslation();function n(){if(e.currentTab.id==="cartesian")return g.jsx(g.Fragment,{children:g.jsx(X5,{store:e,children:t})});if(e.currentTab.id==="joint")return g.jsx(g.Fragment,{children:g.jsx(Z5,{store:e,children:t})})}return g.jsxs(P.Stack,{flexGrow:1,sx:{overflow:"hidden"},children:[g.jsx(P.Tabs,{value:e.tabIndex,onChange:e.onTabChange,variant:"fullWidth",children:e.tabs.map(o=>{const a=o.label==="cartesian"?r("Jogging.Cartesian.bt"):r("Jogging.Joints.bt"),s=o.label==="cartesian"?g.jsx(AC,{fontSize:"small",sx:{mr:1}}):g.jsx(_C,{fontSize:"small",sx:{mr:1}});return g.jsx(P.Tab,{label:e.showTabIcons?g.jsxs(P.Stack,{direction:"row",alignItems:"center",children:[s,a]}):a,id:`jogging-tab-${o.id}`,"aria-controls":`jogging-tab-${o.id}`},o.id)})}),g.jsx(P.Stack,{flexGrow:1,position:"relative",sx:{overflowY:"auto",overflowX:"hidden"},children:n()})]})}),Jf=e=>{var i;const{value:t,ref:r}=e,n=P.useTheme(),[o,a]=J.useState(!1);async function s(){if(!r||!("current"in r))return console.warn("No copy target found"),!1;try{return await navigator.clipboard.writeText(t),console.log("Copied!"),a(!0),!0}catch(l){console.error(l);const c=window.getSelection();if(c&&r&&"current"in r&&r.current){const u=document.createRange();u.selectNodeContents(r.current),c.removeAllRanges(),c.addRange(u)}}return!1}return J.useEffect(()=>{if(!o)return;const l=setTimeout(()=>a(!1),3e3);return()=>{l&&clearTimeout(l)}},[o]),g.jsx(P.Tooltip,{open:o,title:"Copied!",children:g.jsx(P.Stack,{justifyContent:"center",sx:{height:"100%",boxSizing:"border-box",padding:"6px 12px",background:(i=n.palette.backgroundPaperElevation)==null?void 0:i[8],borderRadius:"10px",minWidth:"0",cursor:"pointer"},onClick:()=>s(),children:g.jsx(P.Typography,{ref:r,align:"center",sx:{pointerEvents:"none",fontSize:"12px",color:n.palette.text.primary,whiteSpace:"nowrap",minWidth:0,textOverflow:"ellipsis",width:"100%",overflow:"hidden"},children:t})})})},r3=Oe.observer(({motionStream:e})=>{const t=J.useRef(null);function r(){const n=e.rapidlyChangingMotionState.tcp_pose;return n?Cr.poseToWandelscriptString(n):""}return Rn(()=>{if(!t.current)return;const n=r();t.current.textContent!==n&&(t.current.textContent=n)}),g.jsx(P.Stack,{alignItems:"left",spacing:2,sx:{flexGrow:1,minWidth:0,overflow:"hidden"},children:g.jsx(Jf,{value:r(),ref:t})})}),n3=Oe.observer(({motionStream:e})=>{const t=J.useRef(null);function r(){const{joints:n}=e.rapidlyChangingMotionState.state.joint_position;return`[${n.map(o=>parseFloat(o.toFixed(4))).join(", ")}]`}return Rn(()=>{if(!t.current)return;const n=r();t.current.textContent!==n&&(t.current.textContent=n)}),g.jsx(P.Stack,{alignItems:"left",spacing:2,sx:{flexGrow:1,minWidth:0,overflow:"hidden"},children:g.jsx(Jf,{value:r(),ref:t})})});class Yf{constructor(){this.messages=[],this.addMessage=(t,r="info")=>{const n={id:Math.random().toString(36).substring(2,11),timestamp:new Date,message:t,level:r};this.messages.push(n)},this.clearMessages=()=>{this.messages=[]},this.addInfo=t=>{this.addMessage(t,"info")},this.addWarning=t=>{this.addMessage(t,"warning")},this.addError=t=>{this.addMessage(t,"error")},this.addDebug=t=>{this.addMessage(t,"debug")},$e.makeObservable(this,{messages:$e.observable,addMessage:$e.action,clearMessages:$e.action})}}const Uo=(e,t,r)=>({id:r||`${Date.now()}-${Math.random().toString(36).substring(2,11)}`,timestamp:new Date,message:e,level:t}),o3=(e,t)=>Uo(e,"debug",t),a3=(e,t)=>Uo(e,"info",t),s3=(e,t)=>Uo(e,"warning",t),i3=(e,t)=>Uo(e,"error",t),Kf=Xe(Oe.observer(e=>{var u;const{messages:t=[],onClear:r,height:n=400,sx:o}=e,a=P.useTheme(),s=J.useRef(null);J.useEffect(()=>{if(t.length===0)return;const d=s.current;if(!d)return;const h=setTimeout(()=>{d.scrollTop=d.scrollHeight},10);return()=>clearTimeout(h)},[t.length]);const i=d=>d.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),l=d=>{switch(d){case"error":return a.palette.error.main;case"warning":return a.palette.warning.main;case"info":return a.palette.info.main;case"debug":return a.palette.text.disabled;default:return a.palette.text.secondary}},c=({message:d})=>{const[h,p]=J.useState(!1),[f,m]=J.useState(!1),[b,S]=J.useState(!1),E=d.message.length>150,O=async()=>{try{await navigator.clipboard.writeText(d.message),m(!0),setTimeout(()=>m(!1),2e3)}catch(A){console.error("Failed to copy message:",A)}},w=E&&!h?d.message.substring(0,150)+"...":d.message;return g.jsx(P.Box,{onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),sx:{display:"flex",gap:1,fontFamily:"monospace",flexDirection:"column","&:hover":{backgroundColor:a.palette.action.hover},borderRadius:"4px",padding:"2px 4px",margin:"-2px -4px"},children:g.jsxs(P.Box,{sx:{display:"flex",gap:1},children:[g.jsxs(P.Typography,{component:"span",sx:{fontWeight:400,fontSize:"12px",lineHeight:"18px",letterSpacing:"0.4px",color:a.palette.text.disabled,whiteSpace:"nowrap",flexShrink:0},children:["[",i(d.timestamp),"]"]}),g.jsx(P.Typography,{component:"span",sx:{fontWeight:400,fontSize:"12px",lineHeight:"18px",letterSpacing:"0.4px",color:l(d.level),wordBreak:"break-word",overflowWrap:"anywhere",hyphens:"auto",flex:1,whiteSpace:"pre-wrap"},children:w}),g.jsxs(P.Box,{sx:{display:"flex",alignItems:"flex-start",gap:.5,opacity:b?1:0,transition:"opacity 0.2s ease-in-out",visibility:b?"visible":"hidden"},children:[g.jsx(P.IconButton,{size:"small",onClick:O,sx:{padding:"2px",color:a.palette.text.secondary,"&:hover":{backgroundColor:a.palette.action.hover}},title:f?"Copied!":"Copy message",children:g.jsx(Ft.ContentCopy,{sx:{fontSize:12}})}),E&&g.jsx(P.IconButton,{size:"small",onClick:()=>p(!h),sx:{padding:"2px",color:a.palette.text.secondary,"&:hover":{backgroundColor:a.palette.action.hover}},title:h?"Collapse":"Expand",children:h?g.jsx(Ft.ExpandLess,{sx:{fontSize:12}}):g.jsx(Ft.ExpandMore,{sx:{fontSize:12}})})]})]})},d.id)};return g.jsxs(P.Paper,{sx:{backgroundColor:((u=a.palette.backgroundPaperElevation)==null?void 0:u[2])||"#171927",backgroundImage:"none",height:n,display:"flex",flexDirection:"column",overflow:"hidden",...o},children:[g.jsxs(P.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px"},children:[g.jsxs(P.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[g.jsx(Ft.DescriptionOutlined,{sx:{fontSize:16,color:a.palette.action.active,opacity:.56}}),g.jsx(P.Typography,{sx:{fontWeight:500,fontSize:"14px",lineHeight:"143%",letterSpacing:"0.17px",color:a.palette.text.primary},children:"Log"})]}),g.jsx(P.Button,{onClick:r,variant:"text",sx:{fontWeight:500,fontSize:"13px",lineHeight:"22px",letterSpacing:"0.46px",color:a.palette.primary.main,textTransform:"none",minWidth:"auto",padding:"4px 8px","&:hover":{backgroundColor:a.palette.primary.main+"14"}},children:"Clear"})]}),g.jsx(P.Box,{ref:s,sx:{flex:1,overflow:"auto",padding:"8px 16px",display:"flex",flexDirection:"column",gap:"2px",scrollbarWidth:"thin",scrollbarColor:`${a.palette.divider} transparent`,"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:a.palette.divider,borderRadius:"3px","&:hover":{backgroundColor:a.palette.divider}}},children:t.length===0?g.jsx(P.Typography,{sx:{color:a.palette.text.disabled,fontSize:"12px",fontStyle:"italic",textAlign:"center",marginTop:2},children:"No log messages"}):t.map(d=>g.jsx(c,{message:d},d.id))})]})})),l3=Xe(Oe.observer(e=>{const{store:t,onStoreReady:r,...n}=e,o=J.useRef(r);J.useEffect(()=>{o.current=r},[r]);const a=J.useMemo(()=>{var l;const i=t||new Yf;return(l=o.current)==null||l.call(o,i),i},[t]),s=()=>{a.clearMessages()};return g.jsx(Kf,{...n,messages:a.messages,onClear:s})}));function c3(){const e=window.location.href;return e.substring(0,e.indexOf("/",e.indexOf("//")+2))}function u3({baseUrl:e=c3(),...t}){return g.jsxs(P.Dialog,{"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:[g.jsx(P.DialogTitle,{id:"no-motion-group-modal-title",children:"No motion group found"}),g.jsxs(P.DialogContent,{sx:{marginTop:"3rem",marginBottom:"1.5rem",textAlign:"center"},children:[g.jsx(P.Typography,{color:"#fff",children:"Found no devices to connect to."}),g.jsx(P.Typography,{color:"#fff",children:"Please ensure a motion group has been created."})]}),g.jsx(P.DialogActions,{children:g.jsxs(P.Stack,{width:"100%",maxWidth:"300px",margin:"auto",marginBottom:"2rem",children:[g.jsx(P.Button,{href:`${e}/settings`,variant:"contained",sx:{borderRadius:"8px",width:"100%"},children:"Go to settings app"}),g.jsx(P.Button,{href:`${e}`,variant:"text",sx:{marginTop:"1rem",color:"#fff",textDecoration:"underline",fontSize:"0.75rem"},children:"Back to Homescreen"})]})})]})}var vr=(e=>(e.IDLE="idle",e.RUNNING="running",e.PAUSED="paused",e.STOPPING="stopping",e.ERROR="error",e))(vr||{});const d3=Xe(Oe.observer(({state:e,onRun:t,onPause:r,onStop:n,onReset:o,requiresManualReset:a=!1,variant:s="with_pause",className:i})=>{const l=P.useTheme(),{t:c}=_e.useTranslation(),u=()=>{const p={run:{enabled:e==="idle"||e==="paused"||e==="error",label:c(e==="paused"?"ProgramControl.Resume.bt":e==="error"?"ProgramControl.Retry.bt":"ProgramControl.Start.bt"),color:l.palette.success.main,onClick:t},pause:{enabled:e==="running",label:c("ProgramControl.Pause.bt"),color:"#FFFFFF33",onClick:r||(()=>{})},stop:{enabled:e==="running"||e==="paused",label:c("ProgramControl.Stop.bt"),color:l.palette.error.main,onClick:n}};return s==="without_pause"?[p.run,p.stop]:[p.run,p.pause,p.stop]},d=p=>{const f={sx:{fontSize:"55px"}};if(s==="without_pause")return p===0?g.jsx(Ft.PlayArrow,{...f}):g.jsx(Ft.Stop,{...f});switch(p){case 0:return g.jsx(Ft.PlayArrow,{...f});case 1:return g.jsx(Ft.Pause,{...f});case 2:return g.jsx(Ft.Stop,{...f});default:return null}},h=u();return g.jsx(P.Box,{className:i,sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:g.jsx(P.Box,{sx:{display:"flex",gap:"40px",flexWrap:"wrap",justifyContent:"center",alignItems:"center"},children:h.map((p,f)=>g.jsxs(P.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1},children:[g.jsx(P.Button,{variant:"contained",disabled:!p.enabled||e==="stopping"&&!a,onClick:p.onClick,sx:{width:"88px",height:"88px",borderRadius:"88px",backgroundColor:p.color,opacity:p.enabled&&!(e==="stopping"&&!a)?1:.3,"&:hover":{backgroundColor:p.color,opacity:p.enabled&&!(e==="stopping"&&!a)?.8:.3},"&:disabled":{backgroundColor:p.color,opacity:.3},minWidth:"88px",flexShrink:0},children:d(f)}),g.jsx(P.Typography,{variant:"body1",sx:{color:p.enabled&&!(e==="stopping"&&!a)?p.color:l.palette.text.disabled,textAlign:"center",opacity:p.enabled&&!(e==="stopping"&&!a)?1:.3},children:p.label})]},p.label))})})})),Tl=Xe(Oe.observer(({programState:e,safetyState:t,operationMode:r,className:n})=>{const o=P.useTheme(),{t:a}=_e.useTranslation(),s=()=>{if(t==="SAFETY_STATE_DEVICE_EMERGENCY_STOP"||t==="SAFETY_STATE_ROBOT_EMERGENCY_STOP"||t==="SAFETY_STATE_STOP_0"||t==="SAFETY_STATE_STOP_1"||t==="SAFETY_STATE_STOP_2"||t==="SAFETY_STATE_PROTECTIVE_STOP"||t==="SAFETY_STATE_STOP"||t==="SAFETY_STATE_REDUCED"||t==="SAFETY_STATE_MASTERING"||t==="SAFETY_STATE_CONFIRM_SAFETY"||t==="SAFETY_STATE_OPERATOR_SAFETY"||t==="SAFETY_STATE_RECOVERY"||t==="SAFETY_STATE_VIOLATION")return{label:a("ProgramStateIndicator.EStop.lb"),color:o.palette.error.main};if(t==="SAFETY_STATE_UNKNOWN"||t==="SAFETY_STATE_FAULT")return{label:a("ProgramStateIndicator.Error.lb"),color:o.palette.error.main};if(t==="SAFETY_STATE_NORMAL")switch(e){case vr.RUNNING:return{label:a("ProgramStateIndicator.Running.lb"),color:o.palette.success.main};case vr.PAUSED:return{label:a("ProgramStateIndicator.Paused.lb"),color:o.palette.grey[600]};case vr.STOPPING:return{label:a("ProgramStateIndicator.Stopped.lb"),color:o.palette.error.main};case vr.ERROR:return{label:a("ProgramStateIndicator.Error.lb"),color:o.palette.error.main};case vr.IDLE:default:return{label:a("ProgramStateIndicator.Ready.lb"),color:o.palette.success.main}}return{label:a("ProgramStateIndicator.Idle.lb"),color:o.palette.grey[600]}},{label:i,color:l}=s(),u=`${i} / ${(()=>{switch(r){case"OPERATION_MODE_AUTO":return a("ProgramStateIndicator.Auto.lb");case"OPERATION_MODE_MANUAL":return a("ProgramStateIndicator.Manual.lb");case"OPERATION_MODE_MANUAL_T1":return a("ProgramStateIndicator.ManualT1.lb");case"OPERATION_MODE_MANUAL_T2":return a("ProgramStateIndicator.ManualT2.lb");default:return a("ProgramStateIndicator.Auto.lb")}})()}`;return g.jsx(P.Chip,{className:n,label:g.jsx(P.Typography,{variant:"body2",sx:{fontSize:"0.75rem",lineHeight:1.2},children:u}),variant:"filled",sx:{backgroundColor:l,color:o.palette.getContrastText(l),fontWeight:500,height:"auto","& .MuiChip-label":{paddingX:1.5,paddingY:.5}}})})),kh="0.0.0-semantically-released";function Ic(e){let t=kh;return kh.startsWith("0.")&&(t=""),`https://cdn.jsdelivr.net/gh/wandelbotsgmbh/wandelbots-js-react-components${t?`@${t}`:""}/public/models/${e}.glb`}function h3(e){function t(r){return r.children.length===0?[r]:[r,...r.children.flatMap(n=>t(n))]}return t(e).filter(r=>Xf(r))}function Qf(e){return e.name.endsWith("_FLG")}function Xf(e){return/_J[0-9]+$/.test(e.name)}function p3(e,t){let r;function n(o){if(Qf(o)){if(r)throw Error(`Found multiple flange groups in robot model ${t}; first ${r.name} then ${o.name}. Only one _FLG group is allowed.`);r=o}Xf(o),o.children.map(n)}if(n(e.scene),!r)throw Error(`No flange group found in robot model ${t}. Flange must be identified with a name ending in _FLG.`);return{gltf:e}}function Zf({rapidlyChangingMotionState:e,dhParameters:t,onRotationChanged:r,children:n}){const o=J.useRef([]),a=J.useRef([]),s=J.useRef(null),{invalidate:i}=Ra.useThree();J.useEffect(()=>{const d=e.state.joint_position.joints.filter(h=>h!==void 0);return s.current=new xc(d,{tension:120,friction:20,threshold:.001}),()=>{var h;(h=s.current)==null||h.destroy()}},[]),Ra.useFrame((d,h)=>{if(s.current){const p=s.current.update(h);u(),p||i()}});function l(d){d&&(a.current=h3(d),u(),i())}function c(d){var h;o.current=d,(h=s.current)==null||h.setTarget(d)}function u(){var h;const d=((h=s.current)==null?void 0:h.getCurrentValues())||[];if(r)r(a.current,d);else for(const[p,f]of a.current.entries()){const m=t[p],b=m.theta||0,S=m.reverse_rotation_direction?-1:1;f.rotation.y=S*(d[p]||0)+b}}return Am(()=>{const d=e.state.joint_position.joints.filter(h=>h!==void 0);requestAnimationFrame(()=>c(d))}),g.jsx("group",{ref:l,children:n})}const m3="line",f3="mesh";function g3({rapidlyChangingMotionState:e,dhParameters:t,...r}){const n=new Ot.Matrix4,o=J.useRef([]),a=J.useRef([]);J.useEffect(()=>{o.current=new Array(t.length).fill(null),a.current=new Array(t.length).fill(null)},[t.length]);function s(c,u){const d=new Ot.Vector3,h=new Ot.Quaternion,p=new Ot.Vector3;n.decompose(d,h,p);const f=d.clone(),m=new Ot.Matrix4().makeRotationY(c.theta+u*(c.reverse_rotation_direction?-1:1)).multiply(new Ot.Matrix4().makeTranslation(0,c.d/1e3,0)).multiply(new Ot.Matrix4().makeTranslation(c.a/1e3,0,0)).multiply(new Ot.Matrix4().makeRotationX(c.alpha));return n.multiply(m),n.decompose(d,h,p),{a:f,b:d}}function i(c,u,d,h){if(!t)return;const p=t[c];if(!p)return;const{a:f,b:m}=s(p,h);u.geometry.setPositions([f.toArray(),m.toArray()].flat()),d.position.set(m.x,m.y,m.z)}function l(c,u){n.identity();for(let d=0;d<Math.min(c.length,u.length);d++){const h=o.current[d],p=a.current[d];h&&p&&i(d,h,p,u[d])}}return g.jsx(g.Fragment,{children:g.jsx(Zf,{rapidlyChangingMotionState:e,dhParameters:t,onRotationChanged:l,children:g.jsxs("group",{...r,name:"Scene",children:[g.jsxs("mesh",{children:[g.jsx("sphereGeometry",{args:[.01,32,32]}),g.jsx("meshStandardMaterial",{color:"black",depthTest:!0})]}),t.map((c,u)=>{const{a:d,b:h}=s(c,e.state.joint_position.joints[u]??0),p=`dhrobot_J0${u}`;return g.jsxs("group",{name:p,children:[g.jsx(ut.Line,{ref:f=>{o.current[u]=f},name:m3,points:[d,h],color:"white",lineWidth:5}),g.jsxs("mesh",{ref:f=>{a.current[u]=f},name:f3,position:h,children:[g.jsx("sphereGeometry",{args:[.01,32,32]}),g.jsx("meshStandardMaterial",{color:"black",depthTest:!0})]},"mesh_"+u)]},p)})]})})})}const y3=console.warn;function b3(){return J.useEffect(()=>{console.warn=e=>{e!=="Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"&&y3(e)}},[]),g.jsx(g.Fragment,{})}function x3(e){return e.type==="Mesh"}function v3({modelURL:e,flangeRef:t,postModelRender:r,...n}){const{gltf:o}=p3(ut.useGLTF(e),e.split("/").pop()||e),a=J.useCallback(i=>{i&&r&&r()},[e]);function s(i){return x3(i)?g.jsx("mesh",{name:i.name,geometry:i.geometry,material:i.material,position:i.position,rotation:i.rotation},i.uuid):g.jsx("group",{name:i.name,position:i.position,rotation:i.rotation,ref:Qf(i)?t:void 0,children:i.children.map(s)},i.uuid)}return g.jsx("group",{...n,dispose:null,ref:a,children:s(o.scene)})}const S3=(e,t)=>{e.userData.isGhost||(e.traverse(r=>{if(r instanceof Be.Mesh){r.material instanceof Be.Material&&(r.material.colorWrite=!1);const n=r.clone(),o=r.clone();n.material=new Be.MeshStandardMaterial({depthTest:!0,depthWrite:!0,colorWrite:!1,polygonOffset:!0,polygonOffsetFactor:-1,side:Be.DoubleSide}),n.userData.isGhost=!0,o.material=new Be.MeshStandardMaterial({color:t,opacity:.3,depthTest:!0,depthWrite:!1,transparent:!0,polygonOffset:!0,polygonOffsetFactor:-2,side:Be.DoubleSide}),o.userData.isGhost=!0,r.parent&&(r.parent.add(n),r.parent.add(o))}}),e.userData.isGhost=!0)},O3=e=>{if(!e.userData.isGhost)return;const t=[];e.traverse(r=>{var n;r instanceof Be.Mesh&&((n=r.userData)!=null&&n.isGhost?t.push(r):r.material instanceof Be.Material&&(r.material.colorWrite=!0))}),t.forEach(r=>{r.parent&&r.parent.remove(r)}),e.userData.isGhost=!1},eg=Xe(({rapidlyChangingMotionState:e,modelFromController:t,dhParameters:r,getModel:n=Ic,flangeRef:o,postModelRender:a,transparentColor:s,...i})=>{const[l,c]=J.useState(null),u=J.useCallback(h=>{c(h)},[]);J.useEffect(()=>{l&&(s?S3(l,s):O3(l))},[l,s]);const d=g.jsx(g3,{rapidlyChangingMotionState:e,dhParameters:r,...i});return g.jsxs(vg.ErrorBoundary,{fallback:d,onError:h=>{console.error(h)},children:[g.jsx(J.Suspense,{fallback:d,children:g.jsx("group",{ref:u,children:g.jsx(Zf,{rapidlyChangingMotionState:e,dhParameters:r,children:g.jsx(v3,{modelURL:n(t),postModelRender:a,flangeRef:o,...i})})})}),g.jsx(b3,{})]})});function tg({connectedMotionGroup:e,getModel:t=Ic,flangeRef:r,transparentColor:n,postModelRender:o,...a}){return e.dhParameters?g.jsx(eg,{rapidlyChangingMotionState:e.rapidlyChangingMotionState,modelFromController:e.modelFromController||"",dhParameters:e.dhParameters,getModel:t,flangeRef:r,transparentColor:n,postModelRender:o,...a}):null}const w3=Xe(Oe.observer(({robotName:e,programState:t,safetyState:r,operationMode:n,driveToHomeEnabled:o=!1,onDriveToHomePress:a,onDriveToHomeRelease:s,connectedMotionGroup:i,robotComponent:l=tg,cycleTimerComponent:c=Tm,onCycleTimerReady:u,onCycleEnd:d,cycleTimerAutoStart:h=!0,cycleTimerHasError:p=!1,className:f})=>{var se;const m=P.useTheme(),{t:b}=_e.useTranslation(),[S,E]=J.useState(!1),O=J.useRef(null),w=J.useRef(null),[A,C]=J.useState(!1),[T,V]=J.useState({width:400,height:600}),[j,y]=J.useState(0),R=J.useRef(null);J.useEffect(()=>{const H=()=>{if(w.current){const{offsetWidth:le,offsetHeight:xe}=w.current;C(le>xe),V({width:le,height:xe})}};H();const X=new ResizeObserver(H);return w.current&&X.observe(w.current),()=>{X.disconnect()}},[]);const z=J.useCallback(()=>{y(H=>H+1)},[]),I=J.useCallback(()=>{!o||!a||(E(!0),a())},[o,a]),G=J.useCallback(()=>{!o||!s||(E(!1),s())},[o,s]),oe=J.useCallback(()=>{S&&s&&(E(!1),s())},[S,s]),re=J.useCallback(H=>{R.current=H,u&&u(H)},[u]),te=A?T.width<350:T.height<200,ee=A?T.height<310:T.height<450;return g.jsx(P.Card,{ref:w,className:f,sx:{width:"100%",height:"100%",display:"flex",flexDirection:A?"row":"column",position:"relative",overflow:"hidden",minWidth:{xs:180,sm:220,md:250},minHeight:A?{xs:200,sm:240,md:260}:{xs:150,sm:180,md:220},border:`1px solid ${m.palette.divider}`,borderRadius:"18px",boxShadow:"none",backgroundColor:((se=m.palette.backgroundPaperElevation)==null?void 0:se[8])||"#2A2A3F",backgroundImage:"none"},children:A?g.jsxs(g.Fragment,{children:[g.jsx(P.Box,{sx:{flex:"0 0 50%",position:"relative",height:"100%",minHeight:"100%",maxHeight:"100%",borderRadius:1,m:{xs:1.5,sm:2,md:3},mr:{xs:.75,sm:1,md:1.5},overflow:"hidden",display:te?"none":"block"},children:!te&&g.jsxs(Ra.Canvas,{orthographic:!0,camera:{position:[3,2,3],zoom:1},shadows:!0,frameloop:"demand",style:{borderRadius:m.shape.borderRadius,width:"100%",height:"100%",background:"transparent",position:"absolute",top:0,left:0},dpr:[1,2],gl:{alpha:!0,antialias:!0},children:[g.jsx(Ni,{}),g.jsx(ut.Bounds,{fit:!0,observe:!0,margin:1,maxDuration:1,children:g.jsx(l,{connectedMotionGroup:i,postModelRender:z})})]})}),g.jsxs(P.Box,{sx:{flex:"1",display:"flex",flexDirection:"column",justifyContent:"flex-start",width:te?"100%":"50%"},children:[g.jsxs(P.Box,{sx:{p:{xs:1.5,sm:2,md:3},pb:{xs:1,sm:1.5,md:2},textAlign:"left"},children:[g.jsx(P.Typography,{variant:"h6",component:"h2",sx:{mb:1},children:e}),g.jsx(Tl,{programState:t,safetyState:r,operationMode:n})]}),g.jsxs(P.Box,{sx:{p:{xs:1.5,sm:2,md:3},pt:0,flex:"1",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[!ee&&g.jsxs(P.Box,{children:[g.jsx(P.Typography,{variant:"body1",sx:{mb:0,color:m.palette.text.secondary,textAlign:"left"},children:b("RobotCard.Runtime.lb")}),g.jsx(P.Box,{sx:{textAlign:"left"},children:g.jsx(c,{variant:"small",compact:!0,onCycleComplete:re,onCycleEnd:d,autoStart:h,hasError:p})}),g.jsx(P.Divider,{sx:{mt:1,mb:0,borderColor:m.palette.divider,opacity:.5}})]}),g.jsx(P.Box,{sx:{mt:ee?0:"auto"},children:g.jsx(P.Box,{sx:{display:"flex",justifyContent:"flex-start",mt:{xs:1,sm:1.5,md:2},mb:{xs:.5,sm:.75,md:1}},children:g.jsx(P.Button,{ref:O,variant:"contained",color:"secondary",size:"small",disabled:!o,onMouseDown:I,onMouseUp:G,onMouseLeave:oe,onTouchStart:I,onTouchEnd:G,sx:{textTransform:"none",px:1.5,py:.5},children:b("RobotCard.DriveToHome.bt")})})})]})]})]}):g.jsx(g.Fragment,{children:g.jsxs(P.Box,{sx:{p:3,height:"100%",display:"flex",flexDirection:"column"},children:[g.jsxs(P.Box,{children:[g.jsx(P.Typography,{variant:"h6",component:"h2",sx:{mb:1},children:e}),g.jsx(Tl,{programState:t,safetyState:r,operationMode:n})]}),g.jsx(P.Box,{sx:{flex:te?0:1,position:"relative",minHeight:te?0:{xs:120,sm:150,md:200},height:te?0:"auto",borderRadius:1,overflow:"hidden",display:te?"none":"block"},children:!te&&g.jsxs(Ra.Canvas,{orthographic:!0,camera:{position:[3,2,3],zoom:1},shadows:!0,frameloop:"demand",style:{borderRadius:m.shape.borderRadius,width:"100%",height:"100%",background:"transparent",position:"absolute"},dpr:[1,2],gl:{alpha:!0,antialias:!0},children:[g.jsx(Ni,{}),g.jsx(ut.Bounds,{fit:!0,clip:!0,observe:!0,margin:1,maxDuration:1,children:g.jsx(l,{connectedMotionGroup:i,postModelRender:z})})]})}),g.jsxs(P.Box,{children:[!ee&&g.jsxs(g.Fragment,{children:[g.jsx(P.Typography,{variant:"body1",sx:{mb:0,color:m.palette.text.secondary},children:b("RobotCard.Runtime.lb")}),g.jsx(c,{variant:"small",compact:!0,onCycleComplete:re,onCycleEnd:d,autoStart:h,hasError:p}),g.jsx(P.Divider,{sx:{mt:1,mb:0,borderColor:m.palette.divider,opacity:.5}})]}),g.jsx(P.Box,{sx:{display:"flex",justifyContent:"flex-start",mt:ee?{xs:.5,sm:1,md:2}:{xs:1,sm:2,md:5},mb:{xs:.5,sm:.75,md:1}},children:g.jsx(P.Button,{ref:O,variant:"contained",color:"secondary",size:"small",disabled:!o,onMouseDown:I,onMouseUp:G,onMouseLeave:oe,onTouchStart:I,onTouchEnd:G,sx:{textTransform:"none",px:1.5,py:.5},children:b("RobotCard.DriveToHome.bt")})})]})]})})})})),C3=fr(g.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error"),P3=({title:e,titleId:t,...r},n)=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:18,height:18,fill:"none",ref:n,"aria-labelledby":t,...r},e?F.createElement("title",{id:t},e):null,F.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"})),T3=J.forwardRef(P3);var Vc=(e=>(e.PRECONDITION_NOT_FULFILLED="PRECONDITION_NOT_FULFILLED",e.ROBOT_DISCONNECTED="ROBOT_DISCONNECTED",e.READY="READY",e))(Vc||{});const rg=Xe(Oe.observer(({setupState:e,className:t})=>{const r=P.useTheme(),{t:n}=_e.useTranslation(),o=()=>{var c,u,d,h;switch(e){case"READY":return{label:n("RobotSetupReadinessIndicator.Ready.lb"),indicatorColor:((c=r.palette.tertiary)==null?void 0:c.main)||r.palette.primary.main,backgroundColor:((u=r.palette.backgroundPaperElevation)==null?void 0:u[11])||r.palette.background.paper,textColor:r.palette.secondary.contrastText};case"ROBOT_DISCONNECTED":return{label:n("RobotSetupReadinessIndicator.RobotDisconnected.lb"),indicatorColor:r.palette.error.main,backgroundColor:((d=r.palette.backgroundPaperElevation)==null?void 0:d[11])||r.palette.background.paper,textColor:r.palette.secondary.contrastText};case"PRECONDITION_NOT_FULFILLED":default:return{label:n("RobotSetupReadinessIndicator.PreconditionNotFulfilled.lb"),indicatorColor:r.palette.error.main,backgroundColor:((h=r.palette.backgroundPaperElevation)==null?void 0:h[11])||r.palette.background.paper,textColor:r.palette.secondary.contrastText}}},{label:a,indicatorColor:s,backgroundColor:i,textColor:l}=o();return g.jsx(P.Chip,{className:t,label:g.jsxs(P.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[g.jsx(P.Box,{sx:{width:8,height:8,borderRadius:"50%",backgroundColor:s,flexShrink:0}}),g.jsx(P.Typography,{variant:"body2",sx:{color:l,fontSize:"0.75rem",lineHeight:1.2},children:a})]}),variant:"filled",sx:{backgroundColor:i,color:r.palette.getContrastText(i),fontWeight:500,height:"auto","& .MuiChip-label":{paddingX:1.5,paddingY:.5}}})})),R3=Xe(Oe.observer(({robotName:e,robotType:t,setupState:r,PreconditionComponent:n=rg,className:o})=>{var l;const a=P.useTheme(),s=t||"Robot",i=r===Vc.READY;return g.jsxs(P.Box,{className:o,sx:{border:`1px solid ${a.palette.divider}`,background:((l=a.palette.backgroundPaperElevation)==null?void 0:l[8])||"#292B3F",borderRadius:"8px",padding:"20px",display:"flex",alignItems:"center",justifyContent:"space-between",opacity:1},children:[g.jsxs(P.Box,{sx:{display:"flex",alignItems:"center",gap:2,flex:1},children:[i?g.jsx(P.Box,{sx:{fontSize:24,display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,"& svg":{fill:`${a.palette.primary.main} !important`},"& svg path":{fill:`${a.palette.primary.main} !important`}},children:g.jsx(T3,{})}):g.jsx(C3,{sx:{color:a.palette.error.main,fontSize:24}}),g.jsx(P.Typography,{variant:"body1",sx:{fontWeight:500,color:a.palette.text.primary},children:e}),g.jsx(P.Divider,{orientation:"vertical",flexItem:!0,sx:{backgroundColor:a.palette.text.secondary,opacity:.3,width:"1px"}}),g.jsx(P.Typography,{variant:"body2",sx:{color:a.palette.text.secondary},children:s})]}),n&&g.jsx(n,{setupState:r})]})})),A3=Array(6).fill(2*Math.PI),Rl={[Mt.Abb]:[0,0,0,0,Math.PI/2,0,0],[Mt.Fanuc]:[0,0,0,0,-Math.PI/2,0,0],[Mt.Yaskawa]:[0,0,0,0,-Math.PI/2,0,0],[Mt.Kuka]:[0,-Math.PI/2,Math.PI/2,0,Math.PI/2,0,0],[Mt.Universalrobots]:[0,-Math.PI/2,-Math.PI/2,-Math.PI/2,Math.PI/2,-Math.PI/2,0]};function ng(e){const[t]=e.split("_");switch(t){case"ABB":return Mt.Abb;case"FANUC":return Mt.Fanuc;case"YASKAWA":return Mt.Yaskawa;case"KUKA":return Mt.Kuka;case"UniversalRobots":return Mt.Universalrobots;default:return null}}function _3(e,t){const r=ng(e);return r&&r in Rl?Rl[r]:t||null}const E3=({title:e,titleId:t,...r},n)=>F.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:n,"aria-labelledby":t,...r},e?F.createElement("title",{id:t},e):null,F.createElement("path",{d:"M5.248 21c-.334 0-.619-.116-.853-.35a1.153 1.153 0 0 1-.351-.848c0-.333.117-.616.351-.85.234-.233.519-.35.853-.35H7.24L4.558 9.87a2.881 2.881 0 0 1-1.126-1.042A2.77 2.77 0 0 1 3 7.317c0-.793.28-1.467.838-2.023a2.774 2.774 0 0 1 2.033-.834 2.71 2.71 0 0 1 1.728.585c.494.389.832.887 1.014 1.493h3.58V5.239c0-.22.076-.406.226-.555a.76.76 0 0 1 .558-.224c.136 0 .263.035.381.104.118.07.209.167.273.292v.14l1.835-1.702a.979.979 0 0 1 .52-.279.881.881 0 0 1 .58.091l4.01 1.85a.74.74 0 0 1 .36.364.537.537 0 0 1-.002.474.592.592 0 0 1-.366.323.657.657 0 0 1-.477-.039l-3.858-1.774L13.76 6.59v1.454l2.473 2.233 3.858-1.774a.648.648 0 0 1 .485-.03.571.571 0 0 1 .358.314.513.513 0 0 1 .01.482.79.79 0 0 1-.367.357l-4.011 1.882a.881.881 0 0 1-.58.09.979.979 0 0 1-.52-.278L13.63 9.638v.14a.92.92 0 0 1-.273.275.665.665 0 0 1-.381.12.76.76 0 0 1-.558-.224.752.752 0 0 1-.225-.555V8.096h-3.58a2.82 2.82 0 0 1-.215.54 2.552 2.552 0 0 1-.323.479l5.139 9.488h2.673c.335 0 .62.116.854.35.234.233.35.516.35.849 0 .332-.116.615-.35.849a1.167 1.167 0 0 1-.854.349H5.248Zm.623-12.385c.362 0 .67-.126.924-.378a1.25 1.25 0 0 0 .38-.92 1.25 1.25 0 0 0-.38-.92 1.261 1.261 0 0 0-.924-.379 1.26 1.26 0 0 0-.925.379 1.25 1.25 0 0 0-.38.92c0 .36.127.667.38.92.254.252.562.378.925.378Z"})),I3=J.forwardRef(E3),V3=({title:e,titleId:t,...r},n)=>F.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:n,"aria-labelledby":t,...r},e?F.createElement("title",{id:t},e):null,F.createElement("path",{d:"m13.37 9.12 1.69 1.69 2.99-2.99-3.73-3.73-.95-.95-7.66 7.66-.95.95 3.99 3.99v3.44h7.55v-3.55l-4.72-4.72 1.79-1.79Zm-.91-2.99.91-.91 2.6 2.6-.91.91-2.6-2.6Zm-2.25 10.24h3.74l-1.34-1.34-.04-.04h-2.5l-3.25-3.25 4.59-4.59.92.92L9.5 10.9l5.33 5.33v1.48H10.2v-1.35l.01.01ZM2 2v4.99h1.41V3.4h3.58V2H2ZM22.21 2h-4.98v1.41h3.59v3.58h1.4V2h-.01ZM20.81 20.65h-3.58v1.4h4.98v-4.99h-1.4v3.59ZM3.4 17.06H2v4.98h4.99v-1.4H3.4v-3.58Z"})),M3=J.forwardRef(V3),jt=Oe.observer(({id:e,icon:t,color:r,title:n,name:o,label:a,explanation:s,literalValue:i,anchorOrigin:l,transformOrigin:c})=>{const u=Oe.useLocalObservable(()=>({anchorEl:null,get isPopoverOpen(){return!!u.anchorEl},openPopover(d){u.anchorEl=d.currentTarget},closePopover(){u.anchorEl=null}}));return g.jsxs(g.Fragment,{children:[g.jsxs(P.Stack,{"aria-owns":u.isPopoverOpen?e:void 0,"aria-haspopup":"true",onMouseEnter:u.openPopover,onMouseLeave:u.closePopover,direction:"row",spacing:1,sx:{cursor:"pointer"},children:[g.jsx(P.SvgIcon,{component:t,sx:{color:r}}),a&&g.jsx("div",{style:{color:r},children:a})]}),g.jsx(P.Popover,{id:e,sx:{pointerEvents:"none"},open:u.isPopoverOpen,anchorEl:u.anchorEl,anchorOrigin:l??{vertical:"bottom",horizontal:"left"},transformOrigin:c??{vertical:"top",horizontal:"left"},onClose:u.closePopover,disableRestoreFocus:!0,children:g.jsxs(P.Stack,{gap:"1rem",padding:2,maxWidth:"450px",sx:{wordWrap:"break-word"},children:[g.jsxs("div",{children:[n&&g.jsx(P.Typography,{component:"span",fontSize:"14px",children:`${n}: `}),g.jsx(P.Typography,{component:"span",color:r,fontWeight:"bold",fontSize:"14px",children:o})]}),g.jsx(P.Typography,{fontSize:"14px",children:s}),i&&g.jsx(P.Typography,{fontSize:"12px",children:i})]})})]})}),j3=Oe.observer(({isVirtual:e,motionGroupId:t,anchorOrigin:r,transformOrigin:n,compact:o})=>{const a=P.useTheme(),{t:s}=_e.useTranslation();return e?g.jsx(jt,{id:"motion-group-virtual",icon:M3,color:a.palette.tertiary.main,name:s("SafetyBar.ControllerType.Virtual.lb"),label:o?null:s("SafetyBar.ControllerType.Virtual.lb"),explanation:g.jsxs(_e.Trans,{i18nKey:"SafetyBar.MotionGroup.Virtual.Explanation.lb",values:{motionGroupId:t},children:["Motion group ",g.jsx("code",{children:t})," refers to a virtual robot with no physical counterpart. It can be freely manipulated without special safety precautions."]}),anchorOrigin:r,transformOrigin:n}):g.jsx(jt,{id:"motion-group-physical",icon:I3,color:a.palette.primary.main,name:s("SafetyBar.ControllerType.Physical.lb"),label:o?null:s("SafetyBar.ControllerType.Physical.lb"),explanation:g.jsx(_e.Trans,{i18nKey:"SafetyBar.MotionGroup.Physical.Explanation.lb",values:{motionGroupId:t},components:{code:g.jsx("code",{}),strong:g.jsx("strong",{})}}),anchorOrigin:r,transformOrigin:n})}),k3=({title:e,titleId:t,...r},n)=>F.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:n,"aria-labelledby":t,...r},e?F.createElement("title",{id:t},e):null,F.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.306 2.768c0-.424.344-.768.768-.768h.406C19.53 2 22 4.551 22 7.699c0 3.237-2.51 5.587-5.31 5.703-.84 1.595-2.478 2.677-4.36 2.677a4.845 4.845 0 0 1-3.146-1.163c-.6 1.783 0 3.922 1.79 4.99 1.929 1.149 4.395.467 5.508-1.524l.212-.378a.75.75 0 1 1 1.308.732l-.231.414c-1.524 2.725-4.9 3.66-7.54 2.085-2.716-1.618-3.432-5.037-2.129-7.599a5.22 5.22 0 0 1-.73-2.677c0-2.192 1.335-4.063 3.212-4.793-1.195-1.427-3.29-1.96-5.08-.892-1.928 1.15-2.589 3.696-1.475 5.687l.231.413a.75.75 0 0 1-1.308.732l-.212-.377c-1.524-2.726-.62-6.211 2.02-7.785 2.716-1.619 5.943-.55 7.44 1.897l.13-.001c2.739 0 4.96 2.292 4.96 5.12 0 .284-.023.563-.066.834 1.795-.354 3.288-1.96 3.288-4.095 0-2.3-1.805-4.163-4.032-4.163h-.406a.768.768 0 0 1-.768-.768Zm.496 8.191c0 .286-.033.564-.094.831a3.62 3.62 0 0 1-.672 1.415 3.425 3.425 0 0 1-2.706 1.338 3.402 3.402 0 0 1-2.384-.98 3.598 3.598 0 0 1-.852-1.306 3.677 3.677 0 0 1-.235-1.298c0-1.623 1.046-2.994 2.48-3.435a3.37 3.37 0 0 1 1.522-.107c1.665.264 2.94 1.75 2.94 3.542Z"})),$3=J.forwardRef(k3),U3=({title:e,titleId:t,...r},n)=>F.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:n,"aria-labelledby":t,...r},e?F.createElement("title",{id:t},e):null,F.createElement("path",{d:"M19.763 16.432 13.516 5.864c-.674-1.152-2.358-1.152-3.049 0l-6.23 10.568C3.563 17.567 4.405 19 5.753 19H18.23c1.364 0 2.206-1.432 1.532-2.568ZM12 8.498c.539 0 .96.428.96.938v.066l-.32 4.708a.639.639 0 0 1-.64.592.639.639 0 0 1-.64-.592l-.32-4.708A.953.953 0 0 1 12 8.498Zm0 8.79c-.556 0-1.01-.444-1.01-.987 0-.544.454-.988 1.01-.988s1.01.444 1.01.988c0 .542-.454.987-1.01.987Z",fill:"#fff",fillOpacity:.56})),D3=J.forwardRef(U3),L3=({title:e,titleId:t,...r},n)=>F.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:n,"aria-labelledby":t,...r},e?F.createElement("title",{id:t},e):null,F.createElement("path",{d:"M12.953 5.09a1.497 1.497 0 0 0-1.653-.518l-1.35.43a1.504 1.504 0 0 0-1.726-.376L2.858 6.97c-.736.321-1.06 1.155-.726 1.862.334.707 1.202 1.02 1.937.698l4.27-1.865 1.466 1.973v.402c0 .873-.627 1.63-1.512 1.827l-2.56.567c-1.329.295-2.27 1.431-2.27 2.74v.107c0 .26.22.469.489.469h11.117c1.329 0 2.618.435 3.656 1.233l1.665 1.28A1 1 0 0 0 22 17.47V11.062c0-.312-.108-.616-.308-.863l-3.415-4.218a1.5 1.5 0 0 0-1.618-.471l-.378.12-.866-.475a1.516 1.516 0 0 0-1.188-.114l-1.06.338-.214-.289Z"})),B3=J.forwardRef(L3),N3=Oe.observer(({operationMode:e,anchorOrigin:t,transformOrigin:r,compact:n})=>{const{t:o}=_e.useTranslation(),a=P.useTheme();switch(e){case"OPERATION_MODE_AUTO":return g.jsx(jt,{id:"operation-mode-auto",icon:$3,title:o("SafetyBar.OperationMode.ti"),name:o("SafetyBar.OperationMode.Automatic.ti"),label:n?null:o("SafetyBar.OperationMode.Automatic.ti"),color:a.palette.text.secondary,explanation:g.jsx(_e.Trans,{i18nKey:"SafetyBar.OperationMode.Auto.Explanation.lb",children:"The robot controller is in automatic operation mode. Automated movement without manual confirmation is possible in this mode."}),anchorOrigin:t,transformOrigin:r});case"OPERATION_MODE_MANUAL":case"OPERATION_MODE_MANUAL_T1":case"OPERATION_MODE_MANUAL_T2":return g.jsx(jt,{id:"operation-mode-manual",icon:B3,color:a.palette.warning.main,title:o("SafetyBar.OperationMode.ti"),name:o("SafetyBar.OperationMode.Manual.lb"),label:n?null:o("SafetyBar.OperationMode.Manual.lb"),explanation:g.jsx(_e.Trans,{i18nKey:"SafetyBar.OperationMode.Manual.Explanation.lb",children:"The robot controller is in manual operation mode. On a physical robot, this generally indicates that an enabling switch must be held for the robot to move successfully."}),literalValue:e,anchorOrigin:t,transformOrigin:r});default:return g.jsx(jt,{id:"operation-mode-error",icon:D3,color:a.palette.warning.main,title:o("SafetyBar.OperationMode.ti"),name:o("SafetyBar.OperationMode.Error.lb"),label:n?null:o("SafetyBar.OperationMode.Error.lb"),explanation:g.jsx(_e.Trans,{i18nKey:"SafetyBar.OperationMode.Error.Explanation.lb",children:"The robot controller has entered an unexpected operation mode. Motion group movement may not be possible."}),literalValue:e,anchorOrigin:t,transformOrigin:r})}}),F3=({title:e,titleId:t,...r},n)=>F.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:n,"aria-labelledby":t,...r},e?F.createElement("title",{id:t},e):null,F.createElement("path",{d:"M19.763 16.432 13.516 5.864c-.674-1.152-2.358-1.152-3.049 0l-6.23 10.568C3.563 17.567 4.405 19 5.753 19H18.23c1.364 0 2.206-1.432 1.532-2.568ZM12 8.498c.539 0 .96.428.96.938v.066l-.32 4.708a.639.639 0 0 1-.64.592.639.639 0 0 1-.64-.592l-.32-4.708A.953.953 0 0 1 12 8.498Zm0 8.79c-.556 0-1.01-.444-1.01-.987 0-.544.454-.988 1.01-.988s1.01.444 1.01.988c0 .542-.454.987-1.01.987Z"})),z3=J.forwardRef(F3),G3=({title:e,titleId:t,...r},n)=>F.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:n,"aria-labelledby":t,...r},e?F.createElement("title",{id:t},e):null,F.createElement("path",{d:"M10.24 10.636 12 13.764l1.76-3.128h-3.52Z"}),F.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.364 12a6.364 6.364 0 1 1-12.728 0 6.364 6.364 0 0 1 12.728 0ZM7.909 9.273 12 16.546l4.09-7.273H7.91Z"}),F.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-1.364 0a8.636 8.636 0 1 1-17.273 0 8.636 8.636 0 0 1 17.273 0Z"})),H3=J.forwardRef(G3),q3=({title:e,titleId:t,...r},n)=>F.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:n,"aria-labelledby":t,...r},e?F.createElement("title",{id:t},e):null,F.createElement("path",{d:"M9.057 15.115c-1.681 0-3.111-.59-4.29-1.768C3.59 12.17 3 10.74 3 9.057c0-.29.021-.582.064-.876a4.1 4.1 0 0 1 .214-.844.78.78 0 0 1 .273-.36c.115-.077.244-.133.389-.168a.857.857 0 0 1 .437.008c.146.04.28.12.4.24l2.806 2.787 2.26-2.261-2.775-2.786a.903.903 0 0 1-.241-.405.875.875 0 0 1-.008-.442 1.13 1.13 0 0 1 .174-.389.82.82 0 0 1 .355-.273c.268-.107.548-.182.838-.224.29-.043.581-.064.871-.064 1.682 0 3.112.59 4.29 1.768 1.179 1.178 1.768 2.608 1.768 4.29 0 .444-.042.858-.126 1.241-.084.384-.21.755-.377 1.113l5.726 5.692A2.2 2.2 0 0 1 21 18.721a2.2 2.2 0 0 1-.662 1.617A2.2 2.2 0 0 1 18.72 21a2.173 2.173 0 0 1-1.617-.679l-5.692-5.709c-.372.161-.75.285-1.133.372-.383.087-.79.13-1.222.13Z",fill:"#fff",fillOpacity:.56})),W3=J.forwardRef(q3),J3=({title:e,titleId:t,...r},n)=>F.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:n,"aria-labelledby":t,...r},e?F.createElement("title",{id:t},e):null,F.createElement("path",{d:"m10.6 13.8-2.15-2.15a.948.948 0 0 0-.7-.275.948.948 0 0 0-.7.275.948.948 0 0 0-.275.7c0 .283.092.517.275.7L9.9 15.9c.2.2.433.3.7.3.267 0 .5-.1.7-.3l5.65-5.65a.948.948 0 0 0 .275-.7.948.948 0 0 0-.275-.7.948.948 0 0 0-.7-.275.948.948 0 0 0-.7.275L10.6 13.8ZM12 22a9.738 9.738 0 0 1-3.9-.788 10.099 10.099 0 0 1-3.175-2.137c-.9-.9-1.612-1.958-2.137-3.175A9.738 9.738 0 0 1 2 12c0-1.383.263-2.683.788-3.9a10.099 10.099 0 0 1 2.137-3.175c.9-.9 1.958-1.612 3.175-2.137A9.738 9.738 0 0 1 12 2c1.383 0 2.683.263 3.9.788a10.098 10.098 0 0 1 3.175 2.137c.9.9 1.613 1.958 2.137 3.175A9.738 9.738 0 0 1 22 12a9.738 9.738 0 0 1-.788 3.9 10.098 10.098 0 0 1-2.137 3.175c-.9.9-1.958 1.613-3.175 2.137A9.738 9.738 0 0 1 12 22Zm0-2c2.233 0 4.125-.775 5.675-2.325C19.225 16.125 20 14.233 20 12c0-2.233-.775-4.125-2.325-5.675C16.125 4.775 14.233 4 12 4c-2.233 0-4.125.775-5.675 2.325C4.775 7.875 4 9.767 4 12c0 2.233.775 4.125 2.325 5.675C7.875 19.225 9.767 20 12 20Z"})),Y3=J.forwardRef(J3),K3=({title:e,titleId:t,...r},n)=>F.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:n,"aria-labelledby":t,...r},e?F.createElement("title",{id:t},e):null,F.createElement("path",{d:"M9 16h6c.283 0 .52-.096.713-.287A.968.968 0 0 0 16 15V9a.967.967 0 0 0-.287-.713A.968.968 0 0 0 15 8H9a.968.968 0 0 0-.713.287A.968.968 0 0 0 8 9v6c0 .283.096.52.287.713.192.191.43.287.713.287Zm3 6a9.738 9.738 0 0 1-3.9-.788 10.099 10.099 0 0 1-3.175-2.137c-.9-.9-1.612-1.958-2.137-3.175A9.738 9.738 0 0 1 2 12c0-1.383.263-2.683.788-3.9a10.099 10.099 0 0 1 2.137-3.175c.9-.9 1.958-1.612 3.175-2.137A9.738 9.738 0 0 1 12 2c1.383 0 2.683.263 3.9.788a10.098 10.098 0 0 1 3.175 2.137c.9.9 1.613 1.958 2.137 3.175A9.738 9.738 0 0 1 22 12a9.738 9.738 0 0 1-.788 3.9 10.098 10.098 0 0 1-2.137 3.175c-.9.9-1.958 1.613-3.175 2.137A9.738 9.738 0 0 1 12 22Zm0-2c2.233 0 4.125-.775 5.675-2.325C19.225 16.125 20 14.233 20 12c0-2.233-.775-4.125-2.325-5.675C16.125 4.775 14.233 4 12 4c-2.233 0-4.125.775-5.675 2.325C4.775 7.875 4 9.767 4 12c0 2.233.775 4.125 2.325 5.675C7.875 19.225 9.767 20 12 20Z"})),Q3=J.forwardRef(K3),X3=Oe.observer(({safetyState:e,anchorOrigin:t,transformOrigin:r,compact:n})=>{const{t:o}=_e.useTranslation(),a=P.useTheme();switch(e){case"SAFETY_STATE_NORMAL":return g.jsx(jt,{id:"safety-state-normal",title:o("SafetyBar.SafetyState.ti"),name:o("SafetyBar.SafetyState.Normal.lb"),label:n?null:o("SafetyBar.SafetyState.Normal.lb"),icon:Y3,color:a.palette.text.secondary,explanation:g.jsx(_e.Trans,{i18nKey:"SafetyBar.SafetyState.Normal.Explanation.lb",children:"The robot controller is in a normal safety state. Movement is not prevented by this state."}),anchorOrigin:t,transformOrigin:r});case"SAFETY_STATE_DEVICE_EMERGENCY_STOP":case"SAFETY_STATE_ROBOT_EMERGENCY_STOP":return g.jsx(jt,{id:"safety-state-estop",title:o("SafetyBar.SafetyState.ti"),name:o("SafetyBar.SafetyState.Estop.lb"),label:n?null:o("SafetyBar.SafetyState.Estop.lb"),icon:H3,color:a.palette.error.main,explanation:g.jsx(_e.Trans,{i18nKey:"SafetyBar.StopState.Estop.Explanation.lb",children:"An emergency stop of the robot controller has been triggered. Movement of the robot is no longer possible until the estop is released."}),literalValue:e,anchorOrigin:t,transformOrigin:r});case"SAFETY_STATE_STOP_0":case"SAFETY_STATE_STOP_1":case"SAFETY_STATE_STOP_2":case"SAFETY_STATE_PROTECTIVE_STOP":case"SAFETY_STATE_STOP":return g.jsx(jt,{id:"safety-state-stop",icon:Q3,title:o("SafetyBar.SafetyState.ti"),name:o("SafetyBar.SafetyState.Stop.lb"),label:n?null:o("SafetyBar.SafetyState.Stop.lb"),color:a.palette.warning.main,explanation:g.jsx(_e.Trans,{i18nKey:"SafetyBar.SafetyState.Stop.Explanation.lb",children:"The robot controller has entered a stop state. Movement is no longer possible until the stop state is resolved."}),literalValue:e,anchorOrigin:t,transformOrigin:r});case"SAFETY_STATE_REDUCED":case"SAFETY_STATE_MASTERING":case"SAFETY_STATE_CONFIRM_SAFETY":case"SAFETY_STATE_OPERATOR_SAFETY":case"SAFETY_STATE_RECOVERY":case"SAFETY_STATE_VIOLATION":return g.jsx(jt,{id:"safety-state-manual-action-required",icon:W3,color:a.palette.warning.main,title:o("SafetyBar.SafetyState.ti"),name:o("SafetyBar.SafetyState.ManualActionRequired.lb"),label:n?null:o("SafetyBar.SafetyState.ManualActionRequired.lb"),explanation:g.jsx(_e.Trans,{i18nKey:"SafetyBar.SafetyState.ManualActionRequired.Explanation.lb",children:"The robot controller has entered a safety state requiring manual action to resolve."}),literalValue:e,anchorOrigin:t,transformOrigin:r});case"SAFETY_STATE_UNKNOWN":case"SAFETY_STATE_FAULT":return g.jsx(jt,{id:"safety-state-error",icon:z3,color:a.palette.error.main,title:o("SafetyBar.SafetyState.ti"),name:o("SafetyBar.SafetyState.Error.lb"),label:n?null:o("SafetyBar.SafetyState.Error.lb"),explanation:g.jsx(_e.Trans,{i18nKey:"SafetyBar.SafetyState.Error.Explanation.lb",children:"The robot controller has entered an unexpected safety state."}),literalValue:e,anchorOrigin:t,transformOrigin:r});default:Q2(e,`Unknown safety state ${e}`)}}),Z3=Xe(Oe.observer(({isVirtual:e,motionGroupId:t,operationMode:r,safetyState:n,anchorOrigin:o,transformOrigin:a,compact:s=!0})=>{const i=s?1:2;return g.jsxs(P.Stack,{direction:"row",gap:i,alignItems:"center",sx:{height:"24px"},children:[g.jsx(X3,{safetyState:n,anchorOrigin:o,transformOrigin:a,compact:s}),g.jsx(P.Divider,{orientation:"vertical",flexItem:!0}),g.jsx(N3,{operationMode:r,anchorOrigin:o,transformOrigin:a,compact:s}),g.jsx(P.Divider,{orientation:"vertical",flexItem:!0}),g.jsx(j3,{isVirtual:e,motionGroupId:t,anchorOrigin:o,transformOrigin:a,compact:s})]})})),ej=P.styled(P.Fab,{shouldForwardProp:e=>e!=="selected"})(({theme:e})=>{var t,r,n;return{borderRadius:"20px","&:hover":{background:(t=e.palette.backgroundPaperElevation)==null?void 0:t[7]},variants:[{props:({selected:o})=>!o,style:{background:(r=e.palette.backgroundPaperElevation)==null?void 0:r[0],color:e.palette.action.disabled,"> img":{opacity:.4}}},{props:({selected:o})=>o,style:{background:(n=e.palette.backgroundPaperElevation)==null?void 0:n[11],border:`1px solid ${e.palette.divider}`,color:e.palette.primary.contrastText}}]}}),tj=e=>{const{ref:t,...r}=e;return g.jsx(ej,{ref:t,selected:e.selected,...r,color:"secondary",variant:"circular"})};function rj(e){const{children:t,value:r,index:n,...o}=e;return g.jsx("div",{role:"tabpanel",hidden:r!==n,id:`tabpanel-${n}`,"aria-labelledby":`tab-${n}`,...o,children:r===n&&g.jsx(P.Box,{children:t})})}const nj=Xe(Oe.observer(e=>{const{items:t,defaultActiveTab:r=0,onTabChange:n,sx:o,ref:a}=e,[s,i]=J.useState(r),l=(c,u)=>{i(u),n==null||n(u)};return g.jsxs(P.Box,{ref:a,sx:{height:"100%",display:"flex",flexDirection:"column",...o},children:[g.jsx(P.Box,{sx:{px:0,py:0},children:g.jsx(P.Tabs,{value:s,onChange:l,sx:{minHeight:"32px",backgroundColor:"transparent","& .MuiTabs-indicator":{display:"none"},"& .MuiTabs-flexContainer":{gap:2}},children:t.map((c,u)=>g.jsx(P.Tab,{label:c.label,icon:c.icon,iconPosition:"start",disableRipple:!0,sx:{minHeight:"32px",height:"32px",padding:"0px 10px",borderRadius:"12px",backgroundColor:d=>{var h;return((h=d.palette.backgroundPaperElevation)==null?void 0:h[11])||"#32344B"},color:"text.primary",opacity:s===u?1:.38,fontSize:"13px",transition:"all 0.2s ease-in-out","&:hover":{opacity:s===u?1:.6},"&.Mui-selected":{opacity:1,backgroundColor:d=>{var h;return((h=d.palette.backgroundPaperElevation)==null?void 0:h[11])||"#32344B"},color:"text.primary"},"&:focus":{outline:"none"},"&:active":{transform:"none"}}},c.id))})}),g.jsx(P.Box,{sx:{mt:"32px",borderBottom:1,borderColor:"divider"}}),g.jsx(P.Box,{sx:{flex:1,overflow:"auto"},children:t.map((c,u)=>g.jsx(rj,{value:s,index:u,children:c.content},c.id))})]})})),oj={$schema:"https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",name:"wandelscript",patterns:[{include:"#keywords"},{include:"#strings"},{include:"#comments"},{include:"#functions"}],repository:{keywords:{patterns:[{name:"keyword.control.flow.wandelscript",match:"\\b(move|via|to|interrupt|def|False|True|for|if|else|elif|while|return|switch|activate|deactivate|print|and|or|not)\\b"}]},strings:{name:"string.quoted.double.wandelscript",begin:'"',end:'"',patterns:[{name:"constant.character.escape.wandelscript",match:"\\\\."}]},comments:{patterns:[{begin:"#",beginCaptures:{0:{name:"punctuation.definition.comment.wandelscript"}},end:"$",name:"comment.line.number-sign.wandelscript"}]},functions:{patterns:[{match:"[a-zA-Z_-]+\\(",name:"entity.name.function.wandelscript"}]}},scopeName:"source.wandelscript"},aj=J.lazy(()=>import("@monaco-editor/react"));let Bi=null;async function sj(){if(!Bi){const[{createHighlighter:e},{shikiToMonaco:t}]=await Promise.all([import("shiki"),import("@shikijs/monaco")]);Bi={shiki:await e({langs:[oj],themes:["dark-plus","light-plus"]}),shikiToMonaco:t}}return Bi}const ij=Xe(e=>{const t=P.useTheme(),[r,n]=J.useState("dark-plus"),o=t.palette.mode==="dark"?"dark-plus":"light-plus";async function a(s){var c,u;s.languages.register({id:"wandelscript"}),s.languages.setLanguageConfiguration("wandelscript",{comments:{lineComment:"#"},brackets:[["(",")"],["[","]"]],autoClosingPairs:[{open:"[",close:"]"},{open:"(",close:")"}],surroundingPairs:[{open:"[",close:"]"},{open:"(",close:")"}]});const{shiki:i,shikiToMonaco:l}=await sj();l(i,s),s.editor.defineTheme(o,((u=(c=t.componentsExt)==null?void 0:c.WandelscriptEditor)==null?void 0:u.monacoTheme)??{base:t.palette.mode==="dark"?"vs-dark":"vs",inherit:!0,rules:[],colors:{}}),e.monacoSetup&&e.monacoSetup(s),n(o)}return g.jsx(J.Suspense,{fallback:g.jsx(Cc,{}),children:g.jsx(aj,{value:e.code,onMount:(s,i)=>{a(i)},onChange:e.onChange,defaultLanguage:"wandelscript",theme:r,options:{minimap:{enabled:!1},wordWrap:"on",automaticLayout:!0,...e.monacoOptions}})})});function og(){var t,r,n,o,a,s,i;const e=P.createTheme({palette:{mode:"dark",text:{primary:"rgba(255, 255, 255, 1)",secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.38)"},primary:{main:"rgba(142, 86, 252, 1)",dark:"rgba(136, 58, 255, 1)",light:"rgba(157, 131, 246, 1)",contrastText:"rgba(255, 255, 255, 0.87)"},secondary:{main:"rgba(255, 255, 255, 1)",dark:"rgba(255, 255, 255, 0.06)",contrastText:"rgba(255, 255, 255, 0.87)"},tertiary:{main:"rgba(100, 255, 218, 1)",dark:"rgba(38, 166, 154, 1)",light:"rgba(167, 255, 235, 1)",contrastText:"rgba(0, 0, 0, 1)"},error:{main:"rgba(239, 83, 80, 1)",dark:"rgba(229, 57, 53, 1)",light:"rgba(239, 154, 154, 1)",contrastText:"rgba(255, 255, 255, 1)"},warning:{main:"rgba(255, 171, 64, 1)",dark:"rgba(255, 145, 0, 1)",light:"rgba(255, 209, 128, 1)",contrastText:"rgba(0, 0, 0, 0.87)"},success:{main:"rgba(38, 166, 154, 1)",dark:"rgba(0, 121, 107, 1)",light:"rgba(128, 203, 196, 1)",contrastText:"rgba(255, 255, 255, 0.87)"},background:{default:"rgba(2, 6, 23, 1)",paper:"rgba(17, 19, 31, 1)"},action:{active:"rgba(255, 255, 255, 0.56)",hover:"rgba(255, 255, 255, 0.08)",selected:"rgba(255, 255, 255, 0.16)",disabledBackground:"rgba(255, 255, 255, 0.12)",focus:"rgba(255, 255, 255, 0.12)",disabled:"rgba(255, 255, 255, 0.38)"},common:{white:"rgba(255, 255, 255, 1)",black:"rgba(0, 0, 0, 1)"},divider:"rgba(255, 255, 255, 0.12)",backgroundPaperElevation:{0:"rgba(17,19,31,1.0)",1:"rgba(20,22,35,1.0)",2:"rgba(23,25,39,1.0)",3:"rgba(26,28,43,1.0)",4:"rgba(29,31,47,1.0)",5:"rgba(32,34,51,1.0)",6:"rgba(35,37,55,1.0)",7:"rgba(38,40,59,1.0)",8:"rgba(41,43,63,1.0)",9:"rgba(44,46,67,1.0)",10:"rgba(47,49,71,1.0)",11:"rgba(50,52,75,1.0)",12:"rgba(53,55,79,1.0)",13:"rgba(56,58,83,1.0)",14:"rgba(59,61,87,1.0)",15:"rgba(62,64,91,1.0)",16:"rgba(57,63,87,1.0)"}},paletteExt:{primary:{hover:"rgba(142, 86, 252, 0.08)",selected:"rgba(142, 86, 252, 0.16)",focus:"rgba(142, 86, 252, 0.12)",focusVisible:"rgba(142, 86, 252, 0.3)",outlineBorder:"rgba(142, 86, 252, 0.5)"},secondary:{tonal:"rgba(255,255,255,0.1)"}}});return{...e,components:{MuiCssBaseline:{styleOverrides:{"html, body, *":{scrollbarWidth:"none",msOverflowStyle:"none"},"html:hover, body:hover, *:hover":{scrollbarWidth:"thin",scrollbarColor:`${e.palette.divider} transparent`},".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:{root:{},panelContent:{borderRadius:"16px !important"},filterForm:{"& .MuiInputBase-root":{borderRadius:"10px !important","& fieldset":{borderRadius:"10px !important"},"& .MuiOutlinedInput-notchedOutline":{borderRadius:"10px !important"}}},filterFormValueInput:{"& .MuiInputBase-root":{borderRadius:"10px !important","& fieldset":{borderRadius:"10px !important"},"& .MuiOutlinedInput-notchedOutline":{borderRadius:"10px !important"}}}}},MuiButton:{styleOverrides:{root:{textTransform:"none",borderRadius:"10px"}},variants:[{props:{color:"secondary",variant:"contained"},style:{border:`1px solid ${e.palette.divider}`,background:(n=(r=(t=e.paletteExt)==null?void 0:t.secondary)==null?void 0:r.tonal)==null?void 0:n.toString()}},{props:{color:"secondary",variant:"outlined"},style:{border:`1px solid ${e.palette.divider}`}}]},MuiTab:{styleOverrides:{root:{textTransform:"none",color:e.palette.text.secondary,"&.Mui-selected":{color:e.palette.text.primary}}}},MuiTabs:{styleOverrides:{root:{background:(o=e.palette.backgroundPaperElevation)==null?void 0:o[1]}}},MuiToggleButtonGroup:{styleOverrides:{root:{".MuiToggleButtonGroup-firstButton":{borderRadius:"10px 0 0 10px"},".MuiToggleButtonGroup-lastButton":{borderRadius:"0 10px 10px 0"}}}},MuiToggleButton:{styleOverrides:{root:{textTransform:"none",padding:"6px 16px"}}},MuiSelect:{variants:[{props:{variant:"filled"},style:{borderRadius:"10px","::before, ::after":{visibility:"collapse"},".MuiInputBase-input":{padding:"6px 16px",borderRadius:"10px"}}}]},MuiDrawer:{styleOverrides:{paper:{border:"none",boxShadow:"4px 0 8px -4px rgba(0, 0, 0, 0.3)"}}},MuiFab:{styleOverrides:{root:{background:(s=(a=e.paletteExt)==null?void 0:a.secondary)==null?void 0:s.tonal}},variants:[{props:{color:"primary"},style:{background:e.palette.primary.main}}]}},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:e.palette.text.primary},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:e.palette.text.primary},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:e.palette.text.primary}}},JoggingJoint:{Joint:{arrowColor:e.palette.text.primary}},VelocitySlider:{sliderLegendColor:e.palette.text.primary}},WandelscriptEditor:{monacoTheme:{base:"vs-dark",inherit:!0,rules:[{token:"keyword",foreground:"#b349a9ff"}],colors:{"editor.background":P.rgbToHex(((i=e.palette.backgroundPaperElevation)==null?void 0:i[5])??""),"editor.foreground":"#d4d4d4","editorLineNumber.foreground":"#797979","editorLineNumber.activeForeground":"#e9e9e9","editor.lineHighlightBorder":"#e9e9e911"}}}}}}function lj(){const e=og();return e.palette.mode="light",e}function cj(e){var n,o,a,s;let t=!0;((n=e.palette)==null?void 0:n.mode)==="light"?t=!1:((o=e.palette)==null?void 0:o.mode)!=="dark"&&(t=!(typeof window<"u"&&((s=(a=window.matchMedia)==null?void 0:a.call(window,"(prefers-color-scheme: light)"))==null?void 0:s.matches)));const r=t?og():lj();return np(r,e)}exports.AppHeader=Mg;exports.CycleTimer=Tm;exports.JoggingCartesianAxisControl=ol;exports.JoggingJointRotationControl=Vm;exports.JoggingPanel=e3;exports.JoggingStore=qs;exports.LoadingCover=Cc;exports.LoadingErrorMessage=Cf;exports.LogPanel=l3;exports.LogStore=Yf;exports.LogViewer=Kf;exports.MANUFACTURER_HOME_CONFIGS=Rl;exports.NoMotionGroupModal=u3;exports.PoseCartesianValues=r3;exports.PoseJointValues=n3;exports.PresetEnvironment=Ni;exports.ProgramControl=d3;exports.ProgramState=vr;exports.ProgramStateIndicator=Tl;exports.Robot=tg;exports.RobotCard=w3;exports.RobotListItem=R3;exports.RobotSetupReadinessIndicator=rg;exports.RobotSetupReadinessState=Vc;exports.SafetyBar=Z3;exports.SafetyZonesRenderer=Rg;exports.SelectableFab=tj;exports.SupportedRobot=eg;exports.TabBar=nj;exports.TrajectoryRenderer=Ag;exports.ValueInterpolator=xc;exports.VelocitySlider=qf;exports.VelocitySliderLabel=Ec;exports.WandelbotsDataGrid=Rm;exports.WandelscriptEditor=ij;exports.createDebugMessage=o3;exports.createErrorMessage=i3;exports.createInfoMessage=a3;exports.createLogMessage=Uo;exports.createNovaMuiTheme=cj;exports.createWarningMessage=s3;exports.defaultAxisConfig=A3;exports.defaultGetModel=Ic;exports.extractManufacturer=ng;exports.getDefaultHomeConfig=_3;exports.i18n=_l;exports.useAnimationFrame=Rn;exports.useAutorun=Am;exports.useInterpolation=Pm;exports.useMounted=Is;exports.useReaction=_m;
|
|
155
155
|
//# sourceMappingURL=index.cjs.map
|