/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import e from"../../../core/Error.js";import{clone as r}from"../../../core/lang.js";import{throwIfAborted as o}from"../../../core/promiseUtils.js";import t from"../MeshVertexAttributes.js";import{addMeshCloneContext as s}from"./meshCloneUtils.js";import{convertVertexSpace as i}from"./vertexSpaceConversion.js";async function m(m,n,c){await Promise.resolve(),o(c);const l=i(m,n,{useEllipsoid:c?.useEllipsoid});if(!l)throw new e("meshUtils:convertVertexSpace()","Failed to convert to provided vertex space due to projection errors");return m.clone(s(void 0,{vertexAttributes:new t({...l,uv:r(m.vertexAttributes.uv),color:r(m.vertexAttributes.color)}),vertexSpace:n,transform:null}))}export{m as convertMeshVertexSpace};
