blob: 2c520a46cadeff6d84ffa2cd6e3f2bcbd1dbaabe [file] [log] [blame]
/**
* @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){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("rxjs"),require("rxjs/operators"),require("@angular/cdk/keycodes"),require("@angular/material/core"),require("@angular/cdk/bidi"),require("@angular/cdk/portal"),require("@angular/animations"),require("@angular/cdk/coercion"),require("@angular/cdk/overlay"),require("@angular/common"),require("@angular/material/dialog"),require("@angular/forms"),require("@angular/material/form-field"),require("@angular/material/input"),require("@angular/material/button"),require("@angular/cdk/a11y")):"function"==typeof define&&define.amd?define("@angular/material/datepicker",["exports","@angular/core","rxjs","rxjs/operators","@angular/cdk/keycodes","@angular/material/core","@angular/cdk/bidi","@angular/cdk/portal","@angular/animations","@angular/cdk/coercion","@angular/cdk/overlay","@angular/common","@angular/material/dialog","@angular/forms","@angular/material/form-field","@angular/material/input","@angular/material/button","@angular/cdk/a11y"],e):e((t.ng=t.ng||{},t.ng.material=t.ng.material||{},t.ng.material.datepicker={}),t.ng.core,t.rxjs,t.rxjs.operators,t.ng.cdk.keycodes,t.ng.material.core,t.ng.cdk.bidi,t.ng.cdk.portal,t.ng.animations,t.ng.cdk.coercion,t.ng.cdk.overlay,t.ng.common,t.ng.material.dialog,t.ng.forms,t.ng.material.formField,t.ng.material.input,t.ng.material.button,t.ng.cdk.a11y)}(this,function(t,e,a,i,r,n,o,s,d,l,c,p,h,u,_,m,f,g){"use strict";function y(t,e){function a(){this.constructor=t}w(t,e),t.prototype=null===e?Object.create(e):(a.prototype=e.prototype,new a)}function D(t){return Error("MatDatepicker: No provider found for "+t+". You must import one of the following modules at your application root: MatNativeDateModule, MatMomentDateModule, or provide a custom implementation.")}function v(t,e,a,i,r){var n=t.getYear(e),o=t.getYear(a),s=A(t,i,r);return Math.floor((n-s)/M)===Math.floor((o-s)/M)}function b(t,e,a,i){return C(t.getYear(e)-A(t,a,i),M)}function A(t,e,a){var i=0;if(a){i=t.getYear(a)-M+1}else e&&(i=t.getYear(e));return i}function C(t,e){return(t%e+e)%e}function k(t){return function(){return t.scrollStrategies.reposition()}}var w=function(t,e){return(w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)e.hasOwnProperty(a)&&(t[a]=e[a])})(t,e)},O=function(){function t(){this.changes=new a.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"}return t.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],t.ngInjectableDef=e.ɵɵdefineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),t}(),x=function(){function t(t,e,a,i,r){this.value=t,this.displayValue=e,this.ariaLabel=a,this.enabled=i,this.cssClasses=r}return t}(),V=function(){function t(t,a){this._elementRef=t,this._ngZone=a,this.numCols=7,this.activeCell=0,this.cellAspectRatio=1,this.selectedValueChange=new e.EventEmitter}return t.prototype._cellClicked=function(t){t.enabled&&this.selectedValueChange.emit(t.value)},t.prototype.ngOnChanges=function(t){var e=t.numCols,a=this,i=a.rows,r=a.numCols;(t.rows||e)&&(this._firstRowOffset=i&&i.length&&i[0].length?r-i[0].length:0),(t.cellAspectRatio||e||!this._cellPadding)&&(this._cellPadding=50*this.cellAspectRatio/r+"%"),!e&&this._cellWidth||(this._cellWidth=100/r+"%")},t.prototype._isActiveCell=function(t,e){var a=t*this.numCols+e;return t&&(a-=this._firstRowOffset),a==this.activeCell},t.prototype._focusActiveCell=function(){var t=this;this._ngZone.runOutsideAngular(function(){t._ngZone.onStable.asObservable().pipe(i.take(1)).subscribe(function(){var e=t._elementRef.nativeElement.querySelector(".mat-calendar-body-active");e&&e.focus()})})},t.decorators=[{type:e.Component,args:[{selector:"[mat-calendar-body]",template:'<tr *ngIf="_firstRowOffset < labelMinRequiredCells" aria-hidden="true"><td class="mat-calendar-body-label" [attr.colspan]="numCols" [style.paddingTop]="_cellPadding" [style.paddingBottom]="_cellPadding">{{label}}</td></tr><tr *ngFor="let row of rows; let rowIndex = index" role="row"><td *ngIf="rowIndex === 0 && _firstRowOffset" aria-hidden="true" class="mat-calendar-body-label" [attr.colspan]="_firstRowOffset" [style.paddingTop]="_cellPadding" [style.paddingBottom]="_cellPadding">{{_firstRowOffset >= labelMinRequiredCells ? label : \'\'}}</td><td *ngFor="let item of row; let colIndex = index" role="gridcell" class="mat-calendar-body-cell" [ngClass]="item.cssClasses" [tabindex]="_isActiveCell(rowIndex, colIndex) ? 0 : -1" [class.mat-calendar-body-disabled]="!item.enabled" [class.mat-calendar-body-active]="_isActiveCell(rowIndex, colIndex)" [attr.aria-label]="item.ariaLabel" [attr.aria-disabled]="!item.enabled || null" [attr.aria-selected]="selectedValue === item.value" (click)="_cellClicked(item)" [style.width]="_cellWidth" [style.paddingTop]="_cellPadding" [style.paddingBottom]="_cellPadding"><div class="mat-calendar-body-cell-content" [class.mat-calendar-body-selected]="selectedValue === item.value" [class.mat-calendar-body-today]="todayValue === item.value">{{item.displayValue}}</div></td></tr>',styles:[".mat-calendar-body{min-width:224px}.mat-calendar-body-label{height:0;line-height:0;text-align:left;padding-left:4.71429%;padding-right:4.71429%}.mat-calendar-body-cell{position:relative;height:0;line-height:0;text-align:center;outline:0;cursor:pointer}.mat-calendar-body-disabled{cursor:default}.mat-calendar-body-cell-content{position:absolute;top:5%;left:5%;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;line-height:1;border-width:1px;border-style:solid;border-radius:999px}@media (-ms-high-contrast:active){.mat-calendar-body-cell-content{border:none}}@media (-ms-high-contrast:active){.mat-calendar-body-selected,.mat-datepicker-popup:not(:empty){outline:solid 1px}.mat-calendar-body-today{outline:dotted 1px}.cdk-keyboard-focused .mat-calendar-body-active>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected),.cdk-program-focused .mat-calendar-body-active>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected){outline:dotted 2px}}[dir=rtl] .mat-calendar-body-label{text-align:right}"],host:{class:"mat-calendar-body",role:"grid","aria-readonly":"true"},exportAs:"matCalendarBody",encapsulation:e.ViewEncapsulation.None,changeDetection:e.ChangeDetectionStrategy.OnPush}]}],t.ctorParameters=function(){return[{type:e.ElementRef},{type:e.NgZone}]},t.propDecorators={label:[{type:e.Input}],rows:[{type:e.Input}],todayValue:[{type:e.Input}],selectedValue:[{type:e.Input}],labelMinRequiredCells:[{type:e.Input}],numCols:[{type:e.Input}],activeCell:[{type:e.Input}],cellAspectRatio:[{type:e.Input}],selectedValueChange:[{type:e.Output}]},t}(),I=function(){function t(t,a,i,r){if(this._changeDetectorRef=t,this._dateFormats=a,this._dateAdapter=i,this._dir=r,this.selectedChange=new e.EventEmitter,this._userSelection=new e.EventEmitter,this.activeDateChange=new e.EventEmitter,!this._dateAdapter)throw D("DateAdapter");if(!this._dateFormats)throw D("MAT_DATE_FORMATS");var n=this._dateAdapter.getFirstDayOfWeek(),o=this._dateAdapter.getDayOfWeekNames("narrow"),s=this._dateAdapter.getDayOfWeekNames("long"),d=s.map(function(t,e){return{long:t,narrow:o[e]}});this._weekdays=d.slice(n).concat(d.slice(0,n)),this._activeDate=this._dateAdapter.today()}return Object.defineProperty(t.prototype,"activeDate",{get:function(){return this._activeDate},set:function(t){var e=this._activeDate,a=this._getValidDateOrNull(this._dateAdapter.deserialize(t))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(a,this.minDate,this.maxDate),this._hasSameMonthAndYear(e,this._activeDate)||this._init()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selected",{get:function(){return this._selected},set:function(t){this._selected=this._getValidDateOrNull(this._dateAdapter.deserialize(t)),this._selectedDate=this._getDateInCurrentMonth(this._selected)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minDate",{get:function(){return this._minDate},set:function(t){this._minDate=this._getValidDateOrNull(this._dateAdapter.deserialize(t))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxDate",{get:function(){return this._maxDate},set:function(t){this._maxDate=this._getValidDateOrNull(this._dateAdapter.deserialize(t))},enumerable:!0,configurable:!0}),t.prototype.ngAfterContentInit=function(){this._init()},t.prototype._dateSelected=function(t){if(this._selectedDate!=t){var e=this._dateAdapter.getYear(this.activeDate),a=this._dateAdapter.getMonth(this.activeDate),i=this._dateAdapter.createDate(e,a,t);this.selectedChange.emit(i)}this._userSelection.emit()},t.prototype._handleCalendarBodyKeydown=function(t){var e=this._activeDate,a=this._isRtl();switch(t.keyCode){case r.LEFT_ARROW:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,a?1:-1);break;case r.RIGHT_ARROW:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,a?-1:1);break;case r.UP_ARROW:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,-7);break;case r.DOWN_ARROW:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,7);break;case r.HOME:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,1-this._dateAdapter.getDate(this._activeDate));break;case r.END:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,this._dateAdapter.getNumDaysInMonth(this._activeDate)-this._dateAdapter.getDate(this._activeDate));break;case r.PAGE_UP:this.activeDate=t.altKey?this._dateAdapter.addCalendarYears(this._activeDate,-1):this._dateAdapter.addCalendarMonths(this._activeDate,-1);break;case r.PAGE_DOWN:this.activeDate=t.altKey?this._dateAdapter.addCalendarYears(this._activeDate,1):this._dateAdapter.addCalendarMonths(this._activeDate,1);break;case r.ENTER:case r.SPACE:return void(this.dateFilter&&!this.dateFilter(this._activeDate)||(this._dateSelected(this._dateAdapter.getDate(this._activeDate)),this._userSelection.emit(),t.preventDefault()));default:return}this._dateAdapter.compareDate(e,this.activeDate)&&this.activeDateChange.emit(this.activeDate),this._focusActiveCell(),t.preventDefault()},t.prototype._init=function(){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 t=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),this._dateAdapter.getMonth(this.activeDate),1);this._firstWeekOffset=(7+this._dateAdapter.getDayOfWeek(t)-this._dateAdapter.getFirstDayOfWeek())%7,this._createWeekCells(),this._changeDetectorRef.markForCheck()},t.prototype._focusActiveCell=function(){this._matCalendarBody._focusActiveCell()},t.prototype._createWeekCells=function(){var t=this._dateAdapter.getNumDaysInMonth(this.activeDate),e=this._dateAdapter.getDateNames();this._weeks=[[]];for(var a=0,i=this._firstWeekOffset;a<t;a++,i++){7==i&&(this._weeks.push([]),i=0);var r=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),this._dateAdapter.getMonth(this.activeDate),a+1),n=this._shouldEnableDate(r),o=this._dateAdapter.format(r,this._dateFormats.display.dateA11yLabel),s=this.dateClass?this.dateClass(r):void 0;this._weeks[this._weeks.length-1].push(new x(a+1,e[a],o,n,s))}},t.prototype._shouldEnableDate=function(t){return!!t&&(!this.dateFilter||this.dateFilter(t))&&(!this.minDate||this._dateAdapter.compareDate(t,this.minDate)>=0)&&(!this.maxDate||this._dateAdapter.compareDate(t,this.maxDate)<=0)},t.prototype._getDateInCurrentMonth=function(t){return t&&this._hasSameMonthAndYear(t,this.activeDate)?this._dateAdapter.getDate(t):null},t.prototype._hasSameMonthAndYear=function(t,e){return!(!t||!e||this._dateAdapter.getMonth(t)!=this._dateAdapter.getMonth(e)||this._dateAdapter.getYear(t)!=this._dateAdapter.getYear(e))},t.prototype._getValidDateOrNull=function(t){return this._dateAdapter.isDateInstance(t)&&this._dateAdapter.isValid(t)?t:null},t.prototype._isRtl=function(){return this._dir&&"rtl"===this._dir.value},t.decorators=[{type:e.Component,args:[{selector:"mat-month-view",template:'<table class="mat-calendar-table" role="presentation"><thead class="mat-calendar-table-header"><tr><th *ngFor="let day of _weekdays" [attr.aria-label]="day.long">{{day.narrow}}</th></tr><tr><th class="mat-calendar-table-header-divider" colspan="7" aria-hidden="true"></th></tr></thead><tbody mat-calendar-body [label]="_monthLabel" [rows]="_weeks" [todayValue]="_todayDate" [selectedValue]="_selectedDate" [labelMinRequiredCells]="3" [activeCell]="_dateAdapter.getDate(activeDate) - 1" (selectedValueChange)="_dateSelected($event)" (keydown)="_handleCalendarBodyKeydown($event)"></tbody></table>',exportAs:"matMonthView",encapsulation:e.ViewEncapsulation.None,changeDetection:e.ChangeDetectionStrategy.OnPush}]}],t.ctorParameters=function(){return[{type:e.ChangeDetectorRef},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[n.MAT_DATE_FORMATS]}]},{type:n.DateAdapter,decorators:[{type:e.Optional}]},{type:o.Directionality,decorators:[{type:e.Optional}]}]},t.propDecorators={activeDate:[{type:e.Input}],selected:[{type:e.Input}],minDate:[{type:e.Input}],maxDate:[{type:e.Input}],dateFilter:[{type:e.Input}],dateClass:[{type:e.Input}],selectedChange:[{type:e.Output}],_userSelection:[{type:e.Output}],activeDateChange:[{type:e.Output}],_matCalendarBody:[{type:e.ViewChild,args:[V,{static:!1}]}]},t}(),M=24,R=function(){function t(t,a,i){if(this._changeDetectorRef=t,this._dateAdapter=a,this._dir=i,this.selectedChange=new e.EventEmitter,this.yearSelected=new e.EventEmitter,this.activeDateChange=new e.EventEmitter,!this._dateAdapter)throw D("DateAdapter");this._activeDate=this._dateAdapter.today()}return Object.defineProperty(t.prototype,"activeDate",{get:function(){return this._activeDate},set:function(t){var e=this._activeDate,a=this._getValidDateOrNull(this._dateAdapter.deserialize(t))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(a,this.minDate,this.maxDate),v(this._dateAdapter,e,this._activeDate,this.minDate,this.maxDate)||this._init()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selected",{get:function(){return this._selected},set:function(t){this._selected=this._getValidDateOrNull(this._dateAdapter.deserialize(t)),this._selectedYear=this._selected&&this._dateAdapter.getYear(this._selected)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minDate",{get:function(){return this._minDate},set:function(t){this._minDate=this._getValidDateOrNull(this._dateAdapter.deserialize(t))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxDate",{get:function(){return this._maxDate},set:function(t){this._maxDate=this._getValidDateOrNull(this._dateAdapter.deserialize(t))},enumerable:!0,configurable:!0}),t.prototype.ngAfterContentInit=function(){this._init()},t.prototype._init=function(){var t=this;this._todayYear=this._dateAdapter.getYear(this._dateAdapter.today());var e=this._dateAdapter.getYear(this._activeDate),a=e-b(this._dateAdapter,this.activeDate,this.minDate,this.maxDate);this._years=[];for(var i=0,r=[];i<M;i++)r.push(a+i),4==r.length&&(this._years.push(r.map(function(e){return t._createCellForYear(e)})),r=[]);this._changeDetectorRef.markForCheck()},t.prototype._yearSelected=function(t){this.yearSelected.emit(this._dateAdapter.createDate(t,0,1));var e=this._dateAdapter.getMonth(this.activeDate),a=this._dateAdapter.getNumDaysInMonth(this._dateAdapter.createDate(t,e,1));this.selectedChange.emit(this._dateAdapter.createDate(t,e,Math.min(this._dateAdapter.getDate(this.activeDate),a)))},t.prototype._handleCalendarBodyKeydown=function(t){var e=this._activeDate,a=this._isRtl();switch(t.keyCode){case r.LEFT_ARROW:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,a?1:-1);break;case r.RIGHT_ARROW:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,a?-1:1);break;case r.UP_ARROW:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,-4);break;case r.DOWN_ARROW:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,4);break;case r.HOME:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,-b(this._dateAdapter,this.activeDate,this.minDate,this.maxDate));break;case r.END:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,M-b(this._dateAdapter,this.activeDate,this.minDate,this.maxDate)-1);break;case r.PAGE_UP:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,t.altKey?10*-M:-M);break;case r.PAGE_DOWN:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,t.altKey?10*M:M);break;case r.ENTER:case r.SPACE:this._yearSelected(this._dateAdapter.getYear(this._activeDate));break;default:return}this._dateAdapter.compareDate(e,this.activeDate)&&this.activeDateChange.emit(this.activeDate),this._focusActiveCell(),t.preventDefault()},t.prototype._getActiveCell=function(){return b(this._dateAdapter,this.activeDate,this.minDate,this.maxDate)},t.prototype._focusActiveCell=function(){this._matCalendarBody._focusActiveCell()},t.prototype._createCellForYear=function(t){var e=this._dateAdapter.getYearName(this._dateAdapter.createDate(t,0,1));return new x(t,e,e,this._shouldEnableYear(t))},t.prototype._shouldEnableYear=function(t){if(void 0===t||null===t||this.maxDate&&t>this._dateAdapter.getYear(this.maxDate)||this.minDate&&t<this._dateAdapter.getYear(this.minDate))return!1;if(!this.dateFilter)return!0;for(var e=this._dateAdapter.createDate(t,0,1),a=e;this._dateAdapter.getYear(a)==t;a=this._dateAdapter.addCalendarDays(a,1))if(this.dateFilter(a))return!0;return!1},t.prototype._getValidDateOrNull=function(t){return this._dateAdapter.isDateInstance(t)&&this._dateAdapter.isValid(t)?t:null},t.prototype._isRtl=function(){return this._dir&&"rtl"===this._dir.value},t.decorators=[{type:e.Component,args:[{selector:"mat-multi-year-view",template:'<table class="mat-calendar-table" role="presentation"><thead class="mat-calendar-table-header"><tr><th class="mat-calendar-table-header-divider" colspan="4"></th></tr></thead><tbody mat-calendar-body [rows]="_years" [todayValue]="_todayYear" [selectedValue]="_selectedYear" [numCols]="4" [cellAspectRatio]="4 / 7" [activeCell]="_getActiveCell()" (selectedValueChange)="_yearSelected($event)" (keydown)="_handleCalendarBodyKeydown($event)"></tbody></table>',exportAs:"matMultiYearView",encapsulation:e.ViewEncapsulation.None,changeDetection:e.ChangeDetectionStrategy.OnPush}]}],t.ctorParameters=function(){return[{type:e.ChangeDetectorRef},{type:n.DateAdapter,decorators:[{type:e.Optional}]},{type:o.Directionality,decorators:[{type:e.Optional}]}]},t.propDecorators={activeDate:[{type:e.Input}],selected:[{type:e.Input}],minDate:[{type:e.Input}],maxDate:[{type:e.Input}],dateFilter:[{type:e.Input}],selectedChange:[{type:e.Output}],yearSelected:[{type:e.Output}],activeDateChange:[{type:e.Output}],_matCalendarBody:[{type:e.ViewChild,args:[V,{static:!1}]}]},t}(),E=function(){function t(t,a,i,r){if(this._changeDetectorRef=t,this._dateFormats=a,this._dateAdapter=i,this._dir=r,this.selectedChange=new e.EventEmitter,this.monthSelected=new e.EventEmitter,this.activeDateChange=new e.EventEmitter,!this._dateAdapter)throw D("DateAdapter");if(!this._dateFormats)throw D("MAT_DATE_FORMATS");this._activeDate=this._dateAdapter.today()}return Object.defineProperty(t.prototype,"activeDate",{get:function(){return this._activeDate},set:function(t){var e=this._activeDate,a=this._getValidDateOrNull(this._dateAdapter.deserialize(t))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(a,this.minDate,this.maxDate),this._dateAdapter.getYear(e)!==this._dateAdapter.getYear(this._activeDate)&&this._init()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selected",{get:function(){return this._selected},set:function(t){this._selected=this._getValidDateOrNull(this._dateAdapter.deserialize(t)),this._selectedMonth=this._getMonthInCurrentYear(this._selected)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minDate",{get:function(){return this._minDate},set:function(t){this._minDate=this._getValidDateOrNull(this._dateAdapter.deserialize(t))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxDate",{get:function(){return this._maxDate},set:function(t){this._maxDate=this._getValidDateOrNull(this._dateAdapter.deserialize(t))},enumerable:!0,configurable:!0}),t.prototype.ngAfterContentInit=function(){this._init()},t.prototype._monthSelected=function(t){var e=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),t,1);this.monthSelected.emit(e);var a=this._dateAdapter.getNumDaysInMonth(e);this.selectedChange.emit(this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),t,Math.min(this._dateAdapter.getDate(this.activeDate),a)))},t.prototype._handleCalendarBodyKeydown=function(t){var e=this._activeDate,a=this._isRtl();switch(t.keyCode){case r.LEFT_ARROW:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,a?1:-1);break;case r.RIGHT_ARROW:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,a?-1:1);break;case r.UP_ARROW:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,-4);break;case r.DOWN_ARROW:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,4);break;case r.HOME:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,-this._dateAdapter.getMonth(this._activeDate));break;case r.END:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,11-this._dateAdapter.getMonth(this._activeDate));break;case r.PAGE_UP:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,t.altKey?-10:-1);break;case r.PAGE_DOWN:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,t.altKey?10:1);break;case r.ENTER:case r.SPACE:this._monthSelected(this._dateAdapter.getMonth(this._activeDate));break;default:return}this._dateAdapter.compareDate(e,this.activeDate)&&this.activeDateChange.emit(this.activeDate),this._focusActiveCell(),t.preventDefault()},t.prototype._init=function(){var t=this;this._selectedMonth=this._getMonthInCurrentYear(this.selected),this._todayMonth=this._getMonthInCurrentYear(this._dateAdapter.today()),this._yearLabel=this._dateAdapter.getYearName(this.activeDate);var e=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 t._createCellForMonth(a,e[a])})}),this._changeDetectorRef.markForCheck()},t.prototype._focusActiveCell=function(){this._matCalendarBody._focusActiveCell()},t.prototype._getMonthInCurrentYear=function(t){return t&&this._dateAdapter.getYear(t)==this._dateAdapter.getYear(this.activeDate)?this._dateAdapter.getMonth(t):null},t.prototype._createCellForMonth=function(t,e){var a=this._dateAdapter.format(this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),t,1),this._dateFormats.display.monthYearA11yLabel);return new x(t,e.toLocaleUpperCase(),a,this._shouldEnableMonth(t))},t.prototype._shouldEnableMonth=function(t){var e=this._dateAdapter.getYear(this.activeDate);if(void 0===t||null===t||this._isYearAndMonthAfterMaxDate(e,t)||this._isYearAndMonthBeforeMinDate(e,t))return!1;if(!this.dateFilter)return!0;for(var a=this._dateAdapter.createDate(e,t,1),i=a;this._dateAdapter.getMonth(i)==t;i=this._dateAdapter.addCalendarDays(i,1))if(this.dateFilter(i))return!0;return!1},t.prototype._isYearAndMonthAfterMaxDate=function(t,e){if(this.maxDate){var a=this._dateAdapter.getYear(this.maxDate),i=this._dateAdapter.getMonth(this.maxDate);return t>a||t===a&&e>i}return!1},t.prototype._isYearAndMonthBeforeMinDate=function(t,e){if(this.minDate){var a=this._dateAdapter.getYear(this.minDate),i=this._dateAdapter.getMonth(this.minDate);return t<a||t===a&&e<i}return!1},t.prototype._getValidDateOrNull=function(t){return this._dateAdapter.isDateInstance(t)&&this._dateAdapter.isValid(t)?t:null},t.prototype._isRtl=function(){return this._dir&&"rtl"===this._dir.value},t.decorators=[{type:e.Component,args:[{selector:"mat-year-view",template:'<table class="mat-calendar-table" role="presentation"><thead class="mat-calendar-table-header"><tr><th class="mat-calendar-table-header-divider" colspan="4"></th></tr></thead><tbody mat-calendar-body [label]="_yearLabel" [rows]="_months" [todayValue]="_todayMonth" [selectedValue]="_selectedMonth" [labelMinRequiredCells]="2" [numCols]="4" [cellAspectRatio]="4 / 7" [activeCell]="_dateAdapter.getMonth(activeDate)" (selectedValueChange)="_monthSelected($event)" (keydown)="_handleCalendarBodyKeydown($event)"></tbody></table>',exportAs:"matYearView",encapsulation:e.ViewEncapsulation.None,changeDetection:e.ChangeDetectionStrategy.OnPush}]}],t.ctorParameters=function(){return[{type:e.ChangeDetectorRef},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[n.MAT_DATE_FORMATS]}]},{type:n.DateAdapter,decorators:[{type:e.Optional}]},{type:o.Directionality,decorators:[{type:e.Optional}]}]},t.propDecorators={activeDate:[{type:e.Input}],selected:[{type:e.Input}],minDate:[{type:e.Input}],maxDate:[{type:e.Input}],dateFilter:[{type:e.Input}],selectedChange:[{type:e.Output}],monthSelected:[{type:e.Output}],activeDateChange:[{type:e.Output}],_matCalendarBody:[{type:e.ViewChild,args:[V,{static:!1}]}]},t}(),P=function(){function t(t,e,a,i,r){this._intl=t,this.calendar=e,this._dateAdapter=a,this._dateFormats=i,this.calendar.stateChanges.subscribe(function(){return r.markForCheck()})}return Object.defineProperty(t.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 t=this._dateAdapter.getYear(this.calendar.activeDate),e=t-b(this._dateAdapter,this.calendar.activeDate,this.calendar.minDate,this.calendar.maxDate);return e+" – "+(e+M-1)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"periodButtonLabel",{get:function(){return"month"==this.calendar.currentView?this._intl.switchToMultiYearViewLabel:this._intl.switchToMonthViewLabel},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"prevButtonLabel",{get:function(){return{month:this._intl.prevMonthLabel,year:this._intl.prevYearLabel,"multi-year":this._intl.prevMultiYearLabel}[this.calendar.currentView]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nextButtonLabel",{get:function(){return{month:this._intl.nextMonthLabel,year:this._intl.nextYearLabel,"multi-year":this._intl.nextMultiYearLabel}[this.calendar.currentView]},enumerable:!0,configurable:!0}),t.prototype.currentPeriodClicked=function(){this.calendar.currentView="month"==this.calendar.currentView?"multi-year":"month"},t.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:-M)},t.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:M)},t.prototype.previousEnabled=function(){return!this.calendar.minDate||(!this.calendar.minDate||!this._isSameView(this.calendar.activeDate,this.calendar.minDate))},t.prototype.nextEnabled=function(){return!this.calendar.maxDate||!this._isSameView(this.calendar.activeDate,this.calendar.maxDate)},t.prototype._isSameView=function(t,e){return"month"==this.calendar.currentView?this._dateAdapter.getYear(t)==this._dateAdapter.getYear(e)&&this._dateAdapter.getMonth(t)==this._dateAdapter.getMonth(e):"year"==this.calendar.currentView?this._dateAdapter.getYear(t)==this._dateAdapter.getYear(e):v(this._dateAdapter,t,e,this.calendar.minDate,this.calendar.maxDate)},t.decorators=[{type:e.Component,args:[{selector:"mat-calendar-header",template:'<div class="mat-calendar-header"><div class="mat-calendar-controls"><button mat-button type="button" class="mat-calendar-period-button" (click)="currentPeriodClicked()" [attr.aria-label]="periodButtonLabel" cdkAriaLive="polite">{{periodButtonText}}<div class="mat-calendar-arrow" [class.mat-calendar-invert]="calendar.currentView != \'month\'"></div></button><div class="mat-calendar-spacer"></div><ng-content></ng-content><button mat-icon-button type="button" class="mat-calendar-previous-button" [disabled]="!previousEnabled()" (click)="previousClicked()" [attr.aria-label]="prevButtonLabel"></button> <button mat-icon-button type="button" class="mat-calendar-next-button" [disabled]="!nextEnabled()" (click)="nextClicked()" [attr.aria-label]="nextButtonLabel"></button></div></div>',exportAs:"matCalendarHeader",encapsulation:e.ViewEncapsulation.None,changeDetection:e.ChangeDetectionStrategy.OnPush}]}],t.ctorParameters=function(){return[{type:O},{type:S,decorators:[{type:e.Inject,args:[e.forwardRef(function(){return S})]}]},{type:n.DateAdapter,decorators:[{type:e.Optional}]},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[n.MAT_DATE_FORMATS]}]},{type:e.ChangeDetectorRef}]},t}(),S=function(){function t(t,i,r,n){var o=this;if(this._dateAdapter=i,this._dateFormats=r,this._changeDetectorRef=n,this._moveFocusOnNextTick=!1,this.startView="month",this.selectedChange=new e.EventEmitter,this.yearSelected=new e.EventEmitter,this.monthSelected=new e.EventEmitter,this._userSelection=new e.EventEmitter,this.stateChanges=new a.Subject,!this._dateAdapter)throw D("DateAdapter");if(!this._dateFormats)throw D("MAT_DATE_FORMATS");this._intlChanges=t.changes.subscribe(function(){n.markForCheck(),o.stateChanges.next()})}return Object.defineProperty(t.prototype,"startAt",{get:function(){return this._startAt},set:function(t){this._startAt=this._getValidDateOrNull(this._dateAdapter.deserialize(t))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selected",{get:function(){return this._selected},set:function(t){this._selected=this._getValidDateOrNull(this._dateAdapter.deserialize(t))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minDate",{get:function(){return this._minDate},set:function(t){this._minDate=this._getValidDateOrNull(this._dateAdapter.deserialize(t))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxDate",{get:function(){return this._maxDate},set:function(t){this._maxDate=this._getValidDateOrNull(this._dateAdapter.deserialize(t))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activeDate",{get:function(){return this._clampedActiveDate},set:function(t){this._clampedActiveDate=this._dateAdapter.clampDate(t,this.minDate,this.maxDate),this.stateChanges.next(),this._changeDetectorRef.markForCheck()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentView",{get:function(){return this._currentView},set:function(t){this._currentView=t,this._moveFocusOnNextTick=!0,this._changeDetectorRef.markForCheck()},enumerable:!0,configurable:!0}),t.prototype.ngAfterContentInit=function(){this._calendarHeaderPortal=new s.ComponentPortal(this.headerComponent||P),this.activeDate=this.startAt||this._dateAdapter.today(),this._currentView=this.startView},t.prototype.ngAfterViewChecked=function(){this._moveFocusOnNextTick&&(this._moveFocusOnNextTick=!1,this.focusActiveCell())},
t.prototype.ngOnDestroy=function(){this._intlChanges.unsubscribe(),this.stateChanges.complete()},t.prototype.ngOnChanges=function(t){var e=t.minDate||t.maxDate||t.dateFilter;if(e&&!e.firstChange){var a=this._getCurrentViewComponent();a&&(this._changeDetectorRef.detectChanges(),a._init())}this.stateChanges.next()},t.prototype.focusActiveCell=function(){this._getCurrentViewComponent()._focusActiveCell()},t.prototype.updateTodaysDate=function(){("month"==this.currentView?this.monthView:"year"==this.currentView?this.yearView:this.multiYearView).ngAfterContentInit()},t.prototype._dateSelected=function(t){this._dateAdapter.sameDate(t,this.selected)||this.selectedChange.emit(t)},t.prototype._yearSelectedInMultiYearView=function(t){this.yearSelected.emit(t)},t.prototype._monthSelectedInYearView=function(t){this.monthSelected.emit(t)},t.prototype._userSelected=function(){this._userSelection.emit()},t.prototype._goToDateInView=function(t,e){this.activeDate=t,this.currentView=e},t.prototype._getValidDateOrNull=function(t){return this._dateAdapter.isDateInstance(t)&&this._dateAdapter.isValid(t)?t:null},t.prototype._getCurrentViewComponent=function(){return this.monthView||this.yearView||this.multiYearView},t.decorators=[{type:e.Component,args:[{selector:"mat-calendar",template:'<ng-template [cdkPortalOutlet]="_calendarHeaderPortal"></ng-template><div class="mat-calendar-content" [ngSwitch]="currentView" cdkMonitorSubtreeFocus tabindex="-1"><mat-month-view *ngSwitchCase="\'month\'" [(activeDate)]="activeDate" [selected]="selected" [dateFilter]="dateFilter" [maxDate]="maxDate" [minDate]="minDate" [dateClass]="dateClass" (selectedChange)="_dateSelected($event)" (_userSelection)="_userSelected()"></mat-month-view><mat-year-view *ngSwitchCase="\'year\'" [(activeDate)]="activeDate" [selected]="selected" [dateFilter]="dateFilter" [maxDate]="maxDate" [minDate]="minDate" (monthSelected)="_monthSelectedInYearView($event)" (selectedChange)="_goToDateInView($event, \'month\')"></mat-year-view><mat-multi-year-view *ngSwitchCase="\'multi-year\'" [(activeDate)]="activeDate" [selected]="selected" [dateFilter]="dateFilter" [maxDate]="maxDate" [minDate]="minDate" (yearSelected)="_yearSelectedInMultiYearView($event)" (selectedChange)="_goToDateInView($event, \'year\')"></mat-multi-year-view></div>',styles:[".mat-calendar{display:block}.mat-calendar-header{padding:8px 8px 0 8px}.mat-calendar-content{padding:0 8px 8px 8px;outline:0}.mat-calendar-controls{display:flex;margin:5% calc(33% / 7 - 16px)}.mat-calendar-spacer{flex:1 1 auto}.mat-calendar-period-button{min-width:0}.mat-calendar-arrow{display:inline-block;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top-width:5px;border-top-style:solid;margin:0 0 0 5px;vertical-align:middle}.mat-calendar-arrow.mat-calendar-invert{transform:rotate(180deg)}[dir=rtl] .mat-calendar-arrow{margin:0 5px 0 0}.mat-calendar-next-button,.mat-calendar-previous-button{position:relative}.mat-calendar-next-button::after,.mat-calendar-previous-button::after{top:0;left:0;right:0;bottom:0;position:absolute;content:'';margin:15.5px;border:0 solid currentColor;border-top-width:2px}[dir=rtl] .mat-calendar-next-button,[dir=rtl] .mat-calendar-previous-button{transform:rotate(180deg)}.mat-calendar-previous-button::after{border-left-width:2px;transform:translateX(2px) rotate(-45deg)}.mat-calendar-next-button::after{border-right-width:2px;transform:translateX(-2px) rotate(45deg)}.mat-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.mat-calendar-table-header th{text-align:center;padding:0 0 8px 0}.mat-calendar-table-header-divider{position:relative;height:1px}.mat-calendar-table-header-divider::after{content:'';position:absolute;top:0;left:-8px;right:-8px;height:1px}"],host:{class:"mat-calendar"},exportAs:"matCalendar",encapsulation:e.ViewEncapsulation.None,changeDetection:e.ChangeDetectionStrategy.OnPush}]}],t.ctorParameters=function(){return[{type:O},{type:n.DateAdapter,decorators:[{type:e.Optional}]},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[n.MAT_DATE_FORMATS]}]},{type:e.ChangeDetectorRef}]},t.propDecorators={headerComponent:[{type:e.Input}],startAt:[{type:e.Input}],startView:[{type:e.Input}],selected:[{type:e.Input}],minDate:[{type:e.Input}],maxDate:[{type:e.Input}],dateFilter:[{type:e.Input}],dateClass:[{type:e.Input}],selectedChange:[{type:e.Output}],yearSelected:[{type:e.Output}],monthSelected:[{type:e.Output}],_userSelection:[{type:e.Output}],monthView:[{type:e.ViewChild,args:[I,{static:!1}]}],yearView:[{type:e.ViewChild,args:[E,{static:!1}]}],multiYearView:[{type:e.ViewChild,args:[R,{static:!1}]}]},t}(),Y={transformPanel:d.trigger("transformPanel",[d.state("void",d.style({opacity:0,transform:"scale(1, 0.8)"})),d.transition("void => enter",d.animate("120ms cubic-bezier(0, 0, 0.2, 1)",d.style({opacity:1,transform:"scale(1, 1)"}))),d.transition("* => void",d.animate("100ms linear",d.style({opacity:0})))]),fadeInCalendar:d.trigger("fadeInCalendar",[d.state("void",d.style({opacity:0})),d.state("enter",d.style({opacity:1})),d.transition("void => *",d.animate("120ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)"))])},T=0,F=new e.InjectionToken("mat-datepicker-scroll-strategy"),N={provide:F,deps:[c.Overlay],useFactory:k},j=function(){function t(t){this._elementRef=t}return t}(),L=n.mixinColor(j),B=function(t){function a(e){return t.call(this,e)||this}return y(a,t),a.prototype.ngAfterViewInit=function(){this._calendar.focusActiveCell()},a.decorators=[{type:e.Component,args:[{selector:"mat-datepicker-content",template:'<mat-calendar cdkTrapFocus [id]="datepicker.id" [ngClass]="datepicker.panelClass" [startAt]="datepicker.startAt" [startView]="datepicker.startView" [minDate]="datepicker._minDate" [maxDate]="datepicker._maxDate" [dateFilter]="datepicker._dateFilter" [headerComponent]="datepicker.calendarHeaderComponent" [selected]="datepicker._selected" [dateClass]="datepicker.dateClass" [@fadeInCalendar]="\'enter\'" (selectedChange)="datepicker.select($event)" (yearSelected)="datepicker._selectYear($event)" (monthSelected)="datepicker._selectMonth($event)" (_userSelection)="datepicker.close()"></mat-calendar>',styles:[".mat-datepicker-content{display:block;border-radius:4px}.mat-datepicker-content .mat-calendar{width:296px;height:354px}.mat-datepicker-content-touch{display:block;max-height:80vh;overflow:auto;margin:-24px}.mat-datepicker-content-touch .mat-calendar{min-width:250px;min-height:312px;max-width:750px;max-height:788px}@media all and (orientation:landscape){.mat-datepicker-content-touch .mat-calendar{width:64vh;height:80vh}}@media all and (orientation:portrait){.mat-datepicker-content-touch .mat-calendar{width:80vw;height:100vw}}"],host:{class:"mat-datepicker-content","[@transformPanel]":'"enter"',"[class.mat-datepicker-content-touch]":"datepicker.touchUi"},animations:[Y.transformPanel,Y.fadeInCalendar],exportAs:"matDatepickerContent",encapsulation:e.ViewEncapsulation.None,changeDetection:e.ChangeDetectionStrategy.OnPush,inputs:["color"]}]}],a.ctorParameters=function(){return[{type:e.ElementRef}]},a.propDecorators={_calendar:[{type:e.ViewChild,args:[S,{static:!1}]}]},a}(L),W=function(){function t(t,i,r,n,o,s,d,l){if(this._dialog=t,this._overlay=i,this._ngZone=r,this._viewContainerRef=n,this._dateAdapter=s,this._dir=d,this._document=l,this.startView="month",this._touchUi=!1,this.yearSelected=new e.EventEmitter,this.monthSelected=new e.EventEmitter,this.openedStream=new e.EventEmitter,this.closedStream=new e.EventEmitter,this._opened=!1,this.id="mat-datepicker-"+T++,this._validSelected=null,this._focusedElementBeforeOpen=null,this._inputSubscription=a.Subscription.EMPTY,this._disabledChange=new a.Subject,this._selectedChanged=new a.Subject,!this._dateAdapter)throw D("DateAdapter");this._scrollStrategy=o}return Object.defineProperty(t.prototype,"startAt",{get:function(){return this._startAt||(this._datepickerInput?this._datepickerInput.value:null)},set:function(t){this._startAt=this._getValidDateOrNull(this._dateAdapter.deserialize(t))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this._color||(this._datepickerInput?this._datepickerInput._getThemePalette():void 0)},set:function(t){this._color=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"touchUi",{get:function(){return this._touchUi},set:function(t){this._touchUi=l.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return void 0===this._disabled&&this._datepickerInput?this._datepickerInput.disabled:!!this._disabled},set:function(t){var e=l.coerceBooleanProperty(t);e!==this._disabled&&(this._disabled=e,this._disabledChange.next(e))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"opened",{get:function(){return this._opened},set:function(t){t?this.open():this.close()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_selected",{get:function(){return this._validSelected},set:function(t){this._validSelected=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_minDate",{get:function(){return this._datepickerInput&&this._datepickerInput.min},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_maxDate",{get:function(){return this._datepickerInput&&this._datepickerInput.max},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_dateFilter",{get:function(){return this._datepickerInput&&this._datepickerInput._dateFilter},enumerable:!0,configurable:!0}),t.prototype.ngOnDestroy=function(){this.close(),this._inputSubscription.unsubscribe(),this._disabledChange.complete(),this._popupRef&&(this._popupRef.dispose(),this._popupComponentRef=null)},t.prototype.select=function(t){var e=this._selected;this._selected=t,this._dateAdapter.sameDate(e,this._selected)||this._selectedChanged.next(t)},t.prototype._selectYear=function(t){this.yearSelected.emit(t)},t.prototype._selectMonth=function(t){this.monthSelected.emit(t)},t.prototype._registerInput=function(t){var e=this;if(this._datepickerInput)throw Error("A MatDatepicker can only be associated with a single input.");this._datepickerInput=t,this._inputSubscription=this._datepickerInput._valueChange.subscribe(function(t){return e._selected=t})},t.prototype.open=function(){if(!this._opened&&!this.disabled){if(!this._datepickerInput)throw Error("Attempted to open an MatDatepicker with no associated input.");this._document&&(this._focusedElementBeforeOpen=this._document.activeElement),this.touchUi?this._openAsDialog():this._openAsPopup(),this._opened=!0,this.openedStream.emit()}},t.prototype.close=function(){var t=this;if(this._opened){this._popupRef&&this._popupRef.hasAttached()&&this._popupRef.detach(),this._dialogRef&&(this._dialogRef.close(),this._dialogRef=null),this._calendarPortal&&this._calendarPortal.isAttached&&this._calendarPortal.detach();var e=function(){t._opened&&(t._opened=!1,t.closedStream.emit(),t._focusedElementBeforeOpen=null)};this._focusedElementBeforeOpen&&"function"==typeof this._focusedElementBeforeOpen.focus?(this._focusedElementBeforeOpen.focus(),setTimeout(e)):e()}},t.prototype._openAsDialog=function(){var t=this;this._dialogRef&&this._dialogRef.close(),this._dialogRef=this._dialog.open(B,{direction:this._dir?this._dir.value:"ltr",viewContainerRef:this._viewContainerRef,panelClass:"mat-datepicker-dialog"}),this._dialogRef.afterClosed().subscribe(function(){return t.close()}),this._dialogRef.componentInstance.datepicker=this,this._setColor()},t.prototype._openAsPopup=function(){var t=this;this._calendarPortal||(this._calendarPortal=new s.ComponentPortal(B,this._viewContainerRef)),this._popupRef||this._createPopup(),this._popupRef.hasAttached()||(this._popupComponentRef=this._popupRef.attach(this._calendarPortal),this._popupComponentRef.instance.datepicker=this,this._setColor(),this._ngZone.onStable.asObservable().pipe(i.take(1)).subscribe(function(){t._popupRef.updatePosition()}))},t.prototype._createPopup=function(){var t=this,e=new c.OverlayConfig({positionStrategy:this._createPopupPositionStrategy(),hasBackdrop:!0,backdropClass:"mat-overlay-transparent-backdrop",direction:this._dir,scrollStrategy:this._scrollStrategy(),panelClass:"mat-datepicker-popup"});this._popupRef=this._overlay.create(e),this._popupRef.overlayElement.setAttribute("role","dialog"),a.merge(this._popupRef.backdropClick(),this._popupRef.detachments(),this._popupRef.keydownEvents().pipe(i.filter(function(e){return e.keyCode===r.ESCAPE||t._datepickerInput&&e.altKey&&e.keyCode===r.UP_ARROW}))).subscribe(function(e){e&&e.preventDefault(),t.close()})},t.prototype._createPopupPositionStrategy=function(){return this._overlay.position().flexibleConnectedTo(this._datepickerInput.getConnectedOverlayOrigin()).withTransformOriginOn(".mat-datepicker-content").withFlexibleDimensions(!1).withViewportMargin(8).withLockedPosition().withPositions([{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"}])},t.prototype._getValidDateOrNull=function(t){return this._dateAdapter.isDateInstance(t)&&this._dateAdapter.isValid(t)?t:null},t.prototype._setColor=function(){var t=this.color;this._popupComponentRef&&(this._popupComponentRef.instance.color=t),this._dialogRef&&(this._dialogRef.componentInstance.color=t)},t.decorators=[{type:e.Component,args:[{selector:"mat-datepicker",template:"",exportAs:"matDatepicker",changeDetection:e.ChangeDetectionStrategy.OnPush,encapsulation:e.ViewEncapsulation.None}]}],t.ctorParameters=function(){return[{type:h.MatDialog},{type:c.Overlay},{type:e.NgZone},{type:e.ViewContainerRef},{type:void 0,decorators:[{type:e.Inject,args:[F]}]},{type:n.DateAdapter,decorators:[{type:e.Optional}]},{type:o.Directionality,decorators:[{type:e.Optional}]},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[p.DOCUMENT]}]}]},t.propDecorators={calendarHeaderComponent:[{type:e.Input}],startAt:[{type:e.Input}],startView:[{type:e.Input}],color:[{type:e.Input}],touchUi:[{type:e.Input}],disabled:[{type:e.Input}],yearSelected:[{type:e.Output}],monthSelected:[{type:e.Output}],panelClass:[{type:e.Input}],dateClass:[{type:e.Input}],openedStream:[{type:e.Output,args:["opened"]}],closedStream:[{type:e.Output,args:["closed"]}],opened:[{type:e.Input}]},t}(),z={provide:u.NG_VALUE_ACCESSOR,useExisting:e.forwardRef(function(){return K}),multi:!0},q={provide:u.NG_VALIDATORS,useExisting:e.forwardRef(function(){return K}),multi:!0},U=function(){function t(t,e){this.target=t,this.targetElement=e,this.value=this.target.value}return t}(),K=function(){function t(t,i,r,n){var o=this;if(this._elementRef=t,this._dateAdapter=i,this._dateFormats=r,this._formField=n,this.dateChange=new e.EventEmitter,this.dateInput=new e.EventEmitter,this._valueChange=new e.EventEmitter,this._disabledChange=new e.EventEmitter,this._onTouched=function(){},this._cvaOnChange=function(){},this._validatorOnChange=function(){},this._datepickerSubscription=a.Subscription.EMPTY,this._localeSubscription=a.Subscription.EMPTY,this._parseValidator=function(){return o._lastValueValid?null:{matDatepickerParse:{text:o._elementRef.nativeElement.value}}},this._minValidator=function(t){var e=o._getValidDateOrNull(o._dateAdapter.deserialize(t.value));return!o.min||!e||o._dateAdapter.compareDate(o.min,e)<=0?null:{matDatepickerMin:{min:o.min,actual:e}}},this._maxValidator=function(t){var e=o._getValidDateOrNull(o._dateAdapter.deserialize(t.value));return!o.max||!e||o._dateAdapter.compareDate(o.max,e)>=0?null:{matDatepickerMax:{max:o.max,actual:e}}},this._filterValidator=function(t){var e=o._getValidDateOrNull(o._dateAdapter.deserialize(t.value));return o._dateFilter&&e&&!o._dateFilter(e)?{matDatepickerFilter:!0}:null},this._validator=u.Validators.compose([this._parseValidator,this._minValidator,this._maxValidator,this._filterValidator]),this._lastValueValid=!1,!this._dateAdapter)throw D("DateAdapter");if(!this._dateFormats)throw D("MAT_DATE_FORMATS");this._localeSubscription=i.localeChanges.subscribe(function(){o.value=o.value})}return Object.defineProperty(t.prototype,"matDatepicker",{set:function(t){var e=this;t&&(this._datepicker=t,this._datepicker._registerInput(this),this._datepickerSubscription.unsubscribe(),this._datepickerSubscription=this._datepicker._selectedChanged.subscribe(function(t){e.value=t,e._cvaOnChange(t),e._onTouched(),e.dateInput.emit(new U(e,e._elementRef.nativeElement)),e.dateChange.emit(new U(e,e._elementRef.nativeElement))}))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"matDatepickerFilter",{set:function(t){this._dateFilter=t,this._validatorOnChange()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){t=this._dateAdapter.deserialize(t),this._lastValueValid=!t||this._dateAdapter.isValid(t),t=this._getValidDateOrNull(t);var e=this.value;this._value=t,this._formatValue(t),this._dateAdapter.sameDate(e,t)||this._valueChange.emit(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"min",{get:function(){return this._min},set:function(t){this._min=this._getValidDateOrNull(this._dateAdapter.deserialize(t)),this._validatorOnChange()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"max",{get:function(){return this._max},set:function(t){this._max=this._getValidDateOrNull(this._dateAdapter.deserialize(t)),this._validatorOnChange()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return!!this._disabled},set:function(t){var e=l.coerceBooleanProperty(t),a=this._elementRef.nativeElement;this._disabled!==e&&(this._disabled=e,this._disabledChange.emit(e)),e&&a.blur&&a.blur()},enumerable:!0,configurable:!0}),t.prototype.ngOnDestroy=function(){this._datepickerSubscription.unsubscribe(),this._localeSubscription.unsubscribe(),this._valueChange.complete(),this._disabledChange.complete()},t.prototype.registerOnValidatorChange=function(t){this._validatorOnChange=t},t.prototype.validate=function(t){return this._validator?this._validator(t):null},t.prototype.getPopupConnectionElementRef=function(){return this.getConnectedOverlayOrigin()},t.prototype.getConnectedOverlayOrigin=function(){return this._formField?this._formField.getConnectedOverlayOrigin():this._elementRef},t.prototype.writeValue=function(t){this.value=t},t.prototype.registerOnChange=function(t){this._cvaOnChange=t},t.prototype.registerOnTouched=function(t){this._onTouched=t},t.prototype.setDisabledState=function(t){this.disabled=t},t.prototype._onKeydown=function(t){var e=t.altKey&&t.keyCode===r.DOWN_ARROW;this._datepicker&&e&&!this._elementRef.nativeElement.readOnly&&(this._datepicker.open(),t.preventDefault())},t.prototype._onInput=function(t){var e=this._dateAdapter.parse(t,this._dateFormats.parse.dateInput);this._lastValueValid=!e||this._dateAdapter.isValid(e),e=this._getValidDateOrNull(e),this._dateAdapter.sameDate(e,this._value)?this._validatorOnChange():(this._value=e,this._cvaOnChange(e),this._valueChange.emit(e),this.dateInput.emit(new U(this,this._elementRef.nativeElement)))},t.prototype._onChange=function(){this.dateChange.emit(new U(this,this._elementRef.nativeElement))},t.prototype._getThemePalette=function(){return this._formField?this._formField.color:void 0},t.prototype._onBlur=function(){this.value&&this._formatValue(this.value),this._onTouched()},t.prototype._formatValue=function(t){this._elementRef.nativeElement.value=t?this._dateAdapter.format(t,this._dateFormats.display.dateInput):""},t.prototype._getValidDateOrNull=function(t){return this._dateAdapter.isDateInstance(t)&&this._dateAdapter.isValid(t)?t:null},t.decorators=[{type:e.Directive,args:[{selector:"input[matDatepicker]",providers:[z,q,{provide:m.MAT_INPUT_VALUE_ACCESSOR,useExisting:t}],host:{"aria-haspopup":"dialog","[attr.aria-owns]":"(_datepicker?.opened && _datepicker.id) || null","[attr.min]":"min ? _dateAdapter.toIso8601(min) : null","[attr.max]":"max ? _dateAdapter.toIso8601(max) : null","[disabled]":"disabled","(input)":"_onInput($event.target.value)","(change)":"_onChange()","(blur)":"_onBlur()","(keydown)":"_onKeydown($event)"},exportAs:"matDatepickerInput"}]}],t.ctorParameters=function(){return[{type:e.ElementRef},{type:n.DateAdapter,decorators:[{type:e.Optional}]},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[n.MAT_DATE_FORMATS]}]},{type:_.MatFormField,decorators:[{type:e.Optional}]}]},t.propDecorators={matDatepicker:[{type:e.Input}],matDatepickerFilter:[{type:e.Input}],value:[{type:e.Input}],min:[{type:e.Input}],max:[{type:e.Input}],disabled:[{type:e.Input}],dateChange:[{type:e.Output}],dateInput:[{type:e.Output}]},t}(),H=function(){function t(){}return t.decorators=[{type:e.Directive,args:[{selector:"[matDatepickerToggleIcon]"}]}],t}(),$=function(){function t(t,e,i){this._intl=t,this._changeDetectorRef=e,this._stateChanges=a.Subscription.EMPTY;var r=Number(i);this.tabIndex=r||0===r?r:null}return Object.defineProperty(t.prototype,"disabled",{get:function(){return void 0===this._disabled&&this.datepicker?this.datepicker.disabled:!!this._disabled},set:function(t){this._disabled=l.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(t){t.datepicker&&this._watchStateChanges()},t.prototype.ngOnDestroy=function(){this._stateChanges.unsubscribe()},t.prototype.ngAfterContentInit=function(){this._watchStateChanges()},t.prototype._open=function(t){this.datepicker&&!this.disabled&&(this.datepicker.open(),t.stopPropagation())},t.prototype._watchStateChanges=function(){var t=this,e=this.datepicker?this.datepicker._disabledChange:a.of(),i=this.datepicker&&this.datepicker._datepickerInput?this.datepicker._datepickerInput._disabledChange:a.of(),r=this.datepicker?a.merge(this.datepicker.openedStream,this.datepicker.closedStream):a.of();this._stateChanges.unsubscribe(),this._stateChanges=a.merge(this._intl.changes,e,i,r).subscribe(function(){return t._changeDetectorRef.markForCheck()})},t.decorators=[{type:e.Component,args:[{selector:"mat-datepicker-toggle",template:'<button #button mat-icon-button type="button" aria-haspopup="dialog" [attr.aria-label]="_intl.openCalendarLabel" [attr.tabindex]="disabled ? -1 : tabIndex" [disabled]="disabled" [disableRipple]="disableRipple" (click)="_open($event)"><svg *ngIf="!_customIcon" class="mat-datepicker-toggle-default-icon" viewBox="0 0 24 24" width="24px" height="24px" fill="currentColor" focusable="false"><path d="M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z"/></svg><ng-content select="[matDatepickerToggleIcon]"></ng-content></button>',styles:[".mat-form-field-appearance-legacy .mat-form-field-prefix .mat-datepicker-toggle-default-icon,.mat-form-field-appearance-legacy .mat-form-field-suffix .mat-datepicker-toggle-default-icon{width:1em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-datepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-datepicker-toggle-default-icon{display:block;width:1.5em;height:1.5em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-datepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-datepicker-toggle-default-icon{margin:auto}"],host:{class:"mat-datepicker-toggle","[attr.tabindex]":"-1","[class.mat-datepicker-toggle-active]":"datepicker && datepicker.opened","[class.mat-accent]":'datepicker && datepicker.color === "accent"',"[class.mat-warn]":'datepicker && datepicker.color === "warn"',"(focus)":"_button.focus()"},exportAs:"matDatepickerToggle",encapsulation:e.ViewEncapsulation.None,changeDetection:e.ChangeDetectionStrategy.OnPush}]}],t.ctorParameters=function(){return[{type:O},{type:e.ChangeDetectorRef},{type:String,decorators:[{type:e.Attribute,args:["tabindex"]}]}]},t.propDecorators={datepicker:[{type:e.Input,args:["for"]}],tabIndex:[{type:e.Input}],disabled:[{type:e.Input}],disableRipple:[{type:e.Input}],_customIcon:[{type:e.ContentChild,args:[H,{static:!1}]}],_button:[{type:e.ViewChild,args:["button",{static:!1}]}]},t}(),G=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[p.CommonModule,f.MatButtonModule,h.MatDialogModule,c.OverlayModule,g.A11yModule,s.PortalModule],exports:[S,V,W,B,K,$,H,I,E,R,P],declarations:[S,V,W,B,K,$,H,I,E,R,P],providers:[O,N],entryComponents:[B,P]}]}],t}();t.MatMultiYearView=R,t.yearsPerPage=M,t.yearsPerRow=4,t.MatDatepickerModule=G,t.MatCalendarHeader=P,t.MatCalendar=S,t.MatCalendarCell=x,t.MatCalendarBody=V,t.MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY=k,t.MAT_DATEPICKER_SCROLL_STRATEGY=F,t.MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER=N,t.MatDatepickerContent=B,t.MatDatepicker=W,t.matDatepickerAnimations=Y,t.MAT_DATEPICKER_VALUE_ACCESSOR=z,t.MAT_DATEPICKER_VALIDATORS=q,t.MatDatepickerInputEvent=U,t.MatDatepickerInput=K,t.MatDatepickerIntl=O,t.MatDatepickerToggleIcon=H,t.MatDatepickerToggle=$,t.MatMonthView=I,t.MatYearView=E,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=material-datepicker.umd.min.js.map