/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
class e{constructor(){this._usage=new Map,this._pad=0}clear(){this._usage.clear()}add(e,s,t,r){const o=this._usage.get(e);o?(o[2]=!0,o[3].push(e.name)):this._usage.set(e,[s,`${t}x${r}`,!0,[e.name]]),this._pad=Math.max(this._pad,a(this._usage)),console.debug(Array.from(this._usage.values()).map(([e,a,s,t])=>(s?t[t.length-1]:"").padStart(this._pad," ")).join(" | "))}remove(e){const a=this._usage.get(e);a&&(a[2]=!1)}summarize(){const e=a(this._usage);console.debug(Array.from(this._usage.values()).map(([a,s])=>s.padStart(e," ")).join(" | ")),console.debug(Array.from(this._usage.keys()).map(({usedMemory:a})=>`${(a/1024/1024).toFixed(1)}MB`.padStart(e," ")).join(" | ")),console.debug(Array.from(this._usage.values()).map(([a])=>a.padStart(e," ")).join(" | ")),console.debug("Total",(Array.from(this._usage.keys()).reduce((e,{usedMemory:a})=>e+a,0)/1024/1024).toFixed(1),"MB")}}function a(e){return Array.from(e.values()).reduce((e,[a,s,t,r])=>Math.max(a.length,s.length,r.reduce((e,a)=>Math.max(e,a.length),e)),0)}export{e as FBOCacheUsage};
