saturn-datepicker-ext
Version:
Material datepicker with range support ## What is this?
78 lines • 82.3 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/platform"),require("@angular/core"),require("rxjs"),require("@angular/cdk/a11y"),require("@angular/cdk/overlay"),require("@angular/cdk/portal"),require("@angular/common"),require("@angular/material/button"),require("@angular/material/dialog"),require("@angular/cdk/keycodes"),require("@angular/cdk/bidi"),require("rxjs/operators"),require("@angular/cdk/coercion"),require("@angular/material/core"),require("@angular/animations"),require("@angular/forms"),require("@angular/material/form-field"),require("@angular/material/input")):"function"==typeof define&&define.amd?define("saturn-datepicker-ext",["exports","@angular/cdk/platform","@angular/core","rxjs","@angular/cdk/a11y","@angular/cdk/overlay","@angular/cdk/portal","@angular/common","@angular/material/button","@angular/material/dialog","@angular/cdk/keycodes","@angular/cdk/bidi","rxjs/operators","@angular/cdk/coercion","@angular/material/core","@angular/animations","@angular/forms","@angular/material/form-field","@angular/material/input"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["saturn-datepicker-ext"]={},e.ng.cdk.platform,e.ng.core,e.rxjs,e.ng.cdk.a11y,e.ng.cdk.overlay,e.ng.cdk.portal,e.ng.common,e.ng.material.button,e.ng.material.dialog,e.ng.cdk.keycodes,e.ng.cdk.bidi,e.rxjs.operators,e.ng.cdk.coercion,e.ng.material.core,e.ng.animations,e.ng.forms,e.ng.material.formField,e.ng.material.input)}(this,(function(e,t,a,i,n,r,o,s,d,l,c,p,h,u,_,g,m,f,y){"use strict";
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/var D=new a.InjectionToken("MAT_DATE_LOCALE",{providedIn:"root",factory:b});function b(){return a.inject(a.LOCALE_ID)}var v={provide:D,useExisting:a.LOCALE_ID},A=function(){function e(){this._localeChanges=new i.Subject}return Object.defineProperty(e.prototype,"localeChanges",{get:function(){return this._localeChanges},enumerable:!1,configurable:!0}),e.prototype.deserialize=function(e){return null==e||this.isDateInstance(e)&&this.isValid(e)?e:this.invalid()},e.prototype.setLocale=function(e){this.locale=e,this._localeChanges.next()},e.prototype.compareDate=function(e,t){return this.getYear(e)-this.getYear(t)||this.getMonth(e)-this.getMonth(t)||this.getDate(e)-this.getDate(t)},e.prototype.sameDate=function(e,t){if(e&&t){var a=this.isValid(e),i=this.isValid(t);return a&&i?!this.compareDate(e,t):a==i}return e==t},e.prototype.clampDate=function(e,t,a){return t&&this.compareDate(e,t)<0?t:a&&this.compareDate(e,a)>0?a:e},e}(),C=new a.InjectionToken("mat-date-formats"),w=function(e,t){return(w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)t.hasOwnProperty(a)&&(e[a]=t[a])})(e,t)};function O(e,t){function a(){this.constructor=e}w(e,t),e.prototype=null===t?Object.create(t):(a.prototype=t.prototype,new a)}var k;try{k="undefined"!=typeof Intl}catch(e){k=!1}var S={long:["January","February","March","April","May","June","July","August","September","October","November","December"],short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],narrow:["J","F","M","A","M","J","J","A","S","O","N","D"]},I=E(31,(function(e){return String(e+1)})),x={long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],narrow:["S","M","T","W","T","F","S"]},M={af:1,ar:6,"ar-ly":6,"ar-ma":6,"ar-tn":1,az:1,be:1,bg:1,bm:1,br:1,bs:1,ca:1,cs:1,cv:1,cy:1,da:1,de:1,"de-at":1,"de-ch":1,el:1,"en-au":1,"en-gb":1,"en-ie":1,"en-nz":1,eo:1,es:1,"es-do":1,et:1,eu:1,fa:6,fi:1,fo:1,fr:1,"fr-ch":1,fy:1,gd:1,gl:1,"gom-latn":1,hr:1,hu:1,"hy-am":1,id:1,is:1,it:1,jv:1,ka:1,kk:1,km:1,ky:1,lb:1,lt:1,lv:1,me:1,mi:1,mk:1,ms:1,"ms-my":1,mt:1,my:1,nb:1,nl:1,"nl-be":1,nn:1,pl:1,pt:1,"pt-BR":0,ro:1,ru:1,sd:1,se:1,sk:1,sl:1,sq:1,sr:1,"sr-cyrl":1,ss:1,sv:1,sw:1,tet:1,tg:1,"tl-ph":1,tlh:1,tr:1,tzl:1,tzm:6,"tzm-latn":6,"ug-cn":1,uk:1,ur:1,uz:1,"uz-latn":1,vi:1,"x-pseudo":1,yo:1,"zh-cn":1},V=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;function E(e,t){for(var a=Array(e),i=0;i<e;i++)a[i]=t(i);return a}var R=function(e){function t(t,a){var i=e.call(this)||this;return i.useUtcForDisplay=!0,e.prototype.setLocale.call(i,t),i.useUtcForDisplay=!a.TRIDENT,i._clampDate=a.TRIDENT||a.EDGE,i}return O(t,e),t.prototype.getYear=function(e){return e.getFullYear()},t.prototype.getMonth=function(e){return e.getMonth()},t.prototype.getDate=function(e){return e.getDate()},t.prototype.getDayOfWeek=function(e){return e.getDay()},t.prototype.getMonthNames=function(e){var t=this;if(k){var a=new Intl.DateTimeFormat(this.locale,{month:e,timeZone:"utc"});return E(12,(function(e){return t._stripDirectionalityCharacters(t._format(a,new Date(2017,e,1)))}))}return S[e]},t.prototype.getDateNames=function(){var e=this;if(k){var t=new Intl.DateTimeFormat(this.locale,{day:"numeric",timeZone:"utc"});return E(31,(function(a){return e._stripDirectionalityCharacters(e._format(t,new Date(2017,0,a+1)))}))}return I},t.prototype.getDayOfWeekNames=function(e){var t=this;if(k){var a=new Intl.DateTimeFormat(this.locale,{weekday:e,timeZone:"utc"});return E(7,(function(e){return t._stripDirectionalityCharacters(t._format(a,new Date(2017,0,e+1)))}))}return x[e]},t.prototype.getYearName=function(e){if(k){var t=new Intl.DateTimeFormat(this.locale,{year:"numeric",timeZone:"utc"});return this._stripDirectionalityCharacters(this._format(t,e))}return String(this.getYear(e))},t.prototype.getFirstDayOfWeek=function(){var e=this.locale.toLowerCase();return M[e]||M[e.substr(0,2)]||0},t.prototype.getNumDaysInMonth=function(e){return this.getDate(this._createDateWithOverflow(this.getYear(e),this.getMonth(e)+1,0))},t.prototype.clone=function(e){return new Date(e.getTime())},t.prototype.createDate=function(e,t,a){if(t<0||t>11)throw Error('Invalid month index "'+t+'". Month index has to be between 0 and 11.');if(a<1)throw Error('Invalid date "'+a+'". Date has to be greater than 0.');var i=this._createDateWithOverflow(e,t,a);if(i.getMonth()!=t)throw Error('Invalid date "'+a+'" for month with index "'+t+'".');return i},t.prototype.today=function(){return new Date},t.prototype.parse=function(e){return"number"==typeof e?new Date(e):e?new Date(Date.parse(e)):null},t.prototype.format=function(e,t){if(!this.isValid(e))throw Error("NativeDateAdapter: Cannot format invalid date.");if(k){this._clampDate&&(e.getFullYear()<1||e.getFullYear()>9999)&&(e=this.clone(e)).setFullYear(Math.max(1,Math.min(9999,e.getFullYear()))),t=Object.assign(Object.assign({},t),{timeZone:"utc"});var a=new Intl.DateTimeFormat(this.locale,t);return this._stripDirectionalityCharacters(this._format(a,e))}return this._stripDirectionalityCharacters(e.toDateString())},t.prototype.addCalendarYears=function(e,t){return this.addCalendarMonths(e,12*t)},t.prototype.addCalendarMonths=function(e,t){var a=this._createDateWithOverflow(this.getYear(e),this.getMonth(e)+t,this.getDate(e));return this.getMonth(a)!=((this.getMonth(e)+t)%12+12)%12&&(a=this._createDateWithOverflow(this.getYear(a),this.getMonth(a),0)),a},t.prototype.addCalendarDays=function(e,t){return this._createDateWithOverflow(this.getYear(e),this.getMonth(e),this.getDate(e)+t)},t.prototype.toIso8601=function(e){return[e.getUTCFullYear(),this._2digit(e.getUTCMonth()+1),this._2digit(e.getUTCDate())].join("-")},t.prototype.deserialize=function(t){if("string"==typeof t){if(!t)return null;if(V.test(t)){var a=new Date(t);if(this.isValid(a))return a}}return e.prototype.deserialize.call(this,t)},t.prototype.isDateInstance=function(e){return e instanceof Date},t.prototype.isValid=function(e){return!isNaN(e.getTime())},t.prototype.invalid=function(){return new Date(NaN)},t.prototype._createDateWithOverflow=function(e,t,a){var i=new Date(e,t,a);return e>=0&&e<100&&i.setFullYear(this.getYear(i)-1900),i},t.prototype._2digit=function(e){return("00"+e).slice(-2)},t.prototype._stripDirectionalityCharacters=function(e){return e.replace(/[\u200e\u200f]/g,"")},t.prototype._format=function(e,t){var a=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.format(a)},t}(A);R.decorators=[{type:a.Injectable}],R.ctorParameters=function(){return[{type:String,decorators:[{type:a.Optional},{type:a.Inject,args:[D]}]},{type:t.Platform}]};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var P={parse:{dateInput:null},display:{dateInput:{year:"numeric",month:"numeric",day:"numeric"},monthYearLabel:{year:"numeric",month:"short"},dateA11yLabel:{year:"numeric",month:"long",day:"numeric"},monthYearA11yLabel:{year:"numeric",month:"long"}}},F=function(){};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/F.decorators=[{type:a.NgModule,args:[{imports:[t.PlatformModule],providers:[{provide:A,useClass:R}]}]}];var Y=P,N=function(){};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
function T(e){return Error("SatDatepicker: No provider found for "+e+". You must import one of the following modules at your application root: SatNativeDateModule, MatMomentDateModule, or provide a custom implementation.")}
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/N.decorators=[{type:a.NgModule,args:[{imports:[F],providers:[{provide:C,useValue:Y}]}]}];var j=function(){this.changes=new i.Subject,this.calendarLabel="Calendar",this.openCalendarLabel="Open calendar",this.prevMonthLabel="Previous month",this.nextMonthLabel="Next month",this.prevYearLabel="Previous year",this.nextYearLabel="Next year",this.prevMultiYearLabel="Previous 20 years",this.nextMultiYearLabel="Next 20 years",this.switchToMonthViewLabel="Choose date",this.switchToMultiYearViewLabel="Choose month and year"};j.ɵprov=a.ɵɵdefineInjectable({factory:function(){return new j},token:j,providedIn:"root"}),j.decorators=[{type:a.Injectable,args:[{providedIn:"root"}]}];
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var L=function(e,t,a,i,n){this.value=e,this.displayValue=t,this.ariaLabel=a,this.enabled=i,this.cssClasses=n},B=function(){function e(e,t){this._elementRef=e,this._ngZone=t,this.rangeHoverEffect=!0,this.rangeMode=!1,this.numCols=7,this.activeCell=0,this.cellAspectRatio=1,this.selectedValueChange=new a.EventEmitter}return e.prototype._cellClicked=function(e){e.enabled&&this.selectedValueChange.emit(e.value)},e.prototype._mouseOverCell=function(e){this.rangeHoverEffect&&(this._cellOver=e.value)},e.prototype.ngOnChanges=function(e){var t=e.numCols,a=this.rows,i=this.numCols;(e.rows||t)&&(this._firstRowOffset=a&&a.length&&a[0].length?i-a[0].length:0),(e.cellAspectRatio||t||!this._cellPadding)&&(this._cellPadding=50*this.cellAspectRatio/i+"%"),!t&&this._cellWidth||(this._cellWidth=100/i+"%"),e.activeCell&&this.rangeHoverEffect&&(this._cellOver=this.activeCell+1)},e.prototype._isActiveCell=function(e,t){var a=e*this.numCols+t;return e&&(a-=this._firstRowOffset),a==this.activeCell},e.prototype._isSemiSelected=function(e){return!!this.rangeMode&&(!!this.rangeFull||e!==this.begin&&e!==this.end&&(this.begin&&!this.end?e>this.begin:(this.end&&!this.begin||e>this.begin)&&e<this.end))},e.prototype._isBetweenOverAndBegin=function(e){return!!(this._cellOver&&this.rangeMode&&this.beginSelected)&&(this.isBeforeSelected&&!this.begin?e>this._cellOver:this._cellOver>this.begin?e>this.begin&&e<this._cellOver:this._cellOver<this.begin&&(e<this.begin&&e>this._cellOver))},e.prototype._isBegin=function(e){return this.rangeMode&&this.beginSelected&&this._cellOver?this.isBeforeSelected&&!this.begin?this._cellOver===e:this.begin===e&&!(this._cellOver<this.begin)||this._cellOver===e&&this._cellOver<this.begin:this.begin===e},e.prototype._isEnd=function(e){return this.rangeMode&&this.beginSelected&&this._cellOver?!(this.isBeforeSelected&&!this.begin)&&(this.end===e&&!(this._cellOver>this.begin)||this._cellOver===e&&this._cellOver>this.begin):this.end===e},e.prototype._focusActiveCell=function(){var e=this;this._ngZone.runOutsideAngular((function(){e._ngZone.onStable.asObservable().pipe(h.take(1)).subscribe((function(){var t=e._elementRef.nativeElement.querySelector(".mat-calendar-body-active");t&&t.focus()}))}))},e.prototype._previewCellOver=function(e){return this._cellOver===e&&this.rangeMode&&this.beginSelected},e}();B.decorators=[{type:a.Component,args:[{selector:"[sat-calendar-body]",template:'\x3c!--\n If there\'s not enough space in the first row, create a separate label row. We mark this row as\n aria-hidden because we don\'t want it to be read out as one of the weeks in the month.\n--\x3e\n<tr *ngIf="_firstRowOffset < labelMinRequiredCells" aria-hidden="true">\n <td class="mat-calendar-body-label"\n [attr.colspan]="numCols"\n [style.paddingTop]="_cellPadding"\n [style.paddingBottom]="_cellPadding">\n {{label}}\n </td>\n</tr>\n\n\x3c!-- Create the first row separately so we can include a special spacer cell. --\x3e\n<tr *ngFor="let row of rows; let rowIndex = index" role="row">\n \x3c!--\n We mark this cell as aria-hidden so it doesn\'t get read out as one of the days in the week.\n The aspect ratio of the table cells is maintained by setting the top and bottom padding as a\n percentage of the width (a variant of the trick described here:\n https://www.w3schools.com/howto/howto_css_aspect_ratio.asp).\n --\x3e\n <td *ngIf="rowIndex === 0 && _firstRowOffset"\n aria-hidden="true"\n class="mat-calendar-body-label"\n [attr.colspan]="_firstRowOffset"\n [style.paddingTop]="_cellPadding"\n [style.paddingBottom]="_cellPadding">\n {{_firstRowOffset >= labelMinRequiredCells ? label : \'\'}}\n </td>\n <td *ngFor="let item of row; let colIndex = index"\n role="gridcell"\n class="mat-calendar-body-cell"\n [ngClass]="item.cssClasses"\n [tabindex]="_isActiveCell(rowIndex, colIndex) ? 0 : -1"\n [class.mat-calendar-body-disabled]="!item.enabled"\n [class.mat-calendar-body-active]="_isActiveCell(rowIndex, colIndex)"\n [class.mat-calendar-body-begin-range]="_isBegin(item.value)"\n [class.mat-calendar-body-end-range]="_isEnd(item.value)"\n [class.mat-calendar-cell-semi-selected]="_isSemiSelected(item.value) || _isBetweenOverAndBegin(item.value)"\n [class.mat-calendar-cell-over]="_previewCellOver(item.value)"\n [attr.aria-label]="item.ariaLabel"\n [attr.aria-disabled]="!item.enabled || null"\n [attr.aria-selected]="selectedValue === item.value"\n (click)="_cellClicked(item)"\n (mouseover)="_mouseOverCell(item)"\n [style.width]="_cellWidth"\n [style.paddingTop]="_cellPadding"\n [style.paddingBottom]="_cellPadding">\n <div class="mat-calendar-body-cell-content"\n [class.mat-calendar-body-selected]="begin === item.value || end === item.value || selectedValue === item.value"\n [class.mat-calendar-body-semi-selected]="_isSemiSelected(item.value)"\n [class.mat-calendar-body-today]="todayValue === item.value">\n {{item.displayValue}}\n </div>\n </td>\n</tr>\n',host:{class:"mat-calendar-body",role:"grid","aria-readonly":"true"},exportAs:"matCalendarBody",encapsulation:a.ViewEncapsulation.None,changeDetection:a.ChangeDetectionStrategy.OnPush,styles:[".mat-calendar-body{min-width:224px}.mat-calendar-body-label{height:0;line-height:0;padding-left:4.71429%;padding-right:4.71429%;text-align:left}.mat-calendar-body-cell{cursor:pointer;height:0;line-height:0;outline:0;position:relative;text-align:center}.mat-calendar-body-disabled{cursor:default}.mat-calendar-body-cell-content{align-items:center;border-radius:999px;border-style:solid;border-width:1px;box-sizing:border-box;display:flex;height:90%;justify-content:center;left:5%;line-height:1;position:absolute;top:5%;width:90%}[dir=rtl] .mat-calendar-body-label{text-align:right}"]}]}],B.ctorParameters=function(){return[{type:a.ElementRef},{type:a.NgZone}]},B.propDecorators={label:[{type:a.Input}],rangeHoverEffect:[{type:a.Input}],rows:[{type:a.Input}],todayValue:[{type:a.Input}],selectedValue:[{type:a.Input}],begin:[{type:a.Input}],end:[{type:a.Input}],beginSelected:[{type:a.Input}],isBeforeSelected:[{type:a.Input}],rangeFull:[{type:a.Input}],rangeMode:[{type:a.Input}],labelMinRequiredCells:[{type:a.Input}],numCols:[{type:a.Input}],activeCell:[{type:a.Input}],cellAspectRatio:[{type:a.Input}],selectedValueChange:[{type:a.Output}]};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var z=function(){function e(e,t,i,n){if(this._changeDetectorRef=e,this._dateFormats=t,this._dateAdapter=i,this._dir=n,this.rangeMode=!1,this.rangeHoverEffect=!0,this.closeAfterSelection=!0,this._rangeFull=!1,this.selectedChange=new a.EventEmitter,this._userSelection=new a.EventEmitter,this.activeDateChange=new a.EventEmitter,!this._dateAdapter)throw T("DateAdapter");if(!this._dateFormats)throw T("MAT_DATE_FORMATS");this._activeDate=this._dateAdapter.today()}return Object.defineProperty(e.prototype,"beginDate",{get:function(){return this._beginDate},set:function(e){this._beginDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e)),this.updateRangeSpecificValues()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"endDate",{get:function(){return this._endDate},set:function(e){this._endDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e)),this.updateRangeSpecificValues()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"beginDateSelected",{set:function(e){this._beginDateSelected=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeDate",{get:function(){return this._activeDate},set:function(e){var t=this._activeDate,a=this._getValidDateOrNull(this._dateAdapter.deserialize(e))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(a,this.minDate,this.maxDate),this._hasSameMonthAndYear(t,this._activeDate)||this._init()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this._selected},set:function(e){this._selected=this._getValidDateOrNull(this._dateAdapter.deserialize(e)),this._selectedDate=this._getDateInCurrentMonth(this._selected)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minDate",{get:function(){return this._minDate},set:function(e){this._minDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxDate",{get:function(){return this._maxDate},set:function(e){this._maxDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!1,configurable:!0}),e.prototype.ngAfterContentInit=function(){this._init()},e.prototype._dateSelected=function(e){if(this.rangeMode){var t=this._dateAdapter.getYear(this.activeDate),a=this._dateAdapter.getMonth(this.activeDate),i=this._dateAdapter.createDate(t,a,e);this._beginDateSelected?(this._beginDateSelected=null,this.selectedChange.emit(i),this._userSelection.emit()):(this._beginDateSelected=i,this.selectedChange.emit(i)),this._createWeekCells(),this.activeDate=i,this._focusActiveCell()}else if(this._selectedDate!=e){t=this._dateAdapter.getYear(this.activeDate),a=this._dateAdapter.getMonth(this.activeDate),i=this._dateAdapter.createDate(t,a,e);this.selectedChange.emit(i),this._userSelection.emit(),this._createWeekCells()}},e.prototype._handleCalendarBodyKeydown=function(e){var t=this._activeDate,a=this._isRtl();switch(e.keyCode){case c.LEFT_ARROW:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,a?1:-1);break;case c.RIGHT_ARROW:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,a?-1:1);break;case c.UP_ARROW:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,-7);break;case c.DOWN_ARROW:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,7);break;case c.HOME:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,1-this._dateAdapter.getDate(this._activeDate));break;case c.END:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,this._dateAdapter.getNumDaysInMonth(this._activeDate)-this._dateAdapter.getDate(this._activeDate));break;case c.PAGE_UP:this.activeDate=e.altKey?this._dateAdapter.addCalendarYears(this._activeDate,-1):this._dateAdapter.addCalendarMonths(this._activeDate,-1);break;case c.PAGE_DOWN:this.activeDate=e.altKey?this._dateAdapter.addCalendarYears(this._activeDate,1):this._dateAdapter.addCalendarMonths(this._activeDate,1);break;case c.ENTER:case c.SPACE:return void(this.dateFilter&&!this.dateFilter(this._activeDate)||(this._dateSelected(this._dateAdapter.getDate(this._activeDate)),this._beginDateSelected||this._userSelection.emit(),!this._beginDateSelected&&this.closeAfterSelection||this._focusActiveCell(),e.preventDefault()));default:return}this._dateAdapter.compareDate(t,this.activeDate)&&this.activeDateChange.emit(this.activeDate),this._focusActiveCell(),e.preventDefault()},e.prototype._init=function(){this.updateRangeSpecificValues(),this._selectedDate=this._getDateInCurrentMonth(this.selected),this._todayDate=this._getDateInCurrentMonth(this._dateAdapter.today()),this._monthLabel=this._dateAdapter.getMonthNames("short")[this._dateAdapter.getMonth(this.activeDate)].toLocaleUpperCase();var e=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),this._dateAdapter.getMonth(this.activeDate),1);this._firstWeekOffset=(7+this._dateAdapter.getDayOfWeek(e)-this._dateAdapter.getFirstDayOfWeek())%7,this._initWeekdays(),this._createWeekCells(),this._changeDetectorRef.markForCheck()},e.prototype._focusActiveCell=function(){this._matCalendarBody._focusActiveCell()},e.prototype._initWeekdays=function(){var e=this._dateAdapter.getFirstDayOfWeek(),t=this._dateAdapter.getDayOfWeekNames("narrow"),a=this._dateAdapter.getDayOfWeekNames("long").map((function(e,a){return{long:e,narrow:t[a]}}));this._weekdays=a.slice(e).concat(a.slice(0,e))},e.prototype._createWeekCells=function(){var e=this._dateAdapter.getNumDaysInMonth(this.activeDate),t=this._dateAdapter.getDateNames();this._weeks=[[]];for(var a=0,i=this._firstWeekOffset;a<e;a++,i++){7==i&&(this._weeks.push([]),i=0);var n=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),this._dateAdapter.getMonth(this.activeDate),a+1),r=this._shouldEnableDate(n),o=this._dateAdapter.format(n,this._dateFormats.display.dateA11yLabel),s=this.dateClass?this.dateClass(n):void 0;this._weeks[this._weeks.length-1].push(new L(a+1,t[a],o,r,s))}},e.prototype._shouldEnableDate=function(e){return!!e&&(!this.dateFilter||this.dateFilter(e))&&(!this.minDate||this._dateAdapter.compareDate(e,this.minDate)>=0)&&(!this.maxDate||this._dateAdapter.compareDate(e,this.maxDate)<=0)},e.prototype._getDateInCurrentMonth=function(e){return e&&this._hasSameMonthAndYear(e,this.activeDate)?this._dateAdapter.getDate(e):null},e.prototype._hasSameMonthAndYear=function(e,t){return!(!e||!t||this._dateAdapter.getMonth(e)!=this._dateAdapter.getMonth(t)||this._dateAdapter.getYear(e)!=this._dateAdapter.getYear(t))},e.prototype._getValidDateOrNull=function(e){return this._dateAdapter.isDateInstance(e)&&this._dateAdapter.isValid(e)?e:null},e.prototype._isRtl=function(){return this._dir&&"rtl"===this._dir.value},e.prototype.updateRangeSpecificValues=function(){this.rangeMode?(this._beginDateNumber=this._getDateInCurrentMonth(this._beginDate),this._endDateNumber=this._getDateInCurrentMonth(this._endDate),this._rangeFull=this.beginDate&&this.endDate&&!this._beginDateNumber&&!this._endDateNumber&&this._dateAdapter.compareDate(this.beginDate,this.activeDate)<=0&&this._dateAdapter.compareDate(this.activeDate,this.endDate)<=0):(this._beginDateNumber=this._endDateNumber=null,this._rangeFull=!1)},e}();z.decorators=[{type:a.Component,args:[{selector:"sat-month-view",template:'<table class="mat-calendar-table">\n <thead class="mat-calendar-table-header">\n <tr><th *ngFor="let day of _weekdays" [attr.aria-label]="day.long">{{day.narrow}}</th></tr>\n <tr><th class="mat-calendar-table-header-divider" colspan="7" aria-hidden="true"></th></tr>\n </thead>\n <tbody sat-calendar-body\n [label]="_monthLabel"\n [rows]="_weeks"\n [todayValue]="_todayDate"\n [selectedValue]="_selectedDate"\n [begin]="_beginDateNumber"\n [end]="_endDateNumber"\n [beginSelected]="_beginDateSelected"\n [isBeforeSelected]="_beginDateSelected && _dateAdapter.compareDate(activeDate, _beginDateSelected) < 0"\n [rangeFull]="_rangeFull"\n [rangeMode]="rangeMode"\n [rangeHoverEffect]="rangeHoverEffect"\n [labelMinRequiredCells]="3"\n [activeCell]="_dateAdapter.getDate(activeDate) - 1"\n (selectedValueChange)="_dateSelected($event)"\n (keydown)="_handleCalendarBodyKeydown($event)">\n </tbody>\n</table>\n',exportAs:"matMonthView",encapsulation:a.ViewEncapsulation.None,changeDetection:a.ChangeDetectionStrategy.OnPush}]}],z.ctorParameters=function(){return[{type:a.ChangeDetectorRef},{type:void 0,decorators:[{type:a.Optional},{type:a.Inject,args:[C]}]},{type:A,decorators:[{type:a.Optional}]},{type:p.Directionality,decorators:[{type:a.Optional}]}]},z.propDecorators={beginDate:[{type:a.Input}],endDate:[{type:a.Input}],rangeMode:[{type:a.Input}],rangeHoverEffect:[{type:a.Input}],closeAfterSelection:[{type:a.Input}],beginDateSelected:[{type:a.Input}],activeDate:[{type:a.Input}],selected:[{type:a.Input}],minDate:[{type:a.Input}],maxDate:[{type:a.Input}],dateFilter:[{type:a.Input}],dateClass:[{type:a.Input}],selectedChange:[{type:a.Output}],_userSelection:[{type:a.Output}],activeDateChange:[{type:a.Output}],_matCalendarBody:[{type:a.ViewChild,args:[B,{static:!1}]}]};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var W=24,H=function(){function e(e,t,i){if(this._changeDetectorRef=e,this._dateAdapter=t,this._dir=i,this.selectedChange=new a.EventEmitter,this.yearSelected=new a.EventEmitter,this.activeDateChange=new a.EventEmitter,!this._dateAdapter)throw T("DateAdapter");this._activeDate=this._dateAdapter.today()}return Object.defineProperty(e.prototype,"activeDate",{get:function(){return this._activeDate},set:function(e){var t=this._activeDate,a=this._getValidDateOrNull(this._dateAdapter.deserialize(e))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(a,this.minDate,this.maxDate),U(this._dateAdapter,t,this._activeDate,this.minDate,this.maxDate)||this._init()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this._selected},set:function(e){this._selected=this._getValidDateOrNull(this._dateAdapter.deserialize(e)),this._selectedYear=this._selected&&this._dateAdapter.getYear(this._selected)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minDate",{get:function(){return this._minDate},set:function(e){this._minDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxDate",{get:function(){return this._maxDate},set:function(e){this._maxDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!1,configurable:!0}),e.prototype.ngAfterContentInit=function(){this._init()},e.prototype._init=function(){var e=this;this._todayYear=this._dateAdapter.getYear(this._dateAdapter.today());var t=this._dateAdapter.getYear(this._activeDate)-q(this._dateAdapter,this.activeDate,this.minDate,this.maxDate);this._years=[];for(var a=0,i=[];a<W;a++)i.push(t+a),4==i.length&&(this._years.push(i.map((function(t){return e._createCellForYear(t)}))),i=[]);this._changeDetectorRef.markForCheck()},e.prototype._yearSelected=function(e){this.yearSelected.emit(this._dateAdapter.createDate(e,0,1));var t=this._dateAdapter.getMonth(this.activeDate),a=this._dateAdapter.getNumDaysInMonth(this._dateAdapter.createDate(e,t,1));this.selectedChange.emit(this._dateAdapter.createDate(e,t,Math.min(this._dateAdapter.getDate(this.activeDate),a)))},e.prototype._handleCalendarBodyKeydown=function(e){var t=this._activeDate,a=this._isRtl();switch(e.keyCode){case c.LEFT_ARROW:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,a?1:-1);break;case c.RIGHT_ARROW:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,a?-1:1);break;case c.UP_ARROW:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,-4);break;case c.DOWN_ARROW:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,4);break;case c.HOME:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,-q(this._dateAdapter,this.activeDate,this.minDate,this.maxDate));break;case c.END:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,W-q(this._dateAdapter,this.activeDate,this.minDate,this.maxDate)-1);break;case c.PAGE_UP:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?-240:-24);break;case c.PAGE_DOWN:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?240:W);break;case c.ENTER:case c.SPACE:this._yearSelected(this._dateAdapter.getYear(this._activeDate));break;default:return}this._dateAdapter.compareDate(t,this.activeDate)&&this.activeDateChange.emit(this.activeDate),this._focusActiveCell(),e.preventDefault()},e.prototype._getActiveCell=function(){return q(this._dateAdapter,this.activeDate,this.minDate,this.maxDate)},e.prototype._focusActiveCell=function(){this._matCalendarBody._focusActiveCell()},e.prototype._createCellForYear=function(e){var t=this._dateAdapter.getYearName(this._dateAdapter.createDate(e,0,1));return new L(e,t,t,this._shouldEnableYear(e))},e.prototype._shouldEnableYear=function(e){if(null==e||this.maxDate&&e>this._dateAdapter.getYear(this.maxDate)||this.minDate&&e<this._dateAdapter.getYear(this.minDate))return!1;if(!this.dateFilter)return!0;for(var t=this._dateAdapter.createDate(e,0,1);this._dateAdapter.getYear(t)==e;t=this._dateAdapter.addCalendarDays(t,1))if(this.dateFilter(t))return!0;return!1},e.prototype._getValidDateOrNull=function(e){return this._dateAdapter.isDateInstance(e)&&this._dateAdapter.isValid(e)?e:null},e.prototype._isRtl=function(){return this._dir&&"rtl"===this._dir.value},e}();function U(e,t,a,i,n){var r=e.getYear(t),o=e.getYear(a),s=K(e,i,n);return Math.floor((r-s)/W)===Math.floor((o-s)/W)}function q(e,t,a,i){var n,r=e.getYear(t);return((r-K(e,a,i))%(n=W)+n)%n}function K(e,t,a){var i=0;a?i=e.getYear(a)-W+1:t&&(i=e.getYear(t));return i}H.decorators=[{type:a.Component,args:[{selector:"sat-multi-year-view",template:'<table class="mat-calendar-table" role="presentation">\n <thead class="mat-calendar-table-header">\n <tr><th class="mat-calendar-table-header-divider" colspan="4"></th></tr>\n </thead>\n <tbody sat-calendar-body\n [rows]="_years"\n [todayValue]="_todayYear"\n [selectedValue]="_selectedYear"\n [numCols]="4"\n [cellAspectRatio]="4 / 7"\n [activeCell]="_getActiveCell()"\n (selectedValueChange)="_yearSelected($event)"\n (keydown)="_handleCalendarBodyKeydown($event)">\n </tbody>\n</table>\n',exportAs:"matMultiYearView",encapsulation:a.ViewEncapsulation.None,changeDetection:a.ChangeDetectionStrategy.OnPush}]}],H.ctorParameters=function(){return[{type:a.ChangeDetectorRef},{type:A,decorators:[{type:a.Optional}]},{type:p.Directionality,decorators:[{type:a.Optional}]}]},H.propDecorators={activeDate:[{type:a.Input}],selected:[{type:a.Input}],minDate:[{type:a.Input}],maxDate:[{type:a.Input}],dateFilter:[{type:a.Input}],selectedChange:[{type:a.Output}],yearSelected:[{type:a.Output}],activeDateChange:[{type:a.Output}],_matCalendarBody:[{type:a.ViewChild,args:[B,{static:!1}]}]};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var $=function(){function e(e,t,i,n){if(this._changeDetectorRef=e,this._dateFormats=t,this._dateAdapter=i,this._dir=n,this.selectedChange=new a.EventEmitter,this.monthSelected=new a.EventEmitter,this.activeDateChange=new a.EventEmitter,!this._dateAdapter)throw T("DateAdapter");if(!this._dateFormats)throw T("MAT_DATE_FORMATS");this._activeDate=this._dateAdapter.today()}return Object.defineProperty(e.prototype,"activeDate",{get:function(){return this._activeDate},set:function(e){var t=this._activeDate,a=this._getValidDateOrNull(this._dateAdapter.deserialize(e))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(a,this.minDate,this.maxDate),this._dateAdapter.getYear(t)!==this._dateAdapter.getYear(this._activeDate)&&this._init()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this._selected},set:function(e){this._selected=this._getValidDateOrNull(this._dateAdapter.deserialize(e)),this._selectedMonth=this._getMonthInCurrentYear(this._selected)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minDate",{get:function(){return this._minDate},set:function(e){this._minDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxDate",{get:function(){return this._maxDate},set:function(e){this._maxDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!1,configurable:!0}),e.prototype.ngAfterContentInit=function(){this._init()},e.prototype._monthSelected=function(e){var t=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),e,1);this.monthSelected.emit(t);var a=this._dateAdapter.getNumDaysInMonth(t);this.selectedChange.emit(this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),e,Math.min(this._dateAdapter.getDate(this.activeDate),a)))},e.prototype._handleCalendarBodyKeydown=function(e){var t=this._activeDate,a=this._isRtl();switch(e.keyCode){case c.LEFT_ARROW:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,a?1:-1);break;case c.RIGHT_ARROW:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,a?-1:1);break;case c.UP_ARROW:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,-4);break;case c.DOWN_ARROW:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,4);break;case c.HOME:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,-this._dateAdapter.getMonth(this._activeDate));break;case c.END:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,11-this._dateAdapter.getMonth(this._activeDate));break;case c.PAGE_UP:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?-10:-1);break;case c.PAGE_DOWN:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?10:1);break;case c.ENTER:case c.SPACE:this._monthSelected(this._dateAdapter.getMonth(this._activeDate));break;default:return}this._dateAdapter.compareDate(t,this.activeDate)&&this.activeDateChange.emit(this.activeDate),this._focusActiveCell(),e.preventDefault()},e.prototype._init=function(){var e=this;this._selectedMonth=this._getMonthInCurrentYear(this.selected),this._todayMonth=this._getMonthInCurrentYear(this._dateAdapter.today()),this._yearLabel=this._dateAdapter.getYearName(this.activeDate);var t=this._dateAdapter.getMonthNames("short");this._months=[[0,1,2,3],[4,5,6,7],[8,9,10,11]].map((function(a){return a.map((function(a){return e._createCellForMonth(a,t[a])}))})),this._changeDetectorRef.markForCheck()},e.prototype._focusActiveCell=function(){this._matCalendarBody._focusActiveCell()},e.prototype._getMonthInCurrentYear=function(e){return e&&this._dateAdapter.getYear(e)==this._dateAdapter.getYear(this.activeDate)?this._dateAdapter.getMonth(e):null},e.prototype._createCellForMonth=function(e,t){var a=this._dateAdapter.format(this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),e,1),this._dateFormats.display.monthYearA11yLabel);return new L(e,t.toLocaleUpperCase(),a,this._shouldEnableMonth(e))},e.prototype._shouldEnableMonth=function(e){var t=this._dateAdapter.getYear(this.activeDate);if(null==e||this._isYearAndMonthAfterMaxDate(t,e)||this._isYearAndMonthBeforeMinDate(t,e))return!1;if(!this.dateFilter)return!0;for(var a=this._dateAdapter.createDate(t,e,1);this._dateAdapter.getMonth(a)==e;a=this._dateAdapter.addCalendarDays(a,1))if(this.dateFilter(a))return!0;return!1},e.prototype._isYearAndMonthAfterMaxDate=function(e,t){if(this.maxDate){var a=this._dateAdapter.getYear(this.maxDate),i=this._dateAdapter.getMonth(this.maxDate);return e>a||e===a&&t>i}return!1},e.prototype._isYearAndMonthBeforeMinDate=function(e,t){if(this.minDate){var a=this._dateAdapter.getYear(this.minDate),i=this._dateAdapter.getMonth(this.minDate);return e<a||e===a&&t<i}return!1},e.prototype._getValidDateOrNull=function(e){return this._dateAdapter.isDateInstance(e)&&this._dateAdapter.isValid(e)?e:null},e.prototype._isRtl=function(){return this._dir&&"rtl"===this._dir.value},e}();$.decorators=[{type:a.Component,args:[{selector:"sat-year-view",template:'<table class="mat-calendar-table" role="presentation">\n <thead class="mat-calendar-table-header">\n <tr><th class="mat-calendar-table-header-divider" colspan="4"></th></tr>\n </thead>\n <tbody sat-calendar-body\n [label]="_yearLabel"\n [rows]="_months"\n [todayValue]="_todayMonth"\n [selectedValue]="_selectedMonth"\n [labelMinRequiredCells]="2"\n [numCols]="4"\n [cellAspectRatio]="4 / 7"\n [activeCell]="_dateAdapter.getMonth(activeDate)"\n (selectedValueChange)="_monthSelected($event)"\n (keydown)="_handleCalendarBodyKeydown($event)">\n </tbody>\n</table>\n',exportAs:"matYearView",encapsulation:a.ViewEncapsulation.None,changeDetection:a.ChangeDetectionStrategy.OnPush}]}],$.ctorParameters=function(){return[{type:a.ChangeDetectorRef},{type:void 0,decorators:[{type:a.Optional},{type:a.Inject,args:[C]}]},{type:A,decorators:[{type:a.Optional}]},{type:p.Directionality,decorators:[{type:a.Optional}]}]},$.propDecorators={activeDate:[{type:a.Input}],selected:[{type:a.Input}],minDate:[{type:a.Input}],maxDate:[{type:a.Input}],dateFilter:[{type:a.Input}],selectedChange:[{type:a.Output}],monthSelected:[{type:a.Output}],activeDateChange:[{type:a.Output}],_matCalendarBody:[{type:a.ViewChild,args:[B,{static:!1}]}]};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var G=function(){function e(e,t,a,i,n){this._intl=e,this.calendar=t,this._dateAdapter=a,this._dateFormats=i,this.calendar.stateChanges.subscribe((function(){return n.markForCheck()}))}return Object.defineProperty(e.prototype,"periodButtonText",{get:function(){if("month"==this.calendar.currentView)return this._dateAdapter.format(this.calendar.activeDate,this._dateFormats.display.monthYearLabel).toLocaleUpperCase();if("year"==this.calendar.currentView)return this._dateAdapter.getYearName(this.calendar.activeDate);var e=this._dateAdapter.getYear(this.calendar.activeDate)-q(this._dateAdapter,this.calendar.activeDate,this.calendar.minDate,this.calendar.maxDate),t=e+W-1;return this._dateAdapter.getYearName(this._dateAdapter.createDate(e,0,1))+"\n – "+this._dateAdapter.getYearName(this._dateAdapter.createDate(t,0,1))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"periodButtonLabel",{get:function(){return"month"==this.calendar.currentView?this._intl.switchToMultiYearViewLabel:this._intl.switchToMonthViewLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"prevButtonLabel",{get:function(){return{month:this._intl.prevMonthLabel,year:this._intl.prevYearLabel,"multi-year":this._intl.prevMultiYearLabel}[this.calendar.currentView]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextButtonLabel",{get:function(){return{month:this._intl.nextMonthLabel,year:this._intl.nextYearLabel,"multi-year":this._intl.nextMultiYearLabel}[this.calendar.currentView]},enumerable:!1,configurable:!0}),e.prototype.currentPeriodClicked=function(){var e="month"===this.calendar.orderPeriodLabel?["month","year","multi-year"]:["month","multi-year","month"];switch(this.calendar.currentView){case"month":this.calendar.currentView=e[1];break;case"year":this.calendar.currentView=e[2];break;default:this.calendar.currentView=e[0]}},e.prototype.previousClicked=function(){this.calendar.activeDate="month"==this.calendar.currentView?this._dateAdapter.addCalendarMonths(this.calendar.activeDate,-1):this._dateAdapter.addCalendarYears(this.calendar.activeDate,"year"==this.calendar.currentView?-1:-24)},e.prototype.nextClicked=function(){this.calendar.activeDate="month"==this.calendar.currentView?this._dateAdapter.addCalendarMonths(this.calendar.activeDate,1):this._dateAdapter.addCalendarYears(this.calendar.activeDate,"year"==this.calendar.currentView?1:W)},e.prototype.previousEnabled=function(){return!this.calendar.minDate||(!this.calendar.minDate||!this._isSameView(this.calendar.activeDate,this.calendar.minDate))},e.prototype.nextEnabled=function(){return!this.calendar.maxDate||!this._isSameView(this.calendar.activeDate,this.calendar.maxDate)},e.prototype._isSameView=function(e,t){return"month"==this.calendar.currentView?this._dateAdapter.getYear(e)==this._dateAdapter.getYear(t)&&this._dateAdapter.getMonth(e)==this._dateAdapter.getMonth(t):"year"==this.calendar.currentView?this._dateAdapter.getYear(e)==this._dateAdapter.getYear(t):U(this._dateAdapter,e,t,this.calendar.minDate,this.calendar.maxDate)},e}();G.decorators=[{type:a.Component,args:[{selector:"sat-calendar-header",template:'<div class="mat-calendar-header">\n <div class="mat-calendar-controls">\n <button mat-button type="button" class="mat-calendar-period-button"\n (click)="currentPeriodClicked()" [attr.aria-label]="periodButtonLabel"\n cdkAriaLive="polite">\n {{periodButtonText}}\n <div class="mat-calendar-arrow"\n [class.mat-calendar-invert]="calendar.currentView != \'month\'"></div>\n </button>\n\n <div class="mat-calendar-spacer"></div>\n\n <ng-content></ng-content>\n\n <button mat-icon-button type="button" class="mat-calendar-previous-button"\n [disabled]="!previousEnabled()" (click)="previousClicked()"\n [attr.aria-label]="prevButtonLabel">\n </button>\n\n <button mat-icon-button type="button" class="mat-calendar-next-button"\n [disabled]="!nextEnabled()" (click)="nextClicked()"\n [attr.aria-label]="nextButtonLabel">\n </button>\n </div>\n</div>\n',exportAs:"matCalendarHeader",encapsulation:a.ViewEncapsulation.None,changeDetection:a.ChangeDetectionStrategy.OnPush}]}],G.ctorParameters=function(){return[{type:j},{type:X,decorators:[{type:a.Inject,args:[a.forwardRef((function(){return X}))]}]},{type:A,decorators:[{type:a.Optional}]},{type:void 0,decorators:[{type:a.Optional},{type:a.Inject,args:[C]}]},{type:a.ChangeDetectorRef}]};var Z=function(){};Z.decorators=[{type:a.Component,args:[{moduleId:module.id,selector:"sat-calendar-footer",template:"",exportAs:"matCalendarFooter",encapsulation:a.ViewEncapsulation.None,changeDetection:a.ChangeDetectionStrategy.OnPush}]}];var X=function(){function e(e,t,n,r){var o=this;if(this._dateAdapter=t,this._dateFormats=n,this._changeDetectorRef=r,this.rangeMode=!1,this.rangeHoverEffect=!0,this.closeAfterSelection=!0,this.dateRangesChange=new a.EventEmitter,this.beginDateSelected=!1,this.beginDateSelectedChange=new a.EventEmitter,this._moveFocusOnNextTick=!1,this.startView="month",this.orderPeriodLabel="multi-year",this.selectedChange=new a.EventEmitter,this.yearSelected=new a.EventEmitter,this.monthSelected=new a.EventEmitter,this._userSelection=new a.EventEmitter,this.stateChanges=new i.Subject,!this._dateAdapter)throw T("DateAdapter");if(!this._dateFormats)throw T("MAT_DATE_FORMATS");this._intlChanges=e.changes.subscribe((function(){r.markForCheck(),o.stateChanges.next()}))}return Object.defineProperty(e.prototype,"beginDate",{get:function(){return this._beginDate},set:function(e){this._beginDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"endDate",{get:function(){return this._endDate},set:function(e){this._endDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"startAt",{get:function(){return this._startAt},set:function(e){this._startAt=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this._selected},set:function(e){this._selected=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minDate",{get:function(){return this._minDate},set:function(e){this._minDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxDate",{get:function(){return this._maxDate},set:function(e){this._maxDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeDate",{get:function(){return this._clampedActiveDate},set:function(e){this._clampedActiveDate=this._dateAdapter.clampDate(e,this.minDate,this.maxDate),this.stateChanges.next(),this._changeDetectorRef.markForCheck()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentView",{get:function(){return this._currentView},set:function(e){this._currentView=e,this._moveFocusOnNextTick=!0,this._changeDetectorRef.markForCheck()},enumerable:!1,configurable:!0}),e.prototype.ngAfterContentInit=function(){this._calendarHeaderPortal=new o.ComponentPortal(this.headerComponent||G),this._calendarFooterPortal=new o.ComponentPortal(this.footerComponent||Z),this.activeDate=this.startAt||this._dateAdapter.today(),this._currentView=this.startView},e.prototype.ngAfterViewChecked=function(){this._moveFocusOnNextTick&&(this._moveFocusOnNextTick=!1,this.focusActiveCell())},e.prototype.ngOnDestroy=function(){this._intlChanges.unsubscribe(),this.stateChanges.complete()},e.prototype.ngOnChanges=function(e){var t=e.minDate||e.maxDate||e.dateFilter;if(t&&!t.firstChange){var a=this._getCurrentViewComponent();a&&(this._changeDetectorRef.detectChanges(),a._init())}this.stateChanges.next()},e.prototype.focusActiveCell=function(){this._getCurrentViewComponent()._focusActiveCell()},e.prototype.updateTodaysDate=function(){("month"==this.currentView?this.monthView:"year"==this.currentView?this.yearView:this.multiYearView).ngAfterContentInit()},e.prototype._dateSelected=function(e){this.rangeMode?this.beginDateSelected?(this.beginDateSelected=!1,this._dateAdapter.compareDate(this.beginDate,e)<=0?this.endDate=e:(this.endDate=this.beginDate,this.beginDate=e),this.dateRangesChange.emit({begin:this.beginDate,end:this.endDate})):(this.beginDateSelected=e,this.beginDate=e,this.endDate=e,this.beginDateSelectedChange.emit(e)):this._dateAdapter.sameDate(e,this.selected)||(this.selected=e,this.selectedChange.emit(e))},e.prototype._yearSelectedInMultiYearView=function(e){this.yearSelected.emit(e)},e.prototype._monthSelectedInYearView=function(e){this.monthSelected.emit(e)},e.prototype._userSelected=function(){this._userSelection.emit()},e.prototype._goToDateInView=function(e,t){this.activeDate=e,this.currentView=t},e.prototype._getValidDateOrNull=function(e){return this._dateAdapter.isDateInstance(e)&&this._dateAdapter.isValid(e)?e:null},e.prototype._getCurrentViewComponent=function(){return this.monthView||this.yearView||this.multiYearView},e.prototype._reset=function(){if(!this.rangeMode)return this._selected=null,this.selectedChange.emit(null);this._beginDate=null,this._endDate=null,this.beginDateSelected=null,this.dateRangesChange.emit(null)},e}();X.decorators=[{type:a.Component,args:[{selector:"sat-calendar",template:'\n<ng-template [cdkPortalOutlet]="_calendarHeaderPortal"></ng-template>\n\n<div class="mat-calendar-content" [ngSwitch]="currentView" cdkMonitorSubtreeFocus tabindex="-1">\n <sat-month-view\n *ngSwitchCase="\'month\'"\n [(activeDate)]="activeDate"\n [selected]="selected"\n [beginDate]="beginDate"\n [endDate]="endDate"\n [rangeMode]="rangeMode"\n [closeAfterSelection]="closeAfterSelection"\n [rangeHoverEffect]="rangeHoverEffect"\n [dateFilter]="dateFilter"\n [maxDate]="maxDate"\n [minDate]="minDate"\n [dateClass]="dateClass"\n [beginDateSelected]="beginDat