/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{__decorate as e}from"tslib";import r from"../../AggregateGraphic.js";import{property as t,subclass as o}from"../../core/accessorSupport/decorators.js";import s from"../../geometry/SpatialReference.js";import a from"./FeatureSet.js";import{reader as p}from"../../core/accessorSupport/decorators/reader.js";let c=class extends a{constructor(){super(...arguments),this.features=[]}readFeatures(e,t){const o=s.fromJSON(t.spatialReference),a=[];for(let s=0;s<e.length;s++){const t=e[s],p=r.fromJSON(t),c=t.geometry?.spatialReference;null==p.geometry||c||(p.geometry.spatialReference=o);const i=t.aggregateGeometries,f=p.aggregateGeometries;if(i&&null!=f)for(const e in f){const r=f[e],t=i[e],s=t?.spatialReference;null==r||s||(r.spatialReference=o)}a.push(p)}return a}};e([t({type:[r],json:{write:!0}})],c.prototype,"features",void 0),e([p("features")],c.prototype,"readFeatures",null),c=e([o("esri.rest.support.AggregateFeatureSet")],c);export{c as default};
