/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["../../chunks/_rollupPluginBabelHelpers","../../chunks/tslib.es6","../../core/maybe","../../core/accessorSupport/decorators/property","../../core/arrayUtils","../../core/has","../../core/accessorSupport/ensureType","../../core/accessorSupport/decorators/subclass","../../chunks/common","../../geometry/Extent","../../geometry/Polygon","./GeoreferenceBase"],(function(e,t,r,o,n,s,c,a,i,p,u,l){"use strict";let y=function(t){function o(e){var r;return(r=t.call(this,e)||this).extent=null,r.rotation=0,r.type="extent-and-rotation",r}return e._inheritsLoose(o,t),e._createClass(o,[{key:"coords",get:function(){if(r.isNone(this.extent))return null;const{xmin:e,ymin:t,xmax:o,ymax:n,spatialReference:s}=this.extent;let c;if(this.rotation){const{x:r,y:s}=this.extent.center,a=d(r,s,this.rotation);c=[a(e,t),a(e,n),a(o,n),a(o,t)],c.push(c[0])}else c=[[e,t],[e,n],[o,n],[o,t],[e,t]];return new u({rings:[c],spatialReference:s})}}]),o}(l);function d(e,t,r){const o=i.toRadian(r),n=Math.cos(o),s=Math.sin(o);return(r,o)=>[n*(r-e)+s*(o-t)+e,n*(o-t)-s*(r-e)+t]}t.__decorate([o.property({readOnly:!0})],y.prototype,"coords",null),t.__decorate([o.property({type:p})],y.prototype,"extent",void 0),t.__decorate([o.property({type:Number})],y.prototype,"rotation",void 0),y=t.__decorate([a.subclass("esri.layers.support.ExtentAndRotationGeoreference")],y);return y}));
