import { c, u } from "./chunk-7NPG47AN.js"; import { s as s2 } from "./chunk-GCDJLKH4.js"; import { d, e, l3 as l, n2 as n } from "./chunk-Y3WMVFTW.js"; import { v } from "./chunk-IHXECKQQ.js"; import { s } from "./chunk-EMJ4ZSM2.js"; import { m } from "./chunk-IKP3YN53.js"; // node_modules/@arcgis/core/geometry/support/MeshVertexAttributes.js var i; var l2 = s.getLogger("esri.geometry.support.MeshVertexAttributes"); var p = i = class extends l { constructor(r) { super(r), this.color = null, this.position = new Float64Array(0), this.uv = null, this.normal = null, this.tangent = null; } castColor(r) { return u2(r, Uint8Array, [Uint8ClampedArray], { loggerTag: ".color=", stride: 4 }, l2); } castPosition(r) { r && r instanceof Float32Array && l2.warn(".position=", "Setting position attribute from a Float32Array may cause precision problems. Consider storing data in a Float64Array or a regular number array"); return u2(r, Float64Array, [Float32Array], { loggerTag: ".position=", stride: 3 }, l2); } castUv(r) { return u2(r, Float32Array, [Float64Array], { loggerTag: ".uv=", stride: 2 }, l2); } castNormal(r) { return u2(r, Float32Array, [Float64Array], { loggerTag: ".normal=", stride: 3 }, l2); } castTangent(r) { return u2(r, Float32Array, [Float64Array], { loggerTag: ".tangent=", stride: 4 }, l2); } clone() { const r = { position: m(this.position), uv: m(this.uv), normal: m(this.normal), tangent: m(this.tangent), color: m(this.color) }; return new i(r); } clonePositional() { const r = { position: m(this.position), normal: m(this.normal), tangent: m(this.tangent), uv: this.uv, color: this.color }; return new i(r); } }; function c2(r, t, o, e2) { const { loggerTag: n2, stride: s3 } = t; return r.length % s3 != 0 ? (e2.error(n2, `Invalid array length, expected a multiple of ${s3}`), new o([])) : r; } function u2(r, t, o, e2, n2) { if (!r) return r; if (r instanceof t) return c2(r, e2, t, n2); for (const s3 of o) if (r instanceof s3) return c2(new t(r), e2, t, n2); if (Array.isArray(r)) return c2(new t(r), e2, t, n2); { const e3 = o.map((r2) => `'${r2.name}'`); return n2.error(`Failed to set property, expected one of ${e3}, but got ${r.constructor.name}`), new t([]); } } function g(r, t, o) { t[o] = m2(r); } function m2(r) { const t = new Array(r.length); for (let o = 0; o < r.length; o++) t[o] = r[o]; return t; } e([d({ json: { write: g } })], p.prototype, "color", void 0), e([s2("color")], p.prototype, "castColor", null), e([d({ nonNullable: true, json: { write: g } })], p.prototype, "position", void 0), e([s2("position")], p.prototype, "castPosition", null), e([d({ json: { write: g } })], p.prototype, "uv", void 0), e([s2("uv")], p.prototype, "castUv", null), e([d({ json: { write: g } })], p.prototype, "normal", void 0), e([s2("normal")], p.prototype, "castNormal", null), e([d({ json: { write: g } })], p.prototype, "tangent", void 0), e([s2("tangent")], p.prototype, "castTangent", null), p = i = e([n("esri.geometry.support.MeshVertexAttributes")], p); // node_modules/@arcgis/core/geometry/support/MeshComponent.js var m3; var u3 = s.getLogger("esri.geometry.support.MeshComponent"); var h = m3 = class extends l { constructor(r) { super(r), this.faces = null, this.material = null, this.shading = "source", this.trustSourceNormals = false; } static from(r) { return v(m3, r); } castFaces(r) { return u2(r, Uint32Array, [Uint16Array], { loggerTag: ".faces=", stride: 3 }, u3); } castMaterial(r) { return v(r && typeof r == "object" && ("metallic" in r || "roughness" in r || "metallicRoughnessTexture" in r) ? c : u, r); } clone() { return new m3({ faces: m(this.faces), shading: this.shading, material: m(this.material), trustSourceNormals: this.trustSourceNormals }); } cloneWithDeduplication(r, t) { const o = { faces: m(this.faces), shading: this.shading, material: this.material ? this.material.cloneWithDeduplication(r, t) : null, trustSourceNormals: this.trustSourceNormals }; return new m3(o); } }; e([d({ json: { write: true } })], h.prototype, "faces", void 0), e([s2("faces")], h.prototype, "castFaces", null), e([d({ type: u, json: { write: true } })], h.prototype, "material", void 0), e([s2("material")], h.prototype, "castMaterial", null), e([d({ type: String, json: { write: true } })], h.prototype, "shading", void 0), e([d({ type: Boolean })], h.prototype, "trustSourceNormals", void 0), h = m3 = e([n("esri.geometry.support.MeshComponent")], h); var f = h; export { p, f }; //# sourceMappingURL=chunk-T47XOAZJ.js.map