// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built define("../chunks/tslib.es6 ../core/JSONSupport ../core/lang ../core/unitUtils ../core/accessorSupport/ensureType ../core/accessorSupport/decorators/property ../core/accessorSupport/decorators/subclass ../core/accessorSupport/decorators/writer ./support/spatialReferenceUtils".split(" "),function(c,a,p,l,h,d,q,m,e){var f;a=f=class extends a.JSONSupport{static fromJSON(b){if(!b)return null;if(b.wkid){if(102100===b.wkid)return f.WebMercator;if(4326===b.wkid)return f.WGS84}const g=new f;g.read(b);return g}constructor(b){super(b); this.imageCoordinateSystem=this.latestVcsWkid=this.vcsWkid=this.wkt2=this.wkt=this.wkid=this.latestWkid=null}normalizeCtorArgs(b){return b&&"object"===typeof b?b:{["string"===typeof b?"wkt":"wkid"]:b}}get isWGS84(){return e.isWGS84(this)}get isWebMercator(){return e.isWebMercator(this)}get isGeographic(){return e.isGeographic(this)}get isWrappable(){return e.isWrappable(this)}get metersPerUnit(){return l.getMetersPerUnitForSR(this)}get unit(){return l.getUnitString(this)||(this.isGeographic?"degrees": null)}writeWkt(b,g){this.wkid||(g.wkt=b)}clone(){if(this===f.WGS84)return new f(e.wgs84);if(this===f.WebMercator)return new f(e.webMercator);const b=new f;null!=this.wkid?(b.wkid=this.wkid,null!=this.latestWkid&&(b.latestWkid=this.latestWkid),null!=this.vcsWkid&&(b.vcsWkid=this.vcsWkid),null!=this.latestVcsWkid&&(b.latestVcsWkid=this.latestVcsWkid)):(null!=this.wkt&&(b.wkt=this.wkt),null!=this.wkt2&&(b.wkt2=this.wkt2));this.imageCoordinateSystem&&(b.imageCoordinateSystem=p.clone(this.imageCoordinateSystem)); return b}equals(b){if(null==b)return!1;if(this.imageCoordinateSystem||b.imageCoordinateSystem){if(null==this.imageCoordinateSystem||null==b.imageCoordinateSystem)return!1;const {id:g,referenceServiceName:n}=b.imageCoordinateSystem,{geodataXform:r}=b.imageCoordinateSystem,k=this.imageCoordinateSystem;return null==g||r?JSON.stringify(k)===JSON.stringify(b.imageCoordinateSystem):n?k.id===g&&k.referenceServiceName===n:k.id===g}return e.equals(this,b)}toJSON(b){return this.write(void 0,b)}};a.GCS_NAD_1927= null;a.WGS84=null;a.WebMercator=null;a.PlateCarree=null;c.__decorate([d.property({readOnly:!0})],a.prototype,"isWGS84",null);c.__decorate([d.property({readOnly:!0})],a.prototype,"isWebMercator",null);c.__decorate([d.property({readOnly:!0})],a.prototype,"isGeographic",null);c.__decorate([d.property({readOnly:!0})],a.prototype,"isWrappable",null);c.__decorate([d.property({type:h.Integer,json:{write:!0}})],a.prototype,"latestWkid",void 0);c.__decorate([d.property({readOnly:!0})],a.prototype,"metersPerUnit", null);c.__decorate([d.property({readOnly:!0})],a.prototype,"unit",null);c.__decorate([d.property({type:h.Integer,json:{write:!0,origins:{"web-scene":{write:{overridePolicy(){return{isRequired:null==this.wkt}}}}}}})],a.prototype,"wkid",void 0);c.__decorate([d.property({type:String,json:{origins:{"web-scene":{write:{overridePolicy(){return{isRequired:null==this.wkid}}}}}}})],a.prototype,"wkt",void 0);c.__decorate([m.writer("wkt"),m.writer("web-scene","wkt")],a.prototype,"writeWkt",null);c.__decorate([d.property({type:String, json:{write:!1}})],a.prototype,"wkt2",void 0);c.__decorate([d.property({type:h.Integer,json:{write:!0}})],a.prototype,"vcsWkid",void 0);c.__decorate([d.property({type:h.Integer,json:{write:!0}})],a.prototype,"latestVcsWkid",void 0);c.__decorate([d.property()],a.prototype,"imageCoordinateSystem",void 0);a=f=c.__decorate([q.subclass("esri.geometry.SpatialReference")],a);a.prototype.toJSON.isDefaultToJSON=!0;a.GCS_NAD_1927=new a({wkid:4267,wkt:'GEOGCS["GCS_North_American_1927",DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]'}); a.WGS84=new a(e.wgs84);a.WebMercator=new a(e.webMercator);a.PlateCarree=new a(e.plateCarree);Object.freeze&&(Object.freeze(a.GCS_NAD_1927),Object.freeze(a.WGS84),Object.freeze(a.WebMercator),Object.freeze(a.PlateCarree));return a});