@progress/kendo-react-dateinputs 8.3.0-develop.6 → 8.3.0-develop.7

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.
Files changed (49) hide show
  1. package/calendar/components/Calendar.js +2 -2
  2. package/calendar/components/Calendar.mjs +123 -115
  3. package/calendar/components/CalendarCell.js +1 -1
  4. package/calendar/components/CalendarCell.mjs +37 -39
  5. package/calendar/components/CalendarHeaderTitle.js +1 -1
  6. package/calendar/components/CalendarHeaderTitle.mjs +6 -12
  7. package/calendar/components/CalendarNavigationItem.js +1 -1
  8. package/calendar/components/CalendarNavigationItem.mjs +15 -19
  9. package/calendar/components/CalendarWeekCell.js +1 -1
  10. package/calendar/components/CalendarWeekCell.mjs +10 -15
  11. package/calendar/components/Header.js +1 -1
  12. package/calendar/components/Header.mjs +30 -40
  13. package/calendar/components/Navigation.js +1 -1
  14. package/calendar/components/Navigation.mjs +52 -49
  15. package/calendar/components/TodayCommand.js +1 -1
  16. package/calendar/components/TodayCommand.mjs +21 -25
  17. package/calendar/components/View.js +1 -1
  18. package/calendar/components/View.mjs +48 -42
  19. package/calendar/components/ViewList.js +1 -1
  20. package/calendar/components/ViewList.mjs +99 -94
  21. package/common/ClearButton.js +1 -1
  22. package/common/ClearButton.mjs +25 -31
  23. package/dateinput/DateInput.js +1 -1
  24. package/dateinput/DateInput.mjs +113 -110
  25. package/dateinput/utils.js +1 -1
  26. package/dateinput/utils.mjs +22 -23
  27. package/datepicker/DatePicker.js +1 -1
  28. package/datepicker/DatePicker.mjs +9 -9
  29. package/daterangepicker/DateRangePicker.js +1 -1
  30. package/daterangepicker/DateRangePicker.mjs +5 -5
  31. package/datetimepicker/DateTimePicker.js +1 -1
  32. package/datetimepicker/DateTimePicker.mjs +95 -90
  33. package/datetimepicker/DateTimeSelector.js +1 -1
  34. package/datetimepicker/DateTimeSelector.mjs +83 -81
  35. package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
  36. package/index.d.mts +38 -28
  37. package/index.d.ts +38 -28
  38. package/package-metadata.mjs +1 -1
  39. package/package.json +7 -7
  40. package/timepicker/TimeList.js +3 -3
  41. package/timepicker/TimeList.mjs +83 -81
  42. package/timepicker/TimePart.js +1 -1
  43. package/timepicker/TimePart.mjs +74 -68
  44. package/timepicker/TimePicker.js +1 -1
  45. package/timepicker/TimePicker.mjs +112 -107
  46. package/timepicker/TimeSelector.js +1 -1
  47. package/timepicker/TimeSelector.mjs +66 -59
  48. package/virtualization/Virtualization.js +1 -1
  49. package/virtualization/Virtualization.mjs +49 -48
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-date-math"),require("@progress/kendo-react-intl"),require("@progress/kendo-react-buttons"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-labels"),require("@progress/kendo-react-popup"),require("@progress/kendo-react-layout")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-date-math","@progress/kendo-react-intl","@progress/kendo-react-buttons","@progress/kendo-svg-icons","@progress/kendo-react-labels","@progress/kendo-react-popup","@progress/kendo-react-layout"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactDateinputs={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoDateMath,e.KendoReactIntl,e.KendoReactButtons,e.KendoSvgIcons,e.KendoReactLabels,e.KendoReactPopup,e.KendoReactLayout)}(this,(function(e,t,i,s,a,n,o,r,l,h,d){"use strict";function c(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(i){if("default"!==i){var s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return e[i]}})}})),t.default=e,Object.freeze(t)}var u=c(t);const p={name:"@progress/kendo-react-dateinputs",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1617189075,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"},m=e=>Math.max(e,0);let g=class{constructor(e){this.offset=e}},v=class{constructor(e){this.skip=e}},f=class{constructor(e,t){this.onScrollAction=e,this.onPageAction=t,this.direction="vertical",this.firstLoaded=0,this.lastLoaded=0,this.lastScrollTop=0,this.take=0,this.total=0,this.rowHeightService=null,this.bottomOffset=0,this.topOffset=0}create(e,t,i,s,a=0,n=0,o="vertical"){this.rowHeightService=e,this.firstLoaded=t,this.lastLoaded=t+i,this.take=i,this.total=s,this.lastScrollTop=0,this.topOffset=a,this.bottomOffset=n,this.direction=o;const r=this.rowsForHeight(a),l=m(t-r);this.onScrollAction(new g(this.rowOffset(l))),this.onPageAction(new v(l))}onScroll({scrollLeft:e,scrollTop:t,offsetHeight:i,offsetWidth:s}){const a="vertical"===this.direction?t:e,n="vertical"===this.direction?i:s;if(this.lastScrollTop===a||!this.rowHeightService)return;const o=this.lastScrollTop>=a;this.lastScrollTop=a;const r=this.rowHeightService.index(m(a-this.topOffset)),l=this.rowHeightService.index(m(a+n-this.bottomOffset));if(!o&&l>=this.lastLoaded&&this.lastLoaded<this.total&&(this.firstLoaded=r,this.onScrollAction(new g(this.rowOffset(r))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),this.onPageAction(new v(this.firstLoaded))),o&&r<=this.firstLoaded){const e=Math.floor(.3*this.take);this.firstLoaded=m(r-e),this.onScrollAction(new g(this.rowOffset(this.firstLoaded))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),this.onPageAction(new v(this.firstLoaded))}}rowOffset(e){return this.rowHeightService?this.rowHeightService.offset(e)+this.topOffset:0}rowsForHeight(e){return this.rowHeightService?Math.ceil(e/this.rowHeightService.height(0)):0}};const w={1:e=>t=>t+e,0:e=>t=>t-e},b={1:e=>t=>Math.min(t,e),0:e=>t=>Math.max(t,e)},D={1:e=>t=>t<e,0:e=>t=>t>e},y=class e extends u.Component{constructor(t){super(t),this.rowHeightService=null,this.scrollContainer=null,this.lastDirection=null,this.lastTotal=0,this.lastTake=0,this.animationInProgress=!1,this.restrictScroll=!1,this.scrollTo=e=>{const t="vertical"===this.direction?"scrollTop":"scrollLeft";if(!this.scrollContainer)return;const i=this.scrollContainer[t];this.restrictScroll&&"scrollTop"===t&&(!Number.isInteger(i)||!Number.isInteger(e))&&Math.abs(i-e)<10||(this.scrollContainer[t]=e)},this.scrollToIndex=e=>{this.animationInProgress=!1,this.rowHeightService&&this.scrollTo(this.rowHeightService.offset(e))},this.animateToIndex=e=>{if(!this.rowHeightService||!window)return;window.cancelAnimationFrame(this.cancelAnimation);const t=this.rowHeightService.offset(e),i=this.getContainerScrollDirection(t);let{start:s,end:a}=this.scrollRange(t,i);if(s===a)return;const n=this.scrollStep(s,a),o=w[i](n),r=b[i](a),l=D[i](o(a)),h=e=>{this.animationInProgress=!0;const t=o(e);this.scrollTo(r(t)),l(t)?this.cancelAnimation=window.requestAnimationFrame((()=>{h(t)})):this.animationInProgress=!1};this.cancelAnimation=window.requestAnimationFrame((()=>{h(s)}))},this.scrollToBottom=()=>{this.rowHeightService&&this.scrollTo(this.rowHeightService.totalHeight()+this.props.bottomOffset)},this.scrollStep=(t,i)=>{const s=this.props.scrollDuration||e.defaultProps.scrollDuration;return Math.abs(i-t)/(s/17)},this.scrollRange=(e,t)=>{const i=this.containerScrollPosition;if(parseInt(`${e}`,10)===parseInt(`${i}`,10))return{start:e,end:e};const s=this.containerMaxScroll(),a=0===t?1:-1,n=((e,t,i)=>Math.min(Math.abs(t-e),i))(i,e,this.props.maxScrollDifference||0),o=Math.min(e,s);return{start:Math.min(Math.max(o+a*n,0),s),end:o}},this.containerMaxScroll=()=>this.containerScrollSize-this.containerOffsetSize,this.getContainerScrollDirection=e=>e<this.containerScrollPosition?0:1,this.initServices=(e=this.props)=>{const t="vertical"===this.direction?e.itemHeight:e.itemWidth;void 0!==t&&(this.rowHeightService=new s.RowHeightService(e.total,t,0),this.scrollerService.create(this.rowHeightService,e.skip,e.take,e.total,e.topOffset,this.scrollOffsetSize,this.direction))},this.getContainerProperty=e=>this.scrollContainer?this.scrollContainer[e]:0,this.handleScroll=e=>{if(!this.scrollContainer||!this.rowHeightService)return;const t=e.target;this.scrollerService.onScroll({scrollLeft:t.scrollLeft,scrollTop:t.scrollTop,offsetHeight:t.offsetHeight,offsetWidth:t.offsetWidth});const i=this.rowHeightService.index(this.containerScrollPosition-this.props.topOffset),{onScrollAction:s}=this.props,a={index:i,target:t,scrollAction:this.scrollAction,pageAction:this.pageAction,animationInProgress:this.animationInProgress};this.props.onScroll&&this.props.onScroll.call(void 0,e),s&&s.call(void 0,a),this.scrollAction=void 0,this.pageAction=void 0},this.handleScrollAction=e=>{this.scrollAction=e},this.handlePageAction=e=>{this.pageAction=e},this.scrollerService=new f(this.handleScrollAction,this.handlePageAction),this.restrictScroll=Number.parseFloat(u.version)>17}get element(){return this.scrollContainer}get containerOffsetSize(){return this.getContainerProperty("vertical"===this.direction?"offsetHeight":"offsetWidth")}get containerScrollSize(){return this.getContainerProperty("vertical"===this.direction?"scrollHeight":"scrollWidth")}get containerScrollPosition(){return this.getContainerProperty("vertical"===this.direction?"scrollTop":"scrollLeft")}get direction(){return void 0!==this.props.direction?this.props.direction:e.defaultProps.direction}get scrollOffsetSize(){return void 0!==this.props.scrollOffsetSize?this.props.scrollOffsetSize:e.defaultProps.scrollOffsetSize}activeIndex(){return this.itemIndex(Math.ceil(this.containerScrollPosition))}itemIndex(e){return this.rowHeightService?this.rowHeightService.index(e):0}itemOffset(e){return this.rowHeightService?this.rowHeightService.offset(e):0}isIndexVisible(e){if(!this.rowHeightService)return!1;const t=this.containerScrollPosition,i=t+this.containerOffsetSize,s=this.rowHeightService.offset(e),a=s+this.rowHeightService.height(e);return s>=t&&a<=i}isListScrolled(e){return!!this.rowHeightService&&this.containerScrollPosition!==this.rowHeightService.offset(e)}componentDidMount(){const{onMount:e}=this.props;e&&e.call(void 0,this)}render(){(this.lastTotal!==this.props.total||this.lastDirection!==this.direction||this.lastTake!==this.props.take)&&(this.initServices(),this.lastTotal=this.props.total,this.lastDirection=this.direction,this.lastTake=this.props.take);const e=`${(this.rowHeightService?this.rowHeightService.totalHeight():0)+this.props.bottomOffset}`,t="vertical"===this.direction?{height:`${e}px`}:{width:`${e}px`},i=s.classNames("k-content k-scrollable",{"k-scrollable-horizontal":"horizontal"===this.direction},this.props.className),a=s.classNames("k-scrollable-placeholder",{"k-scrollable-horizontal-placeholder":"horizontal"===this.direction});return u.createElement("div",{ref:e=>{this.scrollContainer=e},onScroll:this.handleScroll,className:i,tabIndex:this.props.tabIndex,role:this.props.role},this.props.children,u.createElement("div",{style:t,className:a}))}};y.propTypes={bottomOffset:i.number.isRequired,className:i.string,direction:i.oneOf(["horizontal","vertical"]),forceScroll:i.bool,itemHeight:i.number,itemWidth:i.number,maxScrollDifference:i.number,onScroll:i.func,onScrollAction:i.func,scrollDuration:i.number,scrollOffsetSize:i.number,skip:i.number.isRequired,tabIndex:i.number,take:i.number.isRequired,topOffset:i.number.isRequired,total:i.number.isRequired,role:i.string},y.defaultProps={direction:"vertical",forceScroll:!1,scrollOffsetSize:0,maxScrollDifference:100,scrollDuration:100};let k=y;let S=class extends u.Component{constructor(){super(...arguments),this.handleClick=e=>{const{onClick:t,value:i}=this.props;t&&t.call(void 0,i,e)},this.handleMouseEnter=()=>{const{onMouseEnter:e,value:t}=this.props;e&&e.call(void 0,t)},this.handleMouseLeave=()=>{const{onMouseLeave:e,value:t}=this.props;e&&e.call(void 0,t)}}shouldComponentUpdate(e){const{value:t,...i}=this.props,{value:s,...a}=e;return!((!t||!s||t.getTime()===s.getTime())&&((e,t)=>{const i=Object.getOwnPropertyNames(e),s=Object.getOwnPropertyNames(t);if(i.length!==s.length)return!1;for(let s=0;s<i.length;s++){const a=i[s];if(e[a]!==t[a])return!1}return!0})(i,a))}render(){const{className:e,formattedValue:t,isWeekend:i,isFocused:a,isInRange:n,isSelected:o,isRangeStart:r,isRangeMid:l,isRangeEnd:h,isRangeSplitStart:d,isRangeSplitEnd:c,isToday:p,isDisabled:m,view:g,value:v,isOtherMonth:f,showOtherMonthDays:w,allowReverse:b,...D}=this.props,y="end"===this.props.activeRangeEnd&&h,k="start"===this.props.activeRangeEnd&&r,S=s.classNames("k-calendar-td",{"k-range-start":!f&&!b&&r,"k-range-end":!f&&!b&&h,"k-range-mid":!f&&l,"k-range-split-end":!f&&c,"k-range-split-start":!f&&d,"k-active":k||y,"k-state-pending-focus":a,"k-selected":!f&&(o||r||h),"k-today":!f&&p,"k-weekend":i,"k-disabled":m,"k-other-month":f},e);return!w&&f?u.createElement("td",{role:"gridcell",className:"k-empty k-calendar-td"}):u.createElement("td",{...D,className:S,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},u.createElement("span",{className:"k-link"},this.props.children))}},x=class extends u.Component{constructor(){super(...arguments),this.handleClick=e=>{const{onClick:t,firstDate:i,weekDays:s}=this.props;t&&e&&t.call(void 0,i,s||[],e)}}render(){const{className:e,firstDate:t,weekDays:i,...a}=this.props;return u.createElement("td",{className:s.classNames("k-calendar-td",e),...a,onClick:this.handleClick},this.props.children)}};var C=(e=>(e[e.month=0]="month",e[e.year=1]="year",e[e.decade=2]="decade",e[e.century=3]="century",e))(C||{});const I={start:null,end:null};function M(e){const t=(t,i,s,...a)=>null===i[s]?null:(t?e.isRequired:e)(i,s,...a),i=t.bind(null,!1);return i.isRequired=t.bind(null,!0),i}const O=(e,t,i)=>void 0===t||void 0===i||t<=e&&e<=i?e:e<t?t:i,E=new Date(1980,0,1),V=new Date(1900,0,1),T=new Date(2099,11,31),F=new Date(1980,0,1),P=new Date(1980,0,1,23,59,59),R=(e,t)=>{const i=a.cloneDate(e);return i.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),i},N=()=>a.getDate(new Date),L=(e,t,i)=>!e||!(t&&t>e||i&&i<e),B=(e,t,i)=>null===e||!(t&&a.getDate(t)>a.getDate(e)||i&&a.getDate(i)<a.getDate(e)),_=(e,t)=>{const{start:i,end:s}=t||I;return!(!i||!s)&&(i<e&&e<s)},A=(e,t,i=1)=>{const s=[];for(let a=e;a<t;a+=i)s.push(a);return s},H=(e,t,i)=>t.getTime()<=e.getTime()&&e.getTime()<=i.getTime(),z=(e,t,i)=>e&&(t&&e<t?a.cloneDate(t):i&&e>i?a.cloneDate(i):e),q=e=>(t,i="",s={})=>{const a=document.createElement(e);return a.className=i,Object.keys(s).map((e=>a.style[e]=s[e])),"string"==typeof t?a.innerHTML=t||"":(t||[]).forEach((e=>e&&a.appendChild(e))),a};function K(e,t,i={}){let s,a,n,o,r;i.maxWait;const l=window;let h=!1,d=!1;const c=!t&&0!==t&&"function"==typeof l.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function u(t){const i=s,o=a;return s=a=void 0,n=e.apply(o,i),n}function p(e,t){return c?(l.cancelAnimationFrame(o),l.requestAnimationFrame(e)):setTimeout(e,t)}function m(e){const i=e-r;return void 0===r||i>=t||i<0||d}function g(){const e=Date.now();if(m(e))return v();o=p(g,function(e){return t-(e-r)}(e))}function v(e){return o=void 0,s?u():(s=a=void 0,n)}function f(...e){const i=Date.now(),l=m(i);return s=e,a=this,r=i,l&&void 0===o?(o=p(g,t),h?u():n):(void 0===o&&(o=p(g,t)),n)}return t=+t||0,f.cancel=function(){void 0!==o&&function(e){if(c)return l.cancelAnimationFrame(e);clearTimeout(e)}(o),s=r=a=o=void 0},f.flush=function(){return void 0===o?n:v()},f.pending=function(){return void 0!==o},f}let W=class{constructor(e){this.intl=e}getWeekNames(e=!1,t){const i=((e,t)=>e.slice(t).concat(e.slice(0,t)))(this.intl.dateFormatNames({nameType:null!=t?t:"short",type:"days"}),this.intl.firstDay());return e?[""].concat(i):i}};const U=e=>u.createElement("td",{key:e,className:"k-calendar-td k-empty"}," "),Y=class e extends u.Component{constructor(){super(...arguments),this.intl=null,this.weekService=null,this.buildWeekNumber=(e,t)=>{if(!this.firstDate(e))return U(`week-cell-${t}`);const i=this.firstDate(e),s=this.getWeekNumber(i),a=`kendo-react-calendar-week-cell-${s}`,n={className:"k-alt",value:s,firstDate:i,weekDays:e,onClick:this.handleWeekCellClick};return this.props.weekCell?u.createElement(this.props.weekCell,{...n,key:a},s):u.createElement(x,{...n,key:a},s)},this.buildRow=e=>e.map(((e,t)=>{if(!e)return U(t);const i={"aria-selected":e.isSelected},s=`kendo-react-calendar-cell-${e.value.getTime()}`,a={...i,...e,isDisabled:!e.isInRange,view:this.props.activeView,showOtherMonthDays:this.props.showOtherMonthDays,allowReverse:this.props.allowReverse,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave};return this.props.cell?u.createElement(this.props.cell,{...a,key:s},e.formattedValue):u.createElement(S,{...a,key:s},e.formattedValue)})),this.firstDate=e=>{const t=this.firstWeekDateContext(e);return t?t.value:null},this.firstWeekDateContext=e=>{if(!this.weekNumber)return null;let t=0,i=e[t];for(;!i&&t<e.length;)i=e[++t];return i},this.handleClick=(e,t)=>{const{onChange:i}=this.props;if(i&&t){const s={value:a.cloneDate(e),target:this,nativeEvent:t&&t.nativeEvent,syntheticEvent:t};i.call(void 0,s)}},this.handleWeekCellClick=(e,t,i)=>{const{onWeekSelect:s}=this.props,a=t.findIndex((t=>t&&t.value===e));s&&i&&s.call(void 0,e,a,i)},this.handleMouseEnter=e=>{const{onCellEnter:t}=this.props;t&&t.call(void 0,a.cloneDate(e))},this.handleMouseLeave=e=>{const{onCellLeave:t}=this.props;t&&t.call(void 0,a.cloneDate(e))}}get min(){return this.props.min}get max(){return this.props.max}get isHorizontal(){return"horizontal"===this.props.direction}get isMonthView(){return this.props.activeView===C.month}get weekNumber(){return!(!this.props.showWeekNumbers||this.props.activeView!==C.month)}get selectedDate(){return void 0!==this.props.selectedDate?this.props.selectedDate:e.defaultProps.selectedDate}render(){this.intl=n.provideIntlService(this),this.weekService=new W(this.intl);const e=this.weekService.getWeekNames(this.weekNumber,this.props.weekDaysFormat),t=this.props.service.rowLength(this.weekNumber),i=this.props.service.title(this.props.viewDate),s=N(),a=R(this.props.viewDate,s),o=this.props.service.data({cellUID:this.props.cellUID,min:this.min,max:this.max,focusedDate:this.props.focusedDate,isActiveView:!this.props.bus.canMoveDown(this.props.activeView),selectedDate:this.selectedDate,selectionRange:this.props.selectionRange,viewDate:a});return u.createElement(u.Fragment,null,this.isMonthView&&this.isHorizontal&&u.createElement("thead",{role:"rowgroup",className:"k-calendar-thead"},u.createElement("tr",{role:"row",className:"k-calendar-tr"},e.map(((e,t)=>u.createElement("th",{key:t,className:"k-calendar-th"},e))))),u.createElement("tbody",{role:"rowgroup",className:"k-calendar-tbody"},!this.isHorizontal&&u.createElement("tr",{role:"presentation",className:"k-calendar-tr"},u.createElement("th",{scope:"col",colSpan:t,className:"k-calendar-caption"},i)),o.map(((e,t)=>u.createElement("tr",{role:"row",className:"k-calendar-tr",key:t},this.weekNumber&&this.buildWeekNumber(e,t),this.buildRow(e))))))}getWeekNumber(e){return this.weekNumber&&this.intl?a.weekInYear(e,this.intl.firstDay()):null}};Y.propTypes={activeRangeEnd:i.oneOf(["start","end",null]),activeView:i.number.isRequired,cellUID:i.string.isRequired,direction:i.oneOf(["horizontal","vertical"]),focusedDate:i.instanceOf(Date).isRequired,max:i.instanceOf(Date).isRequired,min:i.instanceOf(Date).isRequired,onChange:i.func,selectedDate:i.oneOfType([i.instanceOf(Date),i.arrayOf(i.instanceOf(Date))]),showWeekNumbers:i.bool,showOtherMonthDays:i.bool,viewDate:i.instanceOf(Date).isRequired},Y.defaultProps={direction:"vertical",selectedDate:N(),showWeekNumbers:!1};let $=Y;n.registerForIntl($);let j=class extends u.PureComponent{render(){const{view:e,...t}=this.props;return u.createElement(o.Button,{type:"button",fillMode:"flat",themeColor:"primary",...t},this.props.children)}};const Z=class e extends u.Component{constructor(){super(...arguments),this.getTitle=()=>{if(!this.props.currentDate)return"";const e=this.rangeLength-1,t=this.props.service.title(this.props.currentDate),i=this.props.service.addToDate(this.props.currentDate,e);return e<1||!this.props.service.isInRange(i,this.min,this.max)?t:`${t} - ${this.props.service.title(i)}`},this.handleTitleClick=e=>{this.canMoveUp&&this.props.bus.moveUp(this.props.activeView,e)}}get min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}get rangeLength(){return void 0!==this.props.rangeLength?this.props.rangeLength:e.defaultProps.rangeLength}get canMoveUp(){return this.props.bus.canMoveUp(this.props.activeView)}render(){const e=this.getTitle(),t=s.classNames("k-calendar-title"),i={children:e,value:e,view:this.props.activeView,className:t,onClick:this.handleTitleClick,disabled:!this.canMoveUp},a={headerTitleProps:i,commands:this.props.commands},n=this.props.headerTitle?u.createElement(this.props.headerTitle,{...i},e):u.createElement(j,{...i},e),o=this.props.header?u.createElement(this.props.header,{...a}):u.createElement(u.Fragment,null,n,u.createElement("span",{className:"k-spacer"}),u.createElement("span",{className:"k-calendar-nav"},this.props.commands));return u.createElement("div",{className:s.classNames("k-calendar-header",{"k-vstack":this.props.verticalView})},o)}};Z.propTypes={activeView:i.number.isRequired,currentDate:i.instanceOf(Date).isRequired,max:i.instanceOf(Date).isRequired,min:i.instanceOf(Date).isRequired,rangeLength:i.number},Z.defaultProps={rangeLength:1,min:V,max:T};let G=Z;n.registerForLocalization(G);const X="multiviewcalendar.prevView",J="multiviewcalendar.nextView",Q="dateinput.increment",ee="dateinput.decrement",te="dateinput.clear",ie="calendar.today",se="datepicker.toggleCalendar",ae="daterangepicker.swapStartEnd",ne="daterangepicker.start",oe="daterangepicker.end",re="daterangepicker.separator",le="datetimepicker.toggleDateTimeSelector",he="timepicker.now",de="timepicker.selectNow",ce="timepicker.cancel",ue="timepicker.set",pe="timepicker.toggleTimeSelector",me="timepicker.toggleClock",ge="datetimepicker.date",ve="datetimepicker.time",fe="datetimepicker.cancel",we="datetimepicker.set",be="daterangepicker.cancel",De="daterangepicker.set",ye={[ie]:"Today",[he]:"NOW",[ue]:"Set",[ce]:"Cancel",[ge]:"Date",[ve]:"Time",[fe]:"Cancel",[we]:"Set",[be]:"Cancel",[De]:"Set",[ne]:"Start",[oe]:"End",[re]:" ",[de]:"Select Now",[pe]:"Toggle TimeSelector",[me]:"Toggle Clock",[Q]:"Increase value",[ee]:"Decrease value",[te]:"clear",[se]:"Toggle calendar",[X]:"Navigate to previous view",[J]:"Navigate to next view",[ae]:"Swap start and end values",[le]:"Toggle date-time selector"},ke=class e extends u.Component{constructor(){super(...arguments),this.localization=null,this.handleClick=e=>{if(this.todayIsInRange&&this.props.onClick){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,value:z(N(),this.min,this.max),target:this,isTodayClick:!0};this.props.onClick.call(void 0,t)}}}get min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}get todayIsInRange(){return L(N(),a.getDate(this.min),a.getDate(this.max))}render(){this.localization=n.provideLocalizationService(this);const e=this.localization.toLanguageString(ie,ye[ie]),t=s.classNames("k-calendar-nav-today",{"k-disabled":this.props.disabled});return u.createElement(o.Button,{className:t,onClick:this.handleClick,tabIndex:this.props.tabIndex,fillMode:"flat",themeColor:"base",role:"link"},e)}};ke.propTypes={max:i.instanceOf(Date).isRequired,min:i.instanceOf(Date).isRequired,onClick:i.func,disabled:i.bool},ke.defaultProps={min:V,max:T};let Se=ke;n.registerForLocalization(Se);const xe=class e extends u.Component{constructor(e){super(e),this.virtualization=null,this.calendarView=null,this.table=null,this.intl=null,this.bottomOffset=0,this.viewOffset=0,this.viewHeight=0,this._element=null,this.isActive=!1,this.animateToIndex=!0,this.shouldScroll=!1,this.weekService=null,this.focusActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus"),t=this._element.querySelector(".k-state-pending-focus");e&&e[0]&&e[0].classList.remove("k-focus"),t&&t.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus");e&&e.classList.remove("k-focus"),this.isActive=!1},this.handleVirtualizationMount=e=>{if(this.virtualization=e,this.virtualization&&this.table){this.table.style.transform=`translateY(${this.viewOffset}px)`;const e=z(this.props.focusedDate,this.props.min,this.props.max),t=this.props.service.skip(e,this.props.min);this.virtualization.scrollToIndex(t)}},this.buildMonthView=(e,t)=>u.createElement("table",{key:"calendar-view-list-weekdays",className:"k-calendar-table k-calendar-weekdays",role:"grid",tabIndex:this.props.tabIndex},u.createElement("colgroup",null,e.map(((e,t)=>u.createElement("col",{key:t})))),u.createElement("thead",{className:"k-calendar-thead"},u.createElement("tr",{className:"k-calendar-tr"},t.map(((e,t)=>u.createElement("th",{key:t,className:"k-calendar-th"},e)))))),this.buildDates=(e,t)=>{const i=this.props.cellUID;return u.createElement("table",{className:"k-calendar-table",ref:e=>this.table=e,role:"grid",tabIndex:this.props.tabIndex,"aria-activedescendant":i+this.props.focusedDate.getTime()},u.createElement("colgroup",null,e.map(((e,t)=>u.createElement("col",{key:t})))),t.map((e=>u.createElement($,{ref:e=>{this.calendarView||(this.calendarView=e)},key:e.getTime(),activeView:this.props.activeView,viewDate:e,min:this.props.min,max:this.props.max,cellUID:i,focusedDate:this.props.focusedDate,cell:this.props.cell,selectedDate:this.props.value,showWeekNumbers:this.weekNumber,onChange:this.handleDateChange,bus:this.props.bus,service:this.props.service,weekCell:this.props.weekCell,showOtherMonthDays:this.props.showOtherMonthDays}))))},this.calculateHeights=()=>{if(!this.props.dom)return;const e=this.props.activeView===C.month?this.props.dom.scrollableContentHeight:this.props.dom.scrollableYearContentHeight;this.bottomOffset=e-this.props.dom.viewHeight(this.props.activeView),this.viewOffset=-1*this.props.dom.headerHeight,this.viewHeight=this.props.dom.viewHeight(this.props.activeView)||1},this.getTake=(e,t)=>Math.min(t-e,this.take),this.handleScrollAction=({index:e,scrollAction:t,pageAction:i})=>{const s=i?i.skip:this.state.skip;if((this.state.index!==e||this.state.skip!==s)&&this.setState({index:e,skip:s}),this.table&&t){const e=`translateY(${t.offset}px)`;this.table.style.transform=e}},this.handleTodayClick=e=>{this.shouldScroll=!0,this.handleDateChange.call(void 0,e,!0)},this.handleDateChange=(e,t=!1)=>{const{onChange:i}=this.props;if(i){const s={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:a.cloneDate(e.value),target:this,isTodayClick:t};i.call(void 0,s)}},this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate,this.state={skip:this.props.service.skip(this.props.focusedDate,this.props.min),index:this.props.service.skip(this.props.focusedDate,this.props.min)}}get element(){return this._element}get weekNames(){return this.intl=n.provideIntlService(this),this.weekService=new W(this.intl),this.weekService.getWeekNames(this.weekNumber,this.props.weekDaysFormat)}get weekNumber(){return!(!this.props.showWeekNumbers||this.props.activeView!==C.month)}get take(){return void 0!==this.props.take?this.props.take:e.defaultProps.take}get animate(){return!(!this.props.smoothScroll||!this.animateToIndex)}get todayIsInRange(){return L(N(),a.getDate(this.props.min),a.getDate(this.props.max))}componentDidUpdate(e,t){this.shouldScroll=!1,void 0!==this.indexToScroll&&this.virtualization&&this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](this.indexToScroll),this.isActive&&this.focusActiveDate(),this.lastView=this.props.activeView,this.indexToScroll=void 0}render(){this.calculateHeights();const e=this.lastView!==this.props.activeView,t=z(this.props.focusedDate,this.props.min,this.props.max),i=e?this.props.service.skip(t,this.props.min):this.state.skip,n=this.props.service.total(this.props.min,this.props.max),o=this.getTake(i,n),r=this.props.service.addToDate(this.props.min,i),l=this.props.service.addToDate(this.props.min,this.state.index),h=new Array(this.props.service.rowLength(this.weekNumber)).fill(""),d=this.props.activeView!==this.lastView;this.animateToIndex=!d,(d||!a.isEqualDate(this.lastFocus,t)||this.shouldScroll||!this.props.shouldScroll||this.props.shouldScroll())&&(this.indexToScroll=this.props.service.skip(t,this.props.min)),this.lastFocus=t;const c=s.classNames("k-calendar-view k-vstack",{"k-calendar-monthview":this.props.activeView===C.month,"k-calendar-yearview":this.props.activeView===C.year,"k-calendar-decadeview":this.props.activeView===C.decade,"k-calendar-centuryview":this.props.activeView===C.century}),p=this.buildDates(h,this.props.service.datesList(r,o)),m=u.createElement(u.Fragment,null,u.createElement(G,{key:"calendar-view-list-header",currentDate:l,min:this.props.min,max:this.props.max,activeView:this.props.activeView,bus:this.props.bus,service:this.props.service,headerTitle:this.props.headerTitle,header:this.props.header,commands:u.createElement(u.Fragment,null,u.createElement(Se,{min:this.props.min,max:this.props.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange,tabIndex:this.props.tabIndex}))}),this.props.activeView===C.month&&this.buildMonthView(h,this.weekNames),u.createElement(k,{key:"calendar-view-list-content",skip:i,take:this.take,total:n,itemHeight:this.viewHeight,topOffset:this.viewOffset,bottomOffset:this.bottomOffset,scrollOffsetSize:this.viewOffset,maxScrollDifference:this.viewHeight,onScroll:this.props.onScroll,onScrollAction:this.handleScrollAction,onMount:this.handleVirtualizationMount,children:p,tabIndex:this.props.tabIndex}));return u.createElement("div",{ref:e=>{this._element=e},className:c},this.props.dom.didCalculate?m:null)}};xe.propTypes={activeView:i.number.isRequired,bottomOffset:i.number,cellUID:i.string.isRequired,focusedDate:i.instanceOf(Date).isRequired,max:i.instanceOf(Date).isRequired,min:i.instanceOf(Date).isRequired,onChange:i.func,showWeekNumbers:i.bool,smoothScroll:i.bool,take:i.number,value:i.instanceOf(Date),viewHeight:i.number,viewOffset:i.number,weekDaysFormat:i.oneOf(["short","abbreviated","narrow"]),tabIndex:i.number},xe.defaultProps={take:5,showWeekNumbers:!1,weekDaysFormat:"short",smoothScroll:!0};let Ce=xe;n.registerForIntl(Ce);let Ie=class extends u.Component{constructor(){super(...arguments),this.handleClick=e=>{const{onClick:t,value:i}=this.props;t&&t.call(void 0,i,e)}}render(){const{isRangeStart:e,value:t,text:i,...a}=this.props;return u.createElement("li",{...a,onClick:this.handleClick},u.createElement("span",{className:s.classNames({"k-calendar-navigation-marker":e})},this.props.children))}};const Me=class e extends u.Component{constructor(e){super(e),this.virtualization=null,this.list=null,this.itemHeight=0,this.topOffset=0,this.maxViewHeight=0,this.bottomOffset=0,this.handleVirtualizationMount=e=>{if(this.virtualization=e,this.virtualization&&this.list){this.list.style.transform=`translateY(${this.topOffset}px)`;const e=z(this.props.focusedDate,this.props.min,this.props.max),t=this.props.service.skip(e,this.props.min);this.virtualization.scrollToIndex(t)}},this.buildNavigationItem=e=>{const t=this.props.service.navigationTitle(e),i=this.props.service.isRangeStart(e),s=`kendo-react-calendar-nav-item-${e.getTime()}`,a={text:t,value:e,isRangeStart:i,view:this.props.activeView,onClick:this.handleDateChange};return this.props.navigationItem?u.createElement(this.props.navigationItem,{...a,key:s},t):u.createElement(Ie,{...a,key:s},t)},this.calculateHeights=()=>{const e=this.props.dom.calendarHeight;this.itemHeight=this.props.dom.navigationItemHeight||1,this.maxViewHeight=this.props.dom.monthViewHeight,this.topOffset=(e-this.itemHeight)/2,this.bottomOffset=e-this.itemHeight},this.handleDateChange=(e,t)=>{const{onChange:i}=this.props;if(i&&t){const s={value:a.cloneDate(e),target:this,nativeEvent:t&&t.nativeEvent,syntheticEvent:t};i.call(void 0,s)}},this.handleScrollAction=({scrollAction:e,pageAction:t})=>{const i=t?t.skip:this.state.skip;if(this.state.skip!==i&&this.setState({skip:i}),this.list&&e){const t=`translateY(${e.offset}px)`;this.list.style.transform=t}},this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate;const t=this.props.service.skip(this.props.focusedDate,this.props.min),i=this.props.service.total(this.props.min,this.props.max);this.state={skip:t-this.getTake(t,i)>0?t:0}}get take(){return void 0!==this.props.take?this.props.take:e.defaultProps.take}componentDidUpdate(e,t){void 0!==this.indexToScroll&&this.virtualization&&this.virtualization.scrollToIndex(this.indexToScroll),this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate,this.indexToScroll=void 0}render(){this.calculateHeights();const e=this.lastView!==this.props.activeView,t=z(this.props.focusedDate,this.props.min,this.props.max),i=e?this.props.service.skip(t,this.props.min):this.state.skip,s=this.props.service.total(this.props.min,this.props.max),n=this.getTake(i,s),o=this.props.service.addToDate(this.props.min,i),r=this.props.service.datesList(o,n);(this.props.activeView!==this.lastView||!a.isEqual(t,this.lastFocus))&&(this.indexToScroll=this.props.service.skip(t,this.props.min));const l=u.createElement(k,{skip:i,take:this.take,total:s,itemHeight:this.itemHeight,topOffset:this.topOffset,bottomOffset:this.bottomOffset,onScroll:this.props.onScroll,maxScrollDifference:this.maxViewHeight,onScrollAction:this.handleScrollAction,onMount:this.handleVirtualizationMount,tabIndex:this.props.tabIndex},u.createElement("ul",{ref:e=>{this.list=e},className:"k-reset"},r.map((e=>this.buildNavigationItem(e)))));return u.createElement("div",{className:"k-calendar-navigation"},u.createElement("span",{className:"k-calendar-navigation-highlight"}),this.props.dom.didCalculate?l:null)}getTake(e,t){return Math.min(t-e,this.take)}};Me.propTypes={activeView:i.number.isRequired,focusedDate:i.instanceOf(Date).isRequired,max:i.instanceOf(Date).isRequired,min:i.instanceOf(Date).isRequired,onChange:i.func,take:i.number,tabIndex:i.number},Me.defaultProps={take:30};let Oe=Me;var Ee=(e=>(e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.Up=2]="Up",e[e.Down=3]="Down",e[e.PrevView=4]="PrevView",e[e.NextView=5]="NextView",e[e.FirstInView=6]="FirstInView",e[e.LastInView=7]="LastInView",e[e.LowerView=8]="LowerView",e[e.UpperView=9]="UpperView",e))(Ee||{});const Ve=[[]],Te={[Ee.Left]:e=>a.addDecades(e,-1),[Ee.Up]:e=>a.addDecades(e,-5),[Ee.Right]:e=>a.addDecades(e,1),[Ee.Down]:e=>a.addDecades(e,5),[Ee.PrevView]:e=>a.addCenturies(e,-1),[Ee.NextView]:e=>a.addCenturies(e,1),[Ee.FirstInView]:e=>a.firstDecadeOfCentury(e),[Ee.LastInView]:e=>a.lastDecadeOfCentury(e)};class Fe{addToDate(e,t){return a.addCenturies(e,t)}datesList(e,t){return A(0,t).map((t=>a.addCenturies(e,t)))}data(e){const{cellUID:t,focusedDate:i,isActiveView:s,max:n,min:o,selectedDate:r,selectionRange:l=I,viewDate:h}=e;if(!h)return Ve;const d=A(0,4),c=a.firstDecadeOfCentury(h),u=a.lastDecadeOfCentury(h),p=N();return A(0,3).map((e=>{const h=a.addDecades(c,4*e);return d.map((e=>{const d=this.normalize(a.addDecades(h,e),o,n),m=this.isEqual(d,l.start),g=this.isEqual(d,l.end),v=!m&&!g&&_(d,l),f=s&&(Array.isArray(r)?this.isSelectedFromArray(d,r,o,n):L(r,o,n)&&this.isEqual(d,r));return H(d,c,u)?{formattedValue:this.value(d),id:`${t}${d.getTime()}`,isFocused:this.isEqual(d,i),isSelected:f,isWeekend:!1,isInRange:L(d,o,n),isRangeStart:m,isRangeMid:v,isRangeEnd:g,isRangeSplitEnd:v&&this.isEqual(d,u),isRangeSplitStart:v&&this.isEqual(d,c),isToday:this.isEqual(d,p),title:this.cellTitle(d),value:d}:null}))}))}isSelectedFromArray(e,t,i,s){let a=!1;return t.forEach((t=>{L(e,i,s)&&this.isEqual(e,t)&&(a=!0)})),a}isEqual(e,t){return!(!e||!t)&&a.firstYearOfDecade(e).getFullYear()===a.firstYearOfDecade(t).getFullYear()}isInArray(e,t){if(!t.length)return!1;const i=e.getFullYear();return t[0].getFullYear()<=i&&i<=t[t.length-1].getFullYear()+99}isInRange(e,t,i){const s=a.firstYearOfDecade(e).getFullYear(),n=!t||a.firstYearOfDecade(t).getFullYear()<=s,o=!i||s<=a.firstYearOfDecade(i).getFullYear();return n&&o}isInSameView(e,t){return 0===a.durationInCenturies(e,t)}isRangeStart(e){return e.getFullYear()%1e3==0}move(e,t){const i=Te[t];return i?i(e):e}cellTitle(e){return a.firstYearOfDecade(e).getFullYear().toString()}navigationTitle(e){return e?a.firstDecadeOfCentury(e).getFullYear().toString():""}title(e){return e?`${a.firstDecadeOfCentury(e).getFullYear()} - ${a.lastDecadeOfCentury(e).getFullYear()}`:""}rowLength(e){return 4}skip(e,t){return a.durationInCenturies(t,e)}total(e,t){return a.durationInCenturies(e,t)+1}value(e){return e?a.firstYearOfDecade(e).getFullYear().toString():""}viewDate(e,t,i=1){return a.durationInCenturies(e,t)<i?a.addCenturies(e,-1):e}normalize(e,t,i){return e<t&&this.isEqual(e,t)?a.cloneDate(t):e>i&&this.isEqual(e,i)?a.cloneDate(i):e}}const Pe=[[]],Re={[Ee.Left]:e=>a.addYears(e,-1),[Ee.Up]:e=>a.addYears(e,-5),[Ee.Right]:e=>a.addYears(e,1),[Ee.Down]:e=>a.addYears(e,5),[Ee.PrevView]:e=>a.addDecades(e,-1),[Ee.NextView]:e=>a.addDecades(e,1),[Ee.FirstInView]:e=>a.firstYearOfDecade(e),[Ee.LastInView]:e=>a.lastYearOfDecade(e)};let Ne=class{addToDate(e,t){return a.addDecades(e,t)}datesList(e,t){return A(0,t).map((t=>a.addDecades(e,t)))}data(e){const{cellUID:t,focusedDate:i,isActiveView:s,max:n,min:o,selectedDate:r,selectionRange:l=I,viewDate:h}=e;if(!h)return Pe;const d=A(0,4),c=a.firstYearOfDecade(h),u=a.lastYearOfDecade(h),p=N();return A(0,3).map((e=>{const h=a.addYears(c,4*e);return d.map((e=>{const d=this.normalize(a.addYears(h,e),o,n),m=this.isEqual(d,l.start),g=this.isEqual(d,l.end),v=!m&&!g&&_(d,l),f=s&&(Array.isArray(r)?this.isSelectedFromArray(d,r,o,n):L(r,o,n)&&this.isEqual(d,r));return H(d,c,u)?{formattedValue:this.value(d),id:`${t}${d.getTime()}`,isFocused:this.isEqual(d,i),isSelected:f,isWeekend:!1,isInRange:L(d,o,n),isRangeStart:m,isRangeMid:v,isRangeEnd:g,isRangeSplitEnd:v&&this.isEqual(d,u),isRangeSplitStart:v&&this.isEqual(d,c),isToday:this.isEqual(d,p),title:this.cellTitle(d),value:d}:null}))}))}isSelectedFromArray(e,t,i,s){let a=!1;return t.forEach((t=>{L(e,i,s)&&this.isEqual(e,t)&&(a=!0)})),a}isEqual(e,t){return!(!e||!t)&&e.getFullYear()===t.getFullYear()}isInArray(e,t){if(!t.length)return!1;const i=e.getFullYear();return t[0].getFullYear()<=i&&i<=t[t.length-1].getFullYear()+9}isInRange(e,t,i){const s=e.getFullYear(),a=!t||t.getFullYear()<=s,n=!i||s<=i.getFullYear();return a&&n}isRangeStart(e){return e.getFullYear()%100==0}isInSameView(e,t){return 0===a.durationInDecades(e,t)}move(e,t){const i=Re[t];return i?i(e):e}cellTitle(e){return e.getFullYear().toString()}navigationTitle(e){return e?a.firstYearOfDecade(e).getFullYear().toString():""}title(e){return e?`${a.firstYearOfDecade(e).getFullYear()} - ${a.lastYearOfDecade(e).getFullYear()}`:""}rowLength(e){return 4}skip(e,t){return a.durationInDecades(t,e)}total(e,t){return a.durationInDecades(e,t)+1}value(e){return e?e.getFullYear().toString():""}viewDate(e,t,i=1){return a.durationInDecades(e,t)<i?a.addDecades(e,-1):e}normalize(e,t,i){return e<t&&this.isEqual(e,t)?a.cloneDate(t):e>i&&this.isEqual(e,i)?a.cloneDate(i):e}};const Le=[[]],Be={[Ee.Left]:e=>a.addDays(e,-1),[Ee.Up]:e=>a.addWeeks(e,-1),[Ee.Right]:e=>a.addDays(e,1),[Ee.Down]:e=>a.addWeeks(e,1),[Ee.PrevView]:e=>a.addMonths(e,-1),[Ee.NextView]:e=>a.addMonths(e,1),[Ee.FirstInView]:e=>a.firstDayOfMonth(e),[Ee.LastInView]:e=>a.lastDayOfMonth(e)};class _e{constructor(e){this.intl=e}addToDate(e,t){return a.addMonths(e,t)}datesList(e,t){return A(0,t).map((t=>a.addMonths(e,t)))}data(e){const{cellUID:t,focusedDate:i,isActiveView:s,max:n,min:o,selectedDate:r,selectionRange:l=I,viewDate:h}=e;if(!h)return Le;const d=a.firstDayOfMonth(h),c=a.lastDayOfMonth(h),u=a.dayOfWeek(d,this.intl.firstDay(),-1),p=A(0,7),m=N();return A(0,6).map((e=>{const h=a.addDays(u,7*e);return p.map((e=>{const u=this.normalize(a.addDays(h,e),o,n),p=u<d||u>c,g=this.isEqual(u,l.start),v=this.isEqual(u,l.end),f=!g&&!v&&_(u,l),w=s&&(Array.isArray(r)?this.isSelectedFromArray(u,r,o,n):L(r,o,n)&&this.isEqual(u,r));return{formattedValue:this.value(u),id:`${t}${u.getTime()}`,isFocused:this.isEqual(u,i),isSelected:w,isInRange:L(u,o,n),isWeekend:this.isWeekend(u),isRangeStart:g,isRangeMid:f,isRangeEnd:v,isRangeSplitStart:f&&this.isEqual(u,d),isRangeSplitEnd:f&&this.isEqual(u,c),isToday:this.isEqual(u,m),title:this.cellTitle(u),value:u,isOtherMonth:p}}))}))}isEqual(e,t){return!(!e||!t)&&a.getDate(e).getTime()===a.getDate(t).getTime()}isSelectedFromArray(e,t,i,s){let a=!1;return t.forEach((t=>{L(e,i,s)&&this.isEqual(e,t)&&(a=!0)})),a}isInArray(e,t){return!!t.length&&a.firstDayOfMonth(t[0])<=e&&e<=a.lastDayOfMonth(t[t.length-1])}isInRange(e,t,i){const s=a.getDate(e),n=!t||a.getDate(t)<=s,o=!i||s<=a.getDate(i);return n&&o}isInSameView(e,t){return 0===a.durationInMonths(e,t)}isRangeStart(e){return!e.getMonth()}move(e,t){const i=Be[t];return i?i(e):e}cellTitle(e){return this.intl.formatDate(e,"D")}navigationTitle(e){return e?this.isRangeStart(e)?e.getFullYear().toString():this.abbrMonthNames()[e.getMonth()]:""}title(e){return`${this.wideMonthNames()[e.getMonth()]} ${e.getFullYear()}`}rowLength(e){return 7+(e?1:0)}skip(e,t){return a.durationInMonths(t,e)}total(e,t){return a.durationInMonths(e,t)+1}value(e){return e?e.getDate().toString():""}viewDate(e,t,i=1){return a.durationInMonths(e,t)<i?a.addMonths(e,-1):e}isWeekend(e){const t=e.getDay();return 6===t||0===t}abbrMonthNames(){return this.intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(e,t,i){return e<t&&this.isEqual(e,t)?a.getDate(t):e>i&&this.isEqual(e,i)?a.getDate(i):e}wideMonthNames(){return this.intl.dateFormatNames({nameType:"wide",type:"months",standAlone:!0})}}const Ae=[[]],He={[Ee.Left]:e=>a.addMonths(e,-1),[Ee.Up]:e=>a.addMonths(e,(e=>e>4?-5:e<2?-2:-7)(e.getMonth())),[Ee.Right]:e=>a.addMonths(e,1),[Ee.Down]:e=>a.addMonths(e,(e=>e<7?5:e<10?7:2)(e.getMonth())),[Ee.PrevView]:e=>a.addYears(e,-1),[Ee.NextView]:e=>a.addYears(e,1),[Ee.FirstInView]:e=>a.firstMonthOfYear(e),[Ee.LastInView]:e=>a.lastMonthOfYear(e)};class ze{constructor(e){this._intl=e}addToDate(e,t){return a.addYears(e,t)}datesList(e,t){return A(0,t).map((t=>a.addYears(e,t)))}data(e){const{cellUID:t,focusedDate:i,isActiveView:s,max:n,min:o,selectedDate:r,selectionRange:l=I,viewDate:h}=e;if(!h)return Ae;const d=this.abbrMonthNames(),c=a.firstMonthOfYear(h),u=a.lastMonthOfYear(h),p=c.getFullYear(),m=A(0,4),g=N();return A(0,3).map((e=>{const h=a.addMonths(c,4*e);return m.map((e=>{const m=this.normalize(a.addMonths(h,e),o,n);if(p<m.getFullYear())return null;const v=this.isEqual(m,l.start),f=this.isEqual(m,l.end),w=!v&&!f&&_(m,l),b=s&&(Array.isArray(r)?this.isSelectedFromArray(m,r,o,n):L(r,o,n)&&this.isEqual(m,r));return{formattedValue:d[m.getMonth()],id:`${t}${m.getTime()}`,isFocused:this.isEqual(m,i),isSelected:b,isInRange:L(m,o,n),isWeekend:!1,isRangeStart:v,isRangeMid:w,isRangeEnd:f,isRangeSplitEnd:w&&this.isEqual(m,u),isRangeSplitStart:w&&this.isEqual(m,c),isToday:this.isEqual(m,g),title:this.cellTitle(m),value:m}}))}))}isSelectedFromArray(e,t,i,s){let a=!1;return t.forEach((t=>{L(e,i,s)&&this.isEqual(e,t)&&(a=!0)})),a}isEqual(e,t){return!(!e||!t)&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth())}isInArray(e,t){if(!t.length)return!1;const i=e.getFullYear();return t[0].getFullYear()<=i&&i<=t[t.length-1].getFullYear()}isInRange(e,t,i){const s=a.createDate(e.getFullYear(),e.getMonth(),1),n=!t||a.createDate(t.getFullYear(),t.getMonth(),1)<=s,o=!i||s<=a.createDate(i.getFullYear(),i.getMonth(),1);return n&&o}isInSameView(e,t){return 0===a.durationInYears(e,t)}isRangeStart(e){return e.getFullYear()%10==0}move(e,t){const i=He[t];return i?i(e):e}cellTitle(e){return`${e.getFullYear()} ${this.value(e)}`}navigationTitle(e){return this.title(e)}title(e){return e?e.getFullYear().toString():""}rowLength(e){return 4}skip(e,t){return a.durationInYears(t,e)}total(e,t){return a.durationInYears(e,t)+1}value(e){return e?this.abbrMonthNames()[e.getMonth()]:""}viewDate(e,t,i=1){return a.durationInYears(e,t)<i?a.addYears(e,-1):e}abbrMonthNames(){return this._intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(e,t,i){return e<t&&this.isEqual(e,t)?a.cloneDate(t):e>i&&this.isEqual(e,i)?a.cloneDate(i):e}}const qe={[C.month]:_e,[C.year]:ze,[C.decade]:Ne,[C.century]:Fe};let Ke=class{constructor(e){this.bottom=C.month,this.top=C.century,this.onViewChanged=e}configure(e,t){this.bottom=e,this.top=t}service(e,t){return new qe[`${e}`](t)}moveDown(e,t){this.move(e,-1,t)}moveUp(e,t){this.move(e,1,t)}moveToBottom(e){e!==this.bottom&&this.onViewChanged({view:this.bottom})}canMoveDown(e){return this.bottom<e}canMoveUp(e){return e<this.top}clamp(e){return e<this.bottom?this.bottom:e>this.top?this.top:e}move(e,t,i){const s=this.clamp(((e,t)=>{const i=C[C[e+t]];return void 0!==i?i:e})(e,t));s!==e&&this.onViewChanged({view:s},i)}},We=class{constructor(){this.calendarHeight=0,this.headerHeight=0,this.monthViewHeight=0,this.yearViewHeight=0,this.decadeViewHeight=0,this.centuryViewHeight=0,this.navigationItemHeight=0,this.scrollableContentHeight=0,this.scrollableYearContentHeight=0,this.calendarWidth=0,this.monthViewWidth=0,this.yearViewWidth=0,this.decadeViewWidth=0,this.centuryViewWidth=0,this.scrollableContentWidth=0,this.didCalculate=!1,this.hostContainer=null}ensureHeights(){void 0===this.calendarHeight&&this.calculateHeights()}calculateHeights(e){if(!s.canUseDOM)return;const t=q("div"),i=q("ul"),a=q("li"),n=q("td"),o=q("th"),r=q("tr"),l=q("tbody"),h=q("thead"),d=q("table"),c=()=>t('\n <span class="k-button k-button-md k-button-rectangle k-button-solid k-button-solid-base k-button-flat k-calendar-title">\n <span className="k-button-text">March 2017</span>\n </span>\n <span class="k-spacer"></span>\n <span class="k-calendar-nav k-hstack"><button class="k-calendar-nav-today">TODAY</button></span>\n ',"k-calendar-header k-hstack"),u=(e,t)=>new Array(e).fill("1").map(t),p=e=>t(e,"k-content k-scrollable"),m=(()=>{let e;return()=>s.canUseDOM?(e||(e=t([p([i([a("<span>FEB</span>")])])],"k-calendar-navigation",{left:"0px",position:"absolute"})),e):null})(),g=({cells:e,rows:i},a,m)=>{let g;return()=>s.canUseDOM?(g||(g=((e,i,s)=>t(s?[c(),d([h([r([o("MO","k-calendar-th")],"k-calendar-tr")],"k-calendar-thead")],"k-calendar-table k-calendar-weekdays"),p([e,e])]:[c(),p([e,e])],i,{left:"-10000px",position:"absolute"}))(((e,t=1)=>d([l([r([n("1","k-calendar-td k-alt")])].concat(u(e,(()=>r(u(t,(e=>n(`<span class="k-link">${e}</span>`,"k-calendar-td"))),"k-calendar-tr")))),"k-calendar-tbody")],"k-calendar-table"))(i,e),a,m)),g):null},v=e=>e.querySelector(".k-scrollable"),f=e=>{const t=v(e);return t.className=`${t.className} k-scrollable-horizontal`,e},w=g({cells:7,rows:6},"k-calendar-view k-calendar-monthview k-vstack",!0),b=g({cells:5,rows:3},"k-calendar-view k-calendar-yearview",!1),D=g({cells:5,rows:2},"k-calendar-view k-calendar-decadeview",!1),y=e=>parseFloat(window.getComputedStyle(e).height)||e.offsetHeight,k=e=>{const t=window.getComputedStyle(e);return parseFloat(t.width)+parseFloat(t.paddingLeft)+parseFloat(t.paddingRight)||e.offsetWidth},S=e=>e.querySelector("tbody");this.didCalculate=!0,e&&(this.hostContainer=e),this.batch(w(),(e=>{const t=S(e);this.calendarHeight=y(e),this.monthViewHeight=y(t),this.headerHeight=y(t.children[0]),this.scrollableContentHeight=y(v(e))})),this.batch(f(w()),(e=>{const t=S(e);this.calendarWidth=k(e),this.monthViewWidth=k(t),this.scrollableContentWidth=k(v(e))})),this.batch(b(),(e=>{this.yearViewHeight=y(S(e)),this.scrollableYearContentHeight=y(v(e))})),this.batch(f(b()),(e=>{this.yearViewWidth=k(S(e))})),this.batch(D(),(e=>{this.decadeViewHeight=y(S(e)),this.centuryViewHeight=this.decadeViewHeight})),this.batch(f(D()),(e=>{this.decadeViewWidth=k(S(e)),this.centuryViewWidth=this.decadeViewWidth})),this.batch(m(),(e=>{this.navigationItemHeight=y(e.querySelector("li"))}))}viewHeight(e){return this.viewDimension(e,"height")}viewWidth(e){return this.viewDimension(e,"width")}viewDimension(e,t){const i="height"===t?"ViewHeight":"ViewWidth";switch(e){case C.month:return this[`month${i}`];case C.year:return this[`year${i}`];case C.decade:return this[`decade${i}`];case C.century:return this[`century${i}`];default:return 1}}batch(e,t){const i=this.hostContainer||document.body,s=i.appendChild(e);t(s),i.removeChild(s)}};const Ue={33:Ee.PrevView,34:Ee.NextView,35:Ee.LastInView,36:Ee.FirstInView,37:Ee.Left,38:Ee.Up,39:Ee.Right,40:Ee.Down,"meta+38":Ee.UpperView,"meta+40":Ee.LowerView};let Ye=class{constructor(e){this.bus=e}action(e){const t=`${e.ctrlKey||e.metaKey?"meta+":""}${e.keyCode}`;return Ue[t]}move(e,t,i,s,a){return s?t===Ee.UpperView&&this.bus.canMoveUp(i)?(this.bus.moveUp(i,a),e):t===Ee.LowerView&&this.bus.canMoveDown(i)?(this.bus.moveDown(i,a),e):s.move(e,t):e}};class $e{constructor(e){this.dom=e,this.divideByMagnitude=null,this.powerByMagnitude=null,this.navigator=null,this.view=null,this.monthScrolled=!1,this.navScrolled=!1}configure(e){const t=Math.max(this.dom.viewHeight(e)/this.dom.navigationItemHeight,1);this.divideByMagnitude=(e=>t=>Math.floor(t/e))(t),this.powerByMagnitude=(e=>t=>t*e)(t)}sync(e,t,i){if(e&&t){if(this.navigator=e,this.view=t,i.target===this.navigator.element){if(this.monthScrolled)return void(this.monthScrolled=!1);this.navScrolled=!0,this.scrollSiblingOf(this.navigator.element)}if(i.target===this.view.element){if(this.navScrolled)return void(this.navScrolled=!1);this.monthScrolled=!0,this.scrollSiblingOf(this.view.element)}}}scrollSiblingOf(e){const t=this.siblingComponent(e),i=this.calculateScroll(t,e.scrollTop);t.scrollTo(i)}siblingComponent(e){return this.navigator.element===e?this.view:this.navigator}calculateScroll(e,t){const i=e===this.navigator?this.divideByMagnitude:this.powerByMagnitude;return i?i(t):0}}const je=e=>e?e.virtualization:null,Ze=(e=Xe.defaultProps.min,t=Xe.defaultProps.max,i,s)=>void 0!==s?null!==s&&L(a.getDate(s),e,t)?s:null:null!==i&&L(a.getDate(i),e,t)?i:null,Ge=class e extends u.Component{constructor(t){super(t),this.scrollSyncService=null,this.focusedDate=null,this.Navigation=null,this.calendarViewList=null,this._element=null,this.intl=null,this.service=null,this.isActive=!1,this.didNavigationChange=!1,this.focus=()=>{this._element&&this._element.focus()},this.shouldScroll=()=>this.didNavigationChange,this.handleScroll=e=>{this.scrollSyncService&&this.scrollSyncService.sync(je(this.Navigation),je(this.calendarViewList),e)},this.handleNavigationChange=e=>{if(this.props.disabled)return;this.didNavigationChange=!0;const t=a.cloneDate(e.value);this.setState({focusedDate:t})},this.handleViewChange=({view:e})=>{this.scrollSyncService&&this.scrollSyncService.configure(e),this.setState({activeView:e})},this.handleDateChange=e=>{const t=a.cloneDate(e.value),i=a.cloneDate(e.value),s=this.bus.canMoveDown(this.state.activeView);if(this.props.disabled)return;if(s){if(!e.isTodayClick)return this.bus.moveDown(this.state.activeView,e.syntheticEvent),void this.setState({focusedDate:i});this.bus.moveToBottom(this.state.activeView)}this.setState({value:t,focusedDate:i}),this.valueDuringOnChange=t;const{onChange:n}=this.props;if(n){const i={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:t,target:this};n.call(void 0,i)}this.valueDuringOnChange=void 0},this.handleFocus=e=>{if(this.isActive=!0,!this.calendarViewList)return;this.calendarViewList.focusActiveDate();const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleBlur=e=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.handleKeyDown=e=>{const{keyCode:t,ctrlKey:i,metaKey:n}=e;if(this.focusedDate&&this.service){if(84===t&&this.setState({focusedDate:N()}),(i||n)&&(t===s.Keys.left||t===s.Keys.right)){if(this.props.disabled)return;this.didNavigationChange=!0,31===this.focusedDate.getDate()&&this.focusedDate.setDate(30);const e=t===s.Keys.left?this.focusedDate.getMonth()-1:this.focusedDate.getMonth()+1,i=new Date(this.focusedDate.setMonth(e)),n=a.cloneDate(i);this.setState({focusedDate:n})}if(t===s.Keys.enter){if(null!==this.value&&a.isEqualDate(this.focusedDate,this.value)){const e=z(this.focusedDate,this.min,this.max);je(this.calendarViewList).scrollToIndex(this.service.skip(e,this.min))}const t={syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(t)}else{const t=z(this.navigation.move(this.focusedDate,this.navigation.action(e),this.state.activeView,this.service,e),this.min,this.max);if(a.isEqualDate(this.focusedDate,t))return;this.setState({focusedDate:t})}e.preventDefault()}},this.handleMouseDown=e=>{e.preventDefault()},this.handleClick=e=>{this._element&&this._element.focus({preventScroll:!0})},s.validatePackage(p);const i=Ze(this.min,this.max,this.props.defaultValue||e.defaultProps.defaultValue,this.props.value);this.state={value:i,activeView:O(C[t.defaultActiveView],this.bottomView,this.topView),focusedDate:z(t.focusedDate||i||N(),this.min,this.max)},this.dom=new We,this.bus=new Ke(this.handleViewChange),this.navigation=new Ye(this.bus),this.oldValue=i}get cellUID(){return this.props.id+"-cell-uid"}get id(){return this.props.id+"-id"}get element(){return this._element}get value(){return void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.props.value?this.props.value:this.state.value}get min(){return a.getDate(void 0!==this.props.min?this.props.min:e.defaultProps.min)}get max(){return a.getDate(void 0!==this.props.max?this.props.max:e.defaultProps.max)}get bottomView(){return C[void 0!==this.props.bottomView?this.props.bottomView:e.defaultProps.bottomView]}get topView(){return C[void 0!==this.props.topView?this.props.topView:e.defaultProps.topView]}componentDidMount(){Promise.resolve().then((()=>{s.setScrollbarWidth(),this._element&&(this.dom.calculateHeights(this._element),this.scrollSyncService=new $e(this.dom),this.scrollSyncService.configure(this.state.activeView),this.forceUpdate())}))}componentDidUpdate(e,t){s.setScrollbarWidth(),t.activeView!==this.state.activeView&&this.scrollSyncService&&this.scrollSyncService.configure(this.state.activeView),this.calendarViewList&&(this.isActive?this.calendarViewList.focusActiveDate:this.calendarViewList.blurActiveDate)(),this.didNavigationChange=!1,this.isActive&&(this.oldValue=this.value)}render(){this.props._ref&&this.props._ref(this);const t=null!==this.value&&null!==this.oldValue?!a.isEqualDate(this.value,this.oldValue):this.value!==this.oldValue,i=O(this.state.activeView,C[void 0!==this.props.bottomView?this.props.bottomView:e.defaultProps.bottomView],C[void 0!==this.props.topView?this.props.topView:e.defaultProps.topView]),o=Ze(this.min,this.max,this.value,this.value),r=o?a.getDate(o):null;this.focusedDate=a.getDate(z(t&&null!==o?o:this.state.focusedDate,this.min,this.max)),this.intl=n.provideIntlService(this),this.bus.configure(this.bottomView,this.topView),this.service=this.bus.service(i,this.intl);const{smoothScroll:l=Number.parseFloat(u.version)<18}=this.props,h=s.classNames("k-calendar k-calendar-infinite",{"k-disabled":this.props.disabled,"k-week-number":this.props.weekNumber},this.props.mobileMode?"k-calendar-lg":"k-calendar-md",this.props.className),d=[this.props.navigation&&u.createElement(Oe,{key:0,ref:e=>{this.Navigation=e},activeView:this.state.activeView,focusedDate:this.focusedDate,min:this.min,max:this.max,onScroll:this.handleScroll,onChange:this.handleNavigationChange,service:this.service,dom:this.dom,navigationItem:this.props.navigationItem,tabIndex:this.props.tabIndex}),u.createElement(Ce,{key:1,ref:e=>{this.calendarViewList=e},activeView:this.state.activeView,focusedDate:this.focusedDate,min:this.min,max:this.max,bus:this.bus,shouldScroll:this.shouldScroll,onScroll:this.handleScroll,service:this.service,cell:this.props.cell,weekCell:this.props.weekCell,dom:this.dom,smoothScroll:l,showWeekNumbers:this.props.weekNumber,onChange:this.handleDateChange,value:r,cellUID:this.cellUID,headerTitle:this.props.headerTitle,header:this.props.header,tabIndex:this.props.tabIndex,weekDaysFormat:this.props.weekDaysFormat,showOtherMonthDays:this.props.showOtherMonthDays})];return u.createElement("div",{ref:e=>{this._element=e},className:h,id:this.props.id||this.id,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,"aria-disabled":this.props.disabled,tabIndex:this.props.disabled?void 0:this.props.tabIndex||0,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,onClick:this.handleClick},d)}};Ge.displayName="Calendar",Ge.propTypes={className:i.string,defaultActiveView:i.oneOf(["month","year","decade","century"]),defaultValue:i.instanceOf(Date),disabled:i.bool,focusedDate:i.instanceOf(Date),id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,weekDaysFormat:i.oneOf(["short","abbreviated","narrow"]),max:i.instanceOf(Date),min:i.instanceOf(Date),navigation:i.bool,smoothScroll:i.bool,onBlur:i.func,onChange:i.func,onFocus:i.func,tabIndex:i.number,value:i.instanceOf(Date),weekNumber:i.bool,topView:(e,t,i)=>{const s=e[t],a=e.bottomView;return s&&a&&C[s]<C[a]?new Error(`Invalid prop + ${t} suplied to ${i}.\n ${t} can not be smaller than bottomView.\n `):null},bottomView:(e,t,i)=>{const s=e[t],a=e.topView;return s&&a&&C[s]>C[a]?new Error(`Invalid prop + ${t} suplied to ${i}.\n ${t} can not be bigger than topView.\n `):null}},Ge.defaultProps={disabled:!1,min:V,max:T,weekDaysFormat:"short",navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",bottomView:"month",showOtherMonthDays:!1};let Xe=Ge;const Je=s.createPropsContext(),Qe=s.withIdHOC(s.withPropsContext(Je,Xe));Qe.displayName="KendoReactCalendar",n.registerForIntl(Xe);class et{constructor(){this.symbols="",this.partMap=[]}}const tt=(e,t)=>(e[t.pattern[0]]=t.type,e),it=["k-widget","k-dateinput"];let st=class{constructor(e,t,i){this.year=!0,this.month=!0,this.date=!0,this.hours=!0,this.minutes=!0,this.seconds=!0,this.milliseconds=!0,this.leadingZero=null,this.typedMonthPart="",this.knownParts="adHhmMsEy",this.symbols={E:"E",H:"H",M:"M",a:"a",d:"d",h:"h",m:"m",s:"s",y:"y"},this._value=a.getDate(new Date),this.intlProvider=e,this.formatPlaceholder=t,this.format=i,this.monthNames=this.allFormatedMonths()}get intl(){return this.intlProvider()}get value(){return this._value}setValue(e){e?a.isEqual(e,this._value)||(this._value=a.cloneDate(e),this.modifyExisting(!0)):(this._value=a.getDate(new Date),this.modifyExisting(!1))}hasValue(){return this.intl.splitDateFormat(this.format).reduce(((e,t)=>e||"literal"!==t.type&&"dayperiod"!==t.type&&this.getExisting(t.pattern[0])),!1)}getDateObject(){for(let e=0;e<this.knownParts.length;e++)if(!this.getExisting(this.knownParts[e]))return null;return a.cloneDate(this.value)}getTextAndFormat(){return this.merge(this.intl.formatDate(this.value,this.format),this.dateFormatString(this.value,this.format))}modifyExisting(e){const t=this.dateFormatString(this.value,this.format).symbols;for(let i=0;i<t.length;i++)this.setExisting(t[i],e)}getExisting(e){switch(e){case"y":return this.year;case"M":case"L":return this.month;case"d":return this.date;case"E":return this.date&&this.month&&this.year;case"h":case"H":return this.hours;case"m":return this.minutes;case"s":return this.seconds;default:return!0}}setExisting(e,t){switch(e){case"y":this.year=t,!1===t&&this._value.setFullYear(2e3);break;case"M":this.month=t,!1===t&&this._value.setMonth(0);break;case"d":this.date=t;break;case"h":case"H":this.hours=t;break;case"m":this.minutes=t;break;case"s":this.seconds=t;break;default:return}}modifyPart(e,t){let i=a.cloneDate(this.value);switch(e){case"y":i.setFullYear(i.getFullYear()+t);break;case"M":i=a.addMonths(this.value,t);break;case"d":case"E":i.setDate(i.getDate()+t);break;case"h":case"H":i.setHours(i.getHours()+t);break;case"m":i.setMinutes(i.getMinutes()+t);break;case"s":i.setSeconds(i.getSeconds()+t);break;case"a":i.setHours(i.getHours()+12*t)}this.setExisting(e,!0),this._value=i}parsePart(e,t){if(this.resetLeadingZero(),!t)return this.setExisting(e,!1),{value:null};const i=this.intl.formatDate(this.value,this.format),s=this.dateFormatString(this.value,this.format),n=s.symbols;let o=!1,r="",l="",h="";for(let t=0;t<i.length;t++)n[t]===e?(l+=this.getExisting(e)?i[t]:"0",o=!0):o?h+=i[t]:r+=i[t];let d=null;const c=this.matchMonth(t);for(;l.length>0&&"0"===l.charAt(0);)l=l.slice(1);l.length>=4&&(l="");for(let i=0;i<2;i++){let i=l+t,s=parseInt(i,10);if(d=this.intl.parseDate(r+i+h,this.format),!d&&!isNaN(s)&&!isNaN(parseInt(t,10))){if("M"===e&&!c){const e=s-1;e>-1&&e<12&&(d=a.cloneDate(this.value),d.setMonth(e),d.getMonth()!==e&&(d=a.lastDayOfMonth(a.addMonths(d,-1))))}"y"===e&&(d=a.createDate(parseInt(i,10),this.month?this.value.getMonth():0,this.date?this.value.getDate():1,this.hours?this.value.getHours():0,this.minutes?this.value.getMinutes():0,this.seconds?this.value.getSeconds():0,this.milliseconds?this.value.getMilliseconds():0),this.date&&d.getDate()!==this.value.getDate()&&(d=a.lastDayOfMonth(a.addMonths(d,-1))))}if(d)return this._value=d,this.setExisting(e,!0),{value:this.value};l=""}return c&&(d=this.intl.parseDate(r+c+h,this.format),d)?(this._value=d,this.setExisting(e,!0),{value:this.value}):("0"===t&&(this.leadingZero=this.isAbbrMonth(s.partMap,e)?null:{[e]:!0},this.setExisting(e,!1)),{value:null})}symbolMap(e){return this.intl.splitDateFormat(this.format).reduce(tt,{})[e]}resetLeadingZero(){const e=null!==this.leadingZero;return this.leadingZero=null,e}isAbbrMonth(e,t){const i=this.partPattern(e,t);return"month"===i.type&&i.names}partPattern(e,t){return e.filter((e=>-1!==e.pattern.indexOf(t)))[0]}matchMonth(e){if(this.typedMonthPart+=e.toLowerCase(),0===this.monthNames.length)return"";for(;this.typedMonthPart.length>0;){for(let e=0;e<this.monthNames.length;e++)if(0===this.monthNames[e].toLowerCase().indexOf(this.typedMonthPart))return this.monthNames[e];const e=parseInt(this.typedMonthPart,10);if(e>=1&&e<=12&&e.toString()===this.typedMonthPart)return this.monthNames[e-1];this.typedMonthPart=this.typedMonthPart.substring(1,this.typedMonthPart.length)}return""}allFormatedMonths(){const e=this.intl.splitDateFormat(this.format);for(let t=0;t<e.length;t++)if("month"===e[t].type&&e[t].names)return this.intl.dateFormatNames(e[t].names);return[]}dateFormatString(e,t){const i=this.intl.splitDateFormat(t),s=[],a=[];for(let t=0;t<i.length;t++){let n=this.intl.formatDate(e,{pattern:i[t].pattern}).length;for(;n>0;)s.push(this.symbols[i[t].pattern[0]]||"_"),a.push(i[t]),n--}const n=new et;return n.symbols=s.join(""),n.partMap=a,n}merge(e,t){let i="",s="",a=t.symbols;for(let n=a.length-1;n>=0;n--)if(-1===this.knownParts.indexOf(a[n])||this.getExisting(a[n]))i=e[n]+i,s=a[n]+s;else{const e=a[n];for(;n>=0&&e===a[n];)n--;for(n++,i=this.leadingZero&&this.leadingZero[e]?"0"+i:this.dateFieldName(t.partMap[n])+i;s.length<i.length;)s=a[n]+s}return{text:i,format:s}}dateFieldName(e){const t=this.formatPlaceholder||"wide";return t[e.type]?t[e.type]:"formatPattern"===t?e.pattern:this.intl.dateFieldName(Object.assign(e,{nameType:t}))}};const at="dayperiod",nt="hour",ot="minute",rt="second",lt=e=>(t,i)=>{const s=a.cloneDate(t);return s[e](i),s},ht=[{type:nt,getter:e=>e.getHours()},{type:ot,getter:e=>e.getMinutes()},{type:rt,getter:e=>e.getSeconds()},{type:"millisecond",getter:e=>e.getMilliseconds()}],dt=(e=>t=>e.map((e=>t=>e[t.type]?(e=>(t,i)=>e(i))(t.getter):(e=>(t,i)=>e(t))(t.getter))((e=>e.reduce(((e,t)=>(e[t.type]=t.type,e)),{}))(t))))(ht),ct=(e=>(t,i)=>e.map((e=>{const s=Math.floor(t[e.type]);return s?((e,t,i,s)=>a=>{const n=e(a),o=e(i);return"hour"===s?n-(n-o)%t:a.getTime()<=i.getTime()&&0!==n&&n<=o?Math.ceil(n/t)*t:n-n%t})(e.getter,s,i,e.type):e.getter})))(ht),ut=e=>t=>{const i=a.cloneDate(t);return i.setHours(...e.map((e=>e(i)))),i},pt=lt("setHours"),mt=lt("setMinutes"),gt=lt("setSeconds"),vt=()=>new Date,ft=(e,t,i=1)=>{const s=[];for(let a=e;a<t;a+=i)s.push(a);return s},wt=(e,t,i)=>({candidateValue:R(E,e),maxValue:a.addDays(R(E,i),t.getHours()<i.getHours()?0:1),minValue:R(E,t)}),bt=(e,t,i)=>{if(!e||!t||!i)return!0;const{candidateValue:s,minValue:a,maxValue:n}=wt(e,t,i);return a<=s&&s<=n},Dt=(e,t,i)=>{if(null===e)return!0;const{candidateValue:s,minValue:a,maxValue:n}=wt(e,t,i);return a<=s&&s<=n},yt=(e,t)=>{if(null===e||null===t)return!1;const i=R(E,e),s=R(E,t);return i.getTime()<s.getHours()},kt=(e,t)=>{if(null===e||null===t)return!1;const i=R(E,e);return R(E,t).getTime()<i.getHours()};let St=class extends u.Component{constructor(){super(...arguments),this.handelClick=e=>{e.stopPropagation();const{onClick:t}=this.props;t&&t.call(void 0,e)}}render(){const e=n.provideLocalizationService(this).toLanguageString(te,ye[te]);return u.createElement("span",{className:"k-clear-value",role:"button",onClick:this.handelClick,tabIndex:this.props.tabindex||-1,title:e,key:"clearbutton"},u.createElement(s.IconWrap,{name:"x",icon:r.xIcon}))}};n.registerForLocalization(St);const xt=class e extends u.Component{constructor(t){super(t),this.kendoDate=null,this.currentFormat="",this.paste=!1,this._element=null,this._wrapper=null,this._lastSelectedSymbol="",this.focus=()=>{this._element&&this._element.focus()},this.setValidity=()=>{this.element&&this.element.setCustomValidity&&this.element.setCustomValidity(this.validity.valid?"":this.props.validationMessage||e.defaultProps.validationMessage)},this.updateOnPaste=e=>{if(!this.element||!this.kendoDate)return;const t=n.provideIntlService(this).parseDate(this.element.value,this.props.format)||this.value,i=this.value;this.kendoDate.setValue(t),this.triggerChange(e,i)},this.spinnersMouseDown=e=>{e.preventDefault();const t=s.getActiveElement(document);this.element&&t!==this.element&&this.element.focus({preventScroll:!0})},this.handlePaste=()=>{this.paste=!0},this.handleClick=e=>{this.props.onChange&&this.props.onChange(e)},this.elementChange=e=>{if(!this.element||!this.kendoDate)return;if(this.paste)return this.updateOnPaste(e),void(this.paste=!1);const{text:t,format:i}=this.kendoDate.getTextAndFormat();this.currentFormat=i;const s=this.value,a=((e,t,i,s)=>{const a=e[s+e.length-i.length],n=e.substring(0,s+e.length-i.length),o=i.substring(0,s),r=[];if(n===o&&s>0)return r.push([t[s-1],o[s-1]]),r;if(0===n.indexOf(o)&&(0===o.length||t[o.length-1]!==t[o.length])){let e="";1===o.length&&r.push([t[0],o[0]]);for(let i=o.length;i<n.length;i++)t[i]!==e&&"_"!==t[i]&&(e=t[i],r.push([e,""]));return r}if(0===o.indexOf(n)||"_"===t[s-1]){let e=t[0];for(let i=Math.max(0,n.length-1);i<t.length;i++)if("_"!==t[i]){e=t[i];break}return[[e,o[s-1]]]}return" "===o[o.length-1]||o[o.length-1]===a?[[t[s-1],"_"]]:[[t[s-1],o[s-1]]]})(t,this.currentFormat,this.element.value,this.selection.start),n=1===a.length&&"_"===a[0][1];if(!n)for(let e=0;e<a.length;e++)this.kendoDate.parsePart(a[e][0],a[e][1]);a.length&&"_"!==a[0][0]&&this.setSelection(this.selectionBySymbol(a[0][0])),n&&this.switchDateSegment(1),this.triggerChange(e,s)},this.elementClick=e=>{this.setSelection(this.selectionByIndex(this.selection.start))},this.nativeWheel=e=>{s.getActiveElement(document)===this.element&&e.preventDefault()},this.wheel=e=>{s.getActiveElement(document)===this.element&&(e.nativeEvent.deltaY<0&&this.increasePart(e),e.nativeEvent.deltaY>0&&this.decreasePart(e))},this.increasePart=e=>{this.modifyDateSegmentValue(1,e)},this.decreasePart=e=>{this.modifyDateSegmentValue(-1,e)},this.elementKeyDown=e=>{if(!e.altKey){switch(e.keyCode){case 37:this.switchDateSegment(-1);break;case 38:this.modifyDateSegmentValue(1,e);break;case 39:this.switchDateSegment(1);break;case 40:this.modifyDateSegmentValue(-1,e);break;default:return}e.preventDefault()}},this.elementOnFocus=e=>{this.wrapper&&this.wrapper.classList.add("k-focus"),this.setState({focused:!0})},this.elementOnBlur=e=>{this.wrapper&&this.wrapper.classList.remove("k-focus"),this.setState({focused:!1})},s.validatePackage(p),this.state={focused:!1}}get _inputId(){return this.props.id+"-accessibility-id"}componentDidMount(){this.setValidity(),this.wrapper&&this.wrapper.addEventListener("wheel",this.nativeWheel,{passive:!1})}componentDidUpdate(e,t){this._lastSelectedSymbol&&t.focused===this.state.focused?this.setSelection(this.selectionBySymbol(this._lastSelectedSymbol)):void 0!==this.props.placeholder&&this.selection.start===this.selection.end&&this.setSelection({start:0,end:this.currentFormat.length}),this.setValidity()}componentWillUnmount(){this.wrapper&&this.wrapper.removeEventListener("wheel",this.nativeWheel)}render(){const{size:t=e.defaultProps.size,fillMode:i=e.defaultProps.fillMode,rounded:a=e.defaultProps.rounded,autoFocus:h=e.defaultProps.autoFocus}=this.props;this.props._ref&&(this.props._ref.current=this);const d=n.provideLocalizationService(this),c={...e.defaultProps,...this.props},{name:p,label:m,id:g}=c,v=this.text,f=v===this.props.placeholder?"":v,w=v===this.props.placeholder?v:void 0,b=g||this._inputId,D=!this.validityStyles||this.validity.valid,y=[...it];this.props.className&&y.push(this.props.className);const k=u.createElement(s.AsyncFocusBlur,{onFocus:this.elementOnFocus,onBlur:this.elementOnBlur},(({onFocus:e,onBlur:n})=>u.createElement("span",{ref:e=>{this._wrapper=e},style:m?void 0:{width:this.props.width},dir:this.props.dir,className:s.classNames("k-dateinput","k-input",{[`k-input-${s.kendoThemeMaps.sizeMap[t]||t}`]:t,[`k-input-${i}`]:i,[`k-rounded-${s.kendoThemeMaps.roundedMap[a]||a}`]:a,"k-invalid":!D,"k-required":this.required,"k-disabled":this.props.disabled},this.props.className),onFocus:e,onBlur:n},u.createElement("input",{role:this.props.ariaRole||"textbox",readOnly:this.props.readonly,tabIndex:this.props.tabIndex,disabled:this.props.disabled,title:void 0!==this.props.title?this.props.title:v,type:"text",spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoFocus:h,className:"k-input-inner",id:b,"aria-label":this.props.ariaLabel,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,"aria-haspopup":this.props.ariaHasPopup,"aria-disabled":this.props.disabled,"aria-expanded":this.props.ariaExpanded,"aria-controls":this.props.ariaControls,onWheel:this.wheel,onClick:this.elementClick,onInput:this.elementChange,onPaste:this.handlePaste,onKeyDown:this.elementKeyDown,onChange:s.noop,value:f,placeholder:w,name:p,ref:e=>this._element=e}),this.props.children,this.props.clearButton&&this.props.value&&u.createElement(St,{onClick:this.handleClick,key:"clearbutton"}),this.props.spinners&&u.createElement("span",{className:"k-input-spinner k-spin-button",onMouseDown:this.spinnersMouseDown},u.createElement(o.Button,{tabIndex:-1,type:"button",rounded:null,className:"k-spinner-increase",icon:"caret-alt-up",svgIcon:r.caretAltUpIcon,"aria-label":d.toLanguageString(Q,ye[Q]),title:d.toLanguageString(Q,ye[Q]),onClick:this.increasePart}),u.createElement(o.Button,{tabIndex:-1,type:"button",rounded:null,className:"k-spinner-decrease",icon:"caret-alt-down",svgIcon:r.caretAltDownIcon,"aria-label":d.toLanguageString(ee,ye[ee]),title:d.toLanguageString(ee,ye[ee]),onClick:this.decreasePart})))));return m?u.createElement(l.FloatingLabel,{label:m,editorId:b,editorValue:v,editorValid:D,editorDisabled:this.props.disabled,children:k,style:{width:this.props.width}}):k}get value(){return void 0!==this.valueDuringOnChange?this.valueDuringOnChange:this.kendoDate&&this.kendoDate.getDateObject()}get name(){return this.props.name}get min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}get text(){const t={...Mt.defaultProps,...this.props},{formatPlaceholder:i=e.defaultProps.formatPlaceholder,format:s=e.defaultProps.format,value:a,defaultValue:n}=t;null===this.kendoDate?(this.kendoDate=new st(this.intl.bind(this),i,s),this.kendoDate.setValue(a||n||null)):(this.kendoDate.format=s,this.kendoDate.formatPlaceholder=i),void 0!==a&&this.value!==a&&this.kendoDate.setValue(a);const{text:o,format:r}=this.kendoDate.getTextAndFormat();return this.currentFormat=r,null===t.placeholder||void 0===t.placeholder||this.state.focused||this.kendoDate.hasValue()?o:t.placeholder}get validity(){const e=((e,t,i)=>null===e||!(t&&t>e||i&&i<e))(this.value,this.min,this.max)&&bt(this.value,this.props.minTime,this.props.maxTime),t=void 0!==this.props.validationMessage,i=(!this.required||null!==this.value)&&e,s=void 0!==this.props.valid?this.props.valid:i;return{customError:t,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:s,valueMissing:null===this.value}}get element(){return this._element}get validityStyles(){return void 0!==this.props.validityStyles?this.props.validityStyles:e.defaultProps.validityStyles}get required(){return void 0!==this.props.required?this.props.required:e.defaultProps.required}get wrapper(){return this._wrapper}intl(){return n.provideIntlService(this)}get selection(){let e={start:0,end:0};return null!==this.element&&void 0!==this.element.selectionStart&&(e={start:this.element.selectionStart,end:this.element.selectionEnd}),e}setSelection(e){this._lastSelectedSymbol=this.currentFormat[e.start],window.requestAnimationFrame((()=>{const t=s.getActiveElement(document);this.element&&t===this.element&&!this.props.disableSelection&&this.element.setSelectionRange(e.start,e.end)}))}triggerChange(e,t){this.valueDuringOnChange=this.value,this.forceUpdate(),this.props.onChange&&!a.isEqual(t,this.value)&&this.props.onChange.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0}selectionBySymbol(e){let t=-1,i=0;for(let s=0;s<this.currentFormat.length;s++)this.currentFormat[s]===e&&(i=s+1,-1===t&&(t=s));return t<0&&(t=0),{start:t,end:i}}selectionByIndex(e){let t={start:e,end:e};for(let i=e,s=e-1;i<this.currentFormat.length||s>=0;i++,s--){if(i<this.currentFormat.length&&"_"!==this.currentFormat[i]){t=this.selectionBySymbol(this.currentFormat[i]);break}if(s>=0&&"_"!==this.currentFormat[s]){t=this.selectionBySymbol(this.currentFormat[s]);break}}return t}switchDateSegment(e){const{start:t,end:i}=this.selection;if(t<i&&this.currentFormat[t]!==this.currentFormat[i-1])return void this.setSelection(this.selectionByIndex(e>0?t:i-1));const s=this.currentFormat[t];let a=t+e;for(;a>0&&a<this.currentFormat.length&&(this.currentFormat[a]===s||"_"===this.currentFormat[a]);)a+=e;if("_"===this.currentFormat[a])return;let n=a;for(;n>=0&&n<this.currentFormat.length&&this.currentFormat[n]===this.currentFormat[a];)n+=e;a>n&&(n+1!==t||a+1!==i)?this.setSelection({start:n+1,end:a+1}):a<n&&(a!==t||n!==i)&&this.setSelection({start:a,end:n})}modifyDateSegmentValue(e,t){if(!this.kendoDate)return;const i=this.value,s=this.currentFormat[this.selection.start],a=this.kendoDate.symbolMap(s),n=((this.props.steps||{})[a]||1)*e;this.kendoDate.modifyPart(s,n),this.triggerChange(t,i)}};xt.displayName="DateInput",xt.propTypes={value:i.instanceOf(Date),format:i.oneOfType([i.string,i.shape({skeleton:i.string,pattern:i.string,date:i.oneOf(["short","medium","long","full"]),time:i.oneOf(["short","medium","long","full"]),datetime:i.oneOf(["short","medium","long","full"]),era:i.oneOf(["narrow","short","long"]),year:i.oneOf(["numeric","2-digit"]),month:i.oneOf(["numeric","2-digit","narrow","short","long"]),day:i.oneOf(["numeric","2-digit"]),weekday:i.oneOf(["narrow","short","long"]),hour:i.oneOf(["numeric","2-digit"]),hour12:i.bool,minute:i.oneOf(["numeric","2-digit"]),second:i.oneOf(["numeric","2-digit"]),timeZoneName:i.oneOf(["short","long"])})]),formatPlaceholder:i.oneOfType([i.oneOf(["wide","narrow","short","formatPattern"]),i.shape({year:i.string,month:i.string,day:i.string,hour:i.string,minute:i.string,second:i.string})]),width:i.oneOfType([i.string,i.number]),tabIndex:i.number,title:i.string,steps:i.shape({year:i.number,month:i.number,day:i.number,hour:i.number,minute:i.number,second:i.number}),min:i.instanceOf(Date),max:i.instanceOf(Date),disabled:i.bool,spinners:i.bool,name:i.string,dir:i.string,label:i.string,id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,ariaLabel:i.string,ariaRole:i.string,ariaHasPopup:i.oneOfType([i.bool,i.string]),ariaExpanded:i.oneOfType([i.bool]),onChange:i.func,validationMessage:i.string,required:i.bool,validate:i.bool,valid:i.bool,size:i.oneOf([null,"small","medium","large"]),rounded:i.oneOf([null,"small","medium","large","full"]),fillMode:i.oneOf([null,"solid","flat","outline"]),autoFocus:i.bool},xt.defaultProps={format:"d",size:"medium",rounded:"medium",fillMode:"solid",formatPlaceholder:"wide",spinners:!1,disabled:!1,max:a.cloneDate(T),min:a.cloneDate(V),minTime:a.cloneDate(F),maxTime:a.cloneDate(P),required:!1,validityStyles:!0,validationMessage:"Please enter a valid value!",placeholder:null,ariaHasPopup:"grid",autoFocus:!1};let Ct=xt;const It=s.createPropsContext(),Mt=s.withIdHOC(s.withPropsContext(It,Ct));Mt.displayName="KendoReactDateInput",n.registerForIntl(Ct),n.registerForLocalization(Ct);const Ot=o.Button,Et=u.forwardRef(((e,t)=>{const{_ref:i}=e,a=u.useRef(null);u.useImperativeHandle(t,(()=>a.current)),u.useImperativeHandle(i,(()=>a.current));const n=u.useMemo((()=>s.classNames(e.className,"k-picker-wrap")),[e.className]);return u.createElement("span",{ref:a,id:e.id,style:e.style,className:n,tabIndex:e.tabIndex},e.children)})),Vt=e=>{const{dateInput:t,...i}=e,s=(e=>{const[t,i]=u.useState(!1);return u.useEffect((()=>{e.current&&i(!!e.current.text)})),{editorValue:t}})(t);return u.createElement(l.FloatingLabel,{...i,...s})},Tt=e=>{const{footer:t,children:i,windowWidth:s=0,navigatable:a,navigatableElements:n,expand:l,animation:h,onClose:c,adaptiveTitle:p,mobileFilter:m}=e,g={navigatable:a||!1,navigatableElements:n||[],expand:l,animation:!1!==h,onClose:c,animationStyles:s<=500?{top:0,width:"100%",height:"100%"}:void 0,className:s<=500?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"};return u.createElement(d.ActionSheet,{...g},u.createElement(d.ActionSheetHeader,{className:"k-text-center"},u.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},u.createElement("div",{className:"k-actionsheet-title"},u.createElement("div",null,p)),u.createElement("div",{className:"k-actionsheet-actions"},u.createElement(o.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",icon:"x",svgIcon:r.xIcon,onClick:c}))),m&&u.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},m)),i,t&&u.createElement(d.ActionSheetFooter,{className:"k-actions k-actions-stretched"},u.createElement(o.Button,{size:"large",tabIndex:0,"aria-label":t.cancelText,"aria-disabled":"false",type:"button",onClick:t.onCancel},t.cancelText),u.createElement(o.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":t.applyText,"aria-disabled":"false",type:"button",onClick:t.onApply},t.applyText)))},Ft=768,Pt=class e extends u.Component{constructor(t){super(t),this._element=null,this._dateInput=u.createRef(),this._calendar=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.setCalendarRef=e=>{this._calendar=e},this.nextValue=(e,t)=>void 0!==e.value?e.value:t.value,this.nextShow=(e,t)=>void 0!==e.show?e.show:t.show,this.renderPopup=()=>{const{disabled:e,min:t,max:i,weekNumber:n,focusedDate:o,popupSettings:r}=this.props,{popupClass:l,...h}=r,d=this.show,c=this.value,p=c&&a.getDate(c),m=s.classNames(l),g={popupClass:"k-datepicker-popup",show:d,anchor:this._element,className:m,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...h},v={disabled:e,value:p,min:t,max:i,weekNumber:n,focusedDate:o,className:this.mobileMode?"k-calendar-lg":"",navigation:!this.mobileMode,onChange:this.handleCalendarValueChange};return this.mobileMode?u.createElement(this.calendarComp,{_ref:this.setCalendarRef,...v}):u.createElement(this.popupComp,{...g},u.createElement(this.calendarComp,{_ref:this.setCalendarRef,...v}))},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:e};return u.createElement(Tt,{...t},u.createElement(d.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderPopup()))},this.handleInputValueChange=e=>{this.handleValueChange(e.value,e)},this.handleCalendarValueChange=e=>{const t=this.mergeTime(e.value);this.handleValueChange(t,e)},this.handleValueChange=(e,t)=>{this.setState({value:a.cloneDate(e||void 0)}),this.valueDuringOnChange=e,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:i}=this.props;i&&i.call(void 0,{syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:this.value,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.handleIconClick=()=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:t,keyCode:i}=e;if(i===s.Keys.esc&&this.show)return this.shouldFocusDateInput=!0,void this.setShow(!1);t&&(i===s.Keys.up||i===s.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=i===s.Keys.up,this.setShow(i===s.Keys.down))},s.validatePackage(p),this.state={value:this.props.defaultValue||e.defaultProps.defaultValue,show:this.props.defaultShow||e.defaultProps.defaultShow,focused:!1}}get _popupId(){return this.props.id+"-popup-id"}get document(){if(s.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=Ft&&this.props.adaptive)}get dateInput(){return this._dateInput.current}get calendar(){return this._calendar}get value(){const e=void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.props.value?this.props.value:this.state.value;return null!==e?a.cloneDate(e):null}get show(){return void 0!==this.showDuringOnChange?this.showDuringOnChange:void 0!==this.props.show?this.props.show:this.state.show}get name(){return this.props.name}get min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}get dateInputComp(){return this.props.dateInput||e.defaultProps.dateInput}get toggleButtonComp(){return this.props.toggleButton||e.defaultProps.toggleButton}get calendarComp(){return this.props.calendar||e.defaultProps.calendar}get popupComp(){return this.props.popup||e.defaultProps.popup}get pickerWrapComp(){return this.props.pickerWrap||e.defaultProps.pickerWrap}get validity(){const e=B(this.value,this.min,this.max),t=void 0!==this.props.validationMessage,i=(!this.required||null!==this.value)&&e,s=void 0!==this.props.valid?this.props.valid:i;return{customError:t,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:s,valueMissing:null===this.value}}get validityStyles(){return void 0!==this.props.validityStyles?this.props.validityStyles:e.defaultProps.validityStyles}get required(){return void 0!==this.props.required?this.props.required:e.defaultProps.required}componentDidMount(){var e;this.observerResize=s.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this._calendar&&this._calendar.element&&this.show&&!this.prevShow&&this._calendar.element.focus({preventScroll:!0}),this.dateInput&&this.dateInput.element&&!this.show&&this.shouldFocusDateInput&&this.dateInput.element.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var e;clearTimeout(this.nextTickId),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:t=e.defaultProps.size,rounded:i=e.defaultProps.rounded,fillMode:a=e.defaultProps.fillMode,disabled:o,tabIndex:l,title:h,id:d,format:c,formatPlaceholder:p,min:m,max:g,className:v,width:f,name:w,validationMessage:b,required:D,validityStyles:y,ariaLabelledBy:k,ariaDescribedBy:S,ariaLabel:x,placeholder:C,label:I,popupSettings:M,defaultValue:O,defaultShow:E,value:V,popup:T,weekNumber:F,dateInput:P,calendar:R,toggleButton:N,onChange:L,onBlur:B,onFocus:_,show:A,onOpen:H,pickerWrap:z,adaptive:q,adaptiveTitle:K,valid:W,autoFocus:U,visited:Y,touched:$,modified:j,...Z}=this.props,G=this.value,X=!this.validityStyles||this.validity.valid,J={disabled:o,format:c,formatPlaceholder:p,id:d,ariaLabelledBy:k,ariaDescribedBy:S,ariaLabel:x,max:g,min:m,name:w,onChange:this.handleInputValueChange,required:D,tabIndex:this.show?-1:l,title:h,valid:this.validity.valid,validationMessage:b,validityStyles:y,value:G,label:void 0,placeholder:this.state.focused?null:C,ariaExpanded:this.show,size:null,fillMode:null,rounded:null},Q=n.provideLocalizationService(this).toLanguageString(se,ye[se]),ee=u.createElement(s.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},(e=>u.createElement(u.Fragment,null,u.createElement("span",{...I?{}:Z,ref:e=>{this._element=e},className:s.classNames("k-input","k-datepicker",{[`k-input-${s.kendoThemeMaps.sizeMap[t]||t}`]:t,[`k-rounded-${s.kendoThemeMaps.roundedMap[i]||i}`]:i,[`k-input-${a}`]:a,"k-invalid":!X,"k-required":this.required,"k-disabled":o},v),onKeyDown:this.handleKeyDown,style:{width:f},onFocus:e.onFocus,onBlur:e.onBlur,onClick:this.mobileMode?this.handleIconClick:void 0},u.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",readonly:this.mobileMode,ariaExpanded:this.show,ariaControls:this._popupId,autoFocus:U,...J}),u.createElement(this.toggleButtonComp,{type:"button",icon:"calendar",svgIcon:r.calendarIcon,title:Q,className:"k-input-button",rounded:null,onClick:this.mobileMode?void 0:this.handleIconClick,"aria-label":Q,fillMode:a,onMouseDown:this.handleIconMouseDown}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup())));return I?u.createElement(Vt,{dateInput:this._dateInput,label:I,editorId:d,editorValid:X,editorDisabled:o,children:ee,style:{width:f},...Z}):ee}setShow(e){const{onOpen:t,onClose:i}=this.props;this.show!==e&&(this.setState({show:e}),e&&t&&t.call(void 0,{target:this}),!e&&i&&i.call(void 0,{target:this}))}mergeTime(e){return this.value&&e?R(e,this.value):e}nextTick(e){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout((()=>e()))}calculateMedia(e){for(let t of e)this.setState({windowWidth:t.target.clientWidth})}};Pt.displayName="DatePicker",Pt.propTypes={className:i.string,defaultShow:i.bool,defaultValue:i.instanceOf(Date),disabled:i.bool,focusedDate:i.instanceOf(Date),format:i.oneOfType([i.string,i.shape({skeleton:i.string,pattern:i.string,date:i.oneOf(["short","medium","long","full"]),time:i.oneOf(["short","medium","long","full"]),datetime:i.oneOf(["short","medium","long","full"]),era:i.oneOf(["narrow","short","long"]),year:i.oneOf(["numeric","2-digit"]),month:i.oneOf(["numeric","2-digit","narrow","short","long"]),day:i.oneOf(["numeric","2-digit"]),weekday:i.oneOf(["narrow","short","long"]),hour:i.oneOf(["numeric","2-digit"]),hour12:i.bool,minute:i.oneOf(["numeric","2-digit"]),second:i.oneOf(["numeric","2-digit"]),timeZoneName:i.oneOf(["short","long"])})]),formatPlaceholder:i.oneOfType([i.oneOf(["wide","narrow","short","formatPattern"]),i.shape({year:i.string,month:i.string,day:i.string,hour:i.string,minute:i.string,second:i.string})]),id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,ariaLabel:i.string,min:i.instanceOf(Date),max:i.instanceOf(Date),name:i.string,popupSettings:i.shape({animate:i.bool,appendTo:i.any,popupClass:i.string}),show:i.bool,tabIndex:i.number,title:i.string,value:i.instanceOf(Date),weekNumber:i.bool,width:i.oneOfType([i.number,i.string]),validationMessage:i.string,required:i.bool,validate:i.bool,valid:i.bool,size:i.oneOf([null,"small","medium","large"]),rounded:i.oneOf([null,"small","medium","large","full"]),fillMode:i.oneOf([null,"solid","flat","outline"]),adaptive:i.bool,adaptiveTitle:i.string,autoFocus:i.bool},Pt.defaultProps={defaultShow:!1,defaultValue:null,dateInput:Mt,calendar:Qe,toggleButton:Ot,popup:h.Popup,pickerWrap:Et,disabled:!1,format:"d",max:T,min:V,popupSettings:{},tabIndex:0,weekNumber:!1,required:!1,validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1};let Rt=Pt;const Nt=s.createPropsContext(),Lt=s.withIdHOC(s.withPropsContext(Nt,Rt));Lt.displayName="KendoReactDatePicker",n.registerForLocalization(Rt);const Bt=(e,t)=>{const i=a.cloneDate(e);return i.setHours(t),i},_t=e=>null!==e&&e<12,At=(e,t,i)=>!t&&!i||e>=t&&e<=i,Ht=(e,t,i)=>!t&&!i||e>=t||e<=i;let zt=class{constructor(e){this.intl=e,this.min=null,this.max=null,this.part=null}apply(e,t){const i=e.getHours(),s=_t(i),a=_t(t.getHours());if(s&&a||!s&&!a)return e;const[n,o=24]=this.normalizedRange(),r=i+(a?-12:12);return Bt(e,Math.min(Math.max(n,r),o||24))}configure(e){const{min:t=this.min,max:i=this.max,part:s=this.part}=e;this.min=t,this.max=i,this.part=s}data(e){const t=this.part&&this.part.names;if(!t||!this.min)return[];const i=[],[s,a]=this.normalizedRange(),n=this.intl.dateFormatNames(t);return _t(s)&&i.push({text:n.am,value:Bt(this.min,s)}),(e=>null!==e&&(!e||e>11))(a)&&i.push({text:n.pm,value:Bt(this.min,Math.max(12,a))}),this.min.getHours()!==s?i.reverse():i}isRangeChanged(e,t){return!1}limitRange(e,t,i){return[e,t]}total(){const[e,t]=this.normalizedRange();return(e||t)&&(e>11||t<12)?1:2}selectedIndex(e){if(!this.valueInList(e)||!this.min)return-1;const t=Math.floor(e.getHours()/12);return this.min.getHours()===this.normalizedRange()[0]?t:0===t?1:0}valueInList(e){return!(!this.min||!this.max)&&(this.min.getHours()!==this.normalizedRange()[0]?Ht:At)(e.getHours(),this.min.getHours(),this.max.getHours())}normalizedRange(){const e=this.min.getHours(),t=this.max.getHours();return[Math.min(e,t),Math.max(e,t)]}},qt=class{constructor(){this.itemHeight=0,this.timeListHeight=0,this.didCalculate=!1}ensureHeights(){void 0===this.timeListHeight&&this.calculateHeights()}calculateHeights(e){if(!s.canUseDOM)return;const t=q("div"),i=q("span"),a=q("ul"),n=q("li"),o=t([i("minute","k-title"),t([t([a([n("<span>02</span>","k-item")],"k-reset")],"k-content k-scrollable k-time-container")],"k-time-list")],"k-time-list-wrapper",{left:"-10000px",position:"absolute"}),r=e&&e.querySelector(".k-time-container")||document.body,l=r.appendChild(o);this.timeListHeight=l.querySelector(".k-scrollable").offsetHeight,this.itemHeight=l.querySelector("li").offsetHeight,r.removeChild(l),this.didCalculate=!0}};const Kt=(e=>t=>t%e)(24),Wt=(e,t)=>Kt(24+e-t),Ut=e=>(t,i)=>i&&a.getDate(t).getTime()!==a.getDate(i).getTime()?pt(t,e):t,Yt=Ut(0),$t=Ut(23);class jt{constructor(e){this.intl=e,this.boundRange=!1,this.insertUndividedMax=!1,this.min=null,this.max=null,this.step=0,this.toListItem=null}apply(e,t){return pt(e,t.getHours())}configure(e){const{boundRange:t=this.boundRange,insertUndividedMax:i=this.insertUndividedMax,min:s=this.min,max:a=this.max,part:n,step:o=this.step}=e;this.boundRange=t,this.insertUndividedMax=i,this.toListItem=e=>{const t=pt(E,e);return{text:this.intl.formatDate(t,n.pattern),value:t}},this.min=s,this.max=a,this.step=o}data(e){const[t]=this.range(e),i=((e,t)=>i=>Kt(e+i*t))(t,this.step),s=ft(0,this.countFromMin(e)).map((e=>this.toListItem&&this.toListItem(i(e))));return this.addLast(s),e&&this.addMissing(s,e),s}isRangeChanged(e,t){return!(!this.min||!this.max)&&(!a.isEqual(this.min,e)||!a.isEqual(this.max,t))}limitRange(e,t,i){return this.boundRange?[Yt(e,i),$t(t,i)]:[e,t]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,i=this.isMissing(e)?1:0;return this.countFromMin(e)+i+t}selectedIndex(e){return Math.ceil(this.divideByStep(e))}valueInList(e){return!e||(this.insertUndividedMax&&this.lastHour(e)===e.getHours()||!this.isMissing(e))}addLast(e,t){return this.insertUndividedMax&&this.isLastMissing(t)&&this.toListItem&&e.push(this.toListItem(this.lastHour(t))),e}addMissing(e,t){if(this.valueInList(t))return e;if(this.toListItem){const i=this.toListItem(t.getHours());e.splice(this.selectedIndex(t),0,i)}return e}countFromMin(e){const[t,i]=this.range(e);return Math.floor(Wt(i,t)/this.step)+1}isMissing(e){return!!e&&this.selectedIndex(e)!==this.divideByStep(e)}isLastMissing(e){return null!==this.max&&this.isMissing(pt(this.max,this.lastHour(e)))}divideByStep(e){return Wt(e.getHours(),this.min.getHours())/this.step}lastHour(e){return this.range(e)[1]}range(e){const[t,i]=this.limitRange(this.min,this.max,e);return[t.getHours(),i.getHours()]}}const Zt=(e=>t=>t%e)(60),Gt=(e,t)=>Zt(60+e-t),Xt=e=>(t,i)=>i&&t.getHours()!==i.getHours()?mt(t,e):t,Jt=Xt(0),Qt=Xt(59);let ei=class{constructor(e){this.intl=e,this.toListItem=null,this.min=null,this.max=null,this.step=0,this.insertUndividedMax=!1}apply(e,t){return mt(e,t.getMinutes())}configure(e){const{insertUndividedMax:t=this.insertUndividedMax,min:i=this.min,max:s=this.max,part:a,step:n=this.step}=e;this.insertUndividedMax=t,this.toListItem=e=>{const t=mt(E,e);return{text:this.intl.formatDate(t,a.pattern),value:t}},this.min=i,this.max=s,this.step=n}data(e){const[t]=this.range(e),i=((e,t)=>i=>Zt(e+i*t))(t,this.step),s=ft(0,this.countFromMin(e)).map((e=>this.toListItem&&this.toListItem(i(e))));return this.addLast(s),e&&this.addMissing(s,e),s}isRangeChanged(e,t){return!(null===this.min||null===this.max||a.isEqual(this.min,e)&&a.isEqual(this.max,t))}limitRange(e,t,i){return[Jt(e,i),Qt(t,i)]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,i=this.isMissing(e)?1:0;return this.countFromMin(e)+i+t}selectedIndex(e){return Math.ceil(this.divideByStep(e))}valueInList(e){return!e||(this.insertUndividedMax&&this.lastMinute(e)===e.getMinutes()||!this.isMissing(e))}addLast(e,t){return this.insertUndividedMax&&this.isLastMissing(t)&&this.toListItem&&e.push(this.toListItem(this.lastMinute(t))),e}addMissing(e,t){if(this.valueInList(t))return e;if(this.toListItem){const i=this.toListItem(t.getMinutes());e.splice(this.selectedIndex(t),0,i)}return e}countFromMin(e){const[t,i]=this.range(e);return Math.floor(Gt(i,t)/this.step)+1}isMissing(e){return!!e&&this.selectedIndex(e)!==this.divideByStep(e)}isLastMissing(e){return null!==this.max&&this.isMissing(mt(this.max,this.lastMinute(e)))}divideByStep(e){return Gt(e.getMinutes(),this.min.getMinutes())/this.step}lastMinute(e){return this.range(e)[1]}range(e){const[t,i]=this.limitRange(this.min,this.max,e);return[t.getMinutes(),i.getMinutes()]}};const ti=(e=>t=>t%e)(60),ii=(e,t)=>ti(60+e-t),si=e=>(t,i)=>!i||t.getMinutes()===i.getMinutes()&&t.getHours()===i.getHours()?t:gt(t,e),ai=si(0),ni=si(59);class oi{constructor(e){this.intl=e,this.toListItem=null,this.min=null,this.max=null,this.step=0,this.insertUndividedMax=!1}apply(e,t){return gt(e,t.getSeconds())}configure(e){const{insertUndividedMax:t=this.insertUndividedMax,min:i=this.min,max:s=this.max,part:a,step:n=this.step}=e;this.insertUndividedMax=t,this.toListItem=e=>{const t=gt(E,e);return{text:this.intl.formatDate(t,a.pattern),value:t}},this.min=i,this.max=s,this.step=n}data(e){const[t]=this.range(e),i=((e,t)=>i=>ti(e+i*t))(t,this.step),s=ft(0,this.countFromMin(e)).map((e=>this.toListItem&&this.toListItem(i(e))));return this.addLast(s),e&&this.addMissing(s,e),s}isRangeChanged(e,t){return!(null===this.min||null===this.max||a.isEqual(this.min,e)&&a.isEqual(this.max,t))}limitRange(e,t,i){return[ai(e,i),ni(t,i)]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,i=this.isMissing(e)?1:0;return this.countFromMin(e)+i+t}selectedIndex(e){return Math.ceil(this.divideByStep(e))}valueInList(e){return!e||(this.insertUndividedMax&&this.lastSecond(e)===e.getSeconds()||!this.isMissing(e))}divideByStep(e){return ii(e.getSeconds(),this.min.getSeconds())/this.step}addLast(e,t){return this.insertUndividedMax&&this.isLastMissing(t)&&this.toListItem&&e.push(this.toListItem(this.lastSecond(t))),e}addMissing(e,t){if(this.valueInList(t))return e;if(this.toListItem){const i=this.toListItem(t.getSeconds());e.splice(this.selectedIndex(t),0,i)}return e}countFromMin(e){const[t,i]=this.range(e);return Math.floor(ii(i,t)/this.step)+1}isMissing(e){return!!e&&this.selectedIndex(e)!==this.divideByStep(e)}isLastMissing(e){return null!==this.max&&this.isMissing(gt(this.max,this.lastSecond(e)))}lastSecond(e){return this.range(e)[1]}range(e){const[t,i]=this.limitRange(this.min,this.max,e);return[t.getSeconds(),i.getSeconds()]}}const ri={[s.Keys.end]:(e,t)=>e[e.length-1],[s.Keys.home]:(e,t)=>e[0],[s.Keys.up]:(e,t)=>e[t-1],[s.Keys.down]:(e,t)=>e[t+1]},li={[at]:zt,[nt]:jt,[ot]:ei,[rt]:oi},hi=class e extends u.Component{constructor(t){super(t),this.intl=null,this._element=null,this.service=null,this.virtualization=null,this.topOffset=0,this.bottomOffset=0,this.itemHeight=0,this.listHeight=0,this.topThreshold=0,this.bottomThreshold=0,this.animateToIndex=!1,this.focus=e=>{Promise.resolve().then((()=>{this.element&&this.element.focus(e)}))},this.itemOffset=e=>{if(!this.virtualization||!this.service)return-1;const t=this.service.selectedIndex(this.props.value),i=this.virtualization.activeIndex(),s=this.virtualization.itemOffset(i),a=Math.abs(Math.ceil(e)-s);if(t===i&&a<2)return s;const n=t>i;return n&&a>=this.bottomThreshold||!n&&a>this.topThreshold?this.virtualization.itemOffset(i+1):s},this.calculateHeights=()=>{this.dom.didCalculate&&(this.itemHeight=this.dom.itemHeight,this.listHeight=this.dom.timeListHeight,this.topOffset=(this.listHeight-this.itemHeight)/2,this.bottomOffset=this.listHeight-this.itemHeight,this.props.mobileMode&&(this.topOffset+=9,this.bottomOffset+=18),this.topThreshold=.05*this.itemHeight,this.bottomThreshold=.95*this.itemHeight)},this.configureServices=({min:e,max:t,value:i}=this.props)=>{if(this.service){const[s,a]=this.service.limitRange(e||this.min,t||this.max,i||this.props.value);this.service.configure(this.serviceSettings({min:s,max:a}))}},this.serviceSettings=t=>{const i={boundRange:this.props.boundRange||e.defaultProps.boundRange,insertUndividedMax:!1,min:a.cloneDate(this.min),max:a.cloneDate(this.max),part:this.props.part,step:this.step},s=Object.assign({},i,t);return s.boundRange="hour"!==s.part.type||this.props.boundRange||e.defaultProps.boundRange,s},this.handleScrollAction=({target:e,animationInProgress:t})=>{if(this.virtualization&&this.service&&e&&!t){this.animateToIndex=!1;const t=this.virtualization.itemIndex(this.itemOffset(e.scrollTop)),i=this.service.data(this.props.value)[t];this.handleChange(i)}},this.handleFocus=e=>{const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleBlur=e=>{const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.handleMouseOver=()=>{if(!this._element)return;const e=s.getActiveElement(document);document&&e!==this._element&&this.props.show&&this._element.focus({preventScroll:!0})},this.handleKeyDown=e=>{if(!this.service)return;const{keyCode:t}=e;(t===s.Keys.down||t===s.Keys.up||t===s.Keys.end||t===s.Keys.home)&&e.preventDefault();const i=(ri[e.keyCode]||s.noop)(this.service.data(this.props.value),this.service.selectedIndex(this.props.value));i&&this.handleChange(i)},this.handleChange=K((e=>{if(!this.service)return;const t=this.service.apply(this.props.value,e.value);if(this.props.value.getTime()===t.getTime())return;const{onChange:i}=this.props;i&&i.call(void 0,t)}),100),this.dom=new qt}get element(){return this._element}get animate(){return!(!this.props.smoothScroll||!this.animateToIndex)}get min(){return this.props.min||e.defaultProps.min}get max(){return this.props.max||e.defaultProps.max}get step(){return void 0!==this.props.step&&0!==this.props.step?Math.floor(this.props.step):e.defaultProps.step}componentDidMount(){Promise.resolve().then((()=>{this._element&&(this.dom.calculateHeights(this._element),this.forceUpdate())}))}componentDidUpdate(){if(!this.virtualization||!this.service)return;const e=this.service.selectedIndex(this.props.value);this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](e),this.animateToIndex=!0}render(){if(!this.props.part.type||!li[this.props.part.type])return;this.calculateHeights(),this.intl=n.provideIntlService(this),this.service=new li[this.props.part.type](this.intl),this.configureServices();const e=this.service.data(this.props.value),t="translateY("+this.topOffset+"px)",i=this.service.total(this.props.value),s=u.createElement(u.Fragment,null,u.createElement("ul",{style:{transform:t,msTransform:t},className:"k-reset"},e.map(((e,t)=>u.createElement("li",{key:t,className:"k-item",onClick:()=>{this.handleChange(e)}},u.createElement("span",null,e.text))))),u.createElement("div",{className:"k-scrollable-placeholder"}));return u.createElement("div",{className:"k-time-list",id:String(this.props.id||""),tabIndex:this.props.disabled?-1:0,ref:e=>{this._element=e},onKeyDown:this.handleKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseOver:this.handleMouseOver},this.dom.didCalculate?u.createElement(k,{bottomOffset:this.bottomOffset,children:s,className:"k-time-container",itemHeight:this.itemHeight,maxScrollDifference:this.listHeight,onScrollAction:this.handleScrollAction,ref:e=>{this.virtualization=e},role:"presentation",skip:0,tabIndex:-1,take:i,topOffset:this.topOffset,total:i}):u.createElement("div",{className:"k-time-container k-content k-scrollable"},s))}};hi.propTypes={id:i.number,max:i.instanceOf(Date),min:i.instanceOf(Date),part:function(e,t,i){const s=e[t];if(!s||!li[s.type])throw new Error(`\n Invalid prop '${t}' supplied to ${i}.\n Supported part types are hour|minute|second|dayperiod.\n `);return null},step:function(e,t,i){const s=e[t];if(void 0!==s&&s<=0)throw new Error(`\n Invalid prop '${t}' supplied to ${i}.\n ${t} cannot be less than 1.\n `);return null},value:i.instanceOf(Date),smoothScroll:i.bool,show:i.bool},hi.defaultProps={boundRange:!1,max:P,min:E,step:1,smoothScroll:!0};let di=hi;n.registerForIntl(di);const ci=new RegExp(`${nt}|${ot}|${rt}|${at}|literal`),ui=class e extends u.Component{constructor(t){super(t),this._element=null,this._nowButton=null,this.dateFormatParts=[],this.timeLists=[],this.focus=(e,t)=>{Promise.resolve().then((()=>{t&&this._nowButton&&this._nowButton.element&&this._nowButton.element.focus();const i=this.timeLists[0];!t&&-1===this.state.activeListIndex&&!this.hasActiveButton()&&i&&i.element&&i.focus(e)}))},this.timeFormatReducer=(e,t)=>e+t.pattern,this.timeFormatFilter=(e,t,i)=>{const s=t>=1&&i[t-1];return s&&s&&"literal"===e.type?ci.test(s.type||""):ci.test(e.type||"")},this.focusList=e=>{this.timeLists.length&&this.timeLists.reduce(this.listReducer,[]).map((t=>1===e?t.next:t.prev)).map((e=>e&&e.element&&e.element.focus({preventScroll:!0})))},this.listReducer=(e,t,i,s)=>e.length||t.props.id!==this.state.activeListIndex?e:[{next:s[i+1]||t,prev:s[i-1]||t}],this.showNowButton=()=>!this.hasSteps()&&this.props.nowButton&&bt(vt(),this.min,this.max),this.handleKeyDown=e=>{const{keyCode:t}=e;switch(t){case s.Keys.left:return e.preventDefault(),void this.focusList(0);case s.Keys.right:return e.preventDefault(),void this.focusList(1);default:return}},this.handleListBlur=()=>{this.nextTick((()=>{this.setState({activeListIndex:-1})}))},this.handleListFocus=e=>{clearTimeout(this.nextTickId),this.setState({activeListIndex:e})},this.handleChange=e=>{const{onChange:t}=this.props;t&&t.call(void 0,e)},this.snapTime=ut(ct(this.props.steps,this.props.min||e.defaultProps.min)),this.state={activeListIndex:-1},this.hasActiveButton=this.hasActiveButton.bind(this)}get element(){return this._element}get value(){return((e,t,i)=>{if(!e||!t||!i)return e;const{candidateValue:s,minValue:a,maxValue:n}=wt(e,t,i);return s<a?R(e,t):s>n?R(e,i):e})(this.snapTime(a.cloneDate(this.props.value||E)),this.min,this.max)}get intl(){return n.provideIntlService(this)}get min(){return this.snapTime(this.props.min||e.defaultProps.min)}get max(){return this.snapTime(this.props.max||e.defaultProps.max)}get steps(){return this.props.steps||e.defaultProps.steps}get boundRange(){return void 0!==this.props.boundRange?this.props.boundRange:e.defaultProps.boundRange}componentWillUnmount(){clearTimeout(this.nextTickId)}componentDidMount(){const{onMount:e}=this.props;e&&e.call(void 0,this.value)}render(){const{format:t,smoothScroll:i,onNowClick:a,className:r,disabled:l,mobileMode:h,show:d,onNowKeyDown:c}=this.props;this.snapTime=ut(ct(this.steps,this.min)),this.dateFormatParts=this.intl.splitDateFormat(t||e.defaultProps.format).filter(this.timeFormatFilter);const p=s.classNames({"k-disabled":l,"k-time-part":h},r);this.timeLists=[];const m=n.provideLocalizationService(this),g=m.toLanguageString(de,ye[de]);return u.createElement("div",{className:p},u.createElement("div",{className:"k-time-header"},u.createElement("span",{className:"k-title"},this.intl.formatDate(this.value,this.dateFormatParts.reduce(this.timeFormatReducer,""))),this.showNowButton()&&u.createElement(o.Button,{type:"button",ref:e=>{this._nowButton=e},className:"k-time-now",fillMode:"flat",themeColor:"base",title:g,onKeyDown:c,"aria-label":g,onClick:a,tabIndex:l?-1:0},m.toLanguageString(he,ye[he]))),u.createElement("div",{className:"k-time-list-container",onKeyDown:this.handleKeyDown},u.createElement("span",{className:"k-time-highlight"}),this.dateFormatParts.map(((e,t)=>"literal"!==e.type?u.createElement("div",{key:t,className:s.classNames("k-time-list-wrapper",{"k-focus":t===this.state.activeListIndex}),role:"presentation",tabIndex:-1},u.createElement("span",{className:"k-title",onMouseDown:e=>{e.preventDefault()}},this.intl.dateFieldName(e)),u.createElement(di,{min:this.min,max:this.max,boundRange:this.boundRange,part:e,step:e.type?this.steps[e.type]:1,smoothScroll:i,ref:e=>{e&&this.timeLists.push(e)},id:t,onFocus:()=>{this.handleListFocus(t)},onBlur:this.handleListBlur,onChange:this.handleChange,value:this.value,disabled:l,show:d,mobileMode:h})):u.createElement("div",{key:t,className:"k-time-separator"},e.pattern)))))}nextTick(e){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout((()=>e()))}hasActiveButton(){const e=s.getActiveElement(document);return this._nowButton&&e===this._nowButton.element}hasSteps(){const e=Object.keys(this.steps);return e.length!==e.reduce(((e,t)=>e+this.steps[t]),0)}};ui.propTypes={cancelButton:i.bool,disabled:i.bool,format:i.oneOfType([i.string,i.shape({skeleton:i.string,pattern:i.string,date:i.oneOf(["short","medium","long","full"]),time:i.oneOf(["short","medium","long","full"]),datetime:i.oneOf(["short","medium","long","full"]),era:i.oneOf(["narrow","short","long"]),year:i.oneOf(["numeric","2-digit"]),month:i.oneOf(["numeric","2-digit","narrow","short","long"]),day:i.oneOf(["numeric","2-digit"]),weekday:i.oneOf(["narrow","short","long"]),hour:i.oneOf(["numeric","2-digit"]),hour12:i.bool,minute:i.oneOf(["numeric","2-digit"]),second:i.oneOf(["numeric","2-digit"]),timeZoneName:i.oneOf(["short","long"])})]),max:i.instanceOf(Date),min:i.instanceOf(Date),nowButton:i.bool,steps:i.shape({hour:i.number,minute:i.number,second:i.number}),smoothScroll:i.bool,tabIndex:i.number,value:i.instanceOf(Date),show:i.bool},ui.defaultProps={value:null,disabled:!1,nowButton:!0,cancelButton:!0,format:"hh:mm a",min:F,max:P,steps:{},boundRange:!1};let pi=ui;n.registerForIntl(pi),n.registerForLocalization(pi);const mi=class e extends u.Component{constructor(t){super(t),this._element=null,this._cancelButton=null,this._acceptButton=null,this.timePart=null,this.focusActiveList=()=>{this.timePart&&this.timePart.focus({preventScroll:!0})},this.handleKeyDown=e=>{const{keyCode:t}=e;t!==s.Keys.enter||this.hasActiveButton()||this.handleAccept(e)},this.revertToNowButton=e=>{const{keyCode:t,shiftKey:i}=e;!i&&t===s.Keys.tab&&(e.preventDefault(),!1!==this.props.nowButton?this.timePart&&this.timePart.focus({preventScroll:!0},!0):this.timePart&&this.timePart.focus({preventScroll:!0}))},this.handleNowKeyDown=e=>{var t;const{keyCode:i,shiftKey:a}=e;a&&i===s.Keys.tab?(e.preventDefault(),this._acceptButton&&(null==(t=this._acceptButton.element)||t.focus({preventScroll:!0}))):i===s.Keys.enter&&(e.stopPropagation(),this.handleNowClick(e))},this.handleAccept=e=>{const t=this.mergeValue(a.cloneDate(this.value||vt()),this.timePart?this.timePart.value:this.current);this.setState({value:t}),this.valueDuringOnChange=t;const{onChange:i}=this.props;i&&i.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleReject=e=>{this.setState({current:this.value});const{onReject:t}=this.props;t&&t.call(void 0,e)},this.handleNowClick=e=>{const t=this.mergeValue(a.cloneDate(this.value||vt()),vt());this.setState({current:t,value:t}),this.valueDuringOnChange=t;const{onChange:i}=this.props;i&&i.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleChange=e=>{this.setState({current:e});const{handleTimeChange:t}=this.props;t&&t.call(void 0,{time:e})},this.dateFormatParts=this.intl.splitDateFormat(this.props.format||e.defaultProps.format),this.mergeValue=(e=>(t,i)=>(t.setHours(...e.map((e=>e(t,i)))),t))(dt(this.dateFormatParts)),this.hasActiveButton=this.hasActiveButton.bind(this),this.state={current:this.props.value||E,value:this.props.value||e.defaultProps.value}}get element(){return this._element}get value(){const e=void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.props.value?this.props.value:this.state.value;return null!==e?a.cloneDate(e):null}get intl(){return n.provideIntlService(this)}get current(){return null!==this.state.current?a.cloneDate(this.state.current):null}componentWillUnmount(){clearTimeout(this.nextTickId)}render(){const{format:e,cancelButton:t,disabled:i,tabIndex:a,className:r,smoothScroll:l,min:h,max:d,boundRange:c,nowButton:p,steps:m,show:g,mobileMode:v}=this.props,f=n.provideLocalizationService(this),w=f.toLanguageString(ce,ye[ce]),b=f.toLanguageString(ue,ye[ue]);return u.createElement("div",{ref:e=>{this._element=e},tabIndex:i?void 0:a||0,className:s.classNames("k-timeselector k-timeselector-md",r,{"k-disabled":i}),onKeyDown:this.handleKeyDown},u.createElement(pi,{ref:e=>{this.timePart=e},value:this.current,onChange:this.handleChange,onNowClick:this.handleNowClick,format:e,smoothScroll:l,min:h,max:d,boundRange:c,disabled:i,nowButton:p,steps:m,show:g,mobileMode:v,onNowKeyDown:this.handleNowKeyDown}),this.props.footer&&u.createElement("div",{className:"k-time-footer k-actions k-actions-stretched k-actions-horizontal"},t&&u.createElement(o.Button,{type:"button",ref:e=>{this._cancelButton=e},className:"k-time-cancel",onClick:this.handleReject,title:w,"aria-label":w},w),u.createElement(o.Button,{type:"button",ref:e=>{this._acceptButton=e},className:"k-time-accept",themeColor:"primary",onClick:this.handleAccept,onKeyDown:this.revertToNowButton,title:b,"aria-label":b},b)))}nextTick(e){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout((()=>e()))}hasActiveButton(){if(!this._acceptButton||!this._acceptButton.element)return!1;const e=s.getActiveElement(document);return this._acceptButton&&e===this._acceptButton.element||this._cancelButton&&e===this._cancelButton.element}};mi.propTypes={cancelButton:i.bool,className:i.string,disabled:i.bool,format:i.oneOfType([i.string,i.shape({skeleton:i.string,pattern:i.string,date:i.oneOf(["short","medium","long","full"]),time:i.oneOf(["short","medium","long","full"]),datetime:i.oneOf(["short","medium","long","full"]),era:i.oneOf(["narrow","short","long"]),year:i.oneOf(["numeric","2-digit"]),month:i.oneOf(["numeric","2-digit","narrow","short","long"]),day:i.oneOf(["numeric","2-digit"]),weekday:i.oneOf(["narrow","short","long"]),hour:i.oneOf(["numeric","2-digit"]),hour12:i.bool,minute:i.oneOf(["numeric","2-digit"]),second:i.oneOf(["numeric","2-digit"]),timeZoneName:i.oneOf(["short","long"])})]),max:i.instanceOf(Date),min:i.instanceOf(Date),nowButton:i.bool,steps:i.shape({hour:i.number,minute:i.number,second:i.number}),smoothScroll:i.bool,tabIndex:i.number,value:i.instanceOf(Date),show:i.bool},mi.defaultProps={value:null,disabled:!1,cancelButton:!0,format:"t",min:F,max:P,boundRange:!1,footer:!0};let gi=mi;n.registerForIntl(gi),n.registerForLocalization(gi);const vi=class e extends u.Component{constructor(t){super(t),this._element=null,this._dateInput=u.createRef(),this._timeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.renderTimeSelector=()=>{const{smoothScroll:e,cancelButton:t,nowButton:i,disabled:s,format:a,steps:n}=this.props;return u.createElement(gi,{ref:this.setTimeSelectorRef,className:this.mobileMode?"k-reset k-timeselector-lg":"",mobileMode:this.mobileMode,show:this.show,cancelButton:t,disabled:s,nowButton:i,format:a,min:this.min,max:this.max,steps:n,smoothScroll:e,value:this.value,footer:!this.mobileMode,handleTimeChange:this.mobileMode&&this.handleTimeChange,onChange:this.handleValueChange,onReject:this.handleValueReject})},this.renderPopup=()=>{const{popupClass:e,...t}=this.popupSettings,i=s.classNames(e),a={popupClass:"k-timepicker-popup k-list-container",show:this.show,animate:null!==this.element,anchor:this.element,className:i,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...t};return this.props.popup?u.createElement(this.props.popup,{...a},this.renderTimeSelector()):u.createElement(h.Popup,{...a},this.renderTimeSelector())},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:e,footer:{cancelText:this.localizationService.toLanguageString(me,ye[ce]),onCancel:this.handleValueReject,applyText:this.localizationService.toLanguageString(ue,ye[ue]),onApply:e=>this.handleValueChange(e)}};return u.createElement(Tt,{...t},u.createElement(d.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderTimeSelector()))},this.setTimeSelectorRef=e=>{this._timeSelector=e},this.nextValue=(e,t)=>void 0!==e.value?e.value:t.value,this.nextShow=(e,t)=>void 0!==e.show?e.show:t.show,this.handleInputValueChange=e=>{const t=this.mergeTime(e.value);this.handleValueChange({...e,value:t})},this.handleTimeChange=e=>{this.setState({candidate:e.time})},this.handleValueChange=e=>{this.setState({value:a.cloneDate(e.value||this.state.candidate)}),this.valueDuringOnChange=e.value,this.showDuringOnChange=!1,this.shouldFocusDateInput=!0;const{onChange:t}=this.props,i=this.state.candidate||this.value;t&&t.call(void 0,{syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:i,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.handleValueReject=e=>{this.setShow(!1)},this.handleIconClick=e=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:t,keyCode:i}=e;if(i===s.Keys.esc)return this.shouldFocusDateInput=!0,void this.setShow(!1);t&&(i===s.Keys.up||i===s.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=i===s.Keys.up,this.setShow(i===s.Keys.down))},s.validatePackage(p),this.state={value:this.props.defaultValue||e.defaultProps.defaultValue,show:this.props.defaultShow||e.defaultProps.defaultShow,focused:!1,candidate:null},this.normalizeTime=this.normalizeTime.bind(this),this.setShow=this.setShow.bind(this),this.mergeTime=this.mergeTime.bind(this)}get _popupId(){return this.props.id+"-popup-id"}get document(){if(s.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get dateInput(){return this._dateInput.current}get timeSelector(){return this._timeSelector}get value(){const e=void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.props.value?this.props.value:this.state.value;return null!==e?a.cloneDate(e):null}get show(){return void 0!==this.showDuringOnChange?this.showDuringOnChange:void 0!==this.props.show?this.props.show:this.state.show}get name(){return this.props.name}get validity(){const e=this.value&&this.normalizeTime(this.value),t=this.normalizeTime(this.min),i=this.normalizeTime(this.max),s=Dt(e,t,i),a=void 0!==this.props.validationMessage,n=(!this.required||null!==this.value)&&s,o=void 0!==this.props.valid?this.props.valid:n;return{customError:a,rangeOverflow:kt(e,i),rangeUnderflow:yt(e,t),valid:o,valueMissing:null===this.value}}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=Ft&&this.props.adaptive)}get validityStyles(){return void 0!==this.props.validityStyles?this.props.validityStyles:e.defaultProps.validityStyles}get required(){return void 0!==this.props.required?this.props.required:e.defaultProps.required}get popupSettings(){return this.props.popupSettings||e.defaultProps.popupSettings}get min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}get dateInputComp(){return this.props.dateInput||e.defaultProps.dateInput}get localizationService(){return n.provideLocalizationService(this)}componentDidMount(){var e;this.observerResize=s.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this._timeSelector&&this.show&&!this.prevShow?this._timeSelector.focusActiveList():this.dateInput&&this.dateInput.element&&!this.show&&this.shouldFocusDateInput&&this.dateInput.element.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var e;null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:t=e.defaultProps.size,rounded:i=e.defaultProps.rounded,fillMode:a=e.defaultProps.fillMode,disabled:n,tabIndex:l,title:h,id:d,className:c,format:p,formatPlaceholder:m,width:g,name:v,steps:f,validationMessage:w,required:b,validityStyles:D,ariaLabelledBy:y,ariaDescribedBy:k}=this.props,S=!this.validityStyles||this.validity.valid,x={disabled:n,format:p,formatPlaceholder:m,id:d,ariaLabelledBy:y,ariaDescribedBy:k,max:this.normalizeTime(this.max),min:this.normalizeTime(this.min),name:v,onChange:this.handleInputValueChange,required:b,steps:f,tabIndex:this.show?-1:l,title:h,valid:this.validity.valid,validationMessage:w,validityStyles:D,value:this.value&&this.normalizeTime(this.value),label:void 0,placeholder:this.state.focused?null:this.props.placeholder,ariaHasPopup:"dialog",ariaExpanded:this.show,size:null,fillMode:null,rounded:null,readonly:this.mobileMode},C=this.localizationService.toLanguageString(me,ye[me]),I=this.localizationService.toLanguageString(pe,ye[pe]),M=u.createElement(s.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},(({onFocus:e,onBlur:n})=>u.createElement(u.Fragment,null,u.createElement("span",{id:this.props.id,ref:e=>{this._element=e},className:s.classNames("k-input","k-timepicker",{[`k-input-${s.kendoThemeMaps.sizeMap[t]||t}`]:t,[`k-rounded-${s.kendoThemeMaps.roundedMap[i]||i}`]:i,[`k-input-${a}`]:a,"k-invalid":!S,"k-required":this.required,"k-disabled":this.props.disabled},c),onKeyDown:this.handleKeyDown,style:{width:g},onFocus:e,onBlur:n,onClick:this.mobileMode?this.handleIconClick:void 0},u.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,...x}),u.createElement(o.Button,{tabIndex:-1,type:"button",icon:"clock",svgIcon:r.clockIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleIconClick,title:I,className:"k-input-button",rounded:null,fillMode:a,"aria-label":C}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup())));return this.props.label?u.createElement(Vt,{dateInput:this._dateInput,label:this.props.label,editorId:d,editorValid:S,editorDisabled:this.props.disabled,children:M,style:{width:this.props.width}}):M}normalizeTime(e){return R(E,e)}setShow(e){const{onOpen:t,onClose:i}=this.props;this.show!==e&&(this.setState({show:e}),e&&t&&t.call(void 0,{target:this}),!e&&i&&i.call(void 0,{target:this}))}mergeTime(e){return this.value&&e?R(this.value,e):e}calculateMedia(e){for(let t of e)this.setState({windowWidth:t.target.clientWidth})}};vi.displayName="TimePicker",vi.propTypes={className:i.string,cancelButton:i.bool,nowButton:i.bool,defaultShow:i.bool,defaultValue:i.instanceOf(Date),disabled:i.bool,format:i.oneOfType([i.string,i.shape({skeleton:i.string,pattern:i.string,date:i.oneOf(["short","medium","long","full"]),time:i.oneOf(["short","medium","long","full"]),datetime:i.oneOf(["short","medium","long","full"]),era:i.oneOf(["narrow","short","long"]),year:i.oneOf(["numeric","2-digit"]),month:i.oneOf(["numeric","2-digit","narrow","short","long"]),day:i.oneOf(["numeric","2-digit"]),weekday:i.oneOf(["narrow","short","long"]),hour:i.oneOf(["numeric","2-digit"]),hour12:i.bool,minute:i.oneOf(["numeric","2-digit"]),second:i.oneOf(["numeric","2-digit"]),timeZoneName:i.oneOf(["short","long"])})]),formatPlaceholder:i.oneOfType([i.oneOf(["wide","narrow","short","formatPattern"]),i.shape({year:i.string,month:i.string,day:i.string,hour:i.string,minute:i.string,second:i.string})]),id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,min:i.instanceOf(Date),max:i.instanceOf(Date),name:i.string,popupSettings:i.shape({animate:i.bool,appendTo:i.any,popupClass:i.string}),show:i.bool,steps:i.shape({hour:i.number,minute:i.number,second:i.number}),smoothScroll:i.bool,tabIndex:i.number,title:i.string,value:i.instanceOf(Date),width:i.oneOfType([i.number,i.string]),validationMessage:i.string,required:i.bool,validate:i.bool,valid:i.bool,size:i.oneOf([null,"small","medium","large"]),rounded:i.oneOf([null,"small","medium","large","full"]),fillMode:i.oneOf([null,"solid","flat","outline"])},vi.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"t",max:P,min:F,popupSettings:{},tabIndex:0,steps:{},required:!1,validityStyles:!0,dateInput:Mt,size:"medium",rounded:"medium",fillMode:"solid"};let fi=vi;const wi=s.createPropsContext(),bi=s.withIdHOC(s.withPropsContext(wi,fi));bi.displayName="KendoReactTimePicker",n.registerForLocalization(fi);const Di=class e extends u.Component{constructor(e){super(e),this._element=null,this.isActive=!1,this.focusActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus"),t=this._element.querySelector(".k-state-pending-focus");e&&e[0]&&e[0].classList.remove("k-focus"),t&&t.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus");e&&e.classList.remove("k-focus"),this.isActive=!1},this.rotateSelectionRange=e=>{if(null===e.start||null===e.end)return e;const t=e.end<e.start;return{start:t?e.end:e.start,end:t?e.start:e.end}},this.handleWeekCellClick=(e,t,i)=>{const{onWeekSelect:s}=this.props;s&&i&&s.call(void 0,e,t,i)},this.handleDateChange=(e,t=!1)=>{const{onChange:i}=this.props;if(i){const s={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:a.cloneDate(e.value),target:this,isTodayClick:t};i.call(void 0,s)}}}get element(){return this._element}get weekNumber(){return!(!this.props.showWeekNumbers||this.props.activeView!==C.month)}get min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}componentDidUpdate(){this.isActive&&this.focusActiveDate()}render(){const e=this.props.allowReverse?this.rotateSelectionRange(this.props.selectionRange):this.props.selectionRange,t=s.classNames("k-calendar-view k-align-items-start k-justify-content-center",{"k-vstack":this.props.verticalView,"k-hstack":!this.props.verticalView,"k-calendar-monthview":this.props.activeView===C.month,"k-calendar-yearview":this.props.activeView===C.year,"k-calendar-decadeview":this.props.activeView===C.decade,"k-calendar-centuryview":this.props.activeView===C.century});return u.createElement("div",{ref:e=>{this._element=e},className:t},this.props.dates.map((t=>u.createElement("table",{className:"k-calendar-table",key:t.getTime(),role:"grid"},u.createElement($,{bus:this.props.bus,weekDaysFormat:this.props.weekDaysFormat,service:this.props.service,key:t.getTime(),direction:"horizontal",activeView:this.props.activeView,cellUID:this.props.cellUID,viewDate:t,min:this.min,max:this.max,focusedDate:this.props.focusedDate,selectionRange:e,selectedDate:this.props.value,showWeekNumbers:this.weekNumber,onChange:this.handleDateChange,onWeekSelect:this.handleWeekCellClick,onCellEnter:this.props.onCellEnter,cell:this.props.cell,weekCell:this.props.weekCell,showOtherMonthDays:this.props.showOtherMonthDays,allowReverse:this.props.allowReverse})))))}};Di.defaultProps={showWeekNumbers:!1,views:2,take:2,allowReverse:!0,weekDaysFormat:"short",min:V,max:T};let yi=Di;const ki=(e=Mi.defaultProps.min,t=Mi.defaultProps.max,i)=>i instanceof Date&&!Array.isArray(i)&&L(a.getDate(i),e,t)?a.getDate(i):null,Si=(e=Mi.defaultProps.min,t=Mi.defaultProps.max,i)=>Array.isArray(i)?i.filter((i=>L(i,e,t))).map((e=>a.getDate(e))):null,xi=e=>"object"!=typeof e||e instanceof Date||null===e||Array.isArray(e)?I:e,Ci=(e,t,i)=>e||t&&t[0]||i&&i.start,Ii=class e extends u.Component{constructor(t){super(t),this.dates=[],this.selectedDate=null,this.selectedMultiple=null,this.selectedRange=I,this._focusedDate=new Date,this.cellUID=this.props.id+"-cell-uid",this.activeRangeEnd="start",this._element=null,this.intl=null,this.localization=null,this.service=null,this.calendarViewList=null,this.isActive=!1,this.calculateFocusFromValue=!0,this.focus=()=>{this._element&&this._element.focus()},this.clampRange=e=>({start:e,end:null}),this.rangeWithFocused=(e,t)=>({start:e.start,end:null===e.end&&null!==e.start&&this.isActive?t:e.end}),this.generateRange=(e,t)=>{const{end:i,start:s}=t,a=null!==t.start&&e.getTime()<=t.start.getTime();return!this.props.allowReverse&&a?{start:e,end:this.selectedRange.start}:"end"!==this.activeRange?{start:e,end:i}:{start:s||this.selectedDate,end:e}},this.canNavigate=e=>{if(!this.service)return!1;const t=this.service.move(this.focusedDate,e);return this.min<=t&&t<=this.max||this.service.isInSameView(t,this.min)||this.service.isInSameView(t,this.max)},this.navigate=(e,t)=>{this.calculateFocusFromValue=!1;const i=this.move(e,t);this.setState({navigateDate:i,focusedDate:i})},this.move=(e,t)=>this.clampDate(this.service.move(t,e)),this.clampDate=e=>z(e,this.min,this.max),this.shouldAutoCorrect=(e,t)=>{const{end:i,start:s}=t;return"end"!==this.activeRange?null!==i&&e>i:null!==s&&e<s},this.handleCellEnter=e=>{"range"===this.props.mode&&(this.calculateFocusFromValue=!1,this.setState({focusedDate:e}))},this.handleMouseDown=e=>{e.preventDefault()},this.handleClick=e=>{this._element&&this._element.focus({preventScroll:!0})},this.handleFocus=e=>{if(this.isActive=!0,!this.calendarViewList)return;this.calendarViewList.focusActiveDate();const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleBlur=e=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.handleTodayClick=e=>{this.todayIsInRange&&this.handleDateChange(e)},this.handlePrevButtonClick=()=>{const e=Ee.PrevView;if(this.state.activeView>0&&this.focusedDate.getFullYear()>this.dates[0].getFullYear())this.navigate(e,this.move(e,this.focusedDate));else{const t=this.isInMonth(this.focusedDate,this.dates[1])?this.move(e,this.focusedDate):this.focusedDate;this.navigate(e,t)}},this.handleNextButtonClick=()=>{this.navigate(Ee.NextView,this.focusedDate)},this.handleKeyDown=e=>{const{keyCode:t,ctrlKey:i,metaKey:n}=e;if(84===t){const e=N();this.calculateFocusFromValue=!1,this.setState({focusedDate:e,navigateDate:e})}if((i||n)&&(t===s.Keys.left&&this.handlePrevButtonClick(),t===s.Keys.right&&this.handleNextButtonClick()),t===s.Keys.enter){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(t)}else{const t=z(this.navigation.move(this.focusedDate,this.navigation.action(e),this.state.activeView,this.service,e),this.min,this.max);if(a.isEqualDate(this.focusedDate,t))return;this.dates&&this.service&&!this.service.isInArray(t,this.dates)&&this.setState({navigateDate:t}),this.calculateFocusFromValue=!1,this.setState({focusedDate:t})}e.preventDefault()},this.handleViewChange=({view:e})=>{this.calculateFocusFromValue=!1,this.setState((t=>({activeView:e,navigateDate:t.focusedDate})))},this.handleWeekSelection=(e,t,i)=>{if("single"===this.props.mode)return;const s=0===t?e:a.addDays(e,-t),n=6===t?e:a.addDays(e,6-t);let o=null;if("multiple"===this.props.mode){o=[];for(let e=0;e<=6;e++)o.push(a.addDays(s,e));this.setState({value:o,focusedDate:e})}"range"===this.props.mode&&(o={start:s,end:n},this.setState({value:o,focusedDate:e}));const{onChange:r}=this.props;if(r){const e={syntheticEvent:i,nativeEvent:i.nativeEvent,value:o,target:this};r.call(void 0,e)}},this.handleDateChange=e=>{const t=a.cloneDate(e.value),i=this.bus.canMoveDown(this.state.activeView);if(this.props.disabled)return;if(i){if(!e.isTodayClick)return this.bus.moveDown(this.state.activeView,e.syntheticEvent),void this.setState({focusedDate:t,navigateDate:t});this.bus.moveToBottom(this.state.activeView)}let s;switch(this.calculateFocusFromValue=!0,this.props.mode){case"single":default:s=a.cloneDate(e.value);break;case"multiple":if(Array.isArray(this.selectedMultiple)){const t=this.selectedMultiple.slice();let i=-1;t.forEach(((t,s)=>{a.isEqualDate(t,e.value)&&(i=s)})),-1!==i?t.splice(i,1):t.push(a.cloneDate(e.value)),s=t.slice()}else s=this.selectedDate?[a.cloneDate(this.selectedDate),a.cloneDate(e.value)]:[a.cloneDate(e.value)];break;case"range":s=null!==this.selectedRange.start&&null!==this.selectedRange.end&&"start"===this.activeRange?this.clampRange(e.value):this.generateRange(e.value,this.selectedRange),this.activeRangeEnd="end"!==this.activeRange?"end":"start"}this.valueDuringOnChange=s,e.isTodayClick&&this.setState({navigateDate:t}),this.setState({value:s,focusedDate:t}),this.valueDuringOnChange=s;const{onChange:n}=this.props;if(n){const t={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:s,target:this};n.call(void 0,t)}this.valueDuringOnChange=void 0};const i=void 0!==t.value?t.value:t.defaultValue||e.defaultProps.defaultValue,n=ki(this.min,this.max,i),o=Si(this.min,this.max,i),r=xi(i),l=Ci(n,o,r),h=O(C[t.defaultActiveView],this.bottomView,this.topView),d=z(t.focusedDate||l||N(),this.min,this.max);this.state={value:i,activeView:h,focusedDate:d,navigateDate:d},this.activeRangeEnd=((e,t)=>null===e.start&&null===t?"start":null===e.end?"end":"start")(r,n),this.bus=new Ke(this.handleViewChange),this.navigation=new Ye(this.bus),this.calculateFocusFromValue=!1,this.lastView=h,this.lastViewsCount=this.props.views||yi.defaultProps.views}get wrapperID(){return this.props.id+"-wrapper-id"}get isRtl(){return"rtl"===this.props.dir}get element(){return this._element}get value(){return void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.props.value?this.props.value:this.state.value}get focusedDate(){return a.cloneDate(this._focusedDate)}get min(){return a.getDate(void 0!==this.props.min?this.props.min:e.defaultProps.min)}get max(){return a.getDate(void 0!==this.props.max?this.props.max:e.defaultProps.max)}get bottomView(){return C[void 0!==this.props.bottomView?this.props.bottomView:e.defaultProps.bottomView]}get topView(){return C[void 0!==this.props.topView?this.props.topView:e.defaultProps.topView]}get activeRange(){return void 0!==this.props.activeRangeEnd?this.props.activeRangeEnd:this.activeRangeEnd}get todayIsInRange(){return L(N(),a.getDate(this.min),a.getDate(this.max))}componentDidMount(){this.calculateFocusFromValue=!0}componentDidUpdate(){this.calendarViewList&&(this.isActive?this.calendarViewList.focusActiveDate:this.calendarViewList.blurActiveDate)();const e=ki(this.min,this.max,this.value);this.calculateFocusFromValue=!!(this.selectedDate&&e&&this.selectedDate.getTime()&&e.getTime()),this.lastView=this.state.activeView,this.lastViewsCount=this.props.views||yi.defaultProps.views}render(){this.props._ref&&this.props._ref(this),this.intl=n.provideIntlService(this),this.localization=n.provideLocalizationService(this),this.bus.configure(this.bottomView,this.topView);const e=O(this.state.activeView,this.bottomView,this.topView);this.service=this.bus.service(e,this.intl),this.selectedDate=ki(this.min,this.max,this.value),this.selectedMultiple=Si(this.min,this.max,this.value),this.selectedRange=xi(this.value);const t=Ci(this.selectedDate,this.selectedMultiple,this.selectedRange);this._focusedDate=z(this.calculateFocusFromValue&&null!==t?t:this.state.focusedDate,this.min,this.max);const i=s.classNames("k-calendar k-calendar-range k-calendar-md",{"k-disabled":this.props.disabled},this.props.className),l=this.rangeWithFocused(this.selectedRange,this.focusedDate),h=this.localization.toLanguageString(X,ye[X]),d=this.localization.toLanguageString(J,ye[J]),c=!this.canNavigate(Ee.PrevView),p=!this.canNavigate(Ee.NextView),m={"aria-disabled":c},g={"aria-disabled":p},v=this.lastView!==e,f=this.dates&&this.isInMonth(this.state.navigateDate,this.dates[0]),w=this.lastViewsCount!==this.props.views;(!f||v||w)&&(this.dates=this.service.datesList(this.state.navigateDate,this.props.views||yi.defaultProps.views));const b=a.cloneDate(this.dates&&this.dates[0]?this.dates[0]:N());return u.createElement("div",{ref:e=>{this._element=e},className:i,id:this.props.id||this.wrapperID,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,tabIndex:this.props.disabled?void 0:this.props.tabIndex,onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseDown:this.handleMouseDown,onClick:this.handleClick,onKeyDown:this.handleKeyDown,"aria-disabled":this.props.disabled,dir:this.props.dir},u.createElement(G,{key:`.kendo.calendar.header.${b.getTime()}`,activeView:e,currentDate:b,min:this.min,max:this.max,rangeLength:this.props.views,bus:this.bus,service:this.service,headerTitle:this.props.headerTitle,verticalView:this.props.mobileMode,commands:u.createElement(u.Fragment,null,u.createElement(o.Button,{type:"button",className:"k-calendar-nav-prev",icon:this.isRtl?"chevron-right":"chevron-left",svgIcon:this.isRtl?r.chevronRightIcon:r.chevronLeftIcon,fillMode:"flat",title:h,disabled:c,onClick:this.handlePrevButtonClick,...m}),u.createElement(Se,{min:this.min,max:this.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange}),u.createElement(o.Button,{type:"button",className:"k-calendar-nav-next",icon:this.isRtl?"chevron-left":"chevron-right",svgIcon:this.isRtl?r.chevronLeftIcon:r.chevronRightIcon,fillMode:"flat",title:d,disabled:p,onClick:this.handleNextButtonClick,...g}))}),u.createElement(yi,{ref:e=>{this.calendarViewList=e},dates:this.dates,activeView:e,focusedDate:this.focusedDate,weekDaysFormat:this.props.weekDaysFormat,min:this.min,max:this.max,bus:this.bus,service:this.service,selectionRange:l,value:this.selectedMultiple||this.selectedDate,cellUID:this.cellUID,views:this.props.views,onChange:this.handleDateChange,onWeekSelect:this.handleWeekSelection,showWeekNumbers:this.props.weekNumber,onCellEnter:this.handleCellEnter,cell:this.props.cell,weekCell:this.props.weekCell,headerTitle:this.props.headerTitle,verticalView:this.props.mobileMode,showOtherMonthDays:this.props.showOtherMonthDays,allowReverse:this.props.allowReverse}))}isInMonth(e,t){return!!t&&a.firstDayOfMonth(t)<=e&&e<=a.lastDayOfMonth(t)}};Ii.displayName="MultiViewCalendar",Ii.propTypes={activeRangeEnd:i.oneOf(["start","end"]),allowReverse:i.bool,bottomView:i.oneOf(["month","year","decade","century"]),className:i.string,defaultActiveView:i.oneOf(["month","year","decade","century"]),defaultValue:i.oneOfType([M(i.instanceOf(Date)),i.arrayOf(i.instanceOf(Date)),i.shape({start:M(i.instanceOf(Date)),end:M(i.instanceOf(Date))})]),disabled:i.bool,focusedDate:i.instanceOf(Date),id:i.string,weekDaysFormat:i.oneOf(["narrow","short","abbreviated"]),ariaLabelledBy:i.string,ariaDescribedBy:i.string,max:i.instanceOf(Date),min:i.instanceOf(Date),mode:i.oneOf(["single","multiple","range"]),onBlur:i.func,onChange:i.func,onFocus:i.func,tabIndex:i.number,topView:i.oneOf(["month","year","decade","century"]),value:i.oneOfType([M(i.instanceOf(Date)),i.arrayOf(i.instanceOf(Date)),i.shape({start:M(i.instanceOf(Date).isRequired),end:M(i.instanceOf(Date).isRequired)})]),views:(e,t,i)=>{const s=e[t];return void 0!==s&&s<1?new Error(`Invalid prop '${t}' supplied to'${i}'. The '${t}' property cannot be less than 1'`):null},weekNumber:i.bool,showOtherMonthDays:i.bool,dir:i.string},Ii.defaultProps={disabled:!1,min:V,max:T,navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",weekDaysFormat:"short",tabIndex:0,bottomView:"month",views:2,allowReverse:!1,showOtherMonthDays:!1};let Mi=Ii;const Oi=s.createPropsContext(),Ei=s.withIdHOC(s.withPropsContext(Oi,Mi));Ei.displayName="KendoReactMultiViewCalendar",n.registerForIntl(Mi),n.registerForLocalization(Mi);const Vi=class e extends u.Component{constructor(t){super(t),this._element=null,this._calendar=null,this._startDateInput=u.createRef(),this._endDateInput=u.createRef(),this.shouldFocusDateInput=!1,this.shouldFocusCalendar=!1,this.focus=()=>{this.startDateInput&&this.startDateInput.focus()},this.setCalendarRef=e=>{this._calendar=e},this.focusCalendarElement=()=>{this._calendar&&this._calendar.element&&this._calendar.element.focus({preventScroll:!0})},this.calculateValue=(e,t)=>(void 0!==e.value?e.value:t.value)||I,this.calculateShow=(e,t)=>void 0!==e.show?e.show:t.show,this.renderCalendar=()=>{const e=this.value||I,t={min:this.min,max:this.max,allowReverse:this.props.allowReverse,mode:"range",focusedDate:this.props.focusedDate,disabled:this.props.disabled,className:this.mobileMode?"k-calendar-lg":"",mobileMode:this.mobileMode,...this.props.calendarSettings,value:e,dir:this.props.dir,onChange:this.handleCalendarChange};return this.props.calendar?u.createElement(this.props.calendar,{...t}):u.createElement(Ei,{...t,ref:this.setCalendarRef})},this.renderPopup=()=>{const e={popupClass:s.classNames("k-calendar-container","k-daterangepicker-popup"),animate:null!==this._element,anchor:this._element,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...this.props.popupSettings,show:this.show};return this.props.popup?u.createElement(this.props.popup,{...e},this.renderCalendar()):u.createElement(h.Popup,{...e},this.renderCalendar())},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t={expand:this.show,onClose:e=>this.handleCancel(e),adaptiveTitle:this.props.adaptiveTitle,windowWidth:e,footer:{cancelText:this.localizationService.toLanguageString(be,ye[be]),onCancel:this.handleCancel,applyText:this.localizationService.toLanguageString(De,ye[De]),onApply:this.handleBlur}};return u.createElement(Tt,{...t},u.createElement(d.ActionSheetContent,{className:"!k-overflow-hidden"},u.createElement("div",{className:"k-scrollable-wrap"},this.renderCalendar())))},this.handleReverseClick=e=>{const t={start:this.value.end,end:this.value.start},i={syntheticEvent:e,nativeEvent:e.nativeEvent};this.handleChange(t,i)},this.handleReverseMouseDown=e=>{e.preventDefault()},this.handleFocus=e=>{clearTimeout(this.nextTickId),this.shouldFocusDateInput||this.mobileMode&&this.setState({currentValue:this.value});const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleClick=()=>{this.shouldFocusDateInput||this.setShow(!0)},this.handleBlur=e=>{this.nextTick((()=>{this.setShow(!1)}));const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.handleCancel=e=>{this.nextTick((()=>{this.setShow(!1),this.setState({currentValue:I})}));const{onCancel:t}=this.props;t&&t.call(void 0,e)},this.handleEndChange=e=>{const t={start:this.value.start,end:a.cloneDate(e.value||void 0)};this.handleChange(t,e)},this.handleStartChange=e=>{const t={start:a.cloneDate(e.value||void 0),end:this.value.end};this.handleChange(t,e)},this.extractRangeFromValue=e=>{if(!(Array.isArray(e.value)||e.value instanceof Date))return e.value||I;const t=Array.isArray(e.value)?e.value[0]:e.value;return{start:null!==this.value.end?t:this.value.start,end:null!==this.value.start?t:this.value.end}},this.handleCalendarChange=e=>{const t=this.extractRangeFromValue(e);this.handleChange(t,e)},this.handleKeyDown=e=>{const{keyCode:t,altKey:i}=e;t===s.Keys.esc?(e.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1)):i&&t===s.Keys.down?(e.preventDefault(),this.shouldFocusCalendar=!0,this.setShow(!0),this.focusCalendarElement()):i&&t===s.Keys.up&&(e.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1))},this.handleChange=(e,t)=>{this.setState({value:e}),this.valueDuringOnChange=e;const{onChange:i}=this.props;if(i){const e={syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:this.value,show:this.show,target:this};i.call(void 0,e)}this.valueDuringOnChange=void 0},s.validatePackage(p),this.state={show:this.props.show||this.props.defaultShow||e.defaultProps.defaultShow,value:this.props.value||this.props.defaultValue||e.defaultProps.defaultValue,currentValue:I},this.nextTick=this.nextTick.bind(this),this.setShow=this.setShow.bind(this),this.focusCalendarElement=this.focusCalendarElement.bind(this),this.focusDateInputElement=this.focusDateInputElement.bind(this)}get _popupId(){return this.props.id+"-popup-id"}get _startInputId(){return this.props.id+"-start-input-id"}get _endInputId(){return this.props.id+"-end-input-id"}get element(){return this._element}get startDateInput(){return this._startDateInput.current}get endDateInput(){return this._endDateInput.current}get calendar(){return this._calendar}get value(){return(void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.props.value?this.props.value:this.state.value)||I}get show(){return void 0!==this.showDuringOnChange?this.showDuringOnChange:void 0!==this.props.show?this.props.show:this.state.show}get min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}get document(){if(s.canUseDOM)return this.element&&this.element.ownerDocument||document}get localizationService(){return n.provideLocalizationService(this)}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=Ft&&this.props.adaptive)}componentDidMount(){var e;this.observerResize=s.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this.shouldFocusCalendar&&this.focusCalendarElement(),this.shouldFocusDateInput&&this.focusDateInputElement(),this.shouldFocusCalendar=!1,this.shouldFocusDateInput=!1}componentWillUnmount(){var e;clearTimeout(this.nextTickId),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect()}render(){const e=this.value||I,t=this.mobileMode&&this.show?this.state.currentValue:e,i=(this.props.startDateInputSettings||{}).id||this._startInputId,a=(this.props.endDateInputSettings||{}).id||this._endInputId,l=s.classNames("k-daterangepicker",{"k-disabled":this.props.disabled},this.props.className),h=this.localizationService.toLanguageString(ne,ye[ne]),d=this.localizationService.toLanguageString(oe,ye[oe]),c=this.localizationService.toLanguageString(re,ye[re]),p={disableSelection:this.mobileMode&&!0,label:h,format:this.props.format,min:this.min,max:this.max,id:this._startInputId,disabled:this.props.disabled,valid:this.props.valid,tabIndex:this.props.tabIndex,ariaExpanded:this.show,clearButton:this.props.clearButton,...this.props.startDateInputSettings,value:t.start,onChange:this.handleStartChange},m={disableSelection:this.mobileMode&&!0,label:d,format:this.props.format,min:this.min,max:this.max,id:this._endInputId,disabled:this.props.disabled,valid:this.props.valid,tabIndex:this.props.tabIndex,ariaExpanded:this.show,clearButton:this.props.clearButton,...this.props.endDateInputSettings,value:t.end,onChange:this.handleEndChange},g=u.createElement(o.Button,{type:"button",className:"k-select",fillMode:"flat",title:n.provideLocalizationService(this).toLanguageString(ae,ye[ae]),onMouseDown:this.handleReverseMouseDown,onClick:this.handleReverseClick,"aria-controls":i+" "+a,"aria-label":n.provideLocalizationService(this).toLanguageString(ae,ye[ae])},u.createElement(s.IconWrap,{style:{transform:"rotate(90deg)"},name:"arrows-swap",icon:r.arrowsSwapIcon}));return u.createElement(u.Fragment,null,u.createElement("span",{ref:e=>{this._element=e},className:l,style:this.props.style,id:this.props.id,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,tabIndex:this.props.tabIndex,onFocus:this.handleFocus,onClick:this.handleClick,onKeyDown:this.handleKeyDown,onBlur:this.mobileMode?void 0:this.handleBlur,dir:this.props.dir},this.props.startDateInput?u.createElement(this.props.startDateInput,{...p}):u.createElement(Mt,{...p,autoFocus:this.props.autoFocus,ref:this._startDateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode}),(this.props.allowReverse||this.props.calendarSettings&&this.props.calendarSettings.allowReverse)&&this.props.swapButton?g:c,this.props.endDateInput?u.createElement(this.props.endDateInput,{...m}):u.createElement(Mt,{...m,ref:this._endDateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup())}focusDateInputElement(){if(!(document&&this.startDateInput&&this.startDateInput.element&&this.endDateInput&&this.endDateInput.element))return;const e=s.getActiveElement(document);null!==this.value.start&&null===this.value.end||e===this.endDateInput.element?e!==this.startDateInput.element&&this.endDateInput.element.focus({preventScroll:!0}):this.startDateInput.element.focus({preventScroll:!0})}nextTick(e){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout((()=>e()))}setShow(e){const{onOpen:t,onClose:i}=this.props;this.show!==e&&(this.setState({show:e}),e&&t&&t.call(void 0,{target:this}),!e&&i&&i.call(void 0,{target:this}))}calculateMedia(e){for(const t of e)this.setState({windowWidth:t.target.clientWidth})}};Vi.displayName="DateRangePicker",Vi.propTypes={allowReverse:i.bool,calendarSettings:i.any,className:i.string,defaultShow:i.bool,defaultValue:i.shape({start:M(i.instanceOf(Date).isRequired),end:M(i.instanceOf(Date).isRequired)}),disabled:i.bool,endDateInputSettings:i.shape(Ct.propTypes),focusedDate:i.instanceOf(Date),format:i.oneOfType([i.string,i.shape({skeleton:i.string,pattern:i.string,date:i.oneOf(["short","medium","long","full"]),time:i.oneOf(["short","medium","long","full"]),datetime:i.oneOf(["short","medium","long","full"]),era:i.oneOf(["narrow","short","long"]),year:i.oneOf(["numeric","2-digit"]),month:i.oneOf(["numeric","2-digit","narrow","short","long"]),day:i.oneOf(["numeric","2-digit"]),weekday:i.oneOf(["narrow","short","long"]),hour:i.oneOf(["numeric","2-digit"]),hour12:i.bool,minute:i.oneOf(["numeric","2-digit"]),second:i.oneOf(["numeric","2-digit"]),timeZoneName:i.oneOf(["short","long"])})]),id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,max:i.instanceOf(Date),min:i.instanceOf(Date),onBlur:i.func,onChange:i.func,onFocus:i.func,popupSettings:i.any,show:i.bool,startDateInputSettings:i.any,style:i.any,swapButton:i.any,tabIndex:i.number,dir:i.string,value:i.shape({start:M(i.instanceOf(Date).isRequired),end:M(i.instanceOf(Date).isRequired)}),autoFocus:i.bool},Vi.defaultProps={allowReverse:!1,defaultShow:!1,defaultValue:I,disabled:!1,format:"d",max:T,min:V,swapButton:!1,autoFocus:!1};let Ti=Vi;const Fi=s.createPropsContext(),Pi=s.withIdHOC(s.withPropsContext(Fi,Ti));Pi.displayName="KendoReactDateRangePicker",n.registerForLocalization(Ti);const Ri=class extends u.Component{constructor(e){super(e),this._calendar=null,this._timePart=null,this._cancelButton=null,this._acceptButton=null,this._dateButtonRef=null,this._calendarWrap=null,this.shouldFocusPart=!1,this.focus=e=>{Promise.resolve().then((()=>{"time"===this.state.tab&&this._timePart&&this._timePart.focus(e);const t=this.calendarElement();"date"===this.state.tab&&t&&t.focus(e)}))},this.calendarElement=()=>this._calendar&&this._calendar.element||this._calendarWrap&&this._calendarWrap.querySelector(".k-widget.k-calendar"),this.move=e=>{if("right"===e&&"time"===this.state.tab||"left"===e&&"date"===this.state.tab)return;const t="left"===e?"date":"time";this.shouldFocusPart=!0,this.setState({tab:t})},this.dateTimeFooter=()=>{const{cancelButton:e}=this.props,t=this.localizationService.toLanguageString(fe,ye[fe]),i=this.localizationService.toLanguageString(we,ye[we]);return u.createElement("div",{className:"k-datetime-footer k-actions k-actions-stretched"},e&&u.createElement(o.Button,{type:"button",ref:e=>{this._cancelButton=e},className:"k-time-cancel",onClick:this.handleReject,onKeyDown:this.handleCancelKeyDown,title:t,"aria-label":t},t),u.createElement(o.Button,{type:"button",themeColor:"primary",ref:e=>{this._acceptButton=e},className:"k-time-accept",disabled:!this.hasDateValue,onClick:this.handleAccept,onKeyDown:this.handleSetKeyDown,title:i,"aria-label":i},i))},this.handleReject=e=>{this.setState({dateValue:this.props.value,timeValue:this.props.value||E});const t=this.mergeDate(this.props.value,this.props.value||E);if(this.props.onReject){const i={nativeEvent:e.nativeEvent,syntheticEvent:e,target:this,value:t};this.props.onReject.call(void 0,i)}},this.handleAccept=(e,t)=>{if(!this.state.dateValue||!this.state.timeValue||!this.hasDateValue)return;const i=this.mergeDate(this.state.dateValue,t||this.state.timeValue);this.props.onChange.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:i,target:this})},this.handleNowClick=e=>{this.setState({timeValue:vt()}),this.handleAccept(e,vt())},this.handleCalendarValueChange=e=>{e.syntheticEvent.stopPropagation(),this.setState({dateValue:e.value,tab:"time"}),this.shouldFocusPart=!0},this.handleTimeListContainerChange=e=>{this.setState({timeValue:e})},this.handleDateClick=e=>{e.stopPropagation(),this.move("left")},this.handleTimeClick=e=>{e.stopPropagation(),this.move("right")},this.handleKeyDown=e=>{const{keyCode:t,altKey:i}=e;if(!this.props.disabled)switch(t){case s.Keys.enter:return void(!this.hasActiveButton()&&this.hasDateValue&&this.handleAccept(e));case s.Keys.left:if(!i)return;return void this.move("left");case s.Keys.right:if(!i)return;return void this.move("right");default:return}},this.handleCancelKeyDown=e=>{const{keyCode:t}=e;t===s.Keys.tab&&this._dateButtonRef&&this._dateButtonRef.element&&!this.hasDateValue&&(e.preventDefault(),this._dateButtonRef.element.focus())},this.handleSetKeyDown=e=>{const{keyCode:t}=e;t===s.Keys.tab&&this._dateButtonRef&&this._dateButtonRef.element&&(e.preventDefault(),this._dateButtonRef.element.focus())},this.handleDateKeyDown=e=>{var t,i,a,n;const{keyCode:o,shiftKey:r}=e;r&&o===s.Keys.tab&&(e.stopPropagation(),this.hasDateValue?null==(n=null==(a=this._acceptButton)?void 0:a.element)||n.focus():null==(i=null==(t=this._cancelButton)?void 0:t.element)||i.focus()),o===s.Keys.enter&&(e.stopPropagation(),this.move("left"))},this.handleTimeKeyDown=e=>{const{keyCode:t}=e;t===s.Keys.enter&&(e.stopPropagation(),this.move("right"))},this.handleTimePartMount=e=>{this.setState({timeValue:e})},this.state={tab:"date",dateValue:this.props.value,timeValue:this.props.value||E}}get calendar(){return this._calendar}get timePart(){return this._timePart}get hasDateValue(){return null!==this.state.dateValue}get localizationService(){return n.provideLocalizationService(this)}componentDidUpdate(e,t){var i,s;this.shouldFocusPart&&this.focus({preventScroll:!0}),((null==(i=e.value)?void 0:i.getTime())!==(null==(s=this.props.value)?void 0:s.getTime())||this.state.tab!==t.tab&&this.props.value)&&this.setState({dateValue:e.value&&this.props.value&&a.isEqualDate(e.value,this.props.value)?this.state.dateValue:this.props.value,timeValue:this.props.value||E}),this.shouldFocusPart=!1}render(){const{disabled:e,min:t,max:i,weekNumber:a,focusedDate:n,format:r,mobileMode:l,footerActions:h}=this.props,d=s.classNames({"k-date-tab":"date"===this.state.tab,"k-time-tab":"time"===this.state.tab,"k-disabled":e},"k-datetime-wrap"),c=this.localizationService.toLanguageString(ge,ye[ge]),p=this.localizationService.toLanguageString(ve,ye[ve]),m={min:t,max:i,weekNumber:a,focusedDate:n,disabled:e||"date"!==this.state.tab,value:this.state.dateValue,onChange:this.handleCalendarValueChange,navigation:!1,tabIndex:e||"date"!==this.state.tab?-1:void 0,mobileMode:l};return u.createElement("div",{onKeyDown:this.handleKeyDown,className:d,tabIndex:-1},u.createElement("div",{className:"k-datetime-buttongroup"},u.createElement(o.ButtonGroup,{width:"100%"},u.createElement(o.Button,{ref:e=>this._dateButtonRef=e,type:"button",selected:"date"===this.state.tab,togglable:!0,onClick:this.handleDateClick,onKeyDown:this.handleDateKeyDown},c),u.createElement(o.Button,{type:"button",selected:"time"===this.state.tab,togglable:!0,onClick:this.handleTimeClick,onKeyDown:this.handleTimeKeyDown},p))),u.createElement("div",{className:"k-datetime-selector"},u.createElement("div",{className:"k-datetime-calendar-wrap",ref:e=>this._calendarWrap=e},this.props.calendar?u.createElement(this.props.calendar,{key:this.state.tab,...m}):u.createElement(Qe,{key:this.state.tab,ref:e=>{this._calendar=e},...m})),u.createElement("div",{className:"k-datetime-time-wrap"},u.createElement("div",{className:l?"k-reset k-timeselector-lg k-timeselector":""},u.createElement(pi,{key:1,onNowClick:this.handleNowClick,disabled:e||"time"!==this.state.tab,ref:e=>{this._timePart=e},min:this.minTime||F,max:this.maxTime||P,steps:this.props.steps,value:this.state.timeValue,format:r,onChange:this.handleTimeListContainerChange,onMount:this.handleTimePartMount,mobileMode:l})))),h&&this.dateTimeFooter())}get minTime(){return void 0!==this.props.minTime?this.props.minTime:this.normalizeRange(this.props.min,this.state.dateValue)}get maxTime(){return void 0!==this.props.maxTime?this.props.maxTime:this.normalizeRange(this.props.max,this.state.dateValue)}normalizeRange(e,t){return a.isEqualDate(e,t||N())?e:null}hasActiveButton(){if(!this._acceptButton)return!1;const e=s.getActiveElement(document);return this._acceptButton&&e===this._acceptButton.element||this._cancelButton&&e===this._cancelButton.element}mergeTime(e,t){return e&&t?R(t,e):t}mergeDate(e,t){return e?R(e||N(),t):t}};Ri.defaultProps={footerActions:!0};let Ni=Ri;n.registerForLocalization(Ni);const Li=class e extends u.Component{constructor(t){super(t),this._element=null,this._dateInput=u.createRef(),this._dateTimeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{const e=this.dateInputElement();e&&e.focus()},this.renderPicker=()=>{const{disabled:e,minTime:t,maxTime:i,format:s,calendar:a,cancelButton:n,weekNumber:o,focusedDate:r}=this.props;return u.createElement(Ni,{ref:e=>{this._dateTimeSelector=e},cancelButton:n,steps:this.props.steps,value:this.value,onChange:this.handleValueChange,onReject:this.handleReject,disabled:e,weekNumber:o,min:this.min,max:this.max,minTime:t,maxTime:i,focusedDate:r,format:s,calendar:a,mobileMode:this.mobileMode,footerActions:!this.mobileMode})},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t=n.provideLocalizationService(this).toLanguageString(fe,ye[fe]),i=n.provideLocalizationService(this).toLanguageString(we,ye[we]),s={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:e,footer:{cancelText:t,onCancel:e=>{var t;return null==(t=this._dateTimeSelector)?void 0:t.handleReject(e)},applyText:i,onApply:e=>{var t;return null==(t=this._dateTimeSelector)?void 0:t.handleAccept(e)}}};return u.createElement(Tt,{...s},u.createElement(d.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderPicker()))},this.handleReject=()=>{this.shouldFocusDateInput=!0,this.setShow(!1)},this.handleValueChange=e=>{this.setState({value:a.cloneDate(e.value||void 0)}),this.valueDuringOnChange=e.value,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:t}=this.props;t&&t.call(void 0,{syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:this.value,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.handleDateIconClick=()=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:t,keyCode:i}=e;if(i===s.Keys.esc)return this.shouldFocusDateInput=!0,void this.setShow(!1);t&&(i===s.Keys.up||i===s.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=i===s.Keys.up,this.setShow(i===s.Keys.down))},this.dateInputElement=()=>this.dateInput&&this.dateInput.element||this.element&&this.element.querySelector(".k-dateinput > input.k-input-inner"),s.validatePackage(p),this.state={value:this.props.defaultValue||e.defaultProps.defaultValue,show:this.props.defaultShow||e.defaultProps.defaultShow,focused:!1}}get _popupId(){return this.props.id+"-popup-id"}get document(){if(s.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get dateInput(){return this._dateInput.current}get value(){const e=void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.props.value?this.props.value:this.state.value;return null!==e?a.cloneDate(e):null}get show(){return void 0!==this.showDuringOnChange?this.showDuringOnChange:void 0!==this.props.show?this.props.show:this.state.show}get name(){return this.props.name}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=Ft&&this.props.adaptive)}get min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}get validity(){const e=B(this.value,this.min,this.max)&&bt(this.value,this.props.minTime||F,this.props.maxTime||P),t=void 0!==this.props.validationMessage,i=(!this.required||null!==this.value)&&e,s=void 0!==this.props.valid?this.props.valid:i;return{customError:t,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:s,valueMissing:null===this.value}}get validityStyles(){return void 0!==this.props.validityStyles?this.props.validityStyles:e.defaultProps.validityStyles}get required(){return void 0!==this.props.required?this.props.required:e.defaultProps.required}get dateInputComp(){return this.props.dateInput||e.defaultProps.dateInput}componentDidMount(){var e;this.observerResize=s.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){const e=this.dateInputElement();this._dateTimeSelector&&this.show&&!this.prevShow&&this._dateTimeSelector.focus({preventScroll:!0}),e&&!this.show&&this.shouldFocusDateInput&&e.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var e;clearTimeout(this.nextTickId),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:t=e.defaultProps.size,rounded:i=e.defaultProps.rounded,fillMode:a=e.defaultProps.fillMode,autoFocus:l=e.defaultProps.autoFocus,disabled:d,tabIndex:c,title:p,id:m,format:g,formatPlaceholder:v,min:f,max:w,className:b,width:D,name:y,validationMessage:k,required:S,validityStyles:x,minTime:C,maxTime:I,ariaLabelledBy:M,ariaDescribedBy:O,popup:E=h.Popup}=this.props,V=!this.validityStyles||this.validity.valid,T={id:m,ariaLabelledBy:M,ariaDescribedBy:O,format:g,formatPlaceholder:v,disabled:d,title:p,validityStyles:x,validationMessage:k,required:S,min:f,max:w,minTime:C,maxTime:I,name:y,tabIndex:this.show?-1:c,valid:this.validity.valid,value:this.value,onChange:this.handleValueChange,steps:this.props.steps,label:void 0,placeholder:this.state.focused?null:this.props.placeholder,ariaExpanded:this.show,size:null,fillMode:null,rounded:null},F=u.createElement(s.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.handleBlur,onSyncFocus:this.props.onFocus,onSyncBlur:this.props.onBlur},(({onFocus:e,onBlur:h})=>u.createElement(u.Fragment,null,u.createElement("div",{ref:e=>{this._element=e},className:s.classNames("k-input","k-datetimepicker",{[`k-input-${s.kendoThemeMaps.sizeMap[t]||t}`]:t,[`k-rounded-${s.kendoThemeMaps.roundedMap[i]||i}`]:i,[`k-input-${a}`]:a,"k-invalid":!V,"k-required":this.required,"k-disabled":this.props.disabled},b),onKeyDown:this.handleKeyDown,style:{width:D},onFocus:this.mobileMode?void 0:e,onBlur:h,onClick:this.mobileMode?this.handleDateIconClick:void 0},u.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode,autoFocus:l,...T}),u.createElement(o.Button,{tabIndex:-1,type:"button",icon:"calendar",svgIcon:r.calendarIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleDateIconClick,title:n.provideLocalizationService(this).toLanguageString(le,ye[le]),className:"k-input-button",rounded:null,fillMode:a,"aria-label":n.provideLocalizationService(this).toLanguageString(le,ye[le])}),u.createElement(E,{show:this.show,animate:null!==this.element,anchor:this.element,popupClass:"k-datetime-container k-reset",id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"}},!this.mobileMode&&this.renderPicker())),this.mobileMode&&this.renderAdaptivePopup())));return this.props.label?u.createElement(Vt,{dateInput:this._dateInput,label:this.props.label,editorId:m,editorValid:V,editorDisabled:this.props.disabled,children:F,style:{width:this.props.width}}):F}setShow(e){const{onOpen:t,onClose:i}=this.props;this.show!==e&&(this.setState({show:e}),e&&t&&t.call(void 0,{target:this}),!e&&i&&i.call(void 0,{target:this}))}nextTick(e){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout((()=>e()))}calculateMedia(e){for(const t of e)this.setState({windowWidth:t.target.clientWidth})}};Li.displayName="DateTimePicker",Li.propTypes={className:i.string,defaultShow:i.bool,defaultValue:i.instanceOf(Date),disabled:i.bool,focusedDate:i.instanceOf(Date),format:i.oneOfType([i.string,i.shape({skeleton:i.string,pattern:i.string,date:i.oneOf(["short","medium","long","full"]),time:i.oneOf(["short","medium","long","full"]),datetime:i.oneOf(["short","medium","long","full"]),era:i.oneOf(["narrow","short","long"]),year:i.oneOf(["numeric","2-digit"]),month:i.oneOf(["numeric","2-digit","narrow","short","long"]),day:i.oneOf(["numeric","2-digit"]),weekday:i.oneOf(["narrow","short","long"]),hour:i.oneOf(["numeric","2-digit"]),hour12:i.bool,minute:i.oneOf(["numeric","2-digit"]),second:i.oneOf(["numeric","2-digit"]),timeZoneName:i.oneOf(["short","long"])})]),formatPlaceholder:i.oneOfType([i.oneOf(["wide","narrow","short","formatPattern"]),i.shape({year:i.string,month:i.string,day:i.string,hour:i.string,minute:i.string,second:i.string})]),id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,min:i.instanceOf(Date),max:i.instanceOf(Date),name:i.string,popupSettings:i.shape({animate:i.bool,appendTo:i.any,popupClass:i.string}),show:i.bool,tabIndex:i.number,title:i.string,value:i.instanceOf(Date),weekNumber:i.bool,width:i.oneOfType([i.number,i.string]),validationMessage:i.string,required:i.bool,validate:i.bool,valid:i.bool,cancelButton:i.bool,size:i.oneOf([null,"small","medium","large"]),rounded:i.oneOf([null,"small","medium","large","full"]),fillMode:i.oneOf([null,"solid","flat","outline"]),autoFocus:i.bool},Li.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"g",max:T,min:V,popupSettings:{},tabIndex:0,weekNumber:!1,required:!1,validityStyles:!0,cancelButton:!0,dateInput:Mt,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1};let Bi=Li;const _i=s.createPropsContext(),Ai=s.withIdHOC(s.withPropsContext(_i,Bi));Ai.displayName="KendoReactDateTimePicker",n.registerForLocalization(Bi),e.Action=Ee,e.BusViewService=Ke,e.Calendar=Qe,e.CalendarCell=S,e.CalendarHeaderTitle=j,e.CalendarNavigationItem=Ie,e.CalendarPropsContext=Je,e.CalendarViewEnum=C,e.CalendarWeekCell=x,e.CalendarWithoutContext=Xe,e.CenturyViewService=Fe,e.DOMService=We,e.DateInput=Mt,e.DateInputPropsContext=It,e.DateInputWithoutContext=Ct,e.DatePicker=Lt,e.DatePickerPropsContext=Nt,e.DatePickerWithoutContext=Rt,e.DateRangePicker=Pi,e.DateRangePickerPropsContext=Fi,e.DateRangePickerWithoutContext=Ti,e.DateTimePicker=Ai,e.DateTimePickerPropsContext=_i,e.DateTimePickerWithoutContext=Bi,e.DayPeriodService=zt,e.DecadeViewService=Ne,e.EMPTY_SELECTIONRANGE=I,e.Header=G,e.HorizontalViewList=yi,e.HoursService=jt,e.MAX_DATE=T,e.MAX_TIME=P,e.MIN_DATE=V,e.MIN_TIME=F,e.MinutesService=ei,e.MonthViewService=_e,e.MultiViewCalendar=Ei,e.MultiViewCalendarPropsContext=Oi,e.MultiViewCalendarWithoutContext=Mi,e.NavigationService=Ye,e.PickerWrap=Et,e.ScrollSyncService=$e,e.SecondsService=oi,e.TimeList=di,e.TimePart=pi,e.TimePicker=bi,e.TimePickerPropsContext=wi,e.TimePickerWithoutContext=fi,e.TimeSelector=gi,e.TodayCommand=Se,e.ToggleButton=Ot,e.ViewList=Ce,e.Virtualization=k,e.WeekNamesService=W,e.YearViewService=ze,e.dateInputsMessages=ye,e.decreaseValue=ee,e.end=oe,e.getNow=vt,e.getToday=N,e.increaseValue=Q,e.separator=re,e.start=ne,e.swapStartEnd=ae,e.today=ie,e.toggleCalendar=se,e.toggleDateTimeSelector=le}));
8
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-date-math"),require("@progress/kendo-react-intl"),require("@progress/kendo-react-buttons"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-labels"),require("@progress/kendo-react-popup"),require("@progress/kendo-react-layout")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-date-math","@progress/kendo-react-intl","@progress/kendo-react-buttons","@progress/kendo-svg-icons","@progress/kendo-react-labels","@progress/kendo-react-popup","@progress/kendo-react-layout"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactDateinputs={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoDateMath,e.KendoReactIntl,e.KendoReactButtons,e.KendoSvgIcons,e.KendoReactLabels,e.KendoReactPopup,e.KendoReactLayout)}(this,(function(e,t,i,s,a,n,o,r,l,h,c){"use strict";function d(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(i){if("default"!==i){var s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return e[i]}})}})),t.default=e,Object.freeze(t)}var u=d(t);const p={name:"@progress/kendo-react-dateinputs",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1617189075,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"},m=e=>Math.max(e,0);let g=class{constructor(e){this.offset=e}},v=class{constructor(e){this.skip=e}},f=class{constructor(e,t){this.onScrollAction=e,this.onPageAction=t,this.direction="vertical",this.firstLoaded=0,this.lastLoaded=0,this.lastScrollTop=0,this.take=0,this.total=0,this.rowHeightService=null,this.bottomOffset=0,this.topOffset=0}create(e,t,i,s,a=0,n=0,o="vertical"){this.rowHeightService=e,this.firstLoaded=t,this.lastLoaded=t+i,this.take=i,this.total=s,this.lastScrollTop=0,this.topOffset=a,this.bottomOffset=n,this.direction=o;const r=this.rowsForHeight(a),l=m(t-r);this.onScrollAction(new g(this.rowOffset(l))),this.onPageAction(new v(l))}onScroll({scrollLeft:e,scrollTop:t,offsetHeight:i,offsetWidth:s}){const a="vertical"===this.direction?t:e,n="vertical"===this.direction?i:s;if(this.lastScrollTop===a||!this.rowHeightService)return;const o=this.lastScrollTop>=a;this.lastScrollTop=a;const r=this.rowHeightService.index(m(a-this.topOffset)),l=this.rowHeightService.index(m(a+n-this.bottomOffset));if(!o&&l>=this.lastLoaded&&this.lastLoaded<this.total&&(this.firstLoaded=r,this.onScrollAction(new g(this.rowOffset(r))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),this.onPageAction(new v(this.firstLoaded))),o&&r<=this.firstLoaded){const e=Math.floor(.3*this.take);this.firstLoaded=m(r-e),this.onScrollAction(new g(this.rowOffset(this.firstLoaded))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),this.onPageAction(new v(this.firstLoaded))}}rowOffset(e){return this.rowHeightService?this.rowHeightService.offset(e)+this.topOffset:0}rowsForHeight(e){return this.rowHeightService?Math.ceil(e/this.rowHeightService.height(0)):0}};const w={1:e=>t=>t+e,0:e=>t=>t-e},b={1:e=>t=>Math.min(t,e),0:e=>t=>Math.max(t,e)},D={1:e=>t=>t<e,0:e=>t=>t>e},y=class e extends u.Component{constructor(t){super(t),this.rowHeightService=null,this.scrollContainer=null,this.lastDirection=null,this.lastTotal=0,this.lastTake=0,this.animationInProgress=!1,this.restrictScroll=!1,this.scrollTo=e=>{const t="vertical"===this.direction?"scrollTop":"scrollLeft";if(!this.scrollContainer)return;const i=this.scrollContainer[t];this.restrictScroll&&"scrollTop"===t&&(!Number.isInteger(i)||!Number.isInteger(e))&&Math.abs(i-e)<10||(this.scrollContainer[t]=e)},this.scrollToIndex=e=>{this.animationInProgress=!1,this.rowHeightService&&this.scrollTo(this.rowHeightService.offset(e))},this.animateToIndex=e=>{if(!this.rowHeightService||!window)return;window.cancelAnimationFrame(this.cancelAnimation);const t=this.rowHeightService.offset(e),i=this.getContainerScrollDirection(t);let{start:s,end:a}=this.scrollRange(t,i);if(s===a)return;const n=this.scrollStep(s,a),o=w[i](n),r=b[i](a),l=D[i](o(a)),h=e=>{this.animationInProgress=!0;const t=o(e);this.scrollTo(r(t)),l(t)?this.cancelAnimation=window.requestAnimationFrame((()=>{h(t)})):this.animationInProgress=!1};this.cancelAnimation=window.requestAnimationFrame((()=>{h(s)}))},this.scrollToBottom=()=>{this.rowHeightService&&this.scrollTo(this.rowHeightService.totalHeight()+this.props.bottomOffset)},this.scrollStep=(t,i)=>{const s=this.props.scrollDuration||e.defaultProps.scrollDuration;return Math.abs(i-t)/(s/17)},this.scrollRange=(e,t)=>{const i=this.containerScrollPosition;if(parseInt(`${e}`,10)===parseInt(`${i}`,10))return{start:e,end:e};const s=this.containerMaxScroll(),a=0===t?1:-1,n=((e,t,i)=>Math.min(Math.abs(t-e),i))(i,e,this.props.maxScrollDifference||0),o=Math.min(e,s);return{start:Math.min(Math.max(o+a*n,0),s),end:o}},this.containerMaxScroll=()=>this.containerScrollSize-this.containerOffsetSize,this.getContainerScrollDirection=e=>e<this.containerScrollPosition?0:1,this.initServices=(e=this.props)=>{const t="vertical"===this.direction?e.itemHeight:e.itemWidth;void 0!==t&&(this.rowHeightService=new s.RowHeightService(e.total,t,0),this.scrollerService.create(this.rowHeightService,e.skip,e.take,e.total,e.topOffset,this.scrollOffsetSize,this.direction))},this.getContainerProperty=e=>this.scrollContainer?this.scrollContainer[e]:0,this.handleScroll=e=>{if(!this.scrollContainer||!this.rowHeightService)return;const t=e.target;this.scrollerService.onScroll({scrollLeft:t.scrollLeft,scrollTop:t.scrollTop,offsetHeight:t.offsetHeight,offsetWidth:t.offsetWidth});const i=this.rowHeightService.index(this.containerScrollPosition-this.props.topOffset),{onScrollAction:s}=this.props,a={index:i,target:t,scrollAction:this.scrollAction,pageAction:this.pageAction,animationInProgress:this.animationInProgress};this.props.onScroll&&this.props.onScroll.call(void 0,e),s&&s.call(void 0,a),this.scrollAction=void 0,this.pageAction=void 0},this.handleScrollAction=e=>{this.scrollAction=e},this.handlePageAction=e=>{this.pageAction=e},this.scrollerService=new f(this.handleScrollAction,this.handlePageAction),this.restrictScroll=Number.parseFloat(u.version)>17}get element(){return this.scrollContainer}get containerOffsetSize(){return this.getContainerProperty("vertical"===this.direction?"offsetHeight":"offsetWidth")}get containerScrollSize(){return this.getContainerProperty("vertical"===this.direction?"scrollHeight":"scrollWidth")}get containerScrollPosition(){return this.getContainerProperty("vertical"===this.direction?"scrollTop":"scrollLeft")}get direction(){return void 0!==this.props.direction?this.props.direction:e.defaultProps.direction}get scrollOffsetSize(){return void 0!==this.props.scrollOffsetSize?this.props.scrollOffsetSize:e.defaultProps.scrollOffsetSize}activeIndex(){return this.itemIndex(Math.ceil(this.containerScrollPosition))}itemIndex(e){return this.rowHeightService?this.rowHeightService.index(e):0}itemOffset(e){return this.rowHeightService?this.rowHeightService.offset(e):0}isIndexVisible(e){if(!this.rowHeightService)return!1;const t=this.containerScrollPosition,i=t+this.containerOffsetSize,s=this.rowHeightService.offset(e),a=s+this.rowHeightService.height(e);return s>=t&&a<=i}isListScrolled(e){return!!this.rowHeightService&&this.containerScrollPosition!==this.rowHeightService.offset(e)}componentDidMount(){const{onMount:e}=this.props;e&&e.call(void 0,this)}render(){const{total:e,take:t,bottomOffset:i,className:a,tabIndex:n,role:o,children:r,unstyled:l}=this.props,h=l&&l.uCalendar;(this.lastTotal!==e||this.lastDirection!==this.direction||this.lastTake!==t)&&(this.initServices(),this.lastTotal=e,this.lastDirection=this.direction,this.lastTake=t);const c=`${(this.rowHeightService?this.rowHeightService.totalHeight():0)+i}`,d="vertical"===this.direction?{height:`${c}px`}:{width:`${c}px`},p=s.classNames(s.uCalendar.scrollable({c:h,horizontal:"horizontal"===this.direction}),a),m=s.classNames(s.uCalendar.scrollablePlaceholder({c:h,horizontal:"horizontal"===this.direction}));return u.createElement("div",{ref:e=>{this.scrollContainer=e},onScroll:this.handleScroll,className:p,tabIndex:n,role:o},r,u.createElement("div",{style:d,className:m}))}};y.propTypes={bottomOffset:i.number.isRequired,className:i.string,direction:i.oneOf(["horizontal","vertical"]),forceScroll:i.bool,itemHeight:i.number,itemWidth:i.number,maxScrollDifference:i.number,onScroll:i.func,onScrollAction:i.func,scrollDuration:i.number,scrollOffsetSize:i.number,skip:i.number.isRequired,tabIndex:i.number,take:i.number.isRequired,topOffset:i.number.isRequired,total:i.number.isRequired,role:i.string},y.defaultProps={direction:"vertical",forceScroll:!1,scrollOffsetSize:0,maxScrollDifference:100,scrollDuration:100};let S=y;let k=class extends u.Component{constructor(){super(...arguments),this.handleClick=e=>{const{onClick:t,value:i}=this.props;t&&t.call(void 0,i,e)},this.handleMouseEnter=()=>{const{onMouseEnter:e,value:t}=this.props;e&&e.call(void 0,t)},this.handleMouseLeave=()=>{const{onMouseLeave:e,value:t}=this.props;e&&e.call(void 0,t)}}shouldComponentUpdate(e){const{value:t,...i}=this.props,{value:s,...a}=e;return!((!t||!s||t.getTime()===s.getTime())&&((e,t)=>{const i=Object.getOwnPropertyNames(e),s=Object.getOwnPropertyNames(t);if(i.length!==s.length)return!1;for(let s=0;s<i.length;s++){const a=i[s];if(e[a]!==t[a])return!1}return!0})(i,a))}render(){const{className:e,formattedValue:t,isWeekend:i,isFocused:a,isInRange:n,isSelected:o,isRangeStart:r,isRangeMid:l,isRangeEnd:h,isRangeSplitStart:c,isRangeSplitEnd:d,isToday:p,isDisabled:m,view:g,value:v,isOtherMonth:f,showOtherMonthDays:w,allowReverse:b,unstyled:D,...y}=this.props,S="end"===this.props.activeRangeEnd&&h,k="start"===this.props.activeRangeEnd&&r,C=D&&D.uCalendar,x=s.classNames(s.uCalendar.td({c:C,rangeStart:!f&&!b&&r,rangeEnd:!f&&!b&&h,rangeMid:!f&&l,rangeSplitEnd:!f&&d,rangeSplitStart:!f&&c,active:k||S,focused:a,selected:!f&&(o||r||h),today:!f&&p,weekend:i,disabled:m,isOtherMonth:f,isEmpty:!w&&f}),e);return!w&&f?u.createElement("td",{role:"gridcell",className:x}):u.createElement("td",{...y,className:x,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},u.createElement("span",{className:s.classNames(s.uCalendar.link({c:C}))},this.props.children))}};const C=e=>{const{className:t,firstDate:i,weekDays:a,...n}=e,o=s.useUnstyled(),r=o&&o.uCalendar;return u.createElement("td",{className:s.classNames(s.uCalendar.td({c:r,isWeek:!0}),t),...n,onClick:t=>{const{onClick:s}=e;s&&t&&s.call(void 0,i,a||[],t)}},e.children)};var x=(e=>(e[e.month=0]="month",e[e.year=1]="year",e[e.decade=2]="decade",e[e.century=3]="century",e))(x||{});const I={start:null,end:null};function M(e){const t=(t,i,s,...a)=>null===i[s]?null:(t?e.isRequired:e)(i,s,...a),i=t.bind(null,!1);return i.isRequired=t.bind(null,!0),i}const O=(e,t,i)=>void 0===t||void 0===i||t<=e&&e<=i?e:e<t?t:i,E=new Date(1980,0,1),T=new Date(1900,0,1),V=new Date(2099,11,31),P=new Date(1980,0,1),N=new Date(1980,0,1,23,59,59),F=(e,t)=>{const i=a.cloneDate(e);return i.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),i},R=()=>a.getDate(new Date),L=(e,t,i)=>!e||!(t&&t>e||i&&i<e),B=(e,t,i)=>null===e||!(t&&a.getDate(t)>a.getDate(e)||i&&a.getDate(i)<a.getDate(e)),_=(e,t)=>{const{start:i,end:s}=t||I;return!(!i||!s)&&(i<e&&e<s)},H=(e,t,i=1)=>{const s=[];for(let a=e;a<t;a+=i)s.push(a);return s},A=(e,t,i)=>t.getTime()<=e.getTime()&&e.getTime()<=i.getTime(),z=(e,t,i)=>e&&(t&&e<t?a.cloneDate(t):i&&e>i?a.cloneDate(i):e),q=e=>(t,i="",s={})=>{const a=document.createElement(e);return a.className=i,Object.keys(s).map((e=>a.style[e]=s[e])),"string"==typeof t?a.innerHTML=t||"":(t||[]).forEach((e=>e&&a.appendChild(e))),a};function K(e,t,i={}){let s,a,n,o,r;i.maxWait;const l=window;let h=!1,c=!1;const d=!t&&0!==t&&"function"==typeof l.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function u(t){const i=s,o=a;return s=a=void 0,n=e.apply(o,i),n}function p(e,t){return d?(l.cancelAnimationFrame(o),l.requestAnimationFrame(e)):setTimeout(e,t)}function m(e){const i=e-r;return void 0===r||i>=t||i<0||c}function g(){const e=Date.now();if(m(e))return v();o=p(g,function(e){return t-(e-r)}(e))}function v(e){return o=void 0,s?u():(s=a=void 0,n)}function f(...e){const i=Date.now(),l=m(i);return s=e,a=this,r=i,l&&void 0===o?(o=p(g,t),h?u():n):(void 0===o&&(o=p(g,t)),n)}return t=+t||0,f.cancel=function(){void 0!==o&&function(e){if(d)return l.cancelAnimationFrame(e);clearTimeout(e)}(o),s=r=a=o=void 0},f.flush=function(){return void 0===o?n:v()},f.pending=function(){return void 0!==o},f}let W=class{constructor(e){this.intl=e}getWeekNames(e=!1,t){const i=((e,t)=>e.slice(t).concat(e.slice(0,t)))(this.intl.dateFormatNames({nameType:null!=t?t:"short",type:"days"}),this.intl.firstDay());return e?[""].concat(i):i}};const U=(e,t)=>{const i=t;return u.createElement("td",{key:e,role:"gridcell",className:s.classNames(s.uCalendar.td({c:i,isEmpty:!0}))}," ")},Y=class e extends u.Component{constructor(){super(...arguments),this.intl=null,this.weekService=null,this.buildWeekNumber=(e,t)=>{if(!this.firstDate(e))return U(`week-cell-${t}`);const i=this.firstDate(e),s=this.getWeekNumber(i),a=`kendo-react-calendar-week-cell-${s}`,n={value:s,firstDate:i,weekDays:e,unstyled:this.props.unstyled,onClick:this.handleWeekCellClick};return this.props.weekCell?u.createElement(this.props.weekCell,{...n,key:a},s):u.createElement(C,{...n,key:a},s)},this.buildRow=e=>e.map(((e,t)=>{if(!e)return U(t);const i={"aria-selected":e.isSelected},s=`kendo-react-calendar-cell-${e.value.getTime()}`,a={...i,...e,isDisabled:!e.isInRange,view:this.props.activeView,showOtherMonthDays:this.props.showOtherMonthDays,allowReverse:this.props.allowReverse,unstyled:this.props.unstyled,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave};return this.props.cell?u.createElement(this.props.cell,{...a,key:s},e.formattedValue):u.createElement(k,{...a,key:s},e.formattedValue)})),this.firstDate=e=>{const t=this.firstWeekDateContext(e);return t?t.value:null},this.firstWeekDateContext=e=>{if(!this.weekNumber)return null;let t=0,i=e[t];for(;!i&&t<e.length;)i=e[++t];return i},this.handleClick=(e,t)=>{const{onChange:i}=this.props;if(i&&t){const s={value:a.cloneDate(e),target:this,nativeEvent:t&&t.nativeEvent,syntheticEvent:t};i.call(void 0,s)}},this.handleWeekCellClick=(e,t,i)=>{const{onWeekSelect:s}=this.props,a=t.findIndex((t=>t&&t.value===e));s&&i&&s.call(void 0,e,a,i)},this.handleMouseEnter=e=>{const{onCellEnter:t}=this.props;t&&t.call(void 0,a.cloneDate(e))},this.handleMouseLeave=e=>{const{onCellLeave:t}=this.props;t&&t.call(void 0,a.cloneDate(e))}}get min(){return this.props.min}get max(){return this.props.max}get isHorizontal(){return"horizontal"===this.props.direction}get isMonthView(){return this.props.activeView===x.month}get weekNumber(){return!(!this.props.showWeekNumbers||this.props.activeView!==x.month)}get selectedDate(){return void 0!==this.props.selectedDate?this.props.selectedDate:e.defaultProps.selectedDate}render(){const{service:e,weekDaysFormat:t,cellUID:i,focusedDate:a,bus:o,activeView:r,selectionRange:l,unstyled:h}=this.props,c=h&&h.uCalendar;this.intl=n.provideIntlService(this),this.weekService=new W(this.intl);const d=this.weekService.getWeekNames(this.weekNumber,t),p=e.rowLength(this.weekNumber),m=e.title(this.props.viewDate),g=R(),v=F(this.props.viewDate,g),f=e.data({cellUID:i,min:this.min,max:this.max,focusedDate:a,isActiveView:!o.canMoveDown(r),selectedDate:this.selectedDate,selectionRange:l,viewDate:v});return u.createElement(u.Fragment,null,this.isMonthView&&this.isHorizontal&&u.createElement("thead",{role:"rowgroup",className:s.classNames(s.uCalendar.thead({c:c}))},u.createElement("tr",{role:"row",className:s.classNames(s.uCalendar.tr({c:c}))},d.map(((e,t)=>u.createElement("th",{key:t,className:s.classNames(s.uCalendar.th({c:c}))},e))))),u.createElement("tbody",{role:"rowgroup",className:s.classNames(s.uCalendar.tbody({c:c}))},!this.isHorizontal&&u.createElement("tr",{role:"presentation",className:s.classNames(s.uCalendar.tr({c:c}))},u.createElement("th",{scope:"col",colSpan:p,className:s.classNames(s.uCalendar.caption({c:c}))},m)),f.map(((e,t)=>u.createElement("tr",{role:"row",className:s.classNames(s.uCalendar.tr({c:c})),key:t},this.weekNumber&&this.buildWeekNumber(e,t),this.buildRow(e))))))}getWeekNumber(e){return this.weekNumber&&this.intl?a.weekInYear(e,this.intl.firstDay()):null}};Y.propTypes={activeRangeEnd:i.oneOf(["start","end",null]),activeView:i.number.isRequired,cellUID:i.string.isRequired,direction:i.oneOf(["horizontal","vertical"]),focusedDate:i.instanceOf(Date).isRequired,max:i.instanceOf(Date).isRequired,min:i.instanceOf(Date).isRequired,onChange:i.func,selectedDate:i.oneOfType([i.instanceOf(Date),i.arrayOf(i.instanceOf(Date))]),showWeekNumbers:i.bool,showOtherMonthDays:i.bool,viewDate:i.instanceOf(Date).isRequired},Y.defaultProps={direction:"vertical",selectedDate:R(),showWeekNumbers:!1};let $=Y;n.registerForIntl($);const j=e=>{const{view:t,...i}=e;return u.createElement(o.Button,{type:"button",fillMode:"flat",themeColor:"primary",...i},e.children)},Z=class e extends u.Component{constructor(){super(...arguments),this.getTitle=()=>{if(!this.props.currentDate)return"";const e=this.rangeLength-1,t=this.props.service.title(this.props.currentDate),i=this.props.service.addToDate(this.props.currentDate,e);return e<1||!this.props.service.isInRange(i,this.min,this.max)?t:`${t} - ${this.props.service.title(i)}`},this.handleTitleClick=e=>{this.canMoveUp&&this.props.bus.moveUp(this.props.activeView,e)}}get min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}get rangeLength(){return void 0!==this.props.rangeLength?this.props.rangeLength:e.defaultProps.rangeLength}get canMoveUp(){return this.props.bus.canMoveUp(this.props.activeView)}render(){const{activeView:e,commands:t,unstyled:i}=this.props,a=i&&i.uCalendar,n=this.getTitle(),o={children:n,value:n,view:e,className:s.classNames(s.uCalendar.title({c:a})),onClick:this.handleTitleClick,disabled:!this.canMoveUp},r={headerTitleProps:o,commands:t},l=this.props.headerTitle?u.createElement(this.props.headerTitle,{...o},n):u.createElement(j,{...o},n),h=this.props.header?u.createElement(this.props.header,{...r}):u.createElement(u.Fragment,null,l,u.createElement("span",{className:s.classNames(s.uCalendar.spacer({c:a}))}),u.createElement("span",{className:s.classNames(s.uCalendar.nav({c:a}))},this.props.commands));return u.createElement("div",{className:s.classNames(s.uCalendar.header({c:a,vertical:this.props.verticalView}))},h)}};Z.propTypes={activeView:i.number.isRequired,currentDate:i.instanceOf(Date).isRequired,max:i.instanceOf(Date).isRequired,min:i.instanceOf(Date).isRequired,rangeLength:i.number},Z.defaultProps={rangeLength:1,min:T,max:V};let G=Z;n.registerForLocalization(G);const X="multiviewcalendar.prevView",J="multiviewcalendar.nextView",Q="dateinput.increment",ee="dateinput.decrement",te="dateinput.clear",ie="calendar.today",se="datepicker.toggleCalendar",ae="daterangepicker.swapStartEnd",ne="daterangepicker.start",oe="daterangepicker.end",re="daterangepicker.separator",le="datetimepicker.toggleDateTimeSelector",he="timepicker.now",ce="timepicker.selectNow",de="timepicker.cancel",ue="timepicker.set",pe="timepicker.toggleTimeSelector",me="timepicker.toggleClock",ge="datetimepicker.date",ve="datetimepicker.time",fe="datetimepicker.cancel",we="datetimepicker.set",be="daterangepicker.cancel",De="daterangepicker.set",ye={[ie]:"Today",[he]:"NOW",[ue]:"Set",[de]:"Cancel",[ge]:"Date",[ve]:"Time",[fe]:"Cancel",[we]:"Set",[be]:"Cancel",[De]:"Set",[ne]:"Start",[oe]:"End",[re]:" ",[ce]:"Select Now",[pe]:"Toggle TimeSelector",[me]:"Toggle Clock",[Q]:"Increase value",[ee]:"Decrease value",[te]:"clear",[se]:"Toggle calendar",[X]:"Navigate to previous view",[J]:"Navigate to next view",[ae]:"Swap start and end values",[le]:"Toggle date-time selector"},Se=class e extends u.Component{constructor(){super(...arguments),this.localization=null,this.handleClick=e=>{if(this.todayIsInRange&&this.props.onClick){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,value:z(R(),this.min,this.max),target:this,isTodayClick:!0};this.props.onClick.call(void 0,t)}}}get min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}get todayIsInRange(){return L(R(),a.getDate(this.min),a.getDate(this.max))}render(){const{disabled:e,tabIndex:t,unstyled:i}=this.props,a=i&&i.uCalendar;this.localization=n.provideLocalizationService(this);const r=this.localization.toLanguageString(ie,ye[ie]),l=s.classNames(s.uCalendar.today({c:a,disabled:e}));return u.createElement(o.Button,{className:l,onClick:this.handleClick,tabIndex:t,fillMode:"flat",themeColor:"base",role:"link"},r)}};Se.propTypes={max:i.instanceOf(Date).isRequired,min:i.instanceOf(Date).isRequired,onClick:i.func,disabled:i.bool},Se.defaultProps={min:T,max:V};let ke=Se;n.registerForLocalization(ke);const Ce=class e extends u.Component{constructor(e){super(e),this.virtualization=null,this.calendarView=null,this.table=null,this.intl=null,this.bottomOffset=0,this.viewOffset=0,this.viewHeight=0,this._element=null,this.isActive=!1,this.animateToIndex=!0,this.shouldScroll=!1,this.weekService=null,this.focusActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus"),t=this._element.querySelector(".k-state-pending-focus");e&&e[0]&&e[0].classList.remove("k-focus"),t&&t.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus");e&&e.classList.remove("k-focus"),this.isActive=!1},this.handleVirtualizationMount=e=>{if(this.virtualization=e,this.virtualization&&this.table){this.table.style.transform=`translateY(${this.viewOffset}px)`;const e=z(this.props.focusedDate,this.props.min,this.props.max),t=this.props.service.skip(e,this.props.min);this.virtualization.scrollToIndex(t)}},this.buildMonthView=(e,t)=>{const{unstyled:i}=this.props,a=i&&i.uCalendar;return u.createElement("table",{key:"calendar-view-list-weekdays",className:s.classNames(s.uCalendar.table({c:a,weekdays:!0})),role:"grid",tabIndex:this.props.tabIndex},u.createElement("colgroup",null,e.map(((e,t)=>u.createElement("col",{key:t})))),u.createElement("thead",{className:s.classNames(s.uCalendar.thead({c:a}))},u.createElement("tr",{className:s.classNames(s.uCalendar.tr({c:a}))},t.map(((e,t)=>u.createElement("th",{key:t,className:s.classNames(s.uCalendar.th({c:a}))},e))))))},this.buildDates=(e,t)=>{const i=this.props.cellUID,{unstyled:a}=this.props,n=a&&a.uCalendar;return u.createElement("table",{className:s.classNames(s.uCalendar.table({c:n})),ref:e=>this.table=e,role:"grid",tabIndex:this.props.tabIndex,"aria-activedescendant":i+this.props.focusedDate.getTime()},u.createElement("colgroup",null,e.map(((e,t)=>u.createElement("col",{key:t})))),t.map((e=>u.createElement($,{ref:e=>{this.calendarView||(this.calendarView=e)},key:e.getTime(),activeView:this.props.activeView,viewDate:e,min:this.props.min,max:this.props.max,cellUID:i,focusedDate:this.props.focusedDate,cell:this.props.cell,selectedDate:this.props.value,showWeekNumbers:this.weekNumber,onChange:this.handleDateChange,bus:this.props.bus,service:this.props.service,weekCell:this.props.weekCell,showOtherMonthDays:this.props.showOtherMonthDays,unstyled:a}))))},this.calculateHeights=()=>{if(!this.props.dom)return;const e=this.props.activeView===x.month?this.props.dom.scrollableContentHeight:this.props.dom.scrollableYearContentHeight;this.bottomOffset=e-this.props.dom.viewHeight(this.props.activeView),this.viewOffset=-1*this.props.dom.headerHeight,this.viewHeight=this.props.dom.viewHeight(this.props.activeView)||1},this.getTake=(e,t)=>Math.min(t-e,this.take),this.handleScrollAction=({index:e,scrollAction:t,pageAction:i})=>{const s=i?i.skip:this.state.skip;if((this.state.index!==e||this.state.skip!==s)&&this.setState({index:e,skip:s}),this.table&&t){const e=`translateY(${t.offset}px)`;this.table.style.transform=e}},this.handleTodayClick=e=>{this.shouldScroll=!0,this.handleDateChange.call(void 0,e,!0)},this.handleDateChange=(e,t=!1)=>{const{onChange:i}=this.props;if(i){const s={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:a.cloneDate(e.value),target:this,isTodayClick:t};i.call(void 0,s)}},this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate,this.state={skip:this.props.service.skip(this.props.focusedDate,this.props.min),index:this.props.service.skip(this.props.focusedDate,this.props.min)}}get element(){return this._element}get weekNames(){return this.intl=n.provideIntlService(this),this.weekService=new W(this.intl),this.weekService.getWeekNames(this.weekNumber,this.props.weekDaysFormat)}get weekNumber(){return!(!this.props.showWeekNumbers||this.props.activeView!==x.month)}get take(){return void 0!==this.props.take?this.props.take:e.defaultProps.take}get animate(){return!(!this.props.smoothScroll||!this.animateToIndex)}get todayIsInRange(){return L(R(),a.getDate(this.props.min),a.getDate(this.props.max))}componentDidUpdate(e,t){this.shouldScroll=!1,void 0!==this.indexToScroll&&this.virtualization&&this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](this.indexToScroll),this.isActive&&this.focusActiveDate(),this.lastView=this.props.activeView,this.indexToScroll=void 0}render(){const{activeView:e,min:t,max:i,service:n,unstyled:o}=this.props,r=o&&o.uCalendar;this.calculateHeights();const l=this.lastView!==e,h=z(this.props.focusedDate,t,i),c=l?n.skip(h,t):this.state.skip,d=n.total(t,i),p=this.getTake(c,d),m=n.addToDate(t,c),g=n.addToDate(t,this.state.index),v=new Array(n.rowLength(this.weekNumber)).fill(""),f=e!==this.lastView;this.animateToIndex=!f,(f||!a.isEqualDate(this.lastFocus,h)||this.shouldScroll||!this.props.shouldScroll||this.props.shouldScroll())&&(this.indexToScroll=this.props.service.skip(h,this.props.min)),this.lastFocus=h;const w=s.classNames(s.uCalendar.view({c:r,month:e===x.month,year:e===x.year,decade:e===x.decade,century:e===x.century})),b=this.buildDates(v,n.datesList(m,p)),D=u.createElement(u.Fragment,null,u.createElement(G,{key:"calendar-view-list-header",currentDate:g,min:this.props.min,max:this.props.max,activeView:this.props.activeView,bus:this.props.bus,service:this.props.service,headerTitle:this.props.headerTitle,header:this.props.header,unstyled:o,commands:u.createElement(ke,{min:this.props.min,max:this.props.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange,tabIndex:this.props.tabIndex,unstyled:o})}),this.props.activeView===x.month&&this.buildMonthView(v,this.weekNames),u.createElement(S,{key:"calendar-view-list-content",skip:c,take:this.take,total:d,itemHeight:this.viewHeight,topOffset:this.viewOffset,bottomOffset:this.bottomOffset,scrollOffsetSize:this.viewOffset,maxScrollDifference:this.viewHeight,onScroll:this.props.onScroll,onScrollAction:this.handleScrollAction,onMount:this.handleVirtualizationMount,children:b,tabIndex:this.props.tabIndex}));return u.createElement("div",{ref:e=>{this._element=e},className:w},this.props.dom.didCalculate?D:null)}};Ce.propTypes={activeView:i.number.isRequired,bottomOffset:i.number,cellUID:i.string.isRequired,focusedDate:i.instanceOf(Date).isRequired,max:i.instanceOf(Date).isRequired,min:i.instanceOf(Date).isRequired,onChange:i.func,showWeekNumbers:i.bool,smoothScroll:i.bool,take:i.number,value:i.instanceOf(Date),viewHeight:i.number,viewOffset:i.number,weekDaysFormat:i.oneOf(["short","abbreviated","narrow"]),tabIndex:i.number},Ce.defaultProps={take:5,showWeekNumbers:!1,weekDaysFormat:"short",smoothScroll:!0};let xe=Ce;n.registerForIntl(xe);const Ie=e=>{const{isRangeStart:t,value:i,text:a,...n}=e,o=s.useUnstyled(),r=o&&o.uCalendar;return u.createElement("li",{...n,onClick:t=>{const{onClick:s}=e;s&&s.call(void 0,i,t)}},u.createElement("span",{className:s.classNames(s.uCalendar.navigationMarker({c:r,isRangeStart:t}))},e.children))},Me=class e extends u.Component{constructor(e){super(e),this.virtualization=null,this.list=null,this.itemHeight=0,this.topOffset=0,this.maxViewHeight=0,this.bottomOffset=0,this.handleVirtualizationMount=e=>{if(this.virtualization=e,this.virtualization&&this.list){this.list.style.transform=`translateY(${this.topOffset}px)`;const e=z(this.props.focusedDate,this.props.min,this.props.max),t=this.props.service.skip(e,this.props.min);this.virtualization.scrollToIndex(t)}},this.buildNavigationItem=e=>{const t=this.props.service.navigationTitle(e),i=this.props.service.isRangeStart(e),s=`kendo-react-calendar-nav-item-${e.getTime()}`,a={text:t,value:e,isRangeStart:i,view:this.props.activeView,onClick:this.handleDateChange};return this.props.navigationItem?u.createElement(this.props.navigationItem,{...a,key:s},t):u.createElement(Ie,{...a,key:s},t)},this.calculateHeights=()=>{const e=this.props.dom.calendarHeight;this.itemHeight=this.props.dom.navigationItemHeight||1,this.maxViewHeight=this.props.dom.monthViewHeight,this.topOffset=(e-this.itemHeight)/2,this.bottomOffset=e-this.itemHeight},this.handleDateChange=(e,t)=>{const{onChange:i}=this.props;if(i&&t){const s={value:a.cloneDate(e),target:this,nativeEvent:t&&t.nativeEvent,syntheticEvent:t};i.call(void 0,s)}},this.handleScrollAction=({scrollAction:e,pageAction:t})=>{const i=t?t.skip:this.state.skip;if(this.state.skip!==i&&this.setState({skip:i}),this.list&&e){const t=`translateY(${e.offset}px)`;this.list.style.transform=t}},this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate;const t=this.props.service.skip(this.props.focusedDate,this.props.min),i=this.props.service.total(this.props.min,this.props.max);this.state={skip:t-this.getTake(t,i)>0?t:0}}get take(){return void 0!==this.props.take?this.props.take:e.defaultProps.take}componentDidUpdate(e,t){void 0!==this.indexToScroll&&this.virtualization&&this.virtualization.scrollToIndex(this.indexToScroll),this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate,this.indexToScroll=void 0}render(){const{activeView:e,min:t,max:i,service:n,unstyled:o}=this.props;this.calculateHeights();const r=o&&o.uCalendar,l=this.lastView!==e,h=z(this.props.focusedDate,t,i),c=l?n.skip(h,t):this.state.skip,d=n.total(t,i),p=this.getTake(c,d),m=n.addToDate(t,c),g=n.datesList(m,p);(e!==this.lastView||!a.isEqual(h,this.lastFocus))&&(this.indexToScroll=n.skip(h,t));const v=u.createElement(S,{skip:c,take:this.take,total:d,itemHeight:this.itemHeight,topOffset:this.topOffset,bottomOffset:this.bottomOffset,onScroll:this.props.onScroll,maxScrollDifference:this.maxViewHeight,onScrollAction:this.handleScrollAction,onMount:this.handleVirtualizationMount,tabIndex:this.props.tabIndex,unstyled:o},u.createElement("ul",{ref:e=>{this.list=e},className:s.classNames(s.uCalendar.ul({c:r}))},g.map((e=>this.buildNavigationItem(e)))));return u.createElement("div",{className:s.classNames(s.uCalendar.navigation({c:r}))},u.createElement("span",{className:s.classNames(s.uCalendar.navigationHighlight({c:r}))}),this.props.dom.didCalculate?v:null)}getTake(e,t){return Math.min(t-e,this.take)}};Me.propTypes={activeView:i.number.isRequired,focusedDate:i.instanceOf(Date).isRequired,max:i.instanceOf(Date).isRequired,min:i.instanceOf(Date).isRequired,onChange:i.func,take:i.number,tabIndex:i.number},Me.defaultProps={take:30};let Oe=Me;var Ee=(e=>(e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.Up=2]="Up",e[e.Down=3]="Down",e[e.PrevView=4]="PrevView",e[e.NextView=5]="NextView",e[e.FirstInView=6]="FirstInView",e[e.LastInView=7]="LastInView",e[e.LowerView=8]="LowerView",e[e.UpperView=9]="UpperView",e))(Ee||{});const Te=[[]],Ve={[Ee.Left]:e=>a.addDecades(e,-1),[Ee.Up]:e=>a.addDecades(e,-5),[Ee.Right]:e=>a.addDecades(e,1),[Ee.Down]:e=>a.addDecades(e,5),[Ee.PrevView]:e=>a.addCenturies(e,-1),[Ee.NextView]:e=>a.addCenturies(e,1),[Ee.FirstInView]:e=>a.firstDecadeOfCentury(e),[Ee.LastInView]:e=>a.lastDecadeOfCentury(e)};let Pe=class{addToDate(e,t){return a.addCenturies(e,t)}datesList(e,t){return H(0,t).map((t=>a.addCenturies(e,t)))}data(e){const{cellUID:t,focusedDate:i,isActiveView:s,max:n,min:o,selectedDate:r,selectionRange:l=I,viewDate:h}=e;if(!h)return Te;const c=H(0,4),d=a.firstDecadeOfCentury(h),u=a.lastDecadeOfCentury(h),p=R();return H(0,3).map((e=>{const h=a.addDecades(d,4*e);return c.map((e=>{const c=this.normalize(a.addDecades(h,e),o,n),m=this.isEqual(c,l.start),g=this.isEqual(c,l.end),v=!m&&!g&&_(c,l),f=s&&(Array.isArray(r)?this.isSelectedFromArray(c,r,o,n):L(r,o,n)&&this.isEqual(c,r));return A(c,d,u)?{formattedValue:this.value(c),id:`${t}${c.getTime()}`,isFocused:this.isEqual(c,i),isSelected:f,isWeekend:!1,isInRange:L(c,o,n),isRangeStart:m,isRangeMid:v,isRangeEnd:g,isRangeSplitEnd:v&&this.isEqual(c,u),isRangeSplitStart:v&&this.isEqual(c,d),isToday:this.isEqual(c,p),title:this.cellTitle(c),value:c}:null}))}))}isSelectedFromArray(e,t,i,s){let a=!1;return t.forEach((t=>{L(e,i,s)&&this.isEqual(e,t)&&(a=!0)})),a}isEqual(e,t){return!(!e||!t)&&a.firstYearOfDecade(e).getFullYear()===a.firstYearOfDecade(t).getFullYear()}isInArray(e,t){if(!t.length)return!1;const i=e.getFullYear();return t[0].getFullYear()<=i&&i<=t[t.length-1].getFullYear()+99}isInRange(e,t,i){const s=a.firstYearOfDecade(e).getFullYear(),n=!t||a.firstYearOfDecade(t).getFullYear()<=s,o=!i||s<=a.firstYearOfDecade(i).getFullYear();return n&&o}isInSameView(e,t){return 0===a.durationInCenturies(e,t)}isRangeStart(e){return e.getFullYear()%1e3==0}move(e,t){const i=Ve[t];return i?i(e):e}cellTitle(e){return a.firstYearOfDecade(e).getFullYear().toString()}navigationTitle(e){return e?a.firstDecadeOfCentury(e).getFullYear().toString():""}title(e){return e?`${a.firstDecadeOfCentury(e).getFullYear()} - ${a.lastDecadeOfCentury(e).getFullYear()}`:""}rowLength(e){return 4}skip(e,t){return a.durationInCenturies(t,e)}total(e,t){return a.durationInCenturies(e,t)+1}value(e){return e?a.firstYearOfDecade(e).getFullYear().toString():""}viewDate(e,t,i=1){return a.durationInCenturies(e,t)<i?a.addCenturies(e,-1):e}normalize(e,t,i){return e<t&&this.isEqual(e,t)?a.cloneDate(t):e>i&&this.isEqual(e,i)?a.cloneDate(i):e}};const Ne=[[]],Fe={[Ee.Left]:e=>a.addYears(e,-1),[Ee.Up]:e=>a.addYears(e,-5),[Ee.Right]:e=>a.addYears(e,1),[Ee.Down]:e=>a.addYears(e,5),[Ee.PrevView]:e=>a.addDecades(e,-1),[Ee.NextView]:e=>a.addDecades(e,1),[Ee.FirstInView]:e=>a.firstYearOfDecade(e),[Ee.LastInView]:e=>a.lastYearOfDecade(e)};let Re=class{addToDate(e,t){return a.addDecades(e,t)}datesList(e,t){return H(0,t).map((t=>a.addDecades(e,t)))}data(e){const{cellUID:t,focusedDate:i,isActiveView:s,max:n,min:o,selectedDate:r,selectionRange:l=I,viewDate:h}=e;if(!h)return Ne;const c=H(0,4),d=a.firstYearOfDecade(h),u=a.lastYearOfDecade(h),p=R();return H(0,3).map((e=>{const h=a.addYears(d,4*e);return c.map((e=>{const c=this.normalize(a.addYears(h,e),o,n),m=this.isEqual(c,l.start),g=this.isEqual(c,l.end),v=!m&&!g&&_(c,l),f=s&&(Array.isArray(r)?this.isSelectedFromArray(c,r,o,n):L(r,o,n)&&this.isEqual(c,r));return A(c,d,u)?{formattedValue:this.value(c),id:`${t}${c.getTime()}`,isFocused:this.isEqual(c,i),isSelected:f,isWeekend:!1,isInRange:L(c,o,n),isRangeStart:m,isRangeMid:v,isRangeEnd:g,isRangeSplitEnd:v&&this.isEqual(c,u),isRangeSplitStart:v&&this.isEqual(c,d),isToday:this.isEqual(c,p),title:this.cellTitle(c),value:c}:null}))}))}isSelectedFromArray(e,t,i,s){let a=!1;return t.forEach((t=>{L(e,i,s)&&this.isEqual(e,t)&&(a=!0)})),a}isEqual(e,t){return!(!e||!t)&&e.getFullYear()===t.getFullYear()}isInArray(e,t){if(!t.length)return!1;const i=e.getFullYear();return t[0].getFullYear()<=i&&i<=t[t.length-1].getFullYear()+9}isInRange(e,t,i){const s=e.getFullYear(),a=!t||t.getFullYear()<=s,n=!i||s<=i.getFullYear();return a&&n}isRangeStart(e){return e.getFullYear()%100==0}isInSameView(e,t){return 0===a.durationInDecades(e,t)}move(e,t){const i=Fe[t];return i?i(e):e}cellTitle(e){return e.getFullYear().toString()}navigationTitle(e){return e?a.firstYearOfDecade(e).getFullYear().toString():""}title(e){return e?`${a.firstYearOfDecade(e).getFullYear()} - ${a.lastYearOfDecade(e).getFullYear()}`:""}rowLength(e){return 4}skip(e,t){return a.durationInDecades(t,e)}total(e,t){return a.durationInDecades(e,t)+1}value(e){return e?e.getFullYear().toString():""}viewDate(e,t,i=1){return a.durationInDecades(e,t)<i?a.addDecades(e,-1):e}normalize(e,t,i){return e<t&&this.isEqual(e,t)?a.cloneDate(t):e>i&&this.isEqual(e,i)?a.cloneDate(i):e}};const Le=[[]],Be={[Ee.Left]:e=>a.addDays(e,-1),[Ee.Up]:e=>a.addWeeks(e,-1),[Ee.Right]:e=>a.addDays(e,1),[Ee.Down]:e=>a.addWeeks(e,1),[Ee.PrevView]:e=>a.addMonths(e,-1),[Ee.NextView]:e=>a.addMonths(e,1),[Ee.FirstInView]:e=>a.firstDayOfMonth(e),[Ee.LastInView]:e=>a.lastDayOfMonth(e)};class _e{constructor(e){this.intl=e}addToDate(e,t){return a.addMonths(e,t)}datesList(e,t){return H(0,t).map((t=>a.addMonths(e,t)))}data(e){const{cellUID:t,focusedDate:i,isActiveView:s,max:n,min:o,selectedDate:r,selectionRange:l=I,viewDate:h}=e;if(!h)return Le;const c=a.firstDayOfMonth(h),d=a.lastDayOfMonth(h),u=a.dayOfWeek(c,this.intl.firstDay(),-1),p=H(0,7),m=R();return H(0,6).map((e=>{const h=a.addDays(u,7*e);return p.map((e=>{const u=this.normalize(a.addDays(h,e),o,n),p=u<c||u>d,g=this.isEqual(u,l.start),v=this.isEqual(u,l.end),f=!g&&!v&&_(u,l),w=s&&(Array.isArray(r)?this.isSelectedFromArray(u,r,o,n):L(r,o,n)&&this.isEqual(u,r));return{formattedValue:this.value(u),id:`${t}${u.getTime()}`,isFocused:this.isEqual(u,i),isSelected:w,isInRange:L(u,o,n),isWeekend:this.isWeekend(u),isRangeStart:g,isRangeMid:f,isRangeEnd:v,isRangeSplitStart:f&&this.isEqual(u,c),isRangeSplitEnd:f&&this.isEqual(u,d),isToday:this.isEqual(u,m),title:this.cellTitle(u),value:u,isOtherMonth:p}}))}))}isEqual(e,t){return!(!e||!t)&&a.getDate(e).getTime()===a.getDate(t).getTime()}isSelectedFromArray(e,t,i,s){let a=!1;return t.forEach((t=>{L(e,i,s)&&this.isEqual(e,t)&&(a=!0)})),a}isInArray(e,t){return!!t.length&&a.firstDayOfMonth(t[0])<=e&&e<=a.lastDayOfMonth(t[t.length-1])}isInRange(e,t,i){const s=a.getDate(e),n=!t||a.getDate(t)<=s,o=!i||s<=a.getDate(i);return n&&o}isInSameView(e,t){return 0===a.durationInMonths(e,t)}isRangeStart(e){return!e.getMonth()}move(e,t){const i=Be[t];return i?i(e):e}cellTitle(e){return this.intl.formatDate(e,"D")}navigationTitle(e){return e?this.isRangeStart(e)?e.getFullYear().toString():this.abbrMonthNames()[e.getMonth()]:""}title(e){return`${this.wideMonthNames()[e.getMonth()]} ${e.getFullYear()}`}rowLength(e){return 7+(e?1:0)}skip(e,t){return a.durationInMonths(t,e)}total(e,t){return a.durationInMonths(e,t)+1}value(e){return e?e.getDate().toString():""}viewDate(e,t,i=1){return a.durationInMonths(e,t)<i?a.addMonths(e,-1):e}isWeekend(e){const t=e.getDay();return 6===t||0===t}abbrMonthNames(){return this.intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(e,t,i){return e<t&&this.isEqual(e,t)?a.getDate(t):e>i&&this.isEqual(e,i)?a.getDate(i):e}wideMonthNames(){return this.intl.dateFormatNames({nameType:"wide",type:"months",standAlone:!0})}}const He=[[]],Ae={[Ee.Left]:e=>a.addMonths(e,-1),[Ee.Up]:e=>a.addMonths(e,(e=>e>4?-5:e<2?-2:-7)(e.getMonth())),[Ee.Right]:e=>a.addMonths(e,1),[Ee.Down]:e=>a.addMonths(e,(e=>e<7?5:e<10?7:2)(e.getMonth())),[Ee.PrevView]:e=>a.addYears(e,-1),[Ee.NextView]:e=>a.addYears(e,1),[Ee.FirstInView]:e=>a.firstMonthOfYear(e),[Ee.LastInView]:e=>a.lastMonthOfYear(e)};class ze{constructor(e){this._intl=e}addToDate(e,t){return a.addYears(e,t)}datesList(e,t){return H(0,t).map((t=>a.addYears(e,t)))}data(e){const{cellUID:t,focusedDate:i,isActiveView:s,max:n,min:o,selectedDate:r,selectionRange:l=I,viewDate:h}=e;if(!h)return He;const c=this.abbrMonthNames(),d=a.firstMonthOfYear(h),u=a.lastMonthOfYear(h),p=d.getFullYear(),m=H(0,4),g=R();return H(0,3).map((e=>{const h=a.addMonths(d,4*e);return m.map((e=>{const m=this.normalize(a.addMonths(h,e),o,n);if(p<m.getFullYear())return null;const v=this.isEqual(m,l.start),f=this.isEqual(m,l.end),w=!v&&!f&&_(m,l),b=s&&(Array.isArray(r)?this.isSelectedFromArray(m,r,o,n):L(r,o,n)&&this.isEqual(m,r));return{formattedValue:c[m.getMonth()],id:`${t}${m.getTime()}`,isFocused:this.isEqual(m,i),isSelected:b,isInRange:L(m,o,n),isWeekend:!1,isRangeStart:v,isRangeMid:w,isRangeEnd:f,isRangeSplitEnd:w&&this.isEqual(m,u),isRangeSplitStart:w&&this.isEqual(m,d),isToday:this.isEqual(m,g),title:this.cellTitle(m),value:m}}))}))}isSelectedFromArray(e,t,i,s){let a=!1;return t.forEach((t=>{L(e,i,s)&&this.isEqual(e,t)&&(a=!0)})),a}isEqual(e,t){return!(!e||!t)&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth())}isInArray(e,t){if(!t.length)return!1;const i=e.getFullYear();return t[0].getFullYear()<=i&&i<=t[t.length-1].getFullYear()}isInRange(e,t,i){const s=a.createDate(e.getFullYear(),e.getMonth(),1),n=!t||a.createDate(t.getFullYear(),t.getMonth(),1)<=s,o=!i||s<=a.createDate(i.getFullYear(),i.getMonth(),1);return n&&o}isInSameView(e,t){return 0===a.durationInYears(e,t)}isRangeStart(e){return e.getFullYear()%10==0}move(e,t){const i=Ae[t];return i?i(e):e}cellTitle(e){return`${e.getFullYear()} ${this.value(e)}`}navigationTitle(e){return this.title(e)}title(e){return e?e.getFullYear().toString():""}rowLength(e){return 4}skip(e,t){return a.durationInYears(t,e)}total(e,t){return a.durationInYears(e,t)+1}value(e){return e?this.abbrMonthNames()[e.getMonth()]:""}viewDate(e,t,i=1){return a.durationInYears(e,t)<i?a.addYears(e,-1):e}abbrMonthNames(){return this._intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(e,t,i){return e<t&&this.isEqual(e,t)?a.cloneDate(t):e>i&&this.isEqual(e,i)?a.cloneDate(i):e}}const qe={[x.month]:_e,[x.year]:ze,[x.decade]:Re,[x.century]:Pe};let Ke=class{constructor(e){this.bottom=x.month,this.top=x.century,this.onViewChanged=e}configure(e,t){this.bottom=e,this.top=t}service(e,t){return new qe[`${e}`](t)}moveDown(e,t){this.move(e,-1,t)}moveUp(e,t){this.move(e,1,t)}moveToBottom(e){e!==this.bottom&&this.onViewChanged({view:this.bottom})}canMoveDown(e){return this.bottom<e}canMoveUp(e){return e<this.top}clamp(e){return e<this.bottom?this.bottom:e>this.top?this.top:e}move(e,t,i){const s=this.clamp(((e,t)=>{const i=x[x[e+t]];return void 0!==i?i:e})(e,t));s!==e&&this.onViewChanged({view:s},i)}},We=class{constructor(){this.calendarHeight=0,this.headerHeight=0,this.monthViewHeight=0,this.yearViewHeight=0,this.decadeViewHeight=0,this.centuryViewHeight=0,this.navigationItemHeight=0,this.scrollableContentHeight=0,this.scrollableYearContentHeight=0,this.calendarWidth=0,this.monthViewWidth=0,this.yearViewWidth=0,this.decadeViewWidth=0,this.centuryViewWidth=0,this.scrollableContentWidth=0,this.didCalculate=!1,this.hostContainer=null}ensureHeights(){void 0===this.calendarHeight&&this.calculateHeights()}calculateHeights(e){if(!s.canUseDOM)return;const t=q("div"),i=q("ul"),a=q("li"),n=q("td"),o=q("th"),r=q("tr"),l=q("tbody"),h=q("thead"),c=q("table"),d=()=>t('\n <span class="k-button k-button-md k-button-rectangle k-button-solid k-button-solid-base k-button-flat k-calendar-title">\n <span className="k-button-text">March 2017</span>\n </span>\n <span class="k-spacer"></span>\n <span class="k-calendar-nav k-hstack"><button class="k-calendar-nav-today">TODAY</button></span>\n ',"k-calendar-header k-hstack"),u=(e,t)=>new Array(e).fill("1").map(t),p=e=>t(e,"k-content k-scrollable"),m=(()=>{let e;return()=>s.canUseDOM?(e||(e=t([p([i([a("<span>FEB</span>")])])],"k-calendar-navigation",{left:"0px",position:"absolute"})),e):null})(),g=({cells:e,rows:i},a,m)=>{let g;return()=>s.canUseDOM?(g||(g=((e,i,s)=>t(s?[d(),c([h([r([o("MO","k-calendar-th")],"k-calendar-tr")],"k-calendar-thead")],"k-calendar-table k-calendar-weekdays"),p([e,e])]:[d(),p([e,e])],i,{left:"-10000px",position:"absolute"}))(((e,t=1)=>c([l([r([n("1","k-calendar-td k-alt")])].concat(u(e,(()=>r(u(t,(e=>n(`<span class="k-link">${e}</span>`,"k-calendar-td"))),"k-calendar-tr")))),"k-calendar-tbody")],"k-calendar-table"))(i,e),a,m)),g):null},v=e=>e.querySelector(".k-scrollable"),f=e=>{const t=v(e);return t.className=`${t.className} k-scrollable-horizontal`,e},w=g({cells:7,rows:6},"k-calendar-view k-calendar-monthview k-vstack",!0),b=g({cells:5,rows:3},"k-calendar-view k-calendar-yearview",!1),D=g({cells:5,rows:2},"k-calendar-view k-calendar-decadeview",!1),y=e=>parseFloat(window.getComputedStyle(e).height)||e.offsetHeight,S=e=>{const t=window.getComputedStyle(e);return parseFloat(t.width)+parseFloat(t.paddingLeft)+parseFloat(t.paddingRight)||e.offsetWidth},k=e=>e.querySelector("tbody");this.didCalculate=!0,e&&(this.hostContainer=e),this.batch(w(),(e=>{const t=k(e);this.calendarHeight=y(e),this.monthViewHeight=y(t),this.headerHeight=y(t.children[0]),this.scrollableContentHeight=y(v(e))})),this.batch(f(w()),(e=>{const t=k(e);this.calendarWidth=S(e),this.monthViewWidth=S(t),this.scrollableContentWidth=S(v(e))})),this.batch(b(),(e=>{this.yearViewHeight=y(k(e)),this.scrollableYearContentHeight=y(v(e))})),this.batch(f(b()),(e=>{this.yearViewWidth=S(k(e))})),this.batch(D(),(e=>{this.decadeViewHeight=y(k(e)),this.centuryViewHeight=this.decadeViewHeight})),this.batch(f(D()),(e=>{this.decadeViewWidth=S(k(e)),this.centuryViewWidth=this.decadeViewWidth})),this.batch(m(),(e=>{this.navigationItemHeight=y(e.querySelector("li"))}))}viewHeight(e){return this.viewDimension(e,"height")}viewWidth(e){return this.viewDimension(e,"width")}viewDimension(e,t){const i="height"===t?"ViewHeight":"ViewWidth";switch(e){case x.month:return this[`month${i}`];case x.year:return this[`year${i}`];case x.decade:return this[`decade${i}`];case x.century:return this[`century${i}`];default:return 1}}batch(e,t){const i=this.hostContainer||document.body,s=i.appendChild(e);t(s),i.removeChild(s)}};const Ue={33:Ee.PrevView,34:Ee.NextView,35:Ee.LastInView,36:Ee.FirstInView,37:Ee.Left,38:Ee.Up,39:Ee.Right,40:Ee.Down,"meta+38":Ee.UpperView,"meta+40":Ee.LowerView};let Ye=class{constructor(e){this.bus=e}action(e){const t=`${e.ctrlKey||e.metaKey?"meta+":""}${e.keyCode}`;return Ue[t]}move(e,t,i,s,a){return s?t===Ee.UpperView&&this.bus.canMoveUp(i)?(this.bus.moveUp(i,a),e):t===Ee.LowerView&&this.bus.canMoveDown(i)?(this.bus.moveDown(i,a),e):s.move(e,t):e}};class $e{constructor(e){this.dom=e,this.divideByMagnitude=null,this.powerByMagnitude=null,this.navigator=null,this.view=null,this.monthScrolled=!1,this.navScrolled=!1}configure(e){const t=Math.max(this.dom.viewHeight(e)/this.dom.navigationItemHeight,1);this.divideByMagnitude=(e=>t=>Math.floor(t/e))(t),this.powerByMagnitude=(e=>t=>t*e)(t)}sync(e,t,i){if(e&&t){if(this.navigator=e,this.view=t,i.target===this.navigator.element){if(this.monthScrolled)return void(this.monthScrolled=!1);this.navScrolled=!0,this.scrollSiblingOf(this.navigator.element)}if(i.target===this.view.element){if(this.navScrolled)return void(this.navScrolled=!1);this.monthScrolled=!0,this.scrollSiblingOf(this.view.element)}}}scrollSiblingOf(e){const t=this.siblingComponent(e),i=this.calculateScroll(t,e.scrollTop);t.scrollTo(i)}siblingComponent(e){return this.navigator.element===e?this.view:this.navigator}calculateScroll(e,t){const i=e===this.navigator?this.divideByMagnitude:this.powerByMagnitude;return i?i(t):0}}const je=e=>e?e.virtualization:null,Ze=(e=Xe.defaultProps.min,t=Xe.defaultProps.max,i,s)=>void 0!==s?null!==s&&L(a.getDate(s),e,t)?s:null:null!==i&&L(a.getDate(i),e,t)?i:null,Ge=class e extends u.Component{constructor(t){super(t),this.scrollSyncService=null,this.focusedDate=null,this.Navigation=null,this.calendarViewList=null,this._element=null,this.intl=null,this.service=null,this.isActive=!1,this.didNavigationChange=!1,this.focus=()=>{this._element&&this._element.focus()},this.shouldScroll=()=>this.didNavigationChange,this.handleScroll=e=>{this.scrollSyncService&&this.scrollSyncService.sync(je(this.Navigation),je(this.calendarViewList),e)},this.handleNavigationChange=e=>{if(this.props.disabled)return;this.didNavigationChange=!0;const t=a.cloneDate(e.value);this.setState({focusedDate:t})},this.handleViewChange=({view:e})=>{this.scrollSyncService&&this.scrollSyncService.configure(e),this.setState({activeView:e})},this.handleDateChange=e=>{const t=a.cloneDate(e.value),i=a.cloneDate(e.value),s=this.bus.canMoveDown(this.state.activeView);if(this.props.disabled)return;if(s){if(!e.isTodayClick)return this.bus.moveDown(this.state.activeView,e.syntheticEvent),void this.setState({focusedDate:i});this.bus.moveToBottom(this.state.activeView)}this.setState({value:t,focusedDate:i}),this.valueDuringOnChange=t;const{onChange:n}=this.props;if(n){const i={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:t,target:this};n.call(void 0,i)}this.valueDuringOnChange=void 0},this.handleFocus=e=>{if(this.isActive=!0,!this.calendarViewList)return;this.calendarViewList.focusActiveDate();const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleBlur=e=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.handleKeyDown=e=>{const{keyCode:t,ctrlKey:i,metaKey:n}=e;if(this.focusedDate&&this.service){if(84===t&&this.setState({focusedDate:R()}),(i||n)&&(t===s.Keys.left||t===s.Keys.right)){if(this.props.disabled)return;this.didNavigationChange=!0,31===this.focusedDate.getDate()&&this.focusedDate.setDate(30);const e=t===s.Keys.left?this.focusedDate.getMonth()-1:this.focusedDate.getMonth()+1,i=new Date(this.focusedDate.setMonth(e)),n=a.cloneDate(i);this.setState({focusedDate:n})}if(t===s.Keys.enter){if(null!==this.value&&a.isEqualDate(this.focusedDate,this.value)){const e=z(this.focusedDate,this.min,this.max);je(this.calendarViewList).scrollToIndex(this.service.skip(e,this.min))}const t={syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(t)}else{const t=z(this.navigation.move(this.focusedDate,this.navigation.action(e),this.state.activeView,this.service,e),this.min,this.max);if(a.isEqualDate(this.focusedDate,t))return;this.setState({focusedDate:t})}e.preventDefault()}},this.handleMouseDown=e=>{e.preventDefault()},this.handleClick=e=>{this._element&&this._element.focus({preventScroll:!0})},s.validatePackage(p);const i=Ze(this.min,this.max,this.props.defaultValue||e.defaultProps.defaultValue,this.props.value);this.state={value:i,activeView:O(x[t.defaultActiveView],this.bottomView,this.topView),focusedDate:z(t.focusedDate||i||R(),this.min,this.max)},this.dom=new We,this.bus=new Ke(this.handleViewChange),this.navigation=new Ye(this.bus),this.oldValue=i}get cellUID(){return this.props.id+"-cell-uid"}get id(){return this.props.id+"-id"}get element(){return this._element}get value(){return void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.props.value?this.props.value:this.state.value}get min(){return a.getDate(void 0!==this.props.min?this.props.min:e.defaultProps.min)}get max(){return a.getDate(void 0!==this.props.max?this.props.max:e.defaultProps.max)}get bottomView(){return x[void 0!==this.props.bottomView?this.props.bottomView:e.defaultProps.bottomView]}get topView(){return x[void 0!==this.props.topView?this.props.topView:e.defaultProps.topView]}componentDidMount(){Promise.resolve().then((()=>{s.setScrollbarWidth(),this._element&&(this.dom.calculateHeights(this._element),this.scrollSyncService=new $e(this.dom),this.scrollSyncService.configure(this.state.activeView),this.forceUpdate())}))}componentDidUpdate(e,t){s.setScrollbarWidth(),t.activeView!==this.state.activeView&&this.scrollSyncService&&this.scrollSyncService.configure(this.state.activeView),this.calendarViewList&&(this.isActive?this.calendarViewList.focusActiveDate:this.calendarViewList.blurActiveDate)(),this.didNavigationChange=!1,this.isActive&&(this.oldValue=this.value)}render(){const{_ref:t,unstyled:i,bottomView:o,topView:r,disabled:l,weekNumber:h,mobileMode:c,className:d}=this.props;t&&t(this);const p=i&&i.uCalendar,m=null!==this.value&&null!==this.oldValue?!a.isEqualDate(this.value,this.oldValue):this.value!==this.oldValue,g=O(this.state.activeView,x[void 0!==o?o:e.defaultProps.bottomView],x[void 0!==r?r:e.defaultProps.topView]),v=Ze(this.min,this.max,this.value,this.value),f=v?a.getDate(v):null;this.focusedDate=a.getDate(z(m&&null!==v?v:this.state.focusedDate,this.min,this.max)),this.intl=n.provideIntlService(this),this.bus.configure(this.bottomView,this.topView),this.service=this.bus.service(g,this.intl);const{smoothScroll:w=Number.parseFloat(u.version)<18}=this.props,b=s.classNames(s.uCalendar.wrapper({c:p,disabled:l,weekNumber:h,mobileMode:c}),d),D=[this.props.navigation&&u.createElement(Oe,{key:0,ref:e=>{this.Navigation=e},activeView:this.state.activeView,focusedDate:this.focusedDate,min:this.min,max:this.max,onScroll:this.handleScroll,onChange:this.handleNavigationChange,service:this.service,dom:this.dom,navigationItem:this.props.navigationItem,tabIndex:this.props.tabIndex,unstyled:i}),u.createElement(xe,{key:1,ref:e=>{this.calendarViewList=e},activeView:this.state.activeView,focusedDate:this.focusedDate,min:this.min,max:this.max,bus:this.bus,shouldScroll:this.shouldScroll,onScroll:this.handleScroll,service:this.service,cell:this.props.cell,weekCell:this.props.weekCell,dom:this.dom,smoothScroll:w,showWeekNumbers:this.props.weekNumber,onChange:this.handleDateChange,value:f,cellUID:this.cellUID,headerTitle:this.props.headerTitle,header:this.props.header,tabIndex:this.props.tabIndex,weekDaysFormat:this.props.weekDaysFormat,showOtherMonthDays:this.props.showOtherMonthDays,unstyled:i})];return u.createElement("div",{ref:e=>{this._element=e},className:b,id:this.props.id||this.id,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,"aria-disabled":this.props.disabled,tabIndex:this.props.disabled?void 0:this.props.tabIndex||0,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,onClick:this.handleClick},D)}};Ge.displayName="Calendar",Ge.propTypes={className:i.string,defaultActiveView:i.oneOf(["month","year","decade","century"]),defaultValue:i.instanceOf(Date),disabled:i.bool,focusedDate:i.instanceOf(Date),id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,weekDaysFormat:i.oneOf(["short","abbreviated","narrow"]),max:i.instanceOf(Date),min:i.instanceOf(Date),navigation:i.bool,smoothScroll:i.bool,onBlur:i.func,onChange:i.func,onFocus:i.func,tabIndex:i.number,value:i.instanceOf(Date),weekNumber:i.bool,topView:(e,t,i)=>{const s=e[t],a=e.bottomView;return s&&a&&x[s]<x[a]?new Error(`Invalid prop + ${t} suplied to ${i}.\n ${t} can not be smaller than bottomView.\n `):null},bottomView:(e,t,i)=>{const s=e[t],a=e.topView;return s&&a&&x[s]>x[a]?new Error(`Invalid prop + ${t} suplied to ${i}.\n ${t} can not be bigger than topView.\n `):null}},Ge.defaultProps={disabled:!1,min:T,max:V,weekDaysFormat:"short",navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",bottomView:"month",showOtherMonthDays:!1};let Xe=Ge;const Je=s.createPropsContext(),Qe=s.withIdHOC(s.withPropsContext(Je,s.withUnstyledHOC(Xe)));Qe.displayName="KendoReactCalendar",n.registerForIntl(Xe);let et=class{constructor(){this.symbols="",this.partMap=[]}};const tt=(e,t)=>(e[t.pattern[0]]=t.type,e);let it=class{constructor(e,t,i){this.year=!0,this.month=!0,this.date=!0,this.hours=!0,this.minutes=!0,this.seconds=!0,this.milliseconds=!0,this.leadingZero=null,this.typedMonthPart="",this.knownParts="adHhmMsEy",this.symbols={E:"E",H:"H",M:"M",a:"a",d:"d",h:"h",m:"m",s:"s",y:"y"},this._value=a.getDate(new Date),this.intlProvider=e,this.formatPlaceholder=t,this.format=i,this.monthNames=this.allFormatedMonths()}get intl(){return this.intlProvider()}get value(){return this._value}setValue(e){e?a.isEqual(e,this._value)||(this._value=a.cloneDate(e),this.modifyExisting(!0)):(this._value=a.getDate(new Date),this.modifyExisting(!1))}hasValue(){return this.intl.splitDateFormat(this.format).reduce(((e,t)=>e||"literal"!==t.type&&"dayperiod"!==t.type&&this.getExisting(t.pattern[0])),!1)}getDateObject(){for(let e=0;e<this.knownParts.length;e++)if(!this.getExisting(this.knownParts[e]))return null;return a.cloneDate(this.value)}getTextAndFormat(){return this.merge(this.intl.formatDate(this.value,this.format),this.dateFormatString(this.value,this.format))}modifyExisting(e){const t=this.dateFormatString(this.value,this.format).symbols;for(let i=0;i<t.length;i++)this.setExisting(t[i],e)}getExisting(e){switch(e){case"y":return this.year;case"M":case"L":return this.month;case"d":return this.date;case"E":return this.date&&this.month&&this.year;case"h":case"H":return this.hours;case"m":return this.minutes;case"s":return this.seconds;default:return!0}}setExisting(e,t){switch(e){case"y":this.year=t,!1===t&&this._value.setFullYear(2e3);break;case"M":this.month=t,!1===t&&this._value.setMonth(0);break;case"d":this.date=t;break;case"h":case"H":this.hours=t;break;case"m":this.minutes=t;break;case"s":this.seconds=t;break;default:return}}modifyPart(e,t){let i=a.cloneDate(this.value);switch(e){case"y":i.setFullYear(i.getFullYear()+t);break;case"M":i=a.addMonths(this.value,t);break;case"d":case"E":i.setDate(i.getDate()+t);break;case"h":case"H":i.setHours(i.getHours()+t);break;case"m":i.setMinutes(i.getMinutes()+t);break;case"s":i.setSeconds(i.getSeconds()+t);break;case"a":i.setHours(i.getHours()+12*t)}this.setExisting(e,!0),this._value=i}parsePart(e,t){if(this.resetLeadingZero(),!t)return this.setExisting(e,!1),{value:null};const i=this.intl.formatDate(this.value,this.format),s=this.dateFormatString(this.value,this.format),n=s.symbols;let o=!1,r="",l="",h="";for(let t=0;t<i.length;t++)n[t]===e?(l+=this.getExisting(e)?i[t]:"0",o=!0):o?h+=i[t]:r+=i[t];let c=null;const d=this.matchMonth(t);for(;l.length>0&&"0"===l.charAt(0);)l=l.slice(1);l.length>=4&&(l="");for(let i=0;i<2;i++){let i=l+t,s=parseInt(i,10);if(c=this.intl.parseDate(r+i+h,this.format),!c&&!isNaN(s)&&!isNaN(parseInt(t,10))){if("M"===e&&!d){const e=s-1;e>-1&&e<12&&(c=a.cloneDate(this.value),c.setMonth(e),c.getMonth()!==e&&(c=a.lastDayOfMonth(a.addMonths(c,-1))))}"y"===e&&(c=a.createDate(parseInt(i,10),this.month?this.value.getMonth():0,this.date?this.value.getDate():1,this.hours?this.value.getHours():0,this.minutes?this.value.getMinutes():0,this.seconds?this.value.getSeconds():0,this.milliseconds?this.value.getMilliseconds():0),this.date&&c.getDate()!==this.value.getDate()&&(c=a.lastDayOfMonth(a.addMonths(c,-1))))}if(c)return this._value=c,this.setExisting(e,!0),{value:this.value};l=""}return d&&(c=this.intl.parseDate(r+d+h,this.format),c)?(this._value=c,this.setExisting(e,!0),{value:this.value}):("0"===t&&(this.leadingZero=this.isAbbrMonth(s.partMap,e)?null:{[e]:!0},this.setExisting(e,!1)),{value:null})}symbolMap(e){return this.intl.splitDateFormat(this.format).reduce(tt,{})[e]}resetLeadingZero(){const e=null!==this.leadingZero;return this.leadingZero=null,e}isAbbrMonth(e,t){const i=this.partPattern(e,t);return"month"===i.type&&i.names}partPattern(e,t){return e.filter((e=>-1!==e.pattern.indexOf(t)))[0]}matchMonth(e){if(this.typedMonthPart+=e.toLowerCase(),0===this.monthNames.length)return"";for(;this.typedMonthPart.length>0;){for(let e=0;e<this.monthNames.length;e++)if(0===this.monthNames[e].toLowerCase().indexOf(this.typedMonthPart))return this.monthNames[e];const e=parseInt(this.typedMonthPart,10);if(e>=1&&e<=12&&e.toString()===this.typedMonthPart)return this.monthNames[e-1];this.typedMonthPart=this.typedMonthPart.substring(1,this.typedMonthPart.length)}return""}allFormatedMonths(){const e=this.intl.splitDateFormat(this.format);for(let t=0;t<e.length;t++)if("month"===e[t].type&&e[t].names)return this.intl.dateFormatNames(e[t].names);return[]}dateFormatString(e,t){const i=this.intl.splitDateFormat(t),s=[],a=[];for(let t=0;t<i.length;t++){let n=this.intl.formatDate(e,{pattern:i[t].pattern}).length;for(;n>0;)s.push(this.symbols[i[t].pattern[0]]||"_"),a.push(i[t]),n--}const n=new et;return n.symbols=s.join(""),n.partMap=a,n}merge(e,t){let i="",s="",a=t.symbols;for(let n=a.length-1;n>=0;n--)if(-1===this.knownParts.indexOf(a[n])||this.getExisting(a[n]))i=e[n]+i,s=a[n]+s;else{const e=a[n];for(;n>=0&&e===a[n];)n--;for(n++,i=this.leadingZero&&this.leadingZero[e]?"0"+i:this.dateFieldName(t.partMap[n])+i;s.length<i.length;)s=a[n]+s}return{text:i,format:s}}dateFieldName(e){const t=this.formatPlaceholder||"wide";return t[e.type]?t[e.type]:"formatPattern"===t?e.pattern:this.intl.dateFieldName(Object.assign(e,{nameType:t}))}};const st="dayperiod",at="hour",nt="minute",ot="second",rt=e=>(t,i)=>{const s=a.cloneDate(t);return s[e](i),s},lt=[{type:at,getter:e=>e.getHours()},{type:nt,getter:e=>e.getMinutes()},{type:ot,getter:e=>e.getSeconds()},{type:"millisecond",getter:e=>e.getMilliseconds()}],ht=(e=>t=>e.map((e=>t=>e[t.type]?(e=>(t,i)=>e(i))(t.getter):(e=>(t,i)=>e(t))(t.getter))((e=>e.reduce(((e,t)=>(e[t.type]=t.type,e)),{}))(t))))(lt),ct=(e=>(t,i)=>e.map((e=>{const s=Math.floor(t[e.type]);return s?((e,t,i,s)=>a=>{const n=e(a),o=e(i);return"hour"===s?n-(n-o)%t:a.getTime()<=i.getTime()&&0!==n&&n<=o?Math.ceil(n/t)*t:n-n%t})(e.getter,s,i,e.type):e.getter})))(lt),dt=e=>t=>{const i=a.cloneDate(t);return i.setHours(...e.map((e=>e(i)))),i},ut=rt("setHours"),pt=rt("setMinutes"),mt=rt("setSeconds"),gt=()=>new Date,vt=(e,t,i=1)=>{const s=[];for(let a=e;a<t;a+=i)s.push(a);return s},ft=(e,t,i)=>({candidateValue:F(E,e),maxValue:a.addDays(F(E,i),t.getHours()<i.getHours()?0:1),minValue:F(E,t)}),wt=(e,t,i)=>{if(!e||!t||!i)return!0;const{candidateValue:s,minValue:a,maxValue:n}=ft(e,t,i);return a<=s&&s<=n},bt=(e,t,i)=>{if(null===e)return!0;const{candidateValue:s,minValue:a,maxValue:n}=ft(e,t,i);return a<=s&&s<=n},Dt=(e,t)=>{if(null===e||null===t)return!1;const i=F(E,e),s=F(E,t);return i.getTime()<s.getHours()},yt=(e,t)=>{if(null===e||null===t)return!1;const i=F(E,e);return F(E,t).getTime()<i.getHours()},St=e=>{const t=n.useLocalization(),i=s.useUnstyled(),a=i&&i.uDateInput,o=t.toLanguageString(te,ye[te]);return u.createElement("span",{className:s.classNames(s.uDateInput.clearButton({c:a})),role:"button",onClick:t=>{t.stopPropagation();const{onClick:i}=e;i&&i.call(void 0,t)},tabIndex:e.tabindex||-1,title:o,key:"clearbutton"},u.createElement(s.IconWrap,{name:"x",icon:r.xIcon}))},kt=class e extends u.Component{constructor(t){super(t),this.kendoDate=null,this.currentFormat="",this.paste=!1,this._element=null,this._wrapper=null,this._lastSelectedSymbol="",this.focus=()=>{this._element&&this._element.focus()},this.setValidity=()=>{this.element&&this.element.setCustomValidity&&this.element.setCustomValidity(this.validity.valid?"":this.props.validationMessage||e.defaultProps.validationMessage)},this.updateOnPaste=e=>{if(!this.element||!this.kendoDate)return;const t=n.provideIntlService(this).parseDate(this.element.value,this.props.format)||this.value,i=this.value;this.kendoDate.setValue(t),this.triggerChange(e,i)},this.spinnersMouseDown=e=>{e.preventDefault();const t=s.getActiveElement(document);this.element&&t!==this.element&&this.element.focus({preventScroll:!0})},this.handlePaste=()=>{this.paste=!0},this.handleClick=e=>{this.props.onChange&&this.props.onChange(e)},this.elementChange=e=>{if(!this.element||!this.kendoDate)return;if(this.paste)return this.updateOnPaste(e),void(this.paste=!1);const{text:t,format:i}=this.kendoDate.getTextAndFormat();this.currentFormat=i;const s=this.value,a=((e,t,i,s)=>{const a=e[s+e.length-i.length],n=e.substring(0,s+e.length-i.length),o=i.substring(0,s),r=[];if(n===o&&s>0)return r.push([t[s-1],o[s-1]]),r;if(0===n.indexOf(o)&&(0===o.length||t[o.length-1]!==t[o.length])){let e="";1===o.length&&r.push([t[0],o[0]]);for(let i=o.length;i<n.length;i++)t[i]!==e&&"_"!==t[i]&&(e=t[i],r.push([e,""]));return r}if(0===o.indexOf(n)||"_"===t[s-1]){let e=t[0];for(let i=Math.max(0,n.length-1);i<t.length;i++)if("_"!==t[i]){e=t[i];break}return[[e,o[s-1]]]}return" "===o[o.length-1]||o[o.length-1]===a?[[t[s-1],"_"]]:[[t[s-1],o[s-1]]]})(t,this.currentFormat,this.element.value,this.selection.start),n=1===a.length&&"_"===a[0][1];if(!n)for(let e=0;e<a.length;e++)this.kendoDate.parsePart(a[e][0],a[e][1]);a.length&&"_"!==a[0][0]&&this.setSelection(this.selectionBySymbol(a[0][0])),n&&this.switchDateSegment(1),this.triggerChange(e,s)},this.elementClick=e=>{this.setSelection(this.selectionByIndex(this.selection.start))},this.nativeWheel=e=>{s.getActiveElement(document)===this.element&&e.preventDefault()},this.wheel=e=>{s.getActiveElement(document)===this.element&&(e.nativeEvent.deltaY<0&&this.increasePart(e),e.nativeEvent.deltaY>0&&this.decreasePart(e))},this.increasePart=e=>{this.modifyDateSegmentValue(1,e)},this.decreasePart=e=>{this.modifyDateSegmentValue(-1,e)},this.elementKeyDown=e=>{if(!e.altKey){switch(e.keyCode){case 37:this.switchDateSegment(-1);break;case 38:this.modifyDateSegmentValue(1,e);break;case 39:this.switchDateSegment(1);break;case 40:this.modifyDateSegmentValue(-1,e);break;default:return}e.preventDefault()}},this.elementOnFocus=e=>{this.wrapper&&this.wrapper.classList.add("k-focus"),this.setState({focused:!0})},this.elementOnBlur=e=>{this.wrapper&&this.wrapper.classList.remove("k-focus"),this.setState({focused:!1})},s.validatePackage(p),this.state={focused:!1}}get _inputId(){return this.props.id+"-accessibility-id"}componentDidMount(){this.setValidity(),this.wrapper&&this.wrapper.addEventListener("wheel",this.nativeWheel,{passive:!1})}componentDidUpdate(e,t){this._lastSelectedSymbol&&t.focused===this.state.focused?this.setSelection(this.selectionBySymbol(this._lastSelectedSymbol)):void 0!==this.props.placeholder&&this.selection.start===this.selection.end&&this.setSelection({start:0,end:this.currentFormat.length}),this.setValidity()}componentWillUnmount(){this.wrapper&&this.wrapper.removeEventListener("wheel",this.nativeWheel)}render(){const{size:t=e.defaultProps.size,fillMode:i=e.defaultProps.fillMode,rounded:a=e.defaultProps.rounded,autoFocus:h=e.defaultProps.autoFocus,unstyled:c}=this.props,d=c&&c.uDateInput;this.props._ref&&(this.props._ref.current=this);const p=n.provideLocalizationService(this),m={...e.defaultProps,...this.props},{name:g,label:v,id:f,disabled:w}=m,b=this.text,D=b===this.props.placeholder?"":b,y=b===this.props.placeholder?b:void 0,S=f||this._inputId,k=!this.validityStyles||this.validity.valid,C=u.createElement(s.AsyncFocusBlur,{onFocus:this.elementOnFocus,onBlur:this.elementOnBlur},(({onFocus:e,onBlur:n})=>u.createElement("span",{ref:e=>{this._wrapper=e},style:v?void 0:{width:this.props.width},dir:this.props.dir,className:s.classNames(s.uDateInput.wrapper({c:d,size:t,fillMode:i,rounded:a,disabled:w,required:this.required,invalid:!k}),this.props.className),onFocus:e,onBlur:n},u.createElement("input",{role:this.props.ariaRole||"textbox",readOnly:this.props.readonly,tabIndex:this.props.tabIndex,disabled:this.props.disabled,title:void 0!==this.props.title?this.props.title:b,type:"text",spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoFocus:h,className:s.classNames(s.uDateInput.input({c:d})),id:S,"aria-label":this.props.ariaLabel,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,"aria-haspopup":this.props.ariaHasPopup,"aria-disabled":this.props.disabled,"aria-expanded":this.props.ariaExpanded,"aria-controls":this.props.ariaControls,onWheel:this.wheel,onClick:this.elementClick,onInput:this.elementChange,onPaste:this.handlePaste,onKeyDown:this.elementKeyDown,onChange:s.noop,value:D,placeholder:y,name:g,ref:e=>this._element=e}),this.props.children,this.props.clearButton&&this.props.value&&u.createElement(St,{onClick:this.handleClick,key:"clearbutton"}),this.props.spinners&&u.createElement("span",{className:s.classNames(s.uDateInput.inputSpinner({c:d})),onMouseDown:this.spinnersMouseDown},u.createElement(o.Button,{tabIndex:-1,type:"button",rounded:null,className:s.classNames(s.uDateInput.spinnerIncrease({c:d})),icon:"caret-alt-up",svgIcon:r.caretAltUpIcon,"aria-label":p.toLanguageString(Q,ye[Q]),title:p.toLanguageString(Q,ye[Q]),onClick:this.increasePart}),u.createElement(o.Button,{tabIndex:-1,type:"button",rounded:null,className:s.classNames(s.uDateInput.spinnerDecrease({c:d})),icon:"caret-alt-down",svgIcon:r.caretAltDownIcon,"aria-label":p.toLanguageString(ee,ye[ee]),title:p.toLanguageString(ee,ye[ee]),onClick:this.decreasePart})))));return v?u.createElement(l.FloatingLabel,{label:v,editorId:S,editorValue:b,editorValid:k,editorDisabled:this.props.disabled,children:C,style:{width:this.props.width}}):C}get value(){return void 0!==this.valueDuringOnChange?this.valueDuringOnChange:this.kendoDate&&this.kendoDate.getDateObject()}get name(){return this.props.name}get min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}get text(){const t={...It.defaultProps,...this.props},{formatPlaceholder:i=e.defaultProps.formatPlaceholder,format:s=e.defaultProps.format,value:a,defaultValue:n}=t;null===this.kendoDate?(this.kendoDate=new it(this.intl.bind(this),i,s),this.kendoDate.setValue(a||n||null)):(this.kendoDate.format=s,this.kendoDate.formatPlaceholder=i),void 0!==a&&this.value!==a&&this.kendoDate.setValue(a);const{text:o,format:r}=this.kendoDate.getTextAndFormat();return this.currentFormat=r,null===t.placeholder||void 0===t.placeholder||this.state.focused||this.kendoDate.hasValue()?o:t.placeholder}get validity(){const e=((e,t,i)=>null===e||!(t&&t>e||i&&i<e))(this.value,this.min,this.max)&&wt(this.value,this.props.minTime,this.props.maxTime),t=void 0!==this.props.validationMessage,i=(!this.required||null!==this.value)&&e,s=void 0!==this.props.valid?this.props.valid:i;return{customError:t,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:s,valueMissing:null===this.value}}get element(){return this._element}get validityStyles(){return void 0!==this.props.validityStyles?this.props.validityStyles:e.defaultProps.validityStyles}get required(){return void 0!==this.props.required?this.props.required:e.defaultProps.required}get wrapper(){return this._wrapper}intl(){return n.provideIntlService(this)}get selection(){let e={start:0,end:0};return null!==this.element&&void 0!==this.element.selectionStart&&(e={start:this.element.selectionStart,end:this.element.selectionEnd}),e}setSelection(e){this._lastSelectedSymbol=this.currentFormat[e.start],window.requestAnimationFrame((()=>{const t=s.getActiveElement(document);this.element&&t===this.element&&!this.props.disableSelection&&this.element.setSelectionRange(e.start,e.end)}))}triggerChange(e,t){this.valueDuringOnChange=this.value,this.forceUpdate(),this.props.onChange&&!a.isEqual(t,this.value)&&this.props.onChange.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0}selectionBySymbol(e){let t=-1,i=0;for(let s=0;s<this.currentFormat.length;s++)this.currentFormat[s]===e&&(i=s+1,-1===t&&(t=s));return t<0&&(t=0),{start:t,end:i}}selectionByIndex(e){let t={start:e,end:e};for(let i=e,s=e-1;i<this.currentFormat.length||s>=0;i++,s--){if(i<this.currentFormat.length&&"_"!==this.currentFormat[i]){t=this.selectionBySymbol(this.currentFormat[i]);break}if(s>=0&&"_"!==this.currentFormat[s]){t=this.selectionBySymbol(this.currentFormat[s]);break}}return t}switchDateSegment(e){const{start:t,end:i}=this.selection;if(t<i&&this.currentFormat[t]!==this.currentFormat[i-1])return void this.setSelection(this.selectionByIndex(e>0?t:i-1));const s=this.currentFormat[t];let a=t+e;for(;a>0&&a<this.currentFormat.length&&(this.currentFormat[a]===s||"_"===this.currentFormat[a]);)a+=e;if("_"===this.currentFormat[a])return;let n=a;for(;n>=0&&n<this.currentFormat.length&&this.currentFormat[n]===this.currentFormat[a];)n+=e;a>n&&(n+1!==t||a+1!==i)?this.setSelection({start:n+1,end:a+1}):a<n&&(a!==t||n!==i)&&this.setSelection({start:a,end:n})}modifyDateSegmentValue(e,t){if(!this.kendoDate)return;const i=this.value,s=this.currentFormat[this.selection.start],a=this.kendoDate.symbolMap(s),n=((this.props.steps||{})[a]||1)*e;this.kendoDate.modifyPart(s,n),this.triggerChange(t,i)}};kt.displayName="DateInput",kt.propTypes={value:i.instanceOf(Date),format:i.oneOfType([i.string,i.shape({skeleton:i.string,pattern:i.string,date:i.oneOf(["short","medium","long","full"]),time:i.oneOf(["short","medium","long","full"]),datetime:i.oneOf(["short","medium","long","full"]),era:i.oneOf(["narrow","short","long"]),year:i.oneOf(["numeric","2-digit"]),month:i.oneOf(["numeric","2-digit","narrow","short","long"]),day:i.oneOf(["numeric","2-digit"]),weekday:i.oneOf(["narrow","short","long"]),hour:i.oneOf(["numeric","2-digit"]),hour12:i.bool,minute:i.oneOf(["numeric","2-digit"]),second:i.oneOf(["numeric","2-digit"]),timeZoneName:i.oneOf(["short","long"])})]),formatPlaceholder:i.oneOfType([i.oneOf(["wide","narrow","short","formatPattern"]),i.shape({year:i.string,month:i.string,day:i.string,hour:i.string,minute:i.string,second:i.string})]),width:i.oneOfType([i.string,i.number]),tabIndex:i.number,title:i.string,steps:i.shape({year:i.number,month:i.number,day:i.number,hour:i.number,minute:i.number,second:i.number}),min:i.instanceOf(Date),max:i.instanceOf(Date),disabled:i.bool,spinners:i.bool,name:i.string,dir:i.string,label:i.string,id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,ariaLabel:i.string,ariaRole:i.string,ariaHasPopup:i.oneOfType([i.bool,i.string]),ariaExpanded:i.oneOfType([i.bool]),onChange:i.func,validationMessage:i.string,required:i.bool,validate:i.bool,valid:i.bool,size:i.oneOf([null,"small","medium","large"]),rounded:i.oneOf([null,"small","medium","large","full"]),fillMode:i.oneOf([null,"solid","flat","outline"]),autoFocus:i.bool},kt.defaultProps={format:"d",size:"medium",rounded:"medium",fillMode:"solid",formatPlaceholder:"wide",spinners:!1,disabled:!1,max:a.cloneDate(V),min:a.cloneDate(T),minTime:a.cloneDate(P),maxTime:a.cloneDate(N),required:!1,validityStyles:!0,validationMessage:"Please enter a valid value!",placeholder:null,ariaHasPopup:"grid",autoFocus:!1};let Ct=kt;const xt=s.createPropsContext(),It=s.withIdHOC(s.withPropsContext(xt,s.withUnstyledHOC(Ct)));It.displayName="KendoReactDateInput",n.registerForIntl(Ct),n.registerForLocalization(Ct);const Mt=o.Button,Ot=u.forwardRef(((e,t)=>{const{_ref:i}=e,a=u.useRef(null);u.useImperativeHandle(t,(()=>a.current)),u.useImperativeHandle(i,(()=>a.current));const n=u.useMemo((()=>s.classNames(e.className,"k-picker-wrap")),[e.className]);return u.createElement("span",{ref:a,id:e.id,style:e.style,className:n,tabIndex:e.tabIndex},e.children)})),Et=e=>{const{dateInput:t,...i}=e,s=(e=>{const[t,i]=u.useState(!1);return u.useEffect((()=>{e.current&&i(!!e.current.text)})),{editorValue:t}})(t);return u.createElement(l.FloatingLabel,{...i,...s})},Tt=e=>{const{footer:t,children:i,windowWidth:s=0,navigatable:a,navigatableElements:n,expand:l,animation:h,onClose:d,adaptiveTitle:p,mobileFilter:m}=e,g={navigatable:a||!1,navigatableElements:n||[],expand:l,animation:!1!==h,onClose:d,animationStyles:s<=500?{top:0,width:"100%",height:"100%"}:void 0,className:s<=500?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"};return u.createElement(c.ActionSheet,{...g},u.createElement(c.ActionSheetHeader,{className:"k-text-center"},u.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},u.createElement("div",{className:"k-actionsheet-title"},u.createElement("div",null,p)),u.createElement("div",{className:"k-actionsheet-actions"},u.createElement(o.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",icon:"x",svgIcon:r.xIcon,onClick:d}))),m&&u.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},m)),i,t&&u.createElement(c.ActionSheetFooter,{className:"k-actions k-actions-stretched"},u.createElement(o.Button,{size:"large",tabIndex:0,"aria-label":t.cancelText,"aria-disabled":"false",type:"button",onClick:t.onCancel},t.cancelText),u.createElement(o.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":t.applyText,"aria-disabled":"false",type:"button",onClick:t.onApply},t.applyText)))},Vt=768,Pt=class e extends u.Component{constructor(t){super(t),this._element=null,this._dateInput=u.createRef(),this._calendar=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.setCalendarRef=e=>{this._calendar=e},this.nextValue=(e,t)=>void 0!==e.value?e.value:t.value,this.nextShow=(e,t)=>void 0!==e.show?e.show:t.show,this.renderPopup=()=>{const{disabled:e,min:t,max:i,weekNumber:n,focusedDate:o,popupSettings:r}=this.props,{popupClass:l,...h}=r,c=this.show,d=this.value,p=d&&a.getDate(d),m=s.classNames(l),g={popupClass:"k-datepicker-popup",show:c,anchor:this._element,className:m,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...h},v={disabled:e,value:p,min:t,max:i,weekNumber:n,focusedDate:o,className:this.mobileMode?"k-calendar-lg":"",navigation:!this.mobileMode,onChange:this.handleCalendarValueChange};return this.mobileMode?u.createElement(this.calendarComp,{_ref:this.setCalendarRef,...v}):u.createElement(this.popupComp,{...g},u.createElement(this.calendarComp,{_ref:this.setCalendarRef,...v}))},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:e};return u.createElement(Tt,{...t},u.createElement(c.ActionSheetContent,{overflowHidden:!0},this.renderPopup()))},this.handleInputValueChange=e=>{this.handleValueChange(e.value,e)},this.handleCalendarValueChange=e=>{const t=this.mergeTime(e.value);this.handleValueChange(t,e)},this.handleValueChange=(e,t)=>{this.setState({value:a.cloneDate(e||void 0)}),this.valueDuringOnChange=e,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:i}=this.props;i&&i.call(void 0,{syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:this.value,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.handleIconClick=()=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:t,keyCode:i}=e;if(i===s.Keys.esc&&this.show)return this.shouldFocusDateInput=!0,void this.setShow(!1);t&&(i===s.Keys.up||i===s.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=i===s.Keys.up,this.setShow(i===s.Keys.down))},s.validatePackage(p),this.state={value:this.props.defaultValue||e.defaultProps.defaultValue,show:this.props.defaultShow||e.defaultProps.defaultShow,focused:!1}}get _popupId(){return this.props.id+"-popup-id"}get document(){if(s.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=Vt&&this.props.adaptive)}get dateInput(){return this._dateInput.current}get calendar(){return this._calendar}get value(){const e=void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.props.value?this.props.value:this.state.value;return null!==e?a.cloneDate(e):null}get show(){return void 0!==this.showDuringOnChange?this.showDuringOnChange:void 0!==this.props.show?this.props.show:this.state.show}get name(){return this.props.name}get min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}get dateInputComp(){return this.props.dateInput||e.defaultProps.dateInput}get toggleButtonComp(){return this.props.toggleButton||e.defaultProps.toggleButton}get calendarComp(){return this.props.calendar||e.defaultProps.calendar}get popupComp(){return this.props.popup||e.defaultProps.popup}get pickerWrapComp(){return this.props.pickerWrap||e.defaultProps.pickerWrap}get validity(){const e=B(this.value,this.min,this.max),t=void 0!==this.props.validationMessage,i=(!this.required||null!==this.value)&&e,s=void 0!==this.props.valid?this.props.valid:i;return{customError:t,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:s,valueMissing:null===this.value}}get validityStyles(){return void 0!==this.props.validityStyles?this.props.validityStyles:e.defaultProps.validityStyles}get required(){return void 0!==this.props.required?this.props.required:e.defaultProps.required}componentDidMount(){var e;this.observerResize=s.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this._calendar&&this._calendar.element&&this.show&&!this.prevShow&&this._calendar.element.focus({preventScroll:!0}),this.dateInput&&this.dateInput.element&&!this.show&&this.shouldFocusDateInput&&this.dateInput.element.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var e;clearTimeout(this.nextTickId),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:t=e.defaultProps.size,rounded:i=e.defaultProps.rounded,fillMode:a=e.defaultProps.fillMode,disabled:o,tabIndex:l,title:h,id:c,format:d,formatPlaceholder:p,min:m,max:g,className:v,width:f,name:w,validationMessage:b,required:D,validityStyles:y,ariaLabelledBy:S,ariaDescribedBy:k,ariaLabel:C,placeholder:x,label:I,popupSettings:M,defaultValue:O,defaultShow:E,value:T,popup:V,weekNumber:P,dateInput:N,calendar:F,toggleButton:R,onChange:L,onBlur:B,onFocus:_,show:H,onOpen:A,pickerWrap:z,adaptive:q,adaptiveTitle:K,valid:W,autoFocus:U,visited:Y,touched:$,modified:j,...Z}=this.props,G=this.value,X=!this.validityStyles||this.validity.valid,J={disabled:o,format:d,formatPlaceholder:p,id:c,ariaLabelledBy:S,ariaDescribedBy:k,ariaLabel:C,max:g,min:m,name:w,onChange:this.handleInputValueChange,required:D,tabIndex:this.show?-1:l,title:h,valid:this.validity.valid,validationMessage:b,validityStyles:y,value:G,label:void 0,placeholder:this.state.focused?null:x,ariaExpanded:this.show,size:null,fillMode:null,rounded:null},Q=n.provideLocalizationService(this).toLanguageString(se,ye[se]),ee=u.createElement(s.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},(e=>u.createElement(u.Fragment,null,u.createElement("span",{...I?{}:Z,ref:e=>{this._element=e},className:s.classNames("k-input","k-datepicker",{[`k-input-${s.kendoThemeMaps.sizeMap[t]||t}`]:t,[`k-rounded-${s.kendoThemeMaps.roundedMap[i]||i}`]:i,[`k-input-${a}`]:a,"k-invalid":!X,"k-required":this.required,"k-disabled":o},v),onKeyDown:this.handleKeyDown,style:{width:f},onFocus:e.onFocus,onBlur:e.onBlur,onClick:this.mobileMode?this.handleIconClick:void 0},u.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",readonly:this.mobileMode,ariaExpanded:this.show,ariaControls:this._popupId,autoFocus:U,...J}),u.createElement(this.toggleButtonComp,{type:"button",icon:"calendar",svgIcon:r.calendarIcon,title:Q,className:"k-input-button",rounded:null,onClick:this.mobileMode?void 0:this.handleIconClick,"aria-label":Q,fillMode:a,onMouseDown:this.handleIconMouseDown}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup())));return I?u.createElement(Et,{dateInput:this._dateInput,label:I,editorId:c,editorValid:X,editorDisabled:o,children:ee,style:{width:f},...Z}):ee}setShow(e){const{onOpen:t,onClose:i}=this.props;this.show!==e&&(this.setState({show:e}),e&&t&&t.call(void 0,{target:this}),!e&&i&&i.call(void 0,{target:this}))}mergeTime(e){return this.value&&e?F(e,this.value):e}nextTick(e){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout((()=>e()))}calculateMedia(e){for(let t of e)this.setState({windowWidth:t.target.clientWidth})}};Pt.displayName="DatePicker",Pt.propTypes={className:i.string,defaultShow:i.bool,defaultValue:i.instanceOf(Date),disabled:i.bool,focusedDate:i.instanceOf(Date),format:i.oneOfType([i.string,i.shape({skeleton:i.string,pattern:i.string,date:i.oneOf(["short","medium","long","full"]),time:i.oneOf(["short","medium","long","full"]),datetime:i.oneOf(["short","medium","long","full"]),era:i.oneOf(["narrow","short","long"]),year:i.oneOf(["numeric","2-digit"]),month:i.oneOf(["numeric","2-digit","narrow","short","long"]),day:i.oneOf(["numeric","2-digit"]),weekday:i.oneOf(["narrow","short","long"]),hour:i.oneOf(["numeric","2-digit"]),hour12:i.bool,minute:i.oneOf(["numeric","2-digit"]),second:i.oneOf(["numeric","2-digit"]),timeZoneName:i.oneOf(["short","long"])})]),formatPlaceholder:i.oneOfType([i.oneOf(["wide","narrow","short","formatPattern"]),i.shape({year:i.string,month:i.string,day:i.string,hour:i.string,minute:i.string,second:i.string})]),id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,ariaLabel:i.string,min:i.instanceOf(Date),max:i.instanceOf(Date),name:i.string,popupSettings:i.shape({animate:i.bool,appendTo:i.any,popupClass:i.string}),show:i.bool,tabIndex:i.number,title:i.string,value:i.instanceOf(Date),weekNumber:i.bool,width:i.oneOfType([i.number,i.string]),validationMessage:i.string,required:i.bool,validate:i.bool,valid:i.bool,size:i.oneOf([null,"small","medium","large"]),rounded:i.oneOf([null,"small","medium","large","full"]),fillMode:i.oneOf([null,"solid","flat","outline"]),adaptive:i.bool,adaptiveTitle:i.string,autoFocus:i.bool},Pt.defaultProps={defaultShow:!1,defaultValue:null,dateInput:It,calendar:Qe,toggleButton:Mt,popup:h.Popup,pickerWrap:Ot,disabled:!1,format:"d",max:V,min:T,popupSettings:{},tabIndex:0,weekNumber:!1,required:!1,validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1};let Nt=Pt;const Ft=s.createPropsContext(),Rt=s.withIdHOC(s.withPropsContext(Ft,Nt));Rt.displayName="KendoReactDatePicker",n.registerForLocalization(Nt);const Lt=(e,t)=>{const i=a.cloneDate(e);return i.setHours(t),i},Bt=e=>null!==e&&e<12,_t=(e,t,i)=>!t&&!i||e>=t&&e<=i,Ht=(e,t,i)=>!t&&!i||e>=t||e<=i;let At=class{constructor(e){this.intl=e,this.min=null,this.max=null,this.part=null}apply(e,t){const i=e.getHours(),s=Bt(i),a=Bt(t.getHours());if(s&&a||!s&&!a)return e;const[n,o=24]=this.normalizedRange(),r=i+(a?-12:12);return Lt(e,Math.min(Math.max(n,r),o||24))}configure(e){const{min:t=this.min,max:i=this.max,part:s=this.part}=e;this.min=t,this.max=i,this.part=s}data(e){const t=this.part&&this.part.names;if(!t||!this.min)return[];const i=[],[s,a]=this.normalizedRange(),n=this.intl.dateFormatNames(t);return Bt(s)&&i.push({text:n.am,value:Lt(this.min,s)}),(e=>null!==e&&(!e||e>11))(a)&&i.push({text:n.pm,value:Lt(this.min,Math.max(12,a))}),this.min.getHours()!==s?i.reverse():i}isRangeChanged(e,t){return!1}limitRange(e,t,i){return[e,t]}total(){const[e,t]=this.normalizedRange();return(e||t)&&(e>11||t<12)?1:2}selectedIndex(e){if(!this.valueInList(e)||!this.min)return-1;const t=Math.floor(e.getHours()/12);return this.min.getHours()===this.normalizedRange()[0]?t:0===t?1:0}valueInList(e){return!(!this.min||!this.max)&&(this.min.getHours()!==this.normalizedRange()[0]?Ht:_t)(e.getHours(),this.min.getHours(),this.max.getHours())}normalizedRange(){const e=this.min.getHours(),t=this.max.getHours();return[Math.min(e,t),Math.max(e,t)]}},zt=class{constructor(){this.itemHeight=0,this.timeListHeight=0,this.didCalculate=!1}ensureHeights(){void 0===this.timeListHeight&&this.calculateHeights()}calculateHeights(e){if(!s.canUseDOM)return;const t=q("div"),i=q("span"),a=q("ul"),n=q("li"),o=t([i("minute","k-title"),t([t([a([n("<span>02</span>","k-item")],"k-reset")],"k-content k-scrollable k-time-container")],"k-time-list")],"k-time-list-wrapper",{left:"-10000px",position:"absolute"}),r=e&&e.querySelector(".k-time-container")||document.body,l=r.appendChild(o);this.timeListHeight=l.querySelector(".k-scrollable").offsetHeight,this.itemHeight=l.querySelector("li").offsetHeight,r.removeChild(l),this.didCalculate=!0}};const qt=(e=>t=>t%e)(24),Kt=(e,t)=>qt(24+e-t),Wt=e=>(t,i)=>i&&a.getDate(t).getTime()!==a.getDate(i).getTime()?ut(t,e):t,Ut=Wt(0),Yt=Wt(23);let $t=class{constructor(e){this.intl=e,this.boundRange=!1,this.insertUndividedMax=!1,this.min=null,this.max=null,this.step=0,this.toListItem=null}apply(e,t){return ut(e,t.getHours())}configure(e){const{boundRange:t=this.boundRange,insertUndividedMax:i=this.insertUndividedMax,min:s=this.min,max:a=this.max,part:n,step:o=this.step}=e;this.boundRange=t,this.insertUndividedMax=i,this.toListItem=e=>{const t=ut(E,e);return{text:this.intl.formatDate(t,n.pattern),value:t}},this.min=s,this.max=a,this.step=o}data(e){const[t]=this.range(e),i=((e,t)=>i=>qt(e+i*t))(t,this.step),s=vt(0,this.countFromMin(e)).map((e=>this.toListItem&&this.toListItem(i(e))));return this.addLast(s),e&&this.addMissing(s,e),s}isRangeChanged(e,t){return!(!this.min||!this.max)&&(!a.isEqual(this.min,e)||!a.isEqual(this.max,t))}limitRange(e,t,i){return this.boundRange?[Ut(e,i),Yt(t,i)]:[e,t]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,i=this.isMissing(e)?1:0;return this.countFromMin(e)+i+t}selectedIndex(e){return Math.ceil(this.divideByStep(e))}valueInList(e){return!e||(this.insertUndividedMax&&this.lastHour(e)===e.getHours()||!this.isMissing(e))}addLast(e,t){return this.insertUndividedMax&&this.isLastMissing(t)&&this.toListItem&&e.push(this.toListItem(this.lastHour(t))),e}addMissing(e,t){if(this.valueInList(t))return e;if(this.toListItem){const i=this.toListItem(t.getHours());e.splice(this.selectedIndex(t),0,i)}return e}countFromMin(e){const[t,i]=this.range(e);return Math.floor(Kt(i,t)/this.step)+1}isMissing(e){return!!e&&this.selectedIndex(e)!==this.divideByStep(e)}isLastMissing(e){return null!==this.max&&this.isMissing(ut(this.max,this.lastHour(e)))}divideByStep(e){return Kt(e.getHours(),this.min.getHours())/this.step}lastHour(e){return this.range(e)[1]}range(e){const[t,i]=this.limitRange(this.min,this.max,e);return[t.getHours(),i.getHours()]}};const jt=(e=>t=>t%e)(60),Zt=(e,t)=>jt(60+e-t),Gt=e=>(t,i)=>i&&t.getHours()!==i.getHours()?pt(t,e):t,Xt=Gt(0),Jt=Gt(59);let Qt=class{constructor(e){this.intl=e,this.toListItem=null,this.min=null,this.max=null,this.step=0,this.insertUndividedMax=!1}apply(e,t){return pt(e,t.getMinutes())}configure(e){const{insertUndividedMax:t=this.insertUndividedMax,min:i=this.min,max:s=this.max,part:a,step:n=this.step}=e;this.insertUndividedMax=t,this.toListItem=e=>{const t=pt(E,e);return{text:this.intl.formatDate(t,a.pattern),value:t}},this.min=i,this.max=s,this.step=n}data(e){const[t]=this.range(e),i=((e,t)=>i=>jt(e+i*t))(t,this.step),s=vt(0,this.countFromMin(e)).map((e=>this.toListItem&&this.toListItem(i(e))));return this.addLast(s),e&&this.addMissing(s,e),s}isRangeChanged(e,t){return!(null===this.min||null===this.max||a.isEqual(this.min,e)&&a.isEqual(this.max,t))}limitRange(e,t,i){return[Xt(e,i),Jt(t,i)]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,i=this.isMissing(e)?1:0;return this.countFromMin(e)+i+t}selectedIndex(e){return Math.ceil(this.divideByStep(e))}valueInList(e){return!e||(this.insertUndividedMax&&this.lastMinute(e)===e.getMinutes()||!this.isMissing(e))}addLast(e,t){return this.insertUndividedMax&&this.isLastMissing(t)&&this.toListItem&&e.push(this.toListItem(this.lastMinute(t))),e}addMissing(e,t){if(this.valueInList(t))return e;if(this.toListItem){const i=this.toListItem(t.getMinutes());e.splice(this.selectedIndex(t),0,i)}return e}countFromMin(e){const[t,i]=this.range(e);return Math.floor(Zt(i,t)/this.step)+1}isMissing(e){return!!e&&this.selectedIndex(e)!==this.divideByStep(e)}isLastMissing(e){return null!==this.max&&this.isMissing(pt(this.max,this.lastMinute(e)))}divideByStep(e){return Zt(e.getMinutes(),this.min.getMinutes())/this.step}lastMinute(e){return this.range(e)[1]}range(e){const[t,i]=this.limitRange(this.min,this.max,e);return[t.getMinutes(),i.getMinutes()]}};const ei=(e=>t=>t%e)(60),ti=(e,t)=>ei(60+e-t),ii=e=>(t,i)=>!i||t.getMinutes()===i.getMinutes()&&t.getHours()===i.getHours()?t:mt(t,e),si=ii(0),ai=ii(59);class ni{constructor(e){this.intl=e,this.toListItem=null,this.min=null,this.max=null,this.step=0,this.insertUndividedMax=!1}apply(e,t){return mt(e,t.getSeconds())}configure(e){const{insertUndividedMax:t=this.insertUndividedMax,min:i=this.min,max:s=this.max,part:a,step:n=this.step}=e;this.insertUndividedMax=t,this.toListItem=e=>{const t=mt(E,e);return{text:this.intl.formatDate(t,a.pattern),value:t}},this.min=i,this.max=s,this.step=n}data(e){const[t]=this.range(e),i=((e,t)=>i=>ei(e+i*t))(t,this.step),s=vt(0,this.countFromMin(e)).map((e=>this.toListItem&&this.toListItem(i(e))));return this.addLast(s),e&&this.addMissing(s,e),s}isRangeChanged(e,t){return!(null===this.min||null===this.max||a.isEqual(this.min,e)&&a.isEqual(this.max,t))}limitRange(e,t,i){return[si(e,i),ai(t,i)]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,i=this.isMissing(e)?1:0;return this.countFromMin(e)+i+t}selectedIndex(e){return Math.ceil(this.divideByStep(e))}valueInList(e){return!e||(this.insertUndividedMax&&this.lastSecond(e)===e.getSeconds()||!this.isMissing(e))}divideByStep(e){return ti(e.getSeconds(),this.min.getSeconds())/this.step}addLast(e,t){return this.insertUndividedMax&&this.isLastMissing(t)&&this.toListItem&&e.push(this.toListItem(this.lastSecond(t))),e}addMissing(e,t){if(this.valueInList(t))return e;if(this.toListItem){const i=this.toListItem(t.getSeconds());e.splice(this.selectedIndex(t),0,i)}return e}countFromMin(e){const[t,i]=this.range(e);return Math.floor(ti(i,t)/this.step)+1}isMissing(e){return!!e&&this.selectedIndex(e)!==this.divideByStep(e)}isLastMissing(e){return null!==this.max&&this.isMissing(mt(this.max,this.lastSecond(e)))}lastSecond(e){return this.range(e)[1]}range(e){const[t,i]=this.limitRange(this.min,this.max,e);return[t.getSeconds(),i.getSeconds()]}}const oi={[s.Keys.end]:(e,t)=>e[e.length-1],[s.Keys.home]:(e,t)=>e[0],[s.Keys.up]:(e,t)=>e[t-1],[s.Keys.down]:(e,t)=>e[t+1]},ri={[st]:At,[at]:$t,[nt]:Qt,[ot]:ni},li=class e extends u.Component{constructor(t){super(t),this.intl=null,this._element=null,this.service=null,this.virtualization=null,this.topOffset=0,this.bottomOffset=0,this.itemHeight=0,this.listHeight=0,this.topThreshold=0,this.bottomThreshold=0,this.animateToIndex=!1,this.focus=e=>{Promise.resolve().then((()=>{this.element&&this.element.focus(e)}))},this.itemOffset=e=>{if(!this.virtualization||!this.service)return-1;const t=this.service.selectedIndex(this.props.value),i=this.virtualization.activeIndex(),s=this.virtualization.itemOffset(i),a=Math.abs(Math.ceil(e)-s);if(t===i&&a<2)return s;const n=t>i;return n&&a>=this.bottomThreshold||!n&&a>this.topThreshold?this.virtualization.itemOffset(i+1):s},this.calculateHeights=()=>{this.dom.didCalculate&&(this.itemHeight=this.dom.itemHeight,this.listHeight=this.dom.timeListHeight,this.topOffset=(this.listHeight-this.itemHeight)/2,this.bottomOffset=this.listHeight-this.itemHeight,this.props.mobileMode&&(this.topOffset+=9,this.bottomOffset+=18),this.topThreshold=.05*this.itemHeight,this.bottomThreshold=.95*this.itemHeight)},this.configureServices=({min:e,max:t,value:i}=this.props)=>{if(this.service){const[s,a]=this.service.limitRange(e||this.min,t||this.max,i||this.props.value);this.service.configure(this.serviceSettings({min:s,max:a}))}},this.serviceSettings=t=>{const i={boundRange:this.props.boundRange||e.defaultProps.boundRange,insertUndividedMax:!1,min:a.cloneDate(this.min),max:a.cloneDate(this.max),part:this.props.part,step:this.step},s=Object.assign({},i,t);return s.boundRange="hour"!==s.part.type||this.props.boundRange||e.defaultProps.boundRange,s},this.handleScrollAction=({target:e,animationInProgress:t})=>{if(this.virtualization&&this.service&&e&&!t){this.animateToIndex=!1;const t=this.virtualization.itemIndex(this.itemOffset(e.scrollTop)),i=this.service.data(this.props.value)[t];this.handleChange(i)}},this.handleFocus=e=>{const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleBlur=e=>{const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.handleMouseOver=()=>{if(!this._element)return;const e=s.getActiveElement(document);document&&e!==this._element&&this.props.show&&this._element.focus({preventScroll:!0})},this.handleKeyDown=e=>{if(!this.service)return;const{keyCode:t}=e;(t===s.Keys.down||t===s.Keys.up||t===s.Keys.end||t===s.Keys.home)&&e.preventDefault();const i=(oi[e.keyCode]||s.noop)(this.service.data(this.props.value),this.service.selectedIndex(this.props.value));i&&this.handleChange(i)},this.handleChange=K((e=>{if(!this.service)return;const t=this.service.apply(this.props.value,e.value);if(this.props.value.getTime()===t.getTime())return;const{onChange:i}=this.props;i&&i.call(void 0,t)}),100),this.dom=new zt}get element(){return this._element}get animate(){return!(!this.props.smoothScroll||!this.animateToIndex)}get min(){return this.props.min||e.defaultProps.min}get max(){return this.props.max||e.defaultProps.max}get step(){return void 0!==this.props.step&&0!==this.props.step?Math.floor(this.props.step):e.defaultProps.step}componentDidMount(){Promise.resolve().then((()=>{this._element&&(this.dom.calculateHeights(this._element),this.forceUpdate())}))}componentDidUpdate(){if(!this.virtualization||!this.service)return;const e=this.service.selectedIndex(this.props.value);this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](e),this.animateToIndex=!0}render(){const{part:e,value:t,unstyled:i}=this.props;if(!e.type||!ri[e.type])return;const a=i&&i.uTime;this.calculateHeights(),this.intl=n.provideIntlService(this),this.service=new ri[e.type](this.intl),this.configureServices();const o=this.service.data(t),r="translateY("+this.topOffset+"px)",l=this.service.total(t),h=u.createElement(u.Fragment,null,u.createElement("ul",{style:{transform:r,msTransform:r},className:s.classNames(s.uTime.ul({c:a}))},o.map(((e,t)=>u.createElement("li",{key:t,className:s.classNames(s.uTime.li({c:a})),onClick:()=>{this.handleChange(e)}},u.createElement("span",null,e.text))))),u.createElement("div",{className:s.classNames(s.uTime.scrollablePlaceholder({c:a}))}));return u.createElement("div",{className:s.classNames(s.uTime.list({c:a})),id:String(this.props.id||""),tabIndex:this.props.disabled?-1:0,ref:e=>{this._element=e},onKeyDown:this.handleKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseOver:this.handleMouseOver},this.dom.didCalculate?u.createElement(S,{bottomOffset:this.bottomOffset,children:h,className:s.classNames(s.uTime.container({c:a})),itemHeight:this.itemHeight,maxScrollDifference:this.listHeight,onScrollAction:this.handleScrollAction,ref:e=>{this.virtualization=e},role:"presentation",skip:0,tabIndex:-1,take:l,topOffset:this.topOffset,total:l}):u.createElement("div",{className:s.classNames(s.uTime.container({c:a,content:!0,scrollable:!0}))},h))}};li.propTypes={id:i.number,max:i.instanceOf(Date),min:i.instanceOf(Date),part:function(e,t,i){const s=e[t];if(!s||!ri[s.type])throw new Error(`\n Invalid prop '${t}' supplied to ${i}.\n Supported part types are hour|minute|second|dayperiod.\n `);return null},step:function(e,t,i){const s=e[t];if(void 0!==s&&s<=0)throw new Error(`\n Invalid prop '${t}' supplied to ${i}.\n ${t} cannot be less than 1.\n `);return null},value:i.instanceOf(Date),smoothScroll:i.bool,show:i.bool},li.defaultProps={boundRange:!1,max:N,min:E,step:1,smoothScroll:!0};let hi=li;n.registerForIntl(hi);const ci=new RegExp(`${at}|${nt}|${ot}|${st}|literal`),di=class e extends u.Component{constructor(t){super(t),this._element=null,this._nowButton=null,this.dateFormatParts=[],this.timeLists=[],this.focus=(e,t)=>{Promise.resolve().then((()=>{t&&this._nowButton&&this._nowButton.element&&this._nowButton.element.focus();const i=this.timeLists[0];!t&&-1===this.state.activeListIndex&&!this.hasActiveButton()&&i&&i.element&&i.focus(e)}))},this.timeFormatReducer=(e,t)=>e+t.pattern,this.timeFormatFilter=(e,t,i)=>{const s=t>=1&&i[t-1];return s&&s&&"literal"===e.type?ci.test(s.type||""):ci.test(e.type||"")},this.focusList=e=>{this.timeLists.length&&this.timeLists.reduce(this.listReducer,[]).map((t=>1===e?t.next:t.prev)).map((e=>e&&e.element&&e.element.focus({preventScroll:!0})))},this.listReducer=(e,t,i,s)=>e.length||t.props.id!==this.state.activeListIndex?e:[{next:s[i+1]||t,prev:s[i-1]||t}],this.showNowButton=()=>!this.hasSteps()&&this.props.nowButton&&wt(gt(),this.min,this.max),this.handleKeyDown=e=>{const{keyCode:t}=e;switch(t){case s.Keys.left:return e.preventDefault(),void this.focusList(0);case s.Keys.right:return e.preventDefault(),void this.focusList(1);default:return}},this.handleListBlur=()=>{this.nextTick((()=>{this.setState({activeListIndex:-1})}))},this.handleListFocus=e=>{clearTimeout(this.nextTickId),this.setState({activeListIndex:e})},this.handleChange=e=>{const{onChange:t}=this.props;t&&t.call(void 0,e)},this.snapTime=dt(ct(this.props.steps,this.props.min||e.defaultProps.min)),this.state={activeListIndex:-1},this.hasActiveButton=this.hasActiveButton.bind(this)}get element(){return this._element}get value(){return((e,t,i)=>{if(!e||!t||!i)return e;const{candidateValue:s,minValue:a,maxValue:n}=ft(e,t,i);return s<a?F(e,t):s>n?F(e,i):e})(this.snapTime(a.cloneDate(this.props.value||E)),this.min,this.max)}get intl(){return n.provideIntlService(this)}get min(){return this.snapTime(this.props.min||e.defaultProps.min)}get max(){return this.snapTime(this.props.max||e.defaultProps.max)}get steps(){return this.props.steps||e.defaultProps.steps}get boundRange(){return void 0!==this.props.boundRange?this.props.boundRange:e.defaultProps.boundRange}componentWillUnmount(){clearTimeout(this.nextTickId)}componentDidMount(){const{onMount:e}=this.props;e&&e.call(void 0,this.value)}render(){const{format:t,smoothScroll:i,onNowClick:a,className:r,disabled:l,mobileMode:h,show:c,onNowKeyDown:d,unstyled:p}=this.props,m=p&&p.uTime;this.snapTime=dt(ct(this.steps,this.min)),this.dateFormatParts=this.intl.splitDateFormat(t||e.defaultProps.format).filter(this.timeFormatFilter);const g=s.classNames(s.uTime.part({c:m,mobileMode:h,disabled:l}),r);this.timeLists=[];const v=n.provideLocalizationService(this),f=v.toLanguageString(ce,ye[ce]);return u.createElement("div",{className:g},u.createElement("div",{className:s.classNames(s.uTime.header({c:m}))},u.createElement("span",{className:s.classNames(s.uTime.title({c:m}))},this.intl.formatDate(this.value,this.dateFormatParts.reduce(this.timeFormatReducer,""))),this.showNowButton()&&u.createElement(o.Button,{type:"button",ref:e=>{this._nowButton=e},className:s.classNames(s.uTime.now({c:m})),fillMode:"flat",themeColor:"base",title:f,onKeyDown:d,"aria-label":f,onClick:a,tabIndex:l?-1:0},v.toLanguageString(he,ye[he]))),u.createElement("div",{className:s.classNames(s.uTime.listContainer({c:m})),onKeyDown:this.handleKeyDown},u.createElement("span",{className:s.classNames(s.uTime.highlight({c:m}))}),this.dateFormatParts.map(((e,t)=>"literal"!==e.type?u.createElement("div",{key:t,className:s.classNames(s.uTime.listWrapper({c:m,focused:t===this.state.activeListIndex})),role:"presentation",tabIndex:-1},u.createElement("span",{className:s.classNames(s.uTime.title({c:m})),onMouseDown:e=>{e.preventDefault()}},this.intl.dateFieldName(e)),u.createElement(hi,{min:this.min,max:this.max,boundRange:this.boundRange,part:e,step:e.type?this.steps[e.type]:1,smoothScroll:i,ref:e=>{e&&this.timeLists.push(e)},id:t,onFocus:()=>{this.handleListFocus(t)},onBlur:this.handleListBlur,onChange:this.handleChange,value:this.value,disabled:l,show:c,mobileMode:h,unstyled:p})):u.createElement("div",{key:t,className:s.classNames(s.uTime.separator({c:m}))},e.pattern)))))}nextTick(e){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout((()=>e()))}hasActiveButton(){const e=s.getActiveElement(document);return this._nowButton&&e===this._nowButton.element}hasSteps(){const e=Object.keys(this.steps);return e.length!==e.reduce(((e,t)=>e+this.steps[t]),0)}};di.propTypes={cancelButton:i.bool,disabled:i.bool,format:i.oneOfType([i.string,i.shape({skeleton:i.string,pattern:i.string,date:i.oneOf(["short","medium","long","full"]),time:i.oneOf(["short","medium","long","full"]),datetime:i.oneOf(["short","medium","long","full"]),era:i.oneOf(["narrow","short","long"]),year:i.oneOf(["numeric","2-digit"]),month:i.oneOf(["numeric","2-digit","narrow","short","long"]),day:i.oneOf(["numeric","2-digit"]),weekday:i.oneOf(["narrow","short","long"]),hour:i.oneOf(["numeric","2-digit"]),hour12:i.bool,minute:i.oneOf(["numeric","2-digit"]),second:i.oneOf(["numeric","2-digit"]),timeZoneName:i.oneOf(["short","long"])})]),max:i.instanceOf(Date),min:i.instanceOf(Date),nowButton:i.bool,steps:i.shape({hour:i.number,minute:i.number,second:i.number}),smoothScroll:i.bool,tabIndex:i.number,value:i.instanceOf(Date),show:i.bool},di.defaultProps={value:null,disabled:!1,nowButton:!0,cancelButton:!0,format:"hh:mm a",min:P,max:N,steps:{},boundRange:!1};let ui=di;n.registerForIntl(ui),n.registerForLocalization(ui);const pi=class e extends u.Component{constructor(t){super(t),this._element=null,this._cancelButton=null,this._acceptButton=null,this.timePart=null,this.focusActiveList=()=>{this.timePart&&this.timePart.focus({preventScroll:!0})},this.handleKeyDown=e=>{const{keyCode:t}=e;t!==s.Keys.enter||this.hasActiveButton()||this.handleAccept(e)},this.revertToNowButton=e=>{const{keyCode:t,shiftKey:i}=e;!i&&t===s.Keys.tab&&(e.preventDefault(),!1!==this.props.nowButton?this.timePart&&this.timePart.focus({preventScroll:!0},!0):this.timePart&&this.timePart.focus({preventScroll:!0}))},this.handleNowKeyDown=e=>{var t;const{keyCode:i,shiftKey:a}=e;a&&i===s.Keys.tab?(e.preventDefault(),this._acceptButton&&(null==(t=this._acceptButton.element)||t.focus({preventScroll:!0}))):i===s.Keys.enter&&(e.stopPropagation(),this.handleNowClick(e))},this.handleAccept=e=>{const t=this.mergeValue(a.cloneDate(this.value||gt()),this.timePart?this.timePart.value:this.current);this.setState({value:t}),this.valueDuringOnChange=t;const{onChange:i}=this.props;i&&i.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleReject=e=>{this.setState({current:this.value});const{onReject:t}=this.props;t&&t.call(void 0,e)},this.handleNowClick=e=>{const t=this.mergeValue(a.cloneDate(this.value||gt()),gt());this.setState({current:t,value:t}),this.valueDuringOnChange=t;const{onChange:i}=this.props;i&&i.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleChange=e=>{this.setState({current:e});const{handleTimeChange:t}=this.props;t&&t.call(void 0,{time:e})},this.dateFormatParts=this.intl.splitDateFormat(this.props.format||e.defaultProps.format),this.mergeValue=(e=>(t,i)=>(t.setHours(...e.map((e=>e(t,i)))),t))(ht(this.dateFormatParts)),this.hasActiveButton=this.hasActiveButton.bind(this),this.state={current:this.props.value||E,value:this.props.value||e.defaultProps.value}}get element(){return this._element}get value(){const e=void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.props.value?this.props.value:this.state.value;return null!==e?a.cloneDate(e):null}get intl(){return n.provideIntlService(this)}get current(){return null!==this.state.current?a.cloneDate(this.state.current):null}componentWillUnmount(){clearTimeout(this.nextTickId)}render(){const{format:e,cancelButton:t,disabled:i,tabIndex:a,className:r,smoothScroll:l,min:h,max:c,boundRange:d,nowButton:p,steps:m,show:g,mobileMode:v,unstyled:f}=this.props,w=f&&f.uTimePicker,b=f&&f.uTime,D=n.provideLocalizationService(this),y=D.toLanguageString(de,ye[de]),S=D.toLanguageString(ue,ye[ue]);return u.createElement("div",{ref:e=>{this._element=e},tabIndex:i?void 0:a||0,className:s.classNames(s.uTimePicker.timeSelector({c:w,mobileMode:v,disabled:i}),r),onKeyDown:this.handleKeyDown},u.createElement(ui,{ref:e=>{this.timePart=e},value:this.current,onChange:this.handleChange,onNowClick:this.handleNowClick,format:e,smoothScroll:l,min:h,max:c,boundRange:d,disabled:i,nowButton:p,steps:m,show:g,mobileMode:v,onNowKeyDown:this.handleNowKeyDown,unstyled:f}),this.props.footer&&u.createElement("div",{className:s.classNames(s.uTime.footer({c:b}))},t&&u.createElement(o.Button,{type:"button",ref:e=>{this._cancelButton=e},className:s.classNames(s.uTime.cancel({c:b})),onClick:this.handleReject,title:y,"aria-label":y},y),u.createElement(o.Button,{type:"button",ref:e=>{this._acceptButton=e},className:s.classNames(s.uTime.accept({c:b})),themeColor:"primary",onClick:this.handleAccept,onKeyDown:this.revertToNowButton,title:S,"aria-label":S},S)))}nextTick(e){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout((()=>e()))}hasActiveButton(){if(!this._acceptButton||!this._acceptButton.element)return!1;const e=s.getActiveElement(document);return this._acceptButton&&e===this._acceptButton.element||this._cancelButton&&e===this._cancelButton.element}};pi.propTypes={cancelButton:i.bool,className:i.string,disabled:i.bool,format:i.oneOfType([i.string,i.shape({skeleton:i.string,pattern:i.string,date:i.oneOf(["short","medium","long","full"]),time:i.oneOf(["short","medium","long","full"]),datetime:i.oneOf(["short","medium","long","full"]),era:i.oneOf(["narrow","short","long"]),year:i.oneOf(["numeric","2-digit"]),month:i.oneOf(["numeric","2-digit","narrow","short","long"]),day:i.oneOf(["numeric","2-digit"]),weekday:i.oneOf(["narrow","short","long"]),hour:i.oneOf(["numeric","2-digit"]),hour12:i.bool,minute:i.oneOf(["numeric","2-digit"]),second:i.oneOf(["numeric","2-digit"]),timeZoneName:i.oneOf(["short","long"])})]),max:i.instanceOf(Date),min:i.instanceOf(Date),nowButton:i.bool,steps:i.shape({hour:i.number,minute:i.number,second:i.number}),smoothScroll:i.bool,tabIndex:i.number,value:i.instanceOf(Date),show:i.bool},pi.defaultProps={value:null,disabled:!1,cancelButton:!0,format:"t",min:P,max:N,boundRange:!1,footer:!0};let mi=pi;n.registerForIntl(mi),n.registerForLocalization(mi);const gi=class e extends u.Component{constructor(t){super(t),this._element=null,this._dateInput=u.createRef(),this._timeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.renderTimeSelector=()=>{const{smoothScroll:e,cancelButton:t,nowButton:i,disabled:s,format:a,steps:n,unstyled:o}=this.props;return u.createElement(mi,{ref:this.setTimeSelectorRef,mobileMode:this.mobileMode,show:this.show,cancelButton:t,disabled:s,nowButton:i,format:a,min:this.min,max:this.max,steps:n,smoothScroll:e,value:this.value,footer:!this.mobileMode,handleTimeChange:this.mobileMode&&this.handleTimeChange,onChange:this.handleValueChange,onReject:this.handleValueReject,unstyled:o})},this.renderPopup=()=>{const{popupClass:e,...t}=this.popupSettings,{unstyled:i}=this.props,a=i&&i.uTimePicker,n=s.classNames(e),o={popupClass:s.uTimePicker.popup({c:a}),show:this.show,animate:null!==this.element,anchor:this.element,className:n,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...t};return this.props.popup?u.createElement(this.props.popup,{...o},this.renderTimeSelector()):u.createElement(h.Popup,{...o},this.renderTimeSelector())},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:e,footer:{cancelText:this.localizationService.toLanguageString(me,ye[de]),onCancel:this.handleValueReject,applyText:this.localizationService.toLanguageString(ue,ye[ue]),onApply:e=>this.handleValueChange(e)}};return u.createElement(Tt,{...t},u.createElement(c.ActionSheetContent,{overflowHidden:!0},this.renderTimeSelector()))},this.setTimeSelectorRef=e=>{this._timeSelector=e},this.nextValue=(e,t)=>void 0!==e.value?e.value:t.value,this.nextShow=(e,t)=>void 0!==e.show?e.show:t.show,this.handleInputValueChange=e=>{const t=this.mergeTime(e.value);this.handleValueChange({...e,value:t})},this.handleTimeChange=e=>{this.setState({candidate:e.time})},this.handleValueChange=e=>{this.setState({value:a.cloneDate(e.value||this.state.candidate)}),this.valueDuringOnChange=e.value,this.showDuringOnChange=!1,this.shouldFocusDateInput=!0;const{onChange:t}=this.props,i=this.state.candidate||this.value;t&&t.call(void 0,{syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:i,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.handleValueReject=e=>{this.setShow(!1)},this.handleIconClick=e=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:t,keyCode:i}=e;if(i===s.Keys.esc)return this.shouldFocusDateInput=!0,void this.setShow(!1);t&&(i===s.Keys.up||i===s.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=i===s.Keys.up,this.setShow(i===s.Keys.down))},s.validatePackage(p),this.state={value:this.props.defaultValue||e.defaultProps.defaultValue,show:this.props.defaultShow||e.defaultProps.defaultShow,focused:!1,candidate:null},this.normalizeTime=this.normalizeTime.bind(this),this.setShow=this.setShow.bind(this),this.mergeTime=this.mergeTime.bind(this)}get _popupId(){return this.props.id+"-popup-id"}get document(){if(s.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get dateInput(){return this._dateInput.current}get timeSelector(){return this._timeSelector}get value(){const e=void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.props.value?this.props.value:this.state.value;return null!==e?a.cloneDate(e):null}get show(){return void 0!==this.showDuringOnChange?this.showDuringOnChange:void 0!==this.props.show?this.props.show:this.state.show}get name(){return this.props.name}get validity(){const e=this.value&&this.normalizeTime(this.value),t=this.normalizeTime(this.min),i=this.normalizeTime(this.max),s=bt(e,t,i),a=void 0!==this.props.validationMessage,n=(!this.required||null!==this.value)&&s,o=void 0!==this.props.valid?this.props.valid:n;return{customError:a,rangeOverflow:yt(e,i),rangeUnderflow:Dt(e,t),valid:o,valueMissing:null===this.value}}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=Vt&&this.props.adaptive)}get validityStyles(){return void 0!==this.props.validityStyles?this.props.validityStyles:e.defaultProps.validityStyles}get required(){return void 0!==this.props.required?this.props.required:e.defaultProps.required}get popupSettings(){return this.props.popupSettings||e.defaultProps.popupSettings}get min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}get dateInputComp(){return this.props.dateInput||e.defaultProps.dateInput}get localizationService(){return n.provideLocalizationService(this)}componentDidMount(){var e;this.observerResize=s.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this._timeSelector&&this.show&&!this.prevShow?this._timeSelector.focusActiveList():this.dateInput&&this.dateInput.element&&!this.show&&this.shouldFocusDateInput&&this.dateInput.element.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var e;null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:t=e.defaultProps.size,rounded:i=e.defaultProps.rounded,fillMode:a=e.defaultProps.fillMode,disabled:n,tabIndex:l,title:h,id:c,className:d,format:p,formatPlaceholder:m,width:g,name:v,steps:f,validationMessage:w,required:b,validityStyles:D,ariaLabelledBy:y,ariaDescribedBy:S,unstyled:k}=this.props,C=k&&k.uTimePicker,x=!this.validityStyles||this.validity.valid,I={disabled:n,format:p,formatPlaceholder:m,id:c,ariaLabelledBy:y,ariaDescribedBy:S,max:this.normalizeTime(this.max),min:this.normalizeTime(this.min),name:v,onChange:this.handleInputValueChange,required:b,steps:f,tabIndex:this.show?-1:l,title:h,valid:this.validity.valid,validationMessage:w,validityStyles:D,value:this.value&&this.normalizeTime(this.value),label:void 0,placeholder:this.state.focused?null:this.props.placeholder,ariaHasPopup:"dialog",ariaExpanded:this.show,size:null,fillMode:null,rounded:null,readonly:this.mobileMode},M=this.localizationService.toLanguageString(me,ye[me]),O=this.localizationService.toLanguageString(pe,ye[pe]),E=u.createElement(s.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},(({onFocus:e,onBlur:l})=>u.createElement(u.Fragment,null,u.createElement("span",{id:this.props.id,ref:e=>{this._element=e},className:s.classNames(s.uTimePicker.wrapper({c:C,size:t,rounded:i,fillMode:a,invalid:!x,required:this.required,disabled:n}),d),onKeyDown:this.handleKeyDown,style:{width:g},onFocus:e,onBlur:l,onClick:this.mobileMode?this.handleIconClick:void 0},u.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,...I}),u.createElement(o.Button,{tabIndex:-1,type:"button",icon:"clock",svgIcon:r.clockIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleIconClick,title:O,className:s.classNames(s.uTimePicker.inputButton({c:C})),rounded:null,fillMode:a,"aria-label":M}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup())));return this.props.label?u.createElement(Et,{dateInput:this._dateInput,label:this.props.label,editorId:c,editorValid:x,editorDisabled:this.props.disabled,children:E,style:{width:this.props.width}}):E}normalizeTime(e){return F(E,e)}setShow(e){const{onOpen:t,onClose:i}=this.props;this.show!==e&&(this.setState({show:e}),e&&t&&t.call(void 0,{target:this}),!e&&i&&i.call(void 0,{target:this}))}mergeTime(e){return this.value&&e?F(this.value,e):e}calculateMedia(e){for(let t of e)this.setState({windowWidth:t.target.clientWidth})}};gi.displayName="TimePicker",gi.propTypes={className:i.string,cancelButton:i.bool,nowButton:i.bool,defaultShow:i.bool,defaultValue:i.instanceOf(Date),disabled:i.bool,format:i.oneOfType([i.string,i.shape({skeleton:i.string,pattern:i.string,date:i.oneOf(["short","medium","long","full"]),time:i.oneOf(["short","medium","long","full"]),datetime:i.oneOf(["short","medium","long","full"]),era:i.oneOf(["narrow","short","long"]),year:i.oneOf(["numeric","2-digit"]),month:i.oneOf(["numeric","2-digit","narrow","short","long"]),day:i.oneOf(["numeric","2-digit"]),weekday:i.oneOf(["narrow","short","long"]),hour:i.oneOf(["numeric","2-digit"]),hour12:i.bool,minute:i.oneOf(["numeric","2-digit"]),second:i.oneOf(["numeric","2-digit"]),timeZoneName:i.oneOf(["short","long"])})]),formatPlaceholder:i.oneOfType([i.oneOf(["wide","narrow","short","formatPattern"]),i.shape({year:i.string,month:i.string,day:i.string,hour:i.string,minute:i.string,second:i.string})]),id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,min:i.instanceOf(Date),max:i.instanceOf(Date),name:i.string,popupSettings:i.shape({animate:i.bool,appendTo:i.any,popupClass:i.string}),show:i.bool,steps:i.shape({hour:i.number,minute:i.number,second:i.number}),smoothScroll:i.bool,tabIndex:i.number,title:i.string,value:i.instanceOf(Date),width:i.oneOfType([i.number,i.string]),validationMessage:i.string,required:i.bool,validate:i.bool,valid:i.bool,size:i.oneOf([null,"small","medium","large"]),rounded:i.oneOf([null,"small","medium","large","full"]),fillMode:i.oneOf([null,"solid","flat","outline"])},gi.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"t",max:N,min:P,popupSettings:{},tabIndex:0,steps:{},required:!1,validityStyles:!0,dateInput:It,size:"medium",rounded:"medium",fillMode:"solid"};let vi=gi;const fi=s.createPropsContext(),wi=s.withIdHOC(s.withPropsContext(fi,s.withUnstyledHOC(vi)));wi.displayName="KendoReactTimePicker",n.registerForLocalization(vi);const bi=class e extends u.Component{constructor(e){super(e),this._element=null,this.isActive=!1,this.focusActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus"),t=this._element.querySelector(".k-state-pending-focus");e&&e[0]&&e[0].classList.remove("k-focus"),t&&t.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus");e&&e.classList.remove("k-focus"),this.isActive=!1},this.rotateSelectionRange=e=>{if(null===e.start||null===e.end)return e;const t=e.end<e.start;return{start:t?e.end:e.start,end:t?e.start:e.end}},this.handleWeekCellClick=(e,t,i)=>{const{onWeekSelect:s}=this.props;s&&i&&s.call(void 0,e,t,i)},this.handleDateChange=(e,t=!1)=>{const{onChange:i}=this.props;if(i){const s={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:a.cloneDate(e.value),target:this,isTodayClick:t};i.call(void 0,s)}}}get element(){return this._element}get weekNumber(){return!(!this.props.showWeekNumbers||this.props.activeView!==x.month)}get min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}componentDidUpdate(){this.isActive&&this.focusActiveDate()}render(){const e=this.props.allowReverse?this.rotateSelectionRange(this.props.selectionRange):this.props.selectionRange,t=s.classNames("k-calendar-view k-align-items-start k-justify-content-center",{"k-vstack":this.props.verticalView,"k-hstack":!this.props.verticalView,"k-calendar-monthview":this.props.activeView===x.month,"k-calendar-yearview":this.props.activeView===x.year,"k-calendar-decadeview":this.props.activeView===x.decade,"k-calendar-centuryview":this.props.activeView===x.century});return u.createElement("div",{ref:e=>{this._element=e},className:t},this.props.dates.map((t=>u.createElement("table",{className:"k-calendar-table",key:t.getTime(),role:"grid"},u.createElement($,{bus:this.props.bus,weekDaysFormat:this.props.weekDaysFormat,service:this.props.service,key:t.getTime(),direction:"horizontal",activeView:this.props.activeView,cellUID:this.props.cellUID,viewDate:t,min:this.min,max:this.max,focusedDate:this.props.focusedDate,selectionRange:e,selectedDate:this.props.value,showWeekNumbers:this.weekNumber,onChange:this.handleDateChange,onWeekSelect:this.handleWeekCellClick,onCellEnter:this.props.onCellEnter,cell:this.props.cell,weekCell:this.props.weekCell,showOtherMonthDays:this.props.showOtherMonthDays,allowReverse:this.props.allowReverse})))))}};bi.defaultProps={showWeekNumbers:!1,views:2,take:2,allowReverse:!0,weekDaysFormat:"short",min:T,max:V};let Di=bi;const yi=(e=Ii.defaultProps.min,t=Ii.defaultProps.max,i)=>i instanceof Date&&!Array.isArray(i)&&L(a.getDate(i),e,t)?a.getDate(i):null,Si=(e=Ii.defaultProps.min,t=Ii.defaultProps.max,i)=>Array.isArray(i)?i.filter((i=>L(i,e,t))).map((e=>a.getDate(e))):null,ki=e=>"object"!=typeof e||e instanceof Date||null===e||Array.isArray(e)?I:e,Ci=(e,t,i)=>e||t&&t[0]||i&&i.start,xi=class e extends u.Component{constructor(t){super(t),this.dates=[],this.selectedDate=null,this.selectedMultiple=null,this.selectedRange=I,this._focusedDate=new Date,this.cellUID=this.props.id+"-cell-uid",this.activeRangeEnd="start",this._element=null,this.intl=null,this.localization=null,this.service=null,this.calendarViewList=null,this.isActive=!1,this.calculateFocusFromValue=!0,this.focus=()=>{this._element&&this._element.focus()},this.clampRange=e=>({start:e,end:null}),this.rangeWithFocused=(e,t)=>({start:e.start,end:null===e.end&&null!==e.start&&this.isActive?t:e.end}),this.generateRange=(e,t)=>{const{end:i,start:s}=t,a=null!==t.start&&e.getTime()<=t.start.getTime();return!this.props.allowReverse&&a?{start:e,end:this.selectedRange.start}:"end"!==this.activeRange?{start:e,end:i}:{start:s||this.selectedDate,end:e}},this.canNavigate=e=>{if(!this.service)return!1;const t=this.service.move(this.focusedDate,e);return this.min<=t&&t<=this.max||this.service.isInSameView(t,this.min)||this.service.isInSameView(t,this.max)},this.navigate=(e,t)=>{this.calculateFocusFromValue=!1;const i=this.move(e,t);this.setState({navigateDate:i,focusedDate:i})},this.move=(e,t)=>this.clampDate(this.service.move(t,e)),this.clampDate=e=>z(e,this.min,this.max),this.shouldAutoCorrect=(e,t)=>{const{end:i,start:s}=t;return"end"!==this.activeRange?null!==i&&e>i:null!==s&&e<s},this.handleCellEnter=e=>{"range"===this.props.mode&&(this.calculateFocusFromValue=!1,this.setState({focusedDate:e}))},this.handleMouseDown=e=>{e.preventDefault()},this.handleClick=e=>{this._element&&this._element.focus({preventScroll:!0})},this.handleFocus=e=>{if(this.isActive=!0,!this.calendarViewList)return;this.calendarViewList.focusActiveDate();const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleBlur=e=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.handleTodayClick=e=>{this.todayIsInRange&&this.handleDateChange(e)},this.handlePrevButtonClick=()=>{const e=Ee.PrevView;if(this.state.activeView>0&&this.focusedDate.getFullYear()>this.dates[0].getFullYear())this.navigate(e,this.move(e,this.focusedDate));else{const t=this.isInMonth(this.focusedDate,this.dates[1])?this.move(e,this.focusedDate):this.focusedDate;this.navigate(e,t)}},this.handleNextButtonClick=()=>{this.navigate(Ee.NextView,this.focusedDate)},this.handleKeyDown=e=>{const{keyCode:t,ctrlKey:i,metaKey:n}=e;if(84===t){const e=R();this.calculateFocusFromValue=!1,this.setState({focusedDate:e,navigateDate:e})}if((i||n)&&(t===s.Keys.left&&this.handlePrevButtonClick(),t===s.Keys.right&&this.handleNextButtonClick()),t===s.Keys.enter){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(t)}else{const t=z(this.navigation.move(this.focusedDate,this.navigation.action(e),this.state.activeView,this.service,e),this.min,this.max);if(a.isEqualDate(this.focusedDate,t))return;this.dates&&this.service&&!this.service.isInArray(t,this.dates)&&this.setState({navigateDate:t}),this.calculateFocusFromValue=!1,this.setState({focusedDate:t})}e.preventDefault()},this.handleViewChange=({view:e})=>{this.calculateFocusFromValue=!1,this.setState((t=>({activeView:e,navigateDate:t.focusedDate})))},this.handleWeekSelection=(e,t,i)=>{if("single"===this.props.mode)return;const s=0===t?e:a.addDays(e,-t),n=6===t?e:a.addDays(e,6-t);let o=null;if("multiple"===this.props.mode){o=[];for(let e=0;e<=6;e++)o.push(a.addDays(s,e));this.setState({value:o,focusedDate:e})}"range"===this.props.mode&&(o={start:s,end:n},this.setState({value:o,focusedDate:e}));const{onChange:r}=this.props;if(r){const e={syntheticEvent:i,nativeEvent:i.nativeEvent,value:o,target:this};r.call(void 0,e)}},this.handleDateChange=e=>{const t=a.cloneDate(e.value),i=this.bus.canMoveDown(this.state.activeView);if(this.props.disabled)return;if(i){if(!e.isTodayClick)return this.bus.moveDown(this.state.activeView,e.syntheticEvent),void this.setState({focusedDate:t,navigateDate:t});this.bus.moveToBottom(this.state.activeView)}let s;switch(this.calculateFocusFromValue=!0,this.props.mode){case"single":default:s=a.cloneDate(e.value);break;case"multiple":if(Array.isArray(this.selectedMultiple)){const t=this.selectedMultiple.slice();let i=-1;t.forEach(((t,s)=>{a.isEqualDate(t,e.value)&&(i=s)})),-1!==i?t.splice(i,1):t.push(a.cloneDate(e.value)),s=t.slice()}else s=this.selectedDate?[a.cloneDate(this.selectedDate),a.cloneDate(e.value)]:[a.cloneDate(e.value)];break;case"range":s=null!==this.selectedRange.start&&null!==this.selectedRange.end&&"start"===this.activeRange?this.clampRange(e.value):this.generateRange(e.value,this.selectedRange),this.activeRangeEnd="end"!==this.activeRange?"end":"start"}this.valueDuringOnChange=s,e.isTodayClick&&this.setState({navigateDate:t}),this.setState({value:s,focusedDate:t}),this.valueDuringOnChange=s;const{onChange:n}=this.props;if(n){const t={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:s,target:this};n.call(void 0,t)}this.valueDuringOnChange=void 0};const i=void 0!==t.value?t.value:t.defaultValue||e.defaultProps.defaultValue,n=yi(this.min,this.max,i),o=Si(this.min,this.max,i),r=ki(i),l=Ci(n,o,r),h=O(x[t.defaultActiveView],this.bottomView,this.topView),c=z(t.focusedDate||l||R(),this.min,this.max);this.state={value:i,activeView:h,focusedDate:c,navigateDate:c},this.activeRangeEnd=((e,t)=>null===e.start&&null===t?"start":null===e.end?"end":"start")(r,n),this.bus=new Ke(this.handleViewChange),this.navigation=new Ye(this.bus),this.calculateFocusFromValue=!1,this.lastView=h,this.lastViewsCount=this.props.views||Di.defaultProps.views}get wrapperID(){return this.props.id+"-wrapper-id"}get isRtl(){return"rtl"===this.props.dir}get element(){return this._element}get value(){return void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.props.value?this.props.value:this.state.value}get focusedDate(){return a.cloneDate(this._focusedDate)}get min(){return a.getDate(void 0!==this.props.min?this.props.min:e.defaultProps.min)}get max(){return a.getDate(void 0!==this.props.max?this.props.max:e.defaultProps.max)}get bottomView(){return x[void 0!==this.props.bottomView?this.props.bottomView:e.defaultProps.bottomView]}get topView(){return x[void 0!==this.props.topView?this.props.topView:e.defaultProps.topView]}get activeRange(){return void 0!==this.props.activeRangeEnd?this.props.activeRangeEnd:this.activeRangeEnd}get todayIsInRange(){return L(R(),a.getDate(this.min),a.getDate(this.max))}componentDidMount(){this.calculateFocusFromValue=!0}componentDidUpdate(){this.calendarViewList&&(this.isActive?this.calendarViewList.focusActiveDate:this.calendarViewList.blurActiveDate)();const e=yi(this.min,this.max,this.value);this.calculateFocusFromValue=!!(this.selectedDate&&e&&this.selectedDate.getTime()&&e.getTime()),this.lastView=this.state.activeView,this.lastViewsCount=this.props.views||Di.defaultProps.views}render(){this.props._ref&&this.props._ref(this),this.intl=n.provideIntlService(this),this.localization=n.provideLocalizationService(this),this.bus.configure(this.bottomView,this.topView);const e=O(this.state.activeView,this.bottomView,this.topView);this.service=this.bus.service(e,this.intl),this.selectedDate=yi(this.min,this.max,this.value),this.selectedMultiple=Si(this.min,this.max,this.value),this.selectedRange=ki(this.value);const t=Ci(this.selectedDate,this.selectedMultiple,this.selectedRange);this._focusedDate=z(this.calculateFocusFromValue&&null!==t?t:this.state.focusedDate,this.min,this.max);const i=s.classNames("k-calendar k-calendar-range k-calendar-md",{"k-disabled":this.props.disabled},this.props.className),l=this.rangeWithFocused(this.selectedRange,this.focusedDate),h=this.localization.toLanguageString(X,ye[X]),c=this.localization.toLanguageString(J,ye[J]),d=!this.canNavigate(Ee.PrevView),p=!this.canNavigate(Ee.NextView),m={"aria-disabled":d},g={"aria-disabled":p},v=this.lastView!==e,f=this.dates&&this.isInMonth(this.state.navigateDate,this.dates[0]),w=this.lastViewsCount!==this.props.views;(!f||v||w)&&(this.dates=this.service.datesList(this.state.navigateDate,this.props.views||Di.defaultProps.views));const b=a.cloneDate(this.dates&&this.dates[0]?this.dates[0]:R());return u.createElement("div",{ref:e=>{this._element=e},className:i,id:this.props.id||this.wrapperID,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,tabIndex:this.props.disabled?void 0:this.props.tabIndex,onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseDown:this.handleMouseDown,onClick:this.handleClick,onKeyDown:this.handleKeyDown,"aria-disabled":this.props.disabled,dir:this.props.dir},u.createElement(G,{key:`.kendo.calendar.header.${b.getTime()}`,activeView:e,currentDate:b,min:this.min,max:this.max,rangeLength:this.props.views,bus:this.bus,service:this.service,headerTitle:this.props.headerTitle,verticalView:this.props.mobileMode,commands:u.createElement(u.Fragment,null,u.createElement(o.Button,{type:"button",className:"k-calendar-nav-prev",icon:this.isRtl?"chevron-right":"chevron-left",svgIcon:this.isRtl?r.chevronRightIcon:r.chevronLeftIcon,fillMode:"flat",title:h,disabled:d,onClick:this.handlePrevButtonClick,...m}),u.createElement(ke,{min:this.min,max:this.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange}),u.createElement(o.Button,{type:"button",className:"k-calendar-nav-next",icon:this.isRtl?"chevron-left":"chevron-right",svgIcon:this.isRtl?r.chevronLeftIcon:r.chevronRightIcon,fillMode:"flat",title:c,disabled:p,onClick:this.handleNextButtonClick,...g}))}),u.createElement(Di,{ref:e=>{this.calendarViewList=e},dates:this.dates,activeView:e,focusedDate:this.focusedDate,weekDaysFormat:this.props.weekDaysFormat,min:this.min,max:this.max,bus:this.bus,service:this.service,selectionRange:l,value:this.selectedMultiple||this.selectedDate,cellUID:this.cellUID,views:this.props.views,onChange:this.handleDateChange,onWeekSelect:this.handleWeekSelection,showWeekNumbers:this.props.weekNumber,onCellEnter:this.handleCellEnter,cell:this.props.cell,weekCell:this.props.weekCell,headerTitle:this.props.headerTitle,verticalView:this.props.mobileMode,showOtherMonthDays:this.props.showOtherMonthDays,allowReverse:this.props.allowReverse}))}isInMonth(e,t){return!!t&&a.firstDayOfMonth(t)<=e&&e<=a.lastDayOfMonth(t)}};xi.displayName="MultiViewCalendar",xi.propTypes={activeRangeEnd:i.oneOf(["start","end"]),allowReverse:i.bool,bottomView:i.oneOf(["month","year","decade","century"]),className:i.string,defaultActiveView:i.oneOf(["month","year","decade","century"]),defaultValue:i.oneOfType([M(i.instanceOf(Date)),i.arrayOf(i.instanceOf(Date)),i.shape({start:M(i.instanceOf(Date)),end:M(i.instanceOf(Date))})]),disabled:i.bool,focusedDate:i.instanceOf(Date),id:i.string,weekDaysFormat:i.oneOf(["narrow","short","abbreviated"]),ariaLabelledBy:i.string,ariaDescribedBy:i.string,max:i.instanceOf(Date),min:i.instanceOf(Date),mode:i.oneOf(["single","multiple","range"]),onBlur:i.func,onChange:i.func,onFocus:i.func,tabIndex:i.number,topView:i.oneOf(["month","year","decade","century"]),value:i.oneOfType([M(i.instanceOf(Date)),i.arrayOf(i.instanceOf(Date)),i.shape({start:M(i.instanceOf(Date).isRequired),end:M(i.instanceOf(Date).isRequired)})]),views:(e,t,i)=>{const s=e[t];return void 0!==s&&s<1?new Error(`Invalid prop '${t}' supplied to'${i}'. The '${t}' property cannot be less than 1'`):null},weekNumber:i.bool,showOtherMonthDays:i.bool,dir:i.string},xi.defaultProps={disabled:!1,min:T,max:V,navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",weekDaysFormat:"short",tabIndex:0,bottomView:"month",views:2,allowReverse:!1,showOtherMonthDays:!1};let Ii=xi;const Mi=s.createPropsContext(),Oi=s.withIdHOC(s.withPropsContext(Mi,Ii));Oi.displayName="KendoReactMultiViewCalendar",n.registerForIntl(Ii),n.registerForLocalization(Ii);const Ei=class e extends u.Component{constructor(t){super(t),this._element=null,this._calendar=null,this._startDateInput=u.createRef(),this._endDateInput=u.createRef(),this.shouldFocusDateInput=!1,this.shouldFocusCalendar=!1,this.focus=()=>{this.startDateInput&&this.startDateInput.focus()},this.setCalendarRef=e=>{this._calendar=e},this.focusCalendarElement=()=>{this._calendar&&this._calendar.element&&this._calendar.element.focus({preventScroll:!0})},this.calculateValue=(e,t)=>(void 0!==e.value?e.value:t.value)||I,this.calculateShow=(e,t)=>void 0!==e.show?e.show:t.show,this.renderCalendar=()=>{const e=this.value||I,t={min:this.min,max:this.max,allowReverse:this.props.allowReverse,mode:"range",focusedDate:this.props.focusedDate,disabled:this.props.disabled,className:this.mobileMode?"k-calendar-lg":"",mobileMode:this.mobileMode,...this.props.calendarSettings,value:e,dir:this.props.dir,onChange:this.handleCalendarChange};return this.props.calendar?u.createElement(this.props.calendar,{...t}):u.createElement(Oi,{...t,ref:this.setCalendarRef})},this.renderPopup=()=>{const e={popupClass:s.classNames("k-calendar-container","k-daterangepicker-popup"),animate:null!==this._element,anchor:this._element,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...this.props.popupSettings,show:this.show};return this.props.popup?u.createElement(this.props.popup,{...e},this.renderCalendar()):u.createElement(h.Popup,{...e},this.renderCalendar())},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t={expand:this.show,onClose:e=>this.handleCancel(e),adaptiveTitle:this.props.adaptiveTitle,windowWidth:e,footer:{cancelText:this.localizationService.toLanguageString(be,ye[be]),onCancel:this.handleCancel,applyText:this.localizationService.toLanguageString(De,ye[De]),onApply:this.handleBlur}};return u.createElement(Tt,{...t},u.createElement(c.ActionSheetContent,{overflowHidden:!0},u.createElement("div",{className:"k-scrollable-wrap"},this.renderCalendar())))},this.handleReverseClick=e=>{const t={start:this.value.end,end:this.value.start},i={syntheticEvent:e,nativeEvent:e.nativeEvent};this.handleChange(t,i)},this.handleReverseMouseDown=e=>{e.preventDefault()},this.handleFocus=e=>{clearTimeout(this.nextTickId),this.shouldFocusDateInput||this.mobileMode&&this.setState({currentValue:this.value});const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleClick=()=>{this.shouldFocusDateInput||this.setShow(!0)},this.handleBlur=e=>{this.nextTick((()=>{this.setShow(!1)}));const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.handleCancel=e=>{this.nextTick((()=>{this.setShow(!1),this.setState({currentValue:I})}));const{onCancel:t}=this.props;t&&t.call(void 0,e)},this.handleEndChange=e=>{const t={start:this.value.start,end:a.cloneDate(e.value||void 0)};this.handleChange(t,e)},this.handleStartChange=e=>{const t={start:a.cloneDate(e.value||void 0),end:this.value.end};this.handleChange(t,e)},this.extractRangeFromValue=e=>{if(!(Array.isArray(e.value)||e.value instanceof Date))return e.value||I;const t=Array.isArray(e.value)?e.value[0]:e.value;return{start:null!==this.value.end?t:this.value.start,end:null!==this.value.start?t:this.value.end}},this.handleCalendarChange=e=>{const t=this.extractRangeFromValue(e);this.handleChange(t,e)},this.handleKeyDown=e=>{const{keyCode:t,altKey:i}=e;t===s.Keys.esc?(e.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1)):i&&t===s.Keys.down?(e.preventDefault(),this.shouldFocusCalendar=!0,this.setShow(!0),this.focusCalendarElement()):i&&t===s.Keys.up&&(e.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1))},this.handleChange=(e,t)=>{this.setState({value:e}),this.valueDuringOnChange=e;const{onChange:i}=this.props;if(i){const e={syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:this.value,show:this.show,target:this};i.call(void 0,e)}this.valueDuringOnChange=void 0},s.validatePackage(p),this.state={show:this.props.show||this.props.defaultShow||e.defaultProps.defaultShow,value:this.props.value||this.props.defaultValue||e.defaultProps.defaultValue,currentValue:I},this.nextTick=this.nextTick.bind(this),this.setShow=this.setShow.bind(this),this.focusCalendarElement=this.focusCalendarElement.bind(this),this.focusDateInputElement=this.focusDateInputElement.bind(this)}get _popupId(){return this.props.id+"-popup-id"}get _startInputId(){return this.props.id+"-start-input-id"}get _endInputId(){return this.props.id+"-end-input-id"}get element(){return this._element}get startDateInput(){return this._startDateInput.current}get endDateInput(){return this._endDateInput.current}get calendar(){return this._calendar}get value(){return(void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.props.value?this.props.value:this.state.value)||I}get show(){return void 0!==this.showDuringOnChange?this.showDuringOnChange:void 0!==this.props.show?this.props.show:this.state.show}get min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}get document(){if(s.canUseDOM)return this.element&&this.element.ownerDocument||document}get localizationService(){return n.provideLocalizationService(this)}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=Vt&&this.props.adaptive)}componentDidMount(){var e;this.observerResize=s.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this.shouldFocusCalendar&&this.focusCalendarElement(),this.shouldFocusDateInput&&this.focusDateInputElement(),this.shouldFocusCalendar=!1,this.shouldFocusDateInput=!1}componentWillUnmount(){var e;clearTimeout(this.nextTickId),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect()}render(){const e=this.value||I,t=this.mobileMode&&this.show?this.state.currentValue:e,i=(this.props.startDateInputSettings||{}).id||this._startInputId,a=(this.props.endDateInputSettings||{}).id||this._endInputId,l=s.classNames("k-daterangepicker",{"k-disabled":this.props.disabled},this.props.className),h=this.localizationService.toLanguageString(ne,ye[ne]),c=this.localizationService.toLanguageString(oe,ye[oe]),d=this.localizationService.toLanguageString(re,ye[re]),p={disableSelection:this.mobileMode&&!0,label:h,format:this.props.format,min:this.min,max:this.max,id:this._startInputId,disabled:this.props.disabled,valid:this.props.valid,tabIndex:this.props.tabIndex,ariaExpanded:this.show,clearButton:this.props.clearButton,...this.props.startDateInputSettings,value:t.start,onChange:this.handleStartChange},m={disableSelection:this.mobileMode&&!0,label:c,format:this.props.format,min:this.min,max:this.max,id:this._endInputId,disabled:this.props.disabled,valid:this.props.valid,tabIndex:this.props.tabIndex,ariaExpanded:this.show,clearButton:this.props.clearButton,...this.props.endDateInputSettings,value:t.end,onChange:this.handleEndChange},g=u.createElement(o.Button,{type:"button",className:"k-select",fillMode:"flat",title:n.provideLocalizationService(this).toLanguageString(ae,ye[ae]),onMouseDown:this.handleReverseMouseDown,onClick:this.handleReverseClick,"aria-controls":i+" "+a,"aria-label":n.provideLocalizationService(this).toLanguageString(ae,ye[ae])},u.createElement(s.IconWrap,{style:{transform:"rotate(90deg)"},name:"arrows-swap",icon:r.arrowsSwapIcon}));return u.createElement(u.Fragment,null,u.createElement("span",{ref:e=>{this._element=e},className:l,style:this.props.style,id:this.props.id,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,tabIndex:this.props.tabIndex,onFocus:this.handleFocus,onClick:this.handleClick,onKeyDown:this.handleKeyDown,onBlur:this.mobileMode?void 0:this.handleBlur,dir:this.props.dir},this.props.startDateInput?u.createElement(this.props.startDateInput,{...p}):u.createElement(It,{...p,autoFocus:this.props.autoFocus,ref:this._startDateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode}),(this.props.allowReverse||this.props.calendarSettings&&this.props.calendarSettings.allowReverse)&&this.props.swapButton?g:d,this.props.endDateInput?u.createElement(this.props.endDateInput,{...m}):u.createElement(It,{...m,ref:this._endDateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup())}focusDateInputElement(){if(!(document&&this.startDateInput&&this.startDateInput.element&&this.endDateInput&&this.endDateInput.element))return;const e=s.getActiveElement(document);null!==this.value.start&&null===this.value.end||e===this.endDateInput.element?e!==this.startDateInput.element&&this.endDateInput.element.focus({preventScroll:!0}):this.startDateInput.element.focus({preventScroll:!0})}nextTick(e){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout((()=>e()))}setShow(e){const{onOpen:t,onClose:i}=this.props;this.show!==e&&(this.setState({show:e}),e&&t&&t.call(void 0,{target:this}),!e&&i&&i.call(void 0,{target:this}))}calculateMedia(e){for(const t of e)this.setState({windowWidth:t.target.clientWidth})}};Ei.displayName="DateRangePicker",Ei.propTypes={allowReverse:i.bool,calendarSettings:i.any,className:i.string,defaultShow:i.bool,defaultValue:i.shape({start:M(i.instanceOf(Date).isRequired),end:M(i.instanceOf(Date).isRequired)}),disabled:i.bool,endDateInputSettings:i.shape(Ct.propTypes),focusedDate:i.instanceOf(Date),format:i.oneOfType([i.string,i.shape({skeleton:i.string,pattern:i.string,date:i.oneOf(["short","medium","long","full"]),time:i.oneOf(["short","medium","long","full"]),datetime:i.oneOf(["short","medium","long","full"]),era:i.oneOf(["narrow","short","long"]),year:i.oneOf(["numeric","2-digit"]),month:i.oneOf(["numeric","2-digit","narrow","short","long"]),day:i.oneOf(["numeric","2-digit"]),weekday:i.oneOf(["narrow","short","long"]),hour:i.oneOf(["numeric","2-digit"]),hour12:i.bool,minute:i.oneOf(["numeric","2-digit"]),second:i.oneOf(["numeric","2-digit"]),timeZoneName:i.oneOf(["short","long"])})]),id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,max:i.instanceOf(Date),min:i.instanceOf(Date),onBlur:i.func,onChange:i.func,onFocus:i.func,popupSettings:i.any,show:i.bool,startDateInputSettings:i.any,style:i.any,swapButton:i.any,tabIndex:i.number,dir:i.string,value:i.shape({start:M(i.instanceOf(Date).isRequired),end:M(i.instanceOf(Date).isRequired)}),autoFocus:i.bool},Ei.defaultProps={allowReverse:!1,defaultShow:!1,defaultValue:I,disabled:!1,format:"d",max:V,min:T,swapButton:!1,autoFocus:!1};let Ti=Ei;const Vi=s.createPropsContext(),Pi=s.withIdHOC(s.withPropsContext(Vi,Ti));Pi.displayName="KendoReactDateRangePicker",n.registerForLocalization(Ti);const Ni=class extends u.Component{constructor(e){super(e),this._calendar=null,this._timePart=null,this._cancelButton=null,this._acceptButton=null,this._dateButtonRef=null,this._calendarWrap=null,this.shouldFocusPart=!1,this.focus=e=>{Promise.resolve().then((()=>{"time"===this.state.tab&&this._timePart&&this._timePart.focus(e);const t=this.calendarElement();"date"===this.state.tab&&t&&t.focus(e)}))},this.calendarElement=()=>this._calendar&&this._calendar.element||this._calendarWrap&&this._calendarWrap.querySelector(".k-calendar"),this.move=e=>{if("right"===e&&"time"===this.state.tab||"left"===e&&"date"===this.state.tab)return;const t="left"===e?"date":"time";this.shouldFocusPart=!0,this.setState({tab:t})},this.dateTimeFooter=()=>{const{cancelButton:e,unstyled:t}=this.props,i=t&&t.uDateTimePicker,a=this.localizationService.toLanguageString(fe,ye[fe]),n=this.localizationService.toLanguageString(we,ye[we]);return u.createElement("div",{className:s.classNames(s.uDateTimePicker.timeFooter({c:i}))},e&&u.createElement(o.Button,{type:"button",ref:e=>{this._cancelButton=e},className:s.classNames(s.uTime.cancel({c:i})),onClick:this.handleReject,onKeyDown:this.handleCancelKeyDown,title:a,"aria-label":a},a),u.createElement(o.Button,{type:"button",themeColor:"primary",ref:e=>{this._acceptButton=e},className:s.classNames(s.uTime.accept({c:i})),disabled:!this.hasDateValue,onClick:this.handleAccept,onKeyDown:this.handleSetKeyDown,title:n,"aria-label":n},n))},this.handleReject=e=>{this.setState({dateValue:this.props.value,timeValue:this.props.value||E});const t=this.mergeDate(this.props.value,this.props.value||E);if(this.props.onReject){const i={nativeEvent:e.nativeEvent,syntheticEvent:e,target:this,value:t};this.props.onReject.call(void 0,i)}},this.handleAccept=(e,t)=>{if(!this.state.dateValue||!this.state.timeValue||!this.hasDateValue)return;const i=this.mergeDate(this.state.dateValue,t||this.state.timeValue);this.props.onChange.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:i,target:this})},this.handleNowClick=e=>{this.setState({timeValue:gt()}),this.handleAccept(e,gt())},this.handleCalendarValueChange=e=>{e.syntheticEvent.stopPropagation(),this.setState({dateValue:e.value,tab:"time"}),this.shouldFocusPart=!0},this.handleTimeListContainerChange=e=>{this.setState({timeValue:e})},this.handleDateClick=e=>{e.stopPropagation(),this.move("left")},this.handleTimeClick=e=>{e.stopPropagation(),this.move("right")},this.handleKeyDown=e=>{const{keyCode:t,altKey:i}=e;if(!this.props.disabled)switch(t){case s.Keys.enter:return void(!this.hasActiveButton()&&this.hasDateValue&&this.handleAccept(e));case s.Keys.left:if(!i)return;return void this.move("left");case s.Keys.right:if(!i)return;return void this.move("right");default:return}},this.handleCancelKeyDown=e=>{const{keyCode:t}=e;t===s.Keys.tab&&this._dateButtonRef&&this._dateButtonRef.element&&!this.hasDateValue&&(e.preventDefault(),this._dateButtonRef.element.focus())},this.handleSetKeyDown=e=>{const{keyCode:t}=e;t===s.Keys.tab&&this._dateButtonRef&&this._dateButtonRef.element&&(e.preventDefault(),this._dateButtonRef.element.focus())},this.handleDateKeyDown=e=>{var t,i,a,n;const{keyCode:o,shiftKey:r}=e;r&&o===s.Keys.tab&&(e.stopPropagation(),this.hasDateValue?null==(n=null==(a=this._acceptButton)?void 0:a.element)||n.focus():null==(i=null==(t=this._cancelButton)?void 0:t.element)||i.focus()),o===s.Keys.enter&&(e.stopPropagation(),this.move("left"))},this.handleTimeKeyDown=e=>{const{keyCode:t}=e;t===s.Keys.enter&&(e.stopPropagation(),this.move("right"))},this.handleTimePartMount=e=>{this.setState({timeValue:e})},this.state={tab:"date",dateValue:this.props.value,timeValue:this.props.value||E}}get calendar(){return this._calendar}get timePart(){return this._timePart}get hasDateValue(){return null!==this.state.dateValue}get localizationService(){return n.provideLocalizationService(this)}componentDidUpdate(e,t){var i,s;this.shouldFocusPart&&this.focus({preventScroll:!0}),((null==(i=e.value)?void 0:i.getTime())!==(null==(s=this.props.value)?void 0:s.getTime())||this.state.tab!==t.tab&&this.props.value)&&this.setState({dateValue:e.value&&this.props.value&&a.isEqualDate(e.value,this.props.value)?this.state.dateValue:this.props.value,timeValue:this.props.value||E}),this.shouldFocusPart=!1}render(){const{disabled:e,min:t,max:i,weekNumber:a,focusedDate:n,format:r,mobileMode:l,footerActions:h,unstyled:c}=this.props,d=c&&c.uDateTimePicker,p=s.classNames(s.uDateTimePicker.wrap({c:d,date:"date"===this.state.tab,time:"time"===this.state.tab,disabled:e})),m=this.localizationService.toLanguageString(ge,ye[ge]),g=this.localizationService.toLanguageString(ve,ye[ve]),v={min:t,max:i,weekNumber:a,focusedDate:n,disabled:e||"date"!==this.state.tab,value:this.state.dateValue,onChange:this.handleCalendarValueChange,navigation:!1,tabIndex:e||"date"!==this.state.tab?-1:void 0,mobileMode:l};return u.createElement("div",{onKeyDown:this.handleKeyDown,className:p,tabIndex:-1},u.createElement("div",{className:s.classNames(s.uDateTimePicker.buttonGroup({c:d}))},u.createElement(o.ButtonGroup,{width:"100%"},u.createElement(o.Button,{ref:e=>this._dateButtonRef=e,type:"button",selected:"date"===this.state.tab,togglable:!0,onClick:this.handleDateClick,onKeyDown:this.handleDateKeyDown},m),u.createElement(o.Button,{type:"button",selected:"time"===this.state.tab,togglable:!0,onClick:this.handleTimeClick,onKeyDown:this.handleTimeKeyDown},g))),u.createElement("div",{className:s.classNames(s.uDateTimePicker.selector({c:d}))},u.createElement("div",{className:s.classNames(s.uDateTimePicker.calendarWrap({c:d})),ref:e=>this._calendarWrap=e},this.props.calendar?u.createElement(this.props.calendar,{key:this.state.tab,...v}):u.createElement(Qe,{key:this.state.tab,ref:e=>{this._calendar=e},...v})),u.createElement("div",{className:s.classNames(s.uDateTimePicker.timeWrap({c:d}))},u.createElement("div",{className:s.classNames(s.uDateTimePicker.timeSelector({c:d,mobileMode:l}))},u.createElement(ui,{key:1,onNowClick:this.handleNowClick,disabled:e||"time"!==this.state.tab,ref:e=>{this._timePart=e},min:this.minTime||P,max:this.maxTime||N,steps:this.props.steps,value:this.state.timeValue,format:r,onChange:this.handleTimeListContainerChange,onMount:this.handleTimePartMount,mobileMode:l,unstyled:c})))),h&&this.dateTimeFooter())}get minTime(){return void 0!==this.props.minTime?this.props.minTime:this.normalizeRange(this.props.min,this.state.dateValue)}get maxTime(){return void 0!==this.props.maxTime?this.props.maxTime:this.normalizeRange(this.props.max,this.state.dateValue)}normalizeRange(e,t){return a.isEqualDate(e,t||R())?e:null}hasActiveButton(){if(!this._acceptButton)return!1;const e=s.getActiveElement(document);return this._acceptButton&&e===this._acceptButton.element||this._cancelButton&&e===this._cancelButton.element}mergeTime(e,t){return e&&t?F(t,e):t}mergeDate(e,t){return e?F(e||R(),t):t}};Ni.defaultProps={footerActions:!0};let Fi=Ni;n.registerForLocalization(Fi);const Ri=class e extends u.Component{constructor(t){super(t),this._element=null,this._dateInput=u.createRef(),this._dateTimeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{const e=this.dateInputElement();e&&e.focus()},this.renderPicker=()=>{const{disabled:e,minTime:t,maxTime:i,format:s,calendar:a,cancelButton:n,weekNumber:o,focusedDate:r}=this.props;return u.createElement(Fi,{ref:e=>{this._dateTimeSelector=e},cancelButton:n,steps:this.props.steps,value:this.value,onChange:this.handleValueChange,onReject:this.handleReject,disabled:e,weekNumber:o,min:this.min,max:this.max,minTime:t,maxTime:i,focusedDate:r,format:s,calendar:a,mobileMode:this.mobileMode,footerActions:!this.mobileMode})},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t=n.provideLocalizationService(this).toLanguageString(fe,ye[fe]),i=n.provideLocalizationService(this).toLanguageString(we,ye[we]),s={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:e,footer:{cancelText:t,onCancel:e=>{var t;return null==(t=this._dateTimeSelector)?void 0:t.handleReject(e)},applyText:i,onApply:e=>{var t;return null==(t=this._dateTimeSelector)?void 0:t.handleAccept(e)}}};return u.createElement(Tt,{...s},u.createElement(c.ActionSheetContent,{overflowHidden:!0},this.renderPicker()))},this.handleReject=()=>{this.shouldFocusDateInput=!0,this.setShow(!1)},this.handleValueChange=e=>{this.setState({value:a.cloneDate(e.value||void 0)}),this.valueDuringOnChange=e.value,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:t}=this.props;t&&t.call(void 0,{syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:this.value,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.handleDateIconClick=()=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:t,keyCode:i}=e;if(i===s.Keys.esc)return this.shouldFocusDateInput=!0,void this.setShow(!1);t&&(i===s.Keys.up||i===s.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=i===s.Keys.up,this.setShow(i===s.Keys.down))},this.dateInputElement=()=>this.dateInput&&this.dateInput.element||this.element&&this.element.querySelector(".k-dateinput > input.k-input-inner"),s.validatePackage(p),this.state={value:this.props.defaultValue||e.defaultProps.defaultValue,show:this.props.defaultShow||e.defaultProps.defaultShow,focused:!1}}get _popupId(){return this.props.id+"-popup-id"}get document(){if(s.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get dateInput(){return this._dateInput.current}get value(){const e=void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.props.value?this.props.value:this.state.value;return null!==e?a.cloneDate(e):null}get show(){return void 0!==this.showDuringOnChange?this.showDuringOnChange:void 0!==this.props.show?this.props.show:this.state.show}get name(){return this.props.name}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=Vt&&this.props.adaptive)}get min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}get validity(){const e=B(this.value,this.min,this.max)&&wt(this.value,this.props.minTime||P,this.props.maxTime||N),t=void 0!==this.props.validationMessage,i=(!this.required||null!==this.value)&&e,s=void 0!==this.props.valid?this.props.valid:i;return{customError:t,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:s,valueMissing:null===this.value}}get validityStyles(){return void 0!==this.props.validityStyles?this.props.validityStyles:e.defaultProps.validityStyles}get required(){return void 0!==this.props.required?this.props.required:e.defaultProps.required}get dateInputComp(){return this.props.dateInput||e.defaultProps.dateInput}componentDidMount(){var e;this.observerResize=s.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){const e=this.dateInputElement();this._dateTimeSelector&&this.show&&!this.prevShow&&this._dateTimeSelector.focus({preventScroll:!0}),e&&!this.show&&this.shouldFocusDateInput&&e.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var e;clearTimeout(this.nextTickId),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:t=e.defaultProps.size,rounded:i=e.defaultProps.rounded,fillMode:a=e.defaultProps.fillMode,autoFocus:l=e.defaultProps.autoFocus,disabled:c,tabIndex:d,title:p,id:m,format:g,formatPlaceholder:v,min:f,max:w,className:b,width:D,name:y,validationMessage:S,required:k,validityStyles:C,minTime:x,maxTime:I,ariaLabelledBy:M,ariaDescribedBy:O,popup:E=h.Popup,unstyled:T}=this.props,V=T&&T.uDateTimePicker,P=!this.validityStyles||this.validity.valid,N={id:m,ariaLabelledBy:M,ariaDescribedBy:O,format:g,formatPlaceholder:v,disabled:c,title:p,validityStyles:C,validationMessage:S,required:k,min:f,max:w,minTime:x,maxTime:I,name:y,tabIndex:this.show?-1:d,valid:this.validity.valid,value:this.value,onChange:this.handleValueChange,steps:this.props.steps,label:void 0,placeholder:this.state.focused?null:this.props.placeholder,ariaExpanded:this.show,size:null,fillMode:null,rounded:null},F=u.createElement(s.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.handleBlur,onSyncFocus:this.props.onFocus,onSyncBlur:this.props.onBlur},(({onFocus:e,onBlur:h})=>u.createElement(u.Fragment,null,u.createElement("div",{ref:e=>{this._element=e},className:s.classNames(s.uDateTimePicker.wrapper({c:V,size:t,fillMode:a,rounded:i,disabled:c,required:this.required,invalid:!P}),b),onKeyDown:this.handleKeyDown,style:{width:D},onFocus:this.mobileMode?void 0:e,onBlur:h,onClick:this.mobileMode?this.handleDateIconClick:void 0},u.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode,autoFocus:l,...N}),u.createElement(o.Button,{tabIndex:-1,type:"button",icon:"calendar",svgIcon:r.calendarIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleDateIconClick,title:n.provideLocalizationService(this).toLanguageString(le,ye[le]),className:s.classNames(s.uDateTimePicker.inputButton({c:V})),rounded:null,fillMode:a,"aria-label":n.provideLocalizationService(this).toLanguageString(le,ye[le])}),u.createElement(E,{show:this.show,animate:null!==this.element,anchor:this.element,popupClass:s.classNames(s.uDateTimePicker.popup({c:V})),id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"}},!this.mobileMode&&this.renderPicker())),this.mobileMode&&this.renderAdaptivePopup())));return this.props.label?u.createElement(Et,{dateInput:this._dateInput,label:this.props.label,editorId:m,editorValid:P,editorDisabled:this.props.disabled,children:F,style:{width:this.props.width}}):F}setShow(e){const{onOpen:t,onClose:i}=this.props;this.show!==e&&(this.setState({show:e}),e&&t&&t.call(void 0,{target:this}),!e&&i&&i.call(void 0,{target:this}))}nextTick(e){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout((()=>e()))}calculateMedia(e){for(const t of e)this.setState({windowWidth:t.target.clientWidth})}};Ri.displayName="DateTimePicker",Ri.propTypes={className:i.string,defaultShow:i.bool,defaultValue:i.instanceOf(Date),disabled:i.bool,focusedDate:i.instanceOf(Date),format:i.oneOfType([i.string,i.shape({skeleton:i.string,pattern:i.string,date:i.oneOf(["short","medium","long","full"]),time:i.oneOf(["short","medium","long","full"]),datetime:i.oneOf(["short","medium","long","full"]),era:i.oneOf(["narrow","short","long"]),year:i.oneOf(["numeric","2-digit"]),month:i.oneOf(["numeric","2-digit","narrow","short","long"]),day:i.oneOf(["numeric","2-digit"]),weekday:i.oneOf(["narrow","short","long"]),hour:i.oneOf(["numeric","2-digit"]),hour12:i.bool,minute:i.oneOf(["numeric","2-digit"]),second:i.oneOf(["numeric","2-digit"]),timeZoneName:i.oneOf(["short","long"])})]),formatPlaceholder:i.oneOfType([i.oneOf(["wide","narrow","short","formatPattern"]),i.shape({year:i.string,month:i.string,day:i.string,hour:i.string,minute:i.string,second:i.string})]),id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,min:i.instanceOf(Date),max:i.instanceOf(Date),name:i.string,popupSettings:i.shape({animate:i.bool,appendTo:i.any,popupClass:i.string}),show:i.bool,tabIndex:i.number,title:i.string,value:i.instanceOf(Date),weekNumber:i.bool,width:i.oneOfType([i.number,i.string]),validationMessage:i.string,required:i.bool,validate:i.bool,valid:i.bool,cancelButton:i.bool,size:i.oneOf([null,"small","medium","large"]),rounded:i.oneOf([null,"small","medium","large","full"]),fillMode:i.oneOf([null,"solid","flat","outline"]),autoFocus:i.bool},Ri.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"g",max:V,min:T,popupSettings:{},tabIndex:0,weekNumber:!1,required:!1,validityStyles:!0,cancelButton:!0,dateInput:It,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1};let Li=Ri;const Bi=s.createPropsContext(),_i=s.withIdHOC(s.withPropsContext(Bi,s.withUnstyledHOC(Li)));_i.displayName="KendoReactDateTimePicker",n.registerForLocalization(Li),e.Action=Ee,e.BusViewService=Ke,e.Calendar=Qe,e.CalendarCell=k,e.CalendarHeaderTitle=j,e.CalendarNavigationItem=Ie,e.CalendarPropsContext=Je,e.CalendarViewEnum=x,e.CalendarWeekCell=C,e.CalendarWithoutContext=Xe,e.CenturyViewService=Pe,e.DOMService=We,e.DateInput=It,e.DateInputPropsContext=xt,e.DateInputWithoutContext=Ct,e.DatePicker=Rt,e.DatePickerPropsContext=Ft,e.DatePickerWithoutContext=Nt,e.DateRangePicker=Pi,e.DateRangePickerPropsContext=Vi,e.DateRangePickerWithoutContext=Ti,e.DateTimePicker=_i,e.DateTimePickerPropsContext=Bi,e.DateTimePickerWithoutContext=Li,e.DayPeriodService=At,e.DecadeViewService=Re,e.EMPTY_SELECTIONRANGE=I,e.Header=G,e.HorizontalViewList=Di,e.HoursService=$t,e.MAX_DATE=V,e.MAX_TIME=N,e.MIN_DATE=T,e.MIN_TIME=P,e.MinutesService=Qt,e.MonthViewService=_e,e.MultiViewCalendar=Oi,e.MultiViewCalendarPropsContext=Mi,e.MultiViewCalendarWithoutContext=Ii,e.NavigationService=Ye,e.PickerWrap=Ot,e.ScrollSyncService=$e,e.SecondsService=ni,e.TimeList=hi,e.TimePart=ui,e.TimePicker=wi,e.TimePickerPropsContext=fi,e.TimePickerWithoutContext=vi,e.TimeSelector=mi,e.TodayCommand=ke,e.ToggleButton=Mt,e.ViewList=xe,e.Virtualization=S,e.WeekNamesService=W,e.YearViewService=ze,e.dateInputsMessages=ye,e.decreaseValue=ee,e.end=oe,e.getNow=gt,e.getToday=R,e.increaseValue=Q,e.separator=re,e.start=ne,e.swapStartEnd=ae,e.today=ie,e.toggleCalendar=se,e.toggleDateTimeSelector=le}));