UNPKG

carbon-components-angular

Version:
2 lines 127 kB
/*! For license information please see 3360.e0c015fc.iframe.bundle.js.LICENSE.txt */ (self.webpackChunkcarbon_components_angular=self.webpackChunkcarbon_components_angular||[]).push([[3360],{"./node_modules/@carbon/utils-position/index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";var _a,PLACEMENTS;__webpack_require__.d(__webpack_exports__,{FK:()=>position,ZP:()=>__WEBPACK_DEFAULT_EXPORT__}),function(PLACEMENTS){PLACEMENTS.LEFT="left",PLACEMENTS.RIGHT="right",PLACEMENTS.TOP="top",PLACEMENTS.BOTTOM="bottom"}(PLACEMENTS||(PLACEMENTS={}));var defaultPositions=((_a={})[PLACEMENTS.LEFT]=function(referenceOffset,target,referenceRect){return{top:referenceOffset.top-Math.round(target.offsetHeight/2)+Math.round(referenceRect.height/2),left:Math.round(referenceOffset.left-target.offsetWidth)}},_a[PLACEMENTS.RIGHT]=function(referenceOffset,target,referenceRect){return{top:referenceOffset.top-Math.round(target.offsetHeight/2)+Math.round(referenceRect.height/2),left:Math.round(referenceOffset.left+referenceRect.width)}},_a[PLACEMENTS.TOP]=function(referenceOffset,target,referenceRect){return{top:Math.round(referenceOffset.top-target.offsetHeight),left:referenceOffset.left-Math.round(target.offsetWidth/2)+Math.round(referenceRect.width/2)}},_a[PLACEMENTS.BOTTOM]=function(referenceOffset,target,referenceRect){return{top:Math.round(referenceOffset.top+referenceRect.height),left:referenceOffset.left-Math.round(target.offsetWidth/2)+Math.round(referenceRect.width/2)}},_a),windowRef="undefined"!=typeof window?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},Position=function(){function Position(positions){void 0===positions&&(positions={}),this.positions=defaultPositions,this.positions=Object.assign({},defaultPositions,positions)}return Position.prototype.getRelativeOffset=function(target){for(var offsets={left:target.offsetLeft,top:target.offsetTop};target.offsetParent&&"static"===getComputedStyle(target.offsetParent).position;)offsets.left+=target.offsetLeft,offsets.top+=target.offsetTop,target=target.offsetParent;return offsets},Position.prototype.getAbsoluteOffset=function(target){for(var currentNode=target,margins={top:0,left:0};currentNode.offsetParent;){var computed=getComputedStyle(currentNode.offsetParent);"static"===computed.position&&computed.marginLeft&&computed.marginTop&&(parseInt(computed.marginTop,10)&&(margins.top+=parseInt(computed.marginTop,10)),parseInt(computed.marginLeft,10)&&(margins.left+=parseInt(computed.marginLeft,10))),currentNode=currentNode.offsetParent}var targetRect=target.getBoundingClientRect(),relativeRect=document.body.getBoundingClientRect();return{top:targetRect.top-relativeRect.top+margins.top,left:targetRect.left-relativeRect.left+margins.left}},Position.prototype.findRelative=function(reference,target,placement){var referenceOffset=this.getRelativeOffset(reference),referenceRect=reference.getBoundingClientRect();return this.calculatePosition(referenceOffset,referenceRect,target,placement)},Position.prototype.findAbsolute=function(reference,target,placement){var referenceOffset=this.getAbsoluteOffset(reference),referenceRect=reference.getBoundingClientRect();return this.calculatePosition(referenceOffset,referenceRect,target,placement)},Position.prototype.findPosition=function(reference,target,placement,offsetFunction){void 0===offsetFunction&&(offsetFunction=this.getAbsoluteOffset.bind(this));var referenceOffset=offsetFunction(reference),referenceRect=reference.getBoundingClientRect();return this.calculatePosition(referenceOffset,referenceRect,target,placement)},Position.prototype.findPositionAt=function(offset,target,placement){return this.calculatePosition(offset,{top:0,left:0,height:0,width:0},target,placement)},Position.prototype.getPlacementBox=function(target,position){var targetBottom=target.offsetHeight+position.top,targetRight=target.offsetWidth+position.left;return{top:position.top,bottom:targetBottom,left:position.left,right:targetRight}},Position.prototype.addOffset=function(position,top,left){return void 0===top&&(top=0),void 0===left&&(left=0),Object.assign({},position,{top:position.top+top,left:position.left+left})},Position.prototype.setElement=function(element,position){element.style.top=position.top+"px",element.style.left=position.left+"px"},Position.prototype.findBestPlacement=function(reference,target,placements,containerFunction,positionFunction){var _this=this;void 0===containerFunction&&(containerFunction=this.defaultContainerFunction.bind(this)),void 0===positionFunction&&(positionFunction=this.findPosition.bind(this));var weightedPlacements=placements.map((function(placement){var pos=positionFunction(reference,target,placement),box=_this.getPlacementBox(target,pos),hiddenHeight=0,hiddenWidth=0,container=containerFunction();box.top<container.top?hiddenHeight=container.top-box.top:box.bottom>container.height&&(hiddenHeight=box.bottom-container.height),box.left<container.left?hiddenWidth=container.left-box.left:box.right>container.width&&(hiddenWidth=box.right-container.width),hiddenHeight&&!hiddenWidth?hiddenWidth=1:hiddenWidth&&!hiddenHeight&&(hiddenHeight=1);var area=target.offsetHeight*target.offsetWidth;return{placement,weight:(area-hiddenHeight*hiddenWidth)/area}}));return weightedPlacements.sort((function(a,b){return b.weight-a.weight})),weightedPlacements[0].placement},Position.prototype.findBestPlacementAt=function(offset,target,placements,containerFunction){var _this=this;void 0===containerFunction&&(containerFunction=this.defaultContainerFunction.bind(this));return this.findBestPlacement(null,target,placements,containerFunction,(function(_,target,placement){return _this.findPositionAt(offset,target,placement)}))},Position.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:windowRef.innerHeight,width:windowRef.innerWidth}},Position.prototype.calculatePosition=function(referenceOffset,referenceRect,target,placement){return this.positions[placement]?this.positions[placement](referenceOffset,target,referenceRect):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},Position}(),position=new Position;const __WEBPACK_DEFAULT_EXPORT__=Position},"./node_modules/flatpickr/dist/esm/index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>esm});var HOOKS=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],defaults={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(err){return"undefined"!=typeof console&&console.warn(err)},getWeek:function(givenDate){var date=new Date(givenDate.getTime());date.setHours(0,0,0,0),date.setDate(date.getDate()+3-(date.getDay()+6)%7);var week1=new Date(date.getFullYear(),0,4);return 1+Math.round(((date.getTime()-week1.getTime())/864e5-3+(week1.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",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>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,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>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},english={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(nth){var s=nth%100;if(s>3&&s<21)return"th";switch(s%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",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1};const l10n_default=english;var pad=function(number,length){return void 0===length&&(length=2),("000"+number).slice(-1*length)},utils_int=function(bool){return!0===bool?1:0};function debounce(fn,wait){var t;return function(){var _this=this,args=arguments;clearTimeout(t),t=setTimeout((function(){return fn.apply(_this,args)}),wait)}}var arrayify=function(obj){return obj instanceof Array?obj:[obj]};function toggleClass(elem,className,bool){if(!0===bool)return elem.classList.add(className);elem.classList.remove(className)}function createElement(tag,className,content){var e=window.document.createElement(tag);return className=className||"",content=content||"",e.className=className,void 0!==content&&(e.textContent=content),e}function clearNode(node){for(;node.firstChild;)node.removeChild(node.firstChild)}function findParent(node,condition){return condition(node)?node:node.parentNode?findParent(node.parentNode,condition):void 0}function createNumberInput(inputClassName,opts){var wrapper=createElement("div","numInputWrapper"),numInput=createElement("input","numInput "+inputClassName),arrowUp=createElement("span","arrowUp"),arrowDown=createElement("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?numInput.type="number":(numInput.type="text",numInput.pattern="\\d*"),void 0!==opts)for(var key in opts)numInput.setAttribute(key,opts[key]);return wrapper.appendChild(numInput),wrapper.appendChild(arrowUp),wrapper.appendChild(arrowDown),wrapper}function getEventTarget(event){try{return"function"==typeof event.composedPath?event.composedPath()[0]:event.target}catch(error){return event.target}}var doNothing=function(){},monthToStr=function(monthNumber,shorthand,locale){return locale.months[shorthand?"shorthand":"longhand"][monthNumber]},revFormat={D:doNothing,F:function(dateObj,monthName,locale){dateObj.setMonth(locale.months.longhand.indexOf(monthName))},G:function(dateObj,hour){dateObj.setHours((dateObj.getHours()>=12?12:0)+parseFloat(hour))},H:function(dateObj,hour){dateObj.setHours(parseFloat(hour))},J:function(dateObj,day){dateObj.setDate(parseFloat(day))},K:function(dateObj,amPM,locale){dateObj.setHours(dateObj.getHours()%12+12*utils_int(new RegExp(locale.amPM[1],"i").test(amPM)))},M:function(dateObj,shortMonth,locale){dateObj.setMonth(locale.months.shorthand.indexOf(shortMonth))},S:function(dateObj,seconds){dateObj.setSeconds(parseFloat(seconds))},U:function(_,unixSeconds){return new Date(1e3*parseFloat(unixSeconds))},W:function(dateObj,weekNum,locale){var weekNumber=parseInt(weekNum),date=new Date(dateObj.getFullYear(),0,2+7*(weekNumber-1),0,0,0,0);return date.setDate(date.getDate()-date.getDay()+locale.firstDayOfWeek),date},Y:function(dateObj,year){dateObj.setFullYear(parseFloat(year))},Z:function(_,ISODate){return new Date(ISODate)},d:function(dateObj,day){dateObj.setDate(parseFloat(day))},h:function(dateObj,hour){dateObj.setHours((dateObj.getHours()>=12?12:0)+parseFloat(hour))},i:function(dateObj,minutes){dateObj.setMinutes(parseFloat(minutes))},j:function(dateObj,day){dateObj.setDate(parseFloat(day))},l:doNothing,m:function(dateObj,month){dateObj.setMonth(parseFloat(month)-1)},n:function(dateObj,month){dateObj.setMonth(parseFloat(month)-1)},s:function(dateObj,seconds){dateObj.setSeconds(parseFloat(seconds))},u:function(_,unixMillSeconds){return new Date(parseFloat(unixMillSeconds))},w:doNothing,y:function(dateObj,year){dateObj.setFullYear(2e3+parseFloat(year))}},tokenRegex={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",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:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},formats={Z:function(date){return date.toISOString()},D:function(date,locale,options){return locale.weekdays.shorthand[formats.w(date,locale,options)]},F:function(date,locale,options){return monthToStr(formats.n(date,locale,options)-1,!1,locale)},G:function(date,locale,options){return pad(formats.h(date,locale,options))},H:function(date){return pad(date.getHours())},J:function(date,locale){return void 0!==locale.ordinal?date.getDate()+locale.ordinal(date.getDate()):date.getDate()},K:function(date,locale){return locale.amPM[utils_int(date.getHours()>11)]},M:function(date,locale){return monthToStr(date.getMonth(),!0,locale)},S:function(date){return pad(date.getSeconds())},U:function(date){return date.getTime()/1e3},W:function(date,_,options){return options.getWeek(date)},Y:function(date){return pad(date.getFullYear(),4)},d:function(date){return pad(date.getDate())},h:function(date){return date.getHours()%12?date.getHours()%12:12},i:function(date){return pad(date.getMinutes())},j:function(date){return date.getDate()},l:function(date,locale){return locale.weekdays.longhand[date.getDay()]},m:function(date){return pad(date.getMonth()+1)},n:function(date){return date.getMonth()+1},s:function(date){return date.getSeconds()},u:function(date){return date.getTime()},w:function(date){return date.getDay()},y:function(date){return String(date.getFullYear()).substring(2)}},createDateFormatter=function(_a){var _b=_a.config,config=void 0===_b?defaults:_b,_c=_a.l10n,l10n=void 0===_c?english:_c,_d=_a.isMobile,isMobile=void 0!==_d&&_d;return function(dateObj,frmt,overrideLocale){var locale=overrideLocale||l10n;return void 0===config.formatDate||isMobile?frmt.split("").map((function(c,i,arr){return formats[c]&&"\\"!==arr[i-1]?formats[c](dateObj,locale,config):"\\"!==c?c:""})).join(""):config.formatDate(dateObj,frmt,locale)}},createDateParser=function(_a){var _b=_a.config,config=void 0===_b?defaults:_b,_c=_a.l10n,l10n=void 0===_c?english:_c;return function(date,givenFormat,timeless,customLocale){if(0===date||date){var parsedDate,locale=customLocale||l10n,dateOrig=date;if(date instanceof Date)parsedDate=new Date(date.getTime());else if("string"!=typeof date&&void 0!==date.toFixed)parsedDate=new Date(date);else if("string"==typeof date){var format=givenFormat||(config||defaults).dateFormat,datestr=String(date).trim();if("today"===datestr)parsedDate=new Date,timeless=!0;else if(config&&config.parseDate)parsedDate=config.parseDate(date,format);else if(/Z$/.test(datestr)||/GMT$/.test(datestr))parsedDate=new Date(date);else{for(var matched=void 0,ops=[],i=0,matchIndex=0,regexStr="";i<format.length;i++){var token=format[i],isBackSlash="\\"===token,escaped="\\"===format[i-1]||isBackSlash;if(tokenRegex[token]&&!escaped){regexStr+=tokenRegex[token];var match=new RegExp(regexStr).exec(date);match&&(matched=!0)&&ops["Y"!==token?"push":"unshift"]({fn:revFormat[token],val:match[++matchIndex]})}else isBackSlash||(regexStr+=".")}parsedDate=config&&config.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0),ops.forEach((function(_a){var fn=_a.fn,val=_a.val;return parsedDate=fn(parsedDate,val,locale)||parsedDate})),parsedDate=matched?parsedDate:void 0}}if(parsedDate instanceof Date&&!isNaN(parsedDate.getTime()))return!0===timeless&&parsedDate.setHours(0,0,0,0),parsedDate;config.errorHandler(new Error("Invalid date provided: "+dateOrig))}}};function compareDates(date1,date2,timeless){return void 0===timeless&&(timeless=!0),!1!==timeless?new Date(date1.getTime()).setHours(0,0,0,0)-new Date(date2.getTime()).setHours(0,0,0,0):date1.getTime()-date2.getTime()}var calculateSecondsSinceMidnight=function(hours,minutes,seconds){return 3600*hours+60*minutes+seconds},duration_DAY=864e5;function getDefaultHours(config){var hours=config.defaultHour,minutes=config.defaultMinute,seconds=config.defaultSeconds;if(void 0!==config.minDate){var minHour=config.minDate.getHours(),minMinutes=config.minDate.getMinutes(),minSeconds=config.minDate.getSeconds();hours<minHour&&(hours=minHour),hours===minHour&&minutes<minMinutes&&(minutes=minMinutes),hours===minHour&&minutes===minMinutes&&seconds<minSeconds&&(seconds=config.minDate.getSeconds())}if(void 0!==config.maxDate){var maxHr=config.maxDate.getHours(),maxMinutes=config.maxDate.getMinutes();(hours=Math.min(hours,maxHr))===maxHr&&(minutes=Math.min(maxMinutes,minutes)),hours===maxHr&&minutes===maxMinutes&&(seconds=config.maxDate.getSeconds())}return{hours,minutes,seconds}}__webpack_require__("./node_modules/flatpickr/dist/esm/utils/polyfills.js");var __assign=function(){return __assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},__assign.apply(this,arguments)},__spreadArrays=function(){for(var s=0,i=0,il=arguments.length;i<il;i++)s+=arguments[i].length;var r=Array(s),k=0;for(i=0;i<il;i++)for(var a=arguments[i],j=0,jl=a.length;j<jl;j++,k++)r[k]=a[j];return r};function FlatpickrInstance(element,instanceConfig){var self={config:__assign(__assign({},defaults),flatpickr.defaultConfig),l10n:l10n_default};function getClosestActiveElement(){var _a;return(null===(_a=self.calendarContainer)||void 0===_a?void 0:_a.getRootNode()).activeElement||document.activeElement}function bindToInstance(fn){return fn.bind(self)}function setCalendarWidth(){var config=self.config;!1===config.weekNumbers&&1===config.showMonths||!0!==config.noCalendar&&window.requestAnimationFrame((function(){if(void 0!==self.calendarContainer&&(self.calendarContainer.style.visibility="hidden",self.calendarContainer.style.display="block"),void 0!==self.daysContainer){var daysWidth=(self.days.offsetWidth+1)*config.showMonths;self.daysContainer.style.width=daysWidth+"px",self.calendarContainer.style.width=daysWidth+(void 0!==self.weekWrapper?self.weekWrapper.offsetWidth:0)+"px",self.calendarContainer.style.removeProperty("visibility"),self.calendarContainer.style.removeProperty("display")}}))}function updateTime(e){if(0===self.selectedDates.length){var defaultDate=void 0===self.config.minDate||compareDates(new Date,self.config.minDate)>=0?new Date:new Date(self.config.minDate.getTime()),defaults=getDefaultHours(self.config);defaultDate.setHours(defaults.hours,defaults.minutes,defaults.seconds,defaultDate.getMilliseconds()),self.selectedDates=[defaultDate],self.latestSelectedDateObj=defaultDate}void 0!==e&&"blur"!==e.type&&function timeWrapper(e){e.preventDefault();var isKeyDown="keydown"===e.type,eventTarget=getEventTarget(e),input=eventTarget;void 0!==self.amPM&&eventTarget===self.amPM&&(self.amPM.textContent=self.l10n.amPM[utils_int(self.amPM.textContent===self.l10n.amPM[0])]);var min=parseFloat(input.getAttribute("min")),max=parseFloat(input.getAttribute("max")),step=parseFloat(input.getAttribute("step")),curValue=parseInt(input.value,10),delta=e.delta||(isKeyDown?38===e.which?1:-1:0),newValue=curValue+step*delta;if(void 0!==input.value&&2===input.value.length){var isHourElem=input===self.hourElement,isMinuteElem=input===self.minuteElement;newValue<min?(newValue=max+newValue+utils_int(!isHourElem)+(utils_int(isHourElem)&&utils_int(!self.amPM)),isMinuteElem&&incrementNumInput(void 0,-1,self.hourElement)):newValue>max&&(newValue=input===self.hourElement?newValue-max-utils_int(!self.amPM):min,isMinuteElem&&incrementNumInput(void 0,1,self.hourElement)),self.amPM&&isHourElem&&(1===step?newValue+curValue===23:Math.abs(newValue-curValue)>step)&&(self.amPM.textContent=self.l10n.amPM[utils_int(self.amPM.textContent===self.l10n.amPM[0])]),input.value=pad(newValue)}}(e);var prevValue=self._input.value;setHoursFromInputs(),updateValue(),self._input.value!==prevValue&&self._debouncedChange()}function setHoursFromInputs(){if(void 0!==self.hourElement&&void 0!==self.minuteElement){var hours=(parseInt(self.hourElement.value.slice(-2),10)||0)%24,minutes=(parseInt(self.minuteElement.value,10)||0)%60,seconds=void 0!==self.secondElement?(parseInt(self.secondElement.value,10)||0)%60:0;void 0!==self.amPM&&(hours=function ampm2military(hour,amPM){return hour%12+12*utils_int(amPM===self.l10n.amPM[1])}(hours,self.amPM.textContent));var limitMinHours=void 0!==self.config.minTime||self.config.minDate&&self.minDateHasTime&&self.latestSelectedDateObj&&0===compareDates(self.latestSelectedDateObj,self.config.minDate,!0),limitMaxHours=void 0!==self.config.maxTime||self.config.maxDate&&self.maxDateHasTime&&self.latestSelectedDateObj&&0===compareDates(self.latestSelectedDateObj,self.config.maxDate,!0);if(void 0!==self.config.maxTime&&void 0!==self.config.minTime&&self.config.minTime>self.config.maxTime){var minBound=calculateSecondsSinceMidnight(self.config.minTime.getHours(),self.config.minTime.getMinutes(),self.config.minTime.getSeconds()),maxBound=calculateSecondsSinceMidnight(self.config.maxTime.getHours(),self.config.maxTime.getMinutes(),self.config.maxTime.getSeconds()),currentTime=calculateSecondsSinceMidnight(hours,minutes,seconds);if(currentTime>maxBound&&currentTime<minBound){var result=function(secondsSinceMidnight){var hours=Math.floor(secondsSinceMidnight/3600),minutes=(secondsSinceMidnight-3600*hours)/60;return[hours,minutes,secondsSinceMidnight-3600*hours-60*minutes]}(minBound);hours=result[0],minutes=result[1],seconds=result[2]}}else{if(limitMaxHours){var maxTime=void 0!==self.config.maxTime?self.config.maxTime:self.config.maxDate;(hours=Math.min(hours,maxTime.getHours()))===maxTime.getHours()&&(minutes=Math.min(minutes,maxTime.getMinutes())),minutes===maxTime.getMinutes()&&(seconds=Math.min(seconds,maxTime.getSeconds()))}if(limitMinHours){var minTime=void 0!==self.config.minTime?self.config.minTime:self.config.minDate;(hours=Math.max(hours,minTime.getHours()))===minTime.getHours()&&minutes<minTime.getMinutes()&&(minutes=minTime.getMinutes()),minutes===minTime.getMinutes()&&(seconds=Math.max(seconds,minTime.getSeconds()))}}setHours(hours,minutes,seconds)}}function setHoursFromDate(dateObj){var date=dateObj||self.latestSelectedDateObj;date&&date instanceof Date&&setHours(date.getHours(),date.getMinutes(),date.getSeconds())}function setHours(hours,minutes,seconds){void 0!==self.latestSelectedDateObj&&self.latestSelectedDateObj.setHours(hours%24,minutes,seconds||0,0),self.hourElement&&self.minuteElement&&!self.isMobile&&(self.hourElement.value=pad(self.config.time_24hr?hours:(12+hours)%12+12*utils_int(hours%12==0)),self.minuteElement.value=pad(minutes),void 0!==self.amPM&&(self.amPM.textContent=self.l10n.amPM[utils_int(hours>=12)]),void 0!==self.secondElement&&(self.secondElement.value=pad(seconds)))}function onYearInput(event){var eventTarget=getEventTarget(event),year=parseInt(eventTarget.value)+(event.delta||0);(year/1e3>1||"Enter"===event.key&&!/[^\d]/.test(year.toString()))&&changeYear(year)}function bind(element,event,handler,options){return event instanceof Array?event.forEach((function(ev){return bind(element,ev,handler,options)})):element instanceof Array?element.forEach((function(el){return bind(el,event,handler,options)})):(element.addEventListener(event,handler,options),void self._handlers.push({remove:function(){return element.removeEventListener(event,handler,options)}}))}function triggerChange(){triggerEvent("onChange")}function jumpToDate(jumpDate,triggerChange){var jumpTo=void 0!==jumpDate?self.parseDate(jumpDate):self.latestSelectedDateObj||(self.config.minDate&&self.config.minDate>self.now?self.config.minDate:self.config.maxDate&&self.config.maxDate<self.now?self.config.maxDate:self.now),oldYear=self.currentYear,oldMonth=self.currentMonth;try{void 0!==jumpTo&&(self.currentYear=jumpTo.getFullYear(),self.currentMonth=jumpTo.getMonth())}catch(e){e.message="Invalid date supplied: "+jumpTo,self.config.errorHandler(e)}triggerChange&&self.currentYear!==oldYear&&(triggerEvent("onYearChange"),buildMonthSwitch()),!triggerChange||self.currentYear===oldYear&&self.currentMonth===oldMonth||triggerEvent("onMonthChange"),self.redraw()}function timeIncrement(e){var eventTarget=getEventTarget(e);~eventTarget.className.indexOf("arrow")&&incrementNumInput(e,eventTarget.classList.contains("arrowUp")?1:-1)}function incrementNumInput(e,delta,inputElem){var target=e&&getEventTarget(e),input=inputElem||target&&target.parentNode&&target.parentNode.firstChild,event=createEvent("increment");event.delta=delta,input&&input.dispatchEvent(event)}function createDay(className,date,_dayNumber,i){var dateIsEnabled=isEnabled(date,!0),dayElement=createElement("span",className,date.getDate().toString());return dayElement.dateObj=date,dayElement.$i=i,dayElement.setAttribute("aria-label",self.formatDate(date,self.config.ariaDateFormat)),-1===className.indexOf("hidden")&&0===compareDates(date,self.now)&&(self.todayDateElem=dayElement,dayElement.classList.add("today"),dayElement.setAttribute("aria-current","date")),dateIsEnabled?(dayElement.tabIndex=-1,isDateSelected(date)&&(dayElement.classList.add("selected"),self.selectedDateElem=dayElement,"range"===self.config.mode&&(toggleClass(dayElement,"startRange",self.selectedDates[0]&&0===compareDates(date,self.selectedDates[0],!0)),toggleClass(dayElement,"endRange",self.selectedDates[1]&&0===compareDates(date,self.selectedDates[1],!0)),"nextMonthDay"===className&&dayElement.classList.add("inRange")))):dayElement.classList.add("flatpickr-disabled"),"range"===self.config.mode&&function isDateInRange(date){return!("range"!==self.config.mode||self.selectedDates.length<2)&&(compareDates(date,self.selectedDates[0])>=0&&compareDates(date,self.selectedDates[1])<=0)}(date)&&!isDateSelected(date)&&dayElement.classList.add("inRange"),self.weekNumbers&&1===self.config.showMonths&&"prevMonthDay"!==className&&i%7==6&&self.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+self.config.getWeek(date)+"</span>"),triggerEvent("onDayCreate",dayElement),dayElement}function focusOnDayElem(targetNode){targetNode.focus(),"range"===self.config.mode&&onMouseOver(targetNode)}function getFirstAvailableDay(delta){for(var startMonth=delta>0?0:self.config.showMonths-1,endMonth=delta>0?self.config.showMonths:-1,m=startMonth;m!=endMonth;m+=delta)for(var month=self.daysContainer.children[m],startIndex=delta>0?0:month.children.length-1,endIndex=delta>0?month.children.length:-1,i=startIndex;i!=endIndex;i+=delta){var c=month.children[i];if(-1===c.className.indexOf("hidden")&&isEnabled(c.dateObj))return c}}function focusOnDay(current,offset){var activeElement=getClosestActiveElement(),dayFocused=isInView(activeElement||document.body),startElem=void 0!==current?current:dayFocused?activeElement:void 0!==self.selectedDateElem&&isInView(self.selectedDateElem)?self.selectedDateElem:void 0!==self.todayDateElem&&isInView(self.todayDateElem)?self.todayDateElem:getFirstAvailableDay(offset>0?1:-1);void 0===startElem?self._input.focus():dayFocused?function getNextAvailableDay(current,delta){for(var givenMonth=-1===current.className.indexOf("Month")?current.dateObj.getMonth():self.currentMonth,endMonth=delta>0?self.config.showMonths:-1,loopDelta=delta>0?1:-1,m=givenMonth-self.currentMonth;m!=endMonth;m+=loopDelta)for(var month=self.daysContainer.children[m],startIndex=givenMonth-self.currentMonth===m?current.$i+delta:delta<0?month.children.length-1:0,numMonthDays=month.children.length,i=startIndex;i>=0&&i<numMonthDays&&i!=(delta>0?numMonthDays:-1);i+=loopDelta){var c=month.children[i];if(-1===c.className.indexOf("hidden")&&isEnabled(c.dateObj)&&Math.abs(current.$i-i)>=Math.abs(delta))return focusOnDayElem(c)}self.changeMonth(loopDelta),focusOnDay(getFirstAvailableDay(loopDelta),0)}(startElem,offset):focusOnDayElem(startElem)}function buildMonthDays(year,month){for(var firstOfMonth=(new Date(year,month,1).getDay()-self.l10n.firstDayOfWeek+7)%7,prevMonthDays=self.utils.getDaysInMonth((month-1+12)%12,year),daysInMonth=self.utils.getDaysInMonth(month,year),days=window.document.createDocumentFragment(),isMultiMonth=self.config.showMonths>1,prevMonthDayClass=isMultiMonth?"prevMonthDay hidden":"prevMonthDay",nextMonthDayClass=isMultiMonth?"nextMonthDay hidden":"nextMonthDay",dayNumber=prevMonthDays+1-firstOfMonth,dayIndex=0;dayNumber<=prevMonthDays;dayNumber++,dayIndex++)days.appendChild(createDay("flatpickr-day "+prevMonthDayClass,new Date(year,month-1,dayNumber),0,dayIndex));for(dayNumber=1;dayNumber<=daysInMonth;dayNumber++,dayIndex++)days.appendChild(createDay("flatpickr-day",new Date(year,month,dayNumber),0,dayIndex));for(var dayNum=daysInMonth+1;dayNum<=42-firstOfMonth&&(1===self.config.showMonths||dayIndex%7!=0);dayNum++,dayIndex++)days.appendChild(createDay("flatpickr-day "+nextMonthDayClass,new Date(year,month+1,dayNum%daysInMonth),0,dayIndex));var dayContainer=createElement("div","dayContainer");return dayContainer.appendChild(days),dayContainer}function buildDays(){if(void 0!==self.daysContainer){clearNode(self.daysContainer),self.weekNumbers&&clearNode(self.weekNumbers);for(var frag=document.createDocumentFragment(),i=0;i<self.config.showMonths;i++){var d=new Date(self.currentYear,self.currentMonth,1);d.setMonth(self.currentMonth+i),frag.appendChild(buildMonthDays(d.getFullYear(),d.getMonth()))}self.daysContainer.appendChild(frag),self.days=self.daysContainer.firstChild,"range"===self.config.mode&&1===self.selectedDates.length&&onMouseOver()}}function buildMonthSwitch(){if(!(self.config.showMonths>1||"dropdown"!==self.config.monthSelectorType)){var shouldBuildMonth=function(month){return!(void 0!==self.config.minDate&&self.currentYear===self.config.minDate.getFullYear()&&month<self.config.minDate.getMonth())&&!(void 0!==self.config.maxDate&&self.currentYear===self.config.maxDate.getFullYear()&&month>self.config.maxDate.getMonth())};self.monthsDropdownContainer.tabIndex=-1,self.monthsDropdownContainer.innerHTML="";for(var i=0;i<12;i++)if(shouldBuildMonth(i)){var month=createElement("option","flatpickr-monthDropdown-month");month.value=new Date(self.currentYear,i).getMonth().toString(),month.textContent=monthToStr(i,self.config.shorthandCurrentMonth,self.l10n),month.tabIndex=-1,self.currentMonth===i&&(month.selected=!0),self.monthsDropdownContainer.appendChild(month)}}}function buildMonth(){var monthElement,container=createElement("div","flatpickr-month"),monthNavFragment=window.document.createDocumentFragment();self.config.showMonths>1||"static"===self.config.monthSelectorType?monthElement=createElement("span","cur-month"):(self.monthsDropdownContainer=createElement("select","flatpickr-monthDropdown-months"),self.monthsDropdownContainer.setAttribute("aria-label",self.l10n.monthAriaLabel),bind(self.monthsDropdownContainer,"change",(function(e){var target=getEventTarget(e),selectedMonth=parseInt(target.value,10);self.changeMonth(selectedMonth-self.currentMonth),triggerEvent("onMonthChange")})),buildMonthSwitch(),monthElement=self.monthsDropdownContainer);var yearInput=createNumberInput("cur-year",{tabindex:"-1"}),yearElement=yearInput.getElementsByTagName("input")[0];yearElement.setAttribute("aria-label",self.l10n.yearAriaLabel),self.config.minDate&&yearElement.setAttribute("min",self.config.minDate.getFullYear().toString()),self.config.maxDate&&(yearElement.setAttribute("max",self.config.maxDate.getFullYear().toString()),yearElement.disabled=!!self.config.minDate&&self.config.minDate.getFullYear()===self.config.maxDate.getFullYear());var currentMonth=createElement("div","flatpickr-current-month");return currentMonth.appendChild(monthElement),currentMonth.appendChild(yearInput),monthNavFragment.appendChild(currentMonth),container.appendChild(monthNavFragment),{container,yearElement,monthElement}}function buildMonths(){clearNode(self.monthNav),self.monthNav.appendChild(self.prevMonthNav),self.config.showMonths&&(self.yearElements=[],self.monthElements=[]);for(var m=self.config.showMonths;m--;){var month=buildMonth();self.yearElements.push(month.yearElement),self.monthElements.push(month.monthElement),self.monthNav.appendChild(month.container)}self.monthNav.appendChild(self.nextMonthNav)}function buildWeekdays(){self.weekdayContainer?clearNode(self.weekdayContainer):self.weekdayContainer=createElement("div","flatpickr-weekdays");for(var i=self.config.showMonths;i--;){var container=createElement("div","flatpickr-weekdaycontainer");self.weekdayContainer.appendChild(container)}return updateWeekdays(),self.weekdayContainer}function updateWeekdays(){if(self.weekdayContainer){var firstDayOfWeek=self.l10n.firstDayOfWeek,weekdays=__spreadArrays(self.l10n.weekdays.shorthand);firstDayOfWeek>0&&firstDayOfWeek<weekdays.length&&(weekdays=__spreadArrays(weekdays.splice(firstDayOfWeek,weekdays.length),weekdays.splice(0,firstDayOfWeek)));for(var i=self.config.showMonths;i--;)self.weekdayContainer.children[i].innerHTML="\n <span class='flatpickr-weekday'>\n "+weekdays.join("</span><span class='flatpickr-weekday'>")+"\n </span>\n "}}function changeMonth(value,isOffset){void 0===isOffset&&(isOffset=!0);var delta=isOffset?value:value-self.currentMonth;delta<0&&!0===self._hidePrevMonthArrow||delta>0&&!0===self._hideNextMonthArrow||(self.currentMonth+=delta,(self.currentMonth<0||self.currentMonth>11)&&(self.currentYear+=self.currentMonth>11?1:-1,self.currentMonth=(self.currentMonth+12)%12,triggerEvent("onYearChange"),buildMonthSwitch()),buildDays(),triggerEvent("onMonthChange"),updateNavigationCurrentMonth())}function isCalendarElem(elem){return self.calendarContainer.contains(elem)}function documentClick(e){if(self.isOpen&&!self.config.inline){var eventTarget_1=getEventTarget(e),isCalendarElement=isCalendarElem(eventTarget_1),lostFocus=!(eventTarget_1===self.input||eventTarget_1===self.altInput||self.element.contains(eventTarget_1)||e.path&&e.path.indexOf&&(~e.path.indexOf(self.input)||~e.path.indexOf(self.altInput)))&&!isCalendarElement&&!isCalendarElem(e.relatedTarget),isIgnored=!self.config.ignoredFocusElements.some((function(elem){return elem.contains(eventTarget_1)}));lostFocus&&isIgnored&&(self.config.allowInput&&self.setDate(self._input.value,!1,self.config.altInput?self.config.altFormat:self.config.dateFormat),void 0!==self.timeContainer&&void 0!==self.minuteElement&&void 0!==self.hourElement&&""!==self.input.value&&void 0!==self.input.value&&updateTime(),self.close(),self.config&&"range"===self.config.mode&&1===self.selectedDates.length&&self.clear(!1))}}function changeYear(newYear){if(!(!newYear||self.config.minDate&&newYear<self.config.minDate.getFullYear()||self.config.maxDate&&newYear>self.config.maxDate.getFullYear())){var newYearNum=newYear,isNewYear=self.currentYear!==newYearNum;self.currentYear=newYearNum||self.currentYear,self.config.maxDate&&self.currentYear===self.config.maxDate.getFullYear()?self.currentMonth=Math.min(self.config.maxDate.getMonth(),self.currentMonth):self.config.minDate&&self.currentYear===self.config.minDate.getFullYear()&&(self.currentMonth=Math.max(self.config.minDate.getMonth(),self.currentMonth)),isNewYear&&(self.redraw(),triggerEvent("onYearChange"),buildMonthSwitch())}}function isEnabled(date,timeless){var _a;void 0===timeless&&(timeless=!0);var dateToCheck=self.parseDate(date,void 0,timeless);if(self.config.minDate&&dateToCheck&&compareDates(dateToCheck,self.config.minDate,void 0!==timeless?timeless:!self.minDateHasTime)<0||self.config.maxDate&&dateToCheck&&compareDates(dateToCheck,self.config.maxDate,void 0!==timeless?timeless:!self.maxDateHasTime)>0)return!1;if(!self.config.enable&&0===self.config.disable.length)return!0;if(void 0===dateToCheck)return!1;for(var bool=!!self.config.enable,array=null!==(_a=self.config.enable)&&void 0!==_a?_a:self.config.disable,i=0,d=void 0;i<array.length;i++){if("function"==typeof(d=array[i])&&d(dateToCheck))return bool;if(d instanceof Date&&void 0!==dateToCheck&&d.getTime()===dateToCheck.getTime())return bool;if("string"==typeof d){var parsed=self.parseDate(d,void 0,!0);return parsed&&parsed.getTime()===dateToCheck.getTime()?bool:!bool}if("object"==typeof d&&void 0!==dateToCheck&&d.from&&d.to&&dateToCheck.getTime()>=d.from.getTime()&&dateToCheck.getTime()<=d.to.getTime())return bool}return!bool}function isInView(elem){return void 0!==self.daysContainer&&(-1===elem.className.indexOf("hidden")&&-1===elem.className.indexOf("flatpickr-disabled")&&self.daysContainer.contains(elem))}function onBlur(e){var isInput=e.target===self._input,valueChanged=self._input.value.trimEnd()!==getDateStr();!isInput||!valueChanged||e.relatedTarget&&isCalendarElem(e.relatedTarget)||self.setDate(self._input.value,!0,e.target===self.altInput?self.config.altFormat:self.config.dateFormat)}function onKeyDown(e){var eventTarget=getEventTarget(e),isInput=self.config.wrap?element.contains(eventTarget):eventTarget===self._input,allowInput=self.config.allowInput,allowKeydown=self.isOpen&&(!allowInput||!isInput),allowInlineKeydown=self.config.inline&&isInput&&!allowInput;if(13===e.keyCode&&isInput){if(allowInput)return self.setDate(self._input.value,!0,eventTarget===self.altInput?self.config.altFormat:self.config.dateFormat),self.close(),eventTarget.blur();self.open()}else if(isCalendarElem(eventTarget)||allowKeydown||allowInlineKeydown){var isTimeObj=!!self.timeContainer&&self.timeContainer.contains(eventTarget);switch(e.keyCode){case 13:isTimeObj?(e.preventDefault(),updateTime(),focusAndClose()):selectDate(e);break;case 27:e.preventDefault(),focusAndClose();break;case 8:case 46:isInput&&!self.config.allowInput&&(e.preventDefault(),self.clear());break;case 37:case 39:if(isTimeObj||isInput)self.hourElement&&self.hourElement.focus();else{e.preventDefault();var activeElement=getClosestActiveElement();if(void 0!==self.daysContainer&&(!1===allowInput||activeElement&&isInView(activeElement))){var delta_1=39===e.keyCode?1:-1;e.ctrlKey?(e.stopPropagation(),changeMonth(delta_1),focusOnDay(getFirstAvailableDay(1),0)):focusOnDay(void 0,delta_1)}}break;case 38:case 40:e.preventDefault();var delta=40===e.keyCode?1:-1;self.daysContainer&&void 0!==eventTarget.$i||eventTarget===self.input||eventTarget===self.altInput?e.ctrlKey?(e.stopPropagation(),changeYear(self.currentYear-delta),focusOnDay(getFirstAvailableDay(1),0)):isTimeObj||focusOnDay(void 0,7*delta):eventTarget===self.currentYearElement?changeYear(self.currentYear-delta):self.config.enableTime&&(!isTimeObj&&self.hourElement&&self.hourElement.focus(),updateTime(e),self._debouncedChange());break;case 9:if(isTimeObj){var elems=[self.hourElement,self.minuteElement,self.secondElement,self.amPM].concat(self.pluginElements).filter((function(x){return x})),i=elems.indexOf(eventTarget);if(-1!==i){var target=elems[i+(e.shiftKey?-1:1)];e.preventDefault(),(target||self._input).focus()}}else!self.config.noCalendar&&self.daysContainer&&self.daysContainer.contains(eventTarget)&&e.shiftKey&&(e.preventDefault(),self._input.focus())}}if(void 0!==self.amPM&&eventTarget===self.amPM)switch(e.key){case self.l10n.amPM[0].charAt(0):case self.l10n.amPM[0].charAt(0).toLowerCase():self.amPM.textContent=self.l10n.amPM[0],setHoursFromInputs(),updateValue();break;case self.l10n.amPM[1].charAt(0):case self.l10n.amPM[1].charAt(0).toLowerCase():self.amPM.textContent=self.l10n.amPM[1],setHoursFromInputs(),updateValue()}(isInput||isCalendarElem(eventTarget))&&triggerEvent("onKeyDown",e)}function onMouseOver(elem,cellClass){if(void 0===cellClass&&(cellClass="flatpickr-day"),1===self.selectedDates.length&&(!elem||elem.classList.contains(cellClass)&&!elem.classList.contains("flatpickr-disabled"))){for(var hoverDate=elem?elem.dateObj.getTime():self.days.firstElementChild.dateObj.getTime(),initialDate=self.parseDate(self.selectedDates[0],void 0,!0).getTime(),rangeStartDate=Math.min(hoverDate,self.selectedDates[0].getTime()),rangeEndDate=Math.max(hoverDate,self.selectedDates[0].getTime()),containsDisabled=!1,minRange=0,maxRange=0,t=rangeStartDate;t<rangeEndDate;t+=duration_DAY)isEnabled(new Date(t),!0)||(containsDisabled=containsDisabled||t>rangeStartDate&&t<rangeEndDate,t<initialDate&&(!minRange||t>minRange)?minRange=t:t>initialDate&&(!maxRange||t<maxRange)&&(maxRange=t));Array.from(self.rContainer.querySelectorAll("*:nth-child(-n+"+self.config.showMonths+") > ."+cellClass)).forEach((function(dayElem){var ts,ts1,ts2,timestamp=dayElem.dateObj.getTime(),outOfRange=minRange>0&&timestamp<minRange||maxRange>0&&timestamp>maxRange;if(outOfRange)return dayElem.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach((function(c){dayElem.classList.remove(c)}));containsDisabled&&!outOfRange||(["startRange","inRange","endRange","notAllowed"].forEach((function(c){dayElem.classList.remove(c)})),void 0!==elem&&(elem.classList.add(hoverDate<=self.selectedDates[0].getTime()?"startRange":"endRange"),initialDate<hoverDate&&timestamp===initialDate?dayElem.classList.add("startRange"):initialDate>hoverDate&&timestamp===initialDate&&dayElem.classList.add("endRange"),timestamp>=minRange&&(0===maxRange||timestamp<=maxRange)&&(ts1=initialDate,ts2=hoverDate,(ts=timestamp)>Math.min(ts1,ts2)&&ts<Math.max(ts1,ts2))&&dayElem.classList.add("inRange")))}))}}function onResize(){!self.isOpen||self.config.static||self.config.inline||positionCalendar()}function minMaxDateSetter(type){return function(date){var dateObj=self.config["_"+type+"Date"]=self.parseDate(date,self.config.dateFormat),inverseDateObj=self.config["_"+("min"===type?"max":"min")+"Date"];void 0!==dateObj&&(self["min"===type?"minDateHasTime":"maxDateHasTime"]=dateObj.getHours()>0||dateObj.getMinutes()>0||dateObj.getSeconds()>0),self.selectedDates&&(self.selectedDates=self.selectedDates.filter((function(d){return isEnabled(d)})),self.selectedDates.length||"min"!==type||setHoursFromDate(dateObj),updateValue()),self.daysContainer&&(redraw(),void 0!==dateObj?self.currentYearElement[type]=dateObj.getFullYear().toString():self.currentYearElement.removeAttribute(type),self.currentYearElement.disabled=!!inverseDateObj&&void 0!==dateObj&&inverseDateObj.getFullYear()===dateObj.getFullYear())}}function getInputElem(){return self.config.wrap?element.querySelector("[data-input]"):element}function setupLocale(){"object"!=typeof self.config.locale&&void 0===flatpickr.l10ns[self.config.locale]&&self.config.errorHandler(new Error("flatpickr: invalid locale "+self.config.locale)),self.l10n=__assign(__assign({},flatpickr.l10ns.default),"object"==typeof self.config.locale?self.config.locale:"default"!==self.config.locale?flatpickr.l10ns[self.config.locale]:void 0),tokenRegex.D="("+self.l10n.weekdays.shorthand.join("|")+")",tokenRegex.l="("+self.l10n.weekdays.longhand.join("|")+")",tokenRegex.M="("+self.l10n.months.shorthand.join("|")+")",tokenRegex.F="("+self.l10n.months.longhand.join("|")+")",tokenRegex.K="("+self.l10n.amPM[0]+"|"+self.l10n.amPM[1]+"|"+self.l10n.amPM[0].toLowerCase()+"|"+self.l10n.amPM[1].toLowerCase()+")",void 0===__assign(__assign({},instanceConfig),JSON.parse(JSON.stringify(element.dataset||{}))).time_24hr&&void 0===flatpickr.defaultConfig.time_24hr&&(self.config.time_24hr=self.l10n.time_24hr),self.formatDate=createDateFormatter(self),self.parseDate=createDateParser({config:self.config,l10n:self.l10n})}function positionCalendar(customPositionElement){if("function"!=typeof self.config.position){if(void 0!==self.calendarContainer){triggerEvent("onPreCalendarPosition");var positionElement=customPositionElement||self._positionElement,calendarHeight=Array.prototype.reduce.call(self.calendarContainer.children,(function(acc,child){return acc+child.offsetHeight}),0),calendarWidth=self.calendarContainer.offsetWidth,configPos=self.config.position.split(" "),configPosVertical=configPos[0],configPosHorizontal=configPos.length>1?configPos[1]:null,inputBounds=positionElement.getBoundingClientRect(),distanceFromBottom=window.innerHeight-inputBounds.bottom,showOnTop="above"===configPosVertical||"below"!==configPosVertical&&distanceFromBottom<calendarHeight&&inputBounds.top>calendarHeight,top=window.pageYOffset+inputBounds.top+(showOnTop?-calendarHeight-2:positionElement.offsetHeight+2);if(toggleClass(self.calendarContainer,"arrowTop",!showOnTop),toggleClass(self.calendarContainer,"arrowBottom",showOnTop),!self.config.inline){var left=window.pageXOffset+inputBounds.left,isCenter=!1,isRight=!1;"center"===configPosHorizontal?(left-=(calendarWidth-inputBounds.width)/2,isCenter=!0):"right"===configPosHorizontal&&(left-=calendarWidth-inputBounds.width,isRight=!0),toggleClass(self.calendarContainer,"arrowLeft",!isCenter&&!isRight),toggleClass(self.calendarContainer,"arrowCenter",isCenter),toggleClass(self.calendarContainer,"arrowRight",isRight);var right=window.document.body.offsetWidth-(window.pageXOffset+inputBounds.right),rightMost=left+calendarWidth>window.document.body.offsetWidth,centerMost=right+calendarWidth>window.document.body.offsetWidth;if(toggleClass(self.calendarContainer,"rightMost",rightMost),!self.config.static)if(self.calendarContainer.style.top=top+"px",rightMost)if(centerMost){var doc=function getDocumentStyleSheet(){for(var editableSheet=null,i=0;i<document.styleSheets.length;i++){var sheet=document.styleSheets[i];if(sheet.cssRules){try{sheet.cssRules}catch(err){continue}editableSheet=sheet;break}}return null!=editableSheet?editableSheet:function createStyleSheet(){var style=document.createElement("style");return document.head.appendChild(style),style.sheet}()}();if(void 0===doc)return;var bodyWidth=window.document.body.offsetWidth,centerLeft=Math.max(0,bodyWidth/2-calendarWidth/2),centerIndex=doc.cssRules.length,centerStyle="{left:"+inputBounds.left+"px;right:auto;}";toggleClass(self.calendarContainer,"rightMost",!1),toggleClass(self.calendarContainer,"centerMost",!0),doc.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+centerStyle,centerIndex),self.calendarContainer.style.left=centerLeft+"px",self.calendarContainer.style.right="auto"}else self.calendarContainer.style.left="auto",self.calendarContainer.style.right=right+"px";else self.calendarContainer.style.left=left+"px",self.calendarContainer.style.right="auto"}}}else self.config.position(self,customPositionElement)}function redraw(){self.config.noCalendar||self.isMobile||(buildMonthSwitch(),updateNavigationCurrentMonth(),buildDays())}function focusAndClose(){self._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(self.close,0):self.close()}function selectDate(e){e.preventDefault(),e.stopPropagation();var t=findParent(getEventTarget(e),(function(day){return day.classList&&day.classList.contains("flatpickr-day")&&!day.classList.contains("flatpickr-disabled")&&!day.classList.contains("notAllowed")}));if(void 0!==t){var target=t,selectedDate=self.latestSelectedDateObj=new Date(target.dateObj.getTime()),shouldChangeMonth=(selectedDate.getMonth()<self.currentMonth||selectedDate.getMonth()>self.currentMonth+self.config.showMonths-1)&&"range"!==self.config.mode;if(self.selectedDateElem=target,"single"===self.config.mode)self.selectedDates=[selectedDate];else if("multiple"===self.config.mode){var selectedIndex=isDateSelected(selectedDate);selectedIndex?self.selectedDates.splice(parseInt(selectedIndex),1):self.selectedDates.push(selectedDate)}else"range"===self.config.mode&&(2===self.selectedDates.length&&self.clear(!1,!1),self.latestSelectedDateObj=selectedDate,self.selectedDates.push(selectedDate),0!==compareDates(selectedDate,self.selectedDates[0],!0)&&self.selectedDates.sort((function(a,b){return a.getTime()-b.getTime()})));if(setHoursFromInputs(),shouldChangeMonth){var isNewYear=self.currentYear!==selectedDate.getFullYear();self.currentYear=selectedDate.getFullYear(),self.currentMonth=selectedDate.getMonth(),isNewYear&&(triggerEvent("onYearChange"),buildMonthSwitch()),triggerEvent("onMonthChange")}if(updateNavigationCurrentMonth(),buildDays(),updateValue(),shouldChangeMonth||"range"===self.config.mode||1!==self.config.showMonths?void 0!==self.selectedDateElem&&void 0===self.hourElement&&self.selectedDateElem&&self.selectedDateElem.focus():focusOnDayElem(target),void 0!==self.hourElement&&void 0!==self.hourElement&&self.hourElement.focus(),self.config.closeOnSelect){var single="single"===self.config.mode&&!self.config.enableTime,range="range"===self.config.mode&&2===self.selectedDates.length&&!self.config.enableTime;(single||range)&&focusAndClose()}triggerChange()}}self.parseDate=createDateParser({config:self.config,l10n:self.l10n}),self._handlers=[],self.pluginElements=[],self.loadedPlugins=[],self._bind=bind,self._setHoursFromDate=setHoursFromDate,self._positionCalendar=positionCalendar,self.changeMonth=changeMonth,self.changeYear=changeYear,self.clear=function clear(triggerChangeEvent,toInitial){void 0===triggerChangeEvent&&(triggerChangeEvent=!0);void 0===toInitial&&(toInitial=!0);self.input.value="",void 0!==self.altInput&&(self.altInput.value="");void 0!==self.mobileInput&&(self.mobileInput.value="");self.selectedDates=[],self.latestSelectedDateObj=void 0,!0===toInitial&&(self.currentYear=self._initialDate.getFullYear(),self.currentMonth=self._initialDate.getMonth());if(!0===self.config.enableTime){var _a=getDefaultHours(self.config),hours=_a.hours,minutes=_a.minutes,seconds=_a.seconds;setHours(hours,minutes,seconds)}self.redraw(),triggerChangeEvent&&triggerEvent("onChange")},self.close=functi