ngx-bootstrap
Version:
Angular Bootstrap
16 lines (14 loc) • 112 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs/operators"),require("ngx-bootstrap/chronos"),require("ngx-bootstrap/positioning"),require("@angular/animations"),require("rxjs"),require("ngx-bootstrap/mini-ngrx"),require("ngx-bootstrap/component-loader"),require("@angular/forms"),require("ngx-bootstrap/utils"),require("@angular/common"),require("ngx-bootstrap/tooltip")):"function"==typeof define&&define.amd?define("ngx-bootstrap/datepicker",["exports","@angular/core","rxjs/operators","ngx-bootstrap/chronos","ngx-bootstrap/positioning","@angular/animations","rxjs","ngx-bootstrap/mini-ngrx","ngx-bootstrap/component-loader","@angular/forms","ngx-bootstrap/utils","@angular/common","ngx-bootstrap/tooltip"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self)["ngx-bootstrap"]=e["ngx-bootstrap"]||{},e["ngx-bootstrap"].datepicker={}),e.ng.core,e.rxjs.operators,e.chronos,e.positioning,e.ng.animations,e.rxjs,e.miniNgrx,e.componentLoader,e.ng.forms,e.utils,e.ng.common,e.tooltip)}(this,(function(e,t,n,i,a,s,o,r,c,d,l,u,h){"use strict";var p=function(){this.adaptivePosition=!1,this.useUtc=!1,this.isAnimated=!1,this.startView="day",this.returnFocusToInput=!1,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",this.showTodayButton=!1,this.showClearButton=!1,this.todayPosition="center",this.clearPosition="right",this.todayButtonLabel="Today",this.clearButtonLabel="Clear",this.customRangeButtonLabel="Custom Range"};p.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new p},token:p,providedIn:"root"}),p.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}];
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var f=function(e,t){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}f(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function b(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,a,s=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){a={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(a)throw a.error}}return o}function m(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}Object.create;var v="220ms cubic-bezier(0, 0, 0.2, 1)",D=s.trigger("datepickerAnimation",[s.state("animated-down",s.style({height:"*",overflow:"hidden"})),s.transition("* => animated-down",[s.style({height:0,overflow:"hidden"}),s.animate(v)]),s.state("animated-up",s.style({height:"*",overflow:"hidden"})),s.transition("* => animated-up",[s.style({height:"*",overflow:"hidden"}),s.animate(v)]),s.transition("* => unanimated",s.animate("0s"))]),_=function(){function e(){this.containerClass="",this.customRanges=[],this.chosenRange=[],this._daysCalendarSub=new o.Subscription}return Object.defineProperty(e.prototype,"minDate",{set:function(e){var t;null===(t=this._effects)||void 0===t||t.setMinDate(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxDate",{set:function(e){var t;null===(t=this._effects)||void 0===t||t.setMaxDate(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"daysDisabled",{set:function(e){var t;null===(t=this._effects)||void 0===t||t.setDaysDisabled(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"datesDisabled",{set:function(e){var t;null===(t=this._effects)||void 0===t||t.setDatesDisabled(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"datesEnabled",{set:function(e){var t;null===(t=this._effects)||void 0===t||t.setDatesEnabled(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDisabled",{set:function(e){var t;null===(t=this._effects)||void 0===t||t.setDisabled(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dateCustomClasses",{set:function(e){var t;null===(t=this._effects)||void 0===t||t.setDateCustomClasses(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dateTooltipTexts",{set:function(e){var t;null===(t=this._effects)||void 0===t||t.setDateTooltipTexts(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"daysCalendar$",{get:function(){return this._daysCalendar$},set:function(e){var t=this;this._daysCalendar$=e,this._daysCalendarSub.unsubscribe(),this._daysCalendarSub.add(this._daysCalendar$.subscribe((function(e){t.multipleCalendars=!!e&&e.length>1})))},enumerable:!1,configurable:!0}),e.prototype.setViewMode=function(e){},e.prototype.navigateTo=function(e){},e.prototype.dayHoverHandler=function(e){},e.prototype.weekHoverHandler=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.setRangeOnCalendar=function(e){},e.prototype.setToday=function(){},e.prototype.clearDate=function(){},e.prototype._stopPropagation=function(e){e.stopPropagation()},e}(),k=function(){function e(){}return e.prototype.calculate=function(){return{type:e.CALCULATE}},e.prototype.format=function(){return{type:e.FORMAT}},e.prototype.flag=function(){return{type:e.FLAG}},e.prototype.select=function(t){return{type:e.SELECT,payload:t}},e.prototype.changeViewMode=function(t){return{type:e.CHANGE_VIEWMODE,payload:t}},e.prototype.navigateTo=function(t){return{type:e.NAVIGATE_TO,payload:t}},e.prototype.navigateStep=function(t){return{type:e.NAVIGATE_OFFSET,payload:t}},e.prototype.setOptions=function(t){return{type:e.SET_OPTIONS,payload:t}},e.prototype.selectRange=function(t){return{type:e.SELECT_RANGE,payload:t}},e.prototype.hoverDay=function(t){return{type:e.HOVER,payload:t.isHovered?t.cell.date:null}},e.prototype.minDate=function(t){return{type:e.SET_MIN_DATE,payload:t}},e.prototype.maxDate=function(t){return{type:e.SET_MAX_DATE,payload:t}},e.prototype.daysDisabled=function(t){return{type:e.SET_DAYSDISABLED,payload:t}},e.prototype.datesDisabled=function(t){return{type:e.SET_DATESDISABLED,payload:t}},e.prototype.datesEnabled=function(t){return{type:e.SET_DATESENABLED,payload:t}},e.prototype.isDisabled=function(t){return{type:e.SET_IS_DISABLED,payload:t}},e.prototype.setDateCustomClasses=function(t){return{type:e.SET_DATE_CUSTOM_CLASSES,payload:t}},e.prototype.setDateTooltipTexts=function(t){return{type:e.SET_DATE_TOOLTIP_TEXTS,payload:t}},e.prototype.setLocale=function(t){return{type:e.SET_LOCALE,payload:t}},e}();k.CALCULATE="[datepicker] calculate dates matrix",k.FORMAT="[datepicker] format datepicker values",k.FLAG="[datepicker] set flags",k.SELECT="[datepicker] select date",k.NAVIGATE_OFFSET="[datepicker] shift view date",k.NAVIGATE_TO="[datepicker] change view date",k.SET_OPTIONS="[datepicker] update render options",k.HOVER="[datepicker] hover date",k.CHANGE_VIEWMODE="[datepicker] switch view mode",k.SET_MIN_DATE="[datepicker] set min date",k.SET_MAX_DATE="[datepicker] set max date",k.SET_DAYSDISABLED="[datepicker] set days disabled",k.SET_DATESDISABLED="[datepicker] set dates disabled",k.SET_DATESENABLED="[datepicker] set dates enabled",k.SET_IS_DISABLED="[datepicker] set is disabled",k.SET_DATE_CUSTOM_CLASSES="[datepicker] set date custom classes",k.SET_DATE_TOOLTIP_TEXTS="[datepicker] set date tooltip texts",k.SET_LOCALE="[datepicker] set datepicker locale",k.SELECT_RANGE="[daterangepicker] select dates range",k.decorators=[{type:t.Injectable}];var w=function(){function e(){this._defaultLocale="en",this._locale=new o.BehaviorSubject(this._defaultLocale),this._localeChange=this._locale.asObservable()}return Object.defineProperty(e.prototype,"locale",{get:function(){return this._locale},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localeChange",{get:function(){return this._localeChange},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentLocale",{get:function(){return this._locale.getValue()},enumerable:!1,configurable:!0}),e.prototype.use=function(e){e!==this.currentLocale&&this._locale.next(e)},e}();w.decorators=[{type:t.Injectable}];var C=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){var t;null===(t=this._store)||void 0===t||t.dispatch(this._actions.select(e))},e.prototype.setRangeValue=function(e){var t;null===(t=this._store)||void 0===t||t.dispatch(this._actions.selectRange(e))},e.prototype.setMinDate=function(e){var t;return null===(t=this._store)||void 0===t||t.dispatch(this._actions.minDate(e)),this},e.prototype.setMaxDate=function(e){var t;return null===(t=this._store)||void 0===t||t.dispatch(this._actions.maxDate(e)),this},e.prototype.setDaysDisabled=function(e){var t;return null===(t=this._store)||void 0===t||t.dispatch(this._actions.daysDisabled(e)),this},e.prototype.setDatesDisabled=function(e){var t;return null===(t=this._store)||void 0===t||t.dispatch(this._actions.datesDisabled(e)),this},e.prototype.setDatesEnabled=function(e){var t;return null===(t=this._store)||void 0===t||t.dispatch(this._actions.datesEnabled(e)),this},e.prototype.setDisabled=function(e){var t;return null===(t=this._store)||void 0===t||t.dispatch(this._actions.isDisabled(e)),this},e.prototype.setDateCustomClasses=function(e){var t;return null===(t=this._store)||void 0===t||t.dispatch(this._actions.setDateCustomClasses(e)),this},e.prototype.setDateTooltipTexts=function(e){var t;return null===(t=this._store)||void 0===t||t.dispatch(this._actions.setDateTooltipTexts(e)),this},e.prototype.setOptions=function(e){var t,n=Object.assign({locale:this._localeService.currentLocale},e);return null===(t=this._store)||void 0===t||t.dispatch(this._actions.setOptions(n)),this},e.prototype.setBindings=function(e){return this._store?(e.daysCalendar$=this._store.select((function(e){return e.flaggedMonths})).pipe(n.filter((function(e){return!!e}))),e.monthsCalendar=this._store.select((function(e){return e.flaggedMonthsCalendar})).pipe(n.filter((function(e){return!!e}))),e.yearsCalendar=this._store.select((function(e){return e.yearsCalendarFlagged})).pipe(n.filter((function(e){return!!e}))),e.viewMode=this._store.select((function(e){var t;return null===(t=e.view)||void 0===t?void 0:t.mode})),e.options$=o.combineLatest([this._store.select((function(e){return e.showWeekNumbers})),this._store.select((function(e){return e.displayMonths}))]).pipe(n.map((function(e){return{showWeekNumbers:e[0],displayMonths:e[1]}}))),this):this},e.prototype.setEventHandlers=function(e){var t=this;return e.setViewMode=function(e){var n;null===(n=t._store)||void 0===n||n.dispatch(t._actions.changeViewMode(e))},e.navigateTo=function(e){var n;null===(n=t._store)||void 0===n||n.dispatch(t._actions.navigateStep(e.step))},e.dayHoverHandler=function(e){var n,i=e.cell;i.isOtherMonth||i.isDisabled||(null===(n=t._store)||void 0===n||n.dispatch(t._actions.hoverDay(e)),i.isHovered=e.isHovered)},e.monthHoverHandler=function(e){e.cell.isHovered=e.isHovered},e.yearHoverHandler=function(e){e.cell.isHovered=e.isHovered},this},e.prototype.registerDatepickerSideEffects=function(){var e=this;return this._store?(this._subs.push(this._store.select((function(e){return e.view})).subscribe((function(){var t;null===(t=e._store)||void 0===t||t.dispatch(e._actions.calculate())}))),this._subs.push(this._store.select((function(e){return e.monthsModel})).pipe(n.filter((function(e){return!!e}))).subscribe((function(){var t;return null===(t=e._store)||void 0===t?void 0:t.dispatch(e._actions.format())}))),this._subs.push(this._store.select((function(e){return e.formattedMonths})).pipe(n.filter((function(e){return!!e}))).subscribe((function(){var t;return null===(t=e._store)||void 0===t?void 0:t.dispatch(e._actions.flag())}))),this._subs.push(this._store.select((function(e){return e.selectedDate})).pipe(n.filter((function(e){return!!e}))).subscribe((function(){var t;return null===(t=e._store)||void 0===t?void 0:t.dispatch(e._actions.flag())}))),this._subs.push(this._store.select((function(e){return e.selectedRange})).pipe(n.filter((function(e){return!!e}))).subscribe((function(){var t;return null===(t=e._store)||void 0===t?void 0:t.dispatch(e._actions.flag())}))),this._subs.push(this._store.select((function(e){return e.monthsCalendar})).subscribe((function(){var t;return null===(t=e._store)||void 0===t?void 0:t.dispatch(e._actions.flag())}))),this._subs.push(this._store.select((function(e){return e.yearsCalendarModel})).pipe(n.filter((function(e){return!!e}))).subscribe((function(){var t;return null===(t=e._store)||void 0===t?void 0:t.dispatch(e._actions.flag())}))),this._subs.push(this._store.select((function(e){return e.hoveredDate})).pipe(n.filter((function(e){return!!e}))).subscribe((function(){var t;return null===(t=e._store)||void 0===t?void 0:t.dispatch(e._actions.flag())}))),this._subs.push(this._store.select((function(e){return e.dateCustomClasses})).pipe(n.filter((function(e){return!!e}))).subscribe((function(){var t;return null===(t=e._store)||void 0===t?void 0:t.dispatch(e._actions.flag())}))),this._subs.push(this._store.select((function(e){return e.dateTooltipTexts})).pipe(n.filter((function(e){return!!e}))).subscribe((function(){var t;return null===(t=e._store)||void 0===t?void 0:t.dispatch(e._actions.flag())}))),this._subs.push(this._localeService.localeChange.subscribe((function(t){var n;return null===(n=e._store)||void 0===n?void 0:n.dispatch(e._actions.setLocale(t))}))),this):this},e.prototype.destroy=function(){var e,t;try{for(var n=b(this._subs),i=n.next();!i.done;i=n.next()){i.value.unsubscribe()}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},e}();C.decorators=[{type:t.Injectable}],C.ctorParameters=function(){return[{type:k},{type:w}]};var x={date:new Date,mode:"day"},M=Object.assign(new p,{locale:"en",view:x,selectedRange:[],monthViewOptions:{width:7,height:6}});function S(e,t){if(i.isFirstDayOfWeek(e,t.firstDayOfWeek))return e;var n=function(e,t){var n=Number(t);if(isNaN(n))return 0;if(0===n)return e;var i=e-n%7;return i<0?i+7:i}(i.getDay(e),t.firstDayOfWeek);return i.shiftDate(e,{day:-n})}function I(e,t,n){var a=t&&i.isBefore(i.endOf(e,"month"),t,"day"),s=n&&i.isAfter(i.startOf(e,"month"),n,"day");return a||s||!1}function E(e,t,n){var a=t&&i.isBefore(i.endOf(e,"year"),t,"day"),s=n&&i.isAfter(i.startOf(e,"year"),n,"day");return a||s||!1}function T(e,t){void 0===t&&(t=0);var n=e&&e.yearsCalendarModel&&e.yearsCalendarModel[t];return(null==n?void 0:n.years[0])&&n.years[0][0]&&n.years[0][0].date}function O(e,t){return e&&t&&(e.length||e[0].value)?(e.forEach((function(n){return n&&n.value?n.value instanceof Date?e:n.value instanceof Array&&n.value.length?(n.value=A(n.value,t),e):e:e})),e):e}function R(e,t){return e&&t?e instanceof Array&&!e.length||e instanceof Date?e:A(e,t):e}function A(e,t){return e instanceof Array?e.map((function(e){return e?(i.isAfter(e,t,"date")&&(e=t),e):e})):e}function P(e,t){for(var n=e.initialDate,a=new Array(e.height),s=0;s<e.height;s++){a[s]=new Array(e.width);for(var o=0;o<e.width;o++)a[s][o]=t(n),n=i.shiftDate(n,e.shift)}return a}function V(e,t){var n=i.getFirstDayOfMonth(e),a=S(n,t);return{daysMatrix:P({width:t.width||0,height:t.height||0,initialDate:a,shift:{day:1}},(function(e){return e})),month:n}}function H(e){var t=i.getLocale(e),n=t.weekdaysShort(),a=t.firstDayOfWeek();return m(n.slice(a),n.slice(0,a))}function L(e,t){return e.weeks.forEach((function(n){n.days.forEach((function(a,s){var o,r,c=!i.isSameMonth(a.date,e.month),d=!c&&i.isSameDay(a.date,t.hoveredDate),l=!c&&t.selectedRange&&i.isSameDay(a.date,t.selectedRange[0]),u=!c&&t.selectedRange&&i.isSameDay(a.date,t.selectedRange[1]),h=!c&&i.isSameDay(a.date,t.selectedDate)||l||u,p=!c&&t.selectedRange&&function(e,t,n){if(!e||!t||!t[0])return!1;if(t[1])return e>t[0]&&e<=t[1];if(n)return e>t[0]&&e<=n;return!1}(a.date,t.selectedRange,t.hoveredDate),f=t.isDisabled||i.isBefore(a.date,t.minDate,"day")||i.isAfter(a.date,t.maxDate,"day")||i.isDisabledDay(a.date,t.daysDisabled)||(o=a.date,!!((r=t.datesDisabled)&&i.isArray(r)&&r.length)&&r.some((function(e){return i.isSame(o,e,"date")})))||function(e,t){return!!(t&&i.isArray(t)&&t.length)&&!t.some((function(t){return i.isSame(e,t,"date")}))}(a.date,t.datesEnabled),y=new Date,b=!c&&i.isSameDay(a.date,y),g=t.dateCustomClasses&&t.dateCustomClasses.map((function(e){return i.isSameDay(a.date,e.date)?e.classes:[]})).reduce((function(e,t){return e.concat(t)}),[]).join(" ")||"",m=t.dateTooltipTexts&&t.dateTooltipTexts.map((function(e){return i.isSameDay(a.date,e.date)?e.tooltipText:""})).reduce((function(e,t){return e.push(t),e}),[]).join(" ")||"",v=Object.assign({},a,{isOtherMonth:c,isHovered:d,isSelected:h,isSelectionStart:l,isSelectionEnd:u,isInRange:p,isDisabled:f,isToday:b,customClasses:g,tooltipText:m});a.isOtherMonth===v.isOtherMonth&&a.isHovered===v.isHovered&&a.isSelected===v.isSelected&&a.isSelectionStart===v.isSelectionStart&&a.isSelectionEnd===v.isSelectionEnd&&a.isDisabled===v.isDisabled&&a.isInRange===v.isInRange&&a.customClasses===v.customClasses&&a.tooltipText===v.tooltipText||(n.days[s]=v)}))})),e.hideLeftArrow=t.isDisabled||!!t.monthIndex&&t.monthIndex>0&&t.monthIndex!==t.displayMonths,e.hideRightArrow=t.isDisabled||(!!t.monthIndex||0===t.monthIndex)&&!!t.displayMonths&&t.monthIndex<t.displayMonths&&t.monthIndex+1!==t.displayMonths,e.disableLeftArrow=I(i.shiftDate(e.month,{month:-1}),t.minDate,t.maxDate),e.disableRightArrow=I(i.shiftDate(e.month,{month:1}),t.minDate,t.maxDate),e}function F(e,t){return!t||e>=t}var B={month:1};function $(e,t){return{months:P({width:3,height:4,initialDate:i.startOf(e,"year"),shift:B},(function(e){return{date:e,label:i.formatDate(e,t.monthLabel,t.locale)}})),monthTitle:"",yearTitle:i.formatDate(e,t.yearTitle,t.locale),hideRightArrow:!1,hideLeftArrow:!1,disableRightArrow:!1,disableLeftArrow:!1}}var j=16,N=-1*(Math.floor(8)-1),Y={year:1};function z(e,t,n){var a=P({width:4,height:4,initialDate:function(e,t){if(t&&e.getFullYear()>=t.getFullYear()&&e.getFullYear()<t.getFullYear()+16)return t;return i.shiftDate(e,{year:N})}(e,n),shift:Y},(function(e){return{date:e,label:i.formatDate(e,t.yearLabel,t.locale)}}));return{years:a,monthTitle:"",yearTitle:function(e,t){var n=i.formatDate(e[0][0].date,t.yearTitle,t.locale),a=i.formatDate(e[3][3].date,t.yearTitle,t.locale);return n+" - "+a}(a,t),hideLeftArrow:!1,hideRightArrow:!1,disableLeftArrow:!1,disableRightArrow:!1}}function W(e,t){switch(void 0===e&&(e=M),t.type){case k.CALCULATE:return function(e){if(!e.view)return e;var t;t=e.displayOneMonthRange&&q(e.view.date,e.minDate,e.maxDate)?1:e.displayMonths||1;var n=e.view.date;if("day"===e.view.mode&&e.monthViewOptions){e.showPreviousMonth&&e.selectedRange&&0===e.selectedRange.length&&(n=i.shiftDate(n,{month:-1})),e.monthViewOptions.firstDayOfWeek=i.getLocale(e.locale).firstDayOfWeek();for(var a=new Array(t),s=0;s<t;s++)a[s]=V(n,e.monthViewOptions),n=i.shiftDate(n,{month:1});if(e.preventChangeToNextMonth&&e.flaggedMonths&&e.hoveredDate){var o=V(e.view.date,e.monthViewOptions);e.flaggedMonths.length&&e.flaggedMonths[1].month.getMonth()===o.month.getMonth()&&(a=e.flaggedMonths.map((function(t){return e.monthViewOptions?V(t.month,e.monthViewOptions):null})).filter((function(e){return null!==e})))}return Object.assign({},e,{monthsModel:a})}if("month"===e.view.mode){for(var r=new Array(t),c=0;c<t;c++)r[c]=$(n,G(e)),n=i.shiftDate(n,{year:1});return Object.assign({},e,{monthsCalendar:r})}if("year"===e.view.mode){var d=new Array(t);for(c=0;c<t;c++)d[c]=z(n,G(e),"year"===e.minMode?T(e,c):void 0),n=i.shiftDate(n,{year:j});return Object.assign({},e,{yearsCalendarModel:d})}return e}(e);case k.FORMAT:return function(e){if(!e.view)return e;if("day"===e.view.mode&&e.monthsModel){var t=e.monthsModel.map((function(t,n){return function(e,t,n){return{month:e.month,monthTitle:i.formatDate(e.month,t.monthTitle,t.locale),yearTitle:i.formatDate(e.month,t.yearTitle,t.locale),weekNumbers:(a=e.daysMatrix,s=t.weekNumbers,o=t.locale,a.map((function(e){return e[0]?i.formatDate(e[0],s,o):""}))),weekdays:H(t.locale),weeks:e.daysMatrix.map((function(e,a){return{days:e.map((function(e,s){return{date:e,label:i.formatDate(e,t.dayLabel,t.locale),monthIndex:n,weekIndex:a,dayIndex:s}}))}})),hideLeftArrow:!1,hideRightArrow:!1,disableLeftArrow:!1,disableRightArrow:!1};var a,s,o}(t,G(e),n)}));return Object.assign({},e,{formattedMonths:t})}var n=e.displayMonths||1,a=e.view.date;if("month"===e.view.mode){for(var s=new Array(n),o=0;o<n;o++)s[o]=$(a,G(e)),a=i.shiftDate(a,{year:1});return Object.assign({},e,{monthsCalendar:s})}if("year"===e.view.mode){var r=new Array(n);for(o=0;o<n;o++)r[o]=z(a,G(e)),a=i.shiftDate(a,{year:16});return Object.assign({},e,{yearsCalendarModel:r})}return e}(e);case k.FLAG:return function(e){if(!e.view)return e;var t=q(e.view.date,e.minDate,e.maxDate)?1:e.displayMonths;if(e.formattedMonths&&"day"===e.view.mode){var n=e.formattedMonths.map((function(n,i){return L(n,{isDisabled:e.isDisabled,minDate:e.minDate,maxDate:e.maxDate,daysDisabled:e.daysDisabled,datesDisabled:e.datesDisabled,datesEnabled:e.datesEnabled,hoveredDate:e.hoveredDate,selectedDate:e.selectedDate,selectedRange:e.selectedRange,displayMonths:t,dateCustomClasses:e.dateCustomClasses,dateTooltipTexts:e.dateTooltipTexts,monthIndex:i})}));return Object.assign({},e,{flaggedMonths:n})}if("month"===e.view.mode&&e.monthsCalendar){var a=e.monthsCalendar.map((function(n,a){return s=n,o={isDisabled:e.isDisabled,minDate:e.minDate,maxDate:e.maxDate,hoveredMonth:e.hoveredMonth,selectedDate:e.selectedDate,selectedRange:e.selectedRange,displayMonths:t,monthIndex:a},s.months.forEach((function(e,t){e.forEach((function(e,n){var a,r=i.isSameMonth(e.date,o.hoveredMonth),c=o.isDisabled||I(e.date,o.minDate,o.maxDate);!o.selectedDate&&o.selectedRange?(a=i.isSameMonth(e.date,o.selectedRange[0]))||(a=i.isSameMonth(e.date,o.selectedRange[1])):a=i.isSameMonth(e.date,o.selectedDate);var d=Object.assign(e,{isHovered:r,isDisabled:c,isSelected:a});e.isHovered===d.isHovered&&e.isDisabled===d.isDisabled&&e.isSelected===d.isSelected||(s.months[t][n]=d)}))})),s.hideLeftArrow=!!o.monthIndex&&o.monthIndex>0&&o.monthIndex!==o.displayMonths,s.hideRightArrow=(!!o.monthIndex||0===o.monthIndex)&&(!!o.displayMonths||0===o.displayMonths)&&o.monthIndex<o.displayMonths&&o.monthIndex+1!==o.displayMonths,s.disableLeftArrow=E(i.shiftDate(s.months[0][0].date,{year:-1}),o.minDate,o.maxDate),s.disableRightArrow=E(i.shiftDate(s.months[0][0].date,{year:1}),o.minDate,o.maxDate),s;var s,o}));return Object.assign({},e,{flaggedMonthsCalendar:a})}if("year"===e.view.mode&&e.yearsCalendarModel){var s=e.yearsCalendarModel.map((function(n,a){return function(e,t){e.years.forEach((function(n,a){n.forEach((function(n,s){var o,r=i.isSameYear(n.date,t.hoveredYear),c=t.isDisabled||E(n.date,t.minDate,t.maxDate);!t.selectedDate&&t.selectedRange?(o=i.isSameYear(n.date,t.selectedRange[0]))||(o=i.isSameYear(n.date,t.selectedRange[1])):o=i.isSameYear(n.date,t.selectedDate);var d=Object.assign(n,{isHovered:r,isDisabled:c,isSelected:o});n.isHovered===d.isHovered&&n.isDisabled===d.isDisabled&&n.isSelected===d.isSelected||(e.years[a][s]=d)}))})),e.hideLeftArrow=!!t.yearIndex&&t.yearIndex>0&&t.yearIndex!==t.displayMonths,e.hideRightArrow=!!t.yearIndex&&!!t.displayMonths&&t.yearIndex<t.displayMonths&&t.yearIndex+1!==t.displayMonths,e.disableLeftArrow=E(i.shiftDate(e.years[0][0].date,{year:-1}),t.minDate,t.maxDate);var n=e.years.length-1,a=e.years[n].length-1;return e.disableRightArrow=E(i.shiftDate(e.years[n][a].date,{year:1}),t.minDate,t.maxDate),e}(n,{isDisabled:e.isDisabled,minDate:e.minDate,maxDate:e.maxDate,hoveredYear:e.hoveredYear,selectedDate:e.selectedDate,selectedRange:e.selectedRange,displayMonths:t,yearIndex:a})}));return Object.assign({},e,{yearsCalendarFlagged:s})}return e}(e);case k.NAVIGATE_OFFSET:return function(e,t){if(!e.view)return e;var n=function(e,t){if(!e.view)return;if("year"===e.view.mode&&"year"===e.minMode){var n=T(e,0);if(n){var a=i.shiftDate(n,{year:-N});return i.shiftDate(a,t.payload)}}return i.shiftDate(i.startOf(e.view.date,"month"),t.payload)}(e,t);if(!n)return e;var a={view:{mode:e.view.mode,date:n}};return Object.assign({},e,a)}(e,t);case k.NAVIGATE_TO:var n=t.payload;if(!e.view||!n.unit)return e;var a=i.setFullDate(e.view.date,n.unit),s=void 0,o=void 0;return s=F(n.viewMode,e.minMode)?{view:{date:a,mode:o=n.viewMode}}:{selectedDate:a,view:{date:a,mode:o=e.view.mode}},Object.assign({},e,s);case k.CHANGE_VIEWMODE:if(!F(t.payload,e.minMode)||!e.view)return e;s={view:{date:a=e.view.date,mode:o=t.payload}};return Object.assign({},e,s);case k.HOVER:return Object.assign({},e,{hoveredDate:t.payload});case k.SELECT:if(!e.view)return e;s={selectedDate:t.payload,view:e.view},o=e.view.mode,a=U(t.payload||e.view.date,e.minDate,e.maxDate);return s.view={mode:o,date:a},Object.assign({},e,s);case k.SET_OPTIONS:if(!e.view)return e;o=(s=t.payload).minMode?s.minMode:e.view.mode,a=U(i.isDateValid(s.value)&&s.value||i.isArray(s.value)&&i.isDateValid(s.value[0])&&s.value[0]||e.view.date,s.minDate,s.maxDate);return s.view={mode:o,date:a},s.value&&(i.isArray(s.value)&&(s.selectedRange=s.value),s.value instanceof Date&&(s.selectedDate=s.value)),Object.assign({},e,s);case k.SELECT_RANGE:if(!e.view)return e;s={selectedRange:t.payload,view:e.view},o=e.view.mode,a=U(t.payload&&t.payload[0]||e.view.date,e.minDate,e.maxDate);return s.view={mode:o,date:a},Object.assign({},e,s);case k.SET_MIN_DATE:return Object.assign({},e,{minDate:t.payload});case k.SET_MAX_DATE:return Object.assign({},e,{maxDate:t.payload});case k.SET_IS_DISABLED:return Object.assign({},e,{isDisabled:t.payload});case k.SET_DATE_CUSTOM_CLASSES:return Object.assign({},e,{dateCustomClasses:t.payload});case k.SET_DATE_TOOLTIP_TEXTS:return Object.assign({},e,{dateTooltipTexts:t.payload});default:return e}}function G(e){return{locale:e.locale,monthTitle:e.monthTitle,yearTitle:e.yearTitle,dayLabel:e.dayLabel,monthLabel:e.monthLabel,yearLabel:e.yearLabel,weekNumbers:e.weekNumbers}}function U(e,t,n){var a=Array.isArray(e)?e[0]:e;return t&&i.isAfter(t,a,"day")?t:n&&i.isBefore(n,a,"day")?n:a}function q(e,t,n){return!(!n||!i.isSame(n,e,"day"))||t&&n&&t.getMonth()===n.getMonth()}var Z=function(e){function t(){var t=new o.BehaviorSubject({type:"[datepicker] dispatcher init"}),n=new r.MiniState(M,t,W);return e.call(this,t,W,n)||this}return y(t,e),t}(r.MiniStore);Z.decorators=[{type:t.Injectable}],Z.ctorParameters=function(){return[]};var K=function(e){function a(n,i,a,s,o,r,c){var d=e.call(this)||this;return d._config=i,d._store=a,d._element=s,d._actions=o,d._positionService=c,d.valueChange=new t.EventEmitter,d.animationState="void",d._subs=[],d._effects=r,n.setStyle(s.nativeElement,"display","block"),n.setStyle(s.nativeElement,"position","absolute"),d}return y(a,e),Object.defineProperty(a.prototype,"value",{set:function(e){var t;null===(t=this._effects)||void 0===t||t.setValue(e)},enumerable:!1,configurable:!0}),a.prototype.ngOnInit=function(){var e,t,i=this;this._positionService.setOptions({modifiers:{flip:{enabled:this._config.adaptivePosition}},allowedPositions:["top","bottom"]}),null===(e=this._positionService.event$)||void 0===e||e.pipe(n.take(1)).subscribe((function(){i._positionService.disable(),i._config.isAnimated?i.animationState=i.isTopPosition?"animated-up":"animated-down":i.animationState="unanimated"})),this.isOtherMonthsActive=this._config.selectFromOtherMonth,this.containerClass=this._config.containerClass,this.showTodayBtn=this._config.showTodayButton,this.todayBtnLbl=this._config.todayButtonLabel,this.todayPos=this._config.todayPosition,this.showClearBtn=this._config.showClearButton,this.clearBtnLbl=this._config.clearButtonLabel,this.clearPos=this._config.clearPosition,this.customRangeBtnLbl=this._config.customRangeButtonLabel,null===(t=this._effects)||void 0===t||t.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 i.valueChange.emit(e)}))),this._store.dispatch(this._actions.changeViewMode(this._config.startView))},Object.defineProperty(a.prototype,"isTopPosition",{get:function(){return this._element.nativeElement.classList.contains("top")},enumerable:!1,configurable:!0}),a.prototype.positionServiceEnable=function(){this._positionService.enable()},a.prototype.daySelectHandler=function(e){e&&((this.isOtherMonthsActive?e.isDisabled:e.isOtherMonth||e.isDisabled)||this._store.dispatch(this._actions.select(e.date)))},a.prototype.monthSelectHandler=function(e){e&&!e.isDisabled&&this._store.dispatch(this._actions.navigateTo({unit:{month:i.getMonth(e.date),year:i.getFullYear(e.date)},viewMode:"day"}))},a.prototype.yearSelectHandler=function(e){e&&!e.isDisabled&&this._store.dispatch(this._actions.navigateTo({unit:{year:i.getFullYear(e.date)},viewMode:"month"}))},a.prototype.setToday=function(){this._store.dispatch(this._actions.select(new Date))},a.prototype.clearDate=function(){this._store.dispatch(this._actions.select(void 0))},a.prototype.ngOnDestroy=function(){var e,t,n;try{for(var i=b(this._subs),a=i.next();!a.done;a=i.next()){a.value.unsubscribe()}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}null===(n=this._effects)||void 0===n||n.destroy()},a}(_);K.decorators=[{type:t.Component,args:[{selector:"bs-datepicker-container",providers:[Z,C],template:'\x3c!-- days calendar view mode --\x3e\n<div class="bs-datepicker" [ngClass]="containerClass" *ngIf="viewMode | async">\n <div class="bs-datepicker-container"\n [@datepickerAnimation]="animationState"\n (@datepickerAnimation.done)="positionServiceEnable()">\n \x3c!--calendars--\x3e\n <div class="bs-calendar-container" [ngSwitch]="viewMode | async" role="application">\n \x3c!--days calendar--\x3e\n <div *ngSwitchCase="\'day\'" class="bs-media-container">\n <bs-days-calendar-view\n *ngFor="let calendar of daysCalendar$ | async"\n [class.bs-datepicker-multiple]="multipleCalendars"\n [calendar]="calendar"\n [options]="options$ | async"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="setViewMode($event)"\n (onHover)="dayHoverHandler($event)"\n (onHoverWeek)="weekHoverHandler($event)"\n (onSelect)="daySelectHandler($event)">\n </bs-days-calendar-view>\n </div>\n\n \x3c!--months calendar--\x3e\n <div *ngSwitchCase="\'month\'" class="bs-media-container">\n <bs-month-calendar-view\n *ngFor="let calendar of monthsCalendar | async"\n [class.bs-datepicker-multiple]="multipleCalendars"\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\'" class="bs-media-container">\n <bs-years-calendar-view\n *ngFor="let calendar of yearsCalendar | async"\n [class.bs-datepicker-multiple]="multipleCalendars"\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 </div>\n\n \x3c!--applycancel buttons--\x3e\n <div class="bs-datepicker-buttons" *ngIf="false">\n <button class="btn btn-success" type="button">Apply</button>\n <button class="btn btn-default" type="button">Cancel</button>\n </div>\n\n <div class="bs-datepicker-buttons" *ngIf="showTodayBtn || showClearBtn">\n <div class="btn-today-wrapper"\n [class.today-left]="todayPos === \'left\'"\n [class.today-right]="todayPos === \'right\'"\n [class.today-center]="todayPos === \'center\'"\n *ngIf="showTodayBtn">\n <button class="btn btn-success" (click)="setToday()">{{todayBtnLbl}}</button>\n </div>\n\n <div class="btn-clear-wrapper"\n [class.clear-left]="clearPos === \'left\'"\n [class.clear-right]="clearPos === \'right\'"\n [class.clear-center]="clearPos === \'center\'"\n *ngIf="showClearBtn">\n <button class="btn btn-success" (click)="clearDate()">{{clearBtnLbl}}</button>\n </div>\n </div>\n\n </div>\n\n \x3c!--custom dates or date ranges picker--\x3e\n <div class="bs-datepicker-custom-range" *ngIf="customRanges && customRanges.length > 0">\n <bs-custom-date-view\n [selectedRange]="chosenRange"\n [ranges]="customRanges"\n [customRangeLabel]="customRangeBtnLbl"\n (onSelect)="setRangeOnCalendar($event)">\n </bs-custom-date-view>\n </div>\n</div>\n',host:{class:"bottom","(click)":"_stopPropagation($event)",role:"dialog","aria-label":"calendar"},animations:[D]}]}],K.ctorParameters=function(){return[{type:t.Renderer2},{type:p},{type:Z},{type:t.ElementRef},{type:k},{type:C},{type:a.PositioningService}]};var Q=function(){function e(e,n,i,a,s){this._config=e,this._elementRef=n,this._renderer=i,this.placement="bottom",this.triggers="click",this.outsideClick=!0,this.container="body",this.outsideEsc=!0,this.isDestroy$=new o.Subject,this.isDisabled=!1,this.bsValueChange=new t.EventEmitter,this._subs=[],this._dateInputFormat$=new o.Subject,Object.assign(this,this._config),this._datepicker=s.createLoader(n,a,i),this.onShown=this._datepicker.onShown,this.onHidden=this._datepicker.onHidden,this.isOpen$=new o.BehaviorSubject(this.isOpen)}return Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._datepicker.isShown},set:function(e){this.isOpen$.next(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bsValue",{set:function(e){if(!this._bsValue||!e||this._bsValue.getTime()!==e.getTime()){if(!this._bsValue&&e){var t=new Date;e.setMilliseconds(t.getMilliseconds()),e.setSeconds(t.getSeconds()),e.setMinutes(t.getMinutes()),e.setHours(t.getHours())}this._bsValue=e,this.bsValueChange.emit(e)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dateInputFormat$",{get:function(){return this._dateInputFormat$},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bsConfig",{get:function(){return this._bsConfig},set:function(e){this._bsConfig=e,this.setConfig(),this._dateInputFormat$.next(e&&e.dateInputFormat)},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this._datepicker.listen({outsideClick:this.outsideClick,outsideEsc:this.outsideEsc,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.daysDisabled&&(this._datepickerRef.instance.daysDisabled=this.daysDisabled),e.datesDisabled&&(this._datepickerRef.instance.datesDisabled=this.datesDisabled),e.datesEnabled&&(this._datepickerRef.instance.datesEnabled=this.datesEnabled),e.isDisabled&&(this._datepickerRef.instance.isDisabled=this.isDisabled),e.dateCustomClasses&&(this._datepickerRef.instance.dateCustomClasses=this.dateCustomClasses),e.dateTooltipTexts&&(this._datepickerRef.instance.dateTooltipTexts=this.dateTooltipTexts))},e.prototype.ngAfterViewInit=function(){var e=this;this.isOpen$.pipe(n.filter((function(t){return t!==e.isOpen})),n.takeUntil(this.isDestroy$)).subscribe((function(){return e.toggle()}))},e.prototype.show=function(){var e=this;this._datepicker.isShown||(this.setConfig(),this._datepickerRef=this._datepicker.provide({provide:p,useValue:this._config}).attach(K).to(this.container).position({attachment:this.placement}).show({placement:this.placement}),this._subs.push(this.bsValueChange.subscribe((function(t){e._datepickerRef&&(e._datepickerRef.instance.value=t)}))),this._datepickerRef&&this._subs.push(this._datepickerRef.instance.valueChange.subscribe((function(t){e.bsValue=t,e.hide()}))))},e.prototype.hide=function(){var e,t;this.isOpen&&this._datepicker.hide();try{for(var n=b(this._subs),i=n.next();!i.done;i=n.next()){i.value.unsubscribe()}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this._config.returnFocusToInput&&this._renderer.selectRootElement(this._elementRef.nativeElement).focus()},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:R(this._bsValue,this.maxDate||this.bsConfig&&this.bsConfig.maxDate),isDisabled:this.isDisabled,minDate:this.minDate||this.bsConfig&&this.bsConfig.minDate,maxDate:this.maxDate||this.bsConfig&&this.bsConfig.maxDate,daysDisabled:this.daysDisabled||this.bsConfig&&this.bsConfig.daysDisabled,dateCustomClasses:this.dateCustomClasses||this.bsConfig&&this.bsConfig.dateCustomClasses,dateTooltipTexts:this.dateTooltipTexts||this.bsConfig&&this.bsConfig.dateTooltipTexts,datesDisabled:this.datesDisabled||this.bsConfig&&this.bsConfig.datesDisabled,datesEnabled:this.datesEnabled||this.bsConfig&&this.bsConfig.datesEnabled,minMode:this.minMode||this.bsConfig&&this.bsConfig.minMode})},e.prototype.ngOnDestroy=function(){this._datepicker.dispose(),this.isOpen$.next(!1),this.isDestroy$&&(this.isDestroy$.next(),this.isDestroy$.complete())},e}();Q.decorators=[{type:t.Directive,args:[{selector:"[bsDatepicker]",exportAs:"bsDatepicker"}]}],Q.ctorParameters=function(){return[{type:p},{type:t.ElementRef},{type:t.Renderer2},{type:t.ViewContainerRef},{type:c.ComponentLoaderFactory}]},Q.propDecorators={placement:[{type:t.Input}],triggers:[{type:t.Input}],outsideClick:[{type:t.Input}],container:[{type:t.Input}],outsideEsc:[{type:t.Input}],onShown:[{type:t.Output}],onHidden:[{type:t.Output}],isDisabled:[{type:t.Input}],minDate:[{type:t.Input}],maxDate:[{type:t.Input}],minMode:[{type:t.Input}],daysDisabled:[{type:t.Input}],datesDisabled:[{type:t.Input}],datesEnabled:[{type:t.Input}],dateCustomClasses:[{type:t.Input}],dateTooltipTexts:[{type:t.Input}],bsValueChange:[{type:t.Output}],isOpen:[{type:t.Input}],bsValue:[{type:t.Input}],bsConfig:[{type:t.Input}]};var X=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return y(t,e),t}(p);X.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new X},token:X,providedIn:"root"}),X.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}];var J=function(e){function t(t,n,i,a,s,o,r){var c=e.call(this,t,n,i,a,s,o,r)||this;return t.setStyle(a.nativeElement,"display","inline-block"),t.setStyle(a.nativeElement,"position","static"),c}return y(t,e),t}(K);J.decorators=[{type:t.Component,args:[{selector:"bs-datepicker-inline-container",providers:[Z,C],template:'\x3c!-- days calendar view mode --\x3e\n<div class="bs-datepicker" [ngClass]="containerClass" *ngIf="viewMode | async">\n <div class="bs-datepicker-container"\n [@datepickerAnimation]="animationState"\n (@datepickerAnimation.done)="positionServiceEnable()">\n \x3c!--calendars--\x3e\n <div class="bs-calendar-container" [ngSwitch]="viewMode | async" role="application">\n \x3c!--days calendar--\x3e\n <div *ngSwitchCase="\'day\'" class="bs-media-container">\n <bs-days-calendar-view\n *ngFor="let calendar of daysCalendar$ | async"\n [class.bs-datepicker-multiple]="multipleCalendars"\n [calendar]="calendar"\n [options]="options$ | async"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="setViewMode($event)"\n (onHover)="dayHoverHandler($event)"\n (onHoverWeek)="weekHoverHandler($event)"\n (onSelect)="daySelectHandler($event)">\n </bs-days-calendar-view>\n </div>\n\n \x3c!--months calendar--\x3e\n <div *ngSwitchCase="\'month\'" class="bs-media-container">\n <bs-month-calendar-view\n *ngFor="let calendar of monthsCalendar | async"\n [class.bs-datepicker-multiple]="multipleCalendars"\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\'" class="bs-media-container">\n <bs-years-calendar-view\n *ngFor="let calendar of yearsCalendar | async"\n [class.bs-datepicker-multiple]="multipleCalendars"\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 </div>\n\n \x3c!--applycancel buttons--\x3e\n <div class="bs-datepicker-buttons" *ngIf="false">\n <button class="btn btn-success" type="button">Apply</button>\n <button class="btn btn-default" type="button">Cancel</button>\n </div>\n\n <div class="bs-datepicker-buttons" *ngIf="showTodayBtn || showClearBtn">\n <div class="btn-today-wrapper"\n [class.today-left]="todayPos === \'left\'"\n [class.today-right]="todayPos === \'right\'"\n [class.today-center]="todayPos === \'center\'"\n *ngIf="showTodayBtn">\n <button class="btn btn-success" (click)="setToday()">{{todayBtnLbl}}</button>\n </div>\n\n <div class="btn-clear-wrapper"\n [class.clear-left]="clearPos === \'left\'"\n [class.clear-right]="clearPos === \'right\'"\n [class.clear-center]="clearPos === \'center\'"\n *ngIf="showClearBtn">\n <button class="btn btn-success" (click)="clearDate()">{{clearBtnLbl}}</button>\n </div>\n </div>\n\n </div>\n\n \x3c!--custom dates or date ranges picker--\x3e\n <div class="bs-datepicker-custom-range" *ngIf="customRanges && customRanges.length > 0">\n <bs-custom-date-view\n [selectedRange]="chosenRange"\n [ranges]="customRanges"\n [customRangeLabel]="customRangeBtnLbl"\n (onSelect)="setRangeOnCalendar($event)">\n </bs-custom-date-view>\n </div>\n</div>\n',host:{"(click)":"_stopPropagation($event)"},animations:[D]}]}],J.ctorParameters=function(){return[{type:t.Renderer2},{type:p},{type:Z},{type:t.ElementRef},{type:k},{type:C},{type:a.PositioningService}]};var ee=function(){function e(e,n,i,a,s){this._config=e,this._elementRef=n,this.isDisabled=!1,this.bsValueChange=new t.EventEmitter,this._subs=[],Object.assign(this,this._config),this._datepicker=s.createLoader(n,a,i)}return Object.defineProperty(e.prototype,"bsValue",{set:function(e){if(this._bsValue!==e){if(!this._bsValue&&e){var t=new Date;e.setMilliseconds(t.getMilliseconds()),e.setSeconds(t.getSeconds()),e.setMinutes(t.getMinutes()),e.setHours(t.getHours())}this._bsValue=e,this.bsValueChange.emit(e)}},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.setConfig(),this._subs.push(this.bsValueChange.subscribe((function(t){e._datepickerRef&&(e._datepickerRef.instance.value=t)}))),this._datepickerRef&&this._subs.push(this._datepickerRef.instance.valueChange.subscribe((function(t){e.bsValue=t})))},e.prototype.ngOnChanges=function(e){this._datepickerRef&&this._datepickerRef.instance&&(e.minDate&&(this._datepickerRef.instance.minDate=this.minDate,this.setConfig()),e.maxDate&&(this._datepickerRef.instance.maxDate=this.maxDate,this.setConfig()),e.datesDisabled&&(this._datepickerRef.instance.datesDisabled=this.datesDisabled,this.setConfig()),e.datesEnabled&&(this._datepickerRef.instance.datesEnabled=this.datesEnabled,this._datepickerRef.instance.value=this._bsValue),e.isDisabled&&(this._datepickerRef.instance.isDisabled=this.isDisabled,this.setConfig()),e.dateCustomClasses&&(this._datepickerRef.instance.dateCustomClasses=this.dateCustomClasses,this.setConfig()),e.dateTooltipTexts&&(this._datepickerRef.instance.dateTooltipTexts=this.dateTooltipTexts,this.setConfig()))},e.prototype.setConfig=function(){this._datepicker&&this._datepicker.hide(),this._config=Object.assign({},this._config,this.bsConfig,{value:R(this._bsValue,this.maxDate||this.bsConfig&&this.bsConfig.maxDate),isDisabled:this.isDisabled,minDate:this.minDate||this.bsConfig&&this.bsConfig.minDate,maxDate:this.maxDate||this.bsConfig&&this.bsConfig.maxDate,dateCustomClasses:this.dateCustomClasses||this.bsConfig&&this.bsConfig.dateCustomClasses,dateTooltipTexts:this.dateTooltipTexts||this.bsConfig&&this.bsConfig.dateTooltipTexts,datesDisabled:this.datesDisabled||this.bsConfig&&this.bsConfig.datesDisabled,datesEnabled:this.datesEnabled||this.bsConfig&&this.bsConfig.datesEnabled}),this._datepickerRef=this._datepicker.provide({provide:p,useValue:this._config}).attach(J).to(this._elementRef).show()},e.prototype.ngOnDestroy=function(){this._datepicker.dispose()},e}();ee.decorators=[{type:t.Directive,args:[{selector:"bs-datepicker-inline",exportAs:"bsDatepickerInline"}]}],ee.ctorParameters=function(){return[{type:X},{type:t.ElementRef},{type:t.Renderer2},{type:t.ViewContainerRef},{type:c.ComponentLoaderFactory}]},ee.propDecorators={bsConfig:[{type:t.Input}],isDisabled:[{type:t.Input}],minDate:[{type:t.Input}],maxDate:[{type:t.Input}],dateCustomClasses:[{type:t.Input}],dateTooltipTexts:[{type:t.Input}],datesEnabled:[{type:t.Input}],datesDisabled:[{type:t.Input}],bsValueChange:[{type:t.Output}],bsValue:[{type:t.Input}]};var te=function(e){function t(){var t=e.apply(this,m(arguments))||this;return t.displayMonths=2,t.isAnimated=!1,t}return y(t,e),t}(p);te.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new te},token:te,providedIn:"root"}),te.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}];var ne=function(e){function a(n,i,a,s,o,r,c){var d=e.call(this)||this;return d._config=i,d._store=a,d._element=s,d._actions=o,d._positionService=c,d.valueChange=new t.EventEmitter,d.animationState="void",d._rangeStack=[],d.chosenRange=[],d._subs=[],d._effects=r,d.customRanges=d._config.ranges||[],d.customRangeBtnLbl=d._config.customRangeButtonLabel,n.setStyle(s.nativeElement,"display","block"),n.setStyle(s.nativeElement,"position","absolute"),d}return y(a,e),Object.defineProperty(a.prototype,"value",{set:function(e){var t;null===(t=this._effects)||void 0===t||t.setRangeValue(e)},enumerable:!1,configurable:!0}),a.prototype.ngOnInit=function(){var e,t,i=this;this._positionService.setOptions({modifiers:{flip:{enabled:this._config.adaptivePosition}},allowedPositions:["top","bottom"]}),null===(e=this._positionService.event$)||void 0===e||e.pipe(n.take(1)).subscribe((function(){i._positionService.disable(),i._config.isAnimated?i.animationState=i.isTopPosition?"animated-up":"animated-down":i.animationState="unanimated"})),this.containerClass=this._config.containerClass,this.isOtherMonthsActive=this._config.selectFromOtherMonth,null===(t=this._effects)||void 0===t||t.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){i.valueChange.emit(e),i.chosenRange=e||[]})))},Object.defineProperty(a.prototype,"isTopPosition",{get:function(){return this._element.nativeElement.classList.contains("top")},enumerable:!1,configurable:!0}),a.prototype.positionServiceEnable=function(){this._positionService.enable()},a.prototype.daySelectHandler=function(e){e&&((this.isOtherMonthsActive?e.isDisabled:e.isOtherMonth||e.isDisabled)||this.rangesProcessing(e))},a.prototype.monthSelectHandler=function(e){if(e&&!e.isDisabled)if(e.isSelected=!0,"month"===this._config.minMode)this.rangesProcessing(e);else{if(e.isDisabled)return;this._store.dispatch(this._actions.navigateTo({unit:{month:i.getMonth(e.date),year:i.getFullYear(e.date)},viewMode:"day"}))}},a.prototype.yearSelectHandler=function(e){if(e&&!e.isDisabled)if(e.isSelected=!0,"year"===this._config.minMode)this.rangesProcessing(e);else{if(e.isDisabled)return;this._store.dispatch(this._actions.navigateTo({unit:{year:i.ge