import e from"@babel/runtime/helpers/asyncToGenerator";import r from"@babel/runtime/regenerator";import{ASSET_FIELDS as t}from"../constants.js";import{transformAssetToOffsetWell as n}from"../transformers/transformAssetToOffsetWell.js";import{fetchDataByChunks as a}from"./fetchDataByChunks.js";import{assetsFetcher as s}from"./assetsFetcher.js";var o=function(){var o=e(r.mark((function o(i,l){var u,p,c,f,m,d;return r.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return p=(u=null!=l?l:{}).signal,c=u.onProgress,f=u.drillingWells,null==c||c({loaded:0,isComplete:!1}),o.next=4,a({path:"/v2/assets",queryParams:{types:["well"],company_id:i&&i.length>0?i:void 0,last_active_drilling_after:f?1:void 0,fields:t,sort:"name"},chunkSize:2e3,paginationStyle:"page",fetcher:function(){var t=e(r.mark((function e(t,n,a){var o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s(t,n,a);case 2:return o=e.sent,null==c||c({loaded:2e3*n.page,isComplete:!1}),e.abrupt("return",o);case 5:case"end":return e.stop()}}),e)})));return function(e,r,n){return t.apply(this,arguments)}}(),signal:p});case 4:return m=o.sent,d=m.map((function(e){return n(e)})),null==c||c({loaded:d.length,isComplete:!0}),o.abrupt("return",d);case 8:case"end":return o.stop()}}),o)})));return function(e,r){return o.apply(this,arguments)}}();export{o as getAllAssets};
//# sourceMappingURL=getAllAssets.js.map
