1(()=>{var DualCalendar=/*#__PURE__*/function(){function DualCalendar(args){if(void 0===args)args={};this.startDatepicker=null;this.endDatepicker=null;this.flag=!1;this.args=args||{};this.time_args={click_count:0,start_time:null,end_time:null}}var _proto=DualCalendar.prototype;_proto.init=function init(initial_date){var _self=this;this.default_view_date=initial_date||"today";this.dualCalendarInit();this.selectCalendarDate();this.ensureCalendarSync();if(!this.startDatepicker.element.hasAttribute("data-listener-added")){this.startDatepicker.element.addEventListener("changeDate",function(event){var mili_time=_self.startDatepicker.getDate();_self.setTimeArgs(mili_time)});this.startDatepicker.element.setAttribute("data-listener-added","true")}if(!this.endDatepicker.element.hasAttribute("data-listener-added")){this.endDatepicker.element.addEventListener("changeDate",function(event){var mili_time=_self.endDatepicker.getDate();_self.setTimeArgs(mili_time)});this.endDatepicker.element.setAttribute("data-listener-added","true")}};_proto.dualCalendarInit=function dualCalendarInit(){var _this$startDatepicker,_this$endDatepicker;null==(_this$startDatepicker=this.startDatepicker)||_this$startDatepicker.destroy();null==(_this$endDatepicker=this.endDatepicker)||_this$endDatepicker.destroy();this.startDatepicker=new Datepicker(this.args.start_elem,{minDate:"today",autohide:!0,inline:!0,todayHighlight:!0,format:"dd/mm/yyyy",defaultViewDate:this.default_view_date});var oneMonthLater=this.getNextMonth(this.default_view_date);this.endDatepicker=new Datepicker(this.args.end_elem,{autohide:!0,inline:!0,format:"dd/mm/yyyy",defaultViewDate:oneMonthLater});return{start:this.startDatepicker,end:this.endDatepicker}};_proto.getNextMonth=function getNextMonth(date){var currentDate=date?new Date(date):new Date;currentDate.setMonth(currentDate.getMonth()+1);currentDate.setDate(1);return currentDate};_proto.getPrevMonth=function getPrevMonth(date){var currentDate=date?new Date(date):new Date;currentDate.setMonth(currentDate.getMonth()-1);currentDate.setDate(1);return currentDate};_proto.updateCalendarViews=function updateCalendarViews(selectedDate){var _this=this;if(this.startDatepicker&&this.startDatepicker.picker)this.startDatepicker.picker.changeFocus(selectedDate).render();var nextMonth=this.getNextMonth(selectedDate);if(this.endDatepicker&&this.endDatepicker.picker)this.endDatepicker.picker.changeFocus(nextMonth).render();setTimeout(function(){_this.args.main_elem.querySelectorAll(".datepicker--focused").forEach(function(cell){if(!cell.classList.contains("datepicker--selected"))cell.classList.remove("datepicker--focused")})},0)};_proto.setTimeArgs=function setTimeArgs(mili_time){var time=mili_time.getTime();if(1===this.time_args.click_count){this.time_args.click_count=2;this.time_args.start_time=time;this.time_args.end_time=time+864e5;this.default_view_date=mili_time;this.ensureCalendarSync()}else{this.time_args.click_count=1;this.time_args.end_time=time}if(1===this.time_args.click_count&&this.time_args.start_time>this.time_args.end_time){this.time_args.click_count=2;this.time_args.start_time=time;this.time_args.end_time=time+864e5;this.default_view_date=mili_time;this.ensureCalendarSync()}return this.selectCalendarDate()};_proto.ensureCalendarSync=function ensureCalendarSync(){if(!(this.startDatepicker&&this.startDatepicker.picker&&this.endDatepicker&&this.endDatepicker.picker))return;var startMonth=this.startDatepicker.picker.currentView;var endMonth=this.endDatepicker.picker.currentView;var expectedEndDate=this.getNextMonth(new Date(startMonth.year,startMonth.month));var actualEndDate=new Date(endMonth.year,endMonth.month);if(expectedEndDate.getMonth()!==actualEndDate.getMonth()||expectedEndDate.getFullYear()!==actualEndDate.getFullYear())this.updateCalendarViews(this.default_view_date)};_proto.selectCalendarDate=function selectCalendarDate(){var _this2=this;this.args.main_elem.querySelectorAll(".datepicker__cell").forEach(function(item){var dateOnMili=parseInt(item.dataset.date);item.classList.remove("datepicker--selected");item.classList.remove("datepicker--selected-first");item.classList.remove("datepicker--selected-last");if(0===_this2.time_args.click_count&&item.classList.contains("datepicker--today")){var _item$nextSibling;_this2.time_args.start_time=dateOnMili;_this2.time_args.end_time=dateOnMili+864e5;_this2.time_args.click_count=1;item.classList.add("datepicker--selected");null==(_item$nextSibling=item.nextSibling)||_item$nextSibling.classList.add("datepicker--selected")}else if(1===_this2.time_args.click_count&&dateOnMili>=_this2.time_args.start_time&&dateOnMili<=_this2.time_args.end_time)item.classList.add("datepicker--selected");else if(2===_this2.time_args.click_count&&dateOnMili===_this2.time_args.start_time)item.classList.add("datepicker--selected")});var selectedCells=this.args.main_elem.querySelectorAll(".datepicker--selected");if(selectedCells.length>0){selectedCells[0].classList.add("datepicker--selected-first");selectedCells[selectedCells.length-1].classList.add("datepicker--selected-last")}if(this.args.input){var input=this.args.input;
1input.arrival.value=this.time_args.start_time;input.departure.value=this.time_args.end_time;this.args.main_elem.setAttribute("data-click-count",this.time_args.click_count)}setTimeout(function(){_this2.args.main_elem.querySelectorAll(".datepicker--focused").forEach(function(cell){if(!cell.classList.contains("datepicker--selected"))cell.classList.remove("datepicker--focused")})},0)};return DualCalendar}();window.DualCalendar=DualCalendar})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.