diff --git a/asset-manifest.json b/asset-manifest.json index f51d1c7..49255ca 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,7 +1,7 @@ { "files": { "main.css": "/static/css/main.02152627.css", - "main.js": "/static/js/main.71a4daeb.js", + "main.js": "/static/js/main.16008c40.js", "static/media/roboto-all-500-normal.woff": "/static/media/roboto-all-500-normal.0ab669b7a0d19b178f57.woff", "static/media/roboto-all-700-normal.woff": "/static/media/roboto-all-700-normal.a457fde362a540fcadff.woff", "static/media/roboto-all-400-normal.woff": "/static/media/roboto-all-400-normal.c5d001fa922fa66a147f.woff", @@ -36,10 +36,10 @@ "static/media/roboto-greek-ext-700-normal.woff2": "/static/media/roboto-greek-ext-700-normal.bd9854c751441ccc1a70.woff2", "index.html": "/index.html", "main.02152627.css.map": "/static/css/main.02152627.css.map", - "main.71a4daeb.js.map": "/static/js/main.71a4daeb.js.map" + "main.16008c40.js.map": "/static/js/main.16008c40.js.map" }, "entrypoints": [ "static/css/main.02152627.css", - "static/js/main.71a4daeb.js" + "static/js/main.16008c40.js" ] } diff --git a/index.html b/index.html index 9fc9971..17e9e21 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -
+ diff --git a/pioreactorui/__init__.py b/pioreactorui/__init__.py index 185e76a..d373543 100644 --- a/pioreactorui/__init__.py +++ b/pioreactorui/__init__.py @@ -108,7 +108,10 @@ def handle_not_auth(e): @app.errorhandler(500) def handle_server_error(e): - return jsonify({"error": "Internal server error. See logs."}), 500 + return ( + jsonify({"error": f"Internal server error: {e.description}. See logs for more."}), + 500, + ) app.json = MsgspecJsonProvider(app) app.get_json = app.json.loads diff --git a/pioreactorui/api.py b/pioreactorui/api.py index 3e3521c..44301ab 100644 --- a/pioreactorui/api.py +++ b/pioreactorui/api.py @@ -1696,7 +1696,7 @@ def update_experiment_profile() -> ResponseReturnValue: yaml_decode(experiment_profile_body, type=Profile) except Exception as e: # publish_to_error_log(msg, "create_experiment_profile") - return {"msg": str(e)}, 400 + abort(400, str(e)) # verify file - user could have provided a different filename so we still check this. try: @@ -1841,7 +1841,7 @@ def setup_worker_pioreactor() -> ResponseReturnValue: if status: return {"msg": f"Worker {new_name} added successfully."}, 200 else: - return {"msg": f"Failed to add worker {new_name}. See logs."}, 500 + abort(500, f"Failed to add worker {new_name}. See logs.") @api.route("/workers", methods=["PUT"]) diff --git a/static/js/main.71a4daeb.js b/static/js/main.16008c40.js similarity index 90% rename from static/js/main.71a4daeb.js rename to static/js/main.16008c40.js index 71579f8..ab078cb 100644 --- a/static/js/main.71a4daeb.js +++ b/static/js/main.16008c40.js @@ -1,4 +1,4 @@ -/*! For license information please see main.71a4daeb.js.LICENSE.txt */ +/*! For license information please see main.16008c40.js.LICENSE.txt */ (function(){var __webpack_modules__={9498:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(65043),_mui_material_Grid__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(68903),_components_LogTable__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(98229),_components_ExperimentSummary__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(80683),_components_Chart__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(11003),_components_MediaCard__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(22353),_utilities__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(36576),_mui_material_Card__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(12110),_mui_material_ToggleButton__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(84511),_mui_material_ToggleButtonGroup__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(15078),_mui_material_Stack__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(46517),_providers_MQTTContext__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(16216),_providers_ExperimentContext__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(68891),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(70579);const TimeFormatSwitch=e=>{const[t,n]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(e.initTimeScale);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{n(e.initTimeScale)}),[e.initTimeScale]);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_mui_material_ToggleButtonGroup__WEBPACK_IMPORTED_MODULE_9__.A,{color:"primary",value:t,exclusive:!0,onChange:(t,r)=>{null!==r&&(n(r),e.setTimeScale(r),localStorage.setItem("timeScale",r))},size:"small",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_mui_material_ToggleButton__WEBPACK_IMPORTED_MODULE_10__.A,{style:{textTransform:"None"},value:"hours",children:"Elapsed time"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_mui_material_ToggleButton__WEBPACK_IMPORTED_MODULE_10__.A,{style:{textTransform:"None"},value:"clock_time",children:"Timestamp"})]})},TimeWindowSwitch=e=>{const[t,n]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(e.initTimeWindow);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{n(e.initTimeWindow)}),[e.initTimeWindow]);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_mui_material_ToggleButtonGroup__WEBPACK_IMPORTED_MODULE_9__.A,{color:"primary",value:t,exclusive:!0,onChange:(t,r)=>{null!==r&&(n(r),e.setTimeWindow(r),localStorage.setItem("timeWindow",r.toString()))},size:"small",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_mui_material_ToggleButton__WEBPACK_IMPORTED_MODULE_10__.A,{style:{textTransform:"None"},value:1e7,children:"All time"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_mui_material_ToggleButton__WEBPACK_IMPORTED_MODULE_10__.A,{style:{textTransform:"None"},value:12,children:"Past 12h"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_mui_material_ToggleButton__WEBPACK_IMPORTED_MODULE_10__.A,{style:{textTransform:"None"},value:1,children:"Past hour"})]})};function Charts(props){const[charts,setCharts]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({}),config=props.config,{client:client,subscribeToTopic:subscribeToTopic,unsubscribeFromTopic:unsubscribeFromTopic}=(0,_providers_MQTTContext__WEBPACK_IMPORTED_MODULE_6__.W)();return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{fetch("/api/contrib/charts").then((e=>e.json())).then((e=>{setCharts(e.reduce(((e,t)=>(e[t.chart_key]=t,e)),{}))}))}),[]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:Object.entries(charts).filter((e=>{let[t,n]=e;return config["ui.overview.charts"]&&"1"===config["ui.overview.charts"][t]})).map((_ref2=>{let[chart_key,chart]=_ref2;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_11__.Ay,{item:!0,xs:12,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_mui_material_Card__WEBPACK_IMPORTED_MODULE_12__.A,{sx:{maxHeight:"100%"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_components_Chart__WEBPACK_IMPORTED_MODULE_3__.A,{chartKey:chart_key,config:config,dataSource:chart.data_source,title:chart.title,topic:chart.mqtt_topic,payloadKey:chart.payload_key,yAxisLabel:chart.y_axis_label,experiment:props.experimentMetadata.experiment,deltaHours:props.experimentMetadata.delta_hours,experimentStartTime:props.experimentMetadata.created_at,downSample:chart.down_sample,interpolation:chart.interpolation||"stepAfter",yAxisDomain:chart.y_axis_domain?chart.y_axis_domain:null,lookback:props.timeWindow?props.timeWindow:chart.lookback?eval(chart.lookback):1e4,fixedDecimals:chart.fixed_decimals,relabelMap:props.relabelMap,yTransformation:eval(chart.y_transformation||"(y) => y"),dataSourceColumn:chart.data_source_column,isPartitionedBySensor:"raw_optical_density"===chart_key,isLiveChart:!0,byDuration:"hours"===props.timeScale,client:client,subscribeToTopic:subscribeToTopic,unsubscribeFromTopic:unsubscribeFromTopic,unitsColorMap:props.unitsColorMap},`chart-${chart_key}`)})})},`grid-chart-${chart_key}`)}))})}function Overview(e){var t;const{experimentMetadata:n,updateExperiment:r}=(0,_providers_ExperimentContext__WEBPACK_IMPORTED_MODULE_7__.r)(),[i,o]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({}),[a,s]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({}),l=localStorage.getItem("timeScale")||(null===(t=i["ui.overview.settings"])||void 0===t?void 0:t.time_display_mode)||"hours",c=parseInt(localStorage.getItem("timeWindow"))||1e7,[u,d]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(l),[p,f]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(c),[h,m]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),g=new _utilities__WEBPACK_IMPORTED_MODULE_5__.sE(_utilities__WEBPACK_IMPORTED_MODULE_5__.Tj);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{document.title=e.title,(0,_utilities__WEBPACK_IMPORTED_MODULE_5__.zj)(o)}),[e.title]),(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{n.experiment&&((0,_utilities__WEBPACK_IMPORTED_MODULE_5__.yr)(s,n.experiment),async function(e){try{const t=await fetch(`/api/experiments/${e}/workers`);if(t.ok){const e=await t.json();m(e)}else console.error("Failed to fetch workers:",t.statusText)}catch(t){console.error("Error fetching workers:",t)}}(n.experiment))}),[n]);const _=h.filter((e=>1===e.is_active)).map((e=>e.pioreactor_unit)),y=h.map((e=>e.pioreactor_unit));return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_11__.Ay,{container:!0,spacing:2,justifyContent:"space-between",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_11__.Ay,{item:!0,xs:12,md:12,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_components_ExperimentSummary__WEBPACK_IMPORTED_MODULE_2__.A,{experimentMetadata:n,updateExperiment:r})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_11__.Ay,{item:!0,xs:12,md:7,container:!0,spacing:2,justifyContent:"flex-start",style:{height:"100%"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(Charts,{unitsColorMap:g,config:i,timeScale:u,timeWindow:p,experimentMetadata:n,relabelMap:a})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_11__.Ay,{item:!0,xs:12,md:5,container:!0,spacing:1,justifyContent:"flex-end",style:{height:"100%"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_11__.Ay,{item:!0,xs:6,md:6,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_mui_material_Stack__WEBPACK_IMPORTED_MODULE_13__.A,{direction:"row",justifyContent:"start",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(TimeWindowSwitch,{setTimeWindow:f,initTimeWindow:p})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_11__.Ay,{item:!0,xs:6,md:6,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_mui_material_Stack__WEBPACK_IMPORTED_MODULE_13__.A,{direction:"row",justifyContent:"end",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(TimeFormatSwitch,{setTimeScale:d,initTimeScale:u})})}),i["ui.overview.cards"]&&"1"===i["ui.overview.cards"].dosings&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_11__.Ay,{item:!0,xs:12,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_components_MediaCard__WEBPACK_IMPORTED_MODULE_4__.A,{activeUnits:_,experiment:n.experiment,relabelMap:a})}),i["ui.overview.cards"]&&"1"===i["ui.overview.cards"].event_logs&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_11__.Ay,{item:!0,xs:12,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_components_LogTable__WEBPACK_IMPORTED_MODULE_1__.A,{units:y,byDuration:"hours"===u,experimentStartTime:n.created_at,experiment:n.experiment,config:i,relabelMap:a})})]})]})})}__webpack_exports__.A=Overview},43300:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(65043),dayjs__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(60446),dayjs__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_1__),_mui_material_FormLabel__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(51292),_mui_material_FormControl__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(53193),_mui_material_FormGroup__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(69413),_mui_material_FormControlLabel__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(74605),_mui_material_Grid__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__(68903),_mui_material_Button__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(42518),_components_Chart__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(11003),_mui_material_Select__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(72221),_mui_material__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(94496),_mui_material_Box__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(7353),_mui_material_MenuItem__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(32143),_mui_material_Checkbox__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(51962),_mui_material_Card__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(12110),_utilities__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(36576),_mui_icons_material_GetApp__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(15223),react_router_dom__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(35475),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(70579);function ExperimentSelection(e){const[t,n]=react__WEBPACK_IMPORTED_MODULE_0__.useState([]),r=t.find((t=>t.experiment===e.experimentSelection));react__WEBPACK_IMPORTED_MODULE_0__.useEffect((()=>{!async function(){await fetch("/api/experiments").then((e=>e.json())).then((t=>{n((e=>[...t,...e])),e.handleExperimentSelectionChange(t[0].experiment)}))}()}),[]);const i=t.map(((e,t)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material_MenuItem__WEBPACK_IMPORTED_MODULE_5__.A,{value:e.experiment,children:e.experiment+(e.created_at?` (${dayjs__WEBPACK_IMPORTED_MODULE_1___default()(e.created_at).format("MMMM D, YYYY")})`:"")},t)));return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_6__.A,{sx:{maxWidth:"450px",m:1},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_mui_material_FormControl__WEBPACK_IMPORTED_MODULE_7__.A,{fullWidth:!0,component:"fieldset",sx:{my:1},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material_FormLabel__WEBPACK_IMPORTED_MODULE_8__.A,{component:"legend",children:"Experiment"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material_Select__WEBPACK_IMPORTED_MODULE_9__.A,{labelId:"expSelect",variant:"standard",value:e.experimentSelection,onChange:t=>{e.handleExperimentSelectionChange(t.target.value)},children:i})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_6__.A,{sx:{my:1},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_10__.A,{sx:{fontSize:16},color:"text.secondary",gutterBottom:!0,children:"Experiment created"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_10__.A,{variant:"body2",style:{whiteSpace:"pre-line"},gutterBottom:!0,children:dayjs__WEBPACK_IMPORTED_MODULE_1___default()(null===r||void 0===r?void 0:r.created_at).format("MMMM D, YYYY, h:mm a")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_10__.A,{sx:{fontSize:16,pt:1},color:"text.secondary",gutterBottom:!0,children:"Description"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_10__.A,{variant:"body2",style:{whiteSpace:"pre-line"},children:null===r||void 0===r?void 0:r.description})]})]})}function ChartSelection(e){const[t,n]=react__WEBPACK_IMPORTED_MODULE_0__.useState({});react__WEBPACK_IMPORTED_MODULE_0__.useEffect((()=>{!async function(){await fetch("/api/contrib/charts").then((e=>e.json())).then((e=>{n(e.reduce(((e,t)=>(e[t.chart_key]=t,e)),{}))}))}()}),[]);const r=n=>{e.handleChartSelectionChange(t[n.target.name],n.target.checked)};return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{style:{maxWidth:"450px",margin:"10px"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_mui_material_FormControl__WEBPACK_IMPORTED_MODULE_7__.A,{fullWidth:!0,component:"fieldset",sx:{m:2},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material_FormLabel__WEBPACK_IMPORTED_MODULE_8__.A,{component:"legend",children:"Charts"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material_FormGroup__WEBPACK_IMPORTED_MODULE_11__.A,{children:Object.entries(t).filter((t=>{let[n,r]=t;return e.config["ui.overview.charts"]&&"1"===e.config["ui.overview.charts"][n]})).map((t=>{let[n,i]=t;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material_FormControlLabel__WEBPACK_IMPORTED_MODULE_12__.A,{control:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material_Checkbox__WEBPACK_IMPORTED_MODULE_13__.A,{checked:n in e.chartSelection,onChange:r,name:n,size:"small"}),label:i.title},n)}))})]})})}function ExperimentsContainer(props){const[experimentSelection,setExperimentSelection]=react__WEBPACK_IMPORTED_MODULE_0__.useState(""),[chartSelection,setChartSelection]=react__WEBPACK_IMPORTED_MODULE_0__.useState({}),[config,setConfig]=react__WEBPACK_IMPORTED_MODULE_0__.useState({}),[relabelMap,setRelabelMap]=react__WEBPACK_IMPORTED_MODULE_0__.useState({}),unitsColorMap=new _utilities__WEBPACK_IMPORTED_MODULE_3__.sE(_utilities__WEBPACK_IMPORTED_MODULE_3__.Tj);function handleExperimentSelectionChange(e){setExperimentSelection(e),(0,_utilities__WEBPACK_IMPORTED_MODULE_3__.yr)(setRelabelMap,e)}function handleChartSelectionChange(e,t){if(t)setChartSelection({...chartSelection,[e.chart_key]:e});else{const{[e.chart_key]:t,...n}=chartSelection;setChartSelection(n)}}function objectToQueryString(e){const t={implied_growth_rate:"growth_rates",raw_optical_density:"od_readings",temperature:"temperature_readings",normalized_optical_density:"od_readings_filtered",fraction_of_volume_that_is_alternative_media:"alt_media_fraction"};let n="";for(const r in e)e.hasOwnProperty(r)&&t.hasOwnProperty(r)&&(n+=`&${t[r]}=1`);return n}react__WEBPACK_IMPORTED_MODULE_0__.useEffect((()=>{document.title=props.title,(0,_utilities__WEBPACK_IMPORTED_MODULE_3__.zj)(setConfig)}),[props.title]);const additionalQueryString=objectToQueryString(chartSelection);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_6__.A,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_6__.A,{sx:{display:"flex",justifyContent:"space-between",mb:1},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_10__.A,{variant:"h5",component:"h2",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_6__.A,{fontWeight:"fontWeightBold",children:"Past experiments"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_6__.A,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-start",flexFlow:"wrap"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_14__.A,{to:`/export-data?experiment=${experimentSelection}&experiments=1${additionalQueryString}`,component:react_router_dom__WEBPACK_IMPORTED_MODULE_15__.N_,style:{textTransform:"none",marginRight:"0px",float:"right"},color:"primary",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_icons_material_GetApp__WEBPACK_IMPORTED_MODULE_16__.A,{fontSize:"15",sx:{verticalAlign:"middle",margin:"0px 3px"}})," Export experiment data"]})})]})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material_Card__WEBPACK_IMPORTED_MODULE_17__.A,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material_Card__WEBPACK_IMPORTED_MODULE_17__.A,{sx:{p:1},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_18__.Ay,{container:!0,spacing:2,justifyContent:"space-between",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_18__.Ay,{item:!0,xs:6,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(ExperimentSelection,{experimentSelection:experimentSelection,handleExperimentSelectionChange:handleExperimentSelectionChange})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_18__.Ay,{item:!0,xs:6,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(ChartSelection,{chartSelection:chartSelection,handleChartSelectionChange:handleChartSelectionChange,config:config})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_18__.Ay,{item:!0,xs:12,md:12,container:!0,spacing:2,justifyContent:"flex-start",style:{height:"100%"},children:Object.entries(chartSelection).sort().map((_ref3=>{let[chart_key,chart]=_ref3;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_18__.Ay,{item:!0,xs:6,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_components_Chart__WEBPACK_IMPORTED_MODULE_2__.A,{chart_key:`chart-${chart_key}`,config:config,dataSource:chart.data_source,title:chart.title,topic:chart.mqtt_topic,payloadKey:chart.payload_key,yAxisLabel:chart.y_axis_label,experiment:experimentSelection,deltaHours:10,downSample:!0,interpolation:chart.interpolation||"stepAfter",yAxisDomain:chart.y_axis_domain?chart.y_axis_domain:null,lookback:1e4,fixedDecimals:chart.fixed_decimals,yTransformation:eval(chart.y_transformation||"(y) => y"),dataSourceColumn:chart.data_source_column,relabelMap:relabelMap,isPartitionedBySensor:"raw_optical_density"===chart_key,allowZoom:!0,isLiveChart:!1,byDuration:!1,unitsColorMap:unitsColorMap})})},`grid-chart-${chart_key}`)}))})]})})})]})}function Experiments(e){return react__WEBPACK_IMPORTED_MODULE_0__.useEffect((()=>{document.title=e.title}),[e.title]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_18__.Ay,{container:!0,spacing:2,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_18__.Ay,{item:!0,md:12,xs:12,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(ExperimentsContainer,{})})})}__webpack_exports__.A=Experiments},37480:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";var dayjs__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(60446),dayjs__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_0__),react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(65043),_mui_material_Grid__WEBPACK_IMPORTED_MODULE_56__=__webpack_require__(68903),_mui_material__WEBPACK_IMPORTED_MODULE_45__=__webpack_require__(30344),_mui_material_styles__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__(34535),_mui_material_Chip__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__(43845),_mui_material_Card__WEBPACK_IMPORTED_MODULE_54__=__webpack_require__(12110),_mui_material__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__(94496),_mui_material_Dialog__WEBPACK_IMPORTED_MODULE_32__=__webpack_require__(90035),_mui_material_DialogTitle__WEBPACK_IMPORTED_MODULE_33__=__webpack_require__(26600),_mui_material_DialogContent__WEBPACK_IMPORTED_MODULE_38__=__webpack_require__(35316),_mui_material_Box__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__(7353),_mui_material_Divider__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__(39336),_mui_material_CircularProgress__WEBPACK_IMPORTED_MODULE_44__=__webpack_require__(81637),_mui_material_Snackbar__WEBPACK_IMPORTED_MODULE_49__=__webpack_require__(40794),_mui_material_TextField__WEBPACK_IMPORTED_MODULE_50__=__webpack_require__(15795),_mui_material_Tooltip__WEBPACK_IMPORTED_MODULE_55__=__webpack_require__(77739),_mui_material_InputAdornment__WEBPACK_IMPORTED_MODULE_51__=__webpack_require__(51787),_mui_material_Tabs__WEBPACK_IMPORTED_MODULE_34__=__webpack_require__(83625),_mui_material_Tab__WEBPACK_IMPORTED_MODULE_35__=__webpack_require__(24056),_mui_material_Button__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__(42518),_mui_lab_LoadingButton__WEBPACK_IMPORTED_MODULE_48__=__webpack_require__(77093),_mui_icons_material_ToggleOn__WEBPACK_IMPORTED_MODULE_30__=__webpack_require__(433),_mui_icons_material_Clear__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__(30079),_mui_icons_material_Close__WEBPACK_IMPORTED_MODULE_37__=__webpack_require__(33438),_mui_icons_material_ArrowBack__WEBPACK_IMPORTED_MODULE_28__=__webpack_require__(87332),_mui_icons_material_Flare__WEBPACK_IMPORTED_MODULE_53__=__webpack_require__(42950),_mui_icons_material_Settings__WEBPACK_IMPORTED_MODULE_46__=__webpack_require__(32069),_mui_icons_material_Tune__WEBPACK_IMPORTED_MODULE_31__=__webpack_require__(20746),_mui_material_IconButton__WEBPACK_IMPORTED_MODULE_36__=__webpack_require__(17392),_mui_material_Switch__WEBPACK_IMPORTED_MODULE_52__=__webpack_require__(4598),material_ui_confirm__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(88370),_mui_material_Alert__WEBPACK_IMPORTED_MODULE_47__=__webpack_require__(67254),_mui_icons_material_PlayCircleOutlined__WEBPACK_IMPORTED_MODULE_29__=__webpack_require__(41812),react_router_dom__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__(73216),react_router_dom__WEBPACK_IMPORTED_MODULE_27__=__webpack_require__(35475),_components_SelfTestDialog__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(15180),_components_ChangeAutomationsDialog__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(22591),_components_ActionDosingForm__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(76573),_components_ActionManualDosingForm__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(64311),_components_ActionCirculatingForm__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(32520),_components_ActionLEDForm__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(20760),_components_PioreactorIcon__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(29866),_components_UnderlineSpan__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(33367),_components_Bioreactor__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(36865),_components_Chart__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(11003),_components_LogTableByUnit__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(29252),_providers_MQTTContext__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(16216),_providers_ExperimentContext__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(68891),_components_PatientButton__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(18532),_utilities__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(36576),_mui_material__WEBPACK_IMPORTED_MODULE_39__=__webpack_require__(71806),_mui_material__WEBPACK_IMPORTED_MODULE_40__=__webpack_require__(84882),_mui_material__WEBPACK_IMPORTED_MODULE_41__=__webpack_require__(28076),_mui_material__WEBPACK_IMPORTED_MODULE_42__=__webpack_require__(10039),_mui_material__WEBPACK_IMPORTED_MODULE_43__=__webpack_require__(73460),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__(70579);function StateTypography(e){let{state:t,isDisabled:n=!1}=e;const r={color:n?_utilities__WEBPACK_IMPORTED_MODULE_17__.CA:_utilities__WEBPACK_IMPORTED_MODULE_17__.ch[t].color,padding:"1px 10px",borderRadius:"16px",backgroundColor:_utilities__WEBPACK_IMPORTED_MODULE_17__.ch[t].backgroundColor,display:"inline-block",fontWeight:500};return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{display:"block",gutterBottom:!0,sx:r,children:_utilities__WEBPACK_IMPORTED_MODULE_17__.ch[t].display})}const textIcon={verticalAlign:"middle",margin:"0px 3px"},StylizedCode=(0,_mui_material_styles__WEBPACK_IMPORTED_MODULE_20__.Ay)("code")((e=>{let{theme:t}=e;return{backgroundColor:"rgba(0, 0, 0, 0.07)",padding:"1px 4px"}})),DisplaySettingsTable=(0,_mui_material_styles__WEBPACK_IMPORTED_MODULE_20__.Ay)("span")((e=>{let{theme:t}=e;return{width:"55px",display:"inline-block"}})),ManageDivider=(0,_mui_material_styles__WEBPACK_IMPORTED_MODULE_20__.Ay)(_mui_material_Divider__WEBPACK_IMPORTED_MODULE_21__.A)((e=>{let{theme:t}=e;return{marginTop:t.spacing(2),marginBottom:t.spacing(1.25)}})),RowOfUnitSettingDisplayBox=(0,_mui_material_styles__WEBPACK_IMPORTED_MODULE_20__.Ay)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_22__.A)((e=>{let{theme:t}=e;return{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"stretch",alignContent:"stretch"}}));function TabPanel(e){const{children:t,value:n,index:r,...i}=e;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("div",{role:"tabpanel",hidden:n!==r,id:`simple-tabpanel-${r}`,"aria-labelledby":`simple-tab-${r}`,...i,children:n===r&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("div",{children:t})},`simple-tabpanel-${r}`)}function UnitSettingDisplaySubtext(e){return e.subtext?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Chip__WEBPACK_IMPORTED_MODULE_23__.A,{size:"small",sx:{fontSize:"11px",wordBreak:"break-word",padding:"5px 0px"},label:e.subtext.replaceAll("_"," ")}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_22__.A,{sx:{minHeight:"15px"}})}function UnitSettingDisplay(e){const t=null===e.value?"":e.value;function n(e){return e>=10?e.toFixed(0):0===e?"0":e<1?"<1":e.toFixed(1).replace(/[.,]0$/,"")}if(e.isStateSetting)return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(StateTypography,{state:t,isDisabled:!e.isUnitActive}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("br",{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(UnitSettingDisplaySubtext,{subtext:e.subtext})]});if(e.isLEDIntensity){if(e.isUnitActive&&"\u2014"!==t&&""!==t){const r=JSON.parse(t),i=e.config.leds||{},o=i.A?i.A.replace("_"," "):null,a=i.B?i.B.replace("_"," "):null,s=i.C?i.C.replace("_"," "):null,l=i.D?i.D.replace("_"," "):null;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("div",{style:{fontSize:"13px"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(DisplaySettingsTable,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_UnderlineSpan__WEBPACK_IMPORTED_MODULE_10__.A,{title:o||null,children:"A"}),": ",n(r.A),"%"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(DisplaySettingsTable,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_UnderlineSpan__WEBPACK_IMPORTED_MODULE_10__.A,{title:a||null,children:"B"}),": ",n(r.B),"%"]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(DisplaySettingsTable,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_UnderlineSpan__WEBPACK_IMPORTED_MODULE_10__.A,{title:s||null,children:"C"}),": ",n(r.C),"%"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(DisplaySettingsTable,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_UnderlineSpan__WEBPACK_IMPORTED_MODULE_10__.A,{title:l||null,children:"D"}),": ",n(r.D),"%"]})]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(UnitSettingDisplaySubtext,{subtext:e.subtext})]})}return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("div",{style:{color:_utilities__WEBPACK_IMPORTED_MODULE_17__.J6,fontSize:"13px"},children:[" ",e.default," "]})}if(e.isPWMDc){if(e.isUnitActive&&"\u2014"!==t&&""!==t){const r=JSON.parse(t),i={1:"17",2:"13",3:"16",4:"12"},o=e.config.PWM,a=o[1]?o[1].replace("_"," "):null,s=o[2]?o[2].replace("_"," "):null,l=o[3]?o[3].replace("_"," "):null,c=o[4]?o[4].replace("_"," "):null;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("div",{style:{fontSize:"13px"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(DisplaySettingsTable,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_UnderlineSpan__WEBPACK_IMPORTED_MODULE_10__.A,{title:a||null,children:"1"}),": ",n(r[i[1]]||0),"%"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(DisplaySettingsTable,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_UnderlineSpan__WEBPACK_IMPORTED_MODULE_10__.A,{title:s||null,children:"2"}),": ",n(r[i[2]]||0),"%"]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(DisplaySettingsTable,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_UnderlineSpan__WEBPACK_IMPORTED_MODULE_10__.A,{title:l||null,children:"3"}),": ",n(r[i[3]]||0),"%"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(DisplaySettingsTable,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_UnderlineSpan__WEBPACK_IMPORTED_MODULE_10__.A,{title:c||null,children:"4"}),": ",n(r[i[4]]||0),"%"]})]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(UnitSettingDisplaySubtext,{subtext:e.subtext})]})}return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("div",{style:{color:_utilities__WEBPACK_IMPORTED_MODULE_17__.J6,fontSize:"13px"},children:[" ",e.default," "]})}return e.isUnitActive&&"\u2014"!==t&&""!==t?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Chip__WEBPACK_IMPORTED_MODULE_23__.A,{size:"small",style:{fontSize:"13px"},label:function(t){return"string"===typeof t?t:"boolean"===typeof t?t?"On":"Off":+t.toFixed(e.precision)}(t)+" "+(e.measurementUnit?e.measurementUnit:"")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(UnitSettingDisplaySubtext,{subtext:e.subtext})]}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("div",{style:{color:_utilities__WEBPACK_IMPORTED_MODULE_17__.J6,fontSize:"13px"},children:[" ",e.default," "]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(UnitSettingDisplaySubtext,{subtext:e.subtext})]})}function ButtonStopProcess(e){let{experiment:t,unit:n}=e;const r=(0,material_ui_confirm__WEBPACK_IMPORTED_MODULE_2__.SC)();return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_24__.A,{style:{textTransform:"none",float:"right"},color:"secondary",onClick:()=>{r({description:"This will immediately stop all running activities. Do you wish to continue?",title:"Stop all activities?",confirmationText:"Confirm",confirmationButtonProps:{color:"primary"},cancellationButtonProps:{color:"secondary"}}).then((()=>fetch(`/api/workers/${n}/jobs/stop/experiments/${t}`,{method:"POST"}))).catch((()=>{}))},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_icons_material_Clear__WEBPACK_IMPORTED_MODULE_25__.A,{fontSize:"15",sx:textIcon})," Stop all activity"]})}function PioreactorHeader(e){let{unit:t,assignedExperiment:n,isActive:r,selectExperiment:i}=e;const o=(0,react_router_dom__WEBPACK_IMPORTED_MODULE_26__.Zp)();return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_22__.A,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_22__.A,{sx:{display:"flex",justifyContent:"space-between",mb:1},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"h5",component:"h1",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_22__.A,{sx:{display:"inline"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_24__.A,{to:"/pioreactors",component:react_router_dom__WEBPACK_IMPORTED_MODULE_27__.N_,sx:{textTransform:"none"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_icons_material_ArrowBack__WEBPACK_IMPORTED_MODULE_28__.A,{sx:{verticalAlign:"middle",mr:.5},fontSize:"small"})," All assigned Pioreactors"]})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_22__.A,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-start",flexFlow:"wrap"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(ButtonStopProcess,{experiment:n,unit:t})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Divider__WEBPACK_IMPORTED_MODULE_21__.A,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_22__.A,{sx:{m:"10px 2px 0px 2px",display:"flex",flexDirection:"row",justifyContent:"flex-start",flexFlow:"wrap"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"subtitle2",sx:{flexGrow:1},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_22__.A,{sx:{display:"inline"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_22__.A,{fontWeight:"fontWeightBold",sx:{display:"inline-block"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_icons_material_PlayCircleOutlined__WEBPACK_IMPORTED_MODULE_29__.A,{sx:{fontSize:14,verticalAlign:"-2px"}})," Experiment assigned:\xa0"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_22__.A,{fontWeight:"fontWeightRegular",sx:{mr:"1%",display:"inline-block"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Chip__WEBPACK_IMPORTED_MODULE_23__.A,{icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_icons_material_PlayCircleOutlined__WEBPACK_IMPORTED_MODULE_29__.A,{}),size:"small",label:n,clickable:!0,onClick:()=>{i(n),o("/overview")}})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_22__.A,{sx:{display:"inline"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_22__.A,{fontWeight:"fontWeightBold",sx:{display:"inline-block"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_icons_material_ToggleOn__WEBPACK_IMPORTED_MODULE_30__.A,{sx:{fontSize:14,verticalAlign:"-2px"}})," Availability:\xa0"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_22__.A,{fontWeight:"fontWeightRegular",sx:{mr:"1%",display:"inline-block"},children:r?"Active":"Inactive"})]})]})})]})}function CalibrateDialog(e){const[t,n]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1),[r,i]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0),[o,a]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({});(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)((()=>{if(!t)return;const n=`/api/workers/${e.unit}/active_calibrations`;(async()=>{try{const t=await fetch(n),r=await t.json(),i=await(0,_utilities__WEBPACK_IMPORTED_MODULE_17__.T5)(r.result_url_path,{delayMs:2e3});a(i.result[e.unit])}catch(t){console.error("Failed to fetch calibration:",t)}})()}),[t,e.unit]);const s=()=>{n(!1),setTimeout((()=>i(0)),200)};const l="ready"===e.growthRateJobState,c=function(t,n){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];switch(t){case"ready":case"init":case"sleeping":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("div",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_PatientButton__WEBPACK_IMPORTED_MODULE_16__.A,{color:"primary",variant:"contained",buttonText:"Running",disabled:!0})});default:return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("div",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_PatientButton__WEBPACK_IMPORTED_MODULE_16__.A,{color:"primary",variant:"contained",onClick:()=>(0,_utilities__WEBPACK_IMPORTED_MODULE_17__.nU)(e.unit,e.experiment,n),buttonText:"Start",disabled:r})})}}(e.odBlankJobState,"od_blank",l||"od"in o);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_24__.A,{style:{textTransform:"none",float:"right"},color:"primary",disabled:e.disabled,onClick:()=>{n(!0)},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_icons_material_Tune__WEBPACK_IMPORTED_MODULE_31__.A,{color:e.disabled?"disabled":"primary",fontSize:"15",sx:textIcon})," Calibrate"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material_Dialog__WEBPACK_IMPORTED_MODULE_32__.A,{open:t,onClose:s,"aria-labelledby":"form-dialog-title",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material_DialogTitle__WEBPACK_IMPORTED_MODULE_33__.A,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{sx:{fontSize:"13px",color:"rgba(0, 0, 0, 0.60)"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_PioreactorIcon__WEBPACK_IMPORTED_MODULE_9__.A,{style:{verticalAlign:"middle",fontSize:"1.2em"}})," ",e.label?`${e.label} / ${e.unit}`:`${e.unit}`]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material_Tabs__WEBPACK_IMPORTED_MODULE_34__.A,{value:r,onChange:(e,t)=>{i(t)},indicatorColor:"primary",textColor:"primary",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Tab__WEBPACK_IMPORTED_MODULE_35__.A,{label:"Blanks"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Tab__WEBPACK_IMPORTED_MODULE_35__.A,{label:"Calibrations"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_IconButton__WEBPACK_IMPORTED_MODULE_36__.A,{"aria-label":"close",onClick:s,sx:{position:"absolute",right:8,top:8,color:e=>e.palette.grey[500]},size:"large",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_icons_material_Close__WEBPACK_IMPORTED_MODULE_37__.A,{})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material_DialogContent__WEBPACK_IMPORTED_MODULE_38__.A,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(TabPanel,{value:r,index:0,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{gutterBottom:!0,children:"Record optical densities of blank (optional)"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"body2",component:"p",gutterBottom:!0,children:["For more accurate growth rate and biomass inferences, the Pioreactor can subtract out the media's ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("i",{children:"un-inoculated"})," optical density ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("i",{children:"per experiment"}),". Read more about ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("a",{href:"https://docs.pioreactor.com/user-guide/od-normal-growth-rate#blanking",children:"using blanks"}),"."]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"body2",component:"p",style:{margin:"20px 0px"},children:["Recorded optical densities of blank vial: ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("code",{children:e.odBlankReading?Object.entries(JSON.parse(e.odBlankReading)).map((e=>{let[t,n]=e;return`${t}:${n.toFixed(5)}`})).join(", "):"\u2014"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("div",{style:{display:"flex"},children:[c,(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("div",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_24__.A,{size:"small",sx:{width:"70px",mt:"5px",height:"31px",mr:"3px"},color:"secondary",disabled:null===e.odBlankReading||l,onClick:()=>(0,_utilities__WEBPACK_IMPORTED_MODULE_17__.nU)(e.unit,e.experiment,"od_blank",["delete"]),children:" Clear "})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(ManageDivider,{})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(TabPanel,{value:r,index:1,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{gutterBottom:!0,children:"Active calibrations"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"body2",component:"p",gutterBottom:!0,children:["Below are the active calibrations that will be used when running devices like pumps, stirring, etc. Read more about ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("a",{href:"https://docs.pioreactor.com/user-guide/hardware-calibrations",children:"calibrations"}),"."]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_39__.A,{size:"small",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_40__.A,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_41__.A,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_42__.A,{align:"left",sx:{padding:"6px 0px"},children:"Device"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_42__.A,{align:"left",sx:{padding:"6px 0px"},children:"Calibration name"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_42__.A,{align:"left",sx:{padding:"6px 0px"},children:"Calibrated on"})]})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_43__.A,{children:Object.entries(o||{}).map((t=>{let[n,r]=t;const i=r.calibration_name;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_41__.A,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_42__.A,{align:"left",sx:{padding:"6px 0px"},children:[" ",n," "]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_42__.A,{align:"left",sx:{padding:"6px 0px"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Chip__WEBPACK_IMPORTED_MODULE_23__.A,{size:"small",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_icons_material_Tune__WEBPACK_IMPORTED_MODULE_31__.A,{}),label:i,clickable:!0,component:react_router_dom__WEBPACK_IMPORTED_MODULE_27__.N_,to:`/calibrations/${e.unit}/${n}/${i}`})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_42__.A,{align:"left",sx:{padding:"6px 0px"},children:[" ",dayjs__WEBPACK_IMPORTED_MODULE_0___default()(r.created_at).format("YYYY-MM-DD")," "]})]},i+n)}))})]})]})]})]})]})}function SettingsActionsDialog(e){var t;const[n,r]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1),[i,o]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1),[a,s]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(""),[l,c]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0),[u,d]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1),[p,f]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1),[h,m]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1),[g,_]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1),[y,b]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1);function v(e,t){return function(){w(e,"$state",t)}}function x(e){return v(e,"disconnected")}function w(t,n,r){fetch(`/api/workers/${e.unit}/jobs/update/job_name/${t}/experiments/${e.experiment}`,{method:"PATCH",body:JSON.stringify({settings:{[n]:r}}),headers:{Accept:"application/json","Content-Type":"application/json"}})}const A=()=>{r(!1),setTimeout((()=>c(0)),200)};function E(t,n){switch(t){case"lost":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("div",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_PatientButton__WEBPACK_IMPORTED_MODULE_16__.A,{color:"primary",variant:"contained",onClick:()=>(0,_utilities__WEBPACK_IMPORTED_MODULE_17__.nU)(e.unit,e.experiment,n),buttonText:"Start"})},"patient_buttons_lost"+n);case"disconnected":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_PatientButton__WEBPACK_IMPORTED_MODULE_16__.A,{color:"primary",variant:"contained",onClick:()=>(0,_utilities__WEBPACK_IMPORTED_MODULE_17__.nU)(e.unit,e.experiment,n),buttonText:"Start"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_PatientButton__WEBPACK_IMPORTED_MODULE_16__.A,{color:"secondary",disabled:!0,buttonText:"Stop"})]},"patient_buttons_disconnected"+n);case"init":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_PatientButton__WEBPACK_IMPORTED_MODULE_16__.A,{color:"primary",variant:"contained",onClick:()=>!1,buttonText:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_CircularProgress__WEBPACK_IMPORTED_MODULE_44__.A,{color:"inherit",size:22}),disabled:!0}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_PatientButton__WEBPACK_IMPORTED_MODULE_16__.A,{color:"secondary",onClick:x(n),buttonText:"Stop"})]},"patient_buttons_init"+n);case"ready":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_PatientButton__WEBPACK_IMPORTED_MODULE_16__.A,{color:"secondary",variant:"contained",onClick:v(n,"sleeping"),buttonText:"Pause"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_PatientButton__WEBPACK_IMPORTED_MODULE_16__.A,{color:"secondary",onClick:x(n),buttonText:"Stop"})]},"patient_buttons_ready"+n);case"sleeping":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_PatientButton__WEBPACK_IMPORTED_MODULE_16__.A,{color:"primary",variant:"contained",onClick:v(n,"ready"),buttonText:"Resume"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_PatientButton__WEBPACK_IMPORTED_MODULE_16__.A,{color:"secondary",onClick:x(n),buttonText:"Stop"})]},"patient_buttons_sleeping"+n);default:return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("div",{},"patient_buttons_empty"+n)}}function j(e,t,n,r){const i={onUpdate:w,setSnackbarMessage:s,setSnackbarOpen:o,value:e.value,units:e.unit,job:t,setting:n,disabled:"disconnected"===r};switch(e.type){case"boolean":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(SettingSwitchField,{...i});case"numeric":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(SettingNumericField,{...i});default:return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(SettingTextField,{...i})}}const S=e.config.leds||{},O=Object.fromEntries(Object.entries(e.jobs).map(((e,t)=>{let[n,r]=e;return[n,E(r.state,n)]}))),k=JSON.parse(e.jobs.monitor.publishedSettings.versions.value||"{}"),C=JSON.parse(e.jobs.monitor.publishedSettings.voltage_on_pwm_rail.value||"{}"),P=e.jobs.monitor.publishedSettings.ipv4.value,M=e.jobs.monitor.publishedSettings.wlan_mac_address.value,T=e.jobs.monitor.publishedSettings.eth_mac_address.value,D=(0,_mui_material__WEBPACK_IMPORTED_MODULE_45__.A)((e=>e.breakpoints.down("xl"))),R=e.jobs.dosing_automation,I=e.jobs.led_automation,L=e.jobs.temperature_automation;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_24__.A,{style:{textTransform:"none",float:"right"},disabled:e.disabled,onClick:()=>{r(!0)},color:"primary",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_icons_material_Settings__WEBPACK_IMPORTED_MODULE_46__.A,{color:e.disabled?"disabled":"primary",fontSize:"15",sx:textIcon})," Manage"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material_Dialog__WEBPACK_IMPORTED_MODULE_32__.A,{maxWidth:D?"sm":"md",fullWidth:!0,open:n,onClose:A,PaperProps:{sx:{height:"calc(100% - 64px)"}},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material_DialogTitle__WEBPACK_IMPORTED_MODULE_33__.A,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{sx:{fontSize:"13px",color:"rgba(0, 0, 0, 0.60)"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_PioreactorIcon__WEBPACK_IMPORTED_MODULE_9__.A,{style:{verticalAlign:"middle",fontSize:"1.2em"}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("span",{children:[" ",e.label?`${e.label} / ${e.unit}`:`${e.unit}`," "]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_IconButton__WEBPACK_IMPORTED_MODULE_36__.A,{"aria-label":"close",onClick:A,sx:{position:"absolute",right:8,top:8,color:e=>e.palette.grey[500]},size:"large",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_icons_material_Close__WEBPACK_IMPORTED_MODULE_37__.A,{})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material_Tabs__WEBPACK_IMPORTED_MODULE_34__.A,{value:l,onChange:(e,t)=>{c(t)},indicatorColor:"primary",textColor:"primary",variant:"scrollable",scrollButtons:!0,allowScrollButtonsMobile:!0,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Tab__WEBPACK_IMPORTED_MODULE_35__.A,{label:"Activities"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Tab__WEBPACK_IMPORTED_MODULE_35__.A,{label:"Settings"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Tab__WEBPACK_IMPORTED_MODULE_35__.A,{label:"Dosing"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Tab__WEBPACK_IMPORTED_MODULE_35__.A,{label:"LEDs"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Tab__WEBPACK_IMPORTED_MODULE_35__.A,{label:"System"})]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material_DialogContent__WEBPACK_IMPORTED_MODULE_38__.A,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(TabPanel,{value:l,index:0,children:[Object.entries(e.jobs).filter((e=>{let[t,n]=e;return n.metadata.display})).filter((e=>{let[t,n]=e;return!["dosing_automation","led_automation","temperature_automation"].includes(t)})).map((e=>{let[t,n]=e;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("div",{style:{justifyContent:"space-between",display:"flex"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{display:"block",children:n.metadata.display_name}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(StateTypography,{state:n.state})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"caption",display:"block",gutterBottom:!0,color:"textSecondary",children:"app"!==n.metadata.source?`Installed by ${n.metadata.source||"unknown"}`:""}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"body2",component:"p",gutterBottom:!0,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("div",{dangerouslySetInnerHTML:{__html:n.metadata.description}})}),O[t],(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(ManageDivider,{})]},t)})),L&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("div",{style:{justifyContent:"space-between",display:"flex"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{display:"block",children:"Temperature automation"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(StateTypography,{state:L.state})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("div",{children:"ready"===L.state||"sleeping"===L.state||"init"===L.state?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"body2",component:"p",gutterBottom:!0,children:["Currently running temperature automation ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Chip__WEBPACK_IMPORTED_MODULE_23__.A,{size:"small",label:L.publishedSettings.automation_name.value}),"."]}),O[L.metadata.key]]}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"body2",component:"p",gutterBottom:!0,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("span",{dangerouslySetInnerHTML:{__html:L.metadata.description}})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_24__.A,{sx:{width:"70px",mt:"5px",height:"31px",mr:"3px"},size:"small",color:"primary",variant:"contained",onClick:()=>b(!0),children:"Start"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_24__.A,{sx:{width:"70px",mt:"5px",height:"31px",mr:"3px"},size:"small",color:"primary",disabled:!0,children:"Stop"})]})},L.metadata.key),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_ChangeAutomationsDialog__WEBPACK_IMPORTED_MODULE_4__.A,{open:y,onFinished:()=>b(!1),unit:e.unit,label:e.label,experiment:e.experiment,automationType:"temperature",no_skip_first_run:!0})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(ManageDivider,{}),R&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("div",{style:{justifyContent:"space-between",display:"flex"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{display:"block",children:"Dosing automation"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(StateTypography,{state:R.state})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("div",{children:"ready"===R.state||"sleeping"===R.state||"init"===R.state?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"body2",component:"p",gutterBottom:!0,children:["Currently running dosing automation ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Chip__WEBPACK_IMPORTED_MODULE_23__.A,{size:"small",label:R.publishedSettings.automation_name.value}),"."]}),O[R.metadata.key]]}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"body2",component:"p",gutterBottom:!0,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("span",{dangerouslySetInnerHTML:{__html:R.metadata.description}})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_24__.A,{sx:{width:"70px",mt:"5px",height:"31px",mr:"3px"},size:"small",color:"primary",variant:"contained",onClick:()=>m(!0),children:"Start"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_24__.A,{sx:{width:"70px",mt:"5px",height:"31px",mr:"3px"},size:"small",color:"primary",disabled:!0,children:"Stop"})]})},R.metadata.key),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_ChangeAutomationsDialog__WEBPACK_IMPORTED_MODULE_4__.A,{automationType:"dosing",open:h,onFinished:()=>m(!1),unit:e.unit,label:e.label,experiment:e.experiment,no_skip_first_run:!1})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(ManageDivider,{}),I&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("div",{style:{justifyContent:"space-between",display:"flex"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{display:"block",children:"LED automation"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(StateTypography,{state:I.state})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("div",{children:"ready"===I.state||"sleeping"===I.state||"init"===I.state?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"body2",component:"p",gutterBottom:!0,children:["Currently running LED automation ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Chip__WEBPACK_IMPORTED_MODULE_23__.A,{size:"small",label:I.publishedSettings.automation_name.value}),"."]}),O[I.metadata.key]]}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"body2",component:"p",gutterBottom:!0,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("span",{dangerouslySetInnerHTML:{__html:I.metadata.description}})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_24__.A,{sx:{width:"70px",mt:"5px",height:"31px",mr:"3px"},size:"small",color:"primary",variant:"contained",onClick:()=>_(!0),children:"Start"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_24__.A,{sx:{width:"70px",mt:"5px",height:"31px",mr:"3px"},size:"small",color:"primary",disabled:!0,children:"Stop"})]})},I.metadata.key),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_ChangeAutomationsDialog__WEBPACK_IMPORTED_MODULE_4__.A,{automationType:"led",open:g,onFinished:()=>_(!1),unit:e.unit,label:e.label,experiment:e.experiment,no_skip_first_run:!1})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(ManageDivider,{})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(TabPanel,{value:l,index:1,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{gutterBottom:!0,children:"Assign temporary label to Pioreactor"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"body2",component:"p",children:"Assign a temporary label to this Pioreactor for this experiment. The new label will display in graph legends, and throughout the interface."}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(SettingTextField,{value:e.label,onUpdate:function(t,n,r){const i=r;s(`Updating to ${i}`),o(!0),fetch(`/api/experiments/${e.experiment}/unit_labels`,{method:"PUT",body:JSON.stringify({label:i,unit:e.unit}),headers:{Accept:"application/json","Content-Type":"application/json"}}).then((t=>{t.ok&&e.setLabel(i)}))},setSnackbarMessage:s,setSnackbarOpen:o,disabled:!1}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(ManageDivider,{}),Object.values(e.jobs).filter((e=>e.metadata.display)).map((e=>[e.state,e.metadata.key,e.publishedSettings])).map(((e,t)=>{let[n,r,i]=e;return Object.entries(i).filter(((e,t)=>{let[n,r]=e;return r.display&&r.editable})).map(((e,t)=>{let[i,o]=e;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{gutterBottom:!0,children:o.label}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"body2",component:"p",children:o.description}),j(o,r,i,n),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(ManageDivider,{})]},i)}))}))]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(TabPanel,{value:l,index:2,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{gutterBottom:!0,children:"Cycle Media"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"body2",component:"p",children:"Safely cycle media in and out of your Pioreactor for a set duration (seconds) by running the media periodically and waste pump continuously."}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_ActionCirculatingForm__WEBPACK_IMPORTED_MODULE_7__.A,{action:"circulate_media",unit:e.unit,experiment:e.experiment,job:e.jobs.circulate_media}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(ManageDivider,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{gutterBottom:!0,children:"Cycle alternative media"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"body2",component:"p",children:"Safely cycle alternative media in and out of your Pioreactor for a set duration (seconds) by running the alt-media periodically and waste pump continuously."}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_ActionCirculatingForm__WEBPACK_IMPORTED_MODULE_7__.A,{action:"circulate_alt_media",unit:e.unit,experiment:e.experiment,job:e.jobs.circulate_alt_media}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(ManageDivider,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Alert__WEBPACK_IMPORTED_MODULE_47__.A,{severity:"warning",style:{marginBottom:"10px",marginTop:"10px"},children:"It's easy to overflow your vial. Make sure you don't add too much media."}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{gutterBottom:!0,children:"Add media"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"body2",component:"p",gutterBottom:!0,children:"Run the media pump for a set duration (s), moving a set volume (mL), or continuously add until stopped."}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"body2",component:"p",children:"Specify how you\u2019d like to add media:"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_ActionDosingForm__WEBPACK_IMPORTED_MODULE_5__.A,{action:"add_media",unit:e.unit,experiment:e.experiment,job:e.jobs.add_media}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(ManageDivider,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{gutterBottom:!0,children:"Remove waste"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"body2",component:"p",gutterBottom:!0,children:"Run the waste pump for a set duration (s), moving a set volume (mL), or continuously remove until stopped."}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"body2",component:"p",children:"Specify how you\u2019d like to remove waste:"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_ActionDosingForm__WEBPACK_IMPORTED_MODULE_5__.A,{action:"remove_waste",unit:e.unit,experiment:e.experiment,job:e.jobs.remove_waste}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(ManageDivider,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{gutterBottom:!0,children:"Add alternative media"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"body2",component:"p",gutterBottom:!0,children:"Run the alt-media pump for a set duration (s), moving a set volume (mL), or continuously add until stopped."}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"body2",component:"p",children:"Specify how you\u2019d like to add alt-media:"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_ActionDosingForm__WEBPACK_IMPORTED_MODULE_5__.A,{action:"add_alt_media",unit:e.unit,experiment:e.experiment,job:e.jobs.add_alt_media}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(ManageDivider,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{gutterBottom:!0,children:"Manual adjustments"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"body2",component:"p",gutterBottom:!0,children:"Record adjustments before manually adding or removing from the vial. This is recorded in the database and will ensure accurate metrics. Dosing automation must be on."}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_ActionManualDosingForm__WEBPACK_IMPORTED_MODULE_6__.A,{unit:e.unit,experiment:e.experiment})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(TabPanel,{value:l,index:3,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{style:{textTransform:"capitalize"},children:S.A?S.A.replace("_"," ").replace("led","LED"):"Channel A"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{sx:{fontSize:"13px",color:"rgba(0, 0, 0, 0.60)"},color:"textSecondary",children:S.A?"Channel A":""}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_ActionLEDForm__WEBPACK_IMPORTED_MODULE_8__.A,{experiment:e.experiment,channel:"A",unit:e.unit}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(ManageDivider,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{style:{textTransform:"capitalize"},children:S.B?S.B.replace("_"," ").replace("led","LED"):"Channel B"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{sx:{fontSize:"13px",color:"rgba(0, 0, 0, 0.60)"},color:"textSecondary",children:S.B?"Channel B":""}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_ActionLEDForm__WEBPACK_IMPORTED_MODULE_8__.A,{experiment:e.experiment,channel:"B",unit:e.unit}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(ManageDivider,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{style:{textTransform:"capitalize"},children:S.C?S.C.replace("_"," ").replace("led","LED"):"Channel C"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{sx:{fontSize:"13px",color:"rgba(0, 0, 0, 0.60)"},color:"textSecondary",children:S.C?"Channel C":""}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_ActionLEDForm__WEBPACK_IMPORTED_MODULE_8__.A,{experiment:e.experiment,channel:"C",unit:e.unit}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(ManageDivider,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{style:{textTransform:"capitalize"},children:S.D?S.D.replace("_"," ").replace("led","LED"):"Channel D"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{sx:{fontSize:"13px",color:"rgba(0, 0, 0, 0.60)"},color:"textSecondary",children:S.D?"Channel D":""}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_components_ActionLEDForm__WEBPACK_IMPORTED_MODULE_8__.A,{experiment:e.experiment,channel:"D",unit:e.unit}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(ManageDivider,{})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(TabPanel,{value:l,index:4,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{gutterBottom:!0,children:"Addresses and hostname"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"body2",component:"p",gutterBottom:!0,children:["Learn about how to ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://docs.pioreactor.com/user-guide/accessing-raspberry-pi",children:"access the Pioreactor's Raspberry Pi"}),"."]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("table",{style:{borderCollapse:"separate",borderSpacing:"5px",fontSize:"0.90rem"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("td",{style:{textAlign:"right",minWidth:"120px",color:""},children:"IPv4"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(StylizedCode,{children:P||"-"})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("td",{style:{textAlign:"right",minWidth:"120px",color:""},children:"Hostname"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(StylizedCode,{children:[e.unit,".local"]})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("td",{style:{textAlign:"right",minWidth:"120px",color:""},children:"WLAN MAC"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(StylizedCode,{children:M||"-"})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("td",{style:{textAlign:"right",minWidth:"120px",color:""},children:"Ethernet MAC"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(StylizedCode,{children:T||"-"})})]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(ManageDivider,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{gutterBottom:!0,children:"Version information"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("table",{style:{borderCollapse:"separate",borderSpacing:"5px",fontSize:"0.90rem"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("td",{style:{textAlign:"right",minWidth:"120px",color:""},children:"Pioreactor model"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(StylizedCode,{children:"Pioreactor "+(null===(t=k.pioreactor_model)||void 0===t?void 0:t.substring(11))+", v"+k.pioreactor_version||0})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("td",{style:{textAlign:"right",minWidth:"120px",color:""},children:"Software version"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(StylizedCode,{children:k.app||"-"})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("td",{style:{textAlign:"right",minWidth:"120px",color:""},children:"Raspberry Pi"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(StylizedCode,{children:k.rpi_machine||"-"})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("td",{style:{textAlign:"right",minWidth:"120px",color:""},children:"HAT version"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(StylizedCode,{children:k.hat||"-"})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("td",{style:{textAlign:"right",minWidth:"120px",color:""},children:"HAT serial number"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(StylizedCode,{children:k.hat_serial||"-"})})]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(ManageDivider,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{gutterBottom:!0,children:"Voltage on PWM rail"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("table",{style:{borderCollapse:"separate",borderSpacing:"5px",fontSize:"0.90rem"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("td",{style:{textAlign:"right",minWidth:"120px",color:""},children:"Voltage"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(StylizedCode,{children:C.voltage?`${C.voltage} V`:"-"})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("td",{style:{textAlign:"right",minWidth:"120px",color:""},children:"Last updated at"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(StylizedCode,{children:C.timestamp?dayjs__WEBPACK_IMPORTED_MODULE_0___default().utc(C.timestamp,"YYYY-MM-DD[T]HH:mm:ss.SSSSS[Z]").local().format("MMMM D, h:mm a"):"-"})})]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(ManageDivider,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{gutterBottom:!0,children:"Reboot"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"body2",component:"p",children:"Reboot the Raspberry Pi operating system. This will stop all jobs, and the Pioreactor will be inaccessible for a few minutes. It will blink its blue LED when back up, or press the onboard button to light up the blue LED."}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_lab_LoadingButton__WEBPACK_IMPORTED_MODULE_48__.A,{loadingIndicator:"Rebooting",loading:u,variant:"text",color:"primary",style:{marginTop:"15px",textTransform:"none"},onClick:function(){d(!0),fetch(`/api/units/${e.unit}/system/reboot`,{method:"POST"})},children:"Reboot RPi"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(ManageDivider,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{gutterBottom:!0,children:"Shut down"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_19__.A,{variant:"body2",component:"p",children:"After 20 seconds, shut down the Pioreactor. This will stop all jobs, and the Pioreactor will be inaccessible until it is restarted by unplugging and replugging the power supply."}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_lab_LoadingButton__WEBPACK_IMPORTED_MODULE_48__.A,{loadingIndicator:"\ud83d\ude35",loading:p,variant:"text",color:"primary",style:{marginTop:"15px",textTransform:"none"},onClick:function(){f(!0),fetch(`/api/units/${e.unit}/system/shutdown`,{method:"POST"})},children:"Shut down"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(ManageDivider,{})]})]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Snackbar__WEBPACK_IMPORTED_MODULE_49__.A,{anchorOrigin:{vertical:"bottom",horizontal:"center"},open:i,onClose:(e,t)=>{"clickaway"!==t&&o(!1)},message:a,autoHideDuration:7e3,resumeHideDuration:2e3},"snackbar"+e.unit+"settings")]})}function SettingTextField(e){const[t,n]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(e.value||""),[r,i]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1);(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)((()=>{e.value!==t&&n(e.value||"")}),[e.value]);const o=()=>{e.onUpdate(e.job,e.setting,t),""!==t?e.setSnackbarMessage(`Updating to ${t}${e.units?" "+e.units:""}.`):e.setSnackbarMessage("Updating."),e.setSnackbarOpen(!0),i(!1)};return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("div",{style:{display:"flex"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_TextField__WEBPACK_IMPORTED_MODULE_50__.A,{size:"small",autoComplete:"off",disabled:e.disabled,value:t,InputProps:{endAdornment:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_InputAdornment__WEBPACK_IMPORTED_MODULE_51__.A,{position:"end",children:e.units}),autoComplete:"new-password"},variant:"outlined",onChange:e=>{i(!0),n(e.target.value)},onKeyPress:e=>{"Enter"===e.key&&e.target.value&&o()},sx:{mt:2,maxWidth:"180px"}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_24__.A,{size:"small",color:"primary",disabled:!r,onClick:o,style:{textTransform:"none",marginTop:"15px",marginLeft:"7px",display:e.disabled?"None":""},children:"Update"})]})}function SettingSwitchField(e){const[t,n]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(e.value||!1);(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)((()=>{e.value!==t&&n(e.value||!1)}),[e.value]);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Switch__WEBPACK_IMPORTED_MODULE_52__.A,{checked:t,disabled:e.disabled,onChange:t=>{n(t.target.checked),e.onUpdate(e.job,e.setting,t.target.checked?1:0),e.setSnackbarMessage(`Updating to ${t.target.checked?"on":"off"}.`),e.setSnackbarOpen(!0)}})}function SettingNumericField(e){const[t,n]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(e.value||""),[r,i]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1),[o,a]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1);(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)((()=>{e.value!==t&&n(e.value||"")}),[e.value]);const s=()=>{if(!r){e.onUpdate(e.job,e.setting,t);const n=""!==t?`Updating to ${t}${e.units?" "+e.units:""}.`:"Updating.";e.setSnackbarMessage(n),e.setSnackbarOpen(!0),a(!1)}};return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("div",{style:{display:"flex"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_TextField__WEBPACK_IMPORTED_MODULE_50__.A,{type:"number",size:"small",autoComplete:"off",disabled:e.disabled,value:t,error:r,InputProps:{endAdornment:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_InputAdornment__WEBPACK_IMPORTED_MODULE_51__.A,{position:"end",children:e.units}),autoComplete:"new-password"},variant:"outlined",onChange:e=>{const t=e.target.value,r=(e=>/^-?\d*\.?\d*$/.test(e))(t);i(!r),a(r),n(t)},onKeyPress:e=>{"Enter"===e.key&&e.target.value&&!r&&s()},sx:{mt:2,maxWidth:"140px"}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_24__.A,{size:"small",color:"primary",disabled:!o||r,onClick:s,style:{textTransform:"none",marginTop:"15px",marginLeft:"7px",display:e.disabled?"None":""},children:"Update"})]})}function UnitCard(e){let{unit:t,experiment:n,config:r,isAssignedToExperiment:i,isActive:o}=e;const[a,s]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({});return(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)((()=>{n&&(0,_utilities__WEBPACK_IMPORTED_MODULE_17__.yr)(s,n)}),[n]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("div",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(PioreactorCard,{isUnitActive:i&&o,unit:t,config:r,experiment:n,label:a[t]})})})}function FlashLEDButton(e){const[t,n]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_24__.A,{style:{textTransform:"none",float:"right"},className:t?"blinkled":"",disabled:e.disabled,onClick:()=>{n(!0),fetch(`/api/workers/${e.unit}/blink`,{method:"POST"})},color:"primary",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_mui_icons_material_Flare__WEBPACK_IMPORTED_MODULE_53__.A,{color:e.disabled?"disabled":"primary",fontSize:"15",sx:textIcon})," ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("span",{children:" Identify "})]})}function PioreactorCard(e){const t=e.unit,n=e.isUnitActive,r=e.experiment,i=e.config,[o,a]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1),[s,l]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(""),{client:c,subscribeToTopic:u}=(0,_providers_MQTTContext__WEBPACK_IMPORTED_MODULE_14__.W)(),[d,p]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({monitor:{state:null,metadata:{display:!1},publishedSettings:{versions:{value:null,label:null,type:"json",unit:null,display:!1,description:null},voltage_on_pwm_rail:{value:null,label:null,type:"json",unit:null,display:!1,description:null},ipv4:{value:null,label:null,type:"string",unit:null,display:!1,description:null},wlan_mac_address:{value:null,label:null,type:"string",unit:null,display:!1,description:null},eth_mac_address:{value:null,label:null,type:"string",unit:null,display:!1,description:null}}}});(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)((()=>{l(e.label)}),[e.label]),(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)((()=>{fetch("/api/contrib/jobs").then((e=>{if(e.ok)return e.json();throw new Error("Something went wrong")})).then((e=>{var t={};for(const o of e){for(var n={state:"disconnected",publishedSettings:{},metadata:{display_name:o.display_name,subtext:o.subtext,display:o.display,description:o.description,key:o.job_name,source:o.source}},r=0;rd?y:p],v=Math.abs(m[1]-m[0])>Math.abs(b[1]-b[0])?m:b;return te.dw([d,p])?[new Date(v[0]),new Date(v[1])]:v},getScaledDomain:function(e,t,n){var r=De(e,2),i=r[0],o=r[1],a=Math.abs(o-i),s=a-a*t,l=Number(i)+s*n,c=Number(o)-s*(1-n);return[Math.min(l,c),Math.max(l,c)]},getMinimumDomain:function(e,t,n){var r=t.minimumZoom,i=De(this.getDomain(t)[n],2),o=i[0],a=i[1],s=Math.abs(o-a)/1e3,l=r&&r[n]||s,c=e-l/2,u=e+l/2;return[c>o&&co?u:Number(o)+l/2]},zoommingOut:function(e){return e.deltaY>0},getScaleFactor:function(e){var t=this.zoommingOut(e)?1:-1,n=Math.min(Math.abs(e.deltaY/300),.5);return Math.abs(1+t*n)},getScalePercent:function(e,t,n){var r=this.getDomain(t),i=De(r[n],2),o=i[0],a=i[1];return(this.getPosition(e,t,r)[n]-o)/Math.abs(a-o)},getPosition:function(e,t,n){var r=oe(e),i=r.x,o=r.y,a={x:t.scale.x.domain(n.x),y:t.scale.y.domain(n.y)};return se(t,a,i,o)},pan:function(e,t,n){var r,i=De(e.map((function(e){return Number(e)})),2),o=i[0],a=i[1],s=De(t.map((function(e){return Number(e)})),2),l=s[0],c=s[1],u=o+n,d=a+n;if(u>l&&d 0&&void 0!==arguments[0]?arguments[0]:{};const{colorSchemes:t={light:!0},defaultColorScheme:n,disableCssColorScheme:a=!1,cssVarPrefix:s="mui",shouldSkipGeneratingVar:l=F,colorSchemeSelector:c=(t.light&&t.dark?"media":void 0),rootSelector:u=":root",...d}=e,p=Object.keys(t)[0],f=n||(t.light&&"light"!==p?"light":p),h=Q(s),{[f]:m,light:g,dark:_,...y}=t,b={...y};let v=m;if(("dark"===f&&!("dark"in t)||"light"===f&&!("light"in t))&&(v=!0),!v)throw new Error((0,r.A)(21,f));const E=J(b,v,d,f);g&&!b.light&&J(b,g,void 0,"light"),_&&!b.dark&&J(b,_,void 0,"dark");let j={defaultColorScheme:f,...E,cssVarPrefix:s,colorSchemeSelector:c,rootSelector:u,getCssVar:h,colorSchemes:b,font:{...A(E.typography),...E.font},spacing:(S=d.spacing,"number"===typeof S?`${S}px`:"string"===typeof S||"function"===typeof S||Array.isArray(S)?S:"8px")};var S;Object.keys(j.colorSchemes).forEach((e=>{const t=j.colorSchemes[e].palette,n=e=>{const n=e.split("-"),r=n[1],i=n[2];return h(e,t[r][i])};var r;if("light"===t.mode&&(V(t.common,"background","#fff"),V(t.common,"onBackground","#000")),"dark"===t.mode&&(V(t.common,"background","#000"),V(t.common,"onBackground","#fff")),r=t,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"].forEach((e=>{r[e]||(r[e]={})})),"light"===t.mode){V(t.Alert,"errorColor",(0,o.Nd)(t.error.light,.6)),V(t.Alert,"infoColor",(0,o.Nd)(t.info.light,.6)),V(t.Alert,"successColor",(0,o.Nd)(t.success.light,.6)),V(t.Alert,"warningColor",(0,o.Nd)(t.warning.light,.6)),V(t.Alert,"errorFilledBg",n("palette-error-main")),V(t.Alert,"infoFilledBg",n("palette-info-main")),V(t.Alert,"successFilledBg",n("palette-success-main")),V(t.Alert,"warningFilledBg",n("palette-warning-main")),V(t.Alert,"errorFilledColor",X((()=>t.getContrastText(t.error.main)))),V(t.Alert,"infoFilledColor",X((()=>t.getContrastText(t.info.main)))),V(t.Alert,"successFilledColor",X((()=>t.getContrastText(t.success.main)))),V(t.Alert,"warningFilledColor",X((()=>t.getContrastText(t.warning.main)))),V(t.Alert,"errorStandardBg",(0,o.j4)(t.error.light,.9)),V(t.Alert,"infoStandardBg",(0,o.j4)(t.info.light,.9)),V(t.Alert,"successStandardBg",(0,o.j4)(t.success.light,.9)),V(t.Alert,"warningStandardBg",(0,o.j4)(t.warning.light,.9)),V(t.Alert,"errorIconColor",n("palette-error-main")),V(t.Alert,"infoIconColor",n("palette-info-main")),V(t.Alert,"successIconColor",n("palette-success-main")),V(t.Alert,"warningIconColor",n("palette-warning-main")),V(t.AppBar,"defaultBg",n("palette-grey-100")),V(t.Avatar,"defaultBg",n("palette-grey-400")),V(t.Button,"inheritContainedBg",n("palette-grey-300")),V(t.Button,"inheritContainedHoverBg",n("palette-grey-A100")),V(t.Chip,"defaultBorder",n("palette-grey-400")),V(t.Chip,"defaultAvatarColor",n("palette-grey-700")),V(t.Chip,"defaultIconColor",n("palette-grey-700")),V(t.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),V(t.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),V(t.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),V(t.LinearProgress,"primaryBg",(0,o.j4)(t.primary.main,.62)),V(t.LinearProgress,"secondaryBg",(0,o.j4)(t.secondary.main,.62)),V(t.LinearProgress,"errorBg",(0,o.j4)(t.error.main,.62)),V(t.LinearProgress,"infoBg",(0,o.j4)(t.info.main,.62)),V(t.LinearProgress,"successBg",(0,o.j4)(t.success.main,.62)),V(t.LinearProgress,"warningBg",(0,o.j4)(t.warning.main,.62)),V(t.Skeleton,"bg",`rgba(${n("palette-text-primaryChannel")} / 0.11)`),V(t.Slider,"primaryTrack",(0,o.j4)(t.primary.main,.62)),V(t.Slider,"secondaryTrack",(0,o.j4)(t.secondary.main,.62)),V(t.Slider,"errorTrack",(0,o.j4)(t.error.main,.62)),V(t.Slider,"infoTrack",(0,o.j4)(t.info.main,.62)),V(t.Slider,"successTrack",(0,o.j4)(t.success.main,.62)),V(t.Slider,"warningTrack",(0,o.j4)(t.warning.main,.62));const e=(0,o.Y9)(t.background.default,.8);V(t.SnackbarContent,"bg",e),V(t.SnackbarContent,"color",X((()=>t.getContrastText(e)))),V(t.SpeedDialAction,"fabHoverBg",(0,o.Y9)(t.background.paper,.15)),V(t.StepConnector,"border",n("palette-grey-400")),V(t.StepContent,"border",n("palette-grey-400")),V(t.Switch,"defaultColor",n("palette-common-white")),V(t.Switch,"defaultDisabledColor",n("palette-grey-100")),V(t.Switch,"primaryDisabledColor",(0,o.j4)(t.primary.main,.62)),V(t.Switch,"secondaryDisabledColor",(0,o.j4)(t.secondary.main,.62)),V(t.Switch,"errorDisabledColor",(0,o.j4)(t.error.main,.62)),V(t.Switch,"infoDisabledColor",(0,o.j4)(t.info.main,.62)),V(t.Switch,"successDisabledColor",(0,o.j4)(t.success.main,.62)),V(t.Switch,"warningDisabledColor",(0,o.j4)(t.warning.main,.62)),V(t.TableCell,"border",(0,o.j4)((0,o.Cg)(t.divider,1),.88)),V(t.Tooltip,"bg",(0,o.Cg)(t.grey[700],.92))}if("dark"===t.mode){V(t.Alert,"errorColor",(0,o.j4)(t.error.light,.6)),V(t.Alert,"infoColor",(0,o.j4)(t.info.light,.6)),V(t.Alert,"successColor",(0,o.j4)(t.success.light,.6)),V(t.Alert,"warningColor",(0,o.j4)(t.warning.light,.6)),V(t.Alert,"errorFilledBg",n("palette-error-dark")),V(t.Alert,"infoFilledBg",n("palette-info-dark")),V(t.Alert,"successFilledBg",n("palette-success-dark")),V(t.Alert,"warningFilledBg",n("palette-warning-dark")),V(t.Alert,"errorFilledColor",X((()=>t.getContrastText(t.error.dark)))),V(t.Alert,"infoFilledColor",X((()=>t.getContrastText(t.info.dark)))),V(t.Alert,"successFilledColor",X((()=>t.getContrastText(t.success.dark)))),V(t.Alert,"warningFilledColor",X((()=>t.getContrastText(t.warning.dark)))),V(t.Alert,"errorStandardBg",(0,o.Nd)(t.error.light,.9)),V(t.Alert,"infoStandardBg",(0,o.Nd)(t.info.light,.9)),V(t.Alert,"successStandardBg",(0,o.Nd)(t.success.light,.9)),V(t.Alert,"warningStandardBg",(0,o.Nd)(t.warning.light,.9)),V(t.Alert,"errorIconColor",n("palette-error-main")),V(t.Alert,"infoIconColor",n("palette-info-main")),V(t.Alert,"successIconColor",n("palette-success-main")),V(t.Alert,"warningIconColor",n("palette-warning-main")),V(t.AppBar,"defaultBg",n("palette-grey-900")),V(t.AppBar,"darkBg",n("palette-background-paper")),V(t.AppBar,"darkColor",n("palette-text-primary")),V(t.Avatar,"defaultBg",n("palette-grey-600")),V(t.Button,"inheritContainedBg",n("palette-grey-800")),V(t.Button,"inheritContainedHoverBg",n("palette-grey-700")),V(t.Chip,"defaultBorder",n("palette-grey-700")),V(t.Chip,"defaultAvatarColor",n("palette-grey-300")),V(t.Chip,"defaultIconColor",n("palette-grey-300")),V(t.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),V(t.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),V(t.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),V(t.LinearProgress,"primaryBg",(0,o.Nd)(t.primary.main,.5)),V(t.LinearProgress,"secondaryBg",(0,o.Nd)(t.secondary.main,.5)),V(t.LinearProgress,"errorBg",(0,o.Nd)(t.error.main,.5)),V(t.LinearProgress,"infoBg",(0,o.Nd)(t.info.main,.5)),V(t.LinearProgress,"successBg",(0,o.Nd)(t.success.main,.5)),V(t.LinearProgress,"warningBg",(0,o.Nd)(t.warning.main,.5)),V(t.Skeleton,"bg",`rgba(${n("palette-text-primaryChannel")} / 0.13)`),V(t.Slider,"primaryTrack",(0,o.Nd)(t.primary.main,.5)),V(t.Slider,"secondaryTrack",(0,o.Nd)(t.secondary.main,.5)),V(t.Slider,"errorTrack",(0,o.Nd)(t.error.main,.5)),V(t.Slider,"infoTrack",(0,o.Nd)(t.info.main,.5)),V(t.Slider,"successTrack",(0,o.Nd)(t.success.main,.5)),V(t.Slider,"warningTrack",(0,o.Nd)(t.warning.main,.5));const e=(0,o.Y9)(t.background.default,.98);V(t.SnackbarContent,"bg",e),V(t.SnackbarContent,"color",X((()=>t.getContrastText(e)))),V(t.SpeedDialAction,"fabHoverBg",(0,o.Y9)(t.background.paper,.15)),V(t.StepConnector,"border",n("palette-grey-600")),V(t.StepContent,"border",n("palette-grey-600")),V(t.Switch,"defaultColor",n("palette-grey-300")),V(t.Switch,"defaultDisabledColor",n("palette-grey-600")),V(t.Switch,"primaryDisabledColor",(0,o.Nd)(t.primary.main,.55)),V(t.Switch,"secondaryDisabledColor",(0,o.Nd)(t.secondary.main,.55)),V(t.Switch,"errorDisabledColor",(0,o.Nd)(t.error.main,.55)),V(t.Switch,"infoDisabledColor",(0,o.Nd)(t.info.main,.55)),V(t.Switch,"successDisabledColor",(0,o.Nd)(t.success.main,.55)),V(t.Switch,"warningDisabledColor",(0,o.Nd)(t.warning.main,.55)),V(t.TableCell,"border",(0,o.Nd)((0,o.Cg)(t.divider,1),.68)),V(t.Tooltip,"bg",(0,o.Cg)(t.grey[700],.92))}Y(t.background,"default"),Y(t.background,"paper"),Y(t.common,"background"),Y(t.common,"onBackground"),Y(t,"divider"),Object.keys(t).forEach((e=>{const n=t[e];n&&"object"===typeof n&&(n.main&&V(t[e],"mainChannel",(0,o.Me)(G(n.main))),n.light&&V(t[e],"lightChannel",(0,o.Me)(G(n.light))),n.dark&&V(t[e],"darkChannel",(0,o.Me)(G(n.dark))),n.contrastText&&V(t[e],"contrastTextChannel",(0,o.Me)(G(n.contrastText))),"text"===e&&(Y(t[e],"primary"),Y(t[e],"secondary")),"action"===e&&(n.active&&Y(t[e],"active"),n.selected&&Y(t[e],"selected")))}))}));for(var O=arguments.length,M=new Array(O>1?O-1:0),T=1;Ts&&(n=s-l),o=n;o>=0;o--){let n=!0;for(let r=0;rs&&(n=s-l),o=n;o>=0;o--){for(var d=!0,p=0;p>1,u=-7,d=n?i-1:0,p=n?-1:1,f=e[t+d];for(d+=p,o=f&(1<<-u)-1,f>>=-u,u+=s;u>0;o=256*o+e[t+d],d+=p,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=256*a+e[t+d],d+=p,u-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=c}return(f?-1:1)*a*Math.pow(2,o-r)},write:function(e,t,n,r,i,o){var a,s,l,c=8*o-i-1,u=(1<>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return rn(this,e,t,n);case"utf8":case"utf-8":return on(this,e,t,n);case"ascii":return an(this,e,t,n);case"latin1":case"binary":return sn(this,e,t,n);case"base64":return ln(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return cn(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},Ht.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},Ht.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t=0?(c=f.substr(0,h),u=f.substr(h+1)):(c=f,u=""),d=decodeURIComponent(c),p=decodeURIComponent(u),Ui(i,d)?Array.isArray(i[d])?i[d].push(p):i[d]=[i[d],p]:i[d]=p}return i},Ni=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},zi=function(e,t,n,r){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(r){var i=encodeURIComponent(Ni(r))+n;return Array.isArray(e[r])?e[r].map((function(e){return i+encodeURIComponent(Ni(e))})).join(t):i+encodeURIComponent(Ni(e[r]))})).join(t):r?encodeURIComponent(Ni(r))+n+encodeURIComponent(Ni(e)):""},(Fi={}).decode=Fi.parse=$i,Fi.encode=Fi.stringify=zi,Fi.decode,Fi.encode,Fi.parse,Fi.stringify}));function qi(){throw new Error("setTimeout has not been defined")}function Hi(){throw new Error("clearTimeout has not been defined")}function Vi(e){if(Zi===setTimeout)return setTimeout(e,0);if((Zi===qi||!Zi)&&setTimeout)return Zi=setTimeout,setTimeout(e,0);try{return Zi(e,0)}catch{try{return Zi.call(null,e,0)}catch{return Zi.call(this||to,e,0)}}}function Gi(){oo&&ro&&(oo=!1,ro.length?io=ro.concat(io):ao=-1,io.length&&Yi())}function Yi(){if(!oo){var e=Vi(Gi);oo=!0;for(var t=io.length;t;){for(ro=io,io=[];++ao