-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflatpickr.min.js
More file actions
executable file
·3 lines (3 loc) · 41.2 KB
/
flatpickr.min.js
File metadata and controls
executable file
·3 lines (3 loc) · 41.2 KB
1
2
3
/*! flatpickr v2.6.1, @license MIT */
function Flatpickr(e,t){function n(e){return e.bind(pe)}function a(e){pe.config.noCalendar&&!pe.selectedDates.length&&(pe.selectedDates=[pe.now]),me(e),pe.selectedDates.length&&(!pe.minDateHasTime||"input"!==e.type||e.target.value.length>=2?(i(),re()):setTimeout(function(){i(),re()},1e3))}function i(){if(pe.config.enableTime){var e=(parseInt(pe.hourElement.value,10)||0)%(pe.amPM?12:24),t=(parseInt(pe.minuteElement.value,10)||0)%60,n=pe.config.enableSeconds?parseInt(pe.secondElement.value,10)||0:0;void 0!==pe.amPM&&(e=e%12+12*("PM"===pe.amPM.textContent)),pe.minDateHasTime&&0===ge(pe.latestSelectedDateObj,pe.config.minDate)&&(e=Math.max(e,pe.config.minDate.getHours()))===pe.config.minDate.getHours()&&(t=Math.max(t,pe.config.minDate.getMinutes())),pe.maxDateHasTime&&0===ge(pe.latestSelectedDateObj,pe.config.maxDate)&&(e=Math.min(e,pe.config.maxDate.getHours()))===pe.config.maxDate.getHours()&&(t=Math.min(t,pe.config.maxDate.getMinutes())),o(e,t,n)}}function r(e){var t=e||pe.latestSelectedDateObj;t&&o(t.getHours(),t.getMinutes(),t.getSeconds())}function o(e,t,n){pe.selectedDates.length&&pe.latestSelectedDateObj.setHours(e%24,t,n||0,0),pe.config.enableTime&&!pe.isMobile&&(pe.hourElement.value=pe.pad(pe.config.time_24hr?e:(12+e)%12+12*(e%12==0)),pe.minuteElement.value=pe.pad(t),pe.config.time_24hr||(pe.amPM.textContent=e>=12?"PM":"AM"),!0===pe.config.enableSeconds&&(pe.secondElement.value=pe.pad(n)))}function l(e){var t=e.target.value;e.delta&&(t=(parseInt(t)+e.delta).toString()),4!==t.length&&"Enter"!==e.key||(pe.currentYearElement.blur(),/[^\d]/.test(t)||I(t))}function c(e,t,n){return t instanceof Array?t.forEach(function(t){return c(e,t,n)}):e instanceof Array?e.forEach(function(e){return c(e,t,n)}):(e.addEventListener(t,n),void pe._handlers.push({element:e,event:t,handler:n}))}function s(e){return function(t){return 1===t.which&&e(t)}}function d(){if(pe._handlers=[],pe.config.wrap&&["open","close","toggle","clear"].forEach(function(e){Array.prototype.forEach.call(pe.element.querySelectorAll("[data-"+e+"]"),function(t){return c(t,"mousedown",s(pe[e]))})}),pe.isMobile)return G();if(pe.debouncedResize=fe(P,50),pe.triggerChange=function(){ee("Change")},pe.debouncedChange=fe(pe.triggerChange,300),"range"===pe.config.mode&&pe.daysContainer&&c(pe.daysContainer,"mouseover",function(e){return L(e.target)}),c(window.document.body,"keydown",O),pe.config.static||c(pe._input,"keydown",O),pe.config.inline||pe.config.static||c(window,"resize",pe.debouncedResize),void 0!==window.ontouchstart&&c(window.document,"touchstart",Y),c(window.document,"mousedown",s(Y)),c(pe._input,"blur",Y),!0===pe.config.clickOpens&&c(pe._input,"focus",pe.open),pe.config.noCalendar||(pe.monthNav.addEventListener("wheel",function(e){return e.preventDefault()}),c(pe.monthNav,"wheel",fe(le,10)),c(pe.monthNav,"mousedown",s(ce)),c(pe.monthNav,["keyup","increment"],l),c(pe.daysContainer,"mousedown",s(J)),pe.config.animate&&(c(pe.daysContainer,["webkitAnimationEnd","animationend"],u),c(pe.monthNav,["webkitAnimationEnd","animationend"],f))),pe.config.enableTime){var e=function(e){return e.target.select()};c(pe.timeContainer,["wheel","input","increment"],a),c(pe.timeContainer,"mousedown",s(m)),c(pe.timeContainer,["wheel","increment"],pe.debouncedChange),c(pe.timeContainer,"input",pe.triggerChange),c([pe.hourElement,pe.minuteElement],"focus",e),void 0!==pe.secondElement&&c(pe.secondElement,"focus",function(){return pe.secondElement.select()}),void 0!==pe.amPM&&c(pe.amPM,"mousedown",s(function(e){a(e),pe.triggerChange(e)}))}}function u(e){if(pe.daysContainer.childNodes.length>1)switch(e.animationName){case"fpSlideLeft":pe.daysContainer.lastChild.classList.remove("slideLeftNew"),pe.daysContainer.removeChild(pe.daysContainer.firstChild),pe.days=pe.daysContainer.firstChild;break;case"fpSlideRight":pe.daysContainer.firstChild.classList.remove("slideRightNew"),pe.daysContainer.removeChild(pe.daysContainer.lastChild),pe.days=pe.daysContainer.firstChild}}function f(e){switch(e.animationName){case"fpSlideLeftNew":case"fpSlideRightNew":pe.navigationCurrentMonth.classList.remove("slideLeftNew"),pe.navigationCurrentMonth.classList.remove("slideRightNew");for(var t=pe.navigationCurrentMonth;t.nextSibling&&/curr/.test(t.nextSibling.className);)pe.monthNav.removeChild(t.nextSibling);for(;t.previousSibling&&/curr/.test(t.previousSibling.className);)pe.monthNav.removeChild(t.previousSibling);pe.oldCurMonth=null}}function g(e){e=e?pe.parseDate(e):pe.latestSelectedDateObj||(pe.config.minDate>pe.now?pe.config.minDate:pe.config.maxDate&&pe.config.maxDate<pe.now?pe.config.maxDate:pe.now);try{pe.currentYear=e.getFullYear(),pe.currentMonth=e.getMonth()}catch(t){console.error(t.stack),console.warn("Invalid date supplied: "+e)}pe.redraw()}function m(e){~e.target.className.indexOf("arrow")&&p(e,e.target.classList.contains("arrowUp")?1:-1)}function p(e,t,n){var a=n||e.target.parentNode.childNodes[0],i=te("increment");i.delta=t,a.dispatchEvent(i)}function h(e){var t=se("div","numInputWrapper"),n=se("input","numInput "+e),a=se("span","arrowUp"),i=se("span","arrowDown");return n.type="text",n.pattern="\\d*",t.appendChild(n),t.appendChild(a),t.appendChild(i),t}function D(){var e=window.document.createDocumentFragment();pe.calendarContainer=se("div","flatpickr-calendar"),pe.calendarContainer.tabIndex=-1,pe.config.noCalendar||(e.appendChild(M()),pe.innerContainer=se("div","flatpickr-innerContainer"),pe.config.weekNumbers&&pe.innerContainer.appendChild(T()),pe.rContainer=se("div","flatpickr-rContainer"),pe.rContainer.appendChild(x()),pe.daysContainer||(pe.daysContainer=se("div","flatpickr-days"),pe.daysContainer.tabIndex=-1),b(),pe.rContainer.appendChild(pe.daysContainer),pe.innerContainer.appendChild(pe.rContainer),e.appendChild(pe.innerContainer)),pe.config.enableTime&&e.appendChild(k()),ue(pe.calendarContainer,"rangeMode","range"===pe.config.mode),ue(pe.calendarContainer,"animate",pe.config.animate),pe.calendarContainer.appendChild(e);var t=pe.config.appendTo&&pe.config.appendTo.nodeType;if(pe.config.inline||pe.config.static){if(pe.calendarContainer.classList.add(pe.config.inline?"inline":"static"),pe.config.inline&&!t)return pe.element.parentNode.insertBefore(pe.calendarContainer,pe._input.nextSibling);if(pe.config.static){var n=se("div","flatpickr-wrapper");return pe.element.parentNode.insertBefore(n,pe.element),n.appendChild(pe.element),pe.altInput&&n.appendChild(pe.altInput),void n.appendChild(pe.calendarContainer)}}(t?pe.config.appendTo:window.document.body).appendChild(pe.calendarContainer)}function v(e,t,n,a){var i=A(t,!0),r=se("span","flatpickr-day "+e,t.getDate());return r.dateObj=t,r.$i=a,r.setAttribute("aria-label",pe.formatDate(t,"F j, Y")),0===ge(t,pe.now)&&(pe.todayDateElem=r,r.classList.add("today")),i?(r.tabIndex=-1,ne(t)&&(r.classList.add("selected"),pe.selectedDateElem=r,"range"===pe.config.mode&&(ue(r,"startRange",0===ge(t,pe.selectedDates[0])),ue(r,"endRange",0===ge(t,pe.selectedDates[1]))))):(r.classList.add("disabled"),pe.selectedDates[0]&&t>pe.minRangeDate&&t<pe.selectedDates[0]?pe.minRangeDate=t:pe.selectedDates[0]&&t<pe.maxRangeDate&&t>pe.selectedDates[0]&&(pe.maxRangeDate=t)),"range"===pe.config.mode&&(ae(t)&&!ne(t)&&r.classList.add("inRange"),1===pe.selectedDates.length&&(t<pe.minRangeDate||t>pe.maxRangeDate)&&r.classList.add("notAllowed")),pe.config.weekNumbers&&"prevMonthDay"!==e&&n%7==1&&pe.weekNumbers.insertAdjacentHTML("beforeend","<span class='disabled flatpickr-day'>"+pe.config.getWeek(t)+"</span>"),ee("DayCreate",r),r}function C(e,t){var n=e+t||0,a=void 0!==e?pe.days.childNodes[n]:pe.selectedDateElem||pe.todayDateElem||pe.days.childNodes[0],i=function(){a=a||pe.days.childNodes[n],a.focus(),"range"===pe.config.mode&&L(a)};if(void 0===a&&0!==t)return t>0?(pe.changeMonth(1),n%=42):t<0&&(pe.changeMonth(-1),n+=42),w(i);i()}function w(e){if(pe.config.animate)return setTimeout(e,pe._.daysAnimDuration+1);e()}function b(e){var t=(new Date(pe.currentYear,pe.currentMonth,1).getDay()-pe.l10n.firstDayOfWeek+7)%7,n="range"===pe.config.mode;pe.prevMonthDays=pe.utils.getDaysinMonth((pe.currentMonth-1+12)%12),pe.selectedDateElem=void 0,pe.todayDateElem=void 0;var a=pe.utils.getDaysinMonth(),i=window.document.createDocumentFragment(),r=pe.prevMonthDays+1-t,o=0;for(pe.config.weekNumbers&&pe.weekNumbers.firstChild&&(pe.weekNumbers.textContent=""),n&&(pe.minRangeDate=new Date(pe.currentYear,pe.currentMonth-1,r),pe.maxRangeDate=new Date(pe.currentYear,pe.currentMonth+1,(42-t)%a));r<=pe.prevMonthDays;r++,o++)i.appendChild(v("prevMonthDay",new Date(pe.currentYear,pe.currentMonth-1,r),r,o));for(r=1;r<=a;r++,o++)i.appendChild(v("",new Date(pe.currentYear,pe.currentMonth,r),r,o));for(var l=a+1;l<=42-t;l++,o++)i.appendChild(v("nextMonthDay",new Date(pe.currentYear,pe.currentMonth+1,l%a),l,o));n&&1===pe.selectedDates.length&&i.childNodes[0]?(pe._hidePrevMonthArrow=pe._hidePrevMonthArrow||pe.minRangeDate>i.childNodes[0].dateObj,pe._hideNextMonthArrow=pe._hideNextMonthArrow||pe.maxRangeDate<new Date(pe.currentYear,pe.currentMonth+1,1)):ie();var c=se("div","dayContainer");if(c.appendChild(i),pe.config.animate&&void 0!==e)for(;pe.daysContainer.childNodes.length>1;)pe.daysContainer.removeChild(pe.daysContainer.firstChild);else y(pe.daysContainer);return e>=0?pe.daysContainer.appendChild(c):pe.daysContainer.insertBefore(c,pe.daysContainer.firstChild),pe.days=pe.daysContainer.firstChild,pe.daysContainer}function y(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function M(){var e=window.document.createDocumentFragment();pe.monthNav=se("div","flatpickr-month"),pe.prevMonthNav=se("span","flatpickr-prev-month"),pe.prevMonthNav.innerHTML=pe.config.prevArrow,pe.currentMonthElement=se("span","cur-month"),pe.currentMonthElement.title=pe.l10n.scrollTitle;var t=h("cur-year");return pe.currentYearElement=t.childNodes[0],pe.currentYearElement.title=pe.l10n.scrollTitle,pe.config.minDate&&(pe.currentYearElement.min=pe.config.minDate.getFullYear()),pe.config.maxDate&&(pe.currentYearElement.max=pe.config.maxDate.getFullYear(),pe.currentYearElement.disabled=pe.config.minDate&&pe.config.minDate.getFullYear()===pe.config.maxDate.getFullYear()),pe.nextMonthNav=se("span","flatpickr-next-month"),pe.nextMonthNav.innerHTML=pe.config.nextArrow,pe.navigationCurrentMonth=se("span","flatpickr-current-month"),pe.navigationCurrentMonth.appendChild(pe.currentMonthElement),pe.navigationCurrentMonth.appendChild(t),e.appendChild(pe.prevMonthNav),e.appendChild(pe.navigationCurrentMonth),e.appendChild(pe.nextMonthNav),pe.monthNav.appendChild(e),Object.defineProperty(pe,"_hidePrevMonthArrow",{get:function(){return this.__hidePrevMonthArrow},set:function(e){this.__hidePrevMonthArrow!==e&&(pe.prevMonthNav.style.display=e?"none":"block"),this.__hidePrevMonthArrow=e}}),Object.defineProperty(pe,"_hideNextMonthArrow",{get:function(){return this.__hideNextMonthArrow},set:function(e){this.__hideNextMonthArrow!==e&&(pe.nextMonthNav.style.display=e?"none":"block"),this.__hideNextMonthArrow=e}}),ie(),pe.monthNav}function k(){pe.calendarContainer.classList.add("hasTime"),pe.config.noCalendar&&pe.calendarContainer.classList.add("noCalendar"),pe.timeContainer=se("div","flatpickr-time"),pe.timeContainer.tabIndex=-1;var e=se("span","flatpickr-time-separator",":"),t=h("flatpickr-hour");pe.hourElement=t.childNodes[0];var n=h("flatpickr-minute");if(pe.minuteElement=n.childNodes[0],pe.hourElement.tabIndex=pe.minuteElement.tabIndex=-1,pe.hourElement.value=pe.pad(pe.latestSelectedDateObj?pe.latestSelectedDateObj.getHours():pe.config.defaultHour),pe.minuteElement.value=pe.pad(pe.latestSelectedDateObj?pe.latestSelectedDateObj.getMinutes():pe.config.defaultMinute),pe.hourElement.step=pe.config.hourIncrement,pe.minuteElement.step=pe.config.minuteIncrement,pe.hourElement.min=pe.config.time_24hr?0:1,pe.hourElement.max=pe.config.time_24hr?23:12,pe.minuteElement.min=0,pe.minuteElement.max=59,pe.hourElement.title=pe.minuteElement.title=pe.l10n.scrollTitle,pe.timeContainer.appendChild(t),pe.timeContainer.appendChild(e),pe.timeContainer.appendChild(n),pe.config.time_24hr&&pe.timeContainer.classList.add("time24hr"),pe.config.enableSeconds){pe.timeContainer.classList.add("hasSeconds");var a=h("flatpickr-second");pe.secondElement=a.childNodes[0],pe.secondElement.value=pe.latestSelectedDateObj?pe.pad(pe.latestSelectedDateObj.getSeconds()):"00",pe.secondElement.step=pe.minuteElement.step,pe.secondElement.min=pe.minuteElement.min,pe.secondElement.max=pe.minuteElement.max,pe.timeContainer.appendChild(se("span","flatpickr-time-separator",":")),pe.timeContainer.appendChild(a)}return pe.config.time_24hr||(pe.amPM=se("span","flatpickr-am-pm",["AM","PM"][pe.hourElement.value>11|0]),pe.amPM.title=pe.l10n.toggleTitle,pe.amPM.tabIndex=-1,pe.timeContainer.appendChild(pe.amPM)),pe.timeContainer}function x(){pe.weekdayContainer||(pe.weekdayContainer=se("div","flatpickr-weekdays"));var e=pe.l10n.firstDayOfWeek,t=pe.l10n.weekdays.shorthand.slice();return e>0&&e<t.length&&(t=[].concat(t.splice(e,t.length),t.splice(0,e))),pe.weekdayContainer.innerHTML="\n\t\t<span class=flatpickr-weekday>\n\t\t\t"+t.join("</span><span class=flatpickr-weekday>")+"\n\t\t</span>\n\t\t",pe.weekdayContainer}function T(){return pe.calendarContainer.classList.add("hasWeeks"),pe.weekWrapper=se("div","flatpickr-weekwrapper"),pe.weekWrapper.appendChild(se("span","flatpickr-weekday",pe.l10n.weekAbbreviation)),pe.weekNumbers=se("div","flatpickr-weeks"),pe.weekWrapper.appendChild(pe.weekNumbers),pe.weekWrapper}function E(e,t,n){t=void 0===t||t;var a=t?e:e-pe.currentMonth,i=!pe.config.animate||!1===n;if(!(a<0&&pe._hidePrevMonthArrow||a>0&&pe._hideNextMonthArrow)){if(pe.currentMonth+=a,(pe.currentMonth<0||pe.currentMonth>11)&&(pe.currentYear+=pe.currentMonth>11?1:-1,pe.currentMonth=(pe.currentMonth+12)%12,ee("YearChange")),b(i?void 0:a),i)return ee("MonthChange"),ie();var r=pe.navigationCurrentMonth;if(a<0)for(;r.nextSibling&&/curr/.test(r.nextSibling.className);)pe.monthNav.removeChild(r.nextSibling);else if(a>0)for(;r.previousSibling&&/curr/.test(r.previousSibling.className);)pe.monthNav.removeChild(r.previousSibling);if(pe.oldCurMonth=pe.navigationCurrentMonth,pe.navigationCurrentMonth=pe.monthNav.insertBefore(pe.oldCurMonth.cloneNode(!0),a>0?pe.oldCurMonth.nextSibling:pe.oldCurMonth),a>0?(pe.daysContainer.firstChild.classList.add("slideLeft"),pe.daysContainer.lastChild.classList.add("slideLeftNew"),pe.oldCurMonth.classList.add("slideLeft"),pe.navigationCurrentMonth.classList.add("slideLeftNew")):a<0&&(pe.daysContainer.firstChild.classList.add("slideRightNew"),pe.daysContainer.lastChild.classList.add("slideRight"),pe.oldCurMonth.classList.add("slideRight"),pe.navigationCurrentMonth.classList.add("slideRightNew")),pe.currentMonthElement=pe.navigationCurrentMonth.firstChild,pe.currentYearElement=pe.navigationCurrentMonth.lastChild.childNodes[0],ie(),pe.oldCurMonth.firstChild.textContent=pe.utils.monthToStr(pe.currentMonth-a),ee("MonthChange"),void 0===pe._.daysAnimDuration){var o=window.getComputedStyle(pe.daysContainer.lastChild),l=o.getPropertyValue("animation-duration")||o.getPropertyValue("-webkit-animation-duration");pe._.daysAnimDuration=parseInt(/(\d+)s/.exec(l)[1])}}}function N(e){pe.input.value="",pe.altInput&&(pe.altInput.value=""),pe.mobileInput&&(pe.mobileInput.value=""),pe.selectedDates=[],pe.latestSelectedDateObj=void 0,pe.showTimeInput=!1,pe.redraw(),!1!==e&&ee("Change")}function F(){pe.isOpen=!1,pe.isMobile||(pe.calendarContainer.classList.remove("open"),pe._input.classList.remove("active")),ee("Close")}function _(e){e=e||pe;for(var t=e._handlers.length;t--;){var n=e._handlers[t];n.element.removeEventListener(n.event,n.handler)}e._handlers=[],e.mobileInput?(e.mobileInput.parentNode&&e.mobileInput.parentNode.removeChild(e.mobileInput),e.mobileInput=void 0):e.calendarContainer&&e.calendarContainer.parentNode&&e.calendarContainer.parentNode.removeChild(e.calendarContainer),e.altInput&&(e.input.type="text",e.altInput.parentNode&&e.altInput.parentNode.removeChild(e.altInput),e.altInput=void 0),e.input&&(e.input.type=e.input._type,e.input.classList.remove("flatpickr-input"),e.input.removeAttribute("readonly"),e.input.value=""),e.config=void 0,e.input._flatpickr=void 0}function S(e){return!(!pe.config.appendTo||!pe.config.appendTo.contains(e))||pe.calendarContainer.contains(e)}function Y(e){if(pe.isOpen&&!pe.config.inline){var t=S(e.target),n=e.target===pe.input||e.target===pe.altInput||pe.element.contains(e.target)||e.path&&e.path.indexOf&&(~e.path.indexOf(pe.input)||~e.path.indexOf(pe.altInput));("blur"===e.type?n&&e.relatedTarget&&!S(e.relatedTarget):!n&&!t)&&(e.preventDefault(),pe.close(),pe._input.blur(),"range"===pe.config.mode&&1===pe.selectedDates.length&&(pe.clear(!1),pe.redraw()))}}function I(e){if(!(!e||pe.currentYearElement.min&&e<pe.currentYearElement.min||pe.currentYearElement.max&&e>pe.currentYearElement.max)){var t=parseInt(e,10),n=pe.currentYear!==t;pe.currentYear=t||pe.currentYear,pe.config.maxDate&&pe.currentYear===pe.config.maxDate.getFullYear()?pe.currentMonth=Math.min(pe.config.maxDate.getMonth(),pe.currentMonth):pe.config.minDate&&pe.currentYear===pe.config.minDate.getFullYear()&&(pe.currentMonth=Math.max(pe.config.minDate.getMonth(),pe.currentMonth)),n&&(pe.redraw(),ee("YearChange"))}}function A(e,t){if(pe.config.minDate&&ge(e,pe.config.minDate,void 0!==t?t:!pe.minDateHasTime)<0||pe.config.maxDate&&ge(e,pe.config.maxDate,void 0!==t?t:!pe.maxDateHasTime)>0)return!1;if(!pe.config.enable.length&&!pe.config.disable.length)return!0;for(var n,a=pe.parseDate(e,null,!0),i=pe.config.enable.length>0,r=i?pe.config.enable:pe.config.disable,o=0;o<r.length;o++){if((n=r[o])instanceof Function&&n(a))return i;if(n instanceof Date&&n.getTime()===a.getTime())return i;if("string"==typeof n&&pe.parseDate(n,null,!0).getTime()===a.getTime())return i;if("object"===(void 0===n?"undefined":_typeof(n))&&n.from&&n.to&&a>=n.from&&a<=n.to)return i}return!i}function O(e){var t=e.target===pe._input,n=S(e.target),r=pe.config.allowInput,o=pe.isOpen&&(!r||!t),l=pe.config.inline&&t&&!r;if("Enter"===e.key&&r&&t)return pe.setDate(pe._input.value,!0,e.target===pe.altInput?pe.config.altFormat:pe.config.dateFormat),e.target.blur();if(n||o||l){var c=pe.timeContainer&&pe.timeContainer.contains(e.target);switch(e.key){case"Enter":c?re():J(e);break;case"Escape":e.preventDefault(),pe.close();break;case"ArrowLeft":case"ArrowRight":if(e.preventDefault(),pe.daysContainer){var s="ArrowRight"===e.key?1:-1;e.ctrlKey?(E(s,!0),w(function(){C(e.target.$i,0)})):C(e.target.$i,s)}else pe.config.enableTime&&!c&&pe.hourElement.focus();break;case"ArrowUp":case"ArrowDown":e.preventDefault();var d="ArrowDown"===e.key?1:-1;pe.daysContainer?e.ctrlKey?(I(pe.currentYear-d),C(e.target.$i,0)):c||C(e.target.$i,7*d):pe.config.enableTime&&(c||pe.hourElement.focus(),a(e));break;case"Tab":e.target===pe.hourElement?(e.preventDefault(),pe.minuteElement.select()):e.target===pe.minuteElement&&pe.amPM&&(e.preventDefault(),pe.amPM.focus());break;case"a":e.target===pe.amPM&&(pe.amPM.textContent="AM",i(),re());break;case"p":e.target===pe.amPM&&(pe.amPM.textContent="PM",i(),re())}ee("KeyDown",e)}}function L(e){if(1===pe.selectedDates.length&&e.classList.contains("flatpickr-day")){for(var t=e.dateObj,n=pe.parseDate(pe.selectedDates[0],null,!0),a=Math.min(t.getTime(),pe.selectedDates[0].getTime()),i=Math.max(t.getTime(),pe.selectedDates[0].getTime()),r=!1,o=a;o<i;o+=pe.utils.duration.DAY)if(!A(new Date(o))){r=!0;break}for(var l=pe.days.childNodes[0].dateObj.getTime(),c=0;c<42;c++,l+=pe.utils.duration.DAY){(function(o,l){var c=o<pe.minRangeDate.getTime()||o>pe.maxRangeDate.getTime(),s=pe.days.childNodes[l];if(c)return pe.days.childNodes[l].classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(e){s.classList.remove(e)}),"continue";if(r&&!c)return"continue";["startRange","inRange","endRange","notAllowed"].forEach(function(e){s.classList.remove(e)});var d=Math.max(pe.minRangeDate.getTime(),a),u=Math.min(pe.maxRangeDate.getTime(),i);e.classList.add(t<pe.selectedDates[0]?"startRange":"endRange"),n<t&&o===n.getTime()?s.classList.add("startRange"):n>t&&o===n.getTime()&&s.classList.add("endRange"),o>=d&&o<=u&&s.classList.add("inRange")})(l,c)}}}function P(){!pe.isOpen||pe.config.static||pe.config.inline||U()}function j(e){if(pe.isMobile)return e&&(e.preventDefault(),e.target.blur()),setTimeout(function(){pe.mobileInput.click()},0),void ee("Open");pe.isOpen||pe._input.disabled||pe.config.inline||(pe.isOpen=!0,pe.calendarContainer.classList.add("open"),U(),pe._input.classList.add("active"),ee("Open"))}function H(e){return function(t){var n=pe.config["_"+e+"Date"]=pe.parseDate(t),a=pe.config["_"+("min"===e?"max":"min")+"Date"],i=t&&n instanceof Date;i&&(pe[e+"DateHasTime"]=n.getHours()||n.getMinutes()||n.getSeconds()),pe.selectedDates&&(pe.selectedDates=pe.selectedDates.filter(function(e){return A(e)}),pe.selectedDates.length||"min"!==e||r(n),re()),pe.daysContainer&&(B(),i?pe.currentYearElement[e]=n.getFullYear():pe.currentYearElement.removeAttribute(e),pe.currentYearElement.disabled=a&&n&&a.getFullYear()===n.getFullYear())}}function R(){var e=["utc","wrap","weekNumbers","allowInput","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],t=["onChange","onClose","onDayCreate","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange"];pe.config=Object.create(Flatpickr.defaultConfig);var a=_extends({},pe.instanceConfig,JSON.parse(JSON.stringify(pe.element.dataset||{})));pe.config.parseDate=a.parseDate,pe.config.formatDate=a.formatDate,_extends(pe.config,a),!a.dateFormat&&a.enableTime&&(pe.config.dateFormat=pe.config.noCalendar?"H:i"+(pe.config.enableSeconds?":S":""):Flatpickr.defaultConfig.dateFormat+" H:i"+(pe.config.enableSeconds?":S":"")),a.altInput&&a.enableTime&&!a.altFormat&&(pe.config.altFormat=pe.config.noCalendar?"h:i"+(pe.config.enableSeconds?":S K":" K"):Flatpickr.defaultConfig.altFormat+" h:i"+(pe.config.enableSeconds?":S":"")+" K"),Object.defineProperty(pe.config,"minDate",{get:function(){return this._minDate},set:H("min")}),Object.defineProperty(pe.config,"maxDate",{get:function(){return this._maxDate},set:H("max")}),pe.config.minDate=a.minDate,pe.config.maxDate=a.maxDate;for(var i=0;i<e.length;i++)pe.config[e[i]]=!0===pe.config[e[i]]||"true"===pe.config[e[i]];for(var r=t.length;r--;)void 0!==pe.config[t[r]]&&(pe.config[t[r]]=de(pe.config[t[r]]||[]).map(n));for(var o=0;o<pe.config.plugins.length;o++){var l=pe.config.plugins[o](pe)||{};for(var c in l)pe.config[c]instanceof Array||~t.indexOf(c)?pe.config[c]=de(l[c]).map(n).concat(pe.config[c]):void 0===a[c]&&(pe.config[c]=l[c])}ee("ParseConfig")}function W(){"object"!==_typeof(pe.config.locale)&&void 0===Flatpickr.l10ns[pe.config.locale]&&console.warn("flatpickr: invalid locale "+pe.config.locale),pe.l10n=_extends(Object.create(Flatpickr.l10ns.default),"object"===_typeof(pe.config.locale)?pe.config.locale:"default"!==pe.config.locale?Flatpickr.l10ns[pe.config.locale]||{}:{})}function U(){if(void 0!==pe.calendarContainer){var e=pe.calendarContainer.offsetHeight,t=pe.calendarContainer.offsetWidth,n=pe.config.position,a=pe._positionElement.getBoundingClientRect(),i=window.innerHeight-a.bottom,r="above"===n||"below"!==n&&i<e&&a.top>e,o=window.pageYOffset+a.top+(r?-e-2:pe._positionElement.offsetHeight+2);if(ue(pe.calendarContainer,"arrowTop",!r),ue(pe.calendarContainer,"arrowBottom",r),!pe.config.inline){var l=window.pageXOffset+a.left,c=window.document.body.offsetWidth-a.right,s=l+t>window.document.body.offsetWidth;ue(pe.calendarContainer,"rightMost",s),pe.config.static||(pe.calendarContainer.style.top=o+"px",s?(pe.calendarContainer.style.left="auto",pe.calendarContainer.style.right=c+"px"):(pe.calendarContainer.style.left=l+"px",pe.calendarContainer.style.right="auto"))}}}function B(){pe.config.noCalendar||pe.isMobile||(x(),ie(),b())}function J(e){if(e.preventDefault(),e.stopPropagation(),e.target.classList.contains("flatpickr-day")&&!e.target.classList.contains("disabled")&&!e.target.classList.contains("notAllowed")){var t=pe.latestSelectedDateObj=new Date(e.target.dateObj.getTime()),n=t.getMonth()!==pe.currentMonth&&"range"!==pe.config.mode;if(pe.selectedDateElem=e.target,"single"===pe.config.mode)pe.selectedDates=[t];else if("multiple"===pe.config.mode){var a=ne(t);a?pe.selectedDates.splice(a,1):pe.selectedDates.push(t)}else"range"===pe.config.mode&&(2===pe.selectedDates.length&&pe.clear(),pe.selectedDates.push(t),0!==ge(t,pe.selectedDates[0],!0)&&pe.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()}));if(i(),n){var o=pe.currentYear!==t.getFullYear();pe.currentYear=t.getFullYear(),pe.currentMonth=t.getMonth(),o&&ee("YearChange"),ee("MonthChange")}b(),pe.minDateHasTime&&pe.config.enableTime&&0===ge(t,pe.config.minDate)&&r(pe.config.minDate),re(),pe.config.enableTime&&setTimeout(function(){return pe.showTimeInput=!0},50),"range"===pe.config.mode&&(1===pe.selectedDates.length?(L(e.target),pe._hidePrevMonthArrow=pe._hidePrevMonthArrow||pe.minRangeDate>pe.days.childNodes[0].dateObj,pe._hideNextMonthArrow=pe._hideNextMonthArrow||pe.maxRangeDate<new Date(pe.currentYear,pe.currentMonth+1,1)):(ie(),pe.close())),ee("Change"),n?w(function(){return pe.selectedDateElem.focus()}):C(e.target.$i,0),pe.config.enableTime&&setTimeout(function(){return pe.hourElement.select()},451),"single"!==pe.config.mode||pe.config.enableTime||pe.close()}}function K(e,t){pe.config[e]=t,pe.redraw(),g()}function $(e,t){if(e instanceof Array)pe.selectedDates=e.map(function(e){return pe.parseDate(e,t)});else if(e instanceof Date||!isNaN(e))pe.selectedDates=[pe.parseDate(e,t)];else if(e&&e.substring)switch(pe.config.mode){case"single":pe.selectedDates=[pe.parseDate(e,t)];break;case"multiple":pe.selectedDates=e.split("; ").map(function(e){return pe.parseDate(e,t)});break;case"range":pe.selectedDates=e.split(pe.l10n.rangeSeparator).map(function(e){return pe.parseDate(e,t)})}pe.selectedDates=pe.selectedDates.filter(function(e){return e instanceof Date&&A(e,!1)}),pe.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()})}function z(e,t,n){if(!e)return pe.clear(t);$(e,n),pe.showTimeInput=pe.selectedDates.length>0,pe.latestSelectedDateObj=pe.selectedDates[0],pe.redraw(),g(),r(),re(t),t&&ee("Change")}function V(){function e(e){for(var t=e.length;t--;)"string"==typeof e[t]||+e[t]?e[t]=pe.parseDate(e[t],null,!0):e[t]&&e[t].from&&e[t].to&&(e[t].from=pe.parseDate(e[t].from),e[t].to=pe.parseDate(e[t].to));return e.filter(function(e){return e})}pe.selectedDates=[],pe.now=new Date,pe.config.disable.length&&(pe.config.disable=e(pe.config.disable)),pe.config.enable.length&&(pe.config.enable=e(pe.config.enable));var t=pe.config.defaultDate||pe.input.value;t&&$(t,pe.config.dateFormat);var n=pe.selectedDates.length?pe.selectedDates[0]:pe.config.minDate&&pe.config.minDate.getTime()>pe.now?pe.config.minDate:pe.config.maxDate&&pe.config.maxDate.getTime()<pe.now?pe.config.maxDate:pe.now;pe.currentYear=n.getFullYear(),pe.currentMonth=n.getMonth(),pe.selectedDates.length&&(pe.latestSelectedDateObj=pe.selectedDates[0]),pe.minDateHasTime=pe.config.minDate&&(pe.config.minDate.getHours()||pe.config.minDate.getMinutes()||pe.config.minDate.getSeconds()),pe.maxDateHasTime=pe.config.maxDate&&(pe.config.maxDate.getHours()||pe.config.maxDate.getMinutes()||pe.config.maxDate.getSeconds()),Object.defineProperty(pe,"latestSelectedDateObj",{get:function(){return pe._selectedDateObj||pe.selectedDates[pe.selectedDates.length-1]},set:function(e){pe._selectedDateObj=e}}),pe.isMobile||Object.defineProperty(pe,"showTimeInput",{get:function(){return pe._showTimeInput},set:function(e){pe._showTimeInput=e,pe.calendarContainer&&ue(pe.calendarContainer,"showTimeInput",e),U()}})}function Z(){pe.utils={duration:{DAY:864e5},getDaysinMonth:function(e,t){return e=void 0===e?pe.currentMonth:e,t=void 0===t?pe.currentYear:t,1===e&&(t%4==0&&t%100!=0||t%400==0)?29:pe.l10n.daysInMonth[e]},monthToStr:function(e,t){return t=void 0===t?pe.config.shorthandCurrentMonth:t,pe.l10n.months[(t?"short":"long")+"hand"][e]}}}function q(){["D","F","J","M","W","l"].forEach(function(e){pe.formats[e]=Flatpickr.prototype.formats[e].bind(pe)}),pe.revFormat.F=Flatpickr.prototype.revFormat.F.bind(pe),pe.revFormat.M=Flatpickr.prototype.revFormat.M.bind(pe)}function Q(){if(pe.input=pe.config.wrap?pe.element.querySelector("[data-input]"):pe.element,!pe.input)return console.warn("Error: invalid input element specified",pe.input);pe.input._type=pe.input.type,pe.input.type="text",pe.input.classList.add("flatpickr-input"),pe._input=pe.input,pe.config.altInput&&(pe.altInput=se(pe.input.nodeName,pe.input.className+" "+pe.config.altInputClass),pe._input=pe.altInput,pe.altInput.placeholder=pe.input.placeholder,pe.altInput.type="text",pe.input.type="hidden",!pe.config.static&&pe.input.parentNode&&pe.input.parentNode.insertBefore(pe.altInput,pe.input.nextSibling)),pe.config.allowInput||pe._input.setAttribute("readonly","readonly"),pe._positionElement=pe.config.positionElement||pe._input}function G(){var e=pe.config.enableTime?pe.config.noCalendar?"time":"datetime-local":"date";pe.mobileInput=se("input",pe.input.className+" flatpickr-mobile"),pe.mobileInput.step="any",pe.mobileInput.tabIndex=1,pe.mobileInput.type=e,pe.mobileInput.disabled=pe.input.disabled,pe.mobileInput.placeholder=pe.input.placeholder,pe.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",pe.selectedDates.length&&(pe.mobileInput.defaultValue=pe.mobileInput.value=pe.formatDate(pe.selectedDates[0],pe.mobileFormatStr)),pe.config.minDate&&(pe.mobileInput.min=pe.formatDate(pe.config.minDate,"Y-m-d")),pe.config.maxDate&&(pe.mobileInput.max=pe.formatDate(pe.config.maxDate,"Y-m-d")),pe.input.type="hidden",pe.config.altInput&&(pe.altInput.type="hidden");try{pe.input.parentNode.insertBefore(pe.mobileInput,pe.input.nextSibling)}catch(e){}pe.mobileInput.addEventListener("change",function(e){pe.setDate(e.target.value,!1,pe.mobileFormatStr),ee("Change"),ee("Close")})}function X(){if(pe.isOpen)return pe.close();pe.open()}function ee(e,t){var n=pe.config["on"+e];if(void 0!==n&&n.length>0)for(var a=0;n[a]&&a<n.length;a++)n[a](pe.selectedDates,pe._input.value,pe,t);"Change"===e&&(pe.input.dispatchEvent(te("change")),pe.input.dispatchEvent(te("input")))}function te(e){return pe._supportsEvents?new Event(e,{bubbles:!0}):(pe._[e+"Event"]=document.createEvent("Event"),pe._[e+"Event"].initEvent(e,!0,!0),pe._[e+"Event"])}function ne(e){for(var t=0;t<pe.selectedDates.length;t++)if(0===ge(pe.selectedDates[t],e))return""+t;return!1}function ae(e){return!("range"!==pe.config.mode||pe.selectedDates.length<2)&&(ge(e,pe.selectedDates[0])>=0&&ge(e,pe.selectedDates[1])<=0)}function ie(){pe.config.noCalendar||pe.isMobile||!pe.monthNav||(pe.currentMonthElement.textContent=pe.utils.monthToStr(pe.currentMonth)+" ",pe.currentYearElement.value=pe.currentYear,pe._hidePrevMonthArrow=pe.config.minDate&&(pe.currentYear===pe.config.minDate.getFullYear()?pe.currentMonth<=pe.config.minDate.getMonth():pe.currentYear<pe.config.minDate.getFullYear()),pe._hideNextMonthArrow=pe.config.maxDate&&(pe.currentYear===pe.config.maxDate.getFullYear()?pe.currentMonth+1>pe.config.maxDate.getMonth():pe.currentYear>pe.config.maxDate.getFullYear()))}function re(e){if(!pe.selectedDates.length)return pe.clear(e);pe.isMobile&&(pe.mobileInput.value=pe.selectedDates.length?pe.formatDate(pe.latestSelectedDateObj,pe.mobileFormatStr):"");var t="range"!==pe.config.mode?"; ":pe.l10n.rangeSeparator;pe.input.value=pe.selectedDates.map(function(e){return pe.formatDate(e,pe.config.dateFormat)}).join(t),pe.config.altInput&&(pe.altInput.value=pe.selectedDates.map(function(e){return pe.formatDate(e,pe.config.altFormat)}).join(t)),ee("ValueUpdate")}function oe(e){return Math.max(-1,Math.min(1,e.wheelDelta||-e.deltaY))}function le(e){e.preventDefault();var t=pe.currentYearElement.parentNode.contains(e.target)
;if(e.target===pe.currentMonthElement||t){var n=oe(e);t?(I(pe.currentYear+n),e.target.value=pe.currentYear):pe.changeMonth(n,!0,!1)}}function ce(e){var t=pe.prevMonthNav.contains(e.target),n=pe.nextMonthNav.contains(e.target);t||n?E(t?-1:1):e.target===pe.currentYearElement?(e.preventDefault(),pe.currentYearElement.select()):"arrowUp"===e.target.className?pe.changeYear(pe.currentYear+1):"arrowDown"===e.target.className&&pe.changeYear(pe.currentYear-1)}function se(e,t,n){var a=window.document.createElement(e);return t=t||"",n=n||"",a.className=t,void 0!==n&&(a.textContent=n),a}function de(e){return e instanceof Array?e:[e]}function ue(e,t,n){if(n)return e.classList.add(t);e.classList.remove(t)}function fe(e,t,n){var a=void 0;return function(){var i=this,r=arguments;clearTimeout(a),a=setTimeout(function(){a=null,n||e.apply(i,r)},t),n&&!a&&e.apply(i,r)}}function ge(e,t,n){return e instanceof Date&&t instanceof Date&&(!1!==n?new Date(e.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):e.getTime()-t.getTime())}function me(e){e.preventDefault();var t="keydown"===e.type,n=(e.type,e.type,e.target);if(pe.amPM&&e.target===pe.amPM)return e.target.textContent=["AM","PM"]["AM"===e.target.textContent|0];var a=Number(n.min),i=Number(n.max),r=Number(n.step),o=parseInt(n.value,10),l=e.delta||(t?38===e.which?1:-1:Math.max(-1,Math.min(1,e.wheelDelta||-e.deltaY))||0),c=o+r*l;if(void 0!==n.value&&2===n.value.length){var s=n===pe.hourElement,d=n===pe.minuteElement;c<a?(c=i+c+!s+(s&&!pe.amPM),d&&p(null,-1,pe.hourElement)):c>i&&(c=n===pe.hourElement?c-i-!pe.amPM:a,d&&p(null,1,pe.hourElement)),pe.amPM&&s&&(1===r?c+o===23:Math.abs(c-o)>r)&&(pe.amPM.textContent="PM"===pe.amPM.textContent?"AM":"PM"),n.value=pe.pad(c)}}var pe=this;return pe._={},pe._.afterDayAnim=w,pe.changeMonth=E,pe.changeYear=I,pe.clear=N,pe.close=F,pe._createElement=se,pe.destroy=_,pe.isEnabled=A,pe.jumpToDate=g,pe.open=j,pe.redraw=B,pe.set=K,pe.setDate=z,pe.toggle=X,function(){e._flatpickr&&e._flatpickr.destroy(),e._flatpickr=pe,pe.element=e,pe.instanceConfig=t||{},pe.parseDate=Flatpickr.prototype.parseDate.bind(pe),pe.formatDate=Flatpickr.prototype.formatDate.bind(pe),q(),R(),W(),Q(),V(),Z(),pe.isOpen=!1,pe.isMobile=!pe.config.disableMobile&&!pe.config.inline&&"single"===pe.config.mode&&!pe.config.disable.length&&!pe.config.enable.length&&!pe.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),pe.isMobile||D(),d(),(pe.selectedDates.length||pe.config.noCalendar)&&(pe.config.enableTime&&r(pe.config.noCalendar?pe.latestSelectedDateObj||pe.config.minDate:null),re()),pe.config.weekNumbers&&(pe.calendarContainer.style.width=pe.daysContainer.offsetWidth+pe.weekWrapper.offsetWidth+"px"),pe.showTimeInput=pe.selectedDates.length>0||pe.config.noCalendar,pe.isMobile||U(),ee("Ready")}(),pe}function _flatpickr(e,t){for(var n=Array.prototype.slice.call(e),a=[],i=0;i<n.length;i++)try{n[i]._flatpickr=new Flatpickr(n[i],t||{}),a.push(n[i]._flatpickr)}catch(e){console.warn(e,e.stack)}return 1===a.length?a[0]:a}function flatpickr(e,t){return _flatpickr(window.document.querySelectorAll(e),t)}var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Flatpickr.defaultConfig={mode:"single",position:"auto",animate:-1===window.navigator.userAgent.indexOf("MSIE"),utc:!1,wrap:!1,weekNumbers:!1,allowInput:!1,clickOpens:!0,time_24hr:!1,enableTime:!1,noCalendar:!1,dateFormat:"Y-m-d",altInput:!1,altInputClass:"form-control input",altFormat:"F j, Y",defaultDate:null,minDate:null,maxDate:null,parseDate:null,formatDate:null,getWeek:function(e){var t=new Date(e.getTime()),n=new Date(t.getFullYear(),0,1);return Math.ceil(((t-n)/864e5+n.getDay()+1)/7)},enable:[],disable:[],shorthandCurrentMonth:!1,inline:!1,static:!1,appendTo:null,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",enableSeconds:!1,hourIncrement:1,minuteIncrement:5,defaultHour:12,defaultMinute:0,disableMobile:!1,locale:"default",plugins:[],onClose:void 0,onChange:void 0,onDayCreate:void 0,onMonthChange:void 0,onOpen:void 0,onParseConfig:void 0,onReady:void 0,onValueUpdate:void 0,onYearChange:void 0,onKeyDown:void 0},Flatpickr.l10ns={en:{weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle"}},Flatpickr.l10ns.default=Object.create(Flatpickr.l10ns.en),Flatpickr.localize=function(e){return _extends(Flatpickr.l10ns.default,e||{})},Flatpickr.setDefaults=function(e){return _extends(Flatpickr.defaultConfig,e||{})},Flatpickr.prototype={formats:{Z:function(e){return e.toISOString()},D:function(e){return this.l10n.weekdays.shorthand[this.formats.w(e)]},F:function(e){return this.utils.monthToStr(this.formats.n(e)-1,!1)},H:function(e){return Flatpickr.prototype.pad(e.getHours())},J:function(e){return e.getDate()+this.l10n.ordinal(e.getDate())},K:function(e){return e.getHours()>11?"PM":"AM"},M:function(e){return this.utils.monthToStr(e.getMonth(),!0)},S:function(e){return Flatpickr.prototype.pad(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e){return this.config.getWeek(e)},Y:function(e){return e.getFullYear()},d:function(e){return Flatpickr.prototype.pad(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return Flatpickr.prototype.pad(e.getMinutes())},j:function(e){return e.getDate()},l:function(e){return this.l10n.weekdays.longhand[e.getDay()]},m:function(e){return Flatpickr.prototype.pad(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},formatDate:function(e,t){var n=this;return void 0!==this.config&&void 0!==this.config.formatDate?this.config.formatDate(e,t):t.split("").map(function(t,a,i){return n.formats[t]&&"\\"!==i[a-1]?n.formats[t](e):"\\"!==t?t:""}).join("")},revFormat:{D:function(){},F:function(e,t){e.setMonth(this.l10n.months.longhand.indexOf(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t){var n=e.getHours();12!==n&&e.setHours(n%12+12*/pm/i.test(t))},M:function(e,t){e.setMonth(this.l10n.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(t)},U:function(e,t){return new Date(1e3*parseFloat(t))},W:function(e,t){return t=parseInt(t),new Date(e.getFullYear(),0,2+7*(t-1),0,0,0,0,0)},Y:function(e,t){e.setFullYear(t)},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours(parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:function(){},m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},w:function(){},y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},tokenRegex:{D:"(\\w+)",F:"(\\w+)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"(\\w+)",M:"(\\w+)",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"(\\w+)",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},pad:function(e){return("0"+e).slice(-2)},parseDate:function(e,t,n){if(!e)return null;var a=e;if(e instanceof Date)e=new Date(e.getTime()),e.fp_isUTC=a.fp_isUTC;else if(void 0!==e.toFixed)e=new Date(e);else{var i=t||(this.config||Flatpickr.defaultConfig).dateFormat;if("today"===(e=String(e).trim()))e=new Date,n=!0;else if(/Z$/.test(e)||/GMT$/.test(e))e=new Date(e);else if(this.config&&this.config.parseDate)e=this.config.parseDate(e,i);else{for(var r=this.config&&this.config.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0),o=void 0,l=0,c=0,s="";l<i.length;l++){var d=i[l],u="\\"===d,f="\\"===i[l-1]||u;if(this.tokenRegex[d]&&!f){s+=this.tokenRegex[d];var g=new RegExp(s).exec(e);g&&(o=!0)&&(r=this.revFormat[d](r,g[++c])||r)}else u||(s+=".")}e=o?r:null}}return e instanceof Date?(this.config&&this.config.utc&&!e.fp_isUTC&&(e=e.fp_toUTC()),!0===n&&e.setHours(0,0,0,0),e):(console.warn("flatpickr: invalid date "+a),console.info(this.element),null)}},"undefined"!=typeof HTMLElement&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return _flatpickr(this,e)},HTMLElement.prototype.flatpickr=function(e){return _flatpickr([this],e)}),"undefined"!=typeof jQuery&&(jQuery.fn.flatpickr=function(e){return _flatpickr(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+parseInt(e,10))},Date.prototype.fp_isUTC=!1,Date.prototype.fp_toUTC=function(){var e=new Date(this.getUTCFullYear(),this.getUTCMonth(),this.getUTCDate(),this.getUTCHours(),this.getUTCMinutes(),this.getUTCSeconds());return e.fp_isUTC=!0,e},"undefined"!=typeof module&&(module.exports=Flatpickr);