"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),r=require("../../constants.js"),a=require("../shared/dataFormatter.js"),s=require("../shared/transformers/transformToApiCoordinateBounds.js"),n=require("../../../../clients/jsonApi/index.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=i(e),o=i(t),u=function(){var e=l.default(o.default.mark((function e(t,i,l,u){var d,c,p,f,m;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return d=["well.name","well.asset_id","well.settings","well.status","well.rigName","well.visibility"],c={company:l&&l.length>0?l:void 0,search:t,per_page:r.ROWS_PER_PAGE,page:i,fields:d,sort:"name"},(p=s.transformToApiCoordinateBounds(u))&&(c.lat_start=p.lat_start,c.lat_end=p.lat_end,c.long_start=p.long_start,c.long_end=p.long_end),e.prev=4,e.next=7,n.getWells(c);case 7:f=e.sent,e.next=14;break;case 10:e.prev=10,e.t0=e.catch(4),console.error(e.t0),f=[];case 14:return m=a.dataFormatter.deserialize(f),e.abrupt("return",m.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(t,r,a,s){return e.apply(this,arguments)}}();exports.fetchAssetWells=u;
//# sourceMappingURL=fetchAssetWells.js.map
