@wandelbots/wandelbots-js-react-components 3.5.1-pr.feat-add-eight-abbs-v2.450.4419c66 → 3.5.1
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 +61 -10
- package/dist/3d.cjs.js +2 -0
- package/dist/3d.cjs.js.map +1 -0
- package/dist/3d.d.ts +11 -0
- package/dist/3d.d.ts.map +1 -0
- package/dist/3d.es.js +16 -0
- package/dist/3d.es.js.map +1 -0
- package/dist/LoadingCover-Dr9hDTku.js +87 -0
- package/dist/LoadingCover-Dr9hDTku.js.map +1 -0
- package/dist/LoadingCover-r2yhJZF9.cjs +2 -0
- package/dist/LoadingCover-r2yhJZF9.cjs.map +1 -0
- package/dist/WandelscriptEditor-Dj7TBCkF.cjs +2 -0
- package/dist/WandelscriptEditor-Dj7TBCkF.cjs.map +1 -0
- package/dist/WandelscriptEditor-DnJvITTA.js +140 -0
- package/dist/WandelscriptEditor-DnJvITTA.js.map +1 -0
- package/dist/auth0-spa-js.production.esm-DL9f1uDJ.js +1438 -0
- package/dist/auth0-spa-js.production.esm-DL9f1uDJ.js.map +1 -0
- package/dist/auth0-spa-js.production.esm-DTiWXa87.cjs +5 -0
- package/dist/auth0-spa-js.production.esm-DTiWXa87.cjs.map +1 -0
- package/dist/components/3d-viewport/CoordinateSystemTransform.d.ts +1 -1
- package/dist/components/3d-viewport/CoordinateSystemTransform.d.ts.map +1 -1
- package/dist/components/3d-viewport/SafetyZonesRenderer.d.ts.map +1 -1
- package/dist/components/3d-viewport/collider/ColliderCollection.d.ts +1 -1
- package/dist/components/3d-viewport/collider/ColliderCollection.d.ts.map +1 -1
- package/dist/components/3d-viewport/collider/ColliderElement.d.ts +1 -1
- package/dist/components/3d-viewport/collider/ColliderElement.d.ts.map +1 -1
- package/dist/components/3d-viewport/collider/CollisionSceneRenderer.d.ts +1 -1
- package/dist/components/3d-viewport/collider/CollisionSceneRenderer.d.ts.map +1 -1
- package/dist/components/3d-viewport/collider/colliderShapeToBufferGeometry.d.ts +1 -1
- package/dist/components/3d-viewport/collider/colliderShapeToBufferGeometry.d.ts.map +1 -1
- package/dist/components/ProgramStateIndicator.d.ts +3 -3
- package/dist/components/ProgramStateIndicator.d.ts.map +1 -1
- package/dist/components/RobotCard.d.ts +4 -3
- package/dist/components/RobotCard.d.ts.map +1 -1
- package/dist/components/jogging/JoggingBlocked.d.ts +7 -0
- package/dist/components/jogging/JoggingBlocked.d.ts.map +1 -0
- package/dist/components/jogging/JoggingCartesianTab.d.ts.map +1 -1
- package/dist/components/jogging/JoggingOptions.d.ts.map +1 -1
- package/dist/components/jogging/JoggingPanel.d.ts +1 -1
- package/dist/components/jogging/JoggingPanel.d.ts.map +1 -1
- package/dist/components/jogging/JoggingStore.d.ts +10 -5
- package/dist/components/jogging/JoggingStore.d.ts.map +1 -1
- package/dist/components/jogging/PoseCartesianValues.d.ts +2 -2
- package/dist/components/jogging/PoseCartesianValues.d.ts.map +1 -1
- package/dist/components/jogging/PoseJointValues.d.ts +1 -2
- package/dist/components/jogging/PoseJointValues.d.ts.map +1 -1
- package/dist/components/robots/DHRobot.d.ts.map +1 -1
- package/dist/components/robots/Robot.d.ts +1 -1
- package/dist/components/robots/Robot.d.ts.map +1 -1
- package/dist/components/robots/RobotAnimator.d.ts +2 -2
- package/dist/components/robots/RobotAnimator.d.ts.map +1 -1
- package/dist/components/robots/SupportedRobot.d.ts +3 -3
- package/dist/components/robots/SupportedRobot.d.ts.map +1 -1
- package/dist/components/robots/manufacturerHomePositions.d.ts +1 -1
- package/dist/components/robots/manufacturerHomePositions.d.ts.map +1 -1
- package/dist/components/safetyBar/ControllerTypeIndicator.d.ts.map +1 -1
- package/dist/components/safetyBar/OperationModeIndicator.d.ts +2 -2
- package/dist/components/safetyBar/OperationModeIndicator.d.ts.map +1 -1
- package/dist/components/safetyBar/SafetyBar.d.ts +3 -3
- package/dist/components/safetyBar/SafetyBar.d.ts.map +1 -1
- package/dist/components/safetyBar/SafetyStateIndicator.d.ts +2 -2
- package/dist/components/safetyBar/SafetyStateIndicator.d.ts.map +1 -1
- package/dist/components/utils/errorHandling.d.ts.map +1 -1
- package/dist/components/utils/errorHandling.test.d.ts +2 -0
- package/dist/components/utils/errorHandling.test.d.ts.map +1 -0
- package/dist/core.cjs.js +2 -0
- package/dist/core.cjs.js.map +1 -0
- package/dist/core.d.ts +33 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.es.js +54 -0
- package/dist/core.es.js.map +1 -0
- package/dist/index-CAib4NKw.js +2261 -0
- package/dist/index-CAib4NKw.js.map +1 -0
- package/dist/index-CqMZL0FV.cjs +2 -0
- package/dist/index-CqMZL0FV.cjs.map +1 -0
- package/dist/index-CxasuX80.js +5212 -0
- package/dist/index-CxasuX80.js.map +1 -0
- package/dist/index-DxwppshT.cjs +29 -0
- package/dist/index-DxwppshT.cjs.map +1 -0
- package/dist/index.cjs.js +2 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +3 -39
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +69 -0
- package/dist/index.es.js.map +1 -0
- package/dist/lib/ConnectedMotionGroup.d.ts +90 -0
- package/dist/lib/ConnectedMotionGroup.d.ts.map +1 -0
- package/dist/lib/JoggerConnection.d.ts +113 -0
- package/dist/lib/JoggerConnection.d.ts.map +1 -0
- package/dist/lib/JoggerConnection.test.d.ts +2 -0
- package/dist/lib/JoggerConnection.test.d.ts.map +1 -0
- package/dist/lib/MotionStreamConnection.d.ts +24 -0
- package/dist/lib/MotionStreamConnection.d.ts.map +1 -0
- package/dist/lib/MotionStreamConnection.test.d.ts +2 -0
- package/dist/lib/MotionStreamConnection.test.d.ts.map +1 -0
- package/dist/lib/motionStateUpdate.d.ts +7 -0
- package/dist/lib/motionStateUpdate.d.ts.map +1 -0
- package/dist/lib/motionStateUpdate.test.d.ts +2 -0
- package/dist/lib/motionStateUpdate.test.d.ts.map +1 -0
- package/dist/manufacturerHomePositions-Ca80ycLi.cjs +2 -0
- package/dist/manufacturerHomePositions-Ca80ycLi.cjs.map +1 -0
- package/dist/manufacturerHomePositions-CgaG5vaK.js +976 -0
- package/dist/manufacturerHomePositions-CgaG5vaK.js.map +1 -0
- package/dist/theming-Coh4zx7d.js +23682 -0
- package/dist/theming-Coh4zx7d.js.map +1 -0
- package/dist/theming-D4ztsmTr.cjs +133 -0
- package/dist/theming-D4ztsmTr.cjs.map +1 -0
- package/dist/wandelscript.cjs.js +2 -0
- package/dist/wandelscript.cjs.js.map +1 -0
- package/dist/wandelscript.d.ts +2 -0
- package/dist/wandelscript.d.ts.map +1 -0
- package/dist/wandelscript.es.js +5 -0
- package/dist/wandelscript.es.js.map +1 -0
- package/package.json +56 -28
- package/src/3d.ts +15 -0
- package/src/components/3d-viewport/CoordinateSystemTransform.tsx +1 -1
- package/src/components/3d-viewport/SafetyZonesRenderer.tsx +1 -2
- package/src/components/3d-viewport/collider/ColliderCollection.tsx +1 -1
- package/src/components/3d-viewport/collider/ColliderElement.tsx +1 -1
- package/src/components/3d-viewport/collider/CollisionSceneRenderer.tsx +1 -1
- package/src/components/3d-viewport/collider/colliderShapeToBufferGeometry.ts +1 -1
- package/src/components/AppHeader.md +1 -1
- package/src/components/ProgramStateIndicator.tsx +3 -6
- package/src/components/RobotCard.tsx +4 -7
- package/src/components/jogging/JoggingBlocked.tsx +37 -0
- package/src/components/jogging/JoggingCartesianTab.tsx +13 -11
- package/src/components/jogging/JoggingJointLimitDetector.tsx +2 -2
- package/src/components/jogging/JoggingJointTab.tsx +4 -4
- package/src/components/jogging/JoggingOptions.tsx +6 -5
- package/src/components/jogging/JoggingPanel.tsx +6 -3
- package/src/components/jogging/JoggingStore.ts +66 -39
- package/src/components/jogging/PoseCartesianValues.tsx +3 -4
- package/src/components/jogging/PoseJointValues.tsx +3 -4
- package/src/components/robots/DHRobot.tsx +2 -3
- package/src/components/robots/Robot.tsx +1 -1
- package/src/components/robots/RobotAnimator.test.tsx +7 -22
- package/src/components/robots/RobotAnimator.tsx +8 -13
- package/src/components/robots/SupportedRobot.tsx +3 -6
- package/src/components/robots/manufacturerHomePositions.ts +1 -1
- package/src/components/safetyBar/ControllerTypeIndicator.tsx +4 -2
- package/src/components/safetyBar/OperationModeIndicator.tsx +7 -5
- package/src/components/safetyBar/SafetyBar.tsx +3 -6
- package/src/components/safetyBar/SafetyStateIndicator.tsx +9 -7
- package/src/components/utils/errorHandling.test.ts +41 -0
- package/src/components/utils/errorHandling.ts +4 -0
- package/src/core.ts +33 -0
- package/src/i18n/locales/de/translations.json +3 -0
- package/src/i18n/locales/en/translations.json +3 -0
- package/src/index.ts +4 -43
- package/src/lib/ConnectedMotionGroup.ts +444 -0
- package/src/lib/JoggerConnection.test.ts +120 -0
- package/src/lib/JoggerConnection.ts +674 -0
- package/src/lib/MotionStreamConnection.test.ts +23 -0
- package/src/lib/MotionStreamConnection.ts +189 -0
- package/src/lib/motionStateUpdate.test.ts +28 -0
- package/src/lib/motionStateUpdate.ts +117 -0
- package/src/wandelscript.ts +2 -0
- package/dist/auth0-spa-js.production.esm-1QXzndwB.js +0 -950
- package/dist/auth0-spa-js.production.esm-1QXzndwB.js.map +0 -1
- package/dist/auth0-spa-js.production.esm-BLRAk7Yh.cjs +0 -5
- package/dist/auth0-spa-js.production.esm-BLRAk7Yh.cjs.map +0 -1
- package/dist/index.cjs +0 -155
- package/dist/index.cjs.map +0 -1
- package/dist/index.js +0 -34927
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"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}/*! *****************************************************************************
|
|
2
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
4
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
5
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
8
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
9
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
10
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
11
|
+
|
|
12
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
13
|
+
and limitations under the License.
|
|
14
|
+
***************************************************************************** */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);/*!
|
|
15
|
+
* Reconnecting WebSocket
|
|
16
|
+
* by Pedro Ladaria <pedro.ladaria@gmail.com>
|
|
17
|
+
* https://github.com/pladaria/reconnecting-websocket
|
|
18
|
+
* License MIT
|
|
19
|
+
*/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}}/**
|
|
20
|
+
* @mui/styled-engine v7.3.7
|
|
21
|
+
*
|
|
22
|
+
* @license MIT
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/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(`
|
|
26
|
+
`)):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={};/**
|
|
27
|
+
* @license React
|
|
28
|
+
* react-is.production.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/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={};/**
|
|
35
|
+
* @license React
|
|
36
|
+
* react-is.development.js
|
|
37
|
+
*
|
|
38
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the MIT license found in the
|
|
41
|
+
* LICENSE file in the root directory of this source tree.
|
|
42
|
+
*/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>\`.
|
|
43
|
+
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,transform:i}=e,o=s=>{if(s[t]==null)return null;const a=s[t],l=s.theme,c=Gi(l,r)||{};return it(s,a,d=>{let h=gi(c,i,d);return d===h&&typeof d=="string"&&(h=gi(c,i,`${t}${d==="default"?"":Pe(d)}`,d)),n===!1?h:{[n]:h}})};return o.propTypes=process.env.NODE_ENV!=="production"?{[t]:Ut}:{},o.filterProps=[t],o}function ip(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const op={m:"margin",p:"padding"},sp={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},cl={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},ap=ip(e=>{if(e.length>2)if(cl[e])e=cl[e];else return[e];const[t,n]=e.split(""),r=op[t],i=sp[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),Vi=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Ui=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],lp=[...Vi,...Ui];function Er(e,t,n,r){const i=Gi(e,t,!0)??n;return typeof i=="number"||typeof i=="string"?o=>typeof o=="string"?o:(process.env.NODE_ENV!=="production"&&typeof o!="number"&&console.error(`MUI: Expected ${r} argument to be a number or a string, got ${o}.`),typeof i=="string"?i.startsWith("var(")&&o===0?0:i.startsWith("var(")&&o===1?i:`calc(${o} * ${i})`:i*o):Array.isArray(i)?o=>{if(typeof o=="string")return o;const s=Math.abs(o);process.env.NODE_ENV!=="production"&&(Number.isInteger(s)?s>i.length-1&&console.error([`MUI: The value provided (${s}) overflows.`,`The supported values are: ${JSON.stringify(i)}.`,`${s} > ${i.length-1}, you need to add the missing values.`].join(`
|
|
44
|
+
`)):console.error([`MUI: The \`theme.${t}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${t}\` as a number.`].join(`
|
|
45
|
+
`)));const a=i[s];return o>=0?a:typeof a=="number"?-a:typeof a=="string"&&a.startsWith("var(")?`calc(-1 * ${a})`:`-${a}`}:typeof i=="function"?i:(process.env.NODE_ENV!=="production"&&console.error([`MUI: The \`theme.${t}\` value (${i}) is invalid.`,"It should be a number, an array or a function."].join(`
|
|
46
|
+
`)),()=>{})}function Wi(e){return Er(e,"spacing",8,"spacing")}function ln(e,t){return typeof t=="string"||t==null?t:e(t)}function cp(e,t){return n=>e.reduce((r,i)=>(r[i]=ln(t,n),r),{})}function up(e,t,n,r){if(!t.includes(n))return null;const i=ap(n),o=cp(i,r),s=e[n];return it(e,s,o)}function Ru(e,t){const n=Wi(e.theme);return Object.keys(e).map(r=>up(e,t,r,n)).reduce(ar,{})}function ye(e){return Ru(e,Vi)}ye.propTypes=process.env.NODE_ENV!=="production"?Vi.reduce((e,t)=>(e[t]=Ut,e),{}):{};ye.filterProps=Vi;function xe(e){return Ru(e,Ui)}xe.propTypes=process.env.NODE_ENV!=="production"?Ui.reduce((e,t)=>(e[t]=Ut,e),{}):{};xe.filterProps=Ui;process.env.NODE_ENV!=="production"&&lp.reduce((e,t)=>(e[t]=Ut,e),{});function Au(e=8,t=Wi({spacing:e})){if(e.mui)return e;const n=(...r)=>(process.env.NODE_ENV!=="production"&&(r.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${r.length}`)),(r.length===0?[1]:r).map(o=>{const s=t(o);return typeof s=="number"?`${s}px`:s}).join(" "));return n.mui=!0,n}function Hi(...e){const t=e.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>t[o]?ar(i,t[o](r)):i,{});return n.propTypes=process.env.NODE_ENV!=="production"?e.reduce((r,i)=>Object.assign(r,i.propTypes),{}):{},n.filterProps=e.reduce((r,i)=>r.concat(i.filterProps),[]),n}function Ye(e){return typeof e!="number"?e:`${e}px solid`}function Ze(e,t){return be({prop:e,themeKey:"borders",transform:t})}const dp=Ze("border",Ye),hp=Ze("borderTop",Ye),fp=Ze("borderRight",Ye),pp=Ze("borderBottom",Ye),mp=Ze("borderLeft",Ye),gp=Ze("borderColor"),yp=Ze("borderTopColor"),xp=Ze("borderRightColor"),bp=Ze("borderBottomColor"),vp=Ze("borderLeftColor"),Sp=Ze("outline",Ye),wp=Ze("outlineColor"),Yi=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Er(e.theme,"shape.borderRadius",4,"borderRadius"),n=r=>({borderRadius:ln(t,r)});return it(e,e.borderRadius,n)}return null};Yi.propTypes=process.env.NODE_ENV!=="production"?{borderRadius:Ut}:{};Yi.filterProps=["borderRadius"];Hi(dp,hp,fp,pp,mp,gp,yp,xp,bp,vp,Yi,Sp,wp);const qi=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Er(e.theme,"spacing",8,"gap"),n=r=>({gap:ln(t,r)});return it(e,e.gap,n)}return null};qi.propTypes=process.env.NODE_ENV!=="production"?{gap:Ut}:{};qi.filterProps=["gap"];const Ji=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Er(e.theme,"spacing",8,"columnGap"),n=r=>({columnGap:ln(t,r)});return it(e,e.columnGap,n)}return null};Ji.propTypes=process.env.NODE_ENV!=="production"?{columnGap:Ut}:{};Ji.filterProps=["columnGap"];const Ki=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Er(e.theme,"spacing",8,"rowGap"),n=r=>({rowGap:ln(t,r)});return it(e,e.rowGap,n)}return null};Ki.propTypes=process.env.NODE_ENV!=="production"?{rowGap:Ut}:{};Ki.filterProps=["rowGap"];const Ep=be({prop:"gridColumn"}),Tp=be({prop:"gridRow"}),Cp=be({prop:"gridAutoFlow"}),_p=be({prop:"gridAutoColumns"}),Mp=be({prop:"gridAutoRows"}),Rp=be({prop:"gridTemplateColumns"}),Ap=be({prop:"gridTemplateRows"}),Ip=be({prop:"gridTemplateAreas"}),jp=be({prop:"gridArea"});Hi(qi,Ji,Ki,Ep,Tp,Cp,_p,Mp,Rp,Ap,Ip,jp);function Pn(e,t){return t==="grey"?t:e}const kp=be({prop:"color",themeKey:"palette",transform:Pn}),Op=be({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Pn}),Pp=be({prop:"backgroundColor",themeKey:"palette",transform:Pn});Hi(kp,Op,Pp);function Ve(e){return e<=1&&e!==0?`${e*100}%`:e}const Dp=be({prop:"width",transform:Ve}),Vs=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var i,o,s,a,l;const r=((s=(o=(i=e.theme)==null?void 0:i.breakpoints)==null?void 0:o.values)==null?void 0:s[n])||Bi[n];return r?((l=(a=e.theme)==null?void 0:a.breakpoints)==null?void 0:l.unit)!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:Ve(n)}};return it(e,e.maxWidth,t)}return null};Vs.filterProps=["maxWidth"];const $p=be({prop:"minWidth",transform:Ve}),Lp=be({prop:"height",transform:Ve}),Np=be({prop:"maxHeight",transform:Ve}),zp=be({prop:"minHeight",transform:Ve});be({prop:"size",cssProperty:"width",transform:Ve});be({prop:"size",cssProperty:"height",transform:Ve});const Fp=be({prop:"boxSizing"});Hi(Dp,Vs,$p,Lp,Np,zp,Fp);const Tr={border:{themeKey:"borders",transform:Ye},borderTop:{themeKey:"borders",transform:Ye},borderRight:{themeKey:"borders",transform:Ye},borderBottom:{themeKey:"borders",transform:Ye},borderLeft:{themeKey:"borders",transform:Ye},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Ye},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Yi},color:{themeKey:"palette",transform:Pn},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Pn},backgroundColor:{themeKey:"palette",transform:Pn},p:{style:xe},pt:{style:xe},pr:{style:xe},pb:{style:xe},pl:{style:xe},px:{style:xe},py:{style:xe},padding:{style:xe},paddingTop:{style:xe},paddingRight:{style:xe},paddingBottom:{style:xe},paddingLeft:{style:xe},paddingX:{style:xe},paddingY:{style:xe},paddingInline:{style:xe},paddingInlineStart:{style:xe},paddingInlineEnd:{style:xe},paddingBlock:{style:xe},paddingBlockStart:{style:xe},paddingBlockEnd:{style:xe},m:{style:ye},mt:{style:ye},mr:{style:ye},mb:{style:ye},ml:{style:ye},mx:{style:ye},my:{style:ye},margin:{style:ye},marginTop:{style:ye},marginRight:{style:ye},marginBottom:{style:ye},marginLeft:{style:ye},marginX:{style:ye},marginY:{style:ye},marginInline:{style:ye},marginInlineStart:{style:ye},marginInlineEnd:{style:ye},marginBlock:{style:ye},marginBlockStart:{style:ye},marginBlockEnd:{style:ye},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:qi},rowGap:{style:Ki},columnGap:{style:Ji},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Ve},maxWidth:{style:Vs},minWidth:{transform:Ve},height:{transform:Ve},maxHeight:{transform:Ve},minHeight:{transform:Ve},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function Bp(...e){const t=e.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function Gp(e,t){return typeof e=="function"?e(t):e}function Vp(){function e(n,r,i,o){const s={[n]:r,theme:i},a=o[n];if(!a)return{[n]:r};const{cssProperty:l=n,themeKey:c,transform:u,style:d}=a;if(r==null)return null;if(c==="typography"&&r==="inherit")return{[n]:r};const h=Gi(i,c)||{};return d?d(s):it(s,r,m=>{let p=gi(h,u,m);return m===p&&typeof m=="string"&&(p=gi(h,u,`${n}${m==="default"?"":Pe(m)}`,m)),l===!1?p:{[l]:p}})}function t(n){const{sx:r,theme:i={},nested:o}=n||{};if(!r)return null;const s=i.unstable_sxConfig??Tr;function a(l){let c=l;if(typeof l=="function")c=l(i);else if(typeof l!="object")return l;if(!c)return null;const u=Mu(i.breakpoints),d=Object.keys(u);let h=u;return Object.keys(c).forEach(f=>{const m=Gp(c[f],i);if(m!=null)if(typeof m=="object")if(s[f])h=ar(h,e(f,m,i,s));else{const p=it({theme:i},m,y=>({[f]:y}));Bp(p,m)?h[f]=t({sx:m,theme:i,nested:!0}):h=ar(h,p)}else h=ar(h,e(f,m,i,s))}),!o&&i.modularCssLayers?{"@layer sx":al(i,xs(d,h))}:al(i,xs(d,h))}return Array.isArray(r)?r.map(a):a(r)}return t}const zn=Vp();zn.filterProps=["sx"];function Up(e,t){var r;const n=this;if(n.vars){if(!((r=n.colorSchemes)!=null&&r[e])||typeof n.getColorSchemeSelector!="function")return{};let i=n.getColorSchemeSelector(e);return i==="&"?t:((i.includes("data-")||i.includes("."))&&(i=`*:where(${i.replace(/\s*&$/,"")}) &`),{[i]:t})}return n.palette.mode===e?t:{}}function Xi(e={},...t){const{breakpoints:n={},palette:r={},spacing:i,shape:o={},...s}=e,a=Kf(n),l=Au(i);let c=$e({breakpoints:a,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:l,shape:{...ep,...o}},s);return c=Qf(c),c.applyStyles=Up,c=t.reduce((u,d)=>$e(u,d),c),c.unstable_sxConfig={...Tr,...s==null?void 0:s.unstable_sxConfig},c.unstable_sx=function(d){return zn({sx:d,theme:this})},c}function Wp(e){return Object.keys(e).length===0}function Hp(e=null){const t=j.useContext(uf.ThemeContext);return!t||Wp(t)?e:t}const Yp=Xi();function Iu(e=Yp){return Hp(e)}const qp=e=>{var r;const t={systemProps:{},otherProps:{}},n=((r=e==null?void 0:e.theme)==null?void 0:r.unstable_sxConfig)??Tr;return Object.keys(e).forEach(i=>{n[i]?t.systemProps[i]=e[i]:t.otherProps[i]=e[i]}),t};function Jp(e){const{sx:t,...n}=e,{systemProps:r,otherProps:i}=qp(n);let o;return Array.isArray(t)?o=[r,...t]:typeof t=="function"?o=(...s)=>{const a=t(...s);return ct(a)?{...r,...a}:r}:o={...r,...t},{...i,sx:o}}const ul=e=>e,Kp=()=>{let e=ul;return{configure(t){e=t},generate(t){return e(t)},reset(){e=ul}}},Xp=Kp(),Zp={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function fn(e,t,n="Mui"){const r=Zp[t];return r?`${n}-${r}`:`${Xp.generate(e)}-${t}`}function Zi(e,t,n="Mui"){const r={};return t.forEach(i=>{r[i]=fn(e,i,n)}),r}function ju(e,t=""){return e.displayName||e.name||t}function dl(e,t,n){const r=ju(t);return e.displayName||(r!==""?`${n}(${r})`:n)}function Qp(e){if(e!=null){if(typeof e=="string")return e;if(typeof e=="function")return ju(e,"Component");if(typeof e=="object")switch(e.$$typeof){case mi.ForwardRef:return dl(e,e.render,"ForwardRef");case mi.Memo:return dl(e,e.type,"memo");default:return}}}function ku(e){const{variants:t,...n}=e,r={variants:t,style:on(n),isProcessed:!0};return r.style===n||t&&t.forEach(i=>{typeof i.style!="function"&&(i.style=on(i.style))}),r}const em=Xi();function Vo(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function tn(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function tm(e){return e?(t,n)=>n[e]:null}function nm(e,t,n){e.theme=om(e.theme)?n:e.theme[t]||e.theme}function ui(e,t,n){const r=typeof t=="function"?t(e):t;if(Array.isArray(r))return r.flatMap(i=>ui(e,i,n));if(Array.isArray(r==null?void 0:r.variants)){let i;if(r.isProcessed)i=n?tn(r.style,n):r.style;else{const{variants:o,...s}=r;i=n?tn(on(s),n):s}return Ou(e,r.variants,[i],n)}return r!=null&&r.isProcessed?n?tn(on(r.style),n):r.style:n?tn(on(r),n):r}function Ou(e,t,n=[],r=void 0){var o;let i;e:for(let s=0;s<t.length;s+=1){const a=t[s];if(typeof a.props=="function"){if(i??(i={...e,...e.ownerState,ownerState:e.ownerState}),!a.props(i))continue}else for(const l in a.props)if(e[l]!==a.props[l]&&((o=e.ownerState)==null?void 0:o[l])!==a.props[l])continue e;typeof a.style=="function"?(i??(i={...e,...e.ownerState,ownerState:e.ownerState}),n.push(r?tn(on(a.style(i)),r):a.style(i))):n.push(r?tn(on(a.style),r):a.style)}return n}function Pu(e={}){const{themeId:t,defaultTheme:n=em,rootShouldForwardProp:r=Vo,slotShouldForwardProp:i=Vo}=e;function o(a){nm(a,t,n)}return(a,l={})=>{Wf(a,S=>S.filter(C=>C!==zn));const{name:c,slot:u,skipVariantsResolver:d,skipSx:h,overridesResolver:f=tm(Du(u)),...m}=l,p=c&&c.startsWith("Mui")||u?"components":"custom",y=d!==void 0?d:u&&u!=="Root"&&u!=="root"||!1,v=h||!1;let T=Vo;u==="Root"||u==="root"?T=r:u?T=i:sm(a)&&(T=void 0);const w=Uf(a,{shouldForwardProp:T,label:im(c,u),...m}),E=S=>{if(S.__emotion_real===S)return S;if(typeof S=="function")return function(I){return ui(I,S,I.theme.modularCssLayers?p:void 0)};if(ct(S)){const C=ku(S);return function(k){return C.variants?ui(k,C,k.theme.modularCssLayers?p:void 0):k.theme.modularCssLayers?tn(C.style,p):C.style}}return S},R=(...S)=>{const C=[],I=S.map(E),k=[];if(C.push(o),c&&f&&k.push(function(A){var W,B;const z=(B=(W=A.theme.components)==null?void 0:W[c])==null?void 0:B.styleOverrides;if(!z)return null;const N={};for(const Z in z)N[Z]=ui(A,z[Z],A.theme.modularCssLayers?"theme":void 0);return f(A,N)}),c&&!y&&k.push(function(A){var N,W;const _=A.theme,z=(W=(N=_==null?void 0:_.components)==null?void 0:N[c])==null?void 0:W.variants;return z?Ou(A,z,[],A.theme.modularCssLayers?"theme":void 0):null}),v||k.push(zn),Array.isArray(I[0])){const g=I.shift(),A=new Array(C.length).fill(""),_=new Array(k.length).fill("");let z;z=[...A,...g,..._],z.raw=[...A,...g.raw,..._],C.unshift(z)}const P=[...C,...I,...k],D=w(...P);return a.muiName&&(D.muiName=a.muiName),process.env.NODE_ENV!=="production"&&(D.displayName=rm(c,u,a)),D};return w.withConfig&&(R.withConfig=w.withConfig),R}}function rm(e,t,n){return e?`${e}${Pe(t||"")}`:`Styled(${Qp(n)})`}function im(e,t){let n;return process.env.NODE_ENV!=="production"&&e&&(n=`${e}-${Du(t||"Root")}`),n}function om(e){for(const t in e)return!1;return!0}function sm(e){return typeof e=="string"&&e.charCodeAt(0)>96}function Du(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}const am=Pu();function yi(e,t,n=!1){const r={...t};for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const o=i;if(o==="components"||o==="slots")r[o]={...e[o],...r[o]};else if(o==="componentsProps"||o==="slotProps"){const s=e[o],a=t[o];if(!a)r[o]=s||{};else if(!s)r[o]=a;else{r[o]={...a};for(const l in s)if(Object.prototype.hasOwnProperty.call(s,l)){const c=l;r[o][c]=yi(s[c],a[c],n)}}}else o==="className"&&n&&t.className?r.className=De(e==null?void 0:e.className,t==null?void 0:t.className):o==="style"&&n&&t.style?r.style={...e==null?void 0:e.style,...t==null?void 0:t.style}:r[o]===void 0&&(r[o]=e[o])}return r}function lm(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:yi(t.components[n].defaultProps,r)}function $u({props:e,name:t,defaultTheme:n,themeId:r}){let i=Iu(n);return r&&(i=i[r]||i),lm({theme:i,name:t,props:e})}const pt=typeof window<"u"?j.useLayoutEffect:j.useEffect;function kn(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function Us(e,t=0,n=1){return process.env.NODE_ENV!=="production"&&(e<t||e>n)&&console.error(`MUI: The value provided ${e} is out of range [${t}, ${n}].`),kn(e,t,n)}function cm(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),process.env.NODE_ENV!=="production"&&e.length!==e.trim().length&&console.error(`MUI: The color: "${e}" is invalid. Make sure the color input doesn't contain leading/trailing space.`),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function Gt(e){if(e.type)return e;if(e.charAt(0)==="#")return Gt(cm(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(process.env.NODE_ENV!=="production"?`MUI: Unsupported \`${e}\` color.
|
|
47
|
+
The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().`:Bt(9,e));let r=e.substring(t+1,e.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(i))throw new Error(process.env.NODE_ENV!=="production"?`MUI: unsupported \`${i}\` color space.
|
|
48
|
+
The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.`:Bt(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const um=e=>{const t=Gt(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},rr=(e,t)=>{try{return um(e)}catch{return t&&process.env.NODE_ENV!=="production"&&console.warn(t),e}};function Qi(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((i,o)=>o<3?parseInt(i,10):i):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function Lu(e){e=Gt(e);const{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,o=r*Math.min(i,1-i),s=(c,u=(c+n/30)%12)=>i-o*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return e.type==="hsla"&&(a+="a",l.push(t[3])),Qi({type:a,values:l})}function bs(e){e=Gt(e);let t=e.type==="hsl"||e.type==="hsla"?Gt(Lu(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function hl(e,t){const n=bs(e),r=bs(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Nu(e,t){return e=Gt(e),t=Us(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Qi(e)}function Zt(e,t,n){try{return Nu(e,t)}catch{return n&&process.env.NODE_ENV!=="production"&&console.warn(n),e}}function eo(e,t){if(e=Gt(e),t=Us(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return Qi(e)}function se(e,t,n){try{return eo(e,t)}catch{return n&&process.env.NODE_ENV!=="production"&&console.warn(n),e}}function to(e,t){if(e=Gt(e),t=Us(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return Qi(e)}function ae(e,t,n){try{return to(e,t)}catch{return n&&process.env.NODE_ENV!=="production"&&console.warn(n),e}}function dm(e,t=.15){return bs(e)>.5?eo(e,t):to(e,t)}function Br(e,t,n){try{return dm(e,t)}catch{return e}}const hm=j.createContext();process.env.NODE_ENV!=="production"&&(b.node,b.bool);const fm=()=>j.useContext(hm)??!1,pm=j.createContext(void 0);process.env.NODE_ENV!=="production"&&(b.node,b.object);function mm(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const i=t.components[n];return i.defaultProps?yi(i.defaultProps,r,t.components.mergeClassNameAndStyle):!i.styleOverrides&&!i.variants?yi(i,r,t.components.mergeClassNameAndStyle):r}function gm({props:e,name:t}){const n=j.useContext(pm);return mm({props:e,name:t,theme:{components:n}})}let fl=0;function ym(e){const[t,n]=j.useState(e),r=t;return j.useEffect(()=>{t==null&&(fl+=1,n(`mui-${fl}`))},[t]),r}const xm={...j},pl=xm.useId;function bm(e){return pl!==void 0?pl():ym(e)}const ml={theme:void 0};function vm(e){let t,n;return function(i){let o=t;return(o===void 0||i.theme!==n)&&(ml.theme=i.theme,o=ku(e(ml)),t=o,n=i.theme),o}}function Sm(e=""){function t(...r){if(!r.length)return"";const i=r[0];return typeof i=="string"&&!i.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${i}${t(...r.slice(1))})`:`, ${i}`}return(r,...i)=>`var(--${e?`${e}-`:""}${r}${t(...i)})`}const gl=(e,t,n,r=[])=>{let i=e;t.forEach((o,s)=>{s===t.length-1?Array.isArray(i)?i[Number(o)]=n:i&&typeof i=="object"&&(i[o]=n):i&&typeof i=="object"&&(i[o]||(i[o]=r.includes(o)?[]:{}),i=i[o])})},wm=(e,t,n)=>{function r(i,o=[],s=[]){Object.entries(i).forEach(([a,l])=>{(!n||n&&!n([...o,a]))&&l!=null&&(typeof l=="object"&&Object.keys(l).length>0?r(l,[...o,a],Array.isArray(l)?[...s,a]:s):t([...o,a],l,s))})}r(e)},Em=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>e.includes(r))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function Uo(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},i={},o={},s={};return wm(e,(a,l,c)=>{if((typeof l=="string"||typeof l=="number")&&(!r||!r(a,l))){const u=`--${n?`${n}-`:""}${a.join("-")}`,d=Em(a,l);Object.assign(i,{[u]:d}),gl(o,a,`var(${u})`,c),gl(s,a,`var(${u}, ${d})`,c)}},a=>a[0]==="vars"),{css:i,vars:o,varsWithDefaults:s}}function Tm(e,t={}){const{getSelector:n=v,disableCssColorScheme:r,colorSchemeSelector:i,enableContrastVars:o}=t,{colorSchemes:s={},components:a,defaultColorScheme:l="light",...c}=e,{vars:u,css:d,varsWithDefaults:h}=Uo(c,t);let f=h;const m={},{[l]:p,...y}=s;if(Object.entries(y||{}).forEach(([E,R])=>{const{vars:S,css:C,varsWithDefaults:I}=Uo(R,t);f=$e(f,I),m[E]={css:C,vars:S}}),p){const{css:E,vars:R,varsWithDefaults:S}=Uo(p,t);f=$e(f,S),m[l]={css:E,vars:R}}function v(E,R){var C,I;let S=i;if(i==="class"&&(S=".%s"),i==="data"&&(S="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(S=`[${i}="%s"]`),E){if(S==="media")return e.defaultColorScheme===E?":root":{[`@media (prefers-color-scheme: ${((I=(C=s[E])==null?void 0:C.palette)==null?void 0:I.mode)||E})`]:{":root":R}};if(S)return e.defaultColorScheme===E?`:root, ${S.replace("%s",String(E))}`:S.replace("%s",String(E))}return":root"}return{vars:f,generateThemeVars:()=>{let E={...u};return Object.entries(m).forEach(([,{vars:R}])=>{E=$e(E,R)}),E},generateStyleSheets:()=>{var k,P;const E=[],R=e.defaultColorScheme||"light";function S(D,g){Object.keys(g).length&&E.push(typeof D=="string"?{[D]:{...g}}:D)}S(n(void 0,{...d}),d);const{[R]:C,...I}=m;if(C){const{css:D}=C,g=(P=(k=s[R])==null?void 0:k.palette)==null?void 0:P.mode,A=!r&&g?{colorScheme:g,...D}:{...D};S(n(R,{...A}),A)}return Object.entries(I).forEach(([D,{css:g}])=>{var z,N;const A=(N=(z=s[D])==null?void 0:z.palette)==null?void 0:N.mode,_=!r&&A?{colorScheme:A,...g}:{...g};S(n(D,{..._}),_)}),o&&E.push({":root":{"--__l-threshold":"0.7","--__l":"clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)","--__a":"clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)"}}),E}}}function Cm(e){return function(n){return e==="media"?(process.env.NODE_ENV!=="production"&&n!=="light"&&n!=="dark"&&console.error(`MUI: @media (prefers-color-scheme) supports only 'light' or 'dark', but receive '${n}'.`),`@media (prefers-color-scheme: ${n})`):e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${n}"] &`:e==="class"?`.${n} &`:e==="data"?`[data-${n}] &`:`${e.replace("%s",n)} &`:"&"}}const _m=Xi(),Mm=am("div",{name:"MuiStack",slot:"Root"});function Rm(e){return $u({props:e,name:"MuiStack",defaultTheme:_m})}function Am(e,t){const n=j.Children.toArray(e).filter(Boolean);return n.reduce((r,i,o)=>(r.push(i),o<n.length-1&&r.push(j.cloneElement(t,{key:`separator-${o}`})),r),[])}const Im=e=>({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],jm=({ownerState:e,theme:t})=>{let n={display:"flex",flexDirection:"column",...it({theme:t},Go({values:e.direction,breakpoints:t.breakpoints.values}),r=>({flexDirection:r}))};if(e.spacing){const r=Wi(t),i=Object.keys(t.breakpoints.values).reduce((l,c)=>((typeof e.spacing=="object"&&e.spacing[c]!=null||typeof e.direction=="object"&&e.direction[c]!=null)&&(l[c]=!0),l),{}),o=Go({values:e.direction,base:i}),s=Go({values:e.spacing,base:i});typeof o=="object"&&Object.keys(o).forEach((l,c,u)=>{if(!o[l]){const h=c>0?o[u[c-1]]:"column";o[l]=h}}),n=$e(n,it({theme:t},s,(l,c)=>e.useFlexGap?{gap:ln(r,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${Im(c?o[c]:e.direction)}`]:ln(r,l)}}))}return n=np(t.breakpoints,n),n};function km(e={}){const{createStyledComponent:t=Mm,useThemeProps:n=Rm,componentName:r="MuiStack"}=e,i=()=>wr({root:["root"]},l=>fn(r,l),{}),o=t(jm),s=j.forwardRef(function(l,c){const u=n(l),d=Jp(u),{component:h="div",direction:f="column",spacing:m=0,divider:p,children:y,className:v,useFlexGap:T=!1,...w}=d,E={direction:f,spacing:m,useFlexGap:T},R=i();return x.jsxRuntimeExports.jsx(o,{as:h,ownerState:E,ref:c,className:De(R.root,v),...w,children:p?Am(y,p):y})});return process.env.NODE_ENV!=="production"&&(s.propTypes={children:b.node,direction:b.oneOfType([b.oneOf(["column-reverse","column","row-reverse","row"]),b.arrayOf(b.oneOf(["column-reverse","column","row-reverse","row"])),b.object]),divider:b.node,spacing:b.oneOfType([b.arrayOf(b.oneOfType([b.number,b.string])),b.number,b.object,b.string]),sx:b.oneOfType([b.arrayOf(b.oneOfType([b.func,b.object,b.bool])),b.func,b.object])}),s}const hr={black:"#000",white:"#fff"},Om={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},En={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},Tn={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},Xn={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},Cn={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},_n={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},Mn={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"};function zu(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:hr.white,default:hr.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const Fu=zu();function Bu(){return{text:{primary:hr.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:hr.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const vs=Bu();function yl(e,t,n,r){const i=r.light||r,o=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=to(e.main,i):t==="dark"&&(e.dark=eo(e.main,o)))}function xl(e,t,n,r,i){const o=i.light||i,s=i.dark||i*1.5;t[n]||(t.hasOwnProperty(r)?t[n]=t[r]:n==="light"?t.light=`color-mix(in ${e}, ${t.main}, #fff ${(o*100).toFixed(0)}%)`:n==="dark"&&(t.dark=`color-mix(in ${e}, ${t.main}, #000 ${(s*100).toFixed(0)}%)`))}function Pm(e="light"){return e==="dark"?{main:Cn[200],light:Cn[50],dark:Cn[400]}:{main:Cn[700],light:Cn[400],dark:Cn[800]}}function Dm(e="light"){return e==="dark"?{main:En[200],light:En[50],dark:En[400]}:{main:En[500],light:En[300],dark:En[700]}}function $m(e="light"){return e==="dark"?{main:Tn[500],light:Tn[300],dark:Tn[700]}:{main:Tn[700],light:Tn[400],dark:Tn[800]}}function Lm(e="light"){return e==="dark"?{main:_n[400],light:_n[300],dark:_n[700]}:{main:_n[700],light:_n[500],dark:_n[900]}}function Nm(e="light"){return e==="dark"?{main:Mn[400],light:Mn[300],dark:Mn[700]}:{main:Mn[800],light:Mn[500],dark:Mn[900]}}function zm(e="light"){return e==="dark"?{main:Xn[400],light:Xn[300],dark:Xn[700]}:{main:"#ed6c02",light:Xn[500],dark:Xn[900]}}function Fm(e){return`oklch(from ${e} var(--__l) 0 h / var(--__a))`}function Ws(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2,colorSpace:i,...o}=e,s=e.primary||Pm(t),a=e.secondary||Dm(t),l=e.error||$m(t),c=e.info||Lm(t),u=e.success||Nm(t),d=e.warning||zm(t);function h(y){if(i)return Fm(y);const v=hl(y,vs.text.primary)>=n?vs.text.primary:Fu.text.primary;if(process.env.NODE_ENV!=="production"){const T=hl(y,v);T<3&&console.error([`MUI: The contrast ratio of ${T}:1 for ${v} on ${y}`,"falls below the WCAG recommended absolute minimum contrast ratio of 3:1.","https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast"].join(`
|
|
49
|
+
`))}return v}const f=({color:y,name:v,mainShade:T=500,lightShade:w=300,darkShade:E=700})=>{if(y={...y},!y.main&&y[T]&&(y.main=y[T]),!y.hasOwnProperty("main"))throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${v?` (${v})`:""} provided to augmentColor(color) is invalid.
|
|
50
|
+
The color object needs to have a \`main\` property or a \`${T}\` property.`:Bt(11,v?` (${v})`:"",T));if(typeof y.main!="string")throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${v?` (${v})`:""} provided to augmentColor(color) is invalid.
|
|
51
|
+
\`color.main\` should be a string, but \`${JSON.stringify(y.main)}\` was provided instead.
|
|
52
|
+
|
|
53
|
+
Did you intend to use one of the following approaches?
|
|
54
|
+
|
|
55
|
+
import { green } from "@mui/material/colors";
|
|
56
|
+
|
|
57
|
+
const theme1 = createTheme({ palette: {
|
|
58
|
+
primary: green,
|
|
59
|
+
} });
|
|
60
|
+
|
|
61
|
+
const theme2 = createTheme({ palette: {
|
|
62
|
+
primary: { main: green[500] },
|
|
63
|
+
} });`:Bt(12,v?` (${v})`:"",JSON.stringify(y.main)));return i?(xl(i,y,"light",w,r),xl(i,y,"dark",E,r)):(yl(y,"light",w,r),yl(y,"dark",E,r)),y.contrastText||(y.contrastText=h(y.main)),y};let m;return t==="light"?m=zu():t==="dark"&&(m=Bu()),process.env.NODE_ENV!=="production"&&(m||console.error(`MUI: The palette mode \`${t}\` is not supported.`)),$e({common:{...hr},mode:t,primary:f({color:s,name:"primary"}),secondary:f({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:f({color:l,name:"error"}),warning:f({color:d,name:"warning"}),info:f({color:c,name:"info"}),success:f({color:u,name:"success"}),grey:Om,contrastThreshold:n,getContrastText:h,augmentColor:f,tonalOffset:r,...m},o)}function Bm(e){const t={};return Object.entries(e).forEach(r=>{const[i,o]=r;typeof o=="object"&&(t[i]=`${o.fontStyle?`${o.fontStyle} `:""}${o.fontVariant?`${o.fontVariant} `:""}${o.fontWeight?`${o.fontWeight} `:""}${o.fontStretch?`${o.fontStretch} `:""}${o.fontSize||""}${o.lineHeight?`/${o.lineHeight} `:""}${o.fontFamily||""}`)}),t}function Gm(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function Vm(e){return Math.round(e*1e5)/1e5}const bl={textTransform:"uppercase"},vl='"Roboto", "Helvetica", "Arial", sans-serif';function Um(e,t){const{fontFamily:n=vl,fontSize:r=14,fontWeightLight:i=300,fontWeightRegular:o=400,fontWeightMedium:s=500,fontWeightBold:a=700,htmlFontSize:l=16,allVariants:c,pxToRem:u,...d}=typeof t=="function"?t(e):t;process.env.NODE_ENV!=="production"&&(typeof r!="number"&&console.error("MUI: `fontSize` is required to be a number."),typeof l!="number"&&console.error("MUI: `htmlFontSize` is required to be a number."));const h=r/14,f=u||(y=>`${y/l*h}rem`),m=(y,v,T,w,E)=>({fontFamily:n,fontWeight:y,fontSize:f(v),lineHeight:T,...n===vl?{letterSpacing:`${Vm(w/v)}em`}:{},...E,...c}),p={h1:m(i,96,1.167,-1.5),h2:m(i,60,1.2,-.5),h3:m(o,48,1.167,0),h4:m(o,34,1.235,.25),h5:m(o,24,1.334,0),h6:m(s,20,1.6,.15),subtitle1:m(o,16,1.75,.15),subtitle2:m(s,14,1.57,.1),body1:m(o,16,1.5,.15),body2:m(o,14,1.43,.15),button:m(s,14,1.75,.4,bl),caption:m(o,12,1.66,.4),overline:m(o,12,2.66,1,bl),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return $e({htmlFontSize:l,pxToRem:f,fontFamily:n,fontSize:r,fontWeightLight:i,fontWeightRegular:o,fontWeightMedium:s,fontWeightBold:a,...p},d,{clone:!1})}const Wm=.2,Hm=.14,Ym=.12;function me(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${Wm})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${Hm})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${Ym})`].join(",")}const qm=["none",me(0,2,1,-1,0,1,1,0,0,1,3,0),me(0,3,1,-2,0,2,2,0,0,1,5,0),me(0,3,3,-2,0,3,4,0,0,1,8,0),me(0,2,4,-1,0,4,5,0,0,1,10,0),me(0,3,5,-1,0,5,8,0,0,1,14,0),me(0,3,5,-1,0,6,10,0,0,1,18,0),me(0,4,5,-2,0,7,10,1,0,2,16,1),me(0,5,5,-3,0,8,10,1,0,3,14,2),me(0,5,6,-3,0,9,12,1,0,3,16,2),me(0,6,6,-3,0,10,14,1,0,4,18,3),me(0,6,7,-4,0,11,15,1,0,4,20,3),me(0,7,8,-4,0,12,17,2,0,5,22,4),me(0,7,8,-4,0,13,19,2,0,5,24,4),me(0,7,9,-4,0,14,21,2,0,5,26,4),me(0,8,9,-5,0,15,22,2,0,6,28,5),me(0,8,10,-5,0,16,24,2,0,6,30,5),me(0,8,11,-5,0,17,26,2,0,6,32,5),me(0,9,11,-5,0,18,28,2,0,7,34,6),me(0,9,12,-6,0,19,29,2,0,7,36,6),me(0,10,13,-6,0,20,31,3,0,8,38,7),me(0,10,13,-6,0,21,33,3,0,8,40,7),me(0,10,14,-6,0,22,35,3,0,8,42,7),me(0,11,14,-7,0,23,36,3,0,9,44,8),me(0,11,15,-7,0,24,38,3,0,9,46,8)],Jm={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},Km={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Sl(e){return`${Math.round(e)}ms`}function Xm(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function Zm(e){const t={...Jm,...e.easing},n={...Km,...e.duration};return{getAutoHeightDuration:Xm,create:(i=["all"],o={})=>{const{duration:s=n.standard,easing:a=t.easeInOut,delay:l=0,...c}=o;if(process.env.NODE_ENV!=="production"){const u=h=>typeof h=="string",d=h=>!Number.isNaN(parseFloat(h));!u(i)&&!Array.isArray(i)&&console.error('MUI: Argument "props" must be a string or Array.'),!d(s)&&!u(s)&&console.error(`MUI: Argument "duration" must be a number or a string but found ${s}.`),u(a)||console.error('MUI: Argument "easing" must be a string.'),!d(l)&&!u(l)&&console.error('MUI: Argument "delay" must be a number or a string.'),typeof o!="object"&&console.error(["MUI: Secong argument of transition.create must be an object.","Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`"].join(`
|
|
64
|
+
`)),Object.keys(c).length!==0&&console.error(`MUI: Unrecognized argument(s) [${Object.keys(c).join(",")}].`)}return(Array.isArray(i)?i:[i]).map(u=>`${u} ${typeof s=="string"?s:Sl(s)} ${a} ${typeof l=="string"?l:Sl(l)}`).join(",")},...e,easing:t,duration:n}}const Qm={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function eg(e){return ct(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function Gu(e={}){const t={...e};function n(r){const i=Object.entries(r);for(let o=0;o<i.length;o++){const[s,a]=i[o];!eg(a)||s.startsWith("unstable_")?delete r[s]:ct(a)&&(r[s]={...a},n(r[s]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
|
|
65
|
+
|
|
66
|
+
const theme = ${JSON.stringify(t,null,2)};
|
|
67
|
+
|
|
68
|
+
theme.breakpoints = createBreakpoints(theme.breakpoints || {});
|
|
69
|
+
theme.transitions = createTransitions(theme.transitions || {});
|
|
70
|
+
|
|
71
|
+
export default theme;`}function wl(e){return typeof e=="number"?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}const tg=e=>{if(!Number.isNaN(+e))return+e;const t=e.match(/\d*\.?\d+/g);if(!t)return 0;let n=0;for(let r=0;r<t.length;r+=1)n+=+t[r];return n};function ng(e){Object.assign(e,{alpha(t,n){const r=this||e;return r.colorSpace?`oklch(from ${t} l c h / ${typeof n=="string"?`calc(${n})`:n})`:r.vars?`rgba(${t.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${typeof n=="string"?`calc(${n})`:n})`:Nu(t,tg(n))},lighten(t,n){const r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #fff ${wl(n)})`:to(t,n)},darken(t,n){const r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #000 ${wl(n)})`:eo(t,n)}})}function Ss(e={},...t){const{breakpoints:n,mixins:r={},spacing:i,palette:o={},transitions:s={},typography:a={},shape:l,colorSpace:c,...u}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(process.env.NODE_ENV!=="production"?"MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.":Bt(20));const d=Ws({...o,colorSpace:c}),h=Xi(e);let f=$e(h,{mixins:Gm(h.breakpoints,r),palette:d,shadows:qm.slice(),typography:Um(d,a),transitions:Zm(s),zIndex:{...Qm}});if(f=$e(f,u),f=t.reduce((m,p)=>$e(m,p),f),process.env.NODE_ENV!=="production"){const m=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],p=(y,v)=>{let T;for(T in y){const w=y[T];if(m.includes(T)&&Object.keys(w).length>0){if(process.env.NODE_ENV!=="production"){const E=fn("",T);console.error([`MUI: The \`${v}\` component increases the CSS specificity of the \`${T}\` internal state.`,"You can not override it like this: ",JSON.stringify(y,null,2),"",`Instead, you need to use the '&.${E}' syntax:`,JSON.stringify({root:{[`&.${E}`]:w}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
|
|
72
|
+
`))}y[T]={}}}};Object.keys(f.components).forEach(y=>{const v=f.components[y].styleOverrides;v&&y.startsWith("Mui")&&p(v,y)})}return f.unstable_sxConfig={...Tr,...u==null?void 0:u.unstable_sxConfig},f.unstable_sx=function(p){return zn({sx:p,theme:this})},f.toRuntimeSource=Gu,ng(f),f}function rg(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const ig=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=rg(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function Vu(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function Uu(e){return e==="dark"?ig:[]}function og(e){const{palette:t={mode:"light"},opacity:n,overlays:r,colorSpace:i,...o}=e,s=Ws({...t,colorSpace:i});return{palette:s,opacity:{...Vu(s.mode),...n},overlays:r||Uu(s.mode),...o}}function sg(e){var t;return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((t=e[1])!=null&&t.match(/(mode|contrastThreshold|tonalOffset)/))}const ag=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],lg=e=>(t,n)=>{const r=e.rootSelector||":root",i=e.colorSchemeSelector;let o=i;if(i==="class"&&(o=".%s"),i==="data"&&(o="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(o=`[${i}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const s={};return ag(e.cssVarPrefix).forEach(a=>{s[a]=n[a],delete n[a]}),o==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:s}}:o?{[o.replace("%s",t)]:s,[`${r}, ${o.replace("%s",t)}`]:n}:{[r]:{...n,...s}}}if(o&&o!=="media")return`${r}, ${o.replace("%s",String(t))}`}else if(t){if(o==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(o)return o.replace("%s",String(t))}return r};function cg(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function O(e,t,n){!e[t]&&n&&(e[t]=n)}function ir(e){return typeof e!="string"||!e.startsWith("hsl")?e:Lu(e)}function wt(e,t){`${t}Channel`in e||(e[`${t}Channel`]=rr(ir(e[t]),`MUI: Can't create \`palette.${t}Channel\` because \`palette.${t}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
|
|
73
|
+
To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function ug(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const st=e=>{try{return e()}catch{}},dg=(e="mui")=>Sm(e);function Wo(e,t,n,r,i){if(!n)return;n=n===!0?{}:n;const o=i==="dark"?"dark":"light";if(!r){t[i]=og({...n,palette:{mode:o,...n==null?void 0:n.palette},colorSpace:e});return}const{palette:s,...a}=Ss({...r,palette:{mode:o,...n==null?void 0:n.palette},colorSpace:e});return t[i]={...n,palette:s,opacity:{...Vu(o),...n==null?void 0:n.opacity},overlays:(n==null?void 0:n.overlays)||Uu(o)},a}function hg(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:o="mui",nativeColor:s=!1,shouldSkipGeneratingVar:a=sg,colorSchemeSelector:l=n.light&&n.dark?"media":void 0,rootSelector:c=":root",...u}=e,d=Object.keys(n)[0],h=r||(n.light&&d!=="light"?"light":d),f=dg(o),{[h]:m,light:p,dark:y,...v}=n,T={...v};let w=m;if((h==="dark"&&!("dark"in n)||h==="light"&&!("light"in n))&&(w=!0),!w)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${h}\` option is either missing or invalid.`:Bt(21,h));let E;s&&(E="oklch");const R=Wo(E,T,w,u,h);p&&!T.light&&Wo(E,T,p,void 0,"light"),y&&!T.dark&&Wo(E,T,y,void 0,"dark");let S={defaultColorScheme:h,...R,cssVarPrefix:o,colorSchemeSelector:l,rootSelector:c,getCssVar:f,colorSchemes:T,font:{...Bm(R.typography),...R.font},spacing:ug(u.spacing)};Object.keys(S.colorSchemes).forEach(D=>{const g=S.colorSchemes[D].palette,A=z=>{const N=z.split("-"),W=N[1],B=N[2];return f(z,g[W][B])};g.mode==="light"&&(O(g.common,"background","#fff"),O(g.common,"onBackground","#000")),g.mode==="dark"&&(O(g.common,"background","#000"),O(g.common,"onBackground","#fff"));function _(z,N,W){if(E){let B;return z===Zt&&(B=`transparent ${((1-W)*100).toFixed(0)}%`),z===se&&(B=`#000 ${(W*100).toFixed(0)}%`),z===ae&&(B=`#fff ${(W*100).toFixed(0)}%`),`color-mix(in ${E}, ${N}, ${B})`}return z(N,W)}if(cg(g,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),g.mode==="light"){O(g.Alert,"errorColor",_(se,g.error.light,.6)),O(g.Alert,"infoColor",_(se,g.info.light,.6)),O(g.Alert,"successColor",_(se,g.success.light,.6)),O(g.Alert,"warningColor",_(se,g.warning.light,.6)),O(g.Alert,"errorFilledBg",A("palette-error-main")),O(g.Alert,"infoFilledBg",A("palette-info-main")),O(g.Alert,"successFilledBg",A("palette-success-main")),O(g.Alert,"warningFilledBg",A("palette-warning-main")),O(g.Alert,"errorFilledColor",st(()=>g.getContrastText(g.error.main))),O(g.Alert,"infoFilledColor",st(()=>g.getContrastText(g.info.main))),O(g.Alert,"successFilledColor",st(()=>g.getContrastText(g.success.main))),O(g.Alert,"warningFilledColor",st(()=>g.getContrastText(g.warning.main))),O(g.Alert,"errorStandardBg",_(ae,g.error.light,.9)),O(g.Alert,"infoStandardBg",_(ae,g.info.light,.9)),O(g.Alert,"successStandardBg",_(ae,g.success.light,.9)),O(g.Alert,"warningStandardBg",_(ae,g.warning.light,.9)),O(g.Alert,"errorIconColor",A("palette-error-main")),O(g.Alert,"infoIconColor",A("palette-info-main")),O(g.Alert,"successIconColor",A("palette-success-main")),O(g.Alert,"warningIconColor",A("palette-warning-main")),O(g.AppBar,"defaultBg",A("palette-grey-100")),O(g.Avatar,"defaultBg",A("palette-grey-400")),O(g.Button,"inheritContainedBg",A("palette-grey-300")),O(g.Button,"inheritContainedHoverBg",A("palette-grey-A100")),O(g.Chip,"defaultBorder",A("palette-grey-400")),O(g.Chip,"defaultAvatarColor",A("palette-grey-700")),O(g.Chip,"defaultIconColor",A("palette-grey-700")),O(g.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),O(g.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),O(g.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),O(g.LinearProgress,"primaryBg",_(ae,g.primary.main,.62)),O(g.LinearProgress,"secondaryBg",_(ae,g.secondary.main,.62)),O(g.LinearProgress,"errorBg",_(ae,g.error.main,.62)),O(g.LinearProgress,"infoBg",_(ae,g.info.main,.62)),O(g.LinearProgress,"successBg",_(ae,g.success.main,.62)),O(g.LinearProgress,"warningBg",_(ae,g.warning.main,.62)),O(g.Skeleton,"bg",E?_(Zt,g.text.primary,.11):`rgba(${A("palette-text-primaryChannel")} / 0.11)`),O(g.Slider,"primaryTrack",_(ae,g.primary.main,.62)),O(g.Slider,"secondaryTrack",_(ae,g.secondary.main,.62)),O(g.Slider,"errorTrack",_(ae,g.error.main,.62)),O(g.Slider,"infoTrack",_(ae,g.info.main,.62)),O(g.Slider,"successTrack",_(ae,g.success.main,.62)),O(g.Slider,"warningTrack",_(ae,g.warning.main,.62));const z=E?_(se,g.background.default,.6825):Br(g.background.default,.8);O(g.SnackbarContent,"bg",z),O(g.SnackbarContent,"color",st(()=>E?vs.text.primary:g.getContrastText(z))),O(g.SpeedDialAction,"fabHoverBg",Br(g.background.paper,.15)),O(g.StepConnector,"border",A("palette-grey-400")),O(g.StepContent,"border",A("palette-grey-400")),O(g.Switch,"defaultColor",A("palette-common-white")),O(g.Switch,"defaultDisabledColor",A("palette-grey-100")),O(g.Switch,"primaryDisabledColor",_(ae,g.primary.main,.62)),O(g.Switch,"secondaryDisabledColor",_(ae,g.secondary.main,.62)),O(g.Switch,"errorDisabledColor",_(ae,g.error.main,.62)),O(g.Switch,"infoDisabledColor",_(ae,g.info.main,.62)),O(g.Switch,"successDisabledColor",_(ae,g.success.main,.62)),O(g.Switch,"warningDisabledColor",_(ae,g.warning.main,.62)),O(g.TableCell,"border",_(ae,_(Zt,g.divider,1),.88)),O(g.Tooltip,"bg",_(Zt,g.grey[700],.92))}if(g.mode==="dark"){O(g.Alert,"errorColor",_(ae,g.error.light,.6)),O(g.Alert,"infoColor",_(ae,g.info.light,.6)),O(g.Alert,"successColor",_(ae,g.success.light,.6)),O(g.Alert,"warningColor",_(ae,g.warning.light,.6)),O(g.Alert,"errorFilledBg",A("palette-error-dark")),O(g.Alert,"infoFilledBg",A("palette-info-dark")),O(g.Alert,"successFilledBg",A("palette-success-dark")),O(g.Alert,"warningFilledBg",A("palette-warning-dark")),O(g.Alert,"errorFilledColor",st(()=>g.getContrastText(g.error.dark))),O(g.Alert,"infoFilledColor",st(()=>g.getContrastText(g.info.dark))),O(g.Alert,"successFilledColor",st(()=>g.getContrastText(g.success.dark))),O(g.Alert,"warningFilledColor",st(()=>g.getContrastText(g.warning.dark))),O(g.Alert,"errorStandardBg",_(se,g.error.light,.9)),O(g.Alert,"infoStandardBg",_(se,g.info.light,.9)),O(g.Alert,"successStandardBg",_(se,g.success.light,.9)),O(g.Alert,"warningStandardBg",_(se,g.warning.light,.9)),O(g.Alert,"errorIconColor",A("palette-error-main")),O(g.Alert,"infoIconColor",A("palette-info-main")),O(g.Alert,"successIconColor",A("palette-success-main")),O(g.Alert,"warningIconColor",A("palette-warning-main")),O(g.AppBar,"defaultBg",A("palette-grey-900")),O(g.AppBar,"darkBg",A("palette-background-paper")),O(g.AppBar,"darkColor",A("palette-text-primary")),O(g.Avatar,"defaultBg",A("palette-grey-600")),O(g.Button,"inheritContainedBg",A("palette-grey-800")),O(g.Button,"inheritContainedHoverBg",A("palette-grey-700")),O(g.Chip,"defaultBorder",A("palette-grey-700")),O(g.Chip,"defaultAvatarColor",A("palette-grey-300")),O(g.Chip,"defaultIconColor",A("palette-grey-300")),O(g.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),O(g.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),O(g.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),O(g.LinearProgress,"primaryBg",_(se,g.primary.main,.5)),O(g.LinearProgress,"secondaryBg",_(se,g.secondary.main,.5)),O(g.LinearProgress,"errorBg",_(se,g.error.main,.5)),O(g.LinearProgress,"infoBg",_(se,g.info.main,.5)),O(g.LinearProgress,"successBg",_(se,g.success.main,.5)),O(g.LinearProgress,"warningBg",_(se,g.warning.main,.5)),O(g.Skeleton,"bg",E?_(Zt,g.text.primary,.13):`rgba(${A("palette-text-primaryChannel")} / 0.13)`),O(g.Slider,"primaryTrack",_(se,g.primary.main,.5)),O(g.Slider,"secondaryTrack",_(se,g.secondary.main,.5)),O(g.Slider,"errorTrack",_(se,g.error.main,.5)),O(g.Slider,"infoTrack",_(se,g.info.main,.5)),O(g.Slider,"successTrack",_(se,g.success.main,.5)),O(g.Slider,"warningTrack",_(se,g.warning.main,.5));const z=E?_(ae,g.background.default,.985):Br(g.background.default,.98);O(g.SnackbarContent,"bg",z),O(g.SnackbarContent,"color",st(()=>E?Fu.text.primary:g.getContrastText(z))),O(g.SpeedDialAction,"fabHoverBg",Br(g.background.paper,.15)),O(g.StepConnector,"border",A("palette-grey-600")),O(g.StepContent,"border",A("palette-grey-600")),O(g.Switch,"defaultColor",A("palette-grey-300")),O(g.Switch,"defaultDisabledColor",A("palette-grey-600")),O(g.Switch,"primaryDisabledColor",_(se,g.primary.main,.55)),O(g.Switch,"secondaryDisabledColor",_(se,g.secondary.main,.55)),O(g.Switch,"errorDisabledColor",_(se,g.error.main,.55)),O(g.Switch,"infoDisabledColor",_(se,g.info.main,.55)),O(g.Switch,"successDisabledColor",_(se,g.success.main,.55)),O(g.Switch,"warningDisabledColor",_(se,g.warning.main,.55)),O(g.TableCell,"border",_(se,_(Zt,g.divider,1),.68)),O(g.Tooltip,"bg",_(Zt,g.grey[700],.92))}wt(g.background,"default"),wt(g.background,"paper"),wt(g.common,"background"),wt(g.common,"onBackground"),wt(g,"divider"),Object.keys(g).forEach(z=>{const N=g[z];z!=="tonalOffset"&&N&&typeof N=="object"&&(N.main&&O(g[z],"mainChannel",rr(ir(N.main))),N.light&&O(g[z],"lightChannel",rr(ir(N.light))),N.dark&&O(g[z],"darkChannel",rr(ir(N.dark))),N.contrastText&&O(g[z],"contrastTextChannel",rr(ir(N.contrastText))),z==="text"&&(wt(g[z],"primary"),wt(g[z],"secondary")),z==="action"&&(N.active&&wt(g[z],"active"),N.selected&&wt(g[z],"selected")))})}),S=t.reduce((D,g)=>$e(D,g),S);const C={prefix:o,disableCssColorScheme:i,shouldSkipGeneratingVar:a,getSelector:lg(S),enableContrastVars:s},{vars:I,generateThemeVars:k,generateStyleSheets:P}=Tm(S,C);return S.vars=I,Object.entries(S.colorSchemes[S.defaultColorScheme]).forEach(([D,g])=>{S[D]=g}),S.generateThemeVars=k,S.generateStyleSheets=P,S.generateSpacing=function(){return Au(u.spacing,Wi(this))},S.getColorSchemeSelector=Cm(l),S.spacing=S.generateSpacing(),S.shouldSkipGeneratingVar=a,S.unstable_sxConfig={...Tr,...u==null?void 0:u.unstable_sxConfig},S.unstable_sx=function(g){return zn({sx:g,theme:this})},S.toRuntimeSource=Gu,S}function El(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:Ws({...n===!0?{}:n.palette,mode:t})})}function Wu(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:i=n?void 0:{light:!0},defaultColorScheme:o=n==null?void 0:n.mode,...s}=e,a=o||"light",l=i==null?void 0:i[a],c={...i,...n?{[a]:{...typeof l!="boolean"&&l,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in e))return Ss(e,...t);let u=n;"palette"in e||c[a]&&(c[a]!==!0?u=c[a].palette:a==="dark"&&(u={mode:"dark"}));const d=Ss({...e,palette:u},...t);return d.defaultColorScheme=a,d.colorSchemes=c,d.palette.mode==="light"&&(d.colorSchemes.light={...c.light!==!0&&c.light,palette:d.palette},El(d,"dark",c.dark)),d.palette.mode==="dark"&&(d.colorSchemes.dark={...c.dark!==!0&&c.dark,palette:d.palette},El(d,"light",c.light)),d}return!n&&!("light"in c)&&a==="light"&&(c.light=!0),hg({...s,colorSchemes:c,defaultColorScheme:a,...typeof r!="boolean"&&r},...t)}const Hs=Wu();function Hu(){const e=Iu(Hs);return process.env.NODE_ENV!=="production"&&j.useDebugValue(e),e[Gs]||e}function fg({props:e,name:t}){return $u({props:e,name:t,defaultTheme:Hs,themeId:Gs})}function Ys(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const pg=e=>Ys(e)&&e!=="classes",Ue=Pu({themeId:Gs,defaultTheme:Hs,rootShouldForwardProp:pg});function no(...e){const t=j.useRef(void 0),n=j.useCallback(r=>{const i=e.map(o=>{if(o==null)return null;if(typeof o=="function"){const s=o,a=s(r);return typeof a=="function"?a:()=>{s(null)}}return o.current=r,()=>{o.current=null}});return()=>{i.forEach(o=>o==null?void 0:o())}},e);return j.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}var mg=(e,t,n)=>{if(t.length===1&&t[0]===n){let r=!1;try{const i={};e(i)===i&&(r=!0)}catch{}if(r){let i;try{throw new Error}catch(o){({stack:i}=o)}console.warn(`The result function returned its own inputs without modification. e.g
|
|
74
|
+
\`createSelector([state => state.todos], todos => todos)\`
|
|
75
|
+
This could lead to inefficient memoization and unnecessary re-renders.
|
|
76
|
+
Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:i})}}},gg=(e,t,n)=>{const{memoize:r,memoizeOptions:i}=t,{inputSelectorResults:o,inputSelectorResultsCopy:s}=e,a=r(()=>({}),...i);if(!(a.apply(null,o)===a.apply(null,s))){let c;try{throw new Error}catch(u){({stack:c}=u)}console.warn(`An input selector returned a different result when passed same arguments.
|
|
77
|
+
This means your output selector will likely run more frequently than intended.
|
|
78
|
+
Avoid returning a new reference inside your input selector, e.g.
|
|
79
|
+
\`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:n,firstInputs:o,secondInputs:s,stack:c})}},yg={inputStabilityCheck:"once",identityFunctionCheck:"once"},xi=Symbol("NOT_FOUND");function xg(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function bg(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function vg(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var Tl=e=>Array.isArray(e)?e:[e];function Sg(e){const t=Array.isArray(e[0])?e[0]:e;return vg(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Cl(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var wg=(e,t)=>{const{identityFunctionCheck:n,inputStabilityCheck:r}={...yg,...t};return{identityFunctionCheck:{shouldRun:n==="always"||n==="once"&&e,run:mg},inputStabilityCheck:{shouldRun:r==="always"||r==="once"&&e,run:gg}}};function Eg(e){let t;return{get(n){return t&&e(t.key,n)?t.value:xi},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function Tg(e,t){let n=[];function r(a){const l=n.findIndex(c=>t(a,c.key));if(l>-1){const c=n[l];return l>0&&(n.splice(l,1),n.unshift(c)),c.value}return xi}function i(a,l){r(a)===xi&&(n.unshift({key:a,value:l}),n.length>e&&n.pop())}function o(){return n}function s(){n=[]}return{get:r,put:i,getEntries:o,clear:s}}var Cg=(e,t)=>e===t;function _g(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:i}=n;for(let o=0;o<i;o++)if(!e(n[o],r[o]))return!1;return!0}}function Mg(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=Cg,maxSize:i=1,resultEqualityCheck:o}=n,s=_g(r);let a=0;const l=i<=1?Eg(s):Tg(i,s);function c(){let u=l.get(arguments);if(u===xi){if(u=e.apply(null,arguments),a++,o){const h=l.getEntries().find(f=>o(f.value,u));h&&(u=h.value,a!==0&&a--)}l.put(arguments,u)}return u}return c.clearCache=()=>{l.clear(),c.resetResultsCount()},c.resultsCount=()=>a,c.resetResultsCount=()=>{a=0},c}var Rg=class{constructor(e){this.value=e}deref(){return this.value}},Ag=typeof WeakRef<"u"?WeakRef:Rg,Ig=0,_l=1;function Gr(){return{s:Ig,v:void 0,o:null,p:null}}function Yu(e,t={}){let n=Gr();const{resultEqualityCheck:r}=t;let i,o=0;function s(){var d;let a=n;const{length:l}=arguments;for(let h=0,f=l;h<f;h++){const m=arguments[h];if(typeof m=="function"||typeof m=="object"&&m!==null){let p=a.o;p===null&&(a.o=p=new WeakMap);const y=p.get(m);y===void 0?(a=Gr(),p.set(m,a)):a=y}else{let p=a.p;p===null&&(a.p=p=new Map);const y=p.get(m);y===void 0?(a=Gr(),p.set(m,a)):a=y}}const c=a;let u;if(a.s===_l)u=a.v;else if(u=e.apply(null,arguments),o++,r){const h=((d=i==null?void 0:i.deref)==null?void 0:d.call(i))??i;h!=null&&r(h,u)&&(u=h,o!==0&&o--),i=typeof u=="object"&&u!==null||typeof u=="function"?new Ag(u):u}return c.s=_l,c.v=u,u}return s.clearCache=()=>{n=Gr(),s.resetResultsCount()},s.resultsCount=()=>o,s.resetResultsCount=()=>{o=0},s}function qu(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let o=0,s=0,a,l={},c=i.pop();typeof c=="object"&&(l=c,c=i.pop()),xg(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const u={...n,...l},{memoize:d,memoizeOptions:h=[],argsMemoize:f=Yu,argsMemoizeOptions:m=[],devModeChecks:p={}}=u,y=Tl(h),v=Tl(m),T=Sg(i),w=d(function(){return o++,c.apply(null,arguments)},...y);let E=!0;const R=f(function(){s++;const C=Cl(T,arguments);if(a=w.apply(null,C),process.env.NODE_ENV!=="production"){const{identityFunctionCheck:I,inputStabilityCheck:k}=wg(E,p);if(I.shouldRun&&I.run(c,C,a),k.shouldRun){const P=Cl(T,arguments);k.run({inputSelectorResults:C,inputSelectorResultsCopy:P},{memoize:d,memoizeOptions:y},arguments)}E&&(E=!1)}return a},...v);return Object.assign(R,{resultFunc:c,memoizedResultFunc:w,dependencies:T,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>a,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:d,argsMemoize:f})};return Object.assign(r,{withTypes:()=>r}),r}var jg=qu(Yu),kg=Object.assign((e,t=jg)=>{bg(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(o=>e[o]);return t(r,(...o)=>o.reduce((s,a,l)=>(s[n[l]]=a,s),{}))},{withTypes:()=>kg});const Og=qu({memoize:Mg,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),X=(e,t,n,r,i,o,s,a,...l)=>{if(l.length>0)throw new Error("Unsupported number of selectors");let c;if(e&&t&&n&&r&&i&&o&&s&&a)c=(u,d,h,f)=>{const m=e(u,d,h,f),p=t(u,d,h,f),y=n(u,d,h,f),v=r(u,d,h,f),T=i(u,d,h,f),w=o(u,d,h,f),E=s(u,d,h,f);return a(m,p,y,v,T,w,E,d,h,f)};else if(e&&t&&n&&r&&i&&o&&s)c=(u,d,h,f)=>{const m=e(u,d,h,f),p=t(u,d,h,f),y=n(u,d,h,f),v=r(u,d,h,f),T=i(u,d,h,f),w=o(u,d,h,f);return s(m,p,y,v,T,w,d,h,f)};else if(e&&t&&n&&r&&i&&o)c=(u,d,h,f)=>{const m=e(u,d,h,f),p=t(u,d,h,f),y=n(u,d,h,f),v=r(u,d,h,f),T=i(u,d,h,f);return o(m,p,y,v,T,d,h,f)};else if(e&&t&&n&&r&&i)c=(u,d,h,f)=>{const m=e(u,d,h,f),p=t(u,d,h,f),y=n(u,d,h,f),v=r(u,d,h,f);return i(m,p,y,v,d,h,f)};else if(e&&t&&n&&r)c=(u,d,h,f)=>{const m=e(u,d,h,f),p=t(u,d,h,f),y=n(u,d,h,f);return r(m,p,y,d,h,f)};else if(e&&t&&n)c=(u,d,h,f)=>{const m=e(u,d,h,f),p=t(u,d,h,f);return n(m,p,d,h,f)};else if(e&&t)c=(u,d,h,f)=>{const m=e(u,d,h,f);return t(m,d,h,f)};else if(e)c=e;else throw new Error("Missing arguments");return c},qs=e=>(...t)=>{const n=new WeakMap;let r=1;const i=t[t.length-1],o=t.length-1||1,s=Math.max(i.length-o,0);if(s>3)throw new Error("Unsupported number of arguments");return(l,c,u,d)=>{let h=l.__cacheKey__;h||(h={id:r},l.__cacheKey__=h,r+=1);let f=n.get(h);if(!f){const m=t.length===1?[v=>v,i]:t;let p=t;const y=[void 0,void 0,void 0];switch(s){case 0:break;case 1:{p=[...m.slice(0,-1),()=>y[0],i];break}case 2:{p=[...m.slice(0,-1),()=>y[0],()=>y[1],i];break}case 3:{p=[...m.slice(0,-1),()=>y[0],()=>y[1],()=>y[2],i];break}default:throw new Error("Unsupported number of arguments")}e&&(p=[...p,e]),f=Og(...p),f.selectorArgs=y,n.set(h,f)}switch(s){case 3:f.selectorArgs[2]=d;case 2:f.selectorArgs[1]=u;case 1:f.selectorArgs[0]=c}switch(s){case 0:return f(l);case 1:return f(l,c);case 2:return f(l,c,u);case 3:return f(l,c,u,d);default:throw new Error("unreachable")}}},Me=qs();var Vr={exports:{}},Ho={};/**
|
|
80
|
+
* @license React
|
|
81
|
+
* use-sync-external-store-shim.production.js
|
|
82
|
+
*
|
|
83
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
84
|
+
*
|
|
85
|
+
* This source code is licensed under the MIT license found in the
|
|
86
|
+
* LICENSE file in the root directory of this source tree.
|
|
87
|
+
*/var Ml;function Pg(){if(Ml)return Ho;Ml=1;var e=$;function t(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(d,h){var f=h(),m=r({inst:{value:f,getSnapshot:h}}),p=m[0].inst,y=m[1];return o(function(){p.value=f,p.getSnapshot=h,l(p)&&y({inst:p})},[d,f,h]),i(function(){return l(p)&&y({inst:p}),d(function(){l(p)&&y({inst:p})})},[d]),s(f),f}function l(d){var h=d.getSnapshot;d=d.value;try{var f=h();return!n(d,f)}catch{return!0}}function c(d,h){return h()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return Ho.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Ho}var Yo={};/**
|
|
88
|
+
* @license React
|
|
89
|
+
* use-sync-external-store-shim.development.js
|
|
90
|
+
*
|
|
91
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the MIT license found in the
|
|
94
|
+
* LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/var Rl;function Dg(){return Rl||(Rl=1,process.env.NODE_ENV!=="production"&&(function(){function e(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}function t(f,m){u||i.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var p=m();if(!d){var y=m();o(p,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}y=s({inst:{value:p,getSnapshot:m}});var v=y[0].inst,T=y[1];return l(function(){v.value=p,v.getSnapshot=m,n(v)&&T({inst:v})},[f,p,m]),a(function(){return n(v)&&T({inst:v}),f(function(){n(v)&&T({inst:v})})},[f]),c(p),p}function n(f){var m=f.getSnapshot;f=f.value;try{var p=m();return!o(f,p)}catch{return!0}}function r(f,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=$,o=typeof Object.is=="function"?Object.is:e,s=i.useState,a=i.useEffect,l=i.useLayoutEffect,c=i.useDebugValue,u=!1,d=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;Yo.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Yo}var Al;function Js(){return Al||(Al=1,process.env.NODE_ENV==="production"?Vr.exports=Pg():Vr.exports=Dg()),Vr.exports}var $g=Js(),Ur={exports:{}},qo={};/**
|
|
96
|
+
* @license React
|
|
97
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
98
|
+
*
|
|
99
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
100
|
+
*
|
|
101
|
+
* This source code is licensed under the MIT license found in the
|
|
102
|
+
* LICENSE file in the root directory of this source tree.
|
|
103
|
+
*/var Il;function Lg(){if(Il)return qo;Il=1;var e=$,t=Js();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return qo.useSyncExternalStoreWithSelector=function(c,u,d,h,f){var m=o(null);if(m.current===null){var p={hasValue:!1,value:null};m.current=p}else p=m.current;m=a(function(){function v(S){if(!T){if(T=!0,w=S,S=h(S),f!==void 0&&p.hasValue){var C=p.value;if(f(C,S))return E=C}return E=S}if(C=E,r(w,S))return C;var I=h(S);return f!==void 0&&f(C,I)?(w=S,C):(w=S,E=I)}var T=!1,w,E,R=d===void 0?null:d;return[function(){return v(u())},R===null?void 0:function(){return v(R())}]},[u,d,h,f]);var y=i(c,m[0],m[1]);return s(function(){p.hasValue=!0,p.value=y},[y]),l(y),y},qo}var Jo={};/**
|
|
104
|
+
* @license React
|
|
105
|
+
* use-sync-external-store-shim/with-selector.development.js
|
|
106
|
+
*
|
|
107
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
108
|
+
*
|
|
109
|
+
* This source code is licensed under the MIT license found in the
|
|
110
|
+
* LICENSE file in the root directory of this source tree.
|
|
111
|
+
*/var jl;function Ng(){return jl||(jl=1,process.env.NODE_ENV!=="production"&&(function(){function e(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=$,n=Js(),r=typeof Object.is=="function"?Object.is:e,i=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;Jo.useSyncExternalStoreWithSelector=function(c,u,d,h,f){var m=o(null);if(m.current===null){var p={hasValue:!1,value:null};m.current=p}else p=m.current;m=a(function(){function v(S){if(!T){if(T=!0,w=S,S=h(S),f!==void 0&&p.hasValue){var C=p.value;if(f(C,S))return E=C}return E=S}if(C=E,r(w,S))return C;var I=h(S);return f!==void 0&&f(C,I)?(w=S,C):(w=S,E=I)}var T=!1,w,E,R=d===void 0?null:d;return[function(){return v(u())},R===null?void 0:function(){return v(R())}]},[u,d,h,f]);var y=i(c,m[0],m[1]);return s(function(){p.hasValue=!0,p.value=y},[y]),l(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Jo}var kl;function zg(){return kl||(kl=1,process.env.NODE_ENV==="production"?Ur.exports=Lg():Ur.exports=Ng()),Ur.exports}var Fg=zg();const Bg=parseInt(j.version,10),Gg=Bg>=19,Vg=Gg?Wg:Hg;function Ug(e,t,n,r,i){return Vg(e,t,n,r,i)}function Wg(e,t,n,r,i){const o=j.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return $g.useSyncExternalStore(e.subscribe,o,o)}function Hg(e,t,n,r,i){return Fg.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,r,i))}const Ol={};function Yg(e,t){const n=j.useRef(Ol);return n.current===Ol&&(n.current=e(t)),n}const qg=[];function Jg(e){j.useEffect(e,qg)}const Kg=()=>{};function Xg(e,t,n){const r=Yg(Zg,{store:e,selector:t}).current;r.effect=n,Jg(r.onMount)}function Zg(e){const{store:t,selector:n}=e;let r=n(t.state);const i={effect:Kg,dispose:null,subscribe:()=>{i.dispose??(i.dispose=t.subscribe(o=>{const s=n(o);if(!Object.is(r,s)){const a=r;r=s,i.effect(a,s)}}))},onMount:()=>(i.subscribe(),()=>{var o;(o=i.dispose)==null||o.call(i),i.dispose=null})};return i.subscribe(),i}class Ks{constructor(t){H(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));H(this,"getSnapshot",()=>this.state);H(this,"use",(t,n,r,i)=>Ug(this,t,n,r,i));this.state=t,this.listeners=new Set,this.updateTick=0}static create(t){return new Ks(t)}setState(t){this.state=t,this.updateTick+=1;const n=this.updateTick,r=this.listeners.values();let i;for(;i=r.next(),!i.done;){if(n!==this.updateTick)return;const o=i.value;o(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState(G({},this.state,t));return}}set(t,n){Object.is(this.state[t],n)||this.setState(G({},this.state,{[t]:n}))}}const ro=({params:e,store:t})=>{j.useEffect(()=>{t.set("animation",G({},t.state.animation,{skip:e.skipAnimation}))},[t,e.skipAnimation]);const n=j.useCallback(()=>{let r=!1;return t.set("animation",G({},t.state.animation,{skipAnimationRequests:t.state.animation.skipAnimationRequests+1})),()=>{r||(r=!0,t.set("animation",G({},t.state.animation,{skipAnimationRequests:t.state.animation.skipAnimationRequests-1})))}},[t]);return pt(()=>{if(typeof window>"u"||!(window!=null&&window.matchMedia))return;let i;const o=a=>{a.matches?i=n():i==null||i()},s=window.matchMedia("(prefers-reduced-motion)");return o(s),s.addEventListener("change",o),()=>{s.removeEventListener("change",o)}},[n,t]),{instance:{disableAnimation:n}}};ro.params={skipAnimation:!0};ro.getDefaultizedParams=({params:e})=>G({},e,{skipAnimation:e.skipAnimation??!1});ro.getInitialState=({skipAnimation:e})=>{const t=typeof window>"u"||!(window!=null&&window.matchMedia),n=process.env.NODE_ENV==="test"?t:!1;return{animation:{skip:e,skipAnimationRequests:n?1:0}}};const Qg=e=>e.animation,e0=X(Qg,e=>e.skip||e.skipAnimationRequests>0);function Ju(e,t){const n=j.useRef(!0);j.useEffect(()=>{if(n.current){n.current=!1;return}return e()},t)}function lr(e){return e&&e.ownerDocument||document}function t0(e){return lr(e).defaultView||window}const n0="DEFAULT_X_AXIS_KEY",r0="DEFAULT_Y_AXIS_KEY",i0={top:20,bottom:20,left:20,right:20},o0=45,s0=25,Ku=20,It=e=>{var t;return(t=e.cartesianAxis)==null?void 0:t.x},jt=e=>{var t;return(t=e.cartesianAxis)==null?void 0:t.y},a0=X(jt,function(t){return(t??[]).reduce((n,r)=>{var i;return r.position==="left"?n+(r.width||0)+((i=r.zoom)!=null&&i.slider.enabled?r.zoom.slider.size:0):n},0)}),l0=X(jt,function(t){return(t??[]).reduce((n,r)=>{var i;return r.position==="right"?n+(r.width||0)+((i=r.zoom)!=null&&i.slider.enabled?r.zoom.slider.size:0):n},0)}),c0=X(It,function(t){return(t??[]).reduce((n,r)=>{var i;return r.position==="top"?n+(r.height||0)+((i=r.zoom)!=null&&i.slider.enabled?r.zoom.slider.size:0):n},0)}),u0=X(It,function(t){return(t??[]).reduce((n,r)=>{var i;return r.position==="bottom"?n+(r.height||0)+((i=r.zoom)!=null&&i.slider.enabled?r.zoom.slider.size:0):n},0)}),d0=Me(a0,l0,c0,u0,function(t,n,r,i){return{left:t,right:n,top:r,bottom:i}}),Cr=e=>e.dimensions,h0=e=>e.dimensions.margin,gt=Me(Cr,h0,d0,function({width:t,height:n},{top:r,right:i,bottom:o,left:s},{left:a,right:l,top:c,bottom:u}){return{width:t-s-i-a-l,left:s+a,right:i+l,height:n-r-o-c-u,top:r+c,bottom:o+u}}),f0=X(Cr,e=>e.width),p0=X(Cr,e=>e.height),m0=X(Cr,e=>e.propsWidth),g0=X(Cr,e=>e.propsHeight);function Xu(e,t){return typeof e=="number"?{top:e,bottom:e,left:e,right:e}:t?G({},t,e):e}const y0=10,io=({params:e,store:t,svgRef:n})=>{const r=e.width!==void 0&&e.height!==void 0,i=j.useRef({displayError:!1,initialCompute:!0,computeRun:0}),[o,s]=j.useState(0),[a,l]=j.useState(0),c=j.useCallback(()=>{const m=n==null?void 0:n.current;if(!m)return{};const y=t0(m).getComputedStyle(m),v=Math.floor(parseFloat(y.height))||0,T=Math.floor(parseFloat(y.width))||0;return(t.state.dimensions.width!==T||t.state.dimensions.height!==v)&&t.set("dimensions",{margin:{top:e.margin.top,right:e.margin.right,bottom:e.margin.bottom,left:e.margin.left},width:e.width??T,height:e.height??v,propsWidth:e.width,propsHeight:e.height}),{height:v,width:T}},[t,n,e.height,e.width,e.margin.left,e.margin.right,e.margin.top,e.margin.bottom]);Ju(()=>{const m=e.width??t.state.dimensions.width,p=e.height??t.state.dimensions.height;t.set("dimensions",{margin:{top:e.margin.top,right:e.margin.right,bottom:e.margin.bottom,left:e.margin.left},width:m,height:p,propsHeight:e.height,propsWidth:e.width})},[t,e.height,e.width,e.margin.left,e.margin.right,e.margin.top,e.margin.bottom]),j.useEffect(()=>{i.current.displayError=!0},[]),pt(()=>{if(r||!i.current.initialCompute||i.current.computeRun>y0)return;const m=c();m.width!==o||m.height!==a?(i.current.computeRun+=1,m.width!==void 0&&s(m.width),m.height!==void 0&&l(m.height)):i.current.initialCompute&&(i.current.initialCompute=!1)},[a,o,c,r]),pt(()=>{if(r)return()=>{};c();const m=n.current;if(typeof ResizeObserver>"u")return()=>{};let p;const y=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{c()})});return m&&y.observe(m),()=>{p&&cancelAnimationFrame(p),m&&y.unobserve(m)}},[c,r,n]),process.env.NODE_ENV!=="production"&&(i.current.displayError&&e.width===void 0&&o===0&&(console.error("MUI X Charts: ChartContainer does not have `width` prop, and its container has no `width` defined."),i.current.displayError=!1),i.current.displayError&&e.height===void 0&&a===0&&(console.error("MUI X Charts: ChartContainer does not have `height` prop, and its container has no `height` defined."),i.current.displayError=!1));const u=t.use(gt),d=j.useCallback(m=>m>=u.left-1&&m<=u.left+u.width,[u.left,u.width]),h=j.useCallback(m=>m>=u.top-1&&m<=u.top+u.height,[u.height,u.top]);return{instance:{isPointInside:j.useCallback((m,p,y)=>y&&"closest"in y&&y.closest("[data-drawing-container]")?!0:d(m)&&h(p),[d,h]),isXInside:d,isYInside:h}}};io.params={width:!0,height:!0,margin:!0};io.getDefaultizedParams=({params:e})=>G({},e,{margin:Xu(e.margin,i0)});io.getInitialState=({width:e,height:t,margin:n})=>({dimensions:{margin:n,width:e??0,height:t??0,propsWidth:e,propsHeight:t}});const Xs=({params:e,store:t})=>(pt(()=>{t.set("experimentalFeatures",e.experimentalFeatures)},[t,e.experimentalFeatures]),{});Xs.params={experimentalFeatures:!0};Xs.getInitialState=({experimentalFeatures:e})=>({experimentalFeatures:e});const x0=e=>e.experimentalFeatures,oo=X(x0,e=>!!(e!=null&&e.preferStrictDomainInLineCharts));let Pl=0;const b0=()=>(Pl+=1,`mui-chart-${Pl}`),Zs=({params:e,store:t})=>(j.useEffect(()=>{e.id===void 0||e.id===t.state.id.providedChartId&&t.state.id.chartId!==void 0||t.set("id",G({},t.state.id,{chartId:e.id??b0()}))},[t,e.id]),{});Zs.params={id:!0};Zs.getInitialState=({id:e})=>({id:{chartId:e,providedChartId:e}});const v0=e=>e.id,S0=X(v0,e=>e.chartId);function rt(e){const t=j.useRef(e);return pt(()=>{t.current=e}),j.useRef((...n)=>(0,t.current)(...n)).current}const w0=["#4254FB","#FFB422","#FA4F58","#0DBEFF","#22BF75","#FA83B4","#FF7511"],E0=["#495AFB","#FFC758","#F35865","#30C8FF","#44CE8D","#F286B3","#FF8C39"],Zu=e=>e==="dark"?E0:w0,Qu=({series:e,colors:t,seriesConfig:n})=>{const r={};return e.forEach((i,o)=>{var l;const s=n[i.type].getSeriesWithDefaultValues(i,o,t),a=s.id;if(r[i.type]===void 0&&(r[i.type]={series:{},seriesOrder:[]}),((l=r[i.type])==null?void 0:l.series[a])!==void 0)throw new Error(`MUI X Charts: series' id "${a}" is not unique.`);r[i.type].series[a]=s,r[i.type].seriesOrder.push(a)}),r},T0=(e,t,n)=>{const r={};return Object.keys(t).forEach(i=>{var s,a;const o=e[i];o!==void 0&&(r[i]=((a=(s=t[i])==null?void 0:s.seriesProcessor)==null?void 0:a.call(s,o,n))??o)}),r},C0=(e,t,n)=>{let r=!1;const i={};return Object.keys(e).forEach(o=>{var l;const s=(l=t[o])==null?void 0:l.seriesLayout,a=e[o];if(s!==void 0&&a!==void 0){const c=s(a,n);c&&c!==e[o]&&(r=!0,i[o]=c)}}),r?i:{}},_0=(e,t)=>{var r;const n=(r=e[t.type])==null?void 0:r.identifierSerializer;if(!n)throw new Error(`MUI X Charts: No identifier serializer found for series type "${t.type}".`);return n(t)},so=({params:e,store:t,seriesConfig:n})=>{const{series:r,dataset:i,theme:o,colors:s}=e;return Ju(()=>{t.set("series",G({},t.state.series,{defaultizedSeries:Qu({series:r,colors:typeof s=="function"?s(o):s,seriesConfig:n}),dataset:i}))},[s,i,r,o,n,t]),{instance:{serializeIdentifier:rt(l=>_0(n,l))}}};so.params={dataset:!0,series:!0,colors:!0,theme:!0};const M0=[];so.getDefaultizedParams=({params:e})=>{var t;return G({},e,{series:(t=e.series)!=null&&t.length?e.series:M0,colors:e.colors??Zu,theme:e.theme??"light"})};so.getInitialState=({series:e=[],colors:t,theme:n,dataset:r},i,o)=>({series:{seriesConfig:o,defaultizedSeries:Qu({series:e,colors:typeof t=="function"?t(n):t,seriesConfig:o}),dataset:r}});const Qs=e=>e.series,R0=X(Qs,e=>e.defaultizedSeries),Wt=X(Qs,e=>e.seriesConfig),A0=X(Qs,e=>e.dataset),Le=Me(R0,Wt,A0,function(t,n,r){return T0(t,n,r)});Me(Le,Wt,gt,function(t,n,r){return C0(t,n,r)});const I0={abort:!0,animationcancel:!0,animationend:!0,animationiteration:!0,animationstart:!0,auxclick:!0,beforeinput:!0,beforetoggle:!0,blur:!0,cancel:!0,canplay:!0,canplaythrough:!0,change:!0,click:!0,close:!0,compositionend:!0,compositionstart:!0,compositionupdate:!0,contextlost:!0,contextmenu:!0,contextrestored:!0,copy:!0,cuechange:!0,cut:!0,dblclick:!0,drag:!0,dragend:!0,dragenter:!0,dragleave:!0,dragover:!0,dragstart:!0,drop:!0,durationchange:!0,emptied:!0,ended:!0,error:!0,focus:!0,focusin:!0,focusout:!0,formdata:!0,gotpointercapture:!0,input:!0,invalid:!0,keydown:!0,keypress:!0,keyup:!0,load:!0,loadeddata:!0,loadedmetadata:!0,loadstart:!0,lostpointercapture:!0,mousedown:!0,mouseenter:!0,mouseleave:!0,mousemove:!0,mouseout:!0,mouseover:!0,mouseup:!0,paste:!0,pause:!0,play:!0,playing:!0,pointercancel:!0,pointerdown:!0,pointerenter:!0,pointerleave:!0,pointermove:!0,pointerout:!0,pointerover:!0,pointerup:!0,progress:!0,ratechange:!0,reset:!0,resize:!0,scroll:!0,scrollend:!0,securitypolicyviolation:!0,seeked:!0,seeking:!0,select:!0,selectionchange:!0,selectstart:!0,slotchange:!0,stalled:!0,submit:!0,suspend:!0,timeupdate:!0,toggle:!0,touchcancel:!0,touchend:!0,touchmove:!0,touchstart:!0,transitioncancel:!0,transitionend:!0,transitionrun:!0,transitionstart:!0,volumechange:!0,waiting:!0,webkitanimationend:!0,webkitanimationiteration:!0,webkitanimationstart:!0,webkittransitionend:!0,wheel:!0,beforematch:!0,pointerrawupdate:!0};class ed{constructor(t){H(this,"customData",{});H(this,"handleOptionsChange",t=>{t&&t.detail&&this.updateOptions(t.detail)});H(this,"handleStateChange",t=>{t&&t.detail&&this.updateState(t.detail)});if(!t||!t.name)throw new Error("Gesture must be initialized with a valid name.");if(t.name in I0)throw new Error(`Gesture can't be created with a native event name. Tried to use "${t.name}". Please use a custom name instead.`);this.name=t.name,this.preventDefault=t.preventDefault??!1,this.stopPropagation=t.stopPropagation??!1,this.preventIf=t.preventIf??[],this.requiredKeys=t.requiredKeys??[],this.pointerMode=t.pointerMode??[],this.pointerOptions=t.pointerOptions??{}}init(t,n,r,i){this.element=t,this.pointerManager=n,this.gesturesRegistry=r,this.keyboardManager=i;const o=`${this.name}ChangeOptions`;this.element.addEventListener(o,this.handleOptionsChange);const s=`${this.name}ChangeState`;this.element.addEventListener(s,this.handleStateChange)}updateOptions(t){this.preventDefault=t.preventDefault??this.preventDefault,this.stopPropagation=t.stopPropagation??this.stopPropagation,this.preventIf=t.preventIf??this.preventIf,this.requiredKeys=t.requiredKeys??this.requiredKeys,this.pointerMode=t.pointerMode??this.pointerMode,this.pointerOptions=t.pointerOptions??this.pointerOptions}getBaseConfig(){return{requiredKeys:this.requiredKeys}}getEffectiveConfig(t,n){if(t!=="mouse"&&t!=="touch"&&t!=="pen")return n;const r=this.pointerOptions[t];return r?G({},n,r):n}updateState(t){Object.assign(this.state,t)}getTargetElement(t){return this.isActive||this.element===t.target||"contains"in this.element&&this.element.contains(t.target)||"getRootNode"in this.element&&this.element.getRootNode()instanceof ShadowRoot&&t.composedPath().includes(this.element)?this.element:null}set isActive(t){t?this.gesturesRegistry.registerActiveGesture(this.element,this):this.gesturesRegistry.unregisterActiveGesture(this.element,this)}get isActive(){return this.gesturesRegistry.isGestureActive(this.element,this)??!1}shouldPreventGesture(t,n){const r=this.getEffectiveConfig(n,this.getBaseConfig());if(!this.keyboardManager.areKeysPressed(r.requiredKeys))return!0;if(this.preventIf.length===0)return!1;const i=this.gesturesRegistry.getActiveGestures(t);return this.preventIf.some(o=>i[o])}isPointerTypeAllowed(t){return!this.pointerMode||this.pointerMode.length===0?!0:this.pointerMode.includes(t)}destroy(){const t=`${this.name}ChangeOptions`;this.element.removeEventListener(t,this.handleOptionsChange);const n=`${this.name}ChangeState`;this.element.removeEventListener(n,this.handleStateChange)}}class j0{constructor(){H(this,"activeGestures",new Map)}registerActiveGesture(t,n){this.activeGestures.has(t)||this.activeGestures.set(t,new Set);const r=this.activeGestures.get(t),i={gesture:n,element:t};r.add(i)}unregisterActiveGesture(t,n){const r=this.activeGestures.get(t);r&&(r.forEach(i=>{i.gesture===n&&r.delete(i)}),r.size===0&&this.activeGestures.delete(t))}getActiveGestures(t){const n=this.activeGestures.get(t);return n?Array.from(n).reduce((r,i)=>(r[i.gesture.name]=!0,r),{}):{}}isGestureActive(t,n){const r=this.activeGestures.get(t);return r?Array.from(r).some(i=>i.gesture===n):!1}destroy(){this.activeGestures.clear()}unregisterElement(t){this.activeGestures.delete(t)}}class k0{constructor(){H(this,"pressedKeys",new Set);H(this,"handleKeyDown",t=>{this.pressedKeys.add(t.key)});H(this,"handleKeyUp",t=>{this.pressedKeys.delete(t.key)});H(this,"clearKeys",()=>{this.pressedKeys.clear()});this.initialize()}initialize(){typeof window>"u"||(window.addEventListener("keydown",this.handleKeyDown),window.addEventListener("keyup",this.handleKeyUp),window.addEventListener("blur",this.clearKeys))}areKeysPressed(t){return!t||t.length===0?!0:t.every(n=>n==="ControlOrMeta"?navigator.platform.includes("Mac")?this.pressedKeys.has("Meta"):this.pressedKeys.has("Control"):this.pressedKeys.has(n))}destroy(){typeof window<"u"&&(window.removeEventListener("keydown",this.handleKeyDown),window.removeEventListener("keyup",this.handleKeyUp),window.removeEventListener("blur",this.clearKeys)),this.clearKeys()}}class O0{constructor(t){H(this,"preventEventInterruption",!0);H(this,"pointers",new Map);H(this,"gestureHandlers",new Set);H(this,"handleInterruptEvents",t=>{if(this.preventEventInterruption&&"pointerType"in t&&t.pointerType==="touch"){t.preventDefault();return}const n=new PointerEvent("forceCancel",{bubbles:!1,cancelable:!1}),r=this.pointers.values().next().value;if(this.pointers.size>0&&r){Object.defineProperties(n,{clientX:{value:r.clientX},clientY:{value:r.clientY},pointerId:{value:r.pointerId},pointerType:{value:r.pointerType}});for(const[i,o]of this.pointers.entries()){const s=G({},o,{type:"forceCancel"});this.pointers.set(i,s)}}this.notifyHandlers(n),this.pointers.clear()});H(this,"handlePointerEvent",t=>{const{type:n,pointerId:r}=t;if(n==="pointerdown"||n==="pointermove")this.pointers.set(r,this.createPointerData(t));else if(n==="pointerup"||n==="pointercancel"||n==="forceCancel"){this.pointers.set(r,this.createPointerData(t)),this.notifyHandlers(t),this.pointers.delete(r);return}this.notifyHandlers(t)});this.root=t.root??document.getRootNode({composed:!0})??document.body,this.touchAction=t.touchAction||"auto",this.passive=t.passive??!1,this.preventEventInterruption=t.preventEventInterruption??!0,this.setupEventListeners()}registerGestureHandler(t){return this.gestureHandlers.add(t),()=>{this.gestureHandlers.delete(t)}}getPointers(){return new Map(this.pointers)}setupEventListeners(){this.touchAction!=="auto"&&(this.root.style.touchAction=this.touchAction),this.root.addEventListener("pointerdown",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("pointermove",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("pointerup",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("pointercancel",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("forceCancel",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("blur",this.handleInterruptEvents),this.root.addEventListener("contextmenu",this.handleInterruptEvents)}notifyHandlers(t){this.gestureHandlers.forEach(n=>n(this.pointers,t))}createPointerData(t){return{pointerId:t.pointerId,clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY,target:t.target,timeStamp:t.timeStamp,type:t.type,isPrimary:t.isPrimary,pressure:t.pressure,width:t.width,height:t.height,pointerType:t.pointerType,srcEvent:t}}destroy(){this.root.removeEventListener("pointerdown",this.handlePointerEvent),this.root.removeEventListener("pointermove",this.handlePointerEvent),this.root.removeEventListener("pointerup",this.handlePointerEvent),this.root.removeEventListener("pointercancel",this.handlePointerEvent),this.root.removeEventListener("forceCancel",this.handlePointerEvent),this.root.removeEventListener("blur",this.handleInterruptEvents),this.root.removeEventListener("contextmenu",this.handleInterruptEvents),this.pointers.clear(),this.gestureHandlers.clear()}}class P0{constructor(t){H(this,"gestureTemplates",new Map);H(this,"elementGestureMap",new Map);H(this,"activeGesturesRegistry",new j0);H(this,"keyboardManager",new k0);this.pointerManager=new O0({root:t.root,touchAction:t.touchAction,passive:t.passive}),t.gestures&&t.gestures.length>0&&t.gestures.forEach(n=>{this.addGestureTemplate(n)})}addGestureTemplate(t){this.gestureTemplates.has(t.name)&&console.warn(`Gesture template with name "${t.name}" already exists. It will be overwritten.`),this.gestureTemplates.set(t.name,t)}setGestureOptions(t,n,r){const i=this.elementGestureMap.get(n);if(!i||!i.has(t)){console.error(`Gesture "${t}" not found on the provided element.`);return}const o=new CustomEvent(`${t}ChangeOptions`,{detail:r,bubbles:!1,cancelable:!1,composed:!1});n.dispatchEvent(o)}setGestureState(t,n,r){const i=this.elementGestureMap.get(n);if(!i||!i.has(t)){console.error(`Gesture "${t}" not found on the provided element.`);return}const o=new CustomEvent(`${t}ChangeState`,{detail:r,bubbles:!1,cancelable:!1,composed:!1});n.dispatchEvent(o)}registerElement(t,n,r){return Array.isArray(t)||(t=[t]),t.forEach(i=>{const o=r==null?void 0:r[i];this.registerSingleGesture(i,n,o)}),n}registerSingleGesture(t,n,r){const i=this.gestureTemplates.get(t);if(!i)return console.error(`Gesture template "${t}" not found.`),!1;this.elementGestureMap.has(n)||this.elementGestureMap.set(n,new Map);const o=this.elementGestureMap.get(n);o.has(t)&&(console.warn(`Element already has gesture "${t}" registered. It will be replaced.`),this.unregisterElement(t,n));const s=i.clone(r);return s.init(n,this.pointerManager,this.activeGesturesRegistry,this.keyboardManager),o.set(t,s),!0}unregisterElement(t,n){const r=this.elementGestureMap.get(n);return!r||!r.has(t)?!1:(r.get(t).destroy(),r.delete(t),this.activeGesturesRegistry.unregisterElement(n),r.size===0&&this.elementGestureMap.delete(n),!0)}unregisterAllGestures(t){const n=this.elementGestureMap.get(t);if(n){for(const[,r]of n)r.destroy(),this.activeGesturesRegistry.unregisterElement(t);this.elementGestureMap.delete(t)}}destroy(){for(const[t]of this.elementGestureMap)this.unregisterAllGestures(t);this.gestureTemplates.clear(),this.elementGestureMap.clear(),this.activeGesturesRegistry.destroy(),this.keyboardManager.destroy(),this.pointerManager.destroy()}}class pn extends ed{constructor(n){super(n);H(this,"unregisterHandler",null);H(this,"originalTarget",null);this.minPointers=n.minPointers??1,this.maxPointers=n.maxPointers??1/0}init(n,r,i,o){super.init(n,r,i,o),this.unregisterHandler=this.pointerManager.registerGestureHandler(this.handlePointerEvent)}updateOptions(n){super.updateOptions(n),this.minPointers=n.minPointers??this.minPointers,this.maxPointers=n.maxPointers??this.maxPointers}getBaseConfig(){return{requiredKeys:this.requiredKeys,minPointers:this.minPointers,maxPointers:this.maxPointers}}isWithinPointerCount(n,r){const i=this.getEffectiveConfig(r,this.getBaseConfig());return n.length>=i.minPointers&&n.length<=i.maxPointers}getRelevantPointers(n,r){return n.filter(i=>this.isPointerTypeAllowed(i.pointerType)&&(r===i.target||i.target===this.originalTarget||r===this.originalTarget||"contains"in r&&r.contains(i.target))||"getRootNode"in r&&r.getRootNode()instanceof ShadowRoot&&i.srcEvent.composedPath().includes(r))}destroy(){this.unregisterHandler&&(this.unregisterHandler(),this.unregisterHandler=null),super.destroy()}}function D0(e,t){const n=t.x-e.x,r=t.y-e.y;return Math.sqrt(n*n+r*r)}function Wr(e){if(e.length<2)return 0;let t=0,n=0;for(let r=0;r<e.length;r+=1)for(let i=r+1;i<e.length;i+=1)t+=D0({x:e[r].clientX,y:e[r].clientY},{x:e[i].clientX,y:e[i].clientY}),n+=1;return n>0?t/n:0}function nt(e){if(e.length===0)return{x:0,y:0};const t=e.reduce((n,r)=>(n.x+=r.clientX,n.y+=r.clientY,n),{x:0,y:0});return{x:t.x/e.length,y:t.y/e.length}}function Xe(e,t){return`${e}${t==="ongoing"?"":t.charAt(0).toUpperCase()+t.slice(1)}`}const Hr=1e-5,$t=1e-5,Dl=.15;function $0(e,t){const n=t.x-e.x,r=t.y-e.y,i={vertical:null,horizontal:null,mainAxis:null},o=L0(t,e),s=Math.abs(n)>Math.abs(r)?"horizontal":"vertical",a=o||s==="horizontal"?Hr:Dl,l=o?Hr:s==="horizontal"?Dl:Hr;return Math.abs(n)>a&&(i.horizontal=n>0?"right":"left"),Math.abs(r)>l&&(i.vertical=r>0?"down":"up"),i.mainAxis=o?"diagonal":s,i}function L0(e,t){const n=t.x-e.x,r=t.y-e.y,i=Math.atan2(r,n)*180/Math.PI;return i>=-45+$t&&i<=-22.5+$t||i>=22.5+$t&&i<=45+$t||i>=135+$t&&i<=157.5+$t||i>=-157.5+$t&&i<=-135+$t}function N0(e,t){if(!e.vertical&&!e.horizontal)return!1;if(t.length===0)return!0;const n=e.vertical===null||t.includes(e.vertical),r=e.horizontal===null||t.includes(e.horizontal);return n&&r}const $l=0,z0=e=>e>$l?1:e<-$l?-1:0,Nt=e=>{e.cancelable&&e.preventDefault()};class ea extends pn{constructor(n){super(n);H(this,"state",{lastPosition:null});H(this,"handleElementEnter",n=>{if(n.pointerType!=="mouse"&&n.pointerType!=="pen")return;const r=this.pointerManager.getPointers()||new Map,i=Array.from(r.values());if(this.isWithinPointerCount(i,n.pointerType)){this.isActive=!0;const o={x:n.clientX,y:n.clientY};this.state.lastPosition=o,this.emitMoveEvent(this.element,"start",i,n),this.emitMoveEvent(this.element,"ongoing",i,n)}});H(this,"handleElementLeave",n=>{if(n.pointerType!=="mouse"&&n.pointerType!=="pen"||!this.isActive)return;const r=this.pointerManager.getPointers()||new Map,i=Array.from(r.values());this.emitMoveEvent(this.element,"end",i,n),this.resetState()});H(this,"handlePointerEvent",(n,r)=>{if(r.type!=="pointermove"||r.pointerType!=="mouse"&&r.pointerType!=="pen")return;this.preventDefault&&r.preventDefault(),this.stopPropagation&&r.stopPropagation();const i=Array.from(n.values()),o=this.getTargetElement(r);if(!o||!this.isWithinPointerCount(i,r.pointerType))return;if(this.shouldPreventGesture(o,r.pointerType)){if(!this.isActive)return;this.resetState(),this.emitMoveEvent(o,"end",i,r);return}const s={x:r.clientX,y:r.clientY};this.state.lastPosition=s,this.isActive||(this.isActive=!0,this.emitMoveEvent(o,"start",i,r)),this.emitMoveEvent(o,"ongoing",i,r)});this.threshold=n.threshold||0}clone(n){return new ea(G({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,threshold:this.threshold,minPointers:this.minPointers,maxPointers:this.maxPointers,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},n))}init(n,r,i,o){super.init(n,r,i,o),this.element.addEventListener("pointerenter",this.handleElementEnter),this.element.addEventListener("pointerleave",this.handleElementLeave)}destroy(){this.element.removeEventListener("pointerenter",this.handleElementEnter),this.element.removeEventListener("pointerleave",this.handleElementLeave),this.resetState(),super.destroy()}updateOptions(n){super.updateOptions(n)}resetState(){this.isActive=!1,this.state={lastPosition:null}}emitMoveEvent(n,r,i,o){const s=this.state.lastPosition||nt(i),a=this.gesturesRegistry.getActiveGestures(n),l={gestureName:this.name,centroid:s,target:o.target,srcEvent:o,phase:r,pointers:i,timeStamp:o.timeStamp,activeGestures:a,customData:this.customData},c=Xe(this.name,r),u=new CustomEvent(c,{bubbles:!0,cancelable:!0,composed:!0,detail:l});n.dispatchEvent(u)}}class sn extends pn{constructor(n){super(n);H(this,"state",{startPointers:new Map,startCentroid:null,lastCentroid:null,movementThresholdReached:!1,totalDeltaX:0,totalDeltaY:0,activeDeltaX:0,activeDeltaY:0,lastDirection:{vertical:null,horizontal:null,mainAxis:null},lastDeltas:null});H(this,"handlePointerEvent",(n,r)=>{var a;const i=Array.from(n.values());if(r.type==="forceCancel"){this.cancel(r.target,i,r);return}const o=this.getTargetElement(r);if(!o)return;if(this.shouldPreventGesture(o,r.pointerType)){this.cancel(o,i,r);return}const s=this.getRelevantPointers(i,o);if(!this.isWithinPointerCount(s,r.pointerType)){this.cancel(o,s,r);return}switch(r.type){case"pointerdown":if(!this.isActive&&!this.state.startCentroid)s.forEach(l=>{this.state.startPointers.set(l.pointerId,l)}),this.originalTarget=o,this.state.startCentroid=nt(s),this.state.lastCentroid=G({},this.state.startCentroid);else if(this.state.startCentroid&&this.state.lastCentroid){const l=this.state.lastCentroid,c=nt(s),u=c.x-l.x,d=c.y-l.y;this.state.startCentroid={x:this.state.startCentroid.x+u,y:this.state.startCentroid.y+d},this.state.lastCentroid=c,s.forEach(h=>{this.state.startPointers.has(h.pointerId)||this.state.startPointers.set(h.pointerId,h)})}break;case"pointermove":if(this.state.startCentroid&&this.isWithinPointerCount(i,r.pointerType)){const l=nt(s),c=l.x-this.state.startCentroid.x,u=l.y-this.state.startCentroid.y,d=Math.sqrt(c*c+u*u),h=$0(this.state.lastCentroid??this.state.startCentroid,l),f=this.state.lastCentroid?l.x-this.state.lastCentroid.x:0,m=this.state.lastCentroid?l.y-this.state.lastCentroid.y:0;!this.state.movementThresholdReached&&d>=this.threshold&&N0(h,this.direction)?(this.state.movementThresholdReached=!0,this.isActive=!0,this.state.lastDeltas={x:f,y:m},this.state.totalDeltaX+=f,this.state.totalDeltaY+=m,this.state.activeDeltaX+=f,this.state.activeDeltaY+=m,this.emitPanEvent(o,"start",s,r,l),this.emitPanEvent(o,"ongoing",s,r,l)):this.state.movementThresholdReached&&this.isActive&&(this.state.lastDeltas={x:f,y:m},this.state.totalDeltaX+=f,this.state.totalDeltaY+=m,this.state.activeDeltaX+=f,this.state.activeDeltaY+=m,this.emitPanEvent(o,"ongoing",s,r,l)),this.state.lastCentroid=l,this.state.lastDirection=h}break;case"pointerup":case"pointercancel":case"forceCancel":if(this.isActive&&this.state.movementThresholdReached){const l=s.filter(c=>c.type!=="pointerup"&&c.type!=="pointercancel");if(this.isWithinPointerCount(l,r.pointerType)){if(l.length>=1&&this.state.lastCentroid){const c=nt(l),u=c.x-this.state.lastCentroid.x,d=c.y-this.state.lastCentroid.y;this.state.startCentroid={x:this.state.startCentroid.x+u,y:this.state.startCentroid.y+d},this.state.lastCentroid=c;const h=(a=s.find(f=>f.type==="pointerup"||f.type==="pointercancel"))==null?void 0:a.pointerId;h!==void 0&&this.state.startPointers.delete(h)}}else{const c=this.state.lastCentroid||this.state.startCentroid;r.type==="pointercancel"&&this.emitPanEvent(o,"cancel",s,r,c),this.emitPanEvent(o,"end",s,r,c),this.resetState()}}else this.resetState();break}});this.direction=n.direction||["up","down","left","right"],this.threshold=n.threshold||0}clone(n){return new sn(G({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,threshold:this.threshold,minPointers:this.minPointers,maxPointers:this.maxPointers,direction:[...this.direction],requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},n))}destroy(){this.resetState(),super.destroy()}updateOptions(n){super.updateOptions(n),this.direction=n.direction||this.direction,this.threshold=n.threshold??this.threshold}resetState(){this.isActive=!1,this.state=G({},this.state,{startPointers:new Map,startCentroid:null,lastCentroid:null,lastDeltas:null,activeDeltaX:0,activeDeltaY:0,movementThresholdReached:!1,lastDirection:{vertical:null,horizontal:null,mainAxis:null}})}emitPanEvent(n,r,i,o,s){var T,w;if(!this.state.startCentroid)return;const a=((T=this.state.lastDeltas)==null?void 0:T.x)??0,l=((w=this.state.lastDeltas)==null?void 0:w.y)??0,c=this.state.startPointers.values().next().value,u=c?(o.timeStamp-c.timeStamp)/1e3:0,d=u>0?a/u:0,h=u>0?l/u:0,f=Math.sqrt(d*d+h*h),m=this.gesturesRegistry.getActiveGestures(n),p={gestureName:this.name,initialCentroid:this.state.startCentroid,centroid:s,target:o.target,srcEvent:o,phase:r,pointers:i,timeStamp:o.timeStamp,deltaX:a,deltaY:l,direction:this.state.lastDirection,velocityX:d,velocityY:h,velocity:f,totalDeltaX:this.state.totalDeltaX,totalDeltaY:this.state.totalDeltaY,activeDeltaX:this.state.activeDeltaX,activeDeltaY:this.state.activeDeltaY,activeGestures:m,customData:this.customData},y=Xe(this.name,r),v=new CustomEvent(y,{bubbles:!0,cancelable:!0,composed:!0,detail:p});n.dispatchEvent(v),this.preventDefault&&o.preventDefault(),this.stopPropagation&&o.stopPropagation()}cancel(n,r,i){if(this.isActive){const o=n??this.element;this.emitPanEvent(o,"cancel",r,i,this.state.lastCentroid),this.emitPanEvent(o,"end",r,i,this.state.lastCentroid)}this.resetState()}}class ta extends pn{constructor(n){super(G({},n,{minPointers:n.minPointers??2}));H(this,"state",{startDistance:0,lastDistance:0,lastScale:1,lastTime:0,velocity:0,totalScale:1,deltaScale:0});H(this,"handlePointerEvent",(n,r)=>{const i=Array.from(n.values()),o=this.getTargetElement(r);if(!o)return;if(this.shouldPreventGesture(o,r.pointerType)){this.isActive&&(this.emitPinchEvent(o,"cancel",i,r),this.resetState());return}const s=this.getRelevantPointers(i,o);switch(r.type){case"pointerdown":if(s.length>=2&&!this.isActive){const a=Wr(s);this.state.startDistance=a,this.state.lastDistance=a,this.state.lastTime=r.timeStamp,this.originalTarget=o}else if(this.isActive&&s.length>=2){const a=Wr(s);this.state.startDistance=a/this.state.lastScale,this.state.lastDistance=a,this.state.lastTime=r.timeStamp}break;case"pointermove":if(this.state.startDistance&&this.isWithinPointerCount(s,r.pointerType)){const a=Wr(s),l=Math.abs(a-this.state.lastDistance);if(l!==0&&l>=this.threshold){const c=this.state.startDistance?a/this.state.startDistance:1,u=c/this.state.lastScale;this.state.totalScale*=u;const d=(r.timeStamp-this.state.lastTime)/1e3;if(this.state.lastDistance){const f=(a-this.state.lastDistance)/d;this.state.velocity=Number.isNaN(f)?0:f}this.state.lastDistance=a,this.state.deltaScale=c-this.state.lastScale,this.state.lastScale=c,this.state.lastTime=r.timeStamp,this.isActive?this.emitPinchEvent(o,"ongoing",s,r):(this.isActive=!0,this.emitPinchEvent(o,"start",s,r),this.emitPinchEvent(o,"ongoing",s,r))}}break;case"pointerup":case"pointercancel":case"forceCancel":if(this.isActive){const a=s.filter(l=>l.type!=="pointerup"&&l.type!=="pointercancel");if(!this.isWithinPointerCount(a,r.pointerType))r.type==="pointercancel"&&this.emitPinchEvent(o,"cancel",s,r),this.emitPinchEvent(o,"end",s,r),this.resetState();else if(a.length>=2){const l=Wr(a);this.state.startDistance=l/this.state.lastScale,this.state.lastDistance=l,this.state.lastTime=r.timeStamp}}break}});this.threshold=n.threshold??0}clone(n){return new ta(G({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,threshold:this.threshold,minPointers:this.minPointers,maxPointers:this.maxPointers,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},n))}destroy(){this.resetState(),super.destroy()}updateOptions(n){super.updateOptions(n)}resetState(){this.isActive=!1,this.state=G({},this.state,{startDistance:0,lastDistance:0,lastScale:1,lastTime:0,velocity:0,deltaScale:0})}emitPinchEvent(n,r,i,o){const s=nt(i),a=this.state.lastDistance,l=this.state.lastScale,c=this.gesturesRegistry.getActiveGestures(n),u={gestureName:this.name,centroid:s,target:o.target,srcEvent:o,phase:r,pointers:i,timeStamp:o.timeStamp,scale:l,deltaScale:this.state.deltaScale,totalScale:this.state.totalScale,distance:a,velocity:this.state.velocity,activeGestures:c,direction:z0(this.state.velocity),customData:this.customData};this.preventDefault&&o.preventDefault(),this.stopPropagation&&o.stopPropagation();const d=Xe(this.name,r),h=new CustomEvent(d,{bubbles:!0,cancelable:!0,composed:!0,detail:u});n.dispatchEvent(h)}}class ao extends pn{constructor(n){super(n);H(this,"state",{startCentroid:null,lastPosition:null,timerId:null,startTime:0,pressThresholdReached:!1});H(this,"handlePointerEvent",(n,r)=>{const i=Array.from(n.values());if(r.type==="forceCancel"){this.cancelPress(r.target,i,r);return}const o=this.getTargetElement(r);if(!o)return;if(this.shouldPreventGesture(o,r.pointerType)){this.isActive&&this.cancelPress(o,i,r);return}const s=this.getRelevantPointers(i,o);if(!this.isWithinPointerCount(s,r.pointerType)){this.isActive&&this.cancelPress(o,s,r);return}switch(r.type){case"pointerdown":!this.isActive&&!this.state.startCentroid&&(this.state.startCentroid=nt(s),this.state.lastPosition=G({},this.state.startCentroid),this.state.startTime=r.timeStamp,this.isActive=!0,this.originalTarget=o,this.clearPressTimer(),this.state.timerId=setTimeout(()=>{if(this.isActive&&this.state.startCentroid){this.state.pressThresholdReached=!0;const a=this.state.lastPosition;this.emitPressEvent(o,"start",s,r,a),this.emitPressEvent(o,"ongoing",s,r,a)}},this.duration));break;case"pointermove":if(this.isActive&&this.state.startCentroid){const a=nt(s);this.state.lastPosition=a;const l=a.x-this.state.startCentroid.x,c=a.y-this.state.startCentroid.y;Math.sqrt(l*l+c*c)>this.maxDistance&&this.cancelPress(o,s,r)}break;case"pointerup":if(this.isActive){if(this.state.pressThresholdReached){const a=this.state.lastPosition||this.state.startCentroid;this.emitPressEvent(o,"end",s,r,a)}this.resetState()}break;case"pointercancel":case"forceCancel":this.cancelPress(o,s,r);break}});this.duration=n.duration??500,this.maxDistance=n.maxDistance??10}clone(n){return new ao(G({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,duration:this.duration,maxDistance:this.maxDistance,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},n))}destroy(){this.clearPressTimer(),this.resetState(),super.destroy()}updateOptions(n){super.updateOptions(n),this.duration=n.duration??this.duration,this.maxDistance=n.maxDistance??this.maxDistance}resetState(){this.clearPressTimer(),this.isActive=!1,this.state=G({},this.state,{startCentroid:null,lastPosition:null,timerId:null,startTime:0,pressThresholdReached:!1})}clearPressTimer(){this.state.timerId!==null&&(clearTimeout(this.state.timerId),this.state.timerId=null)}emitPressEvent(n,r,i,o,s){const a=this.gesturesRegistry.getActiveGestures(n),l=o.timeStamp-this.state.startTime,c={gestureName:this.name,centroid:s,target:o.target,srcEvent:o,phase:r,pointers:i,timeStamp:o.timeStamp,x:s.x,y:s.y,duration:l,activeGestures:a,customData:this.customData},u=Xe(this.name,r),d=new CustomEvent(u,{bubbles:!0,cancelable:!0,composed:!0,detail:c});n.dispatchEvent(d),this.preventDefault&&o.preventDefault(),this.stopPropagation&&o.stopPropagation()}cancelPress(n,r,i){if(this.isActive&&this.state.pressThresholdReached){const o=this.state.lastPosition||this.state.startCentroid;this.emitPressEvent(n??this.element,"cancel",r,i,o),this.emitPressEvent(n??this.element,"end",r,i,o)}this.resetState()}}class na extends pn{constructor(n){super(n);H(this,"state",{phase:"waitingForPress",dragTimeoutId:null});H(this,"pressHandler",()=>{this.state.phase==="waitingForPress"&&(this.state.phase="pressDetected",this.setTouchAction(),this.state.dragTimeoutId=setTimeout(()=>{this.resetState()},this.dragTimeout))});H(this,"dragStartHandler",n=>{this.state.phase==="pressDetected"&&(this.state.dragTimeoutId!==null&&(clearTimeout(this.state.dragTimeoutId),this.state.dragTimeoutId=null),this.restoreTouchAction(),this.state.phase="dragging",this.isActive=!0,this.element.dispatchEvent(new CustomEvent(Xe(this.name,n.detail.phase),n)))});H(this,"dragMoveHandler",n=>{this.state.phase==="dragging"&&this.element.dispatchEvent(new CustomEvent(Xe(this.name,n.detail.phase),n))});H(this,"dragEndHandler",n=>{this.state.phase==="dragging"&&(this.resetState(),this.element.dispatchEvent(new CustomEvent(Xe(this.name,n.detail.phase),n)))});this.pressDuration=n.pressDuration??500,this.pressMaxDistance=n.pressMaxDistance??10,this.dragTimeout=n.dragTimeout??1e3,this.dragThreshold=n.dragThreshold??0,this.dragDirection=n.dragDirection||["up","down","left","right"],this.pressGesture=new ao({name:`${this.name}-press`,duration:this.pressDuration,maxDistance:this.pressMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}),this.panGesture=new sn({name:`${this.name}-pan`,minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)})}clone(n){return new na(G({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,pressDuration:this.pressDuration,pressMaxDistance:this.pressMaxDistance,dragTimeout:this.dragTimeout,dragThreshold:this.dragThreshold,dragDirection:[...this.dragDirection],requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},n))}init(n,r,i,o){super.init(n,r,i,o),this.pressGesture.init(n,r,i,o),this.panGesture.init(n,r,i,o),this.element.addEventListener(this.pressGesture.name,this.pressHandler),this.element.addEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.addEventListener(this.panGesture.name,this.dragMoveHandler),this.element.addEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.addEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler)}destroy(){this.resetState(),this.pressGesture.destroy(),this.panGesture.destroy(),this.element.removeEventListener(this.pressGesture.name,this.pressHandler),this.element.removeEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.removeEventListener(this.panGesture.name,this.dragMoveHandler),this.element.removeEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.removeEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler),super.destroy()}updateOptions(n){super.updateOptions(n),this.pressDuration=n.pressDuration??this.pressDuration,this.pressMaxDistance=n.pressMaxDistance??this.pressMaxDistance,this.dragTimeout=n.dragTimeout??this.dragTimeout,this.dragThreshold=n.dragThreshold??this.dragThreshold,this.dragDirection=n.dragDirection||this.dragDirection,this.element.dispatchEvent(new CustomEvent(`${this.panGesture.name}ChangeOptions`,{detail:{minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}})),this.element.dispatchEvent(new CustomEvent(`${this.pressGesture.name}ChangeOptions`,{detail:{duration:this.pressDuration,maxDistance:this.pressMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}}))}resetState(){this.state.dragTimeoutId!==null&&clearTimeout(this.state.dragTimeoutId),this.restoreTouchAction(),this.isActive=!1,this.state={phase:"waitingForPress",dragTimeoutId:null}}handlePointerEvent(){}setTouchAction(){this.element.addEventListener("touchstart",Nt,{passive:!1}),this.element.addEventListener("touchmove",Nt,{passive:!1}),this.element.addEventListener("touchend",Nt,{passive:!1})}restoreTouchAction(){this.element.removeEventListener("touchstart",Nt),this.element.removeEventListener("touchmove",Nt),this.element.removeEventListener("touchend",Nt)}}class fr extends pn{constructor(n){super(n);H(this,"state",{startCentroid:null,currentTapCount:0,lastTapTime:0,lastPosition:null});H(this,"handlePointerEvent",(n,r)=>{const i=Array.from(n.values()),o=this.getTargetElement(r);if(!o)return;const s=this.getRelevantPointers(i,o);if(this.shouldPreventGesture(o,r.pointerType)||!this.isWithinPointerCount(s,r.pointerType)){this.isActive&&this.cancelTap(o,s,r);return}switch(r.type){case"pointerdown":this.isActive||(this.state.startCentroid=nt(s),this.state.lastPosition=G({},this.state.startCentroid),this.isActive=!0,this.originalTarget=o);break;case"pointermove":if(this.isActive&&this.state.startCentroid){const a=nt(s);this.state.lastPosition=a;const l=a.x-this.state.startCentroid.x,c=a.y-this.state.startCentroid.y;Math.sqrt(l*l+c*c)>this.maxDistance&&this.cancelTap(o,s,r)}break;case"pointerup":if(this.isActive){this.state.currentTapCount+=1;const a=this.state.lastPosition||this.state.startCentroid;if(!a){this.cancelTap(o,s,r);return}this.state.currentTapCount>=this.taps?(this.fireTapEvent(o,s,r,a),this.resetState()):(this.state.lastTapTime=r.timeStamp,this.isActive=!1,this.state.startCentroid=null,setTimeout(()=>{this.state&&this.state.currentTapCount>0&&this.state.currentTapCount<this.taps&&(this.state.currentTapCount=0)},300))}break;case"pointercancel":case"forceCancel":this.cancelTap(o,s,r);break}});this.maxDistance=n.maxDistance??10,this.taps=n.taps??1}clone(n){return new fr(G({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,maxDistance:this.maxDistance,taps:this.taps,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},n))}destroy(){this.resetState(),super.destroy()}updateOptions(n){super.updateOptions(n),this.maxDistance=n.maxDistance??this.maxDistance,this.taps=n.taps??this.taps}resetState(){this.isActive=!1,this.state={startCentroid:null,currentTapCount:0,lastTapTime:0,lastPosition:null}}fireTapEvent(n,r,i,o){const s=this.gesturesRegistry.getActiveGestures(n),a={gestureName:this.name,centroid:o,target:i.target,srcEvent:i,phase:"end",pointers:r,timeStamp:i.timeStamp,x:o.x,y:o.y,tapCount:this.state.currentTapCount,activeGestures:s,customData:this.customData},l=new CustomEvent(this.name,{bubbles:!0,cancelable:!0,composed:!0,detail:a});n.dispatchEvent(l),this.preventDefault&&i.preventDefault(),this.stopPropagation&&i.stopPropagation()}cancelTap(n,r,i){if(this.state.startCentroid||this.state.lastPosition){const o=this.state.lastPosition||this.state.startCentroid,s=this.gesturesRegistry.getActiveGestures(n),a={gestureName:this.name,centroid:o,target:i.target,srcEvent:i,phase:"cancel",pointers:r,timeStamp:i.timeStamp,x:o.x,y:o.y,tapCount:this.state.currentTapCount,activeGestures:s,customData:this.customData},l=Xe(this.name,"cancel"),c=new CustomEvent(l,{bubbles:!0,cancelable:!0,composed:!0,detail:a});n.dispatchEvent(c)}this.resetState()}}class ra extends pn{constructor(n){super(n);H(this,"state",{phase:"waitingForTap",dragTimeoutId:null});H(this,"tapHandler",()=>{this.state.phase==="waitingForTap"&&(this.state.phase="tapDetected",this.setTouchAction(),this.state.dragTimeoutId=setTimeout(()=>{this.resetState()},this.dragTimeout))});H(this,"dragStartHandler",n=>{this.state.phase==="tapDetected"&&(this.state.dragTimeoutId!==null&&(clearTimeout(this.state.dragTimeoutId),this.state.dragTimeoutId=null),this.restoreTouchAction(),this.state.phase="dragging",this.isActive=!0,this.element.dispatchEvent(new CustomEvent(Xe(this.name,n.detail.phase),n)))});H(this,"dragMoveHandler",n=>{this.state.phase==="dragging"&&this.element.dispatchEvent(new CustomEvent(Xe(this.name,n.detail.phase),n))});H(this,"dragEndHandler",n=>{this.state.phase==="dragging"&&(this.resetState(),this.element.dispatchEvent(new CustomEvent(Xe(this.name,n.detail.phase),n)))});this.tapMaxDistance=n.tapMaxDistance??10,this.dragTimeout=n.dragTimeout??1e3,this.dragThreshold=n.dragThreshold??0,this.dragDirection=n.dragDirection||["up","down","left","right"],this.tapGesture=new fr({name:`${this.name}-tap`,maxDistance:this.tapMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}),this.panGesture=new sn({name:`${this.name}-pan`,minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)})}clone(n){return new ra(G({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,tapMaxDistance:this.tapMaxDistance,dragTimeout:this.dragTimeout,dragThreshold:this.dragThreshold,dragDirection:[...this.dragDirection],requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},n))}init(n,r,i,o){super.init(n,r,i,o),this.tapGesture.init(n,r,i,o),this.panGesture.init(n,r,i,o),this.element.addEventListener(this.tapGesture.name,this.tapHandler),this.element.addEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.addEventListener(this.panGesture.name,this.dragMoveHandler),this.element.addEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.addEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler)}destroy(){this.resetState(),this.tapGesture.destroy(),this.panGesture.destroy(),this.element.removeEventListener(this.tapGesture.name,this.tapHandler),this.element.removeEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.removeEventListener(this.panGesture.name,this.dragMoveHandler),this.element.removeEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.removeEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler),super.destroy()}updateOptions(n){super.updateOptions(n),this.tapMaxDistance=n.tapMaxDistance??this.tapMaxDistance,this.dragTimeout=n.dragTimeout??this.dragTimeout,this.dragThreshold=n.dragThreshold??this.dragThreshold,this.dragDirection=n.dragDirection||this.dragDirection,this.element.dispatchEvent(new CustomEvent(`${this.panGesture.name}ChangeOptions`,{detail:{minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}})),this.element.dispatchEvent(new CustomEvent(`${this.tapGesture.name}ChangeOptions`,{detail:{maxDistance:this.tapMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}}))}resetState(){this.state.dragTimeoutId!==null&&clearTimeout(this.state.dragTimeoutId),this.restoreTouchAction(),this.isActive=!1,this.state={phase:"waitingForTap",dragTimeoutId:null}}handlePointerEvent(){}setTouchAction(){this.element.addEventListener("touchstart",Nt,{passive:!1})}restoreTouchAction(){this.element.removeEventListener("touchstart",Nt)}}class bi extends ed{constructor(n){super(n);H(this,"state",{totalDeltaX:0,totalDeltaY:0,totalDeltaZ:0});H(this,"handleWheelEvent",n=>{if(this.shouldPreventGesture(this.element,"mouse"))return;const r=this.pointerManager.getPointers()||new Map,i=Array.from(r.values());this.state.totalDeltaX+=n.deltaX*this.sensitivity*(this.invert?-1:1),this.state.totalDeltaY+=n.deltaY*this.sensitivity*(this.invert?-1:1),this.state.totalDeltaZ+=n.deltaZ*this.sensitivity*(this.invert?-1:1),["totalDeltaX","totalDeltaY","totalDeltaZ"].forEach(o=>{this.state[o]<this.min&&(this.state[o]=this.min),this.state[o]>this.max&&(this.state[o]=this.max)}),this.emitWheelEvent(i,n)});this.sensitivity=n.sensitivity??1,this.max=n.max??Number.MAX_SAFE_INTEGER,this.min=n.min??Number.MIN_SAFE_INTEGER,this.initialDelta=n.initialDelta??0,this.invert=n.invert??!1,this.state.totalDeltaX=this.initialDelta,this.state.totalDeltaY=this.initialDelta,this.state.totalDeltaZ=this.initialDelta}clone(n){return new bi(G({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,sensitivity:this.sensitivity,max:this.max,min:this.min,initialDelta:this.initialDelta,invert:this.invert,requiredKeys:[...this.requiredKeys],preventIf:[...this.preventIf]},n))}init(n,r,i,o){super.init(n,r,i,o),this.element.addEventListener("wheel",this.handleWheelEvent)}destroy(){this.element.removeEventListener("wheel",this.handleWheelEvent),this.resetState(),super.destroy()}resetState(){this.isActive=!1,this.state={totalDeltaX:0,totalDeltaY:0,totalDeltaZ:0}}updateOptions(n){super.updateOptions(n),this.sensitivity=n.sensitivity??this.sensitivity,this.max=n.max??this.max,this.min=n.min??this.min,this.initialDelta=n.initialDelta??this.initialDelta,this.invert=n.invert??this.invert}emitWheelEvent(n,r){const i=n.length>0?nt(n):{x:r.clientX,y:r.clientY},o=this.gesturesRegistry.getActiveGestures(this.element),s={gestureName:this.name,centroid:i,target:r.target,srcEvent:r,phase:"ongoing",pointers:n,timeStamp:r.timeStamp,deltaX:r.deltaX*this.sensitivity*(this.invert?-1:1),deltaY:r.deltaY*this.sensitivity*(this.invert?-1:1),deltaZ:r.deltaZ*this.sensitivity*(this.invert?-1:1),deltaMode:r.deltaMode,totalDeltaX:this.state.totalDeltaX,totalDeltaY:this.state.totalDeltaY,totalDeltaZ:this.state.totalDeltaZ,activeGestures:o,customData:this.customData};this.preventDefault&&r.preventDefault(),this.stopPropagation&&r.stopPropagation();const a=Xe(this.name,"ongoing"),l=new CustomEvent(a,{bubbles:!0,cancelable:!0,composed:!0,detail:s});this.element.dispatchEvent(l)}}const Rn=e=>e.preventDefault(),ia=({svgRef:e})=>{const t=j.useRef(null);j.useEffect(()=>{const i=e.current;t.current||(t.current=new P0({gestures:[new sn({name:"pan",threshold:0,maxPointers:1}),new ea({name:"move",preventIf:["pan","zoomPinch","zoomPan"]}),new fr({name:"tap",preventIf:["pan","zoomPinch","zoomPan"]}),new ao({name:"quickPress",duration:50}),new sn({name:"brush",threshold:0,maxPointers:1}),new sn({name:"zoomPan",threshold:0,preventIf:["zoomTapAndDrag","zoomPressAndDrag"]}),new ta({name:"zoomPinch",threshold:5}),new bi({name:"zoomTurnWheel",sensitivity:.01,initialDelta:1}),new bi({name:"panTurnWheel",sensitivity:.5}),new ra({name:"zoomTapAndDrag",dragThreshold:10}),new na({name:"zoomPressAndDrag",dragThreshold:10,preventIf:["zoomPinch"]}),new fr({name:"zoomDoubleTapReset",taps:2})]}));const o=t.current;if(!(!i||!o))return o.registerElement(["pan","move","zoomPinch","zoomPan","zoomTurnWheel","panTurnWheel","tap","quickPress","zoomTapAndDrag","zoomPressAndDrag","zoomDoubleTapReset","brush"],i),()=>{o.unregisterAllGestures(i)}},[e,t]);const n=j.useCallback((i,o,s)=>{const a=e.current;return a==null||a.addEventListener(i,o,s),{cleanup:()=>a==null?void 0:a.removeEventListener(i,o)}},[e]),r=j.useCallback((i,o)=>{const s=e.current,a=t.current;!a||!s||a.setGestureOptions(i,s,o??{})},[e,t]);return j.useEffect(()=>{const i=e.current;return i==null||i.addEventListener("gesturestart",Rn),i==null||i.addEventListener("gesturechange",Rn),i==null||i.addEventListener("gestureend",Rn),()=>{i==null||i.removeEventListener("gesturestart",Rn),i==null||i.removeEventListener("gesturechange",Rn),i==null||i.removeEventListener("gestureend",Rn)}},[e]),{instance:{addInteractionListener:n,updateZoomInteractionListeners:r}}};ia.params={};ia.getInitialState=()=>({});const F0=[Zs,Xs,io,so,ia,ro],B0=["apiRef"],G0=e=>{let{plugins:t}=e,n=ft(e.props,B0);const r={};t.forEach(s=>{Object.assign(r,s.params)});const i={};return Object.keys(n).forEach(s=>{const a=n[s];r[s]&&(i[s]=a)}),t.reduce((s,a)=>a.getDefaultizedParams?a.getDefaultizedParams({params:s}):s,i)};let Ll=0;function V0(e,t,n){const r=bm(),i=j.useMemo(()=>[...F0,...e],[e]),o=G0({plugins:i,props:t});o.id=o.id??r;const a=j.useRef({}).current,l=W0(t.apiRef),c=j.useRef(null),u=j.useRef(null),d=j.useRef(null);if(d.current==null){Ll+=1;const m={cacheKey:{id:Ll}};i.forEach(p=>{p.getInitialState&&Object.assign(m,p.getInitialState(o,m,n))}),d.current=new Ks(m)}const h=m=>{const p=m({instance:a,params:o,plugins:i,store:d.current,svgRef:u,chartRootRef:c,seriesConfig:n});p.publicAPI&&Object.assign(l.current,p.publicAPI),p.instance&&Object.assign(a,p.instance)};return i.forEach(h),{contextValue:j.useMemo(()=>({store:d.current,publicAPI:l.current,instance:a,svgRef:u,chartRootRef:c}),[a,l])}}function U0(e){return e.current==null&&(e.current={}),e}function W0(e){const t=j.useRef({});return e?U0(e):t}const oa=j.createContext(null);process.env.NODE_ENV!=="production"&&(oa.displayName="ChartContext");const Nl=new Set;function Fn(e,t="warning"){if(process.env.NODE_ENV==="production")return;const n=Array.isArray(e)?e.join(`
|
|
112
|
+
`):e;Nl.has(n)||(Nl.add(n),t==="error"?console.error(n):console.warn(n))}function H0(e){const{componentName:t,propName:n,controlled:r,defaultValue:i,warningPrefix:o="MUI X"}=e,[{initialDefaultValue:s,isControlled:a}]=j.useState({initialDefaultValue:i,isControlled:r!==void 0});a!==(r!==void 0)&&Fn([`${o}: A component is changing the ${a?"":"un"}controlled ${n} state of ${t} to be ${a?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"],"error"),JSON.stringify(s)!==JSON.stringify(i)&&Fn([`${o}: A component is changing the default ${n} state of an uncontrolled ${t} after being initialized. To suppress this warning opt to use a controlled ${t}.`],"error")}const td=process.env.NODE_ENV==="production"?()=>{}:H0,nd=4,rd=20+2*nd,Y0=40+2*nd,q0="hover",Yr={minStart:0,maxEnd:100,step:5,minSpan:10,maxSpan:100,panning:!0,filterMode:"keep",reverse:!1,slider:{enabled:!1,preview:!1,size:rd,showTooltip:q0}},sa=(e,t,n,r)=>{var i;if(e)return e===!0?G({axisId:t,axisDirection:n},Yr,{reverse:r??!1}):G({axisId:t,axisDirection:n},Yr,{reverse:r??!1},e,{slider:G({},Yr.slider,{size:((i=e.slider)==null?void 0:i.preview)??Yr.slider.preview?Y0:rd},e.slider)})};function id(e,t){const n={top:0,bottom:0,none:0};return(e&&e.length>0?e:[{id:n0,scaleType:"linear"}]).map((o,s)=>{var f;const a=o.dataKey,l=s===0?"bottom":"none",c=o.position??l,u=s0+(o.label?Ku:0),d=o.id??`defaultized-x-axis-${s}`,h=G({offset:n[c]},o,{id:d,position:c,height:o.height??u,zoom:sa(o.zoom,d,"x",o.reverse)});if(c!=="none"&&(n[c]+=h.height,(f=h.zoom)!=null&&f.slider.enabled&&(n[c]+=h.zoom.slider.size)),a===void 0||o.data!==void 0)return h;if(t===void 0)throw new Error("MUI X Charts: x-axis uses `dataKey` but no `dataset` is provided.");return G({},h,{data:t.map(m=>m[a])})})}function od(e,t){const n={right:0,left:0,none:0};return(e&&e.length>0?e:[{id:r0,scaleType:"linear"}]).map((o,s)=>{var f;const a=o.dataKey,l=s===0?"left":"none",c=o.position??l,u=o0+(o.label?Ku:0),d=o.id??`defaultized-y-axis-${s}`,h=G({offset:n[c]},o,{id:d,position:c,width:o.width??u,zoom:sa(o.zoom,d,"y",o.reverse)});if(c!=="none"&&(n[c]+=h.width,(f=h.zoom)!=null&&f.slider.enabled&&(n[c]+=h.zoom.slider.size)),a===void 0||o.data!==void 0)return h;if(t===void 0)throw new Error("MUI X Charts: y-axis uses `dataKey` but no `dataset` is provided.");return G({},h,{data:t.map(m=>m[a])})})}function J0(e,t){return function(r,i){if(i.location==="tick"){const o=i.scale.domain();return o[0]===o[1]?i.scale.tickFormat(1)(r):i.scale.tickFormat(e)(r)}return i.location==="zoom-slider-tooltip"?t.tickFormat(2)(r):`${r}`}}function qn(e){return e.scaleType==="band"}function Jn(e){return e.scaleType==="point"}function K0(e){return e.scaleType==="symlog"}function di(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function X0(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function aa(e){let t,n,r;e.length!==2?(t=di,n=(a,l)=>di(e(a),l),r=(a,l)=>e(a)-l):(t=e===di||e===X0?e:Z0,n=e,r=e);function i(a,l,c=0,u=a.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(a[d],l)<0?c=d+1:u=d}while(c<u)}return c}function o(a,l,c=0,u=a.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(a[d],l)<=0?c=d+1:u=d}while(c<u)}return c}function s(a,l,c=0,u=a.length){const d=i(a,l,c,u-1);return d>c&&r(a[d-1],l)>-r(a[d],l)?d-1:d}return{left:i,center:s,right:o}}function Z0(){return 0}function Q0(e){return e===null?NaN:+e}const ey=aa(di),sd=ey.right;aa(Q0).center;class vi extends Map{constructor(t,n=ry){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(zl(this,t))}has(t){return super.has(zl(this,t))}set(t,n){return super.set(ty(this,t),n)}delete(t){return super.delete(ny(this,t))}}function zl({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function ty({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function ny({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function ry(e){return e!==null&&typeof e=="object"?e.valueOf():e}const iy=Math.sqrt(50),oy=Math.sqrt(10),sy=Math.sqrt(2);function Si(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=iy?10:o>=oy?5:o>=sy?2:1;let a,l,c;return i<0?(c=Math.pow(10,-i)/s,a=Math.round(e*c),l=Math.round(t*c),a/c<e&&++a,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*s,a=Math.round(e/c),l=Math.round(t/c),a*c<e&&++a,l*c>t&&--l),l<a&&.5<=n&&n<2?Si(e,t,n*2):[a,l,c]}function ws(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,o,s]=r?Si(t,e,n):Si(e,t,n);if(!(o>=i))return[];const a=o-i+1,l=new Array(a);if(r)if(s<0)for(let c=0;c<a;++c)l[c]=(o-c)/-s;else for(let c=0;c<a;++c)l[c]=(o-c)*s;else if(s<0)for(let c=0;c<a;++c)l[c]=(i+c)/-s;else for(let c=0;c<a;++c)l[c]=(i+c)*s;return l}function Es(e,t,n){return t=+t,e=+e,n=+n,Si(e,t,n)[2]}function Ts(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Es(t,e,n):Es(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function ay(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}function Ht(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function ly(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const Fl=Symbol("implicit");function Cs(){var e=new vi,t=[],n=[],r=Fl;function i(o){let s=e.get(o);if(s===void 0){if(r!==Fl)return r;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new vi;for(const s of o)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return Cs(t,n).unknown(r)},Ht.apply(i,arguments),i}function la(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ad(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function _r(){}var pr=.7,wi=1/pr,Dn="\\s*([+-]?\\d+)\\s*",mr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ht="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",cy=/^#([0-9a-f]{3,8})$/,uy=new RegExp(`^rgb\\(${Dn},${Dn},${Dn}\\)$`),dy=new RegExp(`^rgb\\(${ht},${ht},${ht}\\)$`),hy=new RegExp(`^rgba\\(${Dn},${Dn},${Dn},${mr}\\)$`),fy=new RegExp(`^rgba\\(${ht},${ht},${ht},${mr}\\)$`),py=new RegExp(`^hsl\\(${mr},${ht},${ht}\\)$`),my=new RegExp(`^hsla\\(${mr},${ht},${ht},${mr}\\)$`),Bl={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};la(_r,gr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Gl,formatHex:Gl,formatHex8:gy,formatHsl:yy,formatRgb:Vl,toString:Vl});function Gl(){return this.rgb().formatHex()}function gy(){return this.rgb().formatHex8()}function yy(){return ld(this).formatHsl()}function Vl(){return this.rgb().formatRgb()}function gr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=cy.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Ul(t):n===3?new Be(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?qr(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?qr(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=uy.exec(e))?new Be(t[1],t[2],t[3],1):(t=dy.exec(e))?new Be(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=hy.exec(e))?qr(t[1],t[2],t[3],t[4]):(t=fy.exec(e))?qr(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=py.exec(e))?Yl(t[1],t[2]/100,t[3]/100,1):(t=my.exec(e))?Yl(t[1],t[2]/100,t[3]/100,t[4]):Bl.hasOwnProperty(e)?Ul(Bl[e]):e==="transparent"?new Be(NaN,NaN,NaN,0):null}function Ul(e){return new Be(e>>16&255,e>>8&255,e&255,1)}function qr(e,t,n,r){return r<=0&&(e=t=n=NaN),new Be(e,t,n,r)}function xy(e){return e instanceof _r||(e=gr(e)),e?(e=e.rgb(),new Be(e.r,e.g,e.b,e.opacity)):new Be}function _s(e,t,n,r){return arguments.length===1?xy(e):new Be(e,t,n,r??1)}function Be(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}la(Be,_s,ad(_r,{brighter(e){return e=e==null?wi:Math.pow(wi,e),new Be(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?pr:Math.pow(pr,e),new Be(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Be(an(this.r),an(this.g),an(this.b),Ei(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Wl,formatHex:Wl,formatHex8:by,formatRgb:Hl,toString:Hl}));function Wl(){return`#${nn(this.r)}${nn(this.g)}${nn(this.b)}`}function by(){return`#${nn(this.r)}${nn(this.g)}${nn(this.b)}${nn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Hl(){const e=Ei(this.opacity);return`${e===1?"rgb(":"rgba("}${an(this.r)}, ${an(this.g)}, ${an(this.b)}${e===1?")":`, ${e})`}`}function Ei(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function an(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function nn(e){return e=an(e),(e<16?"0":"")+e.toString(16)}function Yl(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new et(e,t,n,r)}function ld(e){if(e instanceof et)return new et(e.h,e.s,e.l,e.opacity);if(e instanceof _r||(e=gr(e)),!e)return new et;if(e instanceof et)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(t===o?s=(n-r)/a+(n<r)*6:n===o?s=(r-t)/a+2:s=(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new et(s,a,l,e.opacity)}function vy(e,t,n,r){return arguments.length===1?ld(e):new et(e,t,n,r??1)}function et(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}la(et,vy,ad(_r,{brighter(e){return e=e==null?wi:Math.pow(wi,e),new et(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?pr:Math.pow(pr,e),new et(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Be(Ko(e>=240?e-240:e+120,i,r),Ko(e,i,r),Ko(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new et(ql(this.h),Jr(this.s),Jr(this.l),Ei(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ei(this.opacity);return`${e===1?"hsl(":"hsla("}${ql(this.h)}, ${Jr(this.s)*100}%, ${Jr(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ql(e){return e=(e||0)%360,e<0?e+360:e}function Jr(e){return Math.max(0,Math.min(1,e||0))}function Ko(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const ca=e=>()=>e;function Sy(e,t){return function(n){return e+n*t}}function wy(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Ey(e){return(e=+e)==1?cd:function(t,n){return n-t?wy(t,n,e):ca(isNaN(t)?n:t)}}function cd(e,t){var n=t-e;return n?Sy(e,n):ca(isNaN(e)?t:e)}const Jl=(function e(t){var n=Ey(t);function r(i,o){var s=n((i=_s(i)).r,(o=_s(o)).r),a=n(i.g,o.g),l=n(i.b,o.b),c=cd(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=e,r})(1);function Ty(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=e[i]*(1-o)+t[i]*o;return r}}function Cy(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function _y(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),s;for(s=0;s<r;++s)i[s]=lo(e[s],t[s]);for(;s<n;++s)o[s]=t[s];return function(a){for(s=0;s<r;++s)o[s]=i[s](a);return o}}function ua(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function tt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function My(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=lo(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var Ms=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xo=new RegExp(Ms.source,"g");function Ry(e){return function(){return e}}function Ay(e){return function(t){return e(t)+""}}function Iy(e,t){var n=Ms.lastIndex=Xo.lastIndex=0,r,i,o,s=-1,a=[],l=[];for(e=e+"",t=t+"";(r=Ms.exec(e))&&(i=Xo.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:tt(r,i)})),n=Xo.lastIndex;return n<t.length&&(o=t.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?l[0]?Ay(l[0].x):Ry(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)a[(d=l[u]).i]=d.x(c);return a.join("")})}function lo(e,t){var n=typeof t,r;return t==null||n==="boolean"?ca(t):(n==="number"?tt:n==="string"?(r=gr(t))?(t=r,Jl):Iy:t instanceof gr?Jl:t instanceof Date?ua:Cy(t)?Ty:Array.isArray(t)?_y:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?My:tt)(e,t)}function ud(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function jy(e){return function(){return e}}function ky(e){return+e}var Kl=[0,1];function qe(e){return e}function Rs(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:jy(isNaN(t)?NaN:.5)}function Oy(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Py(e,t,n){var r=e[0],i=e[1],o=t[0],s=t[1];return i<r?(r=Rs(i,r),o=n(s,o)):(r=Rs(r,i),o=n(o,s)),function(a){return o(r(a))}}function Dy(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=Rs(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(a){var l=sd(e,a,1,r)-1;return o[l](i[l](a))}}function Mr(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function co(){var e=Kl,t=Kl,n=lo,r,i,o,s=qe,a,l,c;function u(){var h=Math.min(e.length,t.length);return s!==qe&&(s=Oy(e[0],e[h-1])),a=h>2?Dy:Py,l=c=null,d}function d(h){return h==null||isNaN(h=+h)?o:(l||(l=a(e.map(r),t,n)))(r(s(h)))}return d.invert=function(h){return s(i((c||(c=a(t,e.map(r),tt)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,ky),u()):e.slice()},d.range=function(h){return arguments.length?(t=Array.from(h),u()):t.slice()},d.rangeRound=function(h){return t=Array.from(h),n=ud,u()},d.clamp=function(h){return arguments.length?(s=h?!0:qe,u()):s!==qe},d.interpolate=function(h){return arguments.length?(n=h,u()):n},d.unknown=function(h){return arguments.length?(o=h,d):o},function(h,f){return r=h,i=f,u()}}function dd(){return co()(qe,qe)}function $y(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ti(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Bn(e){return e=Ti(Math.abs(e)),e?e[1]:NaN}function Ly(e,t){return function(n,r){for(var i=n.length,o=[],s=0,a=e[0],l=0;i>0&&a>0&&(l+a+1>r&&(a=Math.max(1,r-l)),o.push(n.substring(i-=a,i+a)),!((l+=a+1)>r));)a=e[s=(s+1)%e.length];return o.reverse().join(t)}}function Ny(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var zy=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function yr(e){if(!(t=zy.exec(e)))throw new Error("invalid format: "+e);var t;return new da({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}yr.prototype=da.prototype;function da(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}da.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Fy(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Ci;function By(e,t){var n=Ti(e,t);if(!n)return Ci=void 0,e.toPrecision(t);var r=n[0],i=n[1],o=i-(Ci=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Ti(e,Math.max(0,t+o-1))[0]}function Xl(e,t){var n=Ti(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Zl={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:$y,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Xl(e*100,t),r:Xl,s:By,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Ql(e){return e}var ec=Array.prototype.map,tc=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Gy(e){var t=e.grouping===void 0||e.thousands===void 0?Ql:Ly(ec.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?Ql:Ny(ec.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(d,h){d=yr(d);var f=d.fill,m=d.align,p=d.sign,y=d.symbol,v=d.zero,T=d.width,w=d.comma,E=d.precision,R=d.trim,S=d.type;S==="n"?(w=!0,S="g"):Zl[S]||(E===void 0&&(E=12),R=!0,S="g"),(v||f==="0"&&m==="=")&&(v=!0,f="0",m="=");var C=(h&&h.prefix!==void 0?h.prefix:"")+(y==="$"?n:y==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():""),I=(y==="$"?r:/[%p]/.test(S)?s:"")+(h&&h.suffix!==void 0?h.suffix:""),k=Zl[S],P=/[defgprs%]/.test(S);E=E===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function D(g){var A=C,_=I,z,N,W;if(S==="c")_=k(g)+_,g="";else{g=+g;var B=g<0||1/g<0;if(g=isNaN(g)?l:k(Math.abs(g),E),R&&(g=Fy(g)),B&&+g==0&&p!=="+"&&(B=!1),A=(B?p==="("?p:a:p==="-"||p==="("?"":p)+A,_=(S==="s"&&!isNaN(g)&&Ci!==void 0?tc[8+Ci/3]:"")+_+(B&&p==="("?")":""),P){for(z=-1,N=g.length;++z<N;)if(W=g.charCodeAt(z),48>W||W>57){_=(W===46?i+g.slice(z+1):g.slice(z))+_,g=g.slice(0,z);break}}}w&&!v&&(g=t(g,1/0));var Z=A.length+g.length+_.length,Q=Z<T?new Array(T-Z+1).join(f):"";switch(w&&v&&(g=t(Q+g,Q.length?T-_.length:1/0),Q=""),m){case"<":g=A+g+_+Q;break;case"=":g=A+Q+g+_;break;case"^":g=Q.slice(0,Z=Q.length>>1)+A+g+_+Q.slice(Z);break;default:g=Q+A+g+_;break}return o(g)}return D.toString=function(){return d+""},D}function u(d,h){var f=Math.max(-8,Math.min(8,Math.floor(Bn(h)/3)))*3,m=Math.pow(10,-f),p=c((d=yr(d),d.type="f",d),{suffix:tc[8+f/3]});return function(y){return p(m*y)}}return{format:c,formatPrefix:u}}var Kr,ha,hd;Vy({thousands:",",grouping:[3],currency:["$",""]});function Vy(e){return Kr=Gy(e),ha=Kr.format,hd=Kr.formatPrefix,Kr}function Uy(e){return Math.max(0,-Bn(Math.abs(e)))}function Wy(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Bn(t)/3)))*3-Bn(Math.abs(e)))}function Hy(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Bn(t)-Bn(e))+1}function Yy(e,t,n,r){var i=Ts(e,t,n),o;switch(r=yr(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=Wy(i,s))&&(r.precision=o),hd(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=Hy(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=Uy(i))&&(r.precision=o-(r.type==="%")*2);break}}return ha(r)}function uo(e){var t=e.domain;return e.ticks=function(n){var r=t();return ws(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Yy(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,s=r[i],a=r[o],l,c,u=10;for(a<s&&(c=s,s=a,a=c,c=i,i=o,o=c);u-- >0;){if(c=Es(s,a,n),c===l)return r[i]=s,r[o]=a,t(r);if(c>0)s=Math.floor(s/c)*c,a=Math.ceil(a/c)*c;else if(c<0)s=Math.ceil(s*c)/c,a=Math.floor(a*c)/c;else break;l=c}return e},e}function fa(){var e=dd();return e.copy=function(){return Mr(e,fa())},Ht.apply(e,arguments),uo(e)}function fd(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],s;return o<i&&(s=n,n=r,r=s,s=i,i=o,o=s),e[n]=t.floor(i),e[r]=t.ceil(o),e}function nc(e){return Math.log(e)}function rc(e){return Math.exp(e)}function qy(e){return-Math.log(-e)}function Jy(e){return-Math.exp(-e)}function Ky(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Xy(e){return e===10?Ky:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Zy(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function ic(e){return(t,n)=>-e(-t,n)}function Qy(e){const t=e(nc,rc),n=t.domain;let r=10,i,o;function s(){return i=Zy(r),o=Xy(r),n()[0]<0?(i=ic(i),o=ic(o),e(qy,Jy)):e(nc,rc),t}return t.base=function(a){return arguments.length?(r=+a,s()):r},t.domain=function(a){return arguments.length?(n(a),s()):n()},t.ticks=a=>{const l=n();let c=l[0],u=l[l.length-1];const d=u<c;d&&([c,u]=[u,c]);let h=i(c),f=i(u),m,p;const y=a==null?10:+a;let v=[];if(!(r%1)&&f-h<y){if(h=Math.floor(h),f=Math.ceil(f),c>0){for(;h<=f;++h)for(m=1;m<r;++m)if(p=h<0?m/o(-h):m*o(h),!(p<c)){if(p>u)break;v.push(p)}}else for(;h<=f;++h)for(m=r-1;m>=1;--m)if(p=h>0?m/o(-h):m*o(h),!(p<c)){if(p>u)break;v.push(p)}v.length*2<y&&(v=ws(c,u,y))}else v=ws(h,f,Math.min(f-h,y)).map(o);return d?v.reverse():v},t.tickFormat=(a,l)=>{if(a==null&&(a=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=yr(l)).precision==null&&(l.trim=!0),l=ha(l)),a===1/0)return l;const c=Math.max(1,r*a/t.ticks().length);return u=>{let d=u/o(Math.round(i(u)));return d*r<r-.5&&(d*=r),d<=c?l(u):""}},t.nice=()=>n(fd(n(),{floor:a=>o(Math.floor(i(a))),ceil:a=>o(Math.ceil(i(a)))})),t}function _i(){const e=Qy(co()).domain([1,10]);return e.copy=()=>Mr(e,_i()).base(e.base()),Ht.apply(e,arguments),e}function oc(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function sc(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function ex(e){var t=1,n=e(oc(t),sc(t));return n.constant=function(r){return arguments.length?e(oc(t=+r),sc(t)):t},uo(n)}function pd(){var e=ex(co());return e.copy=function(){return Mr(e,pd()).constant(e.constant())},Ht.apply(e,arguments)}function ac(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function tx(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function nx(e){return e<0?-e*e:e*e}function rx(e){var t=e(qe,qe),n=1;function r(){return n===1?e(qe,qe):n===.5?e(tx,nx):e(ac(n),ac(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},uo(t)}function pa(){var e=rx(co());return e.copy=function(){return Mr(e,pa()).exponent(e.exponent())},Ht.apply(e,arguments),e}function ix(){return pa.apply(null,arguments).exponent(.5)}function md(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[sd(e,o,0,r)]:n}return i.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var s=t.indexOf(o);return[e[s-1],e[s]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return md().domain(e).range(t).unknown(n)},Ht.apply(i,arguments)}const Zo=new Date,Qo=new Date;function Te(e,t,n,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const s=i(o),a=i.ceil(o);return o-s<a-o?s:a},i.offset=(o,s)=>(t(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,a)=>{const l=[];if(o=i.ceil(o),a=a==null?1:Math.floor(a),!(o<s)||!(a>0))return l;let c;do l.push(c=new Date(+o)),t(o,a),e(o);while(c<o&&o<s);return l},i.filter=o=>Te(s=>{if(s>=s)for(;e(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;t(s,-1),!o(s););else for(;--a>=0;)for(;t(s,1),!o(s););}),n&&(i.count=(o,s)=>(Zo.setTime(+o),Qo.setTime(+s),e(Zo),e(Qo),Math.floor(n(Zo,Qo))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?s=>r(s)%o===0:s=>i.count(0,s)%o===0):i)),i}const Mi=Te(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Mi.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Te(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Mi);Mi.range;const Tt=1e3,Je=Tt*60,Ct=Je*60,Mt=Ct*24,ma=Mt*7,lc=Mt*30,es=Mt*365,rn=Te(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Tt)},(e,t)=>(t-e)/Tt,e=>e.getUTCSeconds());rn.range;const ga=Te(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Tt)},(e,t)=>{e.setTime(+e+t*Je)},(e,t)=>(t-e)/Je,e=>e.getMinutes());ga.range;const ya=Te(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Je)},(e,t)=>(t-e)/Je,e=>e.getUTCMinutes());ya.range;const xa=Te(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Tt-e.getMinutes()*Je)},(e,t)=>{e.setTime(+e+t*Ct)},(e,t)=>(t-e)/Ct,e=>e.getHours());xa.range;const ba=Te(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ct)},(e,t)=>(t-e)/Ct,e=>e.getUTCHours());ba.range;const Rr=Te(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Je)/Mt,e=>e.getDate()-1);Rr.range;const ho=Te(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Mt,e=>e.getUTCDate()-1);ho.range;const gd=Te(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Mt,e=>Math.floor(e/Mt));gd.range;function mn(e){return Te(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Je)/ma)}const fo=mn(0),Ri=mn(1),ox=mn(2),sx=mn(3),Gn=mn(4),ax=mn(5),lx=mn(6);fo.range;Ri.range;ox.range;sx.range;Gn.range;ax.range;lx.range;function gn(e){return Te(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/ma)}const po=gn(0),Ai=gn(1),cx=gn(2),ux=gn(3),Vn=gn(4),dx=gn(5),hx=gn(6);po.range;Ai.range;cx.range;ux.range;Vn.range;dx.range;hx.range;const va=Te(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());va.range;const Sa=Te(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Sa.range;const Rt=Te(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Rt.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Te(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Rt.range;const At=Te(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());At.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Te(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});At.range;function yd(e,t,n,r,i,o){const s=[[rn,1,Tt],[rn,5,5*Tt],[rn,15,15*Tt],[rn,30,30*Tt],[o,1,Je],[o,5,5*Je],[o,15,15*Je],[o,30,30*Je],[i,1,Ct],[i,3,3*Ct],[i,6,6*Ct],[i,12,12*Ct],[r,1,Mt],[r,2,2*Mt],[n,1,ma],[t,1,lc],[t,3,3*lc],[e,1,es]];function a(c,u,d){const h=u<c;h&&([c,u]=[u,c]);const f=d&&typeof d.range=="function"?d:l(c,u,d),m=f?f.range(c,+u+1):[];return h?m.reverse():m}function l(c,u,d){const h=Math.abs(u-c)/d,f=aa(([,,y])=>y).right(s,h);if(f===s.length)return e.every(Ts(c/es,u/es,d));if(f===0)return Mi.every(Math.max(Ts(c,u,d),1));const[m,p]=s[h/s[f-1][2]<s[f][2]/h?f-1:f];return m.every(p)}return[a,l]}const[fx,px]=yd(At,Sa,po,gd,ba,ya),[mx,gx]=yd(Rt,va,fo,Rr,xa,ga);function ts(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function ns(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Zn(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function yx(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,s=e.shortDays,a=e.months,l=e.shortMonths,c=Qn(i),u=er(i),d=Qn(o),h=er(o),f=Qn(s),m=er(s),p=Qn(a),y=er(a),v=Qn(l),T=er(l),w={a:W,A:B,b:Z,B:Q,c:null,d:pc,e:pc,f:Fx,g:Kx,G:Zx,H:Lx,I:Nx,j:zx,L:xd,m:Bx,M:Gx,p:ee,q:Ne,Q:yc,s:xc,S:Vx,u:Ux,U:Wx,V:Hx,w:Yx,W:qx,x:null,X:null,y:Jx,Y:Xx,Z:Qx,"%":gc},E={a:xt,A:bt,b:je,B:vt,c:null,d:mc,e:mc,f:r1,g:f1,G:m1,H:e1,I:t1,j:n1,L:vd,m:i1,M:o1,p:ot,q:Ge,Q:yc,s:xc,S:s1,u:a1,U:l1,V:c1,w:u1,W:d1,x:null,X:null,y:h1,Y:p1,Z:g1,"%":gc},R={a:P,A:D,b:g,B:A,c:_,d:hc,e:hc,f:Ox,g:dc,G:uc,H:fc,I:fc,j:Ax,L:kx,m:Rx,M:Ix,p:k,q:Mx,Q:Dx,s:$x,S:jx,u:wx,U:Ex,V:Tx,w:Sx,W:Cx,x:z,X:N,y:dc,Y:uc,Z:_x,"%":Px};w.x=S(n,w),w.X=S(r,w),w.c=S(t,w),E.x=S(n,E),E.X=S(r,E),E.c=S(t,E);function S(V,q){return function(K){var L=[],ie=-1,te=0,Ae=V.length,Ce,ge,Dt;for(K instanceof Date||(K=new Date(+K));++ie<Ae;)V.charCodeAt(ie)===37&&(L.push(V.slice(te,ie)),(ge=cc[Ce=V.charAt(++ie)])!=null?Ce=V.charAt(++ie):ge=Ce==="e"?" ":"0",(Dt=q[Ce])&&(Ce=Dt(K,ge)),L.push(Ce),te=ie+1);return L.push(V.slice(te,ie)),L.join("")}}function C(V,q){return function(K){var L=Zn(1900,void 0,1),ie=I(L,V,K+="",0),te,Ae;if(ie!=K.length)return null;if("Q"in L)return new Date(L.Q);if("s"in L)return new Date(L.s*1e3+("L"in L?L.L:0));if(q&&!("Z"in L)&&(L.Z=0),"p"in L&&(L.H=L.H%12+L.p*12),L.m===void 0&&(L.m="q"in L?L.q:0),"V"in L){if(L.V<1||L.V>53)return null;"w"in L||(L.w=1),"Z"in L?(te=ns(Zn(L.y,0,1)),Ae=te.getUTCDay(),te=Ae>4||Ae===0?Ai.ceil(te):Ai(te),te=ho.offset(te,(L.V-1)*7),L.y=te.getUTCFullYear(),L.m=te.getUTCMonth(),L.d=te.getUTCDate()+(L.w+6)%7):(te=ts(Zn(L.y,0,1)),Ae=te.getDay(),te=Ae>4||Ae===0?Ri.ceil(te):Ri(te),te=Rr.offset(te,(L.V-1)*7),L.y=te.getFullYear(),L.m=te.getMonth(),L.d=te.getDate()+(L.w+6)%7)}else("W"in L||"U"in L)&&("w"in L||(L.w="u"in L?L.u%7:"W"in L?1:0),Ae="Z"in L?ns(Zn(L.y,0,1)).getUTCDay():ts(Zn(L.y,0,1)).getDay(),L.m=0,L.d="W"in L?(L.w+6)%7+L.W*7-(Ae+5)%7:L.w+L.U*7-(Ae+6)%7);return"Z"in L?(L.H+=L.Z/100|0,L.M+=L.Z%100,ns(L)):ts(L)}}function I(V,q,K,L){for(var ie=0,te=q.length,Ae=K.length,Ce,ge;ie<te;){if(L>=Ae)return-1;if(Ce=q.charCodeAt(ie++),Ce===37){if(Ce=q.charAt(ie++),ge=R[Ce in cc?q.charAt(ie++):Ce],!ge||(L=ge(V,K,L))<0)return-1}else if(Ce!=K.charCodeAt(L++))return-1}return L}function k(V,q,K){var L=c.exec(q.slice(K));return L?(V.p=u.get(L[0].toLowerCase()),K+L[0].length):-1}function P(V,q,K){var L=f.exec(q.slice(K));return L?(V.w=m.get(L[0].toLowerCase()),K+L[0].length):-1}function D(V,q,K){var L=d.exec(q.slice(K));return L?(V.w=h.get(L[0].toLowerCase()),K+L[0].length):-1}function g(V,q,K){var L=v.exec(q.slice(K));return L?(V.m=T.get(L[0].toLowerCase()),K+L[0].length):-1}function A(V,q,K){var L=p.exec(q.slice(K));return L?(V.m=y.get(L[0].toLowerCase()),K+L[0].length):-1}function _(V,q,K){return I(V,t,q,K)}function z(V,q,K){return I(V,n,q,K)}function N(V,q,K){return I(V,r,q,K)}function W(V){return s[V.getDay()]}function B(V){return o[V.getDay()]}function Z(V){return l[V.getMonth()]}function Q(V){return a[V.getMonth()]}function ee(V){return i[+(V.getHours()>=12)]}function Ne(V){return 1+~~(V.getMonth()/3)}function xt(V){return s[V.getUTCDay()]}function bt(V){return o[V.getUTCDay()]}function je(V){return l[V.getUTCMonth()]}function vt(V){return a[V.getUTCMonth()]}function ot(V){return i[+(V.getUTCHours()>=12)]}function Ge(V){return 1+~~(V.getUTCMonth()/3)}return{format:function(V){var q=S(V+="",w);return q.toString=function(){return V},q},parse:function(V){var q=C(V+="",!1);return q.toString=function(){return V},q},utcFormat:function(V){var q=S(V+="",E);return q.toString=function(){return V},q},utcParse:function(V){var q=C(V+="",!0);return q.toString=function(){return V},q}}}var cc={"-":"",_:" ",0:"0"},Re=/^\s*\d+/,xx=/^%/,bx=/[\\^$*+?|[\]().{}]/g;function re(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function vx(e){return e.replace(bx,"\\$&")}function Qn(e){return new RegExp("^(?:"+e.map(vx).join("|")+")","i")}function er(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Sx(e,t,n){var r=Re.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function wx(e,t,n){var r=Re.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Ex(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Tx(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Cx(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function uc(e,t,n){var r=Re.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function dc(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function _x(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Mx(e,t,n){var r=Re.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Rx(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function hc(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Ax(e,t,n){var r=Re.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function fc(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Ix(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function jx(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function kx(e,t,n){var r=Re.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Ox(e,t,n){var r=Re.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Px(e,t,n){var r=xx.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Dx(e,t,n){var r=Re.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function $x(e,t,n){var r=Re.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function pc(e,t){return re(e.getDate(),t,2)}function Lx(e,t){return re(e.getHours(),t,2)}function Nx(e,t){return re(e.getHours()%12||12,t,2)}function zx(e,t){return re(1+Rr.count(Rt(e),e),t,3)}function xd(e,t){return re(e.getMilliseconds(),t,3)}function Fx(e,t){return xd(e,t)+"000"}function Bx(e,t){return re(e.getMonth()+1,t,2)}function Gx(e,t){return re(e.getMinutes(),t,2)}function Vx(e,t){return re(e.getSeconds(),t,2)}function Ux(e){var t=e.getDay();return t===0?7:t}function Wx(e,t){return re(fo.count(Rt(e)-1,e),t,2)}function bd(e){var t=e.getDay();return t>=4||t===0?Gn(e):Gn.ceil(e)}function Hx(e,t){return e=bd(e),re(Gn.count(Rt(e),e)+(Rt(e).getDay()===4),t,2)}function Yx(e){return e.getDay()}function qx(e,t){return re(Ri.count(Rt(e)-1,e),t,2)}function Jx(e,t){return re(e.getFullYear()%100,t,2)}function Kx(e,t){return e=bd(e),re(e.getFullYear()%100,t,2)}function Xx(e,t){return re(e.getFullYear()%1e4,t,4)}function Zx(e,t){var n=e.getDay();return e=n>=4||n===0?Gn(e):Gn.ceil(e),re(e.getFullYear()%1e4,t,4)}function Qx(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+re(t/60|0,"0",2)+re(t%60,"0",2)}function mc(e,t){return re(e.getUTCDate(),t,2)}function e1(e,t){return re(e.getUTCHours(),t,2)}function t1(e,t){return re(e.getUTCHours()%12||12,t,2)}function n1(e,t){return re(1+ho.count(At(e),e),t,3)}function vd(e,t){return re(e.getUTCMilliseconds(),t,3)}function r1(e,t){return vd(e,t)+"000"}function i1(e,t){return re(e.getUTCMonth()+1,t,2)}function o1(e,t){return re(e.getUTCMinutes(),t,2)}function s1(e,t){return re(e.getUTCSeconds(),t,2)}function a1(e){var t=e.getUTCDay();return t===0?7:t}function l1(e,t){return re(po.count(At(e)-1,e),t,2)}function Sd(e){var t=e.getUTCDay();return t>=4||t===0?Vn(e):Vn.ceil(e)}function c1(e,t){return e=Sd(e),re(Vn.count(At(e),e)+(At(e).getUTCDay()===4),t,2)}function u1(e){return e.getUTCDay()}function d1(e,t){return re(Ai.count(At(e)-1,e),t,2)}function h1(e,t){return re(e.getUTCFullYear()%100,t,2)}function f1(e,t){return e=Sd(e),re(e.getUTCFullYear()%100,t,2)}function p1(e,t){return re(e.getUTCFullYear()%1e4,t,4)}function m1(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Vn(e):Vn.ceil(e),re(e.getUTCFullYear()%1e4,t,4)}function g1(){return"+0000"}function gc(){return"%"}function yc(e){return+e}function xc(e){return Math.floor(+e/1e3)}var An,wd,Ed;y1({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function y1(e){return An=yx(e),wd=An.format,An.parse,Ed=An.utcFormat,An.utcParse,An}function x1(e){return new Date(e)}function b1(e){return e instanceof Date?+e:+new Date(+e)}function wa(e,t,n,r,i,o,s,a,l,c){var u=dd(),d=u.invert,h=u.domain,f=c(".%L"),m=c(":%S"),p=c("%I:%M"),y=c("%I %p"),v=c("%a %d"),T=c("%b %d"),w=c("%B"),E=c("%Y");function R(S){return(l(S)<S?f:a(S)<S?m:s(S)<S?p:o(S)<S?y:r(S)<S?i(S)<S?v:T:n(S)<S?w:E)(S)}return u.invert=function(S){return new Date(d(S))},u.domain=function(S){return arguments.length?h(Array.from(S,b1)):h().map(x1)},u.ticks=function(S){var C=h();return e(C[0],C[C.length-1],S??10)},u.tickFormat=function(S,C){return C==null?R:c(C)},u.nice=function(S){var C=h();return(!S||typeof S.range!="function")&&(S=t(C[0],C[C.length-1],S??10)),S?h(fd(C,S)):u},u.copy=function(){return Mr(u,wa(e,t,n,r,i,o,s,a,l,c))},u}function Td(){return Ht.apply(wa(mx,gx,Rt,va,fo,Rr,xa,ga,rn,wd).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function v1(){return Ht.apply(wa(fx,px,At,Sa,po,ho,ba,ya,rn,Ed).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function S1(){var e=0,t=1,n,r,i,o,s=qe,a=!1,l;function c(d){return d==null||isNaN(d=+d)?l:s(i===0?.5:(d=(o(d)-n)*i,a?Math.max(0,Math.min(1,d)):d))}c.domain=function(d){return arguments.length?([e,t]=d,n=o(e=+e),r=o(t=+t),i=n===r?0:1/(r-n),c):[e,t]},c.clamp=function(d){return arguments.length?(a=!!d,c):a},c.interpolator=function(d){return arguments.length?(s=d,c):s};function u(d){return function(h){var f,m;return arguments.length?([f,m]=h,s=d(f,m),c):[s(0),s(1)]}}return c.range=u(lo),c.rangeRound=u(ud),c.unknown=function(d){return arguments.length?(l=d,c):l},function(d){return o=d,n=d(e),r=d(t),i=n===r?0:1/(r-n),c}}function w1(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Cd(){var e=uo(S1()(qe));return e.copy=function(){return w1(e,Cd())},ly.apply(e,arguments)}function _d(e){return e.type==="piecewise"?md(e.thresholds,e.colors):Cd([e.min??0,e.max??100],e.color)}function Ii(e){return e.values?Cs(e.values,e.colors).unknown(e.unknownColor??null):Cs(e.colors.map((t,n)=>n),e.colors).unknown(e.unknownColor??null)}function As(e){return e.type==="ordinal"?Ii(e):_d(e)}function Ea(e,t,n){const{tickMaxStep:r,tickMinStep:i,tickNumber:o}=e,s=i===void 0?999:Math.floor(Math.abs(t[1]-t[0])/i),a=r===void 0?2:Math.ceil(Math.abs(t[1]-t[0])/r);return Math.min(s,Math.max(a,o??n))}function E1(e,t){return t[1]-t[0]===0?1:e/((t[1]-t[0])/100)}function Md(e){return Math.floor(Math.abs(e)/50)}function bc(e){return Array.isArray(e)?JSON.stringify(e):typeof e=="object"&&e!==null?e.valueOf():e}function Ta(...e){let t=new vi(void 0,bc),n=[],r=[],i=0,o=1,s,a,l=!1,c=0,u=0,d=.5;const h=y=>{const v=t.get(y);if(v!==void 0)return r[v%r.length]},f=()=>{const y=n.length,v=o<i,T=v?o:i,w=v?i:o;s=(w-T)/Math.max(1,y-c+u*2),l&&(s=Math.floor(s));const E=T+(w-T-s*(y-c))*d;a=s*(1-c);const R=l?Math.round(E):E;a=l?Math.round(a):a;const C=ay(y).map(I=>R+s*I);return r=v?C.reverse():C,h};h.domain=function(y){if(!arguments.length)return n.slice();n=[],t=new vi(void 0,bc);for(const v of y)t.has(v)||t.set(v,n.push(v)-1);return f()},h.range=function(y){if(!arguments.length)return[i,o];const[v,T]=y;return i=+v,o=+T,f()},h.rangeRound=function(y){const[v,T]=y;return i=+v,o=+T,l=!0,f()},h.bandwidth=function(){return a},h.step=function(){return s},h.round=function(y){return arguments.length?(l=!!y,f()):l},h.padding=function(y){return arguments.length?(c=Math.min(1,u=+y),f()):c},h.paddingInner=function(y){return arguments.length?(c=Math.min(1,y),f()):c},h.paddingOuter=function(y){return arguments.length?(u=+y,f()):u},h.align=function(y){return arguments.length?(d=Math.max(0,Math.min(1,y)),f()):d},h.copy=()=>Ta(n,[i,o]).round(l).paddingInner(c).paddingOuter(u).align(d);const[m,p]=e;return e.length>1?(h.domain(m),h.range(p)):m?h.range(m):f(),h}function T1(...e){const t=Ta(...e).paddingInner(1),n=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=()=>{const r=n();return r.padding=r.paddingOuter,delete r.paddingInner,delete r.paddingOuter,r.copy=t.copy,r},t}function Rd(...e){const t=pd(...e),n=t.ticks,{negativeScale:r,linearScale:i,positiveScale:o}=C1(t);return t.ticks=s=>{const a=n(s),l=t.constant();let c=0,u=0,d=0;a.forEach(f=>{f>-l&&f<l&&(u+=1),f<=-l&&(c+=1),f>=l&&(d+=1)});const h=[];if(c>0&&h.push(...r.ticks(c)),u>0){const f=i.ticks(u);h.at(-1)===f[0]?h.push(...f.slice(1)):h.push(...f)}if(d>0){const f=o.ticks(d);h.at(-1)===f[0]?h.push(...f.slice(1)):h.push(...f)}return h},t.tickFormat=(s=10,a)=>{const l=t.constant(),[c,u]=t.domain(),d=u-c,h=r.domain(),f=h[1]-h[0],p=(d===0?0:f/d)*s,y=i.domain(),v=y[1]-y[0],w=(d===0?0:v/d)*s,E=o.domain(),R=E[1]-E[0],C=(d===0?0:R/d)*s,I=r.tickFormat(p,a),k=i.tickFormat(w,a),P=o.tickFormat(C,a);return D=>(D.valueOf()<=-l?I:D.valueOf()>=l?P:k)(D)},t.copy=()=>Rd(t.domain(),t.range()).constant(t.constant()),t}function C1(e){const t=e.constant(),n=e.domain(),r=[n[0],Math.min(n[1],-t)],i=_i(r,e.range()),o=[Math.max(n[0],-t),Math.min(n[1],t)],s=fa(o,e.range()),a=[Math.max(n[0],t),n[1]],l=_i(a,e.range());return{negativeScale:i,linearScale:s,positiveScale:l}}function Ca(e,t,n){switch(e){case"log":return _i(t,n);case"pow":return pa(t,n);case"sqrt":return ix(t,n);case"time":return Td(t,n);case"utc":return v1(t,n);case"symlog":return Rd(t,n);default:return fa(t,n)}}const _1=e=>(e==null?void 0:e[0])instanceof Date;function M1(e,t,n){const r=Td(e,t);return(i,{location:o})=>o==="tick"?r.tickFormat(n)(i):`${i.toLocaleString()}`}let vc,Sc;class R1{constructor(){H(this,"types",new Set);if(vc)throw new Error("You can only create one instance!");vc=this.types}addType(t){this.types.add(t)}getTypes(){return this.types}}class A1{constructor(){H(this,"types",new Set);if(Sc)throw new Error("You can only create one instance!");Sc=this.types}addType(t){this.types.add(t)}getTypes(){return this.types}}const mo=new R1;mo.addType("bar");mo.addType("line");mo.addType("scatter");const I1=new A1;I1.addType("radar");function Ad(e){return mo.getTypes().has(e)}const j1=(e,t,n,r)=>{const i=new Set;return Object.keys(t).filter(Ad).forEach(s=>{var c,u,d;const a=((c=n[s])==null?void 0:c.series)??{},l=(d=(u=t[s]).axisTooltipGetter)==null?void 0:d.call(u,a);l!==void 0&&l.forEach(({axisId:h,direction:f})=>{f===e&&i.add(h??r)})}),i};function Ar(e){return e.bandwidth!==void 0}function k1(e){return Ar(e)&&e.paddingOuter!==void 0}function O1(e,t,n){const r=t==="x"?[e.left,e.left+e.width]:[e.top+e.height,e.top];return n?[r[1],r[0]]:r}function P1(e,t){return e.step()*t<.1}const D1=.2,$1=.1;function Id({scales:e,drawingArea:t,formattedSeries:n,axis:r,seriesConfig:i,axisDirection:o,zoomMap:s,domains:a}){if(r===void 0)return{axis:{},axisIds:[]};const l=j1(o,i,n,r[0].id),c={};return r.forEach(u=>{const d=u,h=e[d.id],f=s==null?void 0:s.get(d.id),m=f?[f.start,f.end]:[0,100],p=O1(t,o,d.reverse??!1),y=a[d.id].tickNumber,v=!d.ignoreTooltip&&l.has(d.id),T=E1(y,m),w=d.data??[];if(Ar(h)){const S=o==="y"?[p[1],p[0]]:p;if(k1(h)&&qn(d)){const C=d.categoryGapRatio??D1,I=P1(h,C),k=I?0:C,P=I?0:d.barGapRatio??$1;c[d.id]=G({offset:0,height:0,categoryGapRatio:k,barGapRatio:P,triggerTooltip:v},d,{data:w,scale:I?h.copy().padding(0):h,tickNumber:T,colorScale:d.colorMap&&(d.colorMap.type==="ordinal"?Ii(G({values:d.data},d.colorMap)):As(d.colorMap))})}if(Jn(d)&&(c[d.id]=G({offset:0,height:0,triggerTooltip:v},d,{data:w,scale:h,tickNumber:T,colorScale:d.colorMap&&(d.colorMap.type==="ordinal"?Ii(G({values:d.data},d.colorMap)):As(d.colorMap))})),_1(d.data)){const C=M1(d.data,S,d.tickNumber);c[d.id].valueFormatter=d.valueFormatter??C}return}if(d.scaleType==="band"||d.scaleType==="point")return;const E=d,R=E.scaleType??"linear";c[d.id]=G({offset:0,height:0,triggerTooltip:v},E,{data:w,scaleType:R,scale:h,tickNumber:T,colorScale:E.colorMap&&_d(E.colorMap),valueFormatter:d.valueFormatter??J0(T,Ca(R,p.map(S=>h.invert(S)),p))})}),{axis:c,axisIds:r.map(({id:u})=>u)}}function L1(e){return e!=null}function N1(e,t,n,r){const i=(e==null?void 0:e.length)??0,o=Math.floor(t*i/100),s=Math.ceil(n*i/100);return function(l,c){return(l[r]??(e==null?void 0:e[c]))==null?!0:c>=o&&c<s}}function z1(e,t,n,r,i){const o=e[0].valueOf(),s=e[1].valueOf(),a=o+t*(s-o)/100,l=o+n*(s-o)/100;return function(u,d){const h=u[r]??(i==null?void 0:i[d]);return h==null?!0:h>=a&&h<=l}}const F1=e=>({currentAxisId:t,seriesXAxisId:n,seriesYAxisId:r,isDefaultAxis:i})=>(o,s)=>{var c,u;return!(t===n?r:n)||i?((u=(c=Object.values(e??{}))[0])==null?void 0:u.call(c,o,s))??!0:[r,n].filter(d=>d!==t).map(d=>e[d??""]).filter(L1).every(d=>d(o,s))},wc=e=>(t=[])=>t.reduce((n,r)=>{const{zoom:i,id:o,reverse:s}=r,a=sa(i,o,e,s);return a&&(n[o]=a),n},{}),B1=.2;function jd(e,t,n){const r=t==="x"?[e.left,e.left+e.width]:[e.top+e.height,e.top];return n.reverse?[r[1],r[0]]:r}function kd(e,t){const n=[0,1];if(qn(e)){const o=e.categoryGapRatio??B1;return Ta(t,n).paddingInner(o).paddingOuter(o/2)}if(Jn(e))return T1(t,n);const r=e.scaleType??"linear",i=Ca(r,t,n);return K0(e)&&e.constant!=null&&i.constant(e.constant),i}const Od=(e,t)=>{const n=e[1]-e[0],r=t[1]-t[0],i=e[0]-t[0]*n/r,o=e[1]+(100-t[1])*n/r;return[i,o]},G1=(e,t,n,r,i,o,s)=>{var c;const a=n==="x"?r[e].xExtremumGetter:r[e].yExtremumGetter,l=((c=o[e])==null?void 0:c.series)??{};return(a==null?void 0:a({series:l,axis:t,axisIndex:i,isDefaultAxis:i===0,getFilters:s}))??[1/0,-1/0]};function go(e,t,n,r,i,o){const s=Object.keys(n).filter(Ad);let a=[1/0,-1/0];for(const l of s){const[c,u]=G1(l,e,t,n,r,i,o);a=[Math.min(a[0],c),Math.max(a[1],u)]}return Number.isNaN(a[0])||Number.isNaN(a[1])?[1/0,-1/0]:a}const V1=(e,t,n,r)=>{var i;if(e.domainLimit!==void 0)return e.domainLimit;if(t==="x")for(const o of((i=r.line)==null?void 0:i.seriesOrder)??[]){const s=r.line.series[o];if(s.xAxisId===e.id||s.xAxisId===void 0&&n===0)return"strict"}return"nice"};function Pd(e,t,n){return Ca(e??"linear",t,[0,1]).nice(n).domain()}function Dd(e,t,n,r,[i,o],s,a){const l=Ld(e,t,n,r,a);let c=Nd(e,i,o);if(typeof l=="function"){const{min:d,max:h}=l(i.valueOf(),o.valueOf());c[0]=d,c[1]=h}const u=Ea(e,c,s);return l==="nice"&&(c=Pd(e.scaleType,c,u)),c=["min"in e?e.min??c[0]:c[0],"max"in e?e.max??c[1]:c[1]],{domain:c,tickNumber:u}}function $d(e,t,n,r,[i,o],s,a){const l=Ld(e,t,n,r,a);let c=Nd(e,i,o);if(typeof l=="function"){const{min:u,max:d}=l(i.valueOf(),o.valueOf());c[0]=u,c[1]=d}return l==="nice"&&(c=Pd(e.scaleType,c,s)),[e.min??c[0],e.max??c[1]]}function Ld(e,t,n,r,i){return i?V1(e,t,n,r):e.domainLimit??"nice"}function Nd(e,t,n){let r=t,i=n;return"max"in e&&e.max!=null&&e.max<t&&(r=e.max),"min"in e&&e.min!=null&&e.min>t&&(i=e.min),!("min"in e)&&!("max"in e)?[r,i]:[e.min??r,e.max??i]}class U1{constructor(){this.ids=[],this.values=[],this.length=0}clear(){this.length=0}push(t,n){let r=this.length++;for(;r>0;){const i=r-1>>1,o=this.values[i];if(n>=o)break;this.ids[r]=this.ids[i],this.values[r]=o,r=i}this.ids[r]=t,this.values[r]=n}pop(){if(this.length===0)return;const t=this.ids,n=this.values,r=t[0],i=--this.length;if(i>0){const o=t[i],s=n[i];let a=0;const l=i>>1;for(;a<l;){const c=(a<<1)+1,u=c+1,d=c+(+(u<i)&+(n[u]<n[c]));if(n[d]>=s)break;t[a]=t[d],n[a]=n[d],a=d}t[a]=o,n[a]=s}return r}peek(){return this.length>0?this.ids[0]:void 0}peekValue(){return this.length>0?this.values[0]:void 0}shrink(){this.ids.length=this.values.length=this.length}}const Ec=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],rs=3;class _a{static from(t,n=0){if(n%8!==0)throw new Error("byteOffset must be 8-byte aligned.");if(!t||t.byteLength===void 0||t.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");const[r,i]=new Uint8Array(t,n+0,2);if(r!==251)throw new Error("Data does not appear to be in a Flatbush format.");const o=i>>4;if(o!==rs)throw new Error(`Got v${o} data when expected v${rs}.`);const s=Ec[i&15];if(!s)throw new Error("Unrecognized array type.");const[a]=new Uint16Array(t,n+2,1),[l]=new Uint32Array(t,n+4,1);return new _a(l,a,s,void 0,t,n)}constructor(t,n=16,r=Float64Array,i=ArrayBuffer,o,s=0){if(t===void 0)throw new Error("Missing required argument: numItems.");if(isNaN(t)||t<=0)throw new Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.byteOffset=s;let a=t,l=a;this._levelBounds=[a*4];do a=Math.ceil(a/this.nodeSize),l+=a,this._levelBounds.push(l*4);while(a!==1);this.ArrayType=r,this.IndexArrayType=l<16384?Uint16Array:Uint32Array;const c=Ec.indexOf(r),u=l*4*r.BYTES_PER_ELEMENT;if(c<0)throw new Error(`Unexpected typed array class: ${r}.`);if(o)this.data=o,this._boxes=new r(o,s+8,l*4),this._indices=new this.IndexArrayType(o,s+8+u,l),this._pos=l*4,this.minX=this._boxes[this._pos-4],this.minY=this._boxes[this._pos-3],this.maxX=this._boxes[this._pos-2],this.maxY=this._boxes[this._pos-1];else{const d=this.data=new i(8+u+l*this.IndexArrayType.BYTES_PER_ELEMENT);this._boxes=new r(d,8,l*4),this._indices=new this.IndexArrayType(d,8+u,l),this._pos=0,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,new Uint8Array(d,0,2).set([251,(rs<<4)+c]),new Uint16Array(d,2,1)[0]=n,new Uint32Array(d,4,1)[0]=t}this._queue=new U1}add(t,n,r=t,i=n){const o=this._pos>>2,s=this._boxes;return this._indices[o]=o,s[this._pos++]=t,s[this._pos++]=n,s[this._pos++]=r,s[this._pos++]=i,t<this.minX&&(this.minX=t),n<this.minY&&(this.minY=n),r>this.maxX&&(this.maxX=r),i>this.maxY&&(this.maxY=i),o}finish(){if(this._pos>>2!==this.numItems)throw new Error(`Added ${this._pos>>2} items when expected ${this.numItems}.`);const t=this._boxes;if(this.numItems<=this.nodeSize){t[this._pos++]=this.minX,t[this._pos++]=this.minY,t[this._pos++]=this.maxX,t[this._pos++]=this.maxY;return}const n=this.maxX-this.minX||1,r=this.maxY-this.minY||1,i=new Uint32Array(this.numItems),o=65535;for(let s=0,a=0;s<this.numItems;s++){const l=t[a++],c=t[a++],u=t[a++],d=t[a++],h=Math.floor(o*((l+u)/2-this.minX)/n),f=Math.floor(o*((c+d)/2-this.minY)/r);i[s]=Y1(h,f)}Is(i,t,this._indices,0,this.numItems-1,this.nodeSize);for(let s=0,a=0;s<this._levelBounds.length-1;s++){const l=this._levelBounds[s];for(;a<l;){const c=a;let u=t[a++],d=t[a++],h=t[a++],f=t[a++];for(let m=1;m<this.nodeSize&&a<l;m++)u=Math.min(u,t[a++]),d=Math.min(d,t[a++]),h=Math.max(h,t[a++]),f=Math.max(f,t[a++]);this._indices[this._pos>>2]=c,t[this._pos++]=u,t[this._pos++]=d,t[this._pos++]=h,t[this._pos++]=f}}}search(t,n,r,i,o){if(this._pos!==this._boxes.length)throw new Error("Data not yet indexed - call index.finish().");let s=this._boxes.length-4;const a=[],l=[];for(;s!==void 0;){const c=Math.min(s+this.nodeSize*4,Tc(s,this._levelBounds));for(let u=s;u<c;u+=4){if(r<this._boxes[u]||i<this._boxes[u+1]||t>this._boxes[u+2]||n>this._boxes[u+3])continue;const d=this._indices[u>>2]|0;s>=this.numItems*4?a.push(d):(o===void 0||o(d))&&(l.push(d),l.push(this._boxes[u]),l.push(this._boxes[u+1]))}s=a.pop()}return l}neighbors(t,n,r=1/0,i=1/0,o,s=W1){if(this._pos!==this._boxes.length)throw new Error("Data not yet indexed - call index.finish().");let a=this._boxes.length-4;const l=this._queue,c=[];e:for(;a!==void 0;){const u=Math.min(a+this.nodeSize*4,Tc(a,this._levelBounds));for(let d=a;d<u;d+=4){const h=this._indices[d>>2]|0,f=this._boxes[d],m=this._boxes[d+1],p=this._boxes[d+2],y=this._boxes[d+3],v=t<f?f-t:t>p?t-p:0,T=n<m?m-n:n>y?n-y:0,w=s(v,T);w>i||(a>=this.numItems*4?l.push(h<<1,w):(o===void 0||o(h))&&l.push((h<<1)+1,w))}for(;l.length&&l.peek()&1;)if(l.peekValue()>i||(c.push(l.pop()>>1),c.length===r))break e;a=l.length?l.pop()>>1:void 0}return l.clear(),c}}function W1(e,t){return e*e+t*t}function Tc(e,t){let n=0,r=t.length-1;for(;n<r;){const i=n+r>>1;t[i]>e?r=i:n=i+1}return t[n]}function Is(e,t,n,r,i,o){if(Math.floor(r/o)>=Math.floor(i/o))return;const s=e[r],a=e[r+i>>1],l=e[i];let c=l;const u=Math.max(s,a);l>u?c=u:u===s?c=Math.max(a,l):u===a&&(c=Math.max(s,l));let d=r-1,h=i+1;for(;;){do d++;while(e[d]<c);do h--;while(e[h]>c);if(d>=h)break;H1(e,t,n,d,h)}Is(e,t,n,r,h,o),Is(e,t,n,h+1,i,o)}function H1(e,t,n,r,i){const o=e[r];e[r]=e[i],e[i]=o;const s=4*r,a=4*i,l=t[s],c=t[s+1],u=t[s+2],d=t[s+3];t[s]=t[a],t[s+1]=t[a+1],t[s+2]=t[a+2],t[s+3]=t[a+3],t[a]=l,t[a+1]=c,t[a+2]=u,t[a+3]=d;const h=n[r];n[r]=n[i],n[i]=h}function Y1(e,t){let n=e^t,r=65535^n,i=65535^(e|t),o=e&(t^65535),s=n|r>>1,a=n>>1^n,l=i>>1^r&o>>1^i,c=n&i>>1^o>>1^o;n=s,r=a,i=l,o=c,s=n&n>>2^r&r>>2,a=n&r>>2^r&(n^r)>>2,l^=n&i>>2^r&o>>2,c^=r&i>>2^(n^r)&o>>2,n=s,r=a,i=l,o=c,s=n&n>>4^r&r>>4,a=n&r>>4^r&(n^r)>>4,l^=n&i>>4^r&o>>4,c^=r&i>>4^(n^r)&o>>4,n=s,r=a,i=l,o=c,l^=n&i>>8^r&o>>8,c^=r&i>>8^(n^r)&o>>8,n=l^l>>1,r=c^c>>1;let u=e^t,d=r|65535^(u|n);return u=(u|u<<8)&16711935,u=(u|u<<4)&252645135,u=(u|u<<2)&858993459,u=(u|u<<1)&1431655765,d=(d|d<<8)&16711935,d=(d|d<<4)&252645135,d=(d|d<<2)&858993459,d=(d|d<<1)&1431655765,(d<<1|u)>>>0}const q1=e=>{const t=new Map;return e.forEach(n=>{t.set(n.axisId,n)}),t},zd=e=>e.zoom,J1=X(It,jt,(e,t)=>(e==null?void 0:e.some(n=>!!n.zoom))||(t==null?void 0:t.some(n=>!!n.zoom))||!1);X(zd,e=>e==null?void 0:e.isInteracting);const Yt=Me(zd,function(t){return(t==null?void 0:t.zoomData)&&q1(t==null?void 0:t.zoomData)});X(Yt,(e,t)=>e==null?void 0:e.get(t));const yo=Me(It,jt,function(t,n){return G({},wc("x")(t),wc("y")(n))});X(yo,(e,t)=>e[t]);const K1=X(gt,function(t){return Md(t.width)}),X1=X(gt,function(t){return Md(t.height)}),Ma=Me(It,Le,Wt,oo,K1,function(t,n,r,i,o){const a={};return t==null||t.forEach((l,c)=>{var h,f;const u=l;if(qn(u)||Jn(u)){a[u.id]={domain:u.data},u.ordinalTimeTicks!==void 0&&(a[u.id].tickNumber=Ea(u,[(h=u.data)==null?void 0:h.find(m=>m!==null),(f=u.data)==null?void 0:f.findLast(m=>m!==null)],o));return}const d=go(u,"x",r,c,n);a[u.id]=Dd(u,"x",c,n,d,o,i)}),{axes:t,domains:a}}),Ra=Me(jt,Le,Wt,oo,X1,function(t,n,r,i,o){const a={};return t==null||t.forEach((l,c)=>{var h,f;const u=l;if(qn(u)||Jn(u)){a[u.id]={domain:u.data},u.ordinalTimeTicks!==void 0&&(a[u.id].tickNumber=Ea(u,[(h=u.data)==null?void 0:h.find(m=>m!==null),(f=u.data)==null?void 0:f.findLast(m=>m!==null)],o));return}const d=go(u,"y",r,c,n);a[u.id]=Dd(u,"y",c,n,d,o,i)}),{axes:t,domains:a}}),Fd=Me(Yt,yo,Ma,Ra,function(t,n,{axes:r,domains:i},{axes:o,domains:s}){if(!t||!n)return;let a=!1;const l={},c=[...r??[],...o??[]];for(let u=0;u<c.length;u+=1){const d=c[u];if(!n[d.id]||n[d.id].filterMode!=="discard")continue;const h=t.get(d.id);if(h===void 0||h.start<=0&&h.end>=100)continue;const f=u<((r==null?void 0:r.length)??0)?"x":"y";if(d.scaleType==="band"||d.scaleType==="point")l[d.id]=N1(d.data,h.start,h.end,f);else{const{domain:m}=f==="x"?i[d.id]:s[d.id];l[d.id]=z1(m,h.start,h.end,f,d.data)}a=!0}if(a)return F1(l)}),Z1=Me(Le,Wt,Yt,yo,Fd,oo,Ma,function(t,n,r,i,o,s,{axes:a,domains:l}){const c={};return a==null||a.forEach((u,d)=>{const h=l[u.id].domain;if(qn(u)||Jn(u)){c[u.id]=h;return}const f=r==null?void 0:r.get(u.id),m=i==null?void 0:i[u.id],p=f===void 0&&!m?o:void 0;if(!p){c[u.id]=h;return}const y=l[u.id].tickNumber,v=go(u,"x",n,d,t,p);c[u.id]=$d(u,"x",d,t,v,y,s)}),c}),Q1=Me(Le,Wt,Yt,yo,Fd,oo,Ra,function(t,n,r,i,o,s,{axes:a,domains:l}){const c={};return a==null||a.forEach((u,d)=>{const h=l[u.id].domain;if(qn(u)||Jn(u)){c[u.id]=h;return}const f=r==null?void 0:r.get(u.id),m=i==null?void 0:i[u.id],p=f===void 0&&!m?o:void 0;if(!p){c[u.id]=h;return}const y=l[u.id].tickNumber,v=go(u,"y",n,d,t,p);c[u.id]=$d(u,"y",d,t,v,y,s)}),c}),Bd=Me(It,Z1,function(t,n){const r={};return t==null||t.forEach(i=>{const o=i,s=n[o.id];r[o.id]=kd(o,s)}),r}),Gd=Me(jt,Q1,function(t,n){const r={};return t==null||t.forEach(i=>{const o=i,s=n[o.id];r[o.id]=kd(o,s)}),r}),eb=Me(It,Bd,gt,Yt,function(t,n,r,i){const o={};return t==null||t.forEach(s=>{const a=s,l=i==null?void 0:i.get(a.id),c=l?[l.start,l.end]:[0,100],u=jd(r,"x",a),d=n[a.id].copy(),h=Od(u,c);d.range(h),o[a.id]=d}),o}),tb=Me(jt,Gd,gt,Yt,function(t,n,r,i){const o={};return t==null||t.forEach(s=>{const a=s,l=i==null?void 0:i.get(a.id),c=l?[l.start,l.end]:[0,100],u=jd(r,"y",a),d=n[a.id].copy(),h=Ar(d)?u.reverse():u,f=Od(h,c);d.range(f),o[a.id]=d}),o}),qt=Me(gt,Le,Wt,Yt,Ma,eb,function(t,n,r,i,{axes:o,domains:s},a){return Id({scales:a,drawingArea:t,formattedSeries:n,axis:o,seriesConfig:r,axisDirection:"x",zoomMap:i,domains:s})}),Jt=Me(gt,Le,Wt,Yt,Ra,tb,function(t,n,r,i,{axes:o,domains:s},a){return Id({scales:a,drawingArea:t,formattedSeries:n,axis:o,seriesConfig:r,axisDirection:"y",zoomMap:i,domains:s})});X(qt,Jt,(e,t,n)=>(e==null?void 0:e.axis[n])??(t==null?void 0:t.axis[n]));X(It,jt,(e,t,n)=>{const r=(e==null?void 0:e.find(i=>i.id===n))??(t==null?void 0:t.find(i=>i.id===n))??null;if(r)return r});const nb=X(It,e=>e[0].id),rb=X(jt,e=>e[0].id);Me(Le,Bd,Gd,nb,rb,function(t,n,r,i,o){const s=t.scatter,a=new Map;return s&&s.seriesOrder.forEach(l=>{const{data:c,xAxisId:u=i,yAxisId:d=o}=s.series[l],h=new _a(c.length),f=n[u],m=r[d];for(const p of c)h.add(f(p.x),m(p.y));h.finish(),a.set(l,h)}),a});function In(e){return e instanceof Date?e.getTime():e}function Un(e,t){const{scale:n,data:r,reverse:i}=e;if(!Ar(n)){const s=n.invert(t);if(r===void 0)return-1;const a=In(s);return r==null?void 0:r.findIndex((c,u)=>{const d=In(c);return d>a&&(u===0||Math.abs(a-d)<=Math.abs(a-In(r[u-1])))||d<=a&&(u===r.length-1||Math.abs(In(s)-d)<Math.abs(In(s)-In(r[u+1])))})}const o=n.bandwidth()===0?Math.floor((t-Math.min(...n.range())+n.step()/2)/n.step()):Math.floor((t-Math.min(...n.range()))/n.step());return o<0||o>=r.length?-1:i?r.length-1-o:o}function Cc(e,t,n,r){if(!Ar(e)){if(r===null){const i=e.invert(n);return Number.isNaN(i)?null:i}return t[r]}return r===null||r<0||r>=t.length?null:t[r]}function _c(e,t){const n=e.createSVGPoint();return n.x=t.clientX,n.y=t.clientY,n.matrixTransform(e.getScreenCTM().inverse())}const Aa=({store:e})=>{const t=rt(function(){e.update({interaction:G({},e.state.interaction,{pointer:null})})}),n=rt(function(o){e.state.interaction.lastUpdate!==o&&e.set("interaction",G({},e.state.interaction,{lastUpdate:o}))}),r=rt(function(o){e.set("interaction",G({},e.state.interaction,{pointer:o,lastUpdate:o!==null?"pointer":e.state.interaction.lastUpdate}))});return{instance:{cleanInteraction:t,setLastUpdateSource:n,setPointerCoordinate:r}}};Aa.getInitialState=()=>({interaction:{item:null,pointer:null,lastUpdate:"pointer"}});Aa.params={};const Ia=e=>e.interaction,ib=X(Ia,e=>e!==void 0),Vd=X(Ia,e=>(e==null?void 0:e.pointer)??null),xo=X(Vd,e=>e&&e.x),bo=X(Vd,e=>e&&e.y);X(Ia,e=>e==null?void 0:e.lastUpdate);function cr(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)){const i=e.length;if(i!==t.length)return!1;for(let o=0;o<i;o+=1)if(!cr(e[o],t[o]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;const i=Array.from(e.entries());for(let o=0;o<i.length;o+=1)if(!t.has(i[o][0]))return!1;for(let o=0;o<i.length;o+=1){const s=i[o];if(!cr(s[1],t.get(s[0])))return!1}return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;const i=Array.from(e.entries());for(let o=0;o<i.length;o+=1)if(!t.has(i[o][0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){const i=e.length;if(i!==t.length)return!1;for(let o=0;o<i;o+=1)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const n=Object.keys(e),r=n.length;if(r!==Object.keys(t).length)return!1;for(let i=0;i<r;i+=1)if(!Object.prototype.hasOwnProperty.call(t,n[i]))return!1;for(let i=0;i<r;i+=1){const o=n[i];if(!cr(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function js(e,t,n=t.axisIds[0]){return Array.isArray(n)?n.map(r=>Un(t.axis[r],e)):Un(t.axis[n],e)}const Ud=(e,t,n)=>{if(e===null)return null;const r=js(e,t,n);return r===-1?null:r},ob=X(xo,qt,Ud),sb=X(bo,Jt,Ud),ab=X(xo,bo,qt,Jt,(e,t,n,r)=>[...e===null?[]:n.axisIds.map(i=>({axisId:i,dataIndex:js(e,n,i)})),...t===null?[]:r.axisIds.map(i=>({axisId:i,dataIndex:js(t,r,i)}))].filter(i=>i.dataIndex!==null&&i.dataIndex>=0));function Wd(e,t,n,r=t.axisIds[0]){return Array.isArray(r)?r.map((i,o)=>{const s=t.axis[i];return Cc(s.scale,s.data,e,n[o])}):Cc(t.axis[r].scale,t.axis[r].data,e,n)}X(xo,qt,ob,(e,t,n,r)=>e===null||t.axisIds.length===0?null:Wd(e,t,n,r));X(bo,Jt,sb,(e,t,n,r)=>e===null||t.axisIds.length===0?null:Wd(e,t,n,r));const Hd=[],lb=qs({memoizeOptions:{resultEqualityCheck:cr}})(xo,qt,(e,t)=>e===null?Hd:t.axisIds.filter(n=>t.axis[n].triggerTooltip).map(n=>({axisId:n,dataIndex:Un(t.axis[n],e)})).filter(({dataIndex:n})=>n>=0)),cb=qs({memoizeOptions:{resultEqualityCheck:cr}})(bo,Jt,(e,t)=>e===null?Hd:t.axisIds.filter(n=>t.axis[n].triggerTooltip).map(n=>({axisId:n,dataIndex:Un(t.axis[n],e)})).filter(({dataIndex:n})=>n>=0));X(lb,cb,(e,t)=>e.length>0||t.length>0);function ub(e){return e.setPointerCoordinate!==void 0}const db=new Set(["bar","rangeBar","line"]),vo=({params:e,store:t,seriesConfig:n,svgRef:r,instance:i})=>{const{xAxis:o,yAxis:s,dataset:a,onHighlightedAxisChange:l}=e;if(process.env.NODE_ENV!=="production"){const E=[...o??[],...s??[]].filter(S=>S.id).map(S=>S.id),R=new Set(E.filter((S,C)=>E.indexOf(S)!==C));R.size>0&&Fn([`MUI X Charts: The following axis ids are duplicated: ${Array.from(R).join(", ")}.`,"Please make sure that each axis has a unique id."].join(`
|
|
113
|
+
`),"error")}const c=t.use(gt),u=t.use(Le),d=t.use(ib),{axis:h,axisIds:f}=t.use(qt),{axis:m,axisIds:p}=t.use(Jt);td({warningPrefix:"MUI X Charts",componentName:"Chart",propName:"highlightedAxis",controlled:e.highlightedAxis,defaultValue:void 0}),pt(()=>{e.highlightedAxis!==void 0&&t.set("controlledCartesianAxisHighlight",e.highlightedAxis)},[t,e.highlightedAxis]);const y=j.useRef(!0);j.useEffect(()=>{if(y.current){y.current=!1;return}t.set("cartesianAxis",{x:id(o,a),y:od(s,a)})},[n,c,o,s,a,t]);const v=f[0],T=p[0];Xg(t,ab,(E,R)=>{if(l&&!Object.is(E,R)){if(E.length!==R.length){l(R);return}E!=null&&E.some(({axisId:S,dataIndex:C},I)=>R[I].axisId!==S||R[I].dataIndex!==C)&&l(R)}});const w=ub(i);return j.useEffect(()=>{const E=r.current;if(!d||!w||!E||e.disableAxisListener)return()=>{};const R=i.addInteractionListener("moveEnd",g=>{g.detail.activeGestures.pan||i.cleanInteraction()}),S=i.addInteractionListener("panEnd",g=>{g.detail.activeGestures.move||i.cleanInteraction()}),C=i.addInteractionListener("quickPressEnd",g=>{!g.detail.activeGestures.move&&!g.detail.activeGestures.pan&&i.cleanInteraction()}),I=g=>{var N;const A=g.detail.srcEvent,_=g.detail.target,z=_c(E,A);if(g.detail.srcEvent.buttons>=1&&(_!=null&&_.hasPointerCapture(g.detail.srcEvent.pointerId))&&!(_!=null&&_.closest("[data-charts-zoom-slider]"))&&(_==null||_.releasePointerCapture(g.detail.srcEvent.pointerId)),!i.isPointInside(z.x,z.y,_)){(N=i.cleanInteraction)==null||N.call(i);return}i.setPointerCoordinate(z)},k=i.addInteractionListener("move",I),P=i.addInteractionListener("pan",I),D=i.addInteractionListener("quickPress",I);return()=>{k.cleanup(),R.cleanup(),P.cleanup(),S.cleanup(),D.cleanup(),C.cleanup()}},[r,t,h,v,m,T,i,e.disableAxisListener,d,w]),j.useEffect(()=>{const E=r.current,R=e.onAxisClick;if(E===null||!R)return()=>{};const S=i.addInteractionListener("tap",C=>{let I=null,k=!1;const P=_c(E,C.detail.srcEvent),D=Un(h[v],P.x);k=D!==-1,I=k?D:Un(m[T],P.y);const g=k?f[0]:p[0];if(I==null||I===-1)return;const A=(k?h:m)[g].data[I],_={};Object.keys(u).filter(z=>db.has(z)).forEach(z=>{const N=u[z];N==null||N.seriesOrder.forEach(W=>{const B=N.series[W],Z=B.xAxisId,Q=B.yAxisId,ee=k?Z:Q;(ee===void 0||ee===g)&&(_[W]=B.data[I])})}),R(C.detail.srcEvent,{dataIndex:I,axisValue:A,seriesValues:_})});return()=>{S.cleanup()}},[e.onAxisClick,u,r,h,f,m,p,v,T,i]),{}};vo.params={xAxis:!0,yAxis:!0,dataset:!0,onAxisClick:!0,disableAxisListener:!0,onHighlightedAxisChange:!0,highlightedAxis:!0};vo.getDefaultizedParams=({params:e})=>G({},e,{colors:e.colors??Zu,theme:e.theme??"light",defaultizedXAxis:id(e.xAxis,e.dataset),defaultizedYAxis:od(e.yAxis,e.dataset)});vo.getInitialState=e=>G({cartesianAxis:{x:e.defaultizedXAxis,y:e.defaultizedYAxis}},e.highlightedAxis===void 0?{}:{controlledCartesianAxisHighlight:e.highlightedAxis});const hb=Object.is;function ji(e,t){if(e===t)return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=0,r=0;for(const i in e)if(n+=1,!hb(e[i],t[i])||!(i in t))return!1;for(const i in t)r+=1;return n===r}const Ir=e=>e.keyboardNavigation;X(Ir,(e,t)=>(e==null?void 0:e.item)!=null&&ji(e.item,t));const fb=X(Ir,e=>(e==null?void 0:e.item)!=null),Yd=X(Ir,e=>(e==null?void 0:e.item)??null),pb=X(Ir,e=>!!(e!=null&&e.enableKeyboardNavigation)),qd=e=>(t,n,r)=>{var s;if(t==null||!("dataIndex"in t)||t.dataIndex===void 0)return;const i=(s=r[t.type])==null?void 0:s.series[t.seriesId];if(!i)return;let o=e==="x"?"xAxisId"in i&&i.xAxisId:"yAxisId"in i&&i.yAxisId;return(o===void 0||o===!1)&&(o=n.axisIds[0]),{axisId:o,dataIndex:t.dataIndex}};X(Yd,qt,Le,qd("x"));X(Yd,Jt,Le,qd("y"));X(Ir,function(t){if((t==null?void 0:t.item)==null)return null;const{type:n,seriesId:r}=t.item;return n===void 0||r===void 0?null:t.item});const ja=({store:e})=>{const t=rt(function(i){const o=e.state.tooltip.item;if(!i){o!==null&&e.set("tooltip",{item:null});return}o===null||!ji(o,i)||e.set("tooltip",{item:null})});return{instance:{setTooltipItem:rt(function(i){ji(e.state.tooltip.item,i)||e.set("tooltip",{item:i})}),removeTooltipItem:t}}};ja.getInitialState=()=>({tooltip:{item:null}});ja.params={};const $n=(e,t)=>e===void 0?t:Math.PI*e/180;function Mc(e,t){return e.id!==void 0?e:G({id:t},e)}function Rc(e){return e.colorMap?G({},e,{colorScale:e.colorMap.type==="ordinal"&&e.data?Ii(G({values:e.data},e.colorMap)):As(e.colorMap.type==="continuous"?G({min:e.min,max:e.max},e.colorMap):e.colorMap)}):e}function Jd(e,t){if(!e||e.length===0)return{axis:{},axisIds:[]};const n={},r=[];return e.forEach((i,o)=>{const s=i.dataKey,a=i.id??`defaultized-z-axis-${o}`;if(s===void 0||i.data!==void 0){n[a]=Rc(Mc(i,a)),r.push(a);return}if(t===void 0)throw new Error("MUI X Charts: z-axis uses `dataKey` but no `dataset` is provided.");n[a]=Rc(Mc(G({},i,{data:t.map(l=>l[s])}),a)),r.push(a)}),{axis:n,axisIds:r}}const ka=({params:e,store:t})=>{const{zAxis:n,dataset:r}=e,i=j.useRef(!0);return j.useEffect(()=>{if(i.current){i.current=!1;return}t.set("zAxis",Jd(n,r))},[n,r,t]),{}};ka.params={zAxis:!0,dataset:!0};ka.getInitialState=e=>({zAxis:Jd(e.zAxis,e.dataset)});const mb=e=>e,gb=X(mb,e=>e.zAxis),Oa=({store:e,params:t})=>{td({warningPrefix:"MUI X Charts",componentName:"Chart",propName:"highlightedItem",controlled:t.highlightedItem,defaultValue:null}),pt(()=>{e.state.highlight.item!==t.highlightedItem&&e.set("highlight",G({},e.state.highlight,{item:t.highlightedItem})),process.env.NODE_ENV!=="production"&&t.highlightedItem!==void 0&&!e.state.highlight.isControlled&&Fn(["MUI X Charts: The `highlightedItem` switched between controlled and uncontrolled state.","To remove the highlight when using controlled state, you must provide `null` to the `highlightedItem` prop instead of `undefined`."].join(`
|
|
114
|
+
`))},[e,t.highlightedItem]);const n=rt(()=>{var o;(o=t.onHighlightChange)==null||o.call(t,null);const i=e.state.highlight;i.item===null||i.isControlled||e.set("highlight",{item:null,lastUpdate:"pointer",isControlled:!1})}),r=rt(i=>{var s;const o=e.state.highlight;ji(o.item,i)||((s=t.onHighlightChange)==null||s.call(t,i),!o.isControlled&&e.set("highlight",{item:i,lastUpdate:"pointer",isControlled:!1}))});return{instance:{clearHighlight:n,setHighlight:r}}};Oa.getInitialState=e=>({highlight:{item:e.highlightedItem,lastUpdate:"pointer",isControlled:e.highlightedItem!==void 0}});Oa.params={highlightedItem:!0,onHighlightChange:!0};function ki(e){let t=1/0,n=-1/0;for(const r of e??[])r<t&&(t=r),r>n&&(n=r);return[t,n]}const Ac=(e,t)=>t==="x"?{x:e,y:null}:{x:null,y:e},Kd=e=>{var s;const{axis:t,getFilters:n,isDefaultAxis:r}=e,i=n==null?void 0:n({currentAxisId:t.id,isDefaultAxis:r}),o=i?(s=t.data)==null?void 0:s.filter((a,l)=>i({x:null,y:null},l)):t.data;return ki(o??[])},Xd=e=>t=>{const{series:n,axis:r,getFilters:i,isDefaultAxis:o}=t;return Object.keys(n).filter(s=>{const a=e==="x"?n[s].xAxisId:n[s].yAxisId;return a===r.id||o&&a===void 0}).reduce((s,a)=>{const{stackedData:l}=n[a],c=i==null?void 0:i({currentAxisId:r.id,isDefaultAxis:o,seriesXAxisId:n[a].xAxisId,seriesYAxisId:n[a].yAxisId}),[u,d]=(l==null?void 0:l.reduce((h,f,m)=>c&&(!c(Ac(f[0],e),m)||!c(Ac(f[1],e),m))?h:[Math.min(...f,h[0]),Math.max(...f,h[1])],[1/0,-1/0]))??[1/0,-1/0];return[Math.min(u,s[0]),Math.max(d,s[1])]},[1/0,-1/0])},yb=e=>Object.keys(e.series).some(n=>e.series[n].layout==="horizontal")?Xd("x")(e):Kd(e),xb=e=>Object.keys(e.series).some(n=>e.series[n].layout==="horizontal")?Kd(e):Xd("y")(e);function we(e){return function(){return e}}const Ic=Math.abs,ke=Math.atan2,Qt=Math.cos,bb=Math.max,is=Math.min,at=Math.sin,On=Math.sqrt,Fe=1e-12,xr=Math.PI,Oi=xr/2,hi=2*xr;function vb(e){return e>1?0:e<-1?xr:Math.acos(e)}function jc(e){return e>=1?Oi:e<=-1?-Oi:Math.asin(e)}const ks=Math.PI,Os=2*ks,en=1e-6,Sb=Os-en;function Zd(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function wb(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Zd;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class Eb{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Zd:wb(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,s){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+s}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let s=this._x1,a=this._y1,l=r-t,c=i-n,u=s-t,d=a-n,h=u*u+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>en)if(!(Math.abs(d*l-c*u)>en)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let f=r-s,m=i-a,p=l*l+c*c,y=f*f+m*m,v=Math.sqrt(p),T=Math.sqrt(h),w=o*Math.tan((ks-Math.acos((p+h-y)/(2*v*T)))/2),E=w/T,R=w/v;Math.abs(E-1)>en&&this._append`L${t+E*u},${n+E*d}`,this._append`A${o},${o},0,0,${+(d*f>u*m)},${this._x1=t+R*l},${this._y1=n+R*c}`}}arc(t,n,r,i,o,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),l=r*Math.sin(i),c=t+a,u=n+l,d=1^s,h=s?i-o:o-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>en||Math.abs(this._y1-u)>en)&&this._append`L${c},${u}`,r&&(h<0&&(h=h%Os+Os),h>Sb?this._append`A${r},${r},0,1,${d},${t-a},${n-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=u}`:h>en&&this._append`A${r},${r},0,${+(h>=ks)},${d},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function Tb(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Eb(t)}function Cb(e){return e.innerRadius}function _b(e){return e.outerRadius}function Mb(e){return e.startAngle}function Rb(e){return e.endAngle}function Ab(e){return e&&e.padAngle}function Ib(e,t,n,r,i,o,s,a){var l=n-e,c=r-t,u=s-i,d=a-o,h=d*l-u*c;if(!(h*h<Fe))return h=(u*(t-o)-d*(e-i))/h,[e+h*l,t+h*c]}function Xr(e,t,n,r,i,o,s){var a=e-n,l=t-r,c=(s?o:-o)/On(a*a+l*l),u=c*l,d=-c*a,h=e+u,f=t+d,m=n+u,p=r+d,y=(h+m)/2,v=(f+p)/2,T=m-h,w=p-f,E=T*T+w*w,R=i-o,S=h*p-m*f,C=(w<0?-1:1)*On(bb(0,R*R*E-S*S)),I=(S*w-T*C)/E,k=(-S*T-w*C)/E,P=(S*w+T*C)/E,D=(-S*T+w*C)/E,g=I-y,A=k-v,_=P-y,z=D-v;return g*g+A*A>_*_+z*z&&(I=P,k=D),{cx:I,cy:k,x01:-u,y01:-d,x11:I*(i/R-1),y11:k*(i/R-1)}}function Qd(){var e=Cb,t=_b,n=we(0),r=null,i=Mb,o=Rb,s=Ab,a=null,l=Tb(c);function c(){var u,d,h=+e.apply(this,arguments),f=+t.apply(this,arguments),m=i.apply(this,arguments)-Oi,p=o.apply(this,arguments)-Oi,y=Ic(p-m),v=p>m;if(a||(a=u=l()),f<h&&(d=f,f=h,h=d),!(f>Fe))a.moveTo(0,0);else if(y>hi-Fe)a.moveTo(f*Qt(m),f*at(m)),a.arc(0,0,f,m,p,!v),h>Fe&&(a.moveTo(h*Qt(p),h*at(p)),a.arc(0,0,h,p,m,v));else{var T=m,w=p,E=m,R=p,S=y,C=y,I=s.apply(this,arguments)/2,k=I>Fe&&(r?+r.apply(this,arguments):On(h*h+f*f)),P=is(Ic(f-h)/2,+n.apply(this,arguments)),D=P,g=P,A,_;if(k>Fe){var z=jc(k/h*at(I)),N=jc(k/f*at(I));(S-=z*2)>Fe?(z*=v?1:-1,E+=z,R-=z):(S=0,E=R=(m+p)/2),(C-=N*2)>Fe?(N*=v?1:-1,T+=N,w-=N):(C=0,T=w=(m+p)/2)}var W=f*Qt(T),B=f*at(T),Z=h*Qt(R),Q=h*at(R);if(P>Fe){var ee=f*Qt(w),Ne=f*at(w),xt=h*Qt(E),bt=h*at(E),je;if(y<xr)if(je=Ib(W,B,xt,bt,ee,Ne,Z,Q)){var vt=W-je[0],ot=B-je[1],Ge=ee-je[0],V=Ne-je[1],q=1/at(vb((vt*Ge+ot*V)/(On(vt*vt+ot*ot)*On(Ge*Ge+V*V)))/2),K=On(je[0]*je[0]+je[1]*je[1]);D=is(P,(h-K)/(q-1)),g=is(P,(f-K)/(q+1))}else D=g=0}C>Fe?g>Fe?(A=Xr(xt,bt,W,B,f,g,v),_=Xr(ee,Ne,Z,Q,f,g,v),a.moveTo(A.cx+A.x01,A.cy+A.y01),g<P?a.arc(A.cx,A.cy,g,ke(A.y01,A.x01),ke(_.y01,_.x01),!v):(a.arc(A.cx,A.cy,g,ke(A.y01,A.x01),ke(A.y11,A.x11),!v),a.arc(0,0,f,ke(A.cy+A.y11,A.cx+A.x11),ke(_.cy+_.y11,_.cx+_.x11),!v),a.arc(_.cx,_.cy,g,ke(_.y11,_.x11),ke(_.y01,_.x01),!v))):(a.moveTo(W,B),a.arc(0,0,f,T,w,!v)):a.moveTo(W,B),!(h>Fe)||!(S>Fe)?a.lineTo(Z,Q):D>Fe?(A=Xr(Z,Q,ee,Ne,h,-D,v),_=Xr(W,B,xt,bt,h,-D,v),a.lineTo(A.cx+A.x01,A.cy+A.y01),D<P?a.arc(A.cx,A.cy,D,ke(A.y01,A.x01),ke(_.y01,_.x01),!v):(a.arc(A.cx,A.cy,D,ke(A.y01,A.x01),ke(A.y11,A.x11),!v),a.arc(0,0,h,ke(A.cy+A.y11,A.cx+A.x11),ke(_.cy+_.y11,_.cx+_.x11),v),a.arc(_.cx,_.cy,D,ke(_.y11,_.x11),ke(_.y01,_.x01),!v))):a.arc(0,0,h,R,E,v)}if(a.closePath(),u)return a=null,u+""||null}return c.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,d=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-xr/2;return[Qt(d)*u,at(d)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:we(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:we(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:we(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:we(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:we(+u),c):i},c.endAngle=function(u){return arguments.length?(o=typeof u=="function"?u:we(+u),c):o},c.padAngle=function(u){return arguments.length?(s=typeof u=="function"?u:we(+u),c):s},c.context=function(u){return arguments.length?(a=u??null,c):a},c}function eh(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function jb(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function kb(e){return e}function Ob(){var e=kb,t=jb,n=null,r=we(0),i=we(hi),o=we(0);function s(a){var l,c=(a=eh(a)).length,u,d,h=0,f=new Array(c),m=new Array(c),p=+r.apply(this,arguments),y=Math.min(hi,Math.max(-hi,i.apply(this,arguments)-p)),v,T=Math.min(Math.abs(y)/c,o.apply(this,arguments)),w=T*(y<0?-1:1),E;for(l=0;l<c;++l)(E=m[f[l]=l]=+e(a[l],l,a))>0&&(h+=E);for(t!=null?f.sort(function(R,S){return t(m[R],m[S])}):n!=null&&f.sort(function(R,S){return n(a[R],a[S])}),l=0,d=h?(y-c*w)/h:0;l<c;++l,p=v)u=f[l],E=m[u],v=p+(E>0?E*d:0)+w,m[u]={data:a[u],index:l,value:E,startAngle:p,endAngle:v,padAngle:T};return m}return s.value=function(a){return arguments.length?(e=typeof a=="function"?a:we(+a),s):e},s.sortValues=function(a){return arguments.length?(t=a,n=null,s):t},s.sort=function(a){return arguments.length?(n=a,t=null,s):n},s.startAngle=function(a){return arguments.length?(r=typeof a=="function"?a:we(+a),s):r},s.endAngle=function(a){return arguments.length?(i=typeof a=="function"?a:we(+a),s):i},s.padAngle=function(a){return arguments.length?(o=typeof a=="function"?a:we(+a),s):o},s}function Wn(e,t){if((s=e.length)>1)for(var n=1,r,i,o=e[t[0]],s,a=o.length;n<s;++n)for(i=o,o=e[t[n]],r=0;r<a;++r)o[r][1]+=o[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Hn(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Pb(e,t){return e[t]}function Db(e){const t=[];return t.key=e,t}function th(){var e=we([]),t=Hn,n=Wn,r=Pb;function i(o){var s=Array.from(e.apply(this,arguments),Db),a,l=s.length,c=-1,u;for(const d of o)for(a=0,++c;a<l;++a)(s[a][c]=[0,+r(d,s[a].key,c,o)]).data=d;for(a=0,u=eh(t(s));a<l;++a)s[u[a]].index=a;return n(s,u),s}return i.keys=function(o){return arguments.length?(e=typeof o=="function"?o:we(Array.from(o)),i):e},i.value=function(o){return arguments.length?(r=typeof o=="function"?o:we(+o),i):r},i.order=function(o){return arguments.length?(t=o==null?Hn:typeof o=="function"?o:we(Array.from(o)),i):t},i.offset=function(o){return arguments.length?(n=o??Wn,i):n},i}function $b(e,t){if((r=e.length)>0){for(var n,r,i=0,o=e[0].length,s;i<o;++i){for(s=n=0;n<r;++n)s+=e[n][i][1]||0;if(s)for(n=0;n<r;++n)e[n][i][1]/=s}Wn(e,t)}}function Lb(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,o=r.length;n<o;++n){for(var s=0,a=0;s<i;++s)a+=e[s][n][1]||0;r[n][1]+=r[n][0]=-a/2}Wn(e,t)}}function Nb(e,t){if(!(!((s=e.length)>0)||!((o=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,o,s;r<o;++r){for(var a=0,l=0,c=0;a<s;++a){for(var u=e[t[a]],d=u[r][1]||0,h=u[r-1][1]||0,f=(d-h)/2,m=0;m<a;++m){var p=e[t[m]],y=p[r][1]||0,v=p[r-1][1]||0;f+=y-v}l+=d,c+=f*d}i[r-1][1]+=i[r-1][0]=n,l&&(n-=c/l)}i[r-1][1]+=i[r-1][0]=n,Wn(e,t)}}function nh(e){var t=e.map(zb);return Hn(e).sort(function(n,r){return t[n]-t[r]})}function zb(e){for(var t=-1,n=0,r=e.length,i,o=-1/0;++t<r;)(i=+e[t][1])>o&&(o=i,n=t);return n}function rh(e){var t=e.map(ih);return Hn(e).sort(function(n,r){return t[n]-t[r]})}function ih(e){for(var t=0,n=-1,r=e.length,i;++n<r;)(i=+e[n][1])&&(t+=i);return t}function Fb(e){return rh(e).reverse()}function Bb(e){var t=e.length,n,r,i=e.map(ih),o=nh(e),s=0,a=0,l=[],c=[];for(n=0;n<t;++n)r=o[n],s<a?(s+=i[r],l.push(r)):(a+=i[r],c.push(r));return c.reverse().concat(l)}function Gb(e){return Hn(e).reverse()}function Vb(e,t){if(e.length===0)return;const n=e.length,r=t,i=e[r[0]].length;for(let o=0;o<i;o+=1){let s=0,a=0;for(let l=0;l<n;l+=1){const c=e[r[l]],u=c[o],d=u[1]-u[0];d>0?(u[0]=s,s+=d,u[1]=s):d<0?(u[1]=a,a+=d,u[0]=a):u.data[c.key]>0?(u[0]=s,u[1]=s):u.data[c.key]<0?(u[1]=a,u[0]=a):(u[0]=0,u[1]=0)}}}const os={appearance:nh,ascending:rh,descending:Fb,insideOut:Bb,none:Hn,reverse:Gb},ss={expand:$b,diverging:Vb,none:Wn,silhouette:Lb,wiggle:Nb},oh=e=>{const{series:t,seriesOrder:n,defaultStrategy:r}=e,i=[],o={};return n.forEach(s=>{const{stack:a,stackOrder:l,stackOffset:c}=t[s];a===void 0?i.push({ids:[s],stackingOrder:os.none,stackingOffset:ss.none}):o[a]===void 0?(o[a]=i.length,i.push({ids:[s],stackingOrder:os[l??(r==null?void 0:r.stackOrder)??"none"],stackingOffset:ss[c??(r==null?void 0:r.stackOffset)??"diverging"]})):(i[o[a]].ids.push(s),l!==void 0&&(i[o[a]].stackingOrder=os[l]),c!==void 0&&(i[o[a]].stackingOffset=ss[c]))}),i},Ub=e=>e==null?"":e.toLocaleString(),Wb=(e,t)=>{const{seriesOrder:n,series:r}=e,i=oh(e),o=t??[];n.forEach(a=>{const l=r[a].data;if(l!==void 0)l.forEach((c,u)=>{o.length<=u?o.push({[a]:c}):o[u][a]=c});else if(t===void 0)throw new Error([`MUI X Charts: bar series with id='${a}' has no data.`,"Either provide a data property to the series or use the dataset prop."].join(`
|
|
115
|
+
`));if(process.env.NODE_ENV!=="production"&&!l&&t){const c=r[a].dataKey;if(!c)throw new Error([`MUI X Charts: bar series with id='${a}' has no data and no dataKey.`,"You must provide a dataKey when using the dataset prop."].join(`
|
|
116
|
+
`));t.forEach((u,d)=>{const h=u[c];h!=null&&typeof h!="number"&&Fn([`MUI X Charts: your dataset key "${c}" is used for plotting bars, but the dataset contains the non-null non-numerical element "${h}" at index ${d}.`,"Bar plots only support numeric and null values."].join(`
|
|
117
|
+
`))})}});const s={};return i.forEach(a=>{const{ids:l,stackingOffset:c,stackingOrder:u}=a,d=th().keys(l.map(h=>{const f=r[h].dataKey;return r[h].data===void 0&&f!==void 0?f:h})).value((h,f)=>h[f]??0).order(u).offset(c)(o);l.forEach((h,f)=>{const m=r[h].dataKey;s[h]=G({layout:"vertical",labelMarkType:"square",minBarSize:0,valueFormatter:r[h].valueFormatter??Ub},r[h],{data:m?t.map(p=>{const y=p[m];return typeof y=="number"?y:null}):r[h].data,stackedData:d[f].map(([p,y])=>[p,y])})})}),{seriesOrder:n,stackingGroups:i,series:s}};function kt(e,t){return typeof e=="function"?e(t):e}const Hb=e=>{const{seriesOrder:t,series:n}=e;return t.reduce((r,i)=>{const o=kt(n[i].label,"legend");return o===void 0||r.push({type:"bar",markType:n[i].labelMarkType,id:i,seriesId:i,color:n[i].color,label:o}),r},[])};function Pa(e){return e.colorGetter?e.colorGetter:()=>e.color}const Yb=(e,t,n)=>{const r=e.layout==="vertical",i=r?t==null?void 0:t.colorScale:n==null?void 0:n.colorScale,o=r?n==null?void 0:n.colorScale:t==null?void 0:t.colorScale,s=r?t==null?void 0:t.data:n==null?void 0:n.data,a=Pa(e);return o?l=>{if(l===void 0)return e.color;const c=e.data[l],u=c===null?a({value:c,dataIndex:l}):o(c);return u===null?a({value:c,dataIndex:l}):u}:i&&s?l=>{if(l===void 0)return e.color;const c=s[l],u=c===null?a({value:c,dataIndex:l}):i(c);return u===null?a({value:c,dataIndex:l}):u}:l=>{if(l===void 0)return e.color;const c=e.data[l];return a({value:c,dataIndex:l})}};function sh(e,t){return Object.keys(e).filter(n=>t.has(n)).flatMap(n=>{const r=e[n];return r.seriesOrder.filter(i=>r.series[i].data.length>0&&r.series[i].data.some(o=>o!=null)).map(i=>({type:n,seriesId:i}))})}function ah(e,t,n,r){const i=sh(e,t);if(i.length===0)return null;const o=n!==void 0&&r!==void 0?i.findIndex(s=>s.type===n&&s.seriesId===r):-1;return o<=0?i[i.length-1]:i[(o-1+i.length)%i.length]}function lh(e,t){return Object.keys(e).filter(n=>t.has(n)).flatMap(n=>{const r=e[n];return r.seriesOrder.filter(i=>r.series[i].data.length>0&&r.series[i].data.some(o=>o!=null)).map(i=>r.series[i].data.length)}).reduce((n,r)=>Math.max(n,r),0)}function ch(e,t,n,r){const i=sh(e,t);if(i.length===0)return null;const o=n!==void 0&&r!==void 0?i.findIndex(s=>s.type===n&&s.seriesId===r):-1;return i[(o+1)%i.length]}function uh(e,t,n){var i,o;if(t==="sankey")return!1;const r=(o=(i=e[t])==null?void 0:i.series[n])==null?void 0:o.data;return r!=null&&r.length>0}function So(e){return function(n,r){const i=Le(r);let o=n==null?void 0:n.seriesId,s=n==null?void 0:n.type;if(!s||o==null||!uh(i,s,o)){const c=ch(i,e,s,o);if(c===null)return null;s=c.type,o=c.seriesId}const a=lh(i,e),l=Math.min(a-1,(n==null?void 0:n.dataIndex)==null?0:n.dataIndex+1);return{type:s,seriesId:o,dataIndex:l}}}function wo(e){return function(n,r){const i=Le(r);let o=n==null?void 0:n.seriesId,s=n==null?void 0:n.type;if(!s||o==null||!uh(i,s,o)){const c=ah(i,e,s,o);if(c===null)return null;s=c.type,o=c.seriesId}const a=lh(i,e),l=Math.max(0,(n==null?void 0:n.dataIndex)==null?a-1:n.dataIndex-1);return{type:s,seriesId:o,dataIndex:l}}}function Eo(e){return function(n,r){const i=Le(r);let o=n==null?void 0:n.seriesId,s=n==null?void 0:n.type;const a=ch(i,e,s,o);if(a===null)return null;s=a.type,o=a.seriesId;const l=(n==null?void 0:n.dataIndex)==null?0:n.dataIndex;return{type:s,seriesId:o,dataIndex:l}}}function To(e){return function(n,r){const i=Le(r);let o=n==null?void 0:n.seriesId,s=n==null?void 0:n.type;const a=ah(i,e,s,o);if(a===null)return null;s=a.type,o=a.seriesId;const l=i[s].series[o].data,c=(n==null?void 0:n.dataIndex)==null?l.length-1:n.dataIndex;return{type:s,seriesId:o,dataIndex:c}}}const Zr=new Set(["bar","line","scatter"]),qb=e=>{switch(e.key){case"ArrowRight":return So(Zr);case"ArrowLeft":return wo(Zr);case"ArrowDown":return To(Zr);case"ArrowUp":return Eo(Zr);default:return null}},Jb=e=>{const{series:t,getColor:n,identifier:r}=e;if(!r||r.dataIndex===void 0)return null;const i=kt(t.label,"tooltip"),o=t.data[r.dataIndex];if(o==null)return null;const s=t.valueFormatter(o,{dataIndex:r.dataIndex});return{identifier:r,color:n(r.dataIndex),label:i,value:o,formattedValue:s,markType:t.labelMarkType}},Kb=e=>Object.values(e).map(t=>t.layout==="horizontal"?{direction:"y",axisId:t.yAxisId}:{direction:"x",axisId:t.xAxisId});function Xb(e,t,n){if(n===0)return{barWidth:e/t,offset:0};const r=e/(t+(t-1)*n),i=n*r;return{barWidth:r,offset:i}}function Zb(e,t,n){const r=e&&t>0,i=!e&&t<0,o=r||i;return n?!o:o}function Qb(e){const{verticalLayout:t,xAxisConfig:n,yAxisConfig:r,series:i,dataIndex:o,numberOfGroups:s,groupIndex:a}=e,l=t?n:r,c=(t?r.reverse:n.reverse)??!1,{barWidth:u,offset:d}=Xb(l.scale.bandwidth(),s,l.barGapRatio),h=a*(u+d),f=n.scale,m=r.scale,p=l.data[o],y=i.data[o];if(y==null)return null;const T=i.stackedData[o].map(C=>t?m(C):f(C)),w=Math.round(Math.min(...T)),E=Math.round(Math.max(...T)),R=y===0?0:Math.max(i.minBarSize,E-w),S=Zb(t,y,c)?E-R:w;return{x:t?f(p)+h:S,y:t?S:m(p)+h,height:t?R:u,width:t?u:R}}const ev=e=>{var d;const{series:t,identifier:n,axesConfig:r,placement:i}=e;if(!n||n.dataIndex===void 0)return null;const o=(d=t.bar)==null?void 0:d.series[n.seriesId];if(t.bar==null||o==null||r.x===void 0||r.y===void 0)return null;const s=Qb({verticalLayout:o.layout==="vertical",xAxisConfig:r.x,yAxisConfig:r.y,series:o,dataIndex:n.dataIndex,numberOfGroups:t.bar.stackingGroups.length,groupIndex:t.bar.stackingGroups.findIndex(h=>h.ids.includes(o.id))});if(s==null)return null;const{x:a,y:l,width:c,height:u}=s;switch(i){case"right":return{x:a+c,y:l+u/2};case"bottom":return{x:a+c/2,y:l+u};case"left":return{x:a,y:l+u/2};case"top":default:return{x:a+c/2,y:l}}};function tv(e,t,n){return G({},e,{id:e.id??`auto-generated-id-${t}`,color:e.color??n[t%n.length]})}const nv=e=>`Type(${e})`,rv=e=>`Series(${e})`,iv=e=>e===void 0?"":`Index(${e})`,Co=e=>`${nv(e.type)}${rv(e.seriesId)}${iv(e.dataIndex)}`,ov={seriesProcessor:Wb,colorProcessor:Yb,legendGetter:Hb,tooltipGetter:Jb,tooltipItemPositionGetter:ev,axisTooltipGetter:Kb,xExtremumGetter:yb,yExtremumGetter:xb,getSeriesWithDefaultValues:tv,keyboardFocusHandler:qb,identifierSerializer:Co},sv=e=>{const{series:t,axis:n,isDefaultAxis:r,getFilters:i}=e;let o=1/0,s=-1/0;for(const a in t){if(!Object.hasOwn(t,a))continue;const l=t[a].xAxisId;if(!(l===n.id||l===void 0&&r))continue;const c=i==null?void 0:i({currentAxisId:n.id,isDefaultAxis:r,seriesXAxisId:t[a].xAxisId,seriesYAxisId:t[a].yAxisId}),u=t[a].data??[];for(let d=0;d<u.length;d+=1){const h=u[d];c&&!c(h,d)||h.x!==null&&(h.x<o&&(o=h.x),h.x>s&&(s=h.x))}}return[o,s]},av=e=>{const{series:t,axis:n,isDefaultAxis:r,getFilters:i}=e;let o=1/0,s=-1/0;for(const a in t){if(!Object.hasOwn(t,a))continue;const l=t[a].yAxisId;if(!(l===n.id||l===void 0&&r))continue;const c=i==null?void 0:i({currentAxisId:n.id,isDefaultAxis:r,seriesXAxisId:t[a].xAxisId,seriesYAxisId:t[a].yAxisId}),u=t[a].data??[];for(let d=0;d<u.length;d+=1){const h=u[d];c&&!c(h,d)||h.y!==null&&(h.y<o&&(o=h.y),h.y>s&&(s=h.y))}}return[o,s]},lv=({series:e,seriesOrder:t},n)=>({series:Object.fromEntries(Object.entries(e).map(([i,o])=>{const s=o==null?void 0:o.datasetKeys,a=["x","y"].filter(c=>typeof(s==null?void 0:s[c])!="string");if(o!=null&&o.datasetKeys&&a.length>0)throw new Error([`MUI X Charts: scatter series with id='${i}' has incomplete datasetKeys.`,`Properties ${a.map(c=>`"${c}"`).join(", ")} are missing.`].join(`
|
|
118
|
+
`));const l=s?(n==null?void 0:n.map(c=>({x:c[s.x]??null,y:c[s.y]??null,z:s.z&&c[s.z],id:s.id&&c[s.id]})))??[]:o.data??[];return[i,G({labelMarkType:"circle",markerSize:4},o,{preview:G({markerSize:1},o==null?void 0:o.preview),data:l,valueFormatter:o.valueFormatter??(c=>c&&`(${c.x}, ${c.y})`)})]})),seriesOrder:t}),cv=(e,t,n,r)=>{const i=r==null?void 0:r.colorScale,o=n==null?void 0:n.colorScale,s=t==null?void 0:t.colorScale,a=Pa(e);return i?l=>{var d,h;if(l===void 0)return e.color;if(((d=r==null?void 0:r.data)==null?void 0:d[l])!==void 0){const f=i((h=r==null?void 0:r.data)==null?void 0:h[l]);if(f!==null)return f}const c=e.data[l],u=c===null?a({value:c,dataIndex:l}):i(c.z);return u===null?a({value:c,dataIndex:l}):u}:o?l=>{if(l===void 0)return e.color;const c=e.data[l],u=c===null?a({value:c,dataIndex:l}):o(c.y);return u===null?a({value:c,dataIndex:l}):u}:s?l=>{if(l===void 0)return e.color;const c=e.data[l],u=c===null?a({value:c,dataIndex:l}):s(c.x);return u===null?a({value:c,dataIndex:l}):u}:l=>{if(l===void 0)return e.color;const c=e.data[l];return a({value:c,dataIndex:l})}},uv=e=>{const{seriesOrder:t,series:n}=e;return t.reduce((r,i)=>{const o=kt(n[i].label,"legend");return o===void 0||r.push({type:"scatter",markType:n[i].labelMarkType,id:i,seriesId:i,color:n[i].color,label:o}),r},[])},dv=e=>{const{series:t,getColor:n,identifier:r}=e;if(!r||r.dataIndex===void 0)return null;const i=kt(t.label,"tooltip"),o=t.data[r.dataIndex],s=t.valueFormatter(o,{dataIndex:r.dataIndex});return{identifier:r,color:n(r.dataIndex),label:i,value:o,formattedValue:s,markType:t.labelMarkType}},hv=(e,t,n)=>G({},e,{id:e.id??`auto-generated-id-${t}`,color:e.color??n[t%n.length]}),fv=e=>{var a,l,c;const{series:t,identifier:n,axesConfig:r}=e;if(!n||n.dataIndex===void 0)return null;const i=(a=t.scatter)==null?void 0:a.series[n.seriesId];if(i==null||r.x===void 0||r.y===void 0)return null;const o=(l=i.data)==null?void 0:l[n.dataIndex].x,s=(c=i.data)==null?void 0:c[n.dataIndex].y;return o==null||s==null?null:{x:r.x.scale(o),y:r.y.scale(s)}},Qr=new Set(["bar","line","scatter"]),pv=e=>{switch(e.key){case"ArrowRight":return So(Qr);case"ArrowLeft":return wo(Qr);case"ArrowDown":return To(Qr);case"ArrowUp":return Eo(Qr);default:return null}},mv={seriesProcessor:lv,colorProcessor:cv,legendGetter:uv,tooltipGetter:dv,tooltipItemPositionGetter:fv,xExtremumGetter:sv,yExtremumGetter:av,getSeriesWithDefaultValues:hv,keyboardFocusHandler:pv,identifierSerializer:Co},gv=e=>{const{axis:t}=e;return ki(t.data??[])};function yv(e,t,n,r){return n.reduce((i,o,s)=>{if(t[s]===null)return i;const[a,l]=e(o);return r&&(!r({y:a,x:null},s)||!r({y:l,x:null},s))?i:[Math.min(a,l,i[0]),Math.max(a,l,i[1])]},[1/0,-1/0])}const xv=e=>{const{series:t,axis:n,isDefaultAxis:r,getFilters:i}=e;return Object.keys(t).filter(o=>{const s=t[o].yAxisId;return s===n.id||r&&s===void 0}).reduce((o,s)=>{const{area:a,stackedData:l,data:c}=t[s],u=a!==void 0,d=i==null?void 0:i({currentAxisId:n.id,isDefaultAxis:r,seriesXAxisId:t[s].xAxisId,seriesYAxisId:t[s].yAxisId}),h=u&&n.scaleType!=="log"&&typeof t[s].baseline!="string"?y=>y:y=>[y[1],y[1]],f=yv(h,c,l,d),[m,p]=f;return[Math.min(m,o[0]),Math.max(p,o[1])]},[1/0,-1/0])},bv=(e,t)=>{const{seriesOrder:n,series:r}=e,i=oh(G({},e,{defaultStrategy:{stackOffset:"none"}})),o=t??[];n.forEach(a=>{const l=r[a].data;if(l!==void 0)l.forEach((c,u)=>{o.length<=u?o.push({[a]:c}):o[u][a]=c});else if(t===void 0&&process.env.NODE_ENV!=="production")throw new Error([`MUI X Charts: line series with id='${a}' has no data.`,"Either provide a data property to the series or use the dataset prop."].join(`
|
|
119
|
+
`));if(process.env.NODE_ENV!=="production"&&!l&&t){const c=r[a].dataKey;if(!c)throw new Error([`MUI X Charts: line series with id='${a}' has no data and no dataKey.`,"You must provide a dataKey when using the dataset prop."].join(`
|
|
120
|
+
`));t.forEach((u,d)=>{const h=u[c];h!=null&&typeof h!="number"&&Fn([`MUI X Charts: your dataset key "${c}" is used for plotting lines, but the dataset contains the non-null non-numerical element "${h}" at index ${d}.`,"Line plots only support numeric and null values."].join(`
|
|
121
|
+
`))})}});const s={};return i.forEach(a=>{const{ids:l,stackingOrder:c,stackingOffset:u}=a,d=th().keys(l.map(h=>{const f=r[h].dataKey;return r[h].data===void 0&&f!==void 0?f:h})).value((h,f)=>h[f]??0).order(c).offset(u)(o);l.forEach((h,f)=>{var p;const m=r[h].dataKey;s[h]=G({labelMarkType:"line"},r[h],{data:m?t.map(y=>{const v=y[m];return typeof v=="number"?v:null}):r[h].data,stackedData:d[f].map(([y,v])=>[y,v]),valueFormatter:((p=r[h])==null?void 0:p.valueFormatter)??(y=>y==null?"":y.toLocaleString())})})}),{seriesOrder:n,stackingGroups:i,series:s}},vv=(e,t,n)=>{const r=n==null?void 0:n.colorScale,i=t==null?void 0:t.colorScale,o=Pa(e);return r?s=>{if(s===void 0)return e.color;const a=e.data[s],l=a===null?o({value:a,dataIndex:s}):r(a);return l===null?o({value:a,dataIndex:s}):l}:i?s=>{var c;if(s===void 0)return e.color;const a=(c=t.data)==null?void 0:c[s],l=a===null?o({value:a,dataIndex:s}):i(a);return l===null?o({value:a,dataIndex:s}):l}:s=>{if(s===void 0)return e.color;const a=e.data[s];return o({value:a,dataIndex:s})}},Sv=e=>{const{seriesOrder:t,series:n}=e;return t.reduce((r,i)=>{const o=kt(n[i].label,"legend");return o===void 0||r.push({type:"line",markType:n[i].labelMarkType,id:i,seriesId:i,color:n[i].color,label:o}),r},[])},wv=e=>{const{series:t,getColor:n,identifier:r}=e;if(!r||r.dataIndex===void 0)return null;const i=kt(t.label,"tooltip"),o=t.data[r.dataIndex],s=t.valueFormatter(o,{dataIndex:r.dataIndex});return{identifier:r,color:n(r.dataIndex),label:i,value:o,formattedValue:s,markType:t.labelMarkType}},Ev=e=>Object.values(e).map(t=>({direction:"x",axisId:t.xAxisId})),Tv=(e,t,n)=>G({},e,{id:e.id??`auto-generated-id-${t}`,color:e.color??n[t%n.length]}),Cv=e=>{var a,l;const{series:t,identifier:n,axesConfig:r}=e;if(!n||n.dataIndex===void 0)return null;const i=(a=t.line)==null?void 0:a.series[n.seriesId];if(i==null||r.x===void 0||r.y===void 0)return null;const o=(l=r.x.data)==null?void 0:l[n.dataIndex],s=i.data[n.dataIndex];return o==null||s==null?null:{x:r.x.scale(o),y:r.y.scale(s)}},ei=new Set(["bar","line","scatter"]),_v=e=>{switch(e.key){case"ArrowRight":return So(ei);case"ArrowLeft":return wo(ei);case"ArrowDown":return To(ei);case"ArrowUp":return Eo(ei);default:return null}},Mv={colorProcessor:vv,seriesProcessor:bv,legendGetter:Sv,tooltipGetter:wv,tooltipItemPositionGetter:Cv,axisTooltipGetter:Ev,xExtremumGetter:gv,yExtremumGetter:xv,getSeriesWithDefaultValues:Tv,keyboardFocusHandler:_v,identifierSerializer:Co},Rv=(e="none")=>{if(typeof e=="function")return e;switch(e){case"none":return null;case"desc":return(t,n)=>n-t;case"asc":return(t,n)=>t-n;default:return null}},Av=e=>{const{seriesOrder:t,series:n}=e,r={};return t.forEach(i=>{const o=Ob().startAngle($n(n[i].startAngle??0)).endAngle($n(n[i].endAngle??360)).padAngle($n(n[i].paddingAngle??0)).sortValues(Rv(n[i].sortingValues??"none"))(n[i].data.map(s=>s.value));r[i]=G({labelMarkType:"circle",valueFormatter:s=>s.value.toLocaleString()},n[i],{data:n[i].data.map((s,a)=>G({},s,{id:s.id??`auto-generated-pie-id-${i}-${a}`},o[a])).map((s,a)=>{var l,c;return G({labelMarkType:"circle"},s,{formattedValue:((c=(l=n[i]).valueFormatter)==null?void 0:c.call(l,G({},s,{label:kt(s.label,"arc")}),{dataIndex:a}))??s.value.toLocaleString()})})})}),{seriesOrder:t,series:r}},Iv=e=>t=>e.data[t].color,jv=e=>{const{seriesOrder:t,series:n}=e;return t.reduce((r,i)=>(n[i].data.forEach((o,s)=>{const a=kt(o.label,"legend");if(a===void 0)return;const l=o.id??s;r.push({type:"pie",markType:o.labelMarkType??n[i].labelMarkType,seriesId:i,id:l,itemId:l,dataIndex:s,color:o.color,label:a})}),r),[])},kv=e=>{const{series:t,getColor:n,identifier:r}=e;if(!r||r.dataIndex===void 0)return null;const i=t.data[r.dataIndex];if(i==null)return null;const o=kt(i.label,"tooltip"),s=G({},i,{label:o}),a=t.valueFormatter(s,{dataIndex:r.dataIndex});return{identifier:r,color:n(r.dataIndex),label:o,value:s,formattedValue:a,markType:i.labelMarkType??t.labelMarkType}};function ut(e,t){if(typeof e=="number")return e;if(e==="100%")return t;if(e.endsWith("%")){const n=Number.parseFloat(e.slice(0,e.length-1));if(!Number.isNaN(n))return n*t/100}if(e.endsWith("px")){const n=Number.parseFloat(e.slice(0,e.length-2));if(!Number.isNaN(n))return n}throw new Error(`MUI X Charts: Received an unknown value "${e}". It should be a number, or a string with a percentage value.`)}function Ov(e,t){const{height:n,width:r}=t,{cx:i,cy:o}=e,s=Math.min(r,n)/2,a=ut(i??"50%",r),l=ut(o??"50%",n);return{cx:a,cy:l,availableRadius:s}}const Pv=(e,t)=>{const n={};for(const r of e.seriesOrder){const{innerRadius:i,outerRadius:o,arcLabelRadius:s,cx:a,cy:l}=e.series[r],{cx:c,cy:u,availableRadius:d}=Ov({cx:a,cy:l},{width:t.width,height:t.height}),h=ut(o??d,d),f=ut(i??0,d),m=s===void 0?(f+h)/2:ut(s,d);n[r]={radius:{available:d,inner:f,outer:h,label:m},center:{x:t.left+c,y:t.top+u}}}return n},Dv=(e,t,n)=>G({},e,{id:e.id??`auto-generated-id-${t}`,data:e.data.map((r,i)=>G({},r,{color:r.color??n[i%n.length]}))}),$v=e=>{var y,v;const{series:t,identifier:n,placement:r,seriesLayout:i}=e;if(!n||n.dataIndex===void 0)return null;const o=(y=t.pie)==null?void 0:y.series[n.seriesId],s=(v=i.pie)==null?void 0:v[n.seriesId];if(o==null||s==null)return null;const{center:a,radius:l}=s,{data:c}=o,u=c[n.dataIndex];if(!u)return null;const d=[[l.inner,u.startAngle],[l.inner,u.endAngle],[l.outer,u.startAngle],[l.outer,u.endAngle]].map(([T,w])=>({x:a.x+T*Math.sin(w),y:a.y-T*Math.cos(w)})),[h,f]=ki(d.map(T=>T.x)),[m,p]=ki(d.map(T=>T.y));switch(r){case"bottom":return{x:(f+h)/2,y:p};case"left":return{x:h,y:(p+m)/2};case"right":return{x:f,y:(p+m)/2};case"top":default:return{x:(f+h)/2,y:m}}},ti=new Set(["pie"]),Lv=e=>{switch(e.key){case"ArrowRight":return So(ti);case"ArrowLeft":return wo(ti);case"ArrowDown":return To(ti);case"ArrowUp":return Eo(ti);default:return null}},Nv={colorProcessor:Iv,seriesProcessor:Av,seriesLayout:Pv,legendGetter:jv,tooltipGetter:kv,tooltipItemPositionGetter:$v,getSeriesWithDefaultValues:Dv,keyboardFocusHandler:Lv,identifierSerializer:Co},zv={bar:ov,scatter:mv,line:Mv,pie:Nv},Fv=[ka,ja,Aa,vo,Oa];function Bv(e){const{children:t,plugins:n=Fv,pluginParams:r={},seriesConfig:i=zv}=e,{contextValue:o}=V0(n,r,i);return x.jsxRuntimeExports.jsx(oa.Provider,{value:o,children:t})}const dh=()=>{const e=j.useContext(oa);if(e==null)throw new Error(["MUI X Charts: Could not find the Chart context.","It looks like you rendered your component outside of a ChartDataProvider.","This can also happen if you are bundling multiple versions of the library."].join(`
|
|
122
|
+
`));return e};function yn(){const e=dh();if(!e)throw new Error(["MUI X Charts: Could not find the charts context.","It looks like you rendered your component outside of a ChartContainer parent component."].join(`
|
|
123
|
+
`));return e.store}function hh(){return yn().use(gt)}function fh(){return yn().use(S0)}function Gv(){const e=yn(),{axis:t,axisIds:n}=e.use(qt);return{xAxis:t,xAxisIds:n}}function Vv(){const e=yn(),{axis:t,axisIds:n}=e.use(Jt);return{yAxis:t,yAxisIds:n}}function Uv(){const e=yn(),{axis:t,axisIds:n}=e.use(gb)??{axis:{},axisIds:[]};return{zAxis:t,zAxisIds:n}}function Wv(){const e=dh();if(!e)throw new Error(["MUI X Charts: Could not find the svg ref context.","It looks like you rendered your component outside of a ChartContainer parent component."].join(`
|
|
124
|
+
`));return e.svgRef}function Hv(){const e=fh();return j.useCallback(t=>`${e}-gradient-${t}`,[e])}function Yv(){const e=fh();return j.useCallback(t=>`${e}-gradient-${t}-object-bound`,[e])}var as,kc;function qv(){if(kc)return as;kc=1;var e=4,t=.001,n=1e-7,r=10,i=11,o=1/(i-1),s=typeof Float32Array=="function";function a(p,y){return 1-3*y+3*p}function l(p,y){return 3*y-6*p}function c(p){return 3*p}function u(p,y,v){return((a(y,v)*p+l(y,v))*p+c(y))*p}function d(p,y,v){return 3*a(y,v)*p*p+2*l(y,v)*p+c(y)}function h(p,y,v,T,w){var E,R,S=0;do R=y+(v-y)/2,E=u(R,T,w)-p,E>0?v=R:y=R;while(Math.abs(E)>n&&++S<r);return R}function f(p,y,v,T){for(var w=0;w<e;++w){var E=d(y,v,T);if(E===0)return y;var R=u(y,v,T)-p;y-=R/E}return y}function m(p){return p}return as=function(y,v,T,w){if(!(0<=y&&y<=1&&0<=T&&T<=1))throw new Error("bezier x values must be in [0, 1] range");if(y===v&&T===w)return m;for(var E=s?new Float32Array(i):new Array(i),R=0;R<i;++R)E[R]=u(R*o,y,T);function S(C){for(var I=0,k=1,P=i-1;k!==P&&E[k]<=C;++k)I+=o;--k;var D=(C-E[k])/(E[k+1]-E[k]),g=I+D*o,A=d(g,y,T);return A>=t?f(C,g,y,T):A===0?g:h(C,I,I+o,y,T)}return function(I){return I===0?0:I===1?1:u(S(I),v,w)}},as}var Jv=qv();const Kv=hf(Jv),Xv=300,Zv=Kv(.66,0,.34,1);var Yn=0,or=0,tr=0,ph=1e3,Pi,sr,Di=0,cn=0,_o=0,br=typeof performance=="object"&&performance.now?performance:Date,mh=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Da(){return cn||(mh(Qv),cn=br.now()+_o)}function Qv(){cn=0}function $i(){this._call=this._time=this._next=null}$i.prototype=gh.prototype={constructor:$i,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Da():+n)+(t==null?0:+t),!this._next&&sr!==this&&(sr?sr._next=this:Pi=this,sr=this),this._call=e,this._time=n,Ps()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ps())}};function gh(e,t,n){var r=new $i;return r.restart(e,t,n),r}function eS(){Da(),++Yn;for(var e=Pi,t;e;)(t=cn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Yn}function Oc(){cn=(Di=br.now())+_o,Yn=or=0;try{eS()}finally{Yn=0,nS(),cn=0}}function tS(){var e=br.now(),t=e-Di;t>ph&&(_o-=t,Di=e)}function nS(){for(var e,t=Pi,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Pi=n);sr=e,Ps(r)}function Ps(e){if(!Yn){or&&(or=clearTimeout(or));var t=e-cn;t>24?(e<1/0&&(or=setTimeout(Oc,e-br.now()-_o)),tr&&(tr=clearInterval(tr))):(tr||(Di=br.now(),tr=setInterval(tS,ph)),Yn=1,mh(Oc))}}function rS(e,t,n){var r=new $i;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}class iS{constructor(t,n,r){H(this,"elapsed",0);H(this,"timer",null);this.duration=t,this.easingFn=n,this.onTickCallback=r,this.resume()}get running(){return this.timer!==null}timerCallback(t){this.elapsed=Math.min(t,this.duration);const n=this.duration===0?1:this.elapsed/this.duration,r=this.easingFn(n);this.onTickCallback(r),this.elapsed>=this.duration&&this.stop()}resume(){if(this.running||this.elapsed>=this.duration)return this;const t=Da()-this.elapsed;return this.timer=gh(n=>this.timerCallback(n),0,t),this}stop(){return this.running?(this.timer&&(this.timer.stop(),this.timer=null),this):this}finish(){return this.stop(),rS(()=>this.timerCallback(this.duration)),this}}function oS(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i+=1){const o=n[i];if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1}return!0}function sS(e,{createInterpolator:t,applyProps:n,skip:r,initialProps:i=e}){const o=j.useRef(i),s=j.useRef(null),a=j.useRef(null),l=j.useRef(e);pt(()=>{l.current=e},[e]),pt(()=>{var d;r&&((d=s.current)==null||d.finish(),s.current=null,a.current=null,o.current=e)},[e,r]);const c=j.useCallback(d=>{const h=o.current,f=t(h,e);s.current=new iS(Xv,Zv,m=>{const p=f(m);o.current=p,n(d,p)})},[n,t,e]);return[j.useCallback(d=>{var f,m,p,y;if(d===null){(f=s.current)==null||f.stop();return}const h=a.current;if(h===d){if(oS(l.current,e)){(m=s.current)==null||m.resume();return}(p=s.current)==null||p.stop()}h&&((y=s.current)==null||y.stop()),a.current=d,(s.current||!r)&&c(d)},[c,e,r]),o.current]}function aS(e,{createInterpolator:t,transformProps:n,applyProps:r,skip:i,initialProps:o=e,ref:s}){const a=n??(d=>d),[l,c]=sS(e,{initialProps:o,createInterpolator:t,applyProps:(d,h)=>r(d,a(h)),skip:i}),u=n(i?e:c);return G({},u,{ref:no(l,s)})}function Pc(e){const{isReversed:t,gradientId:n,size:r,direction:i,scale:o,colorMap:s}=e;return r<=0?null:x.jsxRuntimeExports.jsx("linearGradient",{id:n,x1:"0",x2:"0",y1:"0",y2:"0",[`${i}${t?1:2}`]:`${r}px`,gradientUnits:"userSpaceOnUse",children:s.thresholds.map((a,l)=>{const c=o(a);if(c===void 0)return null;const u=t?1-c/r:c/r;return Number.isNaN(u)?null:x.jsxRuntimeExports.jsxs(j.Fragment,{children:[x.jsxRuntimeExports.jsx("stop",{offset:u,stopColor:s.colors[l],stopOpacity:1}),x.jsxRuntimeExports.jsx("stop",{offset:u,stopColor:s.colors[l+1],stopOpacity:1})]},a.toString()+l)})})}const lS=10;function Dc(e){const{gradientUnits:t,isReversed:n,gradientId:r,size:i,direction:o,scale:s,colorScale:a,colorMap:l}=e,c=[l.min??0,l.max??100],u=c.map(s).filter(m=>m!==void 0);if(u.length!==2)return null;const d=typeof c[0]=="number"?tt(c[0],c[1]):ua(c[0],c[1]),h=Math.round((Math.max(...u)-Math.min(...u))/lS),f=`${c[0]}-${c[1]}-`;return x.jsxRuntimeExports.jsx("linearGradient",{id:r,x1:"0",x2:"0",y1:"0",y2:"0",[`${o}${n?1:2}`]:t==="objectBoundingBox"?1:`${i}px`,gradientUnits:t??"userSpaceOnUse",children:Array.from({length:h+1},(m,p)=>{const y=d(p/h);if(y===void 0)return null;const v=s(y);if(v===void 0)return null;const T=n?1-v/i:v/i,w=a(y);return w===null?null:x.jsxRuntimeExports.jsx("stop",{offset:T,stopColor:w,stopOpacity:1},f+p)})})}const cS=10,uS=e=>e?{x1:"1",x2:"0",y1:"0",y2:"0"}:{x1:"0",x2:"1",y1:"0",y2:"0"};function ls(e){const{isReversed:t,gradientId:n,colorScale:r,colorMap:i}=e,o=[i.min??0,i.max??100],s=typeof o[0]=="number"?tt(o[0],o[1]):ua(o[0],o[1]),a=cS,l=`${o[0]}-${o[1]}-`;return x.jsxRuntimeExports.jsx("linearGradient",G({id:n},uS(t),{gradientUnits:"objectBoundingBox",children:Array.from({length:a+1},(c,u)=>{const d=u/a,h=s(d);if(h===void 0)return null;const f=r(h);return f===null?null:x.jsxRuntimeExports.jsx("stop",{offset:d,stopColor:f,stopOpacity:1},l+u)})}))}function dS(){const{top:e,height:t,bottom:n,left:r,width:i,right:o}=hh(),s=e+t+n,a=r+i+o,l=Hv(),c=Yv(),{xAxis:u,xAxisIds:d}=Gv(),{yAxis:h,yAxisIds:f}=Vv(),{zAxis:m,zAxisIds:p}=Uv(),y=f.filter(w=>h[w].colorMap!==void 0),v=d.filter(w=>u[w].colorMap!==void 0),T=p.filter(w=>m[w].colorMap!==void 0);return y.length===0&&v.length===0&&T.length===0?null:x.jsxRuntimeExports.jsxs("defs",{children:[y.map(w=>{const E=l(w),R=c(w),{colorMap:S,scale:C,colorScale:I,reverse:k}=h[w];return(S==null?void 0:S.type)==="piecewise"?x.jsxRuntimeExports.jsx(Pc,{isReversed:!k,scale:C,colorMap:S,size:s,gradientId:E,direction:"y"},E):(S==null?void 0:S.type)==="continuous"?x.jsxRuntimeExports.jsxs(j.Fragment,{children:[x.jsxRuntimeExports.jsx(Dc,{isReversed:!k,scale:C,colorScale:I,colorMap:S,size:s,gradientId:E,direction:"y"}),x.jsxRuntimeExports.jsx(ls,{isReversed:k,colorScale:I,colorMap:S,gradientId:R})]},E):null}),v.map(w=>{const E=l(w),R=c(w),{colorMap:S,scale:C,reverse:I,colorScale:k}=u[w];return(S==null?void 0:S.type)==="piecewise"?x.jsxRuntimeExports.jsx(Pc,{isReversed:I,scale:C,colorMap:S,size:a,gradientId:E,direction:"x"},E):(S==null?void 0:S.type)==="continuous"?x.jsxRuntimeExports.jsxs(j.Fragment,{children:[x.jsxRuntimeExports.jsx(Dc,{isReversed:I,scale:C,colorScale:k,colorMap:S,size:a,gradientId:E,direction:"x"}),x.jsxRuntimeExports.jsx(ls,{isReversed:I,colorScale:k,colorMap:S,gradientId:R})]},E):null}),T.map(w=>{const E=c(w),{colorMap:R,colorScale:S}=m[w];return(R==null?void 0:R.type)==="continuous"?x.jsxRuntimeExports.jsx(ls,{colorScale:S,colorMap:R,gradientId:E},E):null})]})}function hS(e){return fn("MuiChartsSurface",e)}const fS=()=>wr({root:["root"]},hS);Zi("MuiChartsSurface",["root"]);const pS=["children","className","title","desc"],mS=Ue("svg",{name:"MuiChartsSurface",slot:"Root"})(({ownerState:e})=>({width:e.width??"100%",height:e.height??"100%",display:"flex",position:"relative",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"hidden",touchAction:e.hasZoom?"pan-y":void 0,userSelect:"none",gridArea:"chart","&:focus":{outline:"none"}})),$a=j.forwardRef(function(t,n){const r=yn(),i=r.use(f0),o=r.use(p0),s=r.use(m0),a=r.use(g0),l=r.use(pb),c=r.use(fb),u=r.use(J1),d=Wv(),h=no(d,n),f=fg({props:t,name:"MuiChartsSurface"}),{children:m,className:p,title:y,desc:v}=f,T=ft(f,pS),w=fS(),E=o>0&&i>0;return x.jsxRuntimeExports.jsxs(mS,G({ownerState:{width:s,height:a,hasZoom:u},viewBox:`0 0 ${i} ${o}`,className:De(w.root,p),tabIndex:l?0:void 0,"data-has-focused-item":c||void 0},T,{ref:h,children:[y&&x.jsxRuntimeExports.jsx("title",{children:y}),v&&x.jsxRuntimeExports.jsx("desc",{children:v}),x.jsxRuntimeExports.jsx(dS,{}),E&&m]}))});process.env.NODE_ENV!=="production"&&($a.displayName="ChartsSurface");process.env.NODE_ENV!=="production"&&($a.propTypes={children:b.node,className:b.string,desc:b.string,sx:b.oneOfType([b.arrayOf(b.oneOfType([b.func,b.object,b.bool])),b.func,b.object]),title:b.string});function cs(e){const t=$n(e);return[Math.sin(t),-Math.cos(t)]}function gS(e,t){const n=[[0,0],cs(e),cs(t)],r=Math.min(e,t),i=Math.max(e,t),o=Math.floor(r/90)*90;for(let u=1;u<=4;u+=1){const d=o+u*90;d<i&&n.push(cs(d))}const s=Math.min(...n.map(([u])=>u)),a=Math.max(...n.map(([u])=>u)),l=Math.min(...n.map(([,u])=>u)),c=Math.max(...n.map(([,u])=>u));return{cx:-s/(a-s),cy:-l/(c-l),minX:s,maxX:a,minY:l,maxY:c}}function yS(e,t,n,r,{minX:i,maxX:o,minY:s,maxY:a}){return Math.min(...[{ratio:Math.abs(i),space:e},{ratio:Math.abs(o),space:n-e},{ratio:Math.abs(s),space:t},{ratio:Math.abs(a),space:r-t}].map(({ratio:l,space:c})=>l<1e-5?1/0:c/l))}const La=j.createContext({value:null,valueMin:0,valueMax:0,startAngle:0,endAngle:0,innerRadius:0,outerRadius:0,cornerRadius:0,cx:0,cy:0,maxRadius:0,valueAngle:null});process.env.NODE_ENV!=="production"&&(La.displayName="GaugeContext");function xS(e){const{value:t=null,valueMin:n=0,valueMax:r=100,startAngle:i=0,endAngle:o=360,outerRadius:s,innerRadius:a,cornerRadius:l,cx:c,cy:u,children:d}=e,{left:h,top:f,width:m,height:p}=hh(),y=gS(i,o),v=c?ut(c,m):y.cx*m,T=u?ut(u,p):y.cy*p;let w=h+v,E=f+T;const R=yS(v,T,m,p,y);if(c===void 0){const P=R*(y.maxX-y.minX);w=h+(m-P)/2+y.cx*P}if(u===void 0){const P=R*(y.maxY-y.minY);E=f+(p-P)/2+y.cy*P}const S=ut(s??R,R),C=ut(a??"80%",R),I=ut(l??0,S-C),k=j.useMemo(()=>{const P=$n(i),D=$n(o);return{value:t,valueMin:n,valueMax:r,startAngle:P,endAngle:D,outerRadius:S,innerRadius:C,cornerRadius:I,cx:w,cy:E,maxRadius:R,valueAngle:t===null?null:P+(D-P)*(t-n)/(r-n)}},[t,n,r,i,o,S,C,I,w,E,R]);return x.jsxRuntimeExports.jsx(La.Provider,{value:k,children:d})}function Na(){return j.useContext(La)}const bS=["width","height","margin","title","desc","value","valueMin","valueMax","startAngle","endAngle","outerRadius","innerRadius","cornerRadius","cx","cy","children"],vS=Ue("g",{slot:"internal",shouldForwardProp:void 0})(({theme:e})=>({"& text":{fill:(e.vars||e).palette.text.primary}})),za=j.forwardRef(function(t,n){const{width:r,height:i,margin:o,title:s,desc:a,value:l,valueMin:c=0,valueMax:u=100,startAngle:d,endAngle:h,outerRadius:f,innerRadius:m,cornerRadius:p,cx:y,cy:v,children:T}=t,w=ft(t,bS);return x.jsxRuntimeExports.jsx(Bv,{pluginParams:{width:r,height:i,margin:Xu(o,{left:10,right:10,top:10,bottom:10})},plugins:[],children:x.jsxRuntimeExports.jsx(xS,{value:l,valueMin:c,valueMax:u,startAngle:d,endAngle:h,outerRadius:f,innerRadius:m,cornerRadius:p,cx:y,cy:v,children:x.jsxRuntimeExports.jsx($a,G({title:s,desc:a,role:"meter","aria-valuenow":l===null?void 0:l,"aria-valuemin":c,"aria-valuemax":u},w,{ref:n,children:x.jsxRuntimeExports.jsx(vS,{"aria-hidden":"true",children:T})}))})})});process.env.NODE_ENV!=="production"&&(za.displayName="GaugeContainer");process.env.NODE_ENV!=="production"&&(za.propTypes={children:b.node,className:b.string,cornerRadius:b.oneOfType([b.number,b.string]),cx:b.oneOfType([b.number,b.string]),cy:b.oneOfType([b.number,b.string]),desc:b.string,endAngle:b.number,height:b.number,id:b.string,innerRadius:b.oneOfType([b.number,b.string]),margin:b.oneOfType([b.number,b.shape({bottom:b.number,left:b.number,right:b.number,top:b.number})]),outerRadius:b.oneOfType([b.number,b.string]),skipAnimation:b.bool,startAngle:b.number,sx:b.oneOfType([b.arrayOf(b.oneOfType([b.func,b.object,b.bool])),b.func,b.object]),title:b.string,value:b.number,valueMax:b.number,valueMin:b.number,width:b.number});function SS(e){const n=yn().use(e0);return e||n}function wS(e,t){const n=tt(e.startAngle,t.startAngle),r=tt(e.endAngle,t.endAngle),i=tt(e.innerRadius,t.innerRadius),o=tt(e.outerRadius,t.outerRadius),s=tt(e.cornerRadius,t.cornerRadius);return a=>({startAngle:n(a),endAngle:r(a),innerRadius:i(a),outerRadius:o(a),cornerRadius:s(a)})}function ES(e){return aS({startAngle:e.startAngle,endAngle:e.endAngle,innerRadius:e.innerRadius,outerRadius:e.outerRadius,cornerRadius:e.cornerRadius},{createInterpolator:wS,transformProps:t=>({d:Qd().cornerRadius(t.cornerRadius)({innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle})}),applyProps(t,n){t.setAttribute("d",n.d)},initialProps:{startAngle:e.startAngle,endAngle:e.startAngle,innerRadius:e.innerRadius,outerRadius:e.outerRadius,cornerRadius:e.cornerRadius},skip:e.skipAnimation,ref:e.ref})}function TS(e){return fn("MuiGauge",e)}const Fa=Zi("MuiGauge",["root","valueArc","referenceArc","valueText"]),CS=["className"],_S=["cx","cy","startAngle","endAngle","cornerRadius","innerRadius","outerRadius","skipAnimation"],MS=Ue("path",{name:"MuiGauge",slot:"ValueArc"})(({theme:e})=>({fill:(e.vars||e).palette.primary.main}));function yh(e){let{className:t}=e,n=ft(e,CS);const{value:r,valueMin:i,valueMax:o,startAngle:s,endAngle:a,outerRadius:l,innerRadius:c,cornerRadius:u,cx:d,cy:h}=Na();if(r===null)return null;const f=s+(r-i)/(o-i)*(a-s);return x.jsxRuntimeExports.jsx(xh,G({},n,{className:De(Fa.valueArc,t),cx:d,cy:h,startAngle:s,endAngle:f,cornerRadius:u,innerRadius:c,outerRadius:l}))}process.env.NODE_ENV!=="production"&&(yh.propTypes={skipAnimation:b.bool});function xh(e){let{cx:t,cy:n,startAngle:r,endAngle:i,cornerRadius:o,innerRadius:s,outerRadius:a,skipAnimation:l}=e,c=ft(e,_S);const u=SS(l),d=ES({startAngle:r,endAngle:i,cornerRadius:o,innerRadius:s,outerRadius:a,skipAnimation:u});return x.jsxRuntimeExports.jsx(MS,G({},d,{transform:`translate(${t}, ${n})`},c))}process.env.NODE_ENV!=="production"&&(xh.propTypes={cornerRadius:b.number.isRequired,cx:b.number.isRequired,cy:b.number.isRequired,endAngle:b.number.isRequired,innerRadius:b.number.isRequired,outerRadius:b.number.isRequired,skipAnimation:b.bool,startAngle:b.number.isRequired});const RS=["className"],AS=Ue("path",{name:"MuiGauge",slot:"ReferenceArc"})(({theme:e})=>({fill:(e.vars||e).palette.divider}));function IS(e){let{className:t}=e,n=ft(e,RS);const{startAngle:r,endAngle:i,outerRadius:o,innerRadius:s,cornerRadius:a,cx:l,cy:c}=Na();return x.jsxRuntimeExports.jsx(AS,G({className:De(Fa.referenceArc,t),transform:`translate(${l}, ${c})`,d:Qd().cornerRadius(a)({startAngle:r,endAngle:i,innerRadius:s,outerRadius:o})},n))}function jS(){return typeof window>"u"}const ni=new Map,kS=2e3,OS=new Set(["minWidth","maxWidth","width","minHeight","maxHeight","height","top","left","fontSize","padding","margin","paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom"]);function bh(e,t){return OS.has(e)&&t===+t?`${t}px`:t}const PS=/([A-Z])/g;function vh(e){return String(e).replace(PS,t=>`-${t.toLowerCase()}`)}function DS(e){let t="";for(const n in e)if(Object.hasOwn(e,n)){const r=n,i=e[r];if(i===void 0)continue;t+=`${vh(r)}:${bh(r,i)};`}return t}const $S=(e,t={})=>{if(e==null||jS())return{width:0,height:0};const n=String(e),r=DS(t),i=`${n}-${r}`,o=ni.get(i);if(o)return o;try{const s=NS(),a=document.createElementNS("http://www.w3.org/2000/svg","text");Object.keys(t).map(c=>(a.style[vh(c)]=bh(c,t[c]),c)),a.textContent=n,s.replaceChildren(a);const l=LS(a);return ni.set(i,l),ni.size+1>kS&&ni.clear(),process.env.NODE_ENV==="test"&&s.replaceChildren(),l}catch{return{width:0,height:0}}};function LS(e){try{const t=e.getBBox();return{width:t.width,height:t.height}}catch{const t=e.getBoundingClientRect();return{width:t.width,height:t.height}}}let ze=null;function NS(){return ze===null&&(ze=document.createElementNS("http://www.w3.org/2000/svg","svg"),ze.setAttribute("aria-hidden","true"),ze.style.position="absolute",ze.style.top="-20000px",ze.style.left="0",ze.style.padding="0",ze.style.margin="0",ze.style.border="none",ze.style.pointerEvents="none",ze.style.visibility="hidden",ze.style.contain="strict",document.body.appendChild(ze)),ze}function zS({style:e,needsComputation:t,text:n}){return n.split(`
|
|
125
|
+
`).map(r=>G({text:r},t?$S(r,e):{width:0,height:0}))}function FS(){const[e,t]=j.useState(!1);return j.useEffect(()=>{t(!0)},[]),e}const BS=["x","y","style","text","ownerState"],GS=["angle","textAnchor","dominantBaseline"];function Sh(e){const{x:t,y:n,style:r,text:i}=e,o=ft(e,BS),s=r??{},{angle:a,textAnchor:l,dominantBaseline:c}=s,u=ft(s,GS),d=FS(),h=j.useMemo(()=>zS({style:u,needsComputation:d&&i.includes(`
|
|
126
|
+
`),text:i}),[u,i,d]);let f;switch(c){case"hanging":case"text-before-edge":f=0;break;case"central":f=(h.length-1)/2*-h[0].height;break;default:f=(h.length-1)*-h[0].height;break}return x.jsxRuntimeExports.jsx("text",G({},o,{transform:a?`rotate(${a}, ${t}, ${n})`:void 0,x:t,y:n,textAnchor:l,dominantBaseline:c,style:u,children:h.map((m,p)=>x.jsxRuntimeExports.jsx("tspan",{x:t,dy:`${p===0?f:h[0].height}px`,dominantBaseline:c,children:m.text},p))}))}process.env.NODE_ENV!=="production"&&(Sh.propTypes={lineHeight:b.number,needsComputation:b.bool,ownerState:b.any,style:b.object,text:b.string.isRequired});const VS=["text","className"];function US({value:e}){return e===null?null:e.toLocaleString()}function wh(e){const{text:t=US,className:n}=e,r=ft(e,VS),{value:i,valueMin:o,valueMax:s,cx:a,cy:l}=Na(),c=typeof t=="function"?t({value:i,valueMin:o,valueMax:s}):t;return c===null?null:x.jsxRuntimeExports.jsx("g",{className:De(Fa.valueText,n),children:x.jsxRuntimeExports.jsx(Sh,G({x:a,y:l,text:c,style:{textAnchor:"middle",dominantBaseline:"central"}},r))})}process.env.NODE_ENV!=="production"&&(wh.propTypes={lineHeight:b.number,needsComputation:b.bool,ownerState:b.any,style:b.object,text:b.oneOfType([b.func,b.string])});const WS=["text","children","classes","className","skipAnimation"],HS=e=>{const{classes:t}=e;return wr({root:["root"]},TS,t)},Ba=j.forwardRef(function(t,n){const{text:r,children:i,className:o,skipAnimation:s}=t,a=ft(t,WS),l=HS(t);return x.jsxRuntimeExports.jsxs(za,G({},a,{className:De(l.root,o),ref:n,children:[x.jsxRuntimeExports.jsx(IS,{}),x.jsxRuntimeExports.jsx(yh,{skipAnimation:s}),x.jsxRuntimeExports.jsx(wh,{text:r}),i]}))});process.env.NODE_ENV!=="production"&&(Ba.displayName="Gauge");process.env.NODE_ENV!=="production"&&(Ba.propTypes={children:b.node,classes:b.object,className:b.string,cornerRadius:b.oneOfType([b.number,b.string]),cx:b.oneOfType([b.number,b.string]),cy:b.oneOfType([b.number,b.string]),desc:b.string,endAngle:b.number,height:b.number,id:b.string,innerRadius:b.oneOfType([b.number,b.string]),margin:b.oneOfType([b.number,b.shape({bottom:b.number,left:b.number,right:b.number,top:b.number})]),outerRadius:b.oneOfType([b.number,b.string]),skipAnimation:b.bool,startAngle:b.number,sx:b.oneOfType([b.arrayOf(b.oneOfType([b.func,b.object,b.bool])),b.func,b.object]),text:b.oneOfType([b.func,b.string]),title:b.string,value:b.number,valueMax:b.number,valueMin:b.number,width:b.number});const YS=e=>{const t=Math.floor(e/86400),n=Math.floor(e%86400/3600),r=Math.floor(e%3600/60),i=e%60,o=[];return t>0?(o.push(t.toString()),o.push(n.toString().padStart(2,"0")),o.push(r.toString().padStart(2,"0")),o.push(i.toString().padStart(2,"0"))):n>0?(o.push(n.toString()),o.push(r.toString().padStart(2,"0")),o.push(i.toString().padStart(2,"0"))):(o.push(r.toString()),o.push(i.toString().padStart(2,"0"))),o.join(":")},lt=(e,t)=>{const n=Math.floor(e/86400),r=Math.floor(e%86400/3600),i=Math.floor(e%3600/60),o=e%60;if(typeof Intl<"u"&&"DurationFormat"in Intl)try{const a={};return n>0&&(a.days=n),r>0&&(a.hours=r),i>0&&(a.minutes=i),(o>0||Object.keys(a).length===0)&&(a.seconds=o),new Intl.DurationFormat(t,{style:"narrow"}).format(a)}catch{}const s=[];return n>0&&s.push(`${n}d`),r>0&&s.push(`${r}h`),i>0&&s.push(`${i}m`),(o>0||s.length===0)&&s.push(`${o}s`),s.join(" ")},qS=(e,t,n)=>e==="countdown"&&n!==null?Math.min(100,t/n*100):e==="measuring"?t/60%1*100:0,JS=({timerState:e,animationState:t,hasError:n,className:r})=>{const{t:i,i18n:o}=fe.useTranslation(),s=M.useTheme(),{currentState:a,remainingTime:l,maxTime:c,currentProgress:u}=e,{showErrorAnimation:d,showPauseAnimation:h,showPulsatingText:f,pulsatingFinished:m,showLabels:p,showMainText:y,showIdlePulsating:v,idleDotsCount:T}=t;return x.jsxRuntimeExports.jsxs(M.Box,{className:r,sx:{position:"relative",width:264,height:264,display:"flex",alignItems:"center",justifyContent:"center"},children:[x.jsxRuntimeExports.jsx(Ba,{width:264,height:264,value:a==="idle"?0:u,valueMin:0,valueMax:100,innerRadius:"85%",outerRadius:"100%",margin:0,skipAnimation:!0,text:()=>"",sx:{opacity:h||d?.6:1,transition:"opacity 0.5s ease-out","& .MuiGauge-valueArc":{fill:n?s.palette.error.light:s.palette.success.main,transition:"fill 0.5s ease-out"},"& .MuiGauge-referenceArc":{fill:"#171927",stroke:"transparent",strokeWidth:0,transition:"fill 0.5s ease-out, stroke 0.5s ease-out, stroke-width 0.5s ease-out"},"& .MuiGauge-valueText":{display:"none"},"& .MuiGauge-text":{display:"none"}}}),x.jsxRuntimeExports.jsxs(M.Box,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:225,height:225,borderRadius:"50%",backgroundColor:"#292B3F",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",gap:1,transition:"background-color 0.5s ease-out"},children:[x.jsxRuntimeExports.jsx(M.Box,{sx:{height:"16px",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:1},children:x.jsxRuntimeExports.jsx(M.Fade,{in:p&&!n&&a!=="idle"&&a!=="success",timeout:300,children:x.jsxRuntimeExports.jsx(M.Typography,{variant:"body2",sx:{fontSize:"12px",color:a==="measured"&&(f||m)?s.palette.success.main:s.palette.text.secondary,transition:"color 0.8s ease-in-out"},children:x.jsxRuntimeExports.jsx("span",{style:{opacity:a==="measured"&&m?f?1:.6:1,transition:"opacity 2s ease-in-out"},children:a==="measuring"||a==="measured"?i("CycleTimer.CycleTime.lb","Cycle Time"):a==="countdown"?i("CycleTimer.RemainingTime.lb","Remaining Time"):""})})})}),x.jsxRuntimeExports.jsxs(M.Box,{sx:{position:"relative",height:"48px",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:.5},children:[x.jsxRuntimeExports.jsx(M.Fade,{in:y&&a==="idle"&&!n,timeout:200,children:x.jsxRuntimeExports.jsxs(M.Typography,{variant:"body2",sx:{position:"absolute",fontSize:"12px",fontWeight:400,color:"rgba(255, 255, 255, 0.7)",lineHeight:"166%",letterSpacing:"0.17px",textAlign:"center",width:"200px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center"},children:[x.jsxRuntimeExports.jsx("span",{style:{opacity:v?1:.6,transition:"opacity 2s ease-in-out"},children:i("CycleTimer.WaitingForCycle.lb","Waiting for program cycle")}),x.jsxRuntimeExports.jsx("span",{style:{display:"inline-block",width:"18px",textAlign:"left",opacity:v?1:.6,transition:"opacity 2s ease-in-out"},children:".".repeat(T)})]})}),x.jsxRuntimeExports.jsx(M.Fade,{in:y&&n,timeout:200,children:x.jsxRuntimeExports.jsx(M.Typography,{variant:"h3",sx:{position:"absolute",fontSize:"40px",fontWeight:400,color:"#FFFFFF",lineHeight:"116.7%"},children:i("CycleTimer.Error.lb","Error")})}),x.jsxRuntimeExports.jsx(M.Fade,{in:y&&!n&&a!=="idle"&&a!=="success",timeout:300,children:x.jsxRuntimeExports.jsx(M.Typography,{variant:"h1",sx:{position:"absolute",fontSize:"48px",fontWeight:500,color:s.palette.text.primary,lineHeight:1,transition:"color 0.8s ease-in-out"},children:x.jsxRuntimeExports.jsx("span",{style:{opacity:1,transition:"opacity 2s ease-in-out"},children:YS(l)})})})]}),x.jsxRuntimeExports.jsx(M.Box,{sx:{height:"16px",display:"flex",marginTop:.5,alignItems:"center",justifyContent:"center"},children:x.jsxRuntimeExports.jsx(M.Fade,{in:p&&!n&&a!=="idle"&&a!=="success",timeout:300,children:x.jsxRuntimeExports.jsx(M.Typography,{variant:"body2",sx:{fontSize:"12px",color:a==="measured"&&(f||m)?s.palette.success.main:s.palette.text.secondary,transition:"color 0.8s ease-in-out"},children:x.jsxRuntimeExports.jsx("span",{style:{opacity:a==="measured"&&m?f?1:.6:1,transition:"opacity 2s ease-in-out"},children:a==="measuring"?i("CycleTimer.Measuring.lb","measuring..."):a==="measured"?i("CycleTimer.Determined.lb","determined"):a==="countdown"&&c!==null?i("CycleTimer.OfTime.lb",{time:lt(c,o.language)}):""})})})})]})]})},KS=({timerState:e,animationState:t,hasError:n,compact:r,className:i})=>{const{t:o,i18n:s}=fe.useTranslation(),a=M.useTheme(),{currentState:l,remainingTime:c,maxTime:u}=e,{showErrorAnimation:d,showPauseAnimation:h,showPulsatingText:f,pulsatingFinished:m,showIdlePulsating:p,idleDotsCount:y}=t;return r&&l==="idle"?x.jsxRuntimeExports.jsx(M.Box,{className:i,sx:{display:"flex",alignItems:"center",m:0},children:x.jsxRuntimeExports.jsx(M.Typography,{variant:"body2",sx:{color:n?a.palette.error.light:a.palette.text.primary,fontSize:"14px",transition:"color 0.5s ease-out"},children:n?o("CycleTimer.Error.lb","Error"):l==="idle"?"0s":lt(c,s.language)})}):x.jsxRuntimeExports.jsxs(M.Box,{className:i,sx:{display:"flex",alignItems:"center",m:0,gap:1},children:[!(l==="idle"&&r)&&x.jsxRuntimeExports.jsx(M.Box,{sx:{width:20,height:20,display:"flex",alignItems:"center",justifyContent:"center",opacity:h||d?.6:1,transition:"opacity 0.5s ease-out"},children:x.jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",style:{transform:"rotate(-90deg)"},role:"img","aria-label":"Timer progress",children:[x.jsxRuntimeExports.jsx("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:n?a.palette.error.light:l==="measured"?f||m?a.palette.success.main:a.palette.text.secondary:a.palette.success.main,strokeWidth:"2",opacity:l==="measured"&&m?f?1:.6:.3,style:{transition:"stroke 0.8s ease-in-out, opacity 2s ease-in-out"}}),x.jsxRuntimeExports.jsx("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:n?a.palette.error.light:l==="measured"?f||m?a.palette.success.main:a.palette.text.secondary:a.palette.success.main,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:`${2*Math.PI*8}`,strokeDashoffset:`${2*Math.PI*8*(1-(l==="idle"?0:e.currentProgress)/100)}`,style:{opacity:l==="measured"&&m?f?1:.6:1,transition:"stroke-dashoffset 0.1s ease-out, stroke 0.8s ease-in-out, opacity 2s ease-in-out"}})]})}),x.jsxRuntimeExports.jsx(M.Typography,{variant:"body2",sx:{color:n?a.palette.error.light:l==="idle"?"rgba(255, 255, 255, 0.7)":l==="measured"?f||m?a.palette.success.main:a.palette.text.secondary:a.palette.text.primary,fontSize:"14px",lineHeight:"normal",letterSpacing:"normal",opacity:l==="idle"?p?1:.6:l==="measured"&&m?f?1:.6:1,transition:"color 0.8s ease-in-out, font-size 0.3s ease-out, opacity 2s ease-in-out"},children:n?o("CycleTimer.Error.lb","Error"):l==="idle"?x.jsxRuntimeExports.jsxs(x.jsxRuntimeExports.Fragment,{children:[x.jsxRuntimeExports.jsx("span",{children:o("CycleTimer.WaitingForCycle.lb","Waiting for program cycle")}),x.jsxRuntimeExports.jsx("span",{style:{display:"inline-block",width:"18px",textAlign:"left"},children:".".repeat(y)})]}):l==="measuring"?r?lt(c,s.language):`${lt(c,s.language)} / ${o("CycleTimer.Measuring.lb","measuring...")}`:l==="measured"?r?lt(c,s.language):`${lt(c,s.language)} / ${o("CycleTimer.Determined.lb","determined")}`:l==="countdown"&&u!==null?r?lt(c,s.language):`${lt(c,s.language)} / ${o("CycleTimer.Time.lb",{time:lt(u,s.language)})}`:lt(c,s.language)})]})},XS=()=>{const[e,t]=$.useState({showPauseAnimation:!1,showErrorAnimation:!1,showPulsatingText:!1,pulsatingFinished:!1,showLabels:!0,showMainText:!0,showIdlePulsating:!1,idleDotsCount:0}),n=$.useRef(null),r=$.useRef(null),i=$.useRef(null),o=$.useRef(null),s=$.useRef(0),a=$.useRef(null),l=$.useRef(null),c=$.useCallback(()=>{t(w=>({...w,showPauseAnimation:!0})),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{t(w=>({...w,showPauseAnimation:!1}))},800)},[]),u=$.useCallback(()=>{t(w=>({...w,showErrorAnimation:!0})),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{t(w=>({...w,showErrorAnimation:!1}))},600)},[]),d=$.useCallback(()=>{t(w=>({...w,showErrorAnimation:!1})),r.current&&clearTimeout(r.current)},[]),h=$.useCallback(w=>{s.current=0,t(E=>({...E,showPulsatingText:!0,pulsatingFinished:!1})),setTimeout(()=>{t(E=>({...E,pulsatingFinished:!0})),i.current=setInterval(()=>{t(E=>({...E,showPulsatingText:!E.showPulsatingText}))},2e3),w&&w()},800)},[]),f=$.useCallback(()=>{i.current&&(clearInterval(i.current),i.current=null),t(w=>({...w,showPulsatingText:!1,pulsatingFinished:!1})),s.current=0},[]),m=$.useCallback(()=>{t(w=>({...w,showIdlePulsating:!0})),a.current=setInterval(()=>{t(w=>({...w,showIdlePulsating:!w.showIdlePulsating}))},2e3),l.current=setInterval(()=>{t(w=>({...w,idleDotsCount:(w.idleDotsCount+1)%4}))},800)},[]),p=$.useCallback(()=>{a.current&&(clearInterval(a.current),a.current=null),l.current&&(clearInterval(l.current),l.current=null),t(w=>({...w,showIdlePulsating:!1,idleDotsCount:0}))},[]),y=$.useCallback(()=>{t(w=>({...w,showLabels:!1,showMainText:!1})),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{t(w=>({...w,showLabels:!0,showMainText:!0}))},200)},[]),v=$.useCallback(()=>{t(w=>({...w,showLabels:!0,showMainText:!0}))},[]),T=$.useCallback(()=>{n.current&&clearTimeout(n.current),r.current&&clearTimeout(r.current),o.current&&clearTimeout(o.current),i.current&&clearInterval(i.current),a.current&&clearInterval(a.current),l.current&&clearInterval(l.current)},[]);return{animationState:e,triggerPauseAnimation:c,triggerErrorAnimation:u,clearErrorAnimation:d,startPulsatingAnimation:h,stopPulsatingAnimation:f,startIdleAnimations:m,stopIdleAnimations:p,triggerFadeTransition:y,setInitialAnimationState:v,cleanup:T}},ZS=({autoStart:e,onCycleEnd:t,onMeasuringComplete:n,hasError:r,onPauseAnimation:i,onErrorAnimation:o,onClearErrorAnimation:s,onStartPulsating:a})=>{const[l,c]=$.useState({currentState:"idle",remainingTime:0,maxTime:null,isRunning:!1,isPausedState:!1,currentProgress:0,wasRunningBeforeError:!1}),u=$.useRef(null),d=$.useRef(null),h=$.useRef(0),[f]=de.useInterpolation([0],{tension:80,friction:18,onChange:([R])=>{c(S=>({...S,currentProgress:R}))}}),m=$.useCallback(()=>{c(R=>({...R,currentState:"idle",maxTime:null,isRunning:!1,isPausedState:!1,currentProgress:0})),h.current=0,d.current=null,f.setImmediate([0])},[f]),p=$.useCallback((R=0)=>{const S=R/60%1*100;c(C=>({...C,currentState:"measuring",maxTime:null,remainingTime:R,isPausedState:!1,currentProgress:S})),h.current=0,f.setImmediate([S]),e?(d.current=Date.now()-R*1e3,c(C=>({...C,isRunning:!0}))):d.current=null},[e,f]),y=$.useCallback((R,S=0)=>{c(k=>({...k,isRunning:!1})),d.current=null,c(k=>({...k,currentState:"countdown",maxTime:R,isPausedState:!1})),h.current=0;const C=Math.max(0,R-S),I=S>0?S/R*100:0;c(k=>({...k,remainingTime:C,currentProgress:I})),f.setImmediate([I]),C===0?(c(k=>({...k,isRunning:!1})),d.current=null,t&&queueMicrotask(()=>t())):e?setTimeout(()=>{d.current=Date.now()-S*1e3,c(k=>({...k,isRunning:!0}))},0):d.current=null},[e,t,f]),v=$.useCallback(()=>{c(R=>({...R,isRunning:!1,currentState:"measured"})),d.current=null,a(()=>{n&&n()})},[a,n]),T=$.useCallback(()=>{if(d.current&&l.isRunning){const S=Date.now()-d.current;h.current+=S;const C=h.current/1e3,I=qS(l.currentState,C,l.maxTime);f.setTarget([I])}c(R=>({...R,isRunning:!1,isPausedState:!0})),i()},[l.isRunning,l.currentState,l.maxTime,f,i]),w=$.useCallback(()=>{l.isPausedState&&(l.remainingTime>0||l.currentState!=="countdown")&&(d.current=Date.now(),c(R=>({...R,isRunning:!0,isPausedState:!1})))},[l.isPausedState,l.remainingTime,l.currentState]),E=$.useCallback(()=>l.isPausedState,[l.isPausedState]);return $.useEffect(()=>{r?(l.isRunning&&!l.isPausedState&&(c(R=>({...R,wasRunningBeforeError:!0})),T()),o()):(l.wasRunningBeforeError&&l.isPausedState&&(c(R=>({...R,wasRunningBeforeError:!1})),w()),s())},[r,l.isRunning,l.isPausedState,l.wasRunningBeforeError,T,w,o,s]),$.useEffect(()=>{if(l.isRunning){const R=()=>{if(d.current){const C=(Date.now()-d.current+h.current)/1e3;if(l.currentState==="countdown"&&l.maxTime!==null){const I=Math.max(0,l.maxTime-C);c(P=>({...P,remainingTime:Math.ceil(I)}));const k=Math.min(100,C/l.maxTime*100);if(f.setTarget([k]),I<=0){c(P=>({...P,isRunning:!1,remainingTime:0})),d.current=null,f.setTarget([100]),t&&queueMicrotask(()=>t());return}}else if(l.currentState==="measuring"){c(k=>({...k,remainingTime:Math.floor(C)}));const I=C/60%1*100;f.setTarget([I])}l.isRunning&&(u.current=requestAnimationFrame(R))}};u.current=requestAnimationFrame(R)}else u.current&&(cancelAnimationFrame(u.current),u.current=null);return()=>{u.current&&cancelAnimationFrame(u.current)}},[l.isRunning,t,l.currentState,l.maxTime,f]),$.useEffect(()=>{let R=null;const S=()=>{f.update(1/60),R=requestAnimationFrame(S)};return R=requestAnimationFrame(S),()=>{R&&cancelAnimationFrame(R)}},[f]),{timerState:l,controls:{startNewCycle:y,startMeasuring:p,setIdle:m,completeMeasuring:v,pause:T,resume:w,isPaused:E}}},QS=x.externalizeComponent(oe.observer(({onCycleComplete:e,onCycleEnd:t,onMeasuringComplete:n,autoStart:r=!0,variant:i="default",compact:o=!1,className:s,hasError:a=!1})=>{const l=$.useRef(void 0),{animationState:c,triggerPauseAnimation:u,triggerErrorAnimation:d,clearErrorAnimation:h,startPulsatingAnimation:f,stopPulsatingAnimation:m,startIdleAnimations:p,stopIdleAnimations:y,triggerFadeTransition:v,setInitialAnimationState:T,cleanup:w}=XS(),{timerState:E,controls:R}=ZS({autoStart:r,onCycleEnd:t,onMeasuringComplete:n,hasError:a,onPauseAnimation:u,onErrorAnimation:d,onClearErrorAnimation:h,onStartPulsating:f});return $.useEffect(()=>{const S=l.current;l.current!==void 0&&S!==E.currentState?(S==="measured"&&m(),S==="idle"&&y(),v()):T(),E.currentState==="idle"&&p(),l.current=E.currentState},[E.currentState,m,y,p,v,T]),$.useEffect(()=>{let S=!0;const C=setTimeout(()=>{S&&e(R)},0);return()=>{S=!1,clearTimeout(C)}},[e,R]),$.useEffect(()=>w,[w]),i==="small"?x.jsxRuntimeExports.jsx(KS,{timerState:E,animationState:c,hasError:a,compact:o,className:s}):x.jsxRuntimeExports.jsx(JS,{timerState:E,animationState:c,hasError:a,className:s})})),xn=vm;process.env.NODE_ENV!=="production"&&(b.node,b.object.isRequired);function Ga(e){return gm(e)}function ew(e){return fn("MuiSvgIcon",e)}Zi("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const tw=e=>{const{color:t,fontSize:n,classes:r}=e,i={root:["root",t!=="inherit"&&`color${Pe(t)}`,`fontSize${Pe(n)}`]};return wr(i,ew,r)},nw=Ue("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${Pe(n.color)}`],t[`fontSize${Pe(n.fontSize)}`]]}})(xn(({theme:e})=>{var t,n,r,i,o,s,a,l,c,u,d,h,f,m;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(i=(t=e.transitions)==null?void 0:t.create)==null?void 0:i.call(t,"fill",{duration:(r=(n=(e.vars??e).transitions)==null?void 0:n.duration)==null?void 0:r.shorter}),variants:[{props:p=>!p.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((s=(o=e.typography)==null?void 0:o.pxToRem)==null?void 0:s.call(o,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((l=(a=e.typography)==null?void 0:a.pxToRem)==null?void 0:l.call(a,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((u=(c=e.typography)==null?void 0:c.pxToRem)==null?void 0:u.call(c,35))||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,p])=>p&&p.main).map(([p])=>{var y,v;return{props:{color:p},style:{color:(v=(y=(e.vars??e).palette)==null?void 0:y[p])==null?void 0:v.main}}}),{props:{color:"action"},style:{color:(h=(d=(e.vars??e).palette)==null?void 0:d.action)==null?void 0:h.active}},{props:{color:"disabled"},style:{color:(m=(f=(e.vars??e).palette)==null?void 0:f.action)==null?void 0:m.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),Li=j.forwardRef(function(t,n){const r=Ga({props:t,name:"MuiSvgIcon"}),{children:i,className:o,color:s="inherit",component:a="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:u=!1,titleAccess:d,viewBox:h="0 0 24 24",...f}=r,m=j.isValidElement(i)&&i.type==="svg",p={...r,color:s,component:a,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:u,viewBox:h,hasSvgAsChild:m},y={};u||(y.viewBox=h);const v=tw(p);return x.jsxRuntimeExports.jsxs(nw,{as:a,className:De(v.root,o),focusable:"false",color:c,"aria-hidden":d?void 0:!0,role:d?"img":void 0,ref:n,...y,...f,...m&&i.props,ownerState:p,children:[m?i.props.children:i,d?x.jsxRuntimeExports.jsx("title",{children:d}):null]})});process.env.NODE_ENV!=="production"&&(Li.propTypes={children:b.node,classes:b.object,className:b.string,color:b.oneOfType([b.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),b.string]),component:b.elementType,fontSize:b.oneOfType([b.oneOf(["inherit","large","medium","small"]),b.string]),htmlColor:b.string,inheritViewBox:b.bool,shapeRendering:b.string,sx:b.oneOfType([b.arrayOf(b.oneOfType([b.func,b.object,b.bool])),b.func,b.object]),titleAccess:b.string,viewBox:b.string});Li.muiName="SvgIcon";function Kt(e,t){function n(r,i){return x.jsxRuntimeExports.jsx(Li,{"data-testid":process.env.NODE_ENV!=="production"?`${t}Icon`:void 0,ref:i,...r,children:e})}return process.env.NODE_ENV!=="production"&&(n.displayName=`${t}Icon`),n.muiName=Li.muiName,j.memo(j.forwardRef(n))}function rw(e){const{controlled:t,default:n,name:r,state:i="value"}=e,{current:o}=j.useRef(t!==void 0),[s,a]=j.useState(n),l=o?t:s;if(process.env.NODE_ENV!=="production"){j.useEffect(()=>{o!==(t!==void 0)&&console.error([`MUI: A component is changing the ${o?"":"un"}controlled ${i} state of ${r} to be ${o?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${r} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
|
|
127
|
+
`))},[i,r,t]);const{current:u}=j.useRef(n);j.useEffect(()=>{!o&&JSON.stringify(n)!==JSON.stringify(u)&&console.error([`MUI: A component is changing the default ${i} state of an uncontrolled ${r} after being initialized. To suppress this warning opt to use a controlled ${r}.`].join(`
|
|
128
|
+
`))},[JSON.stringify(n)])}const c=j.useCallback(u=>{o||a(u)},[]);return[l,c]}const iw=Kt(x.jsxRuntimeExports.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear"),ow=Kt(x.jsxRuntimeExports.jsx("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList"),$c=Kt(x.jsxRuntimeExports.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search"),Eh=x.externalizeComponent(oe.observer(({data:e,columns:t,getRowData:n,onRowClick:r,selectedItem:i,getItemId:o,title:s,showCount:a=!0,searchPlaceholder:l="Search programs",dataGridProps:c,CustomToolbar:u,selectFirstByDefault:d=!1,sx:h})=>{var I;const f=M.useTheme(),m=Qe.useGridApiRef(),p=$.useRef(null),[y,v]=$.useState(null),T=$.useMemo(()=>e.map(n),[e,n]);$.useEffect(()=>{m.current&&T.length>0&&m.current.autosizeColumns({includeOutliers:!0,includeHeaders:!0,expand:!0,columns:t.map(k=>k.field)})},[T,t,m]),$.useEffect(()=>{if(!p.current||!m.current)return;const k=new ResizeObserver(()=>{setTimeout(()=>{m.current&&T.length>0&&m.current.autosizeColumns({includeOutliers:!0,includeHeaders:!0,expand:!0,columns:t.map(P=>P.field)})},100)});return k.observe(p.current),()=>{k.disconnect()}},[m,T.length,t]);const w=$.useMemo(()=>{if(i!==void 0)return i;if(y!==null)return y;if(d&&e.length>0){const k=e[0];return v(k),k}return null},[d,e,i,y]),E=k=>{const P=e.find(D=>n(D).id===k.id);P&&(i===void 0&&v(P),r&&r(P,k))},R=$.useMemo(()=>!w||!o?null:o(w),[w,o]);function S(){return x.jsxRuntimeExports.jsx(Qe.Toolbar,{children:x.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",width:"100%",gap:1,p:.5,alignItems:"center"},children:[s&&x.jsxRuntimeExports.jsxs(M.Typography,{variant:"h6",sx:{fontWeight:500,color:"white"},children:[s,a&&` (${e.length})`]}),x.jsxRuntimeExports.jsxs(M.Box,{sx:{ml:"auto",display:"flex",gap:.5,alignItems:"center",pr:1},children:[x.jsxRuntimeExports.jsx(Qe.FilterPanelTrigger,{render:x.jsxRuntimeExports.jsx(Qe.ToolbarButton,{"aria-label":"Show filters",children:x.jsxRuntimeExports.jsx(ow,{fontSize:"small"})})}),x.jsxRuntimeExports.jsx(M.Divider,{orientation:"vertical",flexItem:!0,sx:{height:"24px",alignSelf:"center"}}),x.jsxRuntimeExports.jsx(Qe.QuickFilter,{render:(k,P)=>x.jsxRuntimeExports.jsxs(M.Box,{...k,sx:{display:"flex",overflow:"hidden"},children:[!P.expanded&&x.jsxRuntimeExports.jsx(Qe.QuickFilterTrigger,{render:x.jsxRuntimeExports.jsx(Qe.ToolbarButton,{"aria-label":"Search",children:x.jsxRuntimeExports.jsx($c,{fontSize:"small"})})}),x.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",overflow:"hidden",transition:"all 0.3s ease-in-out",width:P.expanded?"200px":"0px",position:"relative"},children:[x.jsxRuntimeExports.jsxs(M.Box,{sx:{flex:1,position:"relative","& .MuiInputBase-root":{height:"32px",borderRadius:"16px",backgroundColor:"#171927",paddingLeft:"40px",paddingRight:P.expanded&&P.value!==""?"40px":"12px",color:"white",fontSize:"14px",border:"none !important",outline:"none !important",boxShadow:"none !important","&::before":{display:"none !important",border:"none !important"},"&::after":{display:"none !important",border:"none !important"},"&:hover":{"&::before":{display:"none !important",border:"none !important"},"&::after":{display:"none !important",border:"none !important"}},"&:focus-within":{outline:"none !important",boxShadow:"none !important","&::before":{display:"none !important",border:"none !important"},"&::after":{display:"none !important",border:"none !important"}},"&.Mui-focused":{outline:"none !important",boxShadow:"none !important","&::before":{display:"none !important",border:"none !important"},"&::after":{display:"none !important",border:"none !important"}},"& .MuiInputBase-input":{padding:"8px 0",border:"none !important",outline:"none !important",boxShadow:"none !important","&:focus":{outline:"none !important",boxShadow:"none !important",border:"none !important"},"&::placeholder":{color:"rgba(255, 255, 255, 0.3)",opacity:1}},"& fieldset":{border:"none !important",display:"none !important"},"& .MuiOutlinedInput-notchedOutline":{border:"none !important",display:"none !important"}}},children:[P.expanded&&x.jsxRuntimeExports.jsx($c,{fontSize:"small",sx:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:"rgba(255, 255, 255, 0.6)",zIndex:1,pointerEvents:"none"}}),x.jsxRuntimeExports.jsx(Qe.QuickFilterControl,{placeholder:l})]}),P.expanded&&P.value!==""&&x.jsxRuntimeExports.jsx(Qe.QuickFilterClear,{render:x.jsxRuntimeExports.jsx(M.Box,{sx:{position:"absolute",right:"8px",top:"50%",transform:"translateY(-50%)",zIndex:1},children:x.jsxRuntimeExports.jsx(M.Box,{sx:{minWidth:"24px",width:"24px",height:"24px",padding:0,color:"rgba(255, 255, 255, 0.6)","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.1)"}},children:x.jsxRuntimeExports.jsx(Qe.ToolbarButton,{"aria-label":"Clear",children:x.jsxRuntimeExports.jsx(iw,{fontSize:"small"})})})})})]})]})})]})]})})}const C=u||S;return x.jsxRuntimeExports.jsx(M.Box,{ref:p,sx:{height:"100%",display:"flex",flexDirection:"column","& *":{scrollbarWidth:"none",msOverflowStyle:"none","&::-webkit-scrollbar":{display:"none"}},"&:hover *":{scrollbarWidth:"thin",scrollbarColor:`${f.palette.divider} transparent`,"&::-webkit-scrollbar":{display:"block",width:"8px",height:"8px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:f.palette.divider,borderRadius:"4px"},"&::-webkit-scrollbar-thumb:hover":{background:f.palette.action.hover}},...h},children:x.jsxRuntimeExports.jsx(Qe.DataGrid,{apiRef:m,rows:T,columns:t,onRowClick:E,disableColumnMenu:!1,disableRowSelectionOnClick:!0,disableMultipleRowSelection:!0,hideFooterSelectedRowCount:!0,filterMode:"client",sortingOrder:["desc","asc"],hideFooter:!1,showToolbar:!0,slots:{toolbar:C},initialState:{sorting:{sortModel:[]},filter:{filterModel:{items:[]}},...c==null?void 0:c.initialState},...c,autosizeOnMount:!0,autosizeOptions:{...(c==null?void 0:c.autosizeOptions)||{},includeOutliers:!0,includeHeaders:!0,expand:!0,columns:((I=c==null?void 0:c.autosizeOptions)==null?void 0:I.columns)||t.map(k=>k.field)},sx:{border:"none",width:"100%","& .MuiPaper-root":{boxShadow:"none !important"},"& .MuiDataGrid-overlay":{},"& .MuiDataGrid-main":{border:"none","& .MuiPaper-root":{}},"& .MuiDataGrid-container--top [role=row]":{},"& .MuiDataGrid-topContainer":{borderBottom:"none !important"},"& .MuiDataGrid-columnHeaders":{border:"none",borderBottom:"none !important"},"& .MuiDataGrid-row":{cursor:r?"pointer":"default",border:"none",margin:"1px 0",position:"relative",backgroundColor:"transparent !important","&:hover":{backgroundColor:"transparent !important","&::before":{content:'""',position:"absolute",top:0,left:"16px",right:"16px",bottom:0,backgroundColor:"action.hover",borderRadius:"16px",zIndex:0}},"&.Mui-selected":{backgroundColor:"transparent !important","&:hover":{backgroundColor:"transparent !important"}},...R!==null&&{[`&[data-id="${R}"]`]:{backgroundColor:"transparent !important","&::before":{content:'""',position:"absolute",top:0,left:"16px",right:"16px",bottom:0,backgroundColor:"rgba(255, 255, 255, 0.08) !important",borderRadius:"16px",zIndex:0},"&:hover":{backgroundColor:"transparent !important"},"&:hover::before":{backgroundColor:"rgba(255, 255, 255, 0.12) !important"}}}},"& .MuiDataGrid-cell--textLeft":{paddingLeft:"40px"},"& .MuiDataGrid-cell":{border:"none",position:"relative",zIndex:1,"&:focus":{outline:"none"},"&:focus-within":{outline:"none"},"&:hover":{backgroundColor:"transparent !important"}},"& .MuiDataGrid-columnHeader":{border:"none",paddingLeft:"40px",paddingRight:"40px","& .MuiDataGrid-columnHeaderTitle":{color:"rgba(255, 255, 255, 0.6)"}},"& .MuiDataGrid-toolbarContainer":{padding:"8px",border:"none !important",borderBottom:"none !important","& .MuiBox-root":{},"& .MuiFormControl-root":{},"& .MuiInputBase-root":{},"& .MuiPaper-root":{boxShadow:"none !important"},"& *":{borderBottom:"none !important"}},"& .MuiDataGrid-toolbar":{borderBottom:"none !important"},"& .MuiDataGrid-toolbarFilterList":{border:"none"},"& .MuiDataGrid-withBorderColor":{borderColor:"transparent !important"},"& .MuiDataGrid-columnSeparator":{display:"none"},"& .MuiDataGrid-footerContainer":{display:"none"},"& .MuiDataGrid-filler":{border:"none !important",borderTop:"none !important",borderBottom:"none !important",borderLeft:"none !important",borderRight:"none !important","--rowBorderColor":"none !important"},"& .MuiBackdrop-root":{},"& .MuiModal-backdrop":{},...c==null?void 0:c.sx}})})}));Eh.displayName="WandelbotsDataGrid";const Ln=km({createStyledComponent:Ue("div",{name:"MuiStack",slot:"Root"}),useThemeProps:e=>Ga({props:e,name:"MuiStack"})});process.env.NODE_ENV!=="production"&&(Ln.propTypes={children:b.node,component:b.elementType,direction:b.oneOfType([b.oneOf(["column-reverse","column","row-reverse","row"]),b.arrayOf(b.oneOf(["column-reverse","column","row-reverse","row"])),b.object]),divider:b.node,spacing:b.oneOfType([b.arrayOf(b.oneOfType([b.number,b.string])),b.number,b.object,b.string]),sx:b.oneOfType([b.arrayOf(b.oneOfType([b.func,b.object,b.bool])),b.func,b.object]),useFlexGap:b.bool});const sw=({title:e,titleId:t,...n},r)=>j.createElement("svg",{width:21,height:21,viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?j.createElement("title",{id:t},e):null,j.createElement("g",{id:"JogMinus"},j.createElement("path",{id:"Minus",d:"M0 13V8H21V13H0Z",fill:"white"}))),aw=$.forwardRef(sw),lw=({title:e,titleId:t,...n},r)=>j.createElement("svg",{width:21,height:21,viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?j.createElement("title",{id:t},e):null,j.createElement("g",{id:"JogPlus"},j.createElement("g",{id:"Plus"},j.createElement("path",{d:"M0 13V8H8V13H0Z",fill:"white"}),j.createElement("path",{d:"M8 0L13 2.18557e-07L13 21H8L8 0Z",fill:"white"}),j.createElement("path",{d:"M13 13V8H21V13H13Z",fill:"white"})))),cw=$.forwardRef(lw),Ds=x.externalizeComponent(oe.observer(({colors:e,label:t,getDisplayedValue:n,startJogging:r,stopJogging:i,disabled:o,activeJoggingDirection:s,...a})=>{var w,E,R,S,C,I,k;de.useAnimationFrame(()=>{const P=n(),D=h.current;D&&(D.textContent=P)});const l=M.useTheme(),[c,u]=$.useState(null);$.useEffect(()=>{o&&T()},[o]);const d=s||c,h=$.useRef(null);e||(e={color:"#fff",backgroundColor:"#000",borderColor:"#000",buttonBackgroundColor:{disabled:"#000",default:"#000",hovered:"#000",pressed:"#000"},labelColor:"#000"});const f=d?(w=e.buttonBackgroundColor)==null?void 0:w.pressed:e.borderColor,m={width:"55px",color:e.color,path:{fill:e.color},alignContent:"center",fontSize:"37px",svg:{pointerEvents:"none"}},p={...m,backgroundColor:(E=e.buttonBackgroundColor)==null?void 0:E.default,":hover":{backgroundColor:(R=e.buttonBackgroundColor)==null?void 0:R.hovered},":active":{backgroundColor:(S=e.buttonBackgroundColor)==null?void 0:S.pressed,color:e.backgroundColor,path:{fill:e.backgroundColor}},":disabled":{backgroundColor:(C=e.buttonBackgroundColor)==null?void 0:C.disabled,"svg path":{fill:l.palette.action.disabled}}},y={...m,backgroundColor:(I=e.buttonBackgroundColor)==null?void 0:I.pressed,color:e.backgroundColor,path:{fill:e.backgroundColor},":disabled":{backgroundColor:(k=e.buttonBackgroundColor)==null?void 0:k.pressed,"svg path":{fill:l.palette.action.disabled}}};function v(P,D){o||P.button===0&&(u(D),r(D))}function T(){u(null),i()}return x.jsxRuntimeExports.jsxs(Ln,{height:"64px",direction:"row",justifyContent:"center",...a,children:[x.jsxRuntimeExports.jsx(M.IconButton,{disabled:o,disableRipple:!0,onPointerDown:P=>v(P,"-"),onPointerUp:T,onPointerOut:T,size:"large",sx:{...d==="-"?y:p,borderRadius:"16px 0px 0px 16px",borderLeft:`2px solid ${f??"#fff"}`,borderBottom:`2px solid ${f??"#fff"}`,borderTop:`2px solid ${f??"#fff"}`},children:x.jsxRuntimeExports.jsx(aw,{})}),x.jsxRuntimeExports.jsxs(Ln,{spacing:"6px",sx:{width:"150px",backgroundColor:e.backgroundColor,alignItems:"center",justifyContent:"center",opacity:"0.9",borderBottom:`2px solid ${f??"#fff"}`,borderTop:`2px solid ${f??"#fff"}`},children:[x.jsxRuntimeExports.jsx(Ln,{height:"22px",direction:"row",alignItems:"center",justifyItems:"center",spacing:1,sx:{userSelect:"none",color:e.color,".MuiTypography-root":{fontWeight:700,...o?{color:l.palette.action.disabled}:{}},...o?{"svg path":{fill:l.palette.action.disabled}}:{}},children:t}),x.jsxRuntimeExports.jsx(M.Typography,{height:"22px",sx:{fontSize:"15px",color:o?l.palette.action.disabled:e.color,fontWeight:700},ref:h,children:n()})]}),x.jsxRuntimeExports.jsx(M.IconButton,{disableRipple:!0,disabled:o,onPointerDown:P=>v(P,"+"),onPointerUp:T,onPointerOut:T,size:"large",sx:{...d==="+"?y:p,borderRadius:"0px 16px 16px 0px",borderRight:`2px solid ${f??"#fff"}`,borderBottom:`2px solid ${f??"#fff"}`,borderTop:`2px solid ${f??"#fff"}`},children:x.jsxRuntimeExports.jsx(cw,{})})]})})),uw=Kt(x.jsxRuntimeExports.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft"),dw=Kt(x.jsxRuntimeExports.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");function un(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Th=typeof global=="object"&&global&&global.Object===Object&&global,hw=typeof self=="object"&&self&&self.Object===Object&&self,yt=Th||hw||Function("return this")(),us=function(){return yt.Date.now()},fw=/\s/;function pw(e){for(var t=e.length;t--&&fw.test(e.charAt(t)););return t}var mw=/^\s+/;function gw(e){return e&&e.slice(0,pw(e)+1).replace(mw,"")}var Vt=yt.Symbol,Ch=Object.prototype,yw=Ch.hasOwnProperty,xw=Ch.toString,nr=Vt?Vt.toStringTag:void 0;function bw(e){var t=yw.call(e,nr),n=e[nr];try{e[nr]=void 0;var r=!0}catch{}var i=xw.call(e);return r&&(t?e[nr]=n:delete e[nr]),i}var vw=Object.prototype,Sw=vw.toString;function ww(e){return Sw.call(e)}var Ew="[object Null]",Tw="[object Undefined]",Lc=Vt?Vt.toStringTag:void 0;function bn(e){return e==null?e===void 0?Tw:Ew:Lc&&Lc in Object(e)?bw(e):ww(e)}function dn(e){return e!=null&&typeof e=="object"}var Cw="[object Symbol]";function Mo(e){return typeof e=="symbol"||dn(e)&&bn(e)==Cw}var Nc=NaN,_w=/^[-+]0x[0-9a-f]+$/i,Mw=/^0b[01]+$/i,Rw=/^0o[0-7]+$/i,Aw=parseInt;function zc(e){if(typeof e=="number")return e;if(Mo(e))return Nc;if(un(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=un(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=gw(e);var n=Mw.test(e);return n||Rw.test(e)?Aw(e.slice(2),n?2:8):_w.test(e)?Nc:+e}var Iw="Expected a function",jw=Math.max,kw=Math.min;function Ow(e,t,n){var r,i,o,s,a,l,c=0,u=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(Iw);t=zc(t)||0,un(n)&&(u=!!n.leading,d="maxWait"in n,o=d?jw(zc(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h);function f(S){var C=r,I=i;return r=i=void 0,c=S,s=e.apply(I,C),s}function m(S){return c=S,a=setTimeout(v,t),u?f(S):s}function p(S){var C=S-l,I=S-c,k=t-C;return d?kw(k,o-I):k}function y(S){var C=S-l,I=S-c;return l===void 0||C>=t||C<0||d&&I>=o}function v(){var S=us();if(y(S))return T(S);a=setTimeout(v,p(S))}function T(S){return a=void 0,h&&r?f(S):(r=i=void 0,s)}function w(){a!==void 0&&clearTimeout(a),c=0,r=l=i=a=void 0}function E(){return a===void 0?s:T(us())}function R(){var S=us(),C=y(S);if(r=arguments,i=this,l=S,C){if(a===void 0)return m(l);if(d)return clearTimeout(a),a=setTimeout(v,t),f(l)}return a===void 0&&(a=setTimeout(v,t)),s}return R.cancel=w,R.flush=E,R}var Pw="Expected a function";function Dw(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(Pw);return un(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Ow(e,t,{leading:r,maxWait:t,trailing:i})}const _h=x.externalizeComponent(oe.observer(({startJogging:e,stopJogging:t,lowerLimitDegs:n,upperLimitDegs:r,getValueDegs:i,disabled:o,...s})=>{var w,E,R,S,C,I,k,P,D,g,A,_,z,N,W;const{t:a}=fe.useTranslation(),[l,c]=$.useState(),u=M.useTheme(),d={background:(w=u.palette.backgroundPaperElevation)==null?void 0:w[4],color:(E=u.palette.backgroundPaperElevation)==null?void 0:E[11]},h=oe.useLocalObservable(()=>({activeJoggingDir:null,startJogging(B){this.activeJoggingDir=B,e(B)},stopJogging(){this.activeJoggingDir=null,t()}})),f=Dw(()=>{c(i())},50);de.useAnimationFrame(f);function m(B){B.button===0&&h.startJogging("-")}function p(B){B.button===0&&h.startJogging("+")}function y(B){h.stopJogging()}function v(B){h.stopJogging()}function T(B,Z=1){if(B===void 0||isNaN(B))return"";const Q=a("General.degree.variable",{amount:B.toFixed(Z)});return B>0&&Z===0?`+${Q}`:Q}return x.jsxRuntimeExports.jsxs(Ln,{height:"64px",width:"100%",maxWidth:"260px",direction:"row",...s,sx:{"& .MuiIconButton-root":{width:"52px",color:u.palette.text.primary,alignContent:"center",backgroundColor:(R=u.palette.backgroundPaperElevation)==null?void 0:R[11],"& svg":{width:"42px",height:"42px"},"&.Mui-disabled":{backgroundColor:(S=u.palette.backgroundPaperElevation)==null?void 0:S[11],color:u.palette.action.disabled,opacity:1},"&:hover":{backgroundColor:(C=u.palette.backgroundPaperElevation)==null?void 0:C[9]},"&:active":{...d}}},children:[x.jsxRuntimeExports.jsx(M.IconButton,{onPointerDown:m,onPointerUp:y,onPointerOut:v,disabled:o,disableRipple:!0,sx:{borderRadius:"16px 0px 0px 16px",...h.activeJoggingDir==="-"?d:{}},children:x.jsxRuntimeExports.jsx(uw,{sx:{pointerEvents:"none",color:(D=(P=(k=(I=u.componentsExt)==null?void 0:I.JoggingPanel)==null?void 0:k.JoggingJoint)==null?void 0:P.Joint)==null?void 0:D.arrowColor}})}),x.jsxRuntimeExports.jsxs(Ln,{flexGrow:1,alignItems:"center",justifyContent:"center",sx:{borderStyle:"solid",borderLeftWidth:0,borderRightWidth:0,border:"none",backgroundColor:(g=u.palette.backgroundPaperElevation)==null?void 0:g[11],paddingLeft:"20px",paddingRight:"20px",zIndex:1},children:[x.jsxRuntimeExports.jsx(M.Typography,{sx:{fontSize:"15px",fontWeight:700,position:"relative",top:"5px",color:o?u.palette.action.disabled:u.palette.text.primary},children:T(l)}),x.jsxRuntimeExports.jsx(M.Slider,{disabled:!0,"aria-label":"Joint position",min:n,max:r,value:l||0,track:!1,sx:{"& .MuiSlider-mark":{display:"none"},"& .MuiSlider-thumb":{width:"5px",height:"12px",borderRadius:"2px",color:o?u.palette.action.disabled:u.palette.text.primary},"& .MuiSlider-markLabel":{top:"20px",fontSize:"12px",color:o?u.palette.action.disabled:u.palette.text.secondary},"& .MuiSlider-rail":{backgroundColor:(A=u.palette.backgroundPaperElevation)==null?void 0:A[5],opacity:1}},marks:n!==void 0&&r!==void 0&&[{value:n,label:T(n,0)},{value:r,label:T(r,0)}]})]}),x.jsxRuntimeExports.jsx(M.IconButton,{onPointerDown:p,onPointerUp:y,onPointerOut:v,disabled:o,disableRipple:!0,sx:{borderRadius:"0px 16px 16px 0px",...h.activeJoggingDir==="+"?d:{}},children:x.jsxRuntimeExports.jsx(dw,{sx:{pointerEvents:"none",color:(W=(N=(z=(_=u.componentsExt)==null?void 0:_.JoggingPanel)==null?void 0:z.JoggingJoint)==null?void 0:N.Joint)==null?void 0:W.arrowColor}})})]})})),$w=Kt(x.jsxRuntimeExports.jsx("path",{d:"M10 9h4V6h3l-5-5-5 5h3zm-1 1H6V7l-5 5 5 5v-3h3zm14 2-5-5v3h-3v4h3v3zm-9 3h-4v3H7l5 5 5-5h-3z"}),"OpenWith"),Lw=Kt(x.jsxRuntimeExports.jsx("path",{d:"M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92"}),"Share");function Nw(...e){const t="THREE."+e.shift();console.warn(t,...e)}function Et(e,t,n){return Math.max(t,Math.min(n,e))}class zw{constructor(t=0,n=0,r=0,i=1){this.isQuaternion=!0,this._x=t,this._y=n,this._z=r,this._w=i}static slerpFlat(t,n,r,i,o,s,a){let l=r[i+0],c=r[i+1],u=r[i+2],d=r[i+3],h=o[s+0],f=o[s+1],m=o[s+2],p=o[s+3];if(a<=0){t[n+0]=l,t[n+1]=c,t[n+2]=u,t[n+3]=d;return}if(a>=1){t[n+0]=h,t[n+1]=f,t[n+2]=m,t[n+3]=p;return}if(d!==p||l!==h||c!==f||u!==m){let y=l*h+c*f+u*m+d*p;y<0&&(h=-h,f=-f,m=-m,p=-p,y=-y);let v=1-a;if(y<.9995){const T=Math.acos(y),w=Math.sin(T);v=Math.sin(v*T)/w,a=Math.sin(a*T)/w,l=l*v+h*a,c=c*v+f*a,u=u*v+m*a,d=d*v+p*a}else{l=l*v+h*a,c=c*v+f*a,u=u*v+m*a,d=d*v+p*a;const T=1/Math.sqrt(l*l+c*c+u*u+d*d);l*=T,c*=T,u*=T,d*=T}}t[n]=l,t[n+1]=c,t[n+2]=u,t[n+3]=d}static multiplyQuaternionsFlat(t,n,r,i,o,s){const a=r[i],l=r[i+1],c=r[i+2],u=r[i+3],d=o[s],h=o[s+1],f=o[s+2],m=o[s+3];return t[n]=a*m+u*d+l*f-c*h,t[n+1]=l*m+u*h+c*d-a*f,t[n+2]=c*m+u*f+a*h-l*d,t[n+3]=u*m-a*d-l*h-c*f,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,n,r,i){return this._x=t,this._y=n,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,n=!0){const r=t._x,i=t._y,o=t._z,s=t._order,a=Math.cos,l=Math.sin,c=a(r/2),u=a(i/2),d=a(o/2),h=l(r/2),f=l(i/2),m=l(o/2);switch(s){case"XYZ":this._x=h*u*d+c*f*m,this._y=c*f*d-h*u*m,this._z=c*u*m+h*f*d,this._w=c*u*d-h*f*m;break;case"YXZ":this._x=h*u*d+c*f*m,this._y=c*f*d-h*u*m,this._z=c*u*m-h*f*d,this._w=c*u*d+h*f*m;break;case"ZXY":this._x=h*u*d-c*f*m,this._y=c*f*d+h*u*m,this._z=c*u*m+h*f*d,this._w=c*u*d-h*f*m;break;case"ZYX":this._x=h*u*d-c*f*m,this._y=c*f*d+h*u*m,this._z=c*u*m-h*f*d,this._w=c*u*d+h*f*m;break;case"YZX":this._x=h*u*d+c*f*m,this._y=c*f*d+h*u*m,this._z=c*u*m-h*f*d,this._w=c*u*d-h*f*m;break;case"XZY":this._x=h*u*d-c*f*m,this._y=c*f*d-h*u*m,this._z=c*u*m+h*f*d,this._w=c*u*d+h*f*m;break;default:Nw("Quaternion: .setFromEuler() encountered an unknown order: "+s)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,n){const r=n/2,i=Math.sin(r);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(t){const n=t.elements,r=n[0],i=n[4],o=n[8],s=n[1],a=n[5],l=n[9],c=n[2],u=n[6],d=n[10],h=r+a+d;if(h>0){const f=.5/Math.sqrt(h+1);this._w=.25/f,this._x=(u-l)*f,this._y=(o-c)*f,this._z=(s-i)*f}else if(r>a&&r>d){const f=2*Math.sqrt(1+r-a-d);this._w=(u-l)/f,this._x=.25*f,this._y=(i+s)/f,this._z=(o+c)/f}else if(a>d){const f=2*Math.sqrt(1+a-r-d);this._w=(o-c)/f,this._x=(i+s)/f,this._y=.25*f,this._z=(l+u)/f}else{const f=2*Math.sqrt(1+d-r-a);this._w=(s-i)/f,this._x=(o+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(t,n){let r=t.dot(n)+1;return r<1e-8?(r=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=r):(this._x=0,this._y=-t.z,this._z=t.y,this._w=r)):(this._x=t.y*n.z-t.z*n.y,this._y=t.z*n.x-t.x*n.z,this._z=t.x*n.y-t.y*n.x,this._w=r),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Et(this.dot(t),-1,1)))}rotateTowards(t,n){const r=this.angleTo(t);if(r===0)return this;const i=Math.min(1,n/r);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,n){const r=t._x,i=t._y,o=t._z,s=t._w,a=n._x,l=n._y,c=n._z,u=n._w;return this._x=r*u+s*a+i*c-o*l,this._y=i*u+s*l+o*a-r*c,this._z=o*u+s*c+r*l-i*a,this._w=s*u-r*a-i*l-o*c,this._onChangeCallback(),this}slerp(t,n){if(n<=0)return this;if(n>=1)return this.copy(t);let r=t._x,i=t._y,o=t._z,s=t._w,a=this.dot(t);a<0&&(r=-r,i=-i,o=-o,s=-s,a=-a);let l=1-n;if(a<.9995){const c=Math.acos(a),u=Math.sin(c);l=Math.sin(l*c)/u,n=Math.sin(n*c)/u,this._x=this._x*l+r*n,this._y=this._y*l+i*n,this._z=this._z*l+o*n,this._w=this._w*l+s*n,this._onChangeCallback()}else this._x=this._x*l+r*n,this._y=this._y*l+i*n,this._z=this._z*l+o*n,this._w=this._w*l+s*n,this.normalize();return this}slerpQuaternions(t,n,r){return this.copy(t).slerp(n,r)}random(){const t=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),r=Math.random(),i=Math.sqrt(1-r),o=Math.sqrt(r);return this.set(i*Math.sin(t),i*Math.cos(t),o*Math.sin(n),o*Math.cos(n))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,n=0){return this._x=t[n],this._y=t[n+1],this._z=t[n+2],this._w=t[n+3],this._onChangeCallback(),this}toArray(t=[],n=0){return t[n]=this._x,t[n+1]=this._y,t[n+2]=this._z,t[n+3]=this._w,t}fromBufferAttribute(t,n){return this._x=t.getX(n),this._y=t.getY(n),this._z=t.getZ(n),this._w=t.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Nn{constructor(t=0,n=0,r=0){Nn.prototype.isVector3=!0,this.x=t,this.y=n,this.z=r}set(t,n,r){return r===void 0&&(r=this.z),this.x=t,this.y=n,this.z=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this.z=t.z+n.z,this}addScaledVector(t,n){return this.x+=t.x*n,this.y+=t.y*n,this.z+=t.z*n,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,n){return this.x=t.x*n.x,this.y=t.y*n.y,this.z=t.z*n.z,this}applyEuler(t){return this.applyQuaternion(Fc.setFromEuler(t))}applyAxisAngle(t,n){return this.applyQuaternion(Fc.setFromAxisAngle(t,n))}applyMatrix3(t){const n=this.x,r=this.y,i=this.z,o=t.elements;return this.x=o[0]*n+o[3]*r+o[6]*i,this.y=o[1]*n+o[4]*r+o[7]*i,this.z=o[2]*n+o[5]*r+o[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const n=this.x,r=this.y,i=this.z,o=t.elements,s=1/(o[3]*n+o[7]*r+o[11]*i+o[15]);return this.x=(o[0]*n+o[4]*r+o[8]*i+o[12])*s,this.y=(o[1]*n+o[5]*r+o[9]*i+o[13])*s,this.z=(o[2]*n+o[6]*r+o[10]*i+o[14])*s,this}applyQuaternion(t){const n=this.x,r=this.y,i=this.z,o=t.x,s=t.y,a=t.z,l=t.w,c=2*(s*i-a*r),u=2*(a*n-o*i),d=2*(o*r-s*n);return this.x=n+l*c+s*d-a*u,this.y=r+l*u+a*c-o*d,this.z=i+l*d+o*u-s*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const n=this.x,r=this.y,i=this.z,o=t.elements;return this.x=o[0]*n+o[4]*r+o[8]*i,this.y=o[1]*n+o[5]*r+o[9]*i,this.z=o[2]*n+o[6]*r+o[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,n){return this.x=Et(this.x,t.x,n.x),this.y=Et(this.y,t.y,n.y),this.z=Et(this.z,t.z,n.z),this}clampScalar(t,n){return this.x=Et(this.x,t,n),this.y=Et(this.y,t,n),this.z=Et(this.z,t,n),this}clampLength(t,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Et(r,t,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this.z+=(t.z-this.z)*n,this}lerpVectors(t,n,r){return this.x=t.x+(n.x-t.x)*r,this.y=t.y+(n.y-t.y)*r,this.z=t.z+(n.z-t.z)*r,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,n){const r=t.x,i=t.y,o=t.z,s=n.x,a=n.y,l=n.z;return this.x=i*l-o*a,this.y=o*s-r*l,this.z=r*a-i*s,this}projectOnVector(t){const n=t.lengthSq();if(n===0)return this.set(0,0,0);const r=t.dot(this)/n;return this.copy(t).multiplyScalar(r)}projectOnPlane(t){return ds.copy(this).projectOnVector(t),this.sub(ds)}reflect(t){return this.sub(ds.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const n=Math.sqrt(this.lengthSq()*t.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(t)/n;return Math.acos(Et(r,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const n=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return n*n+r*r+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,n,r){const i=Math.sin(n)*t;return this.x=i*Math.sin(r),this.y=Math.cos(n)*t,this.z=i*Math.cos(r),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,n,r){return this.x=t*Math.sin(n),this.y=r,this.z=t*Math.cos(n),this}setFromMatrixPosition(t){const n=t.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(t){const n=this.setFromMatrixColumn(t,0).length(),r=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(t,n){return this.fromArray(t.elements,n*4)}setFromMatrix3Column(t,n){return this.fromArray(t.elements,n*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,n=0){return this.x=t[n],this.y=t[n+1],this.z=t[n+2],this}toArray(t=[],n=0){return t[n]=this.x,t[n+1]=this.y,t[n+2]=this.z,t}fromBufferAttribute(t,n){return this.x=t.getX(n),this.y=t.getY(n),this.z=t.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,n=Math.random()*2-1,r=Math.sqrt(1-n*n);return this.x=r*Math.cos(t),this.y=n,this.z=r*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const ds=new Nn,Fc=new zw;function Va(e,t,n){if(t.length!==e.length)return!0;for(let r=0;r<t.length;r++)if(Math.abs(t[r]-e[r])>n)return!1;return!0}function Mh(e,t,n){if(e===void 0&&t||e&&t===void 0||(e==null?void 0:e.orientation)===void 0||(t==null?void 0:t.orientation)===void 0||(e==null?void 0:e.position)===void 0||(t==null?void 0:t.position)===void 0)return!1;if(e===void 0||t===void 0)return!0;let r=0;return r+=Math.abs(e.orientation[0]-t.orientation[0]),r+=Math.abs(e.orientation[1]-t.orientation[1]),r+=Math.abs(e.orientation[2]-t.orientation[2]),r+=Math.abs(e.position[0]-t.position[0]),r+=Math.abs(e.position[1]-t.position[1]),r+=Math.abs(e.position[2]-t.position[2]),r<=n}function Ua(e,t,n){return e.coordinate_system===t.coordinate_system&&e.tcp===t.tcp&&Mh(e.tcp_pose,t.tcp_pose,n)}function Rh(e,t){const n=new ms.Vector3(t[0],t[1],t[2]),r=new ms.Vector3(e[0],e[1],e[2]),i=n.length(),o=n.normalize();let s=r.length(),a=r.normalize();a.dot(o)<0&&(s=-s,a=a.multiplyScalar(-1));let l=s-i;return l-=2*Math.PI*Math.floor((l+Math.PI)/(2*Math.PI)),s=i+l,[...a.multiplyScalar(s)]}const Bc=1e-4;class Ro{constructor(t,n,r,i,o,s){this.nova=t,this.controller=n,this.motionGroup=r,this.description=i,this.initialMotionState=o,this.motionStateSocket=s,this.rapidlyChangingMotionState=o,s.addEventListener("message",a=>{var c;const l=(c=Ee.tryParseJson(a.data))==null?void 0:c.result;if(!l)throw new Error(`Failed to get motion state for ${this.motionGroupId}: ${a.data}`);Va(this.rapidlyChangingMotionState.joint_position,l.joint_position,Bc)||he.runInAction(()=>{this.rapidlyChangingMotionState.joint_position=l.joint_position}),Ua(this.rapidlyChangingMotionState,l,Bc)||he.runInAction(()=>{var u,d,h;this.rapidlyChangingMotionState.tcp_pose==null?this.rapidlyChangingMotionState.tcp_pose=l.tcp_pose:(u=l.tcp_pose)!=null&&u.orientation&&((d=l.tcp_pose)!=null&&d.position)&&((h=this.rapidlyChangingMotionState.tcp_pose)!=null&&h.orientation)?this.rapidlyChangingMotionState.tcp_pose={position:l.tcp_pose.position,orientation:Rh(l.tcp_pose.orientation,this.rapidlyChangingMotionState.tcp_pose.orientation)}:console.warn("Received incomplete tcp_pose, ignoring",l.tcp_pose)}),this.rapidlyChangingMotionState.standstill!==l.standstill&&he.runInAction(()=>{this.rapidlyChangingMotionState.standstill=l.standstill})}),he.makeAutoObservable(this)}static async open(t,n){var d;const[r,i]=n.split("@"),o=await t.api.controller.getCurrentRobotControllerState(i),s=o==null?void 0:o.motion_groups.find(h=>h.motion_group===n);if(!o||!s)throw new Error(`Controller ${i} or motion group ${n} not found`);const a=t.openReconnectingWebsocket(`/controllers/${i}/motion-groups/${n}/state-stream`),l=await a.firstMessage(),c=(d=Ee.tryParseJson(l.data))==null?void 0:d.result;if(!c)throw new Error(`Unable to parse initial motion state message ${l.data}`);console.log(`Connected motion state websocket to motion group ${s.motion_group}. Initial state:
|
|
129
|
+
`,c);const u=await t.api.motionGroup.getMotionGroupDescription(i,s.motion_group);return new Ro(t,o,s,u,c,a)}get motionGroupId(){return this.motionGroup.motion_group}get controllerId(){return this.controller.controller}get wandelscriptIdentifier(){const t=this.motionGroupId.split("@")[0];return`${this.controllerId.replace(/-/g,"_")}_${t}`}get joints(){return this.initialMotionState.joint_position.map((t,n)=>({index:n}))}dispose(){this.motionStateSocket.close()}}const Gc="Movement request rejected. Another client is currently executing a 'Jogging' motion!";class Ao{constructor(t,n={}){this.motionStream=t,this.options=n,this.ENDPOINT_JOGGING="/execution/jogging",this.ENDPOINT_TRAJECTORY="/execution/trajectory",this.DEFAULT_MODE="off",this.DEFAULT_TCP="Flange",this.DEFAULT_INIT_TIMEOUT=5e3,this.DEFAULT_ORIENTATION="coordsys",this.mode="off",this.joggingSocket=null,this.trajectorySocket=null,this.timeout=this.DEFAULT_INIT_TIMEOUT,this.tcp=(n==null?void 0:n.tcp)||t.motionGroup.tcp||this.DEFAULT_TCP,this.orientation=(n==null?void 0:n.orientation)||this.DEFAULT_ORIENTATION,this.timeout=(n==null?void 0:n.timeout)||this.DEFAULT_INIT_TIMEOUT,this.mode=(n==null?void 0:n.mode)||this.DEFAULT_MODE,this.onError=n==null?void 0:n.onError}static async open(t,n,r={}){const i=await Ro.open(t,n),o=new Ao(i,r);return await o.setJoggingMode(o.mode),o}async setOptions(t){t.tcp&&(this.tcp=t.tcp),t.orientation&&(this.orientation=t.orientation),t.timeout&&(this.timeout=t.timeout),t.mode&&(this.mode=t.mode),t.onError&&(this.onError=t.onError),this.setJoggingMode(this.mode,!1)}get motionGroupId(){return this.motionStream.motionGroupId}get nova(){return this.motionStream.nova}get numJoints(){return this.motionStream.joints.length}async stop(){if(this.joggingSocket){const t=new Array(this.numJoints).fill(0);this.joggingSocket.sendJson({message_type:"JointVelocityRequest",velocity:t})}this.trajectorySocket&&this.trajectorySocket.sendJson({message_type:"PauseMovementRequest"})}async dispose(){const t=[this.joggingSocket,this.trajectorySocket].filter(n=>n!==null);return t.forEach(n=>{n.dispose()}),this.joggingSocket=null,this.trajectorySocket=null,Promise.all(t.map(n=>n.closed()))}async setJoggingMode(t,n=!0){if(!(this.mode===t&&n)&&(this.dispose(),this.mode=t,this.mode==="jogging"))return this.initializeJoggingWebsocket()}async initializeJoggingWebsocket(){return new Promise((t,n)=>{const r=setTimeout(()=>{n(new Error(`Jogging initialization timeout after ${this.timeout} seconds`))},this.timeout);this.joggingSocket=this.nova.openReconnectingWebsocket(this.ENDPOINT_JOGGING),this.joggingSocket.addEventListener("message",i=>{var s,a,l,c;const o=Ee.tryParseJson(i.data);if(((s=o==null?void 0:o.result)==null?void 0:s.kind)==="INITIALIZE_RECEIVED"){clearTimeout(r),t();return}if(((a=o==null?void 0:o.result)==null?void 0:a.kind)==="MOTION_ERROR")if(clearTimeout(r),this.onBlocked&&((l=o==null?void 0:o.result)!=null&&l.message.includes(Gc))){(c=this.joggingSocket)==null||c.dispose(),this.onBlocked();return}else this.onError?this.onError(i.data):n(new Error(i.data))}),this.joggingSocket.sendJson({message_type:"InitializeJoggingRequest",motion_group:this.motionGroupId,tcp:this.tcp})})}async rotateJoints({joint:t,direction:n,velocityRadsPerSec:r}){if(!this.joggingSocket||this.mode!=="jogging")throw new Error("Joint jogging websocket not connected; create one by setting jogging mode to 'jogging'");const i=new Array(this.numJoints).fill(0);i[t]=n==="-"?-r:r,this.joggingSocket.sendJson({message_type:"JointVelocityRequest",velocity:i})}async translateTCP({axis:t,direction:n,velocityMmPerSec:r}){if(!this.joggingSocket||this.mode!=="jogging")throw new Error("Continuous jogging websocket not connected; create one by setting jogging mode to 'jogging'");const i=[0,0,0],o=[0,0,0];o[Ee.XYZ_TO_VECTOR[t]]=n==="-"?-r:r,this.joggingSocket.sendJson({message_type:"TcpVelocityRequest",translation:o,rotation:i,use_tool_coordinate_system:this.orientation==="tool"})}async rotateTCP({axis:t,direction:n,velocityRadsPerSec:r}){if(!this.joggingSocket||this.mode!=="jogging")throw new Error("Continuous jogging websocket not connected; create one by setting jogging mode to 'jogging'");const i=[0,0,0],o=[0,0,0];i[Ee.XYZ_TO_VECTOR[t]]=n==="-"?-r:r,this.joggingSocket.sendJson({message_type:"TcpVelocityRequest",translation:o,rotation:i})}async runIncrementalCartesianMotion({currentTcpPose:t,currentJoints:n,velocityInRelevantUnits:r,axis:i,direction:o,motion:s}){const a=[];if(this.mode!=="trajectory")throw new Error("Set jogging mode to 'trajectory' to run incremental cartesian motions");if(s.type==="translate"){if(!t.position)throw new Error("Current pose has no position, cannot perform translation");const y=[...t.position];y[Ee.XYZ_TO_VECTOR[i]]+=s.distanceMm*(o==="-"?-1:1),a.push({limits_override:{tcp_velocity_limit:r},path:{path_definition_name:"PathLine",target_pose:{position:y,orientation:t.orientation}}})}else if(s.type==="rotate"){if(!t.orientation)throw new Error("Current pose has no orientation, cannot perform rotation");const y=new Nn(t.orientation[0],t.orientation[1],t.orientation[2]),v=y.length(),T=y.clone().normalize(),w=s.distanceRads*(o==="-"?-1:1),E=new Nn(0,0,0);E[i]=1;const R=Math.cos(.5*w)*Math.cos(.5*v),S=Math.sin(.5*w)*Math.sin(.5*v),C=Math.sin(.5*w)*Math.cos(.5*v),I=Math.cos(.5*w)*Math.sin(.5*v),k=E.dot(T),P=E.clone().cross(T),D=2*Math.acos(R-S*k),g=D/Math.sin(.5*D),A=new Nn().addScaledVector(P,S).addScaledVector(E,C).addScaledVector(T,I).multiplyScalar(g);a.push({limits_override:{tcp_orientation_velocity_limit:r},path:{path_definition_name:"PathLine",target_pose:{position:t.position,orientation:[...A]}}})}const l=this.motionStream.description;if(l.cycle_time===void 0){console.warn("Current motion group has no cycle time, cannot plan jogging motion");return}const c={motion_group_model:l.motion_group_model,cycle_time:l.cycle_time,mounting:l.mounting,global:l.operation_limits.auto_limits},u=await this.nova.api.trajectoryPlanning.planTrajectory({motion_group_setup:c,start_joint_position:n,motion_commands:a}),d=u.response;if(!d)throw new Error(`Failed to plan jogging increment motion ${JSON.stringify(u)}`);this.trajectorySocket&&(console.warn("Trajectory jogging websocket already open; will close"),this.trajectorySocket.dispose()),this.trajectorySocket=this.nova.openReconnectingWebsocket(this.ENDPOINT_TRAJECTORY);const h=y=>{var v;if(!y||y.add_trajectory_error||y.message)if(this.onError)this.onError(y);else throw new Error(((v=y==null?void 0:y.add_trajectory_error)==null?void 0:v.message)||(y==null?void 0:y.message)||"Failed to execute trajectory, unknown error");if(!this.trajectorySocket)throw new Error("Failed to execute trajectory, websocket not available anymore");this.trajectorySocket.sendJson({message_type:"StartMovementRequest",direction:"DIRECTION_FORWARD"})},f=async()=>{var y;await he.when(()=>!this.motionStream.rapidlyChangingMotionState.standstill),await he.when(()=>this.motionStream.rapidlyChangingMotionState.standstill),(y=this.trajectorySocket)==null||y.dispose(),this.trajectorySocket=null},m=async()=>{var y;await he.when(()=>this.motionStream.rapidlyChangingMotionState.standstill),(y=this.trajectorySocket)==null||y.dispose(),this.trajectorySocket=null},p=async y=>{if(y!=null&&y.message)if(this.onError){this.onError(y);return}else throw new Error(y.message||"Failed to execute trajectory, unknown error");this.motionStream.rapidlyChangingMotionState.standstill?await f():await m()};this.trajectorySocket.addEventListener("message",y=>{var T,w;const v=Ee.tryParseJson(y.data);if(!((T=v==null?void 0:v.result)!=null&&T.kind))throw new Error(`Failed to execute trajectory: Received invalid message ${y.data}`);if(this.onBlocked&&((w=v.result.message)!=null&&w.includes(Gc))){this.onBlocked();return}if(v.result.kind==="INITIALIZE_RECEIVED")h(v.result);else if(v.result.kind==="START_RECEIVED")p(v);else if(v.result.kind!=="PAUSE_RECEIVED")if(v.result.kind==="MOTION_ERROR"&&v.result.message)if(this.onError){this.onError(v);return}else throw new Error(v.result.message);else throw new Error(`Failed to execute trajectory, cannot handle message type "${v.result.kind}"`)}),this.trajectorySocket.sendJson({message_type:"InitializeMovementRequest",trajectory:{message_type:"TrajectoryData",motion_group:this.motionGroupId,data:d,tcp:this.tcp}})}}var Fw="[object AsyncFunction]",Bw="[object Function]",Gw="[object GeneratorFunction]",Vw="[object Proxy]";function Ah(e){if(!un(e))return!1;var t=bn(e);return t==Bw||t==Gw||t==Fw||t==Vw}var hs=yt["__core-js_shared__"],Vc=(function(){var e=/[^.]+$/.exec(hs&&hs.keys&&hs.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function Uw(e){return!!Vc&&Vc in e}var Ww=Function.prototype,Hw=Ww.toString;function vn(e){if(e!=null){try{return Hw.call(e)}catch{}try{return e+""}catch{}}return""}var Yw=/[\\^$.*+?()[\]{}|]/g,qw=/^\[object .+?Constructor\]$/,Jw=Function.prototype,Kw=Object.prototype,Xw=Jw.toString,Zw=Kw.hasOwnProperty,Qw=RegExp("^"+Xw.call(Zw).replace(Yw,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function e2(e){if(!un(e)||Uw(e))return!1;var t=Ah(e)?Qw:qw;return t.test(vn(e))}function t2(e,t){return e==null?void 0:e[t]}function Sn(e,t){var n=t2(e,t);return e2(n)?n:void 0}var Uc=(function(){try{var e=Sn(Object,"defineProperty");return e({},"",{}),e}catch{}})();function n2(e,t,n){t=="__proto__"&&Uc?Uc(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function r2(e,t,n,r){for(var i=-1,o=e==null?0:e.length;++i<o;){var s=e[i];t(r,s,n(s),e)}return r}function i2(e){return function(t,n,r){for(var i=-1,o=Object(t),s=r(t),a=s.length;a--;){var l=s[++i];if(n(o[l],l,o)===!1)break}return t}}var o2=i2();function s2(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var a2="[object Arguments]";function Wc(e){return dn(e)&&bn(e)==a2}var Ih=Object.prototype,l2=Ih.hasOwnProperty,c2=Ih.propertyIsEnumerable,jh=Wc((function(){return arguments})())?Wc:function(e){return dn(e)&&l2.call(e,"callee")&&!c2.call(e,"callee")},mt=Array.isArray;function u2(){return!1}var kh=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Hc=kh&&typeof module=="object"&&module&&!module.nodeType&&module,d2=Hc&&Hc.exports===kh,Yc=d2?yt.Buffer:void 0,h2=Yc?Yc.isBuffer:void 0,$s=h2||u2,f2=9007199254740991,p2=/^(?:0|[1-9]\d*)$/;function Oh(e,t){var n=typeof e;return t=t??f2,!!t&&(n=="number"||n!="symbol"&&p2.test(e))&&e>-1&&e%1==0&&e<t}var m2=9007199254740991;function Wa(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=m2}var g2="[object Arguments]",y2="[object Array]",x2="[object Boolean]",b2="[object Date]",v2="[object Error]",S2="[object Function]",w2="[object Map]",E2="[object Number]",T2="[object Object]",C2="[object RegExp]",_2="[object Set]",M2="[object String]",R2="[object WeakMap]",A2="[object ArrayBuffer]",I2="[object DataView]",j2="[object Float32Array]",k2="[object Float64Array]",O2="[object Int8Array]",P2="[object Int16Array]",D2="[object Int32Array]",$2="[object Uint8Array]",L2="[object Uint8ClampedArray]",N2="[object Uint16Array]",z2="[object Uint32Array]",pe={};pe[j2]=pe[k2]=pe[O2]=pe[P2]=pe[D2]=pe[$2]=pe[L2]=pe[N2]=pe[z2]=!0;pe[g2]=pe[y2]=pe[A2]=pe[x2]=pe[I2]=pe[b2]=pe[v2]=pe[S2]=pe[w2]=pe[E2]=pe[T2]=pe[C2]=pe[_2]=pe[M2]=pe[R2]=!1;function F2(e){return dn(e)&&Wa(e.length)&&!!pe[bn(e)]}function B2(e){return function(t){return e(t)}}var Ph=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ur=Ph&&typeof module=="object"&&module&&!module.nodeType&&module,G2=ur&&ur.exports===Ph,fs=G2&&Th.process,qc=(function(){try{var e=ur&&ur.require&&ur.require("util").types;return e||fs&&fs.binding&&fs.binding("util")}catch{}})(),Jc=qc&&qc.isTypedArray,Dh=Jc?B2(Jc):F2,V2=Object.prototype,U2=V2.hasOwnProperty;function W2(e,t){var n=mt(e),r=!n&&jh(e),i=!n&&!r&&$s(e),o=!n&&!r&&!i&&Dh(e),s=n||r||i||o,a=s?s2(e.length,String):[],l=a.length;for(var c in e)U2.call(e,c)&&!(s&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Oh(c,l)))&&a.push(c);return a}var H2=Object.prototype;function Y2(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||H2;return e===n}function q2(e,t){return function(n){return e(t(n))}}var J2=q2(Object.keys,Object),K2=Object.prototype,X2=K2.hasOwnProperty;function Z2(e){if(!Y2(e))return J2(e);var t=[];for(var n in Object(e))X2.call(e,n)&&n!="constructor"&&t.push(n);return t}function $h(e){return e!=null&&Wa(e.length)&&!Ah(e)}function Ha(e){return $h(e)?W2(e):Z2(e)}function Q2(e,t){return e&&o2(e,t,Ha)}function eE(e,t){return function(n,r){if(n==null)return n;if(!$h(n))return e(n,r);for(var i=n.length,o=-1,s=Object(n);++o<i&&r(s[o],o,s)!==!1;);return n}}var tE=eE(Q2);function nE(e,t,n,r){return tE(e,function(i,o,s){t(r,i,n(i),s)}),r}function rE(){this.__data__=[],this.size=0}function Lh(e,t){return e===t||e!==e&&t!==t}function Io(e,t){for(var n=e.length;n--;)if(Lh(e[n][0],t))return n;return-1}var iE=Array.prototype,oE=iE.splice;function sE(e){var t=this.__data__,n=Io(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():oE.call(t,n,1),--this.size,!0}function aE(e){var t=this.__data__,n=Io(t,e);return n<0?void 0:t[n][1]}function lE(e){return Io(this.__data__,e)>-1}function cE(e,t){var n=this.__data__,r=Io(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Ot(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ot.prototype.clear=rE;Ot.prototype.delete=sE;Ot.prototype.get=aE;Ot.prototype.has=lE;Ot.prototype.set=cE;function uE(){this.__data__=new Ot,this.size=0}function dE(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function hE(e){return this.__data__.get(e)}function fE(e){return this.__data__.has(e)}var vr=Sn(yt,"Map"),Sr=Sn(Object,"create");function pE(){this.__data__=Sr?Sr(null):{},this.size=0}function mE(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var gE="__lodash_hash_undefined__",yE=Object.prototype,xE=yE.hasOwnProperty;function bE(e){var t=this.__data__;if(Sr){var n=t[e];return n===gE?void 0:n}return xE.call(t,e)?t[e]:void 0}var vE=Object.prototype,SE=vE.hasOwnProperty;function wE(e){var t=this.__data__;return Sr?t[e]!==void 0:SE.call(t,e)}var EE="__lodash_hash_undefined__";function TE(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Sr&&t===void 0?EE:t,this}function hn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}hn.prototype.clear=pE;hn.prototype.delete=mE;hn.prototype.get=bE;hn.prototype.has=wE;hn.prototype.set=TE;function CE(){this.size=0,this.__data__={hash:new hn,map:new(vr||Ot),string:new hn}}function _E(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function jo(e,t){var n=e.__data__;return _E(t)?n[typeof t=="string"?"string":"hash"]:n.map}function ME(e){var t=jo(this,e).delete(e);return this.size-=t?1:0,t}function RE(e){return jo(this,e).get(e)}function AE(e){return jo(this,e).has(e)}function IE(e,t){var n=jo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Pt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Pt.prototype.clear=CE;Pt.prototype.delete=ME;Pt.prototype.get=RE;Pt.prototype.has=AE;Pt.prototype.set=IE;var jE=200;function kE(e,t){var n=this.__data__;if(n instanceof Ot){var r=n.__data__;if(!vr||r.length<jE-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Pt(r)}return n.set(e,t),this.size=n.size,this}function _t(e){var t=this.__data__=new Ot(e);this.size=t.size}_t.prototype.clear=uE;_t.prototype.delete=dE;_t.prototype.get=hE;_t.prototype.has=fE;_t.prototype.set=kE;var OE="__lodash_hash_undefined__";function PE(e){return this.__data__.set(e,OE),this}function DE(e){return this.__data__.has(e)}function Ni(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Pt;++t<n;)this.add(e[t])}Ni.prototype.add=Ni.prototype.push=PE;Ni.prototype.has=DE;function $E(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function LE(e,t){return e.has(t)}var NE=1,zE=2;function Nh(e,t,n,r,i,o){var s=n&NE,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var c=o.get(e),u=o.get(t);if(c&&u)return c==t&&u==e;var d=-1,h=!0,f=n&zE?new Ni:void 0;for(o.set(e,t),o.set(t,e);++d<a;){var m=e[d],p=t[d];if(r)var y=s?r(p,m,d,t,e,o):r(m,p,d,e,t,o);if(y!==void 0){if(y)continue;h=!1;break}if(f){if(!$E(t,function(v,T){if(!LE(f,T)&&(m===v||i(m,v,n,r,o)))return f.push(T)})){h=!1;break}}else if(!(m===p||i(m,p,n,r,o))){h=!1;break}}return o.delete(e),o.delete(t),h}var Kc=yt.Uint8Array;function FE(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function BE(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var GE=1,VE=2,UE="[object Boolean]",WE="[object Date]",HE="[object Error]",YE="[object Map]",qE="[object Number]",JE="[object RegExp]",KE="[object Set]",XE="[object String]",ZE="[object Symbol]",QE="[object ArrayBuffer]",eT="[object DataView]",Xc=Vt?Vt.prototype:void 0,ps=Xc?Xc.valueOf:void 0;function tT(e,t,n,r,i,o,s){switch(n){case eT:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case QE:return!(e.byteLength!=t.byteLength||!o(new Kc(e),new Kc(t)));case UE:case WE:case qE:return Lh(+e,+t);case HE:return e.name==t.name&&e.message==t.message;case JE:case XE:return e==t+"";case YE:var a=FE;case KE:var l=r&GE;if(a||(a=BE),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=VE,s.set(e,t);var u=Nh(a(e),a(t),r,i,o,s);return s.delete(e),u;case ZE:if(ps)return ps.call(e)==ps.call(t)}return!1}function nT(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function rT(e,t,n){var r=t(e);return mt(e)?r:nT(r,n(e))}function iT(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function oT(){return[]}var sT=Object.prototype,aT=sT.propertyIsEnumerable,Zc=Object.getOwnPropertySymbols,lT=Zc?function(e){return e==null?[]:(e=Object(e),iT(Zc(e),function(t){return aT.call(e,t)}))}:oT;function Qc(e){return rT(e,Ha,lT)}var cT=1,uT=Object.prototype,dT=uT.hasOwnProperty;function hT(e,t,n,r,i,o){var s=n&cT,a=Qc(e),l=a.length,c=Qc(t),u=c.length;if(l!=u&&!s)return!1;for(var d=l;d--;){var h=a[d];if(!(s?h in t:dT.call(t,h)))return!1}var f=o.get(e),m=o.get(t);if(f&&m)return f==t&&m==e;var p=!0;o.set(e,t),o.set(t,e);for(var y=s;++d<l;){h=a[d];var v=e[h],T=t[h];if(r)var w=s?r(T,v,h,t,e,o):r(v,T,h,e,t,o);if(!(w===void 0?v===T||i(v,T,n,r,o):w)){p=!1;break}y||(y=h=="constructor")}if(p&&!y){var E=e.constructor,R=t.constructor;E!=R&&"constructor"in e&&"constructor"in t&&!(typeof E=="function"&&E instanceof E&&typeof R=="function"&&R instanceof R)&&(p=!1)}return o.delete(e),o.delete(t),p}var Ls=Sn(yt,"DataView"),Ns=Sn(yt,"Promise"),zs=Sn(yt,"Set"),Fs=Sn(yt,"WeakMap"),eu="[object Map]",fT="[object Object]",tu="[object Promise]",nu="[object Set]",ru="[object WeakMap]",iu="[object DataView]",pT=vn(Ls),mT=vn(vr),gT=vn(Ns),yT=vn(zs),xT=vn(Fs),zt=bn;(Ls&&zt(new Ls(new ArrayBuffer(1)))!=iu||vr&&zt(new vr)!=eu||Ns&&zt(Ns.resolve())!=tu||zs&&zt(new zs)!=nu||Fs&&zt(new Fs)!=ru)&&(zt=function(e){var t=bn(e),n=t==fT?e.constructor:void 0,r=n?vn(n):"";if(r)switch(r){case pT:return iu;case mT:return eu;case gT:return tu;case yT:return nu;case xT:return ru}return t});var bT=1,ou="[object Arguments]",su="[object Array]",ri="[object Object]",vT=Object.prototype,au=vT.hasOwnProperty;function ST(e,t,n,r,i,o){var s=mt(e),a=mt(t),l=s?su:zt(e),c=a?su:zt(t);l=l==ou?ri:l,c=c==ou?ri:c;var u=l==ri,d=c==ri,h=l==c;if(h&&$s(e)){if(!$s(t))return!1;s=!0,u=!1}if(h&&!u)return o||(o=new _t),s||Dh(e)?Nh(e,t,n,r,i,o):tT(e,t,l,n,r,i,o);if(!(n&bT)){var f=u&&au.call(e,"__wrapped__"),m=d&&au.call(t,"__wrapped__");if(f||m){var p=f?e.value():e,y=m?t.value():t;return o||(o=new _t),i(p,y,n,r,o)}}return h?(o||(o=new _t),hT(e,t,n,r,i,o)):!1}function ko(e,t,n,r,i){return e===t?!0:e==null||t==null||!dn(e)&&!dn(t)?e!==e&&t!==t:ST(e,t,n,r,ko,i)}var wT=1,ET=2;function TT(e,t,n,r){var i=n.length,o=i;if(e==null)return!o;for(e=Object(e);i--;){var s=n[i];if(s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<o;){s=n[i];var a=s[0],l=e[a],c=s[1];if(s[2]){if(l===void 0&&!(a in e))return!1}else{var u=new _t,d;if(!(d===void 0?ko(c,l,wT|ET,r,u):d))return!1}}return!0}function zh(e){return e===e&&!un(e)}function CT(e){for(var t=Ha(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,zh(i)]}return t}function Fh(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function _T(e){var t=CT(e);return t.length==1&&t[0][2]?Fh(t[0][0],t[0][1]):function(n){return n===e||TT(n,e,t)}}var MT=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,RT=/^\w*$/;function Ya(e,t){if(mt(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Mo(e)?!0:RT.test(e)||!MT.test(e)||t!=null&&e in Object(t)}var AT="Expected a function";function qa(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(AT);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(qa.Cache||Pt),n}qa.Cache=Pt;var IT=500;function jT(e){var t=qa(e,function(r){return n.size===IT&&n.clear(),r}),n=t.cache;return t}var kT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,OT=/\\(\\)?/g,PT=jT(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(kT,function(n,r,i,o){t.push(i?o.replace(OT,"$1"):r||n)}),t});function DT(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var lu=Vt?Vt.prototype:void 0,cu=lu?lu.toString:void 0;function Bh(e){if(typeof e=="string")return e;if(mt(e))return DT(e,Bh)+"";if(Mo(e))return cu?cu.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Gh(e){return e==null?"":Bh(e)}function Vh(e,t){return mt(e)?e:Ya(e,t)?[e]:PT(Gh(e))}function Oo(e){if(typeof e=="string"||Mo(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Uh(e,t){t=Vh(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Oo(t[n++])];return n&&n==r?e:void 0}function $T(e,t,n){var r=e==null?void 0:Uh(e,t);return r===void 0?n:r}function LT(e,t){return e!=null&&t in Object(e)}function NT(e,t,n){t=Vh(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var s=Oo(t[r]);if(!(o=e!=null&&n(e,s)))break;e=e[s]}return o||++r!=i?o:(i=e==null?0:e.length,!!i&&Wa(i)&&Oh(s,i)&&(mt(e)||jh(e)))}function zT(e,t){return e!=null&&NT(e,t,LT)}var FT=1,BT=2;function GT(e,t){return Ya(e)&&zh(t)?Fh(Oo(e),t):function(n){var r=$T(n,e);return r===void 0&&r===t?zT(n,e):ko(t,r,FT|BT)}}function VT(e){return e}function UT(e){return function(t){return t==null?void 0:t[e]}}function WT(e){return function(t){return Uh(t,e)}}function HT(e){return Ya(e)?UT(Oo(e)):WT(e)}function YT(e){return typeof e=="function"?e:e==null?VT:typeof e=="object"?mt(e)?GT(e[0],e[1]):_T(e):HT(e)}function qT(e,t){return function(n,r){var i=mt(n)?r2:nE,o={};return i(n,e,YT(r),o)}}var ii=qT(function(e,t,n){n2(e,n,t)}),JT=0;function KT(e){var t=++JT;return Gh(e)+t}const Bs=[{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}],XT=[{id:"continuous"},...Bs],ZT=["coordsys","tool"];class Po{constructor(t,n,r,i){var o,s;this.jogger=t,this.coordSystems=n,this.motionGroupDescription=r,this.tcps=i,this.selectedTabId="cartesian",this.activationState="inactive",this.activationError=null,this.activationCounter=0,this.locks=new Set,this.blocked=!1,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=!1,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 a of n)if(a.coordinate_system===""){a.coordinate_system="world";break}this.selectedCoordSystemId=((o=n[0])==null?void 0:o.coordinate_system)||"world",this.selectedTcpId=((s=i[0])==null?void 0:s.id)||"",he.makeAutoObservable(this,{},{autoBind:!0}),this.jogger.onBlocked=()=>{this.block()},this.loadFromLocalStorage(),this.disposers.push(he.autorun(()=>this.saveToLocalStorage())),window.joggingStore=this}static async loadFor(t){const{nova:n}=t,[r,i]=await Promise.all([n.api.controller.listCoordinateSystems(t.motionStream.controllerId,"ROTATION_VECTOR"),n.api.motionGroup.getMotionGroupDescription(t.motionStream.controllerId,t.motionGroupId)]),o=Object.entries(i.tcps||{}).map(([s,a])=>({id:s,readable_name:a.name,position:a.pose.position,orientation:a.pose.orientation}));return new Po(t,r||[],i,o)}dispose(){for(const t of this.disposers)t();this.jogger.dispose()}get coordSystemCountByName(){return bu.countBy(this.coordSystems,t=>t.name)}async deactivate(){if(this.jogger.mode==="jogging")return this.jogger.stop()}async activate(){return this.currentTab.id==="cartesian"?((this.jogger.tcp!==this.selectedTcpId||this.jogger.orientation!==this.selectedOrientation)&&this.jogger.setOptions({tcp:this.selectedTcpId,orientation:this.selectedOrientation}),this.activeDiscreteIncrement?this.jogger.setJoggingMode("trajectory"):this.jogger.setJoggingMode("jogging")):this.jogger.setJoggingMode("jogging"),this.jogger}loadFromLocalStorage(){const t=Ee.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 XT}get discreteIncrementOptions(){return Bs}get incrementOptionsById(){return ii(this.incrementOptions,t=>t.id)}get tabsById(){return ii(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 ii(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 ii(this.tcps,t=>t.id)}get activeDiscreteIncrement(){return this.selectedOrientation==="tool"?void 0:Bs.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,n){const r=this.tabs[n]||this.tabs[0];this.selectedTabId=r.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)}block(){this.blocked=!0}unblock(){this.blocked=!1,this.jogger.mode==="jogging"&&this.jogger.initializeJoggingWebsocket()}async withMotionLock(t){const n=KT();this.lock(n);try{return await t()}finally{this.unlock(n)}}}const QT=oe.observer(({store:e})=>{const{t}=fe.useTranslation();return x.jsxRuntimeExports.jsx(M.Backdrop,{open:!0,sx:{position:"absolute",zIndex:n=>n.zIndex.drawer+1,color:"#fff",background:"rgba(15, 15, 15, 0.88)",justifyContent:"flex-start",alignItems:"flex-start"},children:x.jsxRuntimeExports.jsxs(M.Stack,{sx:{m:2,width:"100%"},children:[x.jsxRuntimeExports.jsxs(M.Alert,{severity:"error",sx:{mb:2},children:[x.jsxRuntimeExports.jsx(M.AlertTitle,{children:t("Jogging.Blocked.ti")}),t("Jogging.Blocked.lb")]}),x.jsxRuntimeExports.jsx(M.Button,{variant:"contained",color:"secondary",onClick:()=>e.unblock(),children:t("Jogging.Blocked.Reenable.bt")})]})})}),eC=({title:e,titleId:t,...n},r)=>j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:19,height:10,fill:"none",ref:r,"aria-labelledby":t,...n},e?j.createElement("title",{id:t},e):null,j.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"})),tC=$.forwardRef(eC),nC=({title:e,titleId:t,...n},r)=>j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:19,height:10,fill:"none",ref:r,"aria-labelledby":t,...n},e?j.createElement("title",{id:t},e):null,j.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"})),rC=$.forwardRef(nC),iC=({title:e,titleId:t,...n},r)=>j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:10,height:19,fill:"none",ref:r,"aria-labelledby":t,...n},e?j.createElement("title",{id:t},e):null,j.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"})),oC=$.forwardRef(iC),sC=({title:e,titleId:t,...n},r)=>j.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?j.createElement("title",{id:t},e):null,j.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"})),aC=$.forwardRef(sC);function lC(e,t){return ko(e,t)}const Wh=({store:e})=>{const{t}=fe.useTranslation(),[n,r]=$.useState(e.jogger.motionStream.rapidlyChangingMotionState.joint_limit_reached.limit_reached),i=$.useRef(n);de.useAnimationFrame(()=>{const s=e.jogger.motionStream.rapidlyChangingMotionState.joint_limit_reached.limit_reached;lC(i.current,s)||(i.current=s,r(s))});const o=[];for(const[s,a]of n.entries())a&&o.push(s);return x.jsxRuntimeExports.jsx(M.Typography,{color:"error",sx:{margin:"0.5rem 1rem",textAlign:"center",minHeight:"1.5rem",visibility:o.length?"visible":"hidden"},children:t("Jogging.JointLimitsReached.lb",{jointNumbers:o.map(s=>s+1).join(", ")})})},cC=M.styled(M.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 oi({labelValue:e,...t}){return x.jsxRuntimeExports.jsxs(cC,{fullWidth:!0,variant:"filled",children:[x.jsxRuntimeExports.jsx(M.InputLabel,{id:t.labelId,children:e}),x.jsxRuntimeExports.jsx(M.Select,{...t})]})}const uC=oe.observer(({store:e})=>{var o;const{t}=fe.useTranslation(),n=$.useId(),r=[];function i(s){switch(s){case"coordsys":return t("Jogging.Orientation.coordsys");case"tool":return t("Jogging.Orientation.tool");default:return s}}return e.showCoordSystemSelect&&r.push(x.jsxRuntimeExports.jsx(oi,{labelId:`jogging-coord-select-${n}`,labelValue:t("Jogging.CoordinateSystem.hlb"),value:e.selectedCoordSystemId,size:"small",variant:"filled",displayEmpty:!0,onChange:s=>e.setSelectedCoordSystemId(s.target.value),disabled:e.isLocked,children:e.coordSystems.map(s=>x.jsxRuntimeExports.jsx(M.MenuItem,{value:s.coordinate_system,children:s.name&&e.coordSystemCountByName[s.name]>1?`${s.name} / ${s.coordinate_system}`:s.name||s.coordinate_system},s.coordinate_system))},"coord")),e.showTcpSelect&&r.push(x.jsxRuntimeExports.jsx(oi,{labelId:`jogging-tcp-select-${n}`,labelValue:"TCP",value:e.selectedTcpId,size:"small",variant:"filled",onChange:s=>e.setSelectedTcpId(s.target.value),disabled:e.isLocked,children:e.tcps.map(s=>x.jsxRuntimeExports.jsx(M.MenuItem,{value:s.id,children:s.id},s.id))},"tcp")),e.showOrientationSelect&&r.push(x.jsxRuntimeExports.jsx(oi,{labelValue:t("Jogging.Cartesian.Orientation.lb"),labelId:`orientation-select-${n}`,value:e.selectedOrientation,onChange:s=>e.setSelectedOrientation(s.target.value),disabled:e.isLocked,children:ZT.map(s=>x.jsxRuntimeExports.jsx(M.MenuItem,{value:s,children:i(s)},s))},"orientation")),e.showIncrementSelect&&r.push(x.jsxRuntimeExports.jsxs(oi,{labelValue:t("Jogging.Increment.hlb"),labelId:`jogging-increment-select-${n}`,size:"small",variant:"filled",value:((o=e.activeDiscreteIncrement)==null?void 0:o.id)||"continuous",onChange:s=>e.setSelectedIncrementId(s.target.value),disabled:e.isLocked,children:[x.jsxRuntimeExports.jsx(M.MenuItem,{value:"continuous",children:t("Jogging.Increment.Continuous.dd")},"continuous"),e.selectedOrientation==="tool"?null:e.discreteIncrementOptions.map(s=>x.jsxRuntimeExports.jsx(M.MenuItem,{value:s.id,children:e.currentMotionType==="translate"?`${s.mm}mm`:`${s.degrees}°`},s.id))]},"increment")),x.jsxRuntimeExports.jsx(M.Box,{component:"div",sx:{display:"grid",gap:"16px",gridTemplateColumns:"1fr 1fr",gridAutoRows:"min-content","& label":{opacity:.7,fontSize:"12px",marginBottom:"4px"}},children:r.map((s,a)=>x.jsxRuntimeExports.jsx(M.Box,{sx:{gridColumn:r.length%2===1&&a===r.length-1?"span 2":"auto"},children:s},a))})}),dC=M.styled(M.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 uu(e,t){return process.env.NODE_ENV==="production"?()=>null:function(...r){return e(...r)||t(...r)}}function dr(e){return typeof e=="string"}function hC(e,t,n){return e===void 0||dr(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function fi(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function du(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function fC(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=e;if(!t){const f=De(n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),m={...n==null?void 0:n.style,...i==null?void 0:i.style,...r==null?void 0:r.style},p={...n,...i,...r};return f.length>0&&(p.className=f),Object.keys(m).length>0&&(p.style=m),{props:p,internalRef:void 0}}const s=fi({...i,...r}),a=du(r),l=du(i),c=t(s),u=De(c==null?void 0:c.className,n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),d={...c==null?void 0:c.style,...n==null?void 0:n.style,...i==null?void 0:i.style,...r==null?void 0:r.style},h={...c,...n,...l,...a};return u.length>0&&(h.className=u),Object.keys(d).length>0&&(h.style=d),{props:h,internalRef:c.ref}}function pC(e,t,n){return typeof e=="function"?e(t,n):e}function Lt(e){var d;const{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:i=!1,...o}=e,s=i?{}:pC(n,r),{props:a,internalRef:l}=fC({...o,externalSlotProps:s}),c=no(l,s==null?void 0:s.ref,(d=e.additionalProps)==null?void 0:d.ref);return hC(t,{...a,ref:c},r)}function hu(e){try{return e.matches(":focus-visible")}catch{process.env.NODE_ENV!=="production"&&!window.navigator.userAgent.includes("jsdom")&&console.warn(["MUI: The `:focus-visible` pseudo class is not supported in this browser.","Some components rely on this feature to work properly."].join(`
|
|
130
|
+
`))}return!1}const mC={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function gC(e,t,n=(r,i)=>r===i){return e.length===t.length&&e.every((r,i)=>n(r,t[i]))}const yC=2;function jn(e,t,n,r,i){return n===1?Math.min(e+t,i):Math.max(e-t,r)}function Hh(e,t){return e-t}function fu(e,t){const{index:n}=e.reduce((r,i,o)=>{const s=Math.abs(t-i);return r===null||s<r.distance||s===r.distance?{distance:s,index:o}:r},null)??{};return n}function si(e,t){if(t.current!==void 0&&e.changedTouches){const n=e;for(let r=0;r<n.changedTouches.length;r+=1){const i=n.changedTouches[r];if(i.identifier===t.current)return{x:i.clientX,y:i.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function zi(e,t,n){return(e-t)*100/(n-t)}function xC(e,t,n){return(n-t)*e+t}function bC(e){if(Math.abs(e)<1){const n=e.toExponential().split("e-"),r=n[0].split(".")[1];return(r?r.length:0)+parseInt(n[1],10)}const t=e.toString().split(".")[1];return t?t.length:0}function vC(e,t,n){const r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(bC(t)))}function pu({values:e,newValue:t,index:n}){const r=e.slice();return r[n]=t,r.sort(Hh)}function ai({sliderRef:e,activeIndex:t,setActive:n}){var i,o,s;const r=lr(e.current);(!((i=e.current)!=null&&i.contains(r.activeElement))||Number((o=r==null?void 0:r.activeElement)==null?void 0:o.getAttribute("data-index"))!==t)&&((s=e.current)==null||s.querySelector(`[type="range"][data-index="${t}"]`).focus()),n&&n(t)}function li(e,t){return typeof e=="number"&&typeof t=="number"?e===t:typeof e=="object"&&typeof t=="object"?gC(e,t):!1}const SC={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}%`})}},wC=e=>e;let ci;function mu(){return ci===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?ci=CSS.supports("touch-action","none"):ci=!0),ci}function EC(e){const{"aria-labelledby":t,defaultValue:n,disabled:r=!1,disableSwap:i=!1,isRtl:o=!1,marks:s=!1,max:a=100,min:l=0,name:c,onChange:u,onChangeCommitted:d,orientation:h="horizontal",rootRef:f,scale:m=wC,step:p=1,shiftStep:y=10,tabIndex:v,value:T}=e,w=j.useRef(void 0),[E,R]=j.useState(-1),[S,C]=j.useState(-1),[I,k]=j.useState(!1),P=j.useRef(0),D=j.useRef(null),[g,A]=rw({controlled:T,default:n??l,name:"Slider"}),_=u&&((F,U,Y)=>{const ne=F.nativeEvent||F,ue=new ne.constructor(ne.type,ne);Object.defineProperty(ue,"target",{writable:!0,value:{value:U,name:c}}),D.current=U,u(ue,U,Y)}),z=Array.isArray(g);let N=z?g.slice().sort(Hh):[g];N=N.map(F=>F==null?l:kn(F,l,a));const W=s===!0&&p!==null?[...Array(Math.floor((a-l)/p)+1)].map((F,U)=>({value:l+p*U})):s||[],B=W.map(F=>F.value),[Z,Q]=j.useState(-1),ee=j.useRef(null),Ne=no(f,ee),xt=F=>U=>{var ne;const Y=Number(U.currentTarget.getAttribute("data-index"));hu(U.target)&&Q(Y),C(Y),(ne=F==null?void 0:F.onFocus)==null||ne.call(F,U)},bt=F=>U=>{var Y;hu(U.target)||Q(-1),C(-1),(Y=F==null?void 0:F.onBlur)==null||Y.call(F,U)},je=(F,U)=>{const Y=Number(F.currentTarget.getAttribute("data-index")),ne=N[Y],ue=B.indexOf(ne);let J=U;if(W&&p==null){const _e=B[B.length-1];J>=_e?J=_e:J<=B[0]?J=B[0]:J=J<ne?B[ue-1]:B[ue+1]}if(J=kn(J,l,a),z){i&&(J=kn(J,N[Y-1]||-1/0,N[Y+1]||1/0));const _e=J;J=pu({values:N,newValue:J,index:Y});let Oe=Y;i||(Oe=J.indexOf(_e)),ai({sliderRef:ee,activeIndex:Oe})}A(J),Q(Y),_&&!li(J,g)&&_(F,J,Y),d&&d(F,D.current??J)},vt=F=>U=>{var Y;if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(U.key)){U.preventDefault();const ne=Number(U.currentTarget.getAttribute("data-index")),ue=N[ne];let J=null;if(p!=null){const _e=U.shiftKey?y:p;switch(U.key){case"ArrowUp":J=jn(ue,_e,1,l,a);break;case"ArrowRight":J=jn(ue,_e,o?-1:1,l,a);break;case"ArrowDown":J=jn(ue,_e,-1,l,a);break;case"ArrowLeft":J=jn(ue,_e,o?1:-1,l,a);break;case"PageUp":J=jn(ue,y,1,l,a);break;case"PageDown":J=jn(ue,y,-1,l,a);break;case"Home":J=l;break;case"End":J=a;break}}else if(W){const _e=B[B.length-1],Oe=B.indexOf(ue),Se=[o?"ArrowRight":"ArrowLeft","ArrowDown","PageDown","Home"],We=[o?"ArrowLeft":"ArrowRight","ArrowUp","PageUp","End"];Se.includes(U.key)?Oe===0?J=B[0]:J=B[Oe-1]:We.includes(U.key)&&(Oe===B.length-1?J=_e:J=B[Oe+1])}J!=null&&je(U,J)}(Y=F==null?void 0:F.onKeyDown)==null||Y.call(F,U)};pt(()=>{var F;r&&ee.current.contains(document.activeElement)&&((F=document.activeElement)==null||F.blur())},[r]),r&&E!==-1&&R(-1),r&&Z!==-1&&Q(-1);const ot=F=>U=>{var Y;(Y=F.onChange)==null||Y.call(F,U),je(U,U.target.valueAsNumber)},Ge=j.useRef(void 0);let V=h;o&&h==="horizontal"&&(V+="-reverse");const q=({finger:F,move:U=!1})=>{const{current:Y}=ee,{width:ne,height:ue,bottom:J,left:_e}=Y.getBoundingClientRect();let Oe;V.startsWith("vertical")?Oe=(J-F.y)/ue:Oe=(F.x-_e)/ne,V.includes("-reverse")&&(Oe=1-Oe);let Se;if(Se=xC(Oe,l,a),p)Se=vC(Se,p,l);else{const Kn=fu(B,Se);Se=B[Kn]}Se=kn(Se,l,a);let We=0;if(z){U?We=Ge.current:We=fu(N,Se),i&&(Se=kn(Se,N[We-1]||-1/0,N[We+1]||1/0));const Kn=Se;Se=pu({values:N,newValue:Se,index:We}),i&&U||(We=Se.indexOf(Kn),Ge.current=We)}return{newValue:Se,activeIndex:We}},K=rt(F=>{const U=si(F,w);if(!U)return;if(P.current+=1,F.type==="mousemove"&&F.buttons===0){L(F);return}const{newValue:Y,activeIndex:ne}=q({finger:U,move:!0});ai({sliderRef:ee,activeIndex:ne,setActive:R}),A(Y),!I&&P.current>yC&&k(!0),_&&!li(Y,g)&&_(F,Y,ne)}),L=rt(F=>{const U=si(F,w);if(k(!1),!U)return;const{newValue:Y}=q({finger:U,move:!0});R(-1),F.type==="touchend"&&C(-1),d&&d(F,D.current??Y),w.current=void 0,te()}),ie=rt(F=>{if(r)return;mu()||F.preventDefault();const U=F.changedTouches[0];U!=null&&(w.current=U.identifier);const Y=si(F,w);if(Y!==!1){const{newValue:ue,activeIndex:J}=q({finger:Y});ai({sliderRef:ee,activeIndex:J,setActive:R}),A(ue),_&&!li(ue,g)&&_(F,ue,J)}P.current=0;const ne=lr(ee.current);ne.addEventListener("touchmove",K,{passive:!0}),ne.addEventListener("touchend",L,{passive:!0})}),te=j.useCallback(()=>{const F=lr(ee.current);F.removeEventListener("mousemove",K),F.removeEventListener("mouseup",L),F.removeEventListener("touchmove",K),F.removeEventListener("touchend",L)},[L,K]);j.useEffect(()=>{const{current:F}=ee;return F.addEventListener("touchstart",ie,{passive:mu()}),()=>{F.removeEventListener("touchstart",ie),te()}},[te,ie]),j.useEffect(()=>{r&&te()},[r,te]);const Ae=F=>U=>{var ue;if((ue=F.onMouseDown)==null||ue.call(F,U),r||U.defaultPrevented||U.button!==0)return;U.preventDefault();const Y=si(U,w);if(Y!==!1){const{newValue:J,activeIndex:_e}=q({finger:Y});ai({sliderRef:ee,activeIndex:_e,setActive:R}),A(J),_&&!li(J,g)&&_(U,J,_e)}P.current=0;const ne=lr(ee.current);ne.addEventListener("mousemove",K,{passive:!0}),ne.addEventListener("mouseup",L)},Ce=zi(z?N[0]:l,l,a),ge=zi(N[N.length-1],l,a)-Ce,Dt=(F={})=>{const U=fi(F),Y={onMouseDown:Ae(U||{})},ne={...U,...Y};return{...F,ref:Ne,...ne}},kr=F=>U=>{var ne;(ne=F.onMouseOver)==null||ne.call(F,U);const Y=Number(U.currentTarget.getAttribute("data-index"));C(Y)},Or=F=>U=>{var Y;(Y=F.onMouseLeave)==null||Y.call(F,U),C(-1)},Pr=(F={})=>{const U=fi(F),Y={onMouseOver:kr(U||{}),onMouseLeave:Or(U||{})};return{...F,...U,...Y}},Dr=F=>({pointerEvents:E!==-1&&E!==F?"none":void 0});let wn;return h==="vertical"&&(wn=o?"vertical-rl":"vertical-lr"),{active:E,axis:V,axisProps:SC,dragging:I,focusedThumbIndex:Z,getHiddenInputProps:(F={})=>{const U=fi(F),Y={onChange:ot(U||{}),onFocus:xt(U||{}),onBlur:bt(U||{}),onKeyDown:vt(U||{})},ne={...U,...Y};return{tabIndex:v,"aria-labelledby":t,"aria-orientation":h,"aria-valuemax":m(a),"aria-valuemin":m(l),name:c,type:"range",min:e.min,max:e.max,step:e.step===null&&e.marks?"any":e.step??void 0,disabled:r,...F,...ne,style:{...mC,direction:o?"rtl":"ltr",width:"100%",height:"100%",writingMode:wn}}},getRootProps:Dt,getThumbProps:Pr,marks:W,open:S,range:z,rootRef:Ne,trackLeap:ge,trackOffset:Ce,values:N,getThumbStyle:Dr}}const TC=e=>!e||!dr(e);function CC(e){return typeof e.main=="string"}function _C(e,t=[]){if(!CC(e))return!1;for(const n of t)if(!e.hasOwnProperty(n)||typeof e[n]!="string")return!1;return!0}function Ja(e=[]){return([,t])=>t&&_C(t,e)}function MC(e){return fn("MuiSlider",e)}const Ke=Zi("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"]),RC=e=>{const{open:t}=e;return{offset:De(t&&Ke.valueLabelOpen),circle:Ke.valueLabelCircle,label:Ke.valueLabelLabel}};function Yh(e){const{children:t,className:n,value:r}=e,i=RC(e);return t?j.cloneElement(t,{className:t.props.className},x.jsxRuntimeExports.jsxs(j.Fragment,{children:[t.props.children,x.jsxRuntimeExports.jsx("span",{className:De(i.offset,n),"aria-hidden":!0,children:x.jsxRuntimeExports.jsx("span",{className:i.circle,children:x.jsxRuntimeExports.jsx("span",{className:i.label,children:r})})})]})):null}process.env.NODE_ENV!=="production"&&(Yh.propTypes={children:b.element.isRequired,className:b.string,value:b.node});function gu(e){return e}const AC=Ue("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`color${Pe(n.color)}`],n.size!=="medium"&&t[`size${Pe(n.size)}`],n.marked&&t.marked,n.orientation==="vertical"&&t.vertical,n.track==="inverted"&&t.trackInverted,n.track===!1&&t.trackFalse]}})(xn(({theme:e})=>({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${Ke.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${Ke.dragging}`]:{[`& .${Ke.thumb}, & .${Ke.track}`]:{transition:"none"}},variants:[...Object.entries(e.palette).filter(Ja()).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}}]}))),IC=Ue("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}}]}),jC=Ue("span",{name:"MuiSlider",slot:"Track"})(xn(({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(Ja()).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:e.lighten(e.palette[t].main,.62),borderColor:e.lighten(e.palette[t].main,.62),...e.applyStyles("dark",{backgroundColor:e.darken(e.palette[t].main,.5)}),...e.applyStyles("dark",{borderColor:e.darken(e.palette[t].main,.5)})}}}))]}))),kC=Ue("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.thumb,t[`thumbColor${Pe(n.color)}`],n.size!=="medium"&&t[`thumbSize${Pe(n.size)}`]]}})(xn(({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%)"},[`&.${Ke.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(Ja()).map(([t])=>({props:{color:t},style:{[`&:hover, &.${Ke.focusVisible}`]:{boxShadow:`0px 0px 0px 8px ${e.alpha((e.vars||e).palette[t].main,.16)}`,"@media (hover: none)":{boxShadow:"none"}},[`&.${Ke.active}`]:{boxShadow:`0px 0px 0px 14px ${e.alpha((e.vars||e).palette[t].main,.16)}`}}}))]}))),qh=Ue(Yh,{name:"MuiSlider",slot:"ValueLabel"})(xn(({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%"},[`&.${Ke.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%"},[`&.${Ke.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"&&(qh.propTypes={children:b.element.isRequired,index:b.number.isRequired,open:b.bool.isRequired,value:b.node});const OC=Ue("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>Ys(e)&&e!=="markActive",overridesResolver:(e,t)=>{const{markActive:n}=e;return[t.mark,n&&t.markActive]}})(xn(({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}}]}))),PC=Ue("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>Ys(e)&&e!=="markLabelActive"})(xn(({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}}]}))),DC=e=>{const{disabled:t,dragging:n,marked:r,orientation:i,track:o,classes:s,color:a,size:l}=e,c={root:["root",t&&"disabled",n&&"dragging",r&&"marked",i==="vertical"&&"vertical",o==="inverted"&&"trackInverted",o===!1&&"trackFalse",a&&`color${Pe(a)}`,l&&`size${Pe(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",l&&`thumbSize${Pe(l)}`,a&&`thumbColor${Pe(a)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return wr(c,MC,s)},$C=({children:e})=>e,Jh=j.forwardRef(function(t,n){const r=Ga({props:t,name:"MuiSlider"}),i=fm(),{"aria-label":o,"aria-valuetext":s,"aria-labelledby":a,component:l="span",components:c={},componentsProps:u={},color:d="primary",classes:h,className:f,disableSwap:m=!1,disabled:p=!1,getAriaLabel:y,getAriaValueText:v,marks:T=!1,max:w=100,min:E=0,name:R,onChange:S,onChangeCommitted:C,orientation:I="horizontal",shiftStep:k=10,size:P="medium",step:D=1,scale:g=gu,slotProps:A,slots:_,tabIndex:z,track:N="normal",value:W,valueLabelDisplay:B="off",valueLabelFormat:Z=gu,...Q}=r,ee={...r,isRtl:i,max:w,min:E,classes:h,disabled:p,disableSwap:m,orientation:I,marks:T,color:d,size:P,step:D,shiftStep:k,scale:g,track:N,valueLabelDisplay:B,valueLabelFormat:Z},{axisProps:Ne,getRootProps:xt,getHiddenInputProps:bt,getThumbProps:je,open:vt,active:ot,axis:Ge,focusedThumbIndex:V,range:q,dragging:K,marks:L,values:ie,trackOffset:te,trackLeap:Ae,getThumbStyle:Ce}=EC({...ee,rootRef:n});ee.marked=L.length>0&&L.some(ve=>ve.label),ee.dragging=K,ee.focusedThumbIndex=V;const ge=DC(ee),Dt=(_==null?void 0:_.root)??c.Root??AC,kr=(_==null?void 0:_.rail)??c.Rail??IC,Or=(_==null?void 0:_.track)??c.Track??jC,Pr=(_==null?void 0:_.thumb)??c.Thumb??kC,Dr=(_==null?void 0:_.valueLabel)??c.ValueLabel??qh,wn=(_==null?void 0:_.mark)??c.Mark??OC,$r=(_==null?void 0:_.markLabel)??c.MarkLabel??PC,F=(_==null?void 0:_.input)??c.Input??"input",U=(A==null?void 0:A.root)??u.root,Y=(A==null?void 0:A.rail)??u.rail,ne=(A==null?void 0:A.track)??u.track,ue=(A==null?void 0:A.thumb)??u.thumb,J=(A==null?void 0:A.valueLabel)??u.valueLabel,_e=(A==null?void 0:A.mark)??u.mark,Oe=(A==null?void 0:A.markLabel)??u.markLabel,Se=(A==null?void 0:A.input)??u.input,We=Lt({elementType:Dt,getSlotProps:xt,externalSlotProps:U,externalForwardedProps:Q,additionalProps:{...TC(Dt)&&{as:l}},ownerState:{...ee,...U==null?void 0:U.ownerState},className:[ge.root,f]}),Kn=Lt({elementType:kr,externalSlotProps:Y,ownerState:ee,className:ge.rail}),rf=Lt({elementType:Or,externalSlotProps:ne,additionalProps:{style:{...Ne[Ge].offset(te),...Ne[Ge].leap(Ae)}},ownerState:{...ee,...ne==null?void 0:ne.ownerState},className:ge.track}),Do=Lt({elementType:Pr,getSlotProps:je,externalSlotProps:ue,ownerState:{...ee,...ue==null?void 0:ue.ownerState},className:ge.thumb}),of=Lt({elementType:Dr,externalSlotProps:J,ownerState:{...ee,...J==null?void 0:J.ownerState},className:ge.valueLabel}),$o=Lt({elementType:wn,externalSlotProps:_e,ownerState:ee,className:ge.mark}),Lo=Lt({elementType:$r,externalSlotProps:Oe,ownerState:ee,className:ge.markLabel}),sf=Lt({elementType:F,getSlotProps:bt,externalSlotProps:Se,ownerState:ee});return x.jsxRuntimeExports.jsxs(Dt,{...We,children:[x.jsxRuntimeExports.jsx(kr,{...Kn}),x.jsxRuntimeExports.jsx(Or,{...rf}),L.filter(ve=>ve.value>=E&&ve.value<=w).map((ve,Ie)=>{const No=zi(ve.value,E,w),Lr=Ne[Ge].offset(No);let St;return N===!1?St=ie.includes(ve.value):St=N==="normal"&&(q?ve.value>=ie[0]&&ve.value<=ie[ie.length-1]:ve.value<=ie[0])||N==="inverted"&&(q?ve.value<=ie[0]||ve.value>=ie[ie.length-1]:ve.value>=ie[0]),x.jsxRuntimeExports.jsxs(j.Fragment,{children:[x.jsxRuntimeExports.jsx(wn,{"data-index":Ie,...$o,...!dr(wn)&&{markActive:St},style:{...Lr,...$o.style},className:De($o.className,St&&ge.markActive)}),ve.label!=null?x.jsxRuntimeExports.jsx($r,{"aria-hidden":!0,"data-index":Ie,...Lo,...!dr($r)&&{markLabelActive:St},style:{...Lr,...Lo.style},className:De(ge.markLabel,Lo.className,St&&ge.markLabelActive),children:ve.label}):null]},Ie)}),ie.map((ve,Ie)=>{const No=zi(ve,E,w),Lr=Ne[Ge].offset(No),St=B==="off"?$C:Dr;return x.jsxRuntimeExports.jsx(St,{...!dr(St)&&{valueLabelFormat:Z,valueLabelDisplay:B,value:typeof Z=="function"?Z(g(ve),Ie):Z,index:Ie,open:vt===Ie||ot===Ie||B==="on",disabled:p},...of,children:x.jsxRuntimeExports.jsx(Pr,{"data-index":Ie,...Do,className:De(ge.thumb,Do.className,ot===Ie&&ge.active,V===Ie&&ge.focusVisible),style:{...Lr,...Ce(Ie),...Do.style},children:x.jsxRuntimeExports.jsx(F,{"data-index":Ie,"aria-label":y?y(Ie):o,"aria-valuenow":g(ve),"aria-labelledby":a,"aria-valuetext":v?v(g(ve),Ie):s,value:ie[Ie],...sf})})},Ie)})]})});process.env.NODE_ENV!=="production"&&(Jh.propTypes={"aria-label":uu(b.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":b.string,"aria-valuetext":uu(b.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:b.node,classes:b.object,className:b.string,color:b.oneOfType([b.oneOf(["primary","secondary","error","info","success","warning"]),b.string]),components:b.shape({Input:b.elementType,Mark:b.elementType,MarkLabel:b.elementType,Rail:b.elementType,Root:b.elementType,Thumb:b.elementType,Track:b.elementType,ValueLabel:b.elementType}),componentsProps:b.shape({input:b.oneOfType([b.func,b.object]),mark:b.oneOfType([b.func,b.object]),markLabel:b.oneOfType([b.func,b.object]),rail:b.oneOfType([b.func,b.object]),root:b.oneOfType([b.func,b.object]),thumb:b.oneOfType([b.func,b.object]),track:b.oneOfType([b.func,b.object]),valueLabel:b.oneOfType([b.func,b.shape({children:b.element,className:b.string,open:b.bool,style:b.object,value:b.node,valueLabelDisplay:b.oneOf(["auto","off","on"])})])}),defaultValue:b.oneOfType([b.arrayOf(b.number),b.number]),disabled:b.bool,disableSwap:b.bool,getAriaLabel:b.func,getAriaValueText:b.func,marks:b.oneOfType([b.arrayOf(b.shape({label:b.node,value:b.number.isRequired})),b.bool]),max:b.number,min:b.number,name:b.string,onChange:b.func,onChangeCommitted:b.func,orientation:b.oneOf(["horizontal","vertical"]),scale:b.func,shiftStep:b.number,size:b.oneOfType([b.oneOf(["small","medium"]),b.string]),slotProps:b.shape({input:b.oneOfType([b.func,b.object]),mark:b.oneOfType([b.func,b.object]),markLabel:b.oneOfType([b.func,b.object]),rail:b.oneOfType([b.func,b.object]),root:b.oneOfType([b.func,b.object]),thumb:b.oneOfType([b.func,b.object]),track:b.oneOfType([b.func,b.object]),valueLabel:b.oneOfType([b.func,b.shape({children:b.element,className:b.string,open:b.bool,style:b.object,value:b.node,valueLabelDisplay:b.oneOf(["auto","off","on"])})])}),slots:b.shape({input:b.elementType,mark:b.elementType,markLabel:b.elementType,rail:b.elementType,root:b.elementType,thumb:b.elementType,track:b.elementType,valueLabel:b.elementType}),step:b.number,sx:b.oneOfType([b.arrayOf(b.oneOfType([b.func,b.object,b.bool])),b.func,b.object]),tabIndex:b.number,track:b.oneOf(["inverted","normal",!1]),value:b.oneOfType([b.arrayOf(b.number),b.number]),valueLabelDisplay:b.oneOf(["auto","off","on"]),valueLabelFormat:b.oneOfType([b.func,b.string])});var LC="[object Number]";function NC(e){return typeof e=="number"||dn(e)&&bn(e)==LC}const Kh=oe.observer(e=>{var o,s,a;const t=M.useTheme(),{store:n}=e,{t:r}=fe.useTranslation();function i(l,c){c===e.velocity||!NC(c)||e.onVelocityChange(c)}return x.jsxRuntimeExports.jsxs(M.Stack,{direction:"row",gap:2,alignItems:"center",children:[n.showVelocityLegend&&x.jsxRuntimeExports.jsx(M.Typography,{sx:{color:(a=(s=(o=t.componentsExt)==null?void 0:o.JoggingPanel)==null?void 0:s.VelocitySlider)==null?void 0:a.sliderLegendColor,fontSize:"14px"},children:r("Jogging.Velocity.bt")}),x.jsxRuntimeExports.jsx(Jh,{value:e.velocity,color:"secondary",onChange:i,min:e.min,max:e.max,"aria-labelledby":"input-slider",disabled:e.disabled,sx:{"& .MuiSlider-valueLabelOpen":{zIndex:100,backgroundColor:"transparent",top:"0px"}}}),n.showVelocitySliderLabel&&(e.renderValue?e.renderValue(e.velocity):x.jsxRuntimeExports.jsx(Ka,{value:e.velocity.toString()}))]})});function Ka({value:e,sx:t}){var r;const n=M.useTheme();return x.jsxRuntimeExports.jsx(M.Stack,{direction:"row",justifyContent:"center",alignItems:"center",gap:"5px",sx:{padding:"6px 12px",background:(r=n.palette.backgroundPaperElevation)==null?void 0:r[8],borderRadius:"10px",minWidth:"111px",...t},children:x.jsxRuntimeExports.jsx(M.Typography,{component:"span",sx:{textAlign:"right",fontSize:"14px",opacity:.8,color:n.palette.text.primary,whiteSpace:"nowrap"},children:e})})}const Xh=oe.observer(({store:e})=>{const{t}=fe.useTranslation(),n=oe.useLocalObservable(()=>({get valueLabelFormat(){return e.currentMotionType==="translate"?r=>`v = ${t("Jogging.Cartesian.Translation.velocityMmPerSec.lb",{amount:r})}`:r=>`ω = ${t("Jogging.Cartesian.Rotation.velocityDegPerSec.lb",{amount:r})}`}}));return x.jsxRuntimeExports.jsx(Kh,{store:e,velocity:e.velocityInDisplayUnits,min:e.minVelocityInDisplayUnits,max:e.maxVelocityInDisplayUnits,onVelocityChange:e.setVelocityFromSlider,disabled:e.isLocked,renderValue:r=>x.jsxRuntimeExports.jsx(Ka,{value:n.valueLabelFormat(r),sx:{minWidth:"111px",span:{transform:"translateY(-1.5px)"}}})})}),zC=oe.observer(({store:e,children:t})=>{const{t:n}=fe.useTranslation(),r=M.useTheme();function i(h,f){(f==="translate"||f==="rotate")&&e.setSelectedCartesianMotionType(f)}de.useReaction(()=>[e.selectedCoordSystemId,e.selectedTcpId],()=>{e.jogger.motionStream.motionStateSocket.changeUrl(e.jogger.nova.makeWebsocketURL(`/controllers/${e.jogger.motionStream.controllerId}/motion-groups/${e.jogger.motionGroupId}/state-stream?tcp=${e.selectedTcpId}`))},{fireImmediately:!0});async function o(h,f){const m=await e.activate(),p=m.motionStream.rapidlyChangingMotionState.tcp_pose,y=m.motionStream.rapidlyChangingMotionState.joint_position;p&&await e.withMotionLock(async()=>{try{e.setCurrentIncrementJog({axis:h.axis,direction:h.direction}),await e.jogger.runIncrementalCartesianMotion({currentTcpPose:p,currentJoints:y,coordSystemId:e.activeCoordSystemId,velocityInRelevantUnits:e.selectedCartesianMotionType==="translate"?e.translationVelocityMmPerSec:e.rotationVelocityRadsPerSec,axis:h.axis,direction:h.direction,motion:e.selectedCartesianMotionType==="translate"?{type:"translate",distanceMm:f.mm}:{type:"rotate",distanceRads:Ee.degreesToRadians(f.degrees)}})}finally{e.setCurrentIncrementJog(null),await e.deactivate()}})}async function s(h){if(!e.isLocked){if(await e.activate(),e.activeDiscreteIncrement)return o(h,e.activeDiscreteIncrement);h.motionType==="translate"?await e.jogger.translateTCP({axis:h.axis,direction:h.direction,velocityMmPerSec:e.translationVelocityMmPerSec}):await e.jogger.rotateTCP({axis:h.axis,direction:h.direction,velocityRadsPerSec:e.rotationVelocityRadsPerSec})}}async function a(){e.isLocked||e.activeDiscreteIncrement||await e.deactivate()}function l(h,f,m){var y,v,T;const p=(T=(v=(y=m.componentsExt)==null?void 0:y.JoggingPanel)==null?void 0:v.JoggingCartesian)==null?void 0:T.Axis;if(p)return f==="translate"?p[h]:p.CustomRotation??p[h]}const c=[{id:"x",icon:x.jsxRuntimeExports.jsx(tC,{}),colors:l("X",e.selectedCartesianMotionType,r)},{id:"y",icon:x.jsxRuntimeExports.jsx(rC,{}),colors:l("Y",e.selectedCartesianMotionType,r)},{id:"z",icon:x.jsxRuntimeExports.jsx(oC,{}),colors:l("Z",e.selectedCartesianMotionType,r)}];function u(h){return n("General.mm.variable",{amount:h.toFixed(1)})}function d(h){return n("General.degree.variable",{amount:Ee.radiansToDegrees(h).toFixed(1)})}return x.jsxRuntimeExports.jsxs(M.Stack,{flexGrow:1,gap:2,sx:{padding:"18px 24px"},children:[x.jsxRuntimeExports.jsxs(M.Stack,{gap:2,children:[x.jsxRuntimeExports.jsx(uC,{store:e}),x.jsxRuntimeExports.jsx(Xh,{store:e}),x.jsxRuntimeExports.jsx(M.Divider,{})]}),x.jsxRuntimeExports.jsx(M.Stack,{marginLeft:"auto",marginRight:"auto",gap:"24px",justifyContent:"center",sx:{flexGrow:"1"},children:x.jsxRuntimeExports.jsxs(M.Stack,{alignItems:"center",justifyContent:"center",gap:"24px",sx:{flexGrow:1},children:[x.jsxRuntimeExports.jsxs(dC,{value:e.selectedCartesianMotionType,onChange:i,exclusive:!0,"aria-label":n("Jogging.Cartesian.MotionType.lb"),sx:{justifyContent:"center"},children:[x.jsxRuntimeExports.jsx(M.ToggleButton,{value:"translate",children:n("Jogging.Cartesian.Translation.bt")}),x.jsxRuntimeExports.jsx(M.ToggleButton,{value:"rotate",children:n("Jogging.Cartesian.Rotation.bt")})]}),e.selectedCartesianMotionType==="translate"&&c.map(h=>{var f,m;return x.jsxRuntimeExports.jsx(Ds,{colors:h.colors,disabled:e.isLocked,activeJoggingDirection:((f=e.incrementJogInProgress)==null?void 0:f.axis)===h.id?e.incrementJogInProgress.direction:void 0,label:x.jsxRuntimeExports.jsxs(x.jsxRuntimeExports.Fragment,{children:[h.icon,x.jsxRuntimeExports.jsx(M.Typography,{sx:{fontSize:"24px",color:((m=h.colors)==null?void 0:m.labelColor)??r.palette.text.primary},children:h.id.toUpperCase()})]}),getDisplayedValue:()=>{var p,y;return u(((y=(p=e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose)==null?void 0:p.position)==null?void 0:y[Ee.XYZ_TO_VECTOR[h.id]])||0)},startJogging:p=>s({axis:h.id,motionType:"translate",direction:p}),stopJogging:a},h.id)}),e.selectedCartesianMotionType==="rotate"&&c.map(h=>{var f,m;return x.jsxRuntimeExports.jsx(Ds,{colors:h.colors,disabled:e.isLocked,activeJoggingDirection:((f=e.incrementJogInProgress)==null?void 0:f.axis)===h.id?e.incrementJogInProgress.direction:void 0,label:x.jsxRuntimeExports.jsxs(x.jsxRuntimeExports.Fragment,{children:[x.jsxRuntimeExports.jsx(aC,{}),x.jsxRuntimeExports.jsx(M.Typography,{sx:{fontSize:"24px",color:((m=h.colors)==null?void 0:m.labelColor)??r.palette.text.primary},children:h.id.toUpperCase()})]}),getDisplayedValue:()=>{var p,y;return d(((y=(p=e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose)==null?void 0:p.orientation)==null?void 0:y[Ee.XYZ_TO_VECTOR[h.id]])||0)},startJogging:p=>s({axis:h.id,motionType:"rotate",direction:p}),stopJogging:a},h.id)})]})}),x.jsxRuntimeExports.jsx(Wh,{store:e}),t&&x.jsxRuntimeExports.jsx(M.Divider,{}),t]})}),FC=oe.observer(({store:e,children:t})=>{const n=M.useTheme();async function r(o){await e.activate(),await e.jogger.rotateJoints({joint:o.joint,direction:o.direction,velocityRadsPerSec:e.rotationVelocityRadsPerSec})}async function i(){await e.jogger.stop(),await e.deactivate()}return x.jsxRuntimeExports.jsxs(M.Stack,{flexGrow:1,gap:2,sx:{padding:"18px 24px"},children:[x.jsxRuntimeExports.jsx(Xh,{store:e}),x.jsxRuntimeExports.jsx(M.Divider,{}),x.jsxRuntimeExports.jsx(M.Stack,{justifyContent:"center",alignItems:"stretch",sx:{flexGrow:"1"},children:x.jsxRuntimeExports.jsx(M.Stack,{alignItems:"center",gap:"24px",children:e.jogger.motionStream.joints.map(o=>{var c,u,d;const s=(d=(u=(c=e.motionGroupDescription.operation_limits.auto_limits)==null?void 0:c.joints)==null?void 0:u[o.index])==null?void 0:d.position,a=(s==null?void 0:s.lower_limit)!==void 0?Ee.radiansToDegrees(s.lower_limit):void 0,l=(s==null?void 0:s.upper_limit)!==void 0?Ee.radiansToDegrees(s.upper_limit):void 0;return x.jsxRuntimeExports.jsxs(M.Stack,{direction:"row",alignItems:"center",justifyContent:"center",spacing:1.5,width:"100%",children:[e.showJointsLegend&&x.jsxRuntimeExports.jsx(M.Typography,{color:e.isLocked?n.palette.text.disabled:n.palette.text.secondary,children:`G${o.index+1}`}),x.jsxRuntimeExports.jsx(_h,{disabled:e.isLocked,lowerLimitDegs:a,upperLimitDegs:l,getValueDegs:()=>{const h=e.jogger.motionStream.rapidlyChangingMotionState.joint_position[o.index];return h!==void 0?Ee.radiansToDegrees(h):void 0},startJogging:h=>r({joint:o.index,direction:h}),stopJogging:i})]},`joint-${o.index}`)})})}),x.jsxRuntimeExports.jsx(Wh,{store:e}),t&&x.jsxRuntimeExports.jsx(M.Divider,{}),t]})}),BC=x.externalizeComponent(oe.observer(e=>{const t=bu.isString(e.nova)?new Of({instanceUrl:e.nova}):e.nova,n=oe.useLocalObservable(()=>({joggingStore:null,loadingError:null}));async function r(){he.runInAction(()=>{n.loadingError=null,n.joggingStore=null});try{let i=e.store;if(!i){const o=await Ao.open(t,e.motionGroupId);i=await Po.loadFor(o)}he.runInAction(()=>{n.joggingStore=i}),e.onSetup&&e.onSetup(i)}catch(i){n.loadingError=i}}return $.useEffect(()=>(r(),e.store?()=>null:()=>{var i;(i=n.joggingStore)==null||i.dispose()}),[e.store,e.nova,e.motionGroupId]),$.useEffect(()=>{const i=n.joggingStore;i&&(e.locked?i.lock("external"):i.unlock("external"))},[n.joggingStore,e.locked]),x.jsxRuntimeExports.jsx(M.Stack,{sx:{maxWidth:"460px",minWidth:"320px",position:"relative",...e.sx},children:n.joggingStore?x.jsxRuntimeExports.jsx(GC,{store:n.joggingStore,children:e.children}):x.jsxRuntimeExports.jsx(vu.LoadingCover,{message:"Loading jogging",error:n.loadingError})})})),GC=oe.observer(({store:e,children:t})=>{const{t:n}=fe.useTranslation();function r(){if(e.currentTab.id==="cartesian")return x.jsxRuntimeExports.jsx(x.jsxRuntimeExports.Fragment,{children:x.jsxRuntimeExports.jsx(zC,{store:e,children:t})});if(e.currentTab.id==="joint")return x.jsxRuntimeExports.jsx(x.jsxRuntimeExports.Fragment,{children:x.jsxRuntimeExports.jsx(FC,{store:e,children:t})})}return x.jsxRuntimeExports.jsxs(M.Stack,{flexGrow:1,sx:{overflow:"hidden"},children:[x.jsxRuntimeExports.jsx(M.Tabs,{value:e.tabIndex,onChange:e.onTabChange,variant:"fullWidth",children:e.tabs.map(i=>{const o=i.label==="cartesian"?n("Jogging.Cartesian.bt"):n("Jogging.Joints.bt"),s=i.label==="cartesian"?x.jsxRuntimeExports.jsx($w,{fontSize:"small",sx:{mr:1}}):x.jsxRuntimeExports.jsx(Lw,{fontSize:"small",sx:{mr:1}});return x.jsxRuntimeExports.jsx(M.Tab,{label:e.showTabIcons?x.jsxRuntimeExports.jsxs(M.Stack,{direction:"row",alignItems:"center",children:[s,o]}):o,id:`jogging-tab-${i.id}`,"aria-controls":`jogging-tab-${i.id}`},i.id)})}),x.jsxRuntimeExports.jsx(M.Stack,{flexGrow:1,position:"relative",sx:{overflowY:"auto",overflowX:"hidden"},children:r()}),e.blocked&&x.jsxRuntimeExports.jsx(QT,{store:e})]})}),Zh=e=>{var a;const{value:t,ref:n}=e,r=M.useTheme(),[i,o]=$.useState(!1);async function s(){if(!n||!("current"in n))return console.warn("No copy target found"),!1;try{return await navigator.clipboard.writeText(t),console.log("Copied!"),o(!0),!0}catch(l){console.error(l);const c=window.getSelection();if(c&&n&&"current"in n&&n.current){const u=document.createRange();u.selectNodeContents(n.current),c.removeAllRanges(),c.addRange(u)}}return!1}return $.useEffect(()=>{if(!i)return;const l=setTimeout(()=>o(!1),3e3);return()=>{l&&clearTimeout(l)}},[i]),x.jsxRuntimeExports.jsx(M.Tooltip,{open:i,title:"Copied!",children:x.jsxRuntimeExports.jsx(M.Stack,{justifyContent:"center",sx:{height:"100%",boxSizing:"border-box",padding:"6px 12px",background:(a=r.palette.backgroundPaperElevation)==null?void 0:a[8],borderRadius:"10px",minWidth:"0",cursor:"pointer"},onClick:()=>s(),children:x.jsxRuntimeExports.jsx(M.Typography,{ref:n,align:"center",sx:{pointerEvents:"none",fontSize:"12px",color:r.palette.text.primary,whiteSpace:"nowrap",minWidth:0,textOverflow:"ellipsis",width:"100%",overflow:"hidden"},children:t})})})},VC=x.externalizeComponent(oe.observer(({tcpPose:e,showCopyButton:t=!1})=>{const[n,r]=$.useState(null),i=Pf(e),o=async()=>{try{await navigator.clipboard.writeText(i),r("Copied!"),setTimeout(()=>r(null),2e3)}catch{r("Copy failed"),setTimeout(()=>r(null),2e3)}};return x.jsxRuntimeExports.jsxs(M.Stack,{direction:"row",alignItems:"center",spacing:1,sx:{flexGrow:1,minWidth:0,overflow:"hidden"},"data-testid":"pose-cartesian-values",children:[x.jsxRuntimeExports.jsx(Zh,{value:i}),t&&x.jsxRuntimeExports.jsx(M.Button,{variant:"contained",color:"secondary",size:"small",onClick:o,sx:{flexShrink:0},children:n||"Copy"})]})})),UC=x.externalizeComponent(oe.observer(({joints:e,showCopyButton:t=!1})=>{const[n,r]=$.useState(null),i=`[${e.map(s=>parseFloat(s.toFixed(4))).join(", ")}]`,o=async()=>{try{await navigator.clipboard.writeText(i),r("Copied!"),setTimeout(()=>r(null),2e3)}catch{r("Copy failed"),setTimeout(()=>r(null),2e3)}};return x.jsxRuntimeExports.jsxs(M.Stack,{direction:"row",alignItems:"center",spacing:1,sx:{flexGrow:1,minWidth:0,overflow:"hidden"},"data-testid":"pose-joint-values",children:[x.jsxRuntimeExports.jsx(Zh,{value:i}),t&&x.jsxRuntimeExports.jsx(M.Button,{variant:"contained",color:"secondary",size:"small",onClick:o,sx:{flexShrink:0},children:n||"Copy"})]})}));class Qh{constructor(){this.messages=[],this.addMessage=(t,n="info")=>{const r={id:Math.random().toString(36).substring(2,11),timestamp:new Date,message:t,level:n};this.messages.push(r)},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")},he.makeObservable(this,{messages:he.observable,addMessage:he.action,clearMessages:he.action})}}const jr=(e,t,n)=>({id:n||`${Date.now()}-${Math.random().toString(36).substring(2,11)}`,timestamp:new Date,message:e,level:t}),WC=(e,t)=>jr(e,"debug",t),HC=(e,t)=>jr(e,"info",t),YC=(e,t)=>jr(e,"warning",t),qC=(e,t)=>jr(e,"error",t),ef=x.externalizeComponent(oe.observer(e=>{var u;const{messages:t=[],onClear:n,height:r=400,sx:i}=e,o=M.useTheme(),s=$.useRef(null);$.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 a=d=>d.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),l=d=>{switch(d){case"error":return o.palette.error.main;case"warning":return o.palette.warning.main;case"info":return o.palette.info.main;case"debug":return o.palette.text.disabled;default:return o.palette.text.secondary}},c=({message:d})=>{const[h,f]=$.useState(!1),[m,p]=$.useState(!1),[y,v]=$.useState(!1),T=d.message.length>150,w=async()=>{try{await navigator.clipboard.writeText(d.message),p(!0),setTimeout(()=>p(!1),2e3)}catch(R){console.error("Failed to copy message:",R)}},E=T&&!h?d.message.substring(0,150)+"...":d.message;return x.jsxRuntimeExports.jsx(M.Box,{onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),sx:{display:"flex",gap:1,fontFamily:"monospace",flexDirection:"column","&:hover":{backgroundColor:o.palette.action.hover},borderRadius:"4px",padding:"2px 4px",margin:"-2px -4px"},children:x.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",gap:1},children:[x.jsxRuntimeExports.jsxs(M.Typography,{component:"span",sx:{fontWeight:400,fontSize:"12px",lineHeight:"18px",letterSpacing:"0.4px",color:o.palette.text.disabled,whiteSpace:"nowrap",flexShrink:0},children:["[",a(d.timestamp),"]"]}),x.jsxRuntimeExports.jsx(M.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:E}),x.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",alignItems:"flex-start",gap:.5,opacity:y?1:0,transition:"opacity 0.2s ease-in-out",visibility:y?"visible":"hidden"},children:[x.jsxRuntimeExports.jsx(M.IconButton,{size:"small",onClick:w,sx:{padding:"2px",color:o.palette.text.secondary,"&:hover":{backgroundColor:o.palette.action.hover}},title:m?"Copied!":"Copy message",children:x.jsxRuntimeExports.jsx(Nr.ContentCopy,{sx:{fontSize:12}})}),T&&x.jsxRuntimeExports.jsx(M.IconButton,{size:"small",onClick:()=>f(!h),sx:{padding:"2px",color:o.palette.text.secondary,"&:hover":{backgroundColor:o.palette.action.hover}},title:h?"Collapse":"Expand",children:h?x.jsxRuntimeExports.jsx(Nr.ExpandLess,{sx:{fontSize:12}}):x.jsxRuntimeExports.jsx(Nr.ExpandMore,{sx:{fontSize:12}})})]})]})},d.id)};return x.jsxRuntimeExports.jsxs(M.Paper,{sx:{backgroundColor:((u=o.palette.backgroundPaperElevation)==null?void 0:u[2])||"#171927",backgroundImage:"none",height:r,display:"flex",flexDirection:"column",overflow:"hidden",...i},children:[x.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px"},children:[x.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[x.jsxRuntimeExports.jsx(Nr.DescriptionOutlined,{sx:{fontSize:16,color:o.palette.action.active,opacity:.56}}),x.jsxRuntimeExports.jsx(M.Typography,{sx:{fontWeight:500,fontSize:"14px",lineHeight:"143%",letterSpacing:"0.17px",color:o.palette.text.primary},children:"Log"})]}),x.jsxRuntimeExports.jsx(M.Button,{onClick:n,variant:"text",sx:{fontWeight:500,fontSize:"13px",lineHeight:"22px",letterSpacing:"0.46px",color:o.palette.primary.main,textTransform:"none",minWidth:"auto",padding:"4px 8px","&:hover":{backgroundColor:o.palette.primary.main+"14"}},children:"Clear"})]}),x.jsxRuntimeExports.jsx(M.Box,{ref:s,sx:{flex:1,overflow:"auto",padding:"8px 16px",display:"flex",flexDirection:"column",gap:"2px",scrollbarWidth:"thin",scrollbarColor:`${o.palette.divider} transparent`,"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:o.palette.divider,borderRadius:"3px","&:hover":{backgroundColor:o.palette.divider}}},children:t.length===0?x.jsxRuntimeExports.jsx(M.Typography,{sx:{color:o.palette.text.disabled,fontSize:"12px",fontStyle:"italic",textAlign:"center",marginTop:2},children:"No log messages"}):t.map(d=>x.jsxRuntimeExports.jsx(c,{message:d},d.id))})]})})),JC=x.externalizeComponent(oe.observer(e=>{const{store:t,onStoreReady:n,...r}=e,i=$.useRef(n);$.useEffect(()=>{i.current=n},[n]);const o=$.useMemo(()=>{var l;const a=t||new Qh;return(l=i.current)==null||l.call(i,a),a},[t]),s=()=>{o.clearMessages()};return x.jsxRuntimeExports.jsx(ef,{...r,messages:o.messages,onClear:s})}));function KC(){const e=window.location.href;return e.substring(0,e.indexOf("/",e.indexOf("//")+2))}function XC({baseUrl:e=KC(),...t}){return x.jsxRuntimeExports.jsxs(M.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:[x.jsxRuntimeExports.jsx(M.DialogTitle,{id:"no-motion-group-modal-title",children:"No motion group found"}),x.jsxRuntimeExports.jsxs(M.DialogContent,{sx:{marginTop:"3rem",marginBottom:"1.5rem",textAlign:"center"},children:[x.jsxRuntimeExports.jsx(M.Typography,{color:"#fff",children:"Found no devices to connect to."}),x.jsxRuntimeExports.jsx(M.Typography,{color:"#fff",children:"Please ensure a motion group has been created."})]}),x.jsxRuntimeExports.jsx(M.DialogActions,{children:x.jsxRuntimeExports.jsxs(M.Stack,{width:"100%",maxWidth:"300px",margin:"auto",marginBottom:"2rem",children:[x.jsxRuntimeExports.jsx(M.Button,{href:`${e}/settings`,variant:"contained",sx:{borderRadius:"8px",width:"100%"},children:"Go to settings app"}),x.jsxRuntimeExports.jsx(M.Button,{href:`${e}`,variant:"text",sx:{marginTop:"1rem",color:"#fff",textDecoration:"underline",fontSize:"0.75rem"},children:"Back to Homescreen"})]})})]})}const ZC=Kt(x.jsxRuntimeExports.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"),QC=({title:e,titleId:t,...n},r)=>j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:18,height:18,fill:"none",ref:r,"aria-labelledby":t,...n},e?j.createElement("title",{id:t},e):null,j.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"})),e5=$.forwardRef(QC);var Xa=(e=>(e.PRECONDITION_NOT_FULFILLED="PRECONDITION_NOT_FULFILLED",e.ROBOT_DISCONNECTED="ROBOT_DISCONNECTED",e.CELL_OPEN="CELL_OPEN",e.E_STOP="E_STOP",e.MANUAL_MODE="MANUAL_MODE",e.READY="READY",e))(Xa||{});const tf=x.externalizeComponent(oe.observer(({setupState:e,className:t})=>{const n=M.useTheme(),{t:r}=fe.useTranslation(),i=()=>{var c,u,d,h,f,m,p;switch(e){case"READY":return{label:r("RobotSetupReadinessIndicator.Ready.lb"),indicatorColor:((c=n.palette.tertiary)==null?void 0:c.main)||n.palette.primary.main,backgroundColor:((u=n.palette.backgroundPaperElevation)==null?void 0:u[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case"ROBOT_DISCONNECTED":return{label:r("RobotSetupReadinessIndicator.RobotDisconnected.lb"),indicatorColor:n.palette.error.main,backgroundColor:((d=n.palette.backgroundPaperElevation)==null?void 0:d[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case"CELL_OPEN":return{label:r("RobotSetupReadinessIndicator.CellOpen.lb"),indicatorColor:n.palette.error.main,backgroundColor:((h=n.palette.backgroundPaperElevation)==null?void 0:h[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case"E_STOP":return{label:r("RobotSetupReadinessIndicator.EStop.lb"),indicatorColor:n.palette.error.main,backgroundColor:((f=n.palette.backgroundPaperElevation)==null?void 0:f[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case"MANUAL_MODE":return{label:r("RobotSetupReadinessIndicator.ManualMode.lb"),indicatorColor:n.palette.error.main,backgroundColor:((m=n.palette.backgroundPaperElevation)==null?void 0:m[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case"PRECONDITION_NOT_FULFILLED":default:return{label:r("RobotSetupReadinessIndicator.PreconditionNotFulfilled.lb"),indicatorColor:n.palette.error.main,backgroundColor:((p=n.palette.backgroundPaperElevation)==null?void 0:p[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText}}},{label:o,indicatorColor:s,backgroundColor:a,textColor:l}=i();return x.jsxRuntimeExports.jsx(M.Chip,{className:t,label:x.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[x.jsxRuntimeExports.jsx(M.Box,{sx:{width:8,height:8,borderRadius:"50%",backgroundColor:s,flexShrink:0}}),x.jsxRuntimeExports.jsx(M.Typography,{variant:"body2",sx:{color:l,fontSize:"0.75rem",lineHeight:1.2},children:o})]}),variant:"filled",sx:{backgroundColor:a,color:n.palette.getContrastText(a),fontWeight:500,height:"auto","& .MuiChip-label":{paddingX:1.5,paddingY:.5}}})})),t5=x.externalizeComponent(oe.observer(({robotName:e,robotType:t,setupState:n,PreconditionComponent:r=tf,className:i})=>{var l;const o=M.useTheme(),s=t||"Robot",a=n===Xa.READY;return x.jsxRuntimeExports.jsxs(M.Box,{className:i,sx:{border:`1px solid ${o.palette.divider}`,background:((l=o.palette.backgroundPaperElevation)==null?void 0:l[8])||"#292B3F",borderRadius:"8px",padding:"20px",display:"flex",alignItems:"center",justifyContent:"space-between",opacity:1},children:[x.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",alignItems:"center",gap:2,flex:1},children:[a?x.jsxRuntimeExports.jsx(M.Box,{sx:{fontSize:24,display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,"& svg":{fill:`${o.palette.primary.main} !important`},"& svg path":{fill:`${o.palette.primary.main} !important`}},children:x.jsxRuntimeExports.jsx(e5,{})}):x.jsxRuntimeExports.jsx(ZC,{sx:{color:o.palette.error.main,fontSize:24}}),x.jsxRuntimeExports.jsx(M.Typography,{variant:"body1",sx:{fontWeight:500,color:o.palette.text.primary},children:e}),x.jsxRuntimeExports.jsx(M.Divider,{orientation:"vertical",flexItem:!0,sx:{backgroundColor:o.palette.text.secondary,opacity:.3,width:"1px"}}),x.jsxRuntimeExports.jsx(M.Typography,{variant:"body2",sx:{color:o.palette.text.secondary},children:s})]}),r&&x.jsxRuntimeExports.jsx(r,{setupState:n})]})})),n5=({title:e,titleId:t,...n},r)=>j.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?j.createElement("title",{id:t},e):null,j.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"})),r5=$.forwardRef(n5),i5=({title:e,titleId:t,...n},r)=>j.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?j.createElement("title",{id:t},e):null,j.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"})),o5=$.forwardRef(i5),dt=oe.observer(({id:e,icon:t,color:n,title:r,name:i,label:o,explanation:s,literalValue:a,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 x.jsxRuntimeExports.jsxs(x.jsxRuntimeExports.Fragment,{children:[x.jsxRuntimeExports.jsxs(M.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:[x.jsxRuntimeExports.jsx(M.SvgIcon,{component:t,sx:{color:n}}),o&&x.jsxRuntimeExports.jsx("div",{style:{color:n},children:o})]}),x.jsxRuntimeExports.jsx(M.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:x.jsxRuntimeExports.jsxs(M.Stack,{gap:"1rem",padding:2,maxWidth:"450px",sx:{wordWrap:"break-word"},children:[x.jsxRuntimeExports.jsxs("div",{children:[r&&x.jsxRuntimeExports.jsx(M.Typography,{component:"span",fontSize:"14px",children:`${r}: `}),x.jsxRuntimeExports.jsx(M.Typography,{component:"span",color:n,fontWeight:"bold",fontSize:"14px",children:i})]}),x.jsxRuntimeExports.jsx(M.Typography,{fontSize:"14px",children:s}),a&&x.jsxRuntimeExports.jsx(M.Typography,{fontSize:"12px",children:a})]})})]})}),s5=oe.observer(({isVirtual:e,motionGroupId:t,anchorOrigin:n,transformOrigin:r,compact:i})=>{const o=M.useTheme(),s=$.useId(),{t:a}=fe.useTranslation();return e?x.jsxRuntimeExports.jsx(dt,{id:`motion-group-virtual-${s}`,icon:o5,color:o.palette.tertiary.main,name:a("SafetyBar.ControllerType.Virtual.lb"),label:i?null:a("SafetyBar.ControllerType.Virtual.lb"),explanation:x.jsxRuntimeExports.jsxs(fe.Trans,{i18nKey:"SafetyBar.MotionGroup.Virtual.Explanation.lb",values:{motionGroupId:t},children:["Motion group ",x.jsxRuntimeExports.jsx("code",{children:t})," refers to a virtual robot with no physical counterpart. It can be freely manipulated without special safety precautions."]}),anchorOrigin:n,transformOrigin:r}):x.jsxRuntimeExports.jsx(dt,{id:`motion-group-physical-${s}`,icon:r5,color:o.palette.primary.main,name:a("SafetyBar.ControllerType.Physical.lb"),label:i?null:a("SafetyBar.ControllerType.Physical.lb"),explanation:x.jsxRuntimeExports.jsx(fe.Trans,{i18nKey:"SafetyBar.MotionGroup.Physical.Explanation.lb",values:{motionGroupId:t},components:{code:x.jsxRuntimeExports.jsx("code",{}),strong:x.jsxRuntimeExports.jsx("strong",{})}}),anchorOrigin:n,transformOrigin:r})}),a5=({title:e,titleId:t,...n},r)=>j.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?j.createElement("title",{id:t},e):null,j.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"})),l5=$.forwardRef(a5),c5=({title:e,titleId:t,...n},r)=>j.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?j.createElement("title",{id:t},e):null,j.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})),u5=$.forwardRef(c5),d5=({title:e,titleId:t,...n},r)=>j.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?j.createElement("title",{id:t},e):null,j.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"})),h5=$.forwardRef(d5),f5=oe.observer(({operationMode:e,anchorOrigin:t,transformOrigin:n,compact:r})=>{const{t:i}=fe.useTranslation(),o=M.useTheme(),s=$.useId();switch(e){case"OPERATION_MODE_AUTO":return x.jsxRuntimeExports.jsx(dt,{id:`operation-mode-auto-${s}`,icon:l5,title:i("SafetyBar.OperationMode.ti"),name:i("SafetyBar.OperationMode.Automatic.ti"),label:r?null:i("SafetyBar.OperationMode.Automatic.ti"),color:o.palette.text.secondary,explanation:x.jsxRuntimeExports.jsx(fe.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:n});case"OPERATION_MODE_MANUAL":case"OPERATION_MODE_MANUAL_T1":case"OPERATION_MODE_MANUAL_T2":return x.jsxRuntimeExports.jsx(dt,{id:`operation-mode-manual-${s}`,icon:h5,color:o.palette.warning.main,title:i("SafetyBar.OperationMode.ti"),name:i("SafetyBar.OperationMode.Manual.lb"),label:r?null:i("SafetyBar.OperationMode.Manual.lb"),explanation:x.jsxRuntimeExports.jsx(fe.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:n});default:return x.jsxRuntimeExports.jsx(dt,{id:`operation-mode-error-${s}`,icon:u5,color:o.palette.warning.main,title:i("SafetyBar.OperationMode.ti"),name:i("SafetyBar.OperationMode.Error.lb"),label:r?null:i("SafetyBar.OperationMode.Error.lb"),explanation:x.jsxRuntimeExports.jsx(fe.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:n})}}),p5=({title:e,titleId:t,...n},r)=>j.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?j.createElement("title",{id:t},e):null,j.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"})),m5=$.forwardRef(p5),g5=({title:e,titleId:t,...n},r)=>j.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?j.createElement("title",{id:t},e):null,j.createElement("path",{d:"M10.24 10.636 12 13.764l1.76-3.128h-3.52Z"}),j.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"}),j.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"})),y5=$.forwardRef(g5),x5=({title:e,titleId:t,...n},r)=>j.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?j.createElement("title",{id:t},e):null,j.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})),b5=$.forwardRef(x5),v5=({title:e,titleId:t,...n},r)=>j.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?j.createElement("title",{id:t},e):null,j.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"})),S5=$.forwardRef(v5),w5=({title:e,titleId:t,...n},r)=>j.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?j.createElement("title",{id:t},e):null,j.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"})),E5=$.forwardRef(w5),T5=oe.observer(({safetyState:e,anchorOrigin:t,transformOrigin:n,compact:r})=>{const{t:i}=fe.useTranslation(),o=M.useTheme(),s=$.useId();switch(e){case"SAFETY_STATE_NORMAL":return x.jsxRuntimeExports.jsx(dt,{id:`safety-state-normal-${s}`,title:i("SafetyBar.SafetyState.ti"),name:i("SafetyBar.SafetyState.Normal.lb"),label:r?null:i("SafetyBar.SafetyState.Normal.lb"),icon:S5,color:o.palette.text.secondary,explanation:x.jsxRuntimeExports.jsx(fe.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:n});case"SAFETY_STATE_DEVICE_EMERGENCY_STOP":case"SAFETY_STATE_ROBOT_EMERGENCY_STOP":return x.jsxRuntimeExports.jsx(dt,{id:`safety-state-estop-${s}`,title:i("SafetyBar.SafetyState.ti"),name:i("SafetyBar.SafetyState.Estop.lb"),label:r?null:i("SafetyBar.SafetyState.Estop.lb"),icon:y5,color:o.palette.error.main,explanation:x.jsxRuntimeExports.jsx(fe.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:n});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 x.jsxRuntimeExports.jsx(dt,{id:`safety-state-stop-${s}`,icon:E5,title:i("SafetyBar.SafetyState.ti"),name:i("SafetyBar.SafetyState.Stop.lb"),label:r?null:i("SafetyBar.SafetyState.Stop.lb"),color:o.palette.warning.main,explanation:x.jsxRuntimeExports.jsx(fe.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:n});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 x.jsxRuntimeExports.jsx(dt,{id:`safety-state-manual-action-required-${s}`,icon:b5,color:o.palette.warning.main,title:i("SafetyBar.SafetyState.ti"),name:i("SafetyBar.SafetyState.ManualActionRequired.lb"),label:r?null:i("SafetyBar.SafetyState.ManualActionRequired.lb"),explanation:x.jsxRuntimeExports.jsx(fe.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:n});case"SAFETY_STATE_UNKNOWN":case"SAFETY_STATE_FAULT":return x.jsxRuntimeExports.jsx(dt,{id:`safety-state-error-${s}`,icon:m5,color:o.palette.error.main,title:i("SafetyBar.SafetyState.ti"),name:i("SafetyBar.SafetyState.Error.lb"),label:r?null:i("SafetyBar.SafetyState.Error.lb"),explanation:x.jsxRuntimeExports.jsx(fe.Trans,{i18nKey:"SafetyBar.SafetyState.Error.Explanation.lb",children:"The robot controller has entered an unexpected safety state."}),literalValue:e,anchorOrigin:t,transformOrigin:n});default:vu.assertUnreachable(e,`Unknown safety state ${e}`)}}),C5=x.externalizeComponent(oe.observer(({isVirtual:e,motionGroupId:t,operationMode:n,safetyState:r,anchorOrigin:i,transformOrigin:o,compact:s=!0})=>{const a=s?1:2;return x.jsxRuntimeExports.jsxs(M.Stack,{direction:"row",gap:a,alignItems:"center",sx:{height:"24px"},children:[x.jsxRuntimeExports.jsx(T5,{safetyState:r,anchorOrigin:i,transformOrigin:o,compact:s}),x.jsxRuntimeExports.jsx(M.Divider,{orientation:"vertical",flexItem:!0}),x.jsxRuntimeExports.jsx(f5,{operationMode:n,anchorOrigin:i,transformOrigin:o,compact:s}),x.jsxRuntimeExports.jsx(M.Divider,{orientation:"vertical",flexItem:!0}),x.jsxRuntimeExports.jsx(s5,{isVirtual:e,motionGroupId:t,anchorOrigin:i,transformOrigin:o,compact:s})]})})),_5=M.styled(M.Fab,{shouldForwardProp:e=>e!=="selected"})(({theme:e})=>{var t,n,r;return{borderRadius:"20px","&:hover":{background:(t=e.palette.backgroundPaperElevation)==null?void 0:t[7]},variants:[{props:({selected:i})=>!i,style:{background:(n=e.palette.backgroundPaperElevation)==null?void 0:n[0],color:e.palette.action.disabled,"> img":{opacity:.4}}},{props:({selected:i})=>i,style:{background:(r=e.palette.backgroundPaperElevation)==null?void 0:r[11],border:`1px solid ${e.palette.divider}`,color:e.palette.primary.contrastText}}]}}),M5=e=>{const{ref:t,...n}=e;return x.jsxRuntimeExports.jsx(_5,{ref:t,selected:e.selected,...n,color:"secondary",variant:"circular"})};function R5(e){const{children:t,value:n,index:r,...i}=e;return x.jsxRuntimeExports.jsx("div",{role:"tabpanel",hidden:n!==r,id:`tabpanel-${r}`,"aria-labelledby":`tab-${r}`,...i,children:n===r&&x.jsxRuntimeExports.jsx(M.Box,{children:t})})}function A5({children:e,...t}){const{fullWidth:n,indicator:r,onChange:i,orientation:o,scrollButtons:s,selectionFollowsFocus:a,textColor:l,value:c,variant:u,...d}=t;return x.jsxRuntimeExports.jsx(M.Box,{...d,children:e})}const I5=x.externalizeComponent(oe.observer(e=>{const{items:t,activeTab:n,defaultActiveTab:r=0,onTabChange:i,sx:o,ref:s}=e,a=n!==void 0,[l,c]=$.useState(r),u=a?n:l;$.useEffect(()=>{a||t.length!==0&&(l<0||l>t.length-1)&&c(0)},[t.length,a,l]);const d=(h,f)=>{a||c(f),i==null||i(f)};return x.jsxRuntimeExports.jsxs(M.Box,{ref:s,sx:{height:"100%",display:"flex",flexDirection:"column",...o},children:[x.jsxRuntimeExports.jsx(M.Box,{sx:{px:0,py:0,overflow:"visible",position:"relative",paddingTop:h=>h.spacing(2),paddingRight:h=>h.spacing(2.5)},children:x.jsxRuntimeExports.jsx(M.Tabs,{value:u,onChange:d,sx:{minHeight:"32px",backgroundColor:"transparent",overflow:"visible","& .MuiTabs-indicator":{display:"none"},"& .MuiTabs-flexContainer":{gap:2,overflow:"visible",paddingTop:0,paddingBottom:0},"& .MuiTabs-scroller":{overflow:"visible !important"},"& .MuiTab-root":{overflow:"visible"}},children:t.map((h,f)=>{var E,R,S;const m=()=>{if(!h.badge)return;const C=h.badge.content,I=h.badge.max;return typeof C=="number"&&I&&C>I?`${I}+`:C},p=()=>{if(!h.badge)return!1;const C=h.badge.content,I=h.badge.showZero;return!(C===0&&!I)},y=m(),v=p(),T=()=>{a||c(f),i==null||i(f)},w=x.jsxRuntimeExports.jsx(M.Tab,{label:h.label,icon:h.icon,iconPosition:"start",disableRipple:!0,onClick:T,sx:{minHeight:"32px",height:"32px",padding:"0px 10px",borderRadius:"12px",backgroundColor:C=>{var I;return((I=C.palette.backgroundPaperElevation)==null?void 0:I[11])||"#32344B"},color:"text.primary",opacity:u===f?1:.38,fontSize:"13px",transition:"all 0.2s ease-in-out",position:"relative",overflow:"visible","&:hover":{opacity:u===f?1:.6},"&.Mui-selected":{opacity:1,backgroundColor:C=>{var I;return((I=C.palette.backgroundPaperElevation)==null?void 0:I[11])||"#32344B"},color:"text.primary"},"&:focus":{outline:"none"},"&:active":{transform:"none"}}},h.id);return v?x.jsxRuntimeExports.jsx(A5,{component:"span",sx:{display:"inline-flex"},children:x.jsxRuntimeExports.jsx(M.Badge,{badgeContent:y,color:((E=h.badge)==null?void 0:E.color)||"error",max:(R=h.badge)==null?void 0:R.max,showZero:(S=h.badge)==null?void 0:S.showZero,anchorOrigin:{vertical:"top",horizontal:"right"},overlap:"rectangular",sx:{"& .MuiBadge-badge":{opacity:"1 !important"}},children:w})},h.id):w})})}),x.jsxRuntimeExports.jsx(M.Box,{sx:{mt:h=>h.spacing(2),borderBottom:1,borderColor:"divider"}}),x.jsxRuntimeExports.jsx(M.Box,{sx:{flex:1,overflow:"auto"},children:t.map((h,f)=>x.jsxRuntimeExports.jsx(R5,{value:u,index:f,children:h.content},h.id))})]})})),j5=e=>{const t=Math.floor(e/86400),n=Math.floor(e%86400/3600),r=Math.floor(e%3600/60),i=e%60,o=[];return t>0?(o.push(t.toString()),o.push(n.toString().padStart(2,"0")),o.push(r.toString().padStart(2,"0")),o.push(i.toString().padStart(2,"0"))):n>0?(o.push(n.toString()),o.push(r.toString().padStart(2,"0")),o.push(i.toString().padStart(2,"0"))):(o.push(r.toString()),o.push(i.toString().padStart(2,"0"))),o.join(":")},yu=(e,t)=>{const n=Math.floor(e/86400),r=Math.floor(e%86400/3600),i=Math.floor(e%3600/60),o=e%60;if(typeof Intl<"u"&&"DurationFormat"in Intl)try{const a={};return n>0&&(a.days=n),r>0&&(a.hours=r),i>0&&(a.minutes=i),(o>0||Object.keys(a).length===0)&&(a.seconds=o),new Intl.DurationFormat(t,{style:"narrow"}).format(a)}catch{}const s=[];return n>0&&s.push(`${n}d`),r>0&&s.push(`${r}h`),i>0&&s.push(`${i}m`),(o>0||s.length===0)&&s.push(`${o}s`),s.join(" ")},k5=({timerState:e,animationState:t,hasError:n,className:r})=>{const{t:i}=fe.useTranslation(),o=Hu(),{elapsedTime:s,currentProgress:a}=e,{showErrorAnimation:l,showPauseAnimation:c,showMainText:u}=t;return x.jsxRuntimeExports.jsxs(M.Box,{className:r,sx:{position:"relative",width:264,height:264,display:"flex",alignItems:"center",justifyContent:"center"},children:[x.jsxRuntimeExports.jsx(df.Gauge,{width:264,height:264,value:a,valueMin:0,valueMax:100,innerRadius:"85%",outerRadius:"100%",margin:0,skipAnimation:!0,text:()=>"",sx:{opacity:c||l?.6:1,transition:"opacity 0.5s ease-out","& .MuiGauge-valueArc":{fill:n?o.palette.error.light:o.palette.success.main,transition:"fill 0.5s ease-out"},"& .MuiGauge-referenceArc":{fill:"#171927",stroke:"transparent",strokeWidth:0,transition:"fill 0.5s ease-out, stroke 0.5s ease-out, stroke-width 0.5s ease-out"},"& .MuiGauge-valueText":{display:"none"},"& .MuiGauge-text":{display:"none"}}}),x.jsxRuntimeExports.jsx(M.Box,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:225,height:225,borderRadius:"50%",backgroundColor:"#292B3F",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",gap:1,transition:"background-color 0.5s ease-out"},children:x.jsxRuntimeExports.jsxs(M.Box,{sx:{position:"relative",height:"48px",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:.5},children:[x.jsxRuntimeExports.jsx(M.Fade,{in:u&&n,timeout:200,children:x.jsxRuntimeExports.jsx(M.Typography,{variant:"h6",sx:{position:"absolute",fontSize:"16px",fontWeight:500,color:o.palette.error.light},children:i("timer.error")})}),x.jsxRuntimeExports.jsx(M.Fade,{in:u&&!n,timeout:300,children:x.jsxRuntimeExports.jsx(M.Typography,{variant:"h1",sx:{position:"absolute",fontSize:"48px",fontWeight:500,color:o.palette.text.primary,lineHeight:1,letterSpacing:"-0.5px"},children:j5(s)})})]})})]})},O5=({timerState:e,animationState:t,hasError:n,compact:r,className:i})=>{const{t:o,i18n:s}=fe.useTranslation(),a=Hu(),{elapsedTime:l,currentProgress:c}=e,{showErrorAnimation:u,showPauseAnimation:d}=t;return r?x.jsxRuntimeExports.jsx(M.Box,{className:i,sx:{display:"flex",alignItems:"center",m:0},children:x.jsxRuntimeExports.jsx(M.Typography,{variant:"body2",sx:{color:n?a.palette.error.light:a.palette.text.primary,fontSize:"14px",transition:"color 0.5s ease-out"},children:n?o("timer.error"):yu(l,s.language)})}):x.jsxRuntimeExports.jsxs(M.Box,{className:i,sx:{display:"flex",alignItems:"center",m:0,gap:1},children:[x.jsxRuntimeExports.jsx(M.Box,{sx:{width:20,height:20,display:"flex",alignItems:"center",justifyContent:"center",opacity:d||u?.6:1,transition:"opacity 0.5s ease-out"},children:x.jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",style:{transform:"rotate(-90deg)"},role:"img","aria-label":"Timer progress",children:[x.jsxRuntimeExports.jsx("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:n?a.palette.error.light:a.palette.success.main,strokeWidth:"2",opacity:.3,style:{transition:"stroke 0.8s ease-in-out, opacity 2s ease-in-out"}}),x.jsxRuntimeExports.jsx("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:n?a.palette.error.light:a.palette.success.main,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:`${2*Math.PI*8}`,strokeDashoffset:`${2*Math.PI*8*(1-c/100)}`,style:{transition:"stroke-dashoffset 0.1s ease-out, stroke 0.8s ease-in-out, opacity 2s ease-in-out"}})]})}),x.jsxRuntimeExports.jsx(M.Typography,{variant:"body2",sx:{color:n?a.palette.error.light:a.palette.text.primary,fontSize:"14px",lineHeight:"normal",letterSpacing:"normal",transition:"color 0.8s ease-in-out, font-size 0.3s ease-out, opacity 2s ease-in-out"},children:n?o("timer.error"):yu(l,s.language)})]})},P5=()=>{const[e,t]=$.useState({showPauseAnimation:!1,showErrorAnimation:!1,showMainText:!0}),n=$.useRef(null),r=$.useRef(null),i=$.useRef(null),o=$.useCallback(()=>{t(d=>({...d,showPauseAnimation:!0})),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{t(d=>({...d,showPauseAnimation:!1}))},800)},[]),s=$.useCallback(()=>{t(d=>({...d,showErrorAnimation:!0})),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{t(d=>({...d,showErrorAnimation:!1}))},600)},[]),a=$.useCallback(()=>{t(d=>({...d,showErrorAnimation:!1})),r.current&&clearTimeout(r.current)},[]),l=$.useCallback(()=>{t(d=>({...d,showMainText:!1})),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{t(d=>({...d,showMainText:!0}))},200)},[]),c=$.useCallback(()=>{t(d=>({...d,showMainText:!0}))},[]),u=$.useCallback(()=>{n.current&&clearTimeout(n.current),r.current&&clearTimeout(r.current),i.current&&clearTimeout(i.current)},[]);return{animationState:e,triggerPauseAnimation:o,triggerErrorAnimation:s,clearErrorAnimation:a,triggerFadeTransition:l,setInitialAnimationState:c,cleanup:u}},D5=({autoStart:e,hasError:t,onPauseAnimation:n,onErrorAnimation:r,onClearErrorAnimation:i})=>{const[o,s]=$.useState({elapsedTime:0,isRunning:!1,isPausedState:!1,currentProgress:0,wasRunningBeforeError:!1}),a=$.useRef(null),l=$.useRef(null),c=$.useRef(0),u=$.useRef(0),[d]=de.useInterpolation([0],{tension:80,friction:18,onChange:([v])=>{s(T=>({...T,currentProgress:v}))}}),h=$.useCallback((v=0)=>{const T=v/60%1*100;s(w=>({...w,elapsedTime:v,isPausedState:!1,currentProgress:T})),c.current=0,u.current=T,d.setImmediate([T]),e?(l.current=Date.now()-v*1e3,s(w=>({...w,isRunning:!0}))):l.current=null},[e,d]),f=$.useCallback(()=>{if(l.current&&o.isRunning){const T=(Date.now()-l.current)/1e3+c.current,w=T/60%1*100;d.setTarget([w]),s(E=>({...E,elapsedTime:Math.floor(T)}))}s(v=>({...v,isRunning:!1,isPausedState:!0})),n()},[o.isRunning,d,n]),m=$.useCallback(()=>{o.isPausedState&&(c.current=o.elapsedTime,l.current=Date.now(),s(v=>({...v,isRunning:!0,isPausedState:!1})))},[o.isPausedState,o.elapsedTime]),p=$.useCallback(()=>{s(v=>({...v,elapsedTime:0,isRunning:!1,isPausedState:!1,currentProgress:0})),c.current=0,l.current=null,u.current=0,d.setImmediate([0])},[d]),y=$.useCallback(()=>o.isPausedState,[o.isPausedState]);return $.useEffect(()=>{t?(o.isRunning&&(s(v=>({...v,wasRunningBeforeError:!0})),f()),r()):(o.wasRunningBeforeError&&!o.isRunning&&(s(v=>({...v,wasRunningBeforeError:!1})),m()),i())},[t,o.isRunning,o.wasRunningBeforeError,f,m,r,i]),$.useEffect(()=>{if(o.isRunning){const v=()=>{if(l.current){const w=(Date.now()-l.current)/1e3+c.current,E=w/60%1*100;s(S=>({...S,elapsedTime:Math.floor(w)})),Math.abs(E-u.current)>.1&&(d.setTarget([E]),u.current=E)}a.current=requestAnimationFrame(v)};a.current=requestAnimationFrame(v)}else a.current&&(cancelAnimationFrame(a.current),a.current=null);return()=>{a.current&&(cancelAnimationFrame(a.current),a.current=null)}},[o.isRunning,d]),$.useEffect(()=>{let v=null;const T=()=>{d.update(),v=requestAnimationFrame(T)};return v=requestAnimationFrame(T),()=>{v&&cancelAnimationFrame(v)}},[d]),{timerState:o,controls:{start:h,pause:f,resume:m,reset:p,isPaused:y}}},$5=x.externalizeComponent(oe.observer(({onTimerReady:e,autoStart:t=!0,variant:n="default",compact:r=!1,className:i,hasError:o=!1})=>{const{animationState:s,triggerPauseAnimation:a,triggerErrorAnimation:l,clearErrorAnimation:c,setInitialAnimationState:u,cleanup:d}=P5(),{timerState:h,controls:f}=D5({autoStart:t,hasError:o,onPauseAnimation:a,onErrorAnimation:l,onClearErrorAnimation:c});return $.useEffect(()=>{u()},[u]),$.useEffect(()=>{let m=!0;const p=setTimeout(()=>{m&&e(f)},0);return()=>{m=!1,clearTimeout(p)}},[e,f]),$.useEffect(()=>d,[d]),n==="small"?x.jsxRuntimeExports.jsx(O5,{timerState:h,animationState:s,hasError:o,compact:r,className:i}):x.jsxRuntimeExports.jsx(k5,{timerState:h,animationState:s,hasError:o,className:i})})),xu=1e-4,L5={a:0,d:0,alpha:0,theta:0,reverse_rotation_direction:!1};class Fi{constructor(t,n,r,i,o,s,a,l,c,u){this.nova=t,this.controller=n,this.motionGroup=r,this.initialMotionState=i,this.motionStateSocket=o,this.isVirtual=s,this.tcps=a,this.description=l,this.initialControllerState=c,this.controllerStateSocket=u,this.connectedJoggingSocket=null,this.joggingVelocity=10,this.activationState="inactive",this.rapidlyChangingMotionState=i,this.controllerState=c,u.addEventListener("message",d=>{var f;const h=(f=Ee.tryParseJson(d.data))==null?void 0:f.result;h&&he.runInAction(()=>{this.controllerState=h})}),o.addEventListener("message",d=>{var f;const h=(f=Ee.tryParseJson(d.data))==null?void 0:f.result;if(!h)throw new Error(`Failed to get motion state for ${this.motionGroupId}: ${d.data}`);Va(this.rapidlyChangingMotionState.joint_position,h.joint_position,xu)||he.runInAction(()=>{this.rapidlyChangingMotionState.joint_position=h.joint_position}),Ua(this.rapidlyChangingMotionState,h,xu)||he.runInAction(()=>{this.rapidlyChangingMotionState.tcp_pose=h.tcp_pose}),this.rapidlyChangingMotionState.standstill!==h.standstill&&he.runInAction(()=>{this.rapidlyChangingMotionState.standstill=h.standstill})}),he.makeAutoObservable(this)}static async connectMultiple(t,n){return Promise.all(n.map(r=>Fi.connect(t,r)))}static async connect(t,n){var v,T;const[r,i]=n.split("@"),o=await t.api.controller.getCurrentRobotControllerState(i),s=o==null?void 0:o.motion_groups.find(w=>w.motion_group===n);if(!o||!s)throw new Error(`Controller ${i} or motion group ${n} not found`);const a=t.openReconnectingWebsocket(`/controllers/${i}/motion-groups/${n}/state-stream`),l=await a.firstMessage(),c=(v=Ee.tryParseJson(l.data))==null?void 0:v.result;if(!c)throw new Error(`Unable to parse initial motion state message ${l.data}`);console.log(`Connected motion state websocket to motion group ${s.motion_group}. Initial state:
|
|
131
|
+
`,c);const d=(await t.api.controller.getRobotController(o.controller)).configuration.kind==="VirtualController",h=await t.api.motionGroup.getMotionGroupDescription(i,s.motion_group),f=Object.entries(h.tcps||{}).map(([w,E])=>({id:w,readable_name:E.name,position:E.pose.position,orientation:E.pose.orientation})),m=t.openReconnectingWebsocket(`/controllers/${o.controller}/state-stream?response_rate=1000`),p=await m.firstMessage(),y=(T=Ee.tryParseJson(p.data))==null?void 0:T.result;if(!y)throw new Error(`Unable to parse initial controller state message ${p.data}`);return console.log(`Connected controller state websocket to controller ${o.controller}. Initial state:
|
|
132
|
+
`,y),new Fi(t,o,s,c,a,d,f,h,y,m)}get motionGroupId(){return this.motionGroup.motion_group}get controllerId(){return this.controller.controller}get modelFromController(){return this.description.motion_group_model}get wandelscriptIdentifier(){const t=this.motionGroupId.split("@")[0];return`${this.controllerId.replace(/-/g,"_")}_${t}`}get joggingVelocityRads(){return this.joggingVelocity*Math.PI/180}get joints(){return this.initialMotionState.joint_position.map((t,n)=>({index:n}))}get dhParameters(){if(this.description.dh_parameters!==void 0)return this.description.dh_parameters.map(t=>({...L5,...t}))}get safetyZones(){return this.description.safety_zones}get mountingPosition(){var t,n,r;return this.description.mounting?[(((t=this.description.mounting.position)==null?void 0:t[0])||0)/1e3,(((n=this.description.mounting.position)==null?void 0:n[1])||0)/1e3,(((r=this.description.mounting.position)==null?void 0:r[2])||0)/1e3]:[0,0,0]}get mountingQuaternion(){var i,o,s,a,l,c;const t=new Za.Vector3(((o=(i=this.description.mounting)==null?void 0:i.orientation)==null?void 0:o[0])||0,((a=(s=this.description.mounting)==null?void 0:s.orientation)==null?void 0:a[1])||0,((c=(l=this.description.mounting)==null?void 0:l.orientation)==null?void 0:c[2])||0),n=t.length(),r=t.normalize();return new Za.Quaternion().setFromAxisAngle(r,n)}get isEstopActive(){return["SAFETY_STATE_ROBOT_EMERGENCY_STOP","SAFETY_STATE_DEVICE_EMERGENCY_STOP"].includes(this.controllerState.safety_state)}get isMoveableSafetyState(){return["SAFETY_STATE_NORMAL","SAFETY_STATE_REDUCED"].includes(this.controllerState.safety_state)}get isMoveableOperationMode(){return["OPERATION_MODE_AUTO","OPERATION_MODE_MANUAL","OPERATION_MODE_MANUAL_T1","OPERATION_MODE_MANUAL_T2"].includes(this.controllerState.operation_mode)}get canBeMoved(){return this.isMoveableSafetyState&&this.isMoveableOperationMode&&this.activationState==="active"}async deactivate(){if(this.activationState!=="active"){console.error("Tried to deactivate while already deactivating");return}he.runInAction(()=>{this.activationState="deactivating"});try{await this.nova.api.controller.setDefaultMode(this.controllerId,"ROBOT_SYSTEM_MODE_MONITOR"),he.runInAction(()=>{this.activationState="inactive"})}catch(t){throw he.runInAction(()=>{this.activationState="active"}),t}}async activate(){if(this.activationState!=="inactive"){console.error("Tried to activate while already activating");return}he.runInAction(()=>{this.activationState="activating"});try{await this.nova.api.controller.setDefaultMode(this.controllerId,"ROBOT_SYSTEM_MODE_CONTROL"),he.runInAction(()=>{this.activationState="active"})}catch(t){throw he.runInAction(()=>{this.activationState="inactive"}),t}}toggleActivation(){this.activationState==="inactive"?this.activate():this.activationState==="active"&&this.deactivate()}dispose(){this.motionStateSocket.close(),this.connectedJoggingSocket&&this.connectedJoggingSocket.close()}setJoggingVelocity(t){this.joggingVelocity=t}}function nf(){var t,n,r,i,o,s,a;const e=M.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:(r=(n=(t=e.paletteExt)==null?void 0:t.secondary)==null?void 0:n.tonal)==null?void 0:r.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:(i=e.palette.backgroundPaperElevation)==null?void 0:i[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=(o=e.paletteExt)==null?void 0:o.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":M.rgbToHex(((a=e.palette.backgroundPaperElevation)==null?void 0:a[5])??""),"editor.foreground":"#d4d4d4","editorLineNumber.foreground":"#797979","editorLineNumber.activeForeground":"#e9e9e9","editor.lineHighlightBorder":"#e9e9e911"}}}}}}function N5(){const e=nf();return e.palette.mode="light",e}function z5(e){var r,i,o,s;let t=!0;((r=e.palette)==null?void 0:r.mode)==="light"?t=!1:((i=e.palette)==null?void 0:i.mode)!=="dark"&&(t=!(typeof window<"u"&&((s=(o=window.matchMedia)==null?void 0:o.call(window,"(prefers-color-scheme: light)"))==null?void 0:s.matches)));const n=t?nf():N5();return Wu(n,e)}exports.AppHeader=$f;exports.ConnectedMotionGroup=Fi;exports.CycleTimer=QS;exports.JoggerConnection=Ao;exports.JoggingCartesianAxisControl=Ds;exports.JoggingJointRotationControl=_h;exports.JoggingPanel=BC;exports.JoggingStore=Po;exports.LogPanel=JC;exports.LogStore=Qh;exports.LogViewer=ef;exports.MotionStreamConnection=Ro;exports.NoMotionGroupModal=XC;exports.PoseCartesianValues=VC;exports.PoseJointValues=UC;exports.RobotListItem=t5;exports.RobotSetupReadinessIndicator=tf;exports.RobotSetupReadinessState=Xa;exports.SafetyBar=C5;exports.SelectableFab=M5;exports.TabBar=I5;exports.Timer=$5;exports.VelocitySlider=Kh;exports.VelocitySliderLabel=Ka;exports.WandelbotsDataGrid=Eh;exports.createDebugMessage=WC;exports.createErrorMessage=qC;exports.createInfoMessage=HC;exports.createLogMessage=jr;exports.createNovaMuiTheme=z5;exports.createWarningMessage=YC;exports.jointValuesEqual=Va;exports.poseEqual=Mh;exports.tcpMotionEqual=Ua;exports.unwrapRotationVector=Rh;
|
|
133
|
+
//# sourceMappingURL=theming-D4ztsmTr.cjs.map
|