import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/objectWithoutProperties";import{MAX_CONCURRENT_FETCHES as t}from"./constants.js";import{fetchTile as n}from"./fetchTile.js";var o=["queue"];function i(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}var c=function c(f){for(var p=f.queue,s=r(f,o),b=function(){var r=p.pending.shift();if(!r)return"break";p.inProgress.add(r),n(function(r){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){e(r,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}({tileKey:r},s)).finally((function(){p.inProgress.delete(r),c(f)}))};p.pending.length>0&&p.inProgress.size<t;){if("break"===b())break}};export{c as processQueue};
//# sourceMappingURL=processQueue.js.map
