/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../geometry/support/buffer/BufferView","./InterleavedLayout"],(function(e,f,u){"use strict";function r(e,f){return f.push(e.buffer),{buffer:e.buffer,layout:t(e.layout)}}function i(e){return V(e.layout).createView(e.buffer)}function t(e){const f=new Array;return e.fields.forEach(((e,u)=>{const r={...e,constructor:n(e.constructor)};f.push([u,r])})),{stride:e.stride,fields:f,fieldNames:e.fieldNames}}function V(e){const f=u.newLayout();return f.stride=e.stride,f.fieldNames=e.fieldNames,e.fields.forEach((e=>f.fields.set(e[0],{...e[1],constructor:o(e[1].constructor)}))),f}const c=[f.BufferViewFloat,f.BufferViewVec2f,f.BufferViewVec3f,f.BufferViewVec4f,f.BufferViewMat3f,f.BufferViewMat4f,f.BufferViewFloat64,f.BufferViewVec2f64,f.BufferViewVec3f64,f.BufferViewVec4f64,f.BufferViewMat3f64,f.BufferViewMat4f64,f.BufferViewUint8,f.BufferViewVec2u8,f.BufferViewVec3u8,f.BufferViewVec4u8,f.BufferViewUint16,f.BufferViewVec2u16,f.BufferViewVec3u16,f.BufferViewVec4u16,f.BufferViewUint32,f.BufferViewVec2u32,f.BufferViewVec3u32,f.BufferViewVec4u32,f.BufferViewInt8,f.BufferViewVec2i8,f.BufferViewVec3i8,f.BufferViewVec4i8,f.BufferViewInt16,f.BufferViewVec2i16,f.BufferViewVec3i16,f.BufferViewVec4i16,f.BufferViewInt32,f.BufferViewVec2i32,f.BufferViewVec3i32,f.BufferViewVec4i32];function n(e){return`${e.ElementType}_${e.ElementCount}`}function o(e){return w.get(e)}const w=new Map;c.forEach((e=>w.set(n(e),e))),e.packInterleavedBuffer=r,e.packLayout=t,e.unpackInterleavedBuffer=i,e.unpackLayout=V,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
