/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{__decorate as e}from"tslib";import t from"../../../core/Logger.js";import{property as o,subclass as r}from"../../../core/accessorSupport/decorators.js";import m from"./AttachmentsColumnTemplate.js";import s from"./ColumnTemplate.js";import p from"./ColumnTemplateBase.js";import{isTemplateObjectWithType as l}from"./columnUtils.js";import n from"./FieldColumnTemplate.js";import a from"./RelationshipColumnTemplate.js";let i=class extends p{constructor(e){super(e),this.type="group"}get columnTemplates(){return this._get("columnTemplates")}set columnTemplates(e){e&&Array.isArray(e)||(e=[]);const o=[];e.forEach(e=>{if(e instanceof n||e instanceof s||e instanceof m||e instanceof a)o.push(e);else if(l(e)){const r=e.type;"field"===r?o.push(new n(e)):"group"===r?t.getLogger(this).warn("A GroupColumnTemplate cannot contain other GroupColumn templates. Template removed from 'GroupColumnTemplate.columnTemplates'."):"column"===r?o.push(new s(e)):"attachment"===r?o.push(new m(e)):"relationship"===r&&o.push(new a(e))}else t.getLogger(this).warn("Property 'type' is missing from the provided template. Template removed from 'tableTemplate.columnTemplates'.")}),this._set("columnTemplates",o)}};e([o({json:{write:!0}})],i.prototype,"columnTemplates",null),e([o({type:String,json:{read:!1,write:!0}})],i.prototype,"type",void 0),i=e([r("esri.widgets.FeatureTable.support.GroupColumnTemplate")],i);const u=i;export{u as default};
