/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import s from"../../../../core/ReactiveMap.js";import{property as r}from"../../../../core/accessorSupport/decorators.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";let a=class extends t{constructor(e){super(e),this._drawAtFixedElevationOverrides=new s,this._segmentLabelsDisabledOverrides=new s,this.preserveAspectRatio=!1,this.centered=!1}get drawAtFixedElevation(){return this._getDrawAtFixedElevation()}get segmentLabelsDisabled(){return this._getSegmentLabelsDisabled()}getGlobalState(){return{preserveAspectRatio:this.preserveAspectRatio,centered:this.centered,drawAtFixedElevation:this._getDrawAtFixedElevation(),segmentLabelsDisabled:this._getSegmentLabelsDisabled()}}setCentered(e){this.centered=e}setPreserveAspectRatio(e){this.preserveAspectRatio=e}setGlobalState(e,t,s){"drawAtFixedElevation"===t?this._setDrawAtFixedElevation(e,s):"segmentLabelsDisabled"===t&&this._setSegmentLabelsDisabled(e,s)}clearPluginOverrides(e){this._drawAtFixedElevationOverrides.delete(e),this._segmentLabelsDisabledOverrides.delete(e)}_setDrawAtFixedElevation(e,t){null==t?this._drawAtFixedElevationOverrides.delete(e):this._drawAtFixedElevationOverrides.set(e,t)}_setSegmentLabelsDisabled(e,t){null==t?this._segmentLabelsDisabledOverrides.delete(e):this._segmentLabelsDisabledOverrides.set(e,t)}_getDrawAtFixedElevation(){const e=this.getPluginStack?.();if(!e)return!1;for(let t=e.length-1;t>=0;t--){const s=e.at(t),r=this._drawAtFixedElevationOverrides.get(s);if(null!=r)return r}return!1}_getSegmentLabelsDisabled(){const e=this.getPluginStack?.();if(!e)return!1;for(let t=e.length-1;t>=0;t--){const s=e.at(t),r=this._segmentLabelsDisabledOverrides.get(s);if(null!=r)return r}return!1}};e([r({constructOnly:!0})],a.prototype,"getPluginStack",void 0),e([r()],a.prototype,"preserveAspectRatio",void 0),e([r()],a.prototype,"centered",void 0),e([r()],a.prototype,"drawAtFixedElevation",null),e([r()],a.prototype,"segmentLabelsDisabled",null),a=e([i("esri.views.draw.support.managers.GlobalStateManager")],a);export{a as GlobalStateManager};
