import e from"@babel/runtime/helpers/toConsumableArray";var l,n;!function(e){e.ASC="asc",e.DESC="desc"}(l||(l={})),function(e){e.PAD="name",e.WELL="wellName",e.TVD="tvd",e.FORMATION="formation"}(n||(n={}));var t=function(t,o){return function(a,r){var i="",m="";if(t===n.TVD){var u=a.wells||[],f=r.wells||[];i=u.length?Math.min.apply(Math,e(u.map((function(e){return e.totalDepth})))):0,m=f.length?Math.min.apply(Math,e(f.map((function(e){return e.totalDepth})))):0}else if(t===n.FORMATION){var p,s,v=a.wells||[],c=r.wells||[];i=null===(p=v[0])||void 0===p?void 0:p.formation,m=null===(s=c[0])||void 0===s?void 0:s.formation}else if(t===n.WELL){var d,h,A=a.wells||[],C=r.wells||[];i=null===(d=A[0])||void 0===d?void 0:d.name,m=null===(h=C[0])||void 0===h?void 0:h.name}else i="string"==typeof a[t]?a[t]:"",m="string"==typeof r[t]?r[t]:"";return i=String(i),m=String(m),i||m?i?m?o===l.ASC?i.localeCompare(m):m.localeCompare(i):o===l.ASC?1:-1:o===l.ASC?-1:1:0}};export{n as SortBy,l as SortDirection,t as sortPads};
//# sourceMappingURL=sortPads.js.map
