import { a as a3 } from "./chunk-B5WNDDCF.js"; import { n3 as n5, o as o3 } from "./chunk-264YGWEE.js"; import { u as u2, y as y3 } from "./chunk-KUAEOLV3.js"; import { r as r8 } from "./chunk-ZLQP3WDC.js"; import "./chunk-JBMHQ5RK.js"; import { E as E2, a as a2 } from "./chunk-WBWQJQK4.js"; import { r as r7 } from "./chunk-A22ACVMF.js"; import "./chunk-TDS6IBMU.js"; import "./chunk-DBT4KOKX.js"; import "./chunk-2GP5D74I.js"; import "./chunk-EPMXCACW.js"; import "./chunk-UWKVAZQ6.js"; import "./chunk-T2SKWJGU.js"; import "./chunk-UO3LS2M5.js"; import { E, n as n3 } from "./chunk-H2VOWDMO.js"; import "./chunk-QISOH77W.js"; import "./chunk-XO5VJRK4.js"; import "./chunk-3WXSWAUV.js"; import "./chunk-27YO3FKC.js"; import { I } from "./chunk-EQNT4A7P.js"; import "./chunk-4OM3EX6P.js"; import { D, F, G, L, P } from "./chunk-3OFVLRSL.js"; import { e as e3 } from "./chunk-GHN7C53L.js"; import { mt } from "./chunk-PTEMIS7J.js"; import { e as e4 } from "./chunk-IQBIGNPU.js"; import "./chunk-AJFR3FGC.js"; import { n as n4 } from "./chunk-K7B6OWCU.js"; import "./chunk-L5DZVCCW.js"; import { r as r6 } from "./chunk-WNPL3C7R.js"; import { y as y2 } from "./chunk-E7ZLMIQ7.js"; import "./chunk-RG3AHHRL.js"; import { t as t2 } from "./chunk-UDYHZLTE.js"; import "./chunk-QC7NCR5N.js"; import "./chunk-VQXMCZYH.js"; import "./chunk-JQUWFKNU.js"; import "./chunk-RWQH5X3O.js"; import "./chunk-6334AFGG.js"; import "./chunk-TFHLTN6F.js"; import { M, c as c4, f as f2, h as h2, i, o as o2, r as r5, s as s4 } from "./chunk-O3JQY77G.js"; import { r as r4 } from "./chunk-E3G7BRZB.js"; import "./chunk-JKFWEHNK.js"; import { un } from "./chunk-P24XEEHY.js"; import { U } from "./chunk-WOXHUQGM.js"; import "./chunk-FMPQIGFA.js"; import "./chunk-EDHROVWI.js"; import "./chunk-3IRT3YKJ.js"; import "./chunk-SAJAEMIJ.js"; import "./chunk-JOYXMSKE.js"; import "./chunk-YZVAB3DF.js"; import "./chunk-PJNBFKPF.js"; import "./chunk-C7742RNZ.js"; import { a, f, h, l } from "./chunk-TJV6ODRM.js"; import "./chunk-3WQOA5CB.js"; import "./chunk-FZQZIM7U.js"; import "./chunk-CZBRZ6SU.js"; import "./chunk-VGWC3IKZ.js"; import { c as c2, u } from "./chunk-2H5MD622.js"; import "./chunk-3RSFVUKZ.js"; import { c as c3 } from "./chunk-UVVU4UUO.js"; import "./chunk-X4SA4ELJ.js"; import "./chunk-ZAY3CMAZ.js"; import "./chunk-ZLNEXZAN.js"; import "./chunk-3GZSQU56.js"; import "./chunk-ZYRIJWLX.js"; import { c } from "./chunk-RYY6632W.js"; import { S, o } from "./chunk-DW42UVIT.js"; import "./chunk-YAEIHDJH.js"; import { n as n2 } from "./chunk-TJNOJH33.js"; import "./chunk-OSHI574D.js"; import "./chunk-ETGAZ7LF.js"; import "./chunk-75U5LM2V.js"; import "./chunk-RMDDCMKS.js"; import { v2 as v } from "./chunk-VCH45Q2I.js"; import { j as j2 } from "./chunk-LBW34VZ2.js"; import "./chunk-GSSTTHIT.js"; import "./chunk-IM3LVQXV.js"; import "./chunk-55RWC67C.js"; import "./chunk-HZRKBTHJ.js"; import "./chunk-DVUG3KID.js"; import "./chunk-FWSQEIAR.js"; import "./chunk-VEGAOVMY.js"; import { s2 as s3, w2 as w } from "./chunk-6T6G6LCQ.js"; import "./chunk-YEJL5NEF.js"; import { R } from "./chunk-PQFTYGF5.js"; import { e, m, n5 as n, y3 as y } from "./chunk-2Z2TG5CU.js"; import "./chunk-6KZ2LTDA.js"; import "./chunk-U2XHEJM7.js"; import { r as r3 } from "./chunk-SQOPWYIT.js"; import { j, r2 } from "./chunk-V6P2MAQQ.js"; import { s2 as s, s3 as s2 } from "./chunk-E5O6P5I2.js"; import "./chunk-SPWQ3AWG.js"; import "./chunk-2TIUKVZN.js"; import { e as e2, r, t } from "./chunk-YXWMMD76.js"; import "./chunk-S5KM4IGW.js"; // node_modules/@arcgis/core/layers/support/mediaUtils.js var a4 = class extends m { constructor(o4) { super(o4); } get bounds() { const o4 = this.coords; return t(o4) || t(o4.extent) ? null : c2(o4.extent); } get coords() { var _a; const o4 = (_a = e2(this.element.georeference)) == null ? void 0 : _a.coords; return un(o4, this.spatialReference).geometry; } get normalizedCoords() { return v.fromJSON(a3(this.coords)); } get normalizedBounds() { const o4 = r(this.normalizedCoords) ? this.normalizedCoords.extent : null; return r(o4) ? c2(o4) : null; } }; e([y()], a4.prototype, "spatialReference", void 0), e([y()], a4.prototype, "element", void 0), e([y()], a4.prototype, "bounds", null), e([y()], a4.prototype, "coords", null), e([y()], a4.prototype, "normalizedCoords", null), e([y()], a4.prototype, "normalizedBounds", null), a4 = e([n("esri.layers.support.media.MediaElementView")], a4); // node_modules/@arcgis/core/core/perspectiveUtils.js var f3 = n2(); var i2 = e3(); var e5 = e3(); var p = e3(); function j3(s5, n6, o4) { return k(e5, n6[0], n6[1], n6[2], n6[3], n6[4], n6[5], n6[6], n6[7]), k(p, o4[0], o4[1], o4[2], o4[3], o4[4], o4[5], o4[6], o4[7]), i(s5, c4(e5, e5), p); } function k(o4, c5, u3, e6, p2, h3, j5, k2, v2) { s4(o4, c5, e6, h3, u3, p2, j5, 1, 1, 1), o(f3, k2, v2, 1), c4(i2, o4); const [x, b2, d] = S(f3, f3, o2(i2, i2)); return s4(i2, x, 0, 0, 0, b2, 0, 0, 0, d), i(o4, i2, o4); } // node_modules/@arcgis/core/views/2d/engine/webgl/Overlay.js var b = e3(); var V = class extends r8 { constructor(s5) { super(), this.elementView = s5, this.isWrapAround = false, this.perspectiveTransform = n4(), this._vertices = new Float32Array(20), this._handles = [], this._handles.push(l(() => this.elementView.element.opacity, (e6) => this.opacity = e6, h), l(() => [this.elementView.coords], () => { this.requestRender(); }, h), f(() => this.elementView.element.loaded, () => { const e6 = this.elementView.element; this.ready(), "video" === e6.type && r(e6.content) && this._handles.push(r2(e6.content, "play", () => this.requestRender())); }, h)), s5.element.load().catch((t3) => { s.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new s2("element-load-error", "Element cannot be displayed", { element: s5, error: t3 })); }); } destroy() { var _a; this._handles.forEach((e6) => e6.remove()), (_a = this.texture) == null ? void 0 : _a.dispose(), this.texture = null; } get dvsMat3() { return this.parent.dvsMat3; } beforeRender(e6) { const { context: t3 } = e6, r9 = this.elementView.element.content; if (r(r9)) { const e7 = r9 instanceof HTMLImageElement, i3 = r9 instanceof HTMLVideoElement, o4 = e7 ? r9.naturalWidth : i3 ? r9.videoWidth : r9.width, n6 = e7 ? r9.naturalHeight : i3 ? r9.videoHeight : r9.height; this._updatePerspectiveTransform(o4, n6), this.texture ? i3 && !r9.paused && (this.texture.setData(r9), this.requestRender(), (n3(t3.gl) || c(o4) && c(n6)) && this.texture.generateMipmap()) : (this.texture = new E(t3, { pixelFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, samplingMode: L.LINEAR, wrapMode: D.CLAMP_TO_EDGE, width: o4, height: n6, preMultiplyAlpha: true }, r9), (n3(t3.gl) || c(o4) && c(n6)) && this.texture.generateMipmap(), i3 && !r9.paused && this.requestRender()); } super.beforeRender(e6); } _createTransforms() { return null; } updateDrawCoords(e6, t3) { const r9 = this.elementView.coords; if (t(r9)) return; const [s5, i3, n6, a5] = r9.rings[0], m2 = this._vertices, { x: h3, y: c5 } = e6, l2 = 0 !== t3; l2 ? m2.set([i3[0] - h3, i3[1] - c5, s5[0] - h3, s5[1] - c5, n6[0] - h3, n6[1] - c5, a5[0] - h3, a5[1] - c5, a5[0] - h3, a5[1] - c5, i3[0] + t3 - h3, i3[1] - c5, i3[0] + t3 - h3, i3[1] - c5, s5[0] + t3 - h3, s5[1] - c5, n6[0] + t3 - h3, n6[1] - c5, a5[0] + t3 - h3, a5[1] - c5]) : m2.set([i3[0] - h3, i3[1] - c5, s5[0] - h3, s5[1] - c5, n6[0] - h3, n6[1] - c5, a5[0] - h3, a5[1] - c5]), this.isWrapAround = l2; } getVAO(e6, t3, r9) { if (t(this.elementView.coords)) return null; const s5 = this._vertices; if (this._vao) this._geometryVbo.setData(s5); else { this._geometryVbo = E2.createVertex(e6, F.DYNAMIC_DRAW, s5); const i3 = E2.createVertex(e6, F.STATIC_DRAW, new Uint16Array([0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1])); this._vao = new a2(e6, r9, t3, { geometry: this._geometryVbo, tex: i3 }); } return this._vao; } _updatePerspectiveTransform(e6, t3) { const r9 = this._vertices; j3(b, [0, 0, e6, 0, 0, t3, e6, t3], [r9[0], r9[1], r9[4], r9[5], r9[2], r9[3], r9[6], r9[7]]), r4(this.perspectiveTransform, b[6] / b[8] * e6, b[7] / b[8] * t3); } }; // node_modules/@arcgis/core/views/2d/engine/webgl/OverlayContainer.js var M2 = class extends o3 { constructor() { super(...arguments), this._localOrigin = c3(0, 0), this._viewStateId = -1, this._dvsMat3 = e4(), this.requiresDedicatedFBO = false; } get dvsMat3() { return this._dvsMat3; } beforeRender(t3) { this._updateMatrices(t3), this._updateOverlays(t3, this.children); for (const e6 of this.children) e6.beforeRender(t3); } prepareRenderPasses(t3) { const e6 = t3.registerRenderPass({ name: "overlay", brushes: [n5.overlay], target: () => this.children, drawPhase: I.MAP }); return [...super.prepareRenderPasses(t3), e6]; } _updateMatrices(t3) { const { state: e6 } = t3, { id: n6, size: h3, pixelRatio: l2, resolution: m2, rotation: f4, viewpoint: u3, displayMat3: M3 } = e6; if (this._viewStateId === n6) return; const v2 = Math.PI / 180 * f4, _ = l2 * h3[0], w3 = l2 * h3[1], { x: y4, y: g } = u3.targetGeometry, j5 = U(y4, e6.spatialReference); this._localOrigin.x = j5, this._localOrigin.y = g; const b2 = m2 * _, R3 = m2 * w3, O = r5(this._dvsMat3); i(O, O, M3), M(O, O, t2(_ / 2, w3 / 2)), f2(O, O, r7(_ / b2, -w3 / R3, 1)), h2(O, O, -v2), this._viewStateId = n6; } _updateOverlays(e6, s5) { const { state: r9 } = e6, { rotation: o4, spatialReference: a5, worldScreenWidth: i3, size: n6, viewpoint: c5 } = r9, p2 = this._localOrigin; let d = 0; if (a5.isWrappable) { const e7 = n6[0], m2 = n6[1], f4 = 180 / Math.PI * o4, u3 = Math.abs(Math.cos(f4)), M3 = Math.abs(Math.sin(f4)), v2 = Math.round(e7 * u3 + m2 * M3), [_, w3] = R(a5).valid, y4 = mt(a5), { x: g, y: j5 } = c5.targetGeometry, b2 = [g, j5], R3 = [0, 0]; r9.toScreen(R3, b2); const O = [0, 0]; let P2; P2 = v2 > i3 ? 0.5 * i3 : 0.5 * v2; const x = Math.floor((g + 0.5 * y4) / y4), C = _ + x * y4, D2 = w3 + x * y4, I2 = [R3[0] + P2, 0]; r9.toMap(O, I2), O[0] > D2 && (d = y4), I2[0] = R3[0] - P2, r9.toMap(O, I2), O[0] < C && (d = -y4); for (const r10 of s5) { const e8 = r10.elementView.bounds; if (t(e8)) continue; const [s6, , o5] = e8; s6 < _ && o5 > _ ? r10.updateDrawCoords(p2, y4) : o5 > w3 && s6 < w3 ? r10.updateDrawCoords(p2, -y4) : r10.updateDrawCoords(p2, d); } } else for (const t3 of s5) t3.updateDrawCoords(p2, d); } }; // node_modules/@arcgis/core/views/2d/layers/MediaLayerView2D.js var j4 = class extends y3(u2) { constructor() { super(...arguments), this._overlayContainer = null, this._fetchQueue = null, this._tileStrategy = null, this._elementReferences = /* @__PURE__ */ new Map(), this.layer = null, this.elements = new j2(); } attach() { this.handles.add(a(() => this.layer.source, "refresh", () => { for (const e6 of this._tileStrategy.tiles) this._updateTile(e6); this.requestUpdate(); })), this._overlayContainer = new M2(), this.container.addChild(this._overlayContainer), this._fetchQueue = new y2({ tileInfoView: this.view.featuresTilingScheme, concurrency: 10, process: (e6, t3) => this._queryElements(e6, t3) }), this._tileStrategy = new r6({ cachePolicy: "purge", resampling: true, acquireTile: (e6) => this._acquireTile(e6), releaseTile: (e6) => this._releaseTile(e6), tileInfoView: this.view.featuresTilingScheme }), this.requestUpdate(); } detach() { this.handles.removeAll(), this.elements.removeAll(), this._tileStrategy.destroy(), this._fetchQueue.destroy(), this._overlayContainer.removeAllChildren(), this.container.removeAllChildren(), this._elementReferences.clear(); } supportsSpatialReference(e6) { return true; } moveStart() { this.requestUpdate(); } viewChange() { this.requestUpdate(); } moveEnd() { this.requestUpdate(); } update(e6) { this._tileStrategy.update(e6); } async hitTest(e6, t3) { const s5 = [], r9 = e6.normalize(), o4 = [r9.x, r9.y]; for (const { projectedElement: { normalizedCoords: l2, element: n6 } } of this._elementReferences.values()) r(l2) && s3(l2.rings, o4) && s5.push({ type: "media", element: n6, layer: this.layer, mapPoint: e6 }); return s5.reverse(); } canResume() { return null != this.layer.source && super.canResume(); } async doRefresh() { } _acquireTile(e6) { const t3 = new T(e6.clone()); return this._updateTile(t3), t3; } _updateTile(e6) { this.updatingHandles.addPromise(this._fetchQueue.push(e6.key).then((t3) => { const [s5, r9] = e6.setElements(t3); this._acquireElements(e6, s5), this._releaseElements(e6, r9), this.requestUpdate(); }, (e7) => { j(e7) || s.getLogger(this.declaredClass).error(e7); })); } _releaseTile(e6) { this._fetchQueue.abort(e6.key.id), e6.elements && this._releaseElements(e6, e6.elements), this.requestUpdate(); } async _queryElements(e6, t3) { const s5 = this.layer.source; if (t(s5)) return []; this.view.featuresTilingScheme.getTileBounds(w2, e6, true); const r9 = new w({ xmin: w2[0], ymin: w2[1], xmax: w2[2], ymax: w2[3], spatialReference: this.view.spatialReference }); return s5.queryElements(r9, t3); } _acquireElements(e6, t3) { const s5 = this.layer.source, i3 = this.view.spatialReference; if (!t(s5)) for (const o4 of t3) { r3(this._elementReferences, o4.uid, () => { const e7 = new a4({ element: o4, spatialReference: i3 }), t4 = new V(e7); return this._overlayContainer.addChild(t4), this.elements.add(o4), { tiles: /* @__PURE__ */ new Set(), projectedElement: e7, overlay: t4 }; }).tiles.add(e6); } } _releaseElements(e6, t3) { for (const s5 of t3) { const t4 = this._elementReferences.get(s5.uid); t4.tiles.delete(e6), t4.tiles.size || (this._overlayContainer.removeChild(t4.overlay), t4.overlay.destroy(), t4.projectedElement.destroy(), this._elementReferences.delete(s5.uid), this.elements.remove(s5)); } } }; e([y()], j4.prototype, "_fetchQueue", void 0), e([y()], j4.prototype, "layer", void 0), e([y({ readOnly: true })], j4.prototype, "elements", void 0), j4 = e([n("esri.views.2d.layers.MediaLayerView2D")], j4); var w2 = u(); var T = class { constructor(e6) { this.key = e6, this.elements = null, this.isReady = false, this.visible = true; } setElements(e6) { const t3 = [], s5 = new Set(this.elements); this.elements = e6; for (const r9 of e6) s5.has(r9) ? s5.delete(r9) : t3.push(r9); return this.isReady = true, [t3, Array.from(s5)]; } }; var R2 = j4; export { R2 as default }; //# sourceMappingURL=MediaLayerView2D-73NJY27X.js.map