import { a } from "./chunk-PNB3LCW5.js"; import { U, l } from "./chunk-BWATQC2Y.js"; import { v } from "./chunk-2DSTZVND.js"; import { c } from "./chunk-VXKIGGM4.js"; import "./chunk-KG45D2XL.js"; import { O } from "./chunk-JYRZQPQI.js"; import "./chunk-3HZQM2NK.js"; import "./chunk-AR2YN3E2.js"; import "./chunk-U3LEOWJX.js"; import "./chunk-4ONPMX2F.js"; import "./chunk-47NSA4T4.js"; import "./chunk-FUODOQDM.js"; import { n as n3 } from "./chunk-UA6W42KP.js"; import "./chunk-3OSQ6GXO.js"; import "./chunk-3WQOA5CB.js"; import { t } from "./chunk-2L5METUC.js"; import "./chunk-FZQZIM7U.js"; import "./chunk-CZBRZ6SU.js"; import "./chunk-VGWC3IKZ.js"; import "./chunk-UKEN2UNL.js"; import "./chunk-UVVU4UUO.js"; import { d, l as l3, t as t2 } from "./chunk-KTMBA3TM.js"; import { y as y2 } from "./chunk-UTSBIUUP.js"; import "./chunk-ICWTATWH.js"; import { n as n2 } from "./chunk-R7V7MKKV.js"; import { l as l2 } from "./chunk-E36TKLKO.js"; import "./chunk-PE24J2I5.js"; import "./chunk-P3XKUGLS.js"; import "./chunk-PIFOHNWC.js"; import "./chunk-LLO7GCYU.js"; import "./chunk-U7RKABRB.js"; import "./chunk-X7CNGECX.js"; import "./chunk-PSEI52P3.js"; import "./chunk-ZLNEXZAN.js"; import "./chunk-5UVJ64RB.js"; import { b } from "./chunk-O43KLDSX.js"; import "./chunk-AUOH2VSO.js"; import "./chunk-ZYRIJWLX.js"; import "./chunk-TJNOJH33.js"; import "./chunk-OSHI574D.js"; import "./chunk-44GMIOGP.js"; import "./chunk-75U5LM2V.js"; import "./chunk-ZHRAUKVQ.js"; import "./chunk-RZK6A2GY.js"; import "./chunk-4NQ74ZR6.js"; import "./chunk-X4LLOW7U.js"; import "./chunk-BDA6VH2A.js"; import "./chunk-Z4JTBD7M.js"; import "./chunk-MSBIHK67.js"; import "./chunk-HZRKBTHJ.js"; import "./chunk-5DMBXPN2.js"; import "./chunk-QANZ6BFY.js"; import "./chunk-VEGAOVMY.js"; import "./chunk-CXCDYJ5R.js"; import "./chunk-GAOW3WRZ.js"; import { r as r2 } from "./chunk-QCKFNSN2.js"; import { e, e2, n5 as n, y3 as y } from "./chunk-6SOHRC7T.js"; import "./chunk-U2XHEJM7.js"; import "./chunk-SQOPWYIT.js"; import "./chunk-6KZ2LTDA.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-O4E26MJH.js.map