import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import{ROWS_PER_PAGE as r}from"../../constants.js";import{dataFormatter as a}from"../shared/dataFormatter.js";import{transformToApiCoordinateBounds as s}from"../shared/transformers/transformToApiCoordinateBounds.js";import{getWells as n}from"../../../../clients/jsonApi/index.js";var i=function(){var i=e(t.mark((function e(i,o,l,m){var p,u,c,d,f;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return p=["well.name","well.asset_id","well.settings","well.status","well.rigName","well.visibility"],u={company:l&&l.length>0?l:void 0,search:i,per_page:r,page:o,fields:p,sort:"name"},(c=s(m))&&(u.lat_start=c.lat_start,u.lat_end=c.lat_end,u.long_start=c.long_start,u.long_end=c.long_end),e.prev=4,e.next=7,n(u);case 7:d=e.sent,e.next=14;break;case 10:e.prev=10,e.t0=e.catch(4),console.error(e.t0),d=[];case 14:return f=a.deserialize(d),e.abrupt("return",f.map((function(e){return{redirectAssetId:e.asset_id,apiNumber:e.settings.api_number,name:e.name,asset_id:e.asset_id,status:e.status,rigName:e.rigName,visibility:e.visibility,type:"well"}})));case 16:case"end":return e.stop()}}),e,null,[[4,10]])})));return function(e,t,r,a){return i.apply(this,arguments)}}();export{i as fetchAssetWells};
//# sourceMappingURL=fetchAssetWells.js.map
