/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{__decorate as t}from"tslib";import{ClonableMixin as o}from"../../core/Clonable.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{clone as e}from"../../core/lang.js";import n from"../../core/Logger.js";import{property as a,cast as s,subclass as i}from"../../core/accessorSupport/decorators.js";import{castArray as l,writeTypedArray as g}from"./meshProperties.js";var p;let u=p=class extends(o(r)){constructor(t){super(t),this.color=null,this.position=new Float64Array(0),this.uv=null,this.normal=null,this.tangent=null}castColor(t){return l(t,Uint8Array,[Uint8ClampedArray],{loggerTag:".color=",stride:4},n.getLogger(this))}castPosition(t){t&&t instanceof Float32Array&&n.getLogger(this).warn(".position=","Setting position attribute from a Float32Array may cause precision problems. Consider storing data in a Float64Array or a regular number array");return l(t,Float64Array,[Float32Array],{loggerTag:".position=",stride:3},n.getLogger(this))}castUv(t){return l(t,Float32Array,[Float64Array],{loggerTag:".uv=",stride:2},n.getLogger(this))}castNormal(t){return l(t,Float32Array,[Float64Array],{loggerTag:".normal=",stride:3},n.getLogger(this))}castTangent(t){return l(t,Float32Array,[Float64Array],{loggerTag:".tangent=",stride:4},n.getLogger(this))}clonePositional(){const t={position:e(this.position),normal:e(this.normal),tangent:e(this.tangent),uv:this.uv,color:this.color};return new p(t)}get usedMemory(){return this.position.byteLength+(this.uv?.byteLength??0)+(this.normal?.byteLength??0)+(this.tangent?.byteLength??0)+(this.color?.byteLength??0)}};t([a({json:{write:g}})],u.prototype,"color",void 0),t([s("color")],u.prototype,"castColor",null),t([a({nonNullable:!0,json:{write:g}})],u.prototype,"position",void 0),t([s("position")],u.prototype,"castPosition",null),t([a({json:{write:g}})],u.prototype,"uv",void 0),t([s("uv")],u.prototype,"castUv",null),t([a({json:{write:g}})],u.prototype,"normal",void 0),t([s("normal")],u.prototype,"castNormal",null),t([a({json:{write:g}})],u.prototype,"tangent",void 0),t([s("tangent")],u.prototype,"castTangent",null),u=p=t([i("esri.geometry.support.MeshVertexAttributes")],u);export{u as default};
