diff --git a/asset-manifest.json b/asset-manifest.json index 256f8c9a..d04a827c 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,7 +1,7 @@ { "files": { "main.css": "/static/css/main.a3dbeddd.css", - "main.js": "/static/js/main.3d90a949.js", + "main.js": "/static/js/main.26dd64ad.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.a3dbeddd.css.map": "/static/css/main.a3dbeddd.css.map", - "main.3d90a949.js.map": "/static/js/main.3d90a949.js.map" + "main.26dd64ad.js.map": "/static/js/main.26dd64ad.js.map" }, "entrypoints": [ "static/css/main.a3dbeddd.css", - "static/js/main.3d90a949.js" + "static/js/main.26dd64ad.js" ] } diff --git a/index.html b/index.html index bf85cec5..274774fe 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -
+ diff --git a/static/js/main.3d90a949.js b/static/js/main.26dd64ad.js similarity index 99% rename from static/js/main.3d90a949.js rename to static/js/main.26dd64ad.js index c7d51d18..2647ba45 100644 --- a/static/js/main.3d90a949.js +++ b/static/js/main.26dd64ad.js @@ -1,5 +1,5 @@ -/*! For license information please see main.3d90a949.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_10__=__webpack_require__(68903),_mui_material_Button__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(42518),_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__(65901),_components_MediaCard__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(22353),react_router_dom__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(35475),_utilities__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(36576),_mui_material_Card__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(12110),_mui_icons_material_ListAltOutlined__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(98231),_mui_material_ToggleButton__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(84511),_mui_material_ToggleButtonGroup__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(15078),_mui_material_Stack__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(46517),_providers_MQTTContext__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(16216),_providers_ExperimentContext__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(68891),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__=__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_7__.jsxs)(_mui_material_ToggleButtonGroup__WEBPACK_IMPORTED_MODULE_8__.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_7__.jsx)(_mui_material_ToggleButton__WEBPACK_IMPORTED_MODULE_9__.A,{style:{textTransform:"None"},value:"hours",children:"Elapsed time"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_mui_material_ToggleButton__WEBPACK_IMPORTED_MODULE_9__.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_7__.jsxs)(_mui_material_ToggleButtonGroup__WEBPACK_IMPORTED_MODULE_8__.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_7__.jsx)(_mui_material_ToggleButton__WEBPACK_IMPORTED_MODULE_9__.A,{style:{textTransform:"None"},value:1e7,children:"All time"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_mui_material_ToggleButton__WEBPACK_IMPORTED_MODULE_9__.A,{style:{textTransform:"None"},value:12,children:"Past 12h"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_mui_material_ToggleButton__WEBPACK_IMPORTED_MODULE_9__.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_5__.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_7__.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_7__.jsx)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_10__.Ay,{item:!0,xs:12,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_mui_material_Card__WEBPACK_IMPORTED_MODULE_11__.A,{sx:{maxHeight:"100%"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.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_6__.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_12__.sE(_utilities__WEBPACK_IMPORTED_MODULE_12__.Tj);return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{document.title=e.title,(0,_utilities__WEBPACK_IMPORTED_MODULE_12__.zj)(o)}),[e.title]),(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{n.experiment&&((0,_utilities__WEBPACK_IMPORTED_MODULE_12__.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]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_10__.Ay,{container:!0,spacing:2,justifyContent:"space-between",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_10__.Ay,{item:!0,xs:12,md:12,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_components_ExperimentSummary__WEBPACK_IMPORTED_MODULE_2__.A,{experimentMetadata:n,updateExperiment:r})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_10__.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_7__.jsx)(Charts,{unitsColorMap:g,config:i,timeScale:u,timeWindow:p,experimentMetadata:n,relabelMap:a})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_10__.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_7__.jsx)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_10__.Ay,{item:!0,xs:6,md:6,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_mui_material_Stack__WEBPACK_IMPORTED_MODULE_13__.A,{direction:"row",justifyContent:"start",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(TimeWindowSwitch,{setTimeWindow:f,initTimeWindow:p})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_10__.Ay,{item:!0,xs:6,md:6,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_mui_material_Stack__WEBPACK_IMPORTED_MODULE_13__.A,{direction:"row",justifyContent:"end",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(TimeFormatSwitch,{setTimeScale:d,initTimeScale:u})})}),i["ui.overview.cards"]&&"1"===i["ui.overview.cards"].dosings&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_10__.Ay,{item:!0,xs:12,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_components_MediaCard__WEBPACK_IMPORTED_MODULE_4__.A,{activeUnits:h.filter((e=>1===e.is_active)).map((e=>e.pioreactor_unit)),experiment:n.experiment,relabelMap:a})}),i["ui.overview.cards"]&&"1"===i["ui.overview.cards"].event_logs&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_10__.Ay,{item:!0,xs:12,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_components_LogTable__WEBPACK_IMPORTED_MODULE_1__.A,{byDuration:"hours"===u,experimentStartTime:n.created_at,experiment:n.experiment,config:i,relabelMap:a}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_14__.A,{to:`/export-data?experiment=${n.experiment}&logs=1`,component:react_router_dom__WEBPACK_IMPORTED_MODULE_15__.N_,color:"primary",style:{textTransform:"none",verticalAlign:"middle",margin:"0px 3px"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_mui_icons_material_ListAltOutlined__WEBPACK_IMPORTED_MODULE_16__.A,{style:{fontSize:17,margin:"0px 3px"},color:"primary"})," Export all logs"]})]})]})]})})}__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_7__=__webpack_require__(51292),_mui_material_FormControl__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(53193),_mui_material_FormGroup__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(69413),_mui_material_FormControlLabel__WEBPACK_IMPORTED_MODULE_11__=__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__(65901),_mui_material_Select__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(72221),_mui_material__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(94496),_mui_material_Box__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(7353),_mui_material_MenuItem__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(32143),_mui_material_Checkbox__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(51962),_mui_material_Card__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(12110),_utilities__WEBPACK_IMPORTED_MODULE_13__=__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_3__=__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_3__.jsx)(_mui_material_MenuItem__WEBPACK_IMPORTED_MODULE_4__.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_3__.jsxs)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_5__.A,{sx:{maxWidth:"450px",m:1},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_mui_material_FormControl__WEBPACK_IMPORTED_MODULE_6__.A,{fullWidth:!0,component:"fieldset",sx:{my:1},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_mui_material_FormLabel__WEBPACK_IMPORTED_MODULE_7__.A,{component:"legend",children:"Experiment"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_mui_material_Select__WEBPACK_IMPORTED_MODULE_8__.A,{labelId:"expSelect",variant:"standard",value:e.experimentSelection,onChange:t=>{e.handleExperimentSelectionChange(t.target.value)},children:i})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_5__.A,{sx:{my:1},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_9__.A,{sx:{fontSize:16},color:"text.secondary",gutterBottom:!0,children:"Experiment created"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_9__.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_3__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_9__.A,{sx:{fontSize:16,pt:1},color:"text.secondary",gutterBottom:!0,children:"Description"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_9__.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_3__.jsx)("div",{style:{maxWidth:"450px",margin:"10px"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_mui_material_FormControl__WEBPACK_IMPORTED_MODULE_6__.A,{fullWidth:!0,component:"fieldset",sx:{m:2},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_mui_material_FormLabel__WEBPACK_IMPORTED_MODULE_7__.A,{component:"legend",children:"Charts"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_mui_material_FormGroup__WEBPACK_IMPORTED_MODULE_10__.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_3__.jsx)(_mui_material_FormControlLabel__WEBPACK_IMPORTED_MODULE_11__.A,{control:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_mui_material_Checkbox__WEBPACK_IMPORTED_MODULE_12__.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_13__.sE(_utilities__WEBPACK_IMPORTED_MODULE_13__.Tj);function handleExperimentSelectionChange(e){setExperimentSelection(e),(0,_utilities__WEBPACK_IMPORTED_MODULE_13__.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_13__.zj)(setConfig)}),[props.title]);const additionalQueryString=objectToQueryString(chartSelection);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_5__.A,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_5__.A,{sx:{display:"flex",justifyContent:"space-between",mb:1},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_9__.A,{variant:"h5",component:"h2",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_5__.A,{fontWeight:"fontWeightBold",children:"Past experiments"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_5__.A,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-start",flexFlow:"wrap"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.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_3__.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_3__.jsx)(_mui_material_Card__WEBPACK_IMPORTED_MODULE_17__.A,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_mui_material_Card__WEBPACK_IMPORTED_MODULE_17__.A,{sx:{p:1},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_18__.Ay,{container:!0,spacing:2,justifyContent:"space-between",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_18__.Ay,{item:!0,xs:6,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(ExperimentSelection,{experimentSelection:experimentSelection,handleExperimentSelectionChange:handleExperimentSelectionChange})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_18__.Ay,{item:!0,xs:6,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(ChartSelection,{chartSelection:chartSelection,handleChartSelectionChange:handleChartSelectionChange,config:config})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.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_3__.jsx)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_18__.Ay,{item:!0,xs:6,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.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_3__.jsx)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_18__.Ay,{container:!0,spacing:2,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_mui_material_Grid__WEBPACK_IMPORTED_MODULE_18__.Ay,{item:!0,md:12,xs:12,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.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_49__=__webpack_require__(68903),_mui_material__WEBPACK_IMPORTED_MODULE_38__=__webpack_require__(30344),_mui_material_styles__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__(34535),_mui_material_Chip__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__(43845),_mui_material_Card__WEBPACK_IMPORTED_MODULE_47__=__webpack_require__(12110),_mui_material__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(94496),_mui_material_Dialog__WEBPACK_IMPORTED_MODULE_31__=__webpack_require__(90035),_mui_material_DialogTitle__WEBPACK_IMPORTED_MODULE_32__=__webpack_require__(26600),_mui_material_DialogContent__WEBPACK_IMPORTED_MODULE_37__=__webpack_require__(35316),_mui_material_Box__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__(7353),_mui_material_Divider__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__(39336),_mui_material_CircularProgress__WEBPACK_IMPORTED_MODULE_28__=__webpack_require__(81637),_mui_icons_material_ScienceOutlined__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__(2218),_mui_material_Snackbar__WEBPACK_IMPORTED_MODULE_42__=__webpack_require__(40794),_mui_material_TextField__WEBPACK_IMPORTED_MODULE_43__=__webpack_require__(15795),_mui_material_Tooltip__WEBPACK_IMPORTED_MODULE_48__=__webpack_require__(77739),_mui_material_InputAdornment__WEBPACK_IMPORTED_MODULE_44__=__webpack_require__(51787),_mui_material_Tabs__WEBPACK_IMPORTED_MODULE_33__=__webpack_require__(83625),_mui_material_Tab__WEBPACK_IMPORTED_MODULE_34__=__webpack_require__(24056),_mui_material_Button__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__(42518),_mui_lab_LoadingButton__WEBPACK_IMPORTED_MODULE_41__=__webpack_require__(77093),_mui_icons_material_ToggleOn__WEBPACK_IMPORTED_MODULE_27__=__webpack_require__(433),_mui_icons_material_Clear__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__(30079),_mui_icons_material_Close__WEBPACK_IMPORTED_MODULE_36__=__webpack_require__(33438),_mui_icons_material_ArrowBack__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__(87332),_mui_icons_material_Flare__WEBPACK_IMPORTED_MODULE_46__=__webpack_require__(42950),_mui_icons_material_Settings__WEBPACK_IMPORTED_MODULE_39__=__webpack_require__(32069),_mui_icons_material_Tune__WEBPACK_IMPORTED_MODULE_30__=__webpack_require__(20746),_mui_material_IconButton__WEBPACK_IMPORTED_MODULE_35__=__webpack_require__(17392),_mui_material_Switch__WEBPACK_IMPORTED_MODULE_45__=__webpack_require__(4598),material_ui_confirm__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(88370),_utilities__WEBPACK_IMPORTED_MODULE_29__=__webpack_require__(36576),_mui_material_Alert__WEBPACK_IMPORTED_MODULE_40__=__webpack_require__(67254),react_router_dom__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__(35475),react_router_dom__WEBPACK_IMPORTED_MODULE_50__=__webpack_require__(73216),_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__(65901),_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),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(70579);const readyGreen="#176114",disconnectedGrey="#585858",lostRed="#DE3618",disabledColor="rgba(0, 0, 0, 0.38)",stateDisplay={init:{display:"Starting",color:readyGreen,backgroundColor:"#DDFFDC"},ready:{display:"On",color:readyGreen,backgroundColor:"#DDFFDC"},sleeping:{display:"Paused",color:disconnectedGrey,backgroundColor:null},disconnected:{display:"Off",color:disconnectedGrey,backgroundColor:null},lost:{display:"Lost",color:lostRed,backgroundColor:null},NA:{display:"Not available",color:disconnectedGrey,backgroundColor:null}};function StateTypography(e){let{state:t,isDisabled:n=!1}=e;const r={color:n?disabledColor:stateDisplay[t].color,padding:"1px 10px",borderRadius:"16px",backgroundColor:stateDisplay[t].backgroundColor,display:"inline-block",fontWeight:500};return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{display:"block",gutterBottom:!0,sx:r,children:stateDisplay[t].display})}const StylizedCode=(0,_mui_material_styles__WEBPACK_IMPORTED_MODULE_18__.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_18__.Ay)("span")((e=>{let{theme:t}=e;return{width:"55px",display:"inline-block"}})),ManageDivider=(0,_mui_material_styles__WEBPACK_IMPORTED_MODULE_18__.Ay)(_mui_material_Divider__WEBPACK_IMPORTED_MODULE_19__.A)((e=>{let{theme:t}=e;return{marginTop:t.spacing(2),marginBottom:t.spacing(1.25)}})),RowOfUnitSettingDisplayBox=(0,_mui_material_styles__WEBPACK_IMPORTED_MODULE_18__.Ay)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_20__.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_16__.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_16__.jsx)("div",{children:t})},`simple-tabpanel-${r}`)}function UnitSettingDisplaySubtext(e){return e.subtext?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Chip__WEBPACK_IMPORTED_MODULE_21__.A,{size:"small",sx:{fontSize:"11px",wordBreak:"break-word",padding:"5px 0px"},label:e.subtext.replaceAll("_"," ")}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_20__.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_16__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(StateTypography,{state:t,isDisabled:!e.isUnitActive}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("br",{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.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_16__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div",{style:{fontSize:"13px"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(DisplaySettingsTable,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_components_UnderlineSpan__WEBPACK_IMPORTED_MODULE_10__.A,{title:o||null,children:"A"}),": ",n(r.A),"%"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(DisplaySettingsTable,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_components_UnderlineSpan__WEBPACK_IMPORTED_MODULE_10__.A,{title:a||null,children:"B"}),": ",n(r.B),"%"]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(DisplaySettingsTable,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_components_UnderlineSpan__WEBPACK_IMPORTED_MODULE_10__.A,{title:s||null,children:"C"}),": ",n(r.C),"%"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(DisplaySettingsTable,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_components_UnderlineSpan__WEBPACK_IMPORTED_MODULE_10__.A,{title:l||null,children:"D"}),": ",n(r.D),"%"]})]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(UnitSettingDisplaySubtext,{subtext:e.subtext})]})}return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div",{style:{color:disconnectedGrey,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_16__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div",{style:{fontSize:"13px"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(DisplaySettingsTable,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.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_16__.jsxs)(DisplaySettingsTable,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.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_16__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(DisplaySettingsTable,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.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_16__.jsxs)(DisplaySettingsTable,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.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_16__.jsx)(UnitSettingDisplaySubtext,{subtext:e.subtext})]})}return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div",{style:{color:disconnectedGrey,fontSize:"13px"},children:[" ",e.default," "]})}return e.isUnitActive&&"\u2014"!==t&&""!==t?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Chip__WEBPACK_IMPORTED_MODULE_21__.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_16__.jsx)(UnitSettingDisplaySubtext,{subtext:e.subtext})]}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div",{style:{color:disconnectedGrey,fontSize:"13px"},children:[" ",e.default," "]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.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_16__.jsxs)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_22__.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_16__.jsx)(_mui_icons_material_Clear__WEBPACK_IMPORTED_MODULE_23__.A,{fontSize:"15",sx:{verticalAlign:"middle",margin:"0px 3px"}})," Stop all activity"]})}function PioreactorHeader(e){let{unit:t,assignedExperiment:n,isActive:r}=e;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_20__.A,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_20__.A,{sx:{display:"flex",justifyContent:"space-between",mb:1},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{variant:"h5",component:"h1",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_20__.A,{sx:{display:"inline"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_22__.A,{to:"/pioreactors",component:react_router_dom__WEBPACK_IMPORTED_MODULE_24__.N_,sx:{textTransform:"none"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_icons_material_ArrowBack__WEBPACK_IMPORTED_MODULE_25__.A,{sx:{verticalAlign:"middle",mr:.5},fontSize:"small"})," Back to all Pioreactors"]})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_20__.A,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-start",flexFlow:"wrap"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(ButtonStopProcess,{experiment:n,unit:t})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Divider__WEBPACK_IMPORTED_MODULE_19__.A,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_20__.A,{sx:{m:"10px 2px 0px 2px",display:"flex",flexDirection:"row",justifyContent:"flex-start",flexFlow:"wrap"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{variant:"subtitle2",sx:{flexGrow:1},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_20__.A,{sx:{display:"inline"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_20__.A,{fontWeight:"fontWeightBold",sx:{display:"inline-block"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_icons_material_ScienceOutlined__WEBPACK_IMPORTED_MODULE_26__.A,{sx:{fontSize:14,verticalAlign:"-2px"}})," Experiment assigned:\xa0"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_20__.A,{fontWeight:"fontWeightRegular",sx:{mr:"1%",display:"inline-block"},children:n})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_20__.A,{sx:{display:"inline"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_20__.A,{fontWeight:"fontWeightBold",sx:{display:"inline-block"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_icons_material_ToggleOn__WEBPACK_IMPORTED_MODULE_27__.A,{sx:{fontSize:14,verticalAlign:"-2px"}})," Availability:\xa0"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_20__.A,{fontWeight:"fontWeightRegular",sx:{mr:"1%",display:"inline-block"},children:r?"Active":"Inactive"})]})]})})]})}function PatientButton(e){const[t,n]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(e.buttonText),[r,i]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null);(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)((()=>{n(e.buttonText)}),[e.buttonText]);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.Fragment,{children:[r&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("p",{style:{color:lostRed},children:r}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_22__.A,{disableElevation:!0,sx:{width:"70px",mt:"5px",height:"31px",mr:"3px"},color:e.color,variant:e.variant,disabled:e.disabled,size:"small",onClick:async()=>{i(null),n((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_CircularProgress__WEBPACK_IMPORTED_MODULE_28__.A,{color:"inherit",size:21}));try{await e.onClick(),setTimeout((()=>n(e.buttonText)),3e4)}catch(r){i(r.message),setTimeout((()=>n(e.buttonText)),1e4)}},children:t})]})}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=()=>{n(!1),setTimeout((()=>i(0)),200)};function a(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_16__.jsx)("div",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(PatientButton,{color:"primary",variant:"contained",buttonText:"Running",disabled:!0})});default:return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("div",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(PatientButton,{color:"primary",variant:"contained",onClick:()=>(0,_utilities__WEBPACK_IMPORTED_MODULE_29__.nU)(e.unit,e.experiment,n),buttonText:"Start",disabled:r})})}}const s="ready"===e.growthRateJobState,l=a(e.odBlankJobState,"od_blank",s),c=a(e.stirringCalibrationState,"stirring_calibration");return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_22__.A,{style:{textTransform:"none",float:"right"},color:"primary",disabled:e.disabled,onClick:()=>{n(!0)},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_icons_material_Tune__WEBPACK_IMPORTED_MODULE_30__.A,{color:e.disabled?"disabled":"primary",fontSize:"15",sx:{verticalAlign:"middle",margin:"0px 3px"}})," Calibrate"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_mui_material_Dialog__WEBPACK_IMPORTED_MODULE_31__.A,{open:t,onClose:o,"aria-labelledby":"form-dialog-title",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_mui_material_DialogTitle__WEBPACK_IMPORTED_MODULE_32__.A,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{sx:{fontSize:"13px",color:"rgba(0, 0, 0, 0.60)"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.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_16__.jsxs)(_mui_material_Tabs__WEBPACK_IMPORTED_MODULE_33__.A,{value:r,onChange:(e,t)=>{i(t)},indicatorColor:"primary",textColor:"primary",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Tab__WEBPACK_IMPORTED_MODULE_34__.A,{label:"Blanks"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Tab__WEBPACK_IMPORTED_MODULE_34__.A,{label:"Stirring"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Tab__WEBPACK_IMPORTED_MODULE_34__.A,{label:"Dosing"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Tab__WEBPACK_IMPORTED_MODULE_34__.A,{label:"OD600"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_IconButton__WEBPACK_IMPORTED_MODULE_35__.A,{"aria-label":"close",onClick:o,sx:{position:"absolute",right:8,top:8,color:e=>e.palette.grey[500]},size:"large",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_icons_material_Close__WEBPACK_IMPORTED_MODULE_36__.A,{})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_mui_material_DialogContent__WEBPACK_IMPORTED_MODULE_37__.A,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(TabPanel,{value:r,index:0,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{gutterBottom:!0,children:"Record optical densities of blank (optional)"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.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_16__.jsx)("i",{children:"un-inoculated"})," optical density ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("i",{children:"per experiment"}),". Read more about ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("a",{href:"https://docs.pioreactor.com/user-guide/od-normal-growth-rate#blanking",children:"using blanks"}),"."]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{variant:"body2",component:"p",style:{margin:"20px 0px"},children:["Recorded optical densities of blank vial: ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.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_16__.jsxs)("div",{style:{display:"flex"},children:[l,(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("div",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_22__.A,{size:"small",sx:{width:"70px",mt:"5px",height:"31px",mr:"3px"},color:"secondary",disabled:null===e.odBlankReading||s,onClick:()=>(0,_utilities__WEBPACK_IMPORTED_MODULE_29__.nU)(e.unit,e.experiment,"od_blank",["delete"]),children:" Clear "})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(ManageDivider,{})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(TabPanel,{value:r,index:1,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{gutterBottom:!0,children:"Stirring calibration (optional)"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{variant:"body2",component:"p",gutterBottom:!0,children:"You can improve the responsiveness of stirring RPM changes by running this calibration. This calibration is optional, and stirring RPM changes can still occur without running this calibration. Only needs to be performed once - results are saved to disk."}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{variant:"body2",component:"p",gutterBottom:!0,children:"Add a vial, with a stirbar and ~15ml of liquid, to the Pioreactor, then hit Start below. This calibration will take less than five minutes."}),c,(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(ManageDivider,{})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(TabPanel,{value:r,index:2,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{gutterBottom:!0,children:"Dosing calibration for pumps"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{variant:"body2",component:"p",gutterBottom:!0,children:"To use a peristatlic pump with your Pioreactor, you'll need to calibrate it to accuractly dose specific volumes."}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{variant:"body2",component:"p",gutterBottom:!0,children:["See instructions ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://docs.pioreactor.com/user-guide/hardware-calibrations#pump-calibration",children:"here"}),"."]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(ManageDivider,{})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(TabPanel,{value:r,index:3,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{gutterBottom:!0,children:"OD600 Calibration (optional)"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{variant:"body2",component:"p",gutterBottom:!0,children:"By performing the following calibration, you can relate Pioreactor's internal OD readings (measured in volts) to an offline OD600 value. The UI and datasets will be measured in your OD600 values instead of voltages."}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{variant:"body2",component:"p",gutterBottom:!0,children:["See instructions ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://docs.pioreactor.com/user-guide/calibrate-od600",children:"here"}),"."]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(ManageDivider,{})]})]})]})]})}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,v]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1);function b(e,t){return function(){w(e,"$state",t)}}function x(e){return b(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_16__.jsx)("div",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(PatientButton,{color:"primary",variant:"contained",onClick:()=>(0,_utilities__WEBPACK_IMPORTED_MODULE_29__.nU)(e.unit,e.experiment,n),buttonText:"Start"})},"patient_buttons_lost"+n);case"disconnected":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(PatientButton,{color:"primary",variant:"contained",onClick:()=>(0,_utilities__WEBPACK_IMPORTED_MODULE_29__.nU)(e.unit,e.experiment,n),buttonText:"Start"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(PatientButton,{color:"secondary",disabled:!0,buttonText:"Stop"})]},"patient_buttons_disconnected"+n);case"init":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(PatientButton,{color:"primary",variant:"contained",onClick:()=>!1,buttonText:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_CircularProgress__WEBPACK_IMPORTED_MODULE_28__.A,{color:"inherit",size:22}),disabled:!0}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(PatientButton,{color:"secondary",onClick:x(n),buttonText:"Stop"})]},"patient_buttons_init"+n);case"ready":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(PatientButton,{color:"secondary",variant:"contained",onClick:b(n,"sleeping"),buttonText:"Pause"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(PatientButton,{color:"secondary",onClick:x(n),buttonText:"Stop"})]},"patient_buttons_ready"+n);case"sleeping":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(PatientButton,{color:"primary",variant:"contained",onClick:b(n,"ready"),buttonText:"Resume"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(PatientButton,{color:"secondary",onClick:x(n),buttonText:"Stop"})]},"patient_buttons_sleeping"+n);default:return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("div",{},"patient_buttons_empty"+n)}}function S(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_16__.jsx)(SettingSwitchField,{...i});case"numeric":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(SettingNumericField,{...i});default:return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(SettingTextField,{...i})}}const j=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_38__.A)((e=>e.breakpoints.down("xl"))),I=e.jobs.dosing_automation,R=e.jobs.led_automation,L=e.jobs.temperature_automation;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_22__.A,{style:{textTransform:"none",float:"right"},disabled:e.disabled,onClick:()=>{r(!0)},color:"primary",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_icons_material_Settings__WEBPACK_IMPORTED_MODULE_39__.A,{color:e.disabled?"disabled":"primary",fontSize:"15",sx:{verticalAlign:"middle",margin:"0px 3px"}})," Manage"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_mui_material_Dialog__WEBPACK_IMPORTED_MODULE_31__.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_16__.jsxs)(_mui_material_DialogTitle__WEBPACK_IMPORTED_MODULE_32__.A,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{sx:{fontSize:"13px",color:"rgba(0, 0, 0, 0.60)"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_components_PioreactorIcon__WEBPACK_IMPORTED_MODULE_9__.A,{style:{verticalAlign:"middle",fontSize:"1.2em"}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("span",{children:[" ",e.label?`${e.label} / ${e.unit}`:`${e.unit}`," "]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_IconButton__WEBPACK_IMPORTED_MODULE_35__.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_16__.jsx)(_mui_icons_material_Close__WEBPACK_IMPORTED_MODULE_36__.A,{})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_mui_material_Tabs__WEBPACK_IMPORTED_MODULE_33__.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_16__.jsx)(_mui_material_Tab__WEBPACK_IMPORTED_MODULE_34__.A,{label:"Activities"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Tab__WEBPACK_IMPORTED_MODULE_34__.A,{label:"Settings"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Tab__WEBPACK_IMPORTED_MODULE_34__.A,{label:"Dosing"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Tab__WEBPACK_IMPORTED_MODULE_34__.A,{label:"LEDs"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Tab__WEBPACK_IMPORTED_MODULE_34__.A,{label:"System"})]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_mui_material_DialogContent__WEBPACK_IMPORTED_MODULE_37__.A,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.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_16__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div",{style:{justifyContent:"space-between",display:"flex"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{display:"block",children:n.metadata.display_name}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(StateTypography,{state:n.state})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.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_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{variant:"body2",component:"p",gutterBottom:!0,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("div",{dangerouslySetInnerHTML:{__html:n.metadata.description}})}),O[t],(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(ManageDivider,{})]},t)})),L&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div",{style:{justifyContent:"space-between",display:"flex"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{display:"block",children:"Temperature automation"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(StateTypography,{state:L.state})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("div",{children:"ready"===L.state||"sleeping"===L.state||"init"===L.state?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{variant:"body2",component:"p",gutterBottom:!0,children:["Currently running temperature automation ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Chip__WEBPACK_IMPORTED_MODULE_21__.A,{size:"small",label:L.publishedSettings.automation_name.value}),"."]}),O[L.metadata.key]]}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{variant:"body2",component:"p",gutterBottom:!0,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("span",{dangerouslySetInnerHTML:{__html:L.metadata.description}})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_22__.A,{sx:{width:"70px",mt:"5px",height:"31px",mr:"3px"},size:"small",color:"primary",variant:"contained",onClick:()=>v(!0),children:"Start"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_22__.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_16__.jsx)(_components_ChangeAutomationsDialog__WEBPACK_IMPORTED_MODULE_4__.A,{open:y,onFinished:()=>v(!1),unit:e.unit,label:e.label,experiment:e.experiment,automationType:"temperature",no_skip_first_run:!0})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(ManageDivider,{}),I&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div",{style:{justifyContent:"space-between",display:"flex"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{display:"block",children:"Dosing automation"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(StateTypography,{state:I.state})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("div",{children:"ready"===I.state||"sleeping"===I.state||"init"===L.state?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{variant:"body2",component:"p",gutterBottom:!0,children:["Currently running dosing automation ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Chip__WEBPACK_IMPORTED_MODULE_21__.A,{size:"small",label:I.publishedSettings.automation_name.value}),"."]}),O[I.metadata.key]]}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{variant:"body2",component:"p",gutterBottom:!0,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("span",{dangerouslySetInnerHTML:{__html:I.metadata.description}})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_22__.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_16__.jsx)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_22__.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_16__.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_16__.jsx)(ManageDivider,{}),R&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div",{style:{justifyContent:"space-between",display:"flex"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{display:"block",children:"LED automation"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(StateTypography,{state:R.state})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("div",{children:"ready"===R.state||"sleeping"===R.state||"init"===L.state?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{variant:"body2",component:"p",gutterBottom:!0,children:["Currently running LED automation ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Chip__WEBPACK_IMPORTED_MODULE_21__.A,{size:"small",label:R.publishedSettings.automation_name.value}),"."]}),O[R.metadata.key]]}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{variant:"body2",component:"p",gutterBottom:!0,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("span",{dangerouslySetInnerHTML:{__html:R.metadata.description}})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_22__.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_16__.jsx)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_22__.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_16__.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_16__.jsx)(ManageDivider,{})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(TabPanel,{value:l,index:1,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{gutterBottom:!0,children:"Assign temporary label to Pioreactor"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.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_16__.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_16__.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})).map(((e,t)=>{let[i,o]=e;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{gutterBottom:!0,children:o.label}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{variant:"body2",component:"p",children:o.description}),S(o,r,i,n),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(ManageDivider,{})]},i)}))}))]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(TabPanel,{value:l,index:2,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{gutterBottom:!0,children:"Cycle Media"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.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_16__.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_16__.jsx)(ManageDivider,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{gutterBottom:!0,children:"Cycle alternative media"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.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_16__.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_16__.jsx)(ManageDivider,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Alert__WEBPACK_IMPORTED_MODULE_40__.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_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{gutterBottom:!0,children:"Add media"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.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_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{variant:"body2",component:"p",children:"Specify how you\u2019d like to add media:"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.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_16__.jsx)(ManageDivider,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{gutterBottom:!0,children:"Remove waste"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.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_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{variant:"body2",component:"p",children:"Specify how you\u2019d like to remove waste:"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.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_16__.jsx)(ManageDivider,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{gutterBottom:!0,children:"Add alternative media"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.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_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{variant:"body2",component:"p",children:"Specify how you\u2019d like to add alt-media:"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.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_16__.jsx)(ManageDivider,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{gutterBottom:!0,children:"Manual adjustments"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.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."}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_components_ActionManualDosingForm__WEBPACK_IMPORTED_MODULE_6__.A,{unit:e.unit,experiment:e.experiment})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(TabPanel,{value:l,index:3,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{style:{textTransform:"capitalize"},children:j.A?j.A.replace("_"," ").replace("led","LED"):"Channel A"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{sx:{fontSize:"13px",color:"rgba(0, 0, 0, 0.60)"},color:"textSecondary",children:j.A?"Channel A":""}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_components_ActionLEDForm__WEBPACK_IMPORTED_MODULE_8__.A,{experiment:e.experiment,channel:"A",unit:e.unit}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(ManageDivider,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{style:{textTransform:"capitalize"},children:j.B?j.B.replace("_"," ").replace("led","LED"):"Channel B"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{sx:{fontSize:"13px",color:"rgba(0, 0, 0, 0.60)"},color:"textSecondary",children:j.B?"Channel B":""}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_components_ActionLEDForm__WEBPACK_IMPORTED_MODULE_8__.A,{experiment:e.experiment,channel:"B",unit:e.unit}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(ManageDivider,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{style:{textTransform:"capitalize"},children:j.C?j.C.replace("_"," ").replace("led","LED"):"Channel C"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{sx:{fontSize:"13px",color:"rgba(0, 0, 0, 0.60)"},color:"textSecondary",children:j.C?"Channel C":""}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_components_ActionLEDForm__WEBPACK_IMPORTED_MODULE_8__.A,{experiment:e.experiment,channel:"C",unit:e.unit}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(ManageDivider,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{style:{textTransform:"capitalize"},children:j.D?j.D.replace("_"," ").replace("led","LED"):"Channel D"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{sx:{fontSize:"13px",color:"rgba(0, 0, 0, 0.60)"},color:"textSecondary",children:j.D?"Channel D":""}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_components_ActionLEDForm__WEBPACK_IMPORTED_MODULE_8__.A,{experiment:e.experiment,channel:"D",unit:e.unit}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(ManageDivider,{})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(TabPanel,{value:l,index:4,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{gutterBottom:!0,children:"Addresses and hostname"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{variant:"body2",component:"p",gutterBottom:!0,children:["Learn about how to ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.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_16__.jsxs)("table",{style:{borderCollapse:"separate",borderSpacing:"5px",fontSize:"0.90rem"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("td",{style:{textAlign:"right",minWidth:"120px",color:""},children:"IPv4"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(StylizedCode,{children:P||"-"})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("td",{style:{textAlign:"right",minWidth:"120px",color:""},children:"Hostname"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(StylizedCode,{children:[e.unit,".local"]})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("td",{style:{textAlign:"right",minWidth:"120px",color:""},children:"WLAN MAC"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(StylizedCode,{children:M||"-"})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("td",{style:{textAlign:"right",minWidth:"120px",color:""},children:"Ethernet MAC"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(StylizedCode,{children:T||"-"})})]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(ManageDivider,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{gutterBottom:!0,children:"Version information"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("table",{style:{borderCollapse:"separate",borderSpacing:"5px",fontSize:"0.90rem"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("td",{style:{textAlign:"right",minWidth:"120px",color:""},children:"Pioreactor model"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.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_16__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("td",{style:{textAlign:"right",minWidth:"120px",color:""},children:"Software version"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(StylizedCode,{children:k.app||"-"})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("td",{style:{textAlign:"right",minWidth:"120px",color:""},children:"Raspberry Pi"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(StylizedCode,{children:k.rpi_machine||"-"})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("td",{style:{textAlign:"right",minWidth:"120px",color:""},children:"HAT version"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(StylizedCode,{children:k.hat||"-"})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("td",{style:{textAlign:"right",minWidth:"120px",color:""},children:"HAT serial number"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(StylizedCode,{children:k.hat_serial||"-"})})]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(ManageDivider,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{gutterBottom:!0,children:"Voltage on PWM rail"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("table",{style:{borderCollapse:"separate",borderSpacing:"5px",fontSize:"0.90rem"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("td",{style:{textAlign:"right",minWidth:"120px",color:""},children:"Voltage"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(StylizedCode,{children:C.voltage?`${C.voltage} V`:"-"})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("td",{style:{textAlign:"right",minWidth:"120px",color:""},children:"Last updated at"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.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_16__.jsx)(ManageDivider,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{gutterBottom:!0,children:"Reboot"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.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_16__.jsx)(_mui_lab_LoadingButton__WEBPACK_IMPORTED_MODULE_41__.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_16__.jsx)(ManageDivider,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.A,{gutterBottom:!0,children:"Shut down"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_17__.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_16__.jsx)(_mui_lab_LoadingButton__WEBPACK_IMPORTED_MODULE_41__.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_16__.jsx)(ManageDivider,{})]})]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_Snackbar__WEBPACK_IMPORTED_MODULE_42__.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_16__.jsxs)("div",{style:{display:"flex"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_TextField__WEBPACK_IMPORTED_MODULE_43__.A,{size:"small",autoComplete:"off",disabled:e.disabled,value:t,InputProps:{endAdornment:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_InputAdornment__WEBPACK_IMPORTED_MODULE_44__.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_16__.jsx)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_22__.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_16__.jsx)(_mui_material_Switch__WEBPACK_IMPORTED_MODULE_45__.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_16__.jsxs)("div",{style:{display:"flex"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_TextField__WEBPACK_IMPORTED_MODULE_43__.A,{type:"number",size:"small",autoComplete:"off",disabled:e.disabled,value:t,error:r,InputProps:{endAdornment:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_mui_material_InputAdornment__WEBPACK_IMPORTED_MODULE_44__.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_16__.jsx)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_22__.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_29__.yr)(s,n)}),[n]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("div",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.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_16__.jsxs)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_22__.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_16__.jsx)(_mui_icons_material_Flare__WEBPACK_IMPORTED_MODULE_46__.A,{color:e.disabled?"disabled":"primary",fontSize:"15",sx:{verticalAlign:"middle",margin:"0px 3px"}})," ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.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],b=Math.abs(m[1]-m[0])>Math.abs(v[1]-v[0])?m:v;return cr([d,p])?[new Date(b[0]),new Date(b[1])]:b},getScaledDomain:function(e,t,n){var r=nd(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=nd(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=nd(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=yr(e),i=r.x,o=r.y,a={x:t.scale.x.domain(n.x),y:t.scale.y.domain(n.y)};return br(t,a,i,o)},pan:function(e,t,n){var r,i=nd(e.map((function(e){return Number(e)})),2),o=i[0],a=i[1],s=nd(t.map((function(e){return Number(e)})),2),l=s[0],c=s[1],u=o+n,d=a+n;if(u>l&&d tm)if(g>im-tm)s.moveTo(f*Xh(h),f*Jh(h)),s.arc(0,0,f,h,m,!_),p>tm&&(s.moveTo(p*Xh(m),p*Jh(m)),s.arc(0,0,p,m,h,_));else{var y,v,b=h,x=m,w=h,A=m,E=g,S=g,j=a.apply(this,arguments)/2,O=j>tm&&(r?+r.apply(this,arguments):em(p*p+f*f)),k=Qh(Gh(f-p)/2,+n.apply(this,arguments)),C=k,P=k;if(O>tm){var M=om(O/p*Jh(j)),T=om(O/f*Jh(j));(E-=2*M)>tm?(w+=M*=_?1:-1,A-=M):(E=0,w=A=(h+m)/2),(S-=2*T)>tm?(b+=T*=_?1:-1,x-=T):(S=0,b=x=(h+m)/2)}var D=f*Xh(b),I=f*Jh(b),R=p*Xh(A),L=p*Jh(A);if(k>tm){var B,U=f*Xh(x),W=f*Jh(x),N=p*Xh(w),$=p*Jh(w);if(g 0&&(f+=d);for(null!=t?h.sort((function(e,n){return t(m[e],m[n])})):null!=n&&h.sort((function(e,t){return n(a[e],a[t])})),s=0,c=f?(_-p*v)/f:0;s 0?d*c:0)+v,m[l]={data:a[l],index:s,value:d,startAngle:g,endAngle:u,padAngle:y};return m}return a.value=function(t){return arguments.length?(e="function"===typeof t?t:Vh(+t),a):e},a.sortValues=function(e){return arguments.length?(t=e,n=null,a):t},a.sort=function(e){return arguments.length?(n=e,t=null,a):n},a.startAngle=function(e){return arguments.length?(r="function"===typeof e?e:Vh(+e),a):r},a.endAngle=function(e){return arguments.length?(i="function"===typeof e?e:Vh(+e),a):i},a.padAngle=function(e){return arguments.length?(o="function"===typeof e?e:Vh(+e),a):o},a}wm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var Mm=Dm(Am);function Tm(e){this._curve=e}function Dm(e){function t(t){return new Tm(e(t))}return t._curve=e,t}function Im(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(e){return arguments.length?t(Dm(e)):t()._curve},e}function Rm(){return Im(jm().curve(Mm))}function Lm(){var e=Om().curve(Mm),t=e.curve,n=e.lineX0,r=e.lineX1,i=e.lineY0,o=e.lineY1;return e.angle=e.x,delete e.x,e.startAngle=e.x0,delete e.x0,e.endAngle=e.x1,delete e.x1,e.radius=e.y,delete e.y,e.innerRadius=e.y0,delete e.y0,e.outerRadius=e.y1,delete e.y1,e.lineStartAngle=function(){return Im(n())},delete e.lineX0,e.lineEndAngle=function(){return Im(r())},delete e.lineX1,e.lineInnerRadius=function(){return Im(i())},delete e.lineY0,e.lineOuterRadius=function(){return Im(o())},delete e.lineY1,e.curve=function(e){return arguments.length?t(Dm(e)):t()._curve},e}function Bm(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}Tm.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};class Um{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}}class Wm{constructor(e){this._context=e}lineStart(){this._point=0}lineEnd(){}point(e,t){if(e=+e,t=+t,0===this._point)this._point=1;else{const n=Bm(this._x0,this._y0),r=Bm(this._x0,this._y0=(this._y0+t)/2),i=Bm(e,this._y0),o=Bm(e,t);this._context.moveTo(...n),this._context.bezierCurveTo(...r,...i,...o)}this._x0=e,this._y0=t}}function Nm(e){return new Um(e,!0)}function $m(e){return new Um(e,!1)}function zm(e){return new Wm(e)}function Fm(e){return e.source}function Km(e){return e.target}function Hm(e){let t=Fm,n=Km,r=Em,i=Sm,o=null,a=null,s=pm(l);function l(){let l;const c=bm.call(arguments),u=t.apply(this,c),d=n.apply(this,c);if(null==o&&(a=e(l=s())),a.lineStart(),c[0]=u,a.point(+r.apply(this,c),+i.apply(this,c)),c[0]=d,a.point(+r.apply(this,c),+i.apply(this,c)),a.lineEnd(),l)return a=null,l+""||null}return l.source=function(e){return arguments.length?(t=e,l):t},l.target=function(e){return arguments.length?(n=e,l):n},l.x=function(e){return arguments.length?(r="function"===typeof e?e:Vh(+e),l):r},l.y=function(e){return arguments.length?(i="function"===typeof e?e:Vh(+e),l):i},l.context=function(t){return arguments.length?(null==t?o=a=null:a=e(o=t),l):o},l}function qm(){return Hm(Nm)}function Vm(){return Hm($m)}function Gm(){const e=Hm(zm);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e}const Ym=em(3);var Xm={draw(e,t){const n=.59436*em(t+Qh(t/28,.75)),r=n/2,i=r*Ym;e.moveTo(0,n),e.lineTo(0,-n),e.moveTo(-i,-r),e.lineTo(i,r),e.moveTo(-i,r),e.lineTo(i,-r)}},Zm={draw(e,t){const n=em(t/nm);e.moveTo(n,0),e.arc(0,0,n,0,im)}},Qm={draw(e,t){const n=em(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}};const Jm=em(1/3),eg=2*Jm;var tg={draw(e,t){const n=em(t/eg),r=n*Jm;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},ng={draw(e,t){const n=.62625*em(t);e.moveTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.lineTo(-n,0),e.closePath()}},rg={draw(e,t){const n=.87559*em(t-Qh(t/7,2));e.moveTo(-n,0),e.lineTo(n,0),e.moveTo(0,n),e.lineTo(0,-n)}},ig={draw(e,t){const n=em(t),r=-n/2;e.rect(r,r,n,n)}},og={draw(e,t){const n=.4431*em(t);e.moveTo(n,n),e.lineTo(n,-n),e.lineTo(-n,-n),e.lineTo(-n,n),e.closePath()}};const ag=Jh(nm/10)/Jh(7*nm/10),sg=Jh(im/10)*ag,lg=-Xh(im/10)*ag;var cg={draw(e,t){const n=em(.8908130915292852*t),r=sg*n,i=lg*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){const t=im*o/5,a=Xh(t),s=Jh(t);e.lineTo(s*n,-a*n),e.lineTo(a*r-s*i,s*r+a*i)}e.closePath()}};const ug=em(3);var dg={draw(e,t){const n=-em(t/(3*ug));e.moveTo(0,2*n),e.lineTo(-ug*n,-n),e.lineTo(ug*n,-n),e.closePath()}};const pg=em(3);var fg={draw(e,t){const n=.6824*em(t),r=n/2,i=n*pg/2;e.moveTo(0,-n),e.lineTo(i,r),e.lineTo(-i,r),e.closePath()}};const hg=-.5,mg=em(3)/2,gg=1/em(12),_g=3*(gg/2+1);var yg={draw(e,t){const n=em(t/_g),r=n/2,i=n*gg,o=r,a=n*gg+n,s=-o,l=a;e.moveTo(r,i),e.lineTo(o,a),e.lineTo(s,l),e.lineTo(hg*r-mg*i,mg*r+hg*i),e.lineTo(hg*o-mg*a,mg*o+hg*a),e.lineTo(hg*s-mg*l,mg*s+hg*l),e.lineTo(hg*r+mg*i,hg*i-mg*r),e.lineTo(hg*o+mg*a,hg*a-mg*o),e.lineTo(hg*s+mg*l,hg*l-mg*s),e.closePath()}},vg={draw(e,t){const n=.6189*em(t-Qh(t/6,1.7));e.moveTo(-n,-n),e.lineTo(n,n),e.moveTo(-n,n),e.lineTo(n,-n)}};const bg=[Zm,Qm,tg,ig,cg,dg,yg],xg=[Zm,rg,vg,fg,Xm,og,ng];function wg(e,t){let n=null,r=pm(i);function i(){let i;if(n||(n=i=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return e="function"===typeof e?e:Vh(e||Zm),t="function"===typeof t?t:Vh(void 0===t?64:+t),i.type=function(t){return arguments.length?(e="function"===typeof t?t:Vh(t),i):e},i.size=function(e){return arguments.length?(t="function"===typeof e?e:Vh(+e),i):t},i.context=function(e){return arguments.length?(n=null==e?null:e,i):n},i}function Ag(){}function Eg(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Sg(e){this._context=e}function jg(e){return new Sg(e)}function Og(e){this._context=e}function kg(e){return new Og(e)}function Cg(e){this._context=e}function Pg(e){return new Cg(e)}function Mg(e,t){this._basis=new Sg(e),this._beta=t}Sg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Eg(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Eg(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},Og.prototype={areaStart:Ag,areaEnd:Ag,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Eg(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},Cg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Eg(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},Mg.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r,i=e[0],o=t[0],a=e[n]-i,s=t[n]-o,l=-1;++l<=n;)r=l/n,this._basis.point(this._beta*e[l]+(1-this._beta)*(i+r*a),this._beta*t[l]+(1-this._beta)*(o+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var Tg=function e(t){function n(e){return 1===t?new Sg(e):new Mg(e,t)}return n.beta=function(t){return e(+t)},n}(.85);function Dg(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Ig(e,t){this._context=e,this._k=(1-t)/6}Ig.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Dg(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Dg(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Rg=function e(t){function n(e){return new Ig(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Lg(e,t){this._context=e,this._k=(1-t)/6}Lg.prototype={areaStart:Ag,areaEnd:Ag,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Dg(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Bg=function e(t){function n(e){return new Lg(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Ug(e,t){this._context=e,this._k=(1-t)/6}Ug.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Dg(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Wg=function e(t){function n(e){return new Ug(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Ng(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>tm){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>tm){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,o,a,e._x2,e._y2)}function $g(e,t){this._context=e,this._alpha=t}$g.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Ng(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var zg=function e(t){function n(e){return t?new $g(e,t):new Ig(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Fg(e,t){this._context=e,this._alpha=t}Fg.prototype={areaStart:Ag,areaEnd:Ag,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Ng(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Kg=function e(t){function n(e){return t?new Fg(e,t):new Lg(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Hg(e,t){this._context=e,this._alpha=t}Hg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ng(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var qg=function e(t){function n(e){return t?new Hg(e,t):new Ug(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Vg(e){this._context=e}function Gg(e){return new Vg(e)}function Yg(e){return e<0?-1:1}function Xg(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(Yg(o)+Yg(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Zg(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Qg(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function Jg(e){this._context=e}function e_(e){this._context=new t_(e)}function t_(e){this._context=e}function n_(e){return new Jg(e)}function r_(e){return new e_(e)}function i_(e){this._context=e}function o_(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],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}},qt.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},qt.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