/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["./Utils"],(function(e){"use strict";const r=5;return function(){function f(){this.geometries=[{indexBuffer:void 0,vertexBuffer:{}},{indexBuffer:void 0,vertexBuffer:{}},{indexBuffer:void 0,vertexBuffer:{}},{indexBuffer:void 0,vertexBuffer:{}},{indexBuffer:void 0,vertexBuffer:{}}]}var t=f.prototype;return t.clone=function(){const e=new f;for(let r=0;r<this.geometries.length;r++){const f=this.geometries[r],t=e.geometries[r];t.indexBuffer=f.indexBuffer.slice(),t.vertexBuffer={};for(const e in f.vertexBuffer){const{data:r,stride:i}=f.vertexBuffer[e];t.vertexBuffer[e]={data:r.slice(),stride:i}}}return e},f.deserialize=function(t){const i=new f;for(let f=0;f<r;++f){i.geometries[f].indexBuffer=new Uint32Array(t.geometries[f].indexBuffer),i.geometries[f].vertexBuffer={};for(const r in t.geometries[f].vertexBuffer)i.geometries[f].vertexBuffer[r]={data:e.allocateTypedArrayBufferwithData(t.geometries[f].vertexBuffer[r].data,t.geometries[f].vertexBuffer[r].stride),stride:t.geometries[f].vertexBuffer[r].stride}}return i},t.serialize=function(){const e={geometries:[{indexBuffer:this.geometries[0].indexBuffer.buffer,vertexBuffer:{}},{indexBuffer:this.geometries[1].indexBuffer.buffer,vertexBuffer:{}},{indexBuffer:this.geometries[2].indexBuffer.buffer,vertexBuffer:{}},{indexBuffer:this.geometries[3].indexBuffer.buffer,vertexBuffer:{}},{indexBuffer:this.geometries[4].indexBuffer.buffer,vertexBuffer:{}}]};for(let f=0;f<r;++f)for(const r in this.geometries[f].vertexBuffer)e.geometries[f].vertexBuffer[r]={data:this.geometries[f].vertexBuffer[r].data.buffer,stride:this.geometries[f].vertexBuffer[r].stride};return e},t.getBuffers=function(){const e=[];for(let f=0;f<r;++f){e.push(this.geometries[f].indexBuffer.buffer);for(const r in this.geometries[f].vertexBuffer)e.push(this.geometries[f].vertexBuffer[r].data.buffer)}return e},f}()}));
