"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),r=require("../constants.js"),n=require("../transformers/transformAssetToOffsetWell.js"),a=require("./fetchDataByChunks.js"),s=require("./assetsFetcher.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=l(e),o=l(t),i=function(){var e=u.default(o.default.mark((function e(t,l,u){var i,c,f,d;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=(i=null!=u?u:{}).signal,f=i.drillingWells,e.prev=1,e.next=4,a.fetchDataByChunks({path:"/v2/assets",queryParams:{types:["well"],company_id:l&&l.length>0?l:void 0,last_active_drilling_after:f?1:void 0,fields:r.ASSET_FIELDS,sort:"name",lat_start:t.lat_start,lat_end:t.lat_end,long_start:t.long_start,long_end:t.long_end},chunkSize:r.CHUNK_SIZE,paginationStyle:"page",fetcher:s.assetsFetcher,signal:c});case 4:return d=e.sent,e.abrupt("return",d.map((function(e){return n.transformAssetToOffsetWell(e)})));case 8:if(e.prev=8,e.t0=e.catch(1),"AbortError"!==(null===e.t0||void 0===e.t0?void 0:e.t0.name)){e.next=12;break}throw e.t0;case 12:return console.error(e.t0),e.abrupt("return",[]);case 14:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t,r,n){return e.apply(this,arguments)}}();exports.getAssetsByBounds=i;
//# sourceMappingURL=getAssetsByBounds.js.map
