// 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/timeUtils ./core/accessorSupport/decorators/property ./core/has ./core/Logger ./core/RandomLCG ./core/accessorSupport/decorators/reader ./core/accessorSupport/decorators/subclass ./core/accessorSupport/decorators/writer ./time/timeZoneUtils".split(" "),function(h,d,l,m,v,w,x,n,t,p,q){var g;d=g=class extends d.JSONSupport{static get allTime(){return r}static get empty(){return u}static fromArray(a){return new g({start:null!=a[0]?new Date(a[0]):a[0], end:null!=a[1]?new Date(a[1]):a[1]})}constructor(a){super(a);this.start=this.end=null}readEnd(a,b){return null!=b.end?new Date(b.end):null}writeEnd(a,b){b.end=a?.getTime()??null}get isAllTime(){return this.equals(g.allTime)}get isEmpty(){return this.equals(g.empty)}readStart(a,b){return null!=b.start?new Date(b.start):null}writeStart(a,b){b.start=a?.getTime()??null}clone(){return new g({end:this.end,start:this.start})}equals(a){if(!a)return!1;const b=this.start?.getTime()??this.start,e=this.end?.getTime()?? this.end,c=a.start?.getTime()??a.start;a=a.end?.getTime()??a.end;return b===c&&e===a}expandTo(a,b=q.system){if(this.isEmpty||this.isAllTime)return this.clone();let e=this.start;e&&=l.truncateDate(e,a,b);let c=this.end;if(c){const f=l.truncateDate(c,a,b);c=c.getTime()===f.getTime()?f:l.offsetDate(f,1,a,b)}return new g({start:e,end:c})}intersection(a){if(!a)return this.clone();if(this.isEmpty||a.isEmpty)return g.empty;if(this.isAllTime)return a.clone();if(a.isAllTime)return this.clone();const b=this.start?.getTime()?? -Infinity,e=this.end?.getTime()??Infinity,c=a.start?.getTime()??-Infinity;a=a.end?.getTime()??Infinity;let f,k;c>=b&&c<=e?f=c:b>=c&&b<=a&&(f=b);e>=c&&e<=a?k=e:a>=b&&a<=e&&(k=a);return null==f||null==k||isNaN(f)||isNaN(k)?g.empty:new g({start:-Infinity===f?null:new Date(f),end:Infinity===k?null:new Date(k)})}offset(a,b,e=q.system){if(this.isEmpty||this.isAllTime)return this.clone();const c=new g,{start:f,end:k}=this;null!=f&&(c.start=l.offsetDate(f,a,b,e));null!=k&&(c.end=l.offsetDate(k,a,b,e));return c}toArray(){return this.isEmpty? [void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(a){if(!a||a.isEmpty)return this.clone();if(this.isEmpty)return a.clone();if(this.isAllTime||a.isAllTime)return r.clone();const b=null!=this.start&&null!=a.start?new Date(Math.min(this.start.getTime(),a.start.getTime())):null;a=null!=this.end&&null!=a.end?new Date(Math.max(this.end.getTime(),a.end.getTime())):null;return new g({start:b,end:a})}};h.__decorate([m.property({type:Date,json:{write:{allowNull:!0}}})],d.prototype, "end",void 0);h.__decorate([n.reader("end")],d.prototype,"readEnd",null);h.__decorate([p.writer("end")],d.prototype,"writeEnd",null);h.__decorate([m.property({readOnly:!0,json:{read:!1}})],d.prototype,"isAllTime",null);h.__decorate([m.property({readOnly:!0,json:{read:!1}})],d.prototype,"isEmpty",null);h.__decorate([m.property({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"start",void 0);h.__decorate([n.reader("start")],d.prototype,"readStart",null);h.__decorate([p.writer("start")],d.prototype, "writeStart",null);d=g=h.__decorate([t.subclass("esri.TimeExtent")],d);const r=new d,u=new d({start:void 0,end:void 0});return d});