import e from"@babel/runtime/helpers/defineProperty";import{jsxs as t,jsx as l}from"react/jsx-runtime";import{memo as i,useMemo as n}from"react";import o from"classnames";import{TableRow as d,TableCell as s}from"@material-ui/core";import{ColumnType as h,EXPANDED_WELL_NAME_WIDTH as a}from"../../../../constants.js";import{useViewStore as m}from"../../../../stores/view-store/useViewStore.js";import r from"./SkeletonTableRow.module.css.js";import{Skeleton as c}from"../../../../../../componentsV2/Skeleton/Skeleton.js";var v=i((function(i){var v,u,f,g,x,p,y,W,w,N,k,C,S,A,b,j,M,T,V,R,D,E,K=i.columnsWithDict,P=i.metricsKeys,q=i.hasCompanyColumn,z=i.hasTaColumn,B=i.isWellSectionColumnVisible,F=i.wellNameStyle,G=m((function(e){return e.isWellNameExpand})),H=n((function(){return new Map((null==K?void 0:K.map((function(e){return[e.key,e]})))||[])}),[K]),I=H.has(h.rig),J=H.has(h.distance),L=H.has(h.interventionAsset),O=H.has(h.padName),Q=H.has(h.formation),U=n((function(){return B?"wellSection":P.length>0?"lastMetric":"lastActive"}),[B,P.length]);return t(d,{className:r.skeletonRow,children:[t(s,{className:o(r.skeletonCell,r.wellNameCell,F),style:G?{minWidth:a,flex:0}:{minWidth:(null===(v=H.get(h.name))||void 0===v?void 0:v.minWidth)||0,flex:(null===(u=H.get(h.name))||void 0===u?void 0:u.flex)||0},children:[l("div",{className:r.checkboxSkeleton,children:l(c,{type:"block",width:18,height:18})}),l("div",{className:r.wellNameTextWrapper,children:l(c,{type:"text",width:"70%",height:16})})]}),l(s,{className:r.skeletonCell,style:{minWidth:(null===(f=H.get(h.status))||void 0===f?void 0:f.minWidth)||0,flex:(null===(g=H.get(h.status))||void 0===g?void 0:g.flex)||0},children:l("div",{className:r.statusSkeleton,children:l(c,{type:"circle",width:8,height:8})})}),q&&l(s,{className:r.skeletonCell,style:{minWidth:(null===(x=H.get(h.company))||void 0===x?void 0:x.minWidth)||0,flex:(null===(p=H.get(h.company))||void 0===p?void 0:p.flex)||0},children:l(c,{type:"text",width:"60%",height:16})}),L&&l(s,{className:r.skeletonCell,style:{minWidth:(null===(y=H.get(h.interventionAsset))||void 0===y?void 0:y.minWidth)||0,flex:(null===(W=H.get(h.interventionAsset))||void 0===W?void 0:W.flex)||0},children:l(c,{type:"text",width:"55%",height:16})}),O&&l(s,{className:r.skeletonCell,style:{minWidth:(null===(w=H.get(h.padName))||void 0===w?void 0:w.minWidth)||0,flex:(null===(N=H.get(h.padName))||void 0===N?void 0:N.flex)||0},children:l(c,{type:"text",width:"50%",height:16})}),Q&&l(s,{className:r.skeletonCell,style:{minWidth:(null===(k=H.get(h.formation))||void 0===k?void 0:k.minWidth)||0,flex:(null===(C=H.get(h.formation))||void 0===C?void 0:C.flex)||0},children:l(c,{type:"text",width:"55%",height:16})}),I&&l(s,{className:r.skeletonCell,style:{minWidth:(null===(S=H.get(h.rig))||void 0===S?void 0:S.minWidth)||0,flex:(null===(A=H.get(h.rig))||void 0===A?void 0:A.flex)||0},children:l(c,{type:"text",width:"50%",height:16})}),J&&l(s,{className:r.skeletonCell,style:{minWidth:(null===(b=H.get(h.distance))||void 0===b?void 0:b.minWidth)||0,flex:(null===(j=H.get(h.distance))||void 0===j?void 0:j.flex)||0},children:l(c,{type:"text",width:40,height:16})}),z&&l(s,{className:r.skeletonCell,style:{minWidth:(null===(M=H.get(h.taScore))||void 0===M?void 0:M.minWidth)||0,flex:(null===(T=H.get(h.taScore))||void 0===T?void 0:T.flex)||0},children:l(c,{type:"text",width:30,height:16})}),l(s,{className:o(r.skeletonCell,e({},r.lastCell,"lastActive"===U)),style:{minWidth:(null===(V=H.get(h.lastActive))||void 0===V?void 0:V.minWidth)||0,flex:(null===(R=H.get(h.lastActive))||void 0===R?void 0:R.flex)||0},children:l(c,{type:"text",width:70,height:16})}),P.map((function(t,i){var n,d;return l(s,{className:o(r.skeletonCell,e({},r.lastCell,"lastMetric"===U&&i===P.length-1)),style:{minWidth:(null===(n=H.get(t))||void 0===n?void 0:n.minWidth)||0,flex:(null===(d=H.get(t))||void 0===d?void 0:d.flex)||0},children:l(c,{type:"text",width:50,height:16})},t)})),B&&l(s,{className:o(r.skeletonCell,r.lastCell),style:{minWidth:(null===(D=H.get(h.wellSection))||void 0===D?void 0:D.minWidth)||0,flex:(null===(E=H.get(h.wellSection))||void 0===E?void 0:E.flex)||0},children:l(c,{type:"text",width:"50%",height:16})})]})}));export{v as SkeletonTableRow};
//# sourceMappingURL=SkeletonTableRow.js.map
