/*
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 t}from"tslib";import o from"./WebDocument2D.js";import e from"./core/Collection.js";import r from"./core/Error.js";import{loadAll as i}from"./core/loadAll.js";import{property as s,subclass as p}from"./core/accessorSupport/decorators.js";import n from"./networks/UtilityNetwork.js";import m from"./webdoc/GeotriggersInfo.js";import a from"./webdoc/IPSInfo.js";import l from"./webmap/InitialViewProperties.js";import{currentVersion as c}from"./webmap/utils.js";import f from"./webmap/Version.js";const w={currentVersion:c,createInitialViewProperties:()=>new l,parseVersion:f.parse,itemType:"Web Map",name:"webmap",origin:"web-map"},u=e.ofType(n);let y=class extends o{constructor(t){super(t),this.geotriggersInfo=null,this.ipsInfo=null,this.presentation=null,this.utilityNetworks=null}destroy(){if(this.utilityNetworks){const t=this.utilityNetworks.removeAll();for(const o of t)o.destroy();this.utilityNetworks.destroy()}}get context(){return w}loadAll(){return i(this,t=>{t(this.ground,this.basemap,this.layers,this.tables,this.ipsInfo?.positioningService?.portalItem)})}static fromJSON(t){if(t)return new this({resourceInfo:t});throw new r("webmap:empty-resource","Expected a JSON resource but got nothing")}static{this.VERSION=c}};t([s({type:m,json:{write:!0}})],y.prototype,"geotriggersInfo",void 0),t([s({type:a,json:{write:!0,name:"mapIPSInfo"}})],y.prototype,"ipsInfo",void 0),t([s({json:{write:!0}})],y.prototype,"presentation",void 0),t([s({type:u,json:{read:!0,write:!0}})],y.prototype,"utilityNetworks",void 0),y=t([p("esri.WebMap")],y);const d=y;export{d as default};
