@wernfried/daterangepicker 4.17.3 → 4.17.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -20,8 +20,8 @@ Above samples are based on the [original repository](https://github.com/dangross
20
20
  ```html
21
21
  <script type="text/javascript" src="https://cdn.jsdelivr.net/jquery/latest/jquery.min.js"></script>
22
22
  <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/luxon@3.5.0/build/global/luxon.min.js"></script>
23
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@wernfried/daterangepicker@4.17.3/dist/global/daterangepicker.min.js"></script>
24
- <link type="text/css" href="https://cdn.jsdelivr.net/npm/@wernfried/daterangepicker@4.17.3/css/daterangepicker.min.css" rel="stylesheet" />
23
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@wernfried/daterangepicker@4.17.5/dist/global/daterangepicker.min.js"></script>
24
+ <link type="text/css" href="https://cdn.jsdelivr.net/npm/@wernfried/daterangepicker@4.17.5/css/daterangepicker.min.css" rel="stylesheet" />
25
25
 
26
26
  <input type="text" id="picker" />
27
27
 
@@ -43,11 +43,11 @@ Above samples are based on the [original repository](https://github.com/dangross
43
43
  "imports": {
44
44
  "jquery": "https://cdn.jsdelivr.net/npm/jquery@4.0.0/+esm",
45
45
  "luxon": "https://cdn.jsdelivr.net/npm/luxon@3.7.2/+esm",
46
- "daterangepicker": "https://cdn.jsdelivr.net/npm/@wernfried/daterangepicker@4.17.3/+esm"
46
+ "daterangepicker": "https://cdn.jsdelivr.net/npm/@wernfried/daterangepicker@4.17.5/+esm"
47
47
  }
48
48
  }
49
49
  </script>
50
- <link type="text/css" href="https://cdn.jsdelivr.net/npm/@wernfried/daterangepicker@4.17.3/css/daterangepicker.min.css" rel="stylesheet" />
50
+ <link type="text/css" href="https://cdn.jsdelivr.net/npm/@wernfried/daterangepicker@4.17.5/css/daterangepicker.min.css" rel="stylesheet" />
51
51
 
52
52
  <input type="text" id="picker" />
53
53
 
@@ -68,7 +68,7 @@ Above samples are based on the [original repository](https://github.com/dangross
68
68
  ```html
69
69
  <script ...></script>
70
70
  <link type="text/css" href="https://cdn.jsdelivr.net/npm/bulma@1.0.4/css/bulma.min.css" rel="stylesheet" />
71
- <link type="text/css" href="https://cdn.jsdelivr.net/npm/@wernfried/daterangepicker@4.17.3/css/daterangepicker.bulma.min.css" rel="stylesheet" />
71
+ <link type="text/css" href="https://cdn.jsdelivr.net/npm/@wernfried/daterangepicker@4.17.5/css/daterangepicker.bulma.min.css" rel="stylesheet" />
72
72
 
73
73
  <input type="text" id="picker" />
74
74
 
@@ -362,7 +362,7 @@ class DateRangePicker {
362
362
  console.error(`Value of startDate "${this.#startDate}" violates ${vio.find((x) => x.reason.startsWith("isInvalid")).reason}`);
363
363
  } else {
364
364
  const newDate = vio.filter((x) => x.new != null).at(-1).new;
365
- if (process.env.JEST_WORKER_ID == null)
365
+ if (typeof process !== "undefined" && process.env.JEST_WORKER_ID == null)
366
366
  console.warn(`Correcting startDate from ${this.#startDate} to ${newDate}`);
367
367
  this.#startDate = newDate;
368
368
  }
@@ -374,7 +374,7 @@ class DateRangePicker {
374
374
  console.error(`Value of endDate "${this.#endDate}" violates ${vio.find((x) => x.reason.startsWith("isInvalid")).reason}`);
375
375
  } else {
376
376
  const newDate = vio.filter((x) => x.new != null).at(-1).new;
377
- if (process.env.JEST_WORKER_ID == null)
377
+ if (typeof process !== "undefined" && process.env.JEST_WORKER_ID == null)
378
378
  console.warn(`Correcting endDate from ${this.#endDate} to ${newDate}`);
379
379
  this.#endDate = newDate;
380
380
  }
@@ -1,2 +1,2 @@
1
- import{DateTime as o,Duration as b,Info as w,Settings as x}from"luxon";import{$ as h}from"jquery";class I{#t=null;#e=null;constructor(s,t,a){this.parentEl="body",this.element=h(s),this.#t=o.now().startOf("day"),this.#e=o.now().plus({day:1}).startOf("day"),this.minDate=null,this.maxDate=null,this.maxSpan=null,this.minSpan=null,this.defaultSpan=null,this.initalMonth=o.now().startOf("month"),this.autoApply=!1,this.singleDatePicker=!1,this.singleMonthView=!1,this.showDropdowns=!1,this.minYear=o.now().minus({year:100}).year,this.maxYear=o.now().plus({year:100}).year,this.showWeekNumbers=!1,this.showISOWeekNumbers=!1,this.showCustomRangeLabel=!0,this.showLabel=!h(this.element).is("input:text"),this.timePicker=!1;const n=new Intl.DateTimeFormat(o.now().locale,{hour:"numeric"}).resolvedOptions();if(this.timePicker24Hour=!n.hour12,this.timePickerStepSize=b.fromObject({minutes:1}),this.linkedCalendars=!0,this.autoUpdateInput=!0,this.alwaysShowCalendars=!1,this.isInvalidDate=null,this.isInvalidTime=null,this.isCustomDate=null,this.onOutsideClick="apply",this.opens=this.element.hasClass("pull-right")?"left":"right",this.drops=this.element.hasClass("dropup")?"up":"down",this.buttonClasses="btn btn-sm",this.applyButtonClasses="btn-primary",this.cancelButtonClasses="btn-default",this.weekendClasses="weekend",this.weekendDayClasses="weekend-day",this.todayClasses="today",this.altInput=null,this.altFormat=null,this.externalStyle=null,this.ranges={},this.locale={direction:"ltr",format:o.DATE_SHORT,separator:" - ",applyLabel:"Apply",cancelLabel:"Cancel",weekLabel:"W",customRangeLabel:"Custom Range",daysOfWeek:w.weekdays("short"),monthNames:w.months("long"),firstDay:w.getStartOfWeek(),durationFormat:null},this.callback=function(){},this.isShowing=!1,this.leftCalendar={},this.rightCalendar={},(typeof t!="object"||t===null)&&(t={}),t=h.extend(this.element.data(),t),typeof t.singleDatePicker=="boolean"&&(this.singleDatePicker=t.singleDatePicker),!this.singleDatePicker&&typeof t.singleMonthView=="boolean"?this.singleMonthView=t.singleMonthView:this.singleMonthView=!1,typeof t.externalStyle=="string"&&["bulma"].includes(t.externalStyle)&&(this.externalStyle=t.externalStyle),typeof t.template!="string"&&!(t.template instanceof h)){let e=['<div class="daterangepicker">','<div class="ranges"></div>','<div class="drp-calendar left">','<table class="calendar-table">',"<thead></thead>","<tbody></tbody>","<tfoot>",'<tr class="calendar-time start-time"></tr>'];this.singleMonthView&&e.push('<tr class="calendar-time end-time"></tr>'),e.push("</tfoot>","</table>","</div>"),e.push('<div class="drp-calendar right">','<table class="calendar-table">',"<thead></thead>","<tbody></tbody>","<tfoot>",'<tr class="calendar-time end-time"></tr>',"</tfoot>","</table>","</div>"),e.push('<div class="drp-buttons">','<div class="drp-duration-label"></div>','<div class="drp-selected"></div>'),this.externalStyle==="bulma"?e.push('<div class="buttons">','<button class="cancelBtn button is-small" type="button"></button>','<button class="applyBtn button is-small" disabled type="button"></button>',"</div>"):e.push("<div>",'<button class="cancelBtn" type="button"></button>','<button class="applyBtn" disabled type="button"></button>',"</div>"),e.push("</div></div>"),t.template=e.join("")}if(this.parentEl=t.parentEl&&h(t.parentEl).length?h(t.parentEl):h(this.parentEl),this.container=h(t.template).appendTo(this.parentEl),typeof t.timePicker=="boolean"&&(this.timePicker=t.timePicker),this.timePicker&&(this.locale.format=o.DATETIME_SHORT),typeof t.locale=="object"){for(let e of["separator","applyLabel","cancelLabel","weekLabel"])typeof t.locale[e]=="string"&&(this.locale[e]=t.locale[e]);if(typeof t.locale.direction=="string"&&(["rtl","ltr"].includes(t.locale.direction)?this.locale.direction=t.locale.direction:console.error("Option 'options.locale.direction' must be 'rtl' or 'ltr'")),["string","object"].includes(typeof t.locale.format)&&(this.locale.format=t.locale.format),Array.isArray(t.locale.daysOfWeek)&&(t.locale.daysOfWeek.some(e=>typeof e!="string")?console.error("Option 'options.locale.daysOfWeek' must be an array of strings"):this.locale.daysOfWeek=t.locale.daysOfWeek.slice()),Array.isArray(t.locale.monthNames)&&(t.locale.monthNames.some(e=>typeof e!="string")?console.error("Option 'locale.monthNames' must be an array of strings"):this.locale.monthNames=t.locale.monthNames.slice()),typeof t.locale.firstDay=="number"&&(this.locale.firstDay=t.locale.firstDay),typeof t.locale.customRangeLabel=="string"){var r=document.createElement("textarea");r.innerHTML=t.locale.customRangeLabel;var i=r.value;this.locale.customRangeLabel=i}["string","object","function"].includes(typeof t.locale.durationFormat)&&t.locale.durationFormat!=null&&(this.locale.durationFormat=t.locale.durationFormat)}this.container.addClass(this.locale.direction);for(let e of["timePicker24Hour","showWeekNumbers","showISOWeekNumbers","showDropdowns","linkedCalendars","showCustomRangeLabel","alwaysShowCalendars","autoApply","autoUpdateInput","showLabel"])typeof t[e]=="boolean"&&(this[e]=t[e]);for(let e of["applyButtonClasses","cancelButtonClasses","weekendClasses","weekendDayClasses","todayClasses"])typeof t[e]=="string"?this[e]=t[e]:["weekendClasses","weekendDayClasses","todayClasses"].includes(e)&&t[e]===null&&(this[e]=t[e]);for(let e of["minYear","maxYear"])typeof t[e]=="number"&&(this[e]=t[e]);for(let e of["isInvalidDate","isInvalidTime","isCustomDate"])typeof t[e]=="function"?this[e]=t[e]:this[e]=function(){return!1};if(!this.singleDatePicker){for(let e of["minSpan","maxSpan","defaultSpan"])["string","number","object"].includes(typeof t[e])&&(b.isDuration(t[e])&&t[e].isValid?this[e]=t[e]:b.fromISO(t[e]).isValid?this[e]=b.fromISO(t[e]):typeof t[e]=="number"&&b.fromObject({seconds:t[e]}).isValid?this[e]=b.fromObject({seconds:t[e]}):t[e]===null?this[e]=null:console.error(`Option '${key}' is not valid`));this.minSpan&&this.maxSpan&&this.minSpan>this.maxSpan&&(this.minSpan=null,this.maxSpan=null,console.warn("Ignore option 'minSpan' and 'maxSpan', because 'minSpan' must be smaller than 'maxSpan'")),this.defaultSpan&&this.minSpan&&this.minSpan>this.defaultSpan?(this.defaultSpan=null,console.warn("Ignore option 'defaultSpan', because 'defaultSpan' must be greater than 'minSpan'")):this.defaultSpan&&this.maxSpan&&this.maxSpan<this.defaultSpan&&(this.defaultSpan=null,console.warn("Ignore option 'defaultSpan', because 'defaultSpan' must be smaller than 'maxSpan'"))}if(this.timePicker){if(typeof t.timePickerSeconds=="boolean"&&(this.timePickerStepSize=b.fromObject({[t.timePickerSeconds?"seconds":"minutes"]:1})),typeof t.timePickerIncrement=="number"&&(this.timePickerStepSize=b.fromObject({minutes:t.timePickerIncrement})),["string","object","number"].includes(typeof t.timePickerStepSize)){let e;b.isDuration(t.timePickerStepSize)&&t.timePickerStepSize.isValid?e=t.timePickerStepSize:b.fromISO(t.timePickerStepSize).isValid?e=b.fromISO(t.timePickerStepSize):typeof t.timePickerStepSize=="number"&&b.fromObject({seconds:t.timePickerStepSize}).isValid?e=b.fromObject({seconds:t.timePickerStepSize}):(console.error("Option 'timePickerStepSize' is not valid"),e=this.timePickerStepSize);var f=[];for(let l of["minutes","seconds"])f.push(...[1,2,3,4,5,6,10,12,15,20,30].map(d=>b.fromObject({[l]:d})));f.push(...[1,2,3,4,6].map(l=>b.fromObject({hours:l}))),this.timePicker24Hour&&f.push(...[8,12].map(l=>b.fromObject({hours:l}))),f.some(l=>e.rescale().equals(l))?this.timePickerStepSize=e.rescale():console.error(`Option 'timePickerStepSize' ${JSON.stringify(e.toObject())} is not valid`)}this.maxSpan&&this.timePickerStepSize>this.maxSpan&&console.error(`Option 'timePickerStepSize' ${JSON.stringify(this.timePickerStepSize.toObject())} must be smaller than 'maxSpan'`),this.timePickerOpts={showMinutes:this.timePickerStepSize<b.fromObject({hours:1}),showSeconds:this.timePickerStepSize<b.fromObject({minutes:1}),hourStep:this.timePickerStepSize>=b.fromObject({hours:1})?this.timePickerStepSize.hours:1,minuteStep:this.timePickerStepSize>=b.fromObject({minutes:1})?this.timePickerStepSize.minutes:1,secondStep:this.timePickerStepSize.seconds}}for(let e of["startDate","endDate","minDate","maxDate","initalMonth"])if(!(e==="endDate"&&this.singleDatePicker)){if(typeof t[e]=="object")o.isDateTime(t[e])&&t[e].isValid?this[e]=t[e]:t[e]instanceof Date?this[e]=o.fromJSDate(t[e]):t[e]===null?this[e]=null:console.error(`Option '${e}' must be a luxon.DateTime or Date or string`);else if(typeof t[e]=="string"){const l=typeof this.locale.format=="string"?this.locale.format:o.parseFormatForOpts(this.locale.format);if(o.fromISO(t[e]).isValid)this[e]=o.fromISO(t[e]);else if(o.fromFormat(t[e],l,{locale:o.now().locale}).isValid)this[e]=o.fromFormat(t[e],l,{locale:o.now().locale});else{const d=o.fromFormat(t[e],l,{locale:o.now().locale}).invalidExplanation;console.error(`Option '${e}' is not a valid string: ${d}`)}}}if(h(this.element).is("input:text")){const e=h(this.element).val();if(e!=""){const l=typeof this.locale.format=="string"?this.locale.format:o.parseFormatForOpts(this.locale.format);if(this.singleDatePicker&&typeof t.startDate>"u"){const d=o.fromFormat(e,l,{locale:o.now().locale});d.isValid?this.#t=d:console.error(`Value "${e}" in <input> is not a valid string: ${d.invalidExplanation}`)}else if(!this.singleDatePicker&&typeof t.startDate>"u"&&typeof t.endDate>"u"){const d=e.split(this.locale.separator);if(d.length===2){const p=o.fromFormat(d[0],l,{locale:o.now().locale}),u=o.fromFormat(d[1],l,{locale:o.now().locale});p.isValid&&u.isValid?(this.#t=p,this.#e=u):console.error(`Value in <input> is not a valid string: ${p.invalidExplanation} - ${u.invalidExplanation}`)}else console.error(`Value "${e}" in <input> is not a valid string`)}}}if(this.singleDatePicker?this.#e=this.#t:this.#e<this.#t&&console.error(`Option 'endDate' ${this.#e} must not be earlier than 'startDate' ${this.#t}`),this.timePicker||(this.minDate&&(this.minDate=this.minDate.startOf("day")),this.maxDate&&(this.maxDate=this.maxDate.endOf("day")),this.#t=this.#t.startOf("day"),this.#e=this.#e.endOf("day")),t.warnings!==void 0&&console.warn("Option 'warnings' not used anymore. Listen to event 'violated.daterangepicker'"),!this.#t&&this.initalMonth)this.#e=null,this.timePicker&&console.error("Option 'initalMonth' works only with 'timePicker: false'");else{const e=this.validateInput(null,!1);if(e!=null){let l=e.startDate.violations;if(l.length>0)if(l.some(d=>d.reason.startsWith("isInvalid")))console.error(`Value of startDate "${this.#t}" violates ${l.find(d=>d.reason.startsWith("isInvalid")).reason}`);else{const d=l.filter(p=>p.new!=null).at(-1).new;process.env.JEST_WORKER_ID==null&&console.warn(`Correcting startDate from ${this.#t} to ${d}`),this.#t=d}if(!this.singleDatePicker&&(l=e.endDate.violations.filter(d=>d.new!=null),l.length>0))if(l.some(d=>d.reason.startsWith("isInvalid")))console.error(`Value of endDate "${this.#e}" violates ${l.find(d=>d.reason.startsWith("isInvalid")).reason}`);else{const d=l.filter(p=>p.new!=null).at(-1).new;process.env.JEST_WORKER_ID==null&&console.warn(`Correcting endDate from ${this.#e} to ${d}`),this.#e=d}}}if(["function","string"].includes(typeof t.altFormat)&&(this.altFormat=t.altFormat),typeof t.altInput=="string"||Array.isArray(t.altInput))if(this.singleDatePicker&&typeof t.altInput=="string")this.altInput=h(t.altInput).is("input:text")?t.altInput:null;else if(!this.singleDatePicker&&Array.isArray(t.altInput)&&t.altInput.length===2)this.altInput=t.altInput.every(e=>typeof e=="string"&&h(e).is("input:text"))?t.altInput:null;else{const e='Value of "altInput" must be '+(this.singleDatePicker?"a string":"an array of two string elements");console.error(`Option 'altInput' ${JSON.stringify(t.altInput)} is not valid
1
+ import{DateTime as o,Duration as b,Info as w,Settings as x}from"luxon";import{$ as h}from"jquery";class I{#t=null;#e=null;constructor(s,t,a){this.parentEl="body",this.element=h(s),this.#t=o.now().startOf("day"),this.#e=o.now().plus({day:1}).startOf("day"),this.minDate=null,this.maxDate=null,this.maxSpan=null,this.minSpan=null,this.defaultSpan=null,this.initalMonth=o.now().startOf("month"),this.autoApply=!1,this.singleDatePicker=!1,this.singleMonthView=!1,this.showDropdowns=!1,this.minYear=o.now().minus({year:100}).year,this.maxYear=o.now().plus({year:100}).year,this.showWeekNumbers=!1,this.showISOWeekNumbers=!1,this.showCustomRangeLabel=!0,this.showLabel=!h(this.element).is("input:text"),this.timePicker=!1;const n=new Intl.DateTimeFormat(o.now().locale,{hour:"numeric"}).resolvedOptions();if(this.timePicker24Hour=!n.hour12,this.timePickerStepSize=b.fromObject({minutes:1}),this.linkedCalendars=!0,this.autoUpdateInput=!0,this.alwaysShowCalendars=!1,this.isInvalidDate=null,this.isInvalidTime=null,this.isCustomDate=null,this.onOutsideClick="apply",this.opens=this.element.hasClass("pull-right")?"left":"right",this.drops=this.element.hasClass("dropup")?"up":"down",this.buttonClasses="btn btn-sm",this.applyButtonClasses="btn-primary",this.cancelButtonClasses="btn-default",this.weekendClasses="weekend",this.weekendDayClasses="weekend-day",this.todayClasses="today",this.altInput=null,this.altFormat=null,this.externalStyle=null,this.ranges={},this.locale={direction:"ltr",format:o.DATE_SHORT,separator:" - ",applyLabel:"Apply",cancelLabel:"Cancel",weekLabel:"W",customRangeLabel:"Custom Range",daysOfWeek:w.weekdays("short"),monthNames:w.months("long"),firstDay:w.getStartOfWeek(),durationFormat:null},this.callback=function(){},this.isShowing=!1,this.leftCalendar={},this.rightCalendar={},(typeof t!="object"||t===null)&&(t={}),t=h.extend(this.element.data(),t),typeof t.singleDatePicker=="boolean"&&(this.singleDatePicker=t.singleDatePicker),!this.singleDatePicker&&typeof t.singleMonthView=="boolean"?this.singleMonthView=t.singleMonthView:this.singleMonthView=!1,typeof t.externalStyle=="string"&&["bulma"].includes(t.externalStyle)&&(this.externalStyle=t.externalStyle),typeof t.template!="string"&&!(t.template instanceof h)){let e=['<div class="daterangepicker">','<div class="ranges"></div>','<div class="drp-calendar left">','<table class="calendar-table">',"<thead></thead>","<tbody></tbody>","<tfoot>",'<tr class="calendar-time start-time"></tr>'];this.singleMonthView&&e.push('<tr class="calendar-time end-time"></tr>'),e.push("</tfoot>","</table>","</div>"),e.push('<div class="drp-calendar right">','<table class="calendar-table">',"<thead></thead>","<tbody></tbody>","<tfoot>",'<tr class="calendar-time end-time"></tr>',"</tfoot>","</table>","</div>"),e.push('<div class="drp-buttons">','<div class="drp-duration-label"></div>','<div class="drp-selected"></div>'),this.externalStyle==="bulma"?e.push('<div class="buttons">','<button class="cancelBtn button is-small" type="button"></button>','<button class="applyBtn button is-small" disabled type="button"></button>',"</div>"):e.push("<div>",'<button class="cancelBtn" type="button"></button>','<button class="applyBtn" disabled type="button"></button>',"</div>"),e.push("</div></div>"),t.template=e.join("")}if(this.parentEl=t.parentEl&&h(t.parentEl).length?h(t.parentEl):h(this.parentEl),this.container=h(t.template).appendTo(this.parentEl),typeof t.timePicker=="boolean"&&(this.timePicker=t.timePicker),this.timePicker&&(this.locale.format=o.DATETIME_SHORT),typeof t.locale=="object"){for(let e of["separator","applyLabel","cancelLabel","weekLabel"])typeof t.locale[e]=="string"&&(this.locale[e]=t.locale[e]);if(typeof t.locale.direction=="string"&&(["rtl","ltr"].includes(t.locale.direction)?this.locale.direction=t.locale.direction:console.error("Option 'options.locale.direction' must be 'rtl' or 'ltr'")),["string","object"].includes(typeof t.locale.format)&&(this.locale.format=t.locale.format),Array.isArray(t.locale.daysOfWeek)&&(t.locale.daysOfWeek.some(e=>typeof e!="string")?console.error("Option 'options.locale.daysOfWeek' must be an array of strings"):this.locale.daysOfWeek=t.locale.daysOfWeek.slice()),Array.isArray(t.locale.monthNames)&&(t.locale.monthNames.some(e=>typeof e!="string")?console.error("Option 'locale.monthNames' must be an array of strings"):this.locale.monthNames=t.locale.monthNames.slice()),typeof t.locale.firstDay=="number"&&(this.locale.firstDay=t.locale.firstDay),typeof t.locale.customRangeLabel=="string"){var r=document.createElement("textarea");r.innerHTML=t.locale.customRangeLabel;var i=r.value;this.locale.customRangeLabel=i}["string","object","function"].includes(typeof t.locale.durationFormat)&&t.locale.durationFormat!=null&&(this.locale.durationFormat=t.locale.durationFormat)}this.container.addClass(this.locale.direction);for(let e of["timePicker24Hour","showWeekNumbers","showISOWeekNumbers","showDropdowns","linkedCalendars","showCustomRangeLabel","alwaysShowCalendars","autoApply","autoUpdateInput","showLabel"])typeof t[e]=="boolean"&&(this[e]=t[e]);for(let e of["applyButtonClasses","cancelButtonClasses","weekendClasses","weekendDayClasses","todayClasses"])typeof t[e]=="string"?this[e]=t[e]:["weekendClasses","weekendDayClasses","todayClasses"].includes(e)&&t[e]===null&&(this[e]=t[e]);for(let e of["minYear","maxYear"])typeof t[e]=="number"&&(this[e]=t[e]);for(let e of["isInvalidDate","isInvalidTime","isCustomDate"])typeof t[e]=="function"?this[e]=t[e]:this[e]=function(){return!1};if(!this.singleDatePicker){for(let e of["minSpan","maxSpan","defaultSpan"])["string","number","object"].includes(typeof t[e])&&(b.isDuration(t[e])&&t[e].isValid?this[e]=t[e]:b.fromISO(t[e]).isValid?this[e]=b.fromISO(t[e]):typeof t[e]=="number"&&b.fromObject({seconds:t[e]}).isValid?this[e]=b.fromObject({seconds:t[e]}):t[e]===null?this[e]=null:console.error(`Option '${key}' is not valid`));this.minSpan&&this.maxSpan&&this.minSpan>this.maxSpan&&(this.minSpan=null,this.maxSpan=null,console.warn("Ignore option 'minSpan' and 'maxSpan', because 'minSpan' must be smaller than 'maxSpan'")),this.defaultSpan&&this.minSpan&&this.minSpan>this.defaultSpan?(this.defaultSpan=null,console.warn("Ignore option 'defaultSpan', because 'defaultSpan' must be greater than 'minSpan'")):this.defaultSpan&&this.maxSpan&&this.maxSpan<this.defaultSpan&&(this.defaultSpan=null,console.warn("Ignore option 'defaultSpan', because 'defaultSpan' must be smaller than 'maxSpan'"))}if(this.timePicker){if(typeof t.timePickerSeconds=="boolean"&&(this.timePickerStepSize=b.fromObject({[t.timePickerSeconds?"seconds":"minutes"]:1})),typeof t.timePickerIncrement=="number"&&(this.timePickerStepSize=b.fromObject({minutes:t.timePickerIncrement})),["string","object","number"].includes(typeof t.timePickerStepSize)){let e;b.isDuration(t.timePickerStepSize)&&t.timePickerStepSize.isValid?e=t.timePickerStepSize:b.fromISO(t.timePickerStepSize).isValid?e=b.fromISO(t.timePickerStepSize):typeof t.timePickerStepSize=="number"&&b.fromObject({seconds:t.timePickerStepSize}).isValid?e=b.fromObject({seconds:t.timePickerStepSize}):(console.error("Option 'timePickerStepSize' is not valid"),e=this.timePickerStepSize);var f=[];for(let l of["minutes","seconds"])f.push(...[1,2,3,4,5,6,10,12,15,20,30].map(d=>b.fromObject({[l]:d})));f.push(...[1,2,3,4,6].map(l=>b.fromObject({hours:l}))),this.timePicker24Hour&&f.push(...[8,12].map(l=>b.fromObject({hours:l}))),f.some(l=>e.rescale().equals(l))?this.timePickerStepSize=e.rescale():console.error(`Option 'timePickerStepSize' ${JSON.stringify(e.toObject())} is not valid`)}this.maxSpan&&this.timePickerStepSize>this.maxSpan&&console.error(`Option 'timePickerStepSize' ${JSON.stringify(this.timePickerStepSize.toObject())} must be smaller than 'maxSpan'`),this.timePickerOpts={showMinutes:this.timePickerStepSize<b.fromObject({hours:1}),showSeconds:this.timePickerStepSize<b.fromObject({minutes:1}),hourStep:this.timePickerStepSize>=b.fromObject({hours:1})?this.timePickerStepSize.hours:1,minuteStep:this.timePickerStepSize>=b.fromObject({minutes:1})?this.timePickerStepSize.minutes:1,secondStep:this.timePickerStepSize.seconds}}for(let e of["startDate","endDate","minDate","maxDate","initalMonth"])if(!(e==="endDate"&&this.singleDatePicker)){if(typeof t[e]=="object")o.isDateTime(t[e])&&t[e].isValid?this[e]=t[e]:t[e]instanceof Date?this[e]=o.fromJSDate(t[e]):t[e]===null?this[e]=null:console.error(`Option '${e}' must be a luxon.DateTime or Date or string`);else if(typeof t[e]=="string"){const l=typeof this.locale.format=="string"?this.locale.format:o.parseFormatForOpts(this.locale.format);if(o.fromISO(t[e]).isValid)this[e]=o.fromISO(t[e]);else if(o.fromFormat(t[e],l,{locale:o.now().locale}).isValid)this[e]=o.fromFormat(t[e],l,{locale:o.now().locale});else{const d=o.fromFormat(t[e],l,{locale:o.now().locale}).invalidExplanation;console.error(`Option '${e}' is not a valid string: ${d}`)}}}if(h(this.element).is("input:text")){const e=h(this.element).val();if(e!=""){const l=typeof this.locale.format=="string"?this.locale.format:o.parseFormatForOpts(this.locale.format);if(this.singleDatePicker&&typeof t.startDate>"u"){const d=o.fromFormat(e,l,{locale:o.now().locale});d.isValid?this.#t=d:console.error(`Value "${e}" in <input> is not a valid string: ${d.invalidExplanation}`)}else if(!this.singleDatePicker&&typeof t.startDate>"u"&&typeof t.endDate>"u"){const d=e.split(this.locale.separator);if(d.length===2){const p=o.fromFormat(d[0],l,{locale:o.now().locale}),u=o.fromFormat(d[1],l,{locale:o.now().locale});p.isValid&&u.isValid?(this.#t=p,this.#e=u):console.error(`Value in <input> is not a valid string: ${p.invalidExplanation} - ${u.invalidExplanation}`)}else console.error(`Value "${e}" in <input> is not a valid string`)}}}if(this.singleDatePicker?this.#e=this.#t:this.#e<this.#t&&console.error(`Option 'endDate' ${this.#e} must not be earlier than 'startDate' ${this.#t}`),this.timePicker||(this.minDate&&(this.minDate=this.minDate.startOf("day")),this.maxDate&&(this.maxDate=this.maxDate.endOf("day")),this.#t=this.#t.startOf("day"),this.#e=this.#e.endOf("day")),t.warnings!==void 0&&console.warn("Option 'warnings' not used anymore. Listen to event 'violated.daterangepicker'"),!this.#t&&this.initalMonth)this.#e=null,this.timePicker&&console.error("Option 'initalMonth' works only with 'timePicker: false'");else{const e=this.validateInput(null,!1);if(e!=null){let l=e.startDate.violations;if(l.length>0)if(l.some(d=>d.reason.startsWith("isInvalid")))console.error(`Value of startDate "${this.#t}" violates ${l.find(d=>d.reason.startsWith("isInvalid")).reason}`);else{const d=l.filter(p=>p.new!=null).at(-1).new;typeof process<"u"&&process.env.JEST_WORKER_ID==null&&console.warn(`Correcting startDate from ${this.#t} to ${d}`),this.#t=d}if(!this.singleDatePicker&&(l=e.endDate.violations.filter(d=>d.new!=null),l.length>0))if(l.some(d=>d.reason.startsWith("isInvalid")))console.error(`Value of endDate "${this.#e}" violates ${l.find(d=>d.reason.startsWith("isInvalid")).reason}`);else{const d=l.filter(p=>p.new!=null).at(-1).new;typeof process<"u"&&process.env.JEST_WORKER_ID==null&&console.warn(`Correcting endDate from ${this.#e} to ${d}`),this.#e=d}}}if(["function","string"].includes(typeof t.altFormat)&&(this.altFormat=t.altFormat),typeof t.altInput=="string"||Array.isArray(t.altInput))if(this.singleDatePicker&&typeof t.altInput=="string")this.altInput=h(t.altInput).is("input:text")?t.altInput:null;else if(!this.singleDatePicker&&Array.isArray(t.altInput)&&t.altInput.length===2)this.altInput=t.altInput.every(e=>typeof e=="string"&&h(e).is("input:text"))?t.altInput:null;else{const e='Value of "altInput" must be '+(this.singleDatePicker?"a string":"an array of two string elements");console.error(`Option 'altInput' ${JSON.stringify(t.altInput)} is not valid
2
2
  `,e)}if(typeof t.opens=="string"&&(["left","right","center"].includes(t.opens)?this.opens=t.opens:console.error("Option 'options.opens' must be 'left', 'right' or 'center'")),typeof t.drops=="string"&&(["drop","down","auto"].includes(t.drops)?this.drops=t.drops:console.error("Option 'options.drops' must be 'drop', 'down' or 'auto'")),Array.isArray(t.buttonClasses)?this.buttonClasses=t.buttonClasses.join(" "):typeof t.buttonClasses=="string"&&(this.buttonClasses=t.buttonClasses),typeof t.onOutsideClick=="string"&&(["cancel","apply"].includes(t.onOutsideClick)?this.onOutsideClick=t.onOutsideClick:console.error("Option 'options.onOutsideClick' must be 'cancel' or 'apply'")),this.locale.firstDay!=1){let e=this.locale.firstDay;for(;e>1;)this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift()),e--}if(!this.singleDatePicker&&typeof t.ranges=="object"){for(let e in t.ranges){let l,d;if(["string","object"].includes(typeof t.ranges[e][0])&&(o.isDateTime(t.ranges[e][0])&&t.ranges[e][0].isValid?l=t.ranges[e][0]:t.ranges[e][0]instanceof Date?l=o.fromJSDate(t.ranges[e][0]):typeof t.ranges[e][0]=="string"&&o.fromISO(t.ranges[e][0]).isValid?l=o.fromISO(t.ranges[e][0]):console.error(`Option ranges['${e}'] is not am array of valid ISO-8601 string or luxon.DateTime or Date`)),["string","object"].includes(typeof t.ranges[e][1])&&(o.isDateTime(t.ranges[e][1])&&t.ranges[e][1].isValid?d=t.ranges[e][1]:t.ranges[e][1]instanceof Date?d=o.fromJSDate(t.ranges[e][1]):typeof t.ranges[e][1]=="string"&&o.fromISO(t.ranges[e][1]).isValid?d=o.fromISO(t.ranges[e][1]):console.error(`Option ranges['${e}'] is not a valid ISO-8601 string or luxon.DateTime or Date`)),!(l==null||d==null)){t.ranges[e]=[l,d];var r=document.createElement("textarea");r.innerHTML=e,this.ranges[r.value]=[l,d]}}var c="<ul>";for(let e in this.ranges)c+='<li data-range-key="'+e+'">'+e+"</li>";this.showCustomRangeLabel&&(c+='<li data-range-key="'+this.locale.customRangeLabel+'">'+this.locale.customRangeLabel+"</li>"),c+="</ul>",this.container.find(".ranges").prepend(c),this.container.addClass("show-ranges")}typeof a=="function"&&(this.callback=a),this.timePicker||this.container.find(".calendar-time").hide(),this.timePicker&&this.autoApply&&(this.autoApply=!1),this.autoApply&&this.container.addClass("auto-apply"),(this.singleDatePicker||this.singleMonthView)&&(this.container.addClass("single"),this.container.find(".drp-calendar.left").addClass("single"),this.container.find(".drp-calendar.left").show(),this.container.find(".drp-calendar.right").hide(),!this.timePicker&&this.autoApply&&this.container.addClass("auto-apply")),(typeof t.ranges>"u"&&!this.singleDatePicker||this.alwaysShowCalendars)&&this.container.addClass("show-calendar"),this.container.addClass("opens"+this.opens),this.container.find(".applyBtn, .cancelBtn").addClass(this.buttonClasses),this.applyButtonClasses.length&&this.container.find(".applyBtn").addClass(this.applyButtonClasses),this.cancelButtonClasses.length&&this.container.find(".cancelBtn").addClass(this.cancelButtonClasses),this.container.find(".applyBtn").html(this.locale.applyLabel),this.container.find(".cancelBtn").html(this.locale.cancelLabel),this.container.find(".drp-calendar").on("click.daterangepicker",".prev",this.clickPrev.bind(this)).on("click.daterangepicker",".next",this.clickNext.bind(this)).on("mousedown.daterangepicker","td.available",this.clickDate.bind(this)).on("mouseenter.daterangepicker","td.available",this.hoverDate.bind(this)).on("change.daterangepicker","select.yearselect",this.monthOrYearChanged.bind(this)).on("change.daterangepicker","select.monthselect",this.monthOrYearChanged.bind(this)).on("change.daterangepicker","select.hourselect,select.minuteselect,select.secondselect,select.ampmselect",this.timeChanged.bind(this)),this.container.find(".ranges").on("click.daterangepicker","li",this.clickRange.bind(this)).on("mouseenter.daterangepicker","li",this.hoverRange.bind(this)).on("mouseleave.daterangepicker","li",this.leaveRange.bind(this)),this.container.find(".drp-buttons").on("click.daterangepicker","button.applyBtn",this.clickApply.bind(this)).on("click.daterangepicker","button.cancelBtn",this.clickCancel.bind(this)),this.element.is("input")||this.element.is("button")?this.element.on({"click.daterangepicker":this.show.bind(this),"focus.daterangepicker":this.show.bind(this),"keyup.daterangepicker":this.elementChanged.bind(this),"keydown.daterangepicker":this.keydown.bind(this)}):(this.element.on("click.daterangepicker",this.toggle.bind(this)),this.element.on("keydown.daterangepicker",this.toggle.bind(this))),this.updateElement()}get startDate(){return this.timePicker?this.#t:this.#t.startOf("day")}get endDate(){return this.singleDatePicker?null:this.timePicker?this.#e:this.#e.endOf("day")}set startDate(s){this.#t=s}set endDate(s){this.#e=s}setStartDate(s,t=!0){if(!this.singleDatePicker)return setRange(s,this.#e,t);const a=this.#t;let n=this.parseDate(s);if(n.equals(a))return null;const r=this.validateInput([n,null],!0);if(r!=null)if(r.newDate!=null)n=r.newDate.startDate;else return r;return this.#t=n,this.#e=this.#t,this.timePicker||(this.#t=this.#t.startOf("day"),this.#e=this.#e.endOf("day")),this.updateElement(),t&&this.updateView(),r}setEndDate(s,t=!0){return this.singleDatePicker?null:setRange(this.#t,s,t)}setRange(s,t,a=!0){if(this.singleDatePicker)return;this.#e||(this.#e=this.#t);const n=[this.#t,this.#e];let r=[this.parseDate(s),this.parseDate(t)];if(n[0].equals(r[0])&&n[1].equals(r[1])||r[0]>r[1])return;const i=this.validateInput([r[0],r[1]],!0);if(i!=null)if(i.newDate!=null)r[0]=i.newDate.startDate,r[1]=i.newDate.endDate;else return i;return this.#t=r[0],this.#e=r[1],this.timePicker||(this.#t=this.#t.startOf("day"),this.#e=this.#e.endOf("day")),this.updateElement(),a&&this.updateView(),i}parseDate(s){if(typeof s=="object"){if(o.isDateTime(s)&&s.isValid)return s;if(s instanceof Date)return o.fromJSDate(s);throw RangeError("Value must be a luxon.DateTime or Date or string")}else if(typeof s=="string"){const t=typeof this.locale.format=="string"?this.locale.format:o.parseFormatForOpts(this.locale.format);if(o.fromISO(s).isValid)return o.fromISO(s);if(o.fromFormat(s,t,{locale:o.now().locale}).isValid)return o.fromFormat(s,t,{locale:o.now().locale});{const a=o.fromFormat(s,t,{locale:o.now().locale}).invalidExplanation;throw RangeError(`Value is not a valid string: ${a}`)}}}logDate(s){return this.timePicker?s.toISO({suppressMilliseconds:!0}):s.toISODate()}formatDate(s,t=this.locale.format){if(typeof t=="object")return s.toLocaleString(t);if(x.defaultLocale===null){const a=o.now().locale;return s.toFormat(t,{locale:a})}else return s.toFormat(t)}updateLabel(){if(this.showLabel){let s=this.formatDate(this.#t);this.singleDatePicker||(s+=this.locale.separator,this.#e&&(s+=this.formatDate(this.#e))),this.container.find(".drp-selected").html(s)}if(!(this.singleDatePicker||this.locale.durationFormat==null)){if(!this.#e){this.container.find(".drp-duration-label").html("");return}if(typeof this.locale.durationFormat=="function")this.container.find(".drp-duration-label").html(this.locale.durationFormat(this.#t,this.#e));else{let s=this.#e.plus({milliseconds:1}).diff(this.#t).rescale().set({milliseconds:0});this.timePicker||(s=s.set({seconds:0,minutes:0,hours:0})),s=s.removeZeros(),typeof this.locale.durationFormat=="object"?this.container.find(".drp-duration-label").html(s.toHuman(this.locale.durationFormat)):this.container.find(".drp-duration-label").html(s.toFormat(this.locale.durationFormat))}}}validateInput(s,t=!1){let a=s==null?this.#t:s[0],n=s==null?this.#e:s[1];if(a==null)return null;let r={startDate:{violations:[]}},i={old:a,reason:this.timePicker?"timePickerStepSize":"timePicker"};if(this.timePicker){const e=this.timePickerStepSize.as("seconds");a=o.fromSeconds(e*Math.round(a.toSeconds()/e)),i.new=a,i.new.equals(i.old)||r.startDate.violations.push(i)}else a=a.startOf("day");const f=this.timePicker?this.timePickerStepSize.as("seconds"):b.fromObject({days:1}).as("seconds");this.minDate&&a<this.minDate?(i={old:a,reason:"minDate"},a=a.plus({seconds:Math.trunc(this.minDate.diff(a).as("seconds")/f)*f}),a<this.minDate&&(a=a.plus(this.timePicker?this.timePickerStepSize:{days:1})),i.new=a,i.new.equals(i.old)||r.startDate.violations.push(i)):this.maxDate&&a>this.maxDate&&(i={old:a,reason:"maxDate"},a=a.minus({seconds:Math.trunc(a.diff(this.maxDate).as("seconds")/f)*f}),a>this.maxDate&&(a=a.minus(this.timePicker?this.timePickerStepSize:{days:1})),i.new=a,i.new.equals(i.old)||r.startDate.violations.push(i));let c=["hour"];if(this.timePicker&&(this.timePickerOpts.showMinutes&&c.push("minute"),this.timePickerOpts.showSeconds&&c.push("second"),this.timePicker24Hour||c.push("ampm")),this.isInvalidDate(a)&&r.startDate.violations.push({old:a,reason:"isInvalidDate"}),this.timePicker)for(let e of c)this.isInvalidTime(a,e,"start")&&r.startDate.violations.push({old:a,reason:"isInvalidTime",unit:e});if(this.singleDatePicker){if(r.startDate.violations.length==0)return null;if(t){let e={startDate:a};return this.element.triggerHandler("violated.daterangepicker",[this,r,e])&&(r.newDate=e),r}else return r}if(n==null)return null;if(r.endDate={violations:[]},i={old:n,reason:this.timePicker?"stepSize":"timePicker"},this.timePicker){const e=this.timePickerStepSize.as("seconds");n=o.fromSeconds(e*Math.round(n.toSeconds()/e)),i.new=n,i.new.equals(i.old)||r.endDate.violations.push(i)}else n=n.endOf("day");if(this.maxDate&&n>this.maxDate?(i={old:n,reason:"maxDate"},n=n.minus({seconds:Math.trunc(n.diff(this.maxDate).as("seconds")/f)*f}),n>this.maxDate&&(n=n.minus(this.timePicker?this.timePickerStepSize:{days:1})),i.new=n,i.new.equals(i.old)||r.endDate.violations.push(i)):this.minDate&&n<this.minDate&&(i={old:n,reason:"minDate"},n=n.plus({seconds:Math.trunc(this.minDate.diff(n).as("seconds")/f)*f}),n<this.minDate&&(n=n.plus(this.timePicker?this.timePickerStepSize:{days:1})),i.new=n,i.new.equals(i.old)||r.endDate.violations.push(i)),this.maxSpan){const e=a.plus(this.maxSpan);n>e&&(i={old:n,reason:"maxSpan"},n=n.minus({seconds:Math.trunc(e.diff(n).as("seconds")/f)*f}),n>e&&(n=n.minus(this.timePicker?this.timePickerStepSize:{days:1})),i.new=n,i.new.equals(i.old)||r.endDate.violations.push(i))}if(this.minSpan){const e=a.plus(this.defaultSpan??this.minSpan);n<e&&(i={old:n,reason:"minSpan"},n=n.plus({seconds:Math.trunc(e.diff(n).as("seconds")/f)*f}),n<e&&(n=n.plus(this.timePicker?this.timePickerStepSize:{days:1})),i.new=n,i.new.equals(i.old)||r.endDate.violations.push(i))}if(this.isInvalidDate(n)&&r.endDate.violations.push({old:n,reason:"isInvalidDate"}),this.timePicker)for(let e of c)this.isInvalidTime(n,e,"end")&&r.endDate.violations.push({old:n,reason:"isInvalidTime",unit:e});if(r.startDate.violations.length==0&&r.endDate.violations.length==0)return null;if(t){let e={startDate:a,endDate:n};return this.element.triggerHandler("violated.daterangepicker",[this,r,e])&&(r.newDate=e),r}else return r}updateView(){this.timePicker&&(this.element.trigger("beforeRenderTimePicker.daterangepicker",this),this.renderTimePicker("start"),this.renderTimePicker("end"),this.#e?this.container.find(".calendar-time.end-time select").prop("disabled",!1).removeClass("disabled"):this.container.find(".calendar-time.end-time select").prop("disabled",!0).addClass("disabled")),this.updateLabel(),this.updateMonthsInView(),this.updateCalendars(),this.setApplyBtnState()}updateMonthsInView(){if(this.#e){if(!this.singleDatePicker&&this.leftCalendar.month&&this.rightCalendar.month&&(this.#t.hasSame(this.leftCalendar.month,"month")||this.#t.hasSame(this.rightCalendar.month,"month"))&&(this.#e.hasSame(this.leftCalendar.month,"month")||this.#e.hasSame(this.rightCalendar.month,"month")))return;this.leftCalendar.month=this.#t.startOf("month"),this.singleMonthView||(!this.linkedCalendars&&!this.#e.hasSame(this.#t,"month")?this.rightCalendar.month=this.#e.startOf("month"):this.rightCalendar.month=this.#t.startOf("month").plus({month:1}))}else!this.#t&&this.initalMonth?(this.leftCalendar.month=this.initalMonth,this.singleMonthView||(this.rightCalendar.month=this.initalMonth.plus({month:1}))):!this.leftCalendar.month.hasSame(this.#t,"month")&&!this.rightCalendar.month.hasSame(this.#t,"month")&&(this.leftCalendar.month=this.#t.startOf("month"),this.rightCalendar.month=this.#t.startOf("month").plus({month:1}));this.maxDate&&this.linkedCalendars&&!this.singleDatePicker&&!this.singleMonthView&&this.rightCalendar.month>this.maxDate&&(this.rightCalendar.month=this.maxDate.startOf("month"),this.leftCalendar.month=this.maxDate.startOf("month").minus({month:1}))}updateCalendars(){if(this.timePicker){var s,t,a;this.#e?(s=parseInt(this.container.find(".start-time .hourselect").val(),10),isNaN(s)&&(s=parseInt(this.container.find(".start-time .hourselect option:last").val(),10)),t=0,this.timePickerOpts.showMinutes&&(t=parseInt(this.container.find(".start-time .minuteselect").val(),10),isNaN(t)&&(t=parseInt(this.container.find(".start-time .minuteselect option:last").val(),10))),a=0,this.timePickerOpts.showSeconds&&(a=parseInt(this.container.find(".start-time .secondselect").val(),10),isNaN(a)&&(a=parseInt(this.container.find(".start-time .secondselect option:last").val(),10)))):(s=parseInt(this.container.find(".end-time .hourselect").val(),10),isNaN(s)&&(s=parseInt(this.container.find(".end-time .hourselect option:last").val(),10)),t=0,this.timePickerOpts.showMinutes&&(t=parseInt(this.container.find(".end-time .minuteselect").val(),10),isNaN(t)&&(t=parseInt(this.container.find(".end-time .minuteselect option:last").val(),10))),a=0,this.timePickerOpts.showSeconds&&(a=parseInt(this.container.find(".end-time .secondselect").val(),10),isNaN(a)&&(a=parseInt(this.container.find(".end-time .secondselect option:last").val(),10)))),this.leftCalendar.month=this.leftCalendar.month.set({hour:s,minute:t,second:a}),this.singleMonthView||(this.rightCalendar.month=this.rightCalendar.month.set({hour:s,minute:t,second:a}))}else this.leftCalendar.month=this.leftCalendar.month.set({hour:0,minute:0,second:0}),this.singleMonthView||(this.rightCalendar.month=this.rightCalendar.month.set({hour:0,minute:0,second:0}));this.element.trigger("beforeRenderCalendar.daterangepicker",this),this.renderCalendar("left"),this.renderCalendar("right"),this.container.find(".ranges li").removeClass("active"),this.#e!=null&&this.calculateChosenLabel()}renderCalendar(s){if(s==="right"&&this.singleMonthView)return;var i=s==="left"?this.leftCalendar:this.rightCalendar;i.month==null&&!this.#t&&this.initalMonth&&(i.month=this.initalMonth.startOf("month"));const t=i.month.startOf("month"),a=i.month.endOf("month").startOf("day");var n=i.month.startOf("month").minus({day:1});const r={hour:i.month.hour,minute:i.month.minute,second:i.month.second};var i=[];i.firstDay=t,i.lastDay=a;for(var f=0;f<6;f++)i[f]=[];for(;n.weekday!=this.locale.firstDay;)n=n.minus({day:1});for(let m=0,k=-1;m<42;m++,n=n.plus({day:1}))m%7===0&&k++,i[k][m%7]=n.set(r);s==="left"?this.leftCalendar.calendar=i:this.rightCalendar.calendar=i;var c=s==="left"?this.minDate:this.#t,e=this.maxDate,l="<tr>";(this.showWeekNumbers||this.showISOWeekNumbers)&&(l+="<th></th>"),(!c||c<i.firstDay)&&(!this.linkedCalendars||s==="left")?l+='<th class="prev available"><span></span></th>':l+="<th></th>";var d=`${this.locale.monthNames[i.firstDay.month-1]} ${i.firstDay.year}`;if(this.showDropdowns){const m=(e&&e.year)??this.maxYear,k=(c&&c.year)??this.minYear;let O=this.externalStyle==="bulma"?'<div class="select is-small mr-1">':"";for(var p=`${O}<select class="monthselect">`,u=1;u<=12;u++)p+=`<option value="${u}"${u===i.firstDay.month?" selected":""}`,(c&&i.firstDay.set({month:u})<c.startOf("month")||e&&i.firstDay.set({month:u})>e.endOf("month"))&&(p+=" disabled"),p+=`>${this.locale.monthNames[u-1]}</option>`;p+="</select>",this.externalStyle==="bulma"&&(p+="</div>"),O=this.externalStyle==="bulma"?'<div class="select is-small ml-1">':"";for(var g=`${O}<select class="yearselect">`,y=k;y<=m;y++)g+=`<option value="${y}"${y===i.firstDay.year?" selected":""}>${y}</option>`;g+="</select>",this.externalStyle==="bulma"&&(g+="</div>"),d=p+g}l+='<th colspan="5" class="month">'+d+"</th>",(!e||e>i.lastDay.endOf("day"))&&(!this.linkedCalendars||s==="right"||this.singleDatePicker||this.singleMonthView)?l+='<th class="next available"><span></span></th>':l+="<th></th>",l+="</tr>",l+="<tr>",(this.showWeekNumbers||this.showISOWeekNumbers)&&(l+=`<th class="week">${this.locale.weekLabel}</th>`);for(let[m,k]of this.locale.daysOfWeek.entries())l+="<th",this.weekendDayClasses&&this.weekendDayClasses.length&&w.getWeekendWeekdays().includes(m+1)&&(l+=` class="${this.weekendDayClasses}"`),l+=`>${k}</th>`;if(l+="</tr>",this.container.find(".drp-calendar."+s+" .calendar-table thead").html(l),l="",this.#e==null&&this.maxSpan){var v=this.#t.plus(this.maxSpan).endOf("day");(!e||v<e)&&(e=v)}var D;this.#e==null&&this.minSpan&&(D=this.#t.plus(this.minSpan).startOf("day"));for(let m=0;m<6;m++){l+="<tr>",this.showISOWeekNumbers?l+='<td class="week">'+i[m][0].weekNumber+"</td>":this.showWeekNumbers&&(l+='<td class="week">'+i[m][0].localWeekNumber+"</td>");for(let k=0;k<7;k++){var S=[];this.todayClasses&&this.todayClasses.length&&i[m][k].hasSame(o.now(),"day")&&S.push(this.todayClasses),this.weekendClasses&&this.weekendClasses.length&&w.getWeekendWeekdays().includes(i[m][k].weekday)&&S.push(this.weekendClasses),i[m][k].month!=i[1][1].month&&S.push("off","ends"),this.minDate&&i[m][k].startOf("day")<this.minDate.startOf("day")&&S.push("off","disabled"),e&&i[m][k].startOf("day")>e.startOf("day")&&S.push("off","disabled"),D&&i[m][k].startOf("day")>this.#t.startOf("day")&&i[m][k].startOf("day")<D.startOf("day")&&S.push("off","disabled"),this.isInvalidDate(i[m][k])&&S.push("off","disabled"),this.#t!=null&&i[m][k].hasSame(this.#t,"day")&&S.push("active","start-date"),this.#e!=null&&i[m][k].hasSame(this.#e,"day")&&S.push("active","end-date"),this.#e!=null&&i[m][k]>this.#t&&i[m][k]<this.#e&&S.push("in-range");var C=this.isCustomDate(i[m][k]);C!==!1&&(typeof C=="string"?S.push(C):Array.prototype.push.apply(S,C)),S.includes("disabled")||S.push("available"),l+=`<td class="${S.join(" ")}" data-title="r${m}c${k}">${i[m][k].day}</td>`}l+="</tr>"}this.container.find(".drp-calendar."+s+" .calendar-table tbody").html(l)}renderTimePicker(s){if(s==="end"&&!this.#e)return;var t,a,n,r=this.maxDate;let i="";if((this.showWeekNumbers||this.showISOWeekNumbers)&&(i+="<th></th>"),this.maxSpan&&(!this.maxDate||this.#t.plus(this.maxSpan)<this.maxDate)&&(r=this.#t.plus(this.maxSpan)),this.minSpan&&s==="end"&&(a=this.#t.plus(this.defaultSpan??this.minSpan)),s==="start")t=this.#t,n=this.minDate;else if(s==="end"){t=this.#e,n=this.#t;var f=this.container.find(".drp-calendar .calendar-time.end-time");f.html()!=""&&(t=t.set({hour:isNaN(t.hour)?f.find(".hourselect option:selected").val():t.hour,minute:isNaN(t.minute)?f.find(".minuteselect option:selected").val():t.minute,second:isNaN(t.second)?f.find(".secondselect option:selected").val():t.second})),t<this.#t&&(t=this.#t),r&&t>r&&(t=r)}i+='<th colspan="7">',this.externalStyle==="bulma"&&(i+='<div class="select is-small mx-1">'),i+='<select class="hourselect">';const c=t.toFormat("a",{locale:"en-US"});let e=0;this.timePicker24Hour||(e=c==="AM"?1:13);for(var l=e;l<=e+23;l+=this.timePickerOpts.hourStep){let g=t.set({hour:l%24}),y=!1;if(n&&g.set({minute:59})<n&&(y=!0),r&&g.set({minute:0})>r&&(y=!0),a&&g.endOf("hour")<a&&(y=!0),!y&&this.isInvalidTime(g,this.singleDatePicker?null:s,"hour")&&(y=!0),this.timePicker24Hour)!y&&l==t.hour?i+=`<option value="${l}" selected>${l}</option>`:y?i+=`<option value="${l}" disabled class="disabled">${l}</option>`:i+=`<option value="${l}">${l}</option>`;else{const v=o.fromFormat(`${l%24}`,"H").toFormat("h"),D=o.fromFormat(`${l%24}`,"H").toFormat("a",{locale:"en-US"});c==D?!y&&l==t.hour?i+=`<option ampm="${D}" value="${l%24}" selected>${v}</option>`:y?i+=`<option ampm="${D}" value="${l%24}" disabled class="disabled">${v}</option>`:i+=`<option ampm="${D}" value="${l%24}">${v}</option>`:i+=`<option ampm="${D}" hidden="hidden" value="${l%24}">${v}</option>`}}if(i+="</select>",this.externalStyle==="bulma"&&(i+="</div>"),this.timePickerOpts.showMinutes){i+=" : ",this.externalStyle==="bulma"&&(i+='<div class="select is-small mx-1">'),i+='<select class="minuteselect">';for(var l=0;l<60;l+=this.timePickerOpts.minuteStep){var d=l<10?"0"+l:l;let y=t.set({minute:l}),v=!1;n&&y.set({second:59})<n&&(v=!0),r&&y.set({second:0})>r&&(v=!0),a&&y.endOf("minute")<a&&(v=!0),!v&&this.isInvalidTime(y,this.singleDatePicker?null:s,"minute")&&(v=!0),t.minute==l&&!v?i+=`<option value="${l}" selected>${d}</option>`:v?i+=`<option value="${l}" disabled class="disabled">${d}</option>`:i+=`<option value="${l}">${d}</option>`}i+="</select>",this.externalStyle==="bulma"&&(i+="</div>")}if(this.timePickerOpts.showSeconds){i+=" : ",this.externalStyle==="bulma"&&(i+='<div class="select is-small mx-1">'),i+='<select class="secondselect">';for(var l=0;l<60;l+=this.timePickerOpts.secondStep){var d=l<10?"0"+l:l;let v=t.set({second:l}),D=!1;n&&v<n&&(D=!0),r&&v>r&&(D=!0),a&&v<a&&(D=!0),!D&&this.isInvalidTime(v,this.singleDatePicker?null:s,"second")&&(D=!0),t.second==l&&!D?i+=`<option value="${l}" selected>${d}</option>`:D?i+=`<option value="${l}" disabled class="disabled">${d}</option>`:i+=`<option value="${l}">${d}</option>`}i+="</select>",this.externalStyle==="bulma"&&(i+="</div>")}if(!this.timePicker24Hour){this.externalStyle==="bulma"&&(i+='<div class="select is-small mx-1">'),i+='<select class="ampmselect">';var p="",u="";let g=!1;n&&t.startOf("day")<n&&(g=!0),r&&t.endOf("day")>r&&(g=!0),a&&t.startOf("day")<a&&(g=!0),g?(p=' disabled class="disabled "',u=' disabled class="disabled"'):this.isInvalidTime(t,this.singleDatePicker?null:s,"ampm")&&(t.toFormat("a",{locale:"en-US"})==="AM"?u=' disabled class="disabled"':p=' disabled class="disabled"'),i+=`<option value="AM"${p}`,t.toFormat("a",{locale:"en-US"})==="AM"&&(i+=" selected"),i+=`>${w.meridiems()[0]}</option><option value="PM"${u}`,t.toFormat("a",{locale:"en-US"})==="PM"&&(i+=" selected"),i+=`>${w.meridiems()[1]}</option>`,i+="</select>",this.externalStyle==="bulma"&&(i+="</div>")}i+="</div></th>",this.container.find(`.drp-calendar .calendar-time.${s}-time`).html(i)}setApplyBtnState(){this.singleDatePicker||this.#e&&this.#t<=this.#e?this.container.find("button.applyBtn").prop("disabled",!1):this.container.find("button.applyBtn").prop("disabled",!0)}move(){var s={top:0,left:0},t,a=this.drops,n=h(window).width();switch(this.parentEl.is("body")||(s={top:this.parentEl.offset().top-this.parentEl.scrollTop(),left:this.parentEl.offset().left-this.parentEl.scrollLeft()},n=this.parentEl[0].clientWidth+this.parentEl.offset().left),a){case"auto":t=this.element.offset().top+this.element.outerHeight()-s.top,t+this.container.outerHeight()>=this.parentEl[0].scrollHeight&&(t=this.element.offset().top-this.container.outerHeight()-s.top,a="up");break;case"up":t=this.element.offset().top-this.container.outerHeight()-s.top;break;default:t=this.element.offset().top+this.element.outerHeight()-s.top;break}this.container.css({top:0,left:0,right:"auto"});var r=this.container.outerWidth();if(this.container.toggleClass("drop-up",a==="up"),this.opens==="left"){var i=n-this.element.offset().left-this.element.outerWidth();r+i>h(window).width()?this.container.css({top:t,right:"auto",left:9}):this.container.css({top:t,right:i,left:"auto"})}else if(this.opens==="center"){var f=this.element.offset().left-s.left+this.element.outerWidth()/2-r/2;f<0?this.container.css({top:t,right:"auto",left:9}):f+r>h(window).width()?this.container.css({top:t,left:"auto",right:0}):this.container.css({top:t,left:f,right:"auto"})}else{var f=this.element.offset().left-s.left;f+r>h(window).width()?this.container.css({top:t,left:"auto",right:0}):this.container.css({top:t,left:f,right:"auto"})}}show(){this.isShowing||(this._outsideClickProxy=function(s){this.outsideClick(s)}.bind(this),h(document).on("mousedown.daterangepicker",this._outsideClickProxy).on("touchend.daterangepicker",this._outsideClickProxy).on("click.daterangepicker","[data-toggle=dropdown]",this._outsideClickProxy).on("focusin.daterangepicker",this._outsideClickProxy),h(window).on("resize.daterangepicker",function(s){this.move(s)}.bind(this)),this.oldStartDate=this.#t,this.oldEndDate=this.#e,this.updateView(),this.container.show(),this.move(),this.element.trigger("show.daterangepicker",this),this.isShowing=!0)}hide(){this.isShowing&&(this.#e||(this.#t=this.oldStartDate,this.#e=this.oldEndDate),(!this.#t.equals(this.oldStartDate)||!this.#e.equals(this.oldEndDate))&&this.callback(this.startDate,this.endDate,this.chosenLabel),this.updateElement(),!this.element.triggerHandler("beforeHide.daterangepicker",this)&&(h(document).off(".daterangepicker"),h(window).off(".daterangepicker"),this.container.hide(),this.element.trigger("hide.daterangepicker",this),this.isShowing=!1))}toggle(){this.isShowing?this.hide():this.show()}showCalendars(){this.container.addClass("show-calendar"),this.move(),this.element.trigger("showCalendar.daterangepicker",this)}hideCalendars(){this.container.removeClass("show-calendar"),this.element.trigger("hideCalendar.daterangepicker",this)}outsideClick(s){var t=h(s.target);s.type==="focusin"||t.closest(this.element).length||t.closest(this.container).length||t.closest(".calendar-table").length||(this.onOutsideClick==="cancel"&&(this.#t=this.oldStartDate,this.#e=this.oldEndDate),this.hide(),this.element.trigger("outsideClick.daterangepicker",this))}clickPrev(s){var t=h(s.target).parents(".drp-calendar");t.hasClass("left")?(this.leftCalendar.month=this.leftCalendar.month.minus({month:1}),this.linkedCalendars&&!this.singleMonthView&&(this.rightCalendar.month=this.rightCalendar.month.minus({month:1}))):this.rightCalendar.month=this.rightCalendar.month.minus({month:1}),this.updateCalendars()}clickNext(s){var t=h(s.target).parents(".drp-calendar");t.hasClass("left")?this.leftCalendar.month=this.leftCalendar.month.plus({month:1}):(this.rightCalendar.month=this.rightCalendar.month.plus({month:1}),this.linkedCalendars&&(this.leftCalendar.month=this.leftCalendar.month.plus({month:1}))),this.updateCalendars()}hoverDate(s){if(!h(s.target).hasClass("available"))return;let t=h(s.target).attr("data-title");const a=t.substring(1,2),n=t.substring(3,4);var i=h(s.target).parents(".drp-calendar").hasClass("left")?this.leftCalendar.calendar[a][n]:this.rightCalendar.calendar[a][n];const f=this.leftCalendar,c=this.rightCalendar,e=this.#t,l=this.initalMonth;this.#e||this.container.find(".drp-calendar tbody td").each(function(d,p){if(h(p).hasClass("week"))return;const u=h(p).attr("data-title"),g=u.substring(1,2),y=u.substring(3,4),D=h(p).parents(".drp-calendar").hasClass("left")?f.calendar[g][y]:c.calendar[g][y];!e&&l?h(p).removeClass("in-range"):D>e&&D<i||D.hasSame(i,"day")?h(p).addClass("in-range"):h(p).removeClass("in-range")})}hoverRange(s){const t=s.target.getAttribute("data-range-key"),a=[this.#t,this.#e],n=this.ranges[t]??[this.#t,this.#e],r=this.leftCalendar,i=this.rightCalendar;this.container.find(".drp-calendar tbody td").each(function(f,c){if(h(c).hasClass("week"))return;const e=h(c).attr("data-title"),l=e.substring(1,2),d=e.substring(3,4),u=h(c).parents(".drp-calendar").hasClass("left")?r.calendar[l][d]:i.calendar[l][d];let g=!1;u.hasSame(n[0],"day")&&(g=h(c).addClass("start-hover").length>0),u.hasSame(a[0],"day")&&(g=h(c).addClass("start-date").length>0),u.hasSame(n[1],"day")&&(g=h(c).addClass("end-hover").length>0),a[1]!=null&&u.hasSame(a[1],"day")&&(g=h(c).addClass("end-date").length>0),u.startOf("day")>=n[0].startOf("day")&&u.startOf("day")<=n[1].startOf("day")&&(g=h(c).addClass("range-hover").length>0),u.startOf("day")>=a[0].startOf("day")&&a[1]!=null&&u.startOf("day")<=a[1].startOf("day")&&(g=h(c).addClass("in-range").length>0),g||(h(c).removeClass("start-hover"),h(c).removeClass("end-hover"),h(c).removeClass("start-date"),h(c).removeClass("end-date"),h(c).removeClass("in-range"),h(c).removeClass("range-hover"))})}leaveRange(s){this.container.find(".drp-calendar tbody td").each(function(t,a){h(a).hasClass("week")||(h(a).removeClass("start-hover"),h(a).removeClass("end-hover"),h(a).removeClass("range-hover"))})}clickRange(s){var t=s.target.getAttribute("data-range-key");if(this.chosenLabel=t,t==this.locale.customRangeLabel)this.showCalendars();else{var a=this.ranges[t];this.#t=a[0],this.#e=a[1],this.timePicker||(this.#t.startOf("day"),this.#e.endOf("day")),this.alwaysShowCalendars||this.hideCalendars(),this.element.triggerHandler("beforeHide.daterangepicker",this)&&this.updateView(),this.clickApply()}}clickDate(s){if(!h(s.target).hasClass("available"))return;var t=h(s.target).attr("data-title"),a=t.substring(1,2),n=t.substring(3,4),r=h(s.target).parents(".drp-calendar"),i=r.hasClass("left")?this.leftCalendar.calendar[a][n]:this.rightCalendar.calendar[a][n];let f;if(this.#e||!this.#t||i<this.#t.startOf("day")){if(this.timePicker){let c=parseInt(this.container.find(".start-time .hourselect").val(),10);isNaN(c)&&(c=parseInt(this.container.find(".start-time .hourselect option:last").val(),10));let e=0;this.timePickerOpts.showMinutes&&(e=parseInt(this.container.find(".start-time .minuteselect").val(),10),isNaN(e)&&(e=parseInt(this.container.find(".start-time .minuteselect option:last").val(),10)));let l=0;this.timePickerOpts.showSeconds&&(l=parseInt(this.container.find(".start-time .secondselect").val(),10),isNaN(l)&&(l=parseInt(this.container.find(".start-time .secondselect option:last").val(),10))),i=i.set({hour:c,minute:e,second:l})}else i=i.startOf("day");this.#e=null,this.#t=i,f="start"}else if(!this.#e&&i<this.#t)this.#e=this.#t,f="end";else{if(this.timePicker){let c=parseInt(this.container.find(".end-time .hourselect").val(),10);isNaN(c)&&(c=parseInt(this.container.find(".end-time .hourselect option:last").val(),10));let e=0;this.timePickerOpts.showMinutes&&(e=parseInt(this.container.find(".end-time .minuteselect").val(),10),isNaN(e)&&(e=parseInt(this.container.find(".end-time .minuteselect option:last").val(),10)));let l=0;this.timePickerOpts.showSeconds&&(l=parseInt(this.container.find(".end-time .secondselect").val(),10),isNaN(l)&&(l=parseInt(this.container.find(".end-time .secondselect option:last").val(),10))),i=i.set({hour:c,minute:e,second:l})}else i=i.endOf("day");this.#e=i,this.autoApply&&(this.calculateChosenLabel(),this.clickApply()),f="end"}this.singleDatePicker&&(this.#e=this.#t,!this.timePicker&&this.autoApply&&this.clickApply(),f=null),this.updateView(),s.stopPropagation(),this.autoUpdateInput&&this.updateElement(),this.element.trigger("dateChange.daterangepicker",[this,f])}calculateChosenLabel(){var s=!0,t=0;for(var a in this.ranges){var n=this.timePicker?"hour":"day";if(this.timePicker&&(this.timePickerOpts.showMinutes?n="minute":this.timePickerOpts.showSeconds&&(n="second")),this.#t.startOf(n).equals(this.ranges[a][0].startOf(n))&&this.#e.startOf(n).equals(this.ranges[a][1].startOf(n))){s=!1,this.chosenLabel=this.container.find(".ranges li:eq("+t+")").addClass("active").attr("data-range-key");break}t++}s&&(this.showCustomRangeLabel?this.chosenLabel=this.container.find(".ranges li:last").addClass("active").attr("data-range-key"):this.chosenLabel=null,this.showCalendars())}timeChanged(s){const t=h(s.target).closest(".calendar-time"),a=t.hasClass("start-time")?"start":"end";var n=parseInt(t.find(".hourselect").val(),10);if(isNaN(n)&&(n=parseInt(t.find(".hourselect option:last").val(),10)),!this.timePicker24Hour){const f=t.find(".ampmselect").val();if(f==null&&t.find(".ampmselect option:last").val(),f!=o.fromFormat(`${n}`,"H").toFormat("a",{locale:"en-US"})){t.find(".hourselect > option").each(function(){const e=h(this).attr("hidden")||!1;h(this).attr("hidden",e)});const c=o.fromFormat(`${n}`,"H").toFormat("h");n=o.fromFormat(`${c}${f}`,"ha",{locale:"en-US"}).hour}}var r=0;this.timePickerOpts.showMinutes&&(r=parseInt(t.find(".minuteselect").val(),10),isNaN(r)&&(r=parseInt(t.find(".minuteselect option:last").val(),10)));var i=0;this.timePickerOpts.showSeconds&&(i=parseInt(t.find(".secondselect").val(),10),isNaN(i)&&(i=parseInt(t.find(".secondselect option:last").val(),10))),a==="start"?(this.#t&&(this.#t=this.#t.set({hour:n,minute:r,second:i})),this.singleDatePicker?this.#e=this.#t:this.#e&&this.#e.hasSame(this.#t,"day")&&this.#e<this.#t&&(this.#e=this.#t)):this.#e&&(this.#e=this.#e.set({hour:n,minute:r,second:i})),this.updateCalendars(),this.setApplyBtnState(),this.element.trigger("beforeRenderTimePicker.daterangepicker",this),this.renderTimePicker("start"),this.renderTimePicker("end"),this.autoUpdateInput&&this.updateElement(),this.element.trigger("timeChange.daterangepicker",[this,this.singleDatePicker?null:a])}monthOrYearChanged(s){var t=h(s.target).closest(".drp-calendar").hasClass("left"),a=t?"left":"right",n=this.container.find(".drp-calendar."+a),r=parseInt(n.find(".monthselect").val(),10),i=n.find(".yearselect").val();t||(i<this.#t.year||i==this.#t.year&&r<this.#t.month)&&(r=this.#t.month,i=this.#t.year),this.minDate&&(i<this.minDate.year||i==this.minDate.year&&r<this.minDate.month)&&(r=this.minDate.month,i=this.minDate.year),this.maxDate&&(i>this.maxDate.year||i==this.maxDate.year&&r>this.maxDate.month)&&(r=this.maxDate.month,i=this.maxDate.year),t?(this.leftCalendar.month=this.leftCalendar.month.set({year:i,month:r}),this.linkedCalendars&&(this.rightCalendar.month=this.leftCalendar.month.plus({month:1}))):(this.rightCalendar.month=this.rightCalendar.month.set({year:i,month:r}),this.linkedCalendars&&(this.leftCalendar.month=this.rightCalendar.month.minus({month:1}))),this.updateCalendars()}clickApply(){this.hide(),this.element.trigger("apply.daterangepicker",this)}clickCancel(){this.#t=this.oldStartDate,this.#e=this.oldEndDate,this.hide(),this.element.trigger("cancel.daterangepicker",this)}elementChanged(){if(!this.element.is("input:text")||!this.element.val().length)return;const s=typeof this.locale.format=="string"?this.locale.format:o.parseFormatForOpts(this.locale.format),t=this.element.val().split(this.locale.separator);if(this.singleDatePicker){let a=o.fromFormat(this.element.val(),s,{locale:o.now().locale});const n=this.#t;if(!a.isValid||n.equals(a))return;const r=this.validateInput([a,null],!0);if(r!=null)if(r.newDate!=null)a=r.newDate.startDate;else return;this.#t=a,this.#e=this.#t,this.timePicker||(this.#t=this.#t.startOf("day"),this.#e=this.#e.endOf("day"))}else if(!this.singleDatePicker&&t.length===2){const a=[0,1].map(i=>o.fromFormat(t[i],s,{locale:o.now().locale})),n=[this.#t,this.#e];if(!a[0].isValid||!a[1].isValid||n[0].equals(a[0])&&n[1].equals(a[1])||a[0]>a[1])return;const r=this.validateInput([a[0],a[1]],!0);if(r!=null)if(r.newDate!=null)a[0]=r.newDate.startDate,a[1]=r.newDate.endDate;else return;this.#t=a[0],this.#e=a[1],this.timePicker||(this.#t=this.#t.startOf("day"),this.#e=this.#e.endOf("day"))}else return;this.updateView(),this.updateElement(),this.element.trigger("inputChanged.daterangepicker",this)}keydown(s){(s.keyCode===9||s.keyCode===13)&&this.hide(),s.keyCode===27&&(s.preventDefault(),s.stopPropagation(),this.hide())}updateElement(){if(!(this.#t==null&&this.initalMonth))if(this.element.is("input:text")){let s=this.formatDate(this.#t);this.singleDatePicker||(s+=this.locale.separator,this.#e&&(s+=this.formatDate(this.#e))),this.updateAltInput(),s!==this.element.val()&&this.element.val(s).trigger("change")}else this.updateAltInput()}updateAltInput(){if(this.altInput!=null)if(this.singleDatePicker&&h(this.altInput[1]).val(null),this.altFormat==null){let s="day";this.timePicker&&(this.timePickerOpts.showSeconds?s="second":this.timePickerOpts.showMinutes?s="minute":s="hour");const t=this.#t.toISO({format:"basic",precision:s,includeOffset:!1});if(h(this.singleDatePicker?this.altInput:this.altInput[0]).val(t),!this.singleDatePicker&&this.#e){const a=this.#e.toISO({format:"basic",precision:s,includeOffset:!1});h(this.altInput[1]).val(a)}}else{const s=typeof this.altFormat=="function"?this.altFormat(this.#t):this.formatDate(this.#t,this.altFormat);if(h(this.singleDatePicker?this.altInput:this.altInput[0]).val(s),!this.singleDatePicker&&this.#e){const t=typeof this.altFormat=="function"?this.altFormat(this.#e):this.formatDate(this.#e,this.altFormat);h(this.altInput[1]).val(t)}}}remove(){this.container.remove(),this.element.off(".daterangepicker"),this.element.removeData()}}h.fn.daterangepicker||(h.fn.daterangepicker=function(P,s){const t=h.extend(!0,{},h.fn.daterangepicker.defaultOptions,P);return this.each(function(){const a=h(this);a.data("daterangepicker")&&a.data("daterangepicker").remove(),a.data("daterangepicker",new I(a,t,s))}),this});var F=I;export{F as default};
@@ -365,7 +365,7 @@ var DateRangePicker = (() => {
365
365
  console.error(`Value of startDate "${this.#startDate}" violates ${vio.find((x) => x.reason.startsWith("isInvalid")).reason}`);
366
366
  } else {
367
367
  const newDate = vio.filter((x) => x.new != null).at(-1).new;
368
- if (process.env.JEST_WORKER_ID == null)
368
+ if (typeof process !== "undefined" && process.env.JEST_WORKER_ID == null)
369
369
  console.warn(`Correcting startDate from ${this.#startDate} to ${newDate}`);
370
370
  this.#startDate = newDate;
371
371
  }
@@ -377,7 +377,7 @@ var DateRangePicker = (() => {
377
377
  console.error(`Value of endDate "${this.#endDate}" violates ${vio.find((x) => x.reason.startsWith("isInvalid")).reason}`);
378
378
  } else {
379
379
  const newDate = vio.filter((x) => x.new != null).at(-1).new;
380
- if (process.env.JEST_WORKER_ID == null)
380
+ if (typeof process !== "undefined" && process.env.JEST_WORKER_ID == null)
381
381
  console.warn(`Correcting endDate from ${this.#endDate} to ${newDate}`);
382
382
  this.#endDate = newDate;
383
383
  }
@@ -1,2 +1,2 @@
1
- var DateRangePicker=(()=>{const h=luxon.DateTime,D=luxon.Duration,S=luxon.Info,P=luxon.Settings;class I{#t=null;#e=null;constructor(s,t,a){this.parentEl="body",this.element=$(s),this.#t=h.now().startOf("day"),this.#e=h.now().plus({day:1}).startOf("day"),this.minDate=null,this.maxDate=null,this.maxSpan=null,this.minSpan=null,this.defaultSpan=null,this.initalMonth=h.now().startOf("month"),this.autoApply=!1,this.singleDatePicker=!1,this.singleMonthView=!1,this.showDropdowns=!1,this.minYear=h.now().minus({year:100}).year,this.maxYear=h.now().plus({year:100}).year,this.showWeekNumbers=!1,this.showISOWeekNumbers=!1,this.showCustomRangeLabel=!0,this.showLabel=!$(this.element).is("input:text"),this.timePicker=!1;const n=new Intl.DateTimeFormat(h.now().locale,{hour:"numeric"}).resolvedOptions();if(this.timePicker24Hour=!n.hour12,this.timePickerStepSize=D.fromObject({minutes:1}),this.linkedCalendars=!0,this.autoUpdateInput=!0,this.alwaysShowCalendars=!1,this.isInvalidDate=null,this.isInvalidTime=null,this.isCustomDate=null,this.onOutsideClick="apply",this.opens=this.element.hasClass("pull-right")?"left":"right",this.drops=this.element.hasClass("dropup")?"up":"down",this.buttonClasses="btn btn-sm",this.applyButtonClasses="btn-primary",this.cancelButtonClasses="btn-default",this.weekendClasses="weekend",this.weekendDayClasses="weekend-day",this.todayClasses="today",this.altInput=null,this.altFormat=null,this.externalStyle=null,this.ranges={},this.locale={direction:"ltr",format:h.DATE_SHORT,separator:" - ",applyLabel:"Apply",cancelLabel:"Cancel",weekLabel:"W",customRangeLabel:"Custom Range",daysOfWeek:S.weekdays("short"),monthNames:S.months("long"),firstDay:S.getStartOfWeek(),durationFormat:null},this.callback=function(){},this.isShowing=!1,this.leftCalendar={},this.rightCalendar={},(typeof t!="object"||t===null)&&(t={}),t=$.extend(this.element.data(),t),typeof t.singleDatePicker=="boolean"&&(this.singleDatePicker=t.singleDatePicker),!this.singleDatePicker&&typeof t.singleMonthView=="boolean"?this.singleMonthView=t.singleMonthView:this.singleMonthView=!1,typeof t.externalStyle=="string"&&["bulma"].includes(t.externalStyle)&&(this.externalStyle=t.externalStyle),typeof t.template!="string"&&!(t.template instanceof $)){let e=['<div class="daterangepicker">','<div class="ranges"></div>','<div class="drp-calendar left">','<table class="calendar-table">',"<thead></thead>","<tbody></tbody>","<tfoot>",'<tr class="calendar-time start-time"></tr>'];this.singleMonthView&&e.push('<tr class="calendar-time end-time"></tr>'),e.push("</tfoot>","</table>","</div>"),e.push('<div class="drp-calendar right">','<table class="calendar-table">',"<thead></thead>","<tbody></tbody>","<tfoot>",'<tr class="calendar-time end-time"></tr>',"</tfoot>","</table>","</div>"),e.push('<div class="drp-buttons">','<div class="drp-duration-label"></div>','<div class="drp-selected"></div>'),this.externalStyle==="bulma"?e.push('<div class="buttons">','<button class="cancelBtn button is-small" type="button"></button>','<button class="applyBtn button is-small" disabled type="button"></button>',"</div>"):e.push("<div>",'<button class="cancelBtn" type="button"></button>','<button class="applyBtn" disabled type="button"></button>',"</div>"),e.push("</div></div>"),t.template=e.join("")}if(this.parentEl=t.parentEl&&$(t.parentEl).length?$(t.parentEl):$(this.parentEl),this.container=$(t.template).appendTo(this.parentEl),typeof t.timePicker=="boolean"&&(this.timePicker=t.timePicker),this.timePicker&&(this.locale.format=h.DATETIME_SHORT),typeof t.locale=="object"){for(let e of["separator","applyLabel","cancelLabel","weekLabel"])typeof t.locale[e]=="string"&&(this.locale[e]=t.locale[e]);if(typeof t.locale.direction=="string"&&(["rtl","ltr"].includes(t.locale.direction)?this.locale.direction=t.locale.direction:console.error("Option 'options.locale.direction' must be 'rtl' or 'ltr'")),["string","object"].includes(typeof t.locale.format)&&(this.locale.format=t.locale.format),Array.isArray(t.locale.daysOfWeek)&&(t.locale.daysOfWeek.some(e=>typeof e!="string")?console.error("Option 'options.locale.daysOfWeek' must be an array of strings"):this.locale.daysOfWeek=t.locale.daysOfWeek.slice()),Array.isArray(t.locale.monthNames)&&(t.locale.monthNames.some(e=>typeof e!="string")?console.error("Option 'locale.monthNames' must be an array of strings"):this.locale.monthNames=t.locale.monthNames.slice()),typeof t.locale.firstDay=="number"&&(this.locale.firstDay=t.locale.firstDay),typeof t.locale.customRangeLabel=="string"){var r=document.createElement("textarea");r.innerHTML=t.locale.customRangeLabel;var i=r.value;this.locale.customRangeLabel=i}["string","object","function"].includes(typeof t.locale.durationFormat)&&t.locale.durationFormat!=null&&(this.locale.durationFormat=t.locale.durationFormat)}this.container.addClass(this.locale.direction);for(let e of["timePicker24Hour","showWeekNumbers","showISOWeekNumbers","showDropdowns","linkedCalendars","showCustomRangeLabel","alwaysShowCalendars","autoApply","autoUpdateInput","showLabel"])typeof t[e]=="boolean"&&(this[e]=t[e]);for(let e of["applyButtonClasses","cancelButtonClasses","weekendClasses","weekendDayClasses","todayClasses"])typeof t[e]=="string"?this[e]=t[e]:["weekendClasses","weekendDayClasses","todayClasses"].includes(e)&&t[e]===null&&(this[e]=t[e]);for(let e of["minYear","maxYear"])typeof t[e]=="number"&&(this[e]=t[e]);for(let e of["isInvalidDate","isInvalidTime","isCustomDate"])typeof t[e]=="function"?this[e]=t[e]:this[e]=function(){return!1};if(!this.singleDatePicker){for(let e of["minSpan","maxSpan","defaultSpan"])["string","number","object"].includes(typeof t[e])&&(D.isDuration(t[e])&&t[e].isValid?this[e]=t[e]:D.fromISO(t[e]).isValid?this[e]=D.fromISO(t[e]):typeof t[e]=="number"&&D.fromObject({seconds:t[e]}).isValid?this[e]=D.fromObject({seconds:t[e]}):t[e]===null?this[e]=null:console.error(`Option '${key}' is not valid`));this.minSpan&&this.maxSpan&&this.minSpan>this.maxSpan&&(this.minSpan=null,this.maxSpan=null,console.warn("Ignore option 'minSpan' and 'maxSpan', because 'minSpan' must be smaller than 'maxSpan'")),this.defaultSpan&&this.minSpan&&this.minSpan>this.defaultSpan?(this.defaultSpan=null,console.warn("Ignore option 'defaultSpan', because 'defaultSpan' must be greater than 'minSpan'")):this.defaultSpan&&this.maxSpan&&this.maxSpan<this.defaultSpan&&(this.defaultSpan=null,console.warn("Ignore option 'defaultSpan', because 'defaultSpan' must be smaller than 'maxSpan'"))}if(this.timePicker){if(typeof t.timePickerSeconds=="boolean"&&(this.timePickerStepSize=D.fromObject({[t.timePickerSeconds?"seconds":"minutes"]:1})),typeof t.timePickerIncrement=="number"&&(this.timePickerStepSize=D.fromObject({minutes:t.timePickerIncrement})),["string","object","number"].includes(typeof t.timePickerStepSize)){let e;D.isDuration(t.timePickerStepSize)&&t.timePickerStepSize.isValid?e=t.timePickerStepSize:D.fromISO(t.timePickerStepSize).isValid?e=D.fromISO(t.timePickerStepSize):typeof t.timePickerStepSize=="number"&&D.fromObject({seconds:t.timePickerStepSize}).isValid?e=D.fromObject({seconds:t.timePickerStepSize}):(console.error("Option 'timePickerStepSize' is not valid"),e=this.timePickerStepSize);var c=[];for(let l of["minutes","seconds"])c.push(...[1,2,3,4,5,6,10,12,15,20,30].map(o=>D.fromObject({[l]:o})));c.push(...[1,2,3,4,6].map(l=>D.fromObject({hours:l}))),this.timePicker24Hour&&c.push(...[8,12].map(l=>D.fromObject({hours:l}))),c.some(l=>e.rescale().equals(l))?this.timePickerStepSize=e.rescale():console.error(`Option 'timePickerStepSize' ${JSON.stringify(e.toObject())} is not valid`)}this.maxSpan&&this.timePickerStepSize>this.maxSpan&&console.error(`Option 'timePickerStepSize' ${JSON.stringify(this.timePickerStepSize.toObject())} must be smaller than 'maxSpan'`),this.timePickerOpts={showMinutes:this.timePickerStepSize<D.fromObject({hours:1}),showSeconds:this.timePickerStepSize<D.fromObject({minutes:1}),hourStep:this.timePickerStepSize>=D.fromObject({hours:1})?this.timePickerStepSize.hours:1,minuteStep:this.timePickerStepSize>=D.fromObject({minutes:1})?this.timePickerStepSize.minutes:1,secondStep:this.timePickerStepSize.seconds}}for(let e of["startDate","endDate","minDate","maxDate","initalMonth"])if(!(e==="endDate"&&this.singleDatePicker)){if(typeof t[e]=="object")h.isDateTime(t[e])&&t[e].isValid?this[e]=t[e]:t[e]instanceof Date?this[e]=h.fromJSDate(t[e]):t[e]===null?this[e]=null:console.error(`Option '${e}' must be a luxon.DateTime or Date or string`);else if(typeof t[e]=="string"){const l=typeof this.locale.format=="string"?this.locale.format:h.parseFormatForOpts(this.locale.format);if(h.fromISO(t[e]).isValid)this[e]=h.fromISO(t[e]);else if(h.fromFormat(t[e],l,{locale:h.now().locale}).isValid)this[e]=h.fromFormat(t[e],l,{locale:h.now().locale});else{const o=h.fromFormat(t[e],l,{locale:h.now().locale}).invalidExplanation;console.error(`Option '${e}' is not a valid string: ${o}`)}}}if($(this.element).is("input:text")){const e=$(this.element).val();if(e!=""){const l=typeof this.locale.format=="string"?this.locale.format:h.parseFormatForOpts(this.locale.format);if(this.singleDatePicker&&typeof t.startDate>"u"){const o=h.fromFormat(e,l,{locale:h.now().locale});o.isValid?this.#t=o:console.error(`Value "${e}" in <input> is not a valid string: ${o.invalidExplanation}`)}else if(!this.singleDatePicker&&typeof t.startDate>"u"&&typeof t.endDate>"u"){const o=e.split(this.locale.separator);if(o.length===2){const u=h.fromFormat(o[0],l,{locale:h.now().locale}),m=h.fromFormat(o[1],l,{locale:h.now().locale});u.isValid&&m.isValid?(this.#t=u,this.#e=m):console.error(`Value in <input> is not a valid string: ${u.invalidExplanation} - ${m.invalidExplanation}`)}else console.error(`Value "${e}" in <input> is not a valid string`)}}}if(this.singleDatePicker?this.#e=this.#t:this.#e<this.#t&&console.error(`Option 'endDate' ${this.#e} must not be earlier than 'startDate' ${this.#t}`),this.timePicker||(this.minDate&&(this.minDate=this.minDate.startOf("day")),this.maxDate&&(this.maxDate=this.maxDate.endOf("day")),this.#t=this.#t.startOf("day"),this.#e=this.#e.endOf("day")),t.warnings!==void 0&&console.warn("Option 'warnings' not used anymore. Listen to event 'violated.daterangepicker'"),!this.#t&&this.initalMonth)this.#e=null,this.timePicker&&console.error("Option 'initalMonth' works only with 'timePicker: false'");else{const e=this.validateInput(null,!1);if(e!=null){let l=e.startDate.violations;if(l.length>0)if(l.some(o=>o.reason.startsWith("isInvalid")))console.error(`Value of startDate "${this.#t}" violates ${l.find(o=>o.reason.startsWith("isInvalid")).reason}`);else{const o=l.filter(u=>u.new!=null).at(-1).new;process.env.JEST_WORKER_ID==null&&console.warn(`Correcting startDate from ${this.#t} to ${o}`),this.#t=o}if(!this.singleDatePicker&&(l=e.endDate.violations.filter(o=>o.new!=null),l.length>0))if(l.some(o=>o.reason.startsWith("isInvalid")))console.error(`Value of endDate "${this.#e}" violates ${l.find(o=>o.reason.startsWith("isInvalid")).reason}`);else{const o=l.filter(u=>u.new!=null).at(-1).new;process.env.JEST_WORKER_ID==null&&console.warn(`Correcting endDate from ${this.#e} to ${o}`),this.#e=o}}}if(["function","string"].includes(typeof t.altFormat)&&(this.altFormat=t.altFormat),typeof t.altInput=="string"||Array.isArray(t.altInput))if(this.singleDatePicker&&typeof t.altInput=="string")this.altInput=$(t.altInput).is("input:text")?t.altInput:null;else if(!this.singleDatePicker&&Array.isArray(t.altInput)&&t.altInput.length===2)this.altInput=t.altInput.every(e=>typeof e=="string"&&$(e).is("input:text"))?t.altInput:null;else{const e='Value of "altInput" must be '+(this.singleDatePicker?"a string":"an array of two string elements");console.error(`Option 'altInput' ${JSON.stringify(t.altInput)} is not valid
1
+ var DateRangePicker=(()=>{const h=luxon.DateTime,D=luxon.Duration,S=luxon.Info,P=luxon.Settings;class I{#t=null;#e=null;constructor(s,t,a){this.parentEl="body",this.element=$(s),this.#t=h.now().startOf("day"),this.#e=h.now().plus({day:1}).startOf("day"),this.minDate=null,this.maxDate=null,this.maxSpan=null,this.minSpan=null,this.defaultSpan=null,this.initalMonth=h.now().startOf("month"),this.autoApply=!1,this.singleDatePicker=!1,this.singleMonthView=!1,this.showDropdowns=!1,this.minYear=h.now().minus({year:100}).year,this.maxYear=h.now().plus({year:100}).year,this.showWeekNumbers=!1,this.showISOWeekNumbers=!1,this.showCustomRangeLabel=!0,this.showLabel=!$(this.element).is("input:text"),this.timePicker=!1;const n=new Intl.DateTimeFormat(h.now().locale,{hour:"numeric"}).resolvedOptions();if(this.timePicker24Hour=!n.hour12,this.timePickerStepSize=D.fromObject({minutes:1}),this.linkedCalendars=!0,this.autoUpdateInput=!0,this.alwaysShowCalendars=!1,this.isInvalidDate=null,this.isInvalidTime=null,this.isCustomDate=null,this.onOutsideClick="apply",this.opens=this.element.hasClass("pull-right")?"left":"right",this.drops=this.element.hasClass("dropup")?"up":"down",this.buttonClasses="btn btn-sm",this.applyButtonClasses="btn-primary",this.cancelButtonClasses="btn-default",this.weekendClasses="weekend",this.weekendDayClasses="weekend-day",this.todayClasses="today",this.altInput=null,this.altFormat=null,this.externalStyle=null,this.ranges={},this.locale={direction:"ltr",format:h.DATE_SHORT,separator:" - ",applyLabel:"Apply",cancelLabel:"Cancel",weekLabel:"W",customRangeLabel:"Custom Range",daysOfWeek:S.weekdays("short"),monthNames:S.months("long"),firstDay:S.getStartOfWeek(),durationFormat:null},this.callback=function(){},this.isShowing=!1,this.leftCalendar={},this.rightCalendar={},(typeof t!="object"||t===null)&&(t={}),t=$.extend(this.element.data(),t),typeof t.singleDatePicker=="boolean"&&(this.singleDatePicker=t.singleDatePicker),!this.singleDatePicker&&typeof t.singleMonthView=="boolean"?this.singleMonthView=t.singleMonthView:this.singleMonthView=!1,typeof t.externalStyle=="string"&&["bulma"].includes(t.externalStyle)&&(this.externalStyle=t.externalStyle),typeof t.template!="string"&&!(t.template instanceof $)){let e=['<div class="daterangepicker">','<div class="ranges"></div>','<div class="drp-calendar left">','<table class="calendar-table">',"<thead></thead>","<tbody></tbody>","<tfoot>",'<tr class="calendar-time start-time"></tr>'];this.singleMonthView&&e.push('<tr class="calendar-time end-time"></tr>'),e.push("</tfoot>","</table>","</div>"),e.push('<div class="drp-calendar right">','<table class="calendar-table">',"<thead></thead>","<tbody></tbody>","<tfoot>",'<tr class="calendar-time end-time"></tr>',"</tfoot>","</table>","</div>"),e.push('<div class="drp-buttons">','<div class="drp-duration-label"></div>','<div class="drp-selected"></div>'),this.externalStyle==="bulma"?e.push('<div class="buttons">','<button class="cancelBtn button is-small" type="button"></button>','<button class="applyBtn button is-small" disabled type="button"></button>',"</div>"):e.push("<div>",'<button class="cancelBtn" type="button"></button>','<button class="applyBtn" disabled type="button"></button>',"</div>"),e.push("</div></div>"),t.template=e.join("")}if(this.parentEl=t.parentEl&&$(t.parentEl).length?$(t.parentEl):$(this.parentEl),this.container=$(t.template).appendTo(this.parentEl),typeof t.timePicker=="boolean"&&(this.timePicker=t.timePicker),this.timePicker&&(this.locale.format=h.DATETIME_SHORT),typeof t.locale=="object"){for(let e of["separator","applyLabel","cancelLabel","weekLabel"])typeof t.locale[e]=="string"&&(this.locale[e]=t.locale[e]);if(typeof t.locale.direction=="string"&&(["rtl","ltr"].includes(t.locale.direction)?this.locale.direction=t.locale.direction:console.error("Option 'options.locale.direction' must be 'rtl' or 'ltr'")),["string","object"].includes(typeof t.locale.format)&&(this.locale.format=t.locale.format),Array.isArray(t.locale.daysOfWeek)&&(t.locale.daysOfWeek.some(e=>typeof e!="string")?console.error("Option 'options.locale.daysOfWeek' must be an array of strings"):this.locale.daysOfWeek=t.locale.daysOfWeek.slice()),Array.isArray(t.locale.monthNames)&&(t.locale.monthNames.some(e=>typeof e!="string")?console.error("Option 'locale.monthNames' must be an array of strings"):this.locale.monthNames=t.locale.monthNames.slice()),typeof t.locale.firstDay=="number"&&(this.locale.firstDay=t.locale.firstDay),typeof t.locale.customRangeLabel=="string"){var r=document.createElement("textarea");r.innerHTML=t.locale.customRangeLabel;var i=r.value;this.locale.customRangeLabel=i}["string","object","function"].includes(typeof t.locale.durationFormat)&&t.locale.durationFormat!=null&&(this.locale.durationFormat=t.locale.durationFormat)}this.container.addClass(this.locale.direction);for(let e of["timePicker24Hour","showWeekNumbers","showISOWeekNumbers","showDropdowns","linkedCalendars","showCustomRangeLabel","alwaysShowCalendars","autoApply","autoUpdateInput","showLabel"])typeof t[e]=="boolean"&&(this[e]=t[e]);for(let e of["applyButtonClasses","cancelButtonClasses","weekendClasses","weekendDayClasses","todayClasses"])typeof t[e]=="string"?this[e]=t[e]:["weekendClasses","weekendDayClasses","todayClasses"].includes(e)&&t[e]===null&&(this[e]=t[e]);for(let e of["minYear","maxYear"])typeof t[e]=="number"&&(this[e]=t[e]);for(let e of["isInvalidDate","isInvalidTime","isCustomDate"])typeof t[e]=="function"?this[e]=t[e]:this[e]=function(){return!1};if(!this.singleDatePicker){for(let e of["minSpan","maxSpan","defaultSpan"])["string","number","object"].includes(typeof t[e])&&(D.isDuration(t[e])&&t[e].isValid?this[e]=t[e]:D.fromISO(t[e]).isValid?this[e]=D.fromISO(t[e]):typeof t[e]=="number"&&D.fromObject({seconds:t[e]}).isValid?this[e]=D.fromObject({seconds:t[e]}):t[e]===null?this[e]=null:console.error(`Option '${key}' is not valid`));this.minSpan&&this.maxSpan&&this.minSpan>this.maxSpan&&(this.minSpan=null,this.maxSpan=null,console.warn("Ignore option 'minSpan' and 'maxSpan', because 'minSpan' must be smaller than 'maxSpan'")),this.defaultSpan&&this.minSpan&&this.minSpan>this.defaultSpan?(this.defaultSpan=null,console.warn("Ignore option 'defaultSpan', because 'defaultSpan' must be greater than 'minSpan'")):this.defaultSpan&&this.maxSpan&&this.maxSpan<this.defaultSpan&&(this.defaultSpan=null,console.warn("Ignore option 'defaultSpan', because 'defaultSpan' must be smaller than 'maxSpan'"))}if(this.timePicker){if(typeof t.timePickerSeconds=="boolean"&&(this.timePickerStepSize=D.fromObject({[t.timePickerSeconds?"seconds":"minutes"]:1})),typeof t.timePickerIncrement=="number"&&(this.timePickerStepSize=D.fromObject({minutes:t.timePickerIncrement})),["string","object","number"].includes(typeof t.timePickerStepSize)){let e;D.isDuration(t.timePickerStepSize)&&t.timePickerStepSize.isValid?e=t.timePickerStepSize:D.fromISO(t.timePickerStepSize).isValid?e=D.fromISO(t.timePickerStepSize):typeof t.timePickerStepSize=="number"&&D.fromObject({seconds:t.timePickerStepSize}).isValid?e=D.fromObject({seconds:t.timePickerStepSize}):(console.error("Option 'timePickerStepSize' is not valid"),e=this.timePickerStepSize);var c=[];for(let l of["minutes","seconds"])c.push(...[1,2,3,4,5,6,10,12,15,20,30].map(o=>D.fromObject({[l]:o})));c.push(...[1,2,3,4,6].map(l=>D.fromObject({hours:l}))),this.timePicker24Hour&&c.push(...[8,12].map(l=>D.fromObject({hours:l}))),c.some(l=>e.rescale().equals(l))?this.timePickerStepSize=e.rescale():console.error(`Option 'timePickerStepSize' ${JSON.stringify(e.toObject())} is not valid`)}this.maxSpan&&this.timePickerStepSize>this.maxSpan&&console.error(`Option 'timePickerStepSize' ${JSON.stringify(this.timePickerStepSize.toObject())} must be smaller than 'maxSpan'`),this.timePickerOpts={showMinutes:this.timePickerStepSize<D.fromObject({hours:1}),showSeconds:this.timePickerStepSize<D.fromObject({minutes:1}),hourStep:this.timePickerStepSize>=D.fromObject({hours:1})?this.timePickerStepSize.hours:1,minuteStep:this.timePickerStepSize>=D.fromObject({minutes:1})?this.timePickerStepSize.minutes:1,secondStep:this.timePickerStepSize.seconds}}for(let e of["startDate","endDate","minDate","maxDate","initalMonth"])if(!(e==="endDate"&&this.singleDatePicker)){if(typeof t[e]=="object")h.isDateTime(t[e])&&t[e].isValid?this[e]=t[e]:t[e]instanceof Date?this[e]=h.fromJSDate(t[e]):t[e]===null?this[e]=null:console.error(`Option '${e}' must be a luxon.DateTime or Date or string`);else if(typeof t[e]=="string"){const l=typeof this.locale.format=="string"?this.locale.format:h.parseFormatForOpts(this.locale.format);if(h.fromISO(t[e]).isValid)this[e]=h.fromISO(t[e]);else if(h.fromFormat(t[e],l,{locale:h.now().locale}).isValid)this[e]=h.fromFormat(t[e],l,{locale:h.now().locale});else{const o=h.fromFormat(t[e],l,{locale:h.now().locale}).invalidExplanation;console.error(`Option '${e}' is not a valid string: ${o}`)}}}if($(this.element).is("input:text")){const e=$(this.element).val();if(e!=""){const l=typeof this.locale.format=="string"?this.locale.format:h.parseFormatForOpts(this.locale.format);if(this.singleDatePicker&&typeof t.startDate>"u"){const o=h.fromFormat(e,l,{locale:h.now().locale});o.isValid?this.#t=o:console.error(`Value "${e}" in <input> is not a valid string: ${o.invalidExplanation}`)}else if(!this.singleDatePicker&&typeof t.startDate>"u"&&typeof t.endDate>"u"){const o=e.split(this.locale.separator);if(o.length===2){const u=h.fromFormat(o[0],l,{locale:h.now().locale}),m=h.fromFormat(o[1],l,{locale:h.now().locale});u.isValid&&m.isValid?(this.#t=u,this.#e=m):console.error(`Value in <input> is not a valid string: ${u.invalidExplanation} - ${m.invalidExplanation}`)}else console.error(`Value "${e}" in <input> is not a valid string`)}}}if(this.singleDatePicker?this.#e=this.#t:this.#e<this.#t&&console.error(`Option 'endDate' ${this.#e} must not be earlier than 'startDate' ${this.#t}`),this.timePicker||(this.minDate&&(this.minDate=this.minDate.startOf("day")),this.maxDate&&(this.maxDate=this.maxDate.endOf("day")),this.#t=this.#t.startOf("day"),this.#e=this.#e.endOf("day")),t.warnings!==void 0&&console.warn("Option 'warnings' not used anymore. Listen to event 'violated.daterangepicker'"),!this.#t&&this.initalMonth)this.#e=null,this.timePicker&&console.error("Option 'initalMonth' works only with 'timePicker: false'");else{const e=this.validateInput(null,!1);if(e!=null){let l=e.startDate.violations;if(l.length>0)if(l.some(o=>o.reason.startsWith("isInvalid")))console.error(`Value of startDate "${this.#t}" violates ${l.find(o=>o.reason.startsWith("isInvalid")).reason}`);else{const o=l.filter(u=>u.new!=null).at(-1).new;typeof process<"u"&&process.env.JEST_WORKER_ID==null&&console.warn(`Correcting startDate from ${this.#t} to ${o}`),this.#t=o}if(!this.singleDatePicker&&(l=e.endDate.violations.filter(o=>o.new!=null),l.length>0))if(l.some(o=>o.reason.startsWith("isInvalid")))console.error(`Value of endDate "${this.#e}" violates ${l.find(o=>o.reason.startsWith("isInvalid")).reason}`);else{const o=l.filter(u=>u.new!=null).at(-1).new;typeof process<"u"&&process.env.JEST_WORKER_ID==null&&console.warn(`Correcting endDate from ${this.#e} to ${o}`),this.#e=o}}}if(["function","string"].includes(typeof t.altFormat)&&(this.altFormat=t.altFormat),typeof t.altInput=="string"||Array.isArray(t.altInput))if(this.singleDatePicker&&typeof t.altInput=="string")this.altInput=$(t.altInput).is("input:text")?t.altInput:null;else if(!this.singleDatePicker&&Array.isArray(t.altInput)&&t.altInput.length===2)this.altInput=t.altInput.every(e=>typeof e=="string"&&$(e).is("input:text"))?t.altInput:null;else{const e='Value of "altInput" must be '+(this.singleDatePicker?"a string":"an array of two string elements");console.error(`Option 'altInput' ${JSON.stringify(t.altInput)} is not valid
2
2
  `,e)}if(typeof t.opens=="string"&&(["left","right","center"].includes(t.opens)?this.opens=t.opens:console.error("Option 'options.opens' must be 'left', 'right' or 'center'")),typeof t.drops=="string"&&(["drop","down","auto"].includes(t.drops)?this.drops=t.drops:console.error("Option 'options.drops' must be 'drop', 'down' or 'auto'")),Array.isArray(t.buttonClasses)?this.buttonClasses=t.buttonClasses.join(" "):typeof t.buttonClasses=="string"&&(this.buttonClasses=t.buttonClasses),typeof t.onOutsideClick=="string"&&(["cancel","apply"].includes(t.onOutsideClick)?this.onOutsideClick=t.onOutsideClick:console.error("Option 'options.onOutsideClick' must be 'cancel' or 'apply'")),this.locale.firstDay!=1){let e=this.locale.firstDay;for(;e>1;)this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift()),e--}if(!this.singleDatePicker&&typeof t.ranges=="object"){for(let e in t.ranges){let l,o;if(["string","object"].includes(typeof t.ranges[e][0])&&(h.isDateTime(t.ranges[e][0])&&t.ranges[e][0].isValid?l=t.ranges[e][0]:t.ranges[e][0]instanceof Date?l=h.fromJSDate(t.ranges[e][0]):typeof t.ranges[e][0]=="string"&&h.fromISO(t.ranges[e][0]).isValid?l=h.fromISO(t.ranges[e][0]):console.error(`Option ranges['${e}'] is not am array of valid ISO-8601 string or luxon.DateTime or Date`)),["string","object"].includes(typeof t.ranges[e][1])&&(h.isDateTime(t.ranges[e][1])&&t.ranges[e][1].isValid?o=t.ranges[e][1]:t.ranges[e][1]instanceof Date?o=h.fromJSDate(t.ranges[e][1]):typeof t.ranges[e][1]=="string"&&h.fromISO(t.ranges[e][1]).isValid?o=h.fromISO(t.ranges[e][1]):console.error(`Option ranges['${e}'] is not a valid ISO-8601 string or luxon.DateTime or Date`)),!(l==null||o==null)){t.ranges[e]=[l,o];var r=document.createElement("textarea");r.innerHTML=e,this.ranges[r.value]=[l,o]}}var d="<ul>";for(let e in this.ranges)d+='<li data-range-key="'+e+'">'+e+"</li>";this.showCustomRangeLabel&&(d+='<li data-range-key="'+this.locale.customRangeLabel+'">'+this.locale.customRangeLabel+"</li>"),d+="</ul>",this.container.find(".ranges").prepend(d),this.container.addClass("show-ranges")}typeof a=="function"&&(this.callback=a),this.timePicker||this.container.find(".calendar-time").hide(),this.timePicker&&this.autoApply&&(this.autoApply=!1),this.autoApply&&this.container.addClass("auto-apply"),(this.singleDatePicker||this.singleMonthView)&&(this.container.addClass("single"),this.container.find(".drp-calendar.left").addClass("single"),this.container.find(".drp-calendar.left").show(),this.container.find(".drp-calendar.right").hide(),!this.timePicker&&this.autoApply&&this.container.addClass("auto-apply")),(typeof t.ranges>"u"&&!this.singleDatePicker||this.alwaysShowCalendars)&&this.container.addClass("show-calendar"),this.container.addClass("opens"+this.opens),this.container.find(".applyBtn, .cancelBtn").addClass(this.buttonClasses),this.applyButtonClasses.length&&this.container.find(".applyBtn").addClass(this.applyButtonClasses),this.cancelButtonClasses.length&&this.container.find(".cancelBtn").addClass(this.cancelButtonClasses),this.container.find(".applyBtn").html(this.locale.applyLabel),this.container.find(".cancelBtn").html(this.locale.cancelLabel),this.container.find(".drp-calendar").on("click.daterangepicker",".prev",this.clickPrev.bind(this)).on("click.daterangepicker",".next",this.clickNext.bind(this)).on("mousedown.daterangepicker","td.available",this.clickDate.bind(this)).on("mouseenter.daterangepicker","td.available",this.hoverDate.bind(this)).on("change.daterangepicker","select.yearselect",this.monthOrYearChanged.bind(this)).on("change.daterangepicker","select.monthselect",this.monthOrYearChanged.bind(this)).on("change.daterangepicker","select.hourselect,select.minuteselect,select.secondselect,select.ampmselect",this.timeChanged.bind(this)),this.container.find(".ranges").on("click.daterangepicker","li",this.clickRange.bind(this)).on("mouseenter.daterangepicker","li",this.hoverRange.bind(this)).on("mouseleave.daterangepicker","li",this.leaveRange.bind(this)),this.container.find(".drp-buttons").on("click.daterangepicker","button.applyBtn",this.clickApply.bind(this)).on("click.daterangepicker","button.cancelBtn",this.clickCancel.bind(this)),this.element.is("input")||this.element.is("button")?this.element.on({"click.daterangepicker":this.show.bind(this),"focus.daterangepicker":this.show.bind(this),"keyup.daterangepicker":this.elementChanged.bind(this),"keydown.daterangepicker":this.keydown.bind(this)}):(this.element.on("click.daterangepicker",this.toggle.bind(this)),this.element.on("keydown.daterangepicker",this.toggle.bind(this))),this.updateElement()}get startDate(){return this.timePicker?this.#t:this.#t.startOf("day")}get endDate(){return this.singleDatePicker?null:this.timePicker?this.#e:this.#e.endOf("day")}set startDate(s){this.#t=s}set endDate(s){this.#e=s}setStartDate(s,t=!0){if(!this.singleDatePicker)return setRange(s,this.#e,t);const a=this.#t;let n=this.parseDate(s);if(n.equals(a))return null;const r=this.validateInput([n,null],!0);if(r!=null)if(r.newDate!=null)n=r.newDate.startDate;else return r;return this.#t=n,this.#e=this.#t,this.timePicker||(this.#t=this.#t.startOf("day"),this.#e=this.#e.endOf("day")),this.updateElement(),t&&this.updateView(),r}setEndDate(s,t=!0){return this.singleDatePicker?null:setRange(this.#t,s,t)}setRange(s,t,a=!0){if(this.singleDatePicker)return;this.#e||(this.#e=this.#t);const n=[this.#t,this.#e];let r=[this.parseDate(s),this.parseDate(t)];if(n[0].equals(r[0])&&n[1].equals(r[1])||r[0]>r[1])return;const i=this.validateInput([r[0],r[1]],!0);if(i!=null)if(i.newDate!=null)r[0]=i.newDate.startDate,r[1]=i.newDate.endDate;else return i;return this.#t=r[0],this.#e=r[1],this.timePicker||(this.#t=this.#t.startOf("day"),this.#e=this.#e.endOf("day")),this.updateElement(),a&&this.updateView(),i}parseDate(s){if(typeof s=="object"){if(h.isDateTime(s)&&s.isValid)return s;if(s instanceof Date)return h.fromJSDate(s);throw RangeError("Value must be a luxon.DateTime or Date or string")}else if(typeof s=="string"){const t=typeof this.locale.format=="string"?this.locale.format:h.parseFormatForOpts(this.locale.format);if(h.fromISO(s).isValid)return h.fromISO(s);if(h.fromFormat(s,t,{locale:h.now().locale}).isValid)return h.fromFormat(s,t,{locale:h.now().locale});{const a=h.fromFormat(s,t,{locale:h.now().locale}).invalidExplanation;throw RangeError(`Value is not a valid string: ${a}`)}}}logDate(s){return this.timePicker?s.toISO({suppressMilliseconds:!0}):s.toISODate()}formatDate(s,t=this.locale.format){if(typeof t=="object")return s.toLocaleString(t);if(P.defaultLocale===null){const a=h.now().locale;return s.toFormat(t,{locale:a})}else return s.toFormat(t)}updateLabel(){if(this.showLabel){let s=this.formatDate(this.#t);this.singleDatePicker||(s+=this.locale.separator,this.#e&&(s+=this.formatDate(this.#e))),this.container.find(".drp-selected").html(s)}if(!(this.singleDatePicker||this.locale.durationFormat==null)){if(!this.#e){this.container.find(".drp-duration-label").html("");return}if(typeof this.locale.durationFormat=="function")this.container.find(".drp-duration-label").html(this.locale.durationFormat(this.#t,this.#e));else{let s=this.#e.plus({milliseconds:1}).diff(this.#t).rescale().set({milliseconds:0});this.timePicker||(s=s.set({seconds:0,minutes:0,hours:0})),s=s.removeZeros(),typeof this.locale.durationFormat=="object"?this.container.find(".drp-duration-label").html(s.toHuman(this.locale.durationFormat)):this.container.find(".drp-duration-label").html(s.toFormat(this.locale.durationFormat))}}}validateInput(s,t=!1){let a=s==null?this.#t:s[0],n=s==null?this.#e:s[1];if(a==null)return null;let r={startDate:{violations:[]}},i={old:a,reason:this.timePicker?"timePickerStepSize":"timePicker"};if(this.timePicker){const e=this.timePickerStepSize.as("seconds");a=h.fromSeconds(e*Math.round(a.toSeconds()/e)),i.new=a,i.new.equals(i.old)||r.startDate.violations.push(i)}else a=a.startOf("day");const c=this.timePicker?this.timePickerStepSize.as("seconds"):D.fromObject({days:1}).as("seconds");this.minDate&&a<this.minDate?(i={old:a,reason:"minDate"},a=a.plus({seconds:Math.trunc(this.minDate.diff(a).as("seconds")/c)*c}),a<this.minDate&&(a=a.plus(this.timePicker?this.timePickerStepSize:{days:1})),i.new=a,i.new.equals(i.old)||r.startDate.violations.push(i)):this.maxDate&&a>this.maxDate&&(i={old:a,reason:"maxDate"},a=a.minus({seconds:Math.trunc(a.diff(this.maxDate).as("seconds")/c)*c}),a>this.maxDate&&(a=a.minus(this.timePicker?this.timePickerStepSize:{days:1})),i.new=a,i.new.equals(i.old)||r.startDate.violations.push(i));let d=["hour"];if(this.timePicker&&(this.timePickerOpts.showMinutes&&d.push("minute"),this.timePickerOpts.showSeconds&&d.push("second"),this.timePicker24Hour||d.push("ampm")),this.isInvalidDate(a)&&r.startDate.violations.push({old:a,reason:"isInvalidDate"}),this.timePicker)for(let e of d)this.isInvalidTime(a,e,"start")&&r.startDate.violations.push({old:a,reason:"isInvalidTime",unit:e});if(this.singleDatePicker){if(r.startDate.violations.length==0)return null;if(t){let e={startDate:a};return this.element.triggerHandler("violated.daterangepicker",[this,r,e])&&(r.newDate=e),r}else return r}if(n==null)return null;if(r.endDate={violations:[]},i={old:n,reason:this.timePicker?"stepSize":"timePicker"},this.timePicker){const e=this.timePickerStepSize.as("seconds");n=h.fromSeconds(e*Math.round(n.toSeconds()/e)),i.new=n,i.new.equals(i.old)||r.endDate.violations.push(i)}else n=n.endOf("day");if(this.maxDate&&n>this.maxDate?(i={old:n,reason:"maxDate"},n=n.minus({seconds:Math.trunc(n.diff(this.maxDate).as("seconds")/c)*c}),n>this.maxDate&&(n=n.minus(this.timePicker?this.timePickerStepSize:{days:1})),i.new=n,i.new.equals(i.old)||r.endDate.violations.push(i)):this.minDate&&n<this.minDate&&(i={old:n,reason:"minDate"},n=n.plus({seconds:Math.trunc(this.minDate.diff(n).as("seconds")/c)*c}),n<this.minDate&&(n=n.plus(this.timePicker?this.timePickerStepSize:{days:1})),i.new=n,i.new.equals(i.old)||r.endDate.violations.push(i)),this.maxSpan){const e=a.plus(this.maxSpan);n>e&&(i={old:n,reason:"maxSpan"},n=n.minus({seconds:Math.trunc(e.diff(n).as("seconds")/c)*c}),n>e&&(n=n.minus(this.timePicker?this.timePickerStepSize:{days:1})),i.new=n,i.new.equals(i.old)||r.endDate.violations.push(i))}if(this.minSpan){const e=a.plus(this.defaultSpan??this.minSpan);n<e&&(i={old:n,reason:"minSpan"},n=n.plus({seconds:Math.trunc(e.diff(n).as("seconds")/c)*c}),n<e&&(n=n.plus(this.timePicker?this.timePickerStepSize:{days:1})),i.new=n,i.new.equals(i.old)||r.endDate.violations.push(i))}if(this.isInvalidDate(n)&&r.endDate.violations.push({old:n,reason:"isInvalidDate"}),this.timePicker)for(let e of d)this.isInvalidTime(n,e,"end")&&r.endDate.violations.push({old:n,reason:"isInvalidTime",unit:e});if(r.startDate.violations.length==0&&r.endDate.violations.length==0)return null;if(t){let e={startDate:a,endDate:n};return this.element.triggerHandler("violated.daterangepicker",[this,r,e])&&(r.newDate=e),r}else return r}updateView(){this.timePicker&&(this.element.trigger("beforeRenderTimePicker.daterangepicker",this),this.renderTimePicker("start"),this.renderTimePicker("end"),this.#e?this.container.find(".calendar-time.end-time select").prop("disabled",!1).removeClass("disabled"):this.container.find(".calendar-time.end-time select").prop("disabled",!0).addClass("disabled")),this.updateLabel(),this.updateMonthsInView(),this.updateCalendars(),this.setApplyBtnState()}updateMonthsInView(){if(this.#e){if(!this.singleDatePicker&&this.leftCalendar.month&&this.rightCalendar.month&&(this.#t.hasSame(this.leftCalendar.month,"month")||this.#t.hasSame(this.rightCalendar.month,"month"))&&(this.#e.hasSame(this.leftCalendar.month,"month")||this.#e.hasSame(this.rightCalendar.month,"month")))return;this.leftCalendar.month=this.#t.startOf("month"),this.singleMonthView||(!this.linkedCalendars&&!this.#e.hasSame(this.#t,"month")?this.rightCalendar.month=this.#e.startOf("month"):this.rightCalendar.month=this.#t.startOf("month").plus({month:1}))}else!this.#t&&this.initalMonth?(this.leftCalendar.month=this.initalMonth,this.singleMonthView||(this.rightCalendar.month=this.initalMonth.plus({month:1}))):!this.leftCalendar.month.hasSame(this.#t,"month")&&!this.rightCalendar.month.hasSame(this.#t,"month")&&(this.leftCalendar.month=this.#t.startOf("month"),this.rightCalendar.month=this.#t.startOf("month").plus({month:1}));this.maxDate&&this.linkedCalendars&&!this.singleDatePicker&&!this.singleMonthView&&this.rightCalendar.month>this.maxDate&&(this.rightCalendar.month=this.maxDate.startOf("month"),this.leftCalendar.month=this.maxDate.startOf("month").minus({month:1}))}updateCalendars(){if(this.timePicker){var s,t,a;this.#e?(s=parseInt(this.container.find(".start-time .hourselect").val(),10),isNaN(s)&&(s=parseInt(this.container.find(".start-time .hourselect option:last").val(),10)),t=0,this.timePickerOpts.showMinutes&&(t=parseInt(this.container.find(".start-time .minuteselect").val(),10),isNaN(t)&&(t=parseInt(this.container.find(".start-time .minuteselect option:last").val(),10))),a=0,this.timePickerOpts.showSeconds&&(a=parseInt(this.container.find(".start-time .secondselect").val(),10),isNaN(a)&&(a=parseInt(this.container.find(".start-time .secondselect option:last").val(),10)))):(s=parseInt(this.container.find(".end-time .hourselect").val(),10),isNaN(s)&&(s=parseInt(this.container.find(".end-time .hourselect option:last").val(),10)),t=0,this.timePickerOpts.showMinutes&&(t=parseInt(this.container.find(".end-time .minuteselect").val(),10),isNaN(t)&&(t=parseInt(this.container.find(".end-time .minuteselect option:last").val(),10))),a=0,this.timePickerOpts.showSeconds&&(a=parseInt(this.container.find(".end-time .secondselect").val(),10),isNaN(a)&&(a=parseInt(this.container.find(".end-time .secondselect option:last").val(),10)))),this.leftCalendar.month=this.leftCalendar.month.set({hour:s,minute:t,second:a}),this.singleMonthView||(this.rightCalendar.month=this.rightCalendar.month.set({hour:s,minute:t,second:a}))}else this.leftCalendar.month=this.leftCalendar.month.set({hour:0,minute:0,second:0}),this.singleMonthView||(this.rightCalendar.month=this.rightCalendar.month.set({hour:0,minute:0,second:0}));this.element.trigger("beforeRenderCalendar.daterangepicker",this),this.renderCalendar("left"),this.renderCalendar("right"),this.container.find(".ranges li").removeClass("active"),this.#e!=null&&this.calculateChosenLabel()}renderCalendar(s){if(s==="right"&&this.singleMonthView)return;var i=s==="left"?this.leftCalendar:this.rightCalendar;i.month==null&&!this.#t&&this.initalMonth&&(i.month=this.initalMonth.startOf("month"));const t=i.month.startOf("month"),a=i.month.endOf("month").startOf("day");var n=i.month.startOf("month").minus({day:1});const r={hour:i.month.hour,minute:i.month.minute,second:i.month.second};var i=[];i.firstDay=t,i.lastDay=a;for(var c=0;c<6;c++)i[c]=[];for(;n.weekday!=this.locale.firstDay;)n=n.minus({day:1});for(let f=0,g=-1;f<42;f++,n=n.plus({day:1}))f%7===0&&g++,i[g][f%7]=n.set(r);s==="left"?this.leftCalendar.calendar=i:this.rightCalendar.calendar=i;var d=s==="left"?this.minDate:this.#t,e=this.maxDate,l="<tr>";(this.showWeekNumbers||this.showISOWeekNumbers)&&(l+="<th></th>"),(!d||d<i.firstDay)&&(!this.linkedCalendars||s==="left")?l+='<th class="prev available"><span></span></th>':l+="<th></th>";var o=`${this.locale.monthNames[i.firstDay.month-1]} ${i.firstDay.year}`;if(this.showDropdowns){const f=(e&&e.year)??this.maxYear,g=(d&&d.year)??this.minYear;let C=this.externalStyle==="bulma"?'<div class="select is-small mr-1">':"";for(var u=`${C}<select class="monthselect">`,m=1;m<=12;m++)u+=`<option value="${m}"${m===i.firstDay.month?" selected":""}`,(d&&i.firstDay.set({month:m})<d.startOf("month")||e&&i.firstDay.set({month:m})>e.endOf("month"))&&(u+=" disabled"),u+=`>${this.locale.monthNames[m-1]}</option>`;u+="</select>",this.externalStyle==="bulma"&&(u+="</div>"),C=this.externalStyle==="bulma"?'<div class="select is-small ml-1">':"";for(var p=`${C}<select class="yearselect">`,k=g;k<=f;k++)p+=`<option value="${k}"${k===i.firstDay.year?" selected":""}>${k}</option>`;p+="</select>",this.externalStyle==="bulma"&&(p+="</div>"),o=u+p}l+='<th colspan="5" class="month">'+o+"</th>",(!e||e>i.lastDay.endOf("day"))&&(!this.linkedCalendars||s==="right"||this.singleDatePicker||this.singleMonthView)?l+='<th class="next available"><span></span></th>':l+="<th></th>",l+="</tr>",l+="<tr>",(this.showWeekNumbers||this.showISOWeekNumbers)&&(l+=`<th class="week">${this.locale.weekLabel}</th>`);for(let[f,g]of this.locale.daysOfWeek.entries())l+="<th",this.weekendDayClasses&&this.weekendDayClasses.length&&S.getWeekendWeekdays().includes(f+1)&&(l+=` class="${this.weekendDayClasses}"`),l+=`>${g}</th>`;if(l+="</tr>",this.container.find(".drp-calendar."+s+" .calendar-table thead").html(l),l="",this.#e==null&&this.maxSpan){var y=this.#t.plus(this.maxSpan).endOf("day");(!e||y<e)&&(e=y)}var v;this.#e==null&&this.minSpan&&(v=this.#t.plus(this.minSpan).startOf("day"));for(let f=0;f<6;f++){l+="<tr>",this.showISOWeekNumbers?l+='<td class="week">'+i[f][0].weekNumber+"</td>":this.showWeekNumbers&&(l+='<td class="week">'+i[f][0].localWeekNumber+"</td>");for(let g=0;g<7;g++){var b=[];this.todayClasses&&this.todayClasses.length&&i[f][g].hasSame(h.now(),"day")&&b.push(this.todayClasses),this.weekendClasses&&this.weekendClasses.length&&S.getWeekendWeekdays().includes(i[f][g].weekday)&&b.push(this.weekendClasses),i[f][g].month!=i[1][1].month&&b.push("off","ends"),this.minDate&&i[f][g].startOf("day")<this.minDate.startOf("day")&&b.push("off","disabled"),e&&i[f][g].startOf("day")>e.startOf("day")&&b.push("off","disabled"),v&&i[f][g].startOf("day")>this.#t.startOf("day")&&i[f][g].startOf("day")<v.startOf("day")&&b.push("off","disabled"),this.isInvalidDate(i[f][g])&&b.push("off","disabled"),this.#t!=null&&i[f][g].hasSame(this.#t,"day")&&b.push("active","start-date"),this.#e!=null&&i[f][g].hasSame(this.#e,"day")&&b.push("active","end-date"),this.#e!=null&&i[f][g]>this.#t&&i[f][g]<this.#e&&b.push("in-range");var w=this.isCustomDate(i[f][g]);w!==!1&&(typeof w=="string"?b.push(w):Array.prototype.push.apply(b,w)),b.includes("disabled")||b.push("available"),l+=`<td class="${b.join(" ")}" data-title="r${f}c${g}">${i[f][g].day}</td>`}l+="</tr>"}this.container.find(".drp-calendar."+s+" .calendar-table tbody").html(l)}renderTimePicker(s){if(s==="end"&&!this.#e)return;var t,a,n,r=this.maxDate;let i="";if((this.showWeekNumbers||this.showISOWeekNumbers)&&(i+="<th></th>"),this.maxSpan&&(!this.maxDate||this.#t.plus(this.maxSpan)<this.maxDate)&&(r=this.#t.plus(this.maxSpan)),this.minSpan&&s==="end"&&(a=this.#t.plus(this.defaultSpan??this.minSpan)),s==="start")t=this.#t,n=this.minDate;else if(s==="end"){t=this.#e,n=this.#t;var c=this.container.find(".drp-calendar .calendar-time.end-time");c.html()!=""&&(t=t.set({hour:isNaN(t.hour)?c.find(".hourselect option:selected").val():t.hour,minute:isNaN(t.minute)?c.find(".minuteselect option:selected").val():t.minute,second:isNaN(t.second)?c.find(".secondselect option:selected").val():t.second})),t<this.#t&&(t=this.#t),r&&t>r&&(t=r)}i+='<th colspan="7">',this.externalStyle==="bulma"&&(i+='<div class="select is-small mx-1">'),i+='<select class="hourselect">';const d=t.toFormat("a",{locale:"en-US"});let e=0;this.timePicker24Hour||(e=d==="AM"?1:13);for(var l=e;l<=e+23;l+=this.timePickerOpts.hourStep){let p=t.set({hour:l%24}),k=!1;if(n&&p.set({minute:59})<n&&(k=!0),r&&p.set({minute:0})>r&&(k=!0),a&&p.endOf("hour")<a&&(k=!0),!k&&this.isInvalidTime(p,this.singleDatePicker?null:s,"hour")&&(k=!0),this.timePicker24Hour)!k&&l==t.hour?i+=`<option value="${l}" selected>${l}</option>`:k?i+=`<option value="${l}" disabled class="disabled">${l}</option>`:i+=`<option value="${l}">${l}</option>`;else{const y=h.fromFormat(`${l%24}`,"H").toFormat("h"),v=h.fromFormat(`${l%24}`,"H").toFormat("a",{locale:"en-US"});d==v?!k&&l==t.hour?i+=`<option ampm="${v}" value="${l%24}" selected>${y}</option>`:k?i+=`<option ampm="${v}" value="${l%24}" disabled class="disabled">${y}</option>`:i+=`<option ampm="${v}" value="${l%24}">${y}</option>`:i+=`<option ampm="${v}" hidden="hidden" value="${l%24}">${y}</option>`}}if(i+="</select>",this.externalStyle==="bulma"&&(i+="</div>"),this.timePickerOpts.showMinutes){i+=" : ",this.externalStyle==="bulma"&&(i+='<div class="select is-small mx-1">'),i+='<select class="minuteselect">';for(var l=0;l<60;l+=this.timePickerOpts.minuteStep){var o=l<10?"0"+l:l;let k=t.set({minute:l}),y=!1;n&&k.set({second:59})<n&&(y=!0),r&&k.set({second:0})>r&&(y=!0),a&&k.endOf("minute")<a&&(y=!0),!y&&this.isInvalidTime(k,this.singleDatePicker?null:s,"minute")&&(y=!0),t.minute==l&&!y?i+=`<option value="${l}" selected>${o}</option>`:y?i+=`<option value="${l}" disabled class="disabled">${o}</option>`:i+=`<option value="${l}">${o}</option>`}i+="</select>",this.externalStyle==="bulma"&&(i+="</div>")}if(this.timePickerOpts.showSeconds){i+=" : ",this.externalStyle==="bulma"&&(i+='<div class="select is-small mx-1">'),i+='<select class="secondselect">';for(var l=0;l<60;l+=this.timePickerOpts.secondStep){var o=l<10?"0"+l:l;let y=t.set({second:l}),v=!1;n&&y<n&&(v=!0),r&&y>r&&(v=!0),a&&y<a&&(v=!0),!v&&this.isInvalidTime(y,this.singleDatePicker?null:s,"second")&&(v=!0),t.second==l&&!v?i+=`<option value="${l}" selected>${o}</option>`:v?i+=`<option value="${l}" disabled class="disabled">${o}</option>`:i+=`<option value="${l}">${o}</option>`}i+="</select>",this.externalStyle==="bulma"&&(i+="</div>")}if(!this.timePicker24Hour){this.externalStyle==="bulma"&&(i+='<div class="select is-small mx-1">'),i+='<select class="ampmselect">';var u="",m="";let p=!1;n&&t.startOf("day")<n&&(p=!0),r&&t.endOf("day")>r&&(p=!0),a&&t.startOf("day")<a&&(p=!0),p?(u=' disabled class="disabled "',m=' disabled class="disabled"'):this.isInvalidTime(t,this.singleDatePicker?null:s,"ampm")&&(t.toFormat("a",{locale:"en-US"})==="AM"?m=' disabled class="disabled"':u=' disabled class="disabled"'),i+=`<option value="AM"${u}`,t.toFormat("a",{locale:"en-US"})==="AM"&&(i+=" selected"),i+=`>${S.meridiems()[0]}</option><option value="PM"${m}`,t.toFormat("a",{locale:"en-US"})==="PM"&&(i+=" selected"),i+=`>${S.meridiems()[1]}</option>`,i+="</select>",this.externalStyle==="bulma"&&(i+="</div>")}i+="</div></th>",this.container.find(`.drp-calendar .calendar-time.${s}-time`).html(i)}setApplyBtnState(){this.singleDatePicker||this.#e&&this.#t<=this.#e?this.container.find("button.applyBtn").prop("disabled",!1):this.container.find("button.applyBtn").prop("disabled",!0)}move(){var s={top:0,left:0},t,a=this.drops,n=$(window).width();switch(this.parentEl.is("body")||(s={top:this.parentEl.offset().top-this.parentEl.scrollTop(),left:this.parentEl.offset().left-this.parentEl.scrollLeft()},n=this.parentEl[0].clientWidth+this.parentEl.offset().left),a){case"auto":t=this.element.offset().top+this.element.outerHeight()-s.top,t+this.container.outerHeight()>=this.parentEl[0].scrollHeight&&(t=this.element.offset().top-this.container.outerHeight()-s.top,a="up");break;case"up":t=this.element.offset().top-this.container.outerHeight()-s.top;break;default:t=this.element.offset().top+this.element.outerHeight()-s.top;break}this.container.css({top:0,left:0,right:"auto"});var r=this.container.outerWidth();if(this.container.toggleClass("drop-up",a==="up"),this.opens==="left"){var i=n-this.element.offset().left-this.element.outerWidth();r+i>$(window).width()?this.container.css({top:t,right:"auto",left:9}):this.container.css({top:t,right:i,left:"auto"})}else if(this.opens==="center"){var c=this.element.offset().left-s.left+this.element.outerWidth()/2-r/2;c<0?this.container.css({top:t,right:"auto",left:9}):c+r>$(window).width()?this.container.css({top:t,left:"auto",right:0}):this.container.css({top:t,left:c,right:"auto"})}else{var c=this.element.offset().left-s.left;c+r>$(window).width()?this.container.css({top:t,left:"auto",right:0}):this.container.css({top:t,left:c,right:"auto"})}}show(){this.isShowing||(this._outsideClickProxy=function(s){this.outsideClick(s)}.bind(this),$(document).on("mousedown.daterangepicker",this._outsideClickProxy).on("touchend.daterangepicker",this._outsideClickProxy).on("click.daterangepicker","[data-toggle=dropdown]",this._outsideClickProxy).on("focusin.daterangepicker",this._outsideClickProxy),$(window).on("resize.daterangepicker",function(s){this.move(s)}.bind(this)),this.oldStartDate=this.#t,this.oldEndDate=this.#e,this.updateView(),this.container.show(),this.move(),this.element.trigger("show.daterangepicker",this),this.isShowing=!0)}hide(){this.isShowing&&(this.#e||(this.#t=this.oldStartDate,this.#e=this.oldEndDate),(!this.#t.equals(this.oldStartDate)||!this.#e.equals(this.oldEndDate))&&this.callback(this.startDate,this.endDate,this.chosenLabel),this.updateElement(),!this.element.triggerHandler("beforeHide.daterangepicker",this)&&($(document).off(".daterangepicker"),$(window).off(".daterangepicker"),this.container.hide(),this.element.trigger("hide.daterangepicker",this),this.isShowing=!1))}toggle(){this.isShowing?this.hide():this.show()}showCalendars(){this.container.addClass("show-calendar"),this.move(),this.element.trigger("showCalendar.daterangepicker",this)}hideCalendars(){this.container.removeClass("show-calendar"),this.element.trigger("hideCalendar.daterangepicker",this)}outsideClick(s){var t=$(s.target);s.type==="focusin"||t.closest(this.element).length||t.closest(this.container).length||t.closest(".calendar-table").length||(this.onOutsideClick==="cancel"&&(this.#t=this.oldStartDate,this.#e=this.oldEndDate),this.hide(),this.element.trigger("outsideClick.daterangepicker",this))}clickPrev(s){var t=$(s.target).parents(".drp-calendar");t.hasClass("left")?(this.leftCalendar.month=this.leftCalendar.month.minus({month:1}),this.linkedCalendars&&!this.singleMonthView&&(this.rightCalendar.month=this.rightCalendar.month.minus({month:1}))):this.rightCalendar.month=this.rightCalendar.month.minus({month:1}),this.updateCalendars()}clickNext(s){var t=$(s.target).parents(".drp-calendar");t.hasClass("left")?this.leftCalendar.month=this.leftCalendar.month.plus({month:1}):(this.rightCalendar.month=this.rightCalendar.month.plus({month:1}),this.linkedCalendars&&(this.leftCalendar.month=this.leftCalendar.month.plus({month:1}))),this.updateCalendars()}hoverDate(s){if(!$(s.target).hasClass("available"))return;let t=$(s.target).attr("data-title");const a=t.substring(1,2),n=t.substring(3,4);var i=$(s.target).parents(".drp-calendar").hasClass("left")?this.leftCalendar.calendar[a][n]:this.rightCalendar.calendar[a][n];const c=this.leftCalendar,d=this.rightCalendar,e=this.#t,l=this.initalMonth;this.#e||this.container.find(".drp-calendar tbody td").each(function(o,u){if($(u).hasClass("week"))return;const m=$(u).attr("data-title"),p=m.substring(1,2),k=m.substring(3,4),v=$(u).parents(".drp-calendar").hasClass("left")?c.calendar[p][k]:d.calendar[p][k];!e&&l?$(u).removeClass("in-range"):v>e&&v<i||v.hasSame(i,"day")?$(u).addClass("in-range"):$(u).removeClass("in-range")})}hoverRange(s){const t=s.target.getAttribute("data-range-key"),a=[this.#t,this.#e],n=this.ranges[t]??[this.#t,this.#e],r=this.leftCalendar,i=this.rightCalendar;this.container.find(".drp-calendar tbody td").each(function(c,d){if($(d).hasClass("week"))return;const e=$(d).attr("data-title"),l=e.substring(1,2),o=e.substring(3,4),m=$(d).parents(".drp-calendar").hasClass("left")?r.calendar[l][o]:i.calendar[l][o];let p=!1;m.hasSame(n[0],"day")&&(p=$(d).addClass("start-hover").length>0),m.hasSame(a[0],"day")&&(p=$(d).addClass("start-date").length>0),m.hasSame(n[1],"day")&&(p=$(d).addClass("end-hover").length>0),a[1]!=null&&m.hasSame(a[1],"day")&&(p=$(d).addClass("end-date").length>0),m.startOf("day")>=n[0].startOf("day")&&m.startOf("day")<=n[1].startOf("day")&&(p=$(d).addClass("range-hover").length>0),m.startOf("day")>=a[0].startOf("day")&&a[1]!=null&&m.startOf("day")<=a[1].startOf("day")&&(p=$(d).addClass("in-range").length>0),p||($(d).removeClass("start-hover"),$(d).removeClass("end-hover"),$(d).removeClass("start-date"),$(d).removeClass("end-date"),$(d).removeClass("in-range"),$(d).removeClass("range-hover"))})}leaveRange(s){this.container.find(".drp-calendar tbody td").each(function(t,a){$(a).hasClass("week")||($(a).removeClass("start-hover"),$(a).removeClass("end-hover"),$(a).removeClass("range-hover"))})}clickRange(s){var t=s.target.getAttribute("data-range-key");if(this.chosenLabel=t,t==this.locale.customRangeLabel)this.showCalendars();else{var a=this.ranges[t];this.#t=a[0],this.#e=a[1],this.timePicker||(this.#t.startOf("day"),this.#e.endOf("day")),this.alwaysShowCalendars||this.hideCalendars(),this.element.triggerHandler("beforeHide.daterangepicker",this)&&this.updateView(),this.clickApply()}}clickDate(s){if(!$(s.target).hasClass("available"))return;var t=$(s.target).attr("data-title"),a=t.substring(1,2),n=t.substring(3,4),r=$(s.target).parents(".drp-calendar"),i=r.hasClass("left")?this.leftCalendar.calendar[a][n]:this.rightCalendar.calendar[a][n];let c;if(this.#e||!this.#t||i<this.#t.startOf("day")){if(this.timePicker){let d=parseInt(this.container.find(".start-time .hourselect").val(),10);isNaN(d)&&(d=parseInt(this.container.find(".start-time .hourselect option:last").val(),10));let e=0;this.timePickerOpts.showMinutes&&(e=parseInt(this.container.find(".start-time .minuteselect").val(),10),isNaN(e)&&(e=parseInt(this.container.find(".start-time .minuteselect option:last").val(),10)));let l=0;this.timePickerOpts.showSeconds&&(l=parseInt(this.container.find(".start-time .secondselect").val(),10),isNaN(l)&&(l=parseInt(this.container.find(".start-time .secondselect option:last").val(),10))),i=i.set({hour:d,minute:e,second:l})}else i=i.startOf("day");this.#e=null,this.#t=i,c="start"}else if(!this.#e&&i<this.#t)this.#e=this.#t,c="end";else{if(this.timePicker){let d=parseInt(this.container.find(".end-time .hourselect").val(),10);isNaN(d)&&(d=parseInt(this.container.find(".end-time .hourselect option:last").val(),10));let e=0;this.timePickerOpts.showMinutes&&(e=parseInt(this.container.find(".end-time .minuteselect").val(),10),isNaN(e)&&(e=parseInt(this.container.find(".end-time .minuteselect option:last").val(),10)));let l=0;this.timePickerOpts.showSeconds&&(l=parseInt(this.container.find(".end-time .secondselect").val(),10),isNaN(l)&&(l=parseInt(this.container.find(".end-time .secondselect option:last").val(),10))),i=i.set({hour:d,minute:e,second:l})}else i=i.endOf("day");this.#e=i,this.autoApply&&(this.calculateChosenLabel(),this.clickApply()),c="end"}this.singleDatePicker&&(this.#e=this.#t,!this.timePicker&&this.autoApply&&this.clickApply(),c=null),this.updateView(),s.stopPropagation(),this.autoUpdateInput&&this.updateElement(),this.element.trigger("dateChange.daterangepicker",[this,c])}calculateChosenLabel(){var s=!0,t=0;for(var a in this.ranges){var n=this.timePicker?"hour":"day";if(this.timePicker&&(this.timePickerOpts.showMinutes?n="minute":this.timePickerOpts.showSeconds&&(n="second")),this.#t.startOf(n).equals(this.ranges[a][0].startOf(n))&&this.#e.startOf(n).equals(this.ranges[a][1].startOf(n))){s=!1,this.chosenLabel=this.container.find(".ranges li:eq("+t+")").addClass("active").attr("data-range-key");break}t++}s&&(this.showCustomRangeLabel?this.chosenLabel=this.container.find(".ranges li:last").addClass("active").attr("data-range-key"):this.chosenLabel=null,this.showCalendars())}timeChanged(s){const t=$(s.target).closest(".calendar-time"),a=t.hasClass("start-time")?"start":"end";var n=parseInt(t.find(".hourselect").val(),10);if(isNaN(n)&&(n=parseInt(t.find(".hourselect option:last").val(),10)),!this.timePicker24Hour){const c=t.find(".ampmselect").val();if(c==null&&t.find(".ampmselect option:last").val(),c!=h.fromFormat(`${n}`,"H").toFormat("a",{locale:"en-US"})){t.find(".hourselect > option").each(function(){const e=$(this).attr("hidden")||!1;$(this).attr("hidden",e)});const d=h.fromFormat(`${n}`,"H").toFormat("h");n=h.fromFormat(`${d}${c}`,"ha",{locale:"en-US"}).hour}}var r=0;this.timePickerOpts.showMinutes&&(r=parseInt(t.find(".minuteselect").val(),10),isNaN(r)&&(r=parseInt(t.find(".minuteselect option:last").val(),10)));var i=0;this.timePickerOpts.showSeconds&&(i=parseInt(t.find(".secondselect").val(),10),isNaN(i)&&(i=parseInt(t.find(".secondselect option:last").val(),10))),a==="start"?(this.#t&&(this.#t=this.#t.set({hour:n,minute:r,second:i})),this.singleDatePicker?this.#e=this.#t:this.#e&&this.#e.hasSame(this.#t,"day")&&this.#e<this.#t&&(this.#e=this.#t)):this.#e&&(this.#e=this.#e.set({hour:n,minute:r,second:i})),this.updateCalendars(),this.setApplyBtnState(),this.element.trigger("beforeRenderTimePicker.daterangepicker",this),this.renderTimePicker("start"),this.renderTimePicker("end"),this.autoUpdateInput&&this.updateElement(),this.element.trigger("timeChange.daterangepicker",[this,this.singleDatePicker?null:a])}monthOrYearChanged(s){var t=$(s.target).closest(".drp-calendar").hasClass("left"),a=t?"left":"right",n=this.container.find(".drp-calendar."+a),r=parseInt(n.find(".monthselect").val(),10),i=n.find(".yearselect").val();t||(i<this.#t.year||i==this.#t.year&&r<this.#t.month)&&(r=this.#t.month,i=this.#t.year),this.minDate&&(i<this.minDate.year||i==this.minDate.year&&r<this.minDate.month)&&(r=this.minDate.month,i=this.minDate.year),this.maxDate&&(i>this.maxDate.year||i==this.maxDate.year&&r>this.maxDate.month)&&(r=this.maxDate.month,i=this.maxDate.year),t?(this.leftCalendar.month=this.leftCalendar.month.set({year:i,month:r}),this.linkedCalendars&&(this.rightCalendar.month=this.leftCalendar.month.plus({month:1}))):(this.rightCalendar.month=this.rightCalendar.month.set({year:i,month:r}),this.linkedCalendars&&(this.leftCalendar.month=this.rightCalendar.month.minus({month:1}))),this.updateCalendars()}clickApply(){this.hide(),this.element.trigger("apply.daterangepicker",this)}clickCancel(){this.#t=this.oldStartDate,this.#e=this.oldEndDate,this.hide(),this.element.trigger("cancel.daterangepicker",this)}elementChanged(){if(!this.element.is("input:text")||!this.element.val().length)return;const s=typeof this.locale.format=="string"?this.locale.format:h.parseFormatForOpts(this.locale.format),t=this.element.val().split(this.locale.separator);if(this.singleDatePicker){let a=h.fromFormat(this.element.val(),s,{locale:h.now().locale});const n=this.#t;if(!a.isValid||n.equals(a))return;const r=this.validateInput([a,null],!0);if(r!=null)if(r.newDate!=null)a=r.newDate.startDate;else return;this.#t=a,this.#e=this.#t,this.timePicker||(this.#t=this.#t.startOf("day"),this.#e=this.#e.endOf("day"))}else if(!this.singleDatePicker&&t.length===2){const a=[0,1].map(i=>h.fromFormat(t[i],s,{locale:h.now().locale})),n=[this.#t,this.#e];if(!a[0].isValid||!a[1].isValid||n[0].equals(a[0])&&n[1].equals(a[1])||a[0]>a[1])return;const r=this.validateInput([a[0],a[1]],!0);if(r!=null)if(r.newDate!=null)a[0]=r.newDate.startDate,a[1]=r.newDate.endDate;else return;this.#t=a[0],this.#e=a[1],this.timePicker||(this.#t=this.#t.startOf("day"),this.#e=this.#e.endOf("day"))}else return;this.updateView(),this.updateElement(),this.element.trigger("inputChanged.daterangepicker",this)}keydown(s){(s.keyCode===9||s.keyCode===13)&&this.hide(),s.keyCode===27&&(s.preventDefault(),s.stopPropagation(),this.hide())}updateElement(){if(!(this.#t==null&&this.initalMonth))if(this.element.is("input:text")){let s=this.formatDate(this.#t);this.singleDatePicker||(s+=this.locale.separator,this.#e&&(s+=this.formatDate(this.#e))),this.updateAltInput(),s!==this.element.val()&&this.element.val(s).trigger("change")}else this.updateAltInput()}updateAltInput(){if(this.altInput!=null)if(this.singleDatePicker&&$(this.altInput[1]).val(null),this.altFormat==null){let s="day";this.timePicker&&(this.timePickerOpts.showSeconds?s="second":this.timePickerOpts.showMinutes?s="minute":s="hour");const t=this.#t.toISO({format:"basic",precision:s,includeOffset:!1});if($(this.singleDatePicker?this.altInput:this.altInput[0]).val(t),!this.singleDatePicker&&this.#e){const a=this.#e.toISO({format:"basic",precision:s,includeOffset:!1});$(this.altInput[1]).val(a)}}else{const s=typeof this.altFormat=="function"?this.altFormat(this.#t):this.formatDate(this.#t,this.altFormat);if($(this.singleDatePicker?this.altInput:this.altInput[0]).val(s),!this.singleDatePicker&&this.#e){const t=typeof this.altFormat=="function"?this.altFormat(this.#e):this.formatDate(this.#e,this.altFormat);$(this.altInput[1]).val(t)}}}remove(){this.container.remove(),this.element.off(".daterangepicker"),this.element.removeData()}}$.fn.daterangepicker||($.fn.daterangepicker=function(O,s){const t=$.extend(!0,{},$.fn.daterangepicker.defaultOptions,O);return this.each(function(){const a=$(this);a.data("daterangepicker")&&a.data("daterangepicker").remove(),a.data("daterangepicker",new I(a,t,s))}),this});})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wernfried/daterangepicker",
3
- "version": "4.17.3",
3
+ "version": "4.17.5",
4
4
  "description": "Date range picker with time component and pre-defined ranges",
5
5
  "main": "dist/global/daterangepicker.js",
6
6
  "module": "dist/esm/daterangepicker.js",