/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["../../chunks/_rollupPluginBabelHelpers","../../core/promiseUtils"],(function(i,t){"use strict";let l=function(){function l(i,t=0,l=i.lods.length-1){this.tileInfo=i,this.minLOD=t,this.maxLOD=l}var n=l.prototype;return n.getAvailability=function(i,t,l){const n=this.tileInfo.lodAt(i);return!n||i<this.minLOD||i>this.maxLOD?"unavailable":n.cols&&n.rows?l>=n.cols[0]&&l<=n.cols[1]&&t>=n.rows[0]&&t<=n.rows[1]?"available":"unavailable":"available"},n.fetchAvailability=function(){var l=i._asyncToGenerator((function*(i,l,n,e){return yield t.waitTick(e),this.getAvailability(i,l,n)}));function n(i,t,n,e){return l.apply(this,arguments)}return n}(),n.fetchAvailabilityUpsample=function(){var l=i._asyncToGenerator((function*(i,l,n,e,a){yield t.waitTick(a),e.level=i,e.row=l,e.col=n;const o=this.tileInfo;for(o.updateTileInfo(e);;){const i=this.getAvailability(e.level,e.row,e.col);if("unavailable"!==i)return i;if(!o.upsampleTile(e))return"unavailable"}}));function n(i,t,n,e,a){return l.apply(this,arguments)}return n}(),l}();return l}));
