import { a } from "./chunk-7BYZLBFH.js"; import { U, l } from "./chunk-TJV6ODRM.js"; import { v } from "./chunk-JUWKPBLS.js"; import { c } from "./chunk-WLSB4F4I.js"; import "./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 "./chunk-CRGY2SDS.js"; import "./chunk-4T5ZGMEN.js"; import { n as n3 } from "./chunk-XTVKPAWY.js"; import "./chunk-3OSQ6GXO.js"; import "./chunk-3WQOA5CB.js"; import { t } from "./chunk-PLWDAYK7.js"; import "./chunk-FZQZIM7U.js"; import "./chunk-CZBRZ6SU.js"; import "./chunk-VGWC3IKZ.js"; import "./chunk-3RSFVUKZ.js"; import "./chunk-UVVU4UUO.js"; import { d, l as l3, t as t2 } from "./chunk-3TP6BVDH.js"; import { y as y2 } from "./chunk-QRRIN2JN.js"; import "./chunk-ICWTATWH.js"; import { n as n2 } from "./chunk-FAOWJMTO.js"; import { l as l2 } from "./chunk-CDZENOCQ.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-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 { r as r2 } from "./chunk-PQFTYGF5.js"; import { e, e2, n5 as n, y3 as y } from "./chunk-2Z2TG5CU.js"; import "./chunk-6KZ2LTDA.js"; import "./chunk-U2XHEJM7.js"; import "./chunk-SQOPWYIT.js"; import "./chunk-V6P2MAQQ.js"; import "./chunk-E5O6P5I2.js"; import "./chunk-SPWQ3AWG.js"; import "./chunk-2TIUKVZN.js"; import { r } from "./chunk-YXWMMD76.js"; import "./chunk-S5KM4IGW.js"; // node_modules/@arcgis/core/layers/GroupLayer.js var _ = class extends n3(t(c(v(l3(d(O(b))))))) { constructor(i) { super(i), this._visibilityHandles = {}, this.allLayers = new l2({ getCollections: () => [this.layers], getChildrenFunction: (i2) => "layers" in i2 ? i2.layers : null }), this.allTables = t2(this), this.fullExtent = void 0, this.operationalLayerType = "GroupLayer", this.spatialReference = void 0, this.type = "group"; } initialize() { this._enforceVisibility(this.visibilityMode, this.visible), this.addHandles(l(() => this.visible, this._onVisibilityChange.bind(this), U)); } _writeLayers(i, e3, t3, r3) { const o = []; if (!i) return o; i.forEach((i2) => { const e4 = y2(i2, r3.webmap ? r3.webmap.getLayerJSONFromResourceInfo(i2) : null, r3); r(e4) && e4.layerType && o.push(e4); }), e3.layers = o; } set portalItem(i) { this._set("portalItem", i); } set visibilityMode(i) { const e3 = this._get("visibilityMode") !== i; this._set("visibilityMode", i), e3 && this._enforceVisibility(i, this.visible); } load(i) { return this.addResolvingPromise(this.loadFromPortal({ supportedTypes: ["Feature Service", "Feature Collection", "Scene Service"], layerModuleTypeMap: a }, i)), Promise.resolve(this); } loadAll() { return n2(this, (i) => { i(this.layers, this.tables); }); } layerAdded(i) { i.visible && "exclusive" === this.visibilityMode ? this._turnOffOtherLayers(i) : "inherited" === this.visibilityMode && (i.visible = this.visible), this._visibilityHandles[i.uid] = l(() => i.visible, (e3) => this._onChildVisibilityChange(i, e3), U); } layerRemoved(i) { const e3 = this._visibilityHandles[i.uid]; e3 && (e3.remove(), delete this._visibilityHandles[i.uid]), this._enforceVisibility(this.visibilityMode, this.visible); } _turnOffOtherLayers(i) { this.layers.forEach((e3) => { e3 !== i && (e3.visible = false); }); } _enforceVisibility(i, e3) { if (!e2(this).initialized) return; const t3 = this.layers; let s = t3.find((i2) => i2.visible); switch (i) { case "exclusive": t3.length && !s && (s = t3.getItemAt(0), s.visible = true), this._turnOffOtherLayers(s); break; case "inherited": t3.forEach((i2) => { i2.visible = e3; }); } } _onVisibilityChange(i) { "inherited" === this.visibilityMode && this.layers.forEach((e3) => { e3.visible = i; }); } _onChildVisibilityChange(i, e3) { switch (this.visibilityMode) { case "exclusive": e3 ? this._turnOffOtherLayers(i) : this._isAnyLayerVisible() || (i.visible = true); break; case "inherited": i.visible = this.visible; } } _isAnyLayerVisible() { return this.layers.some((i) => i.visible); } }; e([y({ readOnly: true, dependsOn: [] })], _.prototype, "allLayers", void 0), e([y({ readOnly: true })], _.prototype, "allTables", void 0), e([y()], _.prototype, "fullExtent", void 0), e([y({ json: { read: true, write: true } })], _.prototype, "blendMode", void 0), e([y({ json: { read: false, write: { ignoreOrigin: true } } })], _.prototype, "layers", void 0), e([r2("layers")], _.prototype, "_writeLayers", null), e([y({ type: ["GroupLayer"] })], _.prototype, "operationalLayerType", void 0), e([y({ json: { origins: { "web-document": { read: false, write: false } } } })], _.prototype, "portalItem", null), e([y()], _.prototype, "spatialReference", void 0), e([y({ json: { read: false }, readOnly: true, value: "group" })], _.prototype, "type", void 0), e([y({ type: ["independent", "inherited", "exclusive"], value: "independent", json: { write: true, origins: { "web-map": { read: false, write: false } } } })], _.prototype, "visibilityMode", null), _ = e([n("esri.layers.GroupLayer")], _); var g = _; export { g as default }; //# sourceMappingURL=GroupLayer-UF4S7J5N.js.map