UNPKG

@wandelbots/wandelbots-js-react-components

Version:

React UI toolkit for building applications on top of the Wandelbots platform

43 lines (41 loc) • 478 kB
"use strict";var af=Object.defineProperty;var lf=(e,t,n)=>t in e?af(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var H=(e,t,n)=>lf(e,typeof t!="symbol"?t+"":t,n);const x=require("./index-DxwppshT.cjs"),M=require("@mui/material"),oe=require("mobx-react-lite"),$=require("react"),fe=require("react-i18next"),b=require("prop-types"),de=require("./index-CqMZL0FV.cjs"),Qe=require("@mui/x-data-grid"),bu=require("lodash-es"),he=require("mobx"),Ee=require("@wandelbots/nova-js"),vu=require("./LoadingCover-r2yhJZF9.cjs"),Nr=require("@mui/icons-material"),cf=require("@emotion/styled"),uf=require("@emotion/react"),df=require("@mui/x-charts"),ms=require("three");function Su(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const j=Su($),Za=Su(ms);function hf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}/*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */var gs=function(e,t){return gs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i])},gs(e,t)};function wu(e,t){gs(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function ff(e){var t=typeof Symbol=="function"&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function pf(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],s;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o}function mf(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(pf(arguments[t]));return e}var Eu=(function(){function e(t,n){this.target=n,this.type=t}return e})(),gf=(function(e){wu(t,e);function t(n,r){var i=e.call(this,"error",r)||this;return i.message=n.message,i.error=n,i}return t})(Eu),yf=(function(e){wu(t,e);function t(n,r,i){n===void 0&&(n=1e3),r===void 0&&(r="");var o=e.call(this,"close",i)||this;return o.wasClean=!0,o.code=n,o.reason=r,o}return t})(Eu);/*! * Reconnecting WebSocket * by Pedro Ladaria <pedro.ladaria@gmail.com> * https://github.com/pladaria/reconnecting-websocket * License MIT */var xf=function(){if(typeof WebSocket<"u")return WebSocket},bf=function(e){return typeof e<"u"&&!!e&&e.CLOSING===2},Xt={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0},vf=(function(){function e(t,n,r){var i=this;r===void 0&&(r={}),this._listeners={error:[],message:[],open:[],close:[]},this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._binaryType="blob",this._closeCalled=!1,this._messageQueue=[],this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=function(o){i._debug("open event");var s=i._options.minUptime,a=s===void 0?Xt.minUptime:s;clearTimeout(i._connectTimeout),i._uptimeTimeout=setTimeout(function(){return i._acceptOpen()},a),i._ws.binaryType=i._binaryType,i._messageQueue.forEach(function(l){return i._ws.send(l)}),i._messageQueue=[],i.onopen&&i.onopen(o),i._listeners.open.forEach(function(l){return i._callEventListener(o,l)})},this._handleMessage=function(o){i._debug("message event"),i.onmessage&&i.onmessage(o),i._listeners.message.forEach(function(s){return i._callEventListener(o,s)})},this._handleError=function(o){i._debug("error event",o.message),i._disconnect(void 0,o.message==="TIMEOUT"?"timeout":void 0),i.onerror&&i.onerror(o),i._debug("exec error listeners"),i._listeners.error.forEach(function(s){return i._callEventListener(o,s)}),i._connect()},this._handleClose=function(o){i._debug("close event"),i._clearTimeouts(),i._shouldReconnect&&i._connect(),i.onclose&&i.onclose(o),i._listeners.close.forEach(function(s){return i._callEventListener(o,s)})},this._url=t,this._protocols=n,this._options=r,this._options.startClosed&&(this._shouldReconnect=!1),this._connect()}return Object.defineProperty(e,"CONNECTING",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(e,"OPEN",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSING",{get:function(){return 2},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSED",{get:function(){return 3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CONNECTING",{get:function(){return e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OPEN",{get:function(){return e.OPEN},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSING",{get:function(){return e.CLOSING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSED",{get:function(){return e.CLOSED},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"binaryType",{get:function(){return this._ws?this._ws.binaryType:this._binaryType},set:function(t){this._binaryType=t,this._ws&&(this._ws.binaryType=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"retryCount",{get:function(){return Math.max(this._retryCount,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bufferedAmount",{get:function(){var t=this._messageQueue.reduce(function(n,r){return typeof r=="string"?n+=r.length:r instanceof Blob?n+=r.size:n+=r.byteLength,n},0);return t+(this._ws?this._ws.bufferedAmount:0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"extensions",{get:function(){return this._ws?this._ws.extensions:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"protocol",{get:function(){return this._ws?this._ws.protocol:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"readyState",{get:function(){return this._ws?this._ws.readyState:this._options.startClosed?e.CLOSED:e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"url",{get:function(){return this._ws?this._ws.url:""},enumerable:!0,configurable:!0}),e.prototype.close=function(t,n){if(t===void 0&&(t=1e3),this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),!this._ws){this._debug("close enqueued: no ws instance");return}if(this._ws.readyState===this.CLOSED){this._debug("close: already closed");return}this._ws.close(t,n)},e.prototype.reconnect=function(t,n){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,!this._ws||this._ws.readyState===this.CLOSED?this._connect():(this._disconnect(t,n),this._connect())},e.prototype.send=function(t){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",t),this._ws.send(t);else{var n=this._options.maxEnqueuedMessages,r=n===void 0?Xt.maxEnqueuedMessages:n;this._messageQueue.length<r&&(this._debug("enqueue",t),this._messageQueue.push(t))}},e.prototype.addEventListener=function(t,n){this._listeners[t]&&this._listeners[t].push(n)},e.prototype.dispatchEvent=function(t){var n,r,i=this._listeners[t.type];if(i)try{for(var o=ff(i),s=o.next();!s.done;s=o.next()){var a=s.value;this._callEventListener(t,a)}}catch(l){n={error:l}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!0},e.prototype.removeEventListener=function(t,n){this._listeners[t]&&(this._listeners[t]=this._listeners[t].filter(function(r){return r!==n}))},e.prototype._debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._options.debug&&console.log.apply(console,mf(["RWS>"],t))},e.prototype._getNextDelay=function(){var t=this._options,n=t.reconnectionDelayGrowFactor,r=n===void 0?Xt.reconnectionDelayGrowFactor:n,i=t.minReconnectionDelay,o=i===void 0?Xt.minReconnectionDelay:i,s=t.maxReconnectionDelay,a=s===void 0?Xt.maxReconnectionDelay:s,l=0;return this._retryCount>0&&(l=o*Math.pow(r,this._retryCount-1),l>a&&(l=a)),this._debug("next delay",l),l},e.prototype._wait=function(){var t=this;return new Promise(function(n){setTimeout(n,t._getNextDelay())})},e.prototype._getNextUrl=function(t){if(typeof t=="string")return Promise.resolve(t);if(typeof t=="function"){var n=t();if(typeof n=="string")return Promise.resolve(n);if(n.then)return n}throw Error("Invalid URL")},e.prototype._connect=function(){var t=this;if(!(this._connectLock||!this._shouldReconnect)){this._connectLock=!0;var n=this._options,r=n.maxRetries,i=r===void 0?Xt.maxRetries:r,o=n.connectionTimeout,s=o===void 0?Xt.connectionTimeout:o,a=n.WebSocket,l=a===void 0?xf():a;if(this._retryCount>=i){this._debug("max retries reached",this._retryCount,">=",i);return}if(this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),!bf(l))throw Error("No valid WebSocket class provided");this._wait().then(function(){return t._getNextUrl(t._url)}).then(function(c){t._closeCalled||(t._debug("connect",{url:c,protocols:t._protocols}),t._ws=t._protocols?new l(c,t._protocols):new l(c),t._ws.binaryType=t._binaryType,t._connectLock=!1,t._addListeners(),t._connectTimeout=setTimeout(function(){return t._handleTimeout()},s))})}},e.prototype._handleTimeout=function(){this._debug("timeout event"),this._handleError(new gf(Error("TIMEOUT"),this))},e.prototype._disconnect=function(t,n){if(t===void 0&&(t=1e3),this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(t,n),this._handleClose(new yf(t,n,this))}catch{}}},e.prototype._acceptOpen=function(){this._debug("accept open"),this._retryCount=0},e.prototype._callEventListener=function(t,n){"handleEvent"in n?n.handleEvent(t):n(t)},e.prototype._removeListeners=function(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))},e.prototype._addListeners=function(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))},e.prototype._clearTimeouts=function(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)},e})(),Sf=class extends vf{constructor(e,t={}){console.log("Opening websocket to",e),super(()=>this.targetUrl||e,void 0,{startClosed:!0}),this.opts=t,this.disposed=!1,Object.defineProperty(this,"url",{get(){return this.targetUrl}}),this.targetUrl=e,this.addEventListener("open",()=>{console.log(`Websocket to ${this.url} opened`)}),this.addEventListener("message",r=>{this.receivedFirstMessage||(this.receivedFirstMessage=r)}),this.addEventListener("close",()=>{console.log(`Websocket to ${this.url} closed`)});const n=this.reconnect;this.reconnect=()=>{this.opts.mock?this.opts.mock.handleWebsocketConnection(this):n.apply(this)},this.reconnect()}changeUrl(e){this.receivedFirstMessage=void 0,this.targetUrl=e,this.reconnect()}sendJson(e){this.opts.mock?this.opts.mock.handleWebsocketMessage(this,JSON.stringify(e)):this.send(JSON.stringify(e))}dispose(){this.close(),this.disposed=!0,this.opts.onDispose&&this.opts.onDispose()}async opened(){return new Promise((e,t)=>{this.readyState===WebSocket.OPEN?e():(this.addEventListener("open",()=>e()),this.addEventListener("error",t))})}async closed(){return new Promise((e,t)=>{this.readyState===WebSocket.CLOSED?e():(this.addEventListener("close",()=>e()),this.addEventListener("error",t))})}async firstMessage(){return this.receivedFirstMessage?this.receivedFirstMessage:new Promise((e,t)=>{const n=i=>{this.receivedFirstMessage=i,this.removeEventListener("message",n),this.removeEventListener("error",r),e(i)},r=i=>{this.removeEventListener("message",n),this.removeEventListener("error",r),t(i)};this.addEventListener("message",n),this.addEventListener("error",r)})}async nextMessage(){return new Promise((e,t)=>{const n=i=>{this.removeEventListener("message",n),this.removeEventListener("error",r),e(i)},r=i=>{this.removeEventListener("message",n),this.removeEventListener("error",r),t(i)};this.addEventListener("message",n),this.addEventListener("error",r)})}},wf=class{constructor(){this.available=typeof window<"u"&&!!window.localStorage}getJSON(e){if(!this.available)return null;const t=window.localStorage.getItem(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}setJSON(e,t){if(!this.available)return null;window.localStorage.setItem(e,JSON.stringify(t))}delete(e){if(!this.available)return null;window.localStorage.removeItem(e)}setString(e,t){if(!this.available)return null;window.localStorage.setItem(e,t)}getString(e){return this.available?window.localStorage.getItem(e):null}};const zr=new wf;function ys(e,t={}){const{scheme:n,defaultScheme:r}=t,i=/^[a-zA-Z]+:\/\//;return n?(e=e.replace(i,""),e=`${n}://${e}`):r&&!i.test(e)&&(e=`${r}://${e}`),new URL(e)}function Ef(e,t={}){try{return ys(e,t)}catch{return}}function Tf(e){var t;return(t=Ef(e,{defaultScheme:"http"}))!=null&&t.host.endsWith(".wandelbots.io")?ys(e,{defaultScheme:"https"}):ys(e,{defaultScheme:"http"})}const zo={dev:{domain:"https://auth.portal.dev.wandelbots.io",clientId:"fLbJD0RLp5r2Dpucm5j8BjwMR6Hunfha"},stg:{domain:"https://auth.portal.stg.wandelbots.io",clientId:"joVDeD9e786WzFNSGCqoVq7HNkWt5j6s"},prod:{domain:"https://auth.portal.wandelbots.io",clientId:"J7WJUi38xVQdJAEBNRT9Xw1b0fXDb4J2"}},Cf=e=>{if(e.host.endsWith(".dev.wandelbots.io"))return zo.dev;if(e.host.endsWith(".stg.wandelbots.io"))return zo.stg;if(e.host.endsWith(".wandelbots.io"))return zo.prod;throw new Error(`Unable to authenticate with NOVA instance "${e}". Auth0 login is only supported for cloud instances with hosts of the form "**.wandelbots.io".`)},_f=async e=>{if(typeof window>"u")throw new Error("Access token must be set to use NovaClient when not in a browser environment.");if(e.origin===window.location.origin)throw window.location.reload(),new Error("Failed to reload page to get auth details, please refresh manually");const{Auth0Client:t}=await Promise.resolve().then(()=>require("./auth0-spa-js.production.esm-DTiWXa87.cjs")),n=Cf(e),r=new t({domain:n.domain,clientId:n.clientId??"",useRefreshTokens:!1,authorizationParams:{audience:"nova-api",redirect_uri:window.location.origin}});if(window.location.search.includes("code=")&&window.location.search.includes("state=")){const{appState:i}=await r.handleRedirectCallback();window.history.replaceState({},document.title,(i==null?void 0:i.returnTo)||window.location.pathname)}else await r.loginWithRedirect();return await r.getTokenSilently()};function Mf(e){var t=[];if(e.length===0)return"";if(typeof e[0]!="string")throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var n=e.shift();e[0]=n+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var r=0;r<e.length;r++){var i=e[r];if(typeof i!="string")throw new TypeError("Url must be a string. Received "+i);i!==""&&(r>0&&(i=i.replace(/^[\/]+/,"")),r<e.length-1?i=i.replace(/[\/]+$/,""):i=i.replace(/[\/]+$/,"/"),t.push(i))}var o=t.join("/");o=o.replace(/\/(\?|&|#[^!])/g,"$1");var s=o.split("?");return o=s.shift()+(s.length>0?"?":"")+s.join("&"),o}function Fo(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),Mf(e)}var He={},Qa;function Rf(){if(Qa)return He;Qa=1,Object.defineProperty(He,"__esModule",{value:!0}),He.PathError=He.TokenData=void 0,He.parse=c,He.compile=u,He.match=f,He.pathToRegexp=m,He.stringify=E;const e="/",t=C=>C,n=/^[$_\p{ID_Start}]$/u,r=/^[$\u200c\u200d\p{ID_Continue}]$/u,i={"{":"{","}":"}","(":"(",")":")","[":"[","]":"]","+":"+","?":"?","!":"!"};function o(C){return C.replace(/[{}()\[\]+?!:*\\]/g,"\\$&")}function s(C){return C.replace(/[.+*?^${}()[\]|/\\]/g,"\\$&")}class a{constructor(I,k){this.tokens=I,this.originalPath=k}}He.TokenData=a;class l extends TypeError{constructor(I,k){let P=I;k&&(P+=`: ${k}`),P+="; visit https://git.new/pathToRegexpError for info",super(P),this.originalPath=k}}He.PathError=l;function c(C,I={}){const{encodePath:k=t}=I,P=[...C],D=[];let g=0,A=0;function _(){let N="";if(n.test(P[g]))do N+=P[g++];while(r.test(P[g]));else if(P[g]==='"'){let W=g;for(;g++<P.length;){if(P[g]==='"'){g++,W=0;break}P[g]==="\\"&&g++,N+=P[g]}if(W)throw new l(`Unterminated quote at index ${W}`,C)}if(!N)throw new l(`Missing parameter name at index ${g}`,C);return N}for(;g<P.length;){const N=P[g],W=i[N];W?D.push({type:W,index:g++,value:N}):N==="\\"?D.push({type:"escape",index:g++,value:P[g++]}):N===":"?D.push({type:"param",index:g++,value:_()}):N==="*"?D.push({type:"wildcard",index:g++,value:_()}):D.push({type:"char",index:g++,value:N})}D.push({type:"end",index:g,value:""});function z(N){const W=[];for(;;){const B=D[A++];if(B.type===N)break;if(B.type==="char"||B.type==="escape"){let Z=B.value,Q=D[A];for(;Q.type==="char"||Q.type==="escape";)Z+=Q.value,Q=D[++A];W.push({type:"text",value:k(Z)});continue}if(B.type==="param"||B.type==="wildcard"){W.push({type:B.type,name:B.value});continue}if(B.type==="{"){W.push({type:"group",tokens:z("}")});continue}throw new l(`Unexpected ${B.type} at index ${B.index}, expected ${N}`,C)}return W}return new a(z("end"),C)}function u(C,I={}){const{encode:k=encodeURIComponent,delimiter:P=e}=I,D=typeof C=="object"?C:c(C,I),g=d(D.tokens,P,k);return function(_={}){const[z,...N]=g(_);if(N.length)throw new TypeError(`Missing parameters: ${N.join(", ")}`);return z}}function d(C,I,k){const P=C.map(D=>h(D,I,k));return D=>{const g=[""];for(const A of P){const[_,...z]=A(D);g[0]+=_,g.push(...z)}return g}}function h(C,I,k){if(C.type==="text")return()=>[C.value];if(C.type==="group"){const D=d(C.tokens,I,k);return g=>{const[A,..._]=D(g);return _.length?[""]:[A]}}const P=k||t;return C.type==="wildcard"&&k!==!1?D=>{const g=D[C.name];if(g==null)return["",C.name];if(!Array.isArray(g)||g.length===0)throw new TypeError(`Expected "${C.name}" to be a non-empty array`);return[g.map((A,_)=>{if(typeof A!="string")throw new TypeError(`Expected "${C.name}/${_}" to be a string`);return P(A)}).join(I)]}:D=>{const g=D[C.name];if(g==null)return["",C.name];if(typeof g!="string")throw new TypeError(`Expected "${C.name}" to be a string`);return[P(g)]}}function f(C,I={}){const{decode:k=decodeURIComponent,delimiter:P=e}=I,{regexp:D,keys:g}=m(C,I),A=g.map(_=>k===!1?t:_.type==="param"?k:z=>z.split(P).map(k));return function(z){const N=D.exec(z);if(!N)return!1;const W=N[0],B=Object.create(null);for(let Z=1;Z<N.length;Z++){if(N[Z]===void 0)continue;const Q=g[Z-1],ee=A[Z-1];B[Q.name]=ee(N[Z])}return{path:W,params:B}}}function m(C,I={}){const{delimiter:k=e,end:P=!0,sensitive:D=!1,trailing:g=!0}=I,A=[],_=D?"":"i",z=[];for(const B of p(C,[])){const Z=typeof B=="object"?B:c(B,I);for(const Q of y(Z.tokens,0,[]))z.push(v(Q,k,A,Z.originalPath))}let N=`^(?:${z.join("|")})`;return g&&(N+=`(?:${s(k)}$)?`),N+=P?"$":`(?=${s(k)}|$)`,{regexp:new RegExp(N,_),keys:A}}function p(C,I){if(Array.isArray(C))for(const k of C)p(k,I);else I.push(C);return I}function*y(C,I,k){if(I===C.length)return yield k;const P=C[I];if(P.type==="group")for(const D of y(P.tokens,0,k.slice()))yield*y(C,I+1,D);else k.push(P);yield*y(C,I+1,k)}function v(C,I,k,P){let D="",g="",A=!0;for(const _ of C){if(_.type==="text"){D+=s(_.value),g+=_.value,A||(A=_.value.includes(I));continue}if(_.type==="param"||_.type==="wildcard"){if(!A&&!g)throw new l(`Missing text before "${_.name}" ${_.type}`,P);_.type==="param"?D+=`(${T(I,A?"":g)}+)`:D+="([\\s\\S]+)",k.push(_),g="",A=!1;continue}}return D}function T(C,I){return I.length<2?C.length<2?`[^${s(C+I)}]`:`(?:(?!${s(C)})[^${s(I)}])`:C.length<2?`(?:(?!${s(I)})[^${s(C)}])`:`(?:(?!${s(I)}|${s(C)})[\\s\\S])`}function w(C){let I="",k=0;function P(D){return R(D)&&S(C[k])?D:JSON.stringify(D)}for(;k<C.length;){const D=C[k++];if(D.type==="text"){I+=o(D.value);continue}if(D.type==="group"){I+=`{${w(D.tokens)}}`;continue}if(D.type==="param"){I+=`:${P(D.name)}`;continue}if(D.type==="wildcard"){I+=`*${P(D.name)}`;continue}throw new TypeError(`Unknown token type: ${D.type}`)}return I}function E(C){return w(C.tokens)}function R(C){const[I,...k]=C;return n.test(I)&&k.every(P=>r.test(P))}function S(C){return C&&C.type==="text"?!r.test(C.value[0]):!0}return He}var Af=Rf(),If=class{constructor(e,t){this.cellId=e,this.opts=t,this.system=this.withUnwrappedResponsesOnly(de.SystemApi),this.cell=this.withUnwrappedResponsesOnly(de.CellApi),this.motionGroup=this.withCellId(de.MotionGroupApi),this.motionGroupModels=this.withCellId(de.MotionGroupModelsApi),this.controller=this.withCellId(de.ControllerApi),this.controllerIOs=this.withCellId(de.ControllerInputsOutputsApi),this.trajectoryPlanning=this.withCellId(de.TrajectoryPlanningApi),this.trajectoryExecution=this.withCellId(de.TrajectoryExecutionApi),this.trajectoryCaching=this.withCellId(de.TrajectoryCachingApi),this.application=this.withCellId(de.ApplicationApi),this.applicationGlobal=this.withUnwrappedResponsesOnly(de.ApplicationApi),this.jogging=this.withCellId(de.JoggingApi),this.kinematics=this.withCellId(de.KinematicsApi),this.busInputsOutputs=this.withCellId(de.BUSInputsOutputsApi),this.virtualController=this.withCellId(de.VirtualControllerApi),this.virtualControllerBehavior=this.withCellId(de.VirtualControllerBehaviorApi),this.virtualControllerIOs=this.withCellId(de.VirtualControllerInputsOutputsApi),this.storeObject=this.withCellId(de.StoreObjectApi),this.storeCollisionComponents=this.withCellId(de.StoreCollisionComponentsApi),this.storeCollisionSetups=this.withCellId(de.StoreCollisionSetupsApi)}withCellId(e){const t=new e({...this.opts,isJsonMime:n=>n==="application/json"},this.opts.basePath??"",this.opts.axiosInstance??x.axios.create());for(const n of Reflect.ownKeys(Reflect.getPrototypeOf(t)))if(n!=="constructor"&&typeof t[n]=="function"){const r=t[n];t[n]=(...i)=>r.apply(t,[this.cellId,...i]).then(o=>o.data)}return t}withUnwrappedResponsesOnly(e){const t=new e({...this.opts,isJsonMime:n=>n==="application/json"},this.opts.basePath??"",this.opts.axiosInstance??x.axios.create());for(const n of Reflect.ownKeys(Reflect.getPrototypeOf(t)))if(n!=="constructor"&&typeof t[n]=="function"){const r=t[n];t[n]=(...i)=>r.apply(t,i).then(o=>o.data)}return t}},jf=class{constructor(){this.connections=[]}async handleAPIRequest(e){var i,o,s;const t=[{method:"GET",path:"/cells/:cellId/controllers",handle(){return["mock-ur5e"]}},{method:"GET",path:"/cells/:cellId/controllers/:controllerId",handle(){return{configuration:{initial_joint_position:"[0,-1.571,-1.571,-1.571,1.571,-1.571,0]",kind:"VirtualController",manufacturer:"universalrobots",type:"universalrobots-ur5e"},name:"mock-ur5"}}},{method:"GET",path:"/cells/:cellId/controllers/:controllerId/state",handle(){return{mode:"MODE_CONTROL",last_error:[],timestamp:"2025-10-16T09:19:26.634534092Z",sequence_number:1054764,controller:"mock-ur5e",operation_mode:"OPERATION_MODE_AUTO",safety_state:"SAFETY_STATE_NORMAL",velocity_override:100,motion_groups:[{timestamp:"2025-10-16T09:19:26.634534092Z",sequence_number:1054764,motion_group:"0@mock-ur5e",controller:"mock-ur5e",joint_position:[1.487959623336792,-1.8501918315887451,1.8003005981445312,6.034560203552246,1.4921919107437134,1.593459963798523],joint_limit_reached:{limit_reached:[!1,!1,!1,!1,!1,!1]},joint_torque:[],joint_current:[0,0,0,0,0,0],flange_pose:{position:[107.6452433732927,-409.0402987746852,524.2402132330305],orientation:[.9874434028353319,-.986571714997442,1.3336589451098142]},tcp:"Flange",tcp_pose:{position:[107.6452433732927,-409.0402987746852,524.2402132330305],orientation:[.9874434028353319,-.986571714997442,1.3336589451098142]},payload:"",coordinate_system:"",standstill:!0}]}}},{method:"GET",path:"/cells/:cellId/controllers/:controllerId/motion-groups/:motionGroupId/description",handle(){return{motion_group_model:"UniversalRobots_UR5e",mounting:{position:[0,0,0],orientation:[0,0,0]},tcps:{Flange:{name:"Default-Flange",pose:{position:[0,0,0],orientation:[0,0,0]}}},payloads:{"FPay-0":{name:"FPay-0",payload:0,center_of_mass:[0,0,0],moment_of_inertia:[0,0,0]}},cycle_time:8,dh_parameters:[{alpha:1.5707963267948966,d:162.25},{a:-425},{a:-392.2},{alpha:1.5707963267948966,d:133.3},{alpha:-1.5707963267948966,d:99.7},{d:99.6}],operation_limits:{auto_limits:{joints:[{position:{lower_limit:-6.283185307179586,upper_limit:6.283185307179586},velocity:3.34159255027771,acceleration:40,torque:150},{position:{lower_limit:-6.283185307179586,upper_limit:6.283185307179586},velocity:3.34159255027771,acceleration:40,torque:150},{position:{lower_limit:-6.283185307179586,upper_limit:6.283185307179586},velocity:3.34159255027771,acceleration:40,torque:150},{position:{lower_limit:-6.283185307179586,upper_limit:6.283185307179586},velocity:3.34159255027771,acceleration:40,torque:28},{position:{lower_limit:-6.283185307179586,upper_limit:6.283185307179586},velocity:3.34159255027771,acceleration:40,torque:28},{position:{lower_limit:-6.283185307179586,upper_limit:6.283185307179586},velocity:3.34159255027771,acceleration:40,torque:28}],tcp:{velocity:5e3},elbow:{velocity:5e3},flange:{velocity:5e3}},manual_limits:{joints:[{position:{lower_limit:-6.283185307179586,upper_limit:6.283185307179586},velocity:3.34159255027771,acceleration:40,torque:150},{position:{lower_limit:-6.283185307179586,upper_limit:6.283185307179586},velocity:3.34159255027771,acceleration:40,torque:150},{position:{lower_limit:-6.283185307179586,upper_limit:6.283185307179586},velocity:3.34159255027771,acceleration:40,torque:150},{position:{lower_limit:-6.283185307179586,upper_limit:6.283185307179586},velocity:3.34159255027771,acceleration:40,torque:28},{position:{lower_limit:-6.283185307179586,upper_limit:6.283185307179586},velocity:3.34159255027771,acceleration:40,torque:28},{position:{lower_limit:-6.283185307179586,upper_limit:6.283185307179586},velocity:3.34159255027771,acceleration:40,torque:28}],tcp:{velocity:5e3}},manual_t1_limits:{joints:[{position:{lower_limit:-6.283185307179586,upper_limit:6.283185307179586},velocity:3.34159255027771,acceleration:40,torque:150},{position:{lower_limit:-6.283185307179586,upper_limit:6.283185307179586},velocity:3.34159255027771,acceleration:40,torque:150},{position:{lower_limit:-6.283185307179586,upper_limit:6.283185307179586},velocity:3.34159255027771,acceleration:40,torque:150},{position:{lower_limit:-6.283185307179586,upper_limit:6.283185307179586},velocity:3.34159255027771,acceleration:40,torque:28},{position:{lower_limit:-6.283185307179586,upper_limit:6.283185307179586},velocity:3.34159255027771,acceleration:40,torque:28},{position:{lower_limit:-6.283185307179586,upper_limit:6.283185307179586},velocity:3.34159255027771,acceleration:40,torque:28}],tcp:{velocity:5e3}},manual_t2_limits:{joints:[{position:{lower_limit:-6.283185307179586,upper_limit:6.283185307179586},velocity:3.34159255027771,acceleration:40,torque:150},{position:{lower_limit:-6.283185307179586,upper_limit:6.283185307179586},velocity:3.34159255027771,acceleration:40,torque:150},{position:{lower_limit:-6.283185307179586,upper_limit:6.283185307179586},velocity:3.34159255027771,acceleration:40,torque:150},{position:{lower_limit:-6.283185307179586,upper_limit:6.283185307179586},velocity:3.34159255027771,acceleration:40,torque:28},{position:{lower_limit:-6.283185307179586,upper_limit:6.283185307179586},velocity:3.34159255027771,acceleration:40,torque:28},{position:{lower_limit:-6.283185307179586,upper_limit:6.283185307179586},velocity:3.34159255027771,acceleration:40,torque:28}],tcp:{velocity:5e3}}},serial_number:"WBVirtualRobot"}}},{method:"GET",path:"/cells/:cellId/controllers/:controllerId/coordinate-systems",handle(){return[{coordinate_system:"",name:"world",reference_coordinate_system:"",position:[0,0,0],orientation:[0,0,0],orientation_type:"ROTATION_VECTOR"},{coordinate_system:"CS-0",name:"Default-CS",reference_coordinate_system:"",position:[0,0,0],orientation:[0,0,0],orientation_type:"ROTATION_VECTOR"}]}}],n=((i=e.method)==null?void 0:i.toUpperCase())||"GET",r=`/cells${(s=(o=e.url)==null?void 0:o.split("/cells")[1])==null?void 0:s.split("?")[0]}`;for(const a of t){const l=Af.match(a.path)(r||"");if(n===a.method&&l){const c=a.handle();return{status:200,statusText:"Success",data:JSON.stringify(c),headers:{},config:e,request:{responseURL:e.url}}}}throw new x.AxiosError(`No mock handler matched this request: ${n} ${r}`,"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(kf)})),e.url.includes("/execution/jogging")&&e.dispatchEvent(new MessageEvent("message",{data:JSON.stringify({result:{message:"string",kind:"INITIALIZE_RECEIVED"}})}))},10)}handleWebsocketMessage(e,t){console.log(`Received message on ${e.url}`,t)}};const kf={result:{motion_group:"0@universalrobots-ur5e",controller:"universalrobots-ur5e",timestamp:new Date().toISOString(),sequence_number:1,joint_position:[1.1699999570846558,-1.5700000524520874,1.3600000143051147,1.0299999713897705,1.2899999618530273,1.2799999713897705],joint_limit_reached:{limit_reached:[!1,!1,!1,!1,!1,!1]},standstill:!1,flange_pose:{position:[1.3300010259703043,-409.2680714682808,531.0203477065281],orientation:[1.7564919306270736,-1.7542521568325058,.7326972590614671]},tcp_pose:{position:[1.3300010259703043,-409.2680714682808,531.0203477065281],orientation:[1.7564919306270736,-1.7542521568325058,.7326972590614671]}}};var Of=class{constructor(e){this.authPromise=null,this.accessToken=null;const t=e.cellId??"cell";this.config={cellId:t,...e},this.accessToken=e.accessToken||zr.getString("wbjs.access_token")||null,this.config.instanceUrl==="https://mock.example.com"&&(this.mock=new jf),this.instanceUrl=Tf(this.config.instanceUrl);const n=x.axios.create({baseURL:Fo(this.instanceUrl.href,"/api/v2"),headers:typeof window<"u"&&window.location.origin.includes("localhost")?{}:{"X-Wandelbots-Client":"Wandelbots-Nova-JS-SDK"}});n.interceptors.request.use(async r=>(r.headers.Authorization||(this.accessToken?r.headers.Authorization=`Bearer ${this.accessToken}`:this.config.username&&this.config.password&&(r.headers.Authorization=`Basic ${btoa(`${e.username}:${e.password}`)}`)),r)),typeof window<"u"&&n.interceptors.response.use(r=>r,async r=>{var i,o;if(x.isAxiosError(r))if(((i=r.response)==null?void 0:i.status)===401)try{if(await this.renewAuthentication(),r.config)return this.accessToken?r.config.headers.Authorization=`Bearer ${this.accessToken}`:delete r.config.headers.Authorization,n.request(r.config)}catch(s){return Promise.reject(s)}else((o=r.response)==null?void 0:o.status)===503&&(await fetch(window.location.href)).status===503&&window.location.reload();return Promise.reject(r)}),this.api=new If(t,{...e,basePath:Fo(this.instanceUrl.href,"/api/v2"),isJsonMime:r=>r==="application/json",baseOptions:{...this.mock?{adapter:r=>this.mock.handleAPIRequest(r)}:{},...e.baseOptions},axiosInstance:n})}async renewAuthentication(){if(this.authPromise)return;const e=zr.getString("wbjs.access_token");if(e&&this.accessToken!==e){this.accessToken=e;return}this.authPromise=_f(this.instanceUrl);try{this.accessToken=await this.authPromise,this.accessToken?zr.setString("wbjs.access_token",this.accessToken):zr.delete("wbjs.access_token")}finally{this.authPromise=null}}makeWebsocketURL(e){const t=new URL(Fo(this.instanceUrl.href,`/api/v2/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 Sf(this.makeWebsocketURL(e),{mock:this.mock})}};function Pf(e){var o,s,a,l,c,u;const t=[((o=e.position)==null?void 0:o[0])??0,((s=e.position)==null?void 0:s[1])??0,((a=e.position)==null?void 0:a[2])??0],n=[((l=e.orientation)==null?void 0:l[0])??0,((c=e.orientation)==null?void 0:c[1])??0,((u=e.orientation)==null?void 0:u[2])??0],r=t.map(d=>d.toFixed(1)),i=n.map(d=>d.toFixed(4));return`(${r.concat(i).join(", ")})`}const Df=e=>x.jsxRuntimeExports.jsx(M.SvgIcon,{...e,viewBox:"0 0 10 8",children:x.jsxRuntimeExports.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"})}),$f=x.externalizeComponent(oe.observer(e=>{const{appIcon:t,appName:n,apps:r=[],onAppSelect:i,disabled:o=!1,sx:s}=e,[a,l]=$.useState(null),c=!!a,u=f=>{l(f.currentTarget)},d=()=>{l(null)},h=f=>{d(),f.onClick?f.onClick():f.href&&(window.location.href=f.href),i==null||i(f)};return x.jsxRuntimeExports.jsxs(x.jsxRuntimeExports.Fragment,{children:[x.jsxRuntimeExports.jsx(M.AppBar,{position:"static",sx:{boxShadow:"none",backgroundImage:"none","& .MuiAppBar-root":{backgroundImage:"none",backgroundColor:"transparent"},...s},children:x.jsxRuntimeExports.jsxs(M.Toolbar,{sx:{minHeight:"62px !important"},children:[x.jsxRuntimeExports.jsx(M.Box,{sx:{mr:1,display:"flex",alignItems:"center"},children:t}),x.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",alignItems:"center",flexGrow:1},children:[x.jsxRuntimeExports.jsx(M.Typography,{component:"h1",sx:{fontWeight:"bold",fontSize:"1rem"},children:n}),r.length>0&&x.jsxRuntimeExports.jsx(M.IconButton,{color:"inherit","aria-label":"switch app","aria-controls":"app-menu","aria-haspopup":"true",onClick:u,disabled:o,sx:{ml:1,width:28,height:28,borderRadius:"6px",padding:0,backgroundColor:f=>M.alpha(f.palette.common.white,.1),opacity:1,"&:hover":{backgroundColor:f=>M.alpha(f.palette.common.white,.16)},"& .MuiSvgIcon-root":{fontSize:"8px",width:"8px",height:"6px"}},children:x.jsxRuntimeExports.jsx(Df,{})})]})]})}),x.jsxRuntimeExports.jsx(M.Backdrop,{open:c,onClick:d,sx:{backdropFilter:"blur(4px)",backgroundColor:"rgba(0, 0, 0, 0.3)",zIndex:f=>f.zIndex.modal-1}}),x.jsxRuntimeExports.jsx(M.Menu,{id:"app-menu",anchorEl:a,open:c,onClose:d,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},sx:{zIndex:f=>f.zIndex.modal,"& .MuiPaper-root":{minWidth:200,mt:1}},children:r.map(f=>x.jsxRuntimeExports.jsxs(M.MenuItem,{onClick:()=>h(f),children:[x.jsxRuntimeExports.jsx(M.Box,{sx:{display:"flex",alignItems:"center"},children:f.icon}),x.jsxRuntimeExports.jsx(M.Typography,{variant:"body1",sx:{ml:2},children:f.name})]},f.id))})]})}));function G(){return G=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},G.apply(null,arguments)}function ft(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function wr(e,t,n=void 0){const r={};for(const i in e){const o=e[i];let s="",a=!0;for(let l=0;l<o.length;l+=1){const c=o[l];c&&(s+=(a===!0?"":" ")+t(c),a=!1,n&&n[c]&&(s+=" "+n[c]))}r[i]=s}return r}function Tu(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Tu(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function De(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Tu(e))&&(r&&(r+=" "),r+=t);return r}function Bt(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}const Gs="$$material";function Lf(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&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 Nf={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 zf(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Ff=/[A-Z]|^ms/g,Bf=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Cu=function(t){return t.charCodeAt(1)===45},el=function(t){return t!=null&&typeof t!="boolean"},Bo=zf(function(e){return Cu(e)?e:e.replace(Ff,"-$&").toLowerCase()}),tl=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(Bf,function(r,i,o){return Ft={name:i,styles:o,next:Ft},i})}return Nf[t]!==1&&!Cu(t)&&typeof n=="number"&&n!==0?n+"px":n};function pi(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return Ft={name:i.name,styles:i.styles,next:Ft},i.name;var o=n;if(o.styles!==void 0){var s=o.next;if(s!==void 0)for(;s!==void 0;)Ft={name:s.name,styles:s.styles,next:Ft},s=s.next;var a=o.styles+";";return a}return Gf(e,t,n)}}var l=n;return l}function Gf(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=pi(e,t,n[i])+";";else for(var o in n){var s=n[o];if(typeof s!="object"){var a=s;el(a)&&(r+=Bo(o)+":"+tl(o,a)+";")}else if(Array.isArray(s)&&typeof s[0]=="string"&&t==null)for(var l=0;l<s.length;l++)el(s[l])&&(r+=Bo(o)+":"+tl(o,s[l])+";");else{var c=pi(e,t,s);switch(o){case"animation":case"animationName":{r+=Bo(o)+":"+c+";";break}default:r+=o+"{"+c+"}"}}}return r}var nl=/label:\s*([^\s;{]+)\s*(;|$)/g,Ft;function Vf(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,i="";Ft=void 0;var o=e[0];if(o==null||o.raw===void 0)r=!1,i+=pi(n,t,o);else{var s=o;i+=s[0]}for(var a=1;a<e.length;a++)if(i+=pi(n,t,e[a]),r){var l=o;i+=l[a]}nl.lastIndex=0;for(var c="",u;(u=nl.exec(i))!==null;)c+="-"+u[1];var d=Lf(i)+c;return{name:d,styles:i,next:Ft}}/** * @mui/styled-engine v7.3.7 * * @license MIT * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */function Uf(e,t){const n=cf(e,t);return process.env.NODE_ENV!=="production"?(...r)=>{const i=typeof e=="string"?`"${e}"`:"component";return r.length===0?console.error([`MUI: Seems like you called \`styled(${i})()\` without a \`style\` argument.`,'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join(` `)):r.some(o=>o===void 0)&&console.error(`MUI: the styled(${i})(...args) API requires all its args to be defined.`),n(...r)}:n}function Wf(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const rl=[];function on(e){return rl[0]=e,Vf(rl)}var Fr={exports:{}},le={};/** * @license React * react-is.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var il;function Hf(){if(il)return le;il=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),s=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.for("react.view_transition"),f=Symbol.for("react.client.reference");function m(p){if(typeof p=="object"&&p!==null){var y=p.$$typeof;switch(y){case e:switch(p=p.type,p){case n:case i:case r:case l:case c:case h:return p;default:switch(p=p&&p.$$typeof,p){case s:case a:case d:case u:return p;case o:return p;default:return y}}case t:return y}}}return le.ContextConsumer=o,le.ContextProvider=s,le.Element=e,le.ForwardRef=a,le.Fragment=n,le.Lazy=d,le.Memo=u,le.Portal=t,le.Profiler=i,le.StrictMode=r,le.Suspense=l,le.SuspenseList=c,le.isContextConsumer=function(p){return m(p)===o},le.isContextProvider=function(p){return m(p)===s},le.isElement=function(p){return typeof p=="object"&&p!==null&&p.$$typeof===e},le.isForwardRef=function(p){return m(p)===a},le.isFragment=function(p){return m(p)===n},le.isLazy=function(p){return m(p)===d},le.isMemo=function(p){return m(p)===u},le.isPortal=function(p){return m(p)===t},le.isProfiler=function(p){return m(p)===i},le.isStrictMode=function(p){return m(p)===r},le.isSuspense=function(p){return m(p)===l},le.isSuspenseList=function(p){return m(p)===c},le.isValidElementType=function(p){return typeof p=="string"||typeof p=="function"||p===n||p===i||p===r||p===l||p===c||typeof p=="object"&&p!==null&&(p.$$typeof===d||p.$$typeof===u||p.$$typeof===s||p.$$typeof===o||p.$$typeof===a||p.$$typeof===f||p.getModuleId!==void 0)},le.typeOf=m,le}var ce={};/** * @license React * react-is.development.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var ol;function Yf(){return ol||(ol=1,process.env.NODE_ENV!=="production"&&(function(){function e(p){if(typeof p=="object"&&p!==null){var y=p.$$typeof;switch(y){case t:switch(p=p.type,p){case r:case o:case i:case c:case u:case f:return p;default:switch(p=p&&p.$$typeof,p){case a:case l:case h:case d:return p;case s:return p;default:return y}}case n:return y}}}var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.for("react.view_transition"),m=Symbol.for("react.client.reference");ce.ContextConsumer=s,ce.ContextProvider=a,ce.Element=t,ce.ForwardRef=l,ce.Fragment=r,ce.Lazy=h,ce.Memo=d,ce.Portal=n,ce.Profiler=o,ce.StrictMode=i,ce.Suspense=c,ce.SuspenseList=u,ce.isContextConsumer=function(p){return e(p)===s},ce.isContextProvider=function(p){return e(p)===a},ce.isElement=function(p){return typeof p=="object"&&p!==null&&p.$$typeof===t},ce.isForwardRef=function(p){return e(p)===l},ce.isFragment=function(p){return e(p)===r},ce.isLazy=function(p){return e(p)===h},ce.isMemo=function(p){return e(p)===d},ce.isPortal=function(p){return e(p)===n},ce.isProfiler=function(p){return e(p)===o},ce.isStrictMode=function(p){return e(p)===i},ce.isSuspense=function(p){return e(p)===c},ce.isSuspenseList=function(p){return e(p)===u},ce.isValidElementType=function(p){return typeof p=="string"||typeof p=="function"||p===r||p===o||p===i||p===c||p===u||typeof p=="object"&&p!==null&&(p.$$typeof===h||p.$$typeof===d||p.$$typeof===a||p.$$typeof===s||p.$$typeof===l||p.$$typeof===m||p.getModuleId!==void 0)},ce.typeOf=e})()),ce}var sl;function qf(){return sl||(sl=1,process.env.NODE_ENV==="production"?Fr.exports=Hf():Fr.exports=Yf()),Fr.exports}var mi=qf();function ct(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function _u(e){if(j.isValidElement(e)||mi.isValidElementType(e)||!ct(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=_u(e[n])}),t}function $e(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return ct(e)&&ct(t)&&Object.keys(t).forEach(i=>{j.isValidElement(t[i])||mi.isValidElementType(t[i])?r[i]=t[i]:ct(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&ct(e[i])?r[i]=$e(e[i],t[i],n):n.clone?r[i]=ct(t[i])?_u(t[i]):t[i]:r[i]=t[i]}),r}const Jf=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>({...n,[r.key]:r.val}),{})};function Kf(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...i}=e,o=Jf(t),s=Object.keys(o);function a(h){return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${n})`}function l(h){return`@media (max-width:${(typeof t[h]=="number"?t[h]:h)-r/100}${n})`}function c(h,f){const m=s.indexOf(f);return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${n}) and (max-width:${(m!==-1&&typeof t[s[m]]=="number"?t[s[m]]:f)-r/100}${n})`}function u(h){return s.indexOf(h)+1<s.length?c(h,s[s.indexOf(h)+1]):a(h)}function d(h){const f=s.indexOf(h);return f===0?a(s[1]):f===s.length-1?l(s[f]):c(h,s[s.indexOf(h)+1]).replace("@media","@media not all and")}return{keys:s,values:o,up:a,down:l,between:c,only:u,not:d,unit:n,...i}}function al(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(r=>r.startsWith("@container")).sort((r,i)=>{var s,a;const o=/min-width:\s*([0-9.]+)/;return+(((s=r.match(o))==null?void 0:s[1])||0)-+(((a=i.match(o))==null?void 0:a[1])||0)});return n.length?n.reduce((r,i)=>{const o=t[i];return delete r[i],r[i]=o,r},{...t}):t}function Xf(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function Zf(e,t){const n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n){if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV!=="production"?`MUI: The provided shorthand ${`(${t})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`. For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`:Bt(18,`(${t})`));return null}const[,r,i]=n,o=Number.isNaN(+r)?r||0:+r;return e.containerQueries(i).up(o)}function Qf(e){const t=(o,s)=>o.replace("@media",s?`@container ${s}`:"@container");function n(o,s){o.up=(...a)=>t(e.breakpoints.up(...a),s),o.down=(...a)=>t(e.breakpoints.down(...a),s),o.between=(...a)=>t(e.breakpoints.between(...a),s),o.only=(...a)=>t(e.breakpoints.only(...a),s),o.not=(...a)=>{const l=t(e.breakpoints.not(...a),s);return l.includes("not all and")?l.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):l}}const r={},i=o=>(n(r,o),r);return n(i),{...e,containerQueries:i}}const ep={borderRadius:4},Ut=process.env.NODE_ENV!=="production"?b.oneOfType([b.number,b.string,b.object,b.array]):{};function ar(e,t){return t?$e(e,t,{clone:!1}):e}const Bi={xs:0,sm:600,md:900,lg:1200,xl:1536},ll={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Bi[e]}px)`},tp={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:Bi[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function it(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const o=r.breakpoints||ll;return t.reduce((s,a,l)=>(s[o.up(o.keys[l])]=n(t[l]),s),{})}if(typeof t=="object"){const o=r.breakpoints||ll;return Object.keys(t).reduce((s,a)=>{if(Xf(o.keys,a)){const l=Zf(r.containerQueries?r:tp,a);l&&(s[l]=n(t[a],a))}else if(Object.keys(o.values||Bi).includes(a)){const l=o.up(a);s[l]=n(t[a],a)}else{const l=a;s[l]=t[l]}return s},{})}return n(t)}function Mu(e={}){var n;return((n=e.keys)==null?void 0:n.reduce((r,i)=>{const o=e.up(i);return r[o]={},r},{}))||{}}function xs(e,t){return e.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},t)}function np(e,...t){const n=Mu(e),r=[n,...t].reduce((i,o)=>$e(i,o),{});return xs(Object.keys(n),r)}function rp(e,t){if(typeof e!="object")return{};const n={},r=Object.keys(t);return Array.isArray(e)?r.forEach((i,o)=>{o<e.length&&(n[i]=!0)}):r.forEach(i=>{e[i]!=null&&(n[i]=!0)}),n}function Go({values:e,breakpoints:t,base:n}){const r=n||rp(e,t),i=Object.keys(r);if(i.length===0)return e;let o;return i.reduce((s,a,l)=>(Array.isArray(e)?(s[a]=e[l]!=null?e[l]:e[o],o=l):typeof e=="object"?(s[a]=e[a]!=null?e[a]:e[o],o=a):s[a]=e,s),{})}function Pe(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":Bt(7));return e.charAt(0).toUpperCase()+e.slice(1)}function Gi(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((i,o)=>i&&i[o]?i[o]:null,e);if(r!=null)return r}return t.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,e)}function gi(e,t,n,r=n){let i;return typeof e=="function"?i=e(n):Array.isArray(e)?i=e[n]||r:i=Gi(e,n)||r,t&&(i=t(i,r,e)),i}function be(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,trans