import { T as T2 } from "./chunk-AGCBSGET.js"; import { t as t2 } from "./chunk-J525NRN3.js"; import { O as O2 } from "./chunk-XXBIV3TZ.js"; import { n as n3 } from "./chunk-2DNADSBR.js"; import { C as C2 } from "./chunk-MI7HWWFL.js"; import { A, B, C, D, E, F, G, H as H2, I, L, M as M2, O, S, T, U, V, a, b, c, d, g, h, i, j, k, l as l2, m, o as o2, p as p2, q, u as u2, v, w, x as x2, y, z as z2 } from "./chunk-H4JLO5B2.js"; import { H, M, P, _, e, l2 as l, o, r, u, x, z } from "./chunk-XNLG7T2T.js"; import { n as n2 } from "./chunk-IR4PV7VK.js"; import { n, p2 as p, t2 as t } from "./chunk-GZT4BVFP.js"; // node_modules/@arcgis/core/views/3d/support/meshProcessing.js function t3(t4, o5, n5) { const r4 = o5 / 3, c3 = new Uint32Array(n5 + 1), e3 = new Uint32Array(n5 + 1), s = (t5, o6) => { t5 < o6 ? c3[t5 + 1]++ : e3[o6 + 1]++; }; for (let x3 = 0; x3 < r4; x3++) { const o6 = t4[3 * x3], n6 = t4[3 * x3 + 1], r5 = t4[3 * x3 + 2]; s(o6, n6), s(n6, r5), s(r5, o6); } let f3 = 0, l5 = 0; for (let x3 = 0; x3 < n5; x3++) { const t5 = c3[x3 + 1], o6 = e3[x3 + 1]; c3[x3 + 1] = f3, e3[x3 + 1] = l5, f3 += t5, l5 += o6; } const i2 = new Uint32Array(6 * r4), a3 = c3[n5], w5 = (t5, o6, n6) => { if (t5 < o6) { const r5 = c3[t5 + 1]++; i2[2 * r5] = o6, i2[2 * r5 + 1] = n6; } else { const r5 = e3[o6 + 1]++; i2[2 * a3 + 2 * r5] = t5, i2[2 * a3 + 2 * r5 + 1] = n6; } }; for (let x3 = 0; x3 < r4; x3++) { const o6 = t4[3 * x3], n6 = t4[3 * x3 + 1], r5 = t4[3 * x3 + 2]; w5(o6, n6, x3), w5(n6, r5, x3), w5(r5, o6, x3); } const y5 = (t5, o6) => { const n6 = 2 * t5, r5 = o6 - t5; for (let c4 = 1; c4 < r5; c4++) { const t6 = i2[n6 + 2 * c4], o7 = i2[n6 + 2 * c4 + 1]; let r6 = c4 - 1; for (; r6 >= 0 && i2[n6 + 2 * r6] > t6; r6--) i2[n6 + 2 * r6 + 2] = i2[n6 + 2 * r6], i2[n6 + 2 * r6 + 3] = i2[n6 + 2 * r6 + 1]; i2[n6 + 2 * r6 + 2] = t6, i2[n6 + 2 * r6 + 3] = o7; } }; for (let x3 = 0; x3 < n5; x3++) y5(c3[x3], c3[x3 + 1]), y5(a3 + e3[x3], a3 + e3[x3 + 1]); const A4 = new Int32Array(3 * r4), U2 = (o6, n6) => o6 === t4[3 * n6] ? 0 : o6 === t4[3 * n6 + 1] ? 1 : o6 === t4[3 * n6 + 2] ? 2 : -1, u6 = (t5, o6) => { const n6 = U2(t5, o6); A4[3 * o6 + n6] = -1; }, p6 = (t5, o6, n6, r5) => { const c4 = U2(t5, o6); A4[3 * o6 + c4] = r5; const e4 = U2(n6, r5); A4[3 * r5 + e4] = o6; }; for (let x3 = 0; x3 < n5; x3++) { let t5 = c3[x3]; const o6 = c3[x3 + 1]; let n6 = e3[x3]; const r5 = e3[x3 + 1]; for (; t5 < o6 && n6 < r5; ) { const o7 = i2[2 * t5], r6 = i2[2 * a3 + 2 * n6]; o7 === r6 ? (p6(x3, i2[2 * t5 + 1], r6, i2[2 * a3 + 2 * n6 + 1]), t5++, n6++) : o7 < r6 ? (u6(x3, i2[2 * t5 + 1]), t5++) : (u6(r6, i2[2 * a3 + 2 * n6 + 1]), n6++); } for (; t5 < o6; ) u6(x3, i2[2 * t5 + 1]), t5++; for (; n6 < r5; ) { u6(i2[2 * a3 + 2 * n6], i2[2 * a3 + 2 * n6 + 1]), n6++; } } return A4; } // node_modules/@arcgis/core/views/3d/support/buffer/workerHelper.js function z3(e3, t4) { return t4.push(e3.buffer), { buffer: e3.buffer, layout: F2(e3.layout) }; } function F2(e3) { const t4 = new Array(); return e3.fields.forEach((e4, r4) => { const o5 = { ...e4, constructor: J(e4.constructor) }; t4.push([r4, o5]); }), { stride: e3.stride, fields: t4, fieldNames: e3.fieldNames }; } var H3 = [y, u2, i, c, l2, p2, o2, m, T, h, a, b, d, A, O, x2, g, w, E, L, B, F, I, U, j, V, M2, S, k, q, v, z2, C, D, G, H2]; function J(e3) { return `${e3.ElementType}_${e3.ElementCount}`; } var O3 = new Map(); H3.forEach((e3) => O3.set(J(e3), e3)); // node_modules/@arcgis/core/views/3d/support/buffer/glUtil.js function o3(t4, o5 = 0) { const n5 = t4.stride; return t4.fieldNames.filter((e3) => { const o6 = t4.fields.get(e3).optional; return !(o6 && o6.glPadding); }).map((i2) => { const s = t4.fields.get(i2), l5 = s.constructor.ElementCount, u6 = r2(s.constructor.ElementType), f3 = s.offset, c3 = !(!s.optional || !s.optional.glNormalized); return new t2(i2, l5, u6, f3, n5, c3, o5); }); } function r2(t4) { const e3 = n4[t4]; if (e3) return e3; throw new Error("BufferType not supported in WebGL"); } var n4 = { u8: C2.UNSIGNED_BYTE, u16: C2.UNSIGNED_SHORT, u32: C2.UNSIGNED_INT, i8: C2.BYTE, i16: C2.SHORT, i32: C2.INT, f32: C2.FLOAT }; // node_modules/@arcgis/core/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js var A2 = T2().vec3f(O2.POSITION).u16(O2.COMPONENTINDEX).u16(O2.U16PADDING); var e2 = T2().vec2u8(O2.SIDENESS); var T3 = o3(e2); var E2 = T2().vec3f(O2.POSITION0).vec3f(O2.POSITION1).u16(O2.COMPONENTINDEX).u8(O2.VARIANTOFFSET, { glNormalized: true }).u8(O2.VARIANTSTROKE).u8(O2.VARIANTEXTENSION, { glNormalized: true }).u8(O2.U8PADDING, { glPadding: true }).u16(O2.U16PADDING, { glPadding: true }); var S2 = E2.clone().vec3f(O2.NORMAL); var r3 = E2.clone().vec3f(O2.NORMALA).vec3f(O2.NORMALB); var o4 = new Map([[O2.POSITION0, 0], [O2.POSITION1, 1], [O2.COMPONENTINDEX, 2], [O2.VARIANTOFFSET, 3], [O2.VARIANTSTROKE, 4], [O2.VARIANTEXTENSION, 5], [O2.NORMAL, 6], [O2.NORMALA, 6], [O2.NORMALB, 7], [O2.SIDENESS, 8]]); // node_modules/@arcgis/core/views/3d/webgl-engine/lib/edgeRendering/edgeBufferWriters.js var a2 = class { updateSettings(t4) { this.settings = t4, this.edgeHashFunction = t4.reducedPrecision ? f : p3; } write(t4, o5, e3) { const n5 = this.edgeHashFunction(e3); W.seed = n5; const i2 = W.getIntRange(0, 255), r4 = W.getIntRange(0, this.settings.variants - 1), s = 0.7, a3 = W.getFloat(), c3 = 255 * (0.5 * g2(-(1 - Math.min(a3 / s, 1)) + Math.max(0, a3 - s) / (1 - s), 1.2) + 0.5); t4.position0.setVec(o5, e3.position0), t4.position1.setVec(o5, e3.position1), t4.componentIndex.set(o5, e3.componentIndex), t4.variantOffset.set(o5, i2), t4.variantStroke.set(o5, r4), t4.variantExtension.set(o5, c3); } trim(t4, o5) { return t4.slice(0, o5); } }; var c2 = new Float32Array(6); var m2 = new Uint32Array(c2.buffer); var u3 = new Uint32Array(1); function p3(t4) { const o5 = c2; o5[0] = t4.position0[0], o5[1] = t4.position0[1], o5[2] = t4.position0[2], o5[3] = t4.position1[0], o5[4] = t4.position1[1], o5[5] = t4.position1[2], u3[0] = 5381; for (let e3 = 0; e3 < m2.length; e3++) u3[0] = 31 * u3[0] + m2[e3]; return u3[0]; } function f(t4) { const o5 = c2; o5[0] = h2(t4.position0[0]), o5[1] = h2(t4.position0[1]), o5[2] = h2(t4.position0[2]), o5[3] = h2(t4.position1[0]), o5[4] = h2(t4.position1[1]), o5[5] = h2(t4.position1[2]), u3[0] = 5381; for (let e3 = 0; e3 < m2.length; e3++) u3[0] = 31 * u3[0] + m2[e3]; return u3[0]; } var l3 = 1e4; function h2(t4) { return Math.round(t4 * l3) / l3; } function g2(t4, o5) { const e3 = t4 < 0 ? -1 : 1; return Math.abs(t4) ** o5 * e3; } var d2 = class { constructor() { this.commonWriter = new a2(); } updateSettings(t4) { this.commonWriter.updateSettings(t4); } allocate(t4) { return S2.createBuffer(t4); } write(t4, n5, i2) { this.commonWriter.write(t4, n5, i2), u(y2, i2.faceNormal0, i2.faceNormal1), z(y2, y2), t4.normal.setVec(n5, y2); } trim(t4, o5) { return this.commonWriter.trim(t4, o5); } }; d2.Layout = S2, d2.glLayout = o3(S2, 1); var w2 = class { constructor() { this.commonWriter = new a2(); } updateSettings(t4) { this.commonWriter.updateSettings(t4); } allocate(t4) { return r3.createBuffer(t4); } write(t4, o5, e3) { this.commonWriter.write(t4, o5, e3), t4.normalA.setVec(o5, e3.faceNormal0), t4.normalB.setVec(o5, e3.faceNormal1); } trim(t4, o5) { return this.commonWriter.trim(t4, o5); } }; w2.Layout = r3, w2.glLayout = o3(r3, 1); var y2 = n2(); var W = new t(); // node_modules/@arcgis/core/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js var p4 = -1; var u4; function h3(n5, i2, l5, f3 = N) { const g4 = n5.vertices.position, m4 = n5.vertices.componentIndex, u6 = M(f3.anglePlanar), h5 = M(f3.angleSignificantEdge), V3 = Math.cos(h5), S3 = Math.cos(u6), j2 = I2.edge, x3 = j2.position0, E3 = j2.position1, D3 = j2.faceNormal0, F3 = j2.faceNormal1, L3 = y3(n5), U2 = w3(n5), b3 = U2.length / 4, k2 = i2.allocate(b3); let C3 = 0; const H4 = b3, K = l5.allocate(H4); let M3 = 0, O4 = 0, P2 = 0; const T4 = p(0, b3), q2 = new Float32Array(b3); n(q2, (e3, t4, n6) => { g4.getVec(U2[4 * t4 + 0], x3), g4.getVec(U2[4 * t4 + 1], E3), n6[t4] = x(x3, E3); }), T4.sort((e3, t4) => q2[t4] - q2[e3]); const z4 = new Array(), B2 = new Array(); for (let e3 = 0; e3 < b3; e3++) { const t4 = T4[e3], n6 = q2[t4], o5 = U2[4 * t4 + 0], r4 = U2[4 * t4 + 1], f4 = U2[4 * t4 + 2], h6 = U2[4 * t4 + 3], w5 = h6 === p4; if (g4.getVec(o5, x3), g4.getVec(r4, E3), w5) o(D3, L3[3 * f4 + 0], L3[3 * f4 + 1], L3[3 * f4 + 2]), r(F3, D3), j2.componentIndex = m4.get(o5), j2.cosAngle = P(D3, F3); else { if (o(D3, L3[3 * f4 + 0], L3[3 * f4 + 1], L3[3 * f4 + 2]), o(F3, L3[3 * h6 + 0], L3[3 * h6 + 1], L3[3 * h6 + 2]), j2.componentIndex = m4.get(o5), j2.cosAngle = P(D3, F3), A3(j2, S3)) continue; j2.cosAngle < -0.9999 && r(F3, D3); } O4 += n6, P2++, w5 || v2(j2, V3) ? (i2.write(k2, C3++, j2), z4.push(n6)) : d3(j2, u6) && (l5.write(K, M3++, j2), B2.push(n6)); } const G2 = new Float32Array(z4.reverse()), J2 = new Float32Array(B2.reverse()); return { regular: { instancesData: i2.trim(k2, C3), lodInfo: { lengths: G2 } }, silhouette: { instancesData: l5.trim(K, M3), lodInfo: { lengths: J2 } }, averageEdgeLength: O4 / P2 }; } function v2(e3, t4) { return e3.cosAngle < t4; } function A3(e3, t4) { return e3.cosAngle > t4; } function d3(e3, t4) { const o5 = l(e3.cosAngle), r4 = I2.fwd, s = I2.ortho; H(r4, e3.position1, e3.position0); return o5 * (P(_(s, e3.faceNormal0, e3.faceNormal1), r4) > 0 ? -1 : 1) > t4; } function w3(e3) { const t4 = e3.faces.length / 3, n5 = e3.faces, o5 = e3.neighbors; let r4 = 0; for (let a3 = 0; a3 < t4; a3++) { const e4 = o5[3 * a3 + 0], t5 = o5[3 * a3 + 1], s2 = o5[3 * a3 + 2], c4 = n5[3 * a3 + 0], i2 = n5[3 * a3 + 1], l5 = n5[3 * a3 + 2]; r4 += e4 === p4 || c4 < i2 ? 1 : 0, r4 += t5 === p4 || i2 < l5 ? 1 : 0, r4 += s2 === p4 || l5 < c4 ? 1 : 0; } const s = new Int32Array(4 * r4); let c3 = 0; for (let a3 = 0; a3 < t4; a3++) { const e4 = o5[3 * a3 + 0], t5 = o5[3 * a3 + 1], r5 = o5[3 * a3 + 2], i2 = n5[3 * a3 + 0], l5 = n5[3 * a3 + 1], f3 = n5[3 * a3 + 2]; (e4 === p4 || i2 < l5) && (s[c3++] = i2, s[c3++] = l5, s[c3++] = a3, s[c3++] = e4), (t5 === p4 || l5 < f3) && (s[c3++] = l5, s[c3++] = f3, s[c3++] = a3, s[c3++] = t5), (r5 === p4 || f3 < i2) && (s[c3++] = f3, s[c3++] = i2, s[c3++] = a3, s[c3++] = r5); } return s; } function y3(e3) { const t4 = e3.faces.length / 3, n5 = e3.vertices.position, o5 = e3.faces, r4 = V2.v0, s = V2.v1, c3 = V2.v2, a3 = new Float32Array(3 * t4); for (let i2 = 0; i2 < t4; i2++) { const e4 = o5[3 * i2 + 0], t5 = o5[3 * i2 + 1], m4 = o5[3 * i2 + 2]; n5.getVec(e4, r4), n5.getVec(t5, s), n5.getVec(m4, c3), e(s, s, r4), e(c3, c3, r4), _(r4, s, c3), z(r4, r4), a3[3 * i2 + 0] = r4[0], a3[3 * i2 + 1] = r4[1], a3[3 * i2 + 2] = r4[2]; } return a3; } !function(e3) { e3[e3.SOLID = 0] = "SOLID", e3[e3.SKETCH = 1] = "SKETCH"; }(u4 || (u4 = {})); var I2 = { edge: { position0: n2(), position1: n2(), faceNormal0: n2(), faceNormal1: n2(), componentIndex: 0, cosAngle: 0 }, ortho: n2(), fwd: n2() }; var V2 = { v0: n2(), v1: n2(), v2: n2() }; var N = { anglePlanar: 4, angleSignificantEdge: 35 }; // node_modules/@arcgis/core/views/3d/webgl-engine/lib/edgeRendering/EdgeProcessingWorker.js var u5 = class { async extract(e3) { const t4 = l4(e3), n5 = f2(t4), r4 = [t4.data.buffer]; return { result: d4(n5, r4), transferList: r4 }; } async extractComponentsEdgeLocations(e3) { const t4 = l4(e3), n5 = p5(t4.data, t4.skipDeduplicate, t4.indices, t4.indicesLength), i2 = h3(n5, L2, D2), s = []; return { result: z3(i2.regular.instancesData, s), transferList: s }; } async extractEdgeLocations(e3) { const t4 = l4(e3), n5 = p5(t4.data, t4.skipDeduplicate, t4.indices, t4.indicesLength), i2 = h3(n5, w4, D2), s = []; return { result: z3(i2.regular.instancesData, s), transferList: s }; } }; function f2(e3) { const t4 = p5(e3.data, e3.skipDeduplicate, e3.indices, e3.indicesLength); return g3.updateSettings(e3.writerSettings), h4.updateSettings(e3.writerSettings), h3(t4, g3, h4); } function l4(e3) { return { data: A2.createView(e3.dataBuffer), indices: e3.indicesType === "Uint32Array" ? new Uint32Array(e3.indicesBuffer) : e3.indicesType === "Uint16Array" ? new Uint16Array(e3.indicesBuffer) : void 0, indicesLength: e3.indicesLength, writerSettings: e3.writerSettings, skipDeduplicate: e3.skipDeduplicate }; } function d4(e3, t4) { t4.push(e3.regular.lodInfo.lengths.buffer), t4.push(e3.silhouette.lodInfo.lengths.buffer); return { regular: { instancesData: z3(e3.regular.instancesData, t4), lodInfo: { lengths: e3.regular.lodInfo.lengths.buffer } }, silhouette: { instancesData: z3(e3.silhouette.instancesData, t4), lodInfo: { lengths: e3.silhouette.lodInfo.lengths.buffer } }, averageEdgeLength: e3.averageEdgeLength }; } function p5(n5, r4, i2, o5) { if (r4) { return { faces: i2, facesLength: o5, neighbors: t3(i2, o5, n5.count), vertices: n5 }; } const a3 = n3(n5.buffer, n5.stride / 4, { originalIndices: i2, originalIndicesLength: o5 }), c3 = t3(a3.indices, o5, a3.uniqueCount); return { faces: a3.indices, facesLength: a3.indices.length, neighbors: c3, vertices: A2.createView(a3.buffer) }; } var g3 = new d2(); var h4 = new w2(); var m3 = class { allocate(e3) { return b2.createBuffer(e3); } trim(e3, t4) { return e3.slice(0, t4); } write(e3, t4, n5) { e3.position0.setVec(t4, n5.position0), e3.position1.setVec(t4, n5.position1); } }; var I3 = class { allocate(e3) { return y4.createBuffer(e3); } trim(e3, t4) { return e3.slice(0, t4); } write(e3, t4, n5) { e3.position0.setVec(t4, n5.position0), e3.position1.setVec(t4, n5.position1), e3.componentIndex.set(t4, n5.componentIndex); } }; var w4 = new m3(); var L2 = new I3(); var D2 = { allocate: () => null, write: () => { }, trim: () => null }; var b2 = T2().vec3f(O2.POSITION0).vec3f(O2.POSITION1); var y4 = T2().vec3f(O2.POSITION0).vec3f(O2.POSITION1).u16(O2.COMPONENTINDEX).u16(O2.U16PADDING, { glPadding: true }); function v3() { return new u5(); } export { u5 as u, f2 as f, b2 as b, y4 as y, v3 as v }; //# sourceMappingURL=chunk-JSUXM6R5.js.map