import { a2 as a, a3 as a2, d } from "./chunk-PFG2S2HL.js"; import { n, r as r2 } from "./chunk-T4GXZJ3D.js"; import { O } from "./chunk-XXBIV3TZ.js"; import { S as S2 } from "./chunk-5W6F4NR5.js"; import "./chunk-YZUP3MAF.js"; import "./chunk-SCXOTZ6Q.js"; import { Un } from "./chunk-DH2OBAUC.js"; import "./chunk-TNLRDNTC.js"; import "./chunk-MFUAILAT.js"; import "./chunk-HZJYXMI6.js"; import "./chunk-7XXXCK2A.js"; import "./chunk-7ZIDBK7B.js"; import "./chunk-TERAW6FT.js"; import "./chunk-N2663GRX.js"; import "./chunk-O4FY3ITT.js"; import "./chunk-JXW4QTJA.js"; import { S } from "./chunk-XNLG7T2T.js"; import "./chunk-IR4PV7VK.js"; import "./chunk-OWVBLVP3.js"; import "./chunk-MXB2XLKV.js"; import "./chunk-HNOZUNJ4.js"; import "./chunk-VNFRAYHO.js"; import "./chunk-R5IG2D6H.js"; import "./chunk-VBRY5KJM.js"; import "./chunk-PDKDCAAD.js"; import "./chunk-ECW2QABR.js"; import "./chunk-GCDJLKH4.js"; import { k2 as k } from "./chunk-MRJEICT6.js"; import "./chunk-Y3WMVFTW.js"; import "./chunk-SAS7RONY.js"; import "./chunk-WSRBH7BF.js"; import "./chunk-IHXECKQQ.js"; import "./chunk-ULGDPLM2.js"; import { s, s3 as s2 } from "./chunk-EMJ4ZSM2.js"; import { m } from "./chunk-IKP3YN53.js"; import { o2 as o, r, t } from "./chunk-GZT4BVFP.js"; import "./chunk-A5ICIBVI.js"; // node_modules/@arcgis/core/chunks/quatf32.js function e() { const e2 = new Float32Array(4); return e2[3] = 1, e2; } function r3(e2) { const r5 = new Float32Array(4); return r5[0] = e2[0], r5[1] = e2[1], r5[2] = e2[2], r5[3] = e2[3], r5; } function t2(e2, r5, t4, n4) { const o4 = new Float32Array(4); return o4[0] = e2, o4[1] = r5, o4[2] = t4, o4[3] = n4, o4; } function n2(e2, r5) { return new Float32Array(e2, r5, 4); } var o2 = Object.freeze(Object.defineProperty({ __proto__: null, create: e, clone: r3, fromValues: t2, createView: n2 }, Symbol.toStringTag, { value: "Module" })); // node_modules/@arcgis/core/views/3d/layers/i3s/LEPCC.js var t3 = true; var o3 = { identifierOffset: 0, identifierLength: 10, versionOffset: 10, checksumOffset: 12, byteCount: 16 }; function r4(e2, r5, n4) { return { identifier: String.fromCharCode.apply(null, new Uint8Array(e2, n4 + o3.identifierOffset, o3.identifierLength)), version: r5.getUint16(n4 + o3.versionOffset, t3), checksum: r5.getUint32(n4 + o3.checksumOffset, t3) }; } var n3 = { sizeLo: 0, sizeHi: 4, minX: 8, minY: 16, minZ: 24, maxX: 32, maxY: 40, maxZ: 48, errorX: 56, errorY: 64, errorZ: 72, count: 80, reserved: 84, byteCount: 88 }; function i(e2, o4) { return { sizeLo: e2.getUint32(o4 + n3.sizeLo, t3), sizeHi: e2.getUint32(o4 + n3.sizeHi, t3), minX: e2.getFloat64(o4 + n3.minX, t3), minY: e2.getFloat64(o4 + n3.minY, t3), minZ: e2.getFloat64(o4 + n3.minZ, t3), maxX: e2.getFloat64(o4 + n3.maxX, t3), maxY: e2.getFloat64(o4 + n3.maxY, t3), maxZ: e2.getFloat64(o4 + n3.maxZ, t3), errorX: e2.getFloat64(o4 + n3.errorX, t3), errorY: e2.getFloat64(o4 + n3.errorY, t3), errorZ: e2.getFloat64(o4 + n3.errorZ, t3), count: e2.getUint32(o4 + n3.count, t3), reserved: e2.getUint32(o4 + n3.reserved, t3) }; } function c(t4) { const c5 = new DataView(t4, 0); let d5 = 0; const { identifier: l3, version: a6 } = r4(t4, c5, d5); if (d5 += o3.byteCount, l3 !== "LEPCC ") throw new s2("lepcc-decode-error", "Bad identifier"); if (a6 > 1) throw new s2("lepcc-decode-error", "Unknown version"); const u3 = i(c5, d5); d5 += n3.byteCount; if (u3.sizeHi * 2 ** 32 + u3.sizeLo !== t4.byteLength) throw new s2("lepcc-decode-error", "Bad size"); const f4 = new Float64Array(3 * u3.count), h4 = [], w2 = [], g2 = [], p3 = []; if (d5 = s3(t4, d5, h4), d5 = s3(t4, d5, w2), d5 = s3(t4, d5, g2), d5 = s3(t4, d5, p3), d5 !== t4.byteLength) throw new s2("lepcc-decode-error", "Bad length"); let m4 = 0, U = 0; for (let e2 = 0; e2 < h4.length; e2++) { U += h4[e2]; let t5 = 0; for (let o4 = 0; o4 < w2[e2]; o4++) { t5 += g2[m4]; const e3 = p3[m4]; f4[3 * m4] = Math.min(u3.maxX, u3.minX + 2 * u3.errorX * t5), f4[3 * m4 + 1] = Math.min(u3.maxY, u3.minY + 2 * u3.errorY * U), f4[3 * m4 + 2] = Math.min(u3.maxZ, u3.minZ + 2 * u3.errorZ * e3), m4++; } } return { errorX: u3.errorX, errorY: u3.errorY, errorZ: u3.errorZ, result: f4 }; } function s3(e2, t4, o4) { const r5 = []; t4 = d2(e2, t4, r5); const n4 = []; for (let i2 = 0; i2 < r5.length; i2++) { n4.length = 0, t4 = d2(e2, t4, n4); for (let e3 = 0; e3 < n4.length; e3++) o4.push(n4[e3] + r5[i2]); } return t4; } function d2(o4, r5, n4) { const i2 = new DataView(o4, r5), c5 = i2.getUint8(0), s5 = 31 & c5, d5 = !!(32 & c5), l3 = (192 & c5) >> 6; let a6 = 0; if (l3 === 0) a6 = i2.getUint32(1, t3), r5 += 5; else if (l3 === 1) a6 = i2.getUint16(1, t3), r5 += 3; else { if (l3 !== 2) throw new s2("lepcc-decode-error", "Bad count type"); a6 = i2.getUint8(1), r5 += 2; } if (d5) throw new s2("lepcc-decode-error", "LUT not implemented"); const u3 = Math.ceil(a6 * s5 / 8), f4 = new Uint8Array(o4, r5, u3); let h4 = 0, w2 = 0, g2 = 0; const p3 = -1 >>> 32 - s5; for (let e2 = 0; e2 < a6; e2++) { for (; w2 < s5; ) h4 |= f4[g2] << w2, w2 += 8, g2 += 1; n4[e2] = h4 & p3, h4 >>>= s5, w2 -= s5, w2 + s5 > 32 && (h4 |= f4[g2 - 1] >> 8 - w2); } return r5 + g2; } var l = { sizeLo: 0, sizeHi: 4, count: 8, colorMapCount: 12, lookupMethod: 14, compressionMethod: 15, byteCount: 16 }; function a3(e2, o4) { return { sizeLo: e2.getUint32(o4 + l.sizeLo, t3), sizeHi: e2.getUint32(o4 + l.sizeHi, t3), count: e2.getUint32(o4 + l.count, t3), colorMapCount: e2.getUint16(o4 + l.colorMapCount, t3), lookupMethod: e2.getUint8(o4 + l.lookupMethod), compressionMethod: e2.getUint8(o4 + l.compressionMethod) }; } function u(t4) { const n4 = new DataView(t4, 0); let i2 = 0; const { identifier: c5, version: s5 } = r4(t4, n4, i2); if (i2 += o3.byteCount, c5 !== "ClusterRGB") throw new s2("lepcc-decode-error", "Bad identifier"); if (s5 > 1) throw new s2("lepcc-decode-error", "Unknown version"); const d5 = a3(n4, i2); i2 += l.byteCount; if (d5.sizeHi * 2 ** 32 + d5.sizeLo !== t4.byteLength) throw new s2("lepcc-decode-error", "Bad size"); if ((d5.lookupMethod === 2 || d5.lookupMethod === 1) && d5.compressionMethod === 0) { if (3 * d5.colorMapCount + d5.count + i2 !== t4.byteLength || d5.colorMapCount > 256) throw new s2("lepcc-decode-error", "Bad count"); const o4 = new Uint8Array(t4, i2, 3 * d5.colorMapCount), r5 = new Uint8Array(t4, i2 + 3 * d5.colorMapCount, d5.count), n5 = new Uint8Array(3 * d5.count); for (let e2 = 0; e2 < d5.count; e2++) { const t5 = r5[e2]; n5[3 * e2] = o4[3 * t5], n5[3 * e2 + 1] = o4[3 * t5 + 1], n5[3 * e2 + 2] = o4[3 * t5 + 2]; } return n5; } if (d5.lookupMethod === 0 && d5.compressionMethod === 0) { if (3 * d5.count + i2 !== t4.byteLength || d5.colorMapCount !== 0) throw new s2("lepcc-decode-error", "Bad count"); return new Uint8Array(t4, i2).slice(); } if (d5.lookupMethod <= 2 && d5.compressionMethod === 1) { if (i2 + 3 !== t4.byteLength || d5.colorMapCount !== 1) throw new s2("lepcc-decode-error", "Bad count"); const o4 = n4.getUint8(i2), r5 = n4.getUint8(i2 + 1), c6 = n4.getUint8(i2 + 2), s6 = new Uint8Array(3 * d5.count); for (let e2 = 0; e2 < d5.count; e2++) s6[3 * e2] = o4, s6[3 * e2 + 1] = r5, s6[3 * e2 + 2] = c6; return s6; } throw new s2("lepcc-decode-error", "Bad method " + d5.lookupMethod + "," + d5.compressionMethod); } var f = { sizeLo: 0, sizeHi: 4, count: 8, scaleFactor: 12, bitsPerPoint: 14, reserved: 15, byteCount: 16 }; function h(e2, o4) { return { sizeLo: e2.getUint32(o4 + f.sizeLo, t3), sizeHi: e2.getUint32(o4 + f.sizeHi, t3), count: e2.getUint32(o4 + f.count, t3), scaleFactor: e2.getUint16(o4 + f.scaleFactor, t3), bitsPerPoint: e2.getUint8(o4 + f.bitsPerPoint), reserved: e2.getUint8(o4 + f.reserved) }; } function w(t4) { const n4 = new DataView(t4, 0); let i2 = 0; const { identifier: c5, version: s5 } = r4(t4, n4, i2); if (i2 += o3.byteCount, c5 !== "Intensity ") throw new s2("lepcc-decode-error", "Bad identifier"); if (s5 > 1) throw new s2("lepcc-decode-error", "Unknown version"); const l3 = h(n4, i2); i2 += f.byteCount; if (l3.sizeHi * 2 ** 32 + l3.sizeLo !== t4.byteLength) throw new s2("lepcc-decode-error", "Bad size"); const a6 = new Uint16Array(l3.count); if (l3.bitsPerPoint === 8) { if (l3.count + i2 !== t4.byteLength) throw new s2("lepcc-decode-error", "Bad size"); const o4 = new Uint8Array(t4, i2, l3.count); for (let e2 = 0; e2 < l3.count; e2++) a6[e2] = o4[e2] * l3.scaleFactor; } else if (l3.bitsPerPoint === 16) { if (2 * l3.count + i2 !== t4.byteLength) throw new s2("lepcc-decode-error", "Bad size"); const o4 = new Uint16Array(t4, i2, l3.count); for (let e2 = 0; e2 < l3.count; e2++) a6[e2] = o4[e2] * l3.scaleFactor; } else { const o4 = []; if (d2(t4, i2, o4) !== t4.byteLength) throw new s2("lepcc-decode-error", "Bad size"); for (let e2 = 0; e2 < l3.count; e2++) a6[e2] = o4[e2] * l3.scaleFactor; } return a6; } // node_modules/@arcgis/core/views/3d/layers/i3s/I3SBinaryReader.js var u2 = s.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader"); function a4(t4, n4, r5) { let o4 = "", i2 = 0; for (; i2 < r5; ) { const u3 = t4[n4 + i2]; if (u3 < 128) o4 += String.fromCharCode(u3), i2++; else if (u3 >= 192 && u3 < 224) { if (i2 + 1 >= r5) throw new s2("utf8-decode-error", "UTF-8 Decode failed. Two byte character was truncated."); const a6 = (31 & u3) << 6 | 63 & t4[n4 + i2 + 1]; o4 += String.fromCharCode(a6), i2 += 2; } else if (u3 >= 224 && u3 < 240) { if (i2 + 2 >= r5) throw new s2("utf8-decode-error", "UTF-8 Decode failed. Multi byte character was truncated."); const a6 = (15 & u3) << 12 | (63 & t4[n4 + i2 + 1]) << 6 | 63 & t4[n4 + i2 + 2]; o4 += String.fromCharCode(a6), i2 += 3; } else { if (!(u3 >= 240 && u3 < 248)) throw new s2("utf8-decode-error", "UTF-8 Decode failed. Invalid multi byte sequence."); { if (i2 + 3 >= r5) throw new s2("utf8-decode-error", "UTF-8 Decode failed. Multi byte character was truncated."); const a6 = (7 & u3) << 18 | (63 & t4[n4 + i2 + 1]) << 12 | (63 & t4[n4 + i2 + 2]) << 6 | 63 & t4[n4 + i2 + 3]; if (a6 >= 65536) { const e2 = 55296 + (a6 - 65536 >> 10), t5 = 56320 + (1023 & a6); o4 += String.fromCharCode(e2, t5); } else o4 += String.fromCharCode(a6); i2 += 4; } } } return o4; } function s4(e2, t4) { const n4 = { byteOffset: 0, byteCount: 0, fields: Object.create(null) }; let r5 = 0; for (let o4 = 0; o4 < t4.length; o4++) { const i2 = t4[o4], u3 = i2.valueType || i2.type, a6 = h2[u3]; n4.fields[i2.property] = a6(e2, r5), r5 += m2[u3].BYTES_PER_ELEMENT; } return n4.byteCount = r5, n4; } function c2(t4, n4, r5) { const o4 = []; let i2, u3, s5 = 0; for (u3 = 0; u3 < t4; u3 += 1) { if (i2 = n4[u3], i2 > 0) { if (o4.push(a4(r5, s5, i2 - 1)), r5[s5 + i2 - 1] !== 0) throw new s2("string-array-error", "Invalid string array: missing null termination."); } else o4.push(null); s5 += i2; } return o4; } function f2(e2, t4) { return new (0, m2[t4.valueType])(e2, t4.byteOffset, t4.count * t4.valuesPerElement); } function l2(e2, t4) { return new Uint8Array(e2, t4.byteOffset, t4.byteCount); } function b(n4, r5, o4) { const i2 = r5.header != null ? s4(n4, r5.header) : { byteOffset: 0, byteCount: 0, fields: { count: o4 } }, u3 = { header: i2, byteOffset: i2.byteCount, byteCount: 0, entries: Object.create(null) }; let a6 = i2.byteCount; for (let s5 = 0; s5 < r5.ordering.length; s5++) { const n5 = r5.ordering[s5], o5 = m(r5[n5]); if (o5.count = i2.fields.count, o5.valueType === "String") { if (o5.byteOffset = a6, o5.byteCount = i2.fields[n5 + "ByteCount"], o5.encoding !== "UTF-8") throw new s2("unsupported-encoding", "Unsupported String encoding.", { encoding: o5.encoding }); } else { if (!A(o5.valueType)) throw new s2("unsupported-value-type", "Unsupported binary valueType", { valueType: o5.valueType }); { const e2 = O2(o5.valueType); a6 += a6 % e2 != 0 ? e2 - a6 % e2 : 0, o5.byteOffset = a6, o5.byteCount = e2 * o5.valuesPerElement * o5.count; } } a6 += o5.byteCount, u3.entries[n5] = o5; } return u3.byteCount = a6 - u3.byteOffset, u3; } function d3(t4, n4, r5) { if (n4 !== t4 && u2.error(`Invalid ${r5} buffer size expected: ${t4}, actual: ${n4})`), n4 < t4) throw new s2("buffer-too-small", "Binary buffer is too small", { expectedSize: t4, actualSize: n4 }); } function g(e2, t4) { const n4 = s4(e2, t4 && t4.header); let r5 = n4.byteCount; const o4 = { isDraco: false, header: n4, byteOffset: n4.byteCount, byteCount: 0, vertexAttributes: {} }, i2 = n4.fields, u3 = i2.vertexCount != null ? i2.vertexCount : i2.count; for (const s5 of t4.ordering) { if (!t4.vertexAttributes[s5]) continue; const e3 = { ...t4.vertexAttributes[s5], byteOffset: r5, count: u3 }, n5 = C[s5] ? C[s5] : "_" + s5; o4.vertexAttributes[n5] = e3, r5 += O2(e3.valueType) * e3.valuesPerElement * u3; } const a6 = i2.faceCount; if (t4.faces && a6) { o4.faces = {}; for (const e3 of t4.ordering) { if (!t4.faces[e3]) continue; const n5 = { ...t4.faces[e3], byteOffset: r5, count: a6 }; o4.faces[e3] = n5, r5 += O2(n5.valueType) * n5.valuesPerElement * a6; } } const c5 = i2.featureCount; if (t4.featureAttributes && t4.featureAttributeOrder && c5) { o4.featureAttributes = {}; for (const e3 of t4.featureAttributeOrder) { if (!t4.featureAttributes[e3]) continue; const n5 = { ...t4.featureAttributes[e3], byteOffset: r5, count: c5 }; o4.featureAttributes[e3] = n5; r5 += (n5.valueType === "UInt64" ? 8 : O2(n5.valueType)) * n5.valuesPerElement * c5; } } return d3(r5, e2.byteLength, "geometry"), o4.byteCount = r5 - o4.byteOffset, o4; } var C = { position: O.POSITION, normal: O.NORMAL, color: O.COLOR, uv0: O.UV0, region: O.UVREGION }; function I(t4, n4, i2) { if (t4.encoding === "lepcc-rgb") return u(n4); if (t4.encoding === "lepcc-intensity") return w(n4); if (t4.encoding != null && t4.encoding !== "") throw new s2("unknown-attribute-storage-info-encoding", "Unknown Attribute Storage Info Encoding"); t4["attributeByteCounts "] && !t4.attributeByteCounts && (u2.warn("Warning: Trailing space in 'attributeByteCounts '."), t4.attributeByteCounts = t4["attributeByteCounts "]), t4.ordering[0] === "ObjectIds" && t4.hasOwnProperty("objectIds") && (u2.warn("Warning: Case error in objectIds"), t4.ordering[0] = "objectIds"); const a6 = b(n4, t4, i2); d3(a6.byteOffset + a6.byteCount, n4.byteLength, "attribute"); const s5 = a6.entries.attributeValues || a6.entries.objectIds; if (s5) { if (s5.valueType === "String") { const e2 = a6.entries.attributeByteCounts, t5 = f2(n4, e2), r5 = l2(n4, s5); return c2(e2.count, t5, r5); } return f2(n4, s5); } throw new s2("bad-attribute-storage-info", "Bad attributeStorageInfo specification."); } var m2 = { Float32: Float32Array, Float64: Float64Array, UInt8: Uint8Array, Int8: Int8Array, UInt16: Uint16Array, Int16: Int16Array, UInt32: Uint32Array, Int32: Int32Array }; var h2 = { Float32: (e2, t4) => new DataView(e2, 0).getFloat32(t4, true), Float64: (e2, t4) => new DataView(e2, 0).getFloat64(t4, true), UInt8: (e2, t4) => new DataView(e2, 0).getUint8(t4), Int8: (e2, t4) => new DataView(e2, 0).getInt8(t4), UInt16: (e2, t4) => new DataView(e2, 0).getUint16(t4, true), Int16: (e2, t4) => new DataView(e2, 0).getInt16(t4, true), UInt32: (e2, t4) => new DataView(e2, 0).getUint32(t4, true), Int32: (e2, t4) => new DataView(e2, 0).getInt32(t4, true) }; function A(e2) { return m2.hasOwnProperty(e2); } function O2(e2) { return A(e2) ? m2[e2].BYTES_PER_ELEMENT : 0; } // node_modules/@arcgis/core/views/3d/layers/i3s/PointCloudWorkerUtil.js function f3(e2, o4, n4, s5) { const { rendererJSON: i2, isRGBRenderer: u3 } = e2; let f4 = null, c5 = null; if (o4 && u3) f4 = o4; else if (o4 && i2.type === "pointCloudUniqueValueRenderer") { c5 = a2.fromJSON(i2); const e3 = c5.colorUniqueValueInfos; f4 = new Uint8Array(3 * s5); const r5 = p(c5.fieldTransformType); for (let t4 = 0; t4 < s5; t4++) { const l3 = (r5 ? r5(o4[t4]) : o4[t4]) + ""; for (let o5 = 0; o5 < e3.length; o5++) if (e3[o5].values.includes(l3)) { f4[3 * t4] = e3[o5].color.r, f4[3 * t4 + 1] = e3[o5].color.g, f4[3 * t4 + 2] = e3[o5].color.b; break; } } } else if (o4 && i2.type === "pointCloudStretchRenderer") { c5 = a.fromJSON(i2); const e3 = c5.stops; f4 = new Uint8Array(3 * s5); const r5 = p(c5.fieldTransformType); for (let t4 = 0; t4 < s5; t4++) { const l3 = r5 ? r5(o4[t4]) : o4[t4], n5 = e3.length - 1; if (l3 < e3[0].value) f4[3 * t4] = e3[0].color.r, f4[3 * t4 + 1] = e3[0].color.g, f4[3 * t4 + 2] = e3[0].color.b; else if (l3 >= e3[n5].value) f4[3 * t4] = e3[n5].color.r, f4[3 * t4 + 1] = e3[n5].color.g, f4[3 * t4 + 2] = e3[n5].color.b; else for (let o5 = 1; o5 < e3.length; o5++) if (l3 < e3[o5].value) { const r6 = (l3 - e3[o5 - 1].value) / (e3[o5].value - e3[o5 - 1].value); f4[3 * t4] = e3[o5].color.r * r6 + e3[o5 - 1].color.r * (1 - r6), f4[3 * t4 + 1] = e3[o5].color.g * r6 + e3[o5 - 1].color.g * (1 - r6), f4[3 * t4 + 2] = e3[o5].color.b * r6 + e3[o5 - 1].color.b * (1 - r6); break; } } } else if (o4 && i2.type === "pointCloudClassBreaksRenderer") { c5 = d.fromJSON(i2); const e3 = c5.colorClassBreakInfos; f4 = new Uint8Array(3 * s5); const t4 = p(c5.fieldTransformType); for (let r5 = 0; r5 < s5; r5++) { const l3 = t4 ? t4(o4[r5]) : o4[r5]; for (let o5 = 0; o5 < e3.length; o5++) if (l3 >= e3[o5].minValue && l3 <= e3[o5].maxValue) { f4[3 * r5] = e3[o5].color.r, f4[3 * r5 + 1] = e3[o5].color.g, f4[3 * r5 + 2] = e3[o5].color.b; break; } } } else { f4 = new Uint8Array(3 * s5); for (let e3 = 0; e3 < f4.length; e3++) f4[e3] = 255; } if (n4 && c5 && c5.colorModulation) { const e3 = c5.colorModulation.minValue, o5 = c5.colorModulation.maxValue, r5 = 0.3; for (let t4 = 0; t4 < s5; t4++) { const l3 = n4[t4], s6 = l3 >= o5 ? 1 : l3 <= e3 ? r5 : r5 + (1 - r5) * (l3 - e3) / (o5 - e3); f4[3 * t4] = s6 * f4[3 * t4], f4[3 * t4 + 1] = s6 * f4[3 * t4 + 1], f4[3 * t4 + 2] = s6 * f4[3 * t4 + 2]; } } return f4; } function c3(o4, r5) { if (o4.encoding == null || o4.encoding === "") { const t4 = g(r5, o4); if (t(t4.vertexAttributes.position)) return; const l3 = f2(r5, t4.vertexAttributes.position), i2 = t4.header.fields, u3 = [i2.offsetX, i2.offsetY, i2.offsetZ], f4 = [i2.scaleX, i2.scaleY, i2.scaleZ], c5 = l3.length / 3, a6 = new Float64Array(3 * c5); for (let e2 = 0; e2 < c5; e2++) a6[3 * e2] = l3[3 * e2] * f4[0] + u3[0], a6[3 * e2 + 1] = l3[3 * e2 + 1] * f4[1] + u3[1], a6[3 * e2 + 2] = l3[3 * e2 + 2] * f4[2] + u3[2]; return a6; } if (o4.encoding === "lepcc-xyz") return c(r5).result; } function a5(e2, r5, t4) { return r(e2) && e2.attributeInfo.useElevation ? d4(r5, t4) : r(e2) ? I(e2.attributeInfo.storageInfo, e2.buffer, t4) : null; } function d4(e2, o4) { const r5 = new Float64Array(o4); for (let t4 = 0; t4 < o4; t4++) r5[t4] = e2[3 * t4 + 2]; return r5; } function m3(e2, o4, r5, t4, l3) { const n4 = e2.length / 3; let s5 = 0; for (let i2 = 0; i2 < n4; i2++) { let n5 = true; for (let e3 = 0; e3 < t4.length && n5; e3++) { const { filterJSON: o5 } = t4[e3], r6 = l3[e3].values[i2]; switch (o5.type) { case "pointCloudValueFilter": { const e4 = o5.mode === "exclude"; o5.values.includes(r6) === e4 && (n5 = false); break; } case "pointCloudBitfieldFilter": { const e4 = b2(o5.requiredSetBits), t5 = b2(o5.requiredClearBits); (r6 & e4) === e4 && (r6 & t5) == 0 || (n5 = false); break; } case "pointCloudReturnFilter": { const e4 = 15 & r6, t5 = r6 >>> 4 & 15, l4 = t5 > 1, s6 = e4 === 1, i3 = e4 === t5; let u3 = false; for (const r7 of o5.includedReturns) if (r7 === "last" && i3 || r7 === "firstOfMany" && s6 && l4 || r7 === "lastOfMany" && i3 && l4 || r7 === "single" && !l4) { u3 = true; break; } u3 || (n5 = false); break; } } } n5 && (r5[s5] = i2, e2[3 * s5] = e2[3 * i2], e2[3 * s5 + 1] = e2[3 * i2 + 1], e2[3 * s5 + 2] = e2[3 * i2 + 2], o4[3 * s5] = o4[3 * i2], o4[3 * s5 + 1] = o4[3 * i2 + 1], o4[3 * s5 + 2] = o4[3 * i2 + 2], s5++); } return s5; } function p(e2) { return e2 == null || e2 === "none" ? null : e2 === "low-four-bit" ? (e3) => 15 & e3 : e2 === "high-four-bit" ? (e3) => (240 & e3) >> 4 : e2 === "absolute-value" ? (e3) => Math.abs(e3) : e2 === "modulo-ten" ? (e3) => e3 % 10 : null; } function b2(e2) { let o4 = 0; for (const r5 of e2 || []) o4 |= 1 << r5; return o4; } // node_modules/@arcgis/core/views/3d/layers/PointCloudWorker.js var c4 = class { transform(e2) { const a6 = this._transform(e2), o4 = [a6.points.buffer, a6.rgb.buffer]; r(a6.pointIdFilterMap) && o4.push(a6.pointIdFilterMap.buffer); for (const t4 of a6.attributes) "buffer" in t4.values && o(t4.values.buffer) && t4.values.buffer !== a6.rgb.buffer && o4.push(t4.values.buffer); return Promise.resolve({ result: a6, transferList: o4 }); } _transform(r5) { const e2 = c3(r5.schema, r5.geometryBuffer); let a6 = e2.length / 3, o4 = null; const f4 = [], s5 = a5(r5.primaryAttributeData, e2, a6); r(r5.primaryAttributeData) && s5 && f4.push({ attributeInfo: r5.primaryAttributeData.attributeInfo, values: s5 }); const i2 = a5(r5.modulationAttributeData, e2, a6); r(r5.modulationAttributeData) && i2 && f4.push({ attributeInfo: r5.modulationAttributeData.attributeInfo, values: i2 }); let c5 = f3(r5.rendererInfo, s5, i2, a6); if (r5.filterInfo && r5.filterInfo.length > 0 && r(r5.filterAttributesData)) { const t4 = r5.filterAttributesData.map((t5) => { const r6 = a5(t5, e2, a6), o5 = { attributeInfo: t5.attributeInfo, values: r6 }; return f4.push(o5), o5; }); o4 = new Uint32Array(a6), a6 = m3(e2, c5, o4, r5.filterInfo, t4); } for (const t4 of r5.userAttributesData) { const r6 = a5(t4, e2, a6); f4.push({ attributeInfo: t4.attributeInfo, values: r6 }); } 3 * a6 < c5.length && (c5 = new Uint8Array(c5.buffer.slice(0, 3 * a6))), this._applyElevationOffsetInPlace(e2, a6, r5.elevationOffset); const p3 = this._transformCoordinates(e2, a6, r5.obb, k.fromJSON(r5.inSR), k.fromJSON(r5.outSR)); return { obb: r5.obb, points: p3, rgb: c5, attributes: f4, pointIdFilterMap: o4 }; } _transformCoordinates(t4, r5, a6, n4, u3) { if (!Un(t4, n4, 0, t4, u3, 0, r5)) throw Error("Can't reproject"); const l3 = r2(a6.center[0], a6.center[1], a6.center[2]), b3 = n(), m4 = n(); S2(p2, a6.quaternion); const c5 = new Float32Array(3 * r5); for (let e2 = 0; e2 < r5; e2++) b3[0] = t4[3 * e2] - l3[0], b3[1] = t4[3 * e2 + 1] - l3[1], b3[2] = t4[3 * e2 + 2] - l3[2], S(m4, b3, p2), a6.halfSize[0] = Math.max(a6.halfSize[0], Math.abs(m4[0])), a6.halfSize[1] = Math.max(a6.halfSize[1], Math.abs(m4[1])), a6.halfSize[2] = Math.max(a6.halfSize[2], Math.abs(m4[2])), c5[3 * e2] = b3[0], c5[3 * e2 + 1] = b3[1], c5[3 * e2 + 2] = b3[2]; return c5; } _applyElevationOffsetInPlace(t4, r5, e2) { if (e2 !== 0) for (let a6 = 0; a6 < r5; a6++) t4[3 * a6 + 2] += e2; } }; var p2 = e(); function h3() { return new c4(); } export { h3 as default }; //# sourceMappingURL=PointCloudWorker-Z76DJAJC.js.map