/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{__decorate as r}from"tslib";import e from"../../core/Collection.js";import{loadAllChildren as s}from"../../core/loadAll.js";import o from"../../core/Warning.js";import{property as t,subclass as i}from"../../core/accessorSupport/decorators.js";import n from"./BuildingComponentSublayer.js";import l from"./BuildingSublayer.js";import{forEachBuildingSublayer as u}from"./utils.js";const a={type:e,readOnly:!0,json:{origins:{service:{read:{source:"sublayers",reader:p}}},read:!1}};function p(r,s,t){if(r&&Array.isArray(r))return new e(r.map(r=>{const e=d(r);if(e){const s=new e;return s.read(r,t),s}return t?.messages&&r&&t.messages.push(new o("building-scene-layer:unsupported-sublayer-type","Building scene sublayer of type '"+(r.type||"unknown")+"' are not supported",{definition:r,context:t})),null}))}function d(r){return"group"===r.layerType?y:n}let y=class extends l{constructor(r){super(r),this.type="building-group",this.listMode="show",this.sublayers=null}loadAll(){return s(this,r=>u(this.sublayers,e=>{"building-group"!==e.type&&r(e)}))}static{this.sublayersProperty=a}static{this.readSublayers=p}};r([t({type:["hide","show","hide-children"],json:{write:!0}})],y.prototype,"listMode",void 0),r([t(a)],y.prototype,"sublayers",void 0),y=r([i("esri.layers.buildingSublayers.BuildingGroupSublayer")],y);export{y as default};
