import { b, j, v } from "./chunk-VKMM7VW7.js"; import { c } from "./chunk-QHWZYJGI.js"; import "./chunk-X4WJNVEM.js"; import { N, R, T, V, _, d, k, p as p2, s } from "./chunk-ZNJHHCMJ.js"; import { m } from "./chunk-4GSC3BUA.js"; import "./chunk-AGGGC2FA.js"; import "./chunk-RUM3DXFX.js"; import "./chunk-7LRVL5YB.js"; import "./chunk-4OM3EX6P.js"; import "./chunk-X6GHUY4U.js"; import "./chunk-3OFVLRSL.js"; import "./chunk-44FMXGSC.js"; import "./chunk-XFDO4CMR.js"; import "./chunk-GHN7C53L.js"; import "./chunk-HIELTLML.js"; import { q as q2 } from "./chunk-OQSZOHTF.js"; import "./chunk-Y7BZ6TKQ.js"; import "./chunk-VEJPYAE4.js"; import "./chunk-4GGDRIJK.js"; import "./chunk-PZ7XDUL6.js"; import "./chunk-ULSPZIPE.js"; import "./chunk-UMUHMVL4.js"; import "./chunk-FZSI6IGI.js"; import "./chunk-K7B6OWCU.js"; import "./chunk-E3G7BRZB.js"; import "./chunk-OKUFE7TO.js"; import "./chunk-JKFWEHNK.js"; import "./chunk-P24XEEHY.js"; import "./chunk-WOXHUQGM.js"; import "./chunk-FMPQIGFA.js"; import "./chunk-EDHROVWI.js"; import "./chunk-3IRT3YKJ.js"; import "./chunk-SAJAEMIJ.js"; import "./chunk-OJ2HHY2O.js"; import "./chunk-PT62335L.js"; import { r as r4 } from "./chunk-C7742RNZ.js"; import "./chunk-FNA5GLRW.js"; import "./chunk-MCWCB5IY.js"; import "./chunk-CRGY2SDS.js"; import "./chunk-4T5ZGMEN.js"; import "./chunk-CZBRZ6SU.js"; import "./chunk-VGWC3IKZ.js"; import "./chunk-2H5MD622.js"; import "./chunk-3RSFVUKZ.js"; import "./chunk-X4SA4ELJ.js"; import "./chunk-5N7JLUJJ.js"; import "./chunk-ZLNEXZAN.js"; import "./chunk-ZYRIJWLX.js"; import "./chunk-RYY6632W.js"; import { A, g, p, q, r as r3, u, x } from "./chunk-DW42UVIT.js"; import "./chunk-YAEIHDJH.js"; import { n as n2, r as r2, t as t2 } from "./chunk-TJNOJH33.js"; import "./chunk-OSHI574D.js"; import "./chunk-ETGAZ7LF.js"; import "./chunk-75U5LM2V.js"; import "./chunk-RMDDCMKS.js"; import "./chunk-VCH45Q2I.js"; import "./chunk-GSSTTHIT.js"; import "./chunk-HZRKBTHJ.js"; import "./chunk-DVUG3KID.js"; import "./chunk-FWSQEIAR.js"; import "./chunk-VEGAOVMY.js"; import "./chunk-6T6G6LCQ.js"; import "./chunk-YEJL5NEF.js"; import "./chunk-PQFTYGF5.js"; import { e, l, n5 as n } from "./chunk-2Z2TG5CU.js"; import "./chunk-6KZ2LTDA.js"; import { e as e2 } from "./chunk-U2XHEJM7.js"; import "./chunk-SQOPWYIT.js"; import { f } from "./chunk-V6P2MAQQ.js"; import "./chunk-E5O6P5I2.js"; import "./chunk-SPWQ3AWG.js"; import "./chunk-2TIUKVZN.js"; import { i, r, t } from "./chunk-YXWMMD76.js"; import "./chunk-S5KM4IGW.js"; // node_modules/@arcgis/core/geometry/support/clipRay.js function s3(r6) { return r6 ? { ray: d(r6.ray), c0: r6.c0, c1: r6.c1 } : { ray: d(), c0: 0, c1: Number.MAX_VALUE }; } var k3 = new s(() => s3()); // node_modules/@arcgis/core/geometry/support/frustum.js function I() { return [n2(), n2(), n2(), n2(), n2(), n2(), n2(), n2()]; } function i2(T3, _2) { for (let O2 = 0; O2 < v3.NUM; O2++) { const R4 = T3[O2]; if (R4[0] * _2[0] + R4[1] * _2[1] + R4[2] * _2[2] + R4[3] >= _2[3]) return false; } return true; } var U; var l2; !function(T3) { T3[T3.LEFT = 0] = "LEFT", T3[T3.RIGHT = 1] = "RIGHT", T3[T3.BOTTOM = 2] = "BOTTOM", T3[T3.TOP = 3] = "TOP", T3[T3.NEAR = 4] = "NEAR", T3[T3.FAR = 5] = "FAR"; }(U || (U = {})), function(T3) { T3[T3.NEAR_BOTTOM_LEFT = 0] = "NEAR_BOTTOM_LEFT", T3[T3.NEAR_BOTTOM_RIGHT = 1] = "NEAR_BOTTOM_RIGHT", T3[T3.NEAR_TOP_RIGHT = 2] = "NEAR_TOP_RIGHT", T3[T3.NEAR_TOP_LEFT = 3] = "NEAR_TOP_LEFT", T3[T3.FAR_BOTTOM_LEFT = 4] = "FAR_BOTTOM_LEFT", T3[T3.FAR_BOTTOM_RIGHT = 5] = "FAR_BOTTOM_RIGHT", T3[T3.FAR_TOP_RIGHT = 6] = "FAR_TOP_RIGHT", T3[T3.FAR_TOP_LEFT = 7] = "FAR_TOP_LEFT"; }(l2 || (l2 = {})); var k4 = { bottom: [l2.FAR_BOTTOM_RIGHT, l2.NEAR_BOTTOM_RIGHT, l2.NEAR_BOTTOM_LEFT, l2.FAR_BOTTOM_LEFT], near: [l2.NEAR_BOTTOM_LEFT, l2.NEAR_BOTTOM_RIGHT, l2.NEAR_TOP_RIGHT, l2.NEAR_TOP_LEFT], far: [l2.FAR_BOTTOM_RIGHT, l2.FAR_BOTTOM_LEFT, l2.FAR_TOP_LEFT, l2.FAR_TOP_RIGHT], right: [l2.NEAR_BOTTOM_RIGHT, l2.FAR_BOTTOM_RIGHT, l2.FAR_TOP_RIGHT, l2.NEAR_TOP_RIGHT], left: [l2.FAR_BOTTOM_LEFT, l2.NEAR_BOTTOM_LEFT, l2.NEAR_TOP_LEFT, l2.FAR_TOP_LEFT], top: [l2.FAR_TOP_LEFT, l2.NEAR_TOP_LEFT, l2.NEAR_TOP_RIGHT, l2.FAR_TOP_RIGHT] }; var v3; var h2; !function(T3) { T3[T3.NUM = 6] = "NUM"; }(v3 || (v3 = {})), function(T3) { T3[T3.NUM = 8] = "NUM"; }(h2 || (h2 = {})); var g2 = [r4(-1, -1, -1, 1), r4(1, -1, -1, 1), r4(1, 1, -1, 1), r4(-1, 1, -1, 1), r4(-1, -1, 1, 1), r4(1, -1, 1, 1), r4(1, 1, 1, 1), r4(-1, 1, 1, 1)]; var b2 = new s(s3); var y = I(); // node_modules/@arcgis/core/views/3d/webgl-engine/lib/Octree.js var g3 = class { constructor(e3, t4) { this._objectToBoundingSphere = e3, this._maximumObjectsPerNode = 10, this._maximumDepth = 20, this._degenerateObjects = /* @__PURE__ */ new Set(), this._root = new O(), this._objectCount = 0, t4 && (void 0 !== t4.maximumObjectsPerNode && (this._maximumObjectsPerNode = t4.maximumObjectsPerNode), void 0 !== t4.maximumDepth && (this._maximumDepth = t4.maximumDepth)); } get bounds() { return this._root.bounds; } get halfSize() { return this._root.halfSize; } get root() { return this._root.node; } get maximumObjectsPerNode() { return this._maximumObjectsPerNode; } get maximumDepth() { return this._maximumDepth; } get objectCount() { return this._objectCount; } destroy() { this._degenerateObjects.clear(), O.clearPool(), B[0] = null, w2.prune(), W.prune(); } add(e3, t4 = e3.length) { this._objectCount += t4, this._grow(e3, t4); const n3 = O.acquire(); for (let o2 = 0; o2 < t4; o2++) { const t5 = e3[o2]; this._isDegenerate(t5) ? this._degenerateObjects.add(t5) : (n3.init(this._root), this._add(t5, n3)); } O.release(n3); } remove(t4, n3 = null) { this._objectCount -= t4.length; const o2 = O.acquire(); for (const r6 of t4) { const t5 = r(n3) ? n3 : _(this._objectToBoundingSphere(r6), C); z2(t5[3]) ? (o2.init(this._root), this._remove(r6, t5, o2)) : this._degenerateObjects.delete(r6); } O.release(o2), this._shrink(); } update(e3, t4) { if (!z2(t4[3]) && this._isDegenerate(e3)) return; const n3 = R3(e3); this.remove(n3, t4), this.add(n3); } forEachAlongRay(e3, t4, n3) { const o2 = p2(e3, t4); this._forEachNode(this._root, (e4) => { if (!this._intersectsNode(o2, e4)) return false; const t5 = e4.node; return t5.terminals.forAll((e5) => { this._intersectsObject(o2, e5) && n3(e5); }), null !== t5.residents && t5.residents.forAll((e5) => { this._intersectsObject(o2, e5) && n3(e5); }), true; }); } forEachAlongRayWithVerticalOffset(e3, t4, n3, o2) { const r6 = p2(e3, t4); this._forEachNode(this._root, (e4) => { if (!this._intersectsNodeWithOffset(r6, e4, o2)) return false; const t5 = e4.node; return t5.terminals.forAll((e5) => { this._intersectsObjectWithOffset(r6, e5, o2) && n3(e5); }), null !== t5.residents && t5.residents.forAll((e5) => { this._intersectsObjectWithOffset(r6, e5, o2) && n3(e5); }), true; }); } forEach(e3) { this._forEachNode(this._root, (t4) => { const n3 = t4.node; return n3.terminals.forAll(e3), null !== n3.residents && n3.residents.forAll(e3), true; }), this._degenerateObjects.forEach(e3); } forEachDegenerateObject(e3) { this._degenerateObjects.forEach(e3); } findClosest(e3, t4, n3, s4 = () => true, i3 = 1 / 0) { let h3 = 1 / 0, a2 = 1 / 0, d2 = null; const c3 = E(e3, t4), u3 = (o2) => { if (--i3, !s4(o2)) return; const r6 = this._objectToBoundingSphere(o2); if (!i2(n3, r6)) return; const c4 = M(e3, t4, k(r6)), u4 = c4 - r6[3], f3 = c4 + r6[3]; u4 < h3 && (h3 = u4, a2 = f3, d2 = o2); }; return this._forEachNodeDepthOrdered(this._root, (s5) => { if (i3 <= 0 || !i2(n3, s5.bounds)) return false; g(F, c3, s5.halfSize), u(F, F, s5.bounds); if (M(e3, t4, F) > a2) return false; const h4 = s5.node; return h4.terminals.forAll((e4) => u3(e4)), null !== h4.residents && h4.residents.forAll((e4) => u3(e4)), true; }, e3, t4), d2; } forEachInDepthRange(e3, t4, n3, s4, i3, h3, a2) { let d2 = -1 / 0, c3 = 1 / 0; const u3 = { setRange: (e4) => { n3 === g3.DepthOrder.FRONT_TO_BACK ? (d2 = Math.max(d2, e4.near), c3 = Math.min(c3, e4.far)) : (d2 = Math.max(d2, -e4.far), c3 = Math.min(c3, -e4.near)); } }; u3.setRange(s4); const f3 = M(t4, n3, e3), m2 = E(t4, n3), p5 = E(t4, -n3), b3 = (e4) => { if (!a2(e4)) return; const o2 = this._objectToBoundingSphere(e4), r6 = k(o2), s5 = M(t4, n3, r6) - f3, m3 = s5 - o2[3], p6 = s5 + o2[3]; m3 > c3 || p6 < d2 || !i2(h3, o2) || i3(e4, u3); }; this._forEachNodeDepthOrdered(this._root, (e4) => { if (!i2(h3, e4.bounds)) return false; g(F, m2, e4.halfSize), u(F, F, e4.bounds); if (M(t4, n3, F) - f3 > c3) return false; g(F, p5, e4.halfSize), u(F, F, e4.bounds); if (M(t4, n3, F) - f3 < d2) return false; const s5 = e4.node; return s5.terminals.forAll((e5) => b3(e5)), null !== s5.residents && s5.residents.forAll((e5) => b3(e5)), true; }, t4, n3); } forEachNode(e3) { this._forEachNode(this._root, (t4) => e3(t4.node, t4.bounds, t4.halfSize)); } forEachNeighbor(e3, t4) { const n3 = T(t4), o2 = k(t4), r6 = (t5) => { const r7 = this._objectToBoundingSphere(t5), i4 = T(r7), h4 = n3 + i4; return !(p(k(r7), o2) - h4 * h4 <= 0) || e3(t5); }; let i3 = true; const h3 = (e4) => { i3 && (i3 = r6(e4)); }; this._forEachNode(this._root, (e4) => { const t5 = T(e4.bounds), r7 = n3 + t5; if (p(k(e4.bounds), o2) - r7 * r7 > 0) return false; const a2 = e4.node; return a2.terminals.forAll(h3), i3 && null !== a2.residents && a2.residents.forAll(h3), i3; }), i3 && this.forEachDegenerateObject(h3); } _intersectsNode(e3, t4) { return x2(t4.bounds, 2 * -t4.halfSize, k5), x2(t4.bounds, 2 * t4.halfSize, q3), c(e3.origin, e3.direction, k5, q3); } _intersectsNodeWithOffset(e3, t4, n3) { return x2(t4.bounds, 2 * -t4.halfSize, k5), x2(t4.bounds, 2 * t4.halfSize, q3), n3.applyToMinMax(k5, q3), c(e3.origin, e3.direction, k5, q3); } _intersectsObject(e3, t4) { const n3 = this._objectToBoundingSphere(t4); return !(n3[3] > 0) || V(n3, e3); } _intersectsObjectWithOffset(e3, t4, n3) { const o2 = this._objectToBoundingSphere(t4); return !(o2[3] > 0) || V(n3.applyToBoundingSphere(o2), e3); } _forEachNode(e3, t4) { let n3 = O.acquire().init(e3); const o2 = [n3]; for (; 0 !== o2.length; ) { if (n3 = o2.pop(), t4(n3) && !n3.isLeaf()) for (let e4 = 0; e4 < n3.node.children.length; e4++) { n3.node.children[e4] && o2.push(O.acquire().init(n3).advance(e4)); } O.release(n3); } } _forEachNodeDepthOrdered(e3, t4, n3, o2 = g3.DepthOrder.FRONT_TO_BACK) { let r6 = O.acquire().init(e3); const s4 = [r6]; for (T2(n3, o2, V2); 0 !== s4.length; ) { if (r6 = s4.pop(), t4(r6) && !r6.isLeaf()) for (let e4 = 7; e4 >= 0; --e4) { const t5 = V2[e4]; r6.node.children[t5] && s4.push(O.acquire().init(r6).advance(t5)); } O.release(r6); } } _remove(e3, t4, n3) { w2.clear(); const o2 = n3.advanceTo(t4, (e4, t5) => { w2.push(e4.node), w2.push(t5); }) ? n3.node.terminals : n3.node.residents; if (o2.removeUnordered(e3), 0 === o2.length) for (let r6 = w2.length - 2; r6 >= 0; r6 -= 2) { const e4 = w2.data[r6], t5 = w2.data[r6 + 1]; if (!this._purge(e4, t5)) break; } } _nodeIsEmpty(e3) { if (0 !== e3.terminals.length) return false; if (null !== e3.residents) return 0 === e3.residents.length; for (let t4 = 0; t4 < e3.children.length; t4++) if (e3.children[t4]) return false; return true; } _purge(e3, t4) { return t4 >= 0 && (e3.children[t4] = null), !!this._nodeIsEmpty(e3) && (null === e3.residents && (e3.residents = new l({ shrink: true })), true); } _add(e3, t4) { t4.advanceTo(this._objectToBoundingSphere(e3)) ? t4.node.terminals.push(e3) : (t4.node.residents.push(e3), t4.node.residents.length > this._maximumObjectsPerNode && t4.depth < this._maximumDepth && this._split(t4)); } _split(e3) { const t4 = e3.node.residents; e3.node.residents = null; for (let n3 = 0; n3 < t4.length; n3++) { const o2 = O.acquire().init(e3); this._add(t4.getItemAt(n3), o2), O.release(o2); } } _grow(e3, t4) { if (0 !== t4 && (N2(e3, t4, (e4) => this._objectToBoundingSphere(e4), I2), z2(I2[3]) && !this._fitsInsideTree(I2))) if (this._nodeIsEmpty(this._root.node)) _(I2, this._root.bounds), this._root.halfSize = 1.25 * I2[3]; else { const e4 = this._rootBoundsForRootAsSubNode(I2); this._placingRootViolatesMaxDepth(e4) ? this._rebuildTree(I2, e4) : this._growRootAsSubNode(e4), O.release(e4); } } _rebuildTree(e3, t4) { r3(P, t4.bounds), P[3] = t4.halfSize, N2([e3, P], 2, (e4) => e4, L); const n3 = O.acquire().init(this._root); this._root.initFrom(null, L, 1.25 * L[3]), this._forEachNode(n3, (e4) => (this.add(e4.node.terminals.data, e4.node.terminals.length), null !== e4.node.residents && this.add(e4.node.residents.data, e4.node.residents.length), true)), O.release(n3); } _placingRootViolatesMaxDepth(e3) { const t4 = Math.log(e3.halfSize / this._root.halfSize) * Math.LOG2E; let n3 = 0; return this._forEachNode(this._root, (e4) => (n3 = Math.max(n3, e4.depth), n3 + t4 <= this._maximumDepth)), n3 + t4 > this._maximumDepth; } _rootBoundsForRootAsSubNode(e3) { const t4 = e3[3], n3 = e3; let o2 = -1 / 0; const r6 = this._root.bounds, s4 = this._root.halfSize; for (let i3 = 0; i3 < 3; i3++) { const e4 = r6[i3] - s4 - (n3[i3] - t4), h3 = n3[i3] + t4 - (r6[i3] + s4), a2 = Math.max(0, Math.ceil(e4 / (2 * s4))), d2 = Math.max(0, Math.ceil(h3 / (2 * s4))) + 1, l3 = 2 ** Math.ceil(Math.log(a2 + d2) * Math.LOG2E); o2 = Math.max(o2, l3), K[i3].min = a2, K[i3].max = d2; } for (let i3 = 0; i3 < 3; i3++) { let e4 = K[i3].min, t5 = K[i3].max; const n4 = (o2 - (e4 + t5)) / 2; e4 += Math.ceil(n4), t5 += Math.floor(n4); const h3 = r6[i3] - s4 - e4 * s4 * 2; y2[i3] = h3 + (t5 + e4) * s4; } return y2[3] = o2 * s4 * v4, O.acquire().initFrom(null, y2, o2 * s4, 0); } _growRootAsSubNode(e3) { const t4 = this._root.node; r3(I2, this._root.bounds), I2[3] = this._root.halfSize, this._root.init(e3), e3.advanceTo(I2, null, true), e3.node.children = t4.children, e3.node.residents = t4.residents, e3.node.terminals = t4.terminals; } _shrink() { for (; ; ) { const e3 = this._findShrinkIndex(); if (-1 === e3) break; this._root.advance(e3), this._root.depth = 0; } } _findShrinkIndex() { if (0 !== this._root.node.terminals.length || this._root.isLeaf()) return -1; let e3 = null; const t4 = this._root.node.children; let n3 = 0, o2 = 0; for (; o2 < t4.length && null == e3; ) n3 = o2++, e3 = t4[n3]; for (; o2 < t4.length; ) if (t4[o2++]) return -1; return n3; } _isDegenerate(e3) { return !z2(this._objectToBoundingSphere(e3)[3]); } _fitsInsideTree(e3) { const t4 = this._root.bounds, n3 = this._root.halfSize; return e3[3] <= n3 && e3[0] >= t4[0] - n3 && e3[0] <= t4[0] + n3 && e3[1] >= t4[1] - n3 && e3[1] <= t4[1] + n3 && e3[2] >= t4[2] - n3 && e3[2] <= t4[2] + n3; } }; var O = class { constructor() { this.bounds = R(), this.halfSize = 0, this.initFrom(null, null, 0, 0); } init(e3) { return this.initFrom(e3.node, e3.bounds, e3.halfSize, e3.depth); } initFrom(t4, n3, o2, r6 = this.depth) { return this.node = r(t4) ? t4 : O.createEmptyNode(), r(n3) && _(n3, this.bounds), this.halfSize = o2, this.depth = r6, this; } advance(e3) { let t4 = this.node.children[e3]; t4 || (t4 = O.createEmptyNode(), this.node.children[e3] = t4), this.node = t4, this.halfSize /= 2, this.depth++; const n3 = A3[e3]; return this.bounds[0] += n3[0] * this.halfSize, this.bounds[1] += n3[1] * this.halfSize, this.bounds[2] += n3[2] * this.halfSize, this.bounds[3] = this.halfSize * v4, this; } advanceTo(e3, t4, n3 = false) { for (; ; ) { if (this.isTerminalFor(e3)) return t4 && t4(this, -1), true; if (this.isLeaf()) { if (!n3) return t4 && t4(this, -1), false; this.node.residents = null; } const o2 = this._childIndex(e3); t4 && t4(this, o2), this.advance(o2); } } isLeaf() { return null != this.node.residents; } isTerminalFor(e3) { return e3[3] > this.halfSize / 2; } _childIndex(e3) { const t4 = this.bounds; return (t4[0] < e3[0] ? 1 : 0) + (t4[1] < e3[1] ? 2 : 0) + (t4[2] < e3[2] ? 4 : 0); } static createEmptyNode() { return { children: [null, null, null, null, null, null, null, null], terminals: new l({ shrink: true }), residents: new l({ shrink: true }) }; } static acquire() { return O._pool.acquire(); } static release(e3) { O._pool.release(e3); } static clearPool() { O._pool.prune(); } }; function j4(e3, t4) { e3[0] = Math.min(e3[0], t4[0] - t4[3]), e3[1] = Math.min(e3[1], t4[1] - t4[3]), e3[2] = Math.min(e3[2], t4[2] - t4[3]); } function S(e3, t4) { e3[0] = Math.max(e3[0], t4[0] + t4[3]), e3[1] = Math.max(e3[1], t4[1] + t4[3]), e3[2] = Math.max(e3[2], t4[2] + t4[3]); } function x2(e3, t4, n3) { n3[0] = e3[0] + t4, n3[1] = e3[1] + t4, n3[2] = e3[2] + t4; } function N2(e3, t4, n3, o2) { if (1 === t4) { const t5 = n3(e3[0]); _(t5, o2); } else { k5[0] = 1 / 0, k5[1] = 1 / 0, k5[2] = 1 / 0, q3[0] = -1 / 0, q3[1] = -1 / 0, q3[2] = -1 / 0; for (let o3 = 0; o3 < t4; o3++) { const t5 = n3(e3[o3]); z2(t5[3]) && (j4(k5, t5), S(q3, t5)); } A(o2, k5, q3, 0.5), o2[3] = Math.max(q3[0] - k5[0], q3[1] - k5[1], q3[2] - k5[2]) / 2; } } function T2(e3, t4, n3) { if (!W.length) for (let o2 = 0; o2 < 8; ++o2) W.push({ index: 0, distance: 0 }); for (let o2 = 0; o2 < 8; ++o2) { const n4 = A3[o2]; W.data[o2].index = o2, W.data[o2].distance = M(e3, t4, n4); } W.sort((e4, t5) => e4.distance - t5.distance); for (let o2 = 0; o2 < 8; ++o2) n3[o2] = W.data[o2].index; } function E(e3, t4) { let n3, o2 = 1 / 0; for (let r6 = 0; r6 < 8; ++r6) { const s4 = M(e3, t4, D2[r6]); s4 < o2 && (o2 = s4, n3 = D2[r6]); } return n3; } function M(e3, t4, n3) { return t4 * (e3[0] * n3[0] + e3[1] * n3[1] + e3[2] * n3[2]); } function z2(e3) { return !isNaN(e3) && e3 !== -1 / 0 && e3 !== 1 / 0 && e3 > 0; } O._pool = new e2(O), function(e3) { var t4; (t4 = e3.DepthOrder || (e3.DepthOrder = {}))[t4.FRONT_TO_BACK = 1] = "FRONT_TO_BACK", t4[t4.BACK_TO_FRONT = -1] = "BACK_TO_FRONT"; }(g3 || (g3 = {})); var A3 = [r2(-1, -1, -1), r2(1, -1, -1), r2(-1, 1, -1), r2(1, 1, -1), r2(-1, -1, 1), r2(1, -1, 1), r2(-1, 1, 1), r2(1, 1, 1)]; var D2 = [r2(-1, -1, -1), r2(-1, -1, 1), r2(-1, 1, -1), r2(-1, 1, 1), r2(1, -1, -1), r2(1, -1, 1), r2(1, 1, -1), r2(1, 1, 1)]; var v4 = Math.sqrt(3); var B = [null]; function R3(e3) { return B[0] = e3, B; } var y2 = R(); var F = n2(); var k5 = n2(); var q3 = n2(); var w2 = new l(); var C = R(); var I2 = R(); var P = R(); var L = R(); var K = [{ min: 0, max: 0 }, { min: 0, max: 0 }, { min: 0, max: 0 }]; var W = new l(); var V2 = [0, 0, 0, 0, 0, 0, 0, 0]; var G2 = g3; // node_modules/@arcgis/core/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js var t3 = 1e3; function a(t4, a2, e3) { const i3 = R(), m2 = k(i3); return q(m2, m2, t4, 0.5), q(m2, m2, a2, 0.5), i3[3] = x(m2, t4), u(m2, m2, e3), i3; } // node_modules/@arcgis/core/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js var j5 = class { constructor() { this._idToComponent = /* @__PURE__ */ new Map(), this._components = new G2((e3) => e3.bounds), this._edges = new G2((e3) => e3.bounds), this._tmpLineSegment = v(), this._tmpP1 = n2(), this._tmpP2 = n2(), this._tmpP3 = n2(), this.remoteClient = null; } async fetchCandidates(e3, t4) { await Promise.resolve(), f(t4), await this._ensureEdgeLocations(e3, t4); const s4 = []; return this._edges.forEachNeighbor((t5) => (this._addCandidates(e3, t5, s4), s4.length < t3), e3.bounds), { result: { candidates: s4 } }; } async _ensureEdgeLocations(e3, o2) { const n3 = []; if (this._components.forEachNeighbor((e4) => { if (t(e4.info)) { const { id: t4, uid: s4 } = e4; n3.push({ id: t4, uid: s4 }); } return true; }, e3.bounds), !n3.length) return; const i3 = { components: n3 }, r6 = await this.remoteClient.invoke("fetchAllEdgeLocations", i3, i(o2, {})); for (const t4 of r6.components) this._setFetchEdgeLocations(t4); } async add(e3) { const t4 = new E2(e3.id, e3.bounds); return this._idToComponent.set(t4.id, t4), this._components.add([t4]), { result: {} }; } async remove(e3) { const t4 = this._idToComponent.get(e3.id); if (t4) { const e4 = []; this._edges.forEachNeighbor((s4) => (s4.component === t4 && e4.push(s4), true), t4.bounds), this._edges.remove(e4), this._components.remove([t4]), this._idToComponent.delete(t4.id); } return { result: {} }; } _setFetchEdgeLocations(e3) { const s4 = this._idToComponent.get(e3.id); if (t(s4) || e3.uid !== s4.uid) return; const o2 = m.createView(e3.locations), n3 = new Array(o2.count), i3 = n2(), r6 = n2(); for (let t4 = 0; t4 < o2.count; t4++) { o2.position0.getVec(t4, i3), o2.position1.getVec(t4, r6); const d2 = a(i3, r6, e3.origin), c4 = new C2(s4, t4, d2); n3[t4] = c4; } this._edges.add(n3); const { objectIds: c3, origin: a2 } = e3; s4.info = { locations: o2, objectIds: c3, origin: a2 }; } _addCandidates(e3, t4, s4) { const { locations: o2, origin: n3, objectIds: r6 } = t4.component.info, d2 = o2.position0.getVec(t4.index, this._tmpP1), c3 = o2.position1.getVec(t4.index, this._tmpP2); u(d2, d2, n3), u(c3, c3, n3); const a2 = r6[o2.componentIndex.get(t4.index)]; this._addEdgeCandidate(e3, a2, d2, c3, s4), this._addVertexCandidate(e3, a2, d2, s4), this._addVertexCandidate(e3, a2, c3, s4); } _addEdgeCandidate(e3, t4, s4, o2, n3) { if (!(e3.types & q2.EDGE)) return; const i3 = k(e3.bounds), d2 = b(s4, o2, this._tmpLineSegment), a2 = j(d2, i3, this._tmpP3); if (!N(e3.bounds, a2)) return null; n3.push({ type: "edge", objectId: t4, target: t2(a2), distance: x(i3, a2), start: t2(s4), end: t2(o2) }); } _addVertexCandidate(e3, t4, s4, o2) { if (!(e3.types & q2.VERTEX)) return; const n3 = k(e3.bounds); if (!N(e3.bounds, s4)) return null; o2.push({ type: "vertex", objectId: t4, target: t2(s4), distance: x(n3, s4) }); } }; j5 = e([n("esri.views.interactive.snapping.featureSources.sceneLayerSource.SceneLayerSnappingSourceWorker")], j5); var y3 = j5; var E2 = class { constructor(e3, t4) { this.id = e3, this.bounds = t4, this.info = null, this.uid = ++E2.uid; } }; E2.uid = 0; var C2 = class { constructor(e3, t4, s4) { this.component = e3, this.index = t4, this.bounds = s4; } }; export { y3 as default }; //# sourceMappingURL=SceneLayerSnappingSourceWorker-B4FQTD4Q.js.map