"use strict";var e=require("react"),i=require("prop-types"),t=require("classnames"),r=require("@material-ui/core"),a=require("@material-ui/core/colors/blue"),n=require("../../../utils/convert.js"),s=require("../../../utils/FluidCheckUtils.js"),c=require("react/jsx-runtime");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=o(t),u=o(a),p="fluidReportActivity",l=r.makeStyles((function(e){return{density:{color:u.default[300]},unit:{color:e.palette.grey[400],marginLeft:5},oneLineText:{display:"flex",alignItems:"center"},title:{color:e.palette.grey[400]},columnWithMargin:{marginRight:40}}})),y=function(i){var t=i.feedItem.context.fluid_report.data,a=t.depth,o=t.mud_type,u=t.mud_density,y=t.viscosity,m=y.pv,h=void 0===m?"":m,g=y.yp,f=void 0===g?"":g,x=y.rpm_readings,v=l(),q=s.ctop(a,"length","ft"),R=q?q.formatNumeral("0,0"):"-",j=n.getUnitDisplay("length"),T=n.convertValue(+u,"density","ppg").formatNumeral("0,0.00"),b=n.getUnitDisplay("density"),N=n.getUnitDisplay("yp"),_=Number.isFinite(h)?h.fixFloat(3):h,D=Number.isFinite(f)?f.fixFloat(3):f,F=e.useMemo((function(){var e=x.length-1;return x.reduce((function(i,t,r){var a=r===e?"":", ",n="".concat(t.rpm,"/").concat(t.dial_reading);return"".concat(i).concat(n).concat(a)}),"")}),[x]);return c.jsxs(r.Grid,{container:!0,spacing:"40",justify:"flex-start",children:[c.jsxs(r.Grid,{item:!0,className:v.columnWithMargin,children:[c.jsx(r.Typography,{variant:"body2",children:"Density"}),c.jsxs(r.Typography,{variant:"h6","data-testid":"".concat(p,"_density"),className:d.default(v.density,v.oneLineText),children:[T,c.jsxs(r.Typography,{component:"span",variant:"caption",className:v.unit,children:["(",b,")"]})]}),c.jsxs(r.Typography,{className:v.oneLineText,children:[R,c.jsxs(r.Typography,{component:"span",variant:"caption",className:v.unit,children:["(",j,")"]})," / ",o]})]}),c.jsxs(r.Grid,{item:!0,children:[c.jsxs(r.Typography,{variant:"body2","data-testid":"".concat(p,"_viscosity"),className:v.oneLineText,children:[c.jsx(r.Typography,{variant:"span",className:v.title,children:"PV: "}),"".concat(_," ").concat("cP"," / YP: ").concat(D),c.jsx(r.Typography,{component:"span",variant:"caption",className:v.unit,children:N})]}),c.jsx(r.Typography,{variant:"body2",className:v.title,children:"Rheometer Readings (RPM/Dial Reading):"}),c.jsx(r.Typography,{variant:"body2","data-testid":"".concat(p,"_rheometerReadings"),children:F})]})]})};y.propTypes={feedItem:i.shape({context:i.shape({fluid_report:i.shape({data:i.shape({depth:i.number.isRequired,mud_type:i.string.isRequired,mud_density:i.number.isRequired,viscosity:i.shape({pv:i.number.isRequired,yp:i.number.isRequired,rpm_readings:i.arrayOf(i.shape({id:i.string.isRequired,dial_reading:i.number.isRequired,rpm:i.number.isRequired})).isRequired}).isRequired}).isRequired}).isRequired}).isRequired}).isRequired},module.exports=y;
