/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{__decorate as e}from"tslib";import{JSONSupport as r}from"../../core/JSONSupport.js";import{clone as t}from"../../core/lang.js";import o from"../../core/Warning.js";import{property as s,subclass as i}from"../../core/accessorSupport/decorators.js";import{persistable as p}from"../../core/accessorSupport/decorators/persistable.js";import a from"../../geometry/Polygon.js";import{canProjectWithoutEngine as c,projectPolygon as n}from"../../geometry/projectionUtils.js";import{writer as l}from"../../core/accessorSupport/decorators/writer.js";var m;let y=m=class extends r{constructor(e){super(e),this.geometry=null,this.type="clip"}writeGeometry(e,r,t,s){if(s.layer?.spatialReference&&!s.layer.spatialReference.equals(this.geometry.spatialReference)){if(!c(e.spatialReference,s.layer.spatialReference))return void(s?.messages&&s.messages.push(new o("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:s.layer.spatialReference,context:s})));const i=new a;n(e,i,s.layer.spatialReference),r[t]=i.toJSON(s)}else r[t]=e.toJSON(s)}clone(){return new m({geometry:t(this.geometry),type:this.type})}};e([s({type:a}),p()],y.prototype,"geometry",void 0),e([l(["web-scene","portal-item"],"geometry")],y.prototype,"writeGeometry",null),e([s({type:["clip","mask","replace"],nonNullable:!0}),p()],y.prototype,"type",void 0),y=m=e([i("esri.layers.support.SceneModification")],y);export{y as default};
