@opentrons/step-generation 0.3.0-alpha.0 → 0.3.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/commandCreators/atomic/__tests__/vacuumCloseVent.test.d.ts +1 -0
- package/lib/commandCreators/atomic/__tests__/vacuumOpenVent.test.d.ts +1 -0
- package/lib/commandCreators/atomic/__tests__/vacuumSetPumpPower.test.d.ts +1 -0
- package/lib/commandCreators/atomic/__tests__/vacuumSetPumpPressure.test.d.ts +1 -0
- package/lib/commandCreators/atomic/__tests__/vacuumStartRunProfile.test.d.ts +1 -0
- package/lib/commandCreators/atomic/__tests__/vacuumStopPump.test.d.ts +1 -0
- package/lib/commandCreators/atomic/index.d.ts +6 -0
- package/lib/commandCreators/atomic/vacuumCloseVent.d.ts +2 -0
- package/lib/commandCreators/atomic/vacuumOpenVent.d.ts +3 -0
- package/lib/commandCreators/atomic/vacuumSetPumpPower.d.ts +2 -0
- package/lib/commandCreators/atomic/vacuumSetPumpPressure.d.ts +2 -0
- package/lib/commandCreators/atomic/vacuumStartRunProfile.d.ts +3 -0
- package/lib/commandCreators/atomic/vacuumStopPump.d.ts +3 -0
- package/lib/commandCreators/index.d.ts +1 -1
- package/lib/constants.d.ts +4 -1
- package/lib/errorCreators.d.ts +3 -0
- package/lib/getNextRobotStateAndWarnings/__tests__/forSetTipState.test.d.ts +1 -0
- package/lib/getNextRobotStateAndWarnings/__tests__/vacuumUpdates.test.d.ts +1 -0
- package/lib/getNextRobotStateAndWarnings/forSetTipState.d.ts +3 -0
- package/lib/getNextRobotStateAndWarnings/forWaitForTasks.d.ts +2 -1
- package/lib/getNextRobotStateAndWarnings/thermocyclerUpdates.d.ts +2 -2
- package/lib/getNextRobotStateAndWarnings/vacuumUpdates.d.ts +9 -0
- package/lib/index.cjs +107 -162
- package/lib/index.d.ts +1 -1
- package/lib/index.mjs +7421 -9903
- package/lib/types.d.ts +110 -15
- package/lib/utils/__tests__/getModuleHasLiveTask.test.d.ts +1 -0
- package/lib/utils/__tests__/getPipetteCriticalPoint.test.d.ts +1 -0
- package/lib/utils/getModuleHasLiveTask.d.ts +2 -0
- package/lib/utils/getPipetteCriticalPoint.d.ts +3 -0
- package/lib/utils/index.d.ts +2 -1
- package/lib/utils/safePipetteMovements.d.ts +3 -7
- package/lib/utils/vacuumPythonArgs/__tests__/getVacuumProfileStepString.test.d.ts +1 -0
- package/lib/utils/vacuumPythonArgs/__tests__/getVacuumPumpHoldArgsPython.test.d.ts +1 -0
- package/lib/utils/vacuumPythonArgs/getVacuumProfileStepString.d.ts +2 -0
- package/lib/utils/vacuumPythonArgs/getVacuumPumpHoldArgsPython.d.ts +1 -0
- package/package.json +3 -3
package/lib/index.cjs
CHANGED
|
@@ -1,197 +1,142 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("@opentrons/shared-data");function W_(){return{type:"INSUFFICIENT_TIPS",message:"Not enough tips to complete action"}}function Y_(){return{type:"MISSING_96_CHANNEL_TIPRACK_ADAPTER",message:"A 96-channel cannot pick up tips fully without an adapter"}}function K_(){return{type:"REMOVE_96_CHANNEL_TIPRACK_ADAPTER",message:"A 96-channel cannot pick up tips partially with an adapter"}}function Ft(e){const{actionName:t,pipette:r,labware:n,well:a}=e;return{message:n==null||a==null?`Attempted to ${t} with no tip on pipette: ${r} in place`:`Attempted to ${t} with no tip on pipette: ${r} from ${n}'s well ${a}`,type:"NO_TIP_ON_PIPETTE"}}function X_(){return{message:"One or more of the pipettes has a tip",type:"PIPETTE_HAS_TIP"}}function ft(e){const{pipette:t}=e;return{message:`This step tries to use the ${t}. Add the pipette to your protocol or change the step to use a different pipette.`,type:"PIPETTE_DOES_NOT_EXIST"}}function dt(e){const{actionName:t,labware:r}=e;return console.warn(`Attempted to ${t} with labware id "${r}", this labware was not found under "labware"`),{message:`This step tries to use ${r}. Add the labware to your protocol or change the step to use a different labware.`,type:"LABWARE_DOES_NOT_EXIST"}}function ke(){return{message:"This step requires a module, but none is selected",type:"MISSING_MODULE"}}function Z_(){return{message:"This module is not changing temperature because it has either been deactivated or is already holding a temperature. In order to pause the protocol and wait for your module to reach a temperature, you must first use a Temperature step to tell the module to start changing to a new temperature",type:"MISSING_TEMPERATURE_STEP"}}function Kp(){return{message:"This module is not currently running a profile.",type:"MISSING_PROFILE_STEP"}}function J_(e){const{volume:t,maxVolume:r,actionName:n}=e;return{message:`This step tries to ${n} ${t}µL, but the tip can only hold ${r}µL.`,type:"TIP_VOLUME_EXCEEDED"}}function Xa(e){const{actionName:t,volume:r,maxVolume:n,disposalVolume:a}=e;return{message:a!=null?`Attemped to ${t} volume + disposal volume greater than pipette max volume (${r} + ${a} > ${n})`:`This step tries to ${t} ${r}µL, but the tip can only hold ${n}µL.`,type:"PIPETTE_VOLUME_EXCEEDED"}}const Q_=()=>({type:"MOVE_LOCATION_NOT_SPECIFIED",message:"This step is missing a move location."}),ca=()=>({type:"MODULE_PIPETTE_COLLISION_DANGER",message:"Gen 1 8-Channel pipettes cannot access labware or tip racks in slot 4 or 6 because they are adjacent to modules."}),eT=()=>({type:"THERMOCYCLER_BUSY_WITH_PROFILE",message:"This step cannot run while the Thermocycler is running a profile. Move the step outside the profile."}),cn=()=>({type:"THERMOCYCLER_LID_CLOSED",message:"Attempted to interact with contents of a thermocycler with the lid closed."}),eo=()=>({type:"HEATER_SHAKER_LATCH_OPEN",message:"Attempted to interact with contents of a heater-shaker with the latch open."}),Xp=()=>({type:"HEATER_SHAKER_LATCH_CLOSED",message:"Attempted to move the contents of a heater-shaker with the latch closed."}),kr=()=>({type:"ABSORBANCE_READER_LID_CLOSED",message:"Attempted to interact with contents of an absorbance plate reader with the lid closed."}),tT=()=>({type:"ABSORBANCE_READER_NO_INITIALIZATION",message:"This step tries to read labware without initializing the Plate Reader first. Initialize the Plate Reader module or remove this step in order to proceed."}),cb=()=>({type:"ABSORBANCE_READER_NO_GRIPPER",message:"This step involves opening or closing the Absorbance Plate Reader lid with a gripper. Add a gripper or remove step to proceed."}),rT=()=>({type:"HOPPER_EMPTY",message:"Cannot retrieve labware from empty stacker"}),nT=()=>({type:"SHUTTLE_FULL",message:"Shuttle must be empty in order to retrieve labware from the stacker"}),aT=()=>({type:"SHUTTLE_EMPTY",message:"Shuttle must have labware in order to store it in the stacker"}),pb=()=>({type:"MISMATCHED_STACKER_LABWARE_TYPE",message:"The stacker can only store a single type of labware at a time"}),oT=()=>({type:"MISSING_STACKER_LABWARE_TYPE",message:"Add labware to the stacker in the starting deck so that you can refill it later"}),fb=()=>({type:"HOPPER_FULL",message:"The hopper has reached capacity"}),pn=()=>({type:"HEATER_SHAKER_IS_SHAKING",message:"Attempted to interact with the contents of a heater-shaker when it is shaking."}),iT=e=>({type:"TALL_LABWARE_EAST_WEST_OF_HEATER_SHAKER",message:`Labware over 53 mm is ${e} of this Heater-Shaker module.`}),Mr=()=>({type:"POSSIBLE_PIPETTE_COLLISION",message:"There is a possibility that the Pipette will collide with the a labware or module on the deck"}),pa=()=>({type:"HEATER_SHAKER_EAST_WEST_LATCH_OPEN",message:"The Heater-Shaker labware latch is open"}),fa=()=>({type:"HEATER_SHAKER_NORTH_SOUTH_EAST_WEST_SHAKING",message:"The Heater-Shaker is shaking"}),da=()=>({type:"HEATER_SHAKER_EAST_WEST_MULTI_CHANNEL",message:"The Heater-Shaker is shaking"}),to=()=>({type:"HEATER_SHAKER_NORTH_SOUTH__OF_NON_TIPRACK_WITH_MULTI_CHANNEL",message:"8-Channel pipette cannot access labware"}),fn=()=>({type:"LABWARE_OFF_DECK",message:"Attempted to interact with labware off deck"}),sT=()=>({type:"LABWARE_ON_ANOTHER_ENTITY",message:"Attempted to move labware onto another entity with the same slotName"}),yn=()=>({type:"DROP_TIP_LOCATION_DOES_NOT_EXIST",message:"The destination for dropping tip does not exist"}),db=()=>({type:"EQUIPMENT_DOES_NOT_EXIST",message:"Equipment does not exist."}),lT=()=>({type:"GRIPPER_REQUIRED",message:"The gripper is required to fulfill this action"}),Dt=e=>({type:"PIPETTING_INTO_COLUMN_4",message:`Cannot ${e.typeOfStep} into a column 4 slot.`}),uT=()=>({type:"CANNOT_MOVE_WITH_GRIPPER",message:"The gripper cannot move aluminum blocks"}),cT=()=>({type:"NO_TIP_SELECTED",message:"No tips were selected for this step"}),ma=()=>({type:"LABWARE_DISCARDED_IN_TRASH",message:"The labware was discarded in trash in a previous step."}),mb=()=>({type:"SUBMERGE_BELOW_ASPIRATE",message:"The submerge position must be above the aspirate position"}),hb=()=>({type:"RETRACT_BELOW_ASPIRATE",message:"The retract position must be above the aspirate position"}),pT=()=>({type:"SUBMERGE_BELOW_DISPENSE",message:"The submerge position must be above the dispense position"}),fT=()=>({type:"RETRACT_BELOW_DISPENSE",message:"The retract position must be above the dispense position"}),dT=()=>({type:"MULTI_ASPIRATE_VOLUME_TOO_HIGH",message:"Consolidate pipette path was selected but cannot fit volume for more than 1 well in the tip"}),mT=()=>({type:"MULTI_DISPENSE_VOLUME_TOO_HIGH",message:"Distribute pipette path was selected but cannot fit volume for more than 1 well in the tip"}),hT=e=>({type:"CLOSING_THERMOCYCLER_WITH_INVALID_LABWARE_LID",message:`Closing the Thermocycler lid with ${e.lidDisplayName} in place will cause damage`}),Zp=()=>({type:"RETURN_TIP_UNAVAILABLE",message:"Current tip does not have a known location to return to"}),yT=()=>({type:"TIPRACK_LID_NOT_ALLOWED_ON_DECK",message:"The tip rack lid is not supported directly on the deck"}),bT=()=>({type:"NEXT_TIPRACK_HAS_LID",message:"A pipette cannot pick up tips from a tip rack with a lid"}),gT=e=>({type:"STACK_TOO_HIGH",message:`The stack on slot ${e.slot} is too high`}),_T=()=>({type:"TOO_MANY_TIPS",message:"Action will pick up too many tips"}),TT=()=>({type:"INCOMPLETE_PICKUP",message:"At least one of the selected tips is empty"}),ET=()=>({type:"LABWARE_ON_HOPPER",message:"Labware cannot be moved from the Flex Stacker Hopper"});function Ye(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Do,Jp;function yb(){if(Jp)return Do;Jp=1;var e=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis;return Do=e,Do}var qo,Qp;function Mt(){if(Qp)return qo;Qp=1;var e=yb(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return qo=r,qo}var Fo,ef;function bn(){if(ef)return Fo;ef=1;var e=Mt(),t=e.Symbol;return Fo=t,Fo}var Mo,tf;function wT(){if(tf)return Mo;tf=1;var e=bn(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,a=e?e.toStringTag:void 0;function o(i){var s=r.call(i,a),l=i[a];try{i[a]=void 0;var u=!0}catch{}var c=n.call(i);return u&&(s?i[a]=l:delete i[a]),c}return Mo=o,Mo}var Uo,rf;function IT(){if(rf)return Uo;rf=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return Uo=r,Uo}var Bo,nf;function gn(){if(nf)return Bo;nf=1;var e=bn(),t=wT(),r=IT(),n="[object Null]",a="[object Undefined]",o=e?e.toStringTag:void 0;function i(s){return s==null?s===void 0?a:n:o&&o in Object(s)?t(s):r(s)}return Bo=i,Bo}var jo,af;function Kt(){if(af)return jo;af=1;function e(t){return t!=null&&typeof t=="object"}return jo=e,jo}var $o,of;function ha(){if(of)return $o;of=1;var e=gn(),t=Kt(),r="[object Symbol]";function n(a){return typeof a=="symbol"||t(a)&&e(a)==r}return $o=n,$o}var xo,sf;function bb(){if(sf)return xo;sf=1;var e=ha();function t(r,n,a){for(var o=-1,i=r.length;++o<i;){var s=r[o],l=n(s);if(l!=null&&(u===void 0?l===l&&!e(l):a(l,u)))var u=l,c=s}return c}return xo=t,xo}var Vo,lf;function ST(){if(lf)return Vo;lf=1;function e(t,r){return t<r}return Vo=e,Vo}var Ho,uf;function ya(){if(uf)return Ho;uf=1;function e(t){return t}return Ho=e,Ho}var Go,cf;function AT(){if(cf)return Go;cf=1;var e=bb(),t=ST(),r=ya();function n(a){return a&&a.length?e(a,r,t):void 0}return Go=n,Go}var OT=AT();const vT=Ye(OT),ba="TEMPERATURE_DEACTIVATED",Zc="TEMPERATURE_AT_TARGET",Jc="TEMPERATURE_APPROACHING_TARGET",Dc=1,gb=[f.MAGNETIC_MODULE_V1,f.TEMPERATURE_MODULE_V1],qc="fixedTrash",_b={type:f.MAGNETIC_MODULE_TYPE,engaged:!1},Tb={type:f.TEMPERATURE_MODULE_TYPE,status:ba,targetTemperature:null},Eb={type:f.THERMOCYCLER_MODULE_TYPE,currentBlockActivity:{type:"blockDeactivated"},lidTargetTemp:null,lidOpen:null,numProfilesStarted:0},wb={type:f.HEATERSHAKER_MODULE_TYPE,targetTemp:null,targetSpeed:null,latchOpen:null},Ib={type:"absorbanceReaderType",lidOpen:null,initialization:null},Sb={type:"magneticBlockType"},Ab={type:f.FLEX_STACKER_MODULE_TYPE,storedLabwareDetails:null,labwareInHopper:null,labwareOnShuttle:null,setStoredLabwareCount:1,fillCount:1},Ob={type:f.VACUUM_MODULE_TYPE,vacuumState:null,ventStatus:null},vb={[f.MAGNETIC_MODULE_TYPE]:_b,[f.TEMPERATURE_MODULE_TYPE]:Tb,[f.THERMOCYCLER_MODULE_TYPE]:Eb,[f.HEATERSHAKER_MODULE_TYPE]:wb,[f.ABSORBANCE_READER_TYPE]:Ib,[f.MAGNETIC_BLOCK_TYPE]:Sb,[f.FLEX_STACKER_MODULE_TYPE]:Ab,[f.VACUUM_MODULE_TYPE]:Ob},LT="opentrons/opentrons_1_trash_1100ml_fixed/1",RT="opentrons/opentrons_1_trash_3200ml_fixed/1",We=["A4","B4","C4","D4"],Et={x:0,y:0,z:0},Lb="mounted",ro="CLEAN",lr="DIRTY",Pe="EMPTY",Qc="automatic",wt="manual",Rb=["A4","B4","C4","D4"],Pb=["7","8","10","11"],Je="hopper",kb=["hopperA4","hopperB4","hopperC4","hopperD4"],Nb={hopperA4:"A4",hopperB4:"B4",hopperC4:"C4",hopperD4:"D4"},Gt=["adapterLabwareId","primaryLabwareId","lidLabwareId"],PT=["adapterLabwareURI","primaryLabwareURI","lidLabwareURI"],kT={A4:"hopperA4",B4:"hopperB4",C4:"hopperC4",D4:"hopperD4"},NT="open",CT="closed",DT="power",qT="pressure",FT="state",MT="profile",UT="pump",BT="vent",jT="open",$T="closed",xT=.1,VT=1e3;var Ha={exports:{}},pf;function HT(){if(pf)return Ha.exports;pf=1;var e=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof window.msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto);if(e){var t=new Uint8Array(16);Ha.exports=function(){return e(t),t}}else{var r=new Array(16);Ha.exports=function(){for(var a=0,o;a<16;a++)(a&3)===0&&(o=Math.random()*4294967296),r[a]=o>>>((a&3)<<3)&255;return r}}return Ha.exports}var zo,ff;function GT(){if(ff)return zo;ff=1;for(var e=[],t=0;t<256;++t)e[t]=(t+256).toString(16).substr(1);function r(n,a){var o=a||0,i=e;return[i[n[o++]],i[n[o++]],i[n[o++]],i[n[o++]],"-",i[n[o++]],i[n[o++]],"-",i[n[o++]],i[n[o++]],"-",i[n[o++]],i[n[o++]],"-",i[n[o++]],i[n[o++]],i[n[o++]],i[n[o++]],i[n[o++]],i[n[o++]]].join("")}return zo=r,zo}var Wo,df;function zT(){if(df)return Wo;df=1;var e=HT(),t=GT();function r(n,a,o){var i=a&&o||0;typeof n=="string"&&(a=n==="binary"?new Array(16):null,n=null),n=n||{};var s=n.random||(n.rng||e)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,a)for(var l=0;l<16;++l)a[i+l]=s[l];return a||t(s)}return Wo=r,Wo}var WT=zT();const YT=Ye(WT);var Yo,mf;function ep(){if(mf)return Yo;mf=1;function e(t,r){for(var n=-1,a=r.length,o=t.length;++n<a;)t[o+n]=r[n];return t}return Yo=e,Yo}var Ko,hf;function KT(){if(hf)return Ko;hf=1;var e=gn(),t=Kt(),r="[object Arguments]";function n(a){return t(a)&&e(a)==r}return Ko=n,Ko}var Xo,yf;function no(){if(yf)return Xo;yf=1;var e=KT(),t=Kt(),r=Object.prototype,n=r.hasOwnProperty,a=r.propertyIsEnumerable,o=e(function(){return arguments}())?e:function(i){return t(i)&&n.call(i,"callee")&&!a.call(i,"callee")};return Xo=o,Xo}var Zo,bf;function tt(){if(bf)return Zo;bf=1;var e=Array.isArray;return Zo=e,Zo}var Jo,gf;function XT(){if(gf)return Jo;gf=1;var e=bn(),t=no(),r=tt(),n=e?e.isConcatSpreadable:void 0;function a(o){return r(o)||t(o)||!!(n&&o&&o[n])}return Jo=a,Jo}var Qo,_f;function Cb(){if(_f)return Qo;_f=1;var e=ep(),t=XT();function r(n,a,o,i,s){var l=-1,u=n.length;for(o||(o=t),s||(s=[]);++l<u;){var c=n[l];a>0&&o(c)?a>1?r(c,a-1,o,i,s):e(s,c):i||(s[s.length]=c)}return s}return Qo=r,Qo}var ei,Tf;function ga(){if(Tf)return ei;Tf=1;function e(t,r){for(var n=-1,a=t==null?0:t.length,o=Array(a);++n<a;)o[n]=r(t[n],n,t);return o}return ei=e,ei}var ti,Ef;function ZT(){if(Ef)return ti;Ef=1;function e(){this.__data__=[],this.size=0}return ti=e,ti}var ri,wf;function ao(){if(wf)return ri;wf=1;function e(t,r){return t===r||t!==t&&r!==r}return ri=e,ri}var ni,If;function oo(){if(If)return ni;If=1;var e=ao();function t(r,n){for(var a=r.length;a--;)if(e(r[a][0],n))return a;return-1}return ni=t,ni}var ai,Sf;function JT(){if(Sf)return ai;Sf=1;var e=oo(),t=Array.prototype,r=t.splice;function n(a){var o=this.__data__,i=e(o,a);if(i<0)return!1;var s=o.length-1;return i==s?o.pop():r.call(o,i,1),--this.size,!0}return ai=n,ai}var oi,Af;function QT(){if(Af)return oi;Af=1;var e=oo();function t(r){var n=this.__data__,a=e(n,r);return a<0?void 0:n[a][1]}return oi=t,oi}var ii,Of;function eE(){if(Of)return ii;Of=1;var e=oo();function t(r){return e(this.__data__,r)>-1}return ii=t,ii}var si,vf;function tE(){if(vf)return si;vf=1;var e=oo();function t(r,n){var a=this.__data__,o=e(a,r);return o<0?(++this.size,a.push([r,n])):a[o][1]=n,this}return si=t,si}var li,Lf;function io(){if(Lf)return li;Lf=1;var e=ZT(),t=JT(),r=QT(),n=eE(),a=tE();function o(i){var s=-1,l=i==null?0:i.length;for(this.clear();++s<l;){var u=i[s];this.set(u[0],u[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=r,o.prototype.has=n,o.prototype.set=a,li=o,li}var ui,Rf;function rE(){if(Rf)return ui;Rf=1;var e=io();function t(){this.__data__=new e,this.size=0}return ui=t,ui}var ci,Pf;function nE(){if(Pf)return ci;Pf=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return ci=e,ci}var pi,kf;function aE(){if(kf)return pi;kf=1;function e(t){return this.__data__.get(t)}return pi=e,pi}var fi,Nf;function oE(){if(Nf)return fi;Nf=1;function e(t){return this.__data__.has(t)}return fi=e,fi}var di,Cf;function Xt(){if(Cf)return di;Cf=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return di=e,di}var mi,Df;function Db(){if(Df)return mi;Df=1;var e=gn(),t=Xt(),r="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",o="[object Proxy]";function i(s){if(!t(s))return!1;var l=e(s);return l==n||l==a||l==r||l==o}return mi=i,mi}var hi,qf;function iE(){if(qf)return hi;qf=1;var e=Mt(),t=e["__core-js_shared__"];return hi=t,hi}var yi,Ff;function sE(){if(Ff)return yi;Ff=1;var e=iE(),t=function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function r(n){return!!t&&t in n}return yi=r,yi}var bi,Mf;function qb(){if(Mf)return bi;Mf=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return bi=r,bi}var gi,Uf;function lE(){if(Uf)return gi;Uf=1;var e=Db(),t=sE(),r=Xt(),n=qb(),a=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,i=Function.prototype,s=Object.prototype,l=i.toString,u=s.hasOwnProperty,c=RegExp("^"+l.call(u).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(d){if(!r(d)||t(d))return!1;var y=e(d)?c:o;return y.test(n(d))}return gi=p,gi}var _i,Bf;function uE(){if(Bf)return _i;Bf=1;function e(t,r){return t?.[r]}return _i=e,_i}var Ti,jf;function Ur(){if(jf)return Ti;jf=1;var e=lE(),t=uE();function r(n,a){var o=t(n,a);return e(o)?o:void 0}return Ti=r,Ti}var Ei,$f;function tp(){if($f)return Ei;$f=1;var e=Ur(),t=Mt(),r=e(t,"Map");return Ei=r,Ei}var wi,xf;function so(){if(xf)return wi;xf=1;var e=Ur(),t=e(Object,"create");return wi=t,wi}var Ii,Vf;function cE(){if(Vf)return Ii;Vf=1;var e=so();function t(){this.__data__=e?e(null):{},this.size=0}return Ii=t,Ii}var Si,Hf;function pE(){if(Hf)return Si;Hf=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return Si=e,Si}var Ai,Gf;function fE(){if(Gf)return Ai;Gf=1;var e=so(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function a(o){var i=this.__data__;if(e){var s=i[o];return s===t?void 0:s}return n.call(i,o)?i[o]:void 0}return Ai=a,Ai}var Oi,zf;function dE(){if(zf)return Oi;zf=1;var e=so(),t=Object.prototype,r=t.hasOwnProperty;function n(a){var o=this.__data__;return e?o[a]!==void 0:r.call(o,a)}return Oi=n,Oi}var vi,Wf;function mE(){if(Wf)return vi;Wf=1;var e=so(),t="__lodash_hash_undefined__";function r(n,a){var o=this.__data__;return this.size+=this.has(n)?0:1,o[n]=e&&a===void 0?t:a,this}return vi=r,vi}var Li,Yf;function hE(){if(Yf)return Li;Yf=1;var e=cE(),t=pE(),r=fE(),n=dE(),a=mE();function o(i){var s=-1,l=i==null?0:i.length;for(this.clear();++s<l;){var u=i[s];this.set(u[0],u[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=r,o.prototype.has=n,o.prototype.set=a,Li=o,Li}var Ri,Kf;function yE(){if(Kf)return Ri;Kf=1;var e=hE(),t=io(),r=tp();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return Ri=n,Ri}var Pi,Xf;function bE(){if(Xf)return Pi;Xf=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return Pi=e,Pi}var ki,Zf;function lo(){if(Zf)return ki;Zf=1;var e=bE();function t(r,n){var a=r.__data__;return e(n)?a[typeof n=="string"?"string":"hash"]:a.map}return ki=t,ki}var Ni,Jf;function gE(){if(Jf)return Ni;Jf=1;var e=lo();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return Ni=t,Ni}var Ci,Qf;function _E(){if(Qf)return Ci;Qf=1;var e=lo();function t(r){return e(this,r).get(r)}return Ci=t,Ci}var Di,ed;function TE(){if(ed)return Di;ed=1;var e=lo();function t(r){return e(this,r).has(r)}return Di=t,Di}var qi,td;function EE(){if(td)return qi;td=1;var e=lo();function t(r,n){var a=e(this,r),o=a.size;return a.set(r,n),this.size+=a.size==o?0:1,this}return qi=t,qi}var Fi,rd;function rp(){if(rd)return Fi;rd=1;var e=yE(),t=gE(),r=_E(),n=TE(),a=EE();function o(i){var s=-1,l=i==null?0:i.length;for(this.clear();++s<l;){var u=i[s];this.set(u[0],u[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=r,o.prototype.has=n,o.prototype.set=a,Fi=o,Fi}var Mi,nd;function wE(){if(nd)return Mi;nd=1;var e=io(),t=tp(),r=rp(),n=200;function a(o,i){var s=this.__data__;if(s instanceof e){var l=s.__data__;if(!t||l.length<n-1)return l.push([o,i]),this.size=++s.size,this;s=this.__data__=new r(l)}return s.set(o,i),this.size=s.size,this}return Mi=a,Mi}var Ui,ad;function np(){if(ad)return Ui;ad=1;var e=io(),t=rE(),r=nE(),n=aE(),a=oE(),o=wE();function i(s){var l=this.__data__=new e(s);this.size=l.size}return i.prototype.clear=t,i.prototype.delete=r,i.prototype.get=n,i.prototype.has=a,i.prototype.set=o,Ui=i,Ui}var Bi,od;function IE(){if(od)return Bi;od=1;var e="__lodash_hash_undefined__";function t(r){return this.__data__.set(r,e),this}return Bi=t,Bi}var ji,id;function SE(){if(id)return ji;id=1;function e(t){return this.__data__.has(t)}return ji=e,ji}var $i,sd;function Fb(){if(sd)return $i;sd=1;var e=rp(),t=IE(),r=SE();function n(a){var o=-1,i=a==null?0:a.length;for(this.__data__=new e;++o<i;)this.add(a[o])}return n.prototype.add=n.prototype.push=t,n.prototype.has=r,$i=n,$i}var xi,ld;function Mb(){if(ld)return xi;ld=1;function e(t,r){for(var n=-1,a=t==null?0:t.length;++n<a;)if(r(t[n],n,t))return!0;return!1}return xi=e,xi}var Vi,ud;function Ub(){if(ud)return Vi;ud=1;function e(t,r){return t.has(r)}return Vi=e,Vi}var Hi,cd;function Bb(){if(cd)return Hi;cd=1;var e=Fb(),t=Mb(),r=Ub(),n=1,a=2;function o(i,s,l,u,c,p){var d=l&n,y=i.length,b=s.length;if(y!=b&&!(d&&b>y))return!1;var h=p.get(i),g=p.get(s);if(h&&g)return h==s&&g==i;var T=-1,m=!0,_=l&a?new e:void 0;for(p.set(i,s),p.set(s,i);++T<y;){var I=i[T],S=s[T];if(u)var O=d?u(S,I,T,s,i,p):u(I,S,T,i,s,p);if(O!==void 0){if(O)continue;m=!1;break}if(_){if(!t(s,function(v,C){if(!r(_,C)&&(I===v||c(I,v,l,u,p)))return _.push(C)})){m=!1;break}}else if(!(I===S||c(I,S,l,u,p))){m=!1;break}}return p.delete(i),p.delete(s),m}return Hi=o,Hi}var Gi,pd;function jb(){if(pd)return Gi;pd=1;var e=Mt(),t=e.Uint8Array;return Gi=t,Gi}var zi,fd;function AE(){if(fd)return zi;fd=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(a,o){n[++r]=[o,a]}),n}return zi=e,zi}var Wi,dd;function ap(){if(dd)return Wi;dd=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(a){n[++r]=a}),n}return Wi=e,Wi}var Yi,md;function OE(){if(md)return Yi;md=1;var e=bn(),t=jb(),r=ao(),n=Bb(),a=AE(),o=ap(),i=1,s=2,l="[object Boolean]",u="[object Date]",c="[object Error]",p="[object Map]",d="[object Number]",y="[object RegExp]",b="[object Set]",h="[object String]",g="[object Symbol]",T="[object ArrayBuffer]",m="[object DataView]",_=e?e.prototype:void 0,I=_?_.valueOf:void 0;function S(O,v,C,N,V,$,G){switch(C){case m:if(O.byteLength!=v.byteLength||O.byteOffset!=v.byteOffset)return!1;O=O.buffer,v=v.buffer;case T:return!(O.byteLength!=v.byteLength||!$(new t(O),new t(v)));case l:case u:case d:return r(+O,+v);case c:return O.name==v.name&&O.message==v.message;case y:case h:return O==v+"";case p:var X=a;case b:var fe=N&i;if(X||(X=o),O.size!=v.size&&!fe)return!1;var be=G.get(O);if(be)return be==v;N|=s,G.set(O,v);var ge=n(X(O),X(v),N,V,$,G);return G.delete(O),ge;case g:if(I)return I.call(O)==I.call(v)}return!1}return Yi=S,Yi}var Ki,hd;function $b(){if(hd)return Ki;hd=1;var e=ep(),t=tt();function r(n,a,o){var i=a(n);return t(n)?i:e(i,o(n))}return Ki=r,Ki}var Xi,yd;function xb(){if(yd)return Xi;yd=1;function e(t,r){for(var n=-1,a=t==null?0:t.length,o=0,i=[];++n<a;){var s=t[n];r(s,n,t)&&(i[o++]=s)}return i}return Xi=e,Xi}var Zi,bd;function Vb(){if(bd)return Zi;bd=1;function e(){return[]}return Zi=e,Zi}var Ji,gd;function op(){if(gd)return Ji;gd=1;var e=xb(),t=Vb(),r=Object.prototype,n=r.propertyIsEnumerable,a=Object.getOwnPropertySymbols,o=a?function(i){return i==null?[]:(i=Object(i),e(a(i),function(s){return n.call(i,s)}))}:t;return Ji=o,Ji}var Qi,_d;function Hb(){if(_d)return Qi;_d=1;function e(t,r){for(var n=-1,a=Array(t);++n<t;)a[n]=r(n);return a}return Qi=e,Qi}var Qn={exports:{}},es,Td;function vE(){if(Td)return es;Td=1;function e(){return!1}return es=e,es}Qn.exports;var Ed;function uo(){return Ed||(Ed=1,function(e,t){var r=Mt(),n=vE(),a=t&&!t.nodeType&&t,o=a&&!0&&e&&!e.nodeType&&e,i=o&&o.exports===a,s=i?r.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||n;e.exports=u}(Qn,Qn.exports)),Qn.exports}var ts,wd;function co(){if(wd)return ts;wd=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function r(n,a){var o=typeof n;return a=a??e,!!a&&(o=="number"||o!="symbol"&&t.test(n))&&n>-1&&n%1==0&&n<a}return ts=r,ts}var rs,Id;function ip(){if(Id)return rs;Id=1;var e=9007199254740991;function t(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=e}return rs=t,rs}var ns,Sd;function LE(){if(Sd)return ns;Sd=1;var e=gn(),t=ip(),r=Kt(),n="[object Arguments]",a="[object Array]",o="[object Boolean]",i="[object Date]",s="[object Error]",l="[object Function]",u="[object Map]",c="[object Number]",p="[object Object]",d="[object RegExp]",y="[object Set]",b="[object String]",h="[object WeakMap]",g="[object ArrayBuffer]",T="[object DataView]",m="[object Float32Array]",_="[object Float64Array]",I="[object Int8Array]",S="[object Int16Array]",O="[object Int32Array]",v="[object Uint8Array]",C="[object Uint8ClampedArray]",N="[object Uint16Array]",V="[object Uint32Array]",$={};$[m]=$[_]=$[I]=$[S]=$[O]=$[v]=$[C]=$[N]=$[V]=!0,$[n]=$[a]=$[g]=$[o]=$[T]=$[i]=$[s]=$[l]=$[u]=$[c]=$[p]=$[d]=$[y]=$[b]=$[h]=!1;function G(X){return r(X)&&t(X.length)&&!!$[e(X)]}return ns=G,ns}var as,Ad;function sp(){if(Ad)return as;Ad=1;function e(t){return function(r){return t(r)}}return as=e,as}var ea={exports:{}};ea.exports;var Od;function lp(){return Od||(Od=1,function(e,t){var r=yb(),n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===n,i=o&&r.process,s=function(){try{var l=a&&a.require&&a.require("util").types;return l||i&&i.binding&&i.binding("util")}catch{}}();e.exports=s}(ea,ea.exports)),ea.exports}var os,vd;function up(){if(vd)return os;vd=1;var e=LE(),t=sp(),r=lp(),n=r&&r.isTypedArray,a=n?t(n):e;return os=a,os}var is,Ld;function Gb(){if(Ld)return is;Ld=1;var e=Hb(),t=no(),r=tt(),n=uo(),a=co(),o=up(),i=Object.prototype,s=i.hasOwnProperty;function l(u,c){var p=r(u),d=!p&&t(u),y=!p&&!d&&n(u),b=!p&&!d&&!y&&o(u),h=p||d||y||b,g=h?e(u.length,String):[],T=g.length;for(var m in u)(c||s.call(u,m))&&!(h&&(m=="length"||y&&(m=="offset"||m=="parent")||b&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||a(m,T)))&&g.push(m);return g}return is=l,is}var ss,Rd;function po(){if(Rd)return ss;Rd=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||e;return r===a}return ss=t,ss}var ls,Pd;function zb(){if(Pd)return ls;Pd=1;function e(t,r){return function(n){return t(r(n))}}return ls=e,ls}var us,kd;function RE(){if(kd)return us;kd=1;var e=zb(),t=e(Object.keys,Object);return us=t,us}var cs,Nd;function Wb(){if(Nd)return cs;Nd=1;var e=po(),t=RE(),r=Object.prototype,n=r.hasOwnProperty;function a(o){if(!e(o))return t(o);var i=[];for(var s in Object(o))n.call(o,s)&&s!="constructor"&&i.push(s);return i}return cs=a,cs}var ps,Cd;function Br(){if(Cd)return ps;Cd=1;var e=Db(),t=ip();function r(n){return n!=null&&t(n.length)&&!e(n)}return ps=r,ps}var fs,Dd;function _a(){if(Dd)return fs;Dd=1;var e=Gb(),t=Wb(),r=Br();function n(a){return r(a)?e(a):t(a)}return fs=n,fs}var ds,qd;function Yb(){if(qd)return ds;qd=1;var e=$b(),t=op(),r=_a();function n(a){return e(a,r,t)}return ds=n,ds}var ms,Fd;function PE(){if(Fd)return ms;Fd=1;var e=Yb(),t=1,r=Object.prototype,n=r.hasOwnProperty;function a(o,i,s,l,u,c){var p=s&t,d=e(o),y=d.length,b=e(i),h=b.length;if(y!=h&&!p)return!1;for(var g=y;g--;){var T=d[g];if(!(p?T in i:n.call(i,T)))return!1}var m=c.get(o),_=c.get(i);if(m&&_)return m==i&&_==o;var I=!0;c.set(o,i),c.set(i,o);for(var S=p;++g<y;){T=d[g];var O=o[T],v=i[T];if(l)var C=p?l(v,O,T,i,o,c):l(O,v,T,o,i,c);if(!(C===void 0?O===v||u(O,v,s,l,c):C)){I=!1;break}S||(S=T=="constructor")}if(I&&!S){var N=o.constructor,V=i.constructor;N!=V&&"constructor"in o&&"constructor"in i&&!(typeof N=="function"&&N instanceof N&&typeof V=="function"&&V instanceof V)&&(I=!1)}return c.delete(o),c.delete(i),I}return ms=a,ms}var hs,Md;function kE(){if(Md)return hs;Md=1;var e=Ur(),t=Mt(),r=e(t,"DataView");return hs=r,hs}var ys,Ud;function NE(){if(Ud)return ys;Ud=1;var e=Ur(),t=Mt(),r=e(t,"Promise");return ys=r,ys}var bs,Bd;function Kb(){if(Bd)return bs;Bd=1;var e=Ur(),t=Mt(),r=e(t,"Set");return bs=r,bs}var gs,jd;function CE(){if(jd)return gs;jd=1;var e=Ur(),t=Mt(),r=e(t,"WeakMap");return gs=r,gs}var _s,$d;function Ta(){if($d)return _s;$d=1;var e=kE(),t=tp(),r=NE(),n=Kb(),a=CE(),o=gn(),i=qb(),s="[object Map]",l="[object Object]",u="[object Promise]",c="[object Set]",p="[object WeakMap]",d="[object DataView]",y=i(e),b=i(t),h=i(r),g=i(n),T=i(a),m=o;return(e&&m(new e(new ArrayBuffer(1)))!=d||t&&m(new t)!=s||r&&m(r.resolve())!=u||n&&m(new n)!=c||a&&m(new a)!=p)&&(m=function(_){var I=o(_),S=I==l?_.constructor:void 0,O=S?i(S):"";if(O)switch(O){case y:return d;case b:return s;case h:return u;case g:return c;case T:return p}return I}),_s=m,_s}var Ts,xd;function DE(){if(xd)return Ts;xd=1;var e=np(),t=Bb(),r=OE(),n=PE(),a=Ta(),o=tt(),i=uo(),s=up(),l=1,u="[object Arguments]",c="[object Array]",p="[object Object]",d=Object.prototype,y=d.hasOwnProperty;function b(h,g,T,m,_,I){var S=o(h),O=o(g),v=S?c:a(h),C=O?c:a(g);v=v==u?p:v,C=C==u?p:C;var N=v==p,V=C==p,$=v==C;if($&&i(h)){if(!i(g))return!1;S=!0,N=!1}if($&&!N)return I||(I=new e),S||s(h)?t(h,g,T,m,_,I):r(h,g,v,T,m,_,I);if(!(T&l)){var G=N&&y.call(h,"__wrapped__"),X=V&&y.call(g,"__wrapped__");if(G||X){var fe=G?h.value():h,be=X?g.value():g;return I||(I=new e),_(fe,be,T,m,I)}}return $?(I||(I=new e),n(h,g,T,m,_,I)):!1}return Ts=b,Ts}var Es,Vd;function cp(){if(Vd)return Es;Vd=1;var e=DE(),t=Kt();function r(n,a,o,i,s){return n===a?!0:n==null||a==null||!t(n)&&!t(a)?n!==n&&a!==a:e(n,a,o,i,r,s)}return Es=r,Es}var ws,Hd;function qE(){if(Hd)return ws;Hd=1;var e=np(),t=cp(),r=1,n=2;function a(o,i,s,l){var u=s.length,c=u,p=!l;if(o==null)return!c;for(o=Object(o);u--;){var d=s[u];if(p&&d[2]?d[1]!==o[d[0]]:!(d[0]in o))return!1}for(;++u<c;){d=s[u];var y=d[0],b=o[y],h=d[1];if(p&&d[2]){if(b===void 0&&!(y in o))return!1}else{var g=new e;if(l)var T=l(b,h,y,o,i,g);if(!(T===void 0?t(h,b,r|n,l,g):T))return!1}}return!0}return ws=a,ws}var Is,Gd;function Xb(){if(Gd)return Is;Gd=1;var e=Xt();function t(r){return r===r&&!e(r)}return Is=t,Is}var Ss,zd;function FE(){if(zd)return Ss;zd=1;var e=Xb(),t=_a();function r(n){for(var a=t(n),o=a.length;o--;){var i=a[o],s=n[i];a[o]=[i,s,e(s)]}return a}return Ss=r,Ss}var As,Wd;function Zb(){if(Wd)return As;Wd=1;function e(t,r){return function(n){return n==null?!1:n[t]===r&&(r!==void 0||t in Object(n))}}return As=e,As}var Os,Yd;function ME(){if(Yd)return Os;Yd=1;var e=qE(),t=FE(),r=Zb();function n(a){var o=t(a);return o.length==1&&o[0][2]?r(o[0][0],o[0][1]):function(i){return i===a||e(i,a,o)}}return Os=n,Os}var vs,Kd;function pp(){if(Kd)return vs;Kd=1;var e=tt(),t=ha(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(o,i){if(e(o))return!1;var s=typeof o;return s=="number"||s=="symbol"||s=="boolean"||o==null||t(o)?!0:n.test(o)||!r.test(o)||i!=null&&o in Object(i)}return vs=a,vs}var Ls,Xd;function UE(){if(Xd)return Ls;Xd=1;var e=rp(),t="Expected a function";function r(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(t);var o=function(){var i=arguments,s=a?a.apply(this,i):i[0],l=o.cache;if(l.has(s))return l.get(s);var u=n.apply(this,i);return o.cache=l.set(s,u)||l,u};return o.cache=new(r.Cache||e),o}return r.Cache=e,Ls=r,Ls}var Rs,Zd;function BE(){if(Zd)return Rs;Zd=1;var e=UE(),t=500;function r(n){var a=e(n,function(i){return o.size===t&&o.clear(),i}),o=a.cache;return a}return Rs=r,Rs}var Ps,Jd;function jE(){if(Jd)return Ps;Jd=1;var e=BE(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(a){var o=[];return a.charCodeAt(0)===46&&o.push(""),a.replace(t,function(i,s,l,u){o.push(l?u.replace(r,"$1"):s||i)}),o});return Ps=n,Ps}var ks,Qd;function $E(){if(Qd)return ks;Qd=1;var e=bn(),t=ga(),r=tt(),n=ha(),a=e?e.prototype:void 0,o=a?a.toString:void 0;function i(s){if(typeof s=="string")return s;if(r(s))return t(s,i)+"";if(n(s))return o?o.call(s):"";var l=s+"";return l=="0"&&1/s==-1/0?"-0":l}return ks=i,ks}var Ns,em;function xE(){if(em)return Ns;em=1;var e=$E();function t(r){return r==null?"":e(r)}return Ns=t,Ns}var Cs,tm;function _n(){if(tm)return Cs;tm=1;var e=tt(),t=pp(),r=jE(),n=xE();function a(o,i){return e(o)?o:t(o,i)?[o]:r(n(o))}return Cs=a,Cs}var Ds,rm;function Tn(){if(rm)return Ds;rm=1;var e=ha();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return Ds=t,Ds}var qs,nm;function fo(){if(nm)return qs;nm=1;var e=_n(),t=Tn();function r(n,a){a=e(a,n);for(var o=0,i=a.length;n!=null&&o<i;)n=n[t(a[o++])];return o&&o==i?n:void 0}return qs=r,qs}var Fs,am;function VE(){if(am)return Fs;am=1;var e=fo();function t(r,n,a){var o=r==null?void 0:e(r,n);return o===void 0?a:o}return Fs=t,Fs}var Ms,om;function HE(){if(om)return Ms;om=1;function e(t,r){return t!=null&&r in Object(t)}return Ms=e,Ms}var Us,im;function GE(){if(im)return Us;im=1;var e=_n(),t=no(),r=tt(),n=co(),a=ip(),o=Tn();function i(s,l,u){l=e(l,s);for(var c=-1,p=l.length,d=!1;++c<p;){var y=o(l[c]);if(!(d=s!=null&&u(s,y)))break;s=s[y]}return d||++c!=p?d:(p=s==null?0:s.length,!!p&&a(p)&&n(y,p)&&(r(s)||t(s)))}return Us=i,Us}var Bs,sm;function zE(){if(sm)return Bs;sm=1;var e=HE(),t=GE();function r(n,a){return n!=null&&t(n,a,e)}return Bs=r,Bs}var js,lm;function WE(){if(lm)return js;lm=1;var e=cp(),t=VE(),r=zE(),n=pp(),a=Xb(),o=Zb(),i=Tn(),s=1,l=2;function u(c,p){return n(c)&&a(p)?o(i(c),p):function(d){var y=t(d,c);return y===void 0&&y===p?r(d,c):e(p,y,s|l)}}return js=u,js}var $s,um;function Jb(){if(um)return $s;um=1;function e(t){return function(r){return r?.[t]}}return $s=e,$s}var xs,cm;function YE(){if(cm)return xs;cm=1;var e=fo();function t(r){return function(n){return e(n,r)}}return xs=t,xs}var Vs,pm;function KE(){if(pm)return Vs;pm=1;var e=Jb(),t=YE(),r=pp(),n=Tn();function a(o){return r(o)?e(n(o)):t(o)}return Vs=a,Vs}var Hs,fm;function En(){if(fm)return Hs;fm=1;var e=ME(),t=WE(),r=ya(),n=tt(),a=KE();function o(i){return typeof i=="function"?i:i==null?r:typeof i=="object"?n(i)?t(i[0],i[1]):e(i):a(i)}return Hs=o,Hs}var Gs,dm;function XE(){if(dm)return Gs;dm=1;function e(t){return function(r,n,a){for(var o=-1,i=Object(r),s=a(r),l=s.length;l--;){var u=s[t?l:++o];if(n(i[u],u,i)===!1)break}return r}}return Gs=e,Gs}var zs,mm;function ZE(){if(mm)return zs;mm=1;var e=XE(),t=e();return zs=t,zs}var Ws,hm;function Qb(){if(hm)return Ws;hm=1;var e=ZE(),t=_a();function r(n,a){return n&&e(n,a,t)}return Ws=r,Ws}var Ys,ym;function JE(){if(ym)return Ys;ym=1;var e=Br();function t(r,n){return function(a,o){if(a==null)return a;if(!e(a))return r(a,o);for(var i=a.length,s=n?i:-1,l=Object(a);(n?s--:++s<i)&&o(l[s],s,l)!==!1;);return a}}return Ys=t,Ys}var Ks,bm;function fp(){if(bm)return Ks;bm=1;var e=Qb(),t=JE(),r=t(e);return Ks=r,Ks}var Xs,gm;function QE(){if(gm)return Xs;gm=1;var e=fp(),t=Br();function r(n,a){var o=-1,i=t(n)?Array(n.length):[];return e(n,function(s,l,u){i[++o]=a(s,l,u)}),i}return Xs=r,Xs}var Zs,_m;function ew(){if(_m)return Zs;_m=1;var e=ga(),t=En(),r=QE(),n=tt();function a(o,i){var s=n(o)?e:r;return s(o,t(i,3))}return Zs=a,Zs}var Js,Tm;function tw(){if(Tm)return Js;Tm=1;var e=Cb(),t=ew();function r(n,a){return e(t(n,a),1)}return Js=r,Js}var rw=tw();const dn=Ye(rw);var Qs,Em;function eg(){if(Em)return Qs;Em=1;var e=Ur(),t=function(){try{var r=e(Object,"defineProperty");return r({},"",{}),r}catch{}}();return Qs=t,Qs}var el,wm;function dp(){if(wm)return el;wm=1;var e=eg();function t(r,n,a){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[n]=a}return el=t,el}var tl,Im;function nw(){if(Im)return tl;Im=1;var e=dp(),t=Qb(),r=En();function n(a,o){var i={};return o=r(o,3),t(a,function(s,l,u){e(i,l,o(s,l,u))}),i}return tl=n,tl}var aw=nw();const Wt=Ye(aw);var rl,Sm;function ow(){if(Sm)return rl;Sm=1;var e=Math.ceil,t=Math.max;function r(n,a,o,i){for(var s=-1,l=t(e((a-n)/(o||1)),0),u=Array(l);l--;)u[i?l:++s]=n,n+=o;return u}return rl=r,rl}var nl,Am;function mp(){if(Am)return nl;Am=1;var e=ao(),t=Br(),r=co(),n=Xt();function a(o,i,s){if(!n(s))return!1;var l=typeof i;return(l=="number"?t(s)&&r(i,s.length):l=="string"&&i in s)?e(s[i],o):!1}return nl=a,nl}var al,Om;function iw(){if(Om)return al;Om=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return al=t,al}var ol,vm;function sw(){if(vm)return ol;vm=1;var e=iw(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return ol=r,ol}var il,Lm;function lw(){if(Lm)return il;Lm=1;var e=sw(),t=Xt(),r=ha(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,s=parseInt;function l(u){if(typeof u=="number")return u;if(r(u))return n;if(t(u)){var c=typeof u.valueOf=="function"?u.valueOf():u;u=t(c)?c+"":c}if(typeof u!="string")return u===0?u:+u;u=e(u);var p=o.test(u);return p||i.test(u)?s(u.slice(2),p?2:8):a.test(u)?n:+u}return il=l,il}var sl,Rm;function tg(){if(Rm)return sl;Rm=1;var e=lw(),t=1/0,r=17976931348623157e292;function n(a){if(!a)return a===0?a:0;if(a=e(a),a===t||a===-t){var o=a<0?-1:1;return o*r}return a===a?a:0}return sl=n,sl}var ll,Pm;function uw(){if(Pm)return ll;Pm=1;var e=ow(),t=mp(),r=tg();function n(a){return function(o,i,s){return s&&typeof s!="number"&&t(o,i,s)&&(i=s=void 0),o=r(o),i===void 0?(i=o,o=0):i=r(i),s=s===void 0?o<i?1:-1:r(s),e(o,i,s,a)}}return ll=n,ll}var ul,km;function cw(){if(km)return ul;km=1;var e=uw(),t=e();return ul=t,ul}var pw=cw();const ln=Ye(pw);var cl,Nm;function fw(){if(Nm)return cl;Nm=1;function e(t,r,n,a){var o=-1,i=t==null?0:t.length;for(a&&i&&(n=t[++o]);++o<i;)n=r(n,t[o],o,t);return n}return cl=e,cl}var pl,Cm;function dw(){if(Cm)return pl;Cm=1;function e(t,r,n,a,o){return o(t,function(i,s,l){n=a?(a=!1,i):r(n,i,s,l)}),n}return pl=e,pl}var fl,Dm;function mw(){if(Dm)return fl;Dm=1;var e=fw(),t=fp(),r=En(),n=dw(),a=tt();function o(i,s,l){var u=a(i)?e:n,c=arguments.length<3;return u(i,r(s,4),l,c,t)}return fl=o,fl}var hw=mw();const pt=Ye(hw),hp=(e,t,r)=>{const{gripperEntities:n,moduleEntities:a}=t,o=Nn(r,e.moduleId),i=Object.keys(n).length>0,s=[];if((e.moduleId==null||o==null)&&s.push(ke()),i||s.push(cb()),s.length>0)return{errors:s};const l=a[e.moduleId].pythonName;return{commands:[{commandType:"absorbanceReader/closeLid",key:ne(),params:{moduleId:e.moduleId}}],python:`${l}.close_lid()`}},rg=(e,t,r)=>{const{moduleId:n,sampleWavelengths:a,measureMode:o,referenceWavelength:i}=e,s=t.moduleEntities[n].pythonName,l=i!=null?`, reference_wavelength=${i}`:"";return{commands:[{commandType:"absorbanceReader/initialize",key:ne(),params:{moduleId:n,measureMode:o,sampleWavelengths:a,...i!=null?{referenceWavelength:i}:{}}}],python:`${s}.initialize(${ee(o)}, ${Wp(a)}${l})`}},yw=(e,t,r)=>{const{gripperEntities:n,moduleEntities:a}=t,o=Nn(r,e.moduleId),i=Object.keys(n).length>0,s=[];if((e.moduleId==null||o==null)&&s.push(ke()),i||s.push(cb()),s.length>0)return{errors:s};const l=a[e.moduleId].pythonName;return{commands:[{commandType:"absorbanceReader/openLid",key:ne(),params:{moduleId:e.moduleId}}],python:`${l}.open_lid()`}},ng=(e,t,r)=>{const{moduleId:n,fileName:a}=e,o=[],i=Nn(r,n);if(i==null)return{errors:[ke()]};i.initialization===null&&o.push(kr());const s=t.moduleEntities[n].pythonName,l=a!=null?`export_filename=${ee(a)}`:"";return o.length>0?{errors:o}:{commands:[{commandType:"absorbanceReader/read",key:ne(),params:{moduleId:n,...a!=null?{fileName:a}:{}}}],python:`${s}.read(${l})`}},Yt=(e,t,r)=>{const{flowRate:n,pipetteId:a,volume:o,correctionVolume:i}=e,s=[];t.pipetteEntities[a]?.spec||s.push(ft({pipette:a}));const u=t.pipetteEntities[a].pythonName;return{commands:[{commandType:"airGapInPlace",key:ne(),params:{flowRate:n,pipetteId:a,volume:o,...i!=null?{correctionVolume:i}:{}}}],python:`${u}.air_gap(${[`volume=${o}`,"in_place=True",`flow_rate=${n}`].join(", ")})`}},bw=(e,t,r)=>{const{pipetteId:n,volume:a,labwareId:o,wellName:i,flowRate:s,isAirGap:l,tipRack:u,wellLocation:c,primaryNozzle:p,nozzles:d}=e,y="aspirate",b=r.labware,h=[],g=t.pipetteEntities[n]?.spec,T=(g?.displayCategory==="FLEX"||g?.channels===96)??!1,m=On(o,r.labware);if(g||h.push(ft({pipette:n})),!o||!r.labware[o]?h.push(dt({actionName:y,labware:o})):we(r.labware[o].stack)==="offDeck"&&h.push(fn()),We.includes(m))h.push(Dt({typeOfStep:y}));else if(b[m]!=null){const N=we(b[m].stack);We.includes(N)&&h.push(Dt({typeOfStep:y}))}if(vn({pipette:n,labware:o,invariantContext:t,prevRobotState:r})&&h.push(ca()),r.tipState.pipettes[n]?.hasTip||h.push(Ft({actionName:y,pipette:n,labware:o,well:i})),t.pipetteEntities[n]?.spec.channels!==1&&!It({robotState:r,invariantContext:t,pipetteId:n,labwareId:o,wellLocationOffset:c?.offset??{x:0,y:0,z:0},wellTargetName:i,primaryNozzle:p,nozzleConfiguration:d})&&h.push(Mr()),va(r.modules,r.labware,o)&&h.push(cn()),Sa(r.modules,r.labware,o)&&h.push(kr()),Pa(r.modules,r.labware,o)&&h.push(eo()),ka(r.modules,r.labware,o)&&h.push(pn()),Pn(r.modules,m,T?f.FLEX_ROBOT_TYPE:f.OT2_ROBOT_TYPE)&&h.push(fa()),T||(Ln(r.modules,m)&&h.push(pa()),Rn(r.modules,m,g)&&h.push(da()),Ra(r.modules,m,g,t.labwareEntities[o])&&h.push(to())),h.length===0&&g&&g.liquids.default.maxVolume<a&&h.push(Xa({actionName:y,volume:a,maxVolume:g.liquids.default.maxVolume})),h.length===0&&g){const N=ko(n,t,u);N<a&&h.push(J_({actionName:y,volume:a,maxVolume:N}))}if(h.length>0)return{errors:h};const I=[{commandType:"aspirate",key:ne(),params:{pipetteId:n,volume:a,labwareId:o,wellName:i,wellLocation:c,flowRate:s},...l&&{meta:{isAirGap:l}}}],S=t.pipetteEntities[n].pythonName,O=t.labwareEntities[o].pythonName,v=[`volume=${a}`,`location=${O}[${ee(i)}]${kn(c)}`,`flow_rate=${s}`],C=`${S}.aspirate(
|
|
2
|
-
${
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@opentrons/shared-data");function Cy(){return{type:"INSUFFICIENT_TIPS",message:"Not enough tips to complete action"}}function Dy(){return{type:"MISSING_96_CHANNEL_TIPRACK_ADAPTER",message:"A 96-channel cannot pick up tips fully without an adapter"}}function My(){return{type:"REMOVE_96_CHANNEL_TIPRACK_ADAPTER",message:"A 96-channel cannot pick up tips partially with an adapter"}}function Ut(e){const{actionName:t,pipette:r,labware:n,well:a}=e;return{message:n==null||a==null?`Attempted to ${t} with no tip on pipette: ${r} in place`:`Attempted to ${t} with no tip on pipette: ${r} from ${n}'s well ${a}`,type:"NO_TIP_ON_PIPETTE"}}function Fy(){return{message:"One or more of the pipettes has a tip",type:"PIPETTE_HAS_TIP"}}function ut(e){const{pipette:t}=e;return{message:`This step tries to use the ${t}. Add the pipette to your protocol or change the step to use a different pipette.`,type:"PIPETTE_DOES_NOT_EXIST"}}function ct(e){const{actionName:t,labware:r}=e;return console.warn(`Attempted to ${t} with labware id "${r}", this labware was not found under "labware"`),{message:`This step tries to use ${r}. Add the labware to your protocol or change the step to use a different labware.`,type:"LABWARE_DOES_NOT_EXIST"}}function X(){return{message:"This step requires a module, but none is selected",type:"MISSING_MODULE"}}function qy(){return{message:"This module is not changing temperature because it has either been deactivated or is already holding a temperature. In order to pause the protocol and wait for your module to reach a temperature, you must first use a Temperature step to tell the module to start changing to a new temperature",type:"MISSING_TEMPERATURE_STEP"}}function xc(){return{message:"This module is not currently running a profile.",type:"MISSING_PROFILE_STEP"}}function Uy(e){const{volume:t,maxVolume:r,actionName:n}=e;return{message:`This step tries to ${n} ${t}µL, but the tip can only hold ${r}µL.`,type:"TIP_VOLUME_EXCEEDED"}}function Xa(e){const{actionName:t,volume:r,maxVolume:n,disposalVolume:a}=e;return{message:a!=null?`Attemped to ${t} volume + disposal volume greater than pipette max volume (${r} + ${a} > ${n})`:`This step tries to ${t} ${r}µL, but the tip can only hold ${n}µL.`,type:"PIPETTE_VOLUME_EXCEEDED"}}const By=()=>({type:"MOVE_LOCATION_NOT_SPECIFIED",message:"This step is missing a move location."}),pa=()=>({type:"MODULE_PIPETTE_COLLISION_DANGER",message:"Gen 1 8-Channel pipettes cannot access labware or tip racks in slot 4 or 6 because they are adjacent to modules."}),$y=()=>({type:"THERMOCYCLER_BUSY_WITH_PROFILE",message:"This step cannot run while the Thermocycler is running a profile. Move the step outside the profile."}),dn=()=>({type:"THERMOCYCLER_LID_CLOSED",message:"Attempted to interact with contents of a thermocycler with the lid closed."}),ts=()=>({type:"HEATER_SHAKER_LATCH_OPEN",message:"Attempted to interact with contents of a heater-shaker with the latch open."}),Hc=()=>({type:"HEATER_SHAKER_LATCH_CLOSED",message:"Attempted to move the contents of a heater-shaker with the latch closed."}),Dr=()=>({type:"ABSORBANCE_READER_LID_CLOSED",message:"Attempted to interact with contents of an absorbance plate reader with the lid closed."}),Vy=()=>({type:"ABSORBANCE_READER_NO_INITIALIZATION",message:"This step tries to read labware without initializing the Plate Reader first. Initialize the Plate Reader module or remove this step in order to proceed."}),ah=()=>({type:"ABSORBANCE_READER_NO_GRIPPER",message:"This step involves opening or closing the Absorbance Plate Reader lid with a gripper. Add a gripper or remove step to proceed."}),xy=()=>({type:"HOPPER_EMPTY",message:"Cannot retrieve labware from empty stacker"}),Hy=()=>({type:"SHUTTLE_FULL",message:"Shuttle must be empty in order to retrieve labware from the stacker"}),jy=()=>({type:"SHUTTLE_EMPTY",message:"Shuttle must have labware in order to store it in the stacker"}),sh=()=>({type:"MISMATCHED_STACKER_LABWARE_TYPE",message:"The stacker can only store a single type of labware at a time"}),zy=()=>({type:"MISSING_STACKER_LABWARE_TYPE",message:"Add labware to the stacker in the starting deck so that you can refill it later"}),oh=()=>({type:"HOPPER_FULL",message:"The hopper has reached capacity"}),fn=()=>({type:"HEATER_SHAKER_IS_SHAKING",message:"Attempted to interact with the contents of a heater-shaker when it is shaking."}),Gy=e=>({type:"TALL_LABWARE_EAST_WEST_OF_HEATER_SHAKER",message:`Labware over 53 mm is ${e} of this Heater-Shaker module.`}),$r=()=>({type:"POSSIBLE_PIPETTE_COLLISION",message:"There is a possibility that the Pipette will collide with the a labware or module on the deck"}),da=()=>({type:"HEATER_SHAKER_EAST_WEST_LATCH_OPEN",message:"The Heater-Shaker labware latch is open"}),fa=()=>({type:"HEATER_SHAKER_NORTH_SOUTH_EAST_WEST_SHAKING",message:"The Heater-Shaker is shaking"}),ma=()=>({type:"HEATER_SHAKER_EAST_WEST_MULTI_CHANNEL",message:"The Heater-Shaker is shaking"}),rs=()=>({type:"HEATER_SHAKER_NORTH_SOUTH__OF_NON_TIPRACK_WITH_MULTI_CHANNEL",message:"8-Channel pipette cannot access labware"}),mn=()=>({type:"LABWARE_OFF_DECK",message:"Attempted to interact with labware off deck"}),Wy=()=>({type:"LABWARE_ON_ANOTHER_ENTITY",message:"Attempted to move labware onto another entity with the same slotName"}),yn=()=>({type:"DROP_TIP_LOCATION_DOES_NOT_EXIST",message:"The destination for dropping tip does not exist"}),ih=()=>({type:"EQUIPMENT_DOES_NOT_EXIST",message:"Equipment does not exist."}),Yy=()=>({type:"GRIPPER_REQUIRED",message:"The gripper is required to fulfill this action"}),Ft=e=>({type:"PIPETTING_INTO_COLUMN_4",message:`Cannot ${e.typeOfStep} into a column 4 slot.`}),Ky=()=>({type:"CANNOT_MOVE_WITH_GRIPPER",message:"The gripper cannot move aluminum blocks"}),Xy=()=>({type:"NO_TIP_SELECTED",message:"No tips were selected for this step"}),ha=()=>({type:"LABWARE_DISCARDED_IN_TRASH",message:"The labware was discarded in trash in a previous step."}),lh=()=>({type:"SUBMERGE_BELOW_ASPIRATE",message:"The submerge position must be above the aspirate position"}),uh=()=>({type:"RETRACT_BELOW_ASPIRATE",message:"The retract position must be above the aspirate position"}),Zy=()=>({type:"SUBMERGE_BELOW_DISPENSE",message:"The submerge position must be above the dispense position"}),Qy=()=>({type:"RETRACT_BELOW_DISPENSE",message:"The retract position must be above the dispense position"}),Jy=()=>({type:"MULTI_ASPIRATE_VOLUME_TOO_HIGH",message:"Consolidate pipette path was selected but cannot fit volume for more than 1 well in the tip"}),eb=()=>({type:"MULTI_DISPENSE_VOLUME_TOO_HIGH",message:"Distribute pipette path was selected but cannot fit volume for more than 1 well in the tip"}),tb=e=>({type:"CLOSING_THERMOCYCLER_WITH_INVALID_LABWARE_LID",message:`Closing the Thermocycler lid with ${e.lidDisplayName} in place will cause damage`}),jc=()=>({type:"RETURN_TIP_UNAVAILABLE",message:"Current tip does not have a known location to return to"}),rb=()=>({type:"TIPRACK_LID_NOT_ALLOWED_ON_DECK",message:"The tip rack lid is not supported directly on the deck"}),nb=()=>({type:"NEXT_TIPRACK_HAS_LID",message:"A pipette cannot pick up tips from a tip rack with a lid"}),ab=e=>({type:"STACK_TOO_HIGH",message:`The stack on slot ${e.slot} is too high`}),sb=()=>({type:"TOO_MANY_TIPS",message:"Action will pick up too many tips"}),ob=()=>({type:"INCOMPLETE_PICKUP",message:"At least one of the selected tips is empty"}),ib=()=>({type:"LABWARE_ON_HOPPER",message:"Labware cannot be moved from the Flex Stacker Hopper"}),lb=()=>({type:"MISSING_PUMP_ACTIVITY",message:"This module is not currently running a pump activity."}),ub=e=>({type:"INVALID_WAIT_CONDITION",message:`Invalid wait condition: ${e}`}),_a=()=>({type:"LIVE_TASK_ERROR",message:"This module is currently running a live task. Please wait for it to complete before performing this action."});function xe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vs,zc;function ch(){if(zc)return vs;zc=1;var e=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis;return vs=e,vs}var Ps,Gc;function Bt(){if(Gc)return Ps;Gc=1;var e=ch(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return Ps=r,Ps}var Ns,Wc;function bn(){if(Wc)return Ns;Wc=1;var e=Bt(),t=e.Symbol;return Ns=t,Ns}var Cs,Yc;function cb(){if(Yc)return Cs;Yc=1;var e=bn(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,a=e?e.toStringTag:void 0;function s(o){var i=r.call(o,a),l=o[a];try{o[a]=void 0;var u=!0}catch{}var p=n.call(o);return u&&(i?o[a]=l:delete o[a]),p}return Cs=s,Cs}var Ds,Kc;function pb(){if(Kc)return Ds;Kc=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return Ds=r,Ds}var Ms,Xc;function Tn(){if(Xc)return Ms;Xc=1;var e=bn(),t=cb(),r=pb(),n="[object Null]",a="[object Undefined]",s=e?e.toStringTag:void 0;function o(i){return i==null?i===void 0?a:n:s&&s in Object(i)?t(i):r(i)}return Ms=o,Ms}var Fs,Zc;function Qt(){if(Zc)return Fs;Zc=1;function e(t){return t!=null&&typeof t=="object"}return Fs=e,Fs}var qs,Qc;function ya(){if(Qc)return qs;Qc=1;var e=Tn(),t=Qt(),r="[object Symbol]";function n(a){return typeof a=="symbol"||t(a)&&e(a)==r}return qs=n,qs}var Us,Jc;function ph(){if(Jc)return Us;Jc=1;var e=ya();function t(r,n,a){for(var s=-1,o=r.length;++s<o;){var i=r[s],l=n(i);if(l!=null&&(u===void 0?l===l&&!e(l):a(l,u)))var u=l,p=i}return p}return Us=t,Us}var Bs,ep;function db(){if(ep)return Bs;ep=1;function e(t,r){return t<r}return Bs=e,Bs}var $s,tp;function ba(){if(tp)return $s;tp=1;function e(t){return t}return $s=e,$s}var Vs,rp;function fb(){if(rp)return Vs;rp=1;var e=ph(),t=db(),r=ba();function n(a){return a&&a.length?e(a,r,t):void 0}return Vs=n,Vs}var mb=fb();const hb=xe(mb),Ta="TEMPERATURE_DEACTIVATED",Xu="TEMPERATURE_AT_TARGET",Zu="TEMPERATURE_APPROACHING_TARGET",Nu=1,dh=[c.MAGNETIC_MODULE_V1,c.TEMPERATURE_MODULE_V1],Cu="fixedTrash",fh={type:c.MAGNETIC_MODULE_TYPE,engaged:!1},mh={type:c.TEMPERATURE_MODULE_TYPE,status:Ta,targetTemperature:null},hh={type:c.THERMOCYCLER_MODULE_TYPE,currentBlockActivity:{type:"blockDeactivated"},lidTargetTemp:null,lidOpen:null,numProfilesStarted:0},_h={type:c.HEATERSHAKER_MODULE_TYPE,targetTemp:null,targetSpeed:null,latchOpen:null},yh={type:"absorbanceReaderType",lidOpen:null,initialization:null},bh={type:"magneticBlockType"},Th={type:c.FLEX_STACKER_MODULE_TYPE,storedLabwareDetails:null,labwareInHopper:null,labwareOnShuttle:null,setStoredLabwareCount:1,fillCount:1},gh={type:c.VACUUM_MODULE_TYPE,ventStatus:null,numPumpActivitiesStarted:0,currentPumpActivity:{type:"pumpDeactivated"}},Ih={[c.MAGNETIC_MODULE_TYPE]:fh,[c.TEMPERATURE_MODULE_TYPE]:mh,[c.THERMOCYCLER_MODULE_TYPE]:hh,[c.HEATERSHAKER_MODULE_TYPE]:_h,[c.ABSORBANCE_READER_TYPE]:yh,[c.MAGNETIC_BLOCK_TYPE]:bh,[c.FLEX_STACKER_MODULE_TYPE]:Th,[c.VACUUM_MODULE_TYPE]:gh},_b="opentrons/opentrons_1_trash_1100ml_fixed/1",yb="opentrons/opentrons_1_trash_3200ml_fixed/1",De=["A4","B4","C4","D4"],It={x:0,y:0,z:0},Eh="mounted",ga="CLEAN",Wt="DIRTY",se="EMPTY",Qu="automatic",Et="manual",wh=["A4","B4","C4","D4"],bb=["7","8","10","11"],He="hopper",Ah=["hopperA4","hopperB4","hopperC4","hopperD4"],Sh={hopperA4:"A4",hopperB4:"B4",hopperC4:"C4",hopperD4:"D4"},Yt=["adapterLabwareId","primaryLabwareId","lidLabwareId"],Tb=["adapterLabwareURI","primaryLabwareURI","lidLabwareURI"],gb={A4:"hopperA4",B4:"hopperB4",C4:"hopperC4",D4:"hopperD4"},ns="open",Ia="closed",Du="power",Mu="pressure",Ib="state",Eb="profile",wb="pumpOff",Ab="pumpOn",Sb="vent",Lb="open",Ob="closed",Rb=.1,kb=1e3,vb="VACUUM_DEACTIVATED",Pb="VACUUM_AT_TARGET",Fe=[];for(let e=0;e<256;++e)Fe.push((e+256).toString(16).slice(1));function Nb(e,t=0){return(Fe[e[t+0]]+Fe[e[t+1]]+Fe[e[t+2]]+Fe[e[t+3]]+"-"+Fe[e[t+4]]+Fe[e[t+5]]+"-"+Fe[e[t+6]]+Fe[e[t+7]]+"-"+Fe[e[t+8]]+Fe[e[t+9]]+"-"+Fe[e[t+10]]+Fe[e[t+11]]+Fe[e[t+12]]+Fe[e[t+13]]+Fe[e[t+14]]+Fe[e[t+15]]).toLowerCase()}const Cb=new Uint8Array(16);function Db(){return crypto.getRandomValues(Cb)}function Mb(e,t,r){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():Fb(e,t,r)}function Fb(e,t,r){e=e||{};const n=e.random??e.rng?.()??Db();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let a=0;a<16;++a)t[r+a]=n[a];return t}return Nb(n)}var xs,np;function Ju(){if(np)return xs;np=1;function e(t,r){for(var n=-1,a=r.length,s=t.length;++n<a;)t[s+n]=r[n];return t}return xs=e,xs}var Hs,ap;function qb(){if(ap)return Hs;ap=1;var e=Tn(),t=Qt(),r="[object Arguments]";function n(a){return t(a)&&e(a)==r}return Hs=n,Hs}var js,sp;function as(){if(sp)return js;sp=1;var e=qb(),t=Qt(),r=Object.prototype,n=r.hasOwnProperty,a=r.propertyIsEnumerable,s=e((function(){return arguments})())?e:function(o){return t(o)&&n.call(o,"callee")&&!a.call(o,"callee")};return js=s,js}var zs,op;function Ke(){if(op)return zs;op=1;var e=Array.isArray;return zs=e,zs}var Gs,ip;function Ub(){if(ip)return Gs;ip=1;var e=bn(),t=as(),r=Ke(),n=e?e.isConcatSpreadable:void 0;function a(s){return r(s)||t(s)||!!(n&&s&&s[n])}return Gs=a,Gs}var Ws,lp;function Lh(){if(lp)return Ws;lp=1;var e=Ju(),t=Ub();function r(n,a,s,o,i){var l=-1,u=n.length;for(s||(s=t),i||(i=[]);++l<u;){var p=n[l];a>0&&s(p)?a>1?r(p,a-1,s,o,i):e(i,p):o||(i[i.length]=p)}return i}return Ws=r,Ws}var Ys,up;function Ea(){if(up)return Ys;up=1;function e(t,r){for(var n=-1,a=t==null?0:t.length,s=Array(a);++n<a;)s[n]=r(t[n],n,t);return s}return Ys=e,Ys}var Ks,cp;function Bb(){if(cp)return Ks;cp=1;function e(){this.__data__=[],this.size=0}return Ks=e,Ks}var Xs,pp;function ss(){if(pp)return Xs;pp=1;function e(t,r){return t===r||t!==t&&r!==r}return Xs=e,Xs}var Zs,dp;function os(){if(dp)return Zs;dp=1;var e=ss();function t(r,n){for(var a=r.length;a--;)if(e(r[a][0],n))return a;return-1}return Zs=t,Zs}var Qs,fp;function $b(){if(fp)return Qs;fp=1;var e=os(),t=Array.prototype,r=t.splice;function n(a){var s=this.__data__,o=e(s,a);if(o<0)return!1;var i=s.length-1;return o==i?s.pop():r.call(s,o,1),--this.size,!0}return Qs=n,Qs}var Js,mp;function Vb(){if(mp)return Js;mp=1;var e=os();function t(r){var n=this.__data__,a=e(n,r);return a<0?void 0:n[a][1]}return Js=t,Js}var eo,hp;function xb(){if(hp)return eo;hp=1;var e=os();function t(r){return e(this.__data__,r)>-1}return eo=t,eo}var to,_p;function Hb(){if(_p)return to;_p=1;var e=os();function t(r,n){var a=this.__data__,s=e(a,r);return s<0?(++this.size,a.push([r,n])):a[s][1]=n,this}return to=t,to}var ro,yp;function is(){if(yp)return ro;yp=1;var e=Bb(),t=$b(),r=Vb(),n=xb(),a=Hb();function s(o){var i=-1,l=o==null?0:o.length;for(this.clear();++i<l;){var u=o[i];this.set(u[0],u[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=r,s.prototype.has=n,s.prototype.set=a,ro=s,ro}var no,bp;function jb(){if(bp)return no;bp=1;var e=is();function t(){this.__data__=new e,this.size=0}return no=t,no}var ao,Tp;function zb(){if(Tp)return ao;Tp=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return ao=e,ao}var so,gp;function Gb(){if(gp)return so;gp=1;function e(t){return this.__data__.get(t)}return so=e,so}var oo,Ip;function Wb(){if(Ip)return oo;Ip=1;function e(t){return this.__data__.has(t)}return oo=e,oo}var io,Ep;function Jt(){if(Ep)return io;Ep=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return io=e,io}var lo,wp;function Oh(){if(wp)return lo;wp=1;var e=Tn(),t=Jt(),r="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",s="[object Proxy]";function o(i){if(!t(i))return!1;var l=e(i);return l==n||l==a||l==r||l==s}return lo=o,lo}var uo,Ap;function Yb(){if(Ap)return uo;Ap=1;var e=Bt(),t=e["__core-js_shared__"];return uo=t,uo}var co,Sp;function Kb(){if(Sp)return co;Sp=1;var e=Yb(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return co=r,co}var po,Lp;function Rh(){if(Lp)return po;Lp=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return po=r,po}var fo,Op;function Xb(){if(Op)return fo;Op=1;var e=Oh(),t=Kb(),r=Jt(),n=Rh(),a=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,o=Function.prototype,i=Object.prototype,l=o.toString,u=i.hasOwnProperty,p=RegExp("^"+l.call(u).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(f){if(!r(f)||t(f))return!1;var _=e(f)?p:s;return _.test(n(f))}return fo=d,fo}var mo,Rp;function Zb(){if(Rp)return mo;Rp=1;function e(t,r){return t?.[r]}return mo=e,mo}var ho,kp;function Vr(){if(kp)return ho;kp=1;var e=Xb(),t=Zb();function r(n,a){var s=t(n,a);return e(s)?s:void 0}return ho=r,ho}var _o,vp;function ec(){if(vp)return _o;vp=1;var e=Vr(),t=Bt(),r=e(t,"Map");return _o=r,_o}var yo,Pp;function ls(){if(Pp)return yo;Pp=1;var e=Vr(),t=e(Object,"create");return yo=t,yo}var bo,Np;function Qb(){if(Np)return bo;Np=1;var e=ls();function t(){this.__data__=e?e(null):{},this.size=0}return bo=t,bo}var To,Cp;function Jb(){if(Cp)return To;Cp=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return To=e,To}var go,Dp;function eT(){if(Dp)return go;Dp=1;var e=ls(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function a(s){var o=this.__data__;if(e){var i=o[s];return i===t?void 0:i}return n.call(o,s)?o[s]:void 0}return go=a,go}var Io,Mp;function tT(){if(Mp)return Io;Mp=1;var e=ls(),t=Object.prototype,r=t.hasOwnProperty;function n(a){var s=this.__data__;return e?s[a]!==void 0:r.call(s,a)}return Io=n,Io}var Eo,Fp;function rT(){if(Fp)return Eo;Fp=1;var e=ls(),t="__lodash_hash_undefined__";function r(n,a){var s=this.__data__;return this.size+=this.has(n)?0:1,s[n]=e&&a===void 0?t:a,this}return Eo=r,Eo}var wo,qp;function nT(){if(qp)return wo;qp=1;var e=Qb(),t=Jb(),r=eT(),n=tT(),a=rT();function s(o){var i=-1,l=o==null?0:o.length;for(this.clear();++i<l;){var u=o[i];this.set(u[0],u[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=r,s.prototype.has=n,s.prototype.set=a,wo=s,wo}var Ao,Up;function aT(){if(Up)return Ao;Up=1;var e=nT(),t=is(),r=ec();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return Ao=n,Ao}var So,Bp;function sT(){if(Bp)return So;Bp=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return So=e,So}var Lo,$p;function us(){if($p)return Lo;$p=1;var e=sT();function t(r,n){var a=r.__data__;return e(n)?a[typeof n=="string"?"string":"hash"]:a.map}return Lo=t,Lo}var Oo,Vp;function oT(){if(Vp)return Oo;Vp=1;var e=us();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return Oo=t,Oo}var Ro,xp;function iT(){if(xp)return Ro;xp=1;var e=us();function t(r){return e(this,r).get(r)}return Ro=t,Ro}var ko,Hp;function lT(){if(Hp)return ko;Hp=1;var e=us();function t(r){return e(this,r).has(r)}return ko=t,ko}var vo,jp;function uT(){if(jp)return vo;jp=1;var e=us();function t(r,n){var a=e(this,r),s=a.size;return a.set(r,n),this.size+=a.size==s?0:1,this}return vo=t,vo}var Po,zp;function tc(){if(zp)return Po;zp=1;var e=aT(),t=oT(),r=iT(),n=lT(),a=uT();function s(o){var i=-1,l=o==null?0:o.length;for(this.clear();++i<l;){var u=o[i];this.set(u[0],u[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=r,s.prototype.has=n,s.prototype.set=a,Po=s,Po}var No,Gp;function cT(){if(Gp)return No;Gp=1;var e=is(),t=ec(),r=tc(),n=200;function a(s,o){var i=this.__data__;if(i instanceof e){var l=i.__data__;if(!t||l.length<n-1)return l.push([s,o]),this.size=++i.size,this;i=this.__data__=new r(l)}return i.set(s,o),this.size=i.size,this}return No=a,No}var Co,Wp;function rc(){if(Wp)return Co;Wp=1;var e=is(),t=jb(),r=zb(),n=Gb(),a=Wb(),s=cT();function o(i){var l=this.__data__=new e(i);this.size=l.size}return o.prototype.clear=t,o.prototype.delete=r,o.prototype.get=n,o.prototype.has=a,o.prototype.set=s,Co=o,Co}var Do,Yp;function pT(){if(Yp)return Do;Yp=1;var e="__lodash_hash_undefined__";function t(r){return this.__data__.set(r,e),this}return Do=t,Do}var Mo,Kp;function dT(){if(Kp)return Mo;Kp=1;function e(t){return this.__data__.has(t)}return Mo=e,Mo}var Fo,Xp;function kh(){if(Xp)return Fo;Xp=1;var e=tc(),t=pT(),r=dT();function n(a){var s=-1,o=a==null?0:a.length;for(this.__data__=new e;++s<o;)this.add(a[s])}return n.prototype.add=n.prototype.push=t,n.prototype.has=r,Fo=n,Fo}var qo,Zp;function vh(){if(Zp)return qo;Zp=1;function e(t,r){for(var n=-1,a=t==null?0:t.length;++n<a;)if(r(t[n],n,t))return!0;return!1}return qo=e,qo}var Uo,Qp;function Ph(){if(Qp)return Uo;Qp=1;function e(t,r){return t.has(r)}return Uo=e,Uo}var Bo,Jp;function Nh(){if(Jp)return Bo;Jp=1;var e=kh(),t=vh(),r=Ph(),n=1,a=2;function s(o,i,l,u,p,d){var f=l&n,_=o.length,m=i.length;if(_!=m&&!(f&&m>_))return!1;var h=d.get(o),b=d.get(i);if(h&&b)return h==i&&b==o;var T=-1,y=!0,S=l&a?new e:void 0;for(d.set(o,i),d.set(i,o);++T<_;){var w=o[T],g=i[T];if(u)var I=f?u(g,w,T,i,o,d):u(w,g,T,o,i,d);if(I!==void 0){if(I)continue;y=!1;break}if(S){if(!t(i,function(L,A){if(!r(S,A)&&(w===L||p(w,L,l,u,d)))return S.push(A)})){y=!1;break}}else if(!(w===g||p(w,g,l,u,d))){y=!1;break}}return d.delete(o),d.delete(i),y}return Bo=s,Bo}var $o,ed;function Ch(){if(ed)return $o;ed=1;var e=Bt(),t=e.Uint8Array;return $o=t,$o}var Vo,td;function fT(){if(td)return Vo;td=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(a,s){n[++r]=[s,a]}),n}return Vo=e,Vo}var xo,rd;function nc(){if(rd)return xo;rd=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(a){n[++r]=a}),n}return xo=e,xo}var Ho,nd;function mT(){if(nd)return Ho;nd=1;var e=bn(),t=Ch(),r=ss(),n=Nh(),a=fT(),s=nc(),o=1,i=2,l="[object Boolean]",u="[object Date]",p="[object Error]",d="[object Map]",f="[object Number]",_="[object RegExp]",m="[object Set]",h="[object String]",b="[object Symbol]",T="[object ArrayBuffer]",y="[object DataView]",S=e?e.prototype:void 0,w=S?S.valueOf:void 0;function g(I,L,A,E,k,R,B){switch(A){case y:if(I.byteLength!=L.byteLength||I.byteOffset!=L.byteOffset)return!1;I=I.buffer,L=L.buffer;case T:return!(I.byteLength!=L.byteLength||!R(new t(I),new t(L)));case l:case u:case f:return r(+I,+L);case p:return I.name==L.name&&I.message==L.message;case _:case h:return I==L+"";case d:var F=a;case m:var te=E&o;if(F||(F=s),I.size!=L.size&&!te)return!1;var de=B.get(I);if(de)return de==L;E|=i,B.set(I,L);var _e=n(F(I),F(L),E,k,R,B);return B.delete(I),_e;case b:if(w)return w.call(I)==w.call(L)}return!1}return Ho=g,Ho}var jo,ad;function Dh(){if(ad)return jo;ad=1;var e=Ju(),t=Ke();function r(n,a,s){var o=a(n);return t(n)?o:e(o,s(n))}return jo=r,jo}var zo,sd;function Mh(){if(sd)return zo;sd=1;function e(t,r){for(var n=-1,a=t==null?0:t.length,s=0,o=[];++n<a;){var i=t[n];r(i,n,t)&&(o[s++]=i)}return o}return zo=e,zo}var Go,od;function Fh(){if(od)return Go;od=1;function e(){return[]}return Go=e,Go}var Wo,id;function ac(){if(id)return Wo;id=1;var e=Mh(),t=Fh(),r=Object.prototype,n=r.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(o){return o==null?[]:(o=Object(o),e(a(o),function(i){return n.call(o,i)}))}:t;return Wo=s,Wo}var Yo,ld;function qh(){if(ld)return Yo;ld=1;function e(t,r){for(var n=-1,a=Array(t);++n<t;)a[n]=r(n);return a}return Yo=e,Yo}var ta={exports:{}},Ko,ud;function hT(){if(ud)return Ko;ud=1;function e(){return!1}return Ko=e,Ko}ta.exports;var cd;function cs(){return cd||(cd=1,(function(e,t){var r=Bt(),n=hT(),a=t&&!t.nodeType&&t,s=a&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===a,i=o?r.Buffer:void 0,l=i?i.isBuffer:void 0,u=l||n;e.exports=u})(ta,ta.exports)),ta.exports}var Xo,pd;function ps(){if(pd)return Xo;pd=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function r(n,a){var s=typeof n;return a=a??e,!!a&&(s=="number"||s!="symbol"&&t.test(n))&&n>-1&&n%1==0&&n<a}return Xo=r,Xo}var Zo,dd;function sc(){if(dd)return Zo;dd=1;var e=9007199254740991;function t(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=e}return Zo=t,Zo}var Qo,fd;function _T(){if(fd)return Qo;fd=1;var e=Tn(),t=sc(),r=Qt(),n="[object Arguments]",a="[object Array]",s="[object Boolean]",o="[object Date]",i="[object Error]",l="[object Function]",u="[object Map]",p="[object Number]",d="[object Object]",f="[object RegExp]",_="[object Set]",m="[object String]",h="[object WeakMap]",b="[object ArrayBuffer]",T="[object DataView]",y="[object Float32Array]",S="[object Float64Array]",w="[object Int8Array]",g="[object Int16Array]",I="[object Int32Array]",L="[object Uint8Array]",A="[object Uint8ClampedArray]",E="[object Uint16Array]",k="[object Uint32Array]",R={};R[y]=R[S]=R[w]=R[g]=R[I]=R[L]=R[A]=R[E]=R[k]=!0,R[n]=R[a]=R[b]=R[s]=R[T]=R[o]=R[i]=R[l]=R[u]=R[p]=R[d]=R[f]=R[_]=R[m]=R[h]=!1;function B(F){return r(F)&&t(F.length)&&!!R[e(F)]}return Qo=B,Qo}var Jo,md;function oc(){if(md)return Jo;md=1;function e(t){return function(r){return t(r)}}return Jo=e,Jo}var ra={exports:{}};ra.exports;var hd;function ic(){return hd||(hd=1,(function(e,t){var r=ch(),n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===n,o=s&&r.process,i=(function(){try{var l=a&&a.require&&a.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}})();e.exports=i})(ra,ra.exports)),ra.exports}var ei,_d;function lc(){if(_d)return ei;_d=1;var e=_T(),t=oc(),r=ic(),n=r&&r.isTypedArray,a=n?t(n):e;return ei=a,ei}var ti,yd;function Uh(){if(yd)return ti;yd=1;var e=qh(),t=as(),r=Ke(),n=cs(),a=ps(),s=lc(),o=Object.prototype,i=o.hasOwnProperty;function l(u,p){var d=r(u),f=!d&&t(u),_=!d&&!f&&n(u),m=!d&&!f&&!_&&s(u),h=d||f||_||m,b=h?e(u.length,String):[],T=b.length;for(var y in u)(p||i.call(u,y))&&!(h&&(y=="length"||_&&(y=="offset"||y=="parent")||m&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||a(y,T)))&&b.push(y);return b}return ti=l,ti}var ri,bd;function ds(){if(bd)return ri;bd=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||e;return r===a}return ri=t,ri}var ni,Td;function Bh(){if(Td)return ni;Td=1;function e(t,r){return function(n){return t(r(n))}}return ni=e,ni}var ai,gd;function yT(){if(gd)return ai;gd=1;var e=Bh(),t=e(Object.keys,Object);return ai=t,ai}var si,Id;function $h(){if(Id)return si;Id=1;var e=ds(),t=yT(),r=Object.prototype,n=r.hasOwnProperty;function a(s){if(!e(s))return t(s);var o=[];for(var i in Object(s))n.call(s,i)&&i!="constructor"&&o.push(i);return o}return si=a,si}var oi,Ed;function xr(){if(Ed)return oi;Ed=1;var e=Oh(),t=sc();function r(n){return n!=null&&t(n.length)&&!e(n)}return oi=r,oi}var ii,wd;function wa(){if(wd)return ii;wd=1;var e=Uh(),t=$h(),r=xr();function n(a){return r(a)?e(a):t(a)}return ii=n,ii}var li,Ad;function Vh(){if(Ad)return li;Ad=1;var e=Dh(),t=ac(),r=wa();function n(a){return e(a,r,t)}return li=n,li}var ui,Sd;function bT(){if(Sd)return ui;Sd=1;var e=Vh(),t=1,r=Object.prototype,n=r.hasOwnProperty;function a(s,o,i,l,u,p){var d=i&t,f=e(s),_=f.length,m=e(o),h=m.length;if(_!=h&&!d)return!1;for(var b=_;b--;){var T=f[b];if(!(d?T in o:n.call(o,T)))return!1}var y=p.get(s),S=p.get(o);if(y&&S)return y==o&&S==s;var w=!0;p.set(s,o),p.set(o,s);for(var g=d;++b<_;){T=f[b];var I=s[T],L=o[T];if(l)var A=d?l(L,I,T,o,s,p):l(I,L,T,s,o,p);if(!(A===void 0?I===L||u(I,L,i,l,p):A)){w=!1;break}g||(g=T=="constructor")}if(w&&!g){var E=s.constructor,k=o.constructor;E!=k&&"constructor"in s&&"constructor"in o&&!(typeof E=="function"&&E instanceof E&&typeof k=="function"&&k instanceof k)&&(w=!1)}return p.delete(s),p.delete(o),w}return ui=a,ui}var ci,Ld;function TT(){if(Ld)return ci;Ld=1;var e=Vr(),t=Bt(),r=e(t,"DataView");return ci=r,ci}var pi,Od;function gT(){if(Od)return pi;Od=1;var e=Vr(),t=Bt(),r=e(t,"Promise");return pi=r,pi}var di,Rd;function xh(){if(Rd)return di;Rd=1;var e=Vr(),t=Bt(),r=e(t,"Set");return di=r,di}var fi,kd;function IT(){if(kd)return fi;kd=1;var e=Vr(),t=Bt(),r=e(t,"WeakMap");return fi=r,fi}var mi,vd;function Aa(){if(vd)return mi;vd=1;var e=TT(),t=ec(),r=gT(),n=xh(),a=IT(),s=Tn(),o=Rh(),i="[object Map]",l="[object Object]",u="[object Promise]",p="[object Set]",d="[object WeakMap]",f="[object DataView]",_=o(e),m=o(t),h=o(r),b=o(n),T=o(a),y=s;return(e&&y(new e(new ArrayBuffer(1)))!=f||t&&y(new t)!=i||r&&y(r.resolve())!=u||n&&y(new n)!=p||a&&y(new a)!=d)&&(y=function(S){var w=s(S),g=w==l?S.constructor:void 0,I=g?o(g):"";if(I)switch(I){case _:return f;case m:return i;case h:return u;case b:return p;case T:return d}return w}),mi=y,mi}var hi,Pd;function ET(){if(Pd)return hi;Pd=1;var e=rc(),t=Nh(),r=mT(),n=bT(),a=Aa(),s=Ke(),o=cs(),i=lc(),l=1,u="[object Arguments]",p="[object Array]",d="[object Object]",f=Object.prototype,_=f.hasOwnProperty;function m(h,b,T,y,S,w){var g=s(h),I=s(b),L=g?p:a(h),A=I?p:a(b);L=L==u?d:L,A=A==u?d:A;var E=L==d,k=A==d,R=L==A;if(R&&o(h)){if(!o(b))return!1;g=!0,E=!1}if(R&&!E)return w||(w=new e),g||i(h)?t(h,b,T,y,S,w):r(h,b,L,T,y,S,w);if(!(T&l)){var B=E&&_.call(h,"__wrapped__"),F=k&&_.call(b,"__wrapped__");if(B||F){var te=B?h.value():h,de=F?b.value():b;return w||(w=new e),S(te,de,T,y,w)}}return R?(w||(w=new e),n(h,b,T,y,S,w)):!1}return hi=m,hi}var _i,Nd;function uc(){if(Nd)return _i;Nd=1;var e=ET(),t=Qt();function r(n,a,s,o,i){return n===a?!0:n==null||a==null||!t(n)&&!t(a)?n!==n&&a!==a:e(n,a,s,o,r,i)}return _i=r,_i}var yi,Cd;function wT(){if(Cd)return yi;Cd=1;var e=rc(),t=uc(),r=1,n=2;function a(s,o,i,l){var u=i.length,p=u,d=!l;if(s==null)return!p;for(s=Object(s);u--;){var f=i[u];if(d&&f[2]?f[1]!==s[f[0]]:!(f[0]in s))return!1}for(;++u<p;){f=i[u];var _=f[0],m=s[_],h=f[1];if(d&&f[2]){if(m===void 0&&!(_ in s))return!1}else{var b=new e;if(l)var T=l(m,h,_,s,o,b);if(!(T===void 0?t(h,m,r|n,l,b):T))return!1}}return!0}return yi=a,yi}var bi,Dd;function Hh(){if(Dd)return bi;Dd=1;var e=Jt();function t(r){return r===r&&!e(r)}return bi=t,bi}var Ti,Md;function AT(){if(Md)return Ti;Md=1;var e=Hh(),t=wa();function r(n){for(var a=t(n),s=a.length;s--;){var o=a[s],i=n[o];a[s]=[o,i,e(i)]}return a}return Ti=r,Ti}var gi,Fd;function jh(){if(Fd)return gi;Fd=1;function e(t,r){return function(n){return n==null?!1:n[t]===r&&(r!==void 0||t in Object(n))}}return gi=e,gi}var Ii,qd;function ST(){if(qd)return Ii;qd=1;var e=wT(),t=AT(),r=jh();function n(a){var s=t(a);return s.length==1&&s[0][2]?r(s[0][0],s[0][1]):function(o){return o===a||e(o,a,s)}}return Ii=n,Ii}var Ei,Ud;function cc(){if(Ud)return Ei;Ud=1;var e=Ke(),t=ya(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(s,o){if(e(s))return!1;var i=typeof s;return i=="number"||i=="symbol"||i=="boolean"||s==null||t(s)?!0:n.test(s)||!r.test(s)||o!=null&&s in Object(o)}return Ei=a,Ei}var wi,Bd;function LT(){if(Bd)return wi;Bd=1;var e=tc(),t="Expected a function";function r(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(t);var s=function(){var o=arguments,i=a?a.apply(this,o):o[0],l=s.cache;if(l.has(i))return l.get(i);var u=n.apply(this,o);return s.cache=l.set(i,u)||l,u};return s.cache=new(r.Cache||e),s}return r.Cache=e,wi=r,wi}var Ai,$d;function OT(){if($d)return Ai;$d=1;var e=LT(),t=500;function r(n){var a=e(n,function(o){return s.size===t&&s.clear(),o}),s=a.cache;return a}return Ai=r,Ai}var Si,Vd;function RT(){if(Vd)return Si;Vd=1;var e=OT(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(a){var s=[];return a.charCodeAt(0)===46&&s.push(""),a.replace(t,function(o,i,l,u){s.push(l?u.replace(r,"$1"):i||o)}),s});return Si=n,Si}var Li,xd;function kT(){if(xd)return Li;xd=1;var e=bn(),t=Ea(),r=Ke(),n=ya(),a=e?e.prototype:void 0,s=a?a.toString:void 0;function o(i){if(typeof i=="string")return i;if(r(i))return t(i,o)+"";if(n(i))return s?s.call(i):"";var l=i+"";return l=="0"&&1/i==-1/0?"-0":l}return Li=o,Li}var Oi,Hd;function vT(){if(Hd)return Oi;Hd=1;var e=kT();function t(r){return r==null?"":e(r)}return Oi=t,Oi}var Ri,jd;function gn(){if(jd)return Ri;jd=1;var e=Ke(),t=cc(),r=RT(),n=vT();function a(s,o){return e(s)?s:t(s,o)?[s]:r(n(s))}return Ri=a,Ri}var ki,zd;function In(){if(zd)return ki;zd=1;var e=ya();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return ki=t,ki}var vi,Gd;function fs(){if(Gd)return vi;Gd=1;var e=gn(),t=In();function r(n,a){a=e(a,n);for(var s=0,o=a.length;n!=null&&s<o;)n=n[t(a[s++])];return s&&s==o?n:void 0}return vi=r,vi}var Pi,Wd;function PT(){if(Wd)return Pi;Wd=1;var e=fs();function t(r,n,a){var s=r==null?void 0:e(r,n);return s===void 0?a:s}return Pi=t,Pi}var Ni,Yd;function NT(){if(Yd)return Ni;Yd=1;function e(t,r){return t!=null&&r in Object(t)}return Ni=e,Ni}var Ci,Kd;function CT(){if(Kd)return Ci;Kd=1;var e=gn(),t=as(),r=Ke(),n=ps(),a=sc(),s=In();function o(i,l,u){l=e(l,i);for(var p=-1,d=l.length,f=!1;++p<d;){var _=s(l[p]);if(!(f=i!=null&&u(i,_)))break;i=i[_]}return f||++p!=d?f:(d=i==null?0:i.length,!!d&&a(d)&&n(_,d)&&(r(i)||t(i)))}return Ci=o,Ci}var Di,Xd;function DT(){if(Xd)return Di;Xd=1;var e=NT(),t=CT();function r(n,a){return n!=null&&t(n,a,e)}return Di=r,Di}var Mi,Zd;function MT(){if(Zd)return Mi;Zd=1;var e=uc(),t=PT(),r=DT(),n=cc(),a=Hh(),s=jh(),o=In(),i=1,l=2;function u(p,d){return n(p)&&a(d)?s(o(p),d):function(f){var _=t(f,p);return _===void 0&&_===d?r(f,p):e(d,_,i|l)}}return Mi=u,Mi}var Fi,Qd;function zh(){if(Qd)return Fi;Qd=1;function e(t){return function(r){return r?.[t]}}return Fi=e,Fi}var qi,Jd;function FT(){if(Jd)return qi;Jd=1;var e=fs();function t(r){return function(n){return e(n,r)}}return qi=t,qi}var Ui,ef;function qT(){if(ef)return Ui;ef=1;var e=zh(),t=FT(),r=cc(),n=In();function a(s){return r(s)?e(n(s)):t(s)}return Ui=a,Ui}var Bi,tf;function En(){if(tf)return Bi;tf=1;var e=ST(),t=MT(),r=ba(),n=Ke(),a=qT();function s(o){return typeof o=="function"?o:o==null?r:typeof o=="object"?n(o)?t(o[0],o[1]):e(o):a(o)}return Bi=s,Bi}var $i,rf;function UT(){if(rf)return $i;rf=1;function e(t){return function(r,n,a){for(var s=-1,o=Object(r),i=a(r),l=i.length;l--;){var u=i[t?l:++s];if(n(o[u],u,o)===!1)break}return r}}return $i=e,$i}var Vi,nf;function BT(){if(nf)return Vi;nf=1;var e=UT(),t=e();return Vi=t,Vi}var xi,af;function Gh(){if(af)return xi;af=1;var e=BT(),t=wa();function r(n,a){return n&&e(n,a,t)}return xi=r,xi}var Hi,sf;function $T(){if(sf)return Hi;sf=1;var e=xr();function t(r,n){return function(a,s){if(a==null)return a;if(!e(a))return r(a,s);for(var o=a.length,i=n?o:-1,l=Object(a);(n?i--:++i<o)&&s(l[i],i,l)!==!1;);return a}}return Hi=t,Hi}var ji,of;function pc(){if(of)return ji;of=1;var e=Gh(),t=$T(),r=t(e);return ji=r,ji}var zi,lf;function VT(){if(lf)return zi;lf=1;var e=pc(),t=xr();function r(n,a){var s=-1,o=t(n)?Array(n.length):[];return e(n,function(i,l,u){o[++s]=a(i,l,u)}),o}return zi=r,zi}var Gi,uf;function xT(){if(uf)return Gi;uf=1;var e=Ea(),t=En(),r=VT(),n=Ke();function a(s,o){var i=n(s)?e:r;return i(s,t(o,3))}return Gi=a,Gi}var Wi,cf;function HT(){if(cf)return Wi;cf=1;var e=Lh(),t=xT();function r(n,a){return e(t(n,a),1)}return Wi=r,Wi}var jT=HT();const hn=xe(jT);var Yi,pf;function Wh(){if(pf)return Yi;pf=1;var e=Vr(),t=(function(){try{var r=e(Object,"defineProperty");return r({},"",{}),r}catch{}})();return Yi=t,Yi}var Ki,df;function dc(){if(df)return Ki;df=1;var e=Wh();function t(r,n,a){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[n]=a}return Ki=t,Ki}var Xi,ff;function zT(){if(ff)return Xi;ff=1;var e=dc(),t=Gh(),r=En();function n(a,s){var o={};return s=r(s,3),t(a,function(i,l,u){e(o,l,s(i,l,u))}),o}return Xi=n,Xi}var GT=zT();const Xt=xe(GT);var Zi,mf;function WT(){if(mf)return Zi;mf=1;var e=Math.ceil,t=Math.max;function r(n,a,s,o){for(var i=-1,l=t(e((a-n)/(s||1)),0),u=Array(l);l--;)u[o?l:++i]=n,n+=s;return u}return Zi=r,Zi}var Qi,hf;function fc(){if(hf)return Qi;hf=1;var e=ss(),t=xr(),r=ps(),n=Jt();function a(s,o,i){if(!n(i))return!1;var l=typeof o;return(l=="number"?t(i)&&r(o,i.length):l=="string"&&o in i)?e(i[o],s):!1}return Qi=a,Qi}var Ji,_f;function YT(){if(_f)return Ji;_f=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return Ji=t,Ji}var el,yf;function KT(){if(yf)return el;yf=1;var e=YT(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return el=r,el}var tl,bf;function XT(){if(bf)return tl;bf=1;var e=KT(),t=Jt(),r=ya(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,o=/^0o[0-7]+$/i,i=parseInt;function l(u){if(typeof u=="number")return u;if(r(u))return n;if(t(u)){var p=typeof u.valueOf=="function"?u.valueOf():u;u=t(p)?p+"":p}if(typeof u!="string")return u===0?u:+u;u=e(u);var d=s.test(u);return d||o.test(u)?i(u.slice(2),d?2:8):a.test(u)?n:+u}return tl=l,tl}var rl,Tf;function Yh(){if(Tf)return rl;Tf=1;var e=XT(),t=1/0,r=17976931348623157e292;function n(a){if(!a)return a===0?a:0;if(a=e(a),a===t||a===-t){var s=a<0?-1:1;return s*r}return a===a?a:0}return rl=n,rl}var nl,gf;function ZT(){if(gf)return nl;gf=1;var e=WT(),t=fc(),r=Yh();function n(a){return function(s,o,i){return i&&typeof i!="number"&&t(s,o,i)&&(o=i=void 0),s=r(s),o===void 0?(o=s,s=0):o=r(o),i=i===void 0?s<o?1:-1:r(i),e(s,o,i,a)}}return nl=n,nl}var al,If;function QT(){if(If)return al;If=1;var e=ZT(),t=e();return al=t,al}var JT=QT();const cn=xe(JT);var sl,Ef;function eg(){if(Ef)return sl;Ef=1;function e(t,r,n,a){var s=-1,o=t==null?0:t.length;for(a&&o&&(n=t[++s]);++s<o;)n=r(n,t[s],s,t);return n}return sl=e,sl}var ol,wf;function tg(){if(wf)return ol;wf=1;function e(t,r,n,a,s){return s(t,function(o,i,l){n=a?(a=!1,o):r(n,o,i,l)}),n}return ol=e,ol}var il,Af;function rg(){if(Af)return il;Af=1;var e=eg(),t=pc(),r=En(),n=tg(),a=Ke();function s(o,i,l){var u=a(o)?e:n,p=arguments.length<3;return u(o,r(i,4),l,p,t)}return il=s,il}var ng=rg();const lt=xe(ng),mc=(e,t,r)=>{const{gripperEntities:n,moduleEntities:a}=t,s=Dn(r,e.moduleId),o=Object.keys(n).length>0,i=[];if((e.moduleId==null||s==null)&&i.push(X()),o||i.push(ah()),i.length>0)return{errors:i};const l=a[e.moduleId].pythonName;return{commands:[{commandType:"absorbanceReader/closeLid",key:D(),params:{moduleId:e.moduleId}}],python:`${l}.close_lid()`}},Kh=(e,t,r)=>{const{moduleId:n,sampleWavelengths:a,measureMode:s,referenceWavelength:o}=e,i=t.moduleEntities[n].pythonName,l=o!=null?`, reference_wavelength=${o}`:"";return{commands:[{commandType:"absorbanceReader/initialize",key:D(),params:{moduleId:n,measureMode:s,sampleWavelengths:a,...o!=null?{referenceWavelength:o}:{}}}],python:`${i}.initialize(${N(s)}, ${_c(a)}${l})`}},ag=(e,t,r)=>{const{gripperEntities:n,moduleEntities:a}=t,s=Dn(r,e.moduleId),o=Object.keys(n).length>0,i=[];if((e.moduleId==null||s==null)&&i.push(X()),o||i.push(ah()),i.length>0)return{errors:i};const l=a[e.moduleId].pythonName;return{commands:[{commandType:"absorbanceReader/openLid",key:D(),params:{moduleId:e.moduleId}}],python:`${l}.open_lid()`}},Xh=(e,t,r)=>{const{moduleId:n,fileName:a}=e,s=[],o=Dn(r,n);if(o==null)return{errors:[X()]};o.initialization===null&&s.push(Dr());const i=t.moduleEntities[n].pythonName,l=a!=null?`export_filename=${N(a)}`:"";return s.length>0?{errors:s}:{commands:[{commandType:"absorbanceReader/read",key:D(),params:{moduleId:n,...a!=null?{fileName:a}:{}}}],python:`${i}.read(${l})`}},Zt=(e,t,r)=>{const{flowRate:n,pipetteId:a,volume:s,correctionVolume:o}=e,i=[];t.pipetteEntities[a]?.spec||i.push(ut({pipette:a}));const u=t.pipetteEntities[a].pythonName;return{commands:[{commandType:"airGapInPlace",key:D(),params:{flowRate:n,pipetteId:a,volume:s,...o!=null?{correctionVolume:o}:{}}}],python:`${u}.air_gap(${[`volume=${s}`,"in_place=True",`flow_rate=${n}`].join(", ")})`}},sg=(e,t,r)=>{const{pipetteId:n,volume:a,labwareId:s,wellName:o,flowRate:i,isAirGap:l,tipRack:u,wellLocation:p,primaryNozzle:d,nozzles:f}=e,_="aspirate",m=r.labware,h=[],b=t.pipetteEntities[n]?.spec,T=(b?.displayCategory==="FLEX"||b?.channels===96)??!1,y=Rn(s,r.labware);if(b||h.push(ut({pipette:n})),!s||!r.labware[s]?h.push(ct({actionName:_,labware:s})):z(r.labware[s].stack)==="offDeck"&&h.push(mn()),De.includes(y))h.push(Ft({typeOfStep:_}));else if(m[y]!=null){const E=z(m[y].stack);De.includes(E)&&h.push(Ft({typeOfStep:_}))}if(vn({pipette:n,labware:s,invariantContext:t,prevRobotState:r})&&h.push(pa()),r.tipState.pipettes[n]?.hasTip||h.push(Ut({actionName:_,pipette:n,labware:s,well:o})),t.pipetteEntities[n]?.spec.channels!==1&&b&&!wt({robotState:r,invariantContext:t,pipetteId:n,labwareId:s,wellLocationOffset:p?.offset??{x:0,y:0,z:0},wellTargetName:o,primaryNozzle:d,nozzleConfiguration:f})&&h.push($r()),Pa(r.modules,r.labware,s)&&h.push(dn()),Ra(r.modules,r.labware,s)&&h.push(Dr()),Da(r.modules,r.labware,s)&&h.push(ts()),Ma(r.modules,r.labware,s)&&h.push(fn()),Cn(r.modules,y,T?c.FLEX_ROBOT_TYPE:c.OT2_ROBOT_TYPE)&&h.push(fa()),T||(Pn(r.modules,y)&&h.push(da()),Nn(r.modules,y,b)&&h.push(ma()),Ca(r.modules,y,b,t.labwareEntities[s])&&h.push(rs())),h.length===0&&b&&b.liquids.default.maxVolume<a&&h.push(Xa({actionName:_,volume:a,maxVolume:b.liquids.default.maxVolume})),h.length===0&&b){const E=Os(n,t,u);E<a&&h.push(Uy({actionName:_,volume:a,maxVolume:E}))}if(h.length>0)return{errors:h};const w=[{commandType:"aspirate",key:D(),params:{pipetteId:n,volume:a,labwareId:s,wellName:o,wellLocation:p,flowRate:i},...l&&{meta:{isAirGap:l}}}],g=t.pipetteEntities[n].pythonName,I=t.labwareEntities[s].pythonName,L=[`volume=${a}`,`location=${I}[${N(o)}]${An(p)}`,`flow_rate=${i}`],A=`${g}.aspirate(
|
|
2
|
+
${Z(L.join(`,
|
|
3
3
|
`))},
|
|
4
|
-
)`;return{commands:
|
|
5
|
-
${
|
|
6
|
-
${
|
|
7
|
-
${
|
|
4
|
+
)`;return{commands:w,python:A}},ms=(e,t,r)=>{const{pipetteId:n,volume:a,flowRate:s,correctionVolume:o}=e,i=[{commandType:"aspirateInPlace",key:D(),params:{pipetteId:n,volume:a,flowRate:s,...o!=null?{correctionVolume:o}:{}}}],l=[];r.tipState.pipettes[n]?.hasTip||l.push(Ut({actionName:"aspirate",pipette:n}));const u=t.pipetteEntities[n].pythonName,p=[`volume=${a}`,`flow_rate=${s}`],d=`${u}.aspirate(${p.join(", ")})`;return l.length>0?{errors:l}:{commands:i,python:d}},Sa=(e,t,r)=>{const{pipetteId:n,flowRate:a}=e,s=[];if(r.tipState.pipettes[n]?.hasTip||s.push(Ut({actionName:"blowout",pipette:n})),s.length>0)return{errors:s};const o=t.pipetteEntities[n].pythonName;return{commands:[{commandType:"blowOutInPlace",key:D(),params:{pipetteId:n,flowRate:a}}],python:`${o}.flow_rate.blow_out = ${a}
|
|
5
|
+
${o}.blow_out()`}},Zh=(e,t,r)=>{const{pipetteId:n,labwareId:a,wellName:s,wellLocation:o,flowRate:i}=e,{pipetteEntities:l,labwareEntities:u}=t,p=l[n],d="blowout",f=[],_=p?.spec,m=(_?.displayCategory==="FLEX"||_?.channels===96)??!1,h=r.pipettes[n],b=r.labware,T=Rn(a,r.labware);if(h||f.push(ut({pipette:n})),_==null&&f.push(ut({pipette:n})),r.tipState.pipettes[n]?.hasTip||f.push(Ut({actionName:d,pipette:n,labware:a,well:s})),!a||!r.labware[a]?f.push(ct({actionName:d,labware:a})):z(r.labware[a].stack)==="offDeck"&&f.push(mn()),De.includes(T))f.push(Ft({typeOfStep:d}));else if(b[T]!=null){const g=z(b[T].stack);De.includes(g)&&f.push(Ft({typeOfStep:d}))}if(vn({pipette:n,labware:a,invariantContext:t,prevRobotState:r})&&f.push(pa()),Pa(r.modules,r.labware,a)&&f.push(dn()),Ra(r.modules,r.labware,a)&&f.push(Dr()),Da(r.modules,r.labware,a)&&f.push(ts()),Ma(r.modules,r.labware,a)&&f.push(fn()),Cn(r.modules,T,m?c.FLEX_ROBOT_TYPE:c.OT2_ROBOT_TYPE)&&f.push(fa()),!m&&_!=null&&(Pn(r.modules,T)&&f.push(da()),Nn(r.modules,T,_)&&f.push(ma()),Ca(r.modules,T,_,t.labwareEntities[a])&&f.push(rs())),f.length>0)return{errors:f};const y=p.pythonName,S=u[a].pythonName;return{commands:[{commandType:"blowout",key:D(),params:{pipetteId:n,labwareId:a,wellName:s,flowRate:i,wellLocation:o}}],python:`${y}.flow_rate.blow_out = ${i}
|
|
6
|
+
${y}.blow_out(${S}[${N(s)}]${An(o)})`}},og=(e,t,r)=>{const n={commandType:"captureImage",key:D(),params:{homeBefore:e.homeBefore,fileName:e.fileName,resolution:e.resolution,zoom:e.zoom,contrast:e.contrast,brightness:e.brightness,saturation:e.saturation}},a=`${ge}.capture_image()`;return{commands:[n],python:a}},ig=(e,t,r)=>{const{message:n}=e,a=[{commandType:"comment",key:D(),params:{message:n}}],s=`${ge}.comment(${N(n)})`;return{commands:a,python:s}},sa=(e,t,r)=>{const{pipetteId:n,volume:a}=e,s=t.pipetteEntities[n];return s?{commands:[{commandType:"configureForVolume",key:D(),params:{pipetteId:n,volume:a}}],python:`${s.pythonName}.configure_for_volume(${a})`}:{commands:[]}},lg=(e,t,r)=>{const{pipetteId:n,configurationParams:a}=e,{style:s,primaryNozzle:o}=a,i=[{commandType:"configureNozzleLayout",key:D(),params:{pipetteId:n,configurationParams:a}}],l=t.pipetteEntities[n].pythonName;let u;return s===c.PARTIAL_COLUMN?u=[`protocol_api.${s}`,...o!=null?[`start=${N(c.H1_NOZZLE)}, end=${N(o)}`]:[]]:u=[`protocol_api.${s}`,...o!=null?[`start=${N(o)}`]:[]],{commands:i,python:`${l}.configure_nozzle_layout(
|
|
7
|
+
${Z(u.join(`,
|
|
8
8
|
`))},
|
|
9
|
-
)`}},
|
|
10
|
-
${i}.deactivate_block()`}:o===f.HEATERSHAKER_MODULE_TYPE?{commands:[{commandType:"heaterShaker/deactivateHeater",key:ne(),params:s}],python:`${i}.deactivate_heater()`}:(console.error(`setTemperature expected module ${n} to be ${f.TEMPERATURE_MODULE_TYPE}, ${f.THERMOCYCLER_MODULE_TYPE} or ${f.HEATERSHAKER_MODULE_TYPE}, got ${o}`),{errors:[ke()]})},Me=(e,t,r)=>{const{message:n}=e;let a,o;if("seconds"in e){a={commandType:"waitForDuration",key:ne(),params:{seconds:e.seconds,message:n}};const i=[`seconds=${e.seconds}`,...n?[`msg=${ee(n)}`]:[]];o=`${$e}.delay(${i.join(", ")})`}else a={commandType:"waitForResume",key:ne(),params:{message:n}},o=`${$e}.pause(${n?ee(n):""})`;return{commands:[a],python:o}};var dl={exports:{}},ml={},hl={},yl={},bl,qm;function yp(){return qm||(qm=1,bl=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;t[r]=a;for(r in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var i=Object.getOwnPropertyDescriptor(t,r);if(i.value!==a||i.enumerable!==!0)return!1}return!0}),bl}var gl,Fm;function bp(){if(Fm)return gl;Fm=1;var e=yp();return gl=function(){return e()&&!!Symbol.toStringTag},gl}var _l,Mm;function ww(){return Mm||(Mm=1,_l=Error),_l}var Tl,Um;function Iw(){return Um||(Um=1,Tl=EvalError),Tl}var El,Bm;function Sw(){return Bm||(Bm=1,El=RangeError),El}var wl,jm;function Aw(){return jm||(jm=1,wl=ReferenceError),wl}var Il,$m;function og(){return $m||($m=1,Il=SyntaxError),Il}var Sl,xm;function ho(){return xm||(xm=1,Sl=TypeError),Sl}var Al,Vm;function Ow(){return Vm||(Vm=1,Al=URIError),Al}var Ol,Hm;function vw(){if(Hm)return Ol;Hm=1;var e=typeof Symbol<"u"&&Symbol,t=yp();return Ol=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Ol}var vl,Gm;function Lw(){if(Gm)return vl;Gm=1;var e={__proto__:null,foo:{}},t=Object;return vl=function(){return{__proto__:e}.foo===e.foo&&!(e instanceof t)},vl}var Ll,zm;function Rw(){if(zm)return Ll;zm=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,n="[object Function]",a=function(l,u){for(var c=[],p=0;p<l.length;p+=1)c[p]=l[p];for(var d=0;d<u.length;d+=1)c[d+l.length]=u[d];return c},o=function(l,u){for(var c=[],p=u,d=0;p<l.length;p+=1,d+=1)c[d]=l[p];return c},i=function(s,l){for(var u="",c=0;c<s.length;c+=1)u+=s[c],c+1<s.length&&(u+=l);return u};return Ll=function(l){var u=this;if(typeof u!="function"||t.apply(u)!==n)throw new TypeError(e+u);for(var c=o(arguments,1),p,d=function(){if(this instanceof p){var T=u.apply(this,a(c,arguments));return Object(T)===T?T:this}return u.apply(l,a(c,arguments))},y=r(0,u.length-c.length),b=[],h=0;h<y;h++)b[h]="$"+h;if(p=Function("binder","return function ("+i(b,",")+"){ return binder.apply(this,arguments); }")(d),u.prototype){var g=function(){};g.prototype=u.prototype,p.prototype=new g,g.prototype=null}return p},Ll}var Rl,Wm;function gp(){if(Wm)return Rl;Wm=1;var e=Rw();return Rl=Function.prototype.bind||e,Rl}var Pl,Ym;function Pw(){if(Ym)return Pl;Ym=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=gp();return Pl=r.call(e,t),Pl}var kl,Km;function wa(){if(Km)return kl;Km=1;var e,t=ww(),r=Iw(),n=Sw(),a=Aw(),o=og(),i=ho(),s=Ow(),l=Function,u=function(le){try{return l('"use strict"; return ('+le+").constructor;")()}catch{}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch{c=null}var p=function(){throw new i},d=c?function(){try{return arguments.callee,p}catch{try{return c(arguments,"callee").get}catch{return p}}}():p,y=vw()(),b=Lw()(),h=Object.getPrototypeOf||(b?function(le){return le.__proto__}:null),g={},T=typeof Uint8Array>"u"||!h?e:h(Uint8Array),m={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":y&&h?h([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":g,"%AsyncGenerator%":g,"%AsyncGeneratorFunction%":g,"%AsyncIteratorPrototype%":g,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":l,"%GeneratorFunction%":g,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":y&&h?h(h([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!y||!h?e:h(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":n,"%ReferenceError%":a,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!y||!h?e:h(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":y&&h?h(""[Symbol.iterator]()):e,"%Symbol%":y?Symbol:e,"%SyntaxError%":o,"%ThrowTypeError%":d,"%TypedArray%":T,"%TypeError%":i,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":s,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet};if(h)try{null.error}catch(le){var _=h(h(le));m["%Error.prototype%"]=_}var I=function le(re){var U;if(re==="%AsyncFunction%")U=u("async function () {}");else if(re==="%GeneratorFunction%")U=u("function* () {}");else if(re==="%AsyncGeneratorFunction%")U=u("async function* () {}");else if(re==="%AsyncGenerator%"){var x=le("%AsyncGeneratorFunction%");x&&(U=x.prototype)}else if(re==="%AsyncIteratorPrototype%"){var W=le("%AsyncGenerator%");W&&h&&(U=h(W.prototype))}return m[re]=U,U},S={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=gp(),v=Pw(),C=O.call(Function.call,Array.prototype.concat),N=O.call(Function.apply,Array.prototype.splice),V=O.call(Function.call,String.prototype.replace),$=O.call(Function.call,String.prototype.slice),G=O.call(Function.call,RegExp.prototype.exec),X=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,fe=/\\(\\)?/g,be=function(re){var U=$(re,0,1),x=$(re,-1);if(U==="%"&&x!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(x==="%"&&U!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var W=[];return V(re,X,function(w,R,E,A){W[W.length]=E?V(A,fe,"$1"):R||w}),W},ge=function(re,U){var x=re,W;if(v(S,x)&&(W=S[x],x="%"+W[0]+"%"),v(m,x)){var w=m[x];if(w===g&&(w=I(x)),typeof w>"u"&&!U)throw new i("intrinsic "+re+" exists, but is not available. Please file an issue!");return{alias:W,name:x,value:w}}throw new o("intrinsic "+re+" does not exist!")};return kl=function(re,U){if(typeof re!="string"||re.length===0)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof U!="boolean")throw new i('"allowMissing" argument must be a boolean');if(G(/^%?[^%]*%?$/,re)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var x=be(re),W=x.length>0?x[0]:"",w=ge("%"+W+"%",U),R=w.name,E=w.value,A=!1,L=w.alias;L&&(W=L[0],N(x,C([0,1],L)));for(var M=1,q=!0;M<x.length;M+=1){var P=x[M],D=$(P,0,1),z=$(P,-1);if((D==='"'||D==="'"||D==="`"||z==='"'||z==="'"||z==="`")&&D!==z)throw new o("property names with quotes must have matching quotes");if((P==="constructor"||!q)&&(A=!0),W+="."+P,R="%"+W+"%",v(m,R))E=m[R];else if(E!=null){if(!(P in E)){if(!U)throw new i("base intrinsic for "+re+" exists, but the property is not available.");return}if(c&&M+1>=x.length){var H=c(E,P);q=!!H,q&&"get"in H&&!("originalValue"in H.get)?E=H.get:E=E[P]}else q=v(E,P),E=E[P];q&&!A&&(m[R]=E)}}return E},kl}var Nl={exports:{}},Cl,Xm;function _p(){if(Xm)return Cl;Xm=1;var e=wa(),t=e("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return Cl=t,Cl}var Dl,Zm;function Tp(){if(Zm)return Dl;Zm=1;var e=wa(),t=e("%Object.getOwnPropertyDescriptor%",!0);if(t)try{t([],"length")}catch{t=null}return Dl=t,Dl}var ql,Jm;function ig(){if(Jm)return ql;Jm=1;var e=_p(),t=og(),r=ho(),n=Tp();return ql=function(o,i,s){if(!o||typeof o!="object"&&typeof o!="function")throw new r("`obj` must be an object or a function`");if(typeof i!="string"&&typeof i!="symbol")throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new r("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,p=arguments.length>6?arguments[6]:!1,d=!!n&&n(o,i);if(e)e(o,i,{configurable:c===null&&d?d.configurable:!c,enumerable:l===null&&d?d.enumerable:!l,value:s,writable:u===null&&d?d.writable:!u});else if(p||!l&&!u&&!c)o[i]=s;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},ql}var Fl,Qm;function sg(){if(Qm)return Fl;Qm=1;var e=_p(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},Fl=t,Fl}var Ml,eh;function kw(){if(eh)return Ml;eh=1;var e=wa(),t=ig(),r=sg()(),n=Tp(),a=ho(),o=e("%Math.floor%");return Ml=function(s,l){if(typeof s!="function")throw new a("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||o(l)!==l)throw new a("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],c=!0,p=!0;if("length"in s&&n){var d=n(s,"length");d&&!d.configurable&&(c=!1),d&&!d.writable&&(p=!1)}return(c||p||!u)&&(r?t(s,"length",l,!0,!0):t(s,"length",l)),s},Ml}var th;function yo(){return th||(th=1,function(e){var t=gp(),r=wa(),n=kw(),a=ho(),o=r("%Function.prototype.apply%"),i=r("%Function.prototype.call%"),s=r("%Reflect.apply%",!0)||t.call(i,o),l=_p(),u=r("%Math.max%");e.exports=function(d){if(typeof d!="function")throw new a("a function is required");var y=s(t,i,arguments);return n(y,1+u(0,d.length-(arguments.length-1)),!0)};var c=function(){return s(t,o,arguments)};l?l(e.exports,"apply",{value:c}):e.exports.apply=c}(Nl)),Nl.exports}var Ul,rh;function bo(){if(rh)return Ul;rh=1;var e=wa(),t=yo(),r=t(e("String.prototype.indexOf"));return Ul=function(a,o){var i=e(a,!!o);return typeof i=="function"&&r(a,".prototype.")>-1?t(i):i},Ul}var Bl,nh;function Nw(){if(nh)return Bl;nh=1;var e=bp()(),t=bo(),r=t("Object.prototype.toString"),n=function(s){return e&&s&&typeof s=="object"&&Symbol.toStringTag in s?!1:r(s)==="[object Arguments]"},a=function(s){return n(s)?!0:s!==null&&typeof s=="object"&&typeof s.length=="number"&&s.length>=0&&r(s)!=="[object Array]"&&r(s.callee)==="[object Function]"},o=function(){return n(arguments)}();return n.isLegacyArguments=a,Bl=o?n:a,Bl}var jl,ah;function Cw(){if(ah)return jl;ah=1;var e=Object.prototype.toString,t=Function.prototype.toString,r=/^\s*(?:function)?\*/,n=bp()(),a=Object.getPrototypeOf,o=function(){if(!n)return!1;try{return Function("return function*() {}")()}catch{}},i;return jl=function(l){if(typeof l!="function")return!1;if(r.test(t.call(l)))return!0;if(!n){var u=e.call(l);return u==="[object GeneratorFunction]"}if(!a)return!1;if(typeof i>"u"){var c=o();i=c?a(c):!1}return a(l)===i},jl}var $l,oh;function Dw(){if(oh)return $l;oh=1;var e=Function.prototype.toString,t=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,r,n;if(typeof t=="function"&&typeof Object.defineProperty=="function")try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},t(function(){throw 42},null,r)}catch(m){m!==n&&(t=null)}else t=null;var a=/^\s*class\b/,o=function(_){try{var I=e.call(_);return a.test(I)}catch{return!1}},i=function(_){try{return o(_)?!1:(e.call(_),!0)}catch{return!1}},s=Object.prototype.toString,l="[object Object]",u="[object Function]",c="[object GeneratorFunction]",p="[object HTMLAllCollection]",d="[object HTML document.all class]",y="[object HTMLCollection]",b=typeof Symbol=="function"&&!!Symbol.toStringTag,h=!(0 in[,]),g=function(){return!1};if(typeof document=="object"){var T=document.all;s.call(T)===s.call(document.all)&&(g=function(_){if((h||!_)&&(typeof _>"u"||typeof _=="object"))try{var I=s.call(_);return(I===p||I===d||I===y||I===l)&&_("")==null}catch{}return!1})}return $l=t?function(_){if(g(_))return!0;if(!_||typeof _!="function"&&typeof _!="object")return!1;try{t(_,null,r)}catch(I){if(I!==n)return!1}return!o(_)&&i(_)}:function(_){if(g(_))return!0;if(!_||typeof _!="function"&&typeof _!="object")return!1;if(b)return i(_);if(o(_))return!1;var I=s.call(_);return I!==u&&I!==c&&!/^\[object HTML/.test(I)?!1:i(_)},$l}var xl,ih;function qw(){if(ih)return xl;ih=1;var e=Dw(),t=Object.prototype.toString,r=Object.prototype.hasOwnProperty,n=function(l,u,c){for(var p=0,d=l.length;p<d;p++)r.call(l,p)&&(c==null?u(l[p],p,l):u.call(c,l[p],p,l))},a=function(l,u,c){for(var p=0,d=l.length;p<d;p++)c==null?u(l.charAt(p),p,l):u.call(c,l.charAt(p),p,l)},o=function(l,u,c){for(var p in l)r.call(l,p)&&(c==null?u(l[p],p,l):u.call(c,l[p],p,l))},i=function(l,u,c){if(!e(u))throw new TypeError("iterator must be a function");var p;arguments.length>=3&&(p=c),t.call(l)==="[object Array]"?n(l,u,p):typeof l=="string"?a(l,u,p):o(l,u,p)};return xl=i,xl}var Vl,sh;function Fw(){return sh||(sh=1,Vl=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Vl}var Hl,lh;function Mw(){if(lh)return Hl;lh=1;var e=Fw(),t=globalThis;return Hl=function(){for(var n=[],a=0;a<e.length;a++)typeof t[e[a]]=="function"&&(n[n.length]=e[a]);return n},Hl}var Gl,uh;function lg(){if(uh)return Gl;uh=1;var e=qw(),t=Mw(),r=yo(),n=bo(),a=Tp(),o=n("Object.prototype.toString"),i=bp()(),s=globalThis,l=t(),u=n("String.prototype.slice"),c=Object.getPrototypeOf,p=n("Array.prototype.indexOf",!0)||function(g,T){for(var m=0;m<g.length;m+=1)if(g[m]===T)return m;return-1},d={__proto__:null};i&&a&&c?e(l,function(h){var g=new s[h];if(Symbol.toStringTag in g){var T=c(g),m=a(T,Symbol.toStringTag);if(!m){var _=c(T);m=a(_,Symbol.toStringTag)}d["$"+h]=r(m.get)}}):e(l,function(h){var g=new s[h],T=g.slice||g.set;T&&(d["$"+h]=r(T))});var y=function(g){var T=!1;return e(d,function(m,_){if(!T)try{"$"+m(g)===_&&(T=u(_,1))}catch{}}),T},b=function(g){var T=!1;return e(d,function(m,_){if(!T)try{m(g),T=u(_,1)}catch{}}),T};return Gl=function(g){if(!g||typeof g!="object")return!1;if(!i){var T=u(o(g),8,-1);return p(l,T)>-1?T:T!=="Object"?!1:b(g)}return a?y(g):null},Gl}var zl,ch;function Uw(){if(ch)return zl;ch=1;var e=lg();return zl=function(r){return!!e(r)},zl}var ph;function Bw(){return ph||(ph=1,function(e){var t=Nw(),r=Cw(),n=lg(),a=Uw();function o(B){return B.call.bind(B)}var i=typeof BigInt<"u",s=typeof Symbol<"u",l=o(Object.prototype.toString),u=o(Number.prototype.valueOf),c=o(String.prototype.valueOf),p=o(Boolean.prototype.valueOf);if(i)var d=o(BigInt.prototype.valueOf);if(s)var y=o(Symbol.prototype.valueOf);function b(B,qe){if(typeof B!="object")return!1;try{return qe(B),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=r,e.isTypedArray=a;function h(B){return typeof Promise<"u"&&B instanceof Promise||B!==null&&typeof B=="object"&&typeof B.then=="function"&&typeof B.catch=="function"}e.isPromise=h;function g(B){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(B):a(B)||R(B)}e.isArrayBufferView=g;function T(B){return n(B)==="Uint8Array"}e.isUint8Array=T;function m(B){return n(B)==="Uint8ClampedArray"}e.isUint8ClampedArray=m;function _(B){return n(B)==="Uint16Array"}e.isUint16Array=_;function I(B){return n(B)==="Uint32Array"}e.isUint32Array=I;function S(B){return n(B)==="Int8Array"}e.isInt8Array=S;function O(B){return n(B)==="Int16Array"}e.isInt16Array=O;function v(B){return n(B)==="Int32Array"}e.isInt32Array=v;function C(B){return n(B)==="Float32Array"}e.isFloat32Array=C;function N(B){return n(B)==="Float64Array"}e.isFloat64Array=N;function V(B){return n(B)==="BigInt64Array"}e.isBigInt64Array=V;function $(B){return n(B)==="BigUint64Array"}e.isBigUint64Array=$;function G(B){return l(B)==="[object Map]"}G.working=typeof Map<"u"&&G(new Map);function X(B){return typeof Map>"u"?!1:G.working?G(B):B instanceof Map}e.isMap=X;function fe(B){return l(B)==="[object Set]"}fe.working=typeof Set<"u"&&fe(new Set);function be(B){return typeof Set>"u"?!1:fe.working?fe(B):B instanceof Set}e.isSet=be;function ge(B){return l(B)==="[object WeakMap]"}ge.working=typeof WeakMap<"u"&&ge(new WeakMap);function le(B){return typeof WeakMap>"u"?!1:ge.working?ge(B):B instanceof WeakMap}e.isWeakMap=le;function re(B){return l(B)==="[object WeakSet]"}re.working=typeof WeakSet<"u"&&re(new WeakSet);function U(B){return re(B)}e.isWeakSet=U;function x(B){return l(B)==="[object ArrayBuffer]"}x.working=typeof ArrayBuffer<"u"&&x(new ArrayBuffer);function W(B){return typeof ArrayBuffer>"u"?!1:x.working?x(B):B instanceof ArrayBuffer}e.isArrayBuffer=W;function w(B){return l(B)==="[object DataView]"}w.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&w(new DataView(new ArrayBuffer(1),0,1));function R(B){return typeof DataView>"u"?!1:w.working?w(B):B instanceof DataView}e.isDataView=R;var E=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function A(B){return l(B)==="[object SharedArrayBuffer]"}function L(B){return typeof E>"u"?!1:(typeof A.working>"u"&&(A.working=A(new E)),A.working?A(B):B instanceof E)}e.isSharedArrayBuffer=L;function M(B){return l(B)==="[object AsyncFunction]"}e.isAsyncFunction=M;function q(B){return l(B)==="[object Map Iterator]"}e.isMapIterator=q;function P(B){return l(B)==="[object Set Iterator]"}e.isSetIterator=P;function D(B){return l(B)==="[object Generator]"}e.isGeneratorObject=D;function z(B){return l(B)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=z;function H(B){return b(B,u)}e.isNumberObject=H;function oe(B){return b(B,c)}e.isStringObject=oe;function K(B){return b(B,p)}e.isBooleanObject=K;function ue(B){return i&&b(B,d)}e.isBigIntObject=ue;function de(B){return s&&b(B,y)}e.isSymbolObject=de;function J(B){return H(B)||oe(B)||K(B)||ue(B)||de(B)}e.isBoxedPrimitive=J;function ce(B){return typeof Uint8Array<"u"&&(W(B)||L(B))}e.isAnyArrayBuffer=ce,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(B){Object.defineProperty(e,B,{enumerable:!1,value:function(){throw new Error(B+" is not supported in userland")}})})}(yl)),yl}var Wl,fh;function jw(){return fh||(fh=1,Wl=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"}),Wl}var Ga={exports:{}},dh;function $w(){return dh||(dh=1,typeof Object.create=="function"?Ga.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Ga.exports=function(t,r){if(r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}}),Ga.exports}var mh;function aa(){return mh||(mh=1,function(e){var t=Object.getOwnPropertyDescriptors||function(R){for(var E=Object.keys(R),A={},L=0;L<E.length;L++)A[E[L]]=Object.getOwnPropertyDescriptor(R,E[L]);return A},r=/%[sdj%]/g;e.format=function(w){if(!S(w)){for(var R=[],E=0;E<arguments.length;E++)R.push(i(arguments[E]));return R.join(" ")}for(var E=1,A=arguments,L=A.length,M=String(w).replace(r,function(P){if(P==="%%")return"%";if(E>=L)return P;switch(P){case"%s":return String(A[E++]);case"%d":return Number(A[E++]);case"%j":try{return JSON.stringify(A[E++])}catch{return"[Circular]"}default:return P}}),q=A[E];E<L;q=A[++E])m(q)||!N(q)?M+=" "+q:M+=" "+i(q);return M},e.deprecate=function(w,R){if(typeof process<"u"&&process.noDeprecation===!0)return w;if(typeof process>"u")return function(){return e.deprecate(w,R).apply(this,arguments)};var E=!1;function A(){if(!E){if(process.throwDeprecation)throw new Error(R);process.traceDeprecation?console.trace(R):console.error(R),E=!0}return w.apply(this,arguments)}return A};var n={},a=/^$/;if(process.env.NODE_DEBUG){var o=process.env.NODE_DEBUG;o=o.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+o+"$","i")}e.debuglog=function(w){if(w=w.toUpperCase(),!n[w])if(a.test(w)){var R=process.pid;n[w]=function(){var E=e.format.apply(e,arguments);console.error("%s %d: %s",w,R,E)}}else n[w]=function(){};return n[w]};function i(w,R){var E={seen:[],stylize:l};return arguments.length>=3&&(E.depth=arguments[2]),arguments.length>=4&&(E.colors=arguments[3]),T(R)?E.showHidden=R:R&&e._extend(E,R),v(E.showHidden)&&(E.showHidden=!1),v(E.depth)&&(E.depth=2),v(E.colors)&&(E.colors=!1),v(E.customInspect)&&(E.customInspect=!0),E.colors&&(E.stylize=s),c(E,w,E.depth)}e.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function s(w,R){var E=i.styles[R];return E?"\x1B["+i.colors[E][0]+"m"+w+"\x1B["+i.colors[E][1]+"m":w}function l(w,R){return w}function u(w){var R={};return w.forEach(function(E,A){R[E]=!0}),R}function c(w,R,E){if(w.customInspect&&R&&G(R.inspect)&&R.inspect!==e.inspect&&!(R.constructor&&R.constructor.prototype===R)){var A=R.inspect(E,w);return S(A)||(A=c(w,A,E)),A}var L=p(w,R);if(L)return L;var M=Object.keys(R),q=u(M);if(w.showHidden&&(M=Object.getOwnPropertyNames(R)),$(R)&&(M.indexOf("message")>=0||M.indexOf("description")>=0))return d(R);if(M.length===0){if(G(R)){var P=R.name?": "+R.name:"";return w.stylize("[Function"+P+"]","special")}if(C(R))return w.stylize(RegExp.prototype.toString.call(R),"regexp");if(V(R))return w.stylize(Date.prototype.toString.call(R),"date");if($(R))return d(R)}var D="",z=!1,H=["{","}"];if(g(R)&&(z=!0,H=["[","]"]),G(R)){var oe=R.name?": "+R.name:"";D=" [Function"+oe+"]"}if(C(R)&&(D=" "+RegExp.prototype.toString.call(R)),V(R)&&(D=" "+Date.prototype.toUTCString.call(R)),$(R)&&(D=" "+d(R)),M.length===0&&(!z||R.length==0))return H[0]+D+H[1];if(E<0)return C(R)?w.stylize(RegExp.prototype.toString.call(R),"regexp"):w.stylize("[Object]","special");w.seen.push(R);var K;return z?K=y(w,R,E,q,M):K=M.map(function(ue){return b(w,R,E,q,ue,z)}),w.seen.pop(),h(K,D,H)}function p(w,R){if(v(R))return w.stylize("undefined","undefined");if(S(R)){var E="'"+JSON.stringify(R).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return w.stylize(E,"string")}if(I(R))return w.stylize(""+R,"number");if(T(R))return w.stylize(""+R,"boolean");if(m(R))return w.stylize("null","null")}function d(w){return"["+Error.prototype.toString.call(w)+"]"}function y(w,R,E,A,L){for(var M=[],q=0,P=R.length;q<P;++q)re(R,String(q))?M.push(b(w,R,E,A,String(q),!0)):M.push("");return L.forEach(function(D){D.match(/^\d+$/)||M.push(b(w,R,E,A,D,!0))}),M}function b(w,R,E,A,L,M){var q,P,D;if(D=Object.getOwnPropertyDescriptor(R,L)||{value:R[L]},D.get?D.set?P=w.stylize("[Getter/Setter]","special"):P=w.stylize("[Getter]","special"):D.set&&(P=w.stylize("[Setter]","special")),re(A,L)||(q="["+L+"]"),P||(w.seen.indexOf(D.value)<0?(m(E)?P=c(w,D.value,null):P=c(w,D.value,E-1),P.indexOf(`
|
|
11
|
-
|
|
12
|
-
`).map(function(z){return" "+z}).join(`
|
|
13
|
-
`).slice(2):P=`
|
|
14
|
-
`+P.split(`
|
|
15
|
-
`).map(function(z){return" "+z}).join(`
|
|
16
|
-
`))):P=w.stylize("[Circular]","special")),v(q)){if(M&&L.match(/^\d+$/))return P;q=JSON.stringify(""+L),q.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(q=q.slice(1,-1),q=w.stylize(q,"name")):(q=q.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),q=w.stylize(q,"string"))}return q+": "+P}function h(w,R,E){var A=w.reduce(function(L,M){return M.indexOf(`
|
|
17
|
-
`)>=0,L+M.replace(/\u001b\[\d\d?m/g,"").length+1},0);return A>60?E[0]+(R===""?"":R+`
|
|
18
|
-
`)+" "+w.join(`,
|
|
19
|
-
`)+" "+E[1]:E[0]+R+" "+w.join(", ")+" "+E[1]}e.types=Bw();function g(w){return Array.isArray(w)}e.isArray=g;function T(w){return typeof w=="boolean"}e.isBoolean=T;function m(w){return w===null}e.isNull=m;function _(w){return w==null}e.isNullOrUndefined=_;function I(w){return typeof w=="number"}e.isNumber=I;function S(w){return typeof w=="string"}e.isString=S;function O(w){return typeof w=="symbol"}e.isSymbol=O;function v(w){return w===void 0}e.isUndefined=v;function C(w){return N(w)&&fe(w)==="[object RegExp]"}e.isRegExp=C,e.types.isRegExp=C;function N(w){return typeof w=="object"&&w!==null}e.isObject=N;function V(w){return N(w)&&fe(w)==="[object Date]"}e.isDate=V,e.types.isDate=V;function $(w){return N(w)&&(fe(w)==="[object Error]"||w instanceof Error)}e.isError=$,e.types.isNativeError=$;function G(w){return typeof w=="function"}e.isFunction=G;function X(w){return w===null||typeof w=="boolean"||typeof w=="number"||typeof w=="string"||typeof w=="symbol"||typeof w>"u"}e.isPrimitive=X,e.isBuffer=jw();function fe(w){return Object.prototype.toString.call(w)}function be(w){return w<10?"0"+w.toString(10):w.toString(10)}var ge=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function le(){var w=new Date,R=[be(w.getHours()),be(w.getMinutes()),be(w.getSeconds())].join(":");return[w.getDate(),ge[w.getMonth()],R].join(" ")}e.log=function(){console.log("%s - %s",le(),e.format.apply(e,arguments))},e.inherits=$w(),e._extend=function(w,R){if(!R||!N(R))return w;for(var E=Object.keys(R),A=E.length;A--;)w[E[A]]=R[E[A]];return w};function re(w,R){return Object.prototype.hasOwnProperty.call(w,R)}var U=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;e.promisify=function(R){if(typeof R!="function")throw new TypeError('The "original" argument must be of type Function');if(U&&R[U]){var E=R[U];if(typeof E!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(E,U,{value:E,enumerable:!1,writable:!1,configurable:!0}),E}function E(){for(var A,L,M=new Promise(function(D,z){A=D,L=z}),q=[],P=0;P<arguments.length;P++)q.push(arguments[P]);q.push(function(D,z){D?L(D):A(z)});try{R.apply(this,q)}catch(D){L(D)}return M}return Object.setPrototypeOf(E,Object.getPrototypeOf(R)),U&&Object.defineProperty(E,U,{value:E,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(E,t(R))},e.promisify.custom=U;function x(w,R){if(!w){var E=new Error("Promise was rejected with a falsy value");E.reason=w,w=E}return R(w)}function W(w){if(typeof w!="function")throw new TypeError('The "original" argument must be of type Function');function R(){for(var E=[],A=0;A<arguments.length;A++)E.push(arguments[A]);var L=E.pop();if(typeof L!="function")throw new TypeError("The last argument must be of type Function");var M=this,q=function(){return L.apply(M,arguments)};w.apply(this,E).then(function(P){process.nextTick(q.bind(null,null,P))},function(P){process.nextTick(x.bind(null,P,q))})}return Object.setPrototypeOf(R,Object.getPrototypeOf(w)),Object.defineProperties(R,t(w)),R}e.callbackify=W}(hl)),hl}var hh;function ug(){if(hh)return ml;hh=1;function e(m){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(_){return typeof _}:function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},e(m)}function t(m,_,I){return Object.defineProperty(m,"prototype",{writable:!1}),m}function r(m,_){if(!(m instanceof _))throw new TypeError("Cannot call a class as a function")}function n(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),Object.defineProperty(m,"prototype",{writable:!1}),_&&a(m,_)}function a(m,_){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(S,O){return S.__proto__=O,S},a(m,_)}function o(m){var _=l();return function(){var S=u(m),O;if(_){var v=u(this).constructor;O=Reflect.construct(S,arguments,v)}else O=S.apply(this,arguments);return i(this,O)}}function i(m,_){if(_&&(e(_)==="object"||typeof _=="function"))return _;if(_!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return s(m)}function s(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m}function l(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function u(m){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(I){return I.__proto__||Object.getPrototypeOf(I)},u(m)}var c={},p,d;function y(m,_,I){I||(I=Error);function S(v,C,N){return typeof _=="string"?_:_(v,C,N)}var O=function(v){n(N,v);var C=o(N);function N(V,$,G){var X;return r(this,N),X=C.call(this,S(V,$,G)),X.code=m,X}return t(N)}(I);c[m]=O}function b(m,_){if(Array.isArray(m)){var I=m.length;return m=m.map(function(S){return String(S)}),I>2?"one of ".concat(_," ").concat(m.slice(0,I-1).join(", "),", or ")+m[I-1]:I===2?"one of ".concat(_," ").concat(m[0]," or ").concat(m[1]):"of ".concat(_," ").concat(m[0])}else return"of ".concat(_," ").concat(String(m))}function h(m,_,I){return m.substr(0,_.length)===_}function g(m,_,I){return(I===void 0||I>m.length)&&(I=m.length),m.substring(I-_.length,I)===_}function T(m,_,I){return typeof I!="number"&&(I=0),I+_.length>m.length?!1:m.indexOf(_,I)!==-1}return y("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),y("ERR_INVALID_ARG_TYPE",function(m,_,I){p===void 0&&(p=Fc()),p(typeof m=="string","'name' must be a string");var S;typeof _=="string"&&h(_,"not ")?(S="must not be",_=_.replace(/^not /,"")):S="must be";var O;if(g(m," argument"))O="The ".concat(m," ").concat(S," ").concat(b(_,"type"));else{var v=T(m,".")?"property":"argument";O='The "'.concat(m,'" ').concat(v," ").concat(S," ").concat(b(_,"type"))}return O+=". Received type ".concat(e(I)),O},TypeError),y("ERR_INVALID_ARG_VALUE",function(m,_){var I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";d===void 0&&(d=aa());var S=d.inspect(_);return S.length>128&&(S="".concat(S.slice(0,128),"...")),"The argument '".concat(m,"' ").concat(I,". Received ").concat(S)},TypeError),y("ERR_INVALID_RETURN_VALUE",function(m,_,I){var S;return I&&I.constructor&&I.constructor.name?S="instance of ".concat(I.constructor.name):S="type ".concat(e(I)),"Expected ".concat(m,' to be returned from the "').concat(_,'"')+" function but got ".concat(S,".")},TypeError),y("ERR_MISSING_ARGS",function(){for(var m=arguments.length,_=new Array(m),I=0;I<m;I++)_[I]=arguments[I];p===void 0&&(p=Fc()),p(_.length>0,"At least one arg needs to be specified");var S="The ",O=_.length;switch(_=_.map(function(v){return'"'.concat(v,'"')}),O){case 1:S+="".concat(_[0]," argument");break;case 2:S+="".concat(_[0]," and ").concat(_[1]," arguments");break;default:S+=_.slice(0,O-1).join(", "),S+=", and ".concat(_[O-1]," arguments");break}return"".concat(S," must be specified")},TypeError),ml.codes=c,ml}var Yl,yh;function xw(){if(yh)return Yl;yh=1;function e(U,x){var W=Object.keys(U);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(U);x&&(w=w.filter(function(R){return Object.getOwnPropertyDescriptor(U,R).enumerable})),W.push.apply(W,w)}return W}function t(U){for(var x=1;x<arguments.length;x++){var W=arguments[x]!=null?arguments[x]:{};x%2?e(Object(W),!0).forEach(function(w){r(U,w,W[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(U,Object.getOwnPropertyDescriptors(W)):e(Object(W)).forEach(function(w){Object.defineProperty(U,w,Object.getOwnPropertyDescriptor(W,w))})}return U}function r(U,x,W){return x=i(x),x in U?Object.defineProperty(U,x,{value:W,enumerable:!0,configurable:!0,writable:!0}):U[x]=W,U}function n(U,x){if(!(U instanceof x))throw new TypeError("Cannot call a class as a function")}function a(U,x){for(var W=0;W<x.length;W++){var w=x[W];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(U,i(w.key),w)}}function o(U,x,W){return x&&a(U.prototype,x),Object.defineProperty(U,"prototype",{writable:!1}),U}function i(U){var x=s(U,"string");return m(x)==="symbol"?x:String(x)}function s(U,x){if(m(U)!=="object"||U===null)return U;var W=U[Symbol.toPrimitive];if(W!==void 0){var w=W.call(U,x);if(m(w)!=="object")return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(U)}function l(U,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function");U.prototype=Object.create(x&&x.prototype,{constructor:{value:U,writable:!0,configurable:!0}}),Object.defineProperty(U,"prototype",{writable:!1}),x&&g(U,x)}function u(U){var x=b();return function(){var w=T(U),R;if(x){var E=T(this).constructor;R=Reflect.construct(w,arguments,E)}else R=w.apply(this,arguments);return c(this,R)}}function c(U,x){if(x&&(m(x)==="object"||typeof x=="function"))return x;if(x!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return p(U)}function p(U){if(U===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return U}function d(U){var x=typeof Map=="function"?new Map:void 0;return d=function(w){if(w===null||!h(w))return w;if(typeof w!="function")throw new TypeError("Super expression must either be null or a function");if(typeof x<"u"){if(x.has(w))return x.get(w);x.set(w,R)}function R(){return y(w,arguments,T(this).constructor)}return R.prototype=Object.create(w.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),g(R,w)},d(U)}function y(U,x,W){return b()?y=Reflect.construct.bind():y=function(R,E,A){var L=[null];L.push.apply(L,E);var M=Function.bind.apply(R,L),q=new M;return A&&g(q,A.prototype),q},y.apply(null,arguments)}function b(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function h(U){return Function.toString.call(U).indexOf("[native code]")!==-1}function g(U,x){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(w,R){return w.__proto__=R,w},g(U,x)}function T(U){return T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(W){return W.__proto__||Object.getPrototypeOf(W)},T(U)}function m(U){"@babel/helpers - typeof";return m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(x){return typeof x}:function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x},m(U)}var _=aa(),I=_.inspect,S=ug(),O=S.codes.ERR_INVALID_ARG_TYPE;function v(U,x,W){return(W===void 0||W>U.length)&&(W=U.length),U.substring(W-x.length,W)===x}function C(U,x){if(x=Math.floor(x),U.length==0||x==0)return"";var W=U.length*x;for(x=Math.floor(Math.log(x)/Math.log(2));x;)U+=U,x--;return U+=U.substring(0,W-U.length),U}var N="",V="",$="",G="",X={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},fe=10;function be(U){var x=Object.keys(U),W=Object.create(Object.getPrototypeOf(U));return x.forEach(function(w){W[w]=U[w]}),Object.defineProperty(W,"message",{value:U.message}),W}function ge(U){return I(U,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function le(U,x,W){var w="",R="",E=0,A="",L=!1,M=ge(U),q=M.split(`
|
|
20
|
-
`),P=ge(x).split(`
|
|
21
|
-
`),D=0,z="";if(W==="strictEqual"&&m(U)==="object"&&m(x)==="object"&&U!==null&&x!==null&&(W="strictEqualObject"),q.length===1&&P.length===1&&q[0]!==P[0]){var H=q[0].length+P[0].length;if(H<=fe){if((m(U)!=="object"||U===null)&&(m(x)!=="object"||x===null)&&(U!==0||x!==0))return"".concat(X[W],`
|
|
22
|
-
|
|
23
|
-
`)+"".concat(q[0]," !== ").concat(P[0],`
|
|
24
|
-
`)}else if(W!=="strictEqualObject"){var oe=process.stderr&&process.stderr.isTTY?process.stderr.columns:80;if(H<oe){for(;q[0][D]===P[0][D];)D++;D>2&&(z=`
|
|
25
|
-
`.concat(C(" ",D),"^"),D=0)}}}for(var K=q[q.length-1],ue=P[P.length-1];K===ue&&(D++<2?A=`
|
|
26
|
-
`.concat(K).concat(A):w=K,q.pop(),P.pop(),!(q.length===0||P.length===0));)K=q[q.length-1],ue=P[P.length-1];var de=Math.max(q.length,P.length);if(de===0){var J=M.split(`
|
|
27
|
-
`);if(J.length>30)for(J[26]="".concat(N,"...").concat(G);J.length>27;)J.pop();return"".concat(X.notIdentical,`
|
|
28
|
-
|
|
29
|
-
`).concat(J.join(`
|
|
30
|
-
`),`
|
|
31
|
-
`)}D>3&&(A=`
|
|
32
|
-
`.concat(N,"...").concat(G).concat(A),L=!0),w!==""&&(A=`
|
|
33
|
-
`.concat(w).concat(A),w="");var ce=0,B=X[W]+`
|
|
34
|
-
`.concat(V,"+ actual").concat(G," ").concat($,"- expected").concat(G),qe=" ".concat(N,"...").concat(G," Lines skipped");for(D=0;D<de;D++){var Oe=D-E;if(q.length<D+1)Oe>1&&D>2&&(Oe>4?(R+=`
|
|
35
|
-
`.concat(N,"...").concat(G),L=!0):Oe>3&&(R+=`
|
|
36
|
-
`.concat(P[D-2]),ce++),R+=`
|
|
37
|
-
`.concat(P[D-1]),ce++),E=D,w+=`
|
|
38
|
-
`.concat($,"-").concat(G," ").concat(P[D]),ce++;else if(P.length<D+1)Oe>1&&D>2&&(Oe>4?(R+=`
|
|
39
|
-
`.concat(N,"...").concat(G),L=!0):Oe>3&&(R+=`
|
|
40
|
-
`.concat(q[D-2]),ce++),R+=`
|
|
41
|
-
`.concat(q[D-1]),ce++),E=D,R+=`
|
|
42
|
-
`.concat(V,"+").concat(G," ").concat(q[D]),ce++;else{var Ce=P[D],Ee=q[D],k=Ee!==Ce&&(!v(Ee,",")||Ee.slice(0,-1)!==Ce);k&&v(Ce,",")&&Ce.slice(0,-1)===Ee&&(k=!1,Ee+=","),k?(Oe>1&&D>2&&(Oe>4?(R+=`
|
|
43
|
-
`.concat(N,"...").concat(G),L=!0):Oe>3&&(R+=`
|
|
44
|
-
`.concat(q[D-2]),ce++),R+=`
|
|
45
|
-
`.concat(q[D-1]),ce++),E=D,R+=`
|
|
46
|
-
`.concat(V,"+").concat(G," ").concat(Ee),w+=`
|
|
47
|
-
`.concat($,"-").concat(G," ").concat(Ce),ce+=2):(R+=w,w="",(Oe===1||D===0)&&(R+=`
|
|
48
|
-
`.concat(Ee),ce++))}if(ce>20&&D<de-2)return"".concat(B).concat(qe,`
|
|
49
|
-
`).concat(R,`
|
|
50
|
-
`).concat(N,"...").concat(G).concat(w,`
|
|
51
|
-
`)+"".concat(N,"...").concat(G)}return"".concat(B).concat(L?qe:"",`
|
|
52
|
-
`).concat(R).concat(w).concat(A).concat(z)}var re=function(U,x){l(w,U);var W=u(w);function w(R){var E;if(n(this,w),m(R)!=="object"||R===null)throw new O("options","Object",R);var A=R.message,L=R.operator,M=R.stackStartFn,q=R.actual,P=R.expected,D=Error.stackTraceLimit;if(Error.stackTraceLimit=0,A!=null)E=W.call(this,String(A));else if(process.stderr&&process.stderr.isTTY&&(process.stderr&&process.stderr.getColorDepth&&process.stderr.getColorDepth()!==1?(N="\x1B[34m",V="\x1B[32m",G="\x1B[39m",$="\x1B[31m"):(N="",V="",G="",$="")),m(q)==="object"&&q!==null&&m(P)==="object"&&P!==null&&"stack"in q&&q instanceof Error&&"stack"in P&&P instanceof Error&&(q=be(q),P=be(P)),L==="deepStrictEqual"||L==="strictEqual")E=W.call(this,le(q,P,L));else if(L==="notDeepStrictEqual"||L==="notStrictEqual"){var z=X[L],H=ge(q).split(`
|
|
53
|
-
`);if(L==="notStrictEqual"&&m(q)==="object"&&q!==null&&(z=X.notStrictEqualObject),H.length>30)for(H[26]="".concat(N,"...").concat(G);H.length>27;)H.pop();H.length===1?E=W.call(this,"".concat(z," ").concat(H[0])):E=W.call(this,"".concat(z,`
|
|
54
|
-
|
|
55
|
-
`).concat(H.join(`
|
|
56
|
-
`),`
|
|
57
|
-
`))}else{var oe=ge(q),K="",ue=X[L];L==="notDeepEqual"||L==="notEqual"?(oe="".concat(X[L],`
|
|
58
|
-
|
|
59
|
-
`).concat(oe),oe.length>1024&&(oe="".concat(oe.slice(0,1021),"..."))):(K="".concat(ge(P)),oe.length>512&&(oe="".concat(oe.slice(0,509),"...")),K.length>512&&(K="".concat(K.slice(0,509),"...")),L==="deepEqual"||L==="equal"?oe="".concat(ue,`
|
|
60
|
-
|
|
61
|
-
`).concat(oe,`
|
|
62
|
-
|
|
63
|
-
should equal
|
|
64
|
-
|
|
65
|
-
`):K=" ".concat(L," ").concat(K)),E=W.call(this,"".concat(oe).concat(K))}return Error.stackTraceLimit=D,E.generatedMessage=!A,Object.defineProperty(p(E),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),E.code="ERR_ASSERTION",E.actual=q,E.expected=P,E.operator=L,Error.captureStackTrace&&Error.captureStackTrace(p(E),M),E.stack,E.name="AssertionError",c(E)}return o(w,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:x,value:function(E,A){return I(this,t(t({},A),{},{customInspect:!1,depth:0}))}}]),w}(d(Error),I.custom);return Yl=re,Yl}var Kl,bh;function cg(){if(bh)return Kl;bh=1;var e=Object.prototype.toString;return Kl=function(r){var n=e.call(r),a=n==="[object Arguments]";return a||(a=n!=="[object Array]"&&r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&e.call(r.callee)==="[object Function]"),a},Kl}var Xl,gh;function Vw(){if(gh)return Xl;gh=1;var e;if(!Object.keys){var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=cg(),a=Object.prototype.propertyIsEnumerable,o=!a.call({toString:null},"toString"),i=a.call(function(){},"prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(d){var y=d.constructor;return y&&y.prototype===d},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},c=function(){if(typeof window>"u")return!1;for(var d in window)try{if(!u["$"+d]&&t.call(window,d)&&window[d]!==null&&typeof window[d]=="object")try{l(window[d])}catch{return!0}}catch{return!0}return!1}(),p=function(d){if(typeof window>"u"||!c)return l(d);try{return l(d)}catch{return!1}};e=function(y){var b=y!==null&&typeof y=="object",h=r.call(y)==="[object Function]",g=n(y),T=b&&r.call(y)==="[object String]",m=[];if(!b&&!h&&!g)throw new TypeError("Object.keys called on a non-object");var _=i&&h;if(T&&y.length>0&&!t.call(y,0))for(var I=0;I<y.length;++I)m.push(String(I));if(g&&y.length>0)for(var S=0;S<y.length;++S)m.push(String(S));else for(var O in y)!(_&&O==="prototype")&&t.call(y,O)&&m.push(String(O));if(o)for(var v=p(y),C=0;C<s.length;++C)!(v&&s[C]==="constructor")&&t.call(y,s[C])&&m.push(s[C]);return m}}return Xl=e,Xl}var Zl,_h;function pg(){if(_h)return Zl;_h=1;var e=Array.prototype.slice,t=cg(),r=Object.keys,n=r?function(i){return r(i)}:Vw(),a=Object.keys;return n.shim=function(){if(Object.keys){var i=function(){var s=Object.keys(arguments);return s&&s.length===arguments.length}(1,2);i||(Object.keys=function(l){return t(l)?a(e.call(l)):a(l)})}else Object.keys=n;return Object.keys||n},Zl=n,Zl}var Jl,Th;function Hw(){if(Th)return Jl;Th=1;var e=pg(),t=yp()(),r=bo(),n=Object,a=r("Array.prototype.push"),o=r("Object.prototype.propertyIsEnumerable"),i=t?Object.getOwnPropertySymbols:null;return Jl=function(l,u){if(l==null)throw new TypeError("target must be an object");var c=n(l);if(arguments.length===1)return c;for(var p=1;p<arguments.length;++p){var d=n(arguments[p]),y=e(d),b=t&&(Object.getOwnPropertySymbols||i);if(b)for(var h=b(d),g=0;g<h.length;++g){var T=h[g];o(d,T)&&a(y,T)}for(var m=0;m<y.length;++m){var _=y[m];if(o(d,_)){var I=d[_];c[_]=I}}}return c},Jl}var Ql,Eh;function Gw(){if(Eh)return Ql;Eh=1;var e=Hw(),t=function(){if(!Object.assign)return!1;for(var n="abcdefghijklmnopqrst",a=n.split(""),o={},i=0;i<a.length;++i)o[a[i]]=a[i];var s=Object.assign({},o),l="";for(var u in s)l+=u;return n!==l},r=function(){if(!Object.assign||!Object.preventExtensions)return!1;var n=Object.preventExtensions({1:2});try{Object.assign(n,"xy")}catch{return n[1]==="y"}return!1};return Ql=function(){return!Object.assign||t()||r()?e:Object.assign},Ql}var eu,wh;function fg(){if(wh)return eu;wh=1;var e=function(t){return t!==t};return eu=function(r,n){return r===0&&n===0?1/r===1/n:!!(r===n||e(r)&&e(n))},eu}var tu,Ih;function Ep(){if(Ih)return tu;Ih=1;var e=fg();return tu=function(){return typeof Object.is=="function"?Object.is:e},tu}var ru,Sh;function go(){if(Sh)return ru;Sh=1;var e=pg(),t=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",r=Object.prototype.toString,n=Array.prototype.concat,a=ig(),o=function(u){return typeof u=="function"&&r.call(u)==="[object Function]"},i=sg()(),s=function(u,c,p,d){if(c in u){if(d===!0){if(u[c]===p)return}else if(!o(d)||!d())return}i?a(u,c,p,!0):a(u,c,p)},l=function(u,c){var p=arguments.length>2?arguments[2]:{},d=e(c);t&&(d=n.call(d,Object.getOwnPropertySymbols(c)));for(var y=0;y<d.length;y+=1)s(u,d[y],c[d[y]],p[d[y]])};return l.supportsDescriptors=!!i,ru=l,ru}var nu,Ah;function zw(){if(Ah)return nu;Ah=1;var e=Ep(),t=go();return nu=function(){var n=e();return t(Object,{is:n},{is:function(){return Object.is!==n}}),n},nu}var au,Oh;function Ww(){if(Oh)return au;Oh=1;var e=go(),t=yo(),r=fg(),n=Ep(),a=zw(),o=t(n(),Object);return e(o,{getPolyfill:n,implementation:r,shim:a}),au=o,au}var ou,vh;function dg(){return vh||(vh=1,ou=function(t){return t!==t}),ou}var iu,Lh;function mg(){if(Lh)return iu;Lh=1;var e=dg();return iu=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:e},iu}var su,Rh;function Yw(){if(Rh)return su;Rh=1;var e=go(),t=mg();return su=function(){var n=t();return e(Number,{isNaN:n},{isNaN:function(){return Number.isNaN!==n}}),n},su}var lu,Ph;function Kw(){if(Ph)return lu;Ph=1;var e=yo(),t=go(),r=dg(),n=mg(),a=Yw(),o=e(n(),Number);return t(o,{getPolyfill:n,implementation:r,shim:a}),lu=o,lu}var uu,kh;function Xw(){if(kh)return uu;kh=1;function e(k,F){return o(k)||a(k,F)||r(k,F)||t()}function t(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
66
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r(k,F){if(k){if(typeof k=="string")return n(k,F);var Y=Object.prototype.toString.call(k).slice(8,-1);if(Y==="Object"&&k.constructor&&(Y=k.constructor.name),Y==="Map"||Y==="Set")return Array.from(k);if(Y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Y))return n(k,F)}}function n(k,F){(F==null||F>k.length)&&(F=k.length);for(var Y=0,Q=new Array(F);Y<F;Y++)Q[Y]=k[Y];return Q}function a(k,F){var Y=k==null?null:typeof Symbol<"u"&&k[Symbol.iterator]||k["@@iterator"];if(Y!=null){var Q,Z,ie,te,se=[],pe=!0,me=!1;try{if(ie=(Y=Y.call(k)).next,F!==0)for(;!(pe=(Q=ie.call(Y)).done)&&(se.push(Q.value),se.length!==F);pe=!0);}catch(he){me=!0,Z=he}finally{try{if(!pe&&Y.return!=null&&(te=Y.return(),Object(te)!==te))return}finally{if(me)throw Z}}return se}}function o(k){if(Array.isArray(k))return k}function i(k){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(F){return typeof F}:function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},i(k)}var s=/a/g.flags!==void 0,l=function(F){var Y=[];return F.forEach(function(Q){return Y.push(Q)}),Y},u=function(F){var Y=[];return F.forEach(function(Q,Z){return Y.push([Z,Q])}),Y},c=Object.is?Object.is:Ww(),p=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},d=Number.isNaN?Number.isNaN:Kw();function y(k){return k.call.bind(k)}var b=y(Object.prototype.hasOwnProperty),h=y(Object.prototype.propertyIsEnumerable),g=y(Object.prototype.toString),T=aa().types,m=T.isAnyArrayBuffer,_=T.isArrayBufferView,I=T.isDate,S=T.isMap,O=T.isRegExp,v=T.isSet,C=T.isNativeError,N=T.isBoxedPrimitive,V=T.isNumberObject,$=T.isStringObject,G=T.isBooleanObject,X=T.isBigIntObject,fe=T.isSymbolObject,be=T.isFloat32Array,ge=T.isFloat64Array;function le(k){if(k.length===0||k.length>10)return!0;for(var F=0;F<k.length;F++){var Y=k.charCodeAt(F);if(Y<48||Y>57)return!0}return k.length===10&&k>=Math.pow(2,32)}function re(k){return Object.keys(k).filter(le).concat(p(k).filter(Object.prototype.propertyIsEnumerable.bind(k)))}/*!
|
|
67
|
-
* The buffer module from node.js, for the browser.
|
|
68
|
-
*
|
|
69
|
-
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
70
|
-
* @license MIT
|
|
71
|
-
*/function U(k,F){if(k===F)return 0;for(var Y=k.length,Q=F.length,Z=0,ie=Math.min(Y,Q);Z<ie;++Z)if(k[Z]!==F[Z]){Y=k[Z],Q=F[Z];break}return Y<Q?-1:Q<Y?1:0}var x=!0,W=!1,w=0,R=1,E=2,A=3;function L(k,F){return s?k.source===F.source&&k.flags===F.flags:RegExp.prototype.toString.call(k)===RegExp.prototype.toString.call(F)}function M(k,F){if(k.byteLength!==F.byteLength)return!1;for(var Y=0;Y<k.byteLength;Y++)if(k[Y]!==F[Y])return!1;return!0}function q(k,F){return k.byteLength!==F.byteLength?!1:U(new Uint8Array(k.buffer,k.byteOffset,k.byteLength),new Uint8Array(F.buffer,F.byteOffset,F.byteLength))===0}function P(k,F){return k.byteLength===F.byteLength&&U(new Uint8Array(k),new Uint8Array(F))===0}function D(k,F){return V(k)?V(F)&&c(Number.prototype.valueOf.call(k),Number.prototype.valueOf.call(F)):$(k)?$(F)&&String.prototype.valueOf.call(k)===String.prototype.valueOf.call(F):G(k)?G(F)&&Boolean.prototype.valueOf.call(k)===Boolean.prototype.valueOf.call(F):X(k)?X(F)&&BigInt.prototype.valueOf.call(k)===BigInt.prototype.valueOf.call(F):fe(F)&&Symbol.prototype.valueOf.call(k)===Symbol.prototype.valueOf.call(F)}function z(k,F,Y,Q){if(k===F)return k!==0?!0:Y?c(k,F):!0;if(Y){if(i(k)!=="object")return typeof k=="number"&&d(k)&&d(F);if(i(F)!=="object"||k===null||F===null||Object.getPrototypeOf(k)!==Object.getPrototypeOf(F))return!1}else{if(k===null||i(k)!=="object")return F===null||i(F)!=="object"?k==F:!1;if(F===null||i(F)!=="object")return!1}var Z=g(k),ie=g(F);if(Z!==ie)return!1;if(Array.isArray(k)){if(k.length!==F.length)return!1;var te=re(k),se=re(F);return te.length!==se.length?!1:oe(k,F,Y,Q,R,te)}if(Z==="[object Object]"&&(!S(k)&&S(F)||!v(k)&&v(F)))return!1;if(I(k)){if(!I(F)||Date.prototype.getTime.call(k)!==Date.prototype.getTime.call(F))return!1}else if(O(k)){if(!O(F)||!L(k,F))return!1}else if(C(k)||k instanceof Error){if(k.message!==F.message||k.name!==F.name)return!1}else if(_(k)){if(!Y&&(be(k)||ge(k))){if(!M(k,F))return!1}else if(!q(k,F))return!1;var pe=re(k),me=re(F);return pe.length!==me.length?!1:oe(k,F,Y,Q,w,pe)}else{if(v(k))return!v(F)||k.size!==F.size?!1:oe(k,F,Y,Q,E);if(S(k))return!S(F)||k.size!==F.size?!1:oe(k,F,Y,Q,A);if(m(k)){if(!P(k,F))return!1}else if(N(k)&&!D(k,F))return!1}return oe(k,F,Y,Q,w)}function H(k,F){return F.filter(function(Y){return h(k,Y)})}function oe(k,F,Y,Q,Z,ie){if(arguments.length===5){ie=Object.keys(k);var te=Object.keys(F);if(ie.length!==te.length)return!1}for(var se=0;se<ie.length;se++)if(!b(F,ie[se]))return!1;if(Y&&arguments.length===5){var pe=p(k);if(pe.length!==0){var me=0;for(se=0;se<pe.length;se++){var he=pe[se];if(h(k,he)){if(!h(F,he))return!1;ie.push(he),me++}else if(h(F,he))return!1}var Ze=p(F);if(pe.length!==Ze.length&&H(F,Ze).length!==me)return!1}else{var Be=p(F);if(Be.length!==0&&H(F,Be).length!==0)return!1}}if(ie.length===0&&(Z===w||Z===R&&k.length===0||k.size===0))return!0;if(Q===void 0)Q={val1:new Map,val2:new Map,position:0};else{var _e=Q.val1.get(k);if(_e!==void 0){var Se=Q.val2.get(F);if(Se!==void 0)return _e===Se}Q.position++}Q.val1.set(k,Q.position),Q.val2.set(F,Q.position);var rt=Oe(k,F,Y,ie,Q,Z);return Q.val1.delete(k),Q.val2.delete(F),rt}function K(k,F,Y,Q){for(var Z=l(k),ie=0;ie<Z.length;ie++){var te=Z[ie];if(z(F,te,Y,Q))return k.delete(te),!0}return!1}function ue(k){switch(i(k)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":k=+k;case"number":if(d(k))return!1}return!0}function de(k,F,Y){var Q=ue(Y);return Q??(F.has(Q)&&!k.has(Q))}function J(k,F,Y,Q,Z){var ie=ue(Y);if(ie!=null)return ie;var te=F.get(ie);return te===void 0&&!F.has(ie)||!z(Q,te,!1,Z)?!1:!k.has(ie)&&z(Q,te,!1,Z)}function ce(k,F,Y,Q){for(var Z=null,ie=l(k),te=0;te<ie.length;te++){var se=ie[te];if(i(se)==="object"&&se!==null)Z===null&&(Z=new Set),Z.add(se);else if(!F.has(se)){if(Y||!de(k,F,se))return!1;Z===null&&(Z=new Set),Z.add(se)}}if(Z!==null){for(var pe=l(F),me=0;me<pe.length;me++){var he=pe[me];if(i(he)==="object"&&he!==null){if(!K(Z,he,Y,Q))return!1}else if(!Y&&!k.has(he)&&!K(Z,he,Y,Q))return!1}return Z.size===0}return!0}function B(k,F,Y,Q,Z,ie){for(var te=l(k),se=0;se<te.length;se++){var pe=te[se];if(z(Y,pe,Z,ie)&&z(Q,F.get(pe),Z,ie))return k.delete(pe),!0}return!1}function qe(k,F,Y,Q){for(var Z=null,ie=u(k),te=0;te<ie.length;te++){var se=e(ie[te],2),pe=se[0],me=se[1];if(i(pe)==="object"&&pe!==null)Z===null&&(Z=new Set),Z.add(pe);else{var he=F.get(pe);if(he===void 0&&!F.has(pe)||!z(me,he,Y,Q)){if(Y||!J(k,F,pe,me,Q))return!1;Z===null&&(Z=new Set),Z.add(pe)}}}if(Z!==null){for(var Ze=u(F),Be=0;Be<Ze.length;Be++){var _e=e(Ze[Be],2),Se=_e[0],rt=_e[1];if(i(Se)==="object"&&Se!==null){if(!B(Z,k,Se,rt,Y,Q))return!1}else if(!Y&&(!k.has(Se)||!z(k.get(Se),rt,!1,Q))&&!B(Z,k,Se,rt,!1,Q))return!1}return Z.size===0}return!0}function Oe(k,F,Y,Q,Z,ie){var te=0;if(ie===E){if(!ce(k,F,Y,Z))return!1}else if(ie===A){if(!qe(k,F,Y,Z))return!1}else if(ie===R)for(;te<k.length;te++)if(b(k,te)){if(!b(F,te)||!z(k[te],F[te],Y,Z))return!1}else{if(b(F,te))return!1;for(var se=Object.keys(k);te<se.length;te++){var pe=se[te];if(!b(F,pe)||!z(k[pe],F[pe],Y,Z))return!1}return se.length===Object.keys(F).length}for(te=0;te<Q.length;te++){var me=Q[te];if(!z(k[me],F[me],Y,Z))return!1}return!0}function Ce(k,F){return z(k,F,W)}function Ee(k,F){return z(k,F,x)}return uu={isDeepEqual:Ce,isDeepStrictEqual:Ee},uu}var Nh;function Fc(){if(Nh)return dl.exports;Nh=1;function e(E){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},e(E)}function t(E,A,L){return Object.defineProperty(E,"prototype",{writable:!1}),E}function r(E,A){if(!(E instanceof A))throw new TypeError("Cannot call a class as a function")}var n=ug(),a=n.codes,o=a.ERR_AMBIGUOUS_ARGUMENT,i=a.ERR_INVALID_ARG_TYPE,s=a.ERR_INVALID_ARG_VALUE,l=a.ERR_INVALID_RETURN_VALUE,u=a.ERR_MISSING_ARGS,c=xw(),p=aa(),d=p.inspect,y=aa().types,b=y.isPromise,h=y.isRegExp,g=Gw()(),T=Ep()(),m=bo()("RegExp.prototype.test"),_,I;function S(){var E=Xw();_=E.isDeepEqual,I=E.isDeepStrictEqual}var O=!1,v=dl.exports=G,C={};function N(E){throw E.message instanceof Error?E.message:new c(E)}function V(E,A,L,M,q){var P=arguments.length,D;if(P===0)D="Failed";else if(P===1)L=E,E=void 0;else{if(O===!1){O=!0;var z=process.emitWarning?process.emitWarning:console.warn.bind(console);z("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}P===2&&(M="!=")}if(L instanceof Error)throw L;var H={actual:E,expected:A,operator:M===void 0?"fail":M,stackStartFn:q||V};L!==void 0&&(H.message=L);var oe=new c(H);throw D&&(oe.message=D,oe.generatedMessage=!0),oe}v.fail=V,v.AssertionError=c;function $(E,A,L,M){if(!L){var q=!1;if(A===0)q=!0,M="No value argument passed to `assert.ok()`";else if(M instanceof Error)throw M;var P=new c({actual:L,expected:!0,message:M,operator:"==",stackStartFn:E});throw P.generatedMessage=q,P}}function G(){for(var E=arguments.length,A=new Array(E),L=0;L<E;L++)A[L]=arguments[L];$.apply(void 0,[G,A.length].concat(A))}v.ok=G,v.equal=function E(A,L,M){if(arguments.length<2)throw new u("actual","expected");A!=L&&N({actual:A,expected:L,message:M,operator:"==",stackStartFn:E})},v.notEqual=function E(A,L,M){if(arguments.length<2)throw new u("actual","expected");A==L&&N({actual:A,expected:L,message:M,operator:"!=",stackStartFn:E})},v.deepEqual=function E(A,L,M){if(arguments.length<2)throw new u("actual","expected");_===void 0&&S(),_(A,L)||N({actual:A,expected:L,message:M,operator:"deepEqual",stackStartFn:E})},v.notDeepEqual=function E(A,L,M){if(arguments.length<2)throw new u("actual","expected");_===void 0&&S(),_(A,L)&&N({actual:A,expected:L,message:M,operator:"notDeepEqual",stackStartFn:E})},v.deepStrictEqual=function E(A,L,M){if(arguments.length<2)throw new u("actual","expected");_===void 0&&S(),I(A,L)||N({actual:A,expected:L,message:M,operator:"deepStrictEqual",stackStartFn:E})},v.notDeepStrictEqual=X;function X(E,A,L){if(arguments.length<2)throw new u("actual","expected");_===void 0&&S(),I(E,A)&&N({actual:E,expected:A,message:L,operator:"notDeepStrictEqual",stackStartFn:X})}v.strictEqual=function E(A,L,M){if(arguments.length<2)throw new u("actual","expected");T(A,L)||N({actual:A,expected:L,message:M,operator:"strictEqual",stackStartFn:E})},v.notStrictEqual=function E(A,L,M){if(arguments.length<2)throw new u("actual","expected");T(A,L)&&N({actual:A,expected:L,message:M,operator:"notStrictEqual",stackStartFn:E})};var fe=t(function E(A,L,M){var q=this;r(this,E),L.forEach(function(P){P in A&&(M!==void 0&&typeof M[P]=="string"&&h(A[P])&&m(A[P],M[P])?q[P]=M[P]:q[P]=A[P])})});function be(E,A,L,M,q,P){if(!(L in E)||!I(E[L],A[L])){if(!M){var D=new fe(E,q),z=new fe(A,q,E),H=new c({actual:D,expected:z,operator:"deepStrictEqual",stackStartFn:P});throw H.actual=E,H.expected=A,H.operator=P.name,H}N({actual:E,expected:A,message:M,operator:P.name,stackStartFn:P})}}function ge(E,A,L,M){if(typeof A!="function"){if(h(A))return m(A,E);if(arguments.length===2)throw new i("expected",["Function","RegExp"],A);if(e(E)!=="object"||E===null){var q=new c({actual:E,expected:A,message:L,operator:"deepStrictEqual",stackStartFn:M});throw q.operator=M.name,q}var P=Object.keys(A);if(A instanceof Error)P.push("name","message");else if(P.length===0)throw new s("error",A,"may not be an empty object");return _===void 0&&S(),P.forEach(function(D){typeof E[D]=="string"&&h(A[D])&&m(A[D],E[D])||be(E,A,D,L,P,M)}),!0}return A.prototype!==void 0&&E instanceof A?!0:Error.isPrototypeOf(A)?!1:A.call({},E)===!0}function le(E){if(typeof E!="function")throw new i("fn","Function",E);try{E()}catch(A){return A}return C}function re(E){return b(E)||E!==null&&e(E)==="object"&&typeof E.then=="function"&&typeof E.catch=="function"}function U(E){return Promise.resolve().then(function(){var A;if(typeof E=="function"){if(A=E(),!re(A))throw new l("instance of Promise","promiseFn",A)}else if(re(E))A=E;else throw new i("promiseFn",["Function","Promise"],E);return Promise.resolve().then(function(){return A}).then(function(){return C}).catch(function(L){return L})})}function x(E,A,L,M){if(typeof L=="string"){if(arguments.length===4)throw new i("error",["Object","Error","Function","RegExp"],L);if(e(A)==="object"&&A!==null){if(A.message===L)throw new o("error/message",'The error message "'.concat(A.message,'" is identical to the message.'))}else if(A===L)throw new o("error/message",'The error "'.concat(A,'" is identical to the message.'));M=L,L=void 0}else if(L!=null&&e(L)!=="object"&&typeof L!="function")throw new i("error",["Object","Error","Function","RegExp"],L);if(A===C){var q="";L&&L.name&&(q+=" (".concat(L.name,")")),q+=M?": ".concat(M):".";var P=E.name==="rejects"?"rejection":"exception";N({actual:void 0,expected:L,operator:E.name,message:"Missing expected ".concat(P).concat(q),stackStartFn:E})}if(L&&!ge(A,L,M,E))throw A}function W(E,A,L,M){if(A!==C){if(typeof L=="string"&&(M=L,L=void 0),!L||ge(A,L)){var q=M?": ".concat(M):".",P=E.name==="doesNotReject"?"rejection":"exception";N({actual:A,expected:L,operator:E.name,message:"Got unwanted ".concat(P).concat(q,`
|
|
72
|
-
`)+'Actual message: "'.concat(A&&A.message,'"'),stackStartFn:E})}throw A}}v.throws=function E(A){for(var L=arguments.length,M=new Array(L>1?L-1:0),q=1;q<L;q++)M[q-1]=arguments[q];x.apply(void 0,[E,le(A)].concat(M))},v.rejects=function E(A){for(var L=arguments.length,M=new Array(L>1?L-1:0),q=1;q<L;q++)M[q-1]=arguments[q];return U(A).then(function(P){return x.apply(void 0,[E,P].concat(M))})},v.doesNotThrow=function E(A){for(var L=arguments.length,M=new Array(L>1?L-1:0),q=1;q<L;q++)M[q-1]=arguments[q];W.apply(void 0,[E,le(A)].concat(M))},v.doesNotReject=function E(A){for(var L=arguments.length,M=new Array(L>1?L-1:0),q=1;q<L;q++)M[q-1]=arguments[q];return U(A).then(function(P){return W.apply(void 0,[E,P].concat(M))})},v.ifError=function E(A){if(A!=null){var L="ifError got unwanted exception: ";e(A)==="object"&&typeof A.message=="string"?A.message.length===0&&A.constructor?L+=A.constructor.name:L+=A.message:L+=d(A);var M=new c({actual:A,expected:null,operator:"ifError",message:L,stackStartFn:E}),q=A.stack;if(typeof q=="string"){var P=q.split(`
|
|
73
|
-
`);P.shift();for(var D=M.stack.split(`
|
|
74
|
-
`),z=0;z<P.length;z++){var H=D.indexOf(P[z]);if(H!==-1){D=D.slice(0,H);break}}M.stack="".concat(D.join(`
|
|
75
|
-
`),`
|
|
76
|
-
`).concat(P.join(`
|
|
77
|
-
`))}throw M}};function w(E,A,L,M,q){if(!h(A))throw new i("regexp","RegExp",A);var P=q==="match";if(typeof E!="string"||m(A,E)!==P){if(L instanceof Error)throw L;var D=!L;L=L||(typeof E!="string"?'The "string" argument must be of type string. Received type '+"".concat(e(E)," (").concat(d(E),")"):(P?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(d(A),`. Input:
|
|
78
|
-
|
|
79
|
-
`).concat(d(E),`
|
|
80
|
-
`));var z=new c({actual:E,expected:A,message:L,operator:q,stackStartFn:M});throw z.generatedMessage=D,z}}v.match=function E(A,L,M){w(A,L,M,E,"match")},v.doesNotMatch=function E(A,L,M){w(A,L,M,E,"doesNotMatch")};function R(){for(var E=arguments.length,A=new Array(E),L=0;L<E;L++)A[L]=arguments[L];$.apply(void 0,[R,A.length].concat(A))}return v.strict=g(R,v,{equal:v.strictEqual,deepEqual:v.deepStrictEqual,notEqual:v.notStrictEqual,notDeepEqual:v.notDeepStrictEqual}),v.strict.strict=v.strict,dl.exports}var Zw=Fc();const jr=Ye(Zw),Jw=(e,t,r)=>{const{moduleId:n}=e,{moduleEntities:a}=t,o="magneticModule/disengage";if(n===null)return{errors:[ke()]};jr(a[n]?.type===f.MAGNETIC_MODULE_TYPE,`expected module ${n} to be magdeck, got ${a[n]?.type}`);const i=a[n].pythonName;return{commands:[{commandType:o,key:ne(),params:{moduleId:n}}],python:`${i}.disengage()`}},hg=(e,t,r)=>{const{pipetteId:n,volume:a,labwareId:o,wellName:i,flowRate:s,isAirGap:l,wellLocation:u,pushOut:c,primaryNozzle:p,nozzles:d}=e,y="dispense",b=r.labware,h=[],g=t.pipetteEntities[n]?.spec,T=(g?.displayCategory==="FLEX"||g?.channels===96)??!1,m=On(o,r.labware);if(g||h.push(ft({pipette:n})),vn({pipette:n,labware:o,invariantContext:t,prevRobotState:r})&&h.push(ca()),r.tipState.pipettes[n]?.hasTip||h.push(Ft({actionName:y,pipette:n,labware:o,well:i})),!o||!r.labware[o]?h.push(dt({actionName:y,labware:o})):we(r.labware[o].stack)==="offDeck"&&h.push(fn()),We.includes(m))h.push(Dt({typeOfStep:y}));else if(b[m]!=null){const N=we(b[m].stack);We.includes(N)&&h.push(Dt({typeOfStep:y}))}if(t.pipetteEntities[n]?.spec.channels!==1&&!It({robotState:r,invariantContext:t,pipetteId:n,labwareId:o,wellLocationOffset:u?.offset??{x:0,y:0,z:0},wellTargetName:i,primaryNozzle:p,nozzleConfiguration:d})&&h.push(Mr()),va(r.modules,r.labware,o)&&h.push(cn()),Sa(r.modules,r.labware,o)&&h.push(kr()),Pa(r.modules,r.labware,o)&&h.push(eo()),ka(r.modules,r.labware,o)&&h.push(pn()),Pn(r.modules,m,T?f.FLEX_ROBOT_TYPE:f.OT2_ROBOT_TYPE)&&h.push(fa()),T||(Ln(r.modules,m)&&h.push(pa()),Rn(r.modules,m,g)&&h.push(da()),Ra(r.modules,m,g,t.labwareEntities[o])&&h.push(to())),h.length>0)return{errors:h};const I=[{commandType:"dispense",key:ne(),params:{pipetteId:n,volume:a,labwareId:o,wellName:i,wellLocation:u,flowRate:s,...c!=null?{pushOut:c}:{}},...l&&{meta:{isAirGap:l}}}],S=t.pipetteEntities[n].pythonName,O=t.labwareEntities[o].pythonName,v=[`volume=${a}`,`location=${O}[${ee(i)}]${kn(u)}`,`flow_rate=${s}`,...c!=null?[`push_out=${c}`]:[]],C=`${S}.dispense(
|
|
81
|
-
${ve(v.join(`,
|
|
9
|
+
)`}},ug=(e,t,r)=>{const{moduleId:n}=e;if(n===null)return{errors:[X()]};const a=t.moduleEntities[n],s=a?.type,o=a?.pythonName,i={moduleId:n};return s===c.TEMPERATURE_MODULE_TYPE?{commands:[{commandType:"temperatureModule/deactivate",key:D(),params:i}],python:`${o}.deactivate()`}:s===c.THERMOCYCLER_MODULE_TYPE?{commands:[{commandType:"thermocycler/deactivateLid",key:D(),params:i},{commandType:"thermocycler/deactivateBlock",key:D(),params:i}],python:`${o}.deactivate_lid()
|
|
10
|
+
${o}.deactivate_block()`}:s===c.HEATERSHAKER_MODULE_TYPE?{commands:[{commandType:"heaterShaker/deactivateHeater",key:D(),params:i}],python:`${o}.deactivate_heater()`}:(console.error(`setTemperature expected module ${n} to be ${c.TEMPERATURE_MODULE_TYPE}, ${c.THERMOCYCLER_MODULE_TYPE} or ${c.HEATERSHAKER_MODULE_TYPE}, got ${s}`),{errors:[X()]})},he=(e,t,r)=>{const{message:n}=e;let a,s;if("seconds"in e){a={commandType:"waitForDuration",key:D(),params:{seconds:e.seconds,message:n}};const o=[`seconds=${e.seconds}`,...n?[`msg=${N(n)}`]:[]];s=`${ge}.delay(${o.join(", ")})`}else a={commandType:"waitForResume",key:D(),params:{message:n}},s=`${ge}.pause(${n?N(n):""})`;return{commands:[a],python:s}},cg=(e,t,r)=>{const{moduleId:n}=e,{moduleEntities:a}=t,s="magneticModule/disengage";if(n===null)return{errors:[X()]};if(a[n]?.type!==c.MAGNETIC_MODULE_TYPE)throw new Error(`expected module ${n} to be magdeck, got ${a[n]?.type}`);const o=a[n].pythonName;return{commands:[{commandType:s,key:D(),params:{moduleId:n}}],python:`${o}.disengage()`}},Qh=(e,t,r)=>{const{pipetteId:n,volume:a,labwareId:s,wellName:o,flowRate:i,isAirGap:l,wellLocation:u,pushOut:p,primaryNozzle:d,nozzles:f}=e,_="dispense",m=r.labware,h=[],b=t.pipetteEntities[n]?.spec,T=(b?.displayCategory==="FLEX"||b?.channels===96)??!1,y=Rn(s,r.labware);if(b||h.push(ut({pipette:n})),vn({pipette:n,labware:s,invariantContext:t,prevRobotState:r})&&h.push(pa()),r.tipState.pipettes[n]?.hasTip||h.push(Ut({actionName:_,pipette:n,labware:s,well:o})),!s||!r.labware[s]?h.push(ct({actionName:_,labware:s})):z(r.labware[s].stack)==="offDeck"&&h.push(mn()),De.includes(y))h.push(Ft({typeOfStep:_}));else if(m[y]!=null){const E=z(m[y].stack);De.includes(E)&&h.push(Ft({typeOfStep:_}))}if(t.pipetteEntities[n]?.spec.channels!==1&&!wt({robotState:r,invariantContext:t,pipetteId:n,labwareId:s,wellLocationOffset:u?.offset??{x:0,y:0,z:0},wellTargetName:o,primaryNozzle:d,nozzleConfiguration:f})&&h.push($r()),Pa(r.modules,r.labware,s)&&h.push(dn()),Ra(r.modules,r.labware,s)&&h.push(Dr()),Da(r.modules,r.labware,s)&&h.push(ts()),Ma(r.modules,r.labware,s)&&h.push(fn()),Cn(r.modules,y,T?c.FLEX_ROBOT_TYPE:c.OT2_ROBOT_TYPE)&&h.push(fa()),T||(Pn(r.modules,y)&&h.push(da()),Nn(r.modules,y,b)&&h.push(ma()),Ca(r.modules,y,b,t.labwareEntities[s])&&h.push(rs())),h.length>0)return{errors:h};const w=[{commandType:"dispense",key:D(),params:{pipetteId:n,volume:a,labwareId:s,wellName:o,wellLocation:u,flowRate:i,...p!=null?{pushOut:p}:{}},...l&&{meta:{isAirGap:l}}}],g=t.pipetteEntities[n].pythonName,I=t.labwareEntities[s].pythonName,L=[`volume=${a}`,`location=${I}[${N(o)}]${An(u)}`,`flow_rate=${i}`,...p!=null?[`push_out=${p}`]:[]],A=`${g}.dispense(
|
|
11
|
+
${Z(L.join(`,
|
|
82
12
|
`))},
|
|
83
|
-
)`;return{commands:
|
|
84
|
-
`),
|
|
85
|
-
${
|
|
86
|
-
`;if(l!=null&&l.storedLabwareDetails===null&&l.labwareInHopper==null)return{errors:[
|
|
87
|
-
`:[],...a!=null?[`message=${
|
|
88
|
-
`]:[]].join("");return{commands:[{commandType:"flexStacker/fillItems",key:
|
|
89
|
-
${
|
|
90
|
-
`),
|
|
91
|
-
${
|
|
13
|
+
)`;return{commands:w,python:A}},nt=(e,t,r)=>{const{pipetteId:n,volume:a,flowRate:s,pushOut:o,correctionVolume:i,isAirGap:l}=e,u=[];r.tipState.pipettes[n]?.hasTip||u.push(Ut({actionName:"dispense",pipette:n}));const p=[{commandType:"dispenseInPlace",key:D(),params:{pipetteId:n,volume:a,flowRate:s,...o!=null?{pushOut:o}:{},...i!=null?{correctionVolume:i}:{}},...l?{meta:{isAirGap:l}}:{}}],d=t.pipetteEntities[n].pythonName,f=[`volume=${a}`,`flow_rate=${s}`,...o!=null?[`push_out=${o}`]:[]],_=`${d}.dispense(${f.join(", ")})`;return u.length>0?{errors:u}:{commands:p,python:_}},wn=(e,t,r)=>{const{pipette:n,dropTipLocation:a,wellName:s,isReturnTip:o}=e;if(!r.tipState.pipettes[n]?.hasTip)return{commands:[]};const i=r.pipettes[n].tiprackId,l=r.pipettes[n].tipWell,u=Object.values(t.labwareEntities).find(({id:_})=>_===i),p=u!=null&&l!=null;if(o&&!p)return{errors:[jc()]};let d=null;if(o&&p){const _=t.pipetteEntities[n].pythonName,h=`${u.pythonName}["${l}"]`;d=`${_}.drop_tip(location=${h})`}let f=[];if(o){if(i==null||l==null)return{errors:[jc()]};f=[{commandType:"dropTip",key:D(),params:{pipetteId:n,labwareId:i,wellName:l}}]}else{if(a==null||s==null)return{errors:[yn()]};f=[{commandType:"dropTip",key:D(),params:{pipetteId:n,labwareId:a,wellName:s}}]}return{commands:f,...d!=null?{python:d}:{}}},hc=(e,t,r)=>{const{pipetteId:n}=e;return r.tipState.pipettes[n]?.hasTip?{commands:[{commandType:"dropTipInPlace",key:D(),params:{pipetteId:n}}]}:{commands:[]}},pg=(e,t,r)=>{const{moduleId:n,height:a}=e,{moduleEntities:s}=t,o="magneticModule/engage";if(n===null)return{errors:[X()]};if(s[n]?.type!==c.MAGNETIC_MODULE_TYPE)throw new Error(`expected module ${n} to be magdeck, got ${s[n]?.type}`);const i=s[n].pythonName;return{commands:[{commandType:o,key:D(),params:{moduleId:n,height:a}}],python:`${i}.engage(height_from_base=${a})`}},dg=(e,t,r)=>{const{moduleEntities:n}=t,{moduleId:a,strategy:s,message:o,count:i}=e,l=dt(r,a);if(a==null||n[a]==null)return{errors:[X()]};const u=[];if(l==null&&u.push(X()),u.length>0)return{errors:u};const p=n[a].pythonName;return{commands:[{commandType:"flexStacker/empty",key:D(),params:{moduleId:a,strategy:s,message:o,count:i}}],python:`${p}.empty(${e.message?`message=${N(e.message)}`:""})`}},fg=(e,t,r)=>{const{moduleId:n,interventionMessage:a,fillLabwareIds:s}=e,{labwareEntities:o,moduleEntities:i}=t;if(n==null||i[n]==null)return{errors:[X()]};const l=dt(r,n),u=Lc(l,t.labwareEntities),p=i[n].pythonName,d=s.filter(T=>!c.getIsLid(o[T].def)).map(T=>o[T]?.pythonName),_=_s(d,4).map(T=>La+T.join(", ")).join(`,
|
|
14
|
+
`),m=d.length<4?d.join(", "):`
|
|
15
|
+
${_}
|
|
16
|
+
`;if(l!=null&&l.storedLabwareDetails===null&&l.labwareInHopper==null)return{errors:[zy()]};if(u){if(s.length>0&&!s.every(y=>Sc(y,t,l)))return{errors:[sh()]}}else return{errors:[oh()]};const b=[...s.filter(T=>!c.getIsLid(o[T].def)).length>0?`labware=[${m}],
|
|
17
|
+
`:[],...a!=null?[`message=${N(a)},
|
|
18
|
+
`]:[]].join("");return{commands:[{commandType:"flexStacker/fillItems",key:D(),params:{moduleId:n,labware:s,message:a??void 0}}],python:`${p}.fill_items(
|
|
19
|
+
${Z(b)})`}},mg=(e,t,r)=>{const{moduleId:n}=e,{moduleEntities:a}=t;if(n==null||a[n]==null)return{errors:[X()]};const s=a[n].pythonName,o=dt(r,n),i=o?.labwareInHopper!=null&&o.labwareInHopper.length>0;return o!==null&&Ac(o)?{errors:[Hy()]}:i?{commands:[{commandType:"flexStacker/retrieve",key:D(),params:{moduleId:n}}],python:`${s}.retrieve()`}:{errors:[xy()]}},hg=(e,t,r)=>{const{moduleId:n}=e,{labwareEntities:a,moduleEntities:s}=t;if(n==null||s[n]==null)return{errors:[X()]};const o=s[n].pythonName,i=dt(r,n),l=i?.labwareOnShuttle?.primaryLabwareId??null,u=Lc(i,a);return i!==null&&!Ac(i)?{errors:[jy()]}:l!==null&&!Sc(l,t,i)?{errors:[sh()]}:u?{commands:[{commandType:"flexStacker/store",key:D(),params:{moduleId:n,strategy:"automatic"}}],python:`${o}.store()`}:{errors:[oh()]}};function ll(){return{type:"ASPIRATE_MORE_THAN_WELL_CONTENTS",message:"Not enough liquid"}}function ul(){return{type:"ASPIRATE_FROM_PRISTINE_WELL",message:"This step tries to aspirate from an empty well."}}function _g(){return{type:"LABWARE_IN_WASTE_CHUTE_HAS_LIQUID",message:"Disposing of a labware with liquid"}}function yg(){return{type:"TIPRACK_IN_WASTE_CHUTE_HAS_TIPS",message:"Disposing unused tips"}}function bg(){return{type:"TEMPERATURE_IS_POTENTIALLY_UNREACHABLE",message:"The module set temperature is potentially unreachable."}}function Tg(){return{type:"WAITING_FOR_NONEXISTENT_TASK",message:"This step is waiting for a task that was never started."}}const gg="opentrons_flex_tiprack_lid",Ig=(e,t,r)=>{const{labwareId:n,strategy:a,newLocation:s}=e,o=a==="usingGripper",{gripperEntities:i,trashBinEntities:l,wasteChuteEntities:u,labwareEntities:p,moduleEntities:d}=t,f=Object.keys(i).length>0,_=Object.values(u).length>0,m=r.tipState!=null?d_(r.tipState,n):!1,h=r.liquidState!=null?f_(r.liquidState,n):!1,b=Object.values(r.tipState.pipettes).some(({hasTip:P})=>P),T="moveToLabware",y=[],S=[],w=c.locationIsOnAddressableArea(s)&&s.addressableAreaName==="gripperWasteChute";!n||!r.labware[n]?y.push(ct({actionName:T,labware:n})):z(r.labware[n].stack)==="offDeck"&&o?y.push(mn()):r.labware[n].stack.includes(He)&&y.push(ib());const g=p[n]?.def.metadata.displayCategory==="aluminumBlock";o&&g&&y.push(Ky()),(w&&f&&!o||!f&&o)&&y.push(Yy()),b&&o&&y.push(Fy());const I=r.labware[n]!=null?z(r.labware[n].stack):null;(_&&I==="gripperWasteChute"||c.MOVABLE_TRASH_ADDRESSABLE_AREAS.includes(I)||I==="fixedTrash")&&y.push(ha());const L=I!=null&&r.labware[I]!=null?z(r.labware[I].stack):null,A=L??I,E=P=>P==null?null:P in r.modules?r.modules[P].moduleState:Object.values(r.modules).find(({slot:v})=>v===P)?.moduleState??null,k=Object.entries(r.labware).filter(([P,v])=>v.stack.includes("offDeck")).map(([P])=>P),R=Object.values(s);k.some(P=>R.includes(P))&&o&&y.push(By());const B=E(A);B!=null&&(B.type===c.THERMOCYCLER_MODULE_TYPE&&B.lidOpen!==!0?y.push(dn()):B.type===c.HEATERSHAKER_MODULE_TYPE?B.latchOpen!==!0?y.push(Hc()):B.targetSpeed!==null&&y.push(fn()):B.type===c.ABSORBANCE_READER_TYPE&&B.lidOpen!==!0&&y.push(Dr()));const F=c.locationIsOnModule(s)&&"moduleId"in s?s.moduleId:null,te=c.locationIsOnLabware(s)?s.labwareId:null,de=te!=null?r.labware[te].stack[1]:null,_e=de??F;s==="offDeck"&&o&&y.push(mn()),m&&w&&_?S.push(yg()):h&&w&&_&&S.push(_g());const oe=E(_e);oe!=null&&(oe.type===c.THERMOCYCLER_MODULE_TYPE&&oe.lidOpen!==!0?y.push(dn()):oe.type===c.HEATERSHAKER_MODULE_TYPE?(oe.latchOpen!==!0&&y.push(Hc()),oe.targetSpeed!==null&&y.push(fn())):oe.type===c.ABSORBANCE_READER_TYPE&&oe.lidOpen!==!0&&y.push(Dr())),p[n]?.def.parameters.loadName===gg&&s!=null&&c.locationIsOnDeck(s)&&("slotName"in s||"addressableAreaName"in s&&c.FLEX_STAGING_AREA_SLOT_ADDRESSABLE_AREAS.includes(s.addressableAreaName))&&y.push(rb());const ve={labwareId:n,strategy:a,newLocation:s},ze=[{commandType:"moveLabware",key:D(),params:ve}],Ue=p[n]?.pythonName;let J="",Le=null;if(s==="offDeck")J=oa;else if(s==="systemLocation")J="system_location";else if(s==="wasteChuteLocation")J=oa;else if("labwareId"in s){J=p[s.labwareId].pythonName;const P=r.labware[s.labwareId].stack;Le=P[P.length-1]}else if("moduleId"in s)Le=r.modules[s.moduleId].slot,J=d[s.moduleId].pythonName;else if("slotName"in s){const{slotName:P}=s;if(P in p){const v=z(r.labware[P].stack);J=c.getIsLid(p[P].def)?N(v):p[P].pythonName;const C=r.labware[P].stack;Le=C[C.length-1]}else J=N(P),Le=P}else if("addressableAreaName"in s){const P=De.includes(s.addressableAreaName),v=c.WASTE_CHUTE_ADDRESSABLE_AREAS.includes(s.addressableAreaName),$=s.addressableAreaName==="fixedTrash",ae=c.MOVABLE_TRASH_ADDRESSABLE_AREAS.includes(s.addressableAreaName)||$?Object.values(l)?.map(M=>M.location):[],q=!v&&!P?a_(s.addressableAreaName,$?"fixedTrashSlot":"trashBinAdapter",$?c.OT2_ROBOT_TYPE:c.FLEX_ROBOT_TYPE):null,x=ae.find(M=>M===q),H=x!=null?Object.values(l).find(M=>M.location===x)?.id:null;P?J=N(s.addressableAreaName):H!=null&&!v?J=l[H]?.pythonName??"":H==null&&v?J=Object.values(u)[0]?.pythonName??"":J=""}if(Le!=null){const P=ys(r.labware,Le),v=z(P),{isCompatible:$,isAboveStackLimit:C}=y_(n,P,p,d);$||y.push(Wy()),C&&y.push(ab({slot:v}))}if(y.length>0)return{errors:y};J===""&&console.error("expected to find a python new location but could not");const Ge=o?", use_gripper=True":"",Be=c.getIsLid(p[n].def),re=r.labware[n].stack;let W="";if(Be){const P=m_(re);if(P==null)console.error("expected to find a parent for labware to move but could not");else{const v=p[P]!=null,$=v&&c.getIsLid(p[P].def);re.length===2||v&&$?W=N(z(re)):(v||!c.getIsLid(p[P].def))&&(W=p[P].pythonName)}}Be&&W===""&&console.error("expected to find a valid lid move location but could not");const Y=Be?`${ge}.move_lid(${W}, ${J}${Ge})`:`${ge}.move_labware(${Ue}, ${J}${Ge})`;return{commands:ze,...S.length>0?{warnings:S}:{},python:Y}},qe=(e,t,r)=>{const{pipetteId:n,fixtureId:a,offset:s}=e,{pipetteEntities:o,trashBinEntities:i,wasteChuteEntities:l}=t,u=o[n],p=u.spec.channels,d=u.pythonName,f=i[a]??l[a],_=f.pythonName;let m=s_(p);return i[a]!=null&&(m=yc(f.location)),{commands:[{commandType:"moveToAddressableArea",key:D(),params:{pipetteId:n,addressableAreaName:m,offset:s}}],python:`${d}.move_to(${_})`}},Jh=(e,t,r)=>{const{pipetteId:n,addressableAreaName:a}=e;return{commands:[{commandType:"moveToAddressableAreaForDropTip",key:D(),params:{pipetteId:n,addressableAreaName:a,offset:{x:0,y:0,z:0},alternateDropLocation:!0}}]}},V=(e,t,r)=>{const{pipetteId:n,labwareId:a,wellName:s,wellLocation:o,minimumZHeight:i,forceDirect:l,speed:u}=e,p="moveToWell",d=[],f=r.labware,{pipetteEntities:_,labwareEntities:m}=t,h=_[n]?.spec,b=r.pipettes[n]?.nozzles??c.ALL,T=r.pipettes[n]?.primaryNozzle??es({nozzles:b,channels:h?.channels}),y=(h?.displayCategory==="FLEX"||h?.channels===96)??!1,S=Rn(a,r.labware);if(h||d.push(ut({pipette:n})),!a||!r.labware[a]?d.push(ct({actionName:p,labware:a})):z(r.labware[a].stack)==="offDeck"&&d.push(mn()),De.includes(S))d.push(Ft({typeOfStep:"move to well"}));else if(f[S]!=null){const k=z(f[S].stack);De.includes(k)&&d.push(Ft({typeOfStep:p}))}vn({pipette:n,labware:a,invariantContext:t,prevRobotState:r})&&d.push(pa()),Pa(r.modules,r.labware,a)&&d.push(dn()),Da(r.modules,r.labware,a)&&d.push(ts()),Ra(r.modules,r.labware,a)&&d.push(Dr()),Ma(r.modules,r.labware,a)&&d.push(fn()),Cn(r.modules,S,y?c.FLEX_ROBOT_TYPE:c.OT2_ROBOT_TYPE)&&d.push(fa()),y||(Pn(r.modules,S)&&d.push(da()),Nn(r.modules,S,h)&&d.push(ma()),Ca(r.modules,S,h,m[a])&&d.push(rs()));const w=t.pipetteEntities[n]?.spec.channels!==1,g=t.pipetteEntities[n]?.spec;if(w&&g&&!wt({robotState:r,invariantContext:t,pipetteId:n,labwareId:a,wellLocationOffset:o?.offset??{x:0,y:0,z:0},wellTargetName:s,nozzleConfiguration:b,primaryNozzle:T})&&d.push($r()),d.length>0)return{errors:d};const I=_[n].pythonName,L=m[a].pythonName,A=[{commandType:"moveToWell",key:D(),params:{pipetteId:n,labwareId:a,wellName:s,wellLocation:o,...l!=null?{forceDirect:l}:{},...i!=null?{minimumZHeight:i}:{},...u!=null?{speed:u}:null}}],E=[`${L}[${N(s)}]${An(o)}`,...l?["force_direct=True"]:[],...i?[`minimum_z_height=${i}`]:[],...u?[`speed=${u}`]:[]];return{commands:A,python:`${I}.move_to(${E.join(", ")})`}},cl=(e,t,r)=>{const{pipetteId:n,labwareId:a,wellName:s,tipTrackingOption:o=Qu,nozzles:i,primaryNozzle:l}=e,u=[],p=t.pipetteEntities[n].spec.channels,d=wt({robotState:r,invariantContext:t,pipetteId:n,labwareId:a,wellLocationOffset:{x:0,y:0},wellTargetName:s,nozzleConfiguration:i,primaryNozzle:l}),f=fy({tipState:r.tipState.tipracks[a],primaryNozzle:l,channels:p,nozzleConfiguration:i,wellName:s,tiprackDef:t.labwareEntities[a].def});d||u.push($r()),f.isSafe||u.push(sb()),f.isComplete!==!0&&u.push(ob());const _=z(r.labware[a].stack);if(De.includes(_))u.push(Ft({typeOfStep:"pick up tip"}));else if(r.labware[_]!=null){const T=z(r.labware[_].stack);De.includes(T)&&u.push(Ft({typeOfStep:"pick up tip"}))}const m=t.pipetteEntities[n].pythonName,h=t.labwareEntities[a].pythonName,b=`${m}.pick_up_tip(location=${h}${o===Et?`[${N(s)}]`:""})`;return u.length>0?{errors:u}:{commands:[{commandType:"pickUpTip",key:D(),params:{pipetteId:n,labwareId:a,wellName:s}}],python:b}},Eg=(e,t,r)=>{const{moduleId:n,taskId:a,profileElements:s,blockMaxVolumeUl:o}=e,i=t.moduleEntities[n].pythonName,l=hy(e.profileElements),u=l.repeatingProfileSteps.map(m=>`{${N("temperature")}: ${m.celsius}, ${N("hold_time_seconds")}: ${m.holdSeconds}},`).join(`
|
|
20
|
+
`),d=`${`[
|
|
21
|
+
${Z(u)}
|
|
92
22
|
],`}
|
|
93
23
|
${l.numRepetitions},
|
|
94
|
-
`+(e.blockMaxVolumeUl!==void 0?`block_max_volume=${e.blockMaxVolumeUl},`:""),
|
|
95
|
-
${
|
|
96
|
-
)`;return{commands:[{commandType:"thermocycler/startRunExtendedProfile",key:ne(),params:{moduleId:n,taskId:a,profileElements:o,blockMaxVolumeUl:i}}],python:y}},qt=(e,t,r)=>{const{pipetteId:n}=e,a=t.pipetteEntities[n].pythonName;return{commands:[{commandType:"prepareToAspirate",key:ne(),params:{pipetteId:n}}],python:`${a}.prepare_to_aspirate()`}},bg=(e,t,r)=>{const{moduleId:n,celsius:a}=e;if(n===null)return{errors:[ke()]};const o=t.moduleEntities[n],i=o?.type;return i===f.TEMPERATURE_MODULE_TYPE?{commands:[{commandType:"temperatureModule/setTargetTemperature",key:ne(),params:{moduleId:n,celsius:a}}],python:`${o?.pythonName}.start_set_temperature(${a})`}:i===f.THERMOCYCLER_MODULE_TYPE?(console.error("Thermocycler set temp not implemented!"),{commands:[]}):i===f.HEATERSHAKER_MODULE_TYPE?{commands:[{commandType:"heaterShaker/setTargetTemperature",key:ne(),params:{moduleId:n,celsius:a}}],python:`${o?.pythonName}.set_target_temperature(${a})`}:(console.error(`setTemperature expected module ${n} to be ${f.TEMPERATURE_MODULE_TYPE}, ${f.THERMOCYCLER_MODULE_TYPE} or ${f.HEATERSHAKER_MODULE_TYPE}, got ${i}`),{errors:[ke()]})},Ct=(e,t,r)=>{const n="touchTip",{pipetteId:a,labwareId:o,wellName:i,zOffsetFromTop:s,speed:l,mmFromEdge:u}=e,c=r.pipettes[a],p=[];if(c||p.push(ft({pipette:a})),r.tipState.pipettes[a]?.hasTip||p.push(Ft({actionName:n,pipette:a,labware:o,well:i})),p.length>0)return{errors:p};const d=t.pipetteEntities[a].pythonName,b=[`${t.labwareEntities[o].pythonName}[${ee(i)}]`,`v_offset=${s}`,...l!=null?[`speed=${l}`]:[],...u!=null?[`mm_from_edge=${u}`]:[]],h=`${d}.touch_tip(${b.join(", ")})`;return{commands:[{commandType:"touchTip",key:ne(),params:{pipetteId:a,labwareId:o,wellName:i,wellLocation:{origin:f.WELL_ORIGIN_TOP,offset:{z:s}},speed:l,mmFromEdge:u}}],python:h}},gg=(e,t,r)=>{const{moduleId:n,celsius:a}=e,o=n?St(r,n):null,i=[];if(n===null||!o)return{errors:[ke()]};if(o.type!==f.TEMPERATURE_MODULE_TYPE&&o.type!==f.HEATERSHAKER_MODULE_TYPE)return console.error(`expected module to be ${f.TEMPERATURE_MODULE_TYPE} but got ${o.type}`),{errors:[ke()]};const s="status"in o&&o.status===Zc&&o.targetTemperature!==a,l="status"in o&&o.status===Jc&&o.targetTemperature!==a;if(s||"status"in o&&o.status===ba||"targetTemp"in o&&o.targetTemp==null)return{errors:[Z_()]};l&&i.push(iI());const u=t.moduleEntities[n],c=u?.type;switch(c){case f.TEMPERATURE_MODULE_TYPE:return{commands:[{commandType:"temperatureModule/waitForTemperature",key:ne(),params:{moduleId:n,celsius:a}}],warnings:i.length>0?i:void 0,python:`${u?.pythonName}.await_temperature(${a})`};case f.HEATERSHAKER_MODULE_TYPE:return{commands:[{commandType:"heaterShaker/waitForTemperature",key:ne(),params:{moduleId:n,celsius:a}}],warnings:i.length>0?i:void 0,python:`${u?.pythonName}.wait_for_temperature()`};default:return console.error(`awaitTemperature expected module ${n} to be ${f.TEMPERATURE_MODULE_TYPE} or ${f.HEATERSHAKER_MODULE_TYPE}, got ${c}`),{errors:[ke()]}}};function ae(e,t){return(r,n)=>e(t,r,n)}function j(e,t){return(r,n)=>{const a=e(t,r,n);if("python"in a){const{python:o,...i}=a;return i}return a}}const Qe="__air__",$r="source_well",In="dest_well",_g=(e,t,r)=>{const o=f.getDeckDefFromRobotType(r).cutoutFixtures.find(l=>l.id.includes(t))?.providesAddressableAreas,s=(l=>{if(o!=null){for(const u in o)if(o[u].includes(l))return u}return null})(e);if(s==null)throw Error(`expected to find cutoutId from addressableAreaName ${e} but could not`);return s};function Tg(e){switch(e){case 1:return f.ONE_CHANNEL_WASTE_CHUTE_ADDRESSABLE_AREA;case 8:return f.EIGHT_CHANNEL_WASTE_CHUTE_ADDRESSABLE_AREA;case 96:return f.NINETY_SIX_CHANNEL_WASTE_CHUTE_ADDRESSABLE_AREA}}function Ip(e){const t=f.getDeckDefFromRobotType(e==="cutout12"?f.OT2_ROBOT_TYPE:f.FLEX_ROBOT_TYPE);let r=null;return t.robot.model===f.FLEX_ROBOT_TYPE&&(r=t.cutoutFixtures.find(n=>n.id==="trashBinAdapter")?.providesAddressableAreas??null),t.robot.model===f.FLEX_ROBOT_TYPE&&r==null&&console.error(`expected to find a list of cutouts for the Flex but could not with trashLocation ${e}`),r!=null?r[e]?.[0]:"fixedTrash"}function Eg(e){if(e==="fixedTrash")return"cutout12";const r=f.getDeckDefFromRobotType(f.FLEX_ROBOT_TYPE).cutoutFixtures.find(n=>n.id==="trashBinAdapter")?.providesAddressableAreas??null;if(r==null)return console.error("Could not find trashBinAdapter cutouts for Flex"),null;for(const[n,a]of Object.entries(r))if(a.includes(e))return n;return console.error(`Could not find trashLocation for addressableAreaName ${e}`),null}function Sn(e,t,r,n){return e[n]!=null?"labware":t[n]!=null?"wasteChute":r[n]!=null?"trashBin":(console.error(`expected to determine if dest labware is a labware or waste chute with destLabware ${n} but could not`),null)}function wg(e,t){return dn(ln(t),r=>e)}function ur(e){return pt(e,(t,r,n)=>n===Qe?t:t+r.volume,0)}function zt(e,t){const r=ur(t);if(r===0)return{source:t,dest:{[Qe]:{volume:e}}};if(e>r)return{source:Wt(t,()=>({volume:0})),dest:{...t,[Qe]:{volume:e-r}}};const n=pt(t,(a,o,i)=>({...a,[i]:o.volume/r}),{});return Object.keys(t).reduce((a,o)=>{const i=n[o]*e;return{source:{...a.source,[o]:{volume:t[o].volume-i}},dest:{...a.dest,[o]:{volume:i}}}},{source:{},dest:{}})}function cr(e,t){return{...t,...pt(e,(r,n,a)=>{const i=a in t?n.volume+t[a].volume:n.volume;return{...r,[a]:{volume:i}}},{})}}function Sp(e,t,r){const n=e===1?[r]:f.getWellNamePerMultiTip(t,r,e);if(!n)return console.warn(e===1?`Invalid well: ${r}`:`For labware def (URI ${f.getLabwareDefURI(t)}), with primary well ${r}, no wells are accessible by 8-channel's 1st tip`),{wellsForTips:[],allWellsShared:!1};const a=n.every(o=>o&&o===n[0]);return{wellsForTips:n,allWellsShared:a}}const Ig=e=>{const{pipette:t,sourceLabwareId:r,sourceWell:n,destLabwareId:a,destWell:o,blowoutLocation:i,flowRate:s,offsetFromTopMm:l,invariantContext:u}=e;if(!i)return[];const{trashBinEntities:c,wasteChuteEntities:p}=u;let d=null,y=null;return i===$r?(d=r,y=n):i===In&&(d=a,y=o),y!=null&&d!=null?[ae(ag,{pipetteId:t,labwareId:d,wellName:y,flowRate:s,wellLocation:{origin:"top",offset:{z:l}}})]:p[i]!=null?[ae(D_,{pipetteId:t,flowRate:s,wasteChuteId:Object.keys(p)[0]})]:[ae(C_,{pipetteId:t,trashId:Object.keys(c)[0],flowRate:s})]};function Sg(e){const{labwareEntities:t,pipetteEntities:r,wasteChuteEntities:n,trashBinEntities:a}=e;return{pipettes:pt(r,(o,i,s)=>{const l=i.spec;return{...o,[s]:Ag(l.channels,{})}},{}),labware:pt(t,(o,i,s)=>({...o,[s]:Wt(i.def.wells,()=>({}))}),{}),trashBins:pt(a,(o,i,s)=>({...o,[s]:{}}),{}),wasteChute:pt(n,(o,i,s)=>({...o,[s]:{}}),{})}}function Ag(e,t){return ln(e).reduce((r,n)=>({...r,[n]:t}),{})}const Og=e=>{const{blowoutLocation:t,sourceLabware:r,destLabware:n,sourceWell:a,destWell:o}=e;return t===$r&&r!=null&&a!=null?{dispenseAirGapLabware:r,dispenseAirGapWell:a}:{dispenseAirGapLabware:n,dispenseAirGapWell:o}};function Ap(e){const{invariantContext:t,labwareLocations:r,moduleLocations:n={},pipetteLocations:a}=e;return{labware:r,modules:n,pipettes:a,liquidState:Sg(t),tipState:{pipettes:pt(a,(o,i,s)=>i.mount?{...o,[s]:{hasTip:!1,tiprackURI:null}}:o,{}),tipracks:pt(r,(o,i,s)=>{const l=t.labwareEntities[s].def;if(!f.getIsTiprack(l))return o;const u=Wt(l.wells,()=>ro);return{...o,[s]:u}},{})}}}const vg=(e,t)=>e.tipracks[t]!=null?Object.values(e.tipracks[t]).some(r=>r!==Pe):!1,Lg=(e,t)=>e.labware[t]!=null?Object.values(e.labware[t]).some(r=>Object.values(r).some(n=>n.volume>0)):!1,pI=(e,t,r)=>{const{destinationId:n,pipetteId:a,volume:o,flowRate:i,offsetFromBottomMm:s,well:l,xOffset:u,yOffset:c,tipRack:p,primaryNozzle:d,nozzles:y}=e,{labwareEntities:b,trashBinEntities:h,wasteChuteEntities:g}=t,T=Sn(b,g,h,n);let m=[];return T==="labware"&&s!=null&&l!=null?m=[ae(hg,{pipetteId:a,volume:o,labwareId:n,wellName:l,flowRate:i,wellLocation:{origin:"bottom",offset:{z:s,x:u,y:c}},tipRack:p,primaryNozzle:d,nozzles:y})]:T==="wasteChute"?m=[ae(VO,{pipetteId:a,volume:o,flowRate:i,wasteChuteId:g[n].id})]:m=[ae(xO,{pipetteId:a,volume:o,flowRate:i,trashId:h[n].id})],Ne(m,t,r)},fI=(e,t,r)=>{const{destinationId:n,pipetteId:a,zOffset:o,well:i}=e,{labwareEntities:s,wasteChuteEntities:l,trashBinEntities:u}=t,c=Sn(s,l,u,n);let p=[];return c==="labware"&&i!=null?p=[ae(ye,{pipetteId:a,labwareId:n,wellName:i,wellLocation:{origin:"bottom",offset:{x:0,y:0,z:o}}})]:c==="wasteChute"?p=[ae(Xe,{pipetteId:a,fixtureId:l[n].id,offset:{x:0,y:0,z:0}})]:p=[ae(Xe,{pipetteId:a,fixtureId:u[n].id,offset:Et})],Ne(p,t,r)},dI=(e,t,r)=>{const{blowOutLocation:n,destinationId:a,destWell:o,flowRate:i,pipetteId:s,sourceId:l,sourceWell:u,volume:c}=e,{labwareEntities:p,trashBinEntities:d,wasteChuteEntities:y}=t,b=Sn(p,y,d,a);let h=[];if(b==="labware"&&o!=null){const{dispenseAirGapLabware:g,dispenseAirGapWell:T}=Og({blowoutLocation:n,sourceLabware:l,destLabware:a,sourceWell:u,destWell:o});h=[ae(qO,{flowRate:i,pipetteId:s,labwareId:g,wellName:T,volume:c,type:"dispense"})]}else b==="wasteChute"?h=[ae(DO,{pipetteId:s,volume:c,flowRate:i,wasteChuteId:y[a].id})]:h=[ae(CO,{pipetteId:s,volume:c,flowRate:i,trashId:d[a].id})];return Ne(h,t,r)},mI=(e,t,r)=>{const{pipetteId:n,destinationId:a,well:o,zOffset:i,seconds:s}=e,{labwareEntities:l,trashBinEntities:u,wasteChuteEntities:c}=t,p=Sn(l,c,u,a);let d=[];return o!=null&&p==="labware"?d=[ae(ye,{pipetteId:n,labwareId:a,wellName:o,wellLocation:{origin:"bottom",offset:{x:0,y:0,z:i}}}),ae(Me,{seconds:s})]:p==="wasteChute"?d=[ae(Xe,{pipetteId:n,fixtureId:a,offset:Et}),ae(Me,{seconds:s})]:d=[ae(Xe,{pipetteId:n,fixtureId:a,offset:Et}),ae(Me,{seconds:s})],Ne(d,t,r)},we=(e,t=!1)=>{if(e==null)return console.error("expected to find stack but could not"),"unknown slot";{const r=e[e.length-1];return t?`STACKER ${r.slice(-2,-1)}`:r}},Op=e=>e==null?(console.error("expected to find stack but could not"),"unknown top location"):e[0],Rg=e=>e.length>=2?e[1]:null,_o=(e,t)=>Object.values(e).reduce((r,{stack:n})=>(n[n.length-1]===t&&n.length>r.length&&(r=n),r),[]),vp=e=>f.FLEX_SINGLE_SLOT_BY_CUTOUT_ID[f.FLEX_CUTOUT_BY_SLOT_ID[e]],Pg=e=>{const t=f.FLEX_STACKER_ADDRESSABLE_AREAS.indexOf(e);return t===-1?null:We[t]},hI=e=>{const t=Pg(e);return t!=null?vp(t):null},kg=(e,t,r)=>{if(e==null)return null;if(We.includes(e)){const n=vp(e);return Object.entries(t).some(([o,i])=>r[o]?.type===f.FLEX_STACKER_MODULE_TYPE&&i.slot===n)?n:e}return e},To=e=>{const t=f.getDeckDefFromRobotType(f.FLEX_ROBOT_TYPE),r=`${e[0]}3`,n=f.FLEX_CUTOUT_BY_SLOT_ID[r],a=t.cutoutFixtures.find(({id:o})=>o===f.FLEX_STACKER_V1_FIXTURE)?.providesAddressableAreas[n];return f.FLEX_STACKER_ADDRESSABLE_AREAS.find(o=>a?.includes(o))??null},Ng=(e,t,r,n)=>{if(t.length===0)return{isCompatible:!0,isAboveStackLimit:!1};let a=!1;const o=t.find(u=>u in n);o!=null&&(a=n[o].type===f.FLEX_STACKER_MODULE_TYPE&&t.includes(Je));const i=Op(t);let s=!0,l=!1;if(i in r){const u=r[e],c=r[i],p=t.filter(O=>r[O]!=null),d=p.filter(O=>r[O]?.def?.allowedRoles?.includes("lid"))[0],y=p.filter(O=>r[O]?.def?.allowedRoles?.includes("adapter"))[0],b=c.def.parameters.loadName,h=p.filter(O=>!r[O]?.def?.allowedRoles?.includes("adapter")&&!r[O]?.def?.allowedRoles?.includes("lid"))[0];if(a){const O=f.getMaxPoolCount({labwareDefinitions:{primary:r[h]?.def??null,adapter:r[y]?.def??null,lid:r[d]?.def??null},model:f.FLEX_STACKER_MODULE_V1});l=t.length>O}else{const O=c.def.stackLimit??1,v=b===u.def.parameters.loadName,C=t.filter(N=>r[N]?.def.parameters.loadName===b)?.length;l=v&&C>=O}const g=u.def.parameters.loadName==="opentrons_tough_universal_lid",T=c.def.metadata.displayCategory==="tubeRack",m=c.def.metadata.displayCategory==="aluminumBlock",_=c.def.parameters.isTiprack,S=(c.def.allowedRoles??[]).includes("lid");s=u.def.compatibleParentLabware?.some(O=>O===b)||Object.keys(u.def.stackingOffsetWithLabware??{}).some(O=>O===b)||g&&!T&&!m&&!_&&(c.def.parameters.loadName==="opentrons_tough_universal_lid"||!S)}else if(i in n){const u=n[i],{model:c}=u;s=Object.keys(r[e].def.stackingOffsetWithModule??{}).some(p=>c===p)}return{isCompatible:s,isAboveStackLimit:l}},Ia=(e,t)=>t?.find(r=>e[r]!=null)??null,Lp=(e,t,r)=>{if(t==="offDeck"&&r==null)return console.error("offDeck slot is not allowed to be used without an offDeckOverrideId"),[];const n=Cg(t),a=n?Nb[t]:t,o=Object.values(e).filter(i=>i.stack.includes(a)&&(r==null||i.stack.includes(r))&&i.stack.includes(Je)===n);return n?o.reverse()[0].stack??[]:o.sort((i,s)=>s.stack.length-i.stack.length)[0]?.stack??[]},yI=(e,t)=>Object.values(t).filter(r=>r.stack.includes(e)).sort((r,n)=>n.stack.length-r.stack.length)[0]?.stack[0],Jn=(e,t,r,n=!0)=>{const a=f.linearInterpolate(e,t)??0,o=f.linearInterpolate(e,r)??0;return e+(n?a:0)+o},Rp=e=>{const{path:t,volume:r,pipetteSpecs:n,tiprackDefinition:a,conditioningByVolume:o,disposalByVolume:i,numDispenseWells:s,numAspirateWells:l,aspirateAirGapByVolume:u}=e,{liquids:c}=n,d=r<c.default.minVolume&&"lowVolumeDefault"in c?c.lowVolumeDefault.maxVolume:c.default.maxVolume,y=a?.wells.A1.totalLiquidVolume,b=y==null?d:Math.min(d,y),h=r*2,g=o!=null?f.linearInterpolate(h,o)??0:0,m=a?.namespace!=="opentrons"||o!=null&&i!=null&&b>=h+g+(f.linearInterpolate(h,i)??0)+(g===0?f.linearInterpolate(h,u)??0:0),_=b>=h;if(t==="multiAspirate"&&l<=s?console.warn("Invalid combination of source and destination wells for multiAspirate path"):t==="multiDispense"&&l>=s?console.warn("Invalid combination of source and destination wells for multiDispense path"):t==="single"&&l!==s&&console.warn("Invalid combination of source and destination wells for single path"),t==="single"||t==="multiDispense"&&!m||t==="multiAspirate"&&!_){const v=f.linearInterpolate(r,u)??0,C=Math.ceil((r+v)/b),N=r/C;return{referenceVolumes:{airGap:{aspirate:N,dispense:0},correction:{aspirate:N,dispense:N},pushOut:N,flowRate:{aspirate:N,dispense:N}},multiWellHandling:{isSupported:!1}}}if(t==="multiDispense"){let v=0,C=0;for(let N=0;N<s&&!(Jn((N+1)*r,o??[],i??[])>b);N++)v=(N+1)*r,C+=1;return{referenceVolumes:{airGap:{aspirate:Jn(v,o??[],i??[],!1),dispense:Jn((C-1)*r,o??[],i??[],!1)},correction:{aspirate:Jn(v,o??[],i??[]),dispense:r},flowRate:{aspirate:Jn(v,o??[],i??[]),dispense:r},pushOut:r,conditioning:v,disposal:v},multiWellHandling:{isSupported:!0,numWellsToFitInTip:C}}}const I=Math.floor(b/r),S=Math.min(I,l),O=S*r;return{referenceVolumes:{airGap:{aspirate:O,dispense:0},pushOut:O,correction:{aspirate:O,dispense:O},flowRate:{aspirate:r,dispense:O}},multiWellHandling:{isSupported:!0,numWellsToFitInTip:S}}},Nr=e=>{const{retractZOffset:t,retractPositionReference:r,labwareId:n,labwareEntities:a,well:o}=e;if(o==null)return!1;const i=a[n]?.def.wells[o]?.depth;if(i==null)return!1;const s=f.getMmFromBottom(t,r,i);return s==null?!1:s-i>=f.SAFE_MOVE_TO_WELL_OFFSET_FROM_TOP_MM},Mc=e=>e.reduce((t,r)=>{const{kind:n}=r;return n==="onCutoutFixture"?t:n==="onLabware"?[...t,r.labwareId]:n==="onModule"||n==="inStackerHopper"?[...t,r.moduleId]:n==="onAddressableArea"?[...t,r.addressableAreaName]:[...t,r.logicalLocationName]},[]),bI={A4:"cutoutA3",B4:"cutoutB3",C4:"cutoutC3",D4:"cutoutD3"};function Uc(e){if(e.location!=="offDeck"&&e.location!=="systemLocation"&&e.location!=="wasteChuteLocation"&&"addressableAreaName"in e.location&&Rb.includes(e.location.addressableAreaName)){const t=ne(),r=e.location.addressableAreaName,n=bI[r]??r;return{[t]:{id:t,location:n}}}return{}}const gI=(e,t)=>{const r=_o(e,t),n=r.indexOf(Je);return r[n-1]},Cg=e=>kb.includes(e),Pp=e=>e.labwareOnShuttle?.primaryLabwareId??null,kp=(e,t,r)=>{if(r?.storedLabwareDetails==null)return!0;const n=Object.values(r?.storedLabwareDetails??{}).reduce((o,i)=>i!=null?[...o,i]:o,[]),a=t.labwareEntities[e];return n.some(o=>a?.labwareDefURI===o)},Np=(e,t)=>{const{storedLabwareDetails:r}=e??{};if(r==null)return!0;const{primaryLabwareURI:n,adapterLabwareURI:a,lidLabwareURI:o}=r,i=Object.values(t).find(({labwareDefURI:d})=>d===n),s=Object.values(t).find(({labwareDefURI:d})=>d===a),l=Object.values(t).find(({labwareDefURI:d})=>d===o);if(i==null)return console.error("Primary labware entity not found"),!1;const u=f.getMaxPoolCount({labwareDefinitions:{primary:i.def,adapter:s?.def??null,lid:l?.def??null},model:f.FLEX_STACKER_MODULE_V1}),p=e?.labwareInHopper?.length??0;return u>p},Sa=(e,t,r)=>{const n=t[r]?.stack,a=Ia(e,n),o=a!=null?e[a].moduleState:null;return!!(o&&o.type===f.ABSORBANCE_READER_TYPE&&o.lidOpen!==!0)};var du,Ch;function Dg(){if(Ch)return du;Ch=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return du=e,du}var _I=Dg();const Cp=Ye(_I);var qg=Symbol.for("immer-nothing"),Dh=Symbol.for("immer-draftable"),lt=Symbol.for("immer-state"),TI=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function et(e,...t){if(process.env.NODE_ENV!=="production"){const r=TI[e],n=typeof r=="function"?r.apply(null,t):r;throw new Error(`[Immer] ${n}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var mn=Object.getPrototypeOf;function hn(e){return!!e&&!!e[lt]}function Cr(e){return e?Fg(e)||Array.isArray(e)||!!e[Dh]||!!e.constructor?.[Dh]||Aa(e)||wo(e):!1}var EI=Object.prototype.constructor.toString();function Fg(e){if(!e||typeof e!="object")return!1;const t=mn(e);if(t===null)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===EI}function Za(e,t){Eo(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function Eo(e){const t=e[lt];return t?t.type_:Array.isArray(e)?1:Aa(e)?2:wo(e)?3:0}function Bc(e,t){return Eo(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Mg(e,t,r){const n=Eo(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function wI(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Aa(e){return e instanceof Map}function wo(e){return e instanceof Set}function Rr(e){return e.copy_||e.base_}function jc(e,t){if(Aa(e))return new Map(e);if(wo(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=Fg(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[lt];let a=Reflect.ownKeys(n);for(let o=0;o<a.length;o++){const i=a[o],s=n[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[i]})}return Object.create(mn(e),n)}else{const n=mn(e);if(n!==null&&r)return{...e};const a=Object.create(n);return Object.assign(a,e)}}function Dp(e,t=!1){return Io(e)||hn(e)||!Cr(e)||(Eo(e)>1&&Object.defineProperties(e,{set:{value:za},add:{value:za},clear:{value:za},delete:{value:za}}),Object.freeze(e),t&&Object.values(e).forEach(r=>Dp(r,!0))),e}function za(){et(2)}function Io(e){return Object.isFrozen(e)}var II={};function Dr(e){const t=II[e];return t||et(0,e),t}var oa;function Ug(){return oa}function SI(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function qh(e,t){t&&(Dr("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function $c(e){xc(e),e.drafts_.forEach(AI),e.drafts_=null}function xc(e){e===oa&&(oa=e.parent_)}function Fh(e){return oa=SI(oa,e)}function AI(e){const t=e[lt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Mh(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[lt].modified_&&($c(t),et(4)),Cr(e)&&(e=Ja(t,e),t.parent_||Qa(t,e)),t.patches_&&Dr("Patches").generateReplacementPatches_(r[lt].base_,e,t.patches_,t.inversePatches_)):e=Ja(t,r,[]),$c(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==qg?e:void 0}function Ja(e,t,r){if(Io(t))return t;const n=t[lt];if(!n)return Za(t,(a,o)=>Uh(e,n,t,a,o,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Qa(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const a=n.copy_;let o=a,i=!1;n.type_===3&&(o=new Set(a),a.clear(),i=!0),Za(o,(s,l)=>Uh(e,n,a,s,l,r,i)),Qa(e,a,!1),r&&e.patches_&&Dr("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function Uh(e,t,r,n,a,o,i){if(process.env.NODE_ENV!=="production"&&a===r&&et(5),hn(a)){const s=o&&t&&t.type_!==3&&!Bc(t.assigned_,n)?o.concat(n):void 0,l=Ja(e,a,s);if(Mg(r,n,l),hn(l))e.canAutoFreeze_=!1;else return}else i&&r.add(a);if(Cr(a)&&!Io(a)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Ja(e,a),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(Aa(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&Qa(e,a)}}function Qa(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Dp(t,r)}function OI(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Ug(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let a=n,o=qp;r&&(a=[n],o=ia);const{revoke:i,proxy:s}=Proxy.revocable(a,o);return n.draft_=s,n.revoke_=i,s}var qp={get(e,t){if(t===lt)return e;const r=Rr(e);if(!Bc(r,t))return vI(e,r,t);const n=r[t];return e.finalized_||!Cr(n)?n:n===mu(e.base_,t)?(hu(e),e.copy_[t]=Hc(n,e)):n},has(e,t){return t in Rr(e)},ownKeys(e){return Reflect.ownKeys(Rr(e))},set(e,t,r){const n=Bg(Rr(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const a=mu(Rr(e),t),o=a?.[lt];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(wI(r,a)&&(r!==void 0||Bc(e.base_,t)))return!0;hu(e),Vc(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return mu(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,hu(e),Vc(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Rr(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){et(11)},getPrototypeOf(e){return mn(e.base_)},setPrototypeOf(){et(12)}},ia={};Za(qp,(e,t)=>{ia[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});ia.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&et(13),ia.set.call(this,e,t,void 0)};ia.set=function(e,t,r){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&et(14),qp.set.call(this,e[0],t,r,e[0])};function mu(e,t){const r=e[lt];return(r?Rr(r):e)[t]}function vI(e,t,r){const n=Bg(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function Bg(e,t){if(!(t in e))return;let r=mn(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=mn(r)}}function Vc(e){e.modified_||(e.modified_=!0,e.parent_&&Vc(e.parent_))}function hu(e){e.copy_||(e.copy_=jc(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var LI=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const o=r;r=t;const i=this;return function(l=o,...u){return i.produce(l,c=>r.call(this,c,...u))}}typeof r!="function"&&et(6),n!==void 0&&typeof n!="function"&&et(7);let a;if(Cr(t)){const o=Fh(this),i=Hc(t,void 0);let s=!0;try{a=r(i),s=!1}finally{s?$c(o):xc(o)}return qh(o,n),Mh(a,o)}else if(!t||typeof t!="object"){if(a=r(t),a===void 0&&(a=t),a===qg&&(a=void 0),this.autoFreeze_&&Dp(a,!0),n){const o=[],i=[];Dr("Patches").generateReplacementPatches_(t,a,o,i),n(o,i)}return a}else et(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(i,...s)=>this.produceWithPatches(i,l=>t(l,...s));let n,a;return[this.produce(t,r,(i,s)=>{n=i,a=s}),n,a]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Cr(e)||et(8),hn(e)&&(e=RI(e));const t=Fh(this),r=Hc(e,void 0);return r[lt].isManual_=!0,xc(t),r}finishDraft(e,t){const r=e&&e[lt];(!r||!r.isManual_)&&et(9);const{scope_:n}=r;return qh(n,t),Mh(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const a=t[r];if(a.path.length===0&&a.op==="replace"){e=a.value;break}}r>-1&&(t=t.slice(r+1));const n=Dr("Patches").applyPatches_;return hn(e)?n(e,t):this.produce(e,a=>n(a,t))}};function Hc(e,t){const r=Aa(e)?Dr("MapSet").proxyMap_(e,t):wo(e)?Dr("MapSet").proxySet_(e,t):OI(e,t);return(t?t.scope_:Ug()).drafts_.push(r),r}function RI(e){return hn(e)||et(10,e),jg(e)}function jg(e){if(!Cr(e)||Io(e))return e;const t=e[lt];let r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=jc(e,t.scope_.immer_.useStrictShallowCopy_)}else r=jc(e,!0);return Za(r,(n,a)=>{Mg(r,n,jg(a))}),t&&(t.finalized_=!1),r}var PI=new LI,$g=PI.produce;function kI(e,t){let n=0;const a=[];for(;n+1<e.length;){const o=e[n],i=e[n+1];if(t(o,i)){n+=2;continue}else a.push(o),n+=1}return n+1===e.length&&a.push(e[n]),a}const NI=(e,t)=>["pipetteId","volume","labwareId","wellName"].every(n=>e[n]===t[n]),CI=e=>kI(e,(t,r)=>t.commandType==="aspirate"&&r.commandType==="dispense"&&NI(t.params,r.params)),xg=e=>CI(e),Fp=(e,t)=>{const r=St(e,t);return r.type===f.ABSORBANCE_READER_TYPE?r:(console.error(`Absorbance reader state updater expected ${t} moduleState to be absorbanceReader, but it was ${r.type}`),null)},DI=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,o=Fp(n,a);o!=null&&(o.lidOpen=!0)},qI=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,o=Fp(n,a);o!=null&&(o.lidOpen=!1)},FI=(e,t,r)=>{const{robotState:n}=r,{moduleId:a,measureMode:o,sampleWavelengths:i,referenceWavelength:s}=e,l=Fp(n,a);l!=null&&(l.initialization={mode:o,wavelengths:i,referenceWavelength:s},l.lidOpen=!1)};function MI(e,t,r){const{pipetteId:n,volume:a}=e,{robotState:o}=r,i=o.pipettes[n].nozzles;let l=t.pipetteEntities[n].spec.channels;i===f.COLUMN?l=8:i===f.SINGLE&&(l=1),ln(l).forEach(u=>{const c=o.liquidState.pipettes[n][u]??{},p=c[Qe]?.volume??0;o.liquidState.pipettes[n][u]={...c,[Qe]:{volume:p+a}}})}var yu,Bh;function UI(){if(Bh)return yu;Bh=1;var e=Wb(),t=Ta(),r=no(),n=tt(),a=Br(),o=uo(),i=po(),s=up(),l="[object Map]",u="[object Set]",c=Object.prototype,p=c.hasOwnProperty;function d(y){if(y==null)return!0;if(a(y)&&(n(y)||typeof y=="string"||typeof y.splice=="function"||o(y)||s(y)||r(y)))return!y.length;var b=t(y);if(b==l||b==u)return!y.size;if(i(y))return!e(y).length;for(var h in y)if(p.call(y,h))return!1;return!0}return yu=d,yu}var BI=UI();const bu=Ye(BI);var gu,jh;function jI(){if(jh)return gu;jh=1;function e(t,r,n,a){for(var o=t.length,i=n+(a?1:-1);a?i--:++i<o;)if(r(t[i],i,t))return i;return-1}return gu=e,gu}var _u,$h;function $I(){if($h)return _u;$h=1;function e(t){return t!==t}return _u=e,_u}var Tu,xh;function xI(){if(xh)return Tu;xh=1;function e(t,r,n){for(var a=n-1,o=t.length;++a<o;)if(t[a]===r)return a;return-1}return Tu=e,Tu}var Eu,Vh;function VI(){if(Vh)return Eu;Vh=1;var e=jI(),t=$I(),r=xI();function n(a,o,i){return o===o?r(a,o,i):e(a,t,i)}return Eu=n,Eu}var wu,Hh;function HI(){if(Hh)return wu;Hh=1;var e=VI();function t(r,n){var a=r==null?0:r.length;return!!a&&e(r,n,0)>-1}return wu=t,wu}var Iu,Gh;function GI(){if(Gh)return Iu;Gh=1;function e(t,r,n){for(var a=-1,o=t==null?0:t.length;++a<o;)if(n(r,t[a]))return!0;return!1}return Iu=e,Iu}var Su,zh;function zI(){if(zh)return Su;zh=1;function e(){}return Su=e,Su}var Au,Wh;function WI(){if(Wh)return Au;Wh=1;var e=Kb(),t=zI(),r=ap(),n=1/0,a=e&&1/r(new e([,-0]))[1]==n?function(o){return new e(o)}:t;return Au=a,Au}var Ou,Yh;function YI(){if(Yh)return Ou;Yh=1;var e=Fb(),t=HI(),r=GI(),n=Ub(),a=WI(),o=ap(),i=200;function s(l,u,c){var p=-1,d=t,y=l.length,b=!0,h=[],g=h;if(c)b=!1,d=r;else if(y>=i){var T=u?null:a(l);if(T)return o(T);b=!1,d=n,g=new e}else g=u?[]:h;e:for(;++p<y;){var m=l[p],_=u?u(m):m;if(m=c||m!==0?m:0,b&&_===_){for(var I=g.length;I--;)if(g[I]===_)continue e;u&&g.push(_),h.push(m)}else d(g,_,c)||(g!==h&&g.push(_),h.push(m))}return h}return Ou=s,Ou}var vu,Kh;function KI(){if(Kh)return vu;Kh=1;var e=YI();function t(r){return r&&r.length?e(r):[]}return vu=t,vu}var XI=KI();const ZI=Ye(XI),Mp=e=>{const{nozzles:t,pipetteSpec:r,primaryNozzle:n}=e,a=r.channels;if(t==null)return a;switch(t){case f.ROW:return 12;case f.COLUMN:return 8;case f.SINGLE:return 1;case f.ALL:return a;case f.PARTIAL_COLUMN:return f.PARTIAL_NOZZLE_MAP[n];default:return a}};function JI(e,t,r){const{pipetteId:n,volume:a}=e,{robotState:o,warnings:i}=r,s="labwareId"in e?e.labwareId:o.pipettes[n].entityId??"",l="wellName"in e?e.wellName:o.pipettes[n].wellName??"",{liquidState:u}=o,c=o.pipettes[n].nozzles,p=r.robotState.pipettes[n].primaryNozzle,d=t.pipetteEntities[n].spec,y=t.labwareEntities[s].def,b=y.metadata.displayCategory==="reservoir",h=Mp({pipetteSpec:d,nozzles:c,primaryNozzle:p}),{allWellsShared:g,wellsForTips:T}=Sp(h,y,l);if(console.assert(ZI(T).length===g?1:T.length,`expected all wells to be shared, or no wells to be shared. Got: ${JSON.stringify(T)}`),h>1&&g){const _=T[0],I=u.labware[s][_],S=a*h>ur(I);bu(I)?i.push(pu()):S&&i.push(cu());const O=S?ur(I)/h:a,v=zt(O,I).dest;ln(h).forEach(C=>{const N=u.pipettes[n],V=C.toString(),$=N[V],G=S?cr($,{...v,[Qe]:{volume:a-O}}):cr($,v);N[V]=G}),u.labware[s][_]=zt(a*h,u.labware[s][_]).source;return}if(h===96&&b){T.forEach(_=>{const I=u.labware[s][_],S=a*8>ur(I);bu(I)?i.push(pu()):S&&i.push(cu());const O=S?ur(I)/8:a,v=zt(O,I).dest;ln(h).forEach(C=>{const N=u.pipettes[n],V=C.toString(),$=N[V],G=S?cr($,{...v,[Qe]:{volume:a-O}}):cr($,v);N[V]=G}),u.labware[s][_]=zt(O*8,u.labware[s][_]).source});return}ln(h).forEach(_=>{const I=_.toString(),S=u.pipettes[n],O=S[I],v=u.labware[s][T[_]],C=zt(a,v).dest;bu(v)?i.push(pu()):a>ur(v)&&i.push(cu()),S[I]=cr(O,C)});const m=u.labware[s];T.forEach(_=>{m[_]=zt(a,m[_]).source}),"labwareId"in e&&(o.pipettes[n]={...o.pipettes[n],entityId:e.labwareId,wellName:l})}function So(e){const{robotStateAndWarnings:t,invariantContext:r,entityId:n,pipetteId:a,prevLiquidState:o,useFullVolume:i,volume:s,wellName:l}=e,u=r.pipetteEntities[a].spec,c=t.robotState.pipettes[a].nozzles,p=t.robotState.pipettes[a].primaryNozzle,d=Mp({pipetteSpec:u,nozzles:c,primaryNozzle:p}),y=l??null,b=r.labwareEntities[n]!=null?r.labwareEntities[n].def:null;console.assert(!(i&&typeof s=="number"),"dispenseUpdateLiquidState takes either `volume` or `useFullVolume`, but got both"),console.assert(typeof s=="number"||i,"in dispenseUpdateLiquidState, either volume or useFullVolume are required");const{wellsForTips:h,allWellsShared:g}=b!=null&&l!=null?Sp(d,b,l):{wellsForTips:null,allWellsShared:!0},T=o.labware[n]!=null?o.labware[n]:null;let m=null;o.trashBins[n]!=null?m=o.trashBins[n]:o.wasteChute[n]!=null&&(m=o.wasteChute[n]);const _=Wt(o.pipettes[a],v=>{const{...C}=v;if(i){const N=ur(C);return N>0?zt(N,C):{source:{},dest:{}}}return zt(s||0,C)});let I=null;if(y!=null&&T!=null)I={[y]:pt(_,(v,C)=>cr(v,C.dest),T[y])};else if(m!=null){const v=Object.values(o.pipettes[a]).reduce((C,N)=>C+(N[0]?.volume??0),0);m[0]={volume:v}}I==null&&m==null&&console.assert(`expected to merge liquid to a single well with sourceId ${n}`);const S=y!=null&&T!=null&&h!=null?h.reduce((v,C,N)=>({...v,[C]:cr(_[`${N}`].dest,T[C]||{})}),{}):{},O=g?I:S;o.pipettes[a]=Wt(_,"source"),o.trashBins[n]!=null&&m!=null?Object.assign(o.trashBins[n],m):o.wasteChute[n]!=null&&m!=null?Object.assign(o.wasteChute[n],m):o.labware[n]!=null&&O!=null&&(o.labware[n]=Object.assign(T??{},O))}function QI(e,t,r){const{pipetteId:n,labwareId:a,wellName:o}=e,{robotState:i}=r;So({pipetteId:n,entityId:a,useFullVolume:!0,wellName:o,prevLiquidState:i.liquidState,invariantContext:t,robotStateAndWarnings:r})}function eS(e,t,r){const{pipetteId:n,configurationParams:a}=e,{robotState:o}=r;o.pipettes[n].nozzles=a.style,o.pipettes[n].primaryNozzle=a.primaryNozzle}function tS(e,t,r){const{pipetteId:n,volume:a}=e,{robotState:o}=r,i="labwareId"in e?e.labwareId:o.pipettes[n].entityId??"",s="wellName"in e?e.wellName:o.pipettes[n].wellName??"",l=o.liquidState.pipettes[n],c=Object.values(l)[0]?.[Qe]?.volume??0,p=r.robotState.pipettes[n].primaryNozzle;if(So({invariantContext:t,entityId:i,pipetteId:n,prevLiquidState:o.liquidState,useFullVolume:!1,volume:a,wellName:s,robotStateAndWarnings:r}),c>0){const d=r.robotState.pipettes[n].nozzles,y=t.pipetteEntities[n].spec,b=Mp({pipetteSpec:y,nozzles:d,primaryNozzle:p});Object.keys(l).slice(0,b).forEach(g=>{const T=l[g]??{};l[g]={...T,[Qe]:{volume:0}}})}"labwareId"in e&&(o.pipettes[n]={...o.pipettes[n],entityId:e.labwareId})}function rS(e,t,r){const{pipetteId:n,wellName:a,labwareId:o}=e,{robotState:i}=r;i.tipState.pipettes[n].hasTip=!1,i.tipState.pipettes[n].tiprackURI=null,i.pipettes[n].tiprackId=void 0;const s=i.tipState,l=t.pipetteEntities[n].spec,u=i.pipettes[n].nozzles,c=zp(u,l),p=(y,b)=>y.find(h=>h.includes(b)),d=t.labwareEntities[o].def;jr(d!=null&&f.getIsTiprack(d),`forDropTip expected ${o} to have definition and to be a tiprack`),c===f.SINGLE?s.tipracks[o][a]=lr:c===f.COLUMN?(p(d.ordering,a)??[]).forEach(b=>s.tipracks[o][b]=lr):c===f.ALL?l.channels===96?d.ordering.reduce((b,h)=>b.concat(h),[]).forEach(function(b){s.tipracks[o][b]=lr}):(p(d.ordering,a)??[]).forEach(b=>s.tipracks[o][b]=lr):l.channels===1?s.tipracks[o][a]=lr:l.channels===96?d.ordering.reduce((b,h)=>b.concat(h),[]).forEach(function(b){s.tipracks[o][b]=lr}):(p(d.ordering,a)??[]).forEach(b=>s.tipracks[o][b]=lr),i.pipettes[n].entityId=o,i.pipettes[n].wellName=a}function nS(e,t,r){const{labwareId:n,liquidId:a,volumeByWell:o}=e;Object.entries(o).forEach(([i,s])=>{r.robotState.liquidState.labware[n][i][a]={volume:s}})}var Lu,Xh;function aS(){if(Xh)return Lu;Xh=1;function e(t,r){for(var n=-1,a=t==null?0:t.length;++n<a&&r(t[n],n,t)!==!1;);return t}return Lu=e,Lu}var Ru,Zh;function Up(){if(Zh)return Ru;Zh=1;var e=dp(),t=ao(),r=Object.prototype,n=r.hasOwnProperty;function a(o,i,s){var l=o[i];(!(n.call(o,i)&&t(l,s))||s===void 0&&!(i in o))&&e(o,i,s)}return Ru=a,Ru}var Pu,Jh;function Oa(){if(Jh)return Pu;Jh=1;var e=Up(),t=dp();function r(n,a,o,i){var s=!o;o||(o={});for(var l=-1,u=a.length;++l<u;){var c=a[l],p=i?i(o[c],n[c],c,o,n):void 0;p===void 0&&(p=n[c]),s?t(o,c,p):e(o,c,p)}return o}return Pu=r,Pu}var ku,Qh;function oS(){if(Qh)return ku;Qh=1;var e=Oa(),t=_a();function r(n,a){return n&&e(a,t(a),n)}return ku=r,ku}var Nu,ey;function iS(){if(ey)return Nu;ey=1;function e(t){var r=[];if(t!=null)for(var n in Object(t))r.push(n);return r}return Nu=e,Nu}var Cu,ty;function sS(){if(ty)return Cu;ty=1;var e=Xt(),t=po(),r=iS(),n=Object.prototype,a=n.hasOwnProperty;function o(i){if(!e(i))return r(i);var s=t(i),l=[];for(var u in i)u=="constructor"&&(s||!a.call(i,u))||l.push(u);return l}return Cu=o,Cu}var Du,ry;function Bp(){if(ry)return Du;ry=1;var e=Gb(),t=sS(),r=Br();function n(a){return r(a)?e(a,!0):t(a)}return Du=n,Du}var qu,ny;function lS(){if(ny)return qu;ny=1;var e=Oa(),t=Bp();function r(n,a){return n&&e(a,t(a),n)}return qu=r,qu}var ta={exports:{}};ta.exports;var ay;function uS(){return ay||(ay=1,function(e,t){var r=Mt(),n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===n,i=o?r.Buffer:void 0,s=i?i.allocUnsafe:void 0;function l(u,c){if(c)return u.slice();var p=u.length,d=s?s(p):new u.constructor(p);return u.copy(d),d}e.exports=l}(ta,ta.exports)),ta.exports}var Fu,oy;function cS(){if(oy)return Fu;oy=1;function e(t,r){var n=-1,a=t.length;for(r||(r=Array(a));++n<a;)r[n]=t[n];return r}return Fu=e,Fu}var Mu,iy;function pS(){if(iy)return Mu;iy=1;var e=Oa(),t=op();function r(n,a){return e(n,t(n),a)}return Mu=r,Mu}var Uu,sy;function jp(){if(sy)return Uu;sy=1;var e=zb(),t=e(Object.getPrototypeOf,Object);return Uu=t,Uu}var Bu,ly;function Vg(){if(ly)return Bu;ly=1;var e=ep(),t=jp(),r=op(),n=Vb(),a=Object.getOwnPropertySymbols,o=a?function(i){for(var s=[];i;)e(s,r(i)),i=t(i);return s}:n;return Bu=o,Bu}var ju,uy;function fS(){if(uy)return ju;uy=1;var e=Oa(),t=Vg();function r(n,a){return e(n,t(n),a)}return ju=r,ju}var $u,cy;function $p(){if(cy)return $u;cy=1;var e=$b(),t=Vg(),r=Bp();function n(a){return e(a,r,t)}return $u=n,$u}var xu,py;function dS(){if(py)return xu;py=1;var e=Object.prototype,t=e.hasOwnProperty;function r(n){var a=n.length,o=new n.constructor(a);return a&&typeof n[0]=="string"&&t.call(n,"index")&&(o.index=n.index,o.input=n.input),o}return xu=r,xu}var Vu,fy;function xp(){if(fy)return Vu;fy=1;var e=jb();function t(r){var n=new r.constructor(r.byteLength);return new e(n).set(new e(r)),n}return Vu=t,Vu}var Hu,dy;function mS(){if(dy)return Hu;dy=1;var e=xp();function t(r,n){var a=n?e(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.byteLength)}return Hu=t,Hu}var Gu,my;function hS(){if(my)return Gu;my=1;var e=/\w*$/;function t(r){var n=new r.constructor(r.source,e.exec(r));return n.lastIndex=r.lastIndex,n}return Gu=t,Gu}var zu,hy;function yS(){if(hy)return zu;hy=1;var e=bn(),t=e?e.prototype:void 0,r=t?t.valueOf:void 0;function n(a){return r?Object(r.call(a)):{}}return zu=n,zu}var Wu,yy;function bS(){if(yy)return Wu;yy=1;var e=xp();function t(r,n){var a=n?e(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.length)}return Wu=t,Wu}var Yu,by;function gS(){if(by)return Yu;by=1;var e=xp(),t=mS(),r=hS(),n=yS(),a=bS(),o="[object Boolean]",i="[object Date]",s="[object Map]",l="[object Number]",u="[object RegExp]",c="[object Set]",p="[object String]",d="[object Symbol]",y="[object ArrayBuffer]",b="[object DataView]",h="[object Float32Array]",g="[object Float64Array]",T="[object Int8Array]",m="[object Int16Array]",_="[object Int32Array]",I="[object Uint8Array]",S="[object Uint8ClampedArray]",O="[object Uint16Array]",v="[object Uint32Array]";function C(N,V,$){var G=N.constructor;switch(V){case y:return e(N);case o:case i:return new G(+N);case b:return t(N,$);case h:case g:case T:case m:case _:case I:case S:case O:case v:return a(N,$);case s:return new G;case l:case p:return new G(N);case u:return r(N);case c:return new G;case d:return n(N)}}return Yu=C,Yu}var Ku,gy;function _S(){if(gy)return Ku;gy=1;var e=Xt(),t=Object.create,r=function(){function n(){}return function(a){if(!e(a))return{};if(t)return t(a);n.prototype=a;var o=new n;return n.prototype=void 0,o}}();return Ku=r,Ku}var Xu,_y;function TS(){if(_y)return Xu;_y=1;var e=_S(),t=jp(),r=po();function n(a){return typeof a.constructor=="function"&&!r(a)?e(t(a)):{}}return Xu=n,Xu}var Zu,Ty;function ES(){if(Ty)return Zu;Ty=1;var e=Ta(),t=Kt(),r="[object Map]";function n(a){return t(a)&&e(a)==r}return Zu=n,Zu}var Ju,Ey;function wS(){if(Ey)return Ju;Ey=1;var e=ES(),t=sp(),r=lp(),n=r&&r.isMap,a=n?t(n):e;return Ju=a,Ju}var Qu,wy;function IS(){if(wy)return Qu;wy=1;var e=Ta(),t=Kt(),r="[object Set]";function n(a){return t(a)&&e(a)==r}return Qu=n,Qu}var ec,Iy;function SS(){if(Iy)return ec;Iy=1;var e=IS(),t=sp(),r=lp(),n=r&&r.isSet,a=n?t(n):e;return ec=a,ec}var tc,Sy;function Hg(){if(Sy)return tc;Sy=1;var e=np(),t=aS(),r=Up(),n=oS(),a=lS(),o=uS(),i=cS(),s=pS(),l=fS(),u=Yb(),c=$p(),p=Ta(),d=dS(),y=gS(),b=TS(),h=tt(),g=uo(),T=wS(),m=Xt(),_=SS(),I=_a(),S=Bp(),O=1,v=2,C=4,N="[object Arguments]",V="[object Array]",$="[object Boolean]",G="[object Date]",X="[object Error]",fe="[object Function]",be="[object GeneratorFunction]",ge="[object Map]",le="[object Number]",re="[object Object]",U="[object RegExp]",x="[object Set]",W="[object String]",w="[object Symbol]",R="[object WeakMap]",E="[object ArrayBuffer]",A="[object DataView]",L="[object Float32Array]",M="[object Float64Array]",q="[object Int8Array]",P="[object Int16Array]",D="[object Int32Array]",z="[object Uint8Array]",H="[object Uint8ClampedArray]",oe="[object Uint16Array]",K="[object Uint32Array]",ue={};ue[N]=ue[V]=ue[E]=ue[A]=ue[$]=ue[G]=ue[L]=ue[M]=ue[q]=ue[P]=ue[D]=ue[ge]=ue[le]=ue[re]=ue[U]=ue[x]=ue[W]=ue[w]=ue[z]=ue[H]=ue[oe]=ue[K]=!0,ue[X]=ue[fe]=ue[R]=!1;function de(J,ce,B,qe,Oe,Ce){var Ee,k=ce&O,F=ce&v,Y=ce&C;if(B&&(Ee=Oe?B(J,qe,Oe,Ce):B(J)),Ee!==void 0)return Ee;if(!m(J))return J;var Q=h(J);if(Q){if(Ee=d(J),!k)return i(J,Ee)}else{var Z=p(J),ie=Z==fe||Z==be;if(g(J))return o(J,k);if(Z==re||Z==N||ie&&!Oe){if(Ee=F||ie?{}:b(J),!k)return F?l(J,a(Ee,J)):s(J,n(Ee,J))}else{if(!ue[Z])return Oe?J:{};Ee=y(J,Z,k)}}Ce||(Ce=new e);var te=Ce.get(J);if(te)return te;Ce.set(J,Ee),_(J)?J.forEach(function(me){Ee.add(de(me,ce,B,me,J,Ce))}):T(J)&&J.forEach(function(me,he){Ee.set(he,de(me,ce,B,he,J,Ce))});var se=Y?F?c:u:F?S:I,pe=Q?void 0:se(J);return t(pe||J,function(me,he){pe&&(he=me,me=J[he]),r(Ee,he,de(me,ce,B,he,J,Ce))}),Ee}return tc=de,tc}var rc,Ay;function Gg(){if(Ay)return rc;Ay=1;function e(t,r,n){var a=-1,o=t.length;r<0&&(r=-r>o?0:o+r),n=n>o?o:n,n<0&&(n+=o),o=r>n?0:n-r>>>0,r>>>=0;for(var i=Array(o);++a<o;)i[a]=t[a+r];return i}return rc=e,rc}var nc,Oy;function AS(){if(Oy)return nc;Oy=1;var e=fo(),t=Gg();function r(n,a){return a.length<2?n:e(n,t(a,0,-1))}return nc=r,nc}var ac,vy;function OS(){if(vy)return ac;vy=1;var e=_n(),t=Dg(),r=AS(),n=Tn(),a=Object.prototype,o=a.hasOwnProperty;function i(s,l){l=e(l,s);var u=-1,c=l.length;if(!c)return!0;for(;++u<c;){var p=n(l[u]);if(p==="__proto__"&&!o.call(s,"__proto__")||(p==="constructor"||p==="prototype")&&u<c-1)return!1}var d=r(s,l);return d==null||delete d[n(t(l))]}return ac=i,ac}var oc,Ly;function vS(){if(Ly)return oc;Ly=1;var e=gn(),t=jp(),r=Kt(),n="[object Object]",a=Function.prototype,o=Object.prototype,i=a.toString,s=o.hasOwnProperty,l=i.call(Object);function u(c){if(!r(c)||e(c)!=n)return!1;var p=t(c);if(p===null)return!0;var d=s.call(p,"constructor")&&p.constructor;return typeof d=="function"&&d instanceof d&&i.call(d)==l}return oc=u,oc}var ic,Ry;function LS(){if(Ry)return ic;Ry=1;var e=vS();function t(r){return e(r)?void 0:r}return ic=t,ic}var sc,Py;function RS(){if(Py)return sc;Py=1;var e=Cb();function t(r){var n=r==null?0:r.length;return n?e(r,1):[]}return sc=t,sc}var lc,ky;function PS(){if(ky)return lc;ky=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return lc=e,lc}var uc,Ny;function zg(){if(Ny)return uc;Ny=1;var e=PS(),t=Math.max;function r(n,a,o){return a=t(a===void 0?n.length-1:a,0),function(){for(var i=arguments,s=-1,l=t(i.length-a,0),u=Array(l);++s<l;)u[s]=i[a+s];s=-1;for(var c=Array(a+1);++s<a;)c[s]=i[s];return c[a]=o(u),e(n,this,c)}}return uc=r,uc}var cc,Cy;function kS(){if(Cy)return cc;Cy=1;function e(t){return function(){return t}}return cc=e,cc}var pc,Dy;function NS(){if(Dy)return pc;Dy=1;var e=kS(),t=eg(),r=ya(),n=t?function(a,o){return t(a,"toString",{configurable:!0,enumerable:!1,value:e(o),writable:!0})}:r;return pc=n,pc}var fc,qy;function CS(){if(qy)return fc;qy=1;var e=800,t=16,r=Date.now;function n(a){var o=0,i=0;return function(){var s=r(),l=t-(s-i);if(i=s,l>0){if(++o>=e)return arguments[0]}else o=0;return a.apply(void 0,arguments)}}return fc=n,fc}var dc,Fy;function Wg(){if(Fy)return dc;Fy=1;var e=NS(),t=CS(),r=t(e);return dc=r,dc}var mc,My;function DS(){if(My)return mc;My=1;var e=RS(),t=zg(),r=Wg();function n(a){return r(t(a,void 0,e),a+"")}return mc=n,mc}var hc,Uy;function qS(){if(Uy)return hc;Uy=1;var e=ga(),t=Hg(),r=OS(),n=_n(),a=Oa(),o=LS(),i=DS(),s=$p(),l=1,u=2,c=4,p=i(function(d,y){var b={};if(d==null)return b;var h=!1;y=e(y,function(T){return T=n(T,d),h||(h=T.length>1),T}),a(d,s(d),b),h&&(b=t(b,l|u|c,o));for(var g=y.length;g--;)r(b,y[g]);return b});return hc=p,hc}var FS=qS();const MS=Ye(FS),Gc="TOUCHED_PIPETTABLE_LABWARE";var yc,By;function US(){if(By)return yc;By=1;var e=cp();function t(r,n){return e(r,n)}return yc=t,yc}var BS=US();const jS=Ye(BS),Ao=e=>{const{node:t,stack:r=[],robotState:n,memo:a=new Map}=e;let o=r;if(!(typeof t=="object"&&"labwareId"in t))return o=[...r,t],a.set(t,o),{stack:o,memo:a};const{labwareId:i}=t,s=n.labware[i];if(s!=null&&s.stackedOnNode!=null){const{stack:l,memo:u}=Ao({node:s.stackedOnNode,stack:[...r,t],robotState:n,memo:a});Yg(a,u),o=l,a.set(t,o)}return{stack:o,memo:a}},$S=e=>{const{node:t,robotState:r,deckDef:n,deckConfiguration:a}=e,{stack:o}=Ao({node:t,robotState:r}),{cutoutFixtures:i}=n,s=o.find(l=>typeof l=="object"&&"addressableAreaName"in l);if(s!=null&&typeof s=="object"&&"addressableAreaName"in s){const{addressableAreaName:l}=s;for(const{id:u,providesAddressableAreas:c}of i){const[p]=Object.entries(c).find(([d,y])=>y.includes(l))??[];if(p!=null){const d=a.find(({cutoutId:T})=>T===p),{cutoutFixtureId:y,cutoutId:b}=d,h=y===u&&b===p,g=Object.entries(r.modules).find(([T,{slot:m}])=>f.FLEX_CUTOUT_BY_SLOT_ID[m]===b);if(h&&g!=null)return g[0]}}}return null},Yg=(e,t)=>{t.forEach((r,n)=>{e.set(n,r)})},xS=(e,t)=>e.some(r=>jS(r,t)),Kg=e=>{const{labwareId:t,robotState:r}=e,n=new Map,a={labwareId:t};let o=[];for(const[i,{stackedOnNode:s}]of Object.entries(r.labware)){const l={labwareId:i};if(s==null)continue;let u;const c=n.get(l);if(c!=null)u=c;else{const{stack:p,memo:d}=Ao({node:l,robotState:r,memo:n});if(Yg(n,d),!xS(p,a))continue;n.set(l,p),u=p}u.length>o.length&&(o=u)}return o},Xg=e=>{const t=[],r=new Set;for(const n of Object.keys(e.labware)){if(r.has(n))continue;const a=Kg({labwareId:n,robotState:e});a.forEach(o=>{typeof o=="object"&&"labwareId"in o&&r.add(o.labwareId)}),t.push(a)}return t},Vp=e=>{const{moduleId:t,robotState:r,moduleEntities:n,deckDef:a}=e,o=r.modules[t],i=n[t];if(o==null||i==null)return null;const{slot:s}=o,{model:l}=i,u=f.getAddressableAreaNamesFromLoadedModule(l,s,a);return u.length===0?null:u[0]},VS=e=>{const{location:t,robotState:r,moduleEntities:n,deckDef:a}=e;if(t==="offDeck"||t==="systemLocation"||t==="wasteChuteLocation")return null;if("slotName"in t)return t.slotName;if("addressableAreaName"in t)return t.addressableAreaName;if("moduleId"in t){const{moduleId:o}=t;return Vp({moduleId:o,robotState:r,moduleEntities:n,deckDef:a})}return null},Zg=e=>{const{deckConfiguration:t,deckDefinition:r}=e;return t.reduce((n,{cutoutFixtureId:a,cutoutId:o})=>((r.cutoutFixtures.find(({id:s})=>a===s)?.providesAddressableAreas[o]??[]).forEach(s=>{n.add(s)}),n),new Set)},HS=e=>{const{robotState:t,deckConfiguration:r,deckDefinition:n,moduleEntities:a}=e,o=Zg({deckConfiguration:r,deckDefinition:n}),i=new Set(o),s=Xg(t);for(const l of s){const u=Cp(l);if(typeof u=="object"&&"addressableAreaName"in u){const{addressableAreaName:c}=u;i.delete(c)}if(typeof u=="object"&&"slotName"in u){const{slotName:c}=u;i.delete(c)}if(typeof u=="object"&&"moduleId"in u){const{moduleId:c}=u,p=Vp({moduleId:c,robotState:t,moduleEntities:a,deckDef:n});p!=null&&i.delete(p)}}return i},GS=e=>{const t=e.toLowerCase();return t.includes("chute")||t.includes("waste")||t.startsWith("gripper")||t==="96channelwastechute"},Jg=e=>{const{stack:t,subjectLabwareId:r,moduleEntities:n,labwareEntityIds:a,modules:o}=e;if(t.length===0||t[0]!==r||t.length<2)return;const i=t[1];if(i===Je){const u=t[2];return u==null?void 0:{kind:"inStackerHopper",moduleId:u}}if(n[i]!=null)return{moduleId:i};if(a.has(i))return{labwareId:i};if(i==="offDeck")return"offDeck";if(i==="systemLocation")return"systemLocation";if(i==="wasteChuteLocation")return"wasteChuteLocation";if(GS(i))return{addressableAreaName:i};const s=kg(i,o,n)??i;if(Object.entries(o).some(([u,c])=>n[u]?.type===f.FLEX_STACKER_MODULE_TYPE&&c.slot===s)){const u=To(s);if(u!=null)return{addressableAreaName:u}}return{slotName:i}},zS=e=>typeof e=="object"&&e!==null&&"kind"in e&&e.kind==="inStackerHopper",WS=e=>typeof e!="object"||e===null?!1:!zS(e),YS=(e,t)=>{const{id:r,def:n}=e,{id:a,def:o}=t,i=n.dimensions.xDimension,s=n.dimensions.yDimension,l=o.dimensions.xDimension,u=o.dimensions.yDimension;return i>l&&s>u?{containerLabwareId:r,containedLabwareId:a}:l>i&&u>s?{containerLabwareId:a,containedLabwareId:r}:null},Hp=(e,t)=>{const r=new Map;for(const a of Object.keys(e)){const o=e[a].stackedOnNode;if(o==null||!WS(o))continue;const i=JSON.stringify(o),s=r.get(i)??[];s.push(a),r.set(i,s)}const n={};for(const a of r.values()){if(a.length!==2)continue;const[o,i]=a,s=t[o],l=t[i];if(s==null||l==null)continue;const u=YS(s,l);if(u==null)continue;const{containerLabwareId:c,containedLabwareId:p}=u;n[c]=p}return Object.keys(n).length===0?e:Wt(e,(a,o)=>n[o]!=null?{...a,contains:n[o]}:a)},KS=(e,t,r)=>{const n=Object.keys(e.labware),a=new Set(n);let o=Wt(e.labware,(i,s)=>{const l=i.stackedOnNode??Jg({stack:i.stack,subjectLabwareId:s,moduleEntities:t,labwareEntityIds:a,modules:e.modules});return l!=null?{...i,stackedOnNode:l}:{...i}});return o=Hp(o,r),{...e,labware:o}};function XS(e,t,r){const{labwareId:n,newLocation:a}=e,{robotState:o}=r,{labwareEntities:i}=t,{modules:s,labware:l}=o;if(l[n]==null)return;const u=we(l[n].stack),c=Lp(l,u,n),p=c.indexOf(n),d=c.slice(0,p+1),y=f.getIsLid(i[n].def);let b=!1;const h=Object.entries(s).find(([C,{slot:N}])=>{const{type:V}=t.moduleEntities[C]??{};return V===f.FLEX_STACKER_MODULE_TYPE&&N===u})??null,g=h!=null&&h[1].moduleState.type===f.FLEX_STACKER_MODULE_TYPE?Gt.map(C=>h[1].moduleState.labwareOnShuttle?.[C]).filter(C=>C!=null):[],T=g.includes(n)?g.slice(0,g.indexOf(n)+1):[];if(h!=null&&h[1].moduleState.type===f.FLEX_STACKER_MODULE_TYPE){const C=h[1].moduleState,N=Gt.findIndex(V=>C.labwareOnShuttle?.[V]===n);if(N!==-1&&C.labwareOnShuttle!=null)for(const V of Gt.slice(N,Gt.length))if(V==="primaryLabwareId"){C.labwareOnShuttle=null;break}else C.labwareOnShuttle[V]=null}const m=Object.entries(s).find(([C,{slot:N}])=>{const{type:V}=t.moduleEntities[C]??{};return V===f.FLEX_STACKER_MODULE_TYPE&&typeof a=="object"&&("moduleId"in a&&a.moduleId===C||"slotName"in a&&N===a.slotName)})??null,[_,I]=m??[];if(_!=null&&I!=null){const C=T.length>0?T:_o(l,u),N=C.indexOf(n),V=I.moduleState;if(N!==-1){const $=C.slice(0,N+1).toReversed();if(V.labwareOnShuttle==null&&(V.labwareOnShuttle={primaryLabwareId:"",adapterLabwareId:null,lidLabwareId:null}),$.length===3)for(let G=0;G<Gt.length;G++){const X=Gt[G];V.labwareOnShuttle[X]=$[G]}else if($.length===2){const G=$.some(X=>t.labwareEntities[X].def.allowedRoles?.some(fe=>fe==="lid"))?["primaryLabwareId","lidLabwareId"]:["adapterLabwareId","primaryLabwareId"];for(let X=0;X<G.length;X++){const fe=G[X];V.labwareOnShuttle[fe]=$[X]}}else $.length===1&&(V.labwareOnShuttle.primaryLabwareId=$[0])}}const S=[];if(f.locationIsOffDeck(a))S.push(a);else if("moduleId"in a)s[a.moduleId].moduleState.type===f.FLEX_STACKER_MODULE_TYPE?S.push(s[a.moduleId].slot):S.push(a.moduleId,s[a.moduleId].slot);else if("slotName"in a){const{slotName:C}=a;C in l?(b=f.getIsPipettableLabware(i[C].def),S.push(...l[C].stack)):S.push(C)}else if("labwareId"in a){const C=a.labwareId;b=f.getIsPipettableLabware(i[C].def);const N=l[C].stack;S.push(...N)}else"addressableAreaName"in a&&S.push(a.addressableAreaName);d.forEach((C,N)=>{if(l[C]!=null){const V=d.slice(N+1);o.labware[C]={...o.labware[C],stack:[C,...V,...S],...y&&b?{sterility:Gc}:{}}}});const O=typeof a=="object"&&"labwareId"in a&&f.getIsPipettableLabware(i[a.labwareId].def);let v=a;if(typeof a=="object"&&a!==null&&"moduleId"in a&&s[a.moduleId].moduleState.type===f.FLEX_STACKER_MODULE_TYPE){const C=To(s[a.moduleId].slot);C!=null&&(v={addressableAreaName:C})}o.labware[n].stackedOnNode=v,O&&(o.labware[n].sterility=Gc),o.labware=Hp(Wt(o.labware,C=>MS(C,"contains")),i)}function ZS(e,t,r){const{pipetteId:n,addressableAreaName:a}=e,{wasteChuteEntities:o,trashBinEntities:i}=t,s=f.WASTE_CHUTE_ADDRESSABLE_AREAS.includes(a),l=Object.values(i).find(p=>p.location===Eg(a))?.id,u=s?Object.values(o)[0].id:l,{robotState:c}=r;c.pipettes[n]={...c.pipettes[n],entityId:u}}function JS(e,t,r){const{pipetteId:n,labwareId:a,wellName:o}=e,{robotState:i}=r;i.pipettes[n]={...i.pipettes[n],entityId:a,wellName:o}}function QS(e,t,r){const{pipetteId:n,labwareId:a,wellName:o}=e,i=t.pipetteEntities[n].spec,s=t.labwareEntities[a].def;jr(f.getIsTiprack(s),`forPickUpTip expected ${a} to be a tiprack`);const l=r.robotState.tipState,u=r.robotState.pipettes[n].nozzles,c=r.robotState.pipettes[n].primaryNozzle,p=zp(u,i),d=(h,g)=>h.find(T=>T.includes(g)),y=(h,g)=>{const T=h.findIndex(_=>_.includes(g));if(T===-1)return null;const m=h[T].indexOf(g);return h.map(_=>_[m])},b=(h,g)=>{const T=f.PARTIAL_NOZZLE_MAP[c],m=h.findIndex(v=>v.includes(g)),_=h[m].indexOf(g),I=h[m];if(I.length-_<T){const v=I.length-T;return I.slice(v,I.length)}const O=_+T;return I.slice(_,Math.min(O,I.length))};if(l.pipettes[n].hasTip=!0,l.pipettes[n].tiprackURI=a,p===f.SINGLE)l.tipracks[a][o]=Pe;else if(p===f.PARTIAL_COLUMN&&c){const h=b(s.ordering,o);h==null?console.error(`Invalid primary well for tip pick up for partial config: ${o}`):h.forEach(function(g){l.tipracks[a][g]=Pe})}else if(p===f.COLUMN){const h=d(s.ordering,o);h==null&&console.error(`Invalid primary well for tip pickup: ${o}`),h?.forEach(function(g){l.tipracks[a][g]=Pe})}else if(p===f.ROW){const h=y(s.ordering,o);h==null&&console.error("Invalid primary well for tip pickup: "+o),h?.forEach(function(g){l.tipracks[a][g]=Pe})}else if(p===f.ALL)if(i.channels===96)s.ordering.reduce((g,T)=>g.concat(T),[]).forEach(function(g){l.tipracks[a][g]=Pe});else{const h=d(s.ordering,o);h==null&&console.error(`Invalid primary well for tip pickup: ${o}`),h?.forEach(function(g){l.tipracks[a][g]=Pe})}else if(i.channels===1)l.tipracks[a][o]=Pe;else if(i.channels===96)s.ordering.reduce((g,T)=>g.concat(T),[]).forEach(function(g){l.tipracks[a][g]=Pe});else{const h=d(s.ordering,o);h==null&&console.error(`Invalid primary well for tip pickup: ${o}`),h?.forEach(function(g){l.tipracks[a][g]=Pe})}r.robotState.pipettes[n].tiprackId=a,r.robotState.pipettes[n].tipWell=o}const xr=(e,t)=>{const r=St(e,t);return r.type===f.THERMOCYCLER_MODULE_TYPE?r:(console.error(`Thermocycler state updater expected ${t} moduleState to be thermocycler, but it was ${r.type}`),{})},eA=(e,t,r)=>{const{moduleId:n,celsius:a}=e,{robotState:o}=r,i=xr(o,n);i.currentBlockActivity={type:"blockTargetTemp",blockTargetTemp:a}},tA=(e,t,r)=>{const{moduleId:n,celsius:a}=e,{robotState:o}=r,i=xr(o,n);i.lidTargetTemp=a},rA=(e,t,r)=>{},nA=(e,t,r)=>{},aA=(e,t,r)=>{},oA=(e,t,r)=>{const{moduleId:n}=e,{robotState:a}=r,o=xr(a,n);o.currentBlockActivity={type:"blockDeactivated"}},iA=(e,t,r)=>{const{moduleId:n}=e,{robotState:a}=r,o=xr(a,n);o.lidTargetTemp=null},sA=(e,t,r)=>{const{moduleId:n}=e,{robotState:a}=r,o=xr(a,n);o.lidOpen=!1},lA=(e,t,r)=>{const{moduleId:n}=e,{robotState:a}=r,o=xr(a,n);o.lidOpen=!0},uA=(e,t,r)=>{const{profile:n,...a}=e;Qg({profileElements:n,...a},t,r)},Qg=(e,t,r)=>{const n=NaN+ne();e_({...e,taskId:n},t,r),t_(n,t,r)},e_=(e,t,r)=>{const{moduleId:n,taskId:a,profileElements:o}=e,{robotState:i}=r,s=xr(i,n);s.currentBlockActivity={type:"profile",profileElements:o,taskId:a??null},s.numProfilesStarted++},t_=(e,t,r)=>{const{robotState:n}=r,a=Object.values(n.modules).find(o=>o.moduleState.type==="thermocyclerModuleType"&&o.moduleState.currentBlockActivity.type==="profile"&&o.moduleState.currentBlockActivity.taskId===e);if(a!=null&&a.moduleState.type==="thermocyclerModuleType"&&a.moduleState.currentBlockActivity.type==="profile"){const o=cA(a.moduleState.currentBlockActivity.profileElements);return a.moduleState.currentBlockActivity=o!=null?{type:"blockTargetTemp",blockTargetTemp:o}:{type:"blockDeactivated"},!0}else return!1};function cA(e){const t=Cp(Yp(e));return t!=null?t.celsius:null}function pA(e,t,r){for(const n of e.task_ids)t_(n,t,r)||r.warnings.push(sI())}const An=(e,t)=>{const r=St(e,t);return r.type===f.HEATERSHAKER_MODULE_TYPE?r:(console.error(`Heater-Shaker state updater expected ${t} moduleState to be heaterShaker, but it was ${r.type}`),{})},fA=(e,t,r)=>{const{robotState:n}=r,{moduleId:a,celsius:o}=e,i=An(n,a);i.targetTemp=o},dA=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,o=An(n,a);o.targetTemp=null},mA=(e,t,r)=>{const{robotState:n}=r,{moduleId:a,rpm:o}=e,i=An(n,a);i.targetSpeed=o},hA=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,o=An(n,a);o.targetSpeed=null},yA=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,o=An(n,a);o.latchOpen=!0},bA=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,o=An(n,a);o.latchOpen=!1},gA=(e,t,r)=>{const{pipetteId:n}=e,{robotState:a}=r,o=a.pipettes[n].entityId??"";So({invariantContext:t,pipetteId:n,prevLiquidState:a.liquidState,useFullVolume:!0,robotStateAndWarnings:r,entityId:o})},_A=(e,t,r)=>{const{pipetteId:n}=e,{robotState:a}=r,o=a.pipettes[n].entityId??"";a.tipState.pipettes[n]={hasTip:!1,tiprackURI:null},So({invariantContext:t,prevLiquidState:a.liquidState,pipetteId:n,useFullVolume:!0,robotStateAndWarnings:r,entityId:o}),a.pipettes[n].tiprackId=void 0};function r_(e,t){e.type===f.MAGNETIC_MODULE_TYPE&&(e.engaged=t)}function TA(e,t,r){const{moduleId:n}=e,{robotState:a}=r,o=St(a,n);r_(o,!0)}function EA(e,t,r){const{moduleId:n}=e,{robotState:a}=r,o=St(a,n);r_(o,!1)}const bc=(e,t)=>{if(t==null)return console.error("expected to find defURI but could not in getLabwareByDefURI"),null;const r=e.findIndex(a=>a.labwareDefURI===t);if(r===-1)return null;const[n]=e.splice(r,1);return n.id},n_=(e,t,r,n)=>{const a=e.labwareInHopper??[];t.forEach(o=>{const{primaryLabwareId:i,adapterLabwareId:s,lidLabwareId:l}=o;r.labware[i]={stack:[i,...l!=null?[l]:[],...n]},s!=null&&(r.labware[s]={stack:[s,i,...l!=null?[l]:[],...n]}),l!=null&&(r.labware[l]={stack:[l,...n]}),a.push({primaryLabwareId:i,adapterLabwareId:s??null,lidLabwareId:l??null})}),e.labwareInHopper=a},a_=(e,t,r,n,a,o,i,s)=>{const u=Object.entries(e.labware).filter(([p,d])=>d[o]===t[o]).map(([p])=>p).map(p=>r[p]),c=[];for(let p=0;p<n;p++){const d=bc(u,t.storedLabwareDetails?.primaryLabwareURI),y=i!=null?bc(u,t.storedLabwareDetails?.adapterLabwareURI):null,b=s!=null?bc(u,t.storedLabwareDetails?.lidLabwareURI):null;d!=null&&(e.labware[d]={stack:[d,...b!=null?[b]:[],...a]},y!=null&&(e.labware[y]={stack:[y,d,...b!=null?[b]:[],...a]}),b!=null&&(e.labware[b]={stack:[b,...a]}),c.push({primaryLabwareId:d,adapterLabwareId:y,lidLabwareId:b})),t.labwareInHopper=c}},wA=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,o=Object.entries(n.labware).filter(([,s])=>s.stack.includes(Je)&&s.stack.includes(a)),i=mt(n,a);i!=null&&i.labwareInHopper!=null&&(e.count!=null?i.labwareInHopper=i.labwareInHopper.slice(0,e.count):i.labwareInHopper=[]),o.forEach(([s])=>{n.labware[s]={...n.labware[s],stack:[s,f.SYSTEM_LOCATION]}})},IA=(e,t,r)=>{const{robotState:n}=r,{labwareEntities:a}=t,{moduleId:o,labware:i}=e,s=n.modules[o].slot,l=mt(n,o);if(l==null||l.storedLabwareDetails==null)return;const{primaryLabwareURI:u,adapterLabwareURI:c,lidLabwareURI:p}=l.storedLabwareDetails,d=[];for(const g of i){const T=a[g].labwareDefURI;if(T===u)d.push({primaryLabwareId:g,adapterLabwareId:null,lidLabwareId:null});else if(T===c){const m=d[d.length-1];m&&(m.adapterLabwareId=g)}else if(T===p){const m=d[d.length-1];m&&(m.lidLabwareId=g)}}const y=[Je,o,s];for(const g of d){const T=[g.adapterLabwareId,g.primaryLabwareId,g.lidLabwareId,...y].filter(_=>_!=null);n.labware[g.primaryLabwareId]={...n.labware[g.primaryLabwareId],stack:T.slice(T.indexOf(g.primaryLabwareId))},g.adapterLabwareId!=null&&(n.labware[g.adapterLabwareId]={...n.labware[g.adapterLabwareId],stack:T.slice(T.indexOf(g.adapterLabwareId))}),g.lidLabwareId!=null&&(n.labware[g.lidLabwareId]={...n.labware[g.lidLabwareId],stack:T.slice(T.indexOf(g.lidLabwareId))});let m=null;for(const _ of T)a[_]!=null&&(m==null?n.labware[_].stackedOnNode={kind:"inStackerHopper",moduleId:o}:n.labware[_].stackedOnNode={labwareId:m},m=_)}const b=l.labwareInHopper??[],h=d.map(({primaryLabwareId:g,adapterLabwareId:T,lidLabwareId:m})=>({primaryLabwareId:g,adapterLabwareId:T,lidLabwareId:m}));l.labwareInHopper=[...b,...h]},SA=(e,t,r)=>{const{robotState:n}=r,{labwareEntities:a}=t,{moduleId:o,primaryLabware:i,initialCount:s,adapterLabware:l,lidLabware:u,initialStoredLabware:c}=e,p=n.modules[o].slot,d=mt(n,o),y=[Je,o,p];d!=null&&(d.storedLabwareDetails={primaryLabwareURI:`${i.namespace}/${i.loadName}/${i.version}`,adapterLabwareURI:l!=null?`${l.namespace}/${l.loadName}/${l.version}`:null,lidLabwareURI:u!=null?`${u.namespace}/${u.loadName}/${u.version}`:null},s!=null?a_(n,d,a,s,y,"setStoredLabwareCount",l?.loadName,u?.loadName):c!=null&&n_(d,c,n,y),d.setStoredLabwareCount=(d?.setStoredLabwareCount??0)+1)},AA=(e,t,r)=>{const{robotState:n}=r,{moduleId:a,labware:o}=e,{labwareEntities:i}=t,s=n.modules[a].slot,l=mt(n,a);if(l==null)return;const u=o.map(S=>S.split(":")[1]),c=new Set(u),p=Array.from(c),d=p.find(S=>Object.values(i).find(O=>O.labwareDefURI===S&&!O.def.allowedRoles?.includes("lid")&&!O.def.allowedRoles?.includes("adapter"))),y=p.find(S=>Object.values(i).find(O=>O.labwareDefURI===S&&O.def.allowedRoles?.includes("adapter"))),b=p.find(S=>Object.values(i).find(O=>O.labwareDefURI===S&&O.def.allowedRoles?.includes("lid")));if(d==null)throw new Error(`expected to find primaryLabwareURI for storedLabwareDetails but could not with labware ${o}`);l.storedLabwareDetails={primaryLabwareURI:d,adapterLabwareURI:y??null,lidLabwareURI:b??null};const h=[];for(const S of o){const O=i[S].labwareDefURI;if(O===d)h.push({primary:S,adapter:null,lid:null});else if(O===y){const v=h[h.length-1];v&&(v.adapter=S)}else if(O===b){const v=h[h.length-1];v&&(v.lid=S)}}const g=[Je,a,s];for(const S of h){const O=[S.adapter,S.primary,S.lid,...g].filter(v=>v!=null);n.labware[S.primary]={...n.labware[S.primary],stack:O.slice(O.indexOf(S.primary))},S.adapter!=null&&(n.labware[S.adapter]={...n.labware[S.adapter],stack:O.slice(O.indexOf(S.adapter))}),S.lid!=null&&(n.labware[S.lid]={...n.labware[S.lid],stack:O.slice(O.indexOf(S.lid))})}const T=l.labwareInHopper??[],m=h.map(S=>({primaryLabwareId:S.primary,adapterLabwareId:S.adapter,lidLabwareId:S.lid})),_=new Map(T.map(S=>[S.primaryLabwareId,S])),I=[];for(const S of m)I.push(S),_.delete(S.primaryLabwareId);for(const S of T)_.has(S.primaryLabwareId)&&I.push(S);l.labwareInHopper=I},OA=(e,t,r)=>{const{robotState:n}=r,{moduleId:a,count:o,labwareToStore:i}=e,{labwareEntities:s}=t,l=n.modules[a].slot,u=mt(n,a),c=[Je,a,l];if(u!=null){const p=u.storedLabwareDetails?.adapterLabwareURI,d=u.storedLabwareDetails?.lidLabwareURI;o!=null?a_(n,u,s,o,c,"fillCount",p,d):i!=null&&n_(u,i,n,c),u.fillCount=(u?.fillCount??0)+1}},vA=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,o=mt(n,a),i=n.modules[a].slot;if(o!=null){const{labwareInHopper:s,labwareOnShuttle:l}=o;if(s!=null&&s.length>0&&l==null){const u=s[0];o.labwareOnShuttle=u,s.shift();const c=[i];let p=null;for(const d of Gt){const y=u[d];if(y!=null){if(c.unshift(y),n.labware[y].stack=[...c],p==null){const b=To(i);b!=null?n.labware[y].stackedOnNode={addressableAreaName:b}:console.warn(`Could not find an addressable area for retrieved labware in stacker module ${a} at slot ${i}`)}else n.labware[y].stackedOnNode={labwareId:p};p=y}}}}},LA=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,o=mt(n,a),i=n.modules[a].slot;if(o!=null){const{labwareOnShuttle:s}=o;if(s!=null){o.labwareInHopper=[s,...o.labwareInHopper??[]],o.labwareOnShuttle=null;let l=null;for(const u of Gt){const c=s[u];c!=null&&(n.labware[c].stack=[c,Je,a,i],l==null?(n.labware[c].stackedOnNode={kind:"inStackerHopper",moduleId:a},l=c):n.labware[c].stackedOnNode={labwareId:l})}o.storedLabwareDetails==null&&(o.storedLabwareDetails={primaryLabwareURI:t.labwareEntities[s.primaryLabwareId].labwareDefURI,adapterLabwareURI:s.adapterLabwareId!=null?t.labwareEntities[s.adapterLabwareId].labwareDefURI:null,lidLabwareURI:s.lidLabwareId!=null?t.labwareEntities[s.lidLabwareId].labwareDefURI:null})}}};function o_(e,t,r){e.type===f.TEMPERATURE_MODULE_TYPE&&(e.targetTemperature=t,e.status=r)}function RA(e,t,r){const{robotState:n}=r,{moduleId:a,celsius:o}=e,i=St(n,a);o_(i,o,Jc)}function PA(e,t,r){const{robotState:n}=r,{moduleId:a,celsius:o}=e,i=St(n,a);i.type===f.TEMPERATURE_MODULE_TYPE&&o===i.targetTemperature&&(i.status=Zc)}function kA(e,t,r){const{robotState:n}=r,{moduleId:a}=e,o=St(n,a);o_(o,null,ba)}function i_(e,t,r){switch(jr(e,"undefined command passed to getNextRobotStateAndWarning"),e.commandType){case"aspirateWhileTracking":case"aspirate":case"aspirateInPlace":if(e.meta?.isAirGap===!0)break;JI(e.params,t,r);break;case"airGapInPlace":MI(e.params,t,r);break;case"dispenseWhileTracking":case"dispense":case"dispenseInPlace":if(e.meta?.isAirGap===!0)break;tS(e.params,t,r);break;case"blowout":QI(e.params,t,r);break;case"dropTip":rS(e.params,t,r);break;case"pickUpTip":QS(e.params,t,r);break;case"magneticModule/engage":TA(e.params,t,r);break;case"magneticModule/disengage":EA(e.params,t,r);break;case"moveLabware":XS(e.params,t,r);break;case"waitForTasks":pA(e.params,t,r);break;case"flexStacker/setStoredLabware":SA(e.params,t,r);break;case"flexStacker/setStoredLabwareItems":AA(e.params,t,r);break;case"flexStacker/prepareShuttle":case"flexStacker/closeLatch":case"flexStacker/openLatch":break;case"flexStacker/empty":wA(e.params,t,r);break;case"flexStacker/fill":OA(e.params,t,r);break;case"flexStacker/fillItems":IA(e.params,t,r);break;case"flexStacker/retrieve":vA(e.params,t,r);break;case"flexStacker/store":LA(e.params,t,r);break;case"touchTip":case"configureForVolume":case"loadPipette":case"loadLabware":case"loadModule":case"home":case"moveRelative":case"moveToSlot":case"moveToCoordinates":case"savePosition":case"waitForResume":case"waitForDuration":case"pause":case"delay":case"custom":case"comment":case"captureImage":case"prepareToAspirate":case"liquidProbe":case"loadLiquidClass":case"loadLidStack":case"loadLid":case"getTipPresence":case"identifyModule":case"getNextTip":case"retractAxis":case"sealPipetteToTip":case"tryLiquidProbe":case"unsealPipetteFromTip":case"verifyTipPresence":case"pressureDispense":case"createTimer":break;case"moveToAddressableArea":case"moveToAddressableAreaForDropTip":ZS(e.params,t,r);break;case"moveToWell":JS(e.params,t,r);break;case"loadLiquid":nS(e.params,t,r);break;case"dropTipInPlace":_A(e.params,t,r);break;case"blowOutInPlace":gA(e.params,t,r);break;case"configureNozzleLayout":eS(e.params,t,r);break;case"temperatureModule/setTargetTemperature":RA(e.params,t,r);break;case"temperatureModule/deactivate":kA(e.params,t,r);break;case"temperatureModule/waitForTemperature":PA(e.params,t,r);break;case"thermocycler/setTargetBlockTemperature":eA(e.params,t,r);break;case"thermocycler/setTargetLidTemperature":tA(e.params,t,r);break;case"thermocycler/waitForBlockTemperature":rA(e.params);break;case"thermocycler/waitForLidTemperature":nA(e.params);break;case"thermocycler/deactivateBlock":oA(e.params,t,r);break;case"thermocycler/deactivateLid":iA(e.params,t,r);break;case"thermocycler/closeLid":sA(e.params,t,r);break;case"thermocycler/openLid":lA(e.params,t,r);break;case"thermocycler/runProfile":uA(e.params,t,r);break;case"thermocycler/runExtendedProfile":Qg(e.params,t,r);break;case"thermocycler/startRunExtendedProfile":e_(e.params,t,r);break;case"thermocycler/awaitProfileComplete":aA(e.params);break;case"heaterShaker/deactivateHeater":dA(e.params,t,r);break;case"heaterShaker/setTargetTemperature":fA(e.params,t,r);break;case"heaterShaker/setAndWaitForShakeSpeed":mA(e.params,t,r);break;case"heaterShaker/deactivateShaker":hA(e.params,t,r);break;case"heaterShaker/openLabwareLatch":yA(e.params,t,r);break;case"heaterShaker/closeLabwareLatch":bA(e.params,t,r);break;case"heaterShaker/waitForTemperature":break;case"absorbanceReader/openLid":DI(e.params,t,r);break;case"absorbanceReader/closeLid":qI(e.params,t,r);break;case"absorbanceReader/initialize":FI(e.params,t,r);break;case"absorbanceReader/read":break;default:console.error(`unknown command: ${e.commandType} passed to getNextRobotStateAndWarning`)}}function s_(e,t,r){return $g({warnings:[],robotState:r},a=>{i_(e,t,a)})}function Gp(e,t,r){const n=xg(e);return $g({warnings:[],robotState:r},o=>{n.forEach(i=>{i_(i,t,o)})})}const NA=(e,t,r)=>{const n=e.reduce((a,o,i)=>{const s=a.timeline.length===0?r:Cp(a.timeline).robotState;if(a.errors!=null)return a;const l=o(t,s);if("errors"in l)return{timeline:a.timeline,errors:l.errors};const c=xg(l.commands).reduce((d,y)=>s_(y,t,d.robotState),{robotState:s,warnings:[]}),p={commands:l.commands,robotState:c.robotState,warnings:l.warnings,stepInfo:{stepNumber:l.stepNumber,name:l.name,description:l.description},python:l.python};return{timeline:[...a.timeline,p],errors:null}},{timeline:[],errors:null});return{timeline:n.timeline,errors:n.errors}},On=(e,t)=>{const r=t[e]?.stack;return r!=null?we(r):""},vn=e=>{const{pipette:t,labware:r,invariantContext:n,prevRobotState:a}=e;if(n.config.OT_PD_DISABLE_MODULE_RESTRICTIONS)return!1;const o=t?n.pipetteEntities[t]:null,i=r?we(a.labware[r]?.stack):null;if(!t||!r||!o||!i)return!1;const s=Object.keys(n.moduleEntities).some(l=>{const u=n.moduleEntities[l].model;if(gb.includes(u)){const c=a.modules[l]?.slot;return c==="1"&&i==="4"||c==="3"&&i==="6"}else return!1});return f.GEN_ONE_MULTI_PIPETTES.includes(o.name)&&s},Ne=(e,t,r)=>{const n=e.reduce((a,o)=>{if(a.errors.length>0)return a;const i=o(t,a.robotState);if("errors"in i)return{robotState:a.robotState,commands:a.commands,errors:i.errors,warnings:a.warnings};const s=[...a.commands,...i.commands],l=[...a.python?[a.python]:[],...i.python?[i.python]:[]].join(`
|
|
97
|
-
`)
|
|
98
|
-
`).map(t=>t&&
|
|
99
|
-
|
|
100
|
-
${ve(t.map(([n,a])=>`${ee(n)}: ${la(a)}`).join(`,
|
|
24
|
+
`+(e.blockMaxVolumeUl!==void 0?`block_max_volume=${e.blockMaxVolumeUl},`:""),_=(a!=null?`${a} = `:"")+`${i}.start_execute_profile(
|
|
25
|
+
${Z(d)}
|
|
26
|
+
)`;return{commands:[{commandType:"thermocycler/startRunExtendedProfile",key:D(),params:{moduleId:n,taskId:a,profileElements:s,blockMaxVolumeUl:o}}],python:_}},qt=(e,t,r)=>{const{pipetteId:n}=e,a=t.pipetteEntities[n].pythonName;return{commands:[{commandType:"prepareToAspirate",key:D(),params:{pipetteId:n}}],python:`${a}.prepare_to_aspirate()`}},e_=(e,t,r)=>{const{moduleId:n,celsius:a}=e;if(n===null)return{errors:[X()]};const s=t.moduleEntities[n],o=s?.type;return o===c.TEMPERATURE_MODULE_TYPE?{commands:[{commandType:"temperatureModule/setTargetTemperature",key:D(),params:{moduleId:n,celsius:a}}],python:`${s?.pythonName}.start_set_temperature(${a})`}:o===c.THERMOCYCLER_MODULE_TYPE?(console.error("Thermocycler set temp not implemented!"),{commands:[]}):o===c.HEATERSHAKER_MODULE_TYPE?{commands:[{commandType:"heaterShaker/setTargetTemperature",key:D(),params:{moduleId:n,celsius:a}}],python:`${s?.pythonName}.set_target_temperature(${a})`}:(console.error(`setTemperature expected module ${n} to be ${c.TEMPERATURE_MODULE_TYPE}, ${c.THERMOCYCLER_MODULE_TYPE} or ${c.HEATERSHAKER_MODULE_TYPE}, got ${o}`),{errors:[X()]})},Mt=(e,t,r)=>{const n="touchTip",{pipetteId:a,labwareId:s,wellName:o,zOffsetFromTop:i,speed:l,mmFromEdge:u}=e,p=r.pipettes[a],d=[];if(p||d.push(ut({pipette:a})),r.tipState.pipettes[a]?.hasTip||d.push(Ut({actionName:n,pipette:a,labware:s,well:o})),d.length>0)return{errors:d};const f=t.pipetteEntities[a].pythonName,m=[`${t.labwareEntities[s].pythonName}[${N(o)}]`,`v_offset=${i}`,...l!=null?[`speed=${l}`]:[],...u!=null?[`mm_from_edge=${u}`]:[]],h=`${f}.touch_tip(${m.join(", ")})`;return{commands:[{commandType:"touchTip",key:D(),params:{pipetteId:a,labwareId:s,wellName:o,wellLocation:{origin:c.WELL_ORIGIN_TOP,offset:{z:i}},speed:l,mmFromEdge:u}}],python:h}},wg=(e,t,r)=>{const{moduleId:n}=e,a=t.moduleEntities[n],s=st(r,n);if(a==null||s==null)return{errors:[X()]};if(kn(s))return{errors:[_a()]};const i=`${a.pythonName}.close_vent()`;return{commands:[{commandType:"vacuumModule/closeVent",key:D(),params:{moduleId:n}}],python:i}},Ag=(e,t,r)=>{const{moduleId:n}=e,a=t.moduleEntities[n],s=st(r,n);if(a==null||s==null)return{errors:[X()]};if(kn(s))return{errors:[_a()]};const i=`${a.pythonName}.open_vent()`;return{commands:[{commandType:"vacuumModule/openVent",key:D(),params:{moduleId:n}}],python:i}},ge="protocol",oa="protocol_api.OFF_DECK",hs="CUSTOM_LABWARE",La=" ";function Z(e){return e.split(`
|
|
27
|
+
`).map(t=>t&&La+t).join(`
|
|
28
|
+
`)}function pt(e){switch(typeof e){case"undefined":return"None";case"boolean":return e?"True":"False";case"number":return Number.isFinite(e)?`${e}`:`float("${e}")`;case"string":return N(e);case"object":return e===null?"None":Array.isArray(e)?_c(e):Mr(e);default:throw Error("Cannot render value as Python",{cause:e})}}function N(e){return JSON.stringify(e)}function t_(e){return`(${e.map(t=>pt(t)).join(", ")})`}function _c(e){return e.every(t=>Array.isArray(t)&&t.length===2&&t.every(r=>typeof r=="number"))?`[${e.map(t=>t_(t)).join(", ")}]`:`[${e.map(t=>pt(t)).join(", ")}]`}function Sg(e){return["undefined","boolean","number","string"].includes(typeof e)||e===null}function Mr(e){const t=Object.entries(e),r=t.every(([n,a])=>Sg(a));if(t.length<=1||r){const n=`{${t.map(([a,s])=>`${N(a)}: ${pt(s)}`).join(", ")}}`;if(t.length<=1||n.length<64)return n}return`{
|
|
29
|
+
${Z(t.map(([n,a])=>`${N(n)}: ${pt(a)}`).join(`,
|
|
101
30
|
`))},
|
|
102
|
-
}`}function
|
|
103
|
-
|
|
31
|
+
}`}function An(e){const{x:t,y:r,z:n}=e?.offset||{};let a=!!n,s=e?.origin;!s&&(t||r||n)&&(s="top");let o="";if(s&&(o+=(()=>{switch(s){case"top":return a=!1,`.top(${n?`z=${n}`:""})`;case"bottom":return a=!1,`.bottom(${n?`z=${n}`:""})`;case"center":return".center()";case"meniscus":return a=!1,`.meniscus(${n?`z=${n}`:""})`}})()),t||r||a){const i=[...t?[`x=${t}`]:[],...r?[`y=${r}`]:[],...a?[`z=${n}`]:[]];o+=`.move(types.Point(${i.join(", ")}))`}return o}function _s(e,t){const r=[];for(let n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r}const r_=(e,t)=>[`duration=${pt(e)}`,...typeof t=="boolean"?[`vent_after=${pt(t)}`]:[]],Lg=(e,t,r)=>{const{moduleId:n,powerPercent:a,duration:s,ventAfter:o}=e,i=t.moduleEntities[n],l=st(r,n);if(l==null||i==null)return{errors:[X()]};if(kn(l))return{errors:[_a()]};const p=s!=null,d=p?`${i.pythonName}_task_${l.numPumpActivitiesStarted+1}`:null,f=p?{duration:s,ventAfter:o,taskId:d}:null,_=d==null?"":`${d} = `,m=`power_percent=${pt(a)}`,h=p?r_(s,o):[],b=[m,...h],T=`${_}${i.pythonName}.set_power(
|
|
32
|
+
${Z(b.join(`,
|
|
33
|
+
`))}
|
|
34
|
+
)`;return{commands:[{commandType:"vacuumModule/startSetVacuumPower",key:D(),params:{moduleId:n,percentPower:a,...f??{}}}],python:T}},Og=(e,t,r)=>{const{moduleId:n,gaugePressure:a,duration:s,ventAfter:o}=e,i=t.moduleEntities[n],l=st(r,n);if(l==null||i==null)return{errors:[X()]};if(kn(l))return{errors:[_a()]};const p=s!=null,d=p?`${i.pythonName}_task_${l.numPumpActivitiesStarted+1}`:null,f=p?{duration:s,ventAfter:o,taskId:d}:null,_=d==null?"":`${d} = `,m=`gauge_pressure=${pt(a)}`,h=p?r_(s,o):[],b=[m,...h],T=`${_}${i.pythonName}.set_pressure(
|
|
35
|
+
${Z(b.join(`,
|
|
36
|
+
`))}
|
|
37
|
+
)`;return{commands:[{commandType:"vacuumModule/startSetVacuumPressure",key:D(),params:{moduleId:n,gaugePressure:a,...f??{}}}],python:T}},Rg=e=>{const{steps:t,repetitions:r}=e;return Array.from({length:r}).flatMap(()=>t)},kg=e=>e.reduce((t,r)=>{if("repetitions"in r){const n=Rg(r);return[...t,...n]}return[...t,r]},[]),Sf=e=>{if("pressureMbar"in e){const{pressureMbar:n,holdSeconds:a}=e;return Mr({gauge_pressure:n,hold_time_seconds:a})}const{powerPercent:t,holdSeconds:r}=e;return Mr({power_percent:Number(t),hold_time_seconds:Number(r)})},vg=e=>{let t,r;if(e.length===1&&"repetitions"in e[0]){const{steps:n,repetitions:a}=e[0];return t=`profile=[
|
|
38
|
+
${Z(n.map(Sf).join(`,
|
|
39
|
+
`))}
|
|
40
|
+
]`,r=`repetitions=${pt(a)}`,[t,r]}else{const n=kg(e);t=`profile=[
|
|
41
|
+
${Z(n.map(Sf).join(`,
|
|
42
|
+
`))}
|
|
43
|
+
]`,r=`repetitions=${pt(1)}`}return[t,r]},Pg=(e,t,r)=>{const{moduleId:n,profile:a,ventAfter:s}=e,o=st(r,n);if(o===null)return{errors:[X()]};if(kn(o))return{errors:[_a()]};const l=t.moduleEntities[n].pythonName,u=`${l}_task_${o.numPumpActivitiesStarted+1}`,p=vg(a),d=s?`vent_after=${pt(s)}`:null,f=[...p,...d!=null?[d]:[]],_=`${u} = ${l}.start_execute_profile(
|
|
44
|
+
${Z(f.join(`,
|
|
45
|
+
`))}
|
|
46
|
+
)`;return{commands:[{commandType:"vacuumModule/startRunProfile",key:D(),params:{moduleId:n,profile:a,ventAfter:s,taskId:u}}],python:_}},Ng=(e,t,r)=>{const{moduleId:n}=e,a=t.moduleEntities[n];if(a==null)return{errors:[X()]};const s=`${a.pythonName}.stop_vacuum()`;return{commands:[{commandType:"vacuumModule/stopVacuum",key:D(),params:{moduleId:n}}],python:s}},n_=(e,t,r)=>{const{moduleId:n,celsius:a}=e,s=n?At(r,n):null,o=[];if(n===null||!s)return{errors:[X()]};if(s.type!==c.TEMPERATURE_MODULE_TYPE&&s.type!==c.HEATERSHAKER_MODULE_TYPE)return console.error(`expected module to be ${c.TEMPERATURE_MODULE_TYPE} but got ${s.type}`),{errors:[X()]};const i="status"in s&&s.status===Xu&&s.targetTemperature!==a,l="status"in s&&s.status===Zu&&s.targetTemperature!==a;if(i||"status"in s&&s.status===Ta||"targetTemp"in s&&s.targetTemp==null)return{errors:[qy()]};l&&o.push(bg());const u=t.moduleEntities[n],p=u?.type;switch(p){case c.TEMPERATURE_MODULE_TYPE:return{commands:[{commandType:"temperatureModule/waitForTemperature",key:D(),params:{moduleId:n,celsius:a}}],warnings:o.length>0?o:void 0,python:`${u?.pythonName}.await_temperature(${a})`};case c.HEATERSHAKER_MODULE_TYPE:return{commands:[{commandType:"heaterShaker/waitForTemperature",key:D(),params:{moduleId:n,celsius:a}}],warnings:o.length>0?o:void 0,python:`${u?.pythonName}.wait_for_temperature()`};default:return console.error(`awaitTemperature expected module ${n} to be ${c.TEMPERATURE_MODULE_TYPE} or ${c.HEATERSHAKER_MODULE_TYPE}, got ${p}`),{errors:[X()]}}};function U(e,t){return(r,n)=>e(t,r,n)}function O(e,t){return(r,n)=>{const a=e(t,r,n);if("python"in a){const{python:s,...o}=a;return o}return a}}const je="__air__",Hr="source_well",Sn="dest_well",a_=(e,t,r)=>{const s=c.getDeckDefFromRobotType(r).cutoutFixtures.find(l=>l.id.includes(t))?.providesAddressableAreas,i=(l=>{if(s!=null){for(const u in s)if(s[u].includes(l))return u}return null})(e);if(i==null)throw Error(`expected to find cutoutId from addressableAreaName ${e} but could not`);return i};function s_(e){switch(e){case 1:return c.ONE_CHANNEL_WASTE_CHUTE_ADDRESSABLE_AREA;case 8:return c.EIGHT_CHANNEL_WASTE_CHUTE_ADDRESSABLE_AREA;case 96:return c.NINETY_SIX_CHANNEL_WASTE_CHUTE_ADDRESSABLE_AREA}}function yc(e){const t=c.getDeckDefFromRobotType(e==="cutout12"?c.OT2_ROBOT_TYPE:c.FLEX_ROBOT_TYPE);let r=null;return t.robot.model===c.FLEX_ROBOT_TYPE&&(r=t.cutoutFixtures.find(n=>n.id==="trashBinAdapter")?.providesAddressableAreas??null),t.robot.model===c.FLEX_ROBOT_TYPE&&r==null&&console.error(`expected to find a list of cutouts for the Flex but could not with trashLocation ${e}`),r!=null?r[e]?.[0]:"fixedTrash"}function o_(e){if(e==="fixedTrash")return"cutout12";const r=c.getDeckDefFromRobotType(c.FLEX_ROBOT_TYPE).cutoutFixtures.find(n=>n.id==="trashBinAdapter")?.providesAddressableAreas??null;if(r==null)return console.error("Could not find trashBinAdapter cutouts for Flex"),null;for(const[n,a]of Object.entries(r))if(a.includes(e))return n;return console.error(`Could not find trashLocation for addressableAreaName ${e}`),null}function Ln(e,t,r,n){return e[n]!=null?"labware":t[n]!=null?"wasteChute":r[n]!=null?"trashBin":(console.error(`expected to determine if dest labware is a labware or waste chute with destLabware ${n} but could not`),null)}function i_(e,t){return hn(cn(t),r=>e)}function pr(e){return lt(e,(t,r,n)=>n===je?t:t+r.volume,0)}function Kt(e,t){const r=pr(t);if(r===0)return{source:t,dest:{[je]:{volume:e}}};if(e>r)return{source:Xt(t,()=>({volume:0})),dest:{...t,[je]:{volume:e-r}}};const n=lt(t,(a,s,o)=>({...a,[o]:s.volume/r}),{});return Object.keys(t).reduce((a,s)=>{const o=n[s]*e;return{source:{...a.source,[s]:{volume:t[s].volume-o}},dest:{...a.dest,[s]:{volume:o}}}},{source:{},dest:{}})}function dr(e,t){return{...t,...lt(e,(r,n,a)=>{const o=a in t?n.volume+t[a].volume:n.volume;return{...r,[a]:{volume:o}}},{})}}function bc(e,t,r){const n=e===1?[r]:c.getWellNamePerMultiTip(t,r,e);if(!n)return console.warn(e===1?`Invalid well: ${r}`:`For labware def (URI ${c.getLabwareDefURI(t)}), with primary well ${r}, no wells are accessible by 8-channel's 1st tip`),{wellsForTips:[],allWellsShared:!1};const a=n.every(s=>s&&s===n[0]);return{wellsForTips:n,allWellsShared:a}}const l_=e=>{const{pipette:t,sourceLabwareId:r,sourceWell:n,destLabwareId:a,destWell:s,blowoutLocation:o,flowRate:i,offsetFromTopMm:l,invariantContext:u}=e;if(!o)return[];const{trashBinEntities:p,wasteChuteEntities:d}=u;let f=null,_=null;return o===Hr?(f=r,_=n):o===Sn&&(f=a,_=s),_!=null&&f!=null?[U(Zh,{pipetteId:t,labwareId:f,wellName:_,flowRate:i,wellLocation:{origin:"top",offset:{z:l}}})]:d[o]!=null?[U(Ty,{pipetteId:t,flowRate:i,wasteChuteId:Object.keys(d)[0]})]:[U(by,{pipetteId:t,trashId:Object.keys(p)[0],flowRate:i})]};function u_(e){const{labwareEntities:t,pipetteEntities:r,wasteChuteEntities:n,trashBinEntities:a}=e;return{pipettes:lt(r,(s,o,i)=>{const l=o.spec;return{...s,[i]:c_(l.channels,{})}},{}),labware:lt(t,(s,o,i)=>({...s,[i]:Xt(o.def.wells,()=>({}))}),{}),trashBins:lt(a,(s,o,i)=>({...s,[i]:{}}),{}),wasteChute:lt(n,(s,o,i)=>({...s,[i]:{}}),{})}}function c_(e,t){return cn(e).reduce((r,n)=>({...r,[n]:t}),{})}const p_=e=>{const{blowoutLocation:t,sourceLabware:r,destLabware:n,sourceWell:a,destWell:s}=e;return t===Hr&&r!=null&&a!=null?{dispenseAirGapLabware:r,dispenseAirGapWell:a}:{dispenseAirGapLabware:n,dispenseAirGapWell:s}};function Tc(e){const{invariantContext:t,labwareLocations:r,moduleLocations:n={},pipetteLocations:a}=e;return{labware:r,modules:n,pipettes:a,liquidState:u_(t),tipState:{pipettes:lt(a,(s,o,i)=>o.mount?{...s,[i]:{hasTip:!1,tiprackURI:null}}:s,{}),tipracks:lt(r,(s,o,i)=>{const l=t.labwareEntities[i].def;if(!c.getIsTiprack(l))return s;const u=Xt(l.wells,()=>ga);return{...s,[i]:u}},{})}}}const d_=(e,t)=>e.tipracks[t]!=null?Object.values(e.tipracks[t]).some(r=>r!==se):!1,f_=(e,t)=>e.labware[t]!=null?Object.values(e.labware[t]).some(r=>Object.values(r).some(n=>n.volume>0)):!1,Cg=(e,t,r)=>{const{destinationId:n,pipetteId:a,volume:s,flowRate:o,offsetFromBottomMm:i,well:l,xOffset:u,yOffset:p,tipRack:d,primaryNozzle:f,nozzles:_}=e,{labwareEntities:m,trashBinEntities:h,wasteChuteEntities:b}=t,T=Ln(m,b,h,n);let y=[];return T==="labware"&&i!=null&&l!=null?y=[U(Qh,{pipetteId:a,volume:s,labwareId:n,wellName:l,flowRate:o,wellLocation:{origin:"bottom",offset:{z:i,x:u,y:p}},tipRack:d,primaryNozzle:f,nozzles:_})]:T==="wasteChute"?y=[U(gA,{pipetteId:a,volume:s,flowRate:o,wasteChuteId:b[n].id})]:y=[U(TA,{pipetteId:a,volume:s,flowRate:o,trashId:h[n].id})],ce(y,t,r)},Dg=(e,t,r)=>{const{destinationId:n,pipetteId:a,zOffset:s,well:o}=e,{labwareEntities:i,wasteChuteEntities:l,trashBinEntities:u}=t,p=Ln(i,l,u,n);let d=[];return p==="labware"&&o!=null?d=[U(V,{pipetteId:a,labwareId:n,wellName:o,wellLocation:{origin:"bottom",offset:{x:0,y:0,z:s}}})]:p==="wasteChute"?d=[U(qe,{pipetteId:a,fixtureId:l[n].id,offset:{x:0,y:0,z:0}})]:d=[U(qe,{pipetteId:a,fixtureId:u[n].id,offset:It})],ce(d,t,r)},Mg=(e,t,r)=>{const{blowOutLocation:n,destinationId:a,destWell:s,flowRate:o,pipetteId:i,sourceId:l,sourceWell:u,volume:p}=e,{labwareEntities:d,trashBinEntities:f,wasteChuteEntities:_}=t,m=Ln(d,_,f,a);let h=[];if(m==="labware"&&s!=null){const{dispenseAirGapLabware:b,dispenseAirGapWell:T}=p_({blowoutLocation:n,sourceLabware:l,destLabware:a,sourceWell:u,destWell:s});h=[U(dA,{flowRate:o,pipetteId:i,labwareId:b,wellName:T,volume:p,type:"dispense"})]}else m==="wasteChute"?h=[U(pA,{pipetteId:i,volume:p,flowRate:o,wasteChuteId:_[a].id})]:h=[U(cA,{pipetteId:i,volume:p,flowRate:o,trashId:f[a].id})];return ce(h,t,r)},Fg=(e,t,r)=>{const{pipetteId:n,destinationId:a,well:s,zOffset:o,seconds:i}=e,{labwareEntities:l,trashBinEntities:u,wasteChuteEntities:p}=t,d=Ln(l,p,u,a);let f=[];return s!=null&&d==="labware"?f=[U(V,{pipetteId:n,labwareId:a,wellName:s,wellLocation:{origin:"bottom",offset:{x:0,y:0,z:o}}}),U(he,{seconds:i})]:d==="wasteChute"?f=[U(qe,{pipetteId:n,fixtureId:a,offset:It}),U(he,{seconds:i})]:f=[U(qe,{pipetteId:n,fixtureId:a,offset:It}),U(he,{seconds:i})],ce(f,t,r)},z=(e,t=!1)=>{if(e==null)return console.error("expected to find stack but could not"),"unknown slot";{const r=e[e.length-1];return t?`STACKER ${r.slice(-2,-1)}`:r}},gc=e=>e==null?(console.error("expected to find stack but could not"),"unknown top location"):e[0],m_=e=>e.length>=2?e[1]:null,ys=(e,t)=>Object.values(e).reduce((r,{stack:n})=>(n[n.length-1]===t&&n.length>r.length&&(r=n),r),[]),Ic=e=>c.FLEX_SINGLE_SLOT_BY_CUTOUT_ID[c.FLEX_CUTOUT_BY_SLOT_ID[e]],h_=e=>{const t=c.FLEX_STACKER_ADDRESSABLE_AREAS.indexOf(e);return t===-1?null:De[t]},qg=e=>{const t=h_(e);return t!=null?Ic(t):null},__=(e,t,r)=>{if(e==null)return null;if(De.includes(e)){const n=Ic(e);return Object.entries(t).some(([s,o])=>r[s]?.type===c.FLEX_STACKER_MODULE_TYPE&&o.slot===n)?n:e}return e},bs=e=>{const t=c.getDeckDefFromRobotType(c.FLEX_ROBOT_TYPE),r=`${e[0]}3`,n=c.FLEX_CUTOUT_BY_SLOT_ID[r],a=t.cutoutFixtures.find(({id:s})=>s===c.FLEX_STACKER_V1_FIXTURE)?.providesAddressableAreas[n];return c.FLEX_STACKER_ADDRESSABLE_AREAS.find(s=>a?.includes(s))??null},y_=(e,t,r,n)=>{if(t.length===0)return{isCompatible:!0,isAboveStackLimit:!1};let a=!1;const s=t.find(u=>u in n);s!=null&&(a=n[s].type===c.FLEX_STACKER_MODULE_TYPE&&t.includes(He));const o=gc(t);let i=!0,l=!1;if(o in r){const u=r[e],p=r[o],d=t.filter(I=>r[I]!=null),f=d.filter(I=>r[I]?.def?.allowedRoles?.includes("lid"))[0],_=d.filter(I=>r[I]?.def?.allowedRoles?.includes("adapter"))[0],m=p.def.parameters.loadName,h=d.filter(I=>!r[I]?.def?.allowedRoles?.includes("adapter")&&!r[I]?.def?.allowedRoles?.includes("lid"))[0];if(a){const I=c.getMaxPoolCount({labwareDefinitions:{primary:r[h]?.def??null,adapter:r[_]?.def??null,lid:r[f]?.def??null},model:c.FLEX_STACKER_MODULE_V1});l=t.length>I}else{const I=p.def.stackLimit??1,L=m===u.def.parameters.loadName,A=t.filter(E=>r[E]?.def.parameters.loadName===m)?.length;l=L&&A>=I}const b=u.def.parameters.loadName==="opentrons_tough_universal_lid",T=p.def.metadata.displayCategory==="tubeRack",y=p.def.metadata.displayCategory==="aluminumBlock",S=p.def.parameters.isTiprack,g=(p.def.allowedRoles??[]).includes("lid");i=u.def.compatibleParentLabware?.some(I=>I===m)||Object.keys(u.def.stackingOffsetWithLabware??{}).some(I=>I===m)||b&&!T&&!y&&!S&&(p.def.parameters.loadName==="opentrons_tough_universal_lid"||!g)}else if(o in n){const u=n[o],{model:p}=u;i=Object.keys(r[e].def.stackingOffsetWithModule??{}).some(d=>p===d)}return{isCompatible:i,isAboveStackLimit:l}},Oa=(e,t)=>t?.find(r=>e[r]!=null)??null,Ec=(e,t,r)=>{if(t==="offDeck"&&r==null)return console.error("offDeck slot is not allowed to be used without an offDeckOverrideId"),[];const n=b_(t),a=n?Sh[t]:t,s=Object.values(e).filter(o=>o.stack.includes(a)&&(r==null||o.stack.includes(r))&&o.stack.includes(He)===n);return n?s.reverse()[0].stack??[]:s.sort((o,i)=>i.stack.length-o.stack.length)[0]?.stack??[]},Ug=(e,t)=>Object.values(t).filter(r=>r.stack.includes(e)).sort((r,n)=>n.stack.length-r.stack.length)[0]?.stack[0],ea=(e,t,r,n=!0)=>{const a=c.linearInterpolate(e,t)??0,s=c.linearInterpolate(e,r)??0;return e+(n?a:0)+s},wc=e=>{const{path:t,volume:r,pipetteSpecs:n,tiprackDefinition:a,conditioningByVolume:s,disposalByVolume:o,numDispenseWells:i,numAspirateWells:l,aspirateAirGapByVolume:u}=e,{liquids:p}=n,f=r<p.default.minVolume&&"lowVolumeDefault"in p?p.lowVolumeDefault.maxVolume:p.default.maxVolume,_=a?.wells.A1.totalLiquidVolume,m=_==null?f:Math.min(f,_),h=r*2,b=s!=null?c.linearInterpolate(h,s)??0:0,y=a?.namespace!=="opentrons"||s!=null&&o!=null&&m>=h+b+(c.linearInterpolate(h,o)??0)+(b===0?c.linearInterpolate(h,u)??0:0),S=m>=h;if(t==="multiAspirate"&&l<=i?console.warn("Invalid combination of source and destination wells for multiAspirate path"):t==="multiDispense"&&l>=i?console.warn("Invalid combination of source and destination wells for multiDispense path"):t==="single"&&l!==i&&console.warn("Invalid combination of source and destination wells for single path"),t==="single"||t==="multiDispense"&&!y||t==="multiAspirate"&&!S){const L=c.linearInterpolate(r,u)??0,A=Math.ceil((r+L)/m),E=r/A;return{referenceVolumes:{airGap:{aspirate:E,dispense:0},correction:{aspirate:E,dispense:E},pushOut:E,flowRate:{aspirate:E,dispense:E}},multiWellHandling:{isSupported:!1}}}if(t==="multiDispense"){let L=0,A=0;for(let E=0;E<i&&!(ea((E+1)*r,s??[],o??[])>m);E++)L=(E+1)*r,A+=1;return{referenceVolumes:{airGap:{aspirate:ea(L,s??[],o??[],!1),dispense:ea((A-1)*r,s??[],o??[],!1)},correction:{aspirate:ea(L,s??[],o??[]),dispense:r},flowRate:{aspirate:ea(L,s??[],o??[]),dispense:r},pushOut:r,conditioning:L,disposal:L},multiWellHandling:{isSupported:!0,numWellsToFitInTip:A}}}const w=Math.floor(m/r),g=Math.min(w,l),I=g*r;return{referenceVolumes:{airGap:{aspirate:I,dispense:0},pushOut:I,correction:{aspirate:I,dispense:I},flowRate:{aspirate:r,dispense:I}},multiWellHandling:{isSupported:!0,numWellsToFitInTip:g}}},Fr=e=>{const{retractZOffset:t,retractPositionReference:r,labwareId:n,labwareEntities:a,well:s}=e;if(s==null)return!1;const o=a[n]?.def.wells[s]?.depth;if(o==null)return!1;const i=c.getMmFromBottom(t,r,o);return i==null?!1:i-o>=c.SAFE_MOVE_TO_WELL_OFFSET_FROM_TOP_MM},Fu=e=>e.reduce((t,r)=>{const{kind:n}=r;return n==="onCutoutFixture"?t:n==="onLabware"?[...t,r.labwareId]:n==="onModule"||n==="inStackerHopper"?[...t,r.moduleId]:n==="onAddressableArea"?[...t,r.addressableAreaName]:[...t,r.logicalLocationName]},[]),Bg={A4:"cutoutA3",B4:"cutoutB3",C4:"cutoutC3",D4:"cutoutD3"};function qu(e){if(e.location!=="offDeck"&&e.location!=="systemLocation"&&e.location!=="wasteChuteLocation"&&"addressableAreaName"in e.location&&wh.includes(e.location.addressableAreaName)){const t=D(),r=e.location.addressableAreaName,n=Bg[r]??r;return{[t]:{id:t,location:n}}}return{}}const $g=(e,t)=>{const r=ys(e,t),n=r.indexOf(He);return r[n-1]},b_=e=>Ah.includes(e),Ac=e=>e.labwareOnShuttle?.primaryLabwareId??null,Sc=(e,t,r)=>{if(r?.storedLabwareDetails==null)return!0;const n=Object.values(r?.storedLabwareDetails??{}).reduce((s,o)=>o!=null?[...s,o]:s,[]),a=t.labwareEntities[e];return n.some(s=>a?.labwareDefURI===s)},Lc=(e,t)=>{const{storedLabwareDetails:r}=e??{};if(r==null)return!0;const{primaryLabwareURI:n,adapterLabwareURI:a,lidLabwareURI:s}=r,o=Object.values(t).find(({labwareDefURI:f})=>f===n),i=Object.values(t).find(({labwareDefURI:f})=>f===a),l=Object.values(t).find(({labwareDefURI:f})=>f===s);if(o==null)return console.error("Primary labware entity not found"),!1;const u=c.getMaxPoolCount({labwareDefinitions:{primary:o.def,adapter:i?.def??null,lid:l?.def??null},model:c.FLEX_STACKER_MODULE_V1}),d=e?.labwareInHopper?.length??0;return u>d},Ra=(e,t,r)=>{const n=t[r]?.stack,a=Oa(e,n),s=a!=null?e[a].moduleState:null;return!!(s&&s.type===c.ABSORBANCE_READER_TYPE&&s.lidOpen!==!0)};var pl,Lf;function T_(){if(Lf)return pl;Lf=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return pl=e,pl}var Vg=T_();const Oc=xe(Vg);var g_=Symbol.for("immer-nothing"),Of=Symbol.for("immer-draftable"),at=Symbol.for("immer-state"),xg=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function Ye(e,...t){if(process.env.NODE_ENV!=="production"){const r=xg[e],n=typeof r=="function"?r.apply(null,t):r;throw new Error(`[Immer] ${n}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ia=Object.getPrototypeOf;function _n(e){return!!e&&!!e[at]}function qr(e){return e?I_(e)||Array.isArray(e)||!!e[Of]||!!e.constructor?.[Of]||ka(e)||gs(e):!1}var Hg=Object.prototype.constructor.toString(),Rf=new WeakMap;function I_(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=Rf.get(r);return n===void 0&&(n=Function.toString.call(r),Rf.set(r,n)),n===Hg}function Za(e,t,r=!0){Ts(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(a=>{t(a,e[a],e)}):e.forEach((n,a)=>t(a,n,e))}function Ts(e){const t=e[at];return t?t.type_:Array.isArray(e)?1:ka(e)?2:gs(e)?3:0}function Uu(e,t){return Ts(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function E_(e,t,r){const n=Ts(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function jg(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function ka(e){return e instanceof Map}function gs(e){return e instanceof Set}function Nr(e){return e.copy_||e.base_}function Bu(e,t){if(ka(e))return new Map(e);if(gs(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=I_(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[at];let a=Reflect.ownKeys(n);for(let s=0;s<a.length;s++){const o=a[s],i=n[o];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(n[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(ia(e),n)}else{const n=ia(e);if(n!==null&&r)return{...e};const a=Object.create(n);return Object.assign(a,e)}}function Rc(e,t=!1){return Is(e)||_n(e)||!qr(e)||(Ts(e)>1&&Object.defineProperties(e,{set:Ga,add:Ga,clear:Ga,delete:Ga}),Object.freeze(e),t&&Object.values(e).forEach(r=>Rc(r,!0))),e}function zg(){Ye(2)}var Ga={value:zg};function Is(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Gg={};function Ur(e){const t=Gg[e];return t||Ye(0,e),t}var la;function w_(){return la}function Wg(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function kf(e,t){t&&(Ur("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function $u(e){Vu(e),e.drafts_.forEach(Yg),e.drafts_=null}function Vu(e){e===la&&(la=e.parent_)}function vf(e){return la=Wg(la,e)}function Yg(e){const t=e[at];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Pf(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[at].modified_&&($u(t),Ye(4)),qr(e)&&(e=Qa(t,e),t.parent_||Ja(t,e)),t.patches_&&Ur("Patches").generateReplacementPatches_(r[at].base_,e,t.patches_,t.inversePatches_)):e=Qa(t,r,[]),$u(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==g_?e:void 0}function Qa(e,t,r){if(Is(t))return t;const n=e.immer_.shouldUseStrictIteration(),a=t[at];if(!a)return Za(t,(s,o)=>Nf(e,a,t,s,o,r),n),t;if(a.scope_!==e)return t;if(!a.modified_)return Ja(e,a.base_,!0),a.base_;if(!a.finalized_){a.finalized_=!0,a.scope_.unfinalizedDrafts_--;const s=a.copy_;let o=s,i=!1;a.type_===3&&(o=new Set(s),s.clear(),i=!0),Za(o,(l,u)=>Nf(e,a,s,l,u,r,i),n),Ja(e,s,!1),r&&e.patches_&&Ur("Patches").generatePatches_(a,r,e.patches_,e.inversePatches_)}return a.copy_}function Nf(e,t,r,n,a,s,o){if(a==null||typeof a!="object"&&!o)return;const i=Is(a);if(!(i&&!o)){if(process.env.NODE_ENV!=="production"&&a===r&&Ye(5),_n(a)){const l=s&&t&&t.type_!==3&&!Uu(t.assigned_,n)?s.concat(n):void 0,u=Qa(e,a,l);if(E_(r,n,u),_n(u))e.canAutoFreeze_=!1;else return}else o&&r.add(a);if(qr(a)&&!i){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===a&&i)return;Qa(e,a),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(ka(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&Ja(e,a)}}}function Ja(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Rc(t,r)}function Kg(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:w_(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let a=n,s=kc;r&&(a=[n],s=ua);const{revoke:o,proxy:i}=Proxy.revocable(a,s);return n.draft_=i,n.revoke_=o,i}var kc={get(e,t){if(t===at)return e;const r=Nr(e);if(!Uu(r,t))return Xg(e,r,t);const n=r[t];return e.finalized_||!qr(n)?n:n===dl(e.base_,t)?(fl(e),e.copy_[t]=Hu(n,e)):n},has(e,t){return t in Nr(e)},ownKeys(e){return Reflect.ownKeys(Nr(e))},set(e,t,r){const n=A_(Nr(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const a=dl(Nr(e),t),s=a?.[at];if(s&&s.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(jg(r,a)&&(r!==void 0||Uu(e.base_,t)))return!0;fl(e),xu(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return dl(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,fl(e),xu(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Nr(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Ye(11)},getPrototypeOf(e){return ia(e.base_)},setPrototypeOf(){Ye(12)}},ua={};Za(kc,(e,t)=>{ua[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});ua.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Ye(13),ua.set.call(this,e,t,void 0)};ua.set=function(e,t,r){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Ye(14),kc.set.call(this,e[0],t,r,e[0])};function dl(e,t){const r=e[at];return(r?Nr(r):e)[t]}function Xg(e,t,r){const n=A_(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function A_(e,t){if(!(t in e))return;let r=ia(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=ia(r)}}function xu(e){e.modified_||(e.modified_=!0,e.parent_&&xu(e.parent_))}function fl(e){e.copy_||(e.copy_=Bu(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Zg=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const s=r;r=t;const o=this;return function(l=s,...u){return o.produce(l,p=>r.call(this,p,...u))}}typeof r!="function"&&Ye(6),n!==void 0&&typeof n!="function"&&Ye(7);let a;if(qr(t)){const s=vf(this),o=Hu(t,void 0);let i=!0;try{a=r(o),i=!1}finally{i?$u(s):Vu(s)}return kf(s,n),Pf(a,s)}else if(!t||typeof t!="object"){if(a=r(t),a===void 0&&(a=t),a===g_&&(a=void 0),this.autoFreeze_&&Rc(a,!0),n){const s=[],o=[];Ur("Patches").generateReplacementPatches_(t,a,s,o),n(s,o)}return a}else Ye(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(o,...i)=>this.produceWithPatches(o,l=>t(l,...i));let n,a;return[this.produce(t,r,(o,i)=>{n=o,a=i}),n,a]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){qr(e)||Ye(8),_n(e)&&(e=Qg(e));const t=vf(this),r=Hu(e,void 0);return r[at].isManual_=!0,Vu(t),r}finishDraft(e,t){const r=e&&e[at];(!r||!r.isManual_)&&Ye(9);const{scope_:n}=r;return kf(n,t),Pf(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const a=t[r];if(a.path.length===0&&a.op==="replace"){e=a.value;break}}r>-1&&(t=t.slice(r+1));const n=Ur("Patches").applyPatches_;return _n(e)?n(e,t):this.produce(e,a=>n(a,t))}};function Hu(e,t){const r=ka(e)?Ur("MapSet").proxyMap_(e,t):gs(e)?Ur("MapSet").proxySet_(e,t):Kg(e,t);return(t?t.scope_:w_()).drafts_.push(r),r}function Qg(e){return _n(e)||Ye(10,e),S_(e)}function S_(e){if(!qr(e)||Is(e))return e;const t=e[at];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Bu(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Bu(e,!0);return Za(r,(a,s)=>{E_(r,a,S_(s))},n),t&&(t.finalized_=!1),r}var Jg=new Zg,L_=Jg.produce;function eI(e,t){let n=0;const a=[];for(;n+1<e.length;){const s=e[n],o=e[n+1];if(t(s,o)){n+=2;continue}else a.push(s),n+=1}return n+1===e.length&&a.push(e[n]),a}const tI=(e,t)=>["pipetteId","volume","labwareId","wellName"].every(n=>e[n]===t[n]),rI=e=>eI(e,(t,r)=>t.commandType==="aspirate"&&r.commandType==="dispense"&&tI(t.params,r.params)),O_=e=>rI(e),vc=(e,t)=>{const r=At(e,t);return r.type===c.ABSORBANCE_READER_TYPE?r:(console.error(`Absorbance reader state updater expected ${t} moduleState to be absorbanceReader, but it was ${r.type}`),null)},nI=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=vc(n,a);s!=null&&(s.lidOpen=!0)},aI=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=vc(n,a);s!=null&&(s.lidOpen=!1)},sI=(e,t,r)=>{const{robotState:n}=r,{moduleId:a,measureMode:s,sampleWavelengths:o,referenceWavelength:i}=e,l=vc(n,a);l!=null&&(l.initialization={mode:s,wavelengths:o,referenceWavelength:i},l.lidOpen=!1)};function oI(e,t,r){const{pipetteId:n,volume:a}=e,{robotState:s}=r,o=s.pipettes[n].nozzles;let l=t.pipetteEntities[n].spec.channels;o===c.COLUMN?l=8:o===c.SINGLE&&(l=1),cn(l).forEach(u=>{const p=s.liquidState.pipettes[n][u]??{},d=p[je]?.volume??0;s.liquidState.pipettes[n][u]={...p,[je]:{volume:d+a}}})}var ml,Cf;function iI(){if(Cf)return ml;Cf=1;var e=$h(),t=Aa(),r=as(),n=Ke(),a=xr(),s=cs(),o=ds(),i=lc(),l="[object Map]",u="[object Set]",p=Object.prototype,d=p.hasOwnProperty;function f(_){if(_==null)return!0;if(a(_)&&(n(_)||typeof _=="string"||typeof _.splice=="function"||s(_)||i(_)||r(_)))return!_.length;var m=t(_);if(m==l||m==u)return!_.size;if(o(_))return!e(_).length;for(var h in _)if(d.call(_,h))return!1;return!0}return ml=f,ml}var lI=iI();const hl=xe(lI);var _l,Df;function uI(){if(Df)return _l;Df=1;function e(t,r,n,a){for(var s=t.length,o=n+(a?1:-1);a?o--:++o<s;)if(r(t[o],o,t))return o;return-1}return _l=e,_l}var yl,Mf;function cI(){if(Mf)return yl;Mf=1;function e(t){return t!==t}return yl=e,yl}var bl,Ff;function pI(){if(Ff)return bl;Ff=1;function e(t,r,n){for(var a=n-1,s=t.length;++a<s;)if(t[a]===r)return a;return-1}return bl=e,bl}var Tl,qf;function dI(){if(qf)return Tl;qf=1;var e=uI(),t=cI(),r=pI();function n(a,s,o){return s===s?r(a,s,o):e(a,t,o)}return Tl=n,Tl}var gl,Uf;function fI(){if(Uf)return gl;Uf=1;var e=dI();function t(r,n){var a=r==null?0:r.length;return!!a&&e(r,n,0)>-1}return gl=t,gl}var Il,Bf;function mI(){if(Bf)return Il;Bf=1;function e(t,r,n){for(var a=-1,s=t==null?0:t.length;++a<s;)if(n(r,t[a]))return!0;return!1}return Il=e,Il}var El,$f;function hI(){if($f)return El;$f=1;function e(){}return El=e,El}var wl,Vf;function _I(){if(Vf)return wl;Vf=1;var e=xh(),t=hI(),r=nc(),n=1/0,a=e&&1/r(new e([,-0]))[1]==n?function(s){return new e(s)}:t;return wl=a,wl}var Al,xf;function yI(){if(xf)return Al;xf=1;var e=kh(),t=fI(),r=mI(),n=Ph(),a=_I(),s=nc(),o=200;function i(l,u,p){var d=-1,f=t,_=l.length,m=!0,h=[],b=h;if(p)m=!1,f=r;else if(_>=o){var T=u?null:a(l);if(T)return s(T);m=!1,f=n,b=new e}else b=u?[]:h;e:for(;++d<_;){var y=l[d],S=u?u(y):y;if(y=p||y!==0?y:0,m&&S===S){for(var w=b.length;w--;)if(b[w]===S)continue e;u&&b.push(S),h.push(y)}else f(b,S,p)||(b!==h&&b.push(S),h.push(y))}return h}return Al=i,Al}var Sl,Hf;function bI(){if(Hf)return Sl;Hf=1;var e=yI();function t(r){return r&&r.length?e(r):[]}return Sl=t,Sl}var TI=bI();const gI=xe(TI),Pc=e=>{const{nozzles:t,pipetteSpec:r,primaryNozzle:n}=e,a=r.channels;if(t==null)return a;switch(t){case c.ROW:return 12;case c.COLUMN:return 8;case c.SINGLE:return 1;case c.ALL:return a;case c.PARTIAL_COLUMN:return c.PARTIAL_NOZZLE_MAP[n];default:return a}};function II(e,t,r){const{pipetteId:n,volume:a}=e,{robotState:s,warnings:o}=r,i="labwareId"in e?e.labwareId:s.pipettes[n].entityId??"",l="wellName"in e?e.wellName:s.pipettes[n].wellName??"",{liquidState:u}=s,p=s.pipettes[n].nozzles,d=r.robotState.pipettes[n].primaryNozzle,f=t.pipetteEntities[n].spec,_=t.labwareEntities[i].def,m=_.metadata.displayCategory==="reservoir",h=Pc({pipetteSpec:f,nozzles:p,primaryNozzle:d}),{allWellsShared:b,wellsForTips:T}=bc(h,_,l);if(console.assert(gI(T).length===b?1:T.length,`expected all wells to be shared, or no wells to be shared. Got: ${JSON.stringify(T)}`),h>1&&b){const S=T[0],w=u.labware[i][S],g=a*h>pr(w);hl(w)?o.push(ul()):g&&o.push(ll());const I=g?pr(w)/h:a,L=Kt(I,w).dest;cn(h).forEach(A=>{const E=u.pipettes[n],k=A.toString(),R=E[k],B=g?dr(R,{...L,[je]:{volume:a-I}}):dr(R,L);E[k]=B}),u.labware[i][S]=Kt(a*h,u.labware[i][S]).source;return}if(h===96&&m){T.forEach(S=>{const w=u.labware[i][S],g=a*8>pr(w);hl(w)?o.push(ul()):g&&o.push(ll());const I=g?pr(w)/8:a,L=Kt(I,w).dest;cn(h).forEach(A=>{const E=u.pipettes[n],k=A.toString(),R=E[k],B=g?dr(R,{...L,[je]:{volume:a-I}}):dr(R,L);E[k]=B}),u.labware[i][S]=Kt(I*8,u.labware[i][S]).source});return}cn(h).forEach(S=>{const w=S.toString(),g=u.pipettes[n],I=g[w],L=u.labware[i][T[S]],A=Kt(a,L).dest;hl(L)?o.push(ul()):a>pr(L)&&o.push(ll()),g[w]=dr(I,A)});const y=u.labware[i];T.forEach(S=>{y[S]=Kt(a,y[S]).source}),"labwareId"in e&&(s.pipettes[n]={...s.pipettes[n],entityId:e.labwareId,wellName:l})}function Es(e){const{robotStateAndWarnings:t,invariantContext:r,entityId:n,pipetteId:a,prevLiquidState:s,useFullVolume:o,volume:i,wellName:l}=e,u=r.pipetteEntities[a].spec,p=t.robotState.pipettes[a].nozzles,d=t.robotState.pipettes[a].primaryNozzle,f=Pc({pipetteSpec:u,nozzles:p,primaryNozzle:d}),_=l??null,m=r.labwareEntities[n]!=null?r.labwareEntities[n].def:null;console.assert(!(o&&typeof i=="number"),"dispenseUpdateLiquidState takes either `volume` or `useFullVolume`, but got both"),console.assert(typeof i=="number"||o,"in dispenseUpdateLiquidState, either volume or useFullVolume are required");const{wellsForTips:h,allWellsShared:b}=m!=null&&l!=null?bc(f,m,l):{wellsForTips:null,allWellsShared:!0},T=s.labware[n]!=null?s.labware[n]:null;let y=null;s.trashBins[n]!=null?y=s.trashBins[n]:s.wasteChute[n]!=null&&(y=s.wasteChute[n]);const S=Xt(s.pipettes[a],L=>{const{...A}=L;if(o){const E=pr(A);return E>0?Kt(E,A):{source:{},dest:{}}}return Kt(i||0,A)});let w=null;if(_!=null&&T!=null)w={[_]:lt(S,(L,A)=>dr(L,A.dest),T[_])};else if(y!=null){const L=Object.values(s.pipettes[a]).reduce((A,E)=>A+(E[0]?.volume??0),0);y[0]={volume:L}}w==null&&y==null&&console.assert(!1,`expected to merge liquid to a single well with sourceId ${n}`);const g=_!=null&&T!=null&&h!=null?h.reduce((L,A,E)=>({...L,[A]:dr(S[`${E}`].dest,T[A]||{})}),{}):{},I=b?w:g;s.pipettes[a]=Xt(S,"source"),s.trashBins[n]!=null&&y!=null?Object.assign(s.trashBins[n],y):s.wasteChute[n]!=null&&y!=null?Object.assign(s.wasteChute[n],y):s.labware[n]!=null&&I!=null&&(s.labware[n]=Object.assign(T??{},I))}function EI(e,t,r){const{pipetteId:n,labwareId:a,wellName:s}=e,{robotState:o}=r;Es({pipetteId:n,entityId:a,useFullVolume:!0,wellName:s,prevLiquidState:o.liquidState,invariantContext:t,robotStateAndWarnings:r})}function wI(e,t,r){const{pipetteId:n,configurationParams:a}=e,{robotState:s}=r;s.pipettes[n].nozzles=a.style,s.pipettes[n].primaryNozzle=a.primaryNozzle}function AI(e,t,r){const{pipetteId:n,volume:a}=e,{robotState:s}=r,o="labwareId"in e?e.labwareId:s.pipettes[n].entityId??"",i="wellName"in e?e.wellName:s.pipettes[n].wellName??"",l=s.liquidState.pipettes[n],p=Object.values(l)[0]?.[je]?.volume??0,d=r.robotState.pipettes[n].primaryNozzle;if(Es({invariantContext:t,entityId:o,pipetteId:n,prevLiquidState:s.liquidState,useFullVolume:!1,volume:a,wellName:i,robotStateAndWarnings:r}),p>0){const f=r.robotState.pipettes[n].nozzles,_=t.pipetteEntities[n].spec,m=Pc({pipetteSpec:_,nozzles:f,primaryNozzle:d});Object.keys(l).slice(0,m).forEach(b=>{const T=l[b]??{};l[b]={...T,[je]:{volume:0}}})}"labwareId"in e&&(s.pipettes[n]={...s.pipettes[n],entityId:e.labwareId})}function SI(e,t,r){const{pipetteId:n,wellName:a,labwareId:s}=e,{robotState:o}=r;o.tipState.pipettes[n].hasTip=!1,o.tipState.pipettes[n].tiprackURI=null,o.pipettes[n].tiprackId=void 0;const i=o.tipState,l=t.pipetteEntities[n].spec,u=o.pipettes[n].nozzles,p=$c(u,l),d=(_,m)=>_.find(h=>h.includes(m)),f=t.labwareEntities[s].def;if(f==null||!c.getIsTiprack(f))throw new Error(`forDropTip expected ${s} to have definition and to be a tiprack`);p===c.SINGLE?i.tipracks[s][a]=Wt:p===c.COLUMN?(d(f.ordering,a)??[]).forEach(m=>i.tipracks[s][m]=Wt):p===c.ALL?l.channels===96?f.ordering.reduce((m,h)=>m.concat(h),[]).forEach(function(m){i.tipracks[s][m]=Wt}):(d(f.ordering,a)??[]).forEach(m=>i.tipracks[s][m]=Wt):l.channels===1?i.tipracks[s][a]=Wt:l.channels===96?f.ordering.reduce((m,h)=>m.concat(h),[]).forEach(function(m){i.tipracks[s][m]=Wt}):(d(f.ordering,a)??[]).forEach(m=>i.tipracks[s][m]=Wt),o.pipettes[n].entityId=s,o.pipettes[n].wellName=a}function LI(e,t,r){const{labwareId:n,liquidId:a,volumeByWell:s}=e;Object.entries(s).forEach(([o,i])=>{r.robotState.liquidState.labware[n][o][a]={volume:i}})}var Ll,jf;function OI(){if(jf)return Ll;jf=1;function e(t,r){for(var n=-1,a=t==null?0:t.length;++n<a&&r(t[n],n,t)!==!1;);return t}return Ll=e,Ll}var Ol,zf;function Nc(){if(zf)return Ol;zf=1;var e=dc(),t=ss(),r=Object.prototype,n=r.hasOwnProperty;function a(s,o,i){var l=s[o];(!(n.call(s,o)&&t(l,i))||i===void 0&&!(o in s))&&e(s,o,i)}return Ol=a,Ol}var Rl,Gf;function va(){if(Gf)return Rl;Gf=1;var e=Nc(),t=dc();function r(n,a,s,o){var i=!s;s||(s={});for(var l=-1,u=a.length;++l<u;){var p=a[l],d=o?o(s[p],n[p],p,s,n):void 0;d===void 0&&(d=n[p]),i?t(s,p,d):e(s,p,d)}return s}return Rl=r,Rl}var kl,Wf;function RI(){if(Wf)return kl;Wf=1;var e=va(),t=wa();function r(n,a){return n&&e(a,t(a),n)}return kl=r,kl}var vl,Yf;function kI(){if(Yf)return vl;Yf=1;function e(t){var r=[];if(t!=null)for(var n in Object(t))r.push(n);return r}return vl=e,vl}var Pl,Kf;function vI(){if(Kf)return Pl;Kf=1;var e=Jt(),t=ds(),r=kI(),n=Object.prototype,a=n.hasOwnProperty;function s(o){if(!e(o))return r(o);var i=t(o),l=[];for(var u in o)u=="constructor"&&(i||!a.call(o,u))||l.push(u);return l}return Pl=s,Pl}var Nl,Xf;function Cc(){if(Xf)return Nl;Xf=1;var e=Uh(),t=vI(),r=xr();function n(a){return r(a)?e(a,!0):t(a)}return Nl=n,Nl}var Cl,Zf;function PI(){if(Zf)return Cl;Zf=1;var e=va(),t=Cc();function r(n,a){return n&&e(a,t(a),n)}return Cl=r,Cl}var na={exports:{}};na.exports;var Qf;function NI(){return Qf||(Qf=1,(function(e,t){var r=Bt(),n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===n,o=s?r.Buffer:void 0,i=o?o.allocUnsafe:void 0;function l(u,p){if(p)return u.slice();var d=u.length,f=i?i(d):new u.constructor(d);return u.copy(f),f}e.exports=l})(na,na.exports)),na.exports}var Dl,Jf;function CI(){if(Jf)return Dl;Jf=1;function e(t,r){var n=-1,a=t.length;for(r||(r=Array(a));++n<a;)r[n]=t[n];return r}return Dl=e,Dl}var Ml,em;function DI(){if(em)return Ml;em=1;var e=va(),t=ac();function r(n,a){return e(n,t(n),a)}return Ml=r,Ml}var Fl,tm;function Dc(){if(tm)return Fl;tm=1;var e=Bh(),t=e(Object.getPrototypeOf,Object);return Fl=t,Fl}var ql,rm;function R_(){if(rm)return ql;rm=1;var e=Ju(),t=Dc(),r=ac(),n=Fh(),a=Object.getOwnPropertySymbols,s=a?function(o){for(var i=[];o;)e(i,r(o)),o=t(o);return i}:n;return ql=s,ql}var Ul,nm;function MI(){if(nm)return Ul;nm=1;var e=va(),t=R_();function r(n,a){return e(n,t(n),a)}return Ul=r,Ul}var Bl,am;function Mc(){if(am)return Bl;am=1;var e=Dh(),t=R_(),r=Cc();function n(a){return e(a,r,t)}return Bl=n,Bl}var $l,sm;function FI(){if(sm)return $l;sm=1;var e=Object.prototype,t=e.hasOwnProperty;function r(n){var a=n.length,s=new n.constructor(a);return a&&typeof n[0]=="string"&&t.call(n,"index")&&(s.index=n.index,s.input=n.input),s}return $l=r,$l}var Vl,om;function Fc(){if(om)return Vl;om=1;var e=Ch();function t(r){var n=new r.constructor(r.byteLength);return new e(n).set(new e(r)),n}return Vl=t,Vl}var xl,im;function qI(){if(im)return xl;im=1;var e=Fc();function t(r,n){var a=n?e(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.byteLength)}return xl=t,xl}var Hl,lm;function UI(){if(lm)return Hl;lm=1;var e=/\w*$/;function t(r){var n=new r.constructor(r.source,e.exec(r));return n.lastIndex=r.lastIndex,n}return Hl=t,Hl}var jl,um;function BI(){if(um)return jl;um=1;var e=bn(),t=e?e.prototype:void 0,r=t?t.valueOf:void 0;function n(a){return r?Object(r.call(a)):{}}return jl=n,jl}var zl,cm;function $I(){if(cm)return zl;cm=1;var e=Fc();function t(r,n){var a=n?e(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.length)}return zl=t,zl}var Gl,pm;function VI(){if(pm)return Gl;pm=1;var e=Fc(),t=qI(),r=UI(),n=BI(),a=$I(),s="[object Boolean]",o="[object Date]",i="[object Map]",l="[object Number]",u="[object RegExp]",p="[object Set]",d="[object String]",f="[object Symbol]",_="[object ArrayBuffer]",m="[object DataView]",h="[object Float32Array]",b="[object Float64Array]",T="[object Int8Array]",y="[object Int16Array]",S="[object Int32Array]",w="[object Uint8Array]",g="[object Uint8ClampedArray]",I="[object Uint16Array]",L="[object Uint32Array]";function A(E,k,R){var B=E.constructor;switch(k){case _:return e(E);case s:case o:return new B(+E);case m:return t(E,R);case h:case b:case T:case y:case S:case w:case g:case I:case L:return a(E,R);case i:return new B;case l:case d:return new B(E);case u:return r(E);case p:return new B;case f:return n(E)}}return Gl=A,Gl}var Wl,dm;function xI(){if(dm)return Wl;dm=1;var e=Jt(),t=Object.create,r=(function(){function n(){}return function(a){if(!e(a))return{};if(t)return t(a);n.prototype=a;var s=new n;return n.prototype=void 0,s}})();return Wl=r,Wl}var Yl,fm;function HI(){if(fm)return Yl;fm=1;var e=xI(),t=Dc(),r=ds();function n(a){return typeof a.constructor=="function"&&!r(a)?e(t(a)):{}}return Yl=n,Yl}var Kl,mm;function jI(){if(mm)return Kl;mm=1;var e=Aa(),t=Qt(),r="[object Map]";function n(a){return t(a)&&e(a)==r}return Kl=n,Kl}var Xl,hm;function zI(){if(hm)return Xl;hm=1;var e=jI(),t=oc(),r=ic(),n=r&&r.isMap,a=n?t(n):e;return Xl=a,Xl}var Zl,_m;function GI(){if(_m)return Zl;_m=1;var e=Aa(),t=Qt(),r="[object Set]";function n(a){return t(a)&&e(a)==r}return Zl=n,Zl}var Ql,ym;function WI(){if(ym)return Ql;ym=1;var e=GI(),t=oc(),r=ic(),n=r&&r.isSet,a=n?t(n):e;return Ql=a,Ql}var Jl,bm;function k_(){if(bm)return Jl;bm=1;var e=rc(),t=OI(),r=Nc(),n=RI(),a=PI(),s=NI(),o=CI(),i=DI(),l=MI(),u=Vh(),p=Mc(),d=Aa(),f=FI(),_=VI(),m=HI(),h=Ke(),b=cs(),T=zI(),y=Jt(),S=WI(),w=wa(),g=Cc(),I=1,L=2,A=4,E="[object Arguments]",k="[object Array]",R="[object Boolean]",B="[object Date]",F="[object Error]",te="[object Function]",de="[object GeneratorFunction]",_e="[object Map]",oe="[object Number]",Se="[object Object]",ve="[object RegExp]",ze="[object Set]",Ue="[object String]",J="[object Symbol]",Le="[object WeakMap]",Ge="[object ArrayBuffer]",Be="[object DataView]",re="[object Float32Array]",W="[object Float64Array]",Y="[object Int8Array]",P="[object Int16Array]",v="[object Int32Array]",$="[object Uint8Array]",C="[object Uint8ClampedArray]",ae="[object Uint16Array]",q="[object Uint32Array]",x={};x[E]=x[k]=x[Ge]=x[Be]=x[R]=x[B]=x[re]=x[W]=x[Y]=x[P]=x[v]=x[_e]=x[oe]=x[Se]=x[ve]=x[ze]=x[Ue]=x[J]=x[$]=x[C]=x[ae]=x[q]=!0,x[F]=x[te]=x[Le]=!1;function H(M,G,ye,$e,Xe,Ve){var pe,Ze=G&I,ft=G&L,St=G&A;if(ye&&(pe=Xe?ye(M,$e,Xe,Ve):ye(M)),pe!==void 0)return pe;if(!y(M))return M;var mt=h(M);if(mt){if(pe=f(M),!Ze)return o(M,pe)}else{var Oe=d(M),Qe=Oe==te||Oe==de;if(b(M))return s(M,Ze);if(Oe==Se||Oe==E||Qe&&!Xe){if(pe=ft||Qe?{}:m(M),!Ze)return ft?l(M,a(pe,M)):i(M,n(pe,M))}else{if(!x[Oe])return Xe?M:{};pe=_(M,Oe,Ze)}}Ve||(Ve=new e);var Re=Ve.get(M);if(Re)return Re;Ve.set(M,pe),S(M)?M.forEach(function(ie){pe.add(H(ie,G,ye,ie,M,Ve))}):T(M)&&M.forEach(function(ie,ne){pe.set(ne,H(ie,G,ye,ne,M,Ve))});var ke=St?ft?p:u:ft?g:w,Pe=mt?void 0:ke(M);return t(Pe||M,function(ie,ne){Pe&&(ne=ie,ie=M[ne]),r(pe,ne,H(ie,G,ye,ne,M,Ve))}),pe}return Jl=H,Jl}var eu,Tm;function v_(){if(Tm)return eu;Tm=1;function e(t,r,n){var a=-1,s=t.length;r<0&&(r=-r>s?0:s+r),n=n>s?s:n,n<0&&(n+=s),s=r>n?0:n-r>>>0,r>>>=0;for(var o=Array(s);++a<s;)o[a]=t[a+r];return o}return eu=e,eu}var tu,gm;function YI(){if(gm)return tu;gm=1;var e=fs(),t=v_();function r(n,a){return a.length<2?n:e(n,t(a,0,-1))}return tu=r,tu}var ru,Im;function KI(){if(Im)return ru;Im=1;var e=gn(),t=T_(),r=YI(),n=In(),a=Object.prototype,s=a.hasOwnProperty;function o(i,l){l=e(l,i);var u=-1,p=l.length;if(!p)return!0;for(;++u<p;){var d=n(l[u]);if(d==="__proto__"&&!s.call(i,"__proto__")||(d==="constructor"||d==="prototype")&&u<p-1)return!1}var f=r(i,l);return f==null||delete f[n(t(l))]}return ru=o,ru}var nu,Em;function XI(){if(Em)return nu;Em=1;var e=Tn(),t=Dc(),r=Qt(),n="[object Object]",a=Function.prototype,s=Object.prototype,o=a.toString,i=s.hasOwnProperty,l=o.call(Object);function u(p){if(!r(p)||e(p)!=n)return!1;var d=t(p);if(d===null)return!0;var f=i.call(d,"constructor")&&d.constructor;return typeof f=="function"&&f instanceof f&&o.call(f)==l}return nu=u,nu}var au,wm;function ZI(){if(wm)return au;wm=1;var e=XI();function t(r){return e(r)?void 0:r}return au=t,au}var su,Am;function QI(){if(Am)return su;Am=1;var e=Lh();function t(r){var n=r==null?0:r.length;return n?e(r,1):[]}return su=t,su}var ou,Sm;function JI(){if(Sm)return ou;Sm=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return ou=e,ou}var iu,Lm;function P_(){if(Lm)return iu;Lm=1;var e=JI(),t=Math.max;function r(n,a,s){return a=t(a===void 0?n.length-1:a,0),function(){for(var o=arguments,i=-1,l=t(o.length-a,0),u=Array(l);++i<l;)u[i]=o[a+i];i=-1;for(var p=Array(a+1);++i<a;)p[i]=o[i];return p[a]=s(u),e(n,this,p)}}return iu=r,iu}var lu,Om;function eE(){if(Om)return lu;Om=1;function e(t){return function(){return t}}return lu=e,lu}var uu,Rm;function tE(){if(Rm)return uu;Rm=1;var e=eE(),t=Wh(),r=ba(),n=t?function(a,s){return t(a,"toString",{configurable:!0,enumerable:!1,value:e(s),writable:!0})}:r;return uu=n,uu}var cu,km;function rE(){if(km)return cu;km=1;var e=800,t=16,r=Date.now;function n(a){var s=0,o=0;return function(){var i=r(),l=t-(i-o);if(o=i,l>0){if(++s>=e)return arguments[0]}else s=0;return a.apply(void 0,arguments)}}return cu=n,cu}var pu,vm;function N_(){if(vm)return pu;vm=1;var e=tE(),t=rE(),r=t(e);return pu=r,pu}var du,Pm;function nE(){if(Pm)return du;Pm=1;var e=QI(),t=P_(),r=N_();function n(a){return r(t(a,void 0,e),a+"")}return du=n,du}var fu,Nm;function aE(){if(Nm)return fu;Nm=1;var e=Ea(),t=k_(),r=KI(),n=gn(),a=va(),s=ZI(),o=nE(),i=Mc(),l=1,u=2,p=4,d=o(function(f,_){var m={};if(f==null)return m;var h=!1;_=e(_,function(T){return T=n(T,f),h||(h=T.length>1),T}),a(f,i(f),m),h&&(m=t(m,l|u|p,s));for(var b=_.length;b--;)r(m,_[b]);return m});return fu=d,fu}var sE=aE();const oE=xe(sE),ju="TOUCHED_PIPETTABLE_LABWARE";var mu,Cm;function iE(){if(Cm)return mu;Cm=1;var e=uc();function t(r,n){return e(r,n)}return mu=t,mu}var lE=iE();const uE=xe(lE),ws=e=>{const{node:t,stack:r=[],robotState:n,memo:a=new Map}=e;let s=r;if(!(typeof t=="object"&&"labwareId"in t))return s=[...r,t],a.set(t,s),{stack:s,memo:a};const{labwareId:o}=t,i=n.labware[o];if(i!=null&&i.stackedOnNode!=null){const{stack:l,memo:u}=ws({node:i.stackedOnNode,stack:[...r,t],robotState:n,memo:a});C_(a,u),s=l,a.set(t,s)}return{stack:s,memo:a}},cE=e=>{const{node:t,robotState:r,deckDef:n,deckConfiguration:a}=e,{stack:s}=ws({node:t,robotState:r}),{cutoutFixtures:o}=n,i=s.find(l=>typeof l=="object"&&"addressableAreaName"in l);if(i!=null&&typeof i=="object"&&"addressableAreaName"in i){const{addressableAreaName:l}=i;for(const{id:u,providesAddressableAreas:p}of o){const[d]=Object.entries(p).find(([f,_])=>_.includes(l))??[];if(d!=null){const f=a.find(({cutoutId:T})=>T===d),{cutoutFixtureId:_,cutoutId:m}=f,h=_===u&&m===d,b=Object.entries(r.modules).find(([T,{slot:y}])=>c.FLEX_CUTOUT_BY_SLOT_ID[y]===m);if(h&&b!=null)return b[0]}}}return null},C_=(e,t)=>{t.forEach((r,n)=>{e.set(n,r)})},pE=(e,t)=>e.some(r=>uE(r,t)),D_=e=>{const{labwareId:t,robotState:r}=e,n=new Map,a={labwareId:t};let s=[];for(const[o,{stackedOnNode:i}]of Object.entries(r.labware)){const l={labwareId:o};if(i==null)continue;let u;const p=n.get(l);if(p!=null)u=p;else{const{stack:d,memo:f}=ws({node:l,robotState:r,memo:n});if(C_(n,f),!pE(d,a))continue;n.set(l,d),u=d}u.length>s.length&&(s=u)}return s},M_=e=>{const t=[],r=new Set;for(const n of Object.keys(e.labware)){if(r.has(n))continue;const a=D_({labwareId:n,robotState:e});a.forEach(s=>{typeof s=="object"&&"labwareId"in s&&r.add(s.labwareId)}),t.push(a)}return t},qc=e=>{const{moduleId:t,robotState:r,moduleEntities:n,deckDef:a}=e,s=r.modules[t],o=n[t];if(s==null||o==null)return null;const{slot:i}=s,{model:l}=o,u=c.getAddressableAreaNamesFromLoadedModule(l,i,a);return u.length===0?null:u[0]},dE=e=>{const{location:t,robotState:r,moduleEntities:n,deckDef:a}=e;if(t==="offDeck"||t==="systemLocation"||t==="wasteChuteLocation")return null;if("slotName"in t)return t.slotName;if("addressableAreaName"in t)return t.addressableAreaName;if("moduleId"in t){const{moduleId:s}=t;return qc({moduleId:s,robotState:r,moduleEntities:n,deckDef:a})}return null},F_=e=>{const{deckConfiguration:t,deckDefinition:r}=e;return t.reduce((n,{cutoutFixtureId:a,cutoutId:s})=>((r.cutoutFixtures.find(({id:i})=>a===i)?.providesAddressableAreas[s]??[]).forEach(i=>{n.add(i)}),n),new Set)},fE=e=>{const{robotState:t,deckConfiguration:r,deckDefinition:n,moduleEntities:a}=e,s=F_({deckConfiguration:r,deckDefinition:n}),o=new Set(s),i=M_(t);for(const l of i){const u=Oc(l);if(typeof u=="object"&&"addressableAreaName"in u){const{addressableAreaName:p}=u;o.delete(p)}if(typeof u=="object"&&"slotName"in u){const{slotName:p}=u;o.delete(p)}if(typeof u=="object"&&"moduleId"in u){const{moduleId:p}=u,d=qc({moduleId:p,robotState:t,moduleEntities:a,deckDef:n});d!=null&&o.delete(d)}}return o},mE=e=>{const t=e.toLowerCase();return t.includes("chute")||t.includes("waste")||t.startsWith("gripper")||t==="96channelwastechute"},q_=e=>{const{stack:t,subjectLabwareId:r,moduleEntities:n,labwareEntityIds:a,modules:s}=e;if(t.length===0||t[0]!==r||t.length<2)return;const o=t[1];if(o===He){const u=t[2];return u==null?void 0:{kind:"inStackerHopper",moduleId:u}}if(n[o]!=null)return{moduleId:o};if(a.has(o))return{labwareId:o};if(o==="offDeck")return"offDeck";if(o==="systemLocation")return"systemLocation";if(o==="wasteChuteLocation")return"wasteChuteLocation";if(mE(o))return{addressableAreaName:o};const i=__(o,s,n)??o;if(Object.entries(s).some(([u,p])=>n[u]?.type===c.FLEX_STACKER_MODULE_TYPE&&p.slot===i)){const u=bs(i);if(u!=null)return{addressableAreaName:u}}return{slotName:o}},hE=e=>typeof e=="object"&&e!==null&&"kind"in e&&e.kind==="inStackerHopper",_E=e=>typeof e!="object"||e===null?!1:!hE(e),yE=(e,t)=>{const{id:r,def:n}=e,{id:a,def:s}=t,o=n.dimensions.xDimension,i=n.dimensions.yDimension,l=s.dimensions.xDimension,u=s.dimensions.yDimension;return o>l&&i>u?{containerLabwareId:r,containedLabwareId:a}:l>o&&u>i?{containerLabwareId:a,containedLabwareId:r}:null},Uc=(e,t)=>{const r=new Map;for(const a of Object.keys(e)){const s=e[a].stackedOnNode;if(s==null||!_E(s))continue;const o=JSON.stringify(s),i=r.get(o)??[];i.push(a),r.set(o,i)}const n={};for(const a of r.values()){if(a.length!==2)continue;const[s,o]=a,i=t[s],l=t[o];if(i==null||l==null)continue;const u=yE(i,l);if(u==null)continue;const{containerLabwareId:p,containedLabwareId:d}=u;n[p]=d}return Object.keys(n).length===0?e:Xt(e,(a,s)=>n[s]!=null?{...a,contains:n[s]}:a)},bE=(e,t,r)=>{const n=Object.keys(e.labware),a=new Set(n);let s=Xt(e.labware,(o,i)=>{const l=o.stackedOnNode??q_({stack:o.stack,subjectLabwareId:i,moduleEntities:t,labwareEntityIds:a,modules:e.modules});return l!=null?{...o,stackedOnNode:l}:{...o}});return s=Uc(s,r),{...e,labware:s}};function TE(e,t,r){const{labwareId:n,newLocation:a}=e,{robotState:s}=r,{labwareEntities:o}=t,{modules:i,labware:l}=s;if(l[n]==null)return;const u=z(l[n].stack),p=Ec(l,u,n),d=p.indexOf(n),f=p.slice(0,d+1),_=c.getIsLid(o[n].def);let m=!1;const h=Object.entries(i).find(([A,{slot:E}])=>{const{type:k}=t.moduleEntities[A]??{};return k===c.FLEX_STACKER_MODULE_TYPE&&E===u})??null,b=h!=null&&h[1].moduleState.type===c.FLEX_STACKER_MODULE_TYPE?Yt.map(A=>h[1].moduleState.labwareOnShuttle?.[A]).filter(A=>A!=null):[],T=b.includes(n)?b.slice(0,b.indexOf(n)+1):[];if(h!=null&&h[1].moduleState.type===c.FLEX_STACKER_MODULE_TYPE){const A=h[1].moduleState,E=Yt.findIndex(k=>A.labwareOnShuttle?.[k]===n);if(E!==-1&&A.labwareOnShuttle!=null)for(const k of Yt.slice(E,Yt.length))if(k==="primaryLabwareId"){A.labwareOnShuttle=null;break}else A.labwareOnShuttle[k]=null}const y=Object.entries(i).find(([A,{slot:E}])=>{const{type:k}=t.moduleEntities[A]??{};return k===c.FLEX_STACKER_MODULE_TYPE&&typeof a=="object"&&("moduleId"in a&&a.moduleId===A||"slotName"in a&&E===a.slotName)})??null,[S,w]=y??[];if(S!=null&&w!=null){const A=T.length>0?T:ys(l,u),E=A.indexOf(n),k=w.moduleState;if(E!==-1){const R=A.slice(0,E+1).toReversed();if(k.labwareOnShuttle==null&&(k.labwareOnShuttle={primaryLabwareId:"",adapterLabwareId:null,lidLabwareId:null}),R.length===3)for(let B=0;B<Yt.length;B++){const F=Yt[B];k.labwareOnShuttle[F]=R[B]}else if(R.length===2){const B=R.some(F=>t.labwareEntities[F].def.allowedRoles?.some(te=>te==="lid"))?["primaryLabwareId","lidLabwareId"]:["adapterLabwareId","primaryLabwareId"];for(let F=0;F<B.length;F++){const te=B[F];k.labwareOnShuttle[te]=R[F]}}else R.length===1&&(k.labwareOnShuttle.primaryLabwareId=R[0])}}const g=[];if(c.locationIsOffDeck(a))g.push(a);else if("moduleId"in a)i[a.moduleId].moduleState.type===c.FLEX_STACKER_MODULE_TYPE?g.push(i[a.moduleId].slot):g.push(a.moduleId,i[a.moduleId].slot);else if("slotName"in a){const{slotName:A}=a;A in l?(m=c.getIsPipettableLabware(o[A].def),g.push(...l[A].stack)):g.push(A)}else if("labwareId"in a){const A=a.labwareId;m=c.getIsPipettableLabware(o[A].def);const E=l[A].stack;g.push(...E)}else"addressableAreaName"in a&&g.push(a.addressableAreaName);f.forEach((A,E)=>{if(l[A]!=null){const k=f.slice(E+1);s.labware[A]={...s.labware[A],stack:[A,...k,...g],..._&&m?{sterility:ju}:{}}}});const I=typeof a=="object"&&"labwareId"in a&&c.getIsPipettableLabware(o[a.labwareId].def);let L=a;if(typeof a=="object"&&a!==null&&"moduleId"in a&&i[a.moduleId].moduleState.type===c.FLEX_STACKER_MODULE_TYPE){const A=bs(i[a.moduleId].slot);A!=null&&(L={addressableAreaName:A})}s.labware[n].stackedOnNode=L,I&&(s.labware[n].sterility=ju),s.labware=Uc(Xt(s.labware,A=>oE(A,"contains")),o)}function gE(e,t,r){const{pipetteId:n,addressableAreaName:a}=e,{wasteChuteEntities:s,trashBinEntities:o}=t,i=c.WASTE_CHUTE_ADDRESSABLE_AREAS.includes(a),l=Object.values(o).find(d=>d.location===o_(a))?.id,u=i?Object.values(s)[0].id:l,{robotState:p}=r;p.pipettes[n]={...p.pipettes[n],entityId:u}}function IE(e,t,r){const{pipetteId:n,labwareId:a,wellName:s}=e,{robotState:o}=r;o.pipettes[n]={...o.pipettes[n],entityId:a,wellName:s}}function EE(e,t,r){const{pipetteId:n,labwareId:a,wellName:s}=e,o=t.pipetteEntities[n].spec,i=t.labwareEntities[a].def;if(!c.getIsTiprack(i))throw new Error(`forPickUpTip expected ${a} to be a tiprack`);const l=r.robotState.tipState,u=r.robotState.pipettes[n].nozzles,p=r.robotState.pipettes[n].primaryNozzle,d=$c(u,o),f=(h,b)=>h.find(T=>T.includes(b)),_=(h,b)=>{const T=h.findIndex(S=>S.includes(b));if(T===-1)return null;const y=h[T].indexOf(b);return h.map(S=>S[y])},m=(h,b)=>{const T=c.PARTIAL_NOZZLE_MAP[p],y=h.findIndex(L=>L.includes(b)),S=h[y].indexOf(b),w=h[y];if(w.length-S<T){const L=w.length-T;return w.slice(L,w.length)}const I=S+T;return w.slice(S,Math.min(I,w.length))};if(l.pipettes[n].hasTip=!0,l.pipettes[n].tiprackURI=a,d===c.SINGLE)l.tipracks[a][s]=se;else if(d===c.PARTIAL_COLUMN&&p){const h=m(i.ordering,s);h==null?console.error(`Invalid primary well for tip pick up for partial config: ${s}`):h.forEach(function(b){l.tipracks[a][b]=se})}else if(d===c.COLUMN){const h=f(i.ordering,s);h==null&&console.error(`Invalid primary well for tip pickup: ${s}`),h?.forEach(function(b){l.tipracks[a][b]=se})}else if(d===c.ROW){const h=_(i.ordering,s);h==null&&console.error("Invalid primary well for tip pickup: "+s),h?.forEach(function(b){l.tipracks[a][b]=se})}else if(d===c.ALL)if(o.channels===96)i.ordering.reduce((b,T)=>b.concat(T),[]).forEach(function(b){l.tipracks[a][b]=se});else{const h=f(i.ordering,s);h==null&&console.error(`Invalid primary well for tip pickup: ${s}`),h?.forEach(function(b){l.tipracks[a][b]=se})}else if(o.channels===1)l.tipracks[a][s]=se;else if(o.channels===96)i.ordering.reduce((b,T)=>b.concat(T),[]).forEach(function(b){l.tipracks[a][b]=se});else{const h=f(i.ordering,s);h==null&&console.error(`Invalid primary well for tip pickup: ${s}`),h?.forEach(function(b){l.tipracks[a][b]=se})}r.robotState.pipettes[n].tiprackId=a,r.robotState.pipettes[n].tipWell=s}const wE={clean:ga,empty:se,used:Wt};function AE(e,t,r){const{labwareId:n,wellNames:a,tipWellState:s="clean"}=e,o=wE[s],i=r.robotState.tipState.tipracks[n];i!=null&&a.forEach(l=>{i[l]=o})}const jr=(e,t)=>{const r=At(e,t);return r.type===c.THERMOCYCLER_MODULE_TYPE?r:(console.error(`Thermocycler state updater expected ${t} moduleState to be thermocycler, but it was ${r.type}`),{})},SE=(e,t,r)=>{const{moduleId:n,celsius:a}=e,{robotState:s}=r,o=jr(s,n);o.currentBlockActivity={type:"blockTargetTemp",blockTargetTemp:a}},LE=(e,t,r)=>{const{moduleId:n,celsius:a}=e,{robotState:s}=r,o=jr(s,n);o.lidTargetTemp=a},OE=(e,t,r)=>{},RE=(e,t,r)=>{},kE=(e,t,r)=>{},vE=(e,t,r)=>{const{moduleId:n}=e,{robotState:a}=r,s=jr(a,n);s.currentBlockActivity={type:"blockDeactivated"}},PE=(e,t,r)=>{const{moduleId:n}=e,{robotState:a}=r,s=jr(a,n);s.lidTargetTemp=null},NE=(e,t,r)=>{const{moduleId:n}=e,{robotState:a}=r,s=jr(a,n);s.lidOpen=!1},CE=(e,t,r)=>{const{moduleId:n}=e,{robotState:a}=r,s=jr(a,n);s.lidOpen=!0},DE=(e,t,r)=>{const{profile:n,...a}=e;U_({profileElements:n,...a},t,r)},U_=(e,t,r)=>{const n=NaN+D();B_({...e,taskId:n},t,r),$_(n,r,c.THERMOCYCLER_MODULE_TYPE)},B_=(e,t,r)=>{const{moduleId:n,taskId:a,profileElements:s}=e,{robotState:o}=r,i=jr(o,n);i.currentBlockActivity={type:"profile",profileElements:s,taskId:a??null},i.numProfilesStarted++},ME=e=>{if(e.currentBlockActivity.type==="profile"){const t=FE(e.currentBlockActivity.profileElements);return e.currentBlockActivity=t!=null?{type:"blockTargetTemp",blockTargetTemp:t}:{type:"blockDeactivated"},!0}else return!1};function FE(e){const t=Oc(Vc(e));return t!=null?t.celsius:null}const qE=(e,t,r)=>{const{moduleId:n}=e,{robotState:a}=r,s=st(a,n);s!=null&&(s.ventStatus=ns)},UE=(e,t,r)=>{const{moduleId:n}=e,{robotState:a}=r,s=st(a,n);s!=null&&(s.ventStatus=Ia)},BE=(e,t,r)=>{const{moduleId:n,gaugePressure:a,duration:s,ventAfter:o=!0,taskId:i}=e,{robotState:l}=r,u=st(l,n);u!=null&&(s==null||i==null?u.currentPumpActivity={type:"indefiniteHold",mode:Mu,targetPressure:a}:(u.currentPumpActivity={type:"timedHold",mode:Mu,targetPressure:a,durationSeconds:s,taskId:i,ventAfter:o},u.numPumpActivitiesStarted++),u.ventStatus=Ia)},$E=(e,t,r)=>{const{moduleId:n,percentPower:a,duration:s,ventAfter:o=!0,taskId:i}=e,{robotState:l}=r,u=st(l,n);u!=null&&(s==null||i==null?u.currentPumpActivity={type:"indefiniteHold",mode:Du,targetPower:a}:(u.currentPumpActivity={type:"timedHold",mode:Du,targetPower:a,durationSeconds:s,taskId:i,ventAfter:o},u.numPumpActivitiesStarted++),u.ventStatus=Ia)},VE=(e,t,r)=>{const{moduleId:n}=e,{robotState:a}=r,s=st(a,n);s!=null&&(s.currentPumpActivity={type:"pumpDeactivated"},s.ventStatus=ns)},xE=(e,t,r)=>{const{moduleId:n,profile:a,taskId:s,ventAfter:o=!0}=e,{robotState:i}=r,l=st(i,n);l==null||s==null||(l.currentPumpActivity={type:"profile",profileElements:a,taskId:s,ventAfter:o},l.numPumpActivitiesStarted++)},HE=e=>{if(e.currentPumpActivity.type==="timedHold"||e.currentPumpActivity.type==="profile"){const t=e.currentPumpActivity.ventAfter;return e.currentPumpActivity={type:"pumpDeactivated"},e.ventStatus=t?ns:Ia,!0}return!1};function jE(e,t,r){for(const n of e.task_ids)$_(n,r)||r.warnings.push(Tg())}const $_=(e,t,r)=>{const{robotState:n}=t,a=Object.values(n.modules).find(s=>{if(r&&s.moduleState.type!==r)return!1;const o=s.moduleState.type==="thermocyclerModuleType"&&s.moduleState.currentBlockActivity.type==="profile"&&s.moduleState.currentBlockActivity.taskId===e,i=s.moduleState.type==="vacuumModuleType"&&(s.moduleState.currentPumpActivity.type==="timedHold"||s.moduleState.currentPumpActivity.type==="profile")&&s.moduleState.currentPumpActivity.taskId===e;return o||i});return a==null?!1:a.moduleState.type==="thermocyclerModuleType"?ME(a.moduleState):a.moduleState.type==="vacuumModuleType"?HE(a.moduleState):(console.log(`unexpected module type with task: ${a.moduleState.type}`),!1)},On=(e,t)=>{const r=At(e,t);return r.type===c.HEATERSHAKER_MODULE_TYPE?r:(console.error(`Heater-Shaker state updater expected ${t} moduleState to be heaterShaker, but it was ${r.type}`),{})},zE=(e,t,r)=>{const{robotState:n}=r,{moduleId:a,celsius:s}=e,o=On(n,a);o.targetTemp=s},GE=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=On(n,a);s.targetTemp=null},WE=(e,t,r)=>{const{robotState:n}=r,{moduleId:a,rpm:s}=e,o=On(n,a);o.targetSpeed=s},YE=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=On(n,a);s.targetSpeed=null},KE=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=On(n,a);s.latchOpen=!0},XE=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=On(n,a);s.latchOpen=!1},ZE=(e,t,r)=>{const{pipetteId:n}=e,{robotState:a}=r,s=a.pipettes[n].entityId??"";Es({invariantContext:t,pipetteId:n,prevLiquidState:a.liquidState,useFullVolume:!0,robotStateAndWarnings:r,entityId:s})},QE=(e,t,r)=>{const{pipetteId:n}=e,{robotState:a}=r,s=a.pipettes[n].entityId??"";a.tipState.pipettes[n]={hasTip:!1,tiprackURI:null},Es({invariantContext:t,prevLiquidState:a.liquidState,pipetteId:n,useFullVolume:!0,robotStateAndWarnings:r,entityId:s}),a.pipettes[n].tiprackId=void 0};function V_(e,t){e.type===c.MAGNETIC_MODULE_TYPE&&(e.engaged=t)}function JE(e,t,r){const{moduleId:n}=e,{robotState:a}=r,s=At(a,n);V_(s,!0)}function ew(e,t,r){const{moduleId:n}=e,{robotState:a}=r,s=At(a,n);V_(s,!1)}const hu=(e,t)=>{if(t==null)return console.error("expected to find defURI but could not in getLabwareByDefURI"),null;const r=e.findIndex(a=>a.labwareDefURI===t);if(r===-1)return null;const[n]=e.splice(r,1);return n.id},x_=(e,t,r,n)=>{const a=e.labwareInHopper??[];t.forEach(s=>{const{primaryLabwareId:o,adapterLabwareId:i,lidLabwareId:l}=s;r.labware[o]={stack:[o,...l!=null?[l]:[],...n]},i!=null&&(r.labware[i]={stack:[i,o,...l!=null?[l]:[],...n]}),l!=null&&(r.labware[l]={stack:[l,...n]}),a.push({primaryLabwareId:o,adapterLabwareId:i??null,lidLabwareId:l??null})}),e.labwareInHopper=a},H_=(e,t,r,n,a,s,o,i)=>{const u=Object.entries(e.labware).filter(([d,f])=>f[s]===t[s]).map(([d])=>d).map(d=>r[d]),p=[];for(let d=0;d<n;d++){const f=hu(u,t.storedLabwareDetails?.primaryLabwareURI),_=o!=null?hu(u,t.storedLabwareDetails?.adapterLabwareURI):null,m=i!=null?hu(u,t.storedLabwareDetails?.lidLabwareURI):null;f!=null&&(e.labware[f]={stack:[f,...m!=null?[m]:[],...a]},_!=null&&(e.labware[_]={stack:[_,f,...m!=null?[m]:[],...a]}),m!=null&&(e.labware[m]={stack:[m,...a]}),p.push({primaryLabwareId:f,adapterLabwareId:_,lidLabwareId:m})),t.labwareInHopper=p}},tw=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=Object.entries(n.labware).filter(([,i])=>i.stack.includes(He)&&i.stack.includes(a)),o=dt(n,a);o!=null&&o.labwareInHopper!=null&&(e.count!=null?o.labwareInHopper=o.labwareInHopper.slice(0,e.count):o.labwareInHopper=[]),s.forEach(([i])=>{n.labware[i]={...n.labware[i],stack:[i,c.SYSTEM_LOCATION]}})},rw=(e,t,r)=>{const{robotState:n}=r,{labwareEntities:a}=t,{moduleId:s,labware:o}=e,i=n.modules[s].slot,l=dt(n,s);if(l==null||l.storedLabwareDetails==null)return;const{primaryLabwareURI:u,adapterLabwareURI:p,lidLabwareURI:d}=l.storedLabwareDetails,f=[];for(const b of o){const T=a[b].labwareDefURI;if(T===u)f.push({primaryLabwareId:b,adapterLabwareId:null,lidLabwareId:null});else if(T===p){const y=f[f.length-1];y&&(y.adapterLabwareId=b)}else if(T===d){const y=f[f.length-1];y&&(y.lidLabwareId=b)}}const _=[He,s,i];for(const b of f){const T=[b.adapterLabwareId,b.primaryLabwareId,b.lidLabwareId,..._].filter(S=>S!=null);n.labware[b.primaryLabwareId]={...n.labware[b.primaryLabwareId],stack:T.slice(T.indexOf(b.primaryLabwareId))},b.adapterLabwareId!=null&&(n.labware[b.adapterLabwareId]={...n.labware[b.adapterLabwareId],stack:T.slice(T.indexOf(b.adapterLabwareId))}),b.lidLabwareId!=null&&(n.labware[b.lidLabwareId]={...n.labware[b.lidLabwareId],stack:T.slice(T.indexOf(b.lidLabwareId))});let y=null;for(const S of T)a[S]!=null&&(y==null?n.labware[S].stackedOnNode={kind:"inStackerHopper",moduleId:s}:n.labware[S].stackedOnNode={labwareId:y},y=S)}const m=l.labwareInHopper??[],h=f.map(({primaryLabwareId:b,adapterLabwareId:T,lidLabwareId:y})=>({primaryLabwareId:b,adapterLabwareId:T,lidLabwareId:y}));l.labwareInHopper=[...m,...h]},nw=(e,t,r)=>{const{robotState:n}=r,{labwareEntities:a}=t,{moduleId:s,primaryLabware:o,initialCount:i,adapterLabware:l,lidLabware:u,initialStoredLabware:p}=e,d=n.modules[s].slot,f=dt(n,s),_=[He,s,d];f!=null&&(f.storedLabwareDetails={primaryLabwareURI:`${o.namespace}/${o.loadName}/${o.version}`,adapterLabwareURI:l!=null?`${l.namespace}/${l.loadName}/${l.version}`:null,lidLabwareURI:u!=null?`${u.namespace}/${u.loadName}/${u.version}`:null},i!=null?H_(n,f,a,i,_,"setStoredLabwareCount",l?.loadName,u?.loadName):p!=null&&x_(f,p,n,_),f.setStoredLabwareCount=(f?.setStoredLabwareCount??0)+1)},aw=(e,t,r)=>{const{robotState:n}=r,{moduleId:a,labware:s}=e,{labwareEntities:o}=t,i=n.modules[a].slot,l=dt(n,a);if(l==null)return;const u=s.map(g=>g.split(":")[1]),p=new Set(u),d=Array.from(p),f=d.find(g=>Object.values(o).find(I=>I.labwareDefURI===g&&!I.def.allowedRoles?.includes("lid")&&!I.def.allowedRoles?.includes("adapter"))),_=d.find(g=>Object.values(o).find(I=>I.labwareDefURI===g&&I.def.allowedRoles?.includes("adapter"))),m=d.find(g=>Object.values(o).find(I=>I.labwareDefURI===g&&I.def.allowedRoles?.includes("lid")));if(f==null)throw new Error(`expected to find primaryLabwareURI for storedLabwareDetails but could not with labware ${s}`);l.storedLabwareDetails={primaryLabwareURI:f,adapterLabwareURI:_??null,lidLabwareURI:m??null};const h=[];for(const g of s){const I=o[g].labwareDefURI;if(I===f)h.push({primary:g,adapter:null,lid:null});else if(I===_){const L=h[h.length-1];L&&(L.adapter=g)}else if(I===m){const L=h[h.length-1];L&&(L.lid=g)}}const b=[He,a,i];for(const g of h){const I=[g.adapter,g.primary,g.lid,...b].filter(L=>L!=null);n.labware[g.primary]={...n.labware[g.primary],stack:I.slice(I.indexOf(g.primary))},g.adapter!=null&&(n.labware[g.adapter]={...n.labware[g.adapter],stack:I.slice(I.indexOf(g.adapter))}),g.lid!=null&&(n.labware[g.lid]={...n.labware[g.lid],stack:I.slice(I.indexOf(g.lid))})}const T=l.labwareInHopper??[],y=h.map(g=>({primaryLabwareId:g.primary,adapterLabwareId:g.adapter,lidLabwareId:g.lid})),S=new Map(T.map(g=>[g.primaryLabwareId,g])),w=[];for(const g of y)w.push(g),S.delete(g.primaryLabwareId);for(const g of T)S.has(g.primaryLabwareId)&&w.push(g);l.labwareInHopper=w},sw=(e,t,r)=>{const{robotState:n}=r,{moduleId:a,count:s,labwareToStore:o}=e,{labwareEntities:i}=t,l=n.modules[a].slot,u=dt(n,a),p=[He,a,l];if(u!=null){const d=u.storedLabwareDetails?.adapterLabwareURI,f=u.storedLabwareDetails?.lidLabwareURI;s!=null?H_(n,u,i,s,p,"fillCount",d,f):o!=null&&x_(u,o,n,p),u.fillCount=(u?.fillCount??0)+1}},ow=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=dt(n,a),o=n.modules[a].slot;if(s!=null){const{labwareInHopper:i,labwareOnShuttle:l}=s;if(i!=null&&i.length>0&&l==null){const u=i[0];s.labwareOnShuttle=u,i.shift();const p=[o];let d=null;for(const f of Yt){const _=u[f];if(_!=null){if(p.unshift(_),n.labware[_].stack=[...p],d==null){const m=bs(o);m!=null?n.labware[_].stackedOnNode={addressableAreaName:m}:console.warn(`Could not find an addressable area for retrieved labware in stacker module ${a} at slot ${o}`)}else n.labware[_].stackedOnNode={labwareId:d};d=_}}}}},iw=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=dt(n,a),o=n.modules[a].slot;if(s!=null){const{labwareOnShuttle:i}=s;if(i!=null){s.labwareInHopper=[i,...s.labwareInHopper??[]],s.labwareOnShuttle=null;let l=null;for(const u of Yt){const p=i[u];p!=null&&(n.labware[p].stack=[p,He,a,o],l==null?(n.labware[p].stackedOnNode={kind:"inStackerHopper",moduleId:a},l=p):n.labware[p].stackedOnNode={labwareId:l})}s.storedLabwareDetails==null&&(s.storedLabwareDetails={primaryLabwareURI:t.labwareEntities[i.primaryLabwareId].labwareDefURI,adapterLabwareURI:i.adapterLabwareId!=null?t.labwareEntities[i.adapterLabwareId].labwareDefURI:null,lidLabwareURI:i.lidLabwareId!=null?t.labwareEntities[i.lidLabwareId].labwareDefURI:null})}}};function j_(e,t,r){e.type===c.TEMPERATURE_MODULE_TYPE&&(e.targetTemperature=t,e.status=r)}function lw(e,t,r){const{robotState:n}=r,{moduleId:a,celsius:s}=e,o=At(n,a);j_(o,s,Zu)}function uw(e,t,r){const{robotState:n}=r,{moduleId:a,celsius:s}=e,o=At(n,a);o.type===c.TEMPERATURE_MODULE_TYPE&&s===o.targetTemperature&&(o.status=Xu)}function cw(e,t,r){const{robotState:n}=r,{moduleId:a}=e,s=At(n,a);j_(s,null,Ta)}function z_(e,t,r){if(!e)throw new Error("undefined command passed to getNextRobotStateAndWarning");switch(e.commandType){case"aspirateWhileTracking":case"aspirate":case"aspirateInPlace":if(e.meta?.isAirGap===!0)break;II(e.params,t,r);break;case"airGapInPlace":oI(e.params,t,r);break;case"dispenseWhileTracking":case"dispense":case"dispenseInPlace":if(e.meta?.isAirGap===!0)break;AI(e.params,t,r);break;case"blowout":EI(e.params,t,r);break;case"dropTip":SI(e.params,t,r);break;case"pickUpTip":EE(e.params,t,r);break;case"setTipState":AE(e.params,t,r);break;case"magneticModule/engage":JE(e.params,t,r);break;case"magneticModule/disengage":ew(e.params,t,r);break;case"moveLabware":TE(e.params,t,r);break;case"waitForTasks":jE(e.params,t,r);break;case"flexStacker/setStoredLabware":nw(e.params,t,r);break;case"flexStacker/setStoredLabwareItems":aw(e.params,t,r);break;case"flexStacker/prepareShuttle":case"flexStacker/closeLatch":case"flexStacker/openLatch":break;case"flexStacker/empty":tw(e.params,t,r);break;case"flexStacker/fill":sw(e.params,t,r);break;case"flexStacker/fillItems":rw(e.params,t,r);break;case"flexStacker/retrieve":ow(e.params,t,r);break;case"flexStacker/store":iw(e.params,t,r);break;case"touchTip":case"configureForVolume":case"loadPipette":case"loadLabware":case"loadModule":case"home":case"moveRelative":case"moveToSlot":case"moveToCoordinates":case"savePosition":case"waitForResume":case"waitForDuration":case"pause":case"delay":case"custom":case"comment":case"captureImage":case"prepareToAspirate":case"liquidProbe":case"loadLiquidClass":case"loadLidStack":case"loadLid":case"getTipPresence":case"identifyModule":case"getNextTip":case"retractAxis":case"sealPipetteToTip":case"tryLiquidProbe":case"unsealPipetteFromTip":case"verifyTipPresence":case"pressureDispense":case"createTimer":break;case"moveToAddressableArea":case"moveToAddressableAreaForDropTip":gE(e.params,t,r);break;case"moveToWell":IE(e.params,t,r);break;case"loadLiquid":LI(e.params,t,r);break;case"dropTipInPlace":QE(e.params,t,r);break;case"blowOutInPlace":ZE(e.params,t,r);break;case"configureNozzleLayout":wI(e.params,t,r);break;case"temperatureModule/setTargetTemperature":lw(e.params,t,r);break;case"temperatureModule/deactivate":cw(e.params,t,r);break;case"temperatureModule/waitForTemperature":uw(e.params,t,r);break;case"thermocycler/setTargetBlockTemperature":SE(e.params,t,r);break;case"thermocycler/setTargetLidTemperature":LE(e.params,t,r);break;case"thermocycler/waitForBlockTemperature":OE(e.params);break;case"thermocycler/waitForLidTemperature":RE(e.params);break;case"thermocycler/deactivateBlock":vE(e.params,t,r);break;case"thermocycler/deactivateLid":PE(e.params,t,r);break;case"thermocycler/closeLid":NE(e.params,t,r);break;case"thermocycler/openLid":CE(e.params,t,r);break;case"thermocycler/runProfile":DE(e.params,t,r);break;case"thermocycler/runExtendedProfile":U_(e.params,t,r);break;case"thermocycler/startRunExtendedProfile":B_(e.params,t,r);break;case"thermocycler/awaitProfileComplete":kE(e.params);break;case"heaterShaker/deactivateHeater":GE(e.params,t,r);break;case"heaterShaker/setTargetTemperature":zE(e.params,t,r);break;case"heaterShaker/setAndWaitForShakeSpeed":WE(e.params,t,r);break;case"heaterShaker/deactivateShaker":YE(e.params,t,r);break;case"heaterShaker/openLabwareLatch":KE(e.params,t,r);break;case"heaterShaker/closeLabwareLatch":XE(e.params,t,r);break;case"heaterShaker/waitForTemperature":break;case"absorbanceReader/openLid":nI(e.params,t,r);break;case"absorbanceReader/closeLid":aI(e.params,t,r);break;case"absorbanceReader/initialize":sI(e.params,t,r);break;case"absorbanceReader/read":break;case"vacuumModule/startSetVacuumPressure":BE(e.params,t,r);break;case"vacuumModule/startSetVacuumPower":$E(e.params,t,r);break;case"vacuumModule/openVent":qE(e.params,t,r);break;case"vacuumModule/closeVent":UE(e.params,t,r);break;case"vacuumModule/stopVacuum":VE(e.params,t,r);break;case"vacuumModule/startRunProfile":xE(e.params,t,r);break;default:console.error(`unknown command: ${e.commandType} passed to getNextRobotStateAndWarning`)}}function G_(e,t,r){return L_({warnings:[],robotState:r},a=>{z_(e,t,a)})}function Bc(e,t,r){const n=O_(e);return L_({warnings:[],robotState:r},s=>{n.forEach(o=>{z_(o,t,s)})})}const pw=(e,t,r)=>{const n=e.reduce((a,s,o)=>{const i=a.timeline.length===0?r:Oc(a.timeline).robotState;if(a.errors!=null)return a;const l=s(t,i);if("errors"in l)return{timeline:a.timeline,errors:l.errors};const p=O_(l.commands).reduce((f,_)=>G_(_,t,f.robotState),{robotState:i,warnings:[]}),d={commands:l.commands,robotState:p.robotState,warnings:l.warnings,stepInfo:{stepNumber:l.stepNumber,name:l.name,description:l.description},python:l.python};return{timeline:[...a.timeline,d],errors:null}},{timeline:[],errors:null});return{timeline:n.timeline,errors:n.errors}},Rn=(e,t)=>{const r=t[e]?.stack;return r!=null?z(r):""},kn=e=>{if(e.type===c.VACUUM_MODULE_TYPE){const t=e;return t.currentPumpActivity.type==="timedHold"||t.currentPumpActivity.type==="profile"}if(e.type===c.THERMOCYCLER_MODULE_TYPE){const t=e;return t.currentBlockActivity.type==="profile"||t.currentBlockActivity.type==="blockTargetTemp"}return!1},vn=e=>{const{pipette:t,labware:r,invariantContext:n,prevRobotState:a}=e;if(n.config.OT_PD_DISABLE_MODULE_RESTRICTIONS)return!1;const s=t?n.pipetteEntities[t]:null,o=r?z(a.labware[r]?.stack):null;if(!t||!r||!s||!o)return!1;const i=Object.keys(n.moduleEntities).some(l=>{const u=n.moduleEntities[l].model;if(dh.includes(u)){const p=a.modules[l]?.slot;return p==="1"&&o==="4"||p==="3"&&o==="6"}else return!1});return c.GEN_ONE_MULTI_PIPETTES.includes(s.name)&&i},ce=(e,t,r)=>{const n=e.reduce((a,s)=>{if(a.errors.length>0)return a;const o=s(t,a.robotState);if("errors"in o)return{robotState:a.robotState,commands:a.commands,errors:o.errors,warnings:a.warnings};const i=[...a.commands,...o.commands],l=[...a.python?[a.python]:[],...o.python?[o.python]:[]].join(`
|
|
47
|
+
`),u=Bc(o.commands,t,a.robotState);return{...a,robotState:u.robotState,commands:i,warnings:[...a.warnings||[],...o.warnings||[],...u.warnings],...l&&{python:l}}},{robotState:r,commands:[],errors:[],warnings:[]});return n.errors.length>0?{errors:n.errors}:{commands:n.commands,warnings:n.warnings,...n.python&&{python:n.python}}},Pa=(e,t,r)=>{const n=Oa(e,t[r]?.stack),a=n&&e[n].moduleState;return!!(a&&a.type===c.THERMOCYCLER_MODULE_TYPE&&a.lidOpen!==!0)},dw=e=>e.commandCreatorFnName!=="delay"&&e.commandCreatorFnName!=="engageMagnet"&&e.commandCreatorFnName!=="disengageMagnet"&&e.commandCreatorFnName!=="setTemperature"&&e.commandCreatorFnName!=="deactivateTemperature"&&"pipette"in e?e.pipette:null,fw=e=>e.commandCreatorFnName==="delay"||e.commandCreatorFnName==="engageMagnet"||e.commandCreatorFnName==="disengageMagnet"||e.commandCreatorFnName==="setTemperature"||e.commandCreatorFnName==="deactivateTemperature",mw=new Date("2025-03-19T00:00:00Z"),hw=2,_w=22;function yw(e,t,r){const{labware:n,modules:a,pipettes:s,commands:o,liquids:i}=e,l=t.protocolType==="python"?t.apiVersion:null,u=l!=null&&l[0]>=hw&&l[1]>=_w,p=t.protocolType==="json"&&r>=mw,d=c.getLabwareDefinitionsByURIForProtocol(o),f=i.reduce((y,S)=>{const{id:w,description:g,displayName:I,displayColor:L}=S;return{...y,[w]:{description:g,displayName:I??"Unknown Liquid",pythonName:"n/a",displayColor:L??"#B7B8B9",liquidGroupId:w}}},{}),_=a.reduce((y,S)=>{const{id:w,model:g}=S;return{...y,[w]:{id:w,type:c.getModuleType(g),model:g,pythonName:"n/a"}}},{}),m=n.reduce((y,S)=>{const{id:w,definitionUri:g}=S,I=d[g];return I==null||I.schemaVersion===3?y:{...y,[w]:{id:w,labwareDefURI:g,def:I,pythonName:"n/a"}}},{}),h=o.reduce((y,S)=>{if(S.commandType==="loadLidStack"&&S.result!=null){const{stackLabwareId:w,lidStackDefinition:g}=S.result;if(w!=null&&g!=null&&y[w]==null&&g.schemaVersion!==3)return{...y,[w]:{id:w,labwareDefURI:c.getLabwareDefURI(g),def:g,pythonName:"n/a"}}}return y},m),b=s.reduce((y,S)=>{const{id:w,pipetteName:g}=S,I=c.getPipetteSpecsV2(g),A=o.filter(R=>R.commandType==="pickUpTip"&&R.params.pipetteId===w).map(R=>h[R.params.labwareId]),E=Array.from(new Set(A.map(R=>R.labwareDefURI))),k=Array.from(new Set(A.map(R=>R.def)));return I==null||(y[w]={name:g,id:w,tiprackLabwareDef:k,tiprackDefURI:E,spec:I,pythonName:"n/a"}),y},{}),T=o.reduce((y,S)=>{if(S.commandType==="loadLidStack"&&S.result!=null){const{params:w}=S,g=qu(w);return{...y,stagingAreaEntities:{...y.stagingAreaEntities,...g}}}else if((S.commandType==="loadLabware"||S.commandType==="loadLid")&&S.result!=null){const{params:w}=S,g=qu(w);return{...y,stagingAreaEntities:{...y.stagingAreaEntities,...g}}}else if(S.commandType==="moveToAddressableArea"||S.commandType==="moveToAddressableAreaForDropTip"){const w=S.params.addressableAreaName,g=`${D()}:${w}`;let I=Eh;w==="fixedTrash"?I="cutout12":w.includes("WasteChute")?I="cutoutD3":w.includes("movableTrash")&&(I=`cutout${w.split("movableTrash")[1]}`);let L=y.trashBinEntities;!Object.values(y.trashBinEntities).some(E=>E.location===I)&&w.includes("movableTrash")&&(L={...y.trashBinEntities,[g]:{pythonName:"trash_bin_1",id:g,location:I}});let A=y.wasteChuteEntities;return w.includes("WasteChute")&&(A={[g]:{pythonName:"waste_chute",id:g,location:I}}),{...y,trashBinEntities:L,wasteChuteEntities:A}}return y},{wasteChuteEntities:{},trashBinEntities:{},stagingAreaEntities:{},gripperEntities:{},config:{OT_PD_DISABLE_MODULE_RESTRICTIONS:!0}});return{labwareEntities:h,pipetteEntities:b,moduleEntities:_,liquidEntities:u||p?f:{},...T}}const bw={A3:"A4",B3:"B4",C3:"C4",D3:"D4"};function Tw(e,t){const r=e.reduce((o,i)=>i.commandType==="loadPipette"&&i.result!=null?{...o,[i.result.pipetteId]:{mount:i.params.mount}}:o,{}),n=e.reduce((o,i)=>{if(i.commandType==="loadModule"&&i.result!=null){const l=c.getModuleDef(i.params.model).moduleType;return{...o,[i.result.moduleId]:{slot:l===c.FLEX_STACKER_MODULE_TYPE?bw[i.params.location.slotName]:i.params.location.slotName,moduleState:Ih[l]}}}return o},{}),a=e.reduce((o,i)=>{if(i.commandType==="loadLidStack"&&i.result!=null){const{result:l}=i,u=l.locationSequences,p=l.labwareIds,d=l.stackLabwareId,f=l.stackLocationSequence,_=m=>{if(c.locationIsOffDeck(m))return[m];if("slotName"in m)return[m.slotName];if("moduleId"in m){const h=n[m.moduleId]?.slot??"offDeck";return[m.moduleId,h]}else if("addressableAreaName"in m)return[m.addressableAreaName];return["offDeck"]};if(u!=null){const m=u.reduce((T,y)=>{const S=y.find(w=>w.kind==="onLabware");return S!=null&&(T[S.labwareId]=y),T},{}),h=p.reduce((T,y,S)=>{const w=m[y]??u[S];if(w!=null){const g=Fu(w);T[y]={stack:g[0]===y?g:[y,...g]}}else{const g=i.params.location;c.locationIsOffDeck(g)?T[y]={stack:[y,g]}:"slotName"in g?T[y]={stack:[y,g.slotName]}:T[y]={stack:[y,"offDeck"]}}return T},{}),b=d!=null&&f!=null?[d,...Fu(f)]:null;return{...o,...h,...d!=null&&b!=null?{[d]:{stack:b}}:{}}}else{const m=i.params.location,h=p.reduce((T,y)=>{if(c.locationIsOffDeck(m))T[y]={stack:[y,m]};else if("slotName"in m)T[y]={stack:[y,m.slotName]};else if("moduleId"in m){const S=m.moduleId;T[y]={stack:[y,S,n[S].slot]}}else T[y]={stack:[y,"offDeck"]};return T},{}),b=d!=null?[d,..._(m)]:null;return{...o,...h,...d!=null&&b!=null?{[d]:{stack:b}}:{}}}}else if((i.commandType==="loadLabware"||i.commandType==="loadLid")&&i.result!=null){const l=[i.result.labwareId];if(c.locationIsOffDeck(i.params.location))l.push(i.params.location);else if("slotName"in i.params.location)l.push(i.params.location.slotName);else if("moduleId"in i.params.location){const u=i.params.location.moduleId;if(n[u]==null)return console.warn(`Module ${u} not found when processing loadLabware/loadLid command. `),o;l.push(i.params.location.moduleId,n[i.params.location.moduleId].slot)}else if("labwareId"in i.params.location){const u=i.params.location.labwareId;o[u]==null&&(console.warn(`Parent labware ${u} not found when processing loadLabware/loadLid command. `),o[u]={stack:[u,"offDeck"]});const p=o[u].stack;l.push(u,...p)}else l.push(i.params.location.addressableAreaName);return{...o,[i.result.labwareId]:{stack:l}}}else{if(i.commandType==="flexStacker/setStoredLabware")return Mm(i).forEach(u=>{Dm(o,u,"setStoredLabwareCount")}),o;if(i.commandType==="flexStacker/fill")return Mm(i).forEach(u=>{Dm(o,u,"fillCount")}),o}return o},{}),s=Tc({invariantContext:t,labwareLocations:a,moduleLocations:n,pipetteLocations:r});return{frame:{...Bc(e,t,s),command:e[e.length-1]},invariantContext:t}}const Dm=(e,t,r)=>{const n=e[t]??{stack:[t,"offDeck"]};e[t]={...n,[r]:(n[r]??0)+1}},Mm=e=>e.result?.storedLabware?.flatMap(r=>[r.primaryLabwareId,r.adapterLabwareId,r.lidLabwareId].filter(n=>n!=null))??[],$c=(e,t)=>e??(t.channels===1?c.SINGLE:t.channels===96?c.ALL:c.COLUMN);var _u,Fm;function gw(){if(Fm)return _u;Fm=1;var e=pc();function t(r,n){var a;return e(r,function(s,o,i){return a=n(s,o,i),!a}),!!a}return _u=t,_u}var yu,qm;function Iw(){if(qm)return yu;qm=1;var e=vh(),t=En(),r=gw(),n=Ke(),a=fc();function s(o,i,l){var u=n(o)?e:r;return l&&a(o,i,l)&&(i=void 0),u(o,t(i,3))}return yu=s,yu}var Ew=Iw();const Na=xe(Ew),Pn=(e,t)=>Na(e,r=>r.moduleState.type===c.HEATERSHAKER_MODULE_TYPE&&r.moduleState.latchOpen!==!1&&c.getAreSlotsHorizontallyAdjacent(r.slot,t)),Nn=(e,t,r)=>r.channels!==1&&Na(e,n=>n.moduleState.type===c.HEATERSHAKER_MODULE_TYPE&&c.getAreSlotsHorizontallyAdjacent(n.slot,t)),Ca=(e,t,r,n)=>r.channels!==1&&!n.def.parameters.isTiprack&&Na(e,a=>a.moduleState.type===c.HEATERSHAKER_MODULE_TYPE&&c.getAreSlotsVerticallyAdjacent(a.slot,t)),W_=(e,t,r)=>Na(e,(a,s)=>c.getAreSlotsHorizontallyAdjacent(r,z(a.stack))&&c.getIsLabwareAboveHeight(t[s].def,c.MAX_LABWARE_HEIGHT_EAST_WEST_HEATER_SHAKER_MM)),Da=(e,t,r)=>{const n=Oa(e,t[r]?.stack),a=n!=null?e[n].moduleState:null;return!!(a&&a.type===c.HEATERSHAKER_MODULE_TYPE&&a.latchOpen!==!1)},Cn=(e,t,r)=>Na(e,n=>n.moduleState.type===c.HEATERSHAKER_MODULE_TYPE&&n.moduleState.targetSpeed!=null&&n.moduleState.targetSpeed>0&&(r===c.OT2_ROBOT_TYPE?c.getAreSlotsAdjacent(n.slot,t):c.getAreFlexSlotsAdjacent(n.slot,t))),Ma=(e,t,r)=>{const n=Oa(e,t[r]?.stack),a=n!=null?e[n].moduleState:null;return!!(a&&a.type===c.HEATERSHAKER_MODULE_TYPE&&a.targetSpeed!==null)},As=e=>{const{args:t,pipetteName:r,tiprackUri:n,liquidClassValuesForTip:a}=e;let s=null;"mixBeforeAspirate"in t?s=t.mixBeforeAspirate:"mixFirstAspirate"in t&&(s=t.mixFirstAspirate);const o=ww(t),i={dispense_position:{offset:{x:t.dispenseXOffset,y:t.dispenseYOffset,z:t.dispenseZOffset},position_reference:t.dispensePositionReference},flow_rate_by_volume:[[0,t.dispenseFlowRateUlSec??0]],delay:{enabled:!!t.dispenseDelay?.seconds,...t.dispenseDelay?.seconds?{duration:t.dispenseDelay?.seconds}:{}},submerge:{delay:{enabled:!!t.dispenseSubmergeDelay?.seconds,...t.dispenseSubmergeDelay?.seconds?{duration:t.dispenseSubmergeDelay?.seconds}:{}},speed:t.dispenseSubmergeSpeed??void 0,start_position:{offset:{x:t.dispenseSubmergeXOffset,y:t.dispenseSubmergeYOffset,z:t.dispenseSubmergeZOffset},position_reference:t.dispenseSubmergePositionReference}},retract:{air_gap_by_volume:[[0,t.dispenseAirGapVolume??0]],delay:{enabled:!!t.dispenseRetractDelay?.seconds,...t.dispenseRetractDelay?.seconds?{duration:t.dispenseRetractDelay?.seconds}:{}},end_position:{offset:{x:t.dispenseRetractXOffset,y:t.dispenseRetractYOffset,z:t.dispenseRetractZOffset},position_reference:t.dispenseRetractPositionReference},speed:t.dispenseRetractSpeed??void 0,touch_tip:{enabled:t.touchTipAfterDispense,z_offset:t.touchTipAfterDispense?t.touchTipAfterDispenseOffsetMmFromTop:void 0,mm_from_edge:t.touchTipAfterDispense&&t.touchTipAfterDispenseMmFromEdge!=null?t.touchTipAfterDispenseMmFromEdge:void 0,speed:t.touchTipAfterDispense?t.touchTipAfterDispenseSpeed:void 0},blowout:{enabled:t.blowoutLocation!=null,location:Y_(t.blowoutLocation),flow_rate:t.blowoutLocation!=null?t.blowoutFlowRateUlSec:void 0,...o!=null?{blowout_position:o}:{}}}},l={[r]:{[n]:{aspirate:{aspirate_position:{offset:{x:t.aspirateXOffset,y:t.aspirateYOffset,z:t.aspirateZOffset},position_reference:t.aspiratePositionReference},flow_rate_by_volume:[[0,t.aspirateFlowRateUlSec]],pre_wet:t.preWetTip,correction_by_volume:a?.aspirate.correctionByVolume??[[0,0]],delay:{enabled:!!t.aspirateDelay?.seconds,...t.aspirateDelay?.seconds?{duration:t.aspirateDelay?.seconds}:{}},mix:{enabled:!!s?.volume,...s?.times?{repetitions:s.times}:{},...s?.volume?{volume:s.volume}:{}},submerge:{delay:{enabled:!!t.aspirateSubmergeDelay?.seconds,...t.aspirateSubmergeDelay?.seconds?{duration:t.aspirateSubmergeDelay?.seconds}:{}},speed:t.aspirateSubmergeSpeed??void 0,start_position:{offset:{x:t.aspirateSubmergeXOffset,y:t.aspirateSubmergeYOffset,z:t.aspirateSubmergeZOffset},position_reference:t.aspirateSubmergePositionReference}},retract:{air_gap_by_volume:[[0,t.aspirateAirGapVolume??0]],delay:{enabled:!!t.aspirateRetractDelay?.seconds,...t.aspirateRetractDelay?.seconds?{duration:t.aspirateRetractDelay?.seconds}:{}},end_position:{offset:{x:t.aspirateRetractXOffset,y:t.aspirateRetractYOffset,z:t.aspirateRetractZOffset},position_reference:t.aspirateRetractPositionReference},speed:t.aspirateRetractSpeed??void 0,touch_tip:{enabled:t.touchTipAfterAspirate,z_offset:t.touchTipAfterAspirate?t.touchTipAfterAspirateOffsetMmFromTop:void 0,mm_from_edge:t.touchTipAfterAspirate&&t.touchTipAfterAspirateMmFromEdge!=null?t.touchTipAfterAspirateMmFromEdge:void 0,speed:t.touchTipAfterAspirate?t.touchTipAfterAspirateSpeed:void 0}}},dispense:{...i,correction_by_volume:a?.singleDispense.correctionByVolume??[[0,0]],push_out_by_volume:[[0,t.pushOut??0]],mix:{enabled:"mixInDestination"in t?t.mixInDestination!=null:!1,repetitions:"mixInDestination"in t?t.mixInDestination?.times??void 0:void 0,volume:"mixInDestination"in t?t.mixInDestination?.volume??void 0:void 0}},...t.commandCreatorFnName==="distribute"?{multi_dispense:{...i,correction_by_volume:a?.multiDispense?.correctionByVolume??[[0,0]],..."conditioningVolume"in t?{conditioning_by_volume:[[0,t.conditioningVolume??0]]}:{},..."disposalVolume"in t?{disposal_by_volume:[[0,t.disposalVolume??0]]}:{}}}:{}}}},u=JSON.parse(JSON.stringify(l));return Mr(u)},Fa=(e,t)=>`${c.getAllLiquidClassDefs()[e].liquidClassName}${t?"_base_class":""}`,Y_=e=>{if(e!=null)return e===Hr?"source":e===Sn?"destination":"trash"},ww=e=>{const t=Y_(e.blowoutLocation);return!t||t==="trash"?null:{offset:{x:e.blowoutXPosition??0,y:e.blowoutYPosition??0,z:e.blowoutOffsetFromTopMm??1},position_reference:e.blowoutPositionReference??c.POSITION_REFERENCE_TOP}},Ss=e=>{const{labwareEntities:t,tiprackIds:r}=e;return`tip_racks=[${r.map(a=>t[a].pythonName).join(", ")}]`};var bu,Um;function Aw(){if(Um)return bu;Um=1;var e="Expected a function";function t(r){if(typeof r!="function")throw new TypeError(e);return function(){var n=arguments;switch(n.length){case 0:return!r.call(this);case 1:return!r.call(this,n[0]);case 2:return!r.call(this,n[0],n[1]);case 3:return!r.call(this,n[0],n[1],n[2])}return!r.apply(this,n)}}return bu=t,bu}var Tu,Bm;function Sw(){if(Bm)return Tu;Bm=1;var e=Nc(),t=gn(),r=ps(),n=Jt(),a=In();function s(o,i,l,u){if(!n(o))return o;i=t(i,o);for(var p=-1,d=i.length,f=d-1,_=o;_!=null&&++p<d;){var m=a(i[p]),h=l;if(m==="__proto__"||m==="constructor"||m==="prototype")return o;if(p!=f){var b=_[m];h=u?u(b,m,_):void 0,h===void 0&&(h=n(b)?b:r(i[p+1])?[]:{})}e(_,m,h),_=_[m]}return o}return Tu=s,Tu}var gu,$m;function Lw(){if($m)return gu;$m=1;var e=fs(),t=Sw(),r=gn();function n(a,s,o){for(var i=-1,l=s.length,u={};++i<l;){var p=s[i],d=e(a,p);o(d,p)&&t(u,r(p,a),d)}return u}return gu=n,gu}var Iu,Vm;function Ow(){if(Vm)return Iu;Vm=1;var e=Ea(),t=En(),r=Lw(),n=Mc();function a(s,o){if(s==null)return{};var i=e(n(s),function(l){return[l]});return o=t(o),r(s,i,function(l,u){return o(l,u[0])})}return Iu=a,Iu}var Eu,xm;function Rw(){if(xm)return Eu;xm=1;var e=En(),t=Aw(),r=Ow();function n(a,s){return r(a,t(e(s)))}return Eu=n,Eu}var kw=Rw();const vw=xe(kw);function K_(e){return Object.keys(e.wells)}const Pw=(e,t)=>{const r=Object.keys(e||{}).filter(n=>e[n]&&e[n].volume>0);return{wellName:t,groupIds:r,ingreds:vw(e,n=>!n||n.volume<=0)}},Nw=(e,t)=>{const r=K_(t);return lt(r,(n,a)=>{const s=e&&e[a];return{...n,[a]:s?Pw(e[a],a):{}}},{})},Cw=(e,t)=>{const r={};return t.forEach(n=>{const a=e!=null?Object.values(e).reduce((s,o)=>{if(o.groupIds.indexOf(n)!==-1){const l=o.ingreds[n];l?.volume!=null&&(s[o.wellName??"A1"]=l.volume)}return s},{}):{};r[n]=a}),r},Dw=e=>{const t=e.flatMap(r=>r==null?[]:Object.values(r).flatMap(n=>n.groupIds.filter(a=>a!==je)));return Array.from(new Set(t))},Mw=e=>{const t=e!=null?Object.values(e).flatMap(r=>r.groupIds)?.filter(r=>r!==je):[];return Array.from(new Set(t))},X_="#737578",Z_=e=>{const t=Number(e);return Number.isInteger(t)?c.DEFAULT_LIQUID_COLORS[t%c.DEFAULT_LIQUID_COLORS.length]:(e!==je&&console.warn(`swatchColors expected an integer or ${je}, got ${e}`),"transparent")},Fw=(e,t)=>{const r=e.filter(n=>n!==je);return r.length===0?null:r.length===1?t[r[0]]??Z_(r[0]):X_},qw=(e,t)=>lt(e,(r,n,a)=>{const s=Fw(n.groupIds,t);return s?{...r,[a]:s}:r},{});var wu,Hm;function Uw(){if(Hm)return wu;Hm=1;function e(t,r){return t>r}return wu=e,wu}var Au,jm;function Bw(){if(jm)return Au;jm=1;var e=ph(),t=Uw(),r=ba();function n(a){return a&&a.length?e(a,r,t):void 0}return Au=n,Au}var $w=Bw();const Vw=xe($w),Q_="2.28",xw="8.11.0";function Hw(){return["import json","from opentrons import protocol_api, types"].join(`
|
|
48
|
+
`)}function jw(e){function t(n){return n?new Date(n).toISOString():""}const r=Object.fromEntries(Object.entries({protocolName:e.protocolName,author:e.author,description:e.description,created:t(e.created),internalAppBuildDate:e.internalAppBuildDate,lastModified:t(e.lastModified),category:e.category,subcategory:e.subcategory,tags:e.tags?.length&&e.tags.join(", "),protocolDesigner:e.protocolDesigner,source:e.source}).filter(([n,a])=>a));return`metadata = ${Mr(r)}`}function zw(e){const r={robotType:{[c.OT2_ROBOT_TYPE]:"OT-2",[c.FLEX_ROBOT_TYPE]:"Flex"}[e],apiLevel:Q_};return`requirements = ${Mr(r)}`}function J_(e,t){const r=Object.keys(e).length>0,n=r?Object.values(e).map(a=>`${a.pythonName} = ${ge}.load_module(${N(a.model)}, ${N(t[a.id].slot)})`).join(`
|
|
104
49
|
`):"";return r?`# Load Modules:
|
|
105
|
-
${n}`:""}function
|
|
106
|
-
`);return`${l} = ${
|
|
107
|
-
${
|
|
108
|
-
)`}else{const T=[`${
|
|
109
|
-
`);return`${l} = ${
|
|
110
|
-
${
|
|
50
|
+
${n}`:""}function ey(e,t,r){const n=Object.values(t).filter(s=>s.def.allowedRoles?.includes("adapter")),a=Object.values(n).map(s=>{const{id:o,def:i,pythonName:l}=s,{parameters:u,namespace:p,version:d}=i,f=r[o].stack[1],_=e[f]!=null;let m,h;if(_?m=e[f].pythonName:(m=ge,h=`location=${f==="offDeck"?oa:N(f)}`),c.getLabwareDefIsStandard(i)){const T=[`${N(u.loadName)}`,...h?[h]:[],`namespace=${N(p)}`,`version=${d}`].join(`,
|
|
51
|
+
`);return`${l} = ${m}.load_adapter(
|
|
52
|
+
${Z(T)},
|
|
53
|
+
)`}else{const T=[`${hs}[${N(c.getLabwareDefURI(i))}]`,...h?[h]:[]].join(`,
|
|
54
|
+
`);return`${l} = ${m}.load_adapter_from_definition(
|
|
55
|
+
${Z(T)},
|
|
111
56
|
)`}}).join(`
|
|
112
57
|
`);return a?`# Load Adapters:
|
|
113
|
-
${a}`:""}const
|
|
114
|
-
`),
|
|
115
|
-
${
|
|
58
|
+
${a}`:""}const Gw=(e,t,r)=>e.reduce((n,{id:a,labwareDefURI:s,def:o})=>{const{stack:i}=r[a],l=i.length-1,u=i.slice(1,l),p=u.find(T=>t[T]?.def.parameters.loadName==="opentrons_flex_deck_riser"),d=u.every(T=>t[T]?.labwareDefURI===s)||p!=null,f=o.parameters.loadName;if(!d)return n;const _=p!=null?t[p]?.pythonName:z(i),m=i.length-(p!=null?2:1);if(!(_ in n))return{...n,[_]:{loadName:f,quantity:m}};const{quantity:h}=n[_],b=Vw([h,m])??h;return{...n,[_]:{loadName:f,quantity:b}}},{}),ty=(e,t)=>{const r=Object.values(e).filter(s=>s.def.allowedRoles?.includes("lid")),n=Gw(r,e,t),a=Object.entries(n).map(([s,{loadName:o,quantity:i}])=>{const l=Object.values(e).some(({pythonName:m})=>m===s),u=`load_name=${N(o)}`,p=`location=${l?s:N(s)}`,d=`quantity=${i}`,f=[u,p,d].join(`,
|
|
59
|
+
`),_=Z(f);return`lid_stack_${s} = ${ge}.load_lid_stack(
|
|
60
|
+
${_},
|
|
116
61
|
)`}).join(`
|
|
117
62
|
`);return a?`# Load Lid Stacks:
|
|
118
|
-
${a}`:""},
|
|
119
|
-
`);return[...l,`${
|
|
120
|
-
${
|
|
121
|
-
)`]}else{const
|
|
122
|
-
`);return[...l,`${
|
|
123
|
-
${
|
|
63
|
+
${a}`:""},Ww=e=>{const{parameters:t,namespace:r,version:n}=e;return[`lid=${N(t.loadName)}`,`lid_namespace=${N(r)}`,`lid_version=${n}`]};function ry(e,t,r,n,a){const s=Object.values(r).filter(l=>!l.def.allowedRoles?.includes("adapter")&&!l.def.allowedRoles?.includes("lid")),o=Object.values(r).filter(l=>l.def.allowedRoles?.includes("lid")),i=Object.values(s).reduce((l,u)=>{const{id:p,def:d,pythonName:f}=u,{metadata:_,parameters:m,namespace:h,version:b}=d,T=Object.values(o).find(F=>n[F.id].stack[1]===p),y=a[p]!=null&&a[p]!==_.displayName,S=n[p].stack.includes(He),w=n[p].stack[1],g=z(n[p].stack),I=Object.entries(e).find(([F,te])=>te.slot===g&&te.moduleState.type===c.FLEX_STACKER_MODULE_TYPE),L=t[w]!=null||g===I?.[1].slot&&!S,A=r[w]!=null;let E,k;if(A&&!S)E=r[w].pythonName;else if(L){const F=I!=null?I?.[0]:w;E=t[F].pythonName}else E=ge,k=`location=${w==="offDeck"||S?oa:N(w)}`;const R=y?`label=${N(a[p])}`:void 0;if(c.getLabwareDefIsStandard(d)){const F=[`${N(m.loadName)}`,...k?[k]:[],...R?[R]:[],`namespace=${N(h)}`,`version=${b}`,...T!=null?Ww(T.def):[]].join(`,
|
|
64
|
+
`);return[...l,`${f} = ${E}.load_labware(
|
|
65
|
+
${Z(F)},
|
|
66
|
+
)`]}else{const F=[`${hs}[${N(c.getLabwareDefURI(d))}]`,...k?[k]:[],...R?[R]:[]].join(`,
|
|
67
|
+
`);return[...l,`${f} = ${E}.load_labware_from_definition(
|
|
68
|
+
${Z(F)},
|
|
124
69
|
)`]}},[]).join(`
|
|
125
|
-
`);return
|
|
126
|
-
${
|
|
70
|
+
`);return i?`# Load Labware:
|
|
71
|
+
${i}`:""}function ny(e,t){const r=Object.values(e).map(n=>{const{name:a,id:s,spec:o,pythonName:i}=n,l=o.channels===96?"":N(t[s].mount),u=c.isFlexPipette(a)?c.getFlexNameConversion(o):a;return`${i} = ${ge}.load_instrument(${[N(u),...l?[l]:[]].join(", ")})`}).join(`
|
|
127
72
|
`);return r?`# Load Pipettes:
|
|
128
|
-
${r}`:""}function
|
|
129
|
-
`);return`${n} = ${
|
|
130
|
-
${
|
|
73
|
+
${r}`:""}function ay(e){const t=Object.values(e).map(r=>{const{pythonName:n,displayColor:a,displayName:s,description:o}=r,i=[`${N(s)}`,...o?[`description=${N(o)}`]:[],`display_color=${N(a)}`].join(`,
|
|
74
|
+
`);return`${n} = ${ge}.define_liquid(
|
|
75
|
+
${Z(i)},
|
|
131
76
|
)`}).join(`
|
|
132
77
|
`);return t?`# Define Liquids:
|
|
133
|
-
${t}`:""}function
|
|
134
|
-
`),
|
|
135
|
-
${
|
|
78
|
+
${t}`:""}function sy(e,t,r){const n=Object.entries(e).reduce((s,[o,i])=>{const l=r[o].pythonName;return Object.entries(i).forEach(([u,p])=>{Object.entries(p).forEach(([d,f])=>{const _=t[d].pythonName,m=`${l}__${_}__${f.volume}`;s[m]||(s[m]={labwarePythonName:l,liquidPythonName:_,volume:f.volume,wells:[]}),s[m].wells.push(u)})}),s},{}),a=Object.values(n).map(({labwarePythonName:s,liquidPythonName:o,volume:i,wells:l})=>{const u=l.map(m=>N(m)),d=_s(u,8).map(m=>La+m.join(", ")).join(`,
|
|
79
|
+
`),_=[`wells=[${u.length<8?u.join(", "):`
|
|
80
|
+
${d}
|
|
136
81
|
`}],
|
|
137
|
-
liquid=${
|
|
138
|
-
volume=${
|
|
139
|
-
`].join();return`${
|
|
140
|
-
${
|
|
82
|
+
liquid=${o},
|
|
83
|
+
volume=${i},
|
|
84
|
+
`].join();return`${s}.load_liquid(
|
|
85
|
+
${Z(_)})`}).join(`
|
|
141
86
|
`);return a?`# Load Liquids:
|
|
142
|
-
${a}`:""}function
|
|
87
|
+
${a}`:""}function oy(e){const t=c.getAllLiquidClassDefs(),r=e.map(n=>n==null?"":`${Fa(n,!0)} = ${ge}.get_liquid_class(${N(t[n].liquidClassName)})`).join(`
|
|
143
88
|
`);return e.length>0?`# Load Liquid Classes:
|
|
144
|
-
${r}`:""}function
|
|
89
|
+
${r}`:""}function iy(e){const t=Object.values(e)?.map(r=>{const n=N(c.getCutoutDisplayName(r.location));return`${r.pythonName} = ${ge}.load_trash_bin(${n})`}).join(`
|
|
145
90
|
`);return t?`# Load Trash Bins:
|
|
146
|
-
${t}`:""}function
|
|
147
|
-
${t}`:""}const
|
|
91
|
+
${t}`:""}function ly(e){const t=Object.values(e)?.map(r=>`${r.pythonName} = ${ge}.load_waste_chute()`);return t.length>0?`# Load Waste Chute:
|
|
92
|
+
${t}`:""}const Yw=e=>e?`
|
|
148
93
|
`+e.split(/\r\n|\r|\n/).map(t=>`# ${t}`).join(`
|
|
149
|
-
`):"";function
|
|
94
|
+
`):"";function uy(e){return`# PROTOCOL STEPS
|
|
150
95
|
|
|
151
|
-
`+e.timeline.map(t=>{const{stepInfo:r}=t,n=r?.description;return`# Step ${r?.stepNumber}: ${r?.name}${
|
|
96
|
+
`+e.timeline.map(t=>{const{stepInfo:r}=t,n=r?.description;return`# Step ${r?.stepNumber}: ${r?.name}${Yw(n)}
|
|
152
97
|
${t.python||"pass"}`}).join(`
|
|
153
98
|
|
|
154
|
-
`)}function
|
|
99
|
+
`)}function Kw(e,t,r,n,a,s,o){const{moduleEntities:i,labwareEntities:l,pipetteEntities:u,liquidEntities:p,wasteChuteEntities:d,trashBinEntities:f}=e,{modules:_,labware:m,pipettes:h}=t,T=[J_(i,_),ey(i,l,m),ty(l,m),ry(_,i,l,m,a),ny(u,h),...s===c.FLEX_ROBOT_TYPE?[iy(f),ly(d)]:[],ay(p),sy(n,p,l),oy(o),cy(i,l,m,_,r),uy(r)].filter(y=>y).join(`
|
|
155
100
|
|
|
156
|
-
`)||"pass";return`def run(${
|
|
157
|
-
${
|
|
158
|
-
`);return`${
|
|
159
|
-
${
|
|
160
|
-
)`}else{const h=Object.values(
|
|
161
|
-
`),
|
|
101
|
+
`)||"pass";return`def run(${ge}: protocol_api.ProtocolContext) -> None:
|
|
102
|
+
${Z(T)}`}function Xw(e){const t=Object.values(e).filter(r=>!c.getLabwareDefIsStandard(r.def)).map(r=>r.def);if(t.length>0){const r=Object.fromEntries(t.map(n=>[c.getLabwareDefURI(n),n]));return`${hs} = json.loads("""${JSON.stringify(r)}""")`}else return""}const Ls=e=>{switch(e){case"perDest":return"per destination";case"perSource":return"per source";default:return e}},cy=(e,t,r,n,a)=>{const o=Object.values(e).map(i=>{const{id:l,type:u,pythonName:p}=i;if(u===c.FLEX_STACKER_MODULE_TYPE){const d=n[l].slot,f=a.timeline.map(h=>h.robotState.labware),_=Object.entries(r).filter(([h,b])=>b.stack.includes(l)&&b.stack.includes(He)),m=[...Object.entries(r),...f.flatMap(h=>Object.entries(h))].filter(([h,b])=>z(b.stack)===d&&!b.stack.includes(He));if(_.length===0){if(m.length===0)return"";const h=m.find(([y])=>t[y].def.allowedRoles?.includes("lid")),b=m.find(([y])=>!t[y].def.allowedRoles?.includes("lid"));if(b==null)return"";const T=[`load_name=${N(t[b[0]].def.parameters.loadName)}`,`namespace=${N(t[b[0]].def.namespace)}`,`version=${t[b[0]].def.version}`,"count=0",...h!=null?[`lid=${N(t[h[0]].def.parameters.loadName)}`]:[]].join(`,
|
|
103
|
+
`);return`${p}.set_stored_labware(
|
|
104
|
+
${Z(T)}
|
|
105
|
+
)`}else{const h=Object.values(_).filter(w=>!t[w[0]]?.def.allowedRoles?.includes("lid")).map(w=>t[w[0]].pythonName),T=_s(h,4).map(w=>La+w.join(", ")).join(`,
|
|
106
|
+
`),S=`labware=[${h.length<4?h.join(", "):`
|
|
162
107
|
${T}
|
|
163
108
|
`}],
|
|
164
|
-
`;return`${
|
|
165
|
-
${
|
|
166
|
-
${
|
|
167
|
-
`).trimStart()}`:""},un={back_left:{x:-43.25,y:454.9,z:211.91},front_right:{x:128.75,y:402,z:211.91}},Zy={x:un.back_left.x,y:un.back_left.y,z:un.back_left.z},TO={x:un.front_right.x,y:un.front_right.y,z:un.front_right.z},O_=e=>{if(e.addressableArea?.areaType==="slot"){const t=`cutoutId${e.addressableArea?.id}`;if(t)return t}return null},EO=(e,t,r,n,a)=>{const{nozzleMap:o,pipetteBoundingBoxOffsets:i}=e.spec,s=o[n],l=i.backLeftCorner[0],u=i.frontRightCorner[0],c=i.backLeftCorner[1],p=i.frontRightCorner[1],d=r.x-(s[0]-l),y=r.x+(u-s[0]),b=r.y+(c-s[1]),h=r.y-(s[1]-p),g=(r.z??0)+t-a;return[{x:d,y:b,z:g},{x:y,y:h,z:g},{x:y,y:b,z:g},{x:d,y:h,z:g}]},v_=(e,t)=>{const r=e[1].x<t[0].x,n=e[0].x>t[1].x,a=e[0].y<t[1].y,o=e[1].y>t[0].y;return!(r||n||a||o)},Jy=(e,t)=>{if(t===f.FLEX_ROBOT_TYPE){const r=f.getDeckDefFromRobotType(t),{addressableAreas:n}=r.locations;return n.find(o=>o.id.includes(e))?.offsetFromCutoutFixture[2]??0}return f.getModuleDef(e).dimensions.bareOverallHeight},wO=e=>{const t=f.getDeckDefFromRobotType(e);return Object.values(t.cutoutFixtures).find(n=>f.WASTE_CHUTE_FIXTURES.includes(n.id))?.height??0},IO=(e,t,r,n)=>{const{modules:a,labware:o}=e,{moduleEntities:i,labwareEntities:s,wasteChuteEntities:l}=t;let u=0;const c=r?.addressableArea?.id;if(c){const p=Lp(o,c),d=Object.keys(a).find(b=>a[b].slot===c);Object.values(l).find(b=>b.location===O_(r))&&(u+=wO(n)),p.length>0?p.forEach(b=>{a[b]!=null&&(u+=Jy(i[b].model,n)),o[b]!=null&&(u+=s[b].def.dimensions.zDimension)}):d!=null&&(u+=Jy(i[d].model,n))}return u},SO=(e,t,r,n,a)=>{const o=Object.values(n.moduleEntities).some(({type:i})=>i===f.THERMOCYCLER_MODULE_TYPE);for(const i of t){const s=i.addressableArea?.boundingBox,l=i.position;if(o&&a===f.OT2_ROBOT_TYPE&&i.addressableArea?.id!=null&&Pb.includes(i.addressableArea.id))return!0;if(l==null||s==null)continue;const c={x:l[0],y:s.yDimension+l[1],z:l[2]},p={x:l[0]+s.xDimension,y:l[1],z:l[2]};if(v_([e[0],e[1]],[c,p])&&e[0].z!=null&&IO(r,n,i,a)>=e[0]?.z)return!0}return!1},AO=(e,t)=>Object.values(t).find(r=>r.type===f.THERMOCYCLER_MODULE_TYPE)?v_([Zy,TO],[e[0],e[1]])&&e[0].x<=Zy.z:!1,OO=(e,t,r,n,a)=>{const{wells:o}=e.def,i=o[t];return{x:i.x+r.x+(n?.[0]??0),y:i.y+r.y+(n?.[1]??0),z:a?i.z+(r.z??0)+(n?.[2]??0):e.def.dimensions.zDimension}},It=e=>{const{robotState:t,invariantContext:r,pipetteId:n,labwareId:a,wellLocationOffset:o={x:0,y:0,z:0},wellTargetName:i,primaryNozzle:s,nozzleConfiguration:l}=e,{pipetteEntities:u,labwareEntities:c,stagingAreaEntities:p,moduleEntities:d}=r,{labware:y,tipState:b}=t,h=u[n],{spec:g}=h??{},_=g?.displayCategory==="FLEX"?f.FLEX_ROBOT_TYPE:f.OT2_ROBOT_TYPE,I=f.getDeckDefFromRobotType(_);if(c[a]==null||i==null||l==null||l===f.ALL)return!0;const S=b.pipettes[n]?.tiprackURI,O=S!=null?c[S]:null,v=O!=null?O.def.parameters.tipLength:0,C=Object.values(p).map(R=>R.location),N=b.pipettes[n]?.hasTip??!1,V=N?v??0:0,$=we(y[a].stack),G=f.getPositionFromSlotId($,I)??[0,0,0],fe=_===f.FLEX_ROBOT_TYPE&&y[a].stack.some(R=>d[R]?.type===f.THERMOCYCLER_MODULE_TYPE)?I.locations.addressableAreas.find(R=>R.id===f.THERMOCYCLER_MODULE_V2)?.offsetFromCutoutFixture??[0,0,0]:[0,0,0],be=[fe[0]+G[0],fe[1]+G[1],fe[2]+G[2]],ge=OO(c[a],i,o,be,N),{channels:le}=h.spec,re=O!=null?vO({pipetteSpecs:g,tiprackUri:O.labwareDefURI,nozzles:l}):0,U=EO(h,V,ge,s??qr({nozzles:l,channels:le}),re);if(!RO({channels:le,boundingBox:U,robotType:_}))return!1;const w=(_===f.OT2_ROBOT_TYPE?f.getOt2SurroundingSlots($):f.getFlexSurroundingSlots($,C)).map(R=>{const E=f.getAddressableAreaFromSlotId(R,I),A=f.getPositionFromSlotId(R,I);return{addressableArea:E,position:A}});return!AO(U,d)&&!SO(U,w,t,r,_)},L_=e=>{const{tipState:t,primaryNozzle:r,channels:n,nozzleConfiguration:a,wellName:o,tiprackDef:i,tipsToIgnore:s=[]}=e,{ordering:l}=i;if(n===1)return{isSafe:!0,isComplete:t[o]!==Pe};if(n===8){const u=r!==f.A1_NOZZLE,c=zc(o),p=l[c],d=u?[...p].reverse():p;if(a===f.SINGLE){const y=d.indexOf(o);return{isSafe:d.slice(y+1).every(b=>t[b]===Pe||s.includes(b)),isComplete:t[o]!==Pe}}if(a===f.PARTIAL_COLUMN){const y=d.indexOf(o),b=f.PARTIAL_NOZZLE_MAP[r];return{isSafe:d.slice(y+b,d.length).every(h=>t[h]===Pe||s.includes(h)),isComplete:t[o]!==Pe}}return{isSafe:!0,isComplete:d.every(y=>t[y]!==Pe)}}if(a===f.ALL)return{isSafe:!0,isComplete:Object.keys(i.wells).every(u=>t[u]!==Pe)};if(a===f.COLUMN){const u=r===f.A12_NOZZLE,c=zc(o),p=l[c],d=u?[...l].reverse():l,y=d.indexOf(p);return{isSafe:d.slice(y+1).flat().every(b=>t[b]===Pe||s.includes(b)),isComplete:d[y].every(b=>t[b]!==Pe)}}if(a===f.ROW){const u=l[0].map((y,b)=>l.map(h=>h[b])),p=r===f.H1_NOZZLE?[...u].reverse():u,d=p.findIndex(y=>y.some(b=>b===o));return{isSafe:p.slice(d+1).flat().every(y=>t[y]===Pe||s.includes(y)),isComplete:p[d].every(y=>t[y]!==Pe)}}if(a===f.SINGLE){const u=ra(r??qr({nozzles:a,channels:n})),c=R_(r??qr({nozzles:a,channels:n})),p=u==="H",y=c==="12"?[...l].reverse():l,b=y.findIndex(h=>h.some(g=>g===o));return{isSafe:y.slice(b).every(h=>{const g=p?[...h].reverse():h,T=g.findIndex(m=>ra(m)===ra(o));return g.slice(T).every(m=>t[m]===Pe||s.includes(m)||m===o)}),isComplete:t[o]!==Pe}}return{isSafe:!1}},ra=e=>e.slice(0,1),R_=e=>e.slice(1),zc=e=>parseInt(e.slice(1))-1,qr=e=>{const{nozzles:t,channels:r}=e;if(r===8&&t===f.SINGLE)return"H1";if(r===96){if(t===f.COLUMN)return"A12";if(t===f.SINGLE)return"H12"}return"A1"},qa=e=>{const{wellSets:t,nozzles:r,channels:n,primaryNozzle:a}=e;if(r===f.ROW){const o=t[0].length;return Array.from({length:o},(s,l)=>t.map(u=>u[l])).map(s=>s[0])}return t.map(o=>n===96&&r===f.ALL?a:r===f.COLUMN||n===8&&r===f.ALL||n===8&&r===f.PARTIAL_COLUMN?ra(a)==="H"?o[o.length-1]:o[0]:(console.assert(o.length===1,"Well set for SINGLE nozzle configuration should have exactly 1 well"),o[0]))},vO=e=>{const{pipetteSpecs:t,tiprackUri:r,nozzles:n}=e,{channels:a}=t,o=LO(a,n),i=t.pickUpTipConfigurations.pressFit.configurationsByNozzleMap[o]?.default.tipOverlaps;if(i==null)return console.error(`No tip overlaps found for ${n} and ${o} overlap.`),0;const s=Math.max(...Object.keys(i).map(l=>Number(l.slice(1))));return i[`v${s}`]?.[r]??i[`v${s}`]?.default??0},LO=(e,t)=>{if(e===1)return"SingleA1";if(e===8)return t===f.SINGLE?"SingleH1":"Full";if(e===96){if(t===f.SINGLE)return"SingleH12";if(t===f.COLUMN)return"Column12";if(t===f.ROW)return"RowA"}return"Full"},RO=e=>{const{channels:t,boundingBox:r,robotType:n}=e,a=f.getRobotDefFromRobotType(n),{paddingOffsets:o}=a,{front:i,rear:s,leftSide:l,rightSide:u}=o,[c,p]=a.extents,[d,y]=r,{x:b,y:h}=d,{x:g,y:T}=y;if(t===96){if(g<l)return!1;const m=c+u;if(b>m)return!1}if(t!==1){if(h<i)return!1;const m=p+s;if(T>m)return!1}return!0};function P_(e){const t=e.length===1?e[0]:null;return t!=null&&"steps"in t?{numRepetitions:t.repetitions,repeatingProfileSteps:t.steps}:{numRepetitions:1,repeatingProfileSteps:Yp(e)}}function Yp(e){return e.flatMap(t=>"steps"in t?wg(t.steps,t.repetitions):t)}const ne=YT;function k_(e){return Object.keys(e).sort((r,n)=>{const a=we(e[r].stack),o=we(e[n].stack),i=parseInt(a),s=parseInt(o);return We.includes(a)&&We.includes(o)?r.localeCompare(n):We.includes(a)?1:We.includes(o)?-1:i-s})}function N_(e){const{pipetteId:t,tiprackId:r,invariantContext:n,robotState:a,nozzles:o,primaryNozzle:i}=e,s=n.pipetteEntities[t]?.spec?.channels,l=i??qr({nozzles:o,channels:s}),u=n.labwareEntities[r]?.def,c=a.tipState.tipracks[r];if(!s||!u||!c)return console.assert(!1,`Pipette ${t} missing channels/spec or tiprack definition`),null;const p=V=>c[V]===ro,d=f.orderWells(u.ordering,"t2b","l2r"),y=f.orderWells(u.ordering,"b2t","l2r"),b=V=>V.find(p)??null,h=V=>[...V].reverse().find(p)??null,g=V=>V.find($=>$.every(p))??null,T=V=>[...V].reverse().find($=>$.every(p))??null,m=s===8&&o===f.SINGLE,_=m&&l===f.H1_NOZZLE,I=m&&l===f.A1_NOZZLE,S=s===96&&o===f.SINGLE,O=S&&l===f.H12_NOZZLE,v=S&&l===f.A12_NOZZLE,C=S&&l===f.H1_NOZZLE,N=S&&l===f.A1_NOZZLE;if(s===1||_||O)return b(d);if(I)return b(y);if(o===f.PARTIAL_COLUMN){const V=b(d);if(!V)return null;const $=d.indexOf(V);return d[$]??null}if(o===f.ALL&&s===8)return g(u.ordering)?.[0]??null;if(N)return h(d);if(v)return b(y);if(C)return h(y);if(o===f.COLUMN){const V=u.ordering;return(l===f.A1_NOZZLE?T(V):g(V))?.[0]??null}if(o===f.ROW){const V=u.ordering,$=V[0].map((X,fe)=>V.map(be=>be[fe]));return(l===f.A1_NOZZLE?T($):g($))?.[0]??null}return o===f.ALL&&s===96?d.every(p)?d[0]:null:(console.assert(!1,`Unhandled _getNextTip case for pipette ${t}`),null)}function Fa(e,t,r,n,a,o){const i=r.pipetteEntities[e];if(!i)throw new Error(`cannot getNextTiprack, no pipette entity for pipette "${e}"`);const s=k_(n.labware).filter(b=>{console.assert(r.labwareEntities[b]?.labwareDefURI,`cannot getNextTiprack, no labware entity for "${b}"`);const h=we(n.labware[b].stack)!=="offDeck",g=r.labwareEntities[b].labwareDefURI;return h&&g===t});let l=s;const u=i.spec.channels===96,c=[],p=[];u&&(l=l.filter(b=>{const h=n.labware[b].stack[1],g=r.labwareEntities[h],T=g?.def.parameters.loadName==="opentrons_flex_96_tiprack_adapter"&&f.getLabwareDefIsStandard(g?.def),m=o===f.ALL?T:!T;return m||c.push(b),m})),l=l.filter(b=>{const h=Object.entries(n.labware).find(([g,T])=>T.stack.includes(b)&&f.getIsLid(r.labwareEntities[g].def));return h!=null&&p.push(b),h==null});let d=null,y=null;for(const b of l){const h=N_({pipetteId:e,tiprackId:b,nozzles:o,invariantContext:r,robotState:n,primaryNozzle:a});if(h){d=b,y=h;break}}return d&&y?{nextTiprack:{tiprackId:d,well:y},tipracks:{totalTipracks:s.length,excludedBy96Channel:c.length,excludedByLid:p.length,filteredSortedTiprackIds:l}}:{nextTiprack:null,tipracks:{totalTipracks:s.length,excludedBy96Channel:c.length,excludedByLid:p.length,filteredSortedTiprackIds:l}}}function ko(e,t,r){const n=t.pipetteEntities[e],a=n.spec.liquids.default.maxVolume,o=n.tiprackLabwareDef;let i=null;for(const l of o)if(f.getLabwareDefURI(l)===r){i=l;break}const s=f.getTiprackVolume(i??o[0]);return!a||!s?(console.assert(!1,`getPipetteEffectiveMaxVol expected tiprackMaxVol and pipette maxVolume to be > 0, got',
|
|
168
|
-
${a}, ${
|
|
169
|
-
${l}.blow_out(${u})`}),
|
|
170
|
-
${l}.blow_out(${u})`}),
|
|
171
|
-
${
|
|
109
|
+
`;return`${p}.set_stored_labware_items(
|
|
110
|
+
${Z(S)})`}}}).filter(Boolean);return o.length>0?`# Set Stored Labware:
|
|
111
|
+
${o.join(`
|
|
112
|
+
`).trimStart()}`:""},Zw=(e,t,r,n)=>{const{spec:a}=t,s=e===c.ROW,o=e===c.COLUMN||e===c.ALL&&a.channels===8,i=n.ordering[0].length===1;if((o||s)&&i){const u=o?`H${r.slice(1)}`:`${r.charAt(0)}12`,p=a.nozzleMap[u],d=a.nozzleMap[r],f=p.map((h,b)=>h-d[b]),_=[f[0]/2,f[1]/2,0],m=d.map((h,b)=>h+_[b]);return{x:m[0],y:m[1],z:m[2]}}const l=a.nozzleMap[r];return{x:l[0],y:l[1],z:l[2]}},pn={back_left:{x:-43.25,y:454.9,z:211.91},front_right:{x:128.75,y:402,z:211.91}},zm={x:pn.back_left.x,y:pn.back_left.y,z:pn.back_left.z},Qw={x:pn.front_right.x,y:pn.front_right.y,z:pn.front_right.z},py=e=>{if(e.addressableArea?.areaType==="slot"){const t=`cutout${e.addressableArea?.id}`;if(t)return t}return null},Jw=(e,t,r,n,a,s,o)=>{const{pipetteBoundingBoxOffsets:i}=e.spec,l=Zw(s,e,a,n),u=i.backLeftCorner[0],p=i.frontRightCorner[0],d=i.backLeftCorner[1],f=i.frontRightCorner[1],_=r.x-(l.x-u),m=r.x+(p-l.x),h=r.y+(d-l.y),b=r.y-(l.y-f),T=(r.z??0)+t-o;return[{x:_,y:h,z:T},{x:m,y:b,z:T},{x:m,y:h,z:T},{x:_,y:b,z:T}]},dy=(e,t)=>{const r=e[1].x<t[0].x,n=e[0].x>t[1].x,a=e[0].y<t[1].y,s=e[1].y>t[0].y;return!(r||n||a||s)},Gm=(e,t)=>{if(t===c.FLEX_ROBOT_TYPE){const r=c.getDeckDefFromRobotType(t),{addressableAreas:n}=r.locations;return n.find(s=>s.id.includes(e))?.offsetFromCutoutFixture[2]??0}return c.getModuleDef(e).dimensions.bareOverallHeight},eA=e=>{const t=c.getDeckDefFromRobotType(e);return Object.values(t.cutoutFixtures).find(n=>c.WASTE_CHUTE_FIXTURES.includes(n.id))?.height??0},tA=(e,t,r,n)=>{const{modules:a,labware:s}=e,{moduleEntities:o,labwareEntities:i,wasteChuteEntities:l}=t;let u=0;const p=r?.addressableArea?.id;if(p){const d=Ec(s,p),f=Object.keys(a).find(m=>a[m].slot===p);Object.values(l).find(m=>m.location===py(r))&&(u+=eA(n)),d.length>0?d.forEach(m=>{a[m]!=null&&(u+=Gm(o[m].model,n)),s[m]!=null&&(u+=i[m].def.dimensions.zDimension)}):f!=null&&(u+=Gm(o[f].model,n))}return u},rA=(e,t,r,n,a)=>{for(const s of t){const o=s.addressableArea?.boundingBox,i=s.position;if(i==null||o==null)continue;const l={x:i[0],y:o.yDimension+i[1],z:i[2]},u={x:i[0]+o.xDimension,y:i[1],z:i[2]};if(dy([e[0],e[1]],[l,u])&&e[0].z!=null&&tA(r,n,s,a)>=e[0]?.z)return!0}return!1},nA=(e,t)=>Object.values(t).find(r=>r.type===c.THERMOCYCLER_MODULE_TYPE)?dy([zm,Qw],[e[0],e[1]])&&e[0].x<=zm.z:!1,aA=(e,t,r,n,a)=>{const{wells:s}=e.def,o=s[t];return{x:o.x+r.x+(n?.[0]??0),y:o.y+r.y+(n?.[1]??0),z:a?o.z+(r.z??0)+(n?.[2]??0):e.def.dimensions.zDimension}},wt=e=>{const{robotState:t,invariantContext:r,pipetteId:n,labwareId:a,wellLocationOffset:s={x:0,y:0,z:0},wellTargetName:o,primaryNozzle:i,nozzleConfiguration:l,tiprackId:u}=e,{pipetteEntities:p,labwareEntities:d,stagingAreaEntities:f,moduleEntities:_}=r,{labware:m,tipState:h}=t,b=p[n],{spec:T}=b,{channels:y}=T,g=T?.displayCategory==="FLEX"?c.FLEX_ROBOT_TYPE:c.OT2_ROBOT_TYPE,I=c.getDeckDefFromRobotType(g);if(d[a]==null||o==null||y===1)return!0;const L=u?!0:h.pipettes[n]?.hasTip??!1,A=u??h.pipettes[n]?.tiprackURI,E=A!=null?d[A]:null,k=E!=null?E.def.parameters.tipLength:0,R=Object.values(f).map(re=>re.location),B=L?k??0:0,F=z(m[a].stack),te=m[a].stack.some(re=>_[re]?.type===c.THERMOCYCLER_MODULE_TYPE),de=c.getDeckDefFromRobotType(c.FLEX_ROBOT_TYPE),_e=(te?c.getPositionFromSlotId(c.B1_ADDRESSABLE_AREA,de):c.getPositionFromSlotId(F,I))??[0,0,0],oe=te?de.locations.addressableAreas.find(re=>re.id===c.THERMOCYCLER_MODULE_V2)?.offsetFromCutoutFixture??[0,0,0]:[0,0,0],Se=[oe[0]+_e[0],oe[1]+_e[1],oe[2]+_e[2]],ve=aA(d[a],o,s,Se,L),ze=E!=null?sA({pipetteSpecs:T,tiprackUri:E.labwareDefURI,nozzles:l}):0,Ue=d[a].def,J=Jw(b,B,ve,Ue,i,l,ze);if(!iA({channels:y,boundingBox:J,robotType:g}))return!1;const Be=(g===c.OT2_ROBOT_TYPE?c.getOt2SurroundingSlots(F):c.getFlexSurroundingSlots(F,R)).map(re=>{const W=c.getAddressableAreaFromSlotId(re,I),Y=c.getPositionFromSlotId(re,I);return{addressableArea:W,position:Y}});return!nA(J,_)&&!rA(J,Be,t,r,g)},fy=e=>{const{tipState:t,primaryNozzle:r,channels:n,nozzleConfiguration:a,wellName:s,tiprackDef:o,tipsToIgnore:i=[]}=e,{ordering:l}=o;if(n===1)return{isSafe:!0,isComplete:t[s]!==se};if(n===8){const u=r!==c.A1_NOZZLE,p=zu(s),d=l[p],f=u?[...d].reverse():d;if(a===c.SINGLE){const _=f.indexOf(s);return{isSafe:f.slice(_+1).every(m=>t[m]===se||i.includes(m)),isComplete:t[s]!==se}}if(a===c.PARTIAL_COLUMN){const _=f.indexOf(s),m=c.PARTIAL_NOZZLE_MAP[r];return{isSafe:f.slice(_+m,f.length).every(h=>t[h]===se||i.includes(h)),isComplete:t[s]!==se}}return{isSafe:!0,isComplete:f.every(_=>t[_]!==se)}}if(a===c.ALL)return{isSafe:!0,isComplete:Object.keys(o.wells).every(u=>t[u]!==se)};if(a===c.COLUMN){const u=r===c.A12_NOZZLE,p=zu(s),d=l[p],f=u?[...l].reverse():l,_=f.indexOf(d);return{isSafe:f.slice(_+1).flat().every(m=>t[m]===se||i.includes(m)),isComplete:f[_].every(m=>t[m]!==se)}}if(a===c.ROW){const u=l[0].map((_,m)=>l.map(h=>h[m])),d=r===c.H1_NOZZLE?[...u].reverse():u,f=d.findIndex(_=>_.some(m=>m===s));return{isSafe:d.slice(f+1).flat().every(_=>t[_]===se||i.includes(_)),isComplete:d[f].every(_=>t[_]!==se)}}if(a===c.SINGLE){const u=aa(r??es({nozzles:a,channels:n})),p=my(r??es({nozzles:a,channels:n})),d=u==="H",_=p==="12"?[...l].reverse():l,m=_.findIndex(h=>h.some(b=>b===s));return{isSafe:_.slice(m).every(h=>{const b=d?[...h].reverse():h,T=b.findIndex(y=>aa(y)===aa(s));return b.slice(T).every(y=>t[y]===se||i.includes(y)||y===s)}),isComplete:t[s]!==se}}return{isSafe:!1}},aa=e=>e.slice(0,1),my=e=>e.slice(1),zu=e=>parseInt(e.slice(1))-1,es=e=>{const{nozzles:t,channels:r}=e;if(r===8&&t===c.SINGLE)return"H1";if(r===96){if(t===c.COLUMN)return"A12";if(t===c.SINGLE)return"H12"}return"A1"},qa=e=>{const{wellSets:t,nozzles:r,channels:n,primaryNozzle:a}=e;if(r===c.ROW){const s=t[0].length;return Array.from({length:s},(i,l)=>t.map(u=>u[l])).map(i=>i[0])}return t.map(s=>n===96&&r===c.ALL?a:r===c.COLUMN||n===8&&r===c.ALL||n===8&&r===c.PARTIAL_COLUMN?aa(a)==="H"?s[s.length-1]:s[0]:(console.assert(s.length===1,"Well set for SINGLE nozzle configuration should have exactly 1 well"),s[0]))},sA=e=>{const{pipetteSpecs:t,tiprackUri:r,nozzles:n}=e,{channels:a}=t,s=oA(a,n),o=t.pickUpTipConfigurations.pressFit.configurationsByNozzleMap[s]?.default.tipOverlaps;if(o==null)return console.error(`No tip overlaps found for ${n} and ${s} overlap.`),0;const i=Math.max(...Object.keys(o).map(l=>Number(l.slice(1))));return o[`v${i}`]?.[r]??o[`v${i}`]?.default??0},oA=(e,t)=>{if(e===1)return"SingleA1";if(e===8)return t===c.SINGLE?"SingleH1":"Full";if(e===96){if(t===c.SINGLE)return"SingleH12";if(t===c.COLUMN)return"Column12";if(t===c.ROW)return"RowA"}return"Full"},iA=e=>{const{channels:t,boundingBox:r,robotType:n}=e,a=c.getRobotDefFromRobotType(n),{paddingOffsets:s}=a,{front:o,rear:i,leftSide:l,rightSide:u}=s,[p,d]=a.extents,[f,_]=r,{x:m,y:h}=f,{x:b,y:T}=_;if(t===96){if(b<l)return!1;const y=p+u;if(m>y)return!1}if(t!==1){if(h<o)return!1;const y=d+i;if(T>y)return!1}return!0};function hy(e){const t=e.length===1?e[0]:null;return t!=null&&"steps"in t?{numRepetitions:t.repetitions,repeatingProfileSteps:t.steps}:{numRepetitions:1,repeatingProfileSteps:Vc(e)}}function Vc(e){return e.flatMap(t=>"steps"in t?i_(t.steps,t.repetitions):t)}const D=Mb;function _y(e){return Object.keys(e).sort((r,n)=>{const a=z(e[r].stack),s=z(e[n].stack),o=parseInt(a),i=parseInt(s);return De.includes(a)&&De.includes(s)?r.localeCompare(n):De.includes(a)?1:De.includes(s)?-1:o-i})}function yy(e){const{pipetteId:t,tiprackId:r,invariantContext:n,robotState:a,nozzles:s,primaryNozzle:o}=e,i=n.pipetteEntities[t]?.spec?.channels,l=n.labwareEntities[r]?.def,u=a.tipState.tipracks[r];if(!i||!l||!u)return console.assert(!1,`Pipette ${t} missing channels/spec or tiprack definition`),null;const p=E=>u[E]===ga,d=c.orderWells(l.ordering,"t2b","l2r"),f=c.orderWells(l.ordering,"b2t","l2r"),_=E=>E.find(p)??null,m=E=>[...E].reverse().find(p)??null,h=E=>E.find(k=>k.every(p))??null,b=E=>[...E].reverse().find(k=>k.every(p))??null,T=i===8&&s===c.SINGLE,y=T&&o===c.H1_NOZZLE,S=T&&o===c.A1_NOZZLE,w=i===96&&s===c.SINGLE,g=w&&o===c.H12_NOZZLE,I=w&&o===c.A12_NOZZLE,L=w&&o===c.H1_NOZZLE,A=w&&o===c.A1_NOZZLE;if(i===1||y||g)return _(d);if(S)return _(f);if(s===c.PARTIAL_COLUMN){const E=_(d);if(!E)return null;const k=d.indexOf(E);return d[k]??null}if(s===c.ALL&&i===8)return h(l.ordering)?.[0]??null;if(A)return m(d);if(I)return _(f);if(L)return m(f);if(s===c.COLUMN){const E=l.ordering;return(o===c.A1_NOZZLE?b(E):h(E))?.[0]??null}if(s===c.ROW){const E=l.ordering,k=E[0].map((B,F)=>E.map(te=>te[F]));return(o===c.A1_NOZZLE?b(k):h(k))?.[0]??null}return s===c.ALL&&i===96?d.every(p)?d[0]:null:(console.assert(!1,`Unhandled _getNextTip case for pipette ${t}`),null)}function Ua(e,t,r,n,a,s){const o=r.pipetteEntities[e];if(!o)throw new Error(`cannot getNextTiprack, no pipette entity for pipette "${e}"`);const i=_y(n.labware).filter(m=>{console.assert(r.labwareEntities[m]?.labwareDefURI!=null,`cannot getNextTiprack, no labware entity for "${m}"`);const h=z(n.labware[m].stack)!=="offDeck",b=r.labwareEntities[m].labwareDefURI;return h&&b===t});let l=i;const u=o.spec.channels===96,p=[],d=[];u&&(l=l.filter(m=>{const h=n.labware[m].stack[1],b=r.labwareEntities[h],T=b?.def.parameters.loadName==="opentrons_flex_96_tiprack_adapter"&&c.getLabwareDefIsStandard(b?.def),y=s===c.ALL?T:!T;return y||p.push(m),y})),l=l.filter(m=>{const h=Object.entries(n.labware).find(([b,T])=>T.stack.includes(m)&&c.getIsLid(r.labwareEntities[b].def));return h!=null&&d.push(m),h==null});let f=null,_=null;for(const m of l){const h=yy({pipetteId:e,tiprackId:m,nozzles:s,invariantContext:r,robotState:n,primaryNozzle:a});if(h){f=m,_=h;break}}return f&&_?{nextTiprack:{tiprackId:f,well:_},tipracks:{totalTipracks:i.length,excludedBy96Channel:p.length,excludedByLid:d.length,filteredSortedTiprackIds:l}}:{nextTiprack:null,tipracks:{totalTipracks:i.length,excludedBy96Channel:p.length,excludedByLid:d.length,filteredSortedTiprackIds:l}}}function Os(e,t,r){const n=t.pipetteEntities[e],a=n.spec.liquids.default.maxVolume,s=n.tiprackLabwareDef;let o=null;for(const l of s)if(c.getLabwareDefURI(l)===r){o=l;break}const i=c.getTiprackVolume(o??s[0]);return!a||!i?(console.assert(!1,`getPipetteEffectiveMaxVol expected tiprackMaxVol and pipette maxVolume to be > 0, got',
|
|
113
|
+
${a}, ${i}`),NaN):hb([i,a])??NaN}function At(e,t){return t in e.modules||console.warn(`getModuleState expected module id "${t}" to be in robot state`),e.modules[t]?.moduleState}const Rs=(e,t)=>{const r=e.modules[t]?.moduleState;return r&&r.type===c.THERMOCYCLER_MODULE_TYPE?r:null},Dn=(e,t)=>{const r=e.modules[t]?.moduleState;return r&&r.type===c.ABSORBANCE_READER_TYPE?r:null},dt=(e,t)=>{const r=e.modules[t]?.moduleState;return r&&r.type===c.FLEX_STACKER_MODULE_TYPE?r:null},st=(e,t)=>{const r=e.modules[t]?.moduleState;return r&&r.type===c.VACUUM_MODULE_TYPE?r:null},lA=(e,t,r)=>{const{moduleId:n,measureMode:a,sampleWavelengths:s,referenceWavelength:o}=e,i=Dn(r,n),l=[];if(i==null&&l.push(X()),l.length>0)return{errors:l};const u=[U(mc,{moduleId:n}),U(Kh,{moduleId:n,measureMode:a,sampleWavelengths:s,referenceWavelength:o??void 0})];return ce(u,t,r)},uA=(e,t,r)=>{const n=[],a=Dn(r,e.moduleId);if((a==null||e.moduleId==null)&&n.push(X()),a?.initialization==null&&n.push(Vy()),n.length>0)return{errors:n};const{moduleId:s,fileName:o}=e,i=[U(mc,{moduleId:s}),U(Xh,{moduleId:s,fileName:o})];return ce(i,t,r)},cA=(e,t,r)=>{const{pipetteId:n,trashId:a,flowRate:s,volume:o}=e,i=[U(qe,{pipetteId:n,fixtureId:a,offset:It}),O(qt,{pipetteId:n}),U(Zt,{pipetteId:n,volume:o,flowRate:s})];return ce(i,t,r)},pA=(e,t,r)=>{const{pipetteId:n,volume:a,flowRate:s,wasteChuteId:o}=e,i=[U(qe,{pipetteId:n,fixtureId:o,offset:It}),O(qt,{pipetteId:n}),U(Zt,{pipetteId:n,flowRate:s,volume:a})];return ce(i,t,r)},dA=(e,t,r)=>{const{labwareId:n,wellName:a,flowRate:s,pipetteId:o,volume:i,type:l}=e,u=t.pipetteEntities[o].pythonName,p=l==="aspirate"?[]:[O(qt,{pipetteId:o})],d=()=>({commands:[],python:`${u}.air_gap(${[`volume=${i}`,`height=${Nu}`,`flow_rate=${s}`].join(", ")})`}),f=[O(V,{pipetteId:o,labwareId:n,wellName:a,wellLocation:{origin:"top",offset:{z:Nu,x:0,y:0}}}),...p,O(Zt,{pipetteId:o,volume:i,flowRate:s}),d];return ce(f,t,r)},by=(e,t,r)=>{const{pipetteId:n,trashId:a,flowRate:s}=e,{pipetteEntities:o,trashBinEntities:i}=t,l=o[n].pythonName,u=i[a].pythonName,p=()=>({commands:[],python:`${l}.flow_rate.blow_out = ${s}
|
|
114
|
+
${l}.blow_out(${u})`}),d=[O(qe,{pipetteId:n,fixtureId:a,offset:It}),O(Sa,{pipetteId:n,flowRate:s}),p];return ce(d,t,r)},Ty=(e,t,r)=>{const{pipetteId:n,flowRate:a,wasteChuteId:s}=e,{pipetteEntities:o,wasteChuteEntities:i}=t,l=o[n].pythonName,u=i[s].pythonName,p=()=>({commands:[],python:`${l}.flow_rate.blow_out = ${a}
|
|
115
|
+
${l}.blow_out(${u})`}),d=[O(qe,{pipetteId:n,fixtureId:s,offset:It}),O(Sa,{pipetteId:n,flowRate:a}),p];return ce(d,t,r)};var Su,Wm;function fA(){if(Wm)return Su;Wm=1;var e=Yh();function t(r){var n=e(r),a=n%1;return n===n?a?n-a:n:0}return Su=t,Su}var Lu,Ym;function mA(){if(Ym)return Lu;Ym=1;var e=v_(),t=fc(),r=fA(),n=Math.ceil,a=Math.max;function s(o,i,l){(l?t(o,i,l):i===void 0)?i=1:i=a(r(i),0);var u=o==null?0:o.length;if(!u||i<1)return[];for(var p=0,d=0,f=Array(n(u/i));p<u;)f[d++]=e(o,p,p+=i);return f}return Lu=s,Lu}var hA=mA();const gy=xe(hA),Iy=(e,t,r)=>{const{pipetteId:n,trashLocation:a}=e;let s=[];const o=yc(a);if(r.tipState.pipettes[n]?.hasTip){const i=t.pipetteEntities[n].pythonName,l=()=>({commands:[],python:`${i}.drop_tip()`});s=[O(Jh,{pipetteId:n,addressableAreaName:o}),O(hc,{pipetteId:n}),l]}return ce(s,t,r)},Ey=(e,t,r)=>{const n=It,{pipetteId:a,wasteChuteId:s}=e,{pipetteEntities:o,wasteChuteEntities:i}=t;let l=[];if(!r.tipState.pipettes[a].hasTip)l=[];else{const u=o[a].pythonName,p=i[s].pythonName,d=()=>({commands:[],python:`${u}.drop_tip(${p})`});l=[O(qe,{pipetteId:a,fixtureId:s,offset:n}),O(hc,{pipetteId:a}),d]}return ce(l,t,r)},Ba=(e,t,r)=>{const{pipette:n,dropTipLocation:a,nozzles:s,primaryNozzle:o,tipRack:i,isFromMixCommand:l=!1,tipSelectionArgs:u}=e,p=r.pipettes[n].nozzles,d=r.pipettes[n].tiprackId,f=t.pipetteEntities[n]?.spec,_=f?.channels;let m=null;if(u==null){if(i==null)return{errors:[Xy()]};const E=Ua(n,i,t,r,o,s);m=E.nextTiprack;const k=E.tipracks,{excludedBy96Channel:R,excludedByLid:B}=k??{},F=m==null&&_===96&&R>0;if(s===c.ALL&&F)return{errors:[Dy()]};if(s===c.COLUMN&&F)return{errors:[My()]};if(B>0&&m==null)return{errors:[nb()]}}else m={tiprackId:u.tipRackId,well:u.tipWell};if(m==null)return{errors:[Cy()]};const h=(f?.displayCategory==="FLEX"||_===96)??!1;if(!f)return{errors:[ut({pipette:n})]};const b=t.labwareEntities[m.tiprackId]?.def,T=t.wasteChuteEntities[a]!=null,y=t.trashBinEntities[a]!=null;if(!b)return{errors:[ct({actionName:"replaceTip",labware:m.tiprackId})]};const S=r.tipState.pipettes[n]?.hasTip;if(!a||!T&&!y&&S)return{errors:[yn()]};if(vn({pipette:n,labware:m.tiprackId,invariantContext:t,prevRobotState:r}))return{errors:[pa()]};const w=Rn(m.tiprackId,r.labware);if(Cn(r.modules,w,h?c.FLEX_ROBOT_TYPE:c.OT2_ROBOT_TYPE))return{errors:[fa()]};if(!h){if(Pn(r.modules,w))return{errors:[da()]};if(Nn(r.modules,w,f))return{errors:[ma()]}}const g=l?U:O,I=[];_!==1&&e.nozzles!=null&&(e.nozzles!==p||m.tiprackId!==d)&&I.push(U(lg,{configurationParams:{primaryNozzle:o,style:e.nozzles},pipetteId:e.pipette}));const L=u?Et:Qu;let A=[g(wn,{pipette:n,dropTipLocation:a}),...I,g(cl,{pipetteId:n,labwareId:m.tiprackId,wellName:m.well,nozzles:e.nozzles,tipTrackingOption:L,primaryNozzle:o})];return T&&(A=[g(Ey,{pipetteId:e.pipette,wasteChuteId:t.wasteChuteEntities[e.dropTipLocation].id}),...I,g(cl,{pipetteId:n,labwareId:m.tiprackId,wellName:m.well,nozzles:e.nozzles,tipTrackingOption:L,primaryNozzle:o})]),y&&(A=[g(Iy,{pipetteId:n,trashLocation:t.trashBinEntities[e.dropTipLocation].location}),...I,g(cl,{pipetteId:n,labwareId:m.tiprackId,wellName:m.well,nozzles:e.nozzles,tipTrackingOption:L,primaryNozzle:o})]),ce(A,t,r)},Km=(e=0)=>e>0?[O(he,{seconds:e})]:[],_A=e=>()=>{const{invariantContext:t,pipette:r,times:n,volume:a,aspirateDelaySeconds:s,dispenseDelaySeconds:o,finalPushOut:i,aspirateFlowRateUlSec:l,dispenseFlowRateUlSec:u,positionArgs:p}=e,{pipetteEntities:d,labwareEntities:f}=t,_=d[r].pythonName;let m=null;if(p!=null){const{labware:b,well:T,wellOrigin:y,xOffset:S,yOffset:w,zOffset:g}=p,I=f[b].pythonName,L={origin:y,offset:{x:S,y:w,z:g}};m=`location=${I}[${N(T)}]${An(L)}`}const h=[`repetitions=${n}`,`volume=${a}`,...m!=null?[m]:[],`aspirate_flow_rate=${l}`,`dispense_flow_rate=${u}`,...s!=null&&s!==0?[`aspirate_delay=${s}`]:[],...o!=null&&o!==0?[`dispense_delay=${o}`]:[],...i!=null?[`final_push_out=${i}`]:[]];return{commands:[],python:`${_}.mix(
|
|
116
|
+
${Z(h.join(`,
|
|
172
117
|
`))},
|
|
173
|
-
)`}},
|
|
174
|
-
${
|
|
118
|
+
)`}},Cr=e=>{const{pipette:t,volume:r,times:n,aspirateFlowRateUlSec:a,dispenseFlowRateUlSec:s,aspirateDelaySeconds:o=0,dispenseDelaySeconds:i=0,finalPushOut:l,invariantContext:u,liquidClass:p,tiprack:d,moveToWellParams:f,generatePython:_}=e,m=_A({invariantContext:u,pipette:t,volume:r,times:n,aspirateFlowRateUlSec:a,dispenseFlowRateUlSec:s,aspirateDelaySeconds:o,dispenseDelaySeconds:i,finalPushOut:l,positionArgs:f!=null?{labware:f.labwareId,well:f.wellName,wellOrigin:f.wellLocation?.origin??c.WELL_ORIGIN_BOTTOM,xOffset:f.wellLocation?.offset?.x??0,yOffset:f.wellLocation?.offset?.y??0,zOffset:f.wellLocation?.offset?.z??0}:void 0}),h=u.pipetteEntities[t].spec,b=c.getByVolumeValue({liquidClass:p,pipetteSpecs:h,tiprackDefUri:d,targetVolume:r,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,T=c.getByVolumeValue({liquidClass:p,pipetteSpecs:h,tiprackDefUri:d,targetVolume:r,liquidHandlingAction:"singleDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,S=f!=null?[O(V,{...f,wellLocation:{...f.wellLocation}})]:[];for(let w=0;w<n;w++)S.push(O(ms,{pipetteId:t,volume:r,flowRate:a,...b>0?{correctionVolume:b}:{}}),...Km(o),O(nt,{pipetteId:t,volume:r,flowRate:s,...w<n-1?{pushOut:0}:l==null?{}:{pushOut:l},...T>0?{correctionVolume:T}:{}}),...Km(i));return[...S,..._?[m]:[]]},yA=(e,t,r)=>{const{pipette:a,labware:s,wells:o,volume:i,times:l,changeTip:u,aspirateFlowRateUlSec:p,dispenseFlowRateUlSec:d,blowoutFlowRateUlSec:f,blowoutOffsetFromTopMm:_,dropTipLocation:m,tipRack:h,positionReference:b,xOffset:T,yOffset:y,zOffset:S,finalPushOut:w,nozzles:g,primaryNozzle:I,tipsSelected:L,tiprackSelected:A,tipTracking:E}=e,k=e.aspirateDelaySeconds??0,R=e.dispenseDelaySeconds??0,B=t.pipetteEntities[a]?.spec.channels!==1;if(r.pipettes[a]==null||t.pipetteEntities[a]==null)return{errors:[ut({pipette:a})]};if(r.labware[s]==null)return{errors:[ct({actionName:"mix",labware:s})]};const F=z(r.labware[s]?.stack);if(Object.keys(t.wasteChuteEntities).length>0&&F===c.GRIPPER_WASTE_CHUTE_ADDRESSABLE_AREA)return{errors:[ha()]};const de=[...Object.keys(t.trashBinEntities),...Object.keys(t.wasteChuteEntities)],_e=de.length>0?de[0]:null,oe=Object.values(t.labwareEntities).find(({labwareDefURI:Y})=>Y===m),Se=oe!=null&&c.getIsTiprack(oe.def),ve=t.wasteChuteEntities[m]!=null,ze=t.trashBinEntities[m]!=null,Ue=r.pipettes[a]?.tipWell!=null;if(m==null||Se&&_e==null&&u!=="never"&&Ue||!Se&&!ve&&!ze)return{errors:[yn()]};if(B){const Y=wt({robotState:r,invariantContext:t,pipetteId:a,labwareId:s,wellLocationOffset:{x:T,y},wellTargetName:o[0],primaryNozzle:I,nozzleConfiguration:g}),P=wt({robotState:r,invariantContext:t,pipetteId:a,labwareId:s,wellLocationOffset:{x:T,y},wellTargetName:o[0],primaryNozzle:I,nozzleConfiguration:g});if(!Y&&!P)return{errors:[$r()]}}const J=c.LOW_VOLUME_PIPETTES.includes(t.pipetteEntities[a].name),Le=J?[U(sa,{pipetteId:a,volume:i})]:[],Ge=t.pipetteEntities[a].spec,re=E===Et&&A!=null&&L!=null&&L.length>0?qa({wellSets:L,nozzles:g,channels:Ge.channels,primaryNozzle:I}):null,W=hn(o,(Y,P)=>{let v=[];if(u==="always"||u==="once"&&P===0){const ye=re?.shift();v=[U(Ba,{pipette:a,primaryNozzle:I,dropTipLocation:Se&&_e!=null?_e:m,tipRack:h,nozzles:g,...E===Et&&ye!=null&&A!=null?{tipSelectionArgs:{tipRackId:A,tipWell:ye}}:{},isFromMixCommand:!0})]}const $=J||e.blowoutLocation!=null&&P>0?[U(qt,{pipetteId:a})]:[],C=e.touchTip?[U(Mt,{pipetteId:a,labwareId:s,wellName:Y,zOffsetFromTop:e.touchTipMmFromTop})]:[],ae=l_({pipette:e.pipette,sourceLabwareId:e.labware,sourceWell:Y,destLabwareId:e.labware,destWell:Y,blowoutLocation:e.blowoutLocation,flowRate:f,offsetFromTopMm:_,invariantContext:t}),H=[...Object.keys(t.wasteChuteEntities),...Object.keys(t.trashBinEntities)].some(ye=>ye===e.blowoutLocation)?[...C,...ae]:[...ae,...C],M=Se&&(P===o.length-1||u==="always")?[U(wn,{pipette:a,dropTipLocation:h,isReturnTip:Se})]:[],G=Cr({pipette:a,volume:i,times:l,aspirateFlowRateUlSec:p,dispenseFlowRateUlSec:d,invariantContext:t,liquidClass:null,tiprack:h,finalPushOut:w,aspirateDelaySeconds:k,dispenseDelaySeconds:R,moveToWellParams:{pipetteId:a,labwareId:s,wellName:Y,wellLocation:{origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[b],offset:{x:T,y,z:S}}},generatePython:!0});return[...v,...Le,...$,...G,...H,...M]});return ce(W,t,r)},bA=(e,t,r)=>{const{aspirateDelay:n,aspirateFlowRateUlSec:a,aspiratePositionReference:s,aspirateRetractDelay:o,aspirateRetractPositionReference:i,aspirateRetractSpeed:l,aspirateRetractXOffset:u,aspirateRetractYOffset:p,aspirateRetractZOffset:d,aspirateSubmergeDelay:f,aspirateSubmergePositionReference:_,aspirateSubmergeSpeed:m,aspirateSubmergeXOffset:h,aspirateSubmergeYOffset:b,aspirateSubmergeZOffset:T,aspirateXOffset:y,aspirateYOffset:S,aspirateZOffset:w,blowoutFlowRateUlSec:g,blowoutLocation:I,changeTip:L,destLabware:A,destWell:E,dispenseDelay:k,dispenseFlowRateUlSec:R,dispensePositionReference:B,dispenseRetractPositionReference:F,dispenseRetractXOffset:te,dispenseRetractYOffset:de,dispenseRetractZOffset:_e,dispenseSubmergeDelay:oe,dispenseSubmergePositionReference:Se,dispenseSubmergeSpeed:ve,dispenseSubmergeXOffset:ze,dispenseSubmergeYOffset:Ue,dispenseSubmergeZOffset:J,dispenseXOffset:Le,dispenseYOffset:Ge,dispenseZOffset:Be,dropTipLocation:re,liquidClass:W,mixInDestination:Y,nozzles:P,pipette:v,primaryNozzle:$,pushOut:C,sourceLabware:ae,sourceWells:q,tipRack:x,tipTracking:H,tiprackSelected:M,tipsSelected:G,touchTipAfterAspirate:ye,touchTipAfterAspirateMmFromEdge:$e,touchTipAfterAspirateOffsetMmFromTop:Xe,touchTipAfterAspirateSpeed:Ve,touchTipAfterDispense:pe,touchTipAfterDispenseMmFromEdge:Ze,touchTipAfterDispenseOffsetMmFromTop:ft,touchTipAfterDispenseSpeed:St,stepNumber:mt,volume:Oe}=e,{pipetteEntities:Qe,labwareEntities:Re,trashBinEntities:ke,wasteChuteEntities:Pe}=t,ie="consolidate",ne=[],Lt=r.pipettes[v],We=Qe[v]?.spec.channels!==1,K=e.aspirateAirGapVolume??0,Ie=e.dispenseAirGapVolume??0;Lt==null&&ne.push(ut({pipette:v})),(A==null||Re[A]==null&&ke[A]==null&&Pe[A]==null)&&ne.push(ih());const fr=z(r.labware[A]?.stack),Je=z(r.labware[ae]?.stack);Object.keys(Pe).length>0&&(fr===c.GRIPPER_WASTE_CHUTE_ADDRESSABLE_AREA||Je===c.GRIPPER_WASTE_CHUTE_ADDRESSABLE_AREA)&&ne.push(ha());const me=[...Object.keys(t.trashBinEntities),...Object.keys(t.wasteChuteEntities)],et=me.length>0?me[0]:null,Gr=Object.values(t.labwareEntities).find(({labwareDefURI:be})=>be===re),Ot=Gr!=null&&c.getIsTiprack(Gr.def),$a=t.wasteChuteEntities[re]!=null,Wr=t.trashBinEntities[re]!=null,er=r.tipState.pipettes[v]?.hasTip;(re==null||Ot&&et==null&&L!=="never"&&er||!Ot&&!$a&&!Wr)&&ne.push(yn());let ot,Q;if(L==="never"){const be=r.tipState.pipettes[v]?.tiprackURI;ot=t.labwareEntities[be??""],Q=ot?.labwareDefURI}else ot=Object.values(Re).find(({labwareDefURI:be})=>be===x),Q=x;ot==null&&(L==="never"?ne.push(Ut({actionName:ie,pipette:v})):ne.push(ct({actionName:ie,labware:Q})));const{def:Rt=null}=ot??{},{spec:Te,name:kt,pythonName:ee}=Qe[v],j=c.getAllLiquidClassDefs()[W===c.NONE_LIQUID_CLASS_NAME||W==null?c.WATER_LIQUID_CLASS_NAME:W].byPipette?.find(({pipetteModel:be})=>be===c.getFlexNameConversion(Te))?.byTipType.find(({tiprack:be})=>be===Q)??null,{aspirate:it}=j??{},{multiWellHandling:fe}=wc({pipetteSpecs:Te,tiprackDefinition:Rt,volume:Oe,path:"multiAspirate",numAspirateWells:q.length,numDispenseWells:1,aspirateAirGapByVolume:it?.retract.airGapByVolume??[],conditioningByVolume:null,disposalByVolume:null}),{numWellsToFitInTip:tt}=fe;if((!fe.isSupported||tt==null||tt===1)&&ne.push(Jy()),We&&P!==c.ALL){const be=wt({robotState:r,invariantContext:t,pipetteId:v,labwareId:ae,wellLocationOffset:{x:y,y:S},primaryNozzle:$,nozzleConfiguration:P}),le=wt({robotState:r,invariantContext:t,pipetteId:v,labwareId:A,wellLocationOffset:{x:Le,y:Ge},primaryNozzle:$,nozzleConfiguration:P});!be&&!le&&ne.push($r())}const $t=E!=null?Re[ae]?.def.wells[E]?.depth:null,vt=c.getMmFromBottom(Be,B,$t),Yr=c.getMmFromBottom(J,Se,$t),tr=c.getMmFromBottom(_e,F,$t);if(vt!=null&&Yr!=null&&vt>Yr&&ne.push(Zy()),vt!=null&&tr!=null&&vt>tr&&ne.push(Qy()),ne.length>0)return{errors:ne};const{tipracks:mr}=Ua(v,Q,t,r,$,P),rr=c.getByVolumeValue({liquidClass:W,pipetteSpecs:Te,tiprackDefUri:Q,targetVolume:Oe,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Ee=ke[A]?.pythonName??Pe[A]?.pythonName,Pt=ke[re]?.pythonName??Pe[re]?.pythonName,hr=I==null?null:ke[I]?.pythonName??Pe[I]?.pythonName,_r=Re[ae].pythonName,Kr=Re[A]?.pythonName,yr=q.map(be=>`${_r}[${N(be)}]`).join(", "),Xr=e.destWell!=null&&Kr!=null?`${Kr}[${N(e.destWell)}]`:null,Zr=[`name=${N(`${e.commandCreatorFnName}_step_${mt}`)}`,...W!=null?[`base_liquid_class=${Fa(W,!0)}`]:[],`properties=${As({args:e,pipetteName:c.isFlexPipette(kt)?c.getFlexNameConversion(Te):kt,tiprackUri:Q,liquidClassValuesForTip:j})}`],Fn=`${ge}.define_liquid_class(
|
|
119
|
+
${Z(Zr.join(`,
|
|
175
120
|
`))},
|
|
176
|
-
)`,
|
|
177
|
-
${
|
|
121
|
+
)`,br=H===Et&&M!=null&&G!=null&&G.length>0?qa({wellSets:G,nozzles:P,channels:Te.channels,primaryNozzle:$}):null,nr=M!=null?Re[M]?.pythonName:null,Un=br?.map(be=>`${nr}[${N(be)}]`).join(", "),Qr=[`volume=${Oe}`,`source=[${yr}]`,`dest=${Xr!=null?`[${Xr}]`:Ee}`,`new_tip=${N(Ls(L))}`,...Ot?["return_tip=True",...hr!=null?[`trash_location=${hr}`]:[]]:[`trash_location=${Pt}`,"keep_last_tip=True"],...Te.channels>1?["group_wells=False"]:[],...mr.filteredSortedTiprackIds.length>0?[Ss({labwareEntities:Re,tiprackIds:mr.filteredSortedTiprackIds})]:[],`liquid_class=${Fn}`,...br!=null&&nr!=null?[`tips=[${Un}]`]:[]],Bn=()=>({commands:[],python:`${ee}.consolidate_with_liquid_class(
|
|
122
|
+
${Z(Qr.join(`,
|
|
178
123
|
`))},
|
|
179
|
-
)`}),
|
|
180
|
-
${
|
|
124
|
+
)`}),Tr=gy(q,tt),Va=c.LOW_VOLUME_PIPETTES.includes(kt)?[O(sa,{pipetteId:v,volume:Oe})]:[],ar={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[Se],offset:{x:ze,y:Ue,z:J}},$n={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[F],offset:{x:te,y:de,z:_e}},Vt=n!=null?[O(he,{seconds:n.seconds})]:[],gr=c.getByVolumeValue({liquidClass:W,pipetteSpecs:Te,tiprackDefUri:Q,targetVolume:Ie,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Ir=k!=null?[O(he,{seconds:k.seconds})]:[],Vn=c.getByVolumeValue({liquidClass:W,pipetteSpecs:Te,tiprackDefUri:Q,targetVolume:K,liquidHandlingAction:"aspirate",byVolumeProperty:"flowRateByVolume",defaultValue:null})??a,Jr=c.getByVolumeValue({liquidClass:W,pipetteSpecs:Te,tiprackDefUri:Q,targetVolume:K,liquidHandlingAction:"singleDispense",byVolumeProperty:"flowRateByVolume",defaultValue:null})??R,xn=c.getByVolumeValue({liquidClass:W,pipetteSpecs:Te,tiprackDefUri:Q,targetVolume:Ie,liquidHandlingAction:"aspirate",byVolumeProperty:"flowRateByVolume",defaultValue:null})??a,en=c.getByVolumeValue({liquidClass:W,pipetteSpecs:Te,tiprackDefUri:Q,targetVolume:Ie,liquidHandlingAction:"singleDispense",byVolumeProperty:"flowRateByVolume",defaultValue:null})??R,sr=Fr({retractZOffset:_e,retractPositionReference:F,labwareId:A,labwareEntities:Re,well:E}),Er=!sr&&E!=null?[O(V,{pipetteId:v,labwareId:A,wellName:E,wellLocation:c.SAFE_MOVE_TO_WELL_LOCATION})]:[],xa=[...hn(Tr,(be,le)=>{const ht=(Ae,jt=!0)=>Ie>0&&!(L==="never"&&Ne&&Ae)?[...jt?Er:[],O(qt,{pipetteId:v}),O(Zt,{pipetteId:v,volume:Ie,flowRate:xn,...gr>0?{correctionVolume:gr}:{}}),...Vt]:[],_t=Ae=>E!=null&&pe?[O(Mt,{pipetteId:v,labwareId:A,wellName:E,...Ze!=null?{mmFromEdge:Ze}:{},zOffsetFromTop:ft,...St!=null?{speed:St}:{}}),...ht(Ae).length>0&&sr?[O(V,{pipetteId:v,labwareId:A,wellName:E,wellLocation:$n})]:[]]:[],we=le===0,Ne=le===Tr.length-1,jn=be.length,ue=Oe*jn,rt=L==="always"||L==="once"&&we;let or=[];if(rt){const Ae=br?.shift();or=[U(Ba,{pipette:v,primaryNozzle:$,nozzles:P,dropTipLocation:Ot&&et!=null?et:re,tipRack:Q,...H===Et&&Ae!=null&&M!=null?{tipSelectionArgs:{tipRackId:M,tipWell:Ae}}:{}})]}const wr=hn(be,(Ae,jt)=>{const Or=jt===0;let bt=0,zt=R;Or&&!rt&&!we?(bt=Ie,zt=en):Or||(bt=K,zt=Jr);const Yn={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[_],offset:{x:h,y:b,z:T}},nn={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[i],offset:{x:u,y:p,z:d}},an=Fr({retractZOffset:d,retractPositionReference:i,labwareId:ae,labwareEntities:Re,well:Ae}),Kn=!an&&Ae!=null?[O(V,{pipetteId:v,labwareId:ae,wellName:Ae,wellLocation:c.SAFE_MOVE_TO_WELL_LOCATION})]:[],sn=c.getByVolumeValue({liquidClass:W,pipetteSpecs:Te,tiprackDefUri:Q,targetVolume:bt,liquidHandlingAction:"singleDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Rr=Or?[...c.LOW_VOLUME_PIPETTES.includes(t.pipetteEntities[v].name)?[O(sa,{pipetteId:v,volume:ue})]:[],O(qt,{pipetteId:v})]:[],Xn=bt>0?[O(nt,{pipetteId:v,volume:bt,flowRate:zt,...sn>0?{correctionVolume:sn}:{},isAirGap:!0,pushOut:0}),...Ir]:[],kr=[...[O(V,{pipetteId:v,labwareId:ae,wellName:Ae,wellLocation:c.SAFE_MOVE_TO_WELL_LOCATION})],...Xn,...Rr],on=[O(V,{pipetteId:v,labwareId:ae,wellName:Ae,wellLocation:Yn}),O(V,{pipetteId:v,labwareId:ae,...m!=null?{speed:m}:{},wellName:Ae,wellLocation:{origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[s],offset:{x:y,y:S,z:w}}}),...f!=null&&f.seconds>0?[O(he,{seconds:f.seconds})]:[]],ur=ye?[O(Mt,{pipetteId:v,labwareId:ae,wellName:Ae,...$e!=null?{mmFromEdge:$e}:{},zOffsetFromTop:Xe,...Ve!=null?{speed:Ve}:{}}),...K>0&&an?[O(V,{pipetteId:v,labwareId:ae,wellName:Ae,wellLocation:nn})]:[]]:[],vr=c.getByVolumeValue({liquidClass:W,pipetteSpecs:Te,tiprackDefUri:Q,targetVolume:K,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Gt=K>0?[...Kn,O(Zt,{pipetteId:v,volume:K,flowRate:Vn,...vr>0?{correctionVolume:vr}:{}}),...Vt]:[],cr=[O(ms,{pipetteId:v,volume:Oe,flowRate:a,correctionVolume:rr}),...Vt],Zn=[O(V,{pipetteId:v,labwareId:ae,...l!=null?{speed:l}:{},wellName:Ae,wellLocation:nn}),...o!=null&&o?.seconds>0?[O(he,{seconds:o.seconds})]:[]];return[...kr,...on,...cr,...Zn,...ur,...Gt]}),Ar=E!=null?[O(V,{pipetteId:v,labwareId:A,wellName:E,wellLocation:c.SAFE_MOVE_TO_WELL_LOCATION}),O(V,{pipetteId:v,labwareId:A,wellName:E,wellLocation:ar,...ve!=null?{speed:ve}:{}})]:[O(qe,{pipetteId:v,fixtureId:A,offset:{x:0,y:0,z:0}})],zn=c.getByVolumeValue({liquidClass:W,pipetteSpecs:Te,tiprackDefUri:Q,targetVolume:K,liquidHandlingAction:"singleDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Gn=K>0?[O(nt,{pipetteId:v,volume:K,flowRate:Jr,pushOut:0,correctionVolume:zn,isAirGap:!0}),...Ir]:[],yt=E!=null?[O(V,{pipetteId:v,labwareId:A,wellName:E,wellLocation:ar}),O(V,{pipetteId:v,labwareId:A,...ve!=null?{speed:ve}:{},wellName:E,wellLocation:{origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[B],offset:{x:Le,y:Ge,z:Be}}}),...oe!=null&&oe.seconds>0?[O(he,{seconds:oe.seconds})]:[]]:[],Wn=c.getByVolumeValue({liquidClass:W,pipetteSpecs:Te,tiprackDefUri:Q,targetVolume:ue,liquidHandlingAction:"singleDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,ir=Y!=null?0:C,Sr=[O(nt,{pipetteId:v,volume:ue,flowRate:R,...ir!=null?{pushOut:ir}:{},correctionVolume:Wn}),...Ir],xt=(Y!=null?c.getByVolumeValue({liquidClass:W,pipetteSpecs:Te,tiprackDefUri:Q,targetVolume:Y.volume,liquidHandlingAction:"aspirate",byVolumeProperty:"flowRateByVolume",defaultValue:null}):a)??a,Ht=(Y!=null?c.getByVolumeValue({liquidClass:W,pipetteSpecs:Te,tiprackDefUri:Q,targetVolume:Y.volume,liquidHandlingAction:"singleDispense",byVolumeProperty:"flowRateByVolume",defaultValue:null}):R)??R,tn=Y!=null?Cr({pipette:v,volume:Y.volume,times:Y.times,aspirateFlowRateUlSec:xt,dispenseFlowRateUlSec:Ht,aspirateDelaySeconds:n?.seconds,dispenseDelaySeconds:k?.seconds,finalPushOut:C,invariantContext:t,liquidClass:W,tiprack:Q,generatePython:!1}):[],Lr=[O(Sa,{pipetteId:v,flowRate:g})];let lr=[];I==null||I===Hr?lr=[..._t(!0),...ht(!0)]:I===Sn&&E!=null?lr=[O(V,{pipetteId:v,labwareId:A,wellName:E,wellLocation:{origin:c.WELL_ORIGIN_TOP}}),...Lr,..._t(!0),...ht(!0)]:lr=[..._t(!1),...ht(!1),O(qe,{pipetteId:v,fixtureId:Object.values(ke).length>0?Object.values(ke)[0].id:Object.values(Pe)[0].id,offset:{x:0,y:0,z:0}}),...Lr,...ht(!0,!1)];const rn=Ot&&(le===Tr.length-1||L==="always")?[O(wn,{pipette:v,dropTipLocation:Q,isReturnTip:Ot})]:[];return[...or,...Va,...wr,...Ar,...Gn,...yt,...Sr,...tn,...lr,...rn]}),Bn];return ce(xa,t,r)},TA=(e,t,r)=>{const{pipetteId:n,trashId:a,flowRate:s,volume:o}=e,{pipetteEntities:i,trashBinEntities:l}=t,u=l[a],p=i[n].pythonName,d=u.pythonName,f=[`volume=${o}`,`location=${d}`,`rate=${s} / ${p}.flow_rate.dispense`],_=()=>({commands:[],python:`${p}.dispense(
|
|
125
|
+
${Z(f.join(`,
|
|
181
126
|
`))},
|
|
182
|
-
)`}),
|
|
183
|
-
${
|
|
127
|
+
)`}),m=[O(qe,{pipetteId:n,fixtureId:a,offset:It}),O(nt,{pipetteId:n,volume:o,flowRate:s}),_];return ce(m,t,r)},gA=(e,t,r)=>{const{pipetteId:n,flowRate:a,volume:s,wasteChuteId:o}=e,{pipetteEntities:i,wasteChuteEntities:l}=t,u=l[o].pythonName,p=i[n].pythonName,d=[`volume=${s}`,`location=${u}`,`rate=${a} / ${p}.flow_rate.dispense`],f=()=>({commands:[],python:`${p}.dispense(
|
|
128
|
+
${Z(d.join(`,
|
|
184
129
|
`))},
|
|
185
|
-
)`}),
|
|
186
|
-
${
|
|
130
|
+
)`}),_=[O(qe,{pipetteId:n,fixtureId:o,offset:It}),O(nt,{pipetteId:n,flowRate:a,volume:s}),f];return ce(_,t,r)},IA=(e,t,r)=>{const{aspirateDelay:n,aspirateFlowRateUlSec:a,aspiratePositionReference:s,aspirateRetractDelay:o,aspirateRetractPositionReference:i,aspirateRetractSpeed:l,aspirateRetractXOffset:u,aspirateRetractYOffset:p,aspirateRetractZOffset:d,aspirateSubmergeDelay:f,aspirateSubmergePositionReference:_,aspirateSubmergeSpeed:m,aspirateSubmergeXOffset:h,aspirateSubmergeYOffset:b,aspirateSubmergeZOffset:T,aspirateXOffset:y,aspirateYOffset:S,aspirateZOffset:w,blowoutFlowRateUlSec:g,blowoutLocation:I,changeTip:L,destLabware:A,destWells:E,dispenseDelay:k,dispenseFlowRateUlSec:R,dispensePositionReference:B,dispenseRetractDelay:F,dispenseRetractPositionReference:te,dispenseRetractSpeed:de,dispenseRetractXOffset:_e,dispenseRetractYOffset:oe,dispenseRetractZOffset:Se,dispenseSubmergeDelay:ve,dispenseSubmergePositionReference:ze,dispenseSubmergeSpeed:Ue,dispenseSubmergeXOffset:J,dispenseSubmergeYOffset:Le,dispenseSubmergeZOffset:Ge,dispenseXOffset:Be,dispenseYOffset:re,dispenseZOffset:W,dropTipLocation:Y,liquidClass:P,mixBeforeAspirate:v,nozzles:$,pipette:C,preWetTip:ae,primaryNozzle:q,pushOut:x,sourceLabware:H,sourceWell:M,tipRack:G,tipTracking:ye,tiprackSelected:$e,tipsSelected:Xe,touchTipAfterAspirate:Ve,touchTipAfterAspirateMmFromEdge:pe,touchTipAfterAspirateOffsetMmFromTop:Ze,touchTipAfterAspirateSpeed:ft,touchTipAfterDispense:St,touchTipAfterDispenseMmFromEdge:mt,touchTipAfterDispenseOffsetMmFromTop:Oe,touchTipAfterDispenseSpeed:Qe,stepNumber:Re,volume:ke}=e,{pipetteEntities:Pe,labwareEntities:ie,trashBinEntities:ne,wasteChuteEntities:Lt}=t,We="distribute",K=[],Ie=Pe[C]?.spec.channels!==1,fr=ie[H]?.def.parameters.quirks?.includes("touchTipDisabled"),Je=e.aspirateAirGapVolume??0,Me=e.dispenseAirGapVolume??0,me=e.disposalVolume!=null&&e.disposalVolume>0?e.disposalVolume:0,et=e.conditioningVolume!=null&&e.conditioningVolume>0?e.conditioningVolume:0;(r.pipettes[C]==null||Pe[C]==null)&&K.push(ut({pipette:C})),(!H||!r.labware[H])&&K.push(ct({actionName:We,labware:H}));const Gr=z(r.labware[A]?.stack),Ot=z(r.labware[H]?.stack);Object.keys(Lt).length>0&&(Gr===c.GRIPPER_WASTE_CHUTE_ADDRESSABLE_AREA||Ot===c.GRIPPER_WASTE_CHUTE_ADDRESSABLE_AREA)&&K.push(ha());const Wr=[...Object.keys(t.trashBinEntities),...Object.keys(t.wasteChuteEntities)],er=Wr.length>0?Wr[0]:null,ot=Object.values(t.labwareEntities).find(({labwareDefURI:ue})=>ue===Y),Q=ot!=null&&c.getIsTiprack(ot.def),Rt=t.wasteChuteEntities[Y]!=null,Te=t.trashBinEntities[Y]!=null,kt=r.tipState.pipettes[C]?.hasTip;(Y==null||Q&&er==null&&L!=="never"&&kt||!Q&&!Rt&&!Te)&&K.push(yn());let ee,j;if(L==="never"){const ue=r.tipState.pipettes[C]?.tiprackURI;ee=t.labwareEntities[ue??""],j=ee?.labwareDefURI}else ee=Object.values(ie).find(({labwareDefURI:ue})=>ue===G),j=G;ee==null&&(L==="never"?K.push(Ut({actionName:We,pipette:C})):K.push(ct({actionName:We,labware:j})));const{def:it=null}=ee??{},{spec:fe,name:tt,pythonName:$t}=Pe[C],vt=c.getAllLiquidClassDefs()[P===c.NONE_LIQUID_CLASS_NAME||P==null?c.WATER_LIQUID_CLASS_NAME:P].byPipette?.find(({pipetteModel:ue})=>ue===c.getFlexNameConversion(fe))?.byTipType.find(({tiprack:ue})=>ue===j)??null,{aspirate:Yr,multiDispense:tr}=vt??{},{multiWellHandling:mr}=wc({pipetteSpecs:fe,tiprackDefinition:it,volume:ke,path:"multiDispense",numAspirateWells:1,numDispenseWells:E.length,conditioningByVolume:tr?.conditioningByVolume??[],disposalByVolume:tr?.disposalByVolume??[],aspirateAirGapByVolume:Yr?.retract.airGapByVolume??[]}),{numWellsToFitInTip:rr}=mr;if((!mr.isSupported||rr==null||rr===1)&&K.push(eb()),Ie&&$!==c.ALL){const ue=wt({robotState:r,invariantContext:t,pipetteId:C,labwareId:H,wellLocationOffset:{x:y,y:S},wellTargetName:M,primaryNozzle:q,nozzleConfiguration:$}),rt=wt({robotState:r,invariantContext:t,pipetteId:C,labwareId:A,wellLocationOffset:{x:Be,y:re},wellTargetName:E[0],primaryNozzle:q,nozzleConfiguration:$});!ue&&!rt&&K.push($r())}const Ee=t.labwareEntities[H]?.def.wells[M]?.depth??null,Pt=c.getMmFromBottom(w,s,Ee),hr=c.getMmFromBottom(T,_,Ee),_r=c.getMmFromBottom(d,i,Ee);Pt!=null&&hr!=null&&Pt>hr&&K.push(lh()),Pt!=null&&_r!=null&&Pt>_r&&K.push(uh());const Kr=[O(V,{pipetteId:C,labwareId:H,wellName:M,wellLocation:c.SAFE_MOVE_TO_WELL_LOCATION})],yr=Os(C,t,j)-Je;if(Math.floor((yr-me)/ke)===0&&K.push(Xa({actionName:We,volume:ke,maxVolume:yr,disposalVolume:me})),K.length>0)return{errors:K};const{tipracks:Zr}=Ua(C,j,t,r,q,$),Fn=c.getByVolumeValue({liquidClass:P,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:ke,liquidHandlingAction:"multiDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,qn=ne[A]?.pythonName??Lt[A]?.pythonName,br=ne[Y]?.pythonName??Lt[Y]?.pythonName,nr=I==null?null:ne[I]?.pythonName??Lt[I]?.pythonName,Un=ie[H].pythonName,Qr=ie[A]?.pythonName,Bn=`${Un}[${N(e.sourceWell)}]`,Tr=e.destWells.map(ue=>`${Qr}[${N(ue)}]`).join(", "),Va=[`name=${N(`${e.commandCreatorFnName}_step_${Re}`)}`,...P!=null?[`base_liquid_class=${Fa(P,!0)}`]:[],`properties=${As({args:e,pipetteName:c.isFlexPipette(tt)?c.getFlexNameConversion(fe):tt,tiprackUri:j,liquidClassValuesForTip:vt})}`],ar=`${ge}.define_liquid_class(
|
|
131
|
+
${Z(Va.join(`,
|
|
187
132
|
`))},
|
|
188
|
-
)`,
|
|
189
|
-
${
|
|
133
|
+
)`,Vt=ye===Et&&$e!=null&&Xe!=null&&Xe.length>0?qa({wellSets:Xe,nozzles:$,channels:fe.channels,primaryNozzle:q}):null,gr=$e!=null?ie[$e]?.pythonName:null,Ir=Vt?.map(ue=>`${gr}[${N(ue)}]`).join(", "),Vn=[`volume=${ke}`,`source=[${Bn}]`,`dest=[${Tr??qn}]`,`new_tip=${N(Ls(L))}`,...Q?["return_tip=True",...nr!=null?[`trash_location=${nr}`]:[]]:[`trash_location=${br}`,"keep_last_tip=True"],...fe.channels>1?["group_wells=False"]:[],...Zr.filteredSortedTiprackIds.length>0?[Ss({labwareEntities:ie,tiprackIds:Zr.filteredSortedTiprackIds})]:[],`liquid_class=${ar}`,...Vt!=null&&gr!=null?[`tips=[${Ir}]`]:[]],Jr=()=>({commands:[],python:`${$t}.distribute_with_liquid_class(
|
|
134
|
+
${Z(Vn.join(`,
|
|
190
135
|
`))},
|
|
191
|
-
)`}),jn={origin:f.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[y],offset:{x:h,y:g,z:T}},Jr={origin:f.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[s],offset:{x:u,y:c,z:p}},rr={origin:f.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[x],offset:{x:w,y:R,z:E}},_r={origin:f.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[fe],offset:{x:ge,y:le,z:re}},$n=f.getByVolumeValue({liquidClass:P,pipetteSpecs:De,tiprackDefUri:Te,targetVolume:nt,liquidHandlingAction:"aspirate",byVolumeProperty:"flowRateByVolume",defaultValue:null})??a,ja=f.getByVolumeValue({liquidClass:P,pipetteSpecs:De,tiprackDefUri:Te,targetVolume:nt,liquidHandlingAction:"multiDispense",byVolumeProperty:"flowRateByVolume",defaultValue:null})??$,Ue=f.getByVolumeValue({liquidClass:P,pipetteSpecs:De,tiprackDefUri:Te,targetVolume:Ke,liquidHandlingAction:"aspirate",byVolumeProperty:"flowRateByVolume",defaultValue:null})??a,Le=f.getByVolumeValue({liquidClass:P,pipetteSpecs:De,tiprackDefUri:Te,targetVolume:Ke,liquidHandlingAction:"multiDispense",byVolumeProperty:"flowRateByVolume",defaultValue:null})??$,ht=q_(N,Qt),yt=Nr({retractZOffset:p,retractPositionReference:s,labwareId:de,labwareEntities:me,well:J}),Ve=!yt&&J!=null?[j(ye,{pipetteId:H,labwareId:de,wellName:J,wellLocation:f.SAFE_MOVE_TO_WELL_LOCATION})]:[],xn=[...dn(ht,(Re,it)=>{const nr=Re.length,Tr=se*nr,Er=Tr+Fe+at,Vn=it===0,Hn=it===ht.length-1,bt=v==="always"||v==="once"&&Vn,Gn=f.LOW_VOLUME_PIPETTES.includes(ot)?[j(na,{pipetteId:H,volume:Er})]:[];let ar=[];if(bt){const ze=Bt?.shift();ar=[ae(Ma,{pipette:H,nozzles:z,primaryNozzle:K,dropTipLocation:Ie&&Zt!=null?Zt:q,tipRack:Te,...B===wt&&ze!=null&&qe!=null?{tipSelectionArgs:{tipRackId:qe,tipWell:ze}}:{}})]}const wr=[j(qt,{pipetteId:H})],jt=f.getByVolumeValue({liquidClass:P,pipetteSpecs:De,tiprackDefUri:Te,targetVolume:Ke,liquidHandlingAction:"multiDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,$t=V!=null?[j(Me,{seconds:V.seconds})]:[],Qr=Ke>0&&!bt&&!Vn&&Fe===0&&O==null?[j(st,{isAirGap:!0,pipetteId:H,volume:Ke,flowRate:Le,...jt>0?{correctionVolume:jt}:{},pushOut:0}),...$t]:[],Ir=[...Wr,...Qr,...Gn,...wr],or=[j(ye,{pipetteId:H,labwareId:de,wellName:J,wellLocation:jn}),j(ye,{pipetteId:H,labwareId:de,...b!=null?{speed:b}:{},wellName:J,wellLocation:{origin:f.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[o],offset:{x:m,y:_,z:I}}}),...d!=null&&d.seconds>0?[j(Me,{seconds:d.seconds})]:[]],en=oe?Pr({pipette:H,volume:Tr,times:1,aspirateFlowRateUlSec:a,dispenseFlowRateUlSec:$,aspirateDelaySeconds:n?.seconds??0,dispenseDelaySeconds:V?.seconds??0,finalPushOut:0,invariantContext:t,liquidClass:P,tiprack:Te,generatePython:!1}):[],He=D!=null?Pr({pipette:H,volume:D.volume,times:D.times,aspirateFlowRateUlSec:a,dispenseFlowRateUlSec:$,aspirateDelaySeconds:n?.seconds,dispenseDelaySeconds:V?.seconds,finalPushOut:0,invariantContext:t,liquidClass:P,tiprack:Te,generatePython:!1}):[],xt=n!=null?[j(Me,{seconds:n.seconds})]:[],Sr=Ce?[j(Ct,{pipetteId:H,labwareId:de,wellName:J,...Ee!=null?{mmFromEdge:Ee}:{},zOffsetFromTop:k,...F!=null?{speed:F}:{}}),...nt>0&&yt?[j(ye,{pipetteId:H,labwareId:de,wellName:J,wellLocation:Jr})]:[]]:[],gt=f.getByVolumeValue({liquidClass:P,pipetteSpecs:De,tiprackDefUri:Te,targetVolume:nt,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Vt=nt>0?[...Ve,j(Yt,{pipetteId:H,volume:nt,flowRate:$n,...gt>0?{correctionVolume:gt}:{}}),...xt]:[],zn=f.getByVolumeValue({liquidClass:P,pipetteSpecs:De,tiprackDefUri:Te,targetVolume:Er,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,tn=f.getByVolumeValue({liquidClass:P,pipetteSpecs:De,tiprackDefUri:Te,targetVolume:at,liquidHandlingAction:"multiDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,rn=at!=null&&at>0?[j(st,{pipetteId:H,volume:at,flowRate:$,correctionVolume:tn,pushOut:0}),...$t]:[],Wn=[j(mo,{pipetteId:H,volume:Er,flowRate:a,correctionVolume:zn}),...xt,...rn],nn=[j(ye,{pipetteId:H,labwareId:de,...l!=null?{speed:l}:{},wellName:J,wellLocation:Jr}),...i!=null&&i?.seconds>0?[j(Me,{seconds:i.seconds})]:[]],Ar=dn(Re,(ze,Or)=>{const an=Or===0,ir=Or===Re.length-1,vr=Hn&&ir;let Ht=0,sr=$;an&&nt>0?(Ht=nt,sr=ja):!an&&Ke>0&&at===0&&(Ht=Ke,sr=Le);const Kn=f.getByVolumeValue({liquidClass:P,pipetteSpecs:De,tiprackDefUri:Te,targetVolume:Ht,liquidHandlingAction:"multiDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,$a=Nr({retractZOffset:re,retractPositionReference:fe,labwareId:C,labwareEntities:me,well:ze}),Co=$a?[]:[j(ye,{pipetteId:H,labwareId:C,wellName:ze,wellLocation:f.SAFE_MOVE_TO_WELL_LOCATION})],xa=ze!=null?[j(ye,{pipetteId:H,labwareId:C,wellName:ze,wellLocation:rr}),...Ht>0?[j(st,{isAirGap:!0,pipetteId:H,volume:Ht,flowRate:sr,pushOut:0,correctionVolume:Kn}),...$t]:[],j(ye,{pipetteId:H,labwareId:C,...W!=null?{speed:W}:{},wellName:ze,wellLocation:{origin:f.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[G],offset:{x:A,y:L,z:M}}}),...U!=null&&U.seconds>0?[j(Me,{seconds:U.seconds})]:[]]:[j(Xe,{fixtureId:C,pipetteId:H,offset:{x:0,y:0,z:0}})],Xn=Fe===0&&ir?ue:0,_t=[j(st,{pipetteId:H,volume:se,flowRate:$,...Xn!=null?{pushOut:Xn}:{},correctionVolume:Dn}),...$t],on=ze!=null?[j(ye,{pipetteId:H,labwareId:C,...be!=null?{speed:be}:{},wellName:ze,wellLocation:_r}),...X!=null&&X?.seconds>0?[j(Me,{seconds:X.seconds})]:[]]:[],Pt=ir?[j(Ea,{pipetteId:H,flowRate:S})]:[],Va=f.getByVolumeValue({liquidClass:P,pipetteSpecs:De,tiprackDefUri:Te,targetVolume:Ke,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,kt=(Zn,z_=!0)=>Ke>0&&!(Or<Re.length-1&&at>0)&&!(v==="never"&&vr&&Zn)?[...z_?Co:[],j(qt,{pipetteId:H}),j(Yt,{pipetteId:H,volume:Ke,flowRate:Ue,...Va>0?{correctionVolume:Va}:{}}),...xt]:[],Tt=Zn=>ze!=null&&Y?[j(Ct,{pipetteId:H,labwareId:C,wellName:ze,...Q!=null?{mmFromEdge:Q}:{},zOffsetFromTop:Z,...ie!=null?{speed:ie}:{}}),...kt(Zn).length>0&&$a?[j(ye,{pipetteId:H,labwareId:C,wellName:ze,wellLocation:_r})]:[]]:[];let Lr=[];if(O==null||!ir)Lr=[...Tt(!0),...kt(!0)];else if(O===In)Lr=[j(ye,{pipetteId:H,labwareId:C,wellName:ze,wellLocation:{origin:f.WELL_ORIGIN_TOP}}),...Pt,...Tt(!0),...kt(!0)];else if(O===$r){const Zn=kt(!0);Lr=[...Tt(!1),...kt(!1),j(ye,{pipetteId:H,labwareId:de,wellName:J,wellLocation:{origin:f.WELL_ORIGIN_TOP}}),...Pt,...Y&&!rt?[j(Ct,{pipetteId:H,labwareId:de,wellName:J,...Q!=null?{mmFromEdge:Q}:{},zOffsetFromTop:Z,...ie!=null?{speed:ie}:{}})]:[],...Zn.length>0?[j(ye,{pipetteId:H,labwareId:de,wellName:J,wellLocation:{origin:f.WELL_ORIGIN_TOP}})]:[],...kt(!0,!1)]}else Lr=[...Tt(!1),...kt(!1),j(Xe,{pipetteId:H,fixtureId:Object.values(he).length>0?Object.values(he)[0].id:Object.values(Ze)[0].id,offset:{x:0,y:0,z:0}}),...Pt,...kt(!0,!1)];return[...xa,..._t,...on,...Lr]}),Yn=Ie&&(it===ht.length-1||v==="always")?[j(wn,{pipette:H,dropTipLocation:Te,isReturnTip:Ie})]:[];return[...ar,...Ir,...or,...He,...en,...Wn,...nn,...Sr,...Vt,...Ar,...Yn]}),Zr];return Ne(xn,t,r)},GO=(e,t,r)=>{const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"heaterShaker/closeLabwareLatch",key:ne(),params:{moduleId:e.moduleId}}],python:`${n}.close_labware_latch()`}},rb=(e,t,r)=>{const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"heaterShaker/deactivateHeater",key:ne(),params:{moduleId:e.moduleId}}],python:`${n}.deactivate_heater()`}},zO=["1","4","7","10"],WO=(e,t,r)=>{const{pipetteEntities:n,labwareEntities:a,moduleEntities:o}=t,i=r.modules[e.moduleId].slot,s=Object.keys(n)[0],l=n[s]?.spec;if(!((l?.displayCategory==="FLEX"||l?.channels===96)??!1)&&l_(r.labware,a,i)){const p=zO.includes(i)?"right":"left";return{errors:[iT(p)]}}const c=o[e.moduleId].pythonName;return{commands:[{commandType:"heaterShaker/openLabwareLatch",key:ne(),params:{moduleId:e.moduleId}}],python:`${c}.open_labware_latch()`}},YO=(e,t,r)=>{const{moduleEntities:n}=t,{moduleId:a,rpm:o}=e;if(a===null)return{errors:[ke()]};jr(n[a]?.type===f.HEATERSHAKER_MODULE_TYPE,`expected module ${a} to be heaterShaker, got ${n[a]?.type}`);const i=n[a].pythonName;return{commands:[{commandType:"heaterShaker/setAndWaitForShakeSpeed",key:ne(),params:{moduleId:a,rpm:o}}],python:`${i}.set_and_wait_for_shake_speed(${o})`}},nb=(e,t,r)=>{const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"heaterShaker/deactivateShaker",key:ne(),params:{moduleId:e.moduleId}}],python:`${n}.deactivate_shaker()`}},KO=(e,t,r)=>{const{timerHours:n,timerMinutes:a,timerSeconds:o,latchOpen:i,targetTemperature:s,rpm:l}=e;if(e.moduleId==null)return{errors:[ke()]};const u=St(r,e.moduleId),c=e.moduleId??"";if(u==null)return{errors:[ke()]};const p=[];if(i||p.push(ae(GO,{moduleId:c})),s===null?p.push(ae(rb,{moduleId:c})):p.push(ae(bg,{moduleId:c,celsius:s})),l===null&&"targetSpeed"in u&&u.targetSpeed!==null?p.push(ae(nb,{moduleId:c})):l!==null&&p.push(ae(YO,{moduleId:c,rpm:l})),[n,a,o].some(y=>y!=null&&y!==0)){s!==null&&p.push(ae(gg,{moduleId:c,celsius:s}));const y=(n??0)*3600+(a??0)*60+(o??0);p.push(ae(Me,{seconds:y})),p.push(ae(nb,{moduleId:c})),p.push(ae(rb,{moduleId:c}))}return i&&p.push(ae(WO,{moduleId:c})),Ne(p,t,r)},U_=(e,t,r)=>{const{moduleId:n}=e,{moduleEntities:a,labwareEntities:o}=t,i=[],s=a[n].pythonName,u=Object.values(r.labware).filter(d=>d.stack.includes(n)).find(d=>d.stack.find(y=>o[y]?.def.allowedRoles?.includes("lid")&&o[y]?.def.parameters.loadName!=="opentrons_tough_pcr_auto_sealing_lid")),c=u!=null?Op(u.stack):null,p=c!=null?o[c].def.metadata.displayName:null;return p!=null&&i.push(hT({lidDisplayName:p})),i.length>0?{errors:i}:{commands:[{commandType:"thermocycler/closeLid",key:ne(),params:{moduleId:n}}],python:`${s}.close_lid()`}},B_=(e,t,r)=>{const{moduleId:n,celsius:a}=e,o=t.moduleEntities[n].pythonName;return{commands:[{commandType:"thermocycler/setTargetLidTemperature",key:ne(),params:{moduleId:n,celsius:a}}],python:`${o}.set_lid_temperature(${a})`}},XO=(e,t,r)=>{const{moduleId:n,profileElements:a,profileTargetLidTemp:o,profileVolume:i}=e,s=No(r,n);if(s===null)return{errors:[ke()]};const l=t.moduleEntities[n].pythonName,u=[];s.lidOpen!==!1&&u.push(ae(U_,{moduleId:n})),o!==s.lidTargetTemp&&u.push(ae(B_,{moduleId:n,celsius:o}));const c=`${l}_task_${s.numProfilesStarted+1}`;return u.push(ae(cI,{moduleId:n,profileElements:a,blockMaxVolumeUl:i,taskId:c})),Ne(u,t,r)},ZO=()=>({lidOpen:!1,lidClosed:!1,setBlockTemperature:!1,deactivateBlockTemperature:!1,setLidTemperature:!1,deactivateLidTemperature:!1}),JO=(e,t)=>!e.lidOpen&&t.lidOpen?{lidOpen:!0}:{},QO=(e,t)=>e.lidOpen&&!t.lidOpen||e.lidOpen===null&&!t.lidOpen?{lidClosed:!0}:{},ev=(e,t)=>t==null?e.currentBlockActivity.type==="blockDeactivated":e.currentBlockActivity.type==="blockTargetTemp"&&e.currentBlockActivity.blockTargetTemp===t,tv=(e,t)=>{const r={...JO(e,t)},n={...QO(e,t)},a=!ev(e,t.blockTargetTemp),o=a&&t.blockTargetTemp===null,i=a&&t.blockTargetTemp!==null,s=e.lidTargetTemp!==t.lidTargetTemp,l=s&&t.lidTargetTemp===null,u=s&&t.lidTargetTemp!==null;return{...ZO(),...r,...n,setBlockTemperature:i,deactivateBlockTemperature:o,setLidTemperature:u,deactivateLidTemperature:l}},rv=(e,t,r)=>{const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"thermocycler/deactivateBlock",key:ne(),params:{moduleId:e.moduleId}}],python:`${n}.deactivate_block()`}},nv=(e,t,r)=>{const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"thermocycler/deactivateLid",key:ne(),params:{moduleId:e.moduleId}}],python:`${n}.deactivate_lid()`}},av=(e,t,r)=>{const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"thermocycler/openLid",key:ne(),params:{moduleId:e.moduleId}}],python:`${n}.open_lid()`}},ov=(e,t,r)=>{e.celsius!==void 0&&console.warn("'volume' param not implemented for thermocycler/setTargetBlockTemperature, should not be set!");const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"thermocycler/setTargetBlockTemperature",key:ne(),params:{moduleId:e.moduleId,celsius:e.celsius}}],python:`${n}.set_block_temperature(${e.celsius})`}},iv=(e,t,r)=>{const n=No(r,e.moduleId);if(n===null)return{errors:[ke()]};if(n.currentBlockActivity.type==="profile")return{errors:[eT()]};const{lidOpen:a,lidClosed:o,setBlockTemperature:i,deactivateBlockTemperature:s,setLidTemperature:l,deactivateLidTemperature:u}=tv(n,e),{blockTargetTemp:c,lidTargetTemp:p}=e,d=[];return a&&d.push(ae(av,{moduleId:e.moduleId})),o&&d.push(ae(U_,{moduleId:e.moduleId})),s&&d.push(ae(rv,{moduleId:e.moduleId})),c!==null&&i&&d.push(ae(ov,{moduleId:e.moduleId,celsius:c})),u&&d.push(ae(nv,{moduleId:e.moduleId})),p!==null&&l&&d.push(ae(B_,{moduleId:e.moduleId,celsius:p})),Ne(d,t,r)};var Rc,ab;function sv(){if(ab)return Rc;ab=1;var e=ya(),t=zg(),r=Wg();function n(a,o){return r(t(a,o,e),a+"")}return Rc=n,Rc}var Pc,ob;function lv(){if(ob)return Pc;ob=1;var e=Br(),t=Kt();function r(n){return t(n)&&e(n)}return Pc=r,Pc}var kc,ib;function uv(){if(ib)return kc;ib=1;var e=xb(),t=ga(),r=Jb(),n=Hb(),a=lv(),o=Math.max;function i(s){if(!(s&&s.length))return[];var l=0;return s=e(s,function(u){if(a(u))return l=o(u.length,l),!0}),n(l,function(u){return t(s,r(u))})}return kc=i,kc}var Nc,sb;function cv(){if(sb)return Nc;sb=1;var e=sv(),t=uv(),r=e(t);return Nc=r,Nc}var pv=cv();const fv=Ye(pv),dv=(e,t,r)=>{const{aspirateAirGapVolume:n,aspirateDelay:a,aspirateFlowRateUlSec:o,aspiratePositionReference:i,aspirateRetractDelay:s,aspirateRetractPositionReference:l,aspirateRetractSpeed:u,aspirateRetractXOffset:c,aspirateRetractYOffset:p,aspirateRetractZOffset:d,aspirateSubmergeDelay:y,aspirateSubmergePositionReference:b,aspirateSubmergeSpeed:h,aspirateSubmergeXOffset:g,aspirateSubmergeYOffset:T,aspirateSubmergeZOffset:m,aspirateXOffset:_,aspirateYOffset:I,aspirateZOffset:S,blowoutFlowRateUlSec:O,blowoutLocation:v,changeTip:C,destLabware:N,destWells:V,dispenseAirGapVolume:$,dispenseDelay:G,dispenseFlowRateUlSec:X,dispensePositionReference:fe,dispenseRetractDelay:be,dispenseRetractPositionReference:ge,dispenseRetractSpeed:le,dispenseRetractXOffset:re,dispenseRetractYOffset:U,dispenseRetractZOffset:x,dispenseSubmergeDelay:W,dispenseSubmergePositionReference:w,dispenseSubmergeSpeed:R,dispenseSubmergeXOffset:E,dispenseSubmergeYOffset:A,dispenseSubmergeZOffset:L,dispenseXOffset:M,dispenseYOffset:q,dispenseZOffset:P,dropTipLocation:D,liquidClass:z,mixBeforeAspirate:H,mixInDestination:oe,pipette:K,preWetTip:ue,primaryNozzle:de,pushOut:J,sourceLabware:ce,nozzles:B,sourceWells:qe,tipRack:Oe,tipTracking:Ce,tiprackSelected:Ee,tipsSelected:k,touchTipAfterAspirate:F,touchTipAfterAspirateMmFromEdge:Y,touchTipAfterAspirateOffsetMmFromTop:Q,touchTipAfterAspirateSpeed:Z,touchTipAfterDispense:ie,touchTipAfterDispenseMmFromEdge:te,touchTipAfterDispenseOffsetMmFromTop:se,touchTipAfterDispenseSpeed:pe,volume:me,stepNumber:he}=e,{pipetteEntities:Ze,trashBinEntities:Be,wasteChuteEntities:_e,labwareEntities:Se}=t,rt=Sn(Se,_e,Be,N),nt=Se[ce]?.def.parameters.quirks?.includes("touchTipDisabled");rt==="labware"&&V!=null&&qe.length===V.length||(rt==="wasteChute"||rt==="trashBin")&&V==null&&qe.length>=1||jr(!1,`Transfer command creator expected N:N source-to-dest wells ratio. Got ${qe.length}:${V?.length} in labware`);const Ke="transfer",Fe=[];(!r.pipettes[K]||!Ze[K])&&Fe.push(ft({pipette:K})),(!ce||!r.labware[ce])&&Fe.push(dt({actionName:Ke,labware:ce}));const at=r.labware[N]!=null?we(r.labware[N].stack):"",Hr=we(r.labware[ce]?.stack),At=Object.keys(_e).length>0,Ua=_e[D]!=null,Gr=Be[D]!=null;At&&(at===f.GRIPPER_WASTE_CHUTE_ADDRESSABLE_AREA||Hr===f.GRIPPER_WASTE_CHUTE_ADDRESSABLE_AREA)&&Fe.push(ma());const Zt=[...Object.keys(t.trashBinEntities),...Object.keys(t.wasteChuteEntities)],ut=Zt.length>0?Zt[0]:null,Ie=Object.values(t.labwareEntities).find(({labwareDefURI:Le})=>Le===D),Ot=Ie!=null&&f.getIsTiprack(Ie.def),je=r.tipState.pipettes[K]?.hasTip;if(D==null||Ot&&ut==null&&C!=="never"&&je||!Ot&&!Ua&&!Gr)return{errors:[yn()]};(!N||!Se[N]&&!_e[N]&&!Be[N])&&Fe.push(db());let vt,Ae;if(C==="never"){const Le=r.tipState.pipettes[K]?.tiprackURI;vt=t.labwareEntities[Le??""],Ae=vt?.labwareDefURI}else vt=Object.values(Se).find(({labwareDefURI:Le})=>Le===Oe),Ae=Oe;if(vt==null&&(C==="never"?Fe.push(Ft({actionName:Ke,pipette:K})):Fe.push(dt({actionName:Ke,labware:Ae}))),Fe.length>0)return{errors:Fe};const Te=n||0,ct=$||0,De=ko(K,t,Ae)-Te;if(De<=0||!isFinite(De))return Fe.push(Xa({volume:me,maxVolume:De,actionName:Ke})),{errors:Fe};const ot=Math.ceil(me/De);if(!isFinite(ot)||ot<=0)return Fe.push(Xa({volume:me,maxVolume:ot,actionName:Ke})),{errors:Fe};const Ut=me/ot,Lt=Array(ot).fill(Ut),zr={origin:f.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[b],offset:{x:g,y:T,z:m}},Jt={origin:f.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[l],offset:{x:c,y:p,z:d}},pr={origin:f.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[w],offset:{x:E,y:A,z:L}},Qt={origin:f.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[ge],offset:{x:re,y:U,z:x}},{spec:xe,name:Rt,pythonName:fr}=Ze[K],{tipracks:dr}=Fa(K,Ae,t,r,de,B),Wr=f.getAllLiquidClassDefs()[z===f.NONE_LIQUID_CLASS_NAME||z==null?f.WATER_LIQUID_CLASS_NAME:z].byPipette?.find(({pipetteModel:Le})=>Le===f.getFlexNameConversion(xe))?.byTipType.find(({tiprack:Le})=>Le===Ae)??null,mr=f.getByVolumeValue({liquidClass:z,pipetteSpecs:xe,tiprackDefUri:Ae,targetVolume:Ut,liquidHandlingAction:"singleDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Yr=f.getByVolumeValue({liquidClass:z,pipetteSpecs:xe,tiprackDefUri:Ae,targetVolume:Ut,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Kr=Be[N]?.pythonName??_e[N]?.pythonName,Dn=Be[D]?.pythonName??_e[D]?.pythonName,qn=v==null?null:Be[v]?.pythonName??_e[v]?.pythonName,hr=Se[ce].pythonName,er=Se[N]?.pythonName,Fn=qe.map(Le=>`${hr}[${ee(Le)}]`).join(", "),Xr=V!=null&&er!=null?V.map(Le=>`${er}[${ee(Le)}]`).join(", "):null,Mn=[`name=${ee(`${e.commandCreatorFnName}_step_${he}`)}`,...z!=null?[`base_liquid_class=${Da(z,!0)}`]:[],`properties=${Lo({args:e,pipetteName:f.isFlexPipette(Rt)?f.getFlexNameConversion(xe):Rt,tiprackUri:Ae,liquidClassValuesForTip:Wr})}`],yr=`${$e}.define_liquid_class(
|
|
192
|
-
${
|
|
136
|
+
)`}),xn={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[_],offset:{x:h,y:b,z:T}},en={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[i],offset:{x:u,y:p,z:d}},sr={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[ze],offset:{x:J,y:Le,z:Ge}},Er={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[te],offset:{x:_e,y:oe,z:Se}},Hn=c.getByVolumeValue({liquidClass:P,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:Je,liquidHandlingAction:"aspirate",byVolumeProperty:"flowRateByVolume",defaultValue:null})??a,xa=c.getByVolumeValue({liquidClass:P,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:Je,liquidHandlingAction:"multiDispense",byVolumeProperty:"flowRateByVolume",defaultValue:null})??R,be=c.getByVolumeValue({liquidClass:P,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:Me,liquidHandlingAction:"aspirate",byVolumeProperty:"flowRateByVolume",defaultValue:null})??a,le=c.getByVolumeValue({liquidClass:P,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:Me,liquidHandlingAction:"multiDispense",byVolumeProperty:"flowRateByVolume",defaultValue:null})??R,ht=gy(E,rr),_t=Fr({retractZOffset:d,retractPositionReference:i,labwareId:H,labwareEntities:ie,well:M}),we=!_t&&M!=null?[O(V,{pipetteId:C,labwareId:H,wellName:M,wellLocation:c.SAFE_MOVE_TO_WELL_LOCATION})]:[],jn=[...hn(ht,(ue,rt)=>{const or=ue.length,wr=ke*or,Ar=wr+me+et,zn=rt===0,Gn=rt===ht.length-1,yt=L==="always"||L==="once"&&zn,Wn=c.LOW_VOLUME_PIPETTES.includes(tt)?[O(sa,{pipetteId:C,volume:Ar})]:[];let ir=[];if(yt){const Ce=Vt?.shift();ir=[U(Ba,{pipette:C,nozzles:$,primaryNozzle:q,dropTipLocation:Q&&er!=null?er:Y,tipRack:j,...ye===Et&&Ce!=null&&$e!=null?{tipSelectionArgs:{tipRackId:$e,tipWell:Ce}}:{}})]}const Sr=[O(qt,{pipetteId:C})],xt=c.getByVolumeValue({liquidClass:P,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:Me,liquidHandlingAction:"multiDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Ht=k!=null?[O(he,{seconds:k.seconds})]:[],tn=Me>0&&!yt&&!zn&&me===0&&I==null?[O(nt,{isAirGap:!0,pipetteId:C,volume:Me,flowRate:le,...xt>0?{correctionVolume:xt}:{},pushOut:0}),...Ht]:[],Lr=[...Kr,...tn,...Wn,...Sr],lr=[O(V,{pipetteId:C,labwareId:H,wellName:M,wellLocation:xn}),O(V,{pipetteId:C,labwareId:H,...m!=null?{speed:m}:{},wellName:M,wellLocation:{origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[s],offset:{x:y,y:S,z:w}}}),...f!=null&&f.seconds>0?[O(he,{seconds:f.seconds})]:[]],rn=ae?Cr({pipette:C,volume:wr,times:1,aspirateFlowRateUlSec:a,dispenseFlowRateUlSec:R,aspirateDelaySeconds:n?.seconds??0,dispenseDelaySeconds:k?.seconds??0,finalPushOut:0,invariantContext:t,liquidClass:P,tiprack:j,generatePython:!1}):[],Ae=v!=null?Cr({pipette:C,volume:v.volume,times:v.times,aspirateFlowRateUlSec:a,dispenseFlowRateUlSec:R,aspirateDelaySeconds:n?.seconds,dispenseDelaySeconds:k?.seconds,finalPushOut:0,invariantContext:t,liquidClass:P,tiprack:j,generatePython:!1}):[],jt=n!=null?[O(he,{seconds:n.seconds})]:[],Or=Ve?[O(Mt,{pipetteId:C,labwareId:H,wellName:M,...pe!=null?{mmFromEdge:pe}:{},zOffsetFromTop:Ze,...ft!=null?{speed:ft}:{}}),...Je>0&&_t?[O(V,{pipetteId:C,labwareId:H,wellName:M,wellLocation:en})]:[]]:[],bt=c.getByVolumeValue({liquidClass:P,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:Je,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,zt=Je>0?[...we,O(Zt,{pipetteId:C,volume:Je,flowRate:Hn,...bt>0?{correctionVolume:bt}:{}}),...jt]:[],Yn=c.getByVolumeValue({liquidClass:P,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:Ar,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,nn=c.getByVolumeValue({liquidClass:P,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:et,liquidHandlingAction:"multiDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,an=et!=null&&et>0?[O(nt,{pipetteId:C,volume:et,flowRate:R,correctionVolume:nn,pushOut:0}),...Ht]:[],Kn=[O(ms,{pipetteId:C,volume:Ar,flowRate:a,correctionVolume:Yn}),...jt,...an],sn=[O(V,{pipetteId:C,labwareId:H,...l!=null?{speed:l}:{},wellName:M,wellLocation:en}),...o!=null&&o?.seconds>0?[O(he,{seconds:o.seconds})]:[]],Rr=hn(ue,(Ce,kr)=>{const on=kr===0,ur=kr===ue.length-1,vr=Gn&&ur;let Gt=0,cr=R;on&&Je>0?(Gt=Je,cr=xa):!on&&Me>0&&et===0&&(Gt=Me,cr=le);const Zn=c.getByVolumeValue({liquidClass:P,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:Gt,liquidHandlingAction:"multiDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Ha=Fr({retractZOffset:Se,retractPositionReference:te,labwareId:A,labwareEntities:ie,well:Ce}),ks=Ha?[]:[O(V,{pipetteId:C,labwareId:A,wellName:Ce,wellLocation:c.SAFE_MOVE_TO_WELL_LOCATION})],ja=Ce!=null?[O(V,{pipetteId:C,labwareId:A,wellName:Ce,wellLocation:sr}),...Gt>0?[O(nt,{isAirGap:!0,pipetteId:C,volume:Gt,flowRate:cr,pushOut:0,correctionVolume:Zn}),...Ht]:[],O(V,{pipetteId:C,labwareId:A,...Ue!=null?{speed:Ue}:{},wellName:Ce,wellLocation:{origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[B],offset:{x:Be,y:re,z:W}}}),...ve!=null&&ve.seconds>0?[O(he,{seconds:ve.seconds})]:[]]:[O(qe,{fixtureId:A,pipetteId:C,offset:{x:0,y:0,z:0}})],Qn=me===0&&ur?x:0,Tt=[O(nt,{pipetteId:C,volume:ke,flowRate:R,...Qn!=null?{pushOut:Qn}:{},correctionVolume:Fn}),...Ht],ln=Ce!=null?[O(V,{pipetteId:C,labwareId:A,...de!=null?{speed:de}:{},wellName:Ce,wellLocation:Er}),...F!=null&&F?.seconds>0?[O(he,{seconds:F.seconds})]:[]]:[],Nt=ur?[O(Sa,{pipetteId:C,flowRate:g})]:[],za=c.getByVolumeValue({liquidClass:P,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:Me,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Ct=(Jn,Ny=!0)=>Me>0&&!(kr<ue.length-1&&et>0)&&!(L==="never"&&vr&&Jn)?[...Ny?ks:[],O(qt,{pipetteId:C}),O(Zt,{pipetteId:C,volume:Me,flowRate:be,...za>0?{correctionVolume:za}:{}}),...jt]:[],gt=Jn=>Ce!=null&&St?[O(Mt,{pipetteId:C,labwareId:A,wellName:Ce,...mt!=null?{mmFromEdge:mt}:{},zOffsetFromTop:Oe,...Qe!=null?{speed:Qe}:{}}),...Ct(Jn).length>0&&Ha?[O(V,{pipetteId:C,labwareId:A,wellName:Ce,wellLocation:Er})]:[]]:[];let Pr=[];if(I==null||!ur)Pr=[...gt(!0),...Ct(!0)];else if(I===Sn)Pr=[O(V,{pipetteId:C,labwareId:A,wellName:Ce,wellLocation:{origin:c.WELL_ORIGIN_TOP}}),...Nt,...gt(!0),...Ct(!0)];else if(I===Hr){const Jn=Ct(!0);Pr=[...gt(!1),...Ct(!1),O(V,{pipetteId:C,labwareId:H,wellName:M,wellLocation:{origin:c.WELL_ORIGIN_TOP}}),...Nt,...St&&!fr?[O(Mt,{pipetteId:C,labwareId:H,wellName:M,...mt!=null?{mmFromEdge:mt}:{},zOffsetFromTop:Oe,...Qe!=null?{speed:Qe}:{}})]:[],...Jn.length>0?[O(V,{pipetteId:C,labwareId:H,wellName:M,wellLocation:{origin:c.WELL_ORIGIN_TOP}})]:[],...Ct(!0,!1)]}else Pr=[...gt(!1),...Ct(!1),O(qe,{pipetteId:C,fixtureId:Object.values(ne).length>0?Object.values(ne)[0].id:Object.values(Lt)[0].id,offset:{x:0,y:0,z:0}}),...Nt,...Ct(!0,!1)];return[...ja,...Tt,...ln,...Pr]}),Xn=Q&&(rt===ht.length-1||L==="always")?[O(wn,{pipette:C,dropTipLocation:j,isReturnTip:Q})]:[];return[...ir,...Lr,...lr,...Ae,...rn,...Kn,...sn,...Or,...zt,...Rr,...Xn]}),Jr];return ce(jn,t,r)},EA=(e,t,r)=>{const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"heaterShaker/closeLabwareLatch",key:D(),params:{moduleId:e.moduleId}}],python:`${n}.close_labware_latch()`}},Xm=(e,t,r)=>{const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"heaterShaker/deactivateHeater",key:D(),params:{moduleId:e.moduleId}}],python:`${n}.deactivate_heater()`}},wA=["1","4","7","10"],AA=(e,t,r)=>{const{pipetteEntities:n,labwareEntities:a,moduleEntities:s}=t,o=r.modules[e.moduleId].slot,i=Object.keys(n)[0],l=n[i]?.spec;if(!((l?.displayCategory==="FLEX"||l?.channels===96)??!1)&&W_(r.labware,a,o)){const d=wA.includes(o)?"right":"left";return{errors:[Gy(d)]}}const p=s[e.moduleId].pythonName;return{commands:[{commandType:"heaterShaker/openLabwareLatch",key:D(),params:{moduleId:e.moduleId}}],python:`${p}.open_labware_latch()`}},SA=(e,t,r)=>{const{moduleEntities:n}=t,{moduleId:a,rpm:s}=e;if(a===null)return{errors:[X()]};if(n[a]?.type!==c.HEATERSHAKER_MODULE_TYPE)throw new Error(`expected module ${a} to be heaterShaker, got ${n[a]?.type}`);const o=n[a].pythonName;return{commands:[{commandType:"heaterShaker/setAndWaitForShakeSpeed",key:D(),params:{moduleId:a,rpm:s}}],python:`${o}.set_and_wait_for_shake_speed(${s})`}},Zm=(e,t,r)=>{const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"heaterShaker/deactivateShaker",key:D(),params:{moduleId:e.moduleId}}],python:`${n}.deactivate_shaker()`}},LA=(e,t,r)=>{const{timerHours:n,timerMinutes:a,timerSeconds:s,latchOpen:o,targetTemperature:i,rpm:l}=e;if(e.moduleId==null)return{errors:[X()]};const u=At(r,e.moduleId),p=e.moduleId??"";if(u==null)return{errors:[X()]};const d=[];if(o||d.push(U(EA,{moduleId:p})),i===null?d.push(U(Xm,{moduleId:p})):d.push(U(e_,{moduleId:p,celsius:i})),l===null&&"targetSpeed"in u&&u.targetSpeed!==null?d.push(U(Zm,{moduleId:p})):l!==null&&d.push(U(SA,{moduleId:p,rpm:l})),[n,a,s].some(_=>_!=null&&_!==0)){i!==null&&d.push(U(n_,{moduleId:p,celsius:i}));const _=(n??0)*3600+(a??0)*60+(s??0);d.push(U(he,{seconds:_})),d.push(U(Zm,{moduleId:p})),d.push(U(Xm,{moduleId:p}))}return o&&d.push(U(AA,{moduleId:p})),ce(d,t,r)},wy=(e,t,r)=>{const{moduleId:n}=e,{moduleEntities:a,labwareEntities:s}=t,o=[],i=a[n].pythonName,u=Object.values(r.labware).filter(f=>f.stack.includes(n)).find(f=>f.stack.find(_=>s[_]?.def.allowedRoles?.includes("lid")&&s[_]?.def.parameters.loadName!=="opentrons_tough_pcr_auto_sealing_lid")),p=u!=null?gc(u.stack):null,d=p!=null?s[p].def.metadata.displayName:null;return d!=null&&o.push(tb({lidDisplayName:d})),o.length>0?{errors:o}:{commands:[{commandType:"thermocycler/closeLid",key:D(),params:{moduleId:n}}],python:`${i}.close_lid()`}},Ay=(e,t,r)=>{const{moduleId:n,celsius:a}=e,s=t.moduleEntities[n].pythonName;return{commands:[{commandType:"thermocycler/setTargetLidTemperature",key:D(),params:{moduleId:n,celsius:a}}],python:`${s}.set_lid_temperature(${a})`}},OA=(e,t,r)=>{const{moduleId:n,profileElements:a,profileTargetLidTemp:s,profileVolume:o}=e,i=Rs(r,n);if(i===null)return{errors:[X()]};const l=t.moduleEntities[n].pythonName,u=[];i.lidOpen!==!1&&u.push(U(wy,{moduleId:n})),s!==i.lidTargetTemp&&u.push(U(Ay,{moduleId:n,celsius:s}));const p=`${l}_task_${i.numProfilesStarted+1}`;return u.push(U(Eg,{moduleId:n,profileElements:a,blockMaxVolumeUl:o,taskId:p})),ce(u,t,r)},RA=()=>({lidOpen:!1,lidClosed:!1,setBlockTemperature:!1,deactivateBlockTemperature:!1,setLidTemperature:!1,deactivateLidTemperature:!1}),kA=(e,t)=>!e.lidOpen&&t.lidOpen?{lidOpen:!0}:{},vA=(e,t)=>e.lidOpen&&!t.lidOpen||e.lidOpen===null&&!t.lidOpen?{lidClosed:!0}:{},PA=(e,t)=>t==null?e.currentBlockActivity.type==="blockDeactivated":e.currentBlockActivity.type==="blockTargetTemp"&&e.currentBlockActivity.blockTargetTemp===t,NA=(e,t)=>{const r={...kA(e,t)},n={...vA(e,t)},a=!PA(e,t.blockTargetTemp),s=a&&t.blockTargetTemp===null,o=a&&t.blockTargetTemp!==null,i=e.lidTargetTemp!==t.lidTargetTemp,l=i&&t.lidTargetTemp===null,u=i&&t.lidTargetTemp!==null;return{...RA(),...r,...n,setBlockTemperature:o,deactivateBlockTemperature:s,setLidTemperature:u,deactivateLidTemperature:l}},CA=(e,t,r)=>{const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"thermocycler/deactivateBlock",key:D(),params:{moduleId:e.moduleId}}],python:`${n}.deactivate_block()`}},DA=(e,t,r)=>{const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"thermocycler/deactivateLid",key:D(),params:{moduleId:e.moduleId}}],python:`${n}.deactivate_lid()`}},MA=(e,t,r)=>{const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"thermocycler/openLid",key:D(),params:{moduleId:e.moduleId}}],python:`${n}.open_lid()`}},FA=(e,t,r)=>{e.celsius!==void 0&&console.warn("'volume' param not implemented for thermocycler/setTargetBlockTemperature, should not be set!");const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"thermocycler/setTargetBlockTemperature",key:D(),params:{moduleId:e.moduleId,celsius:e.celsius}}],python:`${n}.set_block_temperature(${e.celsius})`}},qA=(e,t,r)=>{const n=Rs(r,e.moduleId);if(n===null)return{errors:[X()]};if(n.currentBlockActivity.type==="profile")return{errors:[$y()]};const{lidOpen:a,lidClosed:s,setBlockTemperature:o,deactivateBlockTemperature:i,setLidTemperature:l,deactivateLidTemperature:u}=NA(n,e),{blockTargetTemp:p,lidTargetTemp:d}=e,f=[];return a&&f.push(U(MA,{moduleId:e.moduleId})),s&&f.push(U(wy,{moduleId:e.moduleId})),i&&f.push(U(CA,{moduleId:e.moduleId})),p!==null&&o&&f.push(U(FA,{moduleId:e.moduleId,celsius:p})),u&&f.push(U(DA,{moduleId:e.moduleId})),d!==null&&l&&f.push(U(Ay,{moduleId:e.moduleId,celsius:d})),ce(f,t,r)};var Ou,Qm;function UA(){if(Qm)return Ou;Qm=1;var e=ba(),t=P_(),r=N_();function n(a,s){return r(t(a,s,e),a+"")}return Ou=n,Ou}var Ru,Jm;function BA(){if(Jm)return Ru;Jm=1;var e=xr(),t=Qt();function r(n){return t(n)&&e(n)}return Ru=r,Ru}var ku,eh;function $A(){if(eh)return ku;eh=1;var e=Mh(),t=Ea(),r=zh(),n=qh(),a=BA(),s=Math.max;function o(i){if(!(i&&i.length))return[];var l=0;return i=e(i,function(u){if(a(u))return l=s(u.length,l),!0}),n(l,function(u){return t(i,r(u))})}return ku=o,ku}var vu,th;function VA(){if(th)return vu;th=1;var e=UA(),t=$A(),r=e(t);return vu=r,vu}var xA=VA();const HA=xe(xA),jA=(e,t,r)=>{const{aspirateAirGapVolume:n,aspirateDelay:a,aspirateFlowRateUlSec:s,aspiratePositionReference:o,aspirateRetractDelay:i,aspirateRetractPositionReference:l,aspirateRetractSpeed:u,aspirateRetractXOffset:p,aspirateRetractYOffset:d,aspirateRetractZOffset:f,aspirateSubmergeDelay:_,aspirateSubmergePositionReference:m,aspirateSubmergeSpeed:h,aspirateSubmergeXOffset:b,aspirateSubmergeYOffset:T,aspirateSubmergeZOffset:y,aspirateXOffset:S,aspirateYOffset:w,aspirateZOffset:g,blowoutFlowRateUlSec:I,blowoutLocation:L,changeTip:A,destLabware:E,destWells:k,dispenseAirGapVolume:R,dispenseDelay:B,dispenseFlowRateUlSec:F,dispensePositionReference:te,dispenseRetractDelay:de,dispenseRetractPositionReference:_e,dispenseRetractSpeed:oe,dispenseRetractXOffset:Se,dispenseRetractYOffset:ve,dispenseRetractZOffset:ze,dispenseSubmergeDelay:Ue,dispenseSubmergePositionReference:J,dispenseSubmergeSpeed:Le,dispenseSubmergeXOffset:Ge,dispenseSubmergeYOffset:Be,dispenseSubmergeZOffset:re,dispenseXOffset:W,dispenseYOffset:Y,dispenseZOffset:P,dropTipLocation:v,liquidClass:$,mixBeforeAspirate:C,mixInDestination:ae,pipette:q,preWetTip:x,primaryNozzle:H,pushOut:M,sourceLabware:G,nozzles:ye,sourceWells:$e,tipRack:Xe,tipTracking:Ve,tiprackSelected:pe,tipsSelected:Ze,touchTipAfterAspirate:ft,touchTipAfterAspirateMmFromEdge:St,touchTipAfterAspirateOffsetMmFromTop:mt,touchTipAfterAspirateSpeed:Oe,touchTipAfterDispense:Qe,touchTipAfterDispenseMmFromEdge:Re,touchTipAfterDispenseOffsetMmFromTop:ke,touchTipAfterDispenseSpeed:Pe,volume:ie,stepNumber:ne}=e,{pipetteEntities:Lt,trashBinEntities:We,wasteChuteEntities:K,labwareEntities:Ie}=t,fr=Ln(Ie,K,We,E),Je=Ie[G]?.def.parameters.quirks?.includes("touchTipDisabled");if(!(fr==="labware"&&k!=null&&$e.length===k.length||(fr==="wasteChute"||fr==="trashBin")&&k==null&&$e.length>=1))throw new Error(`Transfer command creator expected N:N source-to-dest wells ratio. Got ${$e.length}:${k?.length} in labware`);const Me="transfer",me=[];(!r.pipettes[q]||!Lt[q])&&me.push(ut({pipette:q})),(!G||!r.labware[G])&&me.push(ct({actionName:Me,labware:G}));const et=r.labware[E]!=null?z(r.labware[E].stack):"",Gr=z(r.labware[G]?.stack),Ot=Object.keys(K).length>0,$a=K[v]!=null,Wr=We[v]!=null;Ot&&(et===c.GRIPPER_WASTE_CHUTE_ADDRESSABLE_AREA||Gr===c.GRIPPER_WASTE_CHUTE_ADDRESSABLE_AREA)&&me.push(ha());const er=[...Object.keys(t.trashBinEntities),...Object.keys(t.wasteChuteEntities)],ot=er.length>0?er[0]:null,Q=Object.values(t.labwareEntities).find(({labwareDefURI:le})=>le===v),Rt=Q!=null&&c.getIsTiprack(Q.def),Te=r.tipState.pipettes[q]?.hasTip;if(v==null||Rt&&ot==null&&A!=="never"&&Te||!Rt&&!$a&&!Wr)return{errors:[yn()]};(!E||!Ie[E]&&!K[E]&&!We[E])&&me.push(ih());let kt,ee;if(A==="never"){const le=r.tipState.pipettes[q]?.tiprackURI;kt=t.labwareEntities[le??""],ee=kt?.labwareDefURI}else kt=Object.values(Ie).find(({labwareDefURI:le})=>le===Xe),ee=Xe;if(kt==null&&(A==="never"?me.push(Ut({actionName:Me,pipette:q})):me.push(ct({actionName:Me,labware:ee}))),me.length>0)return{errors:me};const j=n||0,it=R||0,fe=Os(q,t,ee)-j;if(fe<=0||!isFinite(fe))return me.push(Xa({volume:ie,maxVolume:fe,actionName:Me})),{errors:me};const tt=Math.ceil(ie/fe);if(!isFinite(tt)||tt<=0)return me.push(Xa({volume:ie,maxVolume:tt,actionName:Me})),{errors:me};const $t=ie/tt,vt=Array(tt).fill($t),Yr={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[m],offset:{x:b,y:T,z:y}},tr={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[l],offset:{x:p,y:d,z:f}},mr={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[J],offset:{x:Ge,y:Be,z:re}},rr={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[_e],offset:{x:Se,y:ve,z:ze}},{spec:Ee,name:Pt,pythonName:hr}=Lt[q],{tipracks:_r}=Ua(q,ee,t,r,H,ye),Kr=c.getAllLiquidClassDefs()[$===c.NONE_LIQUID_CLASS_NAME||$==null?c.WATER_LIQUID_CLASS_NAME:$].byPipette?.find(({pipetteModel:le})=>le===c.getFlexNameConversion(Ee))?.byTipType.find(({tiprack:le})=>le===ee)??null,yr=c.getByVolumeValue({liquidClass:$,pipetteSpecs:Ee,tiprackDefUri:ee,targetVolume:$t,liquidHandlingAction:"singleDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Xr=c.getByVolumeValue({liquidClass:$,pipetteSpecs:Ee,tiprackDefUri:ee,targetVolume:$t,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Zr=We[E]?.pythonName??K[E]?.pythonName,Fn=We[v]?.pythonName??K[v]?.pythonName,qn=L==null?null:We[L]?.pythonName??K[L]?.pythonName,br=Ie[G].pythonName,nr=Ie[E]?.pythonName,Un=$e.map(le=>`${br}[${N(le)}]`).join(", "),Qr=k!=null&&nr!=null?k.map(le=>`${nr}[${N(le)}]`).join(", "):null,Bn=[`name=${N(`${e.commandCreatorFnName}_step_${ne}`)}`,...$!=null?[`base_liquid_class=${Fa($,!0)}`]:[],`properties=${As({args:e,pipetteName:c.isFlexPipette(Pt)?c.getFlexNameConversion(Ee):Pt,tiprackUri:ee,liquidClassValuesForTip:Kr})}`],Tr=`${ge}.define_liquid_class(
|
|
137
|
+
${Z(Bn.join(`,
|
|
193
138
|
`))},
|
|
194
|
-
)`,
|
|
195
|
-
${
|
|
139
|
+
)`,ar=Ve===Et&&pe!=null&&Ze!=null&&Ze.length>0?qa({wellSets:Ze,nozzles:ye,channels:Ee.channels,primaryNozzle:H}):null,$n=pe!=null?Ie[pe]?.pythonName:null,Vt=ar?.map(le=>`${$n}[${N(le)}]`).join(", "),gr=[`volume=${ie}`,`source=[${Un}]`,`dest=${Qr!=null?`[${Qr}]`:Zr}`,`new_tip=${N(Ls(A))}`,...Rt?["return_tip=True",...qn!=null?[`trash_location=${qn}`]:[]]:[`trash_location=${Fn}`,"keep_last_tip=True"],...Ee.channels>1?["group_wells=False"]:[],..._r.filteredSortedTiprackIds.length>0?[Ss({labwareEntities:Ie,tiprackIds:_r.filteredSortedTiprackIds})]:[],`liquid_class=${Tr}`,...ar!=null&&$n!=null?[`tips=[${Vt}]`]:[]],Ir=()=>({commands:[],python:`${hr}.transfer_with_liquid_class(
|
|
140
|
+
${Z(gr.join(`,
|
|
196
141
|
`))},
|
|
197
|
-
)`}),Bn=f.getByVolumeValue({liquidClass:z,pipetteSpecs:xe,tiprackDefUri:Ae,targetVolume:Te,liquidHandlingAction:"aspirate",byVolumeProperty:"flowRateByVolume",defaultValue:null})??o,Zr=f.getByVolumeValue({liquidClass:z,pipetteSpecs:xe,tiprackDefUri:Ae,targetVolume:Te,liquidHandlingAction:"singleDispense",byVolumeProperty:"flowRateByVolume",defaultValue:null})??X,jn=f.getByVolumeValue({liquidClass:z,pipetteSpecs:xe,tiprackDefUri:Ae,targetVolume:ct,liquidHandlingAction:"aspirate",byVolumeProperty:"flowRateByVolume",defaultValue:null})??o,Jr=f.getByVolumeValue({liquidClass:z,pipetteSpecs:xe,tiprackDefUri:Ae,targetVolume:ct,liquidHandlingAction:"singleDispense",byVolumeProperty:"flowRateByVolume",defaultValue:null})??X,rr=fv(qe,V);let _r=null,$n=null;const Ue=[...rr.reduce((Le,ht,yt)=>{const[Ve,Ge]=ht,xn=Lt.reduce((Re,it,nr)=>{const Tr=yt===0&&nr===0,Er=yt+1===rr.length,Hn=nr+1===Lt.length&&Er;let bt=!1;C==="always"?bt=!0:C==="once"?bt=Tr:C==="perSource"?bt=Ve!==_r:C==="perDest"&&(bt=Tr||Ge!==$n);const Gn=f.LOW_VOLUME_PIPETTES.includes(Rt)?[j(na,{pipetteId:K,volume:it})]:[];let ar=[];if(bt){const Tt=tr?.shift();ar=[ae(Ma,{pipette:K,primaryNozzle:de,nozzles:B,dropTipLocation:Ot&&ut!=null?ut:D,tipRack:Ae,...B!=null?{nozzles:B}:{},...Ce===wt&&Tt!=null&&Ee!=null?{tipSelectionArgs:{tipRackId:Ee,tipWell:Tt}}:{}})]}const wr=Se[ce]?.def.wells[Ve]?.depth??null,jt=f.getMmFromBottom(S,i,wr),$t=f.getMmFromBottom(m,b,wr),Qr=f.getMmFromBottom(d,l,wr);jt!=null&&$t!=null&&jt>$t&&Fe.push(mb());const Ir=Nr({retractZOffset:d,retractPositionReference:l,labwareId:ce,labwareEntities:Se,well:Ve}),or=!Ir&&Ve!=null?[j(ye,{pipetteId:K,labwareId:ce,wellName:Ve,wellLocation:f.SAFE_MOVE_TO_WELL_LOCATION})]:[],en=Nr({retractZOffset:x,retractPositionReference:ge,labwareId:N,labwareEntities:Se,well:Ge}),He=!en&&Ge!=null?[j(ye,{pipetteId:K,labwareId:N,wellName:Ge,wellLocation:f.SAFE_MOVE_TO_WELL_LOCATION})]:[];jt!=null&&Qr!=null&&jt>Qr&&Fe.push(hb());const xt=[j(ye,{pipetteId:K,labwareId:ce,wellName:Ve,wellLocation:f.SAFE_MOVE_TO_WELL_LOCATION})],Sr=[j(qt,{pipetteId:K})],gt=f.getByVolumeValue({liquidClass:z,pipetteSpecs:xe,tiprackDefUri:Ae,targetVolume:ct,liquidHandlingAction:"singleDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Vt=G!=null?[j(Me,{seconds:G.seconds})]:[],zn=ct>0&&!bt&&(nr>0||yt>0)?[j(st,{isAirGap:!0,pipetteId:K,volume:ct,flowRate:Jr,...gt>0?{correctionVolume:gt}:{},pushOut:0}),...Vt]:[],tn=[...xt,...zn,...Gn,...Sr],rn=[j(ye,{pipetteId:K,labwareId:ce,wellName:Ve,wellLocation:zr}),j(ye,{pipetteId:K,labwareId:ce,...h!=null?{speed:h}:{},wellName:Ve,wellLocation:{origin:f.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[i],offset:{x:_,y:I,z:S}}}),...y!=null&&y.seconds>0?[j(Me,{seconds:y.seconds})]:[]],Wn=ue?Pr({pipette:K,volume:it,times:1,aspirateFlowRateUlSec:o,dispenseFlowRateUlSec:X,aspirateDelaySeconds:a?.seconds??0,dispenseDelaySeconds:G?.seconds??0,finalPushOut:0,invariantContext:t,liquidClass:z,tiprack:Ae,generatePython:!1}):[],nn=H!=null?Pr({pipette:K,volume:H.volume,times:H.times,aspirateFlowRateUlSec:o,dispenseFlowRateUlSec:X,aspirateDelaySeconds:a?.seconds,dispenseDelaySeconds:G?.seconds,finalPushOut:0,invariantContext:t,liquidClass:z,tiprack:Ae,generatePython:!1}):[],Ar=a!=null?[j(Me,{seconds:a.seconds})]:[],Yn=F?[j(Ct,{pipetteId:K,labwareId:ce,wellName:Ve,...Y!=null?{mmFromEdge:Y}:{},zOffsetFromTop:Q,...Z!=null?{speed:Z}:{}}),...Te>0&&Ir?[j(ye,{pipetteId:K,labwareId:ce,wellName:Ve,wellLocation:Jt})]:[]]:[],ze=f.getByVolumeValue({liquidClass:z,pipetteSpecs:xe,tiprackDefUri:Ae,targetVolume:Te,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Or=Te>0?[...or,j(Yt,{pipetteId:K,volume:Te,flowRate:Bn,...ze>0?{correctionVolume:ze}:{}}),...Ar]:[],an=[j(mo,{pipetteId:K,volume:it,flowRate:o,...Yr>0?{correctionVolume:Yr}:{}}),...Ar],ir=[j(ye,{pipetteId:K,labwareId:ce,...u!=null?{speed:u}:{},wellName:Ve,wellLocation:Jt}),...s!=null&&s?.seconds>0?[j(Me,{seconds:s.seconds})]:[]],vr=f.getByVolumeValue({liquidClass:z,pipetteSpecs:xe,tiprackDefUri:Ae,targetVolume:Te,liquidHandlingAction:"singleDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Ht=Ge!=null?[j(ye,{pipetteId:K,labwareId:N,wellName:Ge,wellLocation:pr}),...Te>0?[j(st,{isAirGap:!0,pipetteId:K,volume:Te,flowRate:Zr,pushOut:0,...vr>0?{correctionVolume:vr}:{}}),...Vt]:[],j(ye,{pipetteId:K,labwareId:N,...R!=null?{speed:R}:{},wellName:Ge,wellLocation:{origin:f.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[fe],offset:{x:M,y:q,z:P}}}),...W!=null&&W.seconds>0?[j(Me,{seconds:W.seconds})]:[]]:[j(Xe,{fixtureId:N,pipetteId:K,offset:{x:0,y:0,z:0}})],sr=oe!=null&&Ge!=null?0:J,Kn=[j(st,{pipetteId:K,volume:it,flowRate:X,...sr!=null?{pushOut:sr}:{},...mr>0?{correctionVolume:mr}:{}}),...Vt],$a=oe!=null&&Ge!=null?Pr({pipette:K,volume:oe.volume,times:oe.times,aspirateFlowRateUlSec:o,dispenseFlowRateUlSec:X,aspirateDelaySeconds:a?.seconds,dispenseDelaySeconds:G?.seconds,finalPushOut:J,invariantContext:t,liquidClass:z,tiprack:Ae,generatePython:!1}):[],Co=Ge!=null?[j(ye,{pipetteId:K,labwareId:N,...le!=null?{speed:le}:{},wellName:Ge,wellLocation:Qt}),...be!=null&&be?.seconds>0?[j(Me,{seconds:be.seconds})]:[]]:[],xa=j(Ea,{pipetteId:K,flowRate:O}),Xn=f.getByVolumeValue({liquidClass:z,pipetteSpecs:xe,tiprackDefUri:Ae,targetVolume:ct,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,_t=(Tt,Lr=!0)=>ct>0&&!(C==="never"&&Hn&&Tt)?[...Lr?He:[],j(qt,{pipetteId:K}),j(Yt,{pipetteId:K,volume:ct,flowRate:jn,...Xn>0?{correctionVolume:Xn}:{}}),...Ar]:[],on=Tt=>Ge!=null&&ie?[j(Ct,{pipetteId:K,labwareId:N,wellName:Ge,...te!=null?{mmFromEdge:te}:{},zOffsetFromTop:se,...pe!=null?{speed:pe}:{}}),..._t(Tt).length>0&&en?[j(ye,{pipetteId:K,labwareId:N,wellName:Ge,wellLocation:Qt})]:[]]:[];let Pt=[];switch(v){case null:case void 0:Pt=[...on(!0),..._t(!0)];break;case In:Pt=[xa,...on(!0),..._t(!0)];break;case $r:Pt=[...on(!0),..._t(!1),j(ye,{pipetteId:K,labwareId:ce,wellName:Ve,wellLocation:{origin:f.WELL_ORIGIN_TOP}}),xa,...ie&&!nt?[j(Ct,{pipetteId:K,labwareId:ce,wellName:Ve,...te!=null?{mmFromEdge:te}:{},zOffsetFromTop:se,...pe!=null?{speed:pe}:{}})]:[],..._t(!0).length>0?[j(ye,{pipetteId:K,labwareId:ce,wellName:Ve,wellLocation:{origin:f.WELL_ORIGIN_TOP}})]:[],..._t(!0,!1)];break;default:v in Be?Pt=[...on(!1),..._t(!1),j(C_,{pipetteId:K,flowRate:O,trashId:v}),..._t(!0,!1)]:v in _e&&(Pt=[j(D_,{pipetteId:K,flowRate:O,wasteChuteId:v}),..._t(!0,!1)]);break}const Va=Ot&&(yt===rr.length-1||C==="always")?[j(wn,{pipette:K,dropTipLocation:Ae,isReturnTip:Ot})]:[],kt=[...ar,...tn,...rn,...nn,...Wn,...an,...ir,...Yn,...Or,...Ht,...Kn,...$a,...Co,...Pt,...Va];return _r=Ve,$n=Ge,[...Re,...kt]},[]);return[...Le,...xn]},[]),gr];return Ne(Ue,t,r)},mv=(e,t,r)=>{const n=`[${e.task_ids.join(", ")}]`,a=`${$e}.wait_for_tasks(${n})`;return{commands:[{key:ne(),commandType:"waitForTasks",params:e}],python:a}},hv=(e,t,r)=>{const{waitCondition:n}=e;return yv(e,t,r)},yv=(e,t,r)=>{const{moduleId:n}=e,a=[],o=No(r,n);if(o==null)return{errors:[ke()]};if(o.currentBlockActivity.type!=="profile")return{errors:[Kp()]};const{taskId:i}=o.currentBlockActivity;return i==null?{errors:[Kp()]}:(a.push(ae(mv,{task_ids:[i]})),Ne(a,t,r))};var Cc,lb;function bv(){if(lb)return Cc;lb=1;var e=Hg(),t=1,r=4;function n(a){return e(a,t|r)}return Cc=n,Cc}var gv=bv();const _v=Ye(gv),j_=["A1","B1","C1","D1","E1","F1","G1","H1","A2","B2","C2","D2","E2","F2","G2","H2","A3","B3","C3","D3","E3","F3","G3","H3","A4","B4","C4","D4","E4","F4","G4","H4","A5","B5","C5","D5","E5","F5","G5","H5","A6","B6","C6","D6","E6","F6","G6","H6","A7","B7","C7","D7","E7","F7","G7","H7","A8","B8","C8","D8","E8","F8","G8","H8","A9","B9","C9","D9","E9","F9","G9","H9","A10","B10","C10","D10","E10","F10","G10","H10","A11","B11","C11","D11","E11","F11","G11","H11","A12","B12","C12","D12","E12","F12","G12","H12"],Fr="p300SingleId",ua="p300MultiId",Wc="p100096Id",Yc="sourcePlateId",Kc="destPlateId",Xc="troughId",Tv="A1",Ev="tiprack1Id",wv={isAirGap:!0},Wa=f.fixture96Plate,ub=f.fixture12Trough,Ya=f.fixtureTiprack10ul,Nt=f.fixtureTiprack300ul,sn=f.fixtureTiprack1000ul,Ka=f.fixtureTiprackAdapter,$_={OT_PD_DISABLE_MODULE_RESTRICTIONS:!1};function x_(e){return j_.reduce((t,r)=>({...t,[r]:e?ro:Pe}),{})}function Iv(e,t){return Array.from("ABCDEFGH").map(r=>`${r}${e}`).reduce((r,n)=>({...r,[n]:t}),{})}function V_(){const e={[Yc]:{id:Yc,pythonName:"mock_source_plate",labwareDefURI:f.getLabwareDefURI(Wa),def:Wa},[Kc]:{id:Kc,pythonName:"mock_dest_plate",labwareDefURI:f.getLabwareDefURI(Wa),def:Wa},[Xc]:{id:Xc,pythonName:"mock_trough",labwareDefURI:f.getLabwareDefURI(ub),def:ub},tiprack1Id:{id:"tiprack1Id",pythonName:"mock_tip_rack_1",labwareDefURI:f.getLabwareDefURI(Nt),def:Nt},tiprack2Id:{id:"tiprack2Id",pythonName:"mock_tip_rack_2",labwareDefURI:f.getLabwareDefURI(Nt),def:Nt},tiprack3Id:{id:"tiprack3Id",pythonName:"mock_tip_rack_3",labwareDefURI:f.getLabwareDefURI(Nt),def:Nt},tiprack4AdapterId:{id:"tiprack4AdapterId",pythonName:"mock_adapter_4",labwareDefURI:f.getLabwareDefURI(Ka),def:Ka},tiprack5AdapterId:{id:"tiprack5AdapterId",pythonName:"mock_adapter_5",labwareDefURI:f.getLabwareDefURI(Ka),def:Ka},tiprack4Id:{id:"tiprack4Id",pythonName:"mock_tip_rack_4",labwareDefURI:f.getLabwareDefURI(sn),def:sn},tiprack5Id:{id:"tiprack5Id",pythonName:"mock_tip_rack_5",labwareDefURI:f.getLabwareDefURI(sn),def:sn}},t={},r={[qc]:{id:qc,location:"cutoutA3",pythonName:"trash_bin_1"}},n={p10SingleId:{name:"p10_single",id:"p10SingleId",pythonName:"mock_pipette_p10",tiprackDefURI:[f.getLabwareDefURI(Ya)],tiprackLabwareDef:[Ya],spec:f.fixtureP10SingleV2Specs},p10MultiId:{name:"p10_multi",id:"p10MultiId",tiprackDefURI:[f.getLabwareDefURI(Ya)],tiprackLabwareDef:[Ya],spec:f.fixtureP10MultiV2Specs,pythonName:"mock_pipette_p10_multi"},[Fr]:{name:"p300_single",id:Fr,tiprackDefURI:[f.getLabwareDefURI(Nt)],tiprackLabwareDef:[Nt],spec:f.fixtureP300SingleV2Specs,pythonName:"mock_pipette"},[ua]:{name:"p300_multi",id:ua,tiprackDefURI:[f.getLabwareDefURI(Nt)],tiprackLabwareDef:[Nt],spec:f.fixtureP300MultiV2Specs,pythonName:"mock_pipette_p300_multi"},[Wc]:{name:"p1000_96",id:Wc,tiprackDefURI:[f.getLabwareDefURI(sn)],tiprackLabwareDef:[sn],spec:f.fixtureP100096V2Specs,pythonName:"mock_pipette_p1000_96"}};return{labwareEntities:e,moduleEntities:t,pipetteEntities:n,trashBinEntities:r,wasteChuteEntities:{},stagingAreaEntities:{},gripperEntities:{},liquidEntities:{},config:$_}}const Vr=e=>{const{invariantContext:t,labwareLocations:r,moduleLocations:n,pipetteLocations:a,tiprackSetting:o}=e,i=Ap({invariantContext:t,labwareLocations:r,moduleLocations:n||{},pipetteLocations:a});return i.tipState.tipracks=Wt(o,s=>x_(s)),i},Cn=()=>({pipetteLocations:{[Fr]:{mount:"left",tiprackId:"tiprack1Id"},[ua]:{mount:"right",tiprackId:"tiprack1Id"}},labwareLocations:{tiprack1Id:{stack:["tiprack1Id","1"]},tiprack2Id:{stack:["tiprack2Id","5"]},tiprack4AdapterId:{stack:["tiprack4AdapterId","7"]},tiprack5AdapterId:{stack:["tiprack5AdapterId","8"]},tiprack4Id:{stack:["tiprack4Id","tiprack4AdapterId","7"]},tiprack5Id:{stack:["tiprack5Id","tiprack5AdapterId","8"]},sourcePlateId:{stack:["sourcePlateId","2"]},destPlateId:{stack:["destPlateId","3"]}},moduleLocations:{}}),H_=()=>({pipetteLocations:{[Fr]:{mount:"left"},[ua]:{mount:"right"}},labwareLocations:{tiprack1Id:{stack:["tiprack1Id","B1"]},tiprack2Id:{stack:["tiprack2Id","A2"]},sourcePlateId:{stack:["sourcePlateId","offDeck"]},destPlateId:{stack:["destPlateId","C2"]}},moduleLocations:{}}),G_=e=>Vr({...Cn(),invariantContext:e,tiprackSetting:{tiprack1Id:!0,tiprack2Id:!0}}),Sv=e=>Vr({...H_(),invariantContext:e,tiprackSetting:{tiprack1Id:!0,tiprack2Id:!0}}),Av=e=>({robotState:G_(e),warnings:[]}),Ov=e=>{const t=Vr({...Cn(),invariantContext:e,tiprackSetting:{tiprack1Id:!0,tiprack2Id:!0}});return t.tipState.pipettes[Fr]={hasTip:!0,tiprackURI:"tiprack1Id"},t},vv=e=>{const t=Vr({...Cn(),invariantContext:e,tiprackSetting:{tiprack1Id:!0}});return t.tipState.pipettes[Fr]={hasTip:!0,tiprackURI:"tiprack1Id"},t.tipState.tipracks.tiprack1Id.A1=Pe,t},Lv=e=>Vr({...Cn(),invariantContext:e,tiprackSetting:{tiprack1Id:!1,tiprack2Id:!1}}),Rv=({temperatureModuleId:e,thermocyclerId:t})=>{const r=V_();r.moduleEntities={[e]:{id:e,type:f.TEMPERATURE_MODULE_TYPE,model:"foo",pythonName:"mock_temperature_module_1"},[t]:{id:t,type:f.THERMOCYCLER_MODULE_TYPE,model:"foo",pythonName:"mock_thermocycler"}};const n=Vr({...Cn(),invariantContext:r,tiprackSetting:{tiprack1Id:!0}});return n.modules={[e]:{slot:"3",moduleState:{type:f.TEMPERATURE_MODULE_TYPE,status:ba,targetTemperature:null}},[t]:{slot:"span7_8_10_11",moduleState:{type:f.THERMOCYCLER_MODULE_TYPE,currentBlockActivity:{type:"blockDeactivated"},lidTargetTemp:null,lidOpen:null,numProfilesStarted:0}}},{invariantContext:r,robotState:n}},Pv=(e,t,r,n)=>{const a=_v(e);return a.modules[t].moduleState={type:f.TEMPERATURE_MODULE_TYPE,targetTemperature:n,status:r},a};exports.ABSORBANCE_READER_INITIAL_STATE=Ib;exports.AIR=Qe;exports.AIR_GAP_META=wv;exports.AIR_GAP_OFFSET_FROM_TOP=Dc;exports.AUTOMATIC=Qc;exports.BOTTOM_UP_LABWARE_POOL_KEYS=Gt;exports.BOTTOM_UP_STORED_LABWARE_URI_KEYS=PT;exports.CLEAN=ro;exports.COLUMN_4_SLOTS=We;exports.CUSTOM_LABWARE_DICT_NAME=Oo;exports.DEFAULT_BLOWOUT_WELL=Tv;exports.DEFAULT_CONFIG=$_;exports.DEFAULT_PIPETTE=Fr;exports.DEST_LABWARE=Kc;exports.DEST_WELL_BLOWOUT_DESTINATION=In;exports.DIRTY=lr;exports.EMPTY=Pe;exports.FAKE_HOPPER_LOCATION_MAP=Nb;exports.FIXED_TRASH_ID=qc;exports.FLEX_STACKER_MODULE_INITIAL_STATE=Ab;exports.FLEX_TRASH_DEF_URI=RT;exports.GRIPPER_LOCATION=Lb;exports.HEATERSHAKER_MODULE_INITIAL_STATE=wb;exports.HOPPER_FAKE_LOCATIONS=kb;exports.HOPPER_STACKER_LOCATION=Je;exports.INDENT=Na;exports.MAGNETIC_BLOCK_INITIAL_STATE=Sb;exports.MAGNETIC_MODULE_INITIAL_STATE=_b;exports.MANUAL=wt;exports.MIXED_WELL_COLOR=p_;exports.MODULES_WITH_COLLISION_ISSUES=gb;exports.MODULE_INITIAL_STATE_BY_TYPE=vb;exports.MULTI_PIPETTE=ua;exports.OFF_DECK=sa;exports.OT2_TC_SLOTS=Pb;exports.OT_2_TRASH_DEF_URI=LT;exports.PAPI_VERSION=d_;exports.PD_APPLICATION_VERSION=pO;exports.PIPETTE_96=Wc;exports.PROTOCOL_CONTEXT_NAME=$e;exports.SLOT_LOCATIONS_TO_FAKE_HOPPER_LOCATIONS=kT;exports.SOURCE_LABWARE=Yc;exports.SOURCE_WELL_BLOWOUT_DESTINATION=$r;exports.STAGING_AREA_SLOTS=Rb;exports.TEMPERATURE_APPROACHING_TARGET=Jc;exports.TEMPERATURE_AT_TARGET=Zc;exports.TEMPERATURE_DEACTIVATED=ba;exports.TEMPERATURE_MODULE_INITIAL_STATE=Tb;exports.THERMOCYCLER_MODULE_INITIAL_STATE=Eb;exports.TIPRACK_1=Ev;exports.TOUCHED_PIPETTABLE_LABWARE=Gc;exports.TROUGH_LABWARE=Xc;exports.VACUUM_MAX_PRESSURE_MBAR=VT;exports.VACUUM_MIN_PRESSURE_MBAR=xT;exports.VACUUM_MODE_POWER=DT;exports.VACUUM_MODE_PRESSURE=qT;exports.VACUUM_MODULE_INITIAL_STATE=Ob;exports.VACUUM_PROGRAM_PROFILE=MT;exports.VACUUM_PROGRAM_STATE=FT;exports.VACUUM_STATE_PUMP=UT;exports.VACUUM_STATE_VENT=BT;exports.VACUUM_VENT_CLOSED=CT;exports.VACUUM_VENT_OPEN=NT;exports.VACUUM_VENT_SET_CLOSED=$T;exports.VACUUM_VENT_SET_OPEN=jT;exports.ZERO_OFFSET=Et;exports._getNextTip=N_;exports._wellContentsForLabware=tO;exports.absorbanceReaderCloseInitialize=kO;exports.absorbanceReaderCloseLid=hp;exports.absorbanceReaderCloseRead=NO;exports.absorbanceReaderCollision=Sa;exports.absorbanceReaderInitialize=rg;exports.absorbanceReaderOpenLid=yw;exports.absorbanceReaderRead=ng;exports.absorbanceReaderStateGetter=Nn;exports.airGapLocationHelper=dI;exports.aspirate=bw;exports.assignContainsAmongSiblings=Hp;exports.blowOutInWell=ag;exports.captureImage=gw;exports.column4StagingSlotIdFromFlexStackerShuttleAddressableArea=Pg;exports.commandCreatorsTimeline=NA;exports.comment=_w;exports.consolidate=$O;exports.constructInvariantContextFromAnalysis=UA;exports.createEmptyLiquidState=Sg;exports.createStagingAreaForInvariantContext=Uc;exports.createTipLiquidState=Ag;exports.curryCommandCreator=ae;exports.curryWithoutPython=j;exports.deactivateTemperature=Ew;exports.deckSlotKeyForFlexStackerShuttleAddressableArea=hI;exports.delay=Me;exports.delayLocationHelper=mI;exports.disengageMagnet=Jw;exports.dispense=hg;exports.dispenseLocationHelper=pI;exports.distribute=HO;exports.dropTip=wn;exports.dropTipInPlace=wp;exports.dropTipInTrash=F_;exports.dropTipInWasteChute=M_;exports.engageMagnet=Qw;exports.enrichRobotStateForStackGraphTraversals=KS;exports.flexStackerEmpty=eI;exports.flexStackerFillItems=tI;exports.flexStackerRetrieve=rI;exports.flexStackerStateGetter=mt;exports.flexStackerStore=nI;exports.formatChangeTipArg=Po;exports.formatPyDict=Ca;exports.formatPyList=Wp;exports.formatPyStr=ee;exports.formatPyTuple=u_;exports.formatPyValue=la;exports.formatPyWellLocation=kn;exports.getAddressableAreaFromModule=Vp;exports.getAddressableAreaNameFromLabwareLocation=VS;exports.getAllLargestStacks=Xg;exports.getAllProvidedAddressableAreasFromDeckConfig=Zg;exports.getAllWellsForLabware=c_;exports.getChunkForIndentingLists=vo;exports.getCustomLiquidClassProperties=Lo;exports.getCutoutIdByAddressableArea=_g;exports.getCutoutIdFromSlot=O_;exports.getDefaultPrimaryNozzle=qr;exports.getDefineLiquids=__;exports.getDispenseAirGapLocation=Og;exports.getFlexStackerCutoutBaseDeckSlotId=vp;exports.getFlexStackerShuttleAddressableArea=To;exports.getFullStackFromLabwares=Lp;exports.getFullStackFromNodeTopDownRecursive=Ao;exports.getHasNoWellsFromCCArgs=DA;exports.getInitialRobotStateStandard=G_;exports.getInitialRobotStateWithOffDeckLabwareStandard=Sv;exports.getIsHeaterShakerEastWestMultiChannelPipette=Rn;exports.getIsHeaterShakerEastWestWithLatchOpen=Ln;exports.getIsHeaterShakerNorthSouthOfNonTiprackWithMultiChannelPipette=Ra;exports.getIsLabwareCompatibleWithStack=Ng;exports.getIsRetractSafeForAirGap=Nr;exports.getIsSafePickupWithinTiprack=L_;exports.getIsSafePipetteMovement=It;exports.getIsSlotAHopper=Cg;exports.getIsSpaceInHopper=Np;exports.getIsTallLabwareEastWestOfHeaterShaker=l_;exports.getLabwareHasLiquid=Lg;exports.getLabwareIdOnHopper=gI;exports.getLabwareIdOnShuttle=Pp;exports.getLabwareSlot=On;exports.getLargestStackContainingLabware=Kg;exports.getLargestStackInSlot=_o;exports.getLiquidClassName=Da;exports.getLiquidIdsOnLabware=aO;exports.getLiquidIdsOnLabwareStack=nO;exports.getLoadAdapters=h_;exports.getLoadLabware=b_;exports.getLoadLidStacks=y_;exports.getLoadLiquidClasses=E_;exports.getLoadLiquids=T_;exports.getLoadModules=m_;exports.getLoadPipettes=g_;exports.getLoadTrashBins=w_;exports.getLoadWasteChute=I_;exports.getLocationTotalVolume=ur;exports.getModuleIdFromRobotStateStack=Ia;exports.getModuleState=St;exports.getNearestParentInStack=Rg;exports.getNextRobotStateAndWarnings=Gp;exports.getNextRobotStateAndWarningsSingleCommand=s_;exports.getNextTiprack=Fa;exports.getNodeParentModuleId=$S;exports.getNozzleConfig=zp;exports.getPipetteIdFromCCArgs=CA;exports.getPipetteWithTipMaxVol=ko;exports.getProvidedAddressableAreasExposed=HS;exports.getPythonAssignTipRacksString=Ro;exports.getResultingTimelineFrameFromRunCommands=jA;exports.getRobotInitialStateNoTipsRemain=Lv;exports.getRobotStateAndWarningsStandard=Av;exports.getRobotStatePickedUpTipStandard=vv;exports.getRobotStateWithTipStandard=Ov;exports.getSetStoredLabware=A_;exports.getSlotInLocationStack=we;exports.getStackForLabwareLocation=Mc;exports.getStackedOnNodeFromPdStack=Jg;exports.getStateAndContextTempTCModules=Rv;exports.getTargetTipsFromWellSets=qa;exports.getThermocyclerProfileRepetitionsForPython=P_;exports.getTipColumn=Iv;exports.getTipColumnIndex=zc;exports.getTipColumnName=R_;exports.getTipRowName=ra;exports.getTiprackHasTips=vg;exports.getTiprackTipstate=x_;exports.getTopLocationInStack=Op;exports.getTopmostLabwareOnModuleFromStackRobotState=yI;exports.getTransferPlanAndReferenceVolumes=Rp;exports.getTrashBinAddressableAreaName=Ip;exports.getTrashLocationFromAddressableAreaName=Eg;exports.getTrashOrLabware=Sn;exports.getVolumesPerLiquid=rO;exports.getWasteChuteAddressableAreaNamePip=Tg;exports.getWellsForTips=Sp;exports.heaterShaker=KO;exports.indentPyLines=ve;exports.labwareMatchesLabwareInHopper=kp;exports.makeContext=V_;exports.makeInitialRobotState=Ap;exports.makeState=Vr;exports.makeStateArgsLabwareOffDeck=H_;exports.makeStateArgsStandard=Cn;exports.mergeLiquid=cr;exports.mix=jO;exports.mixBlowoutLocationHelper=Ig;exports.modulePipetteCollision=vn;exports.moveHelper=fI;exports.moveLabware=uI;exports.moveToAddressableArea=Xe;exports.moveToAddressableAreaForDropTip=yg;exports.pipetteAdjacentHeaterShakerWhileShaking=Pn;exports.pipetteIntoHeaterShakerLatchOpen=Pa;exports.pipetteIntoHeaterShakerWhileShaking=ka;exports.pythonCustomLabwareDict=_O;exports.pythonDefRun=gO;exports.pythonImports=fO;exports.pythonMetadata=dO;exports.pythonRequirements=mO;exports.reduceCommandCreators=Ne;exports.repeatArray=wg;exports.replaceTip=Ma;exports.resolveDeckSlotKeyForLabwareStackInSlot=kg;exports.robotWithStatusAndTemp=Pv;exports.setTemperature=bg;exports.sortLabwareBySlot=k_;exports.splitLiquid=zt;exports.stepCommands=S_;exports.swatchColors=f_;exports.thermocyclerPipetteCollision=va;exports.thermocyclerProfileStep=XO;exports.thermocyclerStateGetter=No;exports.thermocyclerStateStep=iv;exports.tiprackWellNamesFlat=j_;exports.touchTip=Ct;exports.transfer=dv;exports.unrollThermocyclerProfile=Yp;exports.uuid=ne;exports.vacuumModuleStateGetter=PO;exports.waitForModuleTask=hv;exports.waitForTemperature=gg;exports.wellFillFromWellContents=iO;
|
|
142
|
+
)`}),Vn=c.getByVolumeValue({liquidClass:$,pipetteSpecs:Ee,tiprackDefUri:ee,targetVolume:j,liquidHandlingAction:"aspirate",byVolumeProperty:"flowRateByVolume",defaultValue:null})??s,Jr=c.getByVolumeValue({liquidClass:$,pipetteSpecs:Ee,tiprackDefUri:ee,targetVolume:j,liquidHandlingAction:"singleDispense",byVolumeProperty:"flowRateByVolume",defaultValue:null})??F,xn=c.getByVolumeValue({liquidClass:$,pipetteSpecs:Ee,tiprackDefUri:ee,targetVolume:it,liquidHandlingAction:"aspirate",byVolumeProperty:"flowRateByVolume",defaultValue:null})??s,en=c.getByVolumeValue({liquidClass:$,pipetteSpecs:Ee,tiprackDefUri:ee,targetVolume:it,liquidHandlingAction:"singleDispense",byVolumeProperty:"flowRateByVolume",defaultValue:null})??F,sr=HA($e,k);let Er=null,Hn=null;const be=[...sr.reduce((le,ht,_t)=>{const[we,Ne]=ht,jn=vt.reduce((ue,rt,or)=>{const wr=_t===0&&or===0,Ar=_t+1===sr.length,Gn=or+1===vt.length&&Ar;let yt=!1;A==="always"?yt=!0:A==="once"?yt=wr:A==="perSource"?yt=we!==Er:A==="perDest"&&(yt=wr||Ne!==Hn);const Wn=c.LOW_VOLUME_PIPETTES.includes(Pt)?[O(sa,{pipetteId:q,volume:rt})]:[];let ir=[];if(yt){const gt=ar?.shift();ir=[U(Ba,{pipette:q,primaryNozzle:H,nozzles:ye,dropTipLocation:Rt&&ot!=null?ot:v,tipRack:ee,...ye!=null?{nozzles:ye}:{},...Ve===Et&>!=null&&pe!=null?{tipSelectionArgs:{tipRackId:pe,tipWell:gt}}:{}})]}const Sr=Ie[G]?.def.wells[we]?.depth??null,xt=c.getMmFromBottom(g,o,Sr),Ht=c.getMmFromBottom(y,m,Sr),tn=c.getMmFromBottom(f,l,Sr);xt!=null&&Ht!=null&&xt>Ht&&me.push(lh());const Lr=Fr({retractZOffset:f,retractPositionReference:l,labwareId:G,labwareEntities:Ie,well:we}),lr=!Lr&&we!=null?[O(V,{pipetteId:q,labwareId:G,wellName:we,wellLocation:c.SAFE_MOVE_TO_WELL_LOCATION})]:[],rn=Fr({retractZOffset:ze,retractPositionReference:_e,labwareId:E,labwareEntities:Ie,well:Ne}),Ae=!rn&&Ne!=null?[O(V,{pipetteId:q,labwareId:E,wellName:Ne,wellLocation:c.SAFE_MOVE_TO_WELL_LOCATION})]:[];xt!=null&&tn!=null&&xt>tn&&me.push(uh());const jt=[O(V,{pipetteId:q,labwareId:G,wellName:we,wellLocation:c.SAFE_MOVE_TO_WELL_LOCATION})],Or=[O(qt,{pipetteId:q})],bt=c.getByVolumeValue({liquidClass:$,pipetteSpecs:Ee,tiprackDefUri:ee,targetVolume:it,liquidHandlingAction:"singleDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,zt=B!=null?[O(he,{seconds:B.seconds})]:[],Yn=it>0&&!yt&&(or>0||_t>0)?[O(nt,{isAirGap:!0,pipetteId:q,volume:it,flowRate:en,...bt>0?{correctionVolume:bt}:{},pushOut:0}),...zt]:[],nn=[...jt,...Yn,...Wn,...Or],an=[O(V,{pipetteId:q,labwareId:G,wellName:we,wellLocation:Yr}),O(V,{pipetteId:q,labwareId:G,...h!=null?{speed:h}:{},wellName:we,wellLocation:{origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[o],offset:{x:S,y:w,z:g}}}),..._!=null&&_.seconds>0?[O(he,{seconds:_.seconds})]:[]],Kn=x?Cr({pipette:q,volume:rt,times:1,aspirateFlowRateUlSec:s,dispenseFlowRateUlSec:F,aspirateDelaySeconds:a?.seconds??0,dispenseDelaySeconds:B?.seconds??0,finalPushOut:0,invariantContext:t,liquidClass:$,tiprack:ee,generatePython:!1}):[],sn=C!=null?Cr({pipette:q,volume:C.volume,times:C.times,aspirateFlowRateUlSec:s,dispenseFlowRateUlSec:F,aspirateDelaySeconds:a?.seconds,dispenseDelaySeconds:B?.seconds,finalPushOut:0,invariantContext:t,liquidClass:$,tiprack:ee,generatePython:!1}):[],Rr=a!=null?[O(he,{seconds:a.seconds})]:[],Xn=ft?[O(Mt,{pipetteId:q,labwareId:G,wellName:we,...St!=null?{mmFromEdge:St}:{},zOffsetFromTop:mt,...Oe!=null?{speed:Oe}:{}}),...j>0&&Lr?[O(V,{pipetteId:q,labwareId:G,wellName:we,wellLocation:tr})]:[]]:[],Ce=c.getByVolumeValue({liquidClass:$,pipetteSpecs:Ee,tiprackDefUri:ee,targetVolume:j,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,kr=j>0?[...lr,O(Zt,{pipetteId:q,volume:j,flowRate:Vn,...Ce>0?{correctionVolume:Ce}:{}}),...Rr]:[],on=[O(ms,{pipetteId:q,volume:rt,flowRate:s,...Xr>0?{correctionVolume:Xr}:{}}),...Rr],ur=[O(V,{pipetteId:q,labwareId:G,...u!=null?{speed:u}:{},wellName:we,wellLocation:tr}),...i!=null&&i?.seconds>0?[O(he,{seconds:i.seconds})]:[]],vr=c.getByVolumeValue({liquidClass:$,pipetteSpecs:Ee,tiprackDefUri:ee,targetVolume:j,liquidHandlingAction:"singleDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Gt=Ne!=null?[O(V,{pipetteId:q,labwareId:E,wellName:Ne,wellLocation:mr}),...j>0?[O(nt,{isAirGap:!0,pipetteId:q,volume:j,flowRate:Jr,pushOut:0,...vr>0?{correctionVolume:vr}:{}}),...zt]:[],O(V,{pipetteId:q,labwareId:E,...Le!=null?{speed:Le}:{},wellName:Ne,wellLocation:{origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[te],offset:{x:W,y:Y,z:P}}}),...Ue!=null&&Ue.seconds>0?[O(he,{seconds:Ue.seconds})]:[]]:[O(qe,{fixtureId:E,pipetteId:q,offset:{x:0,y:0,z:0}})],cr=ae!=null&&Ne!=null?0:M,Zn=[O(nt,{pipetteId:q,volume:rt,flowRate:F,...cr!=null?{pushOut:cr}:{},...yr>0?{correctionVolume:yr}:{}}),...zt],Ha=ae!=null&&Ne!=null?Cr({pipette:q,volume:ae.volume,times:ae.times,aspirateFlowRateUlSec:s,dispenseFlowRateUlSec:F,aspirateDelaySeconds:a?.seconds,dispenseDelaySeconds:B?.seconds,finalPushOut:M,invariantContext:t,liquidClass:$,tiprack:ee,generatePython:!1}):[],ks=Ne!=null?[O(V,{pipetteId:q,labwareId:E,...oe!=null?{speed:oe}:{},wellName:Ne,wellLocation:rr}),...de!=null&&de?.seconds>0?[O(he,{seconds:de.seconds})]:[]]:[],ja=O(Sa,{pipetteId:q,flowRate:I}),Qn=c.getByVolumeValue({liquidClass:$,pipetteSpecs:Ee,tiprackDefUri:ee,targetVolume:it,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Tt=(gt,Pr=!0)=>it>0&&!(A==="never"&&Gn&>)?[...Pr?Ae:[],O(qt,{pipetteId:q}),O(Zt,{pipetteId:q,volume:it,flowRate:xn,...Qn>0?{correctionVolume:Qn}:{}}),...Rr]:[],ln=gt=>Ne!=null&&Qe?[O(Mt,{pipetteId:q,labwareId:E,wellName:Ne,...Re!=null?{mmFromEdge:Re}:{},zOffsetFromTop:ke,...Pe!=null?{speed:Pe}:{}}),...Tt(gt).length>0&&rn?[O(V,{pipetteId:q,labwareId:E,wellName:Ne,wellLocation:rr})]:[]]:[];let Nt=[];switch(L){case null:case void 0:Nt=[...ln(!0),...Tt(!0)];break;case Sn:Nt=[ja,...ln(!0),...Tt(!0)];break;case Hr:Nt=[...ln(!0),...Tt(!1),O(V,{pipetteId:q,labwareId:G,wellName:we,wellLocation:{origin:c.WELL_ORIGIN_TOP}}),ja,...Qe&&!Je?[O(Mt,{pipetteId:q,labwareId:G,wellName:we,...Re!=null?{mmFromEdge:Re}:{},zOffsetFromTop:ke,...Pe!=null?{speed:Pe}:{}})]:[],...Tt(!0).length>0?[O(V,{pipetteId:q,labwareId:G,wellName:we,wellLocation:{origin:c.WELL_ORIGIN_TOP}})]:[],...Tt(!0,!1)];break;default:L in We?Nt=[...ln(!1),...Tt(!1),O(by,{pipetteId:q,flowRate:I,trashId:L}),...Tt(!0,!1)]:L in K&&(Nt=[O(Ty,{pipetteId:q,flowRate:I,wasteChuteId:L}),...Tt(!0,!1)]);break}const za=Rt&&(_t===sr.length-1||A==="always")?[O(wn,{pipette:q,dropTipLocation:ee,isReturnTip:Rt})]:[],Ct=[...ir,...nn,...an,...sn,...Kn,...on,...ur,...Xn,...kr,...Gt,...Zn,...Ha,...ks,...Nt,...za];return Er=we,Hn=Ne,[...ue,...Ct]},[]);return[...le,...jn]},[]),Ir];return ce(be,t,r)},Sy=(e,t,r)=>{const n=`[${e.task_ids.join(", ")}]`,a=`${ge}.wait_for_tasks(${n})`;return{commands:[{key:D(),commandType:"waitForTasks",params:e}],python:a}},zA=(e,t,r)=>{const{waitCondition:n}=e;return n==="thermocyclerProfileComplete"?GA(e,t,r):n==="vacuumProfileComplete"||n==="vacuumStateComplete"?WA(e,t,r):{errors:[ub(n)]}},GA=(e,t,r)=>{const{moduleId:n}=e,a=[],s=Rs(r,n);if(s==null)return{errors:[X()]};if(s.currentBlockActivity.type!=="profile")return{errors:[xc()]};const{taskId:o}=s.currentBlockActivity;return o==null?{errors:[xc()]}:(a.push(U(Sy,{task_ids:[o]})),ce(a,t,r))},WA=(e,t,r)=>{const{moduleId:n}=e,a=[],s=st(r,n);if(s==null)return{errors:[X()]};if(s.currentPumpActivity.type!=="timedHold"&&s.currentPumpActivity.type!=="profile")return{errors:[lb()]};const o=s.currentPumpActivity.taskId;return a.push(U(Sy,{task_ids:[o]})),ce(a,t,r)};var Pu,rh;function YA(){if(rh)return Pu;rh=1;var e=k_(),t=1,r=4;function n(a){return e(a,t|r)}return Pu=n,Pu}var KA=YA();const XA=xe(KA),Ly=["A1","B1","C1","D1","E1","F1","G1","H1","A2","B2","C2","D2","E2","F2","G2","H2","A3","B3","C3","D3","E3","F3","G3","H3","A4","B4","C4","D4","E4","F4","G4","H4","A5","B5","C5","D5","E5","F5","G5","H5","A6","B6","C6","D6","E6","F6","G6","H6","A7","B7","C7","D7","E7","F7","G7","H7","A8","B8","C8","D8","E8","F8","G8","H8","A9","B9","C9","D9","E9","F9","G9","H9","A10","B10","C10","D10","E10","F10","G10","H10","A11","B11","C11","D11","E11","F11","G11","H11","A12","B12","C12","D12","E12","F12","G12","H12"],Br="p300SingleId",ca="p300MultiId",Gu="p100096Id",Wu="sourcePlateId",Yu="destPlateId",Ku="troughId",ZA="A1",QA="tiprack1Id",JA={isAirGap:!0},Wa=c.fixture96Plate,nh=c.fixture12Trough,Ya=c.fixtureTiprack10ul,Dt=c.fixtureTiprack300ul,un=c.fixtureTiprack1000ul,Ka=c.fixtureTiprackAdapter,Oy={OT_PD_DISABLE_MODULE_RESTRICTIONS:!1};function Ry(e){return Ly.reduce((t,r)=>({...t,[r]:e?ga:se}),{})}function eS(e,t){return Array.from("ABCDEFGH").map(r=>`${r}${e}`).reduce((r,n)=>({...r,[n]:t}),{})}function ky(){const e={[Wu]:{id:Wu,pythonName:"mock_source_plate",labwareDefURI:c.getLabwareDefURI(Wa),def:Wa},[Yu]:{id:Yu,pythonName:"mock_dest_plate",labwareDefURI:c.getLabwareDefURI(Wa),def:Wa},[Ku]:{id:Ku,pythonName:"mock_trough",labwareDefURI:c.getLabwareDefURI(nh),def:nh},tiprack1Id:{id:"tiprack1Id",pythonName:"mock_tip_rack_1",labwareDefURI:c.getLabwareDefURI(Dt),def:Dt},tiprack2Id:{id:"tiprack2Id",pythonName:"mock_tip_rack_2",labwareDefURI:c.getLabwareDefURI(Dt),def:Dt},tiprack3Id:{id:"tiprack3Id",pythonName:"mock_tip_rack_3",labwareDefURI:c.getLabwareDefURI(Dt),def:Dt},tiprack4AdapterId:{id:"tiprack4AdapterId",pythonName:"mock_adapter_4",labwareDefURI:c.getLabwareDefURI(Ka),def:Ka},tiprack5AdapterId:{id:"tiprack5AdapterId",pythonName:"mock_adapter_5",labwareDefURI:c.getLabwareDefURI(Ka),def:Ka},tiprack4Id:{id:"tiprack4Id",pythonName:"mock_tip_rack_4",labwareDefURI:c.getLabwareDefURI(un),def:un},tiprack5Id:{id:"tiprack5Id",pythonName:"mock_tip_rack_5",labwareDefURI:c.getLabwareDefURI(un),def:un}},t={},r={[Cu]:{id:Cu,location:"cutoutA3",pythonName:"trash_bin_1"}},n={p10SingleId:{name:"p10_single",id:"p10SingleId",pythonName:"mock_pipette_p10",tiprackDefURI:[c.getLabwareDefURI(Ya)],tiprackLabwareDef:[Ya],spec:c.fixtureP10SingleV2Specs},p10MultiId:{name:"p10_multi",id:"p10MultiId",tiprackDefURI:[c.getLabwareDefURI(Ya)],tiprackLabwareDef:[Ya],spec:c.fixtureP10MultiV2Specs,pythonName:"mock_pipette_p10_multi"},[Br]:{name:"p300_single",id:Br,tiprackDefURI:[c.getLabwareDefURI(Dt)],tiprackLabwareDef:[Dt],spec:c.fixtureP300SingleV2Specs,pythonName:"mock_pipette"},[ca]:{name:"p300_multi",id:ca,tiprackDefURI:[c.getLabwareDefURI(Dt)],tiprackLabwareDef:[Dt],spec:c.fixtureP300MultiV2Specs,pythonName:"mock_pipette_p300_multi"},[Gu]:{name:"p1000_96",id:Gu,tiprackDefURI:[c.getLabwareDefURI(un)],tiprackLabwareDef:[un],spec:c.fixtureP100096V2Specs,pythonName:"mock_pipette_p1000_96"}};return{labwareEntities:e,moduleEntities:t,pipetteEntities:n,trashBinEntities:r,wasteChuteEntities:{},stagingAreaEntities:{},gripperEntities:{},liquidEntities:{},config:Oy}}const zr=e=>{const{invariantContext:t,labwareLocations:r,moduleLocations:n,pipetteLocations:a,tiprackSetting:s}=e,o=Tc({invariantContext:t,labwareLocations:r,moduleLocations:n||{},pipetteLocations:a});return o.tipState.tipracks=Xt(s,i=>Ry(i)),o},Mn=()=>({pipetteLocations:{[Br]:{mount:"left",tiprackId:"tiprack1Id"},[ca]:{mount:"right",tiprackId:"tiprack1Id"}},labwareLocations:{tiprack1Id:{stack:["tiprack1Id","1"]},tiprack2Id:{stack:["tiprack2Id","5"]},tiprack4AdapterId:{stack:["tiprack4AdapterId","7"]},tiprack5AdapterId:{stack:["tiprack5AdapterId","8"]},tiprack4Id:{stack:["tiprack4Id","tiprack4AdapterId","7"]},tiprack5Id:{stack:["tiprack5Id","tiprack5AdapterId","8"]},sourcePlateId:{stack:["sourcePlateId","2"]},destPlateId:{stack:["destPlateId","3"]}},moduleLocations:{}}),vy=()=>({pipetteLocations:{[Br]:{mount:"left"},[ca]:{mount:"right"}},labwareLocations:{tiprack1Id:{stack:["tiprack1Id","B1"]},tiprack2Id:{stack:["tiprack2Id","A2"]},sourcePlateId:{stack:["sourcePlateId","offDeck"]},destPlateId:{stack:["destPlateId","C2"]}},moduleLocations:{}}),Py=e=>zr({...Mn(),invariantContext:e,tiprackSetting:{tiprack1Id:!0,tiprack2Id:!0}}),tS=e=>zr({...vy(),invariantContext:e,tiprackSetting:{tiprack1Id:!0,tiprack2Id:!0}}),rS=e=>({robotState:Py(e),warnings:[]}),nS=e=>{const t=zr({...Mn(),invariantContext:e,tiprackSetting:{tiprack1Id:!0,tiprack2Id:!0}});return t.tipState.pipettes[Br]={hasTip:!0,tiprackURI:"tiprack1Id"},t},aS=e=>{const t=zr({...Mn(),invariantContext:e,tiprackSetting:{tiprack1Id:!0}});return t.tipState.pipettes[Br]={hasTip:!0,tiprackURI:"tiprack1Id"},t.tipState.tipracks.tiprack1Id.A1=se,t},sS=e=>zr({...Mn(),invariantContext:e,tiprackSetting:{tiprack1Id:!1,tiprack2Id:!1}}),oS=({temperatureModuleId:e,thermocyclerId:t})=>{const r=ky();r.moduleEntities={[e]:{id:e,type:c.TEMPERATURE_MODULE_TYPE,model:"foo",pythonName:"mock_temperature_module_1"},[t]:{id:t,type:c.THERMOCYCLER_MODULE_TYPE,model:"foo",pythonName:"mock_thermocycler"}};const n=zr({...Mn(),invariantContext:r,tiprackSetting:{tiprack1Id:!0}});return n.modules={[e]:{slot:"3",moduleState:{type:c.TEMPERATURE_MODULE_TYPE,status:Ta,targetTemperature:null}},[t]:{slot:"span7_8_10_11",moduleState:{type:c.THERMOCYCLER_MODULE_TYPE,currentBlockActivity:{type:"blockDeactivated"},lidTargetTemp:null,lidOpen:null,numProfilesStarted:0}}},{invariantContext:r,robotState:n}},iS=(e,t,r,n)=>{const a=XA(e);return a.modules[t].moduleState={type:c.TEMPERATURE_MODULE_TYPE,targetTemperature:n,status:r},a};exports.ABSORBANCE_READER_INITIAL_STATE=yh;exports.AIR=je;exports.AIR_GAP_META=JA;exports.AIR_GAP_OFFSET_FROM_TOP=Nu;exports.AUTOMATIC=Qu;exports.BOTTOM_UP_LABWARE_POOL_KEYS=Yt;exports.BOTTOM_UP_STORED_LABWARE_URI_KEYS=Tb;exports.CLEAN=ga;exports.COLUMN_4_SLOTS=De;exports.CUSTOM_LABWARE_DICT_NAME=hs;exports.DEFAULT_BLOWOUT_WELL=ZA;exports.DEFAULT_CONFIG=Oy;exports.DEFAULT_PIPETTE=Br;exports.DEST_LABWARE=Yu;exports.DEST_WELL_BLOWOUT_DESTINATION=Sn;exports.DIRTY=Wt;exports.EMPTY=se;exports.FAKE_HOPPER_LOCATION_MAP=Sh;exports.FIXED_TRASH_ID=Cu;exports.FLEX_STACKER_MODULE_INITIAL_STATE=Th;exports.FLEX_TRASH_DEF_URI=yb;exports.GRIPPER_LOCATION=Eh;exports.HEATERSHAKER_MODULE_INITIAL_STATE=_h;exports.HOPPER_FAKE_LOCATIONS=Ah;exports.HOPPER_STACKER_LOCATION=He;exports.INDENT=La;exports.MAGNETIC_BLOCK_INITIAL_STATE=bh;exports.MAGNETIC_MODULE_INITIAL_STATE=fh;exports.MANUAL=Et;exports.MIXED_WELL_COLOR=X_;exports.MODULES_WITH_COLLISION_ISSUES=dh;exports.MODULE_INITIAL_STATE_BY_TYPE=Ih;exports.MULTI_PIPETTE=ca;exports.OFF_DECK=oa;exports.OT2_TC_SLOTS=bb;exports.OT_2_TRASH_DEF_URI=_b;exports.PAPI_VERSION=Q_;exports.PD_APPLICATION_VERSION=xw;exports.PIPETTE_96=Gu;exports.PROTOCOL_CONTEXT_NAME=ge;exports.SLOT_LOCATIONS_TO_FAKE_HOPPER_LOCATIONS=gb;exports.SOURCE_LABWARE=Wu;exports.SOURCE_WELL_BLOWOUT_DESTINATION=Hr;exports.STAGING_AREA_SLOTS=wh;exports.TEMPERATURE_APPROACHING_TARGET=Zu;exports.TEMPERATURE_AT_TARGET=Xu;exports.TEMPERATURE_DEACTIVATED=Ta;exports.TEMPERATURE_MODULE_INITIAL_STATE=mh;exports.THERMOCYCLER_MODULE_INITIAL_STATE=hh;exports.TIPRACK_1=QA;exports.TOUCHED_PIPETTABLE_LABWARE=ju;exports.TROUGH_LABWARE=Ku;exports.VACUUM_AT_TARGET=Pb;exports.VACUUM_DEACTIVATED=vb;exports.VACUUM_MAX_PRESSURE_MBAR=kb;exports.VACUUM_MIN_PRESSURE_MBAR=Rb;exports.VACUUM_MODE_POWER=Du;exports.VACUUM_MODE_PRESSURE=Mu;exports.VACUUM_MODULE_INITIAL_STATE=gh;exports.VACUUM_PROGRAM_PROFILE=Eb;exports.VACUUM_PROGRAM_STATE=Ib;exports.VACUUM_STATE_PUMP_OFF=wb;exports.VACUUM_STATE_PUMP_ON=Ab;exports.VACUUM_STATE_VENT=Sb;exports.VACUUM_VENT_CLOSED=Ia;exports.VACUUM_VENT_OPEN=ns;exports.VACUUM_VENT_SET_CLOSED=Ob;exports.VACUUM_VENT_SET_OPEN=Lb;exports.ZERO_OFFSET=It;exports._getNextTip=yy;exports._wellContentsForLabware=Nw;exports.absorbanceReaderCloseInitialize=lA;exports.absorbanceReaderCloseLid=mc;exports.absorbanceReaderCloseRead=uA;exports.absorbanceReaderCollision=Ra;exports.absorbanceReaderInitialize=Kh;exports.absorbanceReaderOpenLid=ag;exports.absorbanceReaderRead=Xh;exports.absorbanceReaderStateGetter=Dn;exports.airGapLocationHelper=Mg;exports.aspirate=sg;exports.assignContainsAmongSiblings=Uc;exports.blowOutInWell=Zh;exports.captureImage=og;exports.column4StagingSlotIdFromFlexStackerShuttleAddressableArea=h_;exports.commandCreatorsTimeline=pw;exports.comment=ig;exports.consolidate=bA;exports.constructInvariantContextFromAnalysis=yw;exports.createEmptyLiquidState=u_;exports.createStagingAreaForInvariantContext=qu;exports.createTipLiquidState=c_;exports.curryCommandCreator=U;exports.curryWithoutPython=O;exports.deactivateTemperature=ug;exports.deckSlotKeyForFlexStackerShuttleAddressableArea=qg;exports.delay=he;exports.delayLocationHelper=Fg;exports.disengageMagnet=cg;exports.dispense=Qh;exports.dispenseLocationHelper=Cg;exports.distribute=IA;exports.dropTip=wn;exports.dropTipInPlace=hc;exports.dropTipInTrash=Iy;exports.dropTipInWasteChute=Ey;exports.engageMagnet=pg;exports.enrichRobotStateForStackGraphTraversals=bE;exports.flexStackerEmpty=dg;exports.flexStackerFillItems=fg;exports.flexStackerRetrieve=mg;exports.flexStackerStateGetter=dt;exports.flexStackerStore=hg;exports.formatChangeTipArg=Ls;exports.formatPyDict=Mr;exports.formatPyList=_c;exports.formatPyStr=N;exports.formatPyTuple=t_;exports.formatPyValue=pt;exports.formatPyWellLocation=An;exports.getAddressableAreaFromModule=qc;exports.getAddressableAreaNameFromLabwareLocation=dE;exports.getAllLargestStacks=M_;exports.getAllProvidedAddressableAreasFromDeckConfig=F_;exports.getAllWellsForLabware=K_;exports.getChunkForIndentingLists=_s;exports.getCustomLiquidClassProperties=As;exports.getCutoutFromSlot=py;exports.getCutoutIdByAddressableArea=a_;exports.getDefaultPrimaryNozzle=es;exports.getDefineLiquids=ay;exports.getDispenseAirGapLocation=p_;exports.getFlexStackerCutoutBaseDeckSlotId=Ic;exports.getFlexStackerShuttleAddressableArea=bs;exports.getFullStackFromLabwares=Ec;exports.getFullStackFromNodeTopDownRecursive=ws;exports.getHasNoWellsFromCCArgs=fw;exports.getInitialRobotStateStandard=Py;exports.getInitialRobotStateWithOffDeckLabwareStandard=tS;exports.getIsHeaterShakerEastWestMultiChannelPipette=Nn;exports.getIsHeaterShakerEastWestWithLatchOpen=Pn;exports.getIsHeaterShakerNorthSouthOfNonTiprackWithMultiChannelPipette=Ca;exports.getIsLabwareCompatibleWithStack=y_;exports.getIsRetractSafeForAirGap=Fr;exports.getIsSafePickupWithinTiprack=fy;exports.getIsSafePipetteMovement=wt;exports.getIsSlotAHopper=b_;exports.getIsSpaceInHopper=Lc;exports.getIsTallLabwareEastWestOfHeaterShaker=W_;exports.getLabwareHasLiquid=f_;exports.getLabwareIdOnHopper=$g;exports.getLabwareIdOnShuttle=Ac;exports.getLabwareSlot=Rn;exports.getLargestStackContainingLabware=D_;exports.getLargestStackInSlot=ys;exports.getLiquidClassName=Fa;exports.getLiquidIdsOnLabware=Mw;exports.getLiquidIdsOnLabwareStack=Dw;exports.getLoadAdapters=ey;exports.getLoadLabware=ry;exports.getLoadLidStacks=ty;exports.getLoadLiquidClasses=oy;exports.getLoadLiquids=sy;exports.getLoadModules=J_;exports.getLoadPipettes=ny;exports.getLoadTrashBins=iy;exports.getLoadWasteChute=ly;exports.getLocationTotalVolume=pr;exports.getModuleHasLiveTask=kn;exports.getModuleIdFromRobotStateStack=Oa;exports.getModuleState=At;exports.getNearestParentInStack=m_;exports.getNextRobotStateAndWarnings=Bc;exports.getNextRobotStateAndWarningsSingleCommand=G_;exports.getNextTiprack=Ua;exports.getNodeParentModuleId=cE;exports.getNozzleConfig=$c;exports.getPipetteIdFromCCArgs=dw;exports.getPipetteWithTipMaxVol=Os;exports.getProvidedAddressableAreasExposed=fE;exports.getPythonAssignTipRacksString=Ss;exports.getResultingTimelineFrameFromRunCommands=Tw;exports.getRobotInitialStateNoTipsRemain=sS;exports.getRobotStateAndWarningsStandard=rS;exports.getRobotStatePickedUpTipStandard=aS;exports.getRobotStateWithTipStandard=nS;exports.getSetStoredLabware=cy;exports.getSlotInLocationStack=z;exports.getStackForLabwareLocation=Fu;exports.getStackedOnNodeFromPdStack=q_;exports.getStateAndContextTempTCModules=oS;exports.getTargetTipsFromWellSets=qa;exports.getThermocyclerProfileRepetitionsForPython=hy;exports.getTipColumn=eS;exports.getTipColumnIndex=zu;exports.getTipColumnName=my;exports.getTipRowName=aa;exports.getTiprackHasTips=d_;exports.getTiprackTipstate=Ry;exports.getTopLocationInStack=gc;exports.getTopmostLabwareOnModuleFromStackRobotState=Ug;exports.getTransferPlanAndReferenceVolumes=wc;exports.getTrashBinAddressableAreaName=yc;exports.getTrashLocationFromAddressableAreaName=o_;exports.getTrashOrLabware=Ln;exports.getVolumesPerLiquid=Cw;exports.getWasteChuteAddressableAreaNamePip=s_;exports.getWellsForTips=bc;exports.heaterShaker=LA;exports.indentPyLines=Z;exports.labwareMatchesLabwareInHopper=Sc;exports.makeContext=ky;exports.makeInitialRobotState=Tc;exports.makeState=zr;exports.makeStateArgsLabwareOffDeck=vy;exports.makeStateArgsStandard=Mn;exports.mergeLiquid=dr;exports.mix=yA;exports.mixBlowoutLocationHelper=l_;exports.modulePipetteCollision=vn;exports.moveHelper=Dg;exports.moveLabware=Ig;exports.moveToAddressableArea=qe;exports.moveToAddressableAreaForDropTip=Jh;exports.pipetteAdjacentHeaterShakerWhileShaking=Cn;exports.pipetteIntoHeaterShakerLatchOpen=Da;exports.pipetteIntoHeaterShakerWhileShaking=Ma;exports.pythonCustomLabwareDict=Xw;exports.pythonDefRun=Kw;exports.pythonImports=Hw;exports.pythonMetadata=jw;exports.pythonRequirements=zw;exports.reduceCommandCreators=ce;exports.repeatArray=i_;exports.replaceTip=Ba;exports.resolveDeckSlotKeyForLabwareStackInSlot=__;exports.robotWithStatusAndTemp=iS;exports.setTemperature=e_;exports.sortLabwareBySlot=_y;exports.splitLiquid=Kt;exports.stepCommands=uy;exports.swatchColors=Z_;exports.thermocyclerPipetteCollision=Pa;exports.thermocyclerProfileStep=OA;exports.thermocyclerStateGetter=Rs;exports.thermocyclerStateStep=qA;exports.tiprackWellNamesFlat=Ly;exports.touchTip=Mt;exports.transfer=jA;exports.unrollThermocyclerProfile=Vc;exports.uuid=D;exports.vacuumCloseVent=wg;exports.vacuumModuleStateGetter=st;exports.vacuumOpenVent=Ag;exports.vacuumSetPumpPower=Lg;exports.vacuumSetPumpPressure=Og;exports.vacuumStartRunProfile=Pg;exports.vacuumStopPump=Ng;exports.waitForModuleTask=zA;exports.waitForTemperature=n_;exports.wellFillFromWellContents=qw;
|