ngx-bootstrap
Version:
Native Angular Bootstrap Components
1 lines • 69.2 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("ngx-bootstrap/chronos"),require("@angular/core"),require("@angular/forms"),require("ngx-bootstrap/utils"),require("@angular/common"),require("rxjs"),require("rxjs/operators"),require("ngx-bootstrap/mini-ngrx"),require("ngx-bootstrap/component-loader"),require("ngx-bootstrap/positioning")):"function"==typeof define&&define.amd?define("ngx-bootstrap/datepicker",["exports","ngx-bootstrap/chronos","@angular/core","@angular/forms","ngx-bootstrap/utils","@angular/common","rxjs","rxjs/operators","ngx-bootstrap/mini-ngrx","ngx-bootstrap/component-loader","ngx-bootstrap/positioning"],t):t((e["ngx-bootstrap"]=e["ngx-bootstrap"]||{},e["ngx-bootstrap"].datepicker={}),e.chronos,e.ng.core,e.ng.forms,e.utils,e.ng.common,e.rxjs,e.rxjs.operators,e.miniNgrx,e.componentLoader,e.positioning)}(this,function(e,f,o,t,n,a,i,r,s,c,d){"use strict";var l=function(){function e(){}return e.prototype.format=function(e,t,n){return f.formatDate(e,t,n)},e}(),u=function(){function e(){this.selectionDone=new o.EventEmitter(undefined),this.update=new o.EventEmitter(!1),this.activeDateChange=new o.EventEmitter(undefined),this.stepDay={},this.stepMonth={},this.stepYear={},this.modes=["day","month","year"],this.dateFormatter=new l}return Object.defineProperty(e.prototype,"activeDate",{get:function(){return this._activeDate},set:function(e){this._activeDate=e},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.uniqueId="datepicker--"+Math.floor(1e4*Math.random()),this.initDate?(this.activeDate=this.initDate,this.selectedDate=new Date(this.activeDate.valueOf()),this.update.emit(this.activeDate)):this.activeDate===undefined&&(this.activeDate=new Date)},e.prototype.ngOnChanges=function(e){this.refreshView(),this.checkIfActiveDateGotUpdated(e.activeDate)},e.prototype.checkIfActiveDateGotUpdated=function(e){if(e&&!e.firstChange){var t=e.previousValue;t&&t instanceof Date&&t.getTime()!==e.currentValue.getTime()&&this.activeDateChange.emit(this.activeDate)}},e.prototype.setCompareHandler=function(e,t){"day"===t&&(this.compareHandlerDay=e),"month"===t&&(this.compareHandlerMonth=e),"year"===t&&(this.compareHandlerYear=e)},e.prototype.compare=function(e,t){return e===undefined||t===undefined?undefined:"day"===this.datepickerMode&&this.compareHandlerDay?this.compareHandlerDay(e,t):"month"===this.datepickerMode&&this.compareHandlerMonth?this.compareHandlerMonth(e,t):"year"===this.datepickerMode&&this.compareHandlerYear?this.compareHandlerYear(e,t):void 0},e.prototype.setRefreshViewHandler=function(e,t){"day"===t&&(this.refreshViewHandlerDay=e),"month"===t&&(this.refreshViewHandlerMonth=e),"year"===t&&(this.refreshViewHandlerYear=e)},e.prototype.refreshView=function(){"day"===this.datepickerMode&&this.refreshViewHandlerDay&&this.refreshViewHandlerDay(),"month"===this.datepickerMode&&this.refreshViewHandlerMonth&&this.refreshViewHandlerMonth(),"year"===this.datepickerMode&&this.refreshViewHandlerYear&&this.refreshViewHandlerYear()},e.prototype.dateFilter=function(e,t){return this.dateFormatter.format(e,t,this.locale)},e.prototype.isActive=function(e){return 0===this.compare(e.date,this.activeDate)&&(this.activeDateId=e.uid,!0)},e.prototype.createDateObject=function(e,t){var n={};return n.date=new Date(e.getFullYear(),e.getMonth(),e.getDate()),n.date=this.fixTimeZone(n.date),n.label=this.dateFilter(e,t),n.selected=0===this.compare(e,this.selectedDate),n.disabled=this.isDisabled(e),n.current=0===this.compare(e,new Date),n.customClass=this.getCustomClassForDate(n.date),n},e.prototype.split=function(e,t){for(var n=[];0<e.length;)n.push(e.splice(0,t));return n},e.prototype.fixTimeZone=function(e){var t=e.getHours();return new Date(e.getFullYear(),e.getMonth(),e.getDate(),23===t?t+2:0)},e.prototype.select=function(e,t){void 0===t&&(t=!0),this.datepickerMode===this.minMode?(this.activeDate||(this.activeDate=new Date(0,0,0,0,0,0,0)),this.activeDate=new Date(e.getFullYear(),e.getMonth(),e.getDate()),this.activeDate=this.fixTimeZone(this.activeDate),t&&this.selectionDone.emit(this.activeDate)):(this.activeDate=new Date(e.getFullYear(),e.getMonth(),e.getDate()),this.activeDate=this.fixTimeZone(this.activeDate),t&&(this.datepickerMode=this.modes[this.modes.indexOf(this.datepickerMode)-1])),this.selectedDate=new Date(this.activeDate.valueOf()),this.update.emit(this.activeDate),this.refreshView()},e.prototype.move=function(e){var t;if("day"===this.datepickerMode&&(t=this.stepDay),"month"===this.datepickerMode&&(t=this.stepMonth),"year"===this.datepickerMode&&(t=this.stepYear),t){var n=this.activeDate.getFullYear()+e*(t.years||0),a=this.activeDate.getMonth()+e*(t.months||0);this.activeDate=new Date(n,a,1),this.refreshView(),this.activeDateChange.emit(this.activeDate)}},e.prototype.toggleMode=function(e){var t=e||1;this.datepickerMode===this.maxMode&&1===t||this.datepickerMode===this.minMode&&-1===t||(this.datepickerMode=this.modes[this.modes.indexOf(this.datepickerMode)+t],this.refreshView())},e.prototype.getCustomClassForDate=function(t){var n=this;if(!this.customClass)return"";var e=this.customClass.find(function(e){return e.date.valueOf()===t.valueOf()&&e.mode===n.datepickerMode},this);return e===undefined?"":e.clazz},e.prototype.compareDateDisabled=function(e,t){return e===undefined||t===undefined?undefined:"day"===e.mode&&this.compareHandlerDay?this.compareHandlerDay(e.date,t):"month"===e.mode&&this.compareHandlerMonth?this.compareHandlerMonth(e.date,t):"year"===e.mode&&this.compareHandlerYear?this.compareHandlerYear(e.date,t):undefined},e.prototype.isDisabled=function(t){var n=this,a=!1;return this.dateDisabled&&this.dateDisabled.forEach(function(e){0===n.compareDateDisabled(e,t)&&(a=!0)}),this.dayDisabled&&(a=a||-1<this.dayDisabled.indexOf(t.getDay())),a||this.minDate&&this.compare(t,this.minDate)<0||this.maxDate&&0<this.compare(t,this.maxDate)},e.decorators=[{type:o.Component,args:[{selector:"datepicker-inner",template:'\n \x3c!--<!–ng-keydown="keydown($event)"–>--\x3e\n <div *ngIf="datepickerMode" class="well well-sm bg-faded p-a card" role="application" >\n <ng-content></ng-content>\n </div>\n '}]}],e.propDecorators={locale:[{type:o.Input}],datepickerMode:[{type:o.Input}],startingDay:[{type:o.Input}],yearRange:[{type:o.Input}],minDate:[{type:o.Input}],maxDate:[{type:o.Input}],minMode:[{type:o.Input}],maxMode:[{type:o.Input}],showWeeks:[{type:o.Input}],formatDay:[{type:o.Input}],formatMonth:[{type:o.Input}],formatYear:[{type:o.Input}],formatDayHeader:[{type:o.Input}],formatDayTitle:[{type:o.Input}],formatMonthTitle:[{type:o.Input}],onlyCurrentMonth:[{type:o.Input}],shortcutPropagation:[{type:o.Input}],customClass:[{type:o.Input}],monthColLimit:[{type:o.Input}],yearColLimit:[{type:o.Input}],dateDisabled:[{type:o.Input}],dayDisabled:[{type:o.Input}],initDate:[{type:o.Input}],selectionDone:[{type:o.Output}],update:[{type:o.Output}],activeDateChange:[{type:o.Output}],activeDate:[{type:o.Input}]},e}(),h=function(){function e(){this.locale="en",this.datepickerMode="day",this.startingDay=0,this.yearRange=20,this.minMode="day",this.maxMode="year",this.showWeeks=!0,this.formatDay="DD",this.formatMonth="MMMM",this.formatYear="YYYY",this.formatDayHeader="dd",this.formatDayTitle="MMMM YYYY",this.formatMonthTitle="YYYY",this.onlyCurrentMonth=!1,this.monthColLimit=3,this.yearColLimit=5,this.shortcutPropagation=!1}return e.decorators=[{type:o.Injectable}],e}(),p={provide:t.NG_VALUE_ACCESSOR,useExisting:o.forwardRef(function(){return y}),multi:!0},y=function(){function e(e){this.datepickerMode="day",this.showWeeks=!0,this.selectionDone=new o.EventEmitter(undefined),this.activeDateChange=new o.EventEmitter(undefined),this.onChange=Function.prototype,this.onTouched=Function.prototype,this._now=new Date,this.config=e,this.configureOptions()}return Object.defineProperty(e.prototype,"activeDate",{get:function(){return this._activeDate||this._now},set:function(e){this._activeDate=e},enumerable:!0,configurable:!0}),e.prototype.configureOptions=function(){Object.assign(this,this.config)},e.prototype.onUpdate=function(e){this.activeDate=e,this.onChange(e)},e.prototype.onSelectionDone=function(e){this.selectionDone.emit(e)},e.prototype.onActiveDateChange=function(e){this.activeDateChange.emit(e)},e.prototype.writeValue=function(e){if(0!==this._datePicker.compare(e,this._activeDate))return e&&e instanceof Date?(this.activeDate=e,void this._datePicker.select(e,!1)):void(this.activeDate=e?new Date(e):void 0)},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.decorators=[{type:o.Component,args:[{selector:"datepicker",template:'\n <datepicker-inner [activeDate]="activeDate"\n (update)="onUpdate($event)"\n [locale]="config.locale"\n [datepickerMode]="datepickerMode"\n [initDate]="initDate"\n [minDate]="minDate"\n [maxDate]="maxDate"\n [minMode]="minMode"\n [maxMode]="maxMode"\n [showWeeks]="showWeeks"\n [formatDay]="formatDay"\n [formatMonth]="formatMonth"\n [formatYear]="formatYear"\n [formatDayHeader]="formatDayHeader"\n [formatDayTitle]="formatDayTitle"\n [formatMonthTitle]="formatMonthTitle"\n [startingDay]="startingDay"\n [yearRange]="yearRange"\n [customClass]="customClass"\n [dateDisabled]="dateDisabled"\n [dayDisabled]="dayDisabled"\n [onlyCurrentMonth]="onlyCurrentMonth"\n [shortcutPropagation]="shortcutPropagation"\n [monthColLimit]="monthColLimit"\n [yearColLimit]="yearColLimit"\n (selectionDone)="onSelectionDone($event)"\n (activeDateChange)="onActiveDateChange($event)">\n <daypicker tabindex="0"></daypicker>\n <monthpicker tabindex="0"></monthpicker>\n <yearpicker tabindex="0"></yearpicker>\n </datepicker-inner>\n ',providers:[p]}]}],e.ctorParameters=function(){return[{type:h}]},e.propDecorators={datepickerMode:[{type:o.Input}],initDate:[{type:o.Input}],minDate:[{type:o.Input}],maxDate:[{type:o.Input}],minMode:[{type:o.Input}],maxMode:[{type:o.Input}],showWeeks:[{type:o.Input}],formatDay:[{type:o.Input}],formatMonth:[{type:o.Input}],formatYear:[{type:o.Input}],formatDayHeader:[{type:o.Input}],formatDayTitle:[{type:o.Input}],formatMonthTitle:[{type:o.Input}],startingDay:[{type:o.Input}],yearRange:[{type:o.Input}],onlyCurrentMonth:[{type:o.Input}],shortcutPropagation:[{type:o.Input}],monthColLimit:[{type:o.Input}],yearColLimit:[{type:o.Input}],customClass:[{type:o.Input}],dateDisabled:[{type:o.Input}],dayDisabled:[{type:o.Input}],activeDate:[{type:o.Input}],selectionDone:[{type:o.Output}],activeDateChange:[{type:o.Output}],_datePicker:[{type:o.ViewChild,args:[u]}]},e}(),m=function(){function e(e){this.labels=[],this.rows=[],this.weekNumbers=[],this.datePicker=e}return Object.defineProperty(e.prototype,"isBs4",{get:function(){return!n.isBs3()},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var f=this;this.datePicker.stepDay={months:1},this.datePicker.setRefreshViewHandler(function(){var e=this.activeDate.getFullYear(),t=this.activeDate.getMonth(),n=new Date(e,t,1),a=this.startingDay-n.getDay(),i=0<a?7-a:-a,r=new Date(n.getTime());0<i&&r.setDate(1-i);for(var o=f.getDates(r,42),s=[],c=0;c<42;c++){var d=this.createDateObject(o[c],this.formatDay);d.secondary=o[c].getMonth()!==t,d.uid=this.uniqueId+"-"+c,s[c]=d}f.labels=[];for(var l=0;l<7;l++)f.labels[l]={},f.labels[l].abbr=this.dateFilter(s[l].date,this.formatDayHeader),f.labels[l].full=this.dateFilter(s[l].date,"EEEE");if(f.title=this.dateFilter(this.activeDate,this.formatDayTitle),f.rows=this.split(s,7),this.showWeeks){f.weekNumbers=[];for(var u=(11-this.startingDay)%7,h=f.rows.length,p=0;p<h;p++)f.weekNumbers.push(f.getISO8601WeekNumber(f.rows[p][u].date))}},"day"),this.datePicker.setCompareHandler(function(e,t){var n=new Date(e.getFullYear(),e.getMonth(),e.getDate()),a=new Date(t.getFullYear(),t.getMonth(),t.getDate());return n.getTime()-a.getTime()},"day"),this.datePicker.refreshView()},e.prototype.getDates=function(e,t){for(var n,a=new Array(t),i=new Date(e.getTime()),r=0;r<t;)n=new Date(i.getTime()),n=this.datePicker.fixTimeZone(n),a[r++]=n,i=new Date(n.getFullYear(),n.getMonth(),n.getDate()+1);return a},e.prototype.getISO8601WeekNumber=function(e){var t=new Date(e.getTime());t.setDate(t.getDate()+4-(t.getDay()||7));var n=t.getTime();return t.setMonth(0),t.setDate(1),Math.floor(Math.round((n-t.getTime())/864e5)/7)+1},e.decorators=[{type:o.Component,args:[{selector:"daypicker",template:'\n<table *ngIf="datePicker.datepickerMode === \'day\'" role="grid" [attr.aria-labelledby]="datePicker.uniqueId + \'-title\'" aria-activedescendant="activeDateId">\n <thead>\n <tr>\n <th>\n <button *ngIf="!isBs4"\n type="button"\n class="btn btn-default btn-secondary btn-sm pull-left float-left"\n (click)="datePicker.move(-1)"\n tabindex="-1">‹</button>\n <button *ngIf="isBs4"\n type="button"\n class="btn btn-default btn-secondary btn-sm pull-left float-left"\n (click)="datePicker.move(-1)"\n tabindex="-1"><</button>\n </th>\n <th [attr.colspan]="5 + (datePicker.showWeeks ? 1 : 0)">\n <button [id]="datePicker.uniqueId + \'-title\'"\n type="button" class="btn btn-default btn-secondary btn-sm"\n (click)="datePicker.toggleMode(0)"\n [disabled]="datePicker.datepickerMode === datePicker.maxMode"\n [ngClass]="{disabled: datePicker.datepickerMode === datePicker.maxMode}" tabindex="-1" style="width:100%;">\n <strong>{{ title }}</strong>\n </button>\n </th>\n <th>\n <button *ngIf="!isBs4"\n type="button"\n class="btn btn-default btn-secondary btn-sm pull-right float-right"\n (click)="datePicker.move(1)"\n tabindex="-1">›</button>\n <button *ngIf="isBs4"\n type="button"\n class="btn btn-default btn-secondary btn-sm pull-right float-right"\n (click)="datePicker.move(1)"\n tabindex="-1">>\n </button>\n </th>\n </tr>\n <tr>\n <th *ngIf="datePicker.showWeeks"></th>\n <th *ngFor="let labelz of labels" class="text-center">\n <small aria-label="labelz.full"><b>{{ labelz.abbr }}</b></small>\n </th>\n </tr>\n </thead>\n <tbody>\n <ng-template ngFor [ngForOf]="rows" let-rowz="$implicit" let-index="index">\n <tr *ngIf="!(datePicker.onlyCurrentMonth && rowz[0].secondary && rowz[6].secondary)">\n <td *ngIf="datePicker.showWeeks" class="h6" class="text-center">\n <em>{{ weekNumbers[index] }}</em>\n </td>\n <td *ngFor="let dtz of rowz" class="text-center" role="gridcell" [id]="dtz.uid">\n <button type="button" style="min-width:100%;" class="btn btn-sm {{dtz.customClass}}"\n *ngIf="!(datePicker.onlyCurrentMonth && dtz.secondary)"\n [ngClass]="{\'btn-secondary\': isBs4 && !dtz.selected && !datePicker.isActive(dtz), \'btn-info\': dtz.selected, disabled: dtz.disabled, active: !isBs4 && datePicker.isActive(dtz), \'btn-default\': !isBs4}"\n [disabled]="dtz.disabled"\n (click)="datePicker.select(dtz.date)" tabindex="-1">\n <span [ngClass]="{\'text-muted\': dtz.secondary || dtz.current, \'text-info\': !isBs4 && dtz.current}">{{ dtz.label }}</span>\n </button>\n </td>\n </tr>\n </ng-template>\n </tbody>\n</table>\n ',styles:["\n :host .btn-secondary {\n color: #292b2c;\n background-color: #fff;\n border-color: #ccc;\n }\n :host .btn-info .text-muted {\n color: #292b2c !important;\n }\n "]}]}],e.ctorParameters=function(){return[{type:u}]},e}(),g=function(){function e(e){this.rows=[],this.datePicker=e}return Object.defineProperty(e.prototype,"isBs4",{get:function(){return!n.isBs3()},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var i=this;this.datePicker.stepMonth={years:1},this.datePicker.setRefreshViewHandler(function(){for(var e,t=new Array(12),n=this.activeDate.getFullYear(),a=0;a<12;a++)e=new Date(n,a,1),e=this.fixTimeZone(e),t[a]=this.createDateObject(e,this.formatMonth),t[a].uid=this.uniqueId+"-"+a;i.title=this.dateFilter(this.activeDate,this.formatMonthTitle),i.rows=this.split(t,i.datePicker.monthColLimit)},"month"),this.datePicker.setCompareHandler(function(e,t){var n=new Date(e.getFullYear(),e.getMonth()),a=new Date(t.getFullYear(),t.getMonth());return n.getTime()-a.getTime()},"month"),this.datePicker.refreshView()},e.decorators=[{type:o.Component,args:[{selector:"monthpicker",template:'\n<table *ngIf="datePicker.datepickerMode===\'month\'" role="grid">\n <thead>\n <tr>\n <th>\n <button type="button" class="btn btn-default btn-sm pull-left float-left"\n (click)="datePicker.move(-1)" tabindex="-1">‹</button></th>\n <th [attr.colspan]="((datePicker.monthColLimit - 2) <= 0) ? 1 : datePicker.monthColLimit - 2">\n <button [id]="datePicker.uniqueId + \'-title\'"\n type="button" class="btn btn-default btn-sm"\n (click)="datePicker.toggleMode(0)"\n [disabled]="datePicker.datepickerMode === maxMode"\n [ngClass]="{disabled: datePicker.datepickerMode === maxMode}" tabindex="-1" style="width:100%;">\n <strong>{{ title }}</strong> \n </button>\n </th>\n <th>\n <button type="button" class="btn btn-default btn-sm pull-right float-right"\n (click)="datePicker.move(1)" tabindex="-1">›</button>\n </th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor="let rowz of rows">\n <td *ngFor="let dtz of rowz" class="text-center" role="gridcell" [attr.id]="dtz.uid" [ngClass]="dtz.customClass">\n <button type="button" style="min-width:100%;" class="btn btn-default"\n [ngClass]="{\'btn-link\': isBs4 && !dtz.selected && !datePicker.isActive(dtz), \'btn-info\': dtz.selected || (isBs4 && !dtz.selected && datePicker.isActive(dtz)), disabled: dtz.disabled, active: !isBs4 && datePicker.isActive(dtz)}"\n [disabled]="dtz.disabled"\n (click)="datePicker.select(dtz.date)" tabindex="-1">\n <span [ngClass]="{\'text-success\': isBs4 && dtz.current, \'text-info\': !isBs4 && dtz.current}">{{ dtz.label }}</span>\n </button>\n </td>\n </tr>\n </tbody>\n</table>\n ',styles:["\n :host .btn-info .text-success {\n color: #fff !important;\n }\n "]}]}],e.ctorParameters=function(){return[{type:u}]},e}(),b=function(){function e(e){this.rows=[],this.datePicker=e}return Object.defineProperty(e.prototype,"isBs4",{get:function(){return!n.isBs3()},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var i=this;this.datePicker.stepYear={years:this.datePicker.yearRange},this.datePicker.setRefreshViewHandler(function(){for(var e,t=new Array(this.yearRange),n=i.getStartingYear(this.activeDate.getFullYear()),a=0;a<this.yearRange;a++)e=new Date(n+a,0,1),e=this.fixTimeZone(e),t[a]=this.createDateObject(e,this.formatYear),t[a].uid=this.uniqueId+"-"+a;i.title=[t[0].label,t[this.yearRange-1].label].join(" - "),i.rows=this.split(t,i.datePicker.yearColLimit)},"year"),this.datePicker.setCompareHandler(function(e,t){return e.getFullYear()-t.getFullYear()},"year"),this.datePicker.refreshView()},e.prototype.getStartingYear=function(e){return(e-1)/this.datePicker.yearRange*this.datePicker.yearRange+1},e.decorators=[{type:o.Component,args:[{selector:"yearpicker",template:'\n<table *ngIf="datePicker.datepickerMode===\'year\'" role="grid">\n <thead>\n <tr>\n <th>\n <button type="button" class="btn btn-default btn-sm pull-left float-left"\n (click)="datePicker.move(-1)" tabindex="-1">‹</button>\n </th>\n <th [attr.colspan]="((datePicker.yearColLimit - 2) <= 0) ? 1 : datePicker.yearColLimit - 2">\n <button [id]="datePicker.uniqueId + \'-title\'" role="heading"\n type="button" class="btn btn-default btn-sm"\n (click)="datePicker.toggleMode(0)"\n [disabled]="datePicker.datepickerMode === datePicker.maxMode"\n [ngClass]="{disabled: datePicker.datepickerMode === datePicker.maxMode}" tabindex="-1" style="width:100%;">\n <strong>{{ title }}</strong>\n </button>\n </th>\n <th>\n <button type="button" class="btn btn-default btn-sm pull-right float-right"\n (click)="datePicker.move(1)" tabindex="-1">›</button>\n </th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor="let rowz of rows">\n <td *ngFor="let dtz of rowz" class="text-center" role="gridcell" [attr.id]="dtz.uid">\n <button type="button" style="min-width:100%;" class="btn btn-default"\n [ngClass]="{\'btn-link\': isBs4 && !dtz.selected && !datePicker.isActive(dtz), \'btn-info\': dtz.selected || (isBs4 && !dtz.selected && datePicker.isActive(dtz)), disabled: dtz.disabled, active: !isBs4 && datePicker.isActive(dtz)}"\n [disabled]="dtz.disabled"\n (click)="datePicker.select(dtz.date)" tabindex="-1">\n <span [ngClass]="{\'text-success\': isBs4 && dtz.current, \'text-info\': !isBs4 && dtz.current}">{{ dtz.label }}</span>\n </button>\n </td>\n </tr>\n </tbody>\n</table>\n ',styles:["\n :host .btn-info .text-success {\n color: #fff !important;\n }\n "]}]}],e.ctorParameters=function(){return[{type:u}]},e}(),v=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[h]}},e.decorators=[{type:o.NgModule,args:[{imports:[a.CommonModule,t.FormsModule],declarations:[y,u,m,g,b],exports:[y,u,m,g,b],entryComponents:[y]}]}],e}(),D=function(e,t){return(D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function w(e,t){function n(){this.constructor=e}D(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function k(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function _(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var a,i,r=n.call(e),o=[];try{for(;(void 0===t||0<t--)&&!(a=r.next()).done;)o.push(a.value)}catch(s){i={error:s}}finally{try{a&&!a.done&&(n=r["return"])&&n.call(r)}finally{if(i)throw i.error}}return o}function C(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(_(arguments[t]));return e}var M=function(){function e(){this._customRangesFish=[]}return Object.defineProperty(e.prototype,"minDate",{set:function(e){this._effects.setMinDate(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxDate",{set:function(e){this._effects.setMaxDate(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabled",{set:function(e){this._effects.setDisabled(e)},enumerable:!0,configurable:!0}),e.prototype.setViewMode=function(e){},e.prototype.navigateTo=function(e){},e.prototype.dayHoverHandler=function(e){},e.prototype.monthHoverHandler=function(e){},e.prototype.yearHoverHandler=function(e){},e.prototype.daySelectHandler=function(e){},e.prototype.monthSelectHandler=function(e){},e.prototype.yearSelectHandler=function(e){},e.prototype._stopPropagation=function(e){e.stopPropagation()},e}(),x=function(){function e(){this.containerClass="theme-green",this.displayMonths=1,this.showWeekNumbers=!0,this.dateInputFormat="L",this.rangeSeparator=" - ",this.rangeInputFormat="L",this.monthTitle="MMMM",this.yearTitle="YYYY",this.dayLabel="D",this.monthLabel="MMMM",this.yearLabel="YYYY",this.weekNumbers="w"}return e.decorators=[{type:o.Injectable}],e}(),O=function(){function t(){}return t.prototype.calculate=function(){return{type:t.CALCULATE}},t.prototype.format=function(){return{type:t.FORMAT}},t.prototype.flag=function(){return{type:t.FLAG}},t.prototype.select=function(e){return{type:t.SELECT,payload:e}},t.prototype.changeViewMode=function(e){return{type:t.CHANGE_VIEWMODE,payload:e}},t.prototype.navigateTo=function(e){return{type:t.NAVIGATE_TO,payload:e}},t.prototype.navigateStep=function(e){return{type:t.NAVIGATE_OFFSET,payload:e}},t.prototype.setOptions=function(e){return{type:t.SET_OPTIONS,payload:e}},t.prototype.selectRange=function(e){return{type:t.SELECT_RANGE,payload:e}},t.prototype.hoverDay=function(e){return{type:t.HOVER,payload:e.isHovered?e.cell.date:null}},t.prototype.minDate=function(e){return{type:t.SET_MIN_DATE,payload:e}},t.prototype.maxDate=function(e){return{type:t.SET_MAX_DATE,payload:e}},t.prototype.isDisabled=function(e){return{type:t.SET_IS_DISABLED,payload:e}},t.prototype.setLocale=function(e){return{type:t.SET_LOCALE,payload:e}},t.CALCULATE="[datepicker] calculate dates matrix",t.FORMAT="[datepicker] format datepicker values",t.FLAG="[datepicker] set flags",t.SELECT="[datepicker] select date",t.NAVIGATE_OFFSET="[datepicker] shift view date",t.NAVIGATE_TO="[datepicker] change view date",t.SET_OPTIONS="[datepicker] update render options",t.HOVER="[datepicker] hover date",t.CHANGE_VIEWMODE="[datepicker] switch view mode",t.SET_MIN_DATE="[datepicker] set min date",t.SET_MAX_DATE="[datepicker] set max date",t.SET_IS_DISABLED="[datepicker] set is disabled",t.SET_LOCALE="[datepicker] set datepicker locale",t.SELECT_RANGE="[daterangepicker] select dates range",t.decorators=[{type:o.Injectable}],t}(),I=function(){function e(){this._defaultLocale="en",this._locale=new i.BehaviorSubject(this._defaultLocale),this._localeChange=this._locale.asObservable()}return Object.defineProperty(e.prototype,"locale",{get:function(){return this._locale},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localeChange",{get:function(){return this._localeChange},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentLocale",{get:function(){return this._locale.getValue()},enumerable:!0,configurable:!0}),e.prototype.use=function(e){e!==this.currentLocale&&this._locale.next(e)},e.decorators=[{type:o.Injectable}],e}(),S=function(){function e(e,t){this._actions=e,this._localeService=t,this._subs=[]}return e.prototype.init=function(e){return this._store=e,this},e.prototype.setValue=function(e){this._store.dispatch(this._actions.select(e))},e.prototype.setRangeValue=function(e){this._store.dispatch(this._actions.selectRange(e))},e.prototype.setMinDate=function(e){return this._store.dispatch(this._actions.minDate(e)),this},e.prototype.setMaxDate=function(e){return this._store.dispatch(this._actions.maxDate(e)),this},e.prototype.setDisabled=function(e){return this._store.dispatch(this._actions.isDisabled(e)),this},e.prototype.setOptions=function(e){var t=Object.assign({locale:this._localeService.currentLocale},e);return this._store.dispatch(this._actions.setOptions(t)),this},e.prototype.setBindings=function(e){return e.daysCalendar=this._store.select(function(e){return e.flaggedMonths}).pipe(r.filter(function(e){return!!e})),e.monthsCalendar=this._store.select(function(e){return e.flaggedMonthsCalendar}).pipe(r.filter(function(e){return!!e})),e.yearsCalendar=this._store.select(function(e){return e.yearsCalendarFlagged}).pipe(r.filter(function(e){return!!e})),e.viewMode=this._store.select(function(e){return e.view.mode}),e.options=this._store.select(function(e){return e.showWeekNumbers}).pipe(r.map(function(e){return{showWeekNumbers:e}})),this},e.prototype.setEventHandlers=function(e){var n=this;return e.setViewMode=function(e){n._store.dispatch(n._actions.changeViewMode(e))},e.navigateTo=function(e){n._store.dispatch(n._actions.navigateStep(e.step))},e.dayHoverHandler=function(e){var t=e.cell;t.isOtherMonth||t.isDisabled||(n._store.dispatch(n._actions.hoverDay(e)),t.isHovered=e.isHovered)},e.monthHoverHandler=function(e){e.cell.isHovered=e.isHovered},e.yearHoverHandler=function(e){e.cell.isHovered=e.isHovered},e.monthSelectHandler=function(e){e.isDisabled||n._store.dispatch(n._actions.navigateTo({unit:{month:f.getMonth(e.date)},viewMode:"day"}))},e.yearSelectHandler=function(e){e.isDisabled||n._store.dispatch(n._actions.navigateTo({unit:{year:f.getFullYear(e.date)},viewMode:"month"}))},this},e.prototype.registerDatepickerSideEffects=function(){var t=this;return this._subs.push(this._store.select(function(e){return e.view}).subscribe(function(e){t._store.dispatch(t._actions.calculate())})),this._subs.push(this._store.select(function(e){return e.monthsModel}).pipe(r.filter(function(e){return!!e})).subscribe(function(e){return t._store.dispatch(t._actions.format())})),this._subs.push(this._store.select(function(e){return e.formattedMonths}).pipe(r.filter(function(e){return!!e})).subscribe(function(e){return t._store.dispatch(t._actions.flag())})),this._subs.push(this._store.select(function(e){return e.selectedDate}).pipe(r.filter(function(e){return!!e})).subscribe(function(e){return t._store.dispatch(t._actions.flag())})),this._subs.push(this._store.select(function(e){return e.selectedRange}).pipe(r.filter(function(e){return!!e})).subscribe(function(e){return t._store.dispatch(t._actions.flag())})),this._subs.push(this._store.select(function(e){return e.monthsCalendar}).subscribe(function(){return t._store.dispatch(t._actions.flag())})),this._subs.push(this._store.select(function(e){return e.yearsCalendarModel}).pipe(r.filter(function(e){return!!e})).subscribe(function(){return t._store.dispatch(t._actions.flag())})),this._subs.push(this._store.select(function(e){return e.hoveredDate}).pipe(r.filter(function(e){return!!e})).subscribe(function(e){return t._store.dispatch(t._actions.flag())})),this._subs.push(this._localeService.localeChange.subscribe(function(e){return t._store.dispatch(t._actions.setLocale(e))})),this},e.prototype.destroy=function(){try{for(var e=k(this._subs),t=e.next();!t.done;t=e.next()){t.value.unsubscribe()}}catch(i){n={error:i}}finally{try{t&&!t.done&&(a=e["return"])&&a.call(e)}finally{if(n)throw n.error}}var n,a},e.decorators=[{type:o.Injectable}],e.ctorParameters=function(){return[{type:O},{type:I}]},e}(),E={date:new Date,mode:"day"},A=Object.assign(new x,{locale:"en",view:E,selectedRange:[],monthViewOptions:{width:7,height:6}});function V(e,t,n){var a=t&&f.isBefore(f.endOf(e,"month"),t,"day"),i=n&&f.isAfter(f.startOf(e,"month"),n,"day");return a||i}function H(e,t,n){var a=t&&f.isBefore(f.endOf(e,"year"),t,"day"),i=n&&f.isAfter(f.startOf(e,"year"),n,"day");return a||i}function T(e,t){for(var n=e.initialDate,a=new Array(e.height),i=0;i<e.height;i++){a[i]=new Array(e.width);for(var r=0;r<e.width;r++)a[i][r]=t(n),n=f.shiftDate(n,e.shift)}return a}function P(e,t){var n=f.getFirstDayOfMonth(e),a=function i(e,t){if(f.isFirstDayOfWeek(e,t.firstDayOfWeek))return e;var n=function a(e,t){if(0===t)return e;var n=e-t%7;return n<0?n+7:n}(f.getDay(e),t.firstDayOfWeek);return f.shiftDate(e,{day:-n})}(n,t);return{daysMatrix:T({width:t.width,height:t.height,initialDate:a,shift:{day:1}},function(e){return e}),month:n}}function R(e,a,i){return{month:e.month,monthTitle:f.formatDate(e.month,a.monthTitle,a.locale),yearTitle:f.formatDate(e.month,a.yearTitle,a.locale),weekNumbers:function r(e,t,n){return e.map(function(e){return e[0]?f.formatDate(e[0],t,n):""})}(e.daysMatrix,a.weekNumbers,a.locale),weekdays:function o(e){var t=f.getLocale(e),n=t.weekdaysShort(),a=t.firstDayOfWeek();return C(n.slice(a),n.slice(0,a))}(a.locale),weeks:e.daysMatrix.map(function(e,n){return{days:e.map(function(e,t){return{date:e,label:f.formatDate(e,a.dayLabel,a.locale),monthIndex:i,weekIndex:n,dayIndex:t}})}})}}var F=4,L=3,N={month:1};function j(e,t){var n=f.startOf(e,"year");return{months:T({width:L,height:F,initialDate:n,shift:N},function(e){return{date:e,label:f.formatDate(e,t.monthLabel,t.locale)}}),monthTitle:"",yearTitle:f.formatDate(e,t.yearTitle,t.locale)}}var Y=4,z=4,B=Y*z,W=-1*(Math.floor(B/2)-1),$={year:1};function G(e,t){var n=f.shiftDate(e,{year:W}),a=T({width:z,height:Y,initialDate:n,shift:$},function(e){return{date:e,label:f.formatDate(e,t.yearLabel,t.locale)}});return{years:a,monthTitle:"",yearTitle:function i(e,t){var n=f.formatDate(e[0][0].date,t.yearTitle,t.locale),a=f.formatDate(e[Y-1][z-1].date,t.yearTitle,t.locale);return n+" - "+a}(a,t)}}function q(e,t){switch(void 0===e&&(e=A),t.type){case O.CALCULATE:return function c(e){var t=e.displayMonths,n=e.view.date;if("day"===e.view.mode){e.monthViewOptions.firstDayOfWeek=f.getLocale(e.locale).firstDayOfWeek();for(var a=new Array(t),i=0;i<t;i++)a[i]=P(n,e.monthViewOptions),n=f.shiftDate(n,{month:1});return Object.assign({},e,{monthsModel:a})}if("month"===e.view.mode){for(var r=new Array(t),o=0;o<t;o++)r[o]=j(n,U(e)),n=f.shiftDate(n,{year:1});return Object.assign({},e,{monthsCalendar:r})}if("year"!==e.view.mode)return e;for(var s=new Array(t),o=0;o<t;o++)s[o]=G(n,U(e)),n=f.shiftDate(n,{year:B});return Object.assign({},e,{yearsCalendarModel:s})}(e);case O.FORMAT:return function d(n,e){if("day"===n.view.mode){var t=n.monthsModel.map(function(e,t){return R(e,U(n),t)});return Object.assign({},n,{formattedMonths:t})}var a=n.displayMonths,i=n.view.date;if("month"===n.view.mode){for(var r=new Array(a),o=0;o<a;o++)r[o]=j(i,U(n)),i=f.shiftDate(i,{year:1});return Object.assign({},n,{monthsCalendar:r})}if("year"!==n.view.mode)return n;for(var s=new Array(a),o=0;o<a;o++)s[o]=G(i,U(n)),i=f.shiftDate(i,{year:16});return Object.assign({},n,{yearsCalendarModel:s})}(e);case O.FLAG:return function o(a,e){if("day"===a.view.mode){var t=a.formattedMonths.map(function(e,t){return function n(h,p){return h.weeks.forEach(function(u,e){u.days.forEach(function(e,t){var n=!f.isSameMonth(e.date,h.month),a=!n&&f.isSameDay(e.date,p.hoveredDate),i=!n&&p.selectedRange&&f.isSameDay(e.date,p.selectedRange[0]),r=!n&&p.selectedRange&&f.isSameDay(e.date,p.selectedRange[1]),o=!n&&f.isSameDay(e.date,p.selectedDate)||i||r,s=!n&&p.selectedRange&&function l(e,t,n){return!(!e||!t[0])&&(t[1]?e>t[0]&&e<=t[1]:!!n&&(e>t[0]&&e<=n))}(e.date,p.selectedRange,p.hoveredDate),c=p.isDisabled||f.isBefore(e.date,p.minDate,"day")||f.isAfter(e.date,p.maxDate,"day"),d=Object.assign({},e,{isOtherMonth:n,isHovered:a,isSelected:o,isSelectionStart:i,isSelectionEnd:r,isInRange:s,isDisabled:c});e.isOtherMonth===d.isOtherMonth&&e.isHovered===d.isHovered&&e.isSelected===d.isSelected&&e.isSelectionStart===d.isSelectionStart&&e.isSelectionEnd===d.isSelectionEnd&&e.isDisabled===d.isDisabled&&e.isInRange===d.isInRange||(u.days[t]=d)})}),h.hideLeftArrow=p.isDisabled||0<p.monthIndex&&p.monthIndex!==p.displayMonths,h.hideRightArrow=p.isDisabled||p.monthIndex<p.displayMonths&&p.monthIndex+1!==p.displayMonths,h.disableLeftArrow=V(f.shiftDate(h.month,{month:-1}),p.minDate,p.maxDate),h.disableRightArrow=V(f.shiftDate(h.month,{month:1}),p.minDate,p.maxDate),h}(e,{isDisabled:a.isDisabled,minDate:a.minDate,maxDate:a.maxDate,hoveredDate:a.hoveredDate,selectedDate:a.selectedDate,selectedRange:a.selectedRange,displayMonths:a.displayMonths,monthIndex:t})});return Object.assign({},a,{flaggedMonths:t})}if("month"===a.view.mode){var n=a.monthsCalendar.map(function(e,t){return function n(o,s){return o.months.forEach(function(e,r){e.forEach(function(e,t){var n=f.isSameMonth(e.date,s.hoveredMonth),a=s.isDisabled||V(e.date,s.minDate,s.maxDate),i=Object.assign(e,{isHovered:n,isDisabled:a});e.isHovered===i.isHovered&&e.isDisabled===i.isDisabled||(o.months[r][t]=i)})}),o.hideLeftArrow=0<s.monthIndex&&s.monthIndex!==s.displayMonths,o.hideRightArrow=s.monthIndex<s.displayMonths&&s.monthIndex+1!==s.displayMonths,o.disableLeftArrow=H(f.shiftDate(o.months[0][0].date,{year:-1}),s.minDate,s.maxDate),o.disableRightArrow=H(f.shiftDate(o.months[0][0].date,{year:1}),s.minDate,s.maxDate),o}(e,{isDisabled:a.isDisabled,minDate:a.minDate,maxDate:a.maxDate,hoveredMonth:a.hoveredMonth,displayMonths:a.displayMonths,monthIndex:t})});return Object.assign({},a,{flaggedMonthsCalendar:n})}if("year"!==a.view.mode)return a;var i=a.yearsCalendarModel.map(function(e,t){return function n(o,s){o.years.forEach(function(e,r){e.forEach(function(e,t){var n=f.isSameYear(e.date,s.hoveredYear),a=s.isDisabled||H(e.date,s.minDate,s.maxDate),i=Object.assign(e,{isHovered:n,isDisabled:a});e.isHovered===i.isHovered&&e.isDisabled===i.isDisabled||(o.years[r][t]=i)})}),o.hideLeftArrow=0<s.yearIndex&&s.yearIndex!==s.displayMonths,o.hideRightArrow=s.yearIndex<s.displayMonths&&s.yearIndex+1!==s.displayMonths,o.disableLeftArrow=H(f.shiftDate(o.years[0][0].date,{year:-1}),s.minDate,s.maxDate);var e=o.years.length-1,t=o.years[e].length-1;return o.disableRightArrow=H(f.shiftDate(o.years[e][t].date,{year:1}),s.minDate,s.maxDate),o}(e,{isDisabled:a.isDisabled,minDate:a.minDate,maxDate:a.maxDate,hoveredYear:a.hoveredYear,displayMonths:a.displayMonths,yearIndex:t})});return Object.assign({},a,{yearsCalendarFlagged:i})}(e);case O.NAVIGATE_OFFSET:var n=f.shiftDate(f.startOf(e.view.date,"month"),t.payload),a={view:{mode:e.view.mode,date:n}};return Object.assign({},e,a);case O.NAVIGATE_TO:var i=t.payload;a={view:{date:n=f.setFullDate(e.view.date,i.unit),mode:r=i.viewMode}};return Object.assign({},e,a);case O.CHANGE_VIEWMODE:t.payload,0;a={view:{date:n=e.view.date,mode:r=t.payload}};return Object.assign({},e,a);case O.HOVER:return Object.assign({},e,{hoveredDate:t.payload});case O.SELECT:a={selectedDate:t.payload,view:e.view};var r=e.view.mode;n=Z(t.payload||e.view.date,e.minDate,e.maxDate);return a.view={mode:r,date:n},Object.assign({},e,a);case O.SET_OPTIONS:a=t.payload,r=e.view.mode,n=Z(f.isDateValid(a.value)&&a.value||f.isArray(a.value)&&f.isDateValid(a.value[0])&&a.value[0]||e.view.date,a.minDate,a.maxDate);return a.view={mode:r,date:n},a.value&&(f.isArray(a.value)&&(a.selectedRange=a.value),a.value instanceof Date&&(a.selectedDate=a.value)),Object.assign({},e,a);case O.SELECT_RANGE:a={selectedRange:t.payload,view:e.view},r=e.view.mode,n=Z(t.payload&&t.payload[0]||e.view.date,e.minDate,e.maxDate);return a.view={mode:r,date:n},Object.assign({},e,a);case O.SET_MIN_DATE:return Object.assign({},e,{minDate:t.payload});case O.SET_MAX_DATE:return Object.assign({},e,{maxDate:t.payload});case O.SET_IS_DISABLED:return Object.assign({},e,{isDisabled:t.payload});default:return e}}function U(e){return{locale:e.locale,monthTitle:e.monthTitle,yearTitle:e.yearTitle,dayLabel:e.dayLabel,monthLabel:e.monthLabel,yearLabel:e.yearLabel,weekNumbers:e.weekNumbers}}function Z(e,t,n){var a=Array.isArray(e)?e[0]:e;return t&&f.isAfter(t,a,"day")?t:n&&f.isBefore(n,a,"day")?n:a}var Q=function(n){function e(){var e=new i.BehaviorSubject({type:"[datepicker] dispatcher init"}),t=new s.MiniState(A,e,q);return n.call(this,e,q,t)||this}return w(e,n),e.decorators=[{type:o.Injectable}],e.ctorParameters=function(){return[]},e}(s.MiniStore),K=function(r){function e(e,t,n,a){var i=r.call(this)||this;return i._config=e,i._store=t,i._actions=n,i.valueChange=new o.EventEmitter,i._subs=[],i._effects=a,i}return w(e,r),Object.defineProperty(e.prototype,"value",{set:function(e){this._effects.setValue(e)},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var t=this;this.containerClass=this._config.containerClass,this._effects.init(this._store).setOptions(this._config).setBindings(this).setEventHandlers(this).registerDatepickerSideEffects(),this._subs.push(this._store.select(function(e){return e.selectedDate}).subscribe(function(e){return t.valueChange.emit(e)}))},e.prototype.daySelectHandler=function(e){e.isOtherMonth||e.isDisabled||this._store.dispatch(this._actions.select(e.date))},e.prototype.ngOnDestroy=function(){try{for(var e=k(this._subs),t=e.next();!t.done;t=e.next()){t.value.unsubscribe()}}catch(i){n={error:i}}finally{try{t&&!t.done&&(a=e["return"])&&a.call(e)}finally{if(n)throw n.error}}var n,a;this._effects.destroy()},e.decorators=[{type:o.Component,args:[{selector:"bs-datepicker-container",providers:[Q,S],template:'\x3c!-- days calendar view mode --\x3e\n<div class="bs-datepicker" [ngClass]="containerClass" *ngIf="viewMode | async">\n <div class="bs-datepicker-container">\n\n \x3c!--calendars--\x3e\n <div class="bs-calendar-container" [ngSwitch]="viewMode | async" role="application">\n \x3c!--days calendar--\x3e\n <div *ngSwitchCase="\'day\'">\n <bs-days-calendar-view\n *ngFor="let calendar of (daysCalendar | async)"\n [class.bs-datepicker-multiple]="(daysCalendar | async)?.length > 1"\n [calendar]="calendar"\n [options]="options | async"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="setViewMode($event)"\n (onHover)="dayHoverHandler($event)"\n (onSelect)="daySelectHandler($event)"\n ></bs-days-calendar-view>\n </div>\n\n \x3c!--months calendar--\x3e\n <div *ngSwitchCase="\'month\'">\n <bs-month-calendar-view\n *ngFor="let calendar of (monthsCalendar | async)"\n [class.bs-datepicker-multiple]="(daysCalendar | async)?.length > 1"\n [calendar]="calendar"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="setViewMode($event)"\n (onHover)="monthHoverHandler($event)"\n (onSelect)="monthSelectHandler($event)"\n ></bs-month-calendar-view>\n </div>\n\n \x3c!--years calendar--\x3e\n <div *ngSwitchCase="\'year\'">\n <bs-years-calendar-view\n *ngFor="let calendar of (yearsCalendar | async)"\n [class.bs-datepicker-multiple]="(daysCalendar | async )?.length > 1"\n [calendar]="calendar"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="setViewMode($event)"\n (onHover)="yearHoverHandler($event)"\n (onSelect)="yearSelectHandler($event)"\n ></bs-years-calendar-view>\n </div>\n\n </div>\n\n \x3c!--applycancel buttons--\x3e\n <div class="bs-datepicker-buttons" *ngIf="false">\n <button class="btn btn-success">Apply</button>\n <button class="btn btn-default">Cancel</button>\n </div>\n\n </div>\n\n \x3c!--custom dates or date ranges picker--\x3e\n <div class="bs-datepicker-custom-range" *ngIf="false">\n <bs-custom-date-view [ranges]="_customRangesFish"></bs-custom-date-view>\n </div>\n</div>\n',host:{"(click)":"_stopPropagation($event)",style:"position: absolute; display: block;",role:"dialog","aria-label":"calendar"}}]}],e.ctorParameters=function(){return[{type:x},{type:Q},{type:O},{type:S}]},e}(M),X=function(){function e(e,t,n,a,i){this._config=e,this.placement="bottom",this.triggers="click",this.outsideClick=!0,this.container="body",this.bsValueChange=new o.EventEmitter,this._subs=[],Object.assign(this,this._config),this._datepicker=i.createLoader(t,a,n),this.onShown=this._datepicker.onShown,this.onHidden=this._datepicker.onHidden}return Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._datepicker.isShown},set:function(e){e?this.show():this.hide()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bsValue",{set:function(e){this._bsValue!==e&&(this._bsValue=e,this.bsValueChange.emit(e))},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this._datepicker.listen({outsideClick:this.outsideClick,triggers:this.triggers,show:function(){return e.show()}}),this.setConfig()},e.prototype.ngOnChanges=function(e){this._datepickerRef&&this._datepickerRef.instance&&(e.minDate&&(this._datepickerRef.instance.minDate=this.minDate),e.maxDate&&(this._datepickerRef.instance.maxDate=this.maxDate),e.isDisabled&&(this._datepickerRef.instance.isDisabled=this.isDisabled))},e.prototype.show=function(){var t=this;this._datepicker.isShown||(this.setConfig(),this._datepickerRef=this._datepicker.provide({provide:x,useValue:this._config}).attach(K).to(this.container).position({attachment:this.placement}).show({placement:this.placement}),this._subs.push(this.bsValueChange.subscribe(function(e){t._datepickerRef.instance.value=e})),this._subs.push(this._datepickerRef.instance.valueChange.subscribe(function(e){t.bsValue=e,t.hide()})))},e.prototype.hide=function(){this.isOpen&&this._datepicker.hide();try{for(var e=k(this._subs),t=e.next();!t.done;t=e.next()){t.value.unsubscribe()}}catch(i){n={error:i}}finally{try{t&&!t.done&&(a=e["return"])&&a.call(e)}finally{if(n)throw n.error}}var n,a},e.prototype.toggle=function(){if(this.isOpen)return this.hide();this.show()},e.prototype.setConfig=function(){this._config=Object.assign({},this._config,this.bsConfig,{value:this._bsValue,isDisabled:this.isDisabled,minDate:this.minDate||this.bsConfig&&this.bsConfig.minDate,maxDate:this.maxDate||this.bsConfig&&this.bsConfig.maxDate})},e.prototype.ngOnDestroy=function(){this._datepicker.dispose()},e.decorators=[{type:o.Directive,args:[{selector:"[bsDatepicker]",exportAs:"bsDatepicker"}]}],e.ctorParameters=function(){return[{type:x},{type:o.ElementRef},{type:o.Renderer2},{type:o.ViewContainerRef},{type:c.ComponentLoaderFactory}]},e.propDecorators={placement:[{type:o.Input}],triggers:[{type:o.Input}],outsideClick:[{type:o.Input}],container:[{type:o.Input}],isOpen:[{type:o.Input}],onShown:[{type:o.Output}],onHidden:[{type:o.Output}],bsValue:[{type:o.Input}],bsConfig:[{type:o.Input}],isDisabled:[{type:o.Input}],minDate:[{type:o.Input}],maxDate:[{type:o.Input}],bsValueChange:[{type:o.Output}]},e}(),J={provide:t.NG_VALUE_ACCESSOR,useExisting:o.forwardRef(function(){return te}),multi:!0},ee={provide:t.NG_VALIDATORS,useExisting:o.forwardRef(function(){return te}),multi:!0},te=function(){function e(e,t,n,a,i){var r=this;this._picker=e,this._localeService=t,this._renderer=n,this._elRef=a,this.changeDetection=i,this._onChange=Function.prototype,this._onTouched=Function.prototype,this._validatorChange=Function.prototype,this._picker.bsValueChange.subscribe(function(e){r._setInputValue(e),r._value!==e&&(r._value=e,r._onChange(e),r._onTouched()),r.changeDetection.markForCheck()}),this._localeService.localeChange.subscribe(function(){r._setInputValue(r._value)})}return e.prototype._setInputValue=function(e){var t=e?f.formatDate(e,this._picker._config.dateInputFormat,this._localeService.currentLocale):"";this._renderer.setProperty(this._elRef.nativeElement,"value",t)},e.prototype.onChange=function(e){this.writeValue(e.target.value),this._onChange(this._value),this._onTouched()},e.prototype.validate=function(e){var t=e.value;if(null===t||t===undefined||""===t)return null;if(f.isDate(t)){if(!f.isDateValid(t))return{bsDate:{invalid:t}};if(this._picker&&this._picker.minDate&&f.isBefore(t,this._picker.minDate,"date"))return{bsDate:{minDate:this._picker.minDate}};if(this._picker&&this._picker.maxDate&&f.isAfter(t,this._picker.maxDate,"date"))return{bsDate:{maxDate:this._picker.maxDate}}}},e.prototype.registerOnValidatorChange=function(e){this._validatorChange=e},e.prototype.writeValue=function(e){if(e){var t=this._localeService.currentLocale;if(!f.getLocale(t))throw new Error('Locale "'+t+'" is not defined, please add it with "defineLocale(...)"');this._value=f.parseDate(e,this._picker._config.dateInputFormat,this._localeService.currentLocale)}else this._value=null;this._picker.bsValue=this._value},e.prototype.setDisabledState=function(e){(this._picker.isDisabled=e)?this._renderer.setAttribute(this._elRef.nativeElement,"disabled","disabled"):this._renderer.removeAttribute(this._elRef.nativeElement,"disabled")},e.prototype.registerOnChange=function(e){this._onChange=e},e.prototype.registerOnTouched=function(e){this._onTouched=e},e.prototype.onBlur=function(){this._onTouched()},e.prototype.hide=function(){this._picker.hide()},e.decorators=[{type:o.Directive,args:[{selector:"input[bsDatepicker]",host:{"(change)":"onChange($event)","(keyup.esc)":"hide()","(blur)":"onBlur()"},providers:[J,ee]}]}],e.ctorParameters=function(){return[{type:X,decorators:[{type:o.Host}]},{type:I},{type:o.Renderer2},{type:o.ElementRef},{type:o.ChangeDetectorRef}]},e}(),ne=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.displayMonths=2,e}return w(e,t),e.decorators=[{type:o.Injectable}],e}(x),ae=function(r){function e(e,t,n,a){var i=r.call(this)||this;return i._config=e,i._store=t,i._actions=n,i.valueChange=new o.EventEmitter,i._rangeStack=[],i._subs=[],i._effects=a,i}return w(e,r),Object.defineProperty(e.prototype,"value",{set:function(e){this._effects.setRangeValue(e)},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var t=this;this.containerClass=this._config.containerClass,this._effects.init(this._store).setOptions(this._config).setBindings(this).setEventHandlers(this).registerDatepickerSideEffects(),this._subs.push(this._store.select(function(e){return e.selectedRange}).subscribe(function(e){return t.valueChange.emit(e)}))},e.prototype.daySelectHandler=function(e){e.isOtherMonth||e.isDisabled||(1===this._rangeStack.length&&(this._rangeStack=e.date>=this._rangeStack[0]?[this._rangeStack[0],e.date]:[e.date]),0===this._rangeStack.length&&(this._rangeStack=[e.date]),this._store.dispatch(this._actions.selectRange(this._rangeStack)),2===this._rangeStack.length&&(this._rangeStack=[]))},e.prototype.ngOnDestroy=function(){try{for(var e=k(this._subs),t=e.next();!t.done;t=e.next()){t.value.unsubscribe()}}catch(i){n={error:i}}finally{try{t&&!t.done&&(a=e["return"])&&a.call(e)}finally{if(n)throw n.error}}var n,a;this._effects.destroy()},e.decorators=[{type:o.Component,args:[{selector:"bs-daterangepicker-container",providers:[Q,S],template:'\x3c!-- days calendar view