import { l } from "./chunk-A6WD5XTM.js"; import "./chunk-OP2HNSVZ.js"; import { c } from "./chunk-AOQ55JXI.js"; import { n as n4, p as p3 } from "./chunk-X42TFXOU.js"; import "./chunk-JFSMKLAQ.js"; import "./chunk-LXOC7SMQ.js"; import { s as s3 } from "./chunk-DN6W4TJU.js"; import { u } from "./chunk-OUUXJOLT.js"; import "./chunk-NBKUI76A.js"; import "./chunk-6334AFGG.js"; import { x as x3 } from "./chunk-NLLFSKB2.js"; import "./chunk-S6EFEKAU.js"; import { a } from "./chunk-XEQ4FTFC.js"; import "./chunk-JM5OVQAD.js"; import { n as n5 } from "./chunk-NQA5XJGK.js"; import { p as p4 } from "./chunk-EKYSPJO6.js"; import { i as i2, j2 } from "./chunk-JAUFBT5U.js"; import { o } from "./chunk-W6U6FKJ3.js"; import { p as p5 } from "./chunk-7C2KDOAI.js"; import { n as n3, p2 } from "./chunk-RHFU6KWO.js"; import "./chunk-3FNKD2EB.js"; import "./chunk-ZOO4I2U4.js"; import "./chunk-JPUFJK2B.js"; import "./chunk-HZ2WKB3G.js"; import "./chunk-3HCJD762.js"; import "./chunk-RVCE264D.js"; import "./chunk-HKJ7X3BD.js"; import "./chunk-Y74D3LKQ.js"; import "./chunk-PK4W65H4.js"; import "./chunk-7C23ILQ4.js"; import { k as k2 } from "./chunk-P6VVVEX6.js"; import "./chunk-3Z755LKF.js"; import "./chunk-LTZ5XXDV.js"; import "./chunk-IEU3AM37.js"; import "./chunk-SKKBVHTF.js"; import "./chunk-DLMAGHHC.js"; import { x as x2 } from "./chunk-WD4J43GZ.js"; import "./chunk-JOYXMSKE.js"; import "./chunk-JLYTER4T.js"; import "./chunk-CRHRHOXH.js"; import "./chunk-ZSW35JPD.js"; import "./chunk-JLSNMUQJ.js"; import "./chunk-ECY35CJI.js"; import "./chunk-PT62335L.js"; import { y as y2 } from "./chunk-JGBXYDGB.js"; import "./chunk-QEWF7QPH.js"; import "./chunk-PJNBFKPF.js"; import "./chunk-C7742RNZ.js"; import "./chunk-FNA5GLRW.js"; import "./chunk-MCWCB5IY.js"; import "./chunk-TV3CFJQR.js"; import "./chunk-TJV6ODRM.js"; import { v as v2 } from "./chunk-JUWKPBLS.js"; import { c as c3 } from "./chunk-WLSB4F4I.js"; import { c as c2, d, f, j as j3, l as l2, m as m2, p as p6, w as w3 } from "./chunk-GLSWDDR3.js"; import { O } from "./chunk-MIQGEDET.js"; import "./chunk-DUEMJ5XS.js"; import "./chunk-VRLXUHP2.js"; import "./chunk-3LVSQLWJ.js"; import "./chunk-4ONPMX2F.js"; import { F, x as x4 } from "./chunk-CRGY2SDS.js"; import "./chunk-4T5ZGMEN.js"; import { p } from "./chunk-GN35O2ZO.js"; import { n as n2 } from "./chunk-XTVKPAWY.js"; import "./chunk-3OSQ6GXO.js"; import "./chunk-3WQOA5CB.js"; import { t as t2 } from "./chunk-PLWDAYK7.js"; import "./chunk-FZQZIM7U.js"; import "./chunk-CZBRZ6SU.js"; import "./chunk-VGWC3IKZ.js"; import "./chunk-2H5MD622.js"; import "./chunk-3RSFVUKZ.js"; import "./chunk-UVVU4UUO.js"; import "./chunk-HWSWTWZD.js"; import "./chunk-O6VYMEIX.js"; import "./chunk-X4SA4ELJ.js"; import "./chunk-5N7JLUJJ.js"; import "./chunk-ZAY3CMAZ.js"; import "./chunk-P3XKUGLS.js"; import "./chunk-2ZSOO377.js"; import "./chunk-YUA3AHKR.js"; import "./chunk-LU5IJZB4.js"; import "./chunk-7IBV2TRE.js"; import "./chunk-ZLNEXZAN.js"; import "./chunk-5UVJ64RB.js"; import "./chunk-SFEFRQCL.js"; import { b } from "./chunk-DXVOOCG4.js"; import "./chunk-3GZSQU56.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 { i } from "./chunk-75U5LM2V.js"; import "./chunk-RMDDCMKS.js"; import { v2 as v } from "./chunk-VCH45Q2I.js"; import "./chunk-LBW34VZ2.js"; import "./chunk-GSSTTHIT.js"; import { m } from "./chunk-YFSLJIO4.js"; import "./chunk-IM3LVQXV.js"; import "./chunk-55RWC67C.js"; import "./chunk-HZRKBTHJ.js"; import "./chunk-DVUG3KID.js"; import "./chunk-FWSQEIAR.js"; import { j } from "./chunk-VEGAOVMY.js"; import { w2 } from "./chunk-6T6G6LCQ.js"; import "./chunk-YEJL5NEF.js"; import { k2 as k } from "./chunk-PQFTYGF5.js"; import { e, n5 as n, y3 as y } from "./chunk-2Z2TG5CU.js"; import "./chunk-6KZ2LTDA.js"; import "./chunk-U2XHEJM7.js"; import "./chunk-SQOPWYIT.js"; import { w, x } from "./chunk-V6P2MAQQ.js"; import { s2 as s, s3 as s2 } from "./chunk-E5O6P5I2.js"; import { has } from "./chunk-SPWQ3AWG.js"; import "./chunk-2TIUKVZN.js"; import { r, t } from "./chunk-YXWMMD76.js"; import "./chunk-S5KM4IGW.js"; // node_modules/@arcgis/core/layers/graphics/sources/GeoJSONSource.js var y3 = "esri.layers.graphics.sources.GeoJSONSource"; var f2 = s.getLogger(y3); var g = class extends m { constructor() { super(...arguments), this.type = "geojson", this.refresh = x(async (e2) => { await this.load(); const { extent: t3, timeExtent: r2 } = await this._connection.invoke("refresh", e2); return this.sourceJSON.extent = t3, r2 && (this.sourceJSON.timeInfo.timeExtent = [r2.start, r2.end]), { dataChanged: true, updates: { extent: this.sourceJSON.extent, timeInfo: this.sourceJSON.timeInfo } }; }); } load(e2) { const t3 = r(e2) ? e2.signal : null; return this.addResolvingPromise(this._startWorker(t3)), Promise.resolve(this); } destroy() { var _a; (_a = this._connection) == null ? void 0 : _a.close(), this._connection = null; } applyEdits(e2) { return this.load().then(() => this._applyEdits(e2)); } openPorts() { return this.load().then(() => this._connection.openPorts()); } queryFeatures(e2, t3 = {}) { return this.load(t3).then(() => this._connection.invoke("queryFeatures", e2 ? e2.toJSON() : null, t3)).then((e3) => x3.fromJSON(e3)); } queryFeaturesJSON(e2, t3 = {}) { return this.load(t3).then(() => this._connection.invoke("queryFeatures", e2 ? e2.toJSON() : null, t3)); } queryFeatureCount(e2, t3 = {}) { return this.load(t3).then(() => this._connection.invoke("queryFeatureCount", e2 ? e2.toJSON() : null, t3)); } queryObjectIds(e2, t3 = {}) { return this.load(t3).then(() => this._connection.invoke("queryObjectIds", e2 ? e2.toJSON() : null, t3)); } queryExtent(e2, t3 = {}) { return this.load(t3).then(() => this._connection.invoke("queryExtent", e2 ? e2.toJSON() : null, t3)).then((e3) => ({ count: e3.count, extent: w2.fromJSON(e3.extent) })); } querySnapping(e2, t3 = {}) { return this.load(t3).then(() => this._connection.invoke("querySnapping", e2, t3)); } _applyEdits(e2) { if (!this._connection) throw new s2("geojson-layer-source:edit-failure", "Memory source not loaded"); const r2 = this.layer.objectIdField, o2 = [], s4 = [], i3 = []; if (e2.addFeatures) for (const t3 of e2.addFeatures) o2.push(this._serializeFeature(t3)); if (e2.deleteFeatures) for (const t3 of e2.deleteFeatures) "objectId" in t3 && null != t3.objectId ? s4.push(t3.objectId) : "attributes" in t3 && null != t3.attributes[r2] && s4.push(t3.attributes[r2]); if (e2.updateFeatures) for (const t3 of e2.updateFeatures) i3.push(this._serializeFeature(t3)); return this._connection.invoke("applyEdits", { adds: o2, updates: i3, deletes: s4 }).then(({ extent: e3, timeExtent: t3, featureEditResults: r3 }) => (this.sourceJSON.extent = e3, t3 && (this.sourceJSON.timeInfo.timeExtent = [t3.start, t3.end]), this._createEditsResult(r3))); } _createEditsResult(e2) { return { addFeatureResults: e2.addResults ? e2.addResults.map(this._createFeatureEditResult, this) : [], updateFeatureResults: e2.updateResults ? e2.updateResults.map(this._createFeatureEditResult, this) : [], deleteFeatureResults: e2.deleteResults ? e2.deleteResults.map(this._createFeatureEditResult, this) : [], addAttachmentResults: [], updateAttachmentResults: [], deleteAttachmentResults: [] }; } _createFeatureEditResult(e2) { const r2 = true === e2.success ? null : e2.error || { code: void 0, description: void 0 }; return { objectId: e2.objectId, globalId: e2.globalId, error: r2 ? new s2("geojson-layer-source:edit-failure", r2.description, { code: r2.code }) : null }; } _serializeFeature(e2) { const { attributes: t3 } = e2, r2 = this._geometryForSerialization(e2); return r2 ? { geometry: r2.toJSON(), attributes: t3 } : { attributes: t3 }; } _geometryForSerialization(e2) { const { geometry: t3 } = e2; return t(t3) ? null : "mesh" === t3.type || "extent" === t3.type ? v.fromExtent(t3.extent) : t3; } async _startWorker(e2) { this._connection = await u("GeoJSONSourceWorker", { strategy: has("feature-layers-workers") ? "dedicated" : "local", signal: e2 }); const { fields: t3, spatialReference: r2, hasZ: o2, geometryType: s4, objectIdField: i3, url: n6, timeInfo: u2, customParameters: l3 } = this.layer, d2 = "defaults" === this.layer.originOf("spatialReference"), p7 = { url: n6, customParameters: l3, fields: t3 && t3.map((e3) => e3.toJSON()), geometryType: i.toJSON(s4), hasZ: o2, objectIdField: i3, timeInfo: u2 ? u2.toJSON() : null, spatialReference: d2 ? null : r2 && r2.toJSON() }, h = await this._connection.invoke("load", p7, { signal: e2 }); for (const a2 of h.warnings) f2.warn(a2.message, { layer: this.layer, warning: a2 }); h.featureErrors.length && f2.warn(`Encountered ${h.featureErrors.length} validation errors while loading features`, h.featureErrors), this.sourceJSON = h.layerDefinition, this.capabilities = l(this.sourceJSON.hasZ, true); } }; e([y()], g.prototype, "capabilities", void 0), e([y()], g.prototype, "type", void 0), e([y({ constructOnly: true })], g.prototype, "layer", void 0), e([y()], g.prototype, "sourceJSON", void 0), g = e([n(y3)], g); // node_modules/@arcgis/core/layers/GeoJSONLayer.js var Z = s3(); var M = class extends c(o(n4(p3(n2(a(t2(p(c3(v2(O(b))))))))))) { constructor(e2) { super(e2), this.copyright = null, this.definitionExpression = null, this.displayField = null, this.editingEnabled = false, this.elevationInfo = null, this.fields = null, this.fieldsIndex = null, this.fullExtent = null, this.geometryType = null, this.hasZ = void 0, this.labelsVisible = true, this.labelingInfo = null, this.legendEnabled = true, this.objectIdField = null, this.operationalLayerType = "GeoJSON", this.popupEnabled = true, this.popupTemplate = null, this.screenSizePerspectiveEnabled = true, this.source = new g({ layer: this }), this.spatialReference = k.WGS84, this.templates = null, this.title = "GeoJSON", this.type = "geojson", this.typeIdField = null, this.types = null; } destroy() { var _a; (_a = this.source) == null ? void 0 : _a.destroy(); } load(e2) { const t3 = this.loadFromPortal({ supportedTypes: ["GeoJson"], supportsData: false }, e2).catch(w).then(() => this.source.load(e2)).then(() => { this.read(this.source.sourceJSON, { origin: "service", url: this.parsedUrl }), this.revert(["objectIdField", "fields", "timeInfo"], "service"), F(this.renderer, this.fieldsIndex), x4(this.timeInfo, this.fieldsIndex); }); return this.addResolvingPromise(t3), Promise.resolve(this); } get capabilities() { return this.source ? this.source.capabilities : null; } get createQueryVersion() { return this.commitProperty("definitionExpression"), this.commitProperty("timeExtent"), this.commitProperty("timeOffset"), this.commitProperty("geometryType"), this.commitProperty("capabilities"), (this._get("createQueryVersion") || 0) + 1; } get defaultPopupTemplate() { return this.createPopupTemplate(); } get isTable() { return this.loaded && null == this.geometryType; } get parsedUrl() { return this.url ? j(this.url) : null; } set renderer(e2) { F(e2, this.fieldsIndex), this._set("renderer", e2); } set url(e2) { if (!e2) return void this._set("url", e2); const t3 = j(e2); this._set("url", t3.path), t3.query && (this.customParameters = { ...this.customParameters, ...t3.query }); } async applyEdits(e2, t3) { const r2 = await import("./editingSupport-YMIKJKVG.js"); await this.load(); const i3 = await r2.applyEdits(this, this.source, e2, t3); return this.read({ extent: this.source.sourceJSON.extent, timeInfo: this.source.sourceJSON.timeInfo }, { origin: "service", ignoreDefaults: true }), i3; } on(e2, t3) { return super.on(e2, t3); } createPopupTemplate(e2) { return p5(this, e2); } createQuery() { const e2 = new x2(), t3 = this.get("capabilities.data"); e2.returnGeometry = true, t3 && t3.supportsZ && (e2.returnZ = true), e2.outFields = ["*"], e2.where = this.definitionExpression || "1=1"; const { timeOffset: r2, timeExtent: i3 } = this; return e2.timeExtent = null != r2 && null != i3 ? i3.offset(-r2.value, r2.unit) : i3 || null, e2; } getFieldDomain(e2, t3) { let r2, i3 = false; const o2 = t3 && t3.feature, s4 = o2 && o2.attributes, p7 = this.typeIdField && s4 && s4[this.typeIdField]; return null != p7 && this.types && (i3 = this.types.some((t4) => t4.id == p7 && (r2 = t4.domains && t4.domains[e2], r2 && "inherited" === r2.type && (r2 = this._getLayerDomain(e2)), true))), i3 || r2 || (r2 = this._getLayerDomain(e2)), r2; } getField(e2) { return this.fieldsIndex.get(e2); } queryFeatures(e2, t3) { return this.load().then(() => this.source.queryFeatures(x2.from(e2) || this.createQuery(), t3)).then((e3) => { if (e3 == null ? void 0 : e3.features) for (const t4 of e3.features) t4.layer = t4.sourceLayer = this; return e3; }); } queryObjectIds(e2, t3) { return this.load().then(() => this.source.queryObjectIds(x2.from(e2) || this.createQuery(), t3)); } queryFeatureCount(e2, t3) { return this.load().then(() => this.source.queryFeatureCount(x2.from(e2) || this.createQuery(), t3)); } queryExtent(e2, t3) { return this.load().then(() => this.source.queryExtent(x2.from(e2) || this.createQuery(), t3)); } async hasDataChanged() { try { const { dataChanged: e2, updates: t3 } = await this.source.refresh(this.customParameters); return r(t3) && this.read(t3, { origin: "service", url: this.parsedUrl, ignoreDefaults: true }), e2; } catch { } return false; } _getLayerDomain(e2) { if (!this.fields) return null; let t3 = null; return this.fields.some((r2) => (r2.name === e2 && (t3 = r2.domain), !!t3)), t3; } }; e([y({ readOnly: true, json: { read: false, write: false } })], M.prototype, "capabilities", null), e([y({ type: String })], M.prototype, "copyright", void 0), e([y({ readOnly: true })], M.prototype, "createQueryVersion", null), e([y({ readOnly: true })], M.prototype, "defaultPopupTemplate", null), e([y({ type: String, json: { name: "layerDefinition.definitionExpression", write: { enabled: true, allowNull: true } } })], M.prototype, "definitionExpression", void 0), e([y({ type: String })], M.prototype, "displayField", void 0), e([y({ type: Boolean })], M.prototype, "editingEnabled", void 0), e([y(d)], M.prototype, "elevationInfo", void 0), e([y({ type: [y2], json: { name: "layerDefinition.fields", write: { ignoreOrigin: true, isRequired: true }, origins: { service: { name: "fields" } } } })], M.prototype, "fields", void 0), e([y(Z.fieldsIndex)], M.prototype, "fieldsIndex", void 0), e([y({ type: w2, json: { name: "extent" } })], M.prototype, "fullExtent", void 0), e([y({ type: ["point", "polygon", "polyline", "multipoint"], json: { read: { reader: i.read } } })], M.prototype, "geometryType", void 0), e([y({ type: Boolean })], M.prototype, "hasZ", void 0), e([y(j3)], M.prototype, "id", void 0), e([y({ type: Boolean, readOnly: true })], M.prototype, "isTable", null), e([y(m2)], M.prototype, "labelsVisible", void 0), e([y({ type: [j2], json: { name: "layerDefinition.drawingInfo.labelingInfo", read: { reader: i2 }, write: true } })], M.prototype, "labelingInfo", void 0), e([y(c2)], M.prototype, "legendEnabled", void 0), e([y({ type: ["show", "hide"] })], M.prototype, "listMode", void 0), e([y({ type: String, json: { name: "layerDefinition.objectIdField", write: { ignoreOrigin: true, isRequired: true }, origins: { service: { name: "objectIdField" } } } })], M.prototype, "objectIdField", void 0), e([y(w3)], M.prototype, "opacity", void 0), e([y({ type: ["GeoJSON"] })], M.prototype, "operationalLayerType", void 0), e([y({ readOnly: true })], M.prototype, "parsedUrl", null), e([y(p6)], M.prototype, "popupEnabled", void 0), e([y({ type: k2, json: { name: "popupInfo", write: true } })], M.prototype, "popupTemplate", void 0), e([y({ types: p2, json: { name: "layerDefinition.drawingInfo.renderer", write: true, origins: { service: { name: "drawingInfo.renderer" }, "web-scene": { types: n3 } } } })], M.prototype, "renderer", null), e([y(l2)], M.prototype, "screenSizePerspectiveEnabled", void 0), e([y({ readOnly: true })], M.prototype, "source", void 0), e([y({ type: k })], M.prototype, "spatialReference", void 0), e([y({ type: [p4] })], M.prototype, "templates", void 0), e([y()], M.prototype, "title", void 0), e([y({ json: { read: false }, readOnly: true })], M.prototype, "type", void 0), e([y({ type: String, readOnly: true })], M.prototype, "typeIdField", void 0), e([y({ type: [n5] })], M.prototype, "types", void 0), e([y(f)], M.prototype, "url", null), M = e([n("esri.layers.GeoJSONLayer")], M); var k3 = M; export { k3 as default }; //# sourceMappingURL=GeoJSONLayer-YDKKKMXQ.js.map