import { E, l, l2, t as t2, x } from "./chunk-IDINBHDV.js"; import "./chunk-6LE4RPMZ.js"; import { n as n2 } from "./chunk-67RFR4NT.js"; import "./chunk-WPDBODJM.js"; import "./chunk-5IVP3KUS.js"; import "./chunk-JXYBFGFY.js"; import "./chunk-EPMXCACW.js"; import "./chunk-UCPKJYXN.js"; import "./chunk-KFLNKWNF.js"; import "./chunk-R24MO4IV.js"; import "./chunk-YQBYWPBD.js"; import "./chunk-UWKVAZQ6.js"; import { p as p2 } from "./chunk-XBFCIW4K.js"; import "./chunk-T2SKWJGU.js"; import "./chunk-UO3LS2M5.js"; import "./chunk-H2VOWDMO.js"; import "./chunk-QISOH77W.js"; import "./chunk-4HL6BBWO.js"; import { p } from "./chunk-MDY6FJJE.js"; import "./chunk-KUO7OCMN.js"; import "./chunk-XO5VJRK4.js"; import "./chunk-3WXSWAUV.js"; import "./chunk-27YO3FKC.js"; import { S } from "./chunk-EQNT4A7P.js"; import "./chunk-4OM3EX6P.js"; import "./chunk-3OFVLRSL.js"; import "./chunk-UMUHMVL4.js"; import "./chunk-L5DZVCCW.js"; import "./chunk-WNPL3C7R.js"; import "./chunk-E7ZLMIQ7.js"; import "./chunk-JEA4MMTV.js"; import "./chunk-RG3AHHRL.js"; import "./chunk-XHRNCFJT.js"; import "./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-CC74Y7ET.js"; import "./chunk-TFHLTN6F.js"; import "./chunk-E3G7BRZB.js"; import "./chunk-JKFWEHNK.js"; import "./chunk-EDHROVWI.js"; import "./chunk-3IRT3YKJ.js"; import "./chunk-HKJ7X3BD.js"; import { a, m } from "./chunk-IEU3AM37.js"; import "./chunk-YZVAB3DF.js"; import "./chunk-JLYTER4T.js"; import "./chunk-CRHRHOXH.js"; import "./chunk-ZSW35JPD.js"; import "./chunk-PT62335L.js"; import "./chunk-TJV6ODRM.js"; import "./chunk-4ONPMX2F.js"; import "./chunk-4T5ZGMEN.js"; import "./chunk-2H5MD622.js"; import "./chunk-UVVU4UUO.js"; import "./chunk-X4SA4ELJ.js"; import "./chunk-LU5IJZB4.js"; import "./chunk-7IBV2TRE.js"; import "./chunk-ZLNEXZAN.js"; import "./chunk-5UVJ64RB.js"; import "./chunk-SFEFRQCL.js"; import "./chunk-ZYRIJWLX.js"; import "./chunk-RYY6632W.js"; import "./chunk-DW42UVIT.js"; import "./chunk-YAEIHDJH.js"; import "./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-LBW34VZ2.js"; import "./chunk-GSSTTHIT.js"; import "./chunk-YFSLJIO4.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 "./chunk-6T6G6LCQ.js"; import "./chunk-YEJL5NEF.js"; import { k2 as k } from "./chunk-PQFTYGF5.js"; import { e, n5 as n } from "./chunk-2Z2TG5CU.js"; import "./chunk-6KZ2LTDA.js"; import "./chunk-U2XHEJM7.js"; import "./chunk-SQOPWYIT.js"; import { f as f2, j } from "./chunk-V6P2MAQQ.js"; import "./chunk-E5O6P5I2.js"; import "./chunk-SPWQ3AWG.js"; import "./chunk-2TIUKVZN.js"; import { e as e2, f, o, r, t } from "./chunk-YXWMMD76.js"; import "./chunk-S5KM4IGW.js"; // node_modules/@arcgis/core/views/2d/layers/features/support/ResourceManagerProxy.js var t3 = class { constructor(e3) { this._remoteClient = e3, this._resourceMap = /* @__PURE__ */ new Map(), this._inFlightResourceMap = /* @__PURE__ */ new Map(), this.geometryEngine = null; } destroy() { } async fetchResource(t4, r2) { const s = this._resourceMap, i = s.get(t4); if (i) return i; let n3 = this._inFlightResourceMap.get(t4); if (n3) return n3; try { n3 = this._remoteClient.invoke("tileRenderer.fetchResource", { url: t4 }, { ...r2 }), this._inFlightResourceMap.set(t4, n3), n3.then((e3) => (this._inFlightResourceMap.delete(t4), s.set(t4, e3), e3)); } catch (o2) { return j(o2) ? null : { width: 0, height: 0 }; } return n3; } getResource(e3) { var _a; return (_a = this._resourceMap.get(e3)) != null ? _a : null; } }; // node_modules/@arcgis/core/views/2d/layers/features/processors/SymbolProcessor.js function I(e3, t4) { return (!e3.minScale || e3.minScale >= t4) && (!e3.maxScale || e3.maxScale <= t4); } function M(e3) { const t4 = e3.message, r2 = { message: { data: {}, tileKey: t4.tileKey, tileKeyOrigin: t4.tileKeyOrigin, version: t4.version }, transferList: new Array() }; for (const a2 in t4.data) { const e4 = t4.data[a2]; if (r2.message.data[a2] = null, r(e4)) { const t5 = e4.stride, i = e4.indices.slice(0), o2 = e4.vertices.slice(0), n3 = e4.records.slice(0), l3 = { stride: t5, indices: i, vertices: o2, records: n3, metrics: o(e4.metrics, (e5) => e5.slice(0)) }; r2.transferList.push(i, o2, n3), r2.message.data[a2] = l3; } } return r2; } var v = class extends p { constructor() { super(...arguments), this.type = "symbol", this._matchers = { feature: null, aggregate: null }, this._bufferData = /* @__PURE__ */ new Map(), this._bufferIds = /* @__PURE__ */ new Map(); } initialize() { this.handles.add([this.tileStore.on("update", this.onTileUpdate.bind(this))]), this._resourceManagerProxy = new t3(this.remoteClient); } destroy() { this._resourceManagerProxy.destroy(); } get supportsTileUpdates() { return true; } forEachBufferId(e3) { this._bufferIds.forEach((t4) => { t4.forEach(e3); }); } async update(e3, t4) { const s = t4.schema.processors[0]; if ("symbol" !== s.type) return; const r2 = m(this._schema, s); (a(r2, "mesh") || a(r2, "target")) && (e3.mesh = true, e3.why.mesh.push("Symbology changed"), this._schema = s, this._factory = this._createFactory(s), this._factory.update(s, this.tileStore.tileScheme.tileInfo)); } onTileMessage(e3, t4, s, r2) { return f2(r2), this._onTileData(e3, t4, s, r2); } onTileClear(e3) { const t4 = { clear: true }; return this._bufferData.delete(e3.key.id), this._bufferIds.delete(e3.key.id), this.remoteClient.invoke("tileRenderer.onTileData", { tileKey: e3.id, data: t4 }); } onTileError(e3, t4, s) { const r2 = s.signal, i = { tileKey: e3.id, error: t4 }; return this.remoteClient.invoke("tileRenderer.onTileError", i, { signal: r2 }); } onTileUpdate(e3) { for (const t4 of e3.removed) this._bufferData.has(t4.key.id) && this._bufferData.delete(t4.key.id), this._bufferIds.has(t4.key.id) && this._bufferIds.delete(t4.key.id); for (const t4 of e3.added) this._bufferData.forEach((e4) => { for (const s of e4) s.message.tileKey === t4.id && this._updateTileMesh("append", t4, M(s), [], false, false, null); }); } _addBufferData(e3, t4) { this._bufferData.has(e3) || this._bufferData.set(e3, []), this._bufferData.get(e3).push(M(t4)); } _createFactory(e3) { const { geometryType: t4, objectIdField: r2, fields: i } = this.service, a2 = (e4, t5) => this.remoteClient.invoke("tileRenderer.getMaterialItems", e4, t5), o2 = { geometryType: t4, fields: i, spatialReference: k.fromJSON(this.spatialReference) }, n3 = new x(a2, this.tileStore.tileScheme.tileInfo), { matcher: l3, aggregateMatcher: c } = e3.mesh; return this._store = n3, this._matchers.feature = l2(l3, n3, o2, this._resourceManagerProxy), this._matchers.aggregate = o(c, (e4) => l2(e4, n3, o2, this._resourceManagerProxy)), new l(t4, r2, n3); } async _onTileData(e3, t4, s, a2) { f2(a2); const { type: o2, addOrUpdate: l3, remove: c, clear: d, end: h } = t4, f3 = !!this._schema.mesh.sortKey; if (!l3) { const t5 = { type: o2, addOrUpdate: null, remove: c, clear: d, end: h, sort: f3 }; return this.remoteClient.invoke("tileRenderer.onTileData", { tileKey: e3.id, data: t5 }, a2); } const m2 = this._processFeatures(e3, l3, s, a2, t4.status.version); try { const s2 = await m2; if (t(s2)) { const t5 = { type: o2, addOrUpdate: null, remove: c, clear: d, end: h, sort: f3 }; return this.remoteClient.invoke("tileRenderer.onTileData", { tileKey: e3.id, data: t5 }, a2); } const n3 = []; for (const t5 of s2) { let s3 = false; const r2 = t5.message.bufferIds, a3 = e3.key.id, o3 = t5.message.tileKey; if (a3 !== o3 && r(r2)) { if (!this.tileStore.get(o3)) { this._addBufferData(a3, t5), n3.push(t5); continue; } let e4 = this._bufferIds.get(o3); e4 || (e4 = /* @__PURE__ */ new Set(), this._bufferIds.set(o3, e4)); const i = Array.from(r2); for (const t6 of i) { if (e4.has(t6)) { s3 = true; break; } e4.add(t6); } } s3 || (this._addBufferData(a3, t5), n3.push(t5)); } await Promise.all(n3.map((s3) => { const r2 = e3.key.id === s3.message.tileKey, i = r2 ? t4.remove : [], n4 = r2 && t4.end; return this._updateTileMesh(o2, e3, s3, i, n4, t4.clear, a2.signal); })); } catch (u) { this._handleError(e3, u, a2); } } async _updateTileMesh(e3, t4, r2, i, a2, l3, c) { const d = e3, h = r2.message.tileKey, f3 = !!this._schema.mesh.sortKey; h !== t4.key.id && (a2 = false); const m2 = o(r2, (e4) => e4.message), u = o(r2, (e4) => e4.transferList) || [], g = { type: d, addOrUpdate: m2, remove: i, clear: l3, end: a2, sort: f3 }, p3 = { transferList: e2(u) || [], signal: c }; return f2(p3), this.remoteClient.invoke("tileRenderer.onTileData", { tileKey: h, data: g }, p3); } async _processFeatures(e3, t4, s, i, a2) { if (t(t4) || !t4.hasFeatures) return null; const o2 = { transform: e3.transform, hasZ: false, hasM: false }, l3 = this._factory, c = { viewingMode: "", scale: e3.scale }, d = await this._matchers.feature, h = await this._matchers.aggregate; f2(i); const f3 = this._getLabelInfos(e3, t4); return await l3.analyze(t4.getCursor(), this._resourceManagerProxy, d, h, o2, c), f2(i), this._writeFeatureSet(e3, t4, o2, f3, l3, s, a2); } _writeFeatureSet(e3, t4, s, r2, a2, o2, n3) { const l3 = t4.getSize(), c = this._schema.mesh.matcher.symbologyType, d = new E(e3.key.id, { features: l3, records: l3, metrics: 0 }, c, o2, c !== S.HEATMAP, n3), h = { viewingMode: "", scale: e3.scale }, f3 = t4.getCursor(); for (; f3.next(); ) try { const t5 = f3.getDisplayId(), o3 = r(r2) ? r2.get(t5) : null; a2.writeCursor(d, f3, s, h, e3.level, o3, this._resourceManagerProxy); } catch (p3) { } const m2 = e3.tileInfoView.tileInfo.isWrappable; return d.serialize(m2); } _handleError(e3, t4, s) { if (!j(t4)) { const r2 = { tileKey: e3.id, error: t4.message }; return this.remoteClient.invoke("tileRenderer.onTileError", r2, { signal: s.signal }); } } _getLabelingSchemaForScale(e3) { const t4 = this._schema.mesh.labels; if (t(t4)) return null; if ("subtype" === t4.type) { const s2 = { type: "subtype", classes: {} }; let r2 = false; for (const i in t4.classes) { const a2 = t4.classes[i].filter((t5) => I(t5, e3.scale)); r2 = r2 || !!a2.length, s2.classes[i] = a2; } return r2 ? s2 : null; } const s = t4.classes.filter((t5) => I(t5, e3.scale)); return s.length ? { type: "simple", classes: s } : null; } _getLabels(e3, t4) { var _a; if ("subtype" === t4.type) { const s = this.service.subtypeField, r2 = f(s, "Expected to find subtype Field"), i = e3.readAttribute(r2); return null == i ? [] : (_a = t4.classes[i]) != null ? _a : []; } return t4.classes; } _getLabelInfos(e3, s) { const i = this._getLabelingSchemaForScale(e3); if (t(i)) return null; const a2 = /* @__PURE__ */ new Map(), o2 = s.getCursor(); for (; o2.next(); ) { const e4 = o2.getDisplayId(), s2 = [], r2 = p2(e4), n3 = r2 && 1 !== o2.readAttribute("cluster_count") ? "aggregate" : "feature", l3 = this._getLabels(o2, i); for (const i2 of l3) { if (i2.target !== n3) continue; const a3 = o2.getStorage(), l4 = r2 && "feature" === n3 ? a3.getComputedStringAtIndex(o2.readAttribute("referenceId"), i2.fieldIndex) : a3.getComputedStringAtIndex(e4, i2.fieldIndex); if (!l4) continue; const c = n2(l4.toString()), d = c[0], h = c[1]; this._store.getMosaicItem(i2.symbol, t2(d)).then((e5) => { s2[i2.index] = { glyphs: e5.glyphMosaicItems, rtl: h, index: i2.index }; }); } a2.set(e4, s2); } return a2; } }; v = e([n("esri.views.2d.layers.features.processors.SymbolProcessor")], v); var T = v; export { T as default }; //# sourceMappingURL=SymbolProcessor-QR2MTX2K.js.map