import { S, d as d2, g, j as j3 } from "./chunk-6N2Y4VY4.js"; import "./chunk-2VFJVI2I.js"; import "./chunk-CIG5OHC7.js"; import "./chunk-FUD7XO3N.js"; import "./chunk-6EU7GFUT.js"; import "./chunk-MFUAILAT.js"; import "./chunk-HZJYXMI6.js"; import "./chunk-27P5ZSC7.js"; import "./chunk-UPD4MTCL.js"; import "./chunk-GRBROWI6.js"; import "./chunk-5NKYXKIA.js"; import "./chunk-MPWGHCZG.js"; import "./chunk-FTI5VP6T.js"; import "./chunk-RZFGRBD7.js"; import "./chunk-PUSPZYFZ.js"; import "./chunk-EN7YGJWG.js"; import "./chunk-VBNMTM7L.js"; import "./chunk-3D3QEPRE.js"; import "./chunk-JFNNSBWL.js"; import "./chunk-LY74KTXV.js"; import "./chunk-522WBHUO.js"; import "./chunk-WNCU6BFU.js"; import "./chunk-PIGRDDRG.js"; import "./chunk-BJHM4JNS.js"; import "./chunk-F6A2QQ26.js"; import "./chunk-XLV7RUSE.js"; import "./chunk-NTUXR253.js"; import "./chunk-EOSZHC5H.js"; import "./chunk-C43UE3Z5.js"; import { p } from "./chunk-V7H6CJ37.js"; import "./chunk-H2KDMZTR.js"; import "./chunk-RMX2AZ4P.js"; import "./chunk-NE3ESGA6.js"; import { U, j as j2, l } from "./chunk-YIS6BAC3.js"; import "./chunk-7XXXCK2A.js"; import "./chunk-7ZIDBK7B.js"; import { v } from "./chunk-KHA63LLS.js"; import { c } from "./chunk-FGKNEJKJ.js"; import { f } from "./chunk-PSV473TI.js"; import { O } from "./chunk-I3OBGWNS.js"; import "./chunk-FONIFA5N.js"; import "./chunk-EG5OI4V4.js"; import "./chunk-65BYCSII.js"; import "./chunk-WZQZRKNH.js"; import "./chunk-LRDX4TO7.js"; import "./chunk-6A4U74YA.js"; import { n as n3 } from "./chunk-CYI7KFYB.js"; import { a } from "./chunk-5LXROFTA.js"; import "./chunk-GJXW4HL5.js"; import "./chunk-WJW5DUN6.js"; import { t } from "./chunk-W72F6AS3.js"; import "./chunk-PJ7ZQ4VD.js"; import "./chunk-WDLTDV2L.js"; import "./chunk-TERAW6FT.js"; import "./chunk-N2663GRX.js"; import "./chunk-O4FY3ITT.js"; import "./chunk-WEMIK25H.js"; import { b as b2 } from "./chunk-4DDBH2K5.js"; import "./chunk-7N4X6GF3.js"; import "./chunk-JXW4QTJA.js"; import "./chunk-UXF37FQ4.js"; import "./chunk-ZOEK6QHJ.js"; import "./chunk-XNLG7T2T.js"; import "./chunk-IR4PV7VK.js"; import "./chunk-2Z6LERTI.js"; import "./chunk-OWVBLVP3.js"; import "./chunk-AFZ7XSEW.js"; import "./chunk-EGZW6HC3.js"; import "./chunk-4NKD334K.js"; import "./chunk-65K7LC56.js"; import "./chunk-ATPLLI5W.js"; import "./chunk-WJ3OEUD3.js"; import "./chunk-MXB2XLKV.js"; import "./chunk-XH7RUGVZ.js"; import { m } from "./chunk-TBBTRX4O.js"; import "./chunk-YBSUITLL.js"; import { j } from "./chunk-ALDCDSPV.js"; import { n as n2 } from "./chunk-DT6EAZQ5.js"; import "./chunk-HNOZUNJ4.js"; import "./chunk-VNFRAYHO.js"; import "./chunk-R5IG2D6H.js"; import { Ut } from "./chunk-VBRY5KJM.js"; import "./chunk-PDKDCAAD.js"; import { M2 as M, o } from "./chunk-ECW2QABR.js"; import { s } from "./chunk-GCDJLKH4.js"; import { k2 as k, r as r2 } from "./chunk-MRJEICT6.js"; import { d, e, n2 as n, u2 } from "./chunk-Y3WMVFTW.js"; import "./chunk-SAS7RONY.js"; import "./chunk-WSRBH7BF.js"; import { b } from "./chunk-IHXECKQQ.js"; import { w } from "./chunk-ULGDPLM2.js"; import "./chunk-EMJ4ZSM2.js"; import { u } from "./chunk-IKP3YN53.js"; import { r } from "./chunk-GZT4BVFP.js"; import "./chunk-A5ICIBVI.js"; // node_modules/@arcgis/core/layers/support/KMLSublayer.js var v2; var j4 = v2 = class extends n2.EventedMixin(u2(m)) { constructor() { super(...arguments), this._sublayersHandles = null, this.description = null, this.id = null, this.networkLink = null, this.title = null, this.sourceJSON = null, this.fullExtent = null; } initialize() { j2(() => this.networkLink).then(() => j2(() => this.visible === true)).then(() => this.load()); } load(e2) { if (!this.networkLink) return; if (this.networkLink.viewFormat) return; const t2 = r(e2) ? e2.signal : null, s2 = this._fetchService(this._get("networkLink").href, t2).then((e3) => { const t3 = j3(e3.sublayers); this.fullExtent = M.fromJSON(t3), this.sourceJSON = e3; const s3 = b(j.ofType(v2), S(v2, e3)); this.sublayers ? this.sublayers.addMany(s3) : this.sublayers = s3, this.layer.emit("sublayer-update"), this.layer && this.layer.notifyChange("visibleSublayers"); }); return this.addResolvingPromise(s2), Promise.resolve(this); } set sublayers(e2) { const r3 = this._get("sublayers"); r3 && (r3.forEach((e3) => { e3.parent = null, e3.layer = null; }), this._sublayersHandles.forEach((e3) => e3.remove()), this._sublayersHandles = null), e2 && (e2.forEach((e3) => { e3.parent = this, e3.layer = this.layer; }), this._sublayersHandles = [e2.on("after-add", ({ item: e3 }) => { e3.parent = this, e3.layer = this.layer; }), e2.on("after-remove", ({ item: e3 }) => { e3.parent = null, e3.layer = null; })]), this._set("sublayers", e2); } castSublayers(e2) { return b(j.ofType(v2), e2); } get visible() { return this._get("visible"); } set visible(e2) { this._get("visible") !== e2 && (this._set("visible", e2), this.layer && this.layer.notifyChange("visibleSublayers")); } readVisible(e2, r3) { return !!r3.visibility; } set layer(e2) { this._set("layer", e2), this.sublayers && this.sublayers.forEach((r3) => r3.layer = e2); } _fetchService(e2, r3) { return g(e2, this.layer.outSpatialReference, this.layer.refreshInterval, r3).then((e3) => d2(e3.data)); } }; e([d()], j4.prototype, "description", void 0), e([d()], j4.prototype, "id", void 0), e([d({ readOnly: true, value: null })], j4.prototype, "networkLink", void 0), e([d({ json: { write: { allowNull: true } } })], j4.prototype, "parent", void 0), e([d({ value: null, json: { write: { allowNull: true } } })], j4.prototype, "sublayers", null), e([s("sublayers")], j4.prototype, "castSublayers", null), e([d({ value: null, json: { read: { source: "name", reader: (e2) => u(e2) } } })], j4.prototype, "title", void 0), e([d({ value: true })], j4.prototype, "visible", null), e([o("visible", ["visibility"])], j4.prototype, "readVisible", null), e([d()], j4.prototype, "sourceJSON", void 0), e([d({ value: null })], j4.prototype, "layer", null), e([d({ type: M })], j4.prototype, "fullExtent", void 0), j4 = v2 = e([n("esri.layers.support.KMLSublayer")], j4); var S2 = j4; // node_modules/@arcgis/core/layers/KMLLayer.js var F = ["kml", "xml"]; var O2 = class extends a(n3(t(c(v(O(b2)))))) { constructor(...e2) { super(...e2), this._visibleFolders = [], this.allSublayers = new p({ getCollections: () => [this.sublayers], getChildrenFunction: (e3) => e3.sublayers }), this.outSpatialReference = k.WGS84, this.path = null, this.legendEnabled = false, this.operationalLayerType = "KML", this.sublayers = null, this.type = "kml", this.url = null; } initialize() { this.own([l(() => this.sublayers, (e2, r3) => { r3 && r3.forEach((e3) => { e3.parent = null, e3.layer = null; }), e2 && e2.forEach((e3) => { e3.parent = this, e3.layer = this; }); }, U), this.on("sublayer-update", () => this.notifyChange("fullExtent"))]); } normalizeCtorArgs(e2, r3) { return typeof e2 == "string" ? { url: e2, ...r3 } : e2; } readSublayersFromItemOrWebMap(e2, r3) { this._visibleFolders = r3.visibleFolders; } readSublayers(e2, r3, t2) { return S(S2, r3, t2, this._visibleFolders); } writeSublayers(e2, r3) { const t2 = [], o2 = e2.toArray(); for (; o2.length; ) { const e3 = o2[0]; e3.networkLink || (e3.visible && t2.push(e3.id), e3.sublayers && o2.push(...e3.sublayers.toArray())), o2.shift(); } r3.visibleFolders = t2; } get title() { const e2 = this._get("title"); return e2 && this.originOf("title") !== "defaults" ? e2 : this.url ? Ut(this.url, F) || "KML" : e2 || ""; } set title(e2) { this._set("title", e2); } get visibleSublayers() { const e2 = this.sublayers, r3 = [], t2 = (e3) => { e3.visible && (r3.push(e3), e3.sublayers && e3.sublayers.forEach(t2)); }; return e2 && e2.forEach(t2), r3; } get fullExtent() { return this._recomputeFullExtent(); } load(e2) { const r3 = r(e2) ? e2.signal : null; return this.addResolvingPromise(this.loadFromPortal({ supportedTypes: ["KML"] }, e2).catch(w).then(() => this._fetchService(r3))), Promise.resolve(this); } destroy() { super.destroy(), this.allSublayers.destroy(); } async _fetchService(e2) { const r3 = await Promise.resolve().then(() => this.resourceInfo ? { ssl: false, data: this.resourceInfo } : g(this.url, this.outSpatialReference, this.refreshInterval, e2)), t2 = d2(r3.data); t2 && this.read(t2, { origin: "service" }); } _recomputeFullExtent() { let e2 = null; r(this.extent) && (e2 = this.extent.clone()); const r3 = (t2) => { if (t2.sublayers) for (const s2 of t2.sublayers.items) r3(s2), s2.visible && s2.fullExtent && (r(e2) ? e2.union(s2.fullExtent) : e2 = s2.fullExtent.clone()); }; return r3(this), e2; } }; e([d({ readOnly: true })], O2.prototype, "allSublayers", void 0), e([d({ type: k })], O2.prototype, "outSpatialReference", void 0), e([d({ type: String, json: { origins: { "web-scene": { read: true, write: true } }, read: false } })], O2.prototype, "path", void 0), e([d({ readOnly: true, json: { read: false, write: false } })], O2.prototype, "legendEnabled", void 0), e([d({ type: ["show", "hide", "hide-children"] })], O2.prototype, "listMode", void 0), e([d({ type: ["KML"] })], O2.prototype, "operationalLayerType", void 0), e([d({})], O2.prototype, "resourceInfo", void 0), e([d({ type: j.ofType(S2), json: { write: { ignoreOrigin: true } } })], O2.prototype, "sublayers", void 0), e([o(["web-map", "portal-item"], "sublayers", ["visibleFolders"])], O2.prototype, "readSublayersFromItemOrWebMap", null), e([o("service", "sublayers", ["sublayers"])], O2.prototype, "readSublayers", null), e([r2("sublayers")], O2.prototype, "writeSublayers", null), e([d({ readOnly: true, json: { read: false } })], O2.prototype, "type", void 0), e([d({ json: { origins: { "web-map": { read: { source: "title" } } }, write: { ignoreOrigin: true } } })], O2.prototype, "title", null), e([d(f)], O2.prototype, "url", void 0), e([d({ readOnly: true })], O2.prototype, "visibleSublayers", null), e([d({ type: M })], O2.prototype, "extent", void 0), e([d()], O2.prototype, "fullExtent", null), O2 = e([n("esri.layers.KMLLayer")], O2); var M2 = O2; export { M2 as default }; //# sourceMappingURL=KMLLayer-NWXY6NRR.js.map