/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define((function(){"use strict";const t=-1;return function(){function e(){this._dirties=[{vertexFrom:t,vertexCount:t,indexFrom:t,indexCount:t,allDirty:!1},{vertexFrom:t,vertexCount:t,indexFrom:t,indexCount:t,allDirty:!1},{vertexFrom:t,vertexCount:t,indexFrom:t,indexCount:t,allDirty:!1},{vertexFrom:t,vertexCount:t,indexFrom:t,indexCount:t,allDirty:!1},{vertexFrom:t,vertexCount:t,indexFrom:t,indexCount:t,allDirty:!1}]}var r=e.prototype;return r.hasDirty=function(){return this._dirties.some((e=>e.indexCount!==t||e.allDirty))},r.markAllClean=function(){for(const e of this._dirties)e.indexFrom=t,e.indexCount=t,e.vertexFrom=t,e.vertexCount=t,e.allDirty=!1},r.markAllDirty=function(){for(const t of this._dirties)t.allDirty=!0},r.forEach=function(e){for(let r=0;r<this._dirties.length;++r){const{indexCount:i,indexFrom:n,vertexCount:o,vertexFrom:x,allDirty:u}=this._dirties[r],l={};let d,m=!1;(u||x!==t&&o>0)&&(l.geometry={count:o,from:x,allDirty:u},m=!0),(u||n!==t&&i>0)&&(d={count:i,from:n,allDirty:u},m=!0),m&&e({indices:d,vertices:l},r)}},r.markDirtyIndices=function(e,r,i){const n=this._dirties[e],o=r,x=i;if(!n.allDirty)if(n.indexCount!==t){const t=Math.min(n.indexFrom,o),e=Math.max(n.indexFrom+n.indexCount,o+x)-t;n.indexFrom=t,n.indexCount=e}else n.indexFrom=o,n.indexCount=x},r.markDirtyVertices=function(e,r,i,n){const o=this._dirties[e],x=i,u=n;if(!o.allDirty)if(o.vertexCount!==t){const t=Math.min(o.vertexFrom,x),e=Math.max(o.vertexFrom+o.vertexCount,x+u)-t;o.vertexFrom=t,o.vertexCount=e}else o.vertexFrom=x,o.vertexCount=u},e}()}));
