import{FLUIDS_TYPES as e,PROPPANTS_TYPES as a,CHEMICALS_MASS_TYPES as n,CHEMICALS_VOL_TYPES as m,CHEMICALS_TYPES as t}from"../../../constants/completion.js";var r=function(r){var u,o,i=r.designElements,c=r.actualElements,s=r.rowKey,l=r.predictionSummary;switch(s){case"volumeChemicals":u=m.map((function(e){return e.name})),o="volume";break;case"massChemicals":u=n.map((function(e){return e.name})),o="mass";break;case"proppants":u=a.map((function(e){return e.name})),o="mass";break;default:u=e.map((function(e){return e.name})),o="oil"}return u.reduce((function(e,a){var n=i[a]&&i[a].amount,m=c[a]&&c[a].amount,r=0;if("volumeChemicals"===s||"massChemicals"===s){var u=t.find((function(e){return e.name===a}))||{};r=l[u.key]}if(!n&&!m&&!r)return e;var p=Math.max(n||0,m||0);return{elemMax:Math.max(p,e.elemMax),elemAmount:e.elemAmount.concat({key:a,design:n||0,actual:m||0,predictionVal:r,unitType:o})}}),{elemMax:0,elemAmount:[]})};export{r as getElementInfo};
//# sourceMappingURL=utils.js.map
