@progress/kendo-react-dateinputs 9.0.0-develop.1 → 9.0.0-develop.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -46
- package/calendar/components/Calendar.mjs +57 -60
- package/calendar/components/CalendarNavigationItem.mjs +10 -12
- package/calendar/components/CalendarWeekCell.mjs +9 -1
- package/calendar/components/HorizontalViewList.mjs +8 -11
- package/calendar/components/MultiViewCalendar.mjs +13 -8
- package/calendar/components/Navigation.mjs +11 -11
- package/calendar/components/View.mjs +8 -25
- package/common/PickerWrap.mjs +2 -15
- package/dateinput/models/kendo-date.js +1 -1
- package/dateinput/models/kendo-date.mjs +8 -7
- package/datepicker/DatePicker.mjs +14 -6
- package/daterangepicker/DateRangePicker.mjs +14 -3
- package/datetimepicker/DateTimePicker.mjs +22 -15
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/hooks/usePickerFloatingLabel.mjs +1 -7
- package/index.d.mts +4 -1
- package/index.d.ts +4 -1
- package/package-metadata.mjs +1 -1
- package/package.json +7 -7
- package/timepicker/TimeList.mjs +27 -12
- package/timepicker/TimePart.mjs +55 -75
- package/timepicker/TimePicker.mjs +11 -5
- package/timepicker/TimeSelector.js +1 -1
- package/timepicker/TimeSelector.mjs +41 -45
- package/timepicker/services/DOMService.mjs +7 -4
- package/timepicker/services/DayPeriodService.mjs +1 -4
- package/timepicker/utils.mjs +3 -15
- package/virtualization/Virtualization.js +1 -1
- package/virtualization/Virtualization.mjs +3 -13
|
@@ -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,s,i,a,n,o,r,l,h,c){"use strict";function d(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:function(){return e[s]}})}})),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,s,i,a=0,n=0,o="vertical"){this.rowHeightService=e,this.firstLoaded=t,this.lastLoaded=t+s,this.take=s,this.total=i,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:s,offsetWidth:i}){const a="vertical"===this.direction?t:e,n="vertical"===this.direction?s:i;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},D={1:e=>t=>Math.min(t,e),0:e=>t=>Math.max(t,e)},b={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 s=this.scrollContainer[t];this.restrictScroll&&"scrollTop"===t&&(!Number.isInteger(s)||!Number.isInteger(e))&&Math.abs(s-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),s=this.getContainerScrollDirection(t);let{start:i,end:a}=this.scrollRange(t,s);if(i===a)return;const n=this.scrollStep(i,a),o=w[s](n),r=D[s](a),l=b[s](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(i)}))},this.scrollToBottom=()=>{this.rowHeightService&&this.scrollTo(this.rowHeightService.totalHeight()+this.props.bottomOffset)},this.scrollStep=(t,s)=>{const i=this.props.scrollDuration||e.defaultProps.scrollDuration;return Math.abs(s-t)/(i/17)},this.scrollRange=(e,t)=>{const s=this.containerScrollPosition;if(parseInt(`${e}`,10)===parseInt(`${s}`,10))return{start:e,end:e};const i=this.containerMaxScroll(),a=0===t?1:-1,n=((e,t,s)=>Math.min(Math.abs(t-e),s))(s,e,this.props.maxScrollDifference||0),o=Math.min(e,i);return{start:Math.min(Math.max(o+a*n,0),i),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 i.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 s=this.rowHeightService.index(this.containerScrollPosition-this.props.topOffset),{onScrollAction:i}=this.props,a={index:s,target:t,scrollAction:this.scrollAction,pageAction:this.pageAction,animationInProgress:this.animationInProgress};this.props.onScroll&&this.props.onScroll.call(void 0,e),i&&i.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,s=t+this.containerOffsetSize,i=this.rowHeightService.offset(e),a=i+this.rowHeightService.height(e);return i>=t&&a<=s}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:s,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)+s}`,d="vertical"===this.direction?{height:`${c}px`}:{width:`${c}px`},p=i.classNames(i.uCalendar.scrollableSelector({c:h}),i.uCalendar.scrollable({c:h,horizontal:"horizontal"===this.direction}),a),m=i.classNames(i.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:s.number.isRequired,className:s.string,direction:s.oneOf(["horizontal","vertical"]),forceScroll:s.bool,itemHeight:s.number,itemWidth:s.number,maxScrollDifference:s.number,onScroll:s.func,onScrollAction:s.func,scrollDuration:s.number,scrollOffsetSize:s.number,skip:s.number.isRequired,tabIndex:s.number,take:s.number.isRequired,topOffset:s.number.isRequired,total:s.number.isRequired,role:s.string},y.defaultProps={direction:"vertical",forceScroll:!1,scrollOffsetSize:0,maxScrollDifference:100,scrollDuration:100};let S=y;let C=class extends u.Component{constructor(){super(...arguments),this.handleClick=e=>{const{onClick:t,value:s}=this.props;t&&t.call(void 0,s,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,...s}=this.props,{value:i,...a}=e;return!((!t||!i||t.getTime()===i.getTime())&&((e,t)=>{const s=Object.getOwnPropertyNames(e),i=Object.getOwnPropertyNames(t);if(s.length!==i.length)return!1;for(let i=0;i<s.length;i++){const a=s[i];if(e[a]!==t[a])return!1}return!0})(s,a))}render(){const{className:e,formattedValue:t,isWeekend:s,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:D,unstyled:b,...y}=this.props,S="end"===this.props.activeRangeEnd&&h,C="start"===this.props.activeRangeEnd&&r,k=b&&b.uCalendar,x=i.classNames(i.uCalendar.td({c:k,rangeStart:!f&&!D&&r,rangeEnd:!f&&!D&&h,rangeMid:!f&&l,rangeSplitEnd:!f&&d,rangeSplitStart:!f&&c,active:C||S,focused:a,selected:!f&&(o||r||h),today:!f&&p,weekend:s,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:i.classNames(i.uCalendar.link({c:k}))},this.props.children))}};const k=e=>{const{className:t,firstDate:s,weekDays:a,...n}=e,o=i.useUnstyled(),r=o&&o.uCalendar;return u.createElement("td",{className:i.classNames(i.uCalendar.td({c:r,isWeek:!0}),t),...n,onClick:t=>{const{onClick:i}=e;i&&t&&i.call(void 0,s,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,s,i,...a)=>null===s[i]?null:(t?e.isRequired:e)(s,i,...a),s=t.bind(null,!1);return s.isRequired=t.bind(null,!0),s}const O=(e,t,s)=>void 0===t||void 0===s||t<=e&&e<=s?e:e<t?t:s,T=new Date(1980,0,1),E=new Date(1900,0,1),V=new Date(2099,11,31),N=new Date(1980,0,1),P=new Date(1980,0,1,23,59,59),F=(e,t)=>{const s=a.cloneDate(e);return s.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),s},R=()=>a.getDate(new Date),L=(e,t,s)=>!e||!(t&&t>e||s&&s<e),B=(e,t,s)=>null===e||!(t&&a.getDate(t)>a.getDate(e)||s&&a.getDate(s)<a.getDate(e)),_=(e,t)=>{const{start:s,end:i}=t||I;return!(!s||!i)&&(s<e&&e<i)},H=(e,t,s=1)=>{const i=[];for(let a=e;a<t;a+=s)i.push(a);return i},A=(e,t,s)=>t.getTime()<=e.getTime()&&e.getTime()<=s.getTime(),z=(e,t,s)=>e&&(t&&e<t?a.cloneDate(t):s&&e>s?a.cloneDate(s):e),q=e=>(t,s="",i={})=>{const a=document.createElement(e);return a.className=s,Object.keys(i).map((e=>a.style[e]=i[e])),"string"==typeof t?a.innerHTML=t||"":(t||[]).forEach((e=>e&&a.appendChild(e))),a};function W(e,t,s={}){let i,a,n,o,r;s.maxWait;const l=window,h=!1,c=!1,d=!t&&0!==t&&"function"==typeof l.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function u(t){const s=i,o=a;return i=a=void 0,n=e.apply(o,s),n}function p(e,t){return d?(l.cancelAnimationFrame(o),l.requestAnimationFrame(e)):setTimeout(e,t)}function m(e){const s=e-r;return void 0===r||s>=t||s<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,i?u():(i=a=void 0,n)}function f(...e){const s=Date.now(),l=m(s);return i=e,a=this,r=s,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),i=r=a=o=void 0},f.flush=function(){return void 0===o?n:v()},f.pending=function(){return void 0!==o},f}let K=class{constructor(e){this.intl=e}getWeekNames(e=!1,t){const s=((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(s):s}};const U=(e,t)=>{const s=t;return u.createElement("td",{key:e,role:"gridcell",className:i.classNames(i.uCalendar.td({c:s,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 s=this.firstDate(e),i=this.getWeekNumber(s),a=`kendo-react-calendar-week-cell-${i}`,n={value:i,firstDate:s,weekDays:e,unstyled:this.props.unstyled,onClick:this.handleWeekCellClick};return this.props.weekCell?u.createElement(this.props.weekCell,{...n,key:a},i):u.createElement(k,{...n,key:a},i)},this.buildRow=e=>e.map(((e,t)=>{if(!e)return U(t);const s={"aria-selected":e.isSelected},i=`kendo-react-calendar-cell-${e.value.getTime()}`,a={...s,...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:i},e.formattedValue):u.createElement(C,{...a,key:i},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,s=e[t];for(;!s&&t<e.length;)s=e[++t];return s},this.handleClick=(e,t)=>{const{onChange:s}=this.props;if(s&&t){const i={value:a.cloneDate(e),target:this,nativeEvent:t&&t.nativeEvent,syntheticEvent:t};s.call(void 0,i)}},this.handleWeekCellClick=(e,t,s)=>{const{onWeekSelect:i}=this.props,a=t.findIndex((t=>t&&t.value===e));i&&s&&i.call(void 0,e,a,s)},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:s,focusedDate:a,bus:o,activeView:r,selectionRange:l,unstyled:h}=this.props,c=h&&h.uCalendar;this.intl=n.provideIntlService(this),this.weekService=new K(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:s,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:i.classNames(i.uCalendar.thead({c:c}))},u.createElement("tr",{role:"row",className:i.classNames(i.uCalendar.tr({c:c}))},d.map(((e,t)=>u.createElement("th",{key:t,className:i.classNames(i.uCalendar.th({c:c}))},e))))),u.createElement("tbody",{role:"rowgroup",className:i.classNames(i.uCalendar.tbody({c:c}))},!this.isHorizontal&&u.createElement("tr",{role:"presentation",className:i.classNames(i.uCalendar.tr({c:c}))},u.createElement("th",{scope:"col",colSpan:p,className:i.classNames(i.uCalendar.caption({c:c}))},m)),f.map(((e,t)=>u.createElement("tr",{role:"row",className:i.classNames(i.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:s.oneOf(["start","end",null]),activeView:s.number.isRequired,cellUID:s.string.isRequired,direction:s.oneOf(["horizontal","vertical"]),focusedDate:s.instanceOf(Date).isRequired,max:s.instanceOf(Date).isRequired,min:s.instanceOf(Date).isRequired,onChange:s.func,selectedDate:s.oneOfType([s.instanceOf(Date),s.arrayOf(s.instanceOf(Date))]),showWeekNumbers:s.bool,showOtherMonthDays:s.bool,viewDate:s.instanceOf(Date).isRequired},Y.defaultProps={direction:"vertical",selectedDate:R(),showWeekNumbers:!1};let $=Y;n.registerForIntl($);const j=e=>{const{view:t,...s}=e;return u.createElement(o.Button,{type:"button",fillMode:"flat",themeColor:"primary",...s},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),s=this.props.service.addToDate(this.props.currentDate,e);return e<1||!this.props.service.isInRange(s,this.min,this.max)?t:`${t} - ${this.props.service.title(s)}`},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:s}=this.props,a=s&&s.uCalendar,n=this.getTitle(),o={children:n,value:n,view:e,className:i.classNames(i.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:i.classNames(i.uCalendar.spacer({c:a}))}),u.createElement("span",{className:i.classNames(i.uCalendar.nav({c:a}))},this.props.commands));return u.createElement("div",{className:i.classNames(i.uCalendar.header({c:a,vertical:this.props.verticalView}))},h)}};Z.propTypes={activeView:s.number.isRequired,currentDate:s.instanceOf(Date).isRequired,max:s.instanceOf(Date).isRequired,min:s.instanceOf(Date).isRequired,rangeLength:s.number},Z.defaultProps={rangeLength:1,min:E,max:V};let G=Z;n.registerForLocalization(G);const X="multiviewcalendar.prevView",J="multiviewcalendar.nextView",Q="dateinput.increment",ee="dateinput.decrement",te="dateinput.clear",se="calendar.today",ie="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",De="daterangepicker.cancel",be="daterangepicker.set",ye={[se]:"Today",[he]:"NOW",[ue]:"Set",[de]:"Cancel",[ge]:"Date",[ve]:"Time",[fe]:"Cancel",[we]:"Set",[De]:"Cancel",[be]:"Set",[ne]:"Start",[oe]:"End",[re]:" ",[ce]:"Select Now",[pe]:"Toggle TimeSelector",[me]:"Toggle Clock",[Q]:"Increase value",[ee]:"Decrease value",[te]:"clear",[ie]:"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:s}=this.props,a=s&&s.uCalendar;this.localization=n.provideLocalizationService(this);const r=this.localization.toLanguageString(se,ye[se]),l=i.classNames(i.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:s.instanceOf(Date).isRequired,min:s.instanceOf(Date).isRequired,onClick:s.func,disabled:s.bool},Se.defaultProps={min:E,max:V};let Ce=Se;n.registerForLocalization(Ce);const ke=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:s}=this.props,a=s&&s.uCalendar;return u.createElement("table",{key:"calendar-view-list-weekdays",className:i.classNames(i.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:i.classNames(i.uCalendar.thead({c:a}))},u.createElement("tr",{className:i.classNames(i.uCalendar.tr({c:a}))},t.map(((e,t)=>u.createElement("th",{key:t,className:i.classNames(i.uCalendar.th({c:a}))},e))))))},this.buildDates=(e,t)=>{const s=this.props.cellUID,{unstyled:a}=this.props,n=a&&a.uCalendar;return u.createElement("table",{className:i.classNames(i.uCalendar.table({c:n})),ref:e=>this.table=e,role:"grid",tabIndex:this.props.tabIndex,"aria-activedescendant":s+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:s,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:s})=>{const i=s?s.skip:this.state.skip;if((this.state.index!==e||this.state.skip!==i)&&this.setState({index:e,skip:i}),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:s}=this.props;if(s){const i={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:a.cloneDate(e.value),target:this,isTodayClick:t};s.call(void 0,i)}},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 K(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:s,service:n,unstyled:o}=this.props,r=o&&o.uCalendar;this.calculateHeights();const l=this.lastView!==e,h=z(this.props.focusedDate,t,s),c=l?n.skip(h,t):this.state.skip,d=n.total(t,s),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=i.classNames(i.uCalendar.view({c:r,month:e===x.month,year:e===x.year,decade:e===x.decade,century:e===x.century})),D=this.buildDates(v,n.datesList(m,p)),b=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(Ce,{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:e=>!this.virtualization&&this.handleVirtualizationMount(e),children:D,tabIndex:this.props.tabIndex,unstyled:o}));return u.createElement("div",{ref:e=>{this._element=e},className:w},this.props.dom.didCalculate?b:null)}};ke.propTypes={activeView:s.number.isRequired,bottomOffset:s.number,cellUID:s.string.isRequired,focusedDate:s.instanceOf(Date).isRequired,max:s.instanceOf(Date).isRequired,min:s.instanceOf(Date).isRequired,onChange:s.func,showWeekNumbers:s.bool,smoothScroll:s.bool,take:s.number,value:s.instanceOf(Date),viewHeight:s.number,viewOffset:s.number,weekDaysFormat:s.oneOf(["short","abbreviated","narrow"]),tabIndex:s.number},ke.defaultProps={take:5,showWeekNumbers:!1,weekDaysFormat:"short",smoothScroll:!0};let xe=ke;n.registerForIntl(xe);const Ie=e=>{const{isRangeStart:t,value:s,text:a,view:n,...o}=e,r=i.useUnstyled(),l=r&&r.uCalendar;return u.createElement("li",{...o,onClick:t=>{const{onClick:i}=e;i&&i.call(void 0,s,t)},className:i.classNames(i.uCalendar.li({c:l}))},u.createElement("span",{className:i.classNames(i.uCalendar.navigationMarker({c:l,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),s=this.props.service.isRangeStart(e),i=`kendo-react-calendar-nav-item-${e.getTime()}`,a={text:t,value:e,isRangeStart:s,view:this.props.activeView,onClick:this.handleDateChange};return this.props.navigationItem?u.createElement(this.props.navigationItem,{...a,key:i},t):u.createElement(Ie,{...a,key:i},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:s}=this.props;if(s&&t){const i={value:a.cloneDate(e),target:this,nativeEvent:t&&t.nativeEvent,syntheticEvent:t};s.call(void 0,i)}},this.handleScrollAction=({scrollAction:e,pageAction:t})=>{const s=t?t.skip:this.state.skip;if(this.state.skip!==s&&this.setState({skip:s}),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),s=this.props.service.total(this.props.min,this.props.max);this.state={skip:t-this.getTake(t,s)>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:s,service:n,unstyled:o}=this.props;this.calculateHeights();const r=o&&o.uCalendar,l=this.lastView!==e,h=z(this.props.focusedDate,t,s),c=l?n.skip(h,t):this.state.skip,d=n.total(t,s),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:e=>!this.virtualization&&this.handleVirtualizationMount(e),tabIndex:this.props.tabIndex,unstyled:o},u.createElement("ul",{ref:e=>{this.list=e},className:i.classNames(i.uCalendar.ul({c:r}))},g.map((e=>this.buildNavigationItem(e)))));return u.createElement("div",{className:i.classNames(i.uCalendar.navigation({c:r}))},u.createElement("span",{className:i.classNames(i.uCalendar.navigationHighlight({c:r}))}),this.props.dom.didCalculate?v:null)}getTake(e,t){return Math.min(t-e,this.take)}};Me.propTypes={activeView:s.number.isRequired,focusedDate:s.instanceOf(Date).isRequired,max:s.instanceOf(Date).isRequired,min:s.instanceOf(Date).isRequired,onChange:s.func,take:s.number,tabIndex:s.number},Me.defaultProps={take:30};let Oe=Me;var Te=(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))(Te||{});const Ee=[[]],Ve={[Te.Left]:e=>a.addDecades(e,-1),[Te.Up]:e=>a.addDecades(e,-5),[Te.Right]:e=>a.addDecades(e,1),[Te.Down]:e=>a.addDecades(e,5),[Te.PrevView]:e=>a.addCenturies(e,-1),[Te.NextView]:e=>a.addCenturies(e,1),[Te.FirstInView]:e=>a.firstDecadeOfCentury(e),[Te.LastInView]:e=>a.lastDecadeOfCentury(e)};let Ne=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:s,isActiveView:i,max:n,min:o,selectedDate:r,selectionRange:l=I,viewDate:h}=e;if(!h)return Ee;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=i&&(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,s),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,s,i){let a=!1;return t.forEach((t=>{L(e,s,i)&&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 s=e.getFullYear();return t[0].getFullYear()<=s&&s<=t[t.length-1].getFullYear()+99}isInRange(e,t,s){const i=a.firstYearOfDecade(e).getFullYear(),n=!t||a.firstYearOfDecade(t).getFullYear()<=i,o=!s||i<=a.firstYearOfDecade(s).getFullYear();return n&&o}isInSameView(e,t){return 0===a.durationInCenturies(e,t)}isRangeStart(e){return e.getFullYear()%1e3==0}move(e,t){const s=Ve[t];return s?s(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,s=1){return a.durationInCenturies(e,t)<s?a.addCenturies(e,-1):e}normalize(e,t,s){return e<t&&this.isEqual(e,t)?a.cloneDate(t):e>s&&this.isEqual(e,s)?a.cloneDate(s):e}};const Pe=[[]],Fe={[Te.Left]:e=>a.addYears(e,-1),[Te.Up]:e=>a.addYears(e,-5),[Te.Right]:e=>a.addYears(e,1),[Te.Down]:e=>a.addYears(e,5),[Te.PrevView]:e=>a.addDecades(e,-1),[Te.NextView]:e=>a.addDecades(e,1),[Te.FirstInView]:e=>a.firstYearOfDecade(e),[Te.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:s,isActiveView:i,max:n,min:o,selectedDate:r,selectionRange:l=I,viewDate:h}=e;if(!h)return Pe;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=i&&(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,s),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,s,i){let a=!1;return t.forEach((t=>{L(e,s,i)&&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 s=e.getFullYear();return t[0].getFullYear()<=s&&s<=t[t.length-1].getFullYear()+9}isInRange(e,t,s){const i=e.getFullYear(),a=!t||t.getFullYear()<=i,n=!s||i<=s.getFullYear();return a&&n}isRangeStart(e){return e.getFullYear()%100==0}isInSameView(e,t){return 0===a.durationInDecades(e,t)}move(e,t){const s=Fe[t];return s?s(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,s=1){return a.durationInDecades(e,t)<s?a.addDecades(e,-1):e}normalize(e,t,s){return e<t&&this.isEqual(e,t)?a.cloneDate(t):e>s&&this.isEqual(e,s)?a.cloneDate(s):e}};const Le=[[]],Be={[Te.Left]:e=>a.addDays(e,-1),[Te.Up]:e=>a.addWeeks(e,-1),[Te.Right]:e=>a.addDays(e,1),[Te.Down]:e=>a.addWeeks(e,1),[Te.PrevView]:e=>a.addMonths(e,-1),[Te.NextView]:e=>a.addMonths(e,1),[Te.FirstInView]:e=>a.firstDayOfMonth(e),[Te.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:s,isActiveView:i,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=i&&(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,s),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,s,i){let a=!1;return t.forEach((t=>{L(e,s,i)&&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,s){const i=a.getDate(e),n=!t||a.getDate(t)<=i,o=!s||i<=a.getDate(s);return n&&o}isInSameView(e,t){return 0===a.durationInMonths(e,t)}isRangeStart(e){return!e.getMonth()}move(e,t){const s=Be[t];return s?s(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,s=1){return a.durationInMonths(e,t)<s?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,s){return e<t&&this.isEqual(e,t)?a.getDate(t):e>s&&this.isEqual(e,s)?a.getDate(s):e}wideMonthNames(){return this.intl.dateFormatNames({nameType:"wide",type:"months",standAlone:!0})}}const He=[[]],Ae={[Te.Left]:e=>a.addMonths(e,-1),[Te.Up]:e=>a.addMonths(e,(e=>e>4?-5:e<2?-2:-7)(e.getMonth())),[Te.Right]:e=>a.addMonths(e,1),[Te.Down]:e=>a.addMonths(e,(e=>e<7?5:e<10?7:2)(e.getMonth())),[Te.PrevView]:e=>a.addYears(e,-1),[Te.NextView]:e=>a.addYears(e,1),[Te.FirstInView]:e=>a.firstMonthOfYear(e),[Te.LastInView]:e=>a.lastMonthOfYear(e)};let ze=class{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:s,isActiveView:i,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),D=i&&(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,s),isSelected:D,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,s,i){let a=!1;return t.forEach((t=>{L(e,s,i)&&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 s=e.getFullYear();return t[0].getFullYear()<=s&&s<=t[t.length-1].getFullYear()}isInRange(e,t,s){const i=a.createDate(e.getFullYear(),e.getMonth(),1),n=!t||a.createDate(t.getFullYear(),t.getMonth(),1)<=i,o=!s||i<=a.createDate(s.getFullYear(),s.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 s=Ae[t];return s?s(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,s=1){return a.durationInYears(e,t)<s?a.addYears(e,-1):e}abbrMonthNames(){return this._intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(e,t,s){return e<t&&this.isEqual(e,t)?a.cloneDate(t):e>s&&this.isEqual(e,s)?a.cloneDate(s):e}};const qe={[x.month]:_e,[x.year]:ze,[x.decade]:Re,[x.century]:Ne};let We=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,s){const i=this.clamp(((e,t)=>{const s=x[x[e+t]];return void 0!==s?s:e})(e,t));i!==e&&this.onViewChanged({view:i},s)}};class Ke{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,t){if(!i.canUseDOM)return;const s=q("div"),a=q("ul"),n=q("li"),o=q("td"),r=q("th"),l=q("tr"),h=q("tbody"),c=q("thead"),d=q("table"),u=t&&t.uCalendar,p=t&&t.uButton,m=i.strippedClassNames(i.uButton.wrapper({c:p,fillMode:"flat",size:"medium",rounded:"medium",themeColor:"primary"}),i.uCalendar.title({c:u})),g=()=>s(`\n <span class="${m}">\n <span class="${i.strippedClassNames(i.uButton.text({c:p}))}">March 2017</span>\n </span>\n <span class="${i.strippedClassNames(i.uCalendar.spacer({c:u}))}"></span>\n <span class="${i.strippedClassNames(i.uCalendar.nav({c:u}))}"><button class="${i.strippedClassNames(i.uCalendar.today({c:u}))}">TODAY</button></span>\n `,i.strippedClassNames(i.uCalendar.header({c:u,vertical:!0}))),v=(e,t)=>new Array(e).fill("1").map(t),f=e=>s(e,i.strippedClassNames(i.uCalendar.scrollableSelector({c:u}),i.uCalendar.scrollable({c:u,horizontal:!0}))),w=(()=>{let e;return()=>i.canUseDOM?(e||(e=s([f([a([n("<span>FEB</span>")])])],i.strippedClassNames(i.uCalendar.navigation({c:u})),{left:"0px",position:"absolute"})),e):null})(),D=({cells:e,rows:t},a,n)=>{let p;return()=>i.canUseDOM?(p||(p=((e,t,a)=>s(a?[g(),d([c([l([r("MO",i.strippedClassNames(i.uCalendar.th({c:u})))],i.strippedClassNames(i.uCalendar.tr({c:u})))],i.strippedClassNames(i.uCalendar.thead({c:u})))],i.strippedClassNames(i.uCalendar.table({c:u,weekdays:!0}))),f([e,e])]:[g(),f([e,e])],t,{left:"-10000px",position:"absolute"}))(((e,t=1)=>d([h([l([o("1",i.strippedClassNames(i.uCalendar.td({c:u,isWeek:!0})))])].concat(v(e,(()=>l(v(t,(e=>o(`<span class="${i.strippedClassNames(i.uCalendar.link({c:u}))}">${e}</span>`,i.strippedClassNames(i.uCalendar.td({c:u}))))),i.strippedClassNames(i.uCalendar.tr({c:u})))))),i.strippedClassNames(i.uCalendar.tbody({c:u})))],i.strippedClassNames(i.uCalendar.table({c:u}))))(t,e),a,n)),p):null},b=e=>e.querySelector(`.${i.strippedClassNames(i.uCalendar.scrollableSelector({c:u}))}`),y=e=>{const t=b(e);return t.className=`${t.className} scrollable-horizontal`,e},S=D({cells:7,rows:6},i.strippedClassNames(i.uCalendar.view({c:u,month:!0})),!0),C=D({cells:5,rows:3},i.strippedClassNames(i.uCalendar.view({c:u,year:!0})),!1),k=D({cells:5,rows:2},i.strippedClassNames(i.uCalendar.view({c:u,decade:!0})),!1),x=e=>parseFloat(window.getComputedStyle(e).height)||e.offsetHeight,I=e=>{const t=window.getComputedStyle(e);return parseFloat(t.width)+parseFloat(t.paddingLeft)+parseFloat(t.paddingRight)||e.offsetWidth},M=e=>e.querySelector("tbody");this.didCalculate=!0,e&&(this.hostContainer=e),this.batch(S(),(e=>{const t=M(e);this.calendarHeight=x(e),this.monthViewHeight=x(t),this.headerHeight=x(t.children[0]),this.scrollableContentHeight=x(b(e))})),this.batch(y(S()),(e=>{const t=M(e);this.calendarWidth=I(e),this.monthViewWidth=I(t),this.scrollableContentWidth=I(b(e))})),this.batch(C(),(e=>{this.yearViewHeight=x(M(e)),this.scrollableYearContentHeight=x(b(e))})),this.batch(y(C()),(e=>{this.yearViewWidth=I(M(e))})),this.batch(k(),(e=>{this.decadeViewHeight=x(M(e)),this.centuryViewHeight=this.decadeViewHeight})),this.batch(y(k()),(e=>{this.decadeViewWidth=I(M(e)),this.centuryViewWidth=this.decadeViewWidth})),this.batch(w(),(e=>{this.navigationItemHeight=x(e.querySelector("li"))}))}viewHeight(e){return this.viewDimension(e,"height")}viewWidth(e){return this.viewDimension(e,"width")}viewDimension(e,t){const s="height"===t?"ViewHeight":"ViewWidth";switch(e){case x.month:return this[`month${s}`];case x.year:return this[`year${s}`];case x.decade:return this[`decade${s}`];case x.century:return this[`century${s}`];default:return 1}}batch(e,t){const s=this.hostContainer||document.body,i=s.appendChild(e);t(i),s.removeChild(i)}}const Ue={33:Te.PrevView,34:Te.NextView,35:Te.LastInView,36:Te.FirstInView,37:Te.Left,38:Te.Up,39:Te.Right,40:Te.Down,"meta+38":Te.UpperView,"meta+40":Te.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,s,i,a){return i?t===Te.UpperView&&this.bus.canMoveUp(s)?(this.bus.moveUp(s,a),e):t===Te.LowerView&&this.bus.canMoveDown(s)?(this.bus.moveDown(s,a),e):i.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,s){if(e&&t){if(this.navigator=e,this.view=t,s.target===this.navigator.element){if(this.monthScrolled)return void(this.monthScrolled=!1);this.navScrolled=!0,this.scrollSiblingOf(this.navigator.element)}if(s.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),s=this.calculateScroll(t,e.scrollTop);t.scrollTo(s)}siblingComponent(e){return this.navigator.element===e?this.view:this.navigator}calculateScroll(e,t){const s=e===this.navigator?this.divideByMagnitude:this.powerByMagnitude;return s?s(t):0}}const je=e=>e?e.virtualization:null,Ze=(e=Xe.defaultProps.min,t=Xe.defaultProps.max,s,i)=>void 0!==i?null!==i&&L(a.getDate(i),e,t)?i:null:null!==s&&L(a.getDate(s),e,t)?s: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),s=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:s});this.bus.moveToBottom(this.state.activeView)}this.setState({value:t,focusedDate:s}),this.valueDuringOnChange=t;const{onChange:n}=this.props;if(n){const s={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:t,target:this};n.call(void 0,s)}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:s,metaKey:n}=e;if(this.focusedDate&&this.service){if(84===t&&this.setState({focusedDate:R()}),(s||n)&&(t===i.Keys.left||t===i.Keys.right)){if(this.props.disabled)return;this.didNavigationChange=!0,31===this.focusedDate.getDate()&&this.focusedDate.setDate(30);const e=t===i.Keys.left?this.focusedDate.getMonth()-1:this.focusedDate.getMonth()+1,s=new Date(this.focusedDate.setMonth(e)),n=a.cloneDate(s);this.setState({focusedDate:n})}if(t===i.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})},i.validatePackage(p);const s=Ze(this.min,this.max,this.props.defaultValue||e.defaultProps.defaultValue,this.props.value);this.state={value:s,activeView:O(x[t.defaultActiveView],this.bottomView,this.topView),focusedDate:z(t.focusedDate||s||R(),this.min,this.max)},this.dom=new Ke,this.bus=new We(this.handleViewChange),this.navigation=new Ye(this.bus),this.oldValue=s}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(){const{unstyled:e}=this.props;Promise.resolve().then((()=>{i.setScrollbarWidth(),this._element&&(this.dom.calculateHeights(this._element,e),this.scrollSyncService=new $e(this.dom),this.scrollSyncService.configure(this.state.activeView),this.forceUpdate())}))}componentDidUpdate(e,t){i.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:s,bottomView:o,topView:r,disabled:l,weekNumber:h,mobileMode:c,className:d}=this.props;t&&t(this);const p=s&&s.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,D=i.classNames(i.uCalendar.wrapper({c:p,disabled:l,weekNumber:h,mobileMode:c}),d),b=[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:s}),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:s})];return u.createElement("div",{ref:e=>{this._element=e},className:D,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},b)}};Ge.displayName="Calendar",Ge.propTypes={className:s.string,defaultActiveView:s.oneOf(["month","year","decade","century"]),defaultValue:s.instanceOf(Date),disabled:s.bool,focusedDate:s.instanceOf(Date),id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,weekDaysFormat:s.oneOf(["short","abbreviated","narrow"]),max:s.instanceOf(Date),min:s.instanceOf(Date),navigation:s.bool,smoothScroll:s.bool,onBlur:s.func,onChange:s.func,onFocus:s.func,tabIndex:s.number,value:s.instanceOf(Date),weekNumber:s.bool,topView:(e,t,s)=>{const i=e[t],a=e.bottomView;return i&&a&&x[i]<x[a]?new Error(`Invalid prop + ${t} suplied to ${s}.\n ${t} can not be smaller than bottomView.\n `):null},bottomView:(e,t,s)=>{const i=e[t],a=e.topView;return i&&a&&x[i]>x[a]?new Error(`Invalid prop + ${t} suplied to ${s}.\n ${t} can not be bigger than topView.\n `):null}},Ge.defaultProps={disabled:!1,min:E,max:V,weekDaysFormat:"short",navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",bottomView:"month",showOtherMonthDays:!1};let Xe=Ge;const Je=i.createPropsContext(),Qe=i.withIdHOC(i.withPropsContext(Je,i.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 st=class{constructor(e,t,s){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=s,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 s=0;s<t.length;s++)this.setExisting(t[s],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 s=a.cloneDate(this.value);switch(e){case"y":s.setFullYear(s.getFullYear()+t);break;case"M":s=a.addMonths(this.value,t);break;case"d":case"E":s.setDate(s.getDate()+t);break;case"h":case"H":s.setHours(s.getHours()+t);break;case"m":s.setMinutes(s.getMinutes()+t);break;case"s":s.setSeconds(s.getSeconds()+t);break;case"a":s.setHours(s.getHours()+12*t)}this.setExisting(e,!0),this._value=s}parsePart(e,t){if(this.resetLeadingZero(),!t)return this.setExisting(e,!1),{value:null};const s=this.intl.formatDate(this.value,this.format),i=this.dateFormatString(this.value,this.format),n=i.symbols;let o=!1,r="",l="",h="";for(let t=0;t<s.length;t++)n[t]===e?(l+=this.getExisting(e)?s[t]:"0",o=!0):o?h+=s[t]:r+=s[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 s=0;s<2;s++){let s=l+t,i=parseInt(s,10);if(c=this.intl.parseDate(r+s+h,this.format),!c&&!isNaN(i)&&!isNaN(parseInt(t,10))){if("M"===e&&!d){const e=i-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(s,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(i.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 s=this.partPattern(e,t);return"month"===s.type&&s.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 s=this.intl.splitDateFormat(t),i=[],a=[];for(let t=0;t<s.length;t++){let n=this.intl.formatDate(e,{pattern:s[t].pattern}).length;for(;n>0;)i.push(this.symbols[s[t].pattern[0]]||"_"),a.push(s[t]),n--}const n=new et;return n.symbols=i.join(""),n.partMap=a,n}merge(e,t){let s="",i="",a=t.symbols;for(let n=a.length-1;n>=0;n--)if(-1===this.knownParts.indexOf(a[n])||this.getExisting(a[n]))s=e[n]+s,i=a[n]+i;else{const e=a[n];for(;n>=0&&e===a[n];)n--;for(n++,s=this.leadingZero&&this.leadingZero[e]?"0"+s:this.dateFieldName(t.partMap[n])+s;i.length<s.length;)i=a[n]+i}return{text:s,format:i}}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 it="dayperiod",at="hour",nt="minute",ot="second",rt=e=>(t,s)=>{const i=a.cloneDate(t);return i[e](s),i},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,s)=>e(s))(t.getter):(e=>(t,s)=>e(t))(t.getter))((e=>e.reduce(((e,t)=>(e[t.type]=t.type,e)),{}))(t))))(lt),ct=(e=>(t,s)=>e.map((e=>{const i=Math.floor(t[e.type]);return i?((e,t,s,i)=>a=>{const n=e(a),o=e(s);return"hour"===i?n-(n-o)%t:a.getTime()<=s.getTime()&&0!==n&&n<=o?Math.ceil(n/t)*t:n-n%t})(e.getter,i,s,e.type):e.getter})))(lt),dt=e=>t=>{const s=a.cloneDate(t);return s.setHours(...e.map((e=>e(s)))),s},ut=rt("setHours"),pt=rt("setMinutes"),mt=rt("setSeconds"),gt=()=>new Date,vt=(e,t,s=1)=>{const i=[];for(let a=e;a<t;a+=s)i.push(a);return i},ft=(e,t,s)=>({candidateValue:F(T,e),maxValue:a.addDays(F(T,s),t.getHours()<s.getHours()?0:1),minValue:F(T,t)}),wt=(e,t,s)=>{if(!e||!t||!s)return!0;const{candidateValue:i,minValue:a,maxValue:n}=ft(e,t,s);return a<=i&&i<=n},Dt=(e,t,s)=>{if(null===e)return!0;const{candidateValue:i,minValue:a,maxValue:n}=ft(e,t,s);return a<=i&&i<=n},bt=(e,t)=>{if(null===e||null===t)return!1;const s=F(T,e),i=F(T,t);return s.getTime()<i.getHours()},yt=(e,t)=>{if(null===e||null===t)return!1;const s=F(T,e);return F(T,t).getTime()<s.getHours()},St=e=>{const t=n.useLocalization(),s=i.useUnstyled(),a=s&&s.uDateInput,o=t.toLanguageString(te,ye[te]);return u.createElement("span",{className:i.classNames(i.uDateInput.clearButton({c:a})),role:"button",onClick:t=>{t.stopPropagation();const{onClick:s}=e;s&&s.call(void 0,t)},tabIndex:e.tabindex||-1,title:o,key:"clearbutton"},u.createElement(i.IconWrap,{name:"x",icon:r.xIcon}))},Ct=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,s=this.value;this.kendoDate.setValue(t),this.triggerChange(e,s)},this.spinnersMouseDown=e=>{e.preventDefault();const t=i.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:s}=this.kendoDate.getTextAndFormat();this.currentFormat=s;const i=this.value,a=((e,t,s,i)=>{const a=e[i+e.length-s.length],n=e.substring(0,i+e.length-s.length),o=s.substring(0,i),r=[];if(n===o&&i>0)return r.push([t[i-1],o[i-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 s=o.length;s<n.length;s++)t[s]!==e&&"_"!==t[s]&&(e=t[s],r.push([e,""]));return r}if(0===o.indexOf(n)||"_"===t[i-1]){let e=t[0];for(let s=Math.max(0,n.length-1);s<t.length;s++)if("_"!==t[s]){e=t[s];break}return[[e,o[i-1]]]}return" "===o[o.length-1]||o[o.length-1]===a?[[t[i-1],"_"]]:[[t[i-1],o[i-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,i)},this.elementClick=e=>{this.setSelection(this.selectionByIndex(this.selection.start))},this.nativeWheel=e=>{i.getActiveElement(document)===this.element&&e.preventDefault()},this.wheel=e=>{i.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})},i.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:s=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,D=this.text,b=D===this.props.placeholder?"":D,y=D===this.props.placeholder?D:void 0,S=f||this._inputId,C=!this.validityStyles||this.validity.valid,k=u.createElement(i.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:i.classNames(i.uDateInput.wrapper({c:d,size:t,fillMode:s,rounded:a,disabled:w,required:this.required,invalid:!C}),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:D,type:"text",spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoFocus:h,className:i.classNames(i.uDateInput.inputInner({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,"aria-required":this.props.required,"aria-invalid":!C,onWheel:this.wheel,onClick:this.elementClick,onInput:this.elementChange,onPaste:this.handlePaste,onKeyDown:this.elementKeyDown,onChange:i.noop,value:b,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:i.classNames(i.uDateInput.inputSpinner({c:d})),onMouseDown:this.spinnersMouseDown},u.createElement(o.Button,{tabIndex:-1,type:"button",rounded:null,className:i.classNames(i.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:i.classNames(i.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:D,editorValid:C,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={...It.defaultProps,...this.props},{formatPlaceholder:s=e.defaultProps.formatPlaceholder,format:i=e.defaultProps.format,value:a,defaultValue:n}=t;null===this.kendoDate?(this.kendoDate=new st(this.intl.bind(this),s,i),this.kendoDate.setValue(a||n||null)):(this.kendoDate.format=i,this.kendoDate.formatPlaceholder=s),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,s)=>null===e||!(t&&t>e||s&&s<e))(this.value,this.min,this.max)&&wt(this.value,this.props.minTime,this.props.maxTime),t=void 0!==this.props.validationMessage,s=(!this.required||null!==this.value)&&e,i=void 0!==this.props.valid?this.props.valid:s;return{customError:t,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:i,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}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=i.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,s=0;for(let i=0;i<this.currentFormat.length;i++)this.currentFormat[i]===e&&(s=i+1,-1===t&&(t=i));return t<0&&(t=0),{start:t,end:s}}selectionByIndex(e){let t={start:e,end:e};for(let s=e,i=e-1;s<this.currentFormat.length||i>=0;s++,i--){if(s<this.currentFormat.length&&"_"!==this.currentFormat[s]){t=this.selectionBySymbol(this.currentFormat[s]);break}if(i>=0&&"_"!==this.currentFormat[i]){t=this.selectionBySymbol(this.currentFormat[i]);break}}return t}switchDateSegment(e){const{start:t,end:s}=this.selection;if(t<s&&this.currentFormat[t]!==this.currentFormat[s-1])return void this.setSelection(this.selectionByIndex(e>0?t:s-1));const i=this.currentFormat[t];let a=t+e;for(;a>0&&a<this.currentFormat.length&&(this.currentFormat[a]===i||"_"===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!==s)?this.setSelection({start:n+1,end:a+1}):a<n&&(a!==t||n!==s)&&this.setSelection({start:a,end:n})}modifyDateSegmentValue(e,t){if(!this.kendoDate)return;const s=this.value,i=this.currentFormat[this.selection.start],a=this.kendoDate.symbolMap(i),n=((this.props.steps||{})[a]||1)*e;this.kendoDate.modifyPart(i,n),this.triggerChange(t,s)}};Ct.displayName="DateInput",Ct.propTypes={value:s.instanceOf(Date),format:s.oneOfType([s.string,s.shape({skeleton:s.string,pattern:s.string,date:s.oneOf(["short","medium","long","full"]),time:s.oneOf(["short","medium","long","full"]),datetime:s.oneOf(["short","medium","long","full"]),era:s.oneOf(["narrow","short","long"]),year:s.oneOf(["numeric","2-digit"]),month:s.oneOf(["numeric","2-digit","narrow","short","long"]),day:s.oneOf(["numeric","2-digit"]),weekday:s.oneOf(["narrow","short","long"]),hour:s.oneOf(["numeric","2-digit"]),hour12:s.bool,minute:s.oneOf(["numeric","2-digit"]),second:s.oneOf(["numeric","2-digit"]),timeZoneName:s.oneOf(["short","long"])})]),formatPlaceholder:s.oneOfType([s.oneOf(["wide","narrow","short","formatPattern"]),s.shape({year:s.string,month:s.string,day:s.string,hour:s.string,minute:s.string,second:s.string})]),width:s.oneOfType([s.string,s.number]),tabIndex:s.number,title:s.string,steps:s.shape({year:s.number,month:s.number,day:s.number,hour:s.number,minute:s.number,second:s.number}),min:s.instanceOf(Date),max:s.instanceOf(Date),disabled:s.bool,spinners:s.bool,name:s.string,dir:s.string,label:s.string,id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,ariaLabel:s.string,ariaRole:s.string,ariaHasPopup:s.oneOfType([s.bool,s.string]),ariaExpanded:s.oneOfType([s.bool]),onChange:s.func,validationMessage:s.string,required:s.bool,validate:s.bool,valid:s.bool,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"solid","flat","outline"]),autoFocus:s.bool},Ct.defaultProps={format:"d",size:"medium",rounded:"medium",fillMode:"solid",formatPlaceholder:"wide",spinners:!1,disabled:!1,max:a.cloneDate(V),min:a.cloneDate(E),minTime:a.cloneDate(N),maxTime:a.cloneDate(P),validityStyles:!0,validationMessage:"Please enter a valid value!",placeholder:null,ariaHasPopup:"grid",autoFocus:!1};let kt=Ct;const xt=i.createPropsContext(),It=i.withIdHOC(i.withPropsContext(xt,i.withUnstyledHOC(kt)));It.displayName="KendoReactDateInput",n.registerForIntl(kt),n.registerForLocalization(kt);const Mt=o.Button,Ot=u.forwardRef(((e,t)=>{const{_ref:s}=e,a=u.useRef(null);u.useImperativeHandle(t,(()=>a.current)),u.useImperativeHandle(s,(()=>a.current));const n=u.useMemo((()=>i.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)})),Tt=e=>{const{dateInput:t,...s}=e,i=(e=>{const[t,s]=u.useState(!1);return u.useEffect((()=>{e.current&&s(!!e.current.text)})),{editorValue:t}})(t);return u.createElement(l.FloatingLabel,{...s,...i})},Et=e=>{const{footer:t,children:s,windowWidth:i=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:i<=500?{top:0,width:"100%",height:"100%"}:void 0,className:i<=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)),s,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,Nt=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:s,weekNumber:n,focusedDate:o,popupSettings:r}=this.props,{popupClass:l,...h}=r,c=this.show,d=this.value,p=d&&a.getDate(d),m=i.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,onMouseDownOutside:this.handleMouseDownOutside},v={disabled:e,value:p,min:t,max:s,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(Et,{...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:s}=this.props;s&&s.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.togglePopup=()=>{this.setShow(!this.show)},this.handleMouseDownOutside=e=>{var t;null!=(t=this.props.popupSettings)&&t.onMouseDownOutside&&this.props.popupSettings.onMouseDownOutside.call(void 0,e)},this.handleIconClick=()=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:t,keyCode:s}=e;if(s===i.Keys.esc&&this.show)return this.shouldFocusDateInput=!0,void this.setShow(!1);t&&(s===i.Keys.up||s===i.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=s===i.Keys.up,this.setShow(s===i.Keys.down))},i.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(i.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,s=(!this.required||null!==this.value)&&e,i=void 0!==this.props.valid?this.props.valid:s;return{customError:t,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:i,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}componentDidMount(){var e;this.observerResize=i.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:s=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:D,required:b,validityStyles:y,ariaLabelledBy:S,ariaDescribedBy:C,ariaLabel:k,placeholder:x,label:I,popupSettings:M,defaultValue:O,defaultShow:T,value:E,popup:V,weekNumber:N,dateInput:P,calendar:F,toggleButton:R,onChange:L,onBlur:B,onFocus:_,show:H,onOpen:A,pickerWrap:z,adaptive:q,adaptiveTitle:W,valid:K,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:C,ariaLabel:k,max:g,min:m,name:w,onChange:this.handleInputValueChange,required:b,tabIndex:this.show?-1:l,title:h,valid:this.validity.valid,validationMessage:D,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(ie,ye[ie]),ee=u.createElement(i.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:i.classNames("k-input","k-datepicker",{[`k-input-${i.kendoThemeMaps.sizeMap[t]||t}`]:t,[`k-rounded-${i.kendoThemeMaps.roundedMap[s]||s}`]:s,[`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(Tt,{dateInput:this._dateInput,label:I,editorId:c,editorValid:X,editorDisabled:o,children:ee,style:{width:f},...Z}):ee}setShow(e){const{onOpen:t,onClose:s}=this.props;this.show!==e&&(this.setState({show:e}),e&&t&&t.call(void 0,{target:this}),!e&&s&&s.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(const t of e)this.setState({windowWidth:t.target.clientWidth})}};Nt.displayName="DatePicker",Nt.propTypes={className:s.string,defaultShow:s.bool,defaultValue:s.instanceOf(Date),disabled:s.bool,focusedDate:s.instanceOf(Date),format:s.oneOfType([s.string,s.shape({skeleton:s.string,pattern:s.string,date:s.oneOf(["short","medium","long","full"]),time:s.oneOf(["short","medium","long","full"]),datetime:s.oneOf(["short","medium","long","full"]),era:s.oneOf(["narrow","short","long"]),year:s.oneOf(["numeric","2-digit"]),month:s.oneOf(["numeric","2-digit","narrow","short","long"]),day:s.oneOf(["numeric","2-digit"]),weekday:s.oneOf(["narrow","short","long"]),hour:s.oneOf(["numeric","2-digit"]),hour12:s.bool,minute:s.oneOf(["numeric","2-digit"]),second:s.oneOf(["numeric","2-digit"]),timeZoneName:s.oneOf(["short","long"])})]),formatPlaceholder:s.oneOfType([s.oneOf(["wide","narrow","short","formatPattern"]),s.shape({year:s.string,month:s.string,day:s.string,hour:s.string,minute:s.string,second:s.string})]),id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,ariaLabel:s.string,min:s.instanceOf(Date),max:s.instanceOf(Date),name:s.string,popupSettings:s.shape({animate:s.bool,appendTo:s.any,popupClass:s.string}),show:s.bool,tabIndex:s.number,title:s.string,value:s.instanceOf(Date),weekNumber:s.bool,width:s.oneOfType([s.number,s.string]),validationMessage:s.string,required:s.bool,validate:s.bool,valid:s.bool,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"solid","flat","outline"]),adaptive:s.bool,adaptiveTitle:s.string,autoFocus:s.bool},Nt.defaultProps={defaultShow:!1,defaultValue:null,dateInput:It,calendar:Qe,toggleButton:Mt,popup:h.Popup,pickerWrap:Ot,disabled:!1,format:"d",max:V,min:E,popupSettings:{},tabIndex:0,weekNumber:!1,validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1};let Pt=Nt;const Ft=i.createPropsContext(),Rt=i.withIdHOC(i.withPropsContext(Ft,Pt));Rt.displayName="KendoReactDatePicker",n.registerForLocalization(Pt);const Lt=(e,t)=>{const s=a.cloneDate(e);return s.setHours(t),s},Bt=e=>null!==e&&e<12,_t=(e,t,s)=>!t&&!s||e>=t&&e<=s,Ht=(e,t,s)=>!t&&!s||e>=t||e<=s;let At=class{constructor(e){this.intl=e,this.min=null,this.max=null,this.part=null}apply(e,t){const s=e.getHours(),i=Bt(s),a=Bt(t.getHours());if(i&&a||!i&&!a)return e;const[n,o=24]=this.normalizedRange(),r=s+(a?-12:12);return Lt(e,Math.min(Math.max(n,r),o||24))}configure(e){const{min:t=this.min,max:s=this.max,part:i=this.part}=e;this.min=t,this.max=s,this.part=i}data(e){const t=this.part&&this.part.names;if(!t||!this.min)return[];const s=[],[i,a]=this.normalizedRange(),n=this.intl.dateFormatNames(t);return Bt(i)&&s.push({text:n.am,value:Lt(this.min,i)}),(e=>null!==e&&(!e||e>11))(a)&&s.push({text:n.pm,value:Lt(this.min,Math.max(12,a))}),this.min.getHours()!==i?s.reverse():s}isRangeChanged(e,t){return!1}limitRange(e,t,s){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,t){if(!i.canUseDOM)return;const s=t&&t.uTime,a=q("div"),n=q("span"),o=q("ul"),r=q("li"),l=a([n("minute",i.strippedClassNames(i.uTime.title({c:s}))),a([a([o([r("<span>02</span>",i.strippedClassNames(i.uTime.li({c:s})))],i.strippedClassNames(i.uTime.ul({c:s})))],i.strippedClassNames(i.uTime.containerSelector({c:s}),i.uTime.container({c:s,content:!0,scrollable:!0})))],i.strippedClassNames(i.uTime.list({c:s})))],i.strippedClassNames(i.uTime.listWrapper({c:s})),{left:"-10000px",position:"absolute"}),h=`.${i.strippedClassNames(i.uTime.containerSelector({c:s}))}`,c=e&&e.querySelector(h)||document.body,d=c.appendChild(l);this.timeListHeight=d.querySelector(h).offsetHeight,this.itemHeight=d.querySelector("li").offsetHeight,c.removeChild(d),this.didCalculate=!0}};const qt=(e=>t=>t%e)(24),Wt=(e,t)=>qt(24+e-t),Kt=e=>(t,s)=>s&&a.getDate(t).getTime()!==a.getDate(s).getTime()?ut(t,e):t,Ut=Kt(0),Yt=Kt(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:s=this.insertUndividedMax,min:i=this.min,max:a=this.max,part:n,step:o=this.step}=e;this.boundRange=t,this.insertUndividedMax=s,this.toListItem=e=>{const t=ut(T,e);return{text:this.intl.formatDate(t,n.pattern),value:t}},this.min=i,this.max=a,this.step=o}data(e){const[t]=this.range(e),s=((e,t)=>s=>qt(e+s*t))(t,this.step),i=vt(0,this.countFromMin(e)).map((e=>this.toListItem&&this.toListItem(s(e))));return this.addLast(i),e&&this.addMissing(i,e),i}isRangeChanged(e,t){return!(!this.min||!this.max)&&(!a.isEqual(this.min,e)||!a.isEqual(this.max,t))}limitRange(e,t,s){return this.boundRange?[Ut(e,s),Yt(t,s)]:[e,t]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,s=this.isMissing(e)?1:0;return this.countFromMin(e)+s+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 s=this.toListItem(t.getHours());e.splice(this.selectedIndex(t),0,s)}return e}countFromMin(e){const[t,s]=this.range(e);return Math.floor(Wt(s,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 Wt(e.getHours(),this.min.getHours())/this.step}lastHour(e){return this.range(e)[1]}range(e){const[t,s]=this.limitRange(this.min,this.max,e);return[t.getHours(),s.getHours()]}};const jt=(e=>t=>t%e)(60),Zt=(e,t)=>jt(60+e-t),Gt=e=>(t,s)=>s&&t.getHours()!==s.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:s=this.min,max:i=this.max,part:a,step:n=this.step}=e;this.insertUndividedMax=t,this.toListItem=e=>{const t=pt(T,e);return{text:this.intl.formatDate(t,a.pattern),value:t}},this.min=s,this.max=i,this.step=n}data(e){const[t]=this.range(e),s=((e,t)=>s=>jt(e+s*t))(t,this.step),i=vt(0,this.countFromMin(e)).map((e=>this.toListItem&&this.toListItem(s(e))));return this.addLast(i),e&&this.addMissing(i,e),i}isRangeChanged(e,t){return!(null===this.min||null===this.max||a.isEqual(this.min,e)&&a.isEqual(this.max,t))}limitRange(e,t,s){return[Xt(e,s),Jt(t,s)]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,s=this.isMissing(e)?1:0;return this.countFromMin(e)+s+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 s=this.toListItem(t.getMinutes());e.splice(this.selectedIndex(t),0,s)}return e}countFromMin(e){const[t,s]=this.range(e);return Math.floor(Zt(s,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,s]=this.limitRange(this.min,this.max,e);return[t.getMinutes(),s.getMinutes()]}};const es=(e=>t=>t%e)(60),ts=(e,t)=>es(60+e-t),ss=e=>(t,s)=>!s||t.getMinutes()===s.getMinutes()&&t.getHours()===s.getHours()?t:mt(t,e),is=ss(0),as=ss(59);class ns{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:s=this.min,max:i=this.max,part:a,step:n=this.step}=e;this.insertUndividedMax=t,this.toListItem=e=>{const t=mt(T,e);return{text:this.intl.formatDate(t,a.pattern),value:t}},this.min=s,this.max=i,this.step=n}data(e){const[t]=this.range(e),s=((e,t)=>s=>es(e+s*t))(t,this.step),i=vt(0,this.countFromMin(e)).map((e=>this.toListItem&&this.toListItem(s(e))));return this.addLast(i),e&&this.addMissing(i,e),i}isRangeChanged(e,t){return!(null===this.min||null===this.max||a.isEqual(this.min,e)&&a.isEqual(this.max,t))}limitRange(e,t,s){return[is(e,s),as(t,s)]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,s=this.isMissing(e)?1:0;return this.countFromMin(e)+s+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 ts(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 s=this.toListItem(t.getSeconds());e.splice(this.selectedIndex(t),0,s)}return e}countFromMin(e){const[t,s]=this.range(e);return Math.floor(ts(s,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,s]=this.limitRange(this.min,this.max,e);return[t.getSeconds(),s.getSeconds()]}}const os={[i.Keys.end]:(e,t)=>e[e.length-1],[i.Keys.home]:(e,t)=>e[0],[i.Keys.up]:(e,t)=>e[t-1],[i.Keys.down]:(e,t)=>e[t+1]},rs={[it]:At,[at]:$t,[nt]:Qt,[ot]:ns},ls=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),s=this.virtualization.activeIndex(),i=this.virtualization.itemOffset(s),a=Math.abs(Math.ceil(e)-i);if(t===s&&a<2)return i;const n=t>s;return n&&a>=this.bottomThreshold||!n&&a>this.topThreshold?this.virtualization.itemOffset(s+1):i},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:s}=this.props)=>{if(this.service){const[i,a]=this.service.limitRange(e||this.min,t||this.max,s||this.props.value);this.service.configure(this.serviceSettings({min:i,max:a}))}},this.serviceSettings=t=>{const s={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},i=Object.assign({},s,t);return i.boundRange="hour"!==i.part.type||this.props.boundRange||e.defaultProps.boundRange,i},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)),s=this.service.data(this.props.value)[t];this.handleChange(s)}},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=i.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===i.Keys.down||t===i.Keys.up||t===i.Keys.end||t===i.Keys.home)&&e.preventDefault();const s=(os[e.keyCode]||i.noop)(this.service.data(this.props.value),this.service.selectedIndex(this.props.value));s&&this.handleChange(s)},this.handleChange=W((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:s}=this.props;s&&s.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((()=>{const{unstyled:e}=this.props;this._element&&(this.dom.calculateHeights(this._element,e),this.forceUpdate())}))}componentDidUpdate(){if(!this.virtualization||!this.service)return;const e=this.service.selectedIndex(this.props.value);if(this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](e),this.animateToIndex=!0,!this.topOffset&&this._element){const{unstyled:e}=this.props;this.dom.calculateHeights(this._element,e)}}render(){const{part:e,value:t,unstyled:s}=this.props;if(!e.type||!rs[e.type])return;const a=s&&s.uTime;this.calculateHeights(),this.intl=n.provideIntlService(this),this.service=new rs[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:i.classNames(i.uTime.ul({c:a}))},o.map(((e,t)=>u.createElement("li",{key:t,className:i.classNames(i.uTime.li({c:a})),onClick:()=>{this.handleChange(e)}},u.createElement("span",null,e.text))))),u.createElement("div",{className:i.classNames(i.uTime.scrollablePlaceholder({c:a}))}));return u.createElement("div",{className:i.classNames(i.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:i.classNames(i.uTime.containerSelector({c:a}),i.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,unstyled:s}):u.createElement("div",{className:i.classNames(i.uTime.containerSelector({c:a}),i.uTime.container({c:a,content:!0,scrollable:!0}))},h))}};ls.propTypes={id:s.number,max:s.instanceOf(Date),min:s.instanceOf(Date),part:function(e,t,s){const i=e[t];if(!i||!rs[i.type])throw new Error(`\n Invalid prop '${t}' supplied to ${s}.\n Supported part types are hour|minute|second|dayperiod.\n `);return null},step:function(e,t,s){const i=e[t];if(void 0!==i&&i<=0)throw new Error(`\n Invalid prop '${t}' supplied to ${s}.\n ${t} cannot be less than 1.\n `);return null},value:s.instanceOf(Date),smoothScroll:s.bool,show:s.bool},ls.defaultProps={boundRange:!1,max:P,min:T,step:1,smoothScroll:!0};let hs=ls;n.registerForIntl(hs);const cs=new RegExp(`${at}|${nt}|${ot}|${it}|literal`),ds=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 s=this.timeLists[0];!t&&-1===this.state.activeListIndex&&!this.hasActiveButton()&&s&&s.element&&s.focus(e)}))},this.timeFormatReducer=(e,t)=>e+t.pattern,this.timeFormatFilter=(e,t,s)=>{const i=t>=1&&s[t-1];return i&&i&&"literal"===e.type?cs.test(i.type||""):cs.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,s,i)=>e.length||t.props.id!==this.state.activeListIndex?e:[{next:i[s+1]||t,prev:i[s-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 i.Keys.left:return e.preventDefault(),void this.focusList(0);case i.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,s)=>{if(!e||!t||!s)return e;const{candidateValue:i,minValue:a,maxValue:n}=ft(e,t,s);return i<a?F(e,t):i>n?F(e,s):e})(this.snapTime(a.cloneDate(this.props.value||T)),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:s,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=i.classNames(i.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:i.classNames(i.uTime.header({c:m}))},u.createElement("span",{className:i.classNames(i.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:i.classNames(i.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:i.classNames(i.uTime.listContainer({c:m})),onKeyDown:this.handleKeyDown},u.createElement("span",{className:i.classNames(i.uTime.highlight({c:m}))}),this.dateFormatParts.map(((e,t)=>"literal"!==e.type?u.createElement("div",{key:t,className:i.classNames(i.uTime.listWrapper({c:m,focused:t===this.state.activeListIndex})),role:"presentation",tabIndex:-1},u.createElement("span",{className:i.classNames(i.uTime.title({c:m})),onMouseDown:e=>{e.preventDefault()}},this.intl.dateFieldName(e)),u.createElement(hs,{min:this.min,max:this.max,boundRange:this.boundRange,part:e,step:e.type?this.steps[e.type]:1,smoothScroll:s,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:i.classNames(i.uTime.separator({c:m}))},e.pattern)))))}nextTick(e){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout((()=>e()))}hasActiveButton(){const e=i.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)}};ds.propTypes={cancelButton:s.bool,disabled:s.bool,format:s.oneOfType([s.string,s.shape({skeleton:s.string,pattern:s.string,date:s.oneOf(["short","medium","long","full"]),time:s.oneOf(["short","medium","long","full"]),datetime:s.oneOf(["short","medium","long","full"]),era:s.oneOf(["narrow","short","long"]),year:s.oneOf(["numeric","2-digit"]),month:s.oneOf(["numeric","2-digit","narrow","short","long"]),day:s.oneOf(["numeric","2-digit"]),weekday:s.oneOf(["narrow","short","long"]),hour:s.oneOf(["numeric","2-digit"]),hour12:s.bool,minute:s.oneOf(["numeric","2-digit"]),second:s.oneOf(["numeric","2-digit"]),timeZoneName:s.oneOf(["short","long"])})]),max:s.instanceOf(Date),min:s.instanceOf(Date),nowButton:s.bool,steps:s.shape({hour:s.number,minute:s.number,second:s.number}),smoothScroll:s.bool,tabIndex:s.number,value:s.instanceOf(Date),show:s.bool},ds.defaultProps={value:null,disabled:!1,nowButton:!0,cancelButton:!0,format:"hh:mm a",min:N,max:P,steps:{},boundRange:!1};let us=ds;n.registerForIntl(us),n.registerForLocalization(us);const ps=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!==i.Keys.enter||this.hasActiveButton()||this.handleAccept(e)},this.revertToNowButton=e=>{const{keyCode:t,shiftKey:s}=e;!s&&t===i.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:s,shiftKey:a}=e;a&&s===i.Keys.tab?(e.preventDefault(),this._acceptButton&&(null==(t=this._acceptButton.element)||t.focus({preventScroll:!0}))):s===i.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:s}=this.props;s&&s.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:s}=this.props;s&&s.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,s)=>(t.setHours(...e.map((e=>e(t,s)))),t))(ht(this.dateFormatParts)),this.hasActiveButton=this.hasActiveButton.bind(this),this.state={current:this.props.value||T,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:s,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,D=f&&f.uTime,b=n.provideLocalizationService(this),y=b.toLanguageString(de,ye[de]),S=b.toLanguageString(ue,ye[ue]);return u.createElement("div",{ref:e=>{this._element=e},tabIndex:s?void 0:a||0,className:i.classNames(i.uTimePicker.timeSelector({c:w,mobileMode:v,disabled:s}),r),onKeyDown:this.handleKeyDown},u.createElement(us,{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:s,nowButton:p,steps:m,show:g,mobileMode:v,onNowKeyDown:this.handleNowKeyDown,unstyled:f}),this.props.footer&&u.createElement("div",{className:i.classNames(i.uTime.footer({c:D}))},t&&u.createElement(o.Button,{type:"button",ref:e=>{this._cancelButton=e},className:i.classNames(i.uTime.cancel({c:D})),onClick:this.handleReject,title:y,"aria-label":y},y),u.createElement(o.Button,{type:"button",ref:e=>{this._acceptButton=e},className:i.classNames(i.uTime.accept({c:D})),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=i.getActiveElement(document);return this._acceptButton&&e===this._acceptButton.element||this._cancelButton&&e===this._cancelButton.element}};ps.propTypes={cancelButton:s.bool,className:s.string,disabled:s.bool,format:s.oneOfType([s.string,s.shape({skeleton:s.string,pattern:s.string,date:s.oneOf(["short","medium","long","full"]),time:s.oneOf(["short","medium","long","full"]),datetime:s.oneOf(["short","medium","long","full"]),era:s.oneOf(["narrow","short","long"]),year:s.oneOf(["numeric","2-digit"]),month:s.oneOf(["numeric","2-digit","narrow","short","long"]),day:s.oneOf(["numeric","2-digit"]),weekday:s.oneOf(["narrow","short","long"]),hour:s.oneOf(["numeric","2-digit"]),hour12:s.bool,minute:s.oneOf(["numeric","2-digit"]),second:s.oneOf(["numeric","2-digit"]),timeZoneName:s.oneOf(["short","long"])})]),max:s.instanceOf(Date),min:s.instanceOf(Date),nowButton:s.bool,steps:s.shape({hour:s.number,minute:s.number,second:s.number}),smoothScroll:s.bool,tabIndex:s.number,value:s.instanceOf(Date),show:s.bool},ps.defaultProps={value:null,disabled:!1,cancelButton:!0,format:"t",min:N,max:P,boundRange:!1,footer:!0};let ms=ps;n.registerForIntl(ms),n.registerForLocalization(ms);const gs=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:s,disabled:i,format:a,steps:n,unstyled:o}=this.props;return u.createElement(ms,{ref:this.setTimeSelectorRef,mobileMode:this.mobileMode,show:this.show,cancelButton:t,disabled:i,nowButton:s,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:s}=this.props,a=s&&s.uTimePicker,n=i.classNames(e),o={popupClass:i.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(Et,{...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,s=this.state.candidate||this.value;t&&t.call(void 0,{syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:s,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:s}=e;if(s===i.Keys.esc)return this.shouldFocusDateInput=!0,void this.setShow(!1);t&&(s===i.Keys.up||s===i.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=s===i.Keys.up,this.setShow(s===i.Keys.down))},i.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(i.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),s=this.normalizeTime(this.max),i=Dt(e,t,s),a=void 0!==this.props.validationMessage,n=(!this.required||null!==this.value)&&i,o=void 0!==this.props.valid?this.props.valid:n;return{customError:a,rangeOverflow:yt(e,s),rangeUnderflow:bt(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}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=i.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:s=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:D,validityStyles:b,ariaLabelledBy:y,ariaDescribedBy:S,unstyled:C}=this.props,k=C&&C.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:D,steps:f,tabIndex:this.show?-1:l,title:h,valid:this.validity.valid,validationMessage:w,validityStyles:b,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]),T=u.createElement(i.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:i.classNames(i.uTimePicker.wrapper({c:k,size:t,rounded:s,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:i.classNames(i.uTimePicker.inputButton({c:k})),rounded:null,fillMode:a,"aria-label":M}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup())));return this.props.label?u.createElement(Tt,{dateInput:this._dateInput,label:this.props.label,editorId:c,editorValid:x,editorDisabled:this.props.disabled,children:T,style:{width:this.props.width}}):T}normalizeTime(e){return F(T,e)}setShow(e){const{onOpen:t,onClose:s}=this.props;this.show!==e&&(this.setState({show:e}),e&&t&&t.call(void 0,{target:this}),!e&&s&&s.call(void 0,{target:this}))}mergeTime(e){return this.value&&e?F(this.value,e):e}calculateMedia(e){for(const t of e)this.setState({windowWidth:t.target.clientWidth})}};gs.displayName="TimePicker",gs.propTypes={className:s.string,cancelButton:s.bool,nowButton:s.bool,defaultShow:s.bool,defaultValue:s.instanceOf(Date),disabled:s.bool,format:s.oneOfType([s.string,s.shape({skeleton:s.string,pattern:s.string,date:s.oneOf(["short","medium","long","full"]),time:s.oneOf(["short","medium","long","full"]),datetime:s.oneOf(["short","medium","long","full"]),era:s.oneOf(["narrow","short","long"]),year:s.oneOf(["numeric","2-digit"]),month:s.oneOf(["numeric","2-digit","narrow","short","long"]),day:s.oneOf(["numeric","2-digit"]),weekday:s.oneOf(["narrow","short","long"]),hour:s.oneOf(["numeric","2-digit"]),hour12:s.bool,minute:s.oneOf(["numeric","2-digit"]),second:s.oneOf(["numeric","2-digit"]),timeZoneName:s.oneOf(["short","long"])})]),formatPlaceholder:s.oneOfType([s.oneOf(["wide","narrow","short","formatPattern"]),s.shape({year:s.string,month:s.string,day:s.string,hour:s.string,minute:s.string,second:s.string})]),id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,min:s.instanceOf(Date),max:s.instanceOf(Date),name:s.string,popupSettings:s.shape({animate:s.bool,appendTo:s.any,popupClass:s.string}),show:s.bool,steps:s.shape({hour:s.number,minute:s.number,second:s.number}),smoothScroll:s.bool,tabIndex:s.number,title:s.string,value:s.instanceOf(Date),width:s.oneOfType([s.number,s.string]),validationMessage:s.string,required:s.bool,validate:s.bool,valid:s.bool,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"solid","flat","outline"])},gs.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"t",max:P,min:N,popupSettings:{},tabIndex:0,steps:{},validityStyles:!0,dateInput:It,size:"medium",rounded:"medium",fillMode:"solid"};let vs=gs;const fs=i.createPropsContext(),ws=i.withIdHOC(i.withPropsContext(fs,i.withUnstyledHOC(vs)));ws.displayName="KendoReactTimePicker",n.registerForLocalization(vs);const Ds=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,s)=>{const{onWeekSelect:i}=this.props;i&&s&&i.call(void 0,e,t,s)},this.handleDateChange=(e,t=!1)=>{const{onChange:s}=this.props;if(s){const i={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:a.cloneDate(e.value),target:this,isTodayClick:t};s.call(void 0,i)}}}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=i.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})))))}};Ds.defaultProps={showWeekNumbers:!1,views:2,take:2,allowReverse:!0,weekDaysFormat:"short",min:E,max:V};let bs=Ds;const ys=(e=Is.defaultProps.min,t=Is.defaultProps.max,s)=>s instanceof Date&&!Array.isArray(s)&&L(a.getDate(s),e,t)?a.getDate(s):null,Ss=(e=Is.defaultProps.min,t=Is.defaultProps.max,s)=>Array.isArray(s)?s.filter((s=>L(s,e,t))).map((e=>a.getDate(e))):null,Cs=e=>"object"!=typeof e||e instanceof Date||null===e||Array.isArray(e)?I:e,ks=(e,t,s)=>e||t&&t[0]||s&&s.start,xs=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:s,start:i}=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:s}:{start:i||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 s=this.move(e,t);this.setState({navigateDate:s,focusedDate:s})},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:s,start:i}=t;return"end"!==this.activeRange?null!==s&&e>s:null!==i&&e<i},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=Te.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(Te.NextView,this.focusedDate)},this.handleKeyDown=e=>{const{keyCode:t,ctrlKey:s,metaKey:n}=e;if(84===t){const e=R();this.calculateFocusFromValue=!1,this.setState({focusedDate:e,navigateDate:e})}if((s||n)&&(t===i.Keys.left&&this.handlePrevButtonClick(),t===i.Keys.right&&this.handleNextButtonClick()),t===i.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,s)=>{if("single"===this.props.mode)return;const i=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(i,e));this.setState({value:o,focusedDate:e})}"range"===this.props.mode&&(o={start:i,end:n},this.setState({value:o,focusedDate:e}));const{onChange:r}=this.props;if(r){const e={syntheticEvent:s,nativeEvent:s.nativeEvent,value:o,target:this};r.call(void 0,e)}},this.handleDateChange=e=>{const t=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:t,navigateDate:t});this.bus.moveToBottom(this.state.activeView)}let i;switch(this.calculateFocusFromValue=!0,this.props.mode){case"single":default:i=a.cloneDate(e.value);break;case"multiple":if(Array.isArray(this.selectedMultiple)){const t=this.selectedMultiple.slice();let s=-1;t.forEach(((t,i)=>{a.isEqualDate(t,e.value)&&(s=i)})),-1!==s?t.splice(s,1):t.push(a.cloneDate(e.value)),i=t.slice()}else i=this.selectedDate?[a.cloneDate(this.selectedDate),a.cloneDate(e.value)]:[a.cloneDate(e.value)];break;case"range":i=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=i,e.isTodayClick&&this.setState({navigateDate:t}),this.setState({value:i,focusedDate:t}),this.valueDuringOnChange=i;const{onChange:n}=this.props;if(n){const t={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:i,target:this};n.call(void 0,t)}this.valueDuringOnChange=void 0};const s=void 0!==t.value?t.value:t.defaultValue||e.defaultProps.defaultValue,n=ys(this.min,this.max,s),o=Ss(this.min,this.max,s),r=Cs(s),l=ks(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:s,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 We(this.handleViewChange),this.navigation=new Ye(this.bus),this.calculateFocusFromValue=!1,this.lastView=h,this.lastViewsCount=this.props.views||bs.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=ys(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||bs.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=ys(this.min,this.max,this.value),this.selectedMultiple=Ss(this.min,this.max,this.value),this.selectedRange=Cs(this.value);const t=ks(this.selectedDate,this.selectedMultiple,this.selectedRange);this._focusedDate=z(this.calculateFocusFromValue&&null!==t?t:this.state.focusedDate,this.min,this.max);const s=i.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(Te.PrevView),p=!this.canNavigate(Te.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||bs.defaultProps.views));const D=a.cloneDate(this.dates&&this.dates[0]?this.dates[0]:R());return u.createElement("div",{ref:e=>{this._element=e},className:s,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.${D.getTime()}`,activeView:e,currentDate:D,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(Ce,{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(bs,{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)}};xs.displayName="MultiViewCalendar",xs.propTypes={activeRangeEnd:s.oneOf(["start","end"]),allowReverse:s.bool,bottomView:s.oneOf(["month","year","decade","century"]),className:s.string,defaultActiveView:s.oneOf(["month","year","decade","century"]),defaultValue:s.oneOfType([M(s.instanceOf(Date)),s.arrayOf(s.instanceOf(Date)),s.shape({start:M(s.instanceOf(Date)),end:M(s.instanceOf(Date))})]),disabled:s.bool,focusedDate:s.instanceOf(Date),id:s.string,weekDaysFormat:s.oneOf(["narrow","short","abbreviated"]),ariaLabelledBy:s.string,ariaDescribedBy:s.string,max:s.instanceOf(Date),min:s.instanceOf(Date),mode:s.oneOf(["single","multiple","range"]),onBlur:s.func,onChange:s.func,onFocus:s.func,tabIndex:s.number,topView:s.oneOf(["month","year","decade","century"]),value:s.oneOfType([M(s.instanceOf(Date)),s.arrayOf(s.instanceOf(Date)),s.shape({start:M(s.instanceOf(Date).isRequired),end:M(s.instanceOf(Date).isRequired)})]),views:(e,t,s)=>{const i=e[t];return void 0!==i&&i<1?new Error(`Invalid prop '${t}' supplied to'${s}'. The '${t}' property cannot be less than 1'`):null},weekNumber:s.bool,showOtherMonthDays:s.bool,dir:s.string},xs.defaultProps={disabled:!1,min:E,max:V,navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",weekDaysFormat:"short",tabIndex:0,bottomView:"month",views:2,allowReverse:!1,showOtherMonthDays:!1};let Is=xs;const Ms=i.createPropsContext(),Os=i.withIdHOC(i.withPropsContext(Ms,Is));Os.displayName="KendoReactMultiViewCalendar",n.registerForIntl(Is),n.registerForLocalization(Is);const Ts=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(Os,{...t,ref:this.setCalendarRef})},this.renderPopup=()=>{const e={popupClass:i.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(De,ye[De]),onCancel:this.handleCancel,applyText:this.localizationService.toLanguageString(be,ye[be]),onApply:this.handleBlur}};return u.createElement(Et,{...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},s={syntheticEvent:e,nativeEvent:e.nativeEvent};this.handleChange(t,s)},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:s}=e;t===i.Keys.esc?(e.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1)):s&&t===i.Keys.down?(e.preventDefault(),this.shouldFocusCalendar=!0,this.setShow(!0),this.focusCalendarElement()):s&&t===i.Keys.up&&(e.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1))},this.handleChange=(e,t)=>{this.setState({value:e}),this.valueDuringOnChange=e;const{onChange:s}=this.props;if(s){const e={syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:this.value,show:this.show,target:this};s.call(void 0,e)}this.valueDuringOnChange=void 0},i.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(i.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=i.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,s=(this.props.startDateInputSettings||{}).id||this._startInputId,a=(this.props.endDateInputSettings||{}).id||this._endInputId,l=i.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":s+" "+a,"aria-label":n.provideLocalizationService(this).toLanguageString(ae,ye[ae])},u.createElement(i.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=i.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:s}=this.props;this.show!==e&&(this.setState({show:e}),e&&t&&t.call(void 0,{target:this}),!e&&s&&s.call(void 0,{target:this}))}calculateMedia(e){for(const t of e)this.setState({windowWidth:t.target.clientWidth})}};Ts.displayName="DateRangePicker",Ts.propTypes={allowReverse:s.bool,calendarSettings:s.any,className:s.string,defaultShow:s.bool,defaultValue:s.shape({start:M(s.instanceOf(Date).isRequired),end:M(s.instanceOf(Date).isRequired)}),disabled:s.bool,endDateInputSettings:s.shape(kt.propTypes),focusedDate:s.instanceOf(Date),format:s.oneOfType([s.string,s.shape({skeleton:s.string,pattern:s.string,date:s.oneOf(["short","medium","long","full"]),time:s.oneOf(["short","medium","long","full"]),datetime:s.oneOf(["short","medium","long","full"]),era:s.oneOf(["narrow","short","long"]),year:s.oneOf(["numeric","2-digit"]),month:s.oneOf(["numeric","2-digit","narrow","short","long"]),day:s.oneOf(["numeric","2-digit"]),weekday:s.oneOf(["narrow","short","long"]),hour:s.oneOf(["numeric","2-digit"]),hour12:s.bool,minute:s.oneOf(["numeric","2-digit"]),second:s.oneOf(["numeric","2-digit"]),timeZoneName:s.oneOf(["short","long"])})]),id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,max:s.instanceOf(Date),min:s.instanceOf(Date),onBlur:s.func,onChange:s.func,onFocus:s.func,popupSettings:s.any,show:s.bool,startDateInputSettings:s.any,style:s.any,swapButton:s.any,tabIndex:s.number,dir:s.string,value:s.shape({start:M(s.instanceOf(Date).isRequired),end:M(s.instanceOf(Date).isRequired)}),autoFocus:s.bool},Ts.defaultProps={allowReverse:!1,defaultShow:!1,defaultValue:I,disabled:!1,format:"d",max:V,min:E,swapButton:!1,autoFocus:!1};let Es=Ts;const Vs=i.createPropsContext(),Ns=i.withIdHOC(i.withPropsContext(Vs,Es));Ns.displayName="KendoReactDateRangePicker",n.registerForLocalization(Es);const Ps=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,s=t&&t.uDateTimePicker,a=this.localizationService.toLanguageString(fe,ye[fe]),n=this.localizationService.toLanguageString(we,ye[we]);return u.createElement("div",{className:i.classNames(i.uDateTimePicker.timeFooter({c:s}))},e&&u.createElement(o.Button,{type:"button",ref:e=>{this._cancelButton=e},className:i.classNames(i.uTime.cancel({c:s})),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:i.classNames(i.uTime.accept({c:s})),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||T});const t=this.mergeDate(this.props.value,this.props.value||T);if(this.props.onReject){const s={nativeEvent:e.nativeEvent,syntheticEvent:e,target:this,value:t};this.props.onReject.call(void 0,s)}},this.handleAccept=(e,t)=>{if(!this.state.dateValue||!this.state.timeValue||!this.hasDateValue)return;const s=this.mergeDate(this.state.dateValue,t||this.state.timeValue);this.props.onChange.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:s,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:s}=e;if(!this.props.disabled)switch(t){case i.Keys.enter:return void(!this.hasActiveButton()&&this.hasDateValue&&this.handleAccept(e));case i.Keys.left:if(!s)return;return void this.move("left");case i.Keys.right:if(!s)return;return void this.move("right");default:return}},this.handleCancelKeyDown=e=>{const{keyCode:t}=e;t===i.Keys.tab&&this._dateButtonRef&&this._dateButtonRef.element&&!this.hasDateValue&&(e.preventDefault(),this._dateButtonRef.element.focus())},this.handleSetKeyDown=e=>{const{keyCode:t}=e;t===i.Keys.tab&&this._dateButtonRef&&this._dateButtonRef.element&&(e.preventDefault(),this._dateButtonRef.element.focus())},this.handleDateKeyDown=e=>{var t,s,a,n;const{keyCode:o,shiftKey:r}=e;r&&o===i.Keys.tab&&(e.stopPropagation(),this.hasDateValue?null==(n=null==(a=this._acceptButton)?void 0:a.element)||n.focus():null==(s=null==(t=this._cancelButton)?void 0:t.element)||s.focus()),o===i.Keys.enter&&(e.stopPropagation(),this.move("left"))},this.handleTimeKeyDown=e=>{const{keyCode:t}=e;t===i.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||T}}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 s,i;this.shouldFocusPart&&this.focus({preventScroll:!0}),((null==(s=e.value)?void 0:s.getTime())!==(null==(i=this.props.value)?void 0:i.getTime())||this.state.tab!==t.tab&&this.props.value)&&this.setState((t=>({dateValue:e.value&&this.props.value&&a.isEqualDate(e.value,this.props.value)?t.dateValue:this.props.value,timeValue:this.props.value||T}))),this.shouldFocusPart=!1}render(){const{disabled:e,min:t,max:s,weekNumber:a,focusedDate:n,format:r,mobileMode:l,footerActions:h,unstyled:c}=this.props,d=c&&c.uDateTimePicker,p=i.classNames(i.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:s,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:i.classNames(i.uDateTimePicker.buttonGroup({c:d}))},u.createElement(o.ButtonGroup,{width:"100%",unstyled:c},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:i.classNames(i.uDateTimePicker.selector({c:d}))},u.createElement("div",{className:i.classNames(i.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:i.classNames(i.uDateTimePicker.timeWrap({c:d}))},u.createElement("div",{className:i.classNames(i.uDateTimePicker.timeSelector({c:d,mobileMode:l}))},u.createElement(us,{key:1,onNowClick:this.handleNowClick,disabled:e||"time"!==this.state.tab,ref:e=>{this._timePart=e},min:this.minTime||N,max:this.maxTime||P,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=i.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}};Ps.defaultProps={footerActions:!0};let Fs=Ps;n.registerForLocalization(Fs);const Rs=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:s,format:i,calendar:a,cancelButton:n,weekNumber:o,focusedDate:r,unstyled:l}=this.props;return u.createElement(Fs,{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:s,focusedDate:r,format:i,calendar:a,mobileMode:this.mobileMode,footerActions:!this.mobileMode,unstyled:l})},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t=n.provideLocalizationService(this).toLanguageString(fe,ye[fe]),s=n.provideLocalizationService(this).toLanguageString(we,ye[we]),i={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:s,onApply:e=>{var t;return null==(t=this._dateTimeSelector)?void 0:t.handleAccept(e)}}};return u.createElement(Et,{...i},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:s}=e;if(s===i.Keys.esc)return this.shouldFocusDateInput=!0,void this.setShow(!1);t&&(s===i.Keys.up||s===i.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=s===i.Keys.up,this.setShow(s===i.Keys.down))},this.dateInputElement=()=>this.dateInput&&this.dateInput.element||this.element&&this.element.querySelector(".k-dateinput > input.k-input-inner"),i.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(i.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||N,this.props.maxTime||P),t=void 0!==this.props.validationMessage,s=(!this.required||null!==this.value)&&e,i=void 0!==this.props.valid?this.props.valid:s;return{customError:t,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:i,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}get dateInputComp(){return this.props.dateInput||e.defaultProps.dateInput}componentDidMount(){var e;this.observerResize=i.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:s=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:D,width:b,name:y,validationMessage:S,required:C,validityStyles:k,minTime:x,maxTime:I,ariaLabelledBy:M,ariaDescribedBy:O,popup:T=h.Popup,unstyled:E}=this.props,V=E&&E.uDateTimePicker,N=!this.validityStyles||this.validity.valid,P={id:m,ariaLabelledBy:M,ariaDescribedBy:O,format:g,formatPlaceholder:v,disabled:c,title:p,validityStyles:k,validationMessage:S,required:C,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,unstyled:E},F=u.createElement(i.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:i.classNames(i.uDateTimePicker.wrapper({c:V,size:t,fillMode:a,rounded:s,disabled:c,required:this.required,invalid:!N}),D),onKeyDown:this.handleKeyDown,style:{width:b},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,ariaHasPopup:"dialog",readonly:this.mobileMode,autoFocus:l,...P}),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:i.classNames(i.uDateTimePicker.inputButton({c:V})),rounded:null,fillMode:a,"aria-label":n.provideLocalizationService(this).toLanguageString(le,ye[le])}),u.createElement(T,{show:this.show,animate:null!==this.element,anchor:this.element,popupClass:i.classNames(i.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(Tt,{dateInput:this._dateInput,label:this.props.label,editorId:m,editorValid:N,editorDisabled:this.props.disabled,children:F,style:{width:this.props.width}}):F}setShow(e){const{onOpen:t,onClose:s}=this.props;this.show!==e&&(this.setState({show:e}),e&&t&&t.call(void 0,{target:this}),!e&&s&&s.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})}};Rs.displayName="DateTimePicker",Rs.propTypes={className:s.string,defaultShow:s.bool,defaultValue:s.instanceOf(Date),disabled:s.bool,focusedDate:s.instanceOf(Date),format:s.oneOfType([s.string,s.shape({skeleton:s.string,pattern:s.string,date:s.oneOf(["short","medium","long","full"]),time:s.oneOf(["short","medium","long","full"]),datetime:s.oneOf(["short","medium","long","full"]),era:s.oneOf(["narrow","short","long"]),year:s.oneOf(["numeric","2-digit"]),month:s.oneOf(["numeric","2-digit","narrow","short","long"]),day:s.oneOf(["numeric","2-digit"]),weekday:s.oneOf(["narrow","short","long"]),hour:s.oneOf(["numeric","2-digit"]),hour12:s.bool,minute:s.oneOf(["numeric","2-digit"]),second:s.oneOf(["numeric","2-digit"]),timeZoneName:s.oneOf(["short","long"])})]),formatPlaceholder:s.oneOfType([s.oneOf(["wide","narrow","short","formatPattern"]),s.shape({year:s.string,month:s.string,day:s.string,hour:s.string,minute:s.string,second:s.string})]),id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,min:s.instanceOf(Date),max:s.instanceOf(Date),name:s.string,popupSettings:s.shape({animate:s.bool,appendTo:s.any,popupClass:s.string}),show:s.bool,tabIndex:s.number,title:s.string,value:s.instanceOf(Date),weekNumber:s.bool,width:s.oneOfType([s.number,s.string]),validationMessage:s.string,required:s.bool,validate:s.bool,valid:s.bool,cancelButton:s.bool,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"solid","flat","outline"]),autoFocus:s.bool},Rs.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"g",max:V,min:E,popupSettings:{},tabIndex:0,weekNumber:!1,validityStyles:!0,cancelButton:!0,dateInput:It,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1};let Ls=Rs;const Bs=i.createPropsContext(),_s=i.withIdHOC(i.withPropsContext(Bs,i.withUnstyledHOC(Ls)));_s.displayName="KendoReactDateTimePicker",n.registerForLocalization(Ls),e.Action=Te,e.BusViewService=We,e.Calendar=Qe,e.CalendarCell=C,e.CalendarHeaderTitle=j,e.CalendarNavigationItem=Ie,e.CalendarPropsContext=Je,e.CalendarViewEnum=x,e.CalendarWeekCell=k,e.CalendarWithoutContext=Xe,e.CenturyViewService=Ne,e.DOMService=Ke,e.DateInput=It,e.DateInputPropsContext=xt,e.DateInputWithoutContext=kt,e.DatePicker=Rt,e.DatePickerPropsContext=Ft,e.DatePickerWithoutContext=Pt,e.DateRangePicker=Ns,e.DateRangePickerPropsContext=Vs,e.DateRangePickerWithoutContext=Es,e.DateTimePicker=_s,e.DateTimePickerPropsContext=Bs,e.DateTimePickerWithoutContext=Ls,e.DayPeriodService=At,e.DecadeViewService=Re,e.EMPTY_SELECTIONRANGE=I,e.Header=G,e.HorizontalViewList=bs,e.HoursService=$t,e.MAX_DATE=V,e.MAX_TIME=P,e.MIN_DATE=E,e.MIN_TIME=N,e.MinutesService=Qt,e.MonthViewService=_e,e.MultiViewCalendar=Os,e.MultiViewCalendarPropsContext=Ms,e.MultiViewCalendarWithoutContext=Is,e.NavigationService=Ye,e.PickerWrap=Ot,e.ScrollSyncService=$e,e.SecondsService=ns,e.TimeList=hs,e.TimePart=us,e.TimePicker=ws,e.TimePickerPropsContext=fs,e.TimePickerWithoutContext=vs,e.TimeSelector=ms,e.TodayCommand=Ce,e.ToggleButton=Mt,e.ViewList=xe,e.Virtualization=S,e.WeekNamesService=K,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=se,e.toggleCalendar=ie,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,s,i,a,n,o,r,l,h,c){"use strict";function d(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:function(){return e[s]}})}})),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,s,i,a=0,n=0,o="vertical"){this.rowHeightService=e,this.firstLoaded=t,this.lastLoaded=t+s,this.take=s,this.total=i,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:s,offsetWidth:i}){const a="vertical"===this.direction?t:e,n="vertical"===this.direction?s:i;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},D={1:e=>t=>Math.min(t,e),0:e=>t=>Math.max(t,e)},b={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 s=this.scrollContainer[t];this.restrictScroll&&"scrollTop"===t&&(!Number.isInteger(s)||!Number.isInteger(e))&&Math.abs(s-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),s=this.getContainerScrollDirection(t),{start:i,end:a}=this.scrollRange(t,s);if(i===a)return;const n=this.scrollStep(i,a),o=w[s](n),r=D[s](a),l=b[s](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(i)}))},this.scrollToBottom=()=>{this.rowHeightService&&this.scrollTo(this.rowHeightService.totalHeight()+this.props.bottomOffset)},this.scrollStep=(t,s)=>{const i=this.props.scrollDuration||e.defaultProps.scrollDuration;return Math.abs(s-t)/(i/17)},this.scrollRange=(e,t)=>{const s=this.containerScrollPosition;if(parseInt(`${e}`,10)===parseInt(`${s}`,10))return{start:e,end:e};const i=this.containerMaxScroll(),a=0===t?1:-1,n=((e,t,s)=>Math.min(Math.abs(t-e),s))(s,e,this.props.maxScrollDifference||0),o=Math.min(e,i);return{start:Math.min(Math.max(o+a*n,0),i),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 i.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 s=this.rowHeightService.index(this.containerScrollPosition-this.props.topOffset),{onScrollAction:i}=this.props,a={index:s,target:t,scrollAction:this.scrollAction,pageAction:this.pageAction,animationInProgress:this.animationInProgress};this.props.onScroll&&this.props.onScroll.call(void 0,e),i&&i.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,s=t+this.containerOffsetSize,i=this.rowHeightService.offset(e),a=i+this.rowHeightService.height(e);return i>=t&&a<=s}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:s,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)+s}`,d="vertical"===this.direction?{height:`${c}px`}:{width:`${c}px`},p=i.classNames(i.uCalendar.scrollableSelector({c:h}),i.uCalendar.scrollable({c:h,horizontal:"horizontal"===this.direction}),a),m=i.classNames(i.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:s.number.isRequired,className:s.string,direction:s.oneOf(["horizontal","vertical"]),forceScroll:s.bool,itemHeight:s.number,itemWidth:s.number,maxScrollDifference:s.number,onScroll:s.func,onScrollAction:s.func,scrollDuration:s.number,scrollOffsetSize:s.number,skip:s.number.isRequired,tabIndex:s.number,take:s.number.isRequired,topOffset:s.number.isRequired,total:s.number.isRequired,role:s.string},y.defaultProps={direction:"vertical",forceScroll:!1,scrollOffsetSize:0,maxScrollDifference:100,scrollDuration:100};let S=y;let C=class extends u.Component{constructor(){super(...arguments),this.handleClick=e=>{const{onClick:t,value:s}=this.props;t&&t.call(void 0,s,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,...s}=this.props,{value:i,...a}=e;return!((!t||!i||t.getTime()===i.getTime())&&((e,t)=>{const s=Object.getOwnPropertyNames(e),i=Object.getOwnPropertyNames(t);if(s.length!==i.length)return!1;for(let i=0;i<s.length;i++){const a=s[i];if(e[a]!==t[a])return!1}return!0})(s,a))}render(){const{className:e,formattedValue:t,isWeekend:s,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:D,unstyled:b,...y}=this.props,S="end"===this.props.activeRangeEnd&&h,C="start"===this.props.activeRangeEnd&&r,k=b&&b.uCalendar,x=i.classNames(i.uCalendar.td({c:k,rangeStart:!f&&!D&&r,rangeEnd:!f&&!D&&h,rangeMid:!f&&l,rangeSplitEnd:!f&&d,rangeSplitStart:!f&&c,active:C||S,focused:a,selected:!f&&(o||r||h),today:!f&&p,weekend:s,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:i.classNames(i.uCalendar.link({c:k}))},this.props.children))}};const k=e=>{const{className:t,firstDate:s,weekDays:a,...n}=e,o=i.useUnstyled(),r=o&&o.uCalendar;return u.createElement("td",{className:i.classNames(i.uCalendar.td({c:r,isWeek:!0}),t),...n,onClick:t=>{const{onClick:i}=e;i&&t&&i.call(void 0,s,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,s,i,...a)=>null===s[i]?null:(t?e.isRequired:e)(s,i,...a),s=t.bind(null,!1);return s.isRequired=t.bind(null,!0),s}const O=(e,t,s)=>void 0===t||void 0===s||t<=e&&e<=s?e:e<t?t:s,T=new Date(1980,0,1),E=new Date(1900,0,1),V=new Date(2099,11,31),N=new Date(1980,0,1),P=new Date(1980,0,1,23,59,59),F=(e,t)=>{const s=a.cloneDate(e);return s.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),s},R=()=>a.getDate(new Date),L=(e,t,s)=>!e||!(t&&t>e||s&&s<e),B=(e,t,s)=>null===e||!(t&&a.getDate(t)>a.getDate(e)||s&&a.getDate(s)<a.getDate(e)),_=(e,t)=>{const{start:s,end:i}=t||I;return!(!s||!i)&&(s<e&&e<i)},H=(e,t,s=1)=>{const i=[];for(let a=e;a<t;a+=s)i.push(a);return i},A=(e,t,s)=>t.getTime()<=e.getTime()&&e.getTime()<=s.getTime(),z=(e,t,s)=>e&&(t&&e<t?a.cloneDate(t):s&&e>s?a.cloneDate(s):e),q=e=>(t,s="",i={})=>{const a=document.createElement(e);return a.className=s,Object.keys(i).map((e=>a.style[e]=i[e])),"string"==typeof t?a.innerHTML=t||"":(t||[]).forEach((e=>e&&a.appendChild(e))),a};function W(e,t,s={}){let i,a,n,o,r;s.maxWait;const l=window,h=!1,c=!1,d=!t&&0!==t&&"function"==typeof l.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function u(t){const s=i,o=a;return i=a=void 0,n=e.apply(o,s),n}function p(e,t){return d?(l.cancelAnimationFrame(o),l.requestAnimationFrame(e)):setTimeout(e,t)}function m(e){const s=e-r;return void 0===r||s>=t||s<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,i?u():(i=a=void 0,n)}function f(...e){const s=Date.now(),l=m(s);return i=e,a=this,r=s,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),i=r=a=o=void 0},f.flush=function(){return void 0===o?n:v()},f.pending=function(){return void 0!==o},f}let K=class{constructor(e){this.intl=e}getWeekNames(e=!1,t){const s=((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(s):s}};const U=(e,t)=>{const s=t;return u.createElement("td",{key:e,role:"gridcell",className:i.classNames(i.uCalendar.td({c:s,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 s=this.firstDate(e),i=this.getWeekNumber(s),a=`kendo-react-calendar-week-cell-${i}`,n={value:i,firstDate:s,weekDays:e,unstyled:this.props.unstyled,onClick:this.handleWeekCellClick};return this.props.weekCell?u.createElement(this.props.weekCell,{...n,key:a},i):u.createElement(k,{...n,key:a},i)},this.buildRow=e=>e.map(((e,t)=>{if(!e)return U(t);const s={"aria-selected":e.isSelected},i=`kendo-react-calendar-cell-${e.value.getTime()}`,a={...s,...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:i},e.formattedValue):u.createElement(C,{...a,key:i},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,s=e[t];for(;!s&&t<e.length;)s=e[++t];return s},this.handleClick=(e,t)=>{const{onChange:s}=this.props;if(s&&t){const i={value:a.cloneDate(e),target:this,nativeEvent:t&&t.nativeEvent,syntheticEvent:t};s.call(void 0,i)}},this.handleWeekCellClick=(e,t,s)=>{const{onWeekSelect:i}=this.props,a=t.findIndex((t=>t&&t.value===e));i&&s&&i.call(void 0,e,a,s)},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:s,focusedDate:a,bus:o,activeView:r,selectionRange:l,unstyled:h}=this.props,c=h&&h.uCalendar;this.intl=n.provideIntlService(this),this.weekService=new K(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:s,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:i.classNames(i.uCalendar.thead({c:c}))},u.createElement("tr",{role:"row",className:i.classNames(i.uCalendar.tr({c:c}))},d.map(((e,t)=>u.createElement("th",{key:t,className:i.classNames(i.uCalendar.th({c:c}))},e))))),u.createElement("tbody",{role:"rowgroup",className:i.classNames(i.uCalendar.tbody({c:c}))},!this.isHorizontal&&u.createElement("tr",{role:"presentation",className:i.classNames(i.uCalendar.tr({c:c}))},u.createElement("th",{scope:"col",colSpan:p,className:i.classNames(i.uCalendar.caption({c:c}))},m)),f.map(((e,t)=>u.createElement("tr",{role:"row",className:i.classNames(i.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:s.oneOf(["start","end",null]),activeView:s.number.isRequired,cellUID:s.string.isRequired,direction:s.oneOf(["horizontal","vertical"]),focusedDate:s.instanceOf(Date).isRequired,max:s.instanceOf(Date).isRequired,min:s.instanceOf(Date).isRequired,onChange:s.func,selectedDate:s.oneOfType([s.instanceOf(Date),s.arrayOf(s.instanceOf(Date))]),showWeekNumbers:s.bool,showOtherMonthDays:s.bool,viewDate:s.instanceOf(Date).isRequired},Y.defaultProps={direction:"vertical",selectedDate:R(),showWeekNumbers:!1};let $=Y;n.registerForIntl($);const j=e=>{const{view:t,...s}=e;return u.createElement(o.Button,{type:"button",fillMode:"flat",themeColor:"primary",...s},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),s=this.props.service.addToDate(this.props.currentDate,e);return e<1||!this.props.service.isInRange(s,this.min,this.max)?t:`${t} - ${this.props.service.title(s)}`},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:s}=this.props,a=s&&s.uCalendar,n=this.getTitle(),o={children:n,value:n,view:e,className:i.classNames(i.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:i.classNames(i.uCalendar.spacer({c:a}))}),u.createElement("span",{className:i.classNames(i.uCalendar.nav({c:a}))},this.props.commands));return u.createElement("div",{className:i.classNames(i.uCalendar.header({c:a,vertical:this.props.verticalView}))},h)}};Z.propTypes={activeView:s.number.isRequired,currentDate:s.instanceOf(Date).isRequired,max:s.instanceOf(Date).isRequired,min:s.instanceOf(Date).isRequired,rangeLength:s.number},Z.defaultProps={rangeLength:1,min:E,max:V};let G=Z;n.registerForLocalization(G);const X="multiviewcalendar.prevView",J="multiviewcalendar.nextView",Q="dateinput.increment",ee="dateinput.decrement",te="dateinput.clear",se="calendar.today",ie="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",De="daterangepicker.cancel",be="daterangepicker.set",ye={[se]:"Today",[he]:"NOW",[ue]:"Set",[de]:"Cancel",[ge]:"Date",[ve]:"Time",[fe]:"Cancel",[we]:"Set",[De]:"Cancel",[be]:"Set",[ne]:"Start",[oe]:"End",[re]:" ",[ce]:"Select Now",[pe]:"Toggle TimeSelector",[me]:"Toggle Clock",[Q]:"Increase value",[ee]:"Decrease value",[te]:"clear",[ie]:"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:s}=this.props,a=s&&s.uCalendar;this.localization=n.provideLocalizationService(this);const r=this.localization.toLanguageString(se,ye[se]),l=i.classNames(i.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:s.instanceOf(Date).isRequired,min:s.instanceOf(Date).isRequired,onClick:s.func,disabled:s.bool},Se.defaultProps={min:E,max:V};let Ce=Se;n.registerForLocalization(Ce);const ke=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:s}=this.props,a=s&&s.uCalendar;return u.createElement("table",{key:"calendar-view-list-weekdays",className:i.classNames(i.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:i.classNames(i.uCalendar.thead({c:a}))},u.createElement("tr",{className:i.classNames(i.uCalendar.tr({c:a}))},t.map(((e,t)=>u.createElement("th",{key:t,className:i.classNames(i.uCalendar.th({c:a}))},e))))))},this.buildDates=(e,t)=>{const s=this.props.cellUID,{unstyled:a}=this.props,n=a&&a.uCalendar;return u.createElement("table",{className:i.classNames(i.uCalendar.table({c:n})),ref:e=>this.table=e,role:"grid",tabIndex:this.props.tabIndex,"aria-activedescendant":s+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:s,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:s})=>{const i=s?s.skip:this.state.skip;if((this.state.index!==e||this.state.skip!==i)&&this.setState({index:e,skip:i}),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:s}=this.props;if(s){const i={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:a.cloneDate(e.value),target:this,isTodayClick:t};s.call(void 0,i)}},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 K(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:s,service:n,unstyled:o}=this.props,r=o&&o.uCalendar;this.calculateHeights();const l=this.lastView!==e,h=z(this.props.focusedDate,t,s),c=l?n.skip(h,t):this.state.skip,d=n.total(t,s),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=i.classNames(i.uCalendar.view({c:r,month:e===x.month,year:e===x.year,decade:e===x.decade,century:e===x.century})),D=this.buildDates(v,n.datesList(m,p)),b=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(Ce,{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:e=>!this.virtualization&&this.handleVirtualizationMount(e),children:D,tabIndex:this.props.tabIndex,unstyled:o}));return u.createElement("div",{ref:e=>{this._element=e},className:w},this.props.dom.didCalculate?b:null)}};ke.propTypes={activeView:s.number.isRequired,bottomOffset:s.number,cellUID:s.string.isRequired,focusedDate:s.instanceOf(Date).isRequired,max:s.instanceOf(Date).isRequired,min:s.instanceOf(Date).isRequired,onChange:s.func,showWeekNumbers:s.bool,smoothScroll:s.bool,take:s.number,value:s.instanceOf(Date),viewHeight:s.number,viewOffset:s.number,weekDaysFormat:s.oneOf(["short","abbreviated","narrow"]),tabIndex:s.number},ke.defaultProps={take:5,showWeekNumbers:!1,weekDaysFormat:"short",smoothScroll:!0};let xe=ke;n.registerForIntl(xe);const Ie=e=>{const{isRangeStart:t,value:s,text:a,view:n,...o}=e,r=i.useUnstyled(),l=r&&r.uCalendar;return u.createElement("li",{...o,onClick:t=>{const{onClick:i}=e;i&&i.call(void 0,s,t)},className:i.classNames(i.uCalendar.li({c:l}))},u.createElement("span",{className:i.classNames(i.uCalendar.navigationMarker({c:l,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),s=this.props.service.isRangeStart(e),i=`kendo-react-calendar-nav-item-${e.getTime()}`,a={text:t,value:e,isRangeStart:s,view:this.props.activeView,onClick:this.handleDateChange};return this.props.navigationItem?u.createElement(this.props.navigationItem,{...a,key:i},t):u.createElement(Ie,{...a,key:i},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:s}=this.props;if(s&&t){const i={value:a.cloneDate(e),target:this,nativeEvent:t&&t.nativeEvent,syntheticEvent:t};s.call(void 0,i)}},this.handleScrollAction=({scrollAction:e,pageAction:t})=>{const s=t?t.skip:this.state.skip;if(this.state.skip!==s&&this.setState({skip:s}),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),s=this.props.service.total(this.props.min,this.props.max);this.state={skip:t-this.getTake(t,s)>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:s,service:n,unstyled:o}=this.props;this.calculateHeights();const r=o&&o.uCalendar,l=this.lastView!==e,h=z(this.props.focusedDate,t,s),c=l?n.skip(h,t):this.state.skip,d=n.total(t,s),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:e=>!this.virtualization&&this.handleVirtualizationMount(e),tabIndex:this.props.tabIndex,unstyled:o},u.createElement("ul",{ref:e=>{this.list=e},className:i.classNames(i.uCalendar.ul({c:r}))},g.map((e=>this.buildNavigationItem(e)))));return u.createElement("div",{className:i.classNames(i.uCalendar.navigation({c:r}))},u.createElement("span",{className:i.classNames(i.uCalendar.navigationHighlight({c:r}))}),this.props.dom.didCalculate?v:null)}getTake(e,t){return Math.min(t-e,this.take)}};Me.propTypes={activeView:s.number.isRequired,focusedDate:s.instanceOf(Date).isRequired,max:s.instanceOf(Date).isRequired,min:s.instanceOf(Date).isRequired,onChange:s.func,take:s.number,tabIndex:s.number},Me.defaultProps={take:30};let Oe=Me;var Te=(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))(Te||{});const Ee=[[]],Ve={[Te.Left]:e=>a.addDecades(e,-1),[Te.Up]:e=>a.addDecades(e,-5),[Te.Right]:e=>a.addDecades(e,1),[Te.Down]:e=>a.addDecades(e,5),[Te.PrevView]:e=>a.addCenturies(e,-1),[Te.NextView]:e=>a.addCenturies(e,1),[Te.FirstInView]:e=>a.firstDecadeOfCentury(e),[Te.LastInView]:e=>a.lastDecadeOfCentury(e)};let Ne=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:s,isActiveView:i,max:n,min:o,selectedDate:r,selectionRange:l=I,viewDate:h}=e;if(!h)return Ee;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=i&&(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,s),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,s,i){let a=!1;return t.forEach((t=>{L(e,s,i)&&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 s=e.getFullYear();return t[0].getFullYear()<=s&&s<=t[t.length-1].getFullYear()+99}isInRange(e,t,s){const i=a.firstYearOfDecade(e).getFullYear(),n=!t||a.firstYearOfDecade(t).getFullYear()<=i,o=!s||i<=a.firstYearOfDecade(s).getFullYear();return n&&o}isInSameView(e,t){return 0===a.durationInCenturies(e,t)}isRangeStart(e){return e.getFullYear()%1e3==0}move(e,t){const s=Ve[t];return s?s(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,s=1){return a.durationInCenturies(e,t)<s?a.addCenturies(e,-1):e}normalize(e,t,s){return e<t&&this.isEqual(e,t)?a.cloneDate(t):e>s&&this.isEqual(e,s)?a.cloneDate(s):e}};const Pe=[[]],Fe={[Te.Left]:e=>a.addYears(e,-1),[Te.Up]:e=>a.addYears(e,-5),[Te.Right]:e=>a.addYears(e,1),[Te.Down]:e=>a.addYears(e,5),[Te.PrevView]:e=>a.addDecades(e,-1),[Te.NextView]:e=>a.addDecades(e,1),[Te.FirstInView]:e=>a.firstYearOfDecade(e),[Te.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:s,isActiveView:i,max:n,min:o,selectedDate:r,selectionRange:l=I,viewDate:h}=e;if(!h)return Pe;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=i&&(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,s),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,s,i){let a=!1;return t.forEach((t=>{L(e,s,i)&&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 s=e.getFullYear();return t[0].getFullYear()<=s&&s<=t[t.length-1].getFullYear()+9}isInRange(e,t,s){const i=e.getFullYear(),a=!t||t.getFullYear()<=i,n=!s||i<=s.getFullYear();return a&&n}isRangeStart(e){return e.getFullYear()%100==0}isInSameView(e,t){return 0===a.durationInDecades(e,t)}move(e,t){const s=Fe[t];return s?s(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,s=1){return a.durationInDecades(e,t)<s?a.addDecades(e,-1):e}normalize(e,t,s){return e<t&&this.isEqual(e,t)?a.cloneDate(t):e>s&&this.isEqual(e,s)?a.cloneDate(s):e}};const Le=[[]],Be={[Te.Left]:e=>a.addDays(e,-1),[Te.Up]:e=>a.addWeeks(e,-1),[Te.Right]:e=>a.addDays(e,1),[Te.Down]:e=>a.addWeeks(e,1),[Te.PrevView]:e=>a.addMonths(e,-1),[Te.NextView]:e=>a.addMonths(e,1),[Te.FirstInView]:e=>a.firstDayOfMonth(e),[Te.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:s,isActiveView:i,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=i&&(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,s),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,s,i){let a=!1;return t.forEach((t=>{L(e,s,i)&&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,s){const i=a.getDate(e),n=!t||a.getDate(t)<=i,o=!s||i<=a.getDate(s);return n&&o}isInSameView(e,t){return 0===a.durationInMonths(e,t)}isRangeStart(e){return!e.getMonth()}move(e,t){const s=Be[t];return s?s(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,s=1){return a.durationInMonths(e,t)<s?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,s){return e<t&&this.isEqual(e,t)?a.getDate(t):e>s&&this.isEqual(e,s)?a.getDate(s):e}wideMonthNames(){return this.intl.dateFormatNames({nameType:"wide",type:"months",standAlone:!0})}}const He=[[]],Ae={[Te.Left]:e=>a.addMonths(e,-1),[Te.Up]:e=>a.addMonths(e,(e=>e>4?-5:e<2?-2:-7)(e.getMonth())),[Te.Right]:e=>a.addMonths(e,1),[Te.Down]:e=>a.addMonths(e,(e=>e<7?5:e<10?7:2)(e.getMonth())),[Te.PrevView]:e=>a.addYears(e,-1),[Te.NextView]:e=>a.addYears(e,1),[Te.FirstInView]:e=>a.firstMonthOfYear(e),[Te.LastInView]:e=>a.lastMonthOfYear(e)};let ze=class{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:s,isActiveView:i,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),D=i&&(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,s),isSelected:D,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,s,i){let a=!1;return t.forEach((t=>{L(e,s,i)&&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 s=e.getFullYear();return t[0].getFullYear()<=s&&s<=t[t.length-1].getFullYear()}isInRange(e,t,s){const i=a.createDate(e.getFullYear(),e.getMonth(),1),n=!t||a.createDate(t.getFullYear(),t.getMonth(),1)<=i,o=!s||i<=a.createDate(s.getFullYear(),s.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 s=Ae[t];return s?s(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,s=1){return a.durationInYears(e,t)<s?a.addYears(e,-1):e}abbrMonthNames(){return this._intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(e,t,s){return e<t&&this.isEqual(e,t)?a.cloneDate(t):e>s&&this.isEqual(e,s)?a.cloneDate(s):e}};const qe={[x.month]:_e,[x.year]:ze,[x.decade]:Re,[x.century]:Ne};let We=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,s){const i=this.clamp(((e,t)=>{const s=x[x[e+t]];return void 0!==s?s:e})(e,t));i!==e&&this.onViewChanged({view:i},s)}};class Ke{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,t){if(!i.canUseDOM)return;const s=q("div"),a=q("ul"),n=q("li"),o=q("td"),r=q("th"),l=q("tr"),h=q("tbody"),c=q("thead"),d=q("table"),u=t&&t.uCalendar,p=t&&t.uButton,m=i.strippedClassNames(i.uButton.wrapper({c:p,fillMode:"flat",size:"medium",rounded:"medium",themeColor:"primary"}),i.uCalendar.title({c:u})),g=()=>s(`\n <span class="${m}">\n <span class="${i.strippedClassNames(i.uButton.text({c:p}))}">March 2017</span>\n </span>\n <span class="${i.strippedClassNames(i.uCalendar.spacer({c:u}))}"></span>\n <span class="${i.strippedClassNames(i.uCalendar.nav({c:u}))}"><button class="${i.strippedClassNames(i.uCalendar.today({c:u}))}">TODAY</button></span>\n `,i.strippedClassNames(i.uCalendar.header({c:u,vertical:!0}))),v=(e,t)=>new Array(e).fill("1").map(t),f=e=>s(e,i.strippedClassNames(i.uCalendar.scrollableSelector({c:u}),i.uCalendar.scrollable({c:u,horizontal:!0}))),w=(()=>{let e;return()=>i.canUseDOM?(e||(e=s([f([a([n("<span>FEB</span>")])])],i.strippedClassNames(i.uCalendar.navigation({c:u})),{left:"0px",position:"absolute"})),e):null})(),D=({cells:e,rows:t},a,n)=>{let p;return()=>i.canUseDOM?(p||(p=((e,t,a)=>s(a?[g(),d([c([l([r("MO",i.strippedClassNames(i.uCalendar.th({c:u})))],i.strippedClassNames(i.uCalendar.tr({c:u})))],i.strippedClassNames(i.uCalendar.thead({c:u})))],i.strippedClassNames(i.uCalendar.table({c:u,weekdays:!0}))),f([e,e])]:[g(),f([e,e])],t,{left:"-10000px",position:"absolute"}))(((e,t=1)=>d([h([l([o("1",i.strippedClassNames(i.uCalendar.td({c:u,isWeek:!0})))])].concat(v(e,(()=>l(v(t,(e=>o(`<span class="${i.strippedClassNames(i.uCalendar.link({c:u}))}">${e}</span>`,i.strippedClassNames(i.uCalendar.td({c:u}))))),i.strippedClassNames(i.uCalendar.tr({c:u})))))),i.strippedClassNames(i.uCalendar.tbody({c:u})))],i.strippedClassNames(i.uCalendar.table({c:u}))))(t,e),a,n)),p):null},b=e=>e.querySelector(`.${i.strippedClassNames(i.uCalendar.scrollableSelector({c:u}))}`),y=e=>{const t=b(e);return t.className=`${t.className} scrollable-horizontal`,e},S=D({cells:7,rows:6},i.strippedClassNames(i.uCalendar.view({c:u,month:!0})),!0),C=D({cells:5,rows:3},i.strippedClassNames(i.uCalendar.view({c:u,year:!0})),!1),k=D({cells:5,rows:2},i.strippedClassNames(i.uCalendar.view({c:u,decade:!0})),!1),x=e=>parseFloat(window.getComputedStyle(e).height)||e.offsetHeight,I=e=>{const t=window.getComputedStyle(e);return parseFloat(t.width)+parseFloat(t.paddingLeft)+parseFloat(t.paddingRight)||e.offsetWidth},M=e=>e.querySelector("tbody");this.didCalculate=!0,e&&(this.hostContainer=e),this.batch(S(),(e=>{const t=M(e);this.calendarHeight=x(e),this.monthViewHeight=x(t),this.headerHeight=x(t.children[0]),this.scrollableContentHeight=x(b(e))})),this.batch(y(S()),(e=>{const t=M(e);this.calendarWidth=I(e),this.monthViewWidth=I(t),this.scrollableContentWidth=I(b(e))})),this.batch(C(),(e=>{this.yearViewHeight=x(M(e)),this.scrollableYearContentHeight=x(b(e))})),this.batch(y(C()),(e=>{this.yearViewWidth=I(M(e))})),this.batch(k(),(e=>{this.decadeViewHeight=x(M(e)),this.centuryViewHeight=this.decadeViewHeight})),this.batch(y(k()),(e=>{this.decadeViewWidth=I(M(e)),this.centuryViewWidth=this.decadeViewWidth})),this.batch(w(),(e=>{this.navigationItemHeight=x(e.querySelector("li"))}))}viewHeight(e){return this.viewDimension(e,"height")}viewWidth(e){return this.viewDimension(e,"width")}viewDimension(e,t){const s="height"===t?"ViewHeight":"ViewWidth";switch(e){case x.month:return this[`month${s}`];case x.year:return this[`year${s}`];case x.decade:return this[`decade${s}`];case x.century:return this[`century${s}`];default:return 1}}batch(e,t){const s=this.hostContainer||document.body,i=s.appendChild(e);t(i),s.removeChild(i)}}const Ue={33:Te.PrevView,34:Te.NextView,35:Te.LastInView,36:Te.FirstInView,37:Te.Left,38:Te.Up,39:Te.Right,40:Te.Down,"meta+38":Te.UpperView,"meta+40":Te.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,s,i,a){return i?t===Te.UpperView&&this.bus.canMoveUp(s)?(this.bus.moveUp(s,a),e):t===Te.LowerView&&this.bus.canMoveDown(s)?(this.bus.moveDown(s,a),e):i.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,s){if(e&&t){if(this.navigator=e,this.view=t,s.target===this.navigator.element){if(this.monthScrolled)return void(this.monthScrolled=!1);this.navScrolled=!0,this.scrollSiblingOf(this.navigator.element)}if(s.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),s=this.calculateScroll(t,e.scrollTop);t.scrollTo(s)}siblingComponent(e){return this.navigator.element===e?this.view:this.navigator}calculateScroll(e,t){const s=e===this.navigator?this.divideByMagnitude:this.powerByMagnitude;return s?s(t):0}}const je=e=>e?e.virtualization:null,Ze=(e=Xe.defaultProps.min,t=Xe.defaultProps.max,s,i)=>void 0!==i?null!==i&&L(a.getDate(i),e,t)?i:null:null!==s&&L(a.getDate(s),e,t)?s: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),s=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:s});this.bus.moveToBottom(this.state.activeView)}this.setState({value:t,focusedDate:s}),this.valueDuringOnChange=t;const{onChange:n}=this.props;if(n){const s={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:t,target:this};n.call(void 0,s)}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:s,metaKey:n}=e;if(this.focusedDate&&this.service){if(84===t&&this.setState({focusedDate:R()}),(s||n)&&(t===i.Keys.left||t===i.Keys.right)){if(this.props.disabled)return;this.didNavigationChange=!0,31===this.focusedDate.getDate()&&this.focusedDate.setDate(30);const e=t===i.Keys.left?this.focusedDate.getMonth()-1:this.focusedDate.getMonth()+1,s=new Date(this.focusedDate.setMonth(e)),n=a.cloneDate(s);this.setState({focusedDate:n})}if(t===i.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})},i.validatePackage(p);const s=Ze(this.min,this.max,this.props.defaultValue||e.defaultProps.defaultValue,this.props.value);this.state={value:s,activeView:O(x[t.defaultActiveView],this.bottomView,this.topView),focusedDate:z(t.focusedDate||s||R(),this.min,this.max)},this.dom=new Ke,this.bus=new We(this.handleViewChange),this.navigation=new Ye(this.bus),this.oldValue=s}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(){const{unstyled:e}=this.props;Promise.resolve().then((()=>{i.setScrollbarWidth(),this._element&&(this.dom.calculateHeights(this._element,e),this.scrollSyncService=new $e(this.dom),this.scrollSyncService.configure(this.state.activeView),this.forceUpdate())}))}componentDidUpdate(e,t){i.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:s,bottomView:o,topView:r,disabled:l,weekNumber:h,mobileMode:c,className:d}=this.props;t&&t(this);const p=s&&s.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,D=i.classNames(i.uCalendar.wrapper({c:p,disabled:l,weekNumber:h,mobileMode:c}),d),b=[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:s}),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:s})];return u.createElement("div",{ref:e=>{this._element=e},className:D,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},b)}};Ge.displayName="Calendar",Ge.propTypes={className:s.string,defaultActiveView:s.oneOf(["month","year","decade","century"]),defaultValue:s.instanceOf(Date),disabled:s.bool,focusedDate:s.instanceOf(Date),id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,weekDaysFormat:s.oneOf(["short","abbreviated","narrow"]),max:s.instanceOf(Date),min:s.instanceOf(Date),navigation:s.bool,smoothScroll:s.bool,onBlur:s.func,onChange:s.func,onFocus:s.func,tabIndex:s.number,value:s.instanceOf(Date),weekNumber:s.bool,topView:(e,t,s)=>{const i=e[t],a=e.bottomView;return i&&a&&x[i]<x[a]?new Error(`Invalid prop + ${t} suplied to ${s}.\n ${t} can not be smaller than bottomView.\n `):null},bottomView:(e,t,s)=>{const i=e[t],a=e.topView;return i&&a&&x[i]>x[a]?new Error(`Invalid prop + ${t} suplied to ${s}.\n ${t} can not be bigger than topView.\n `):null}},Ge.defaultProps={disabled:!1,min:E,max:V,weekDaysFormat:"short",navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",bottomView:"month",showOtherMonthDays:!1};let Xe=Ge;const Je=i.createPropsContext(),Qe=i.withIdHOC(i.withPropsContext(Je,i.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 st=class{constructor(e,t,s){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=s,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 s=0;s<t.length;s++)this.setExisting(t[s],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 s=a.cloneDate(this.value);switch(e){case"y":s.setFullYear(s.getFullYear()+t);break;case"M":s=a.addMonths(this.value,t);break;case"d":case"E":s.setDate(s.getDate()+t);break;case"h":case"H":s.setHours(s.getHours()+t);break;case"m":s.setMinutes(s.getMinutes()+t);break;case"s":s.setSeconds(s.getSeconds()+t);break;case"a":s.setHours(s.getHours()+12*t)}this.setExisting(e,!0),this._value=s}parsePart(e,t){if(this.resetLeadingZero(),!t)return this.setExisting(e,!1),{value:null};const s=this.intl.formatDate(this.value,this.format),i=this.dateFormatString(this.value,this.format),n=i.symbols;let o=!1,r="",l="",h="";for(let t=0;t<s.length;t++)n[t]===e?(l+=this.getExisting(e)?s[t]:"0",o=!0):o?h+=s[t]:r+=s[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 s=0;s<2;s++){const s=l+t,i=parseInt(s,10);if(c=this.intl.parseDate(r+s+h,this.format),!c&&!isNaN(i)&&!isNaN(parseInt(t,10))){if("M"===e&&!d){const e=i-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(s,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(i.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 s=this.partPattern(e,t);return"month"===s.type&&s.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 s=this.intl.splitDateFormat(t),i=[],a=[];for(let t=0;t<s.length;t++){let n=this.intl.formatDate(e,{pattern:s[t].pattern}).length;for(;n>0;)i.push(this.symbols[s[t].pattern[0]]||"_"),a.push(s[t]),n--}const n=new et;return n.symbols=i.join(""),n.partMap=a,n}merge(e,t){let s="",i="";const a=t.symbols;for(let n=a.length-1;n>=0;n--)if(-1===this.knownParts.indexOf(a[n])||this.getExisting(a[n]))s=e[n]+s,i=a[n]+i;else{const e=a[n];for(;n>=0&&e===a[n];)n--;for(n++,s=this.leadingZero&&this.leadingZero[e]?"0"+s:this.dateFieldName(t.partMap[n])+s;i.length<s.length;)i=a[n]+i}return{text:s,format:i}}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 it="dayperiod",at="hour",nt="minute",ot="second",rt=e=>(t,s)=>{const i=a.cloneDate(t);return i[e](s),i},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,s)=>e(s))(t.getter):(e=>(t,s)=>e(t))(t.getter))((e=>e.reduce(((e,t)=>(e[t.type]=t.type,e)),{}))(t))))(lt),ct=(e=>(t,s)=>e.map((e=>{const i=Math.floor(t[e.type]);return i?((e,t,s,i)=>a=>{const n=e(a),o=e(s);return"hour"===i?n-(n-o)%t:a.getTime()<=s.getTime()&&0!==n&&n<=o?Math.ceil(n/t)*t:n-n%t})(e.getter,i,s,e.type):e.getter})))(lt),dt=e=>t=>{const s=a.cloneDate(t);return s.setHours(...e.map((e=>e(s)))),s},ut=rt("setHours"),pt=rt("setMinutes"),mt=rt("setSeconds"),gt=()=>new Date,vt=(e,t,s=1)=>{const i=[];for(let a=e;a<t;a+=s)i.push(a);return i},ft=(e,t,s)=>({candidateValue:F(T,e),maxValue:a.addDays(F(T,s),t.getHours()<s.getHours()?0:1),minValue:F(T,t)}),wt=(e,t,s)=>{if(!e||!t||!s)return!0;const{candidateValue:i,minValue:a,maxValue:n}=ft(e,t,s);return a<=i&&i<=n},Dt=(e,t,s)=>{if(null===e)return!0;const{candidateValue:i,minValue:a,maxValue:n}=ft(e,t,s);return a<=i&&i<=n},bt=(e,t)=>{if(null===e||null===t)return!1;const s=F(T,e),i=F(T,t);return s.getTime()<i.getHours()},yt=(e,t)=>{if(null===e||null===t)return!1;const s=F(T,e);return F(T,t).getTime()<s.getHours()},St=e=>{const t=n.useLocalization(),s=i.useUnstyled(),a=s&&s.uDateInput,o=t.toLanguageString(te,ye[te]);return u.createElement("span",{className:i.classNames(i.uDateInput.clearButton({c:a})),role:"button",onClick:t=>{t.stopPropagation();const{onClick:s}=e;s&&s.call(void 0,t)},tabIndex:e.tabindex||-1,title:o,key:"clearbutton"},u.createElement(i.IconWrap,{name:"x",icon:r.xIcon}))},Ct=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,s=this.value;this.kendoDate.setValue(t),this.triggerChange(e,s)},this.spinnersMouseDown=e=>{e.preventDefault();const t=i.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:s}=this.kendoDate.getTextAndFormat();this.currentFormat=s;const i=this.value,a=((e,t,s,i)=>{const a=e[i+e.length-s.length],n=e.substring(0,i+e.length-s.length),o=s.substring(0,i),r=[];if(n===o&&i>0)return r.push([t[i-1],o[i-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 s=o.length;s<n.length;s++)t[s]!==e&&"_"!==t[s]&&(e=t[s],r.push([e,""]));return r}if(0===o.indexOf(n)||"_"===t[i-1]){let e=t[0];for(let s=Math.max(0,n.length-1);s<t.length;s++)if("_"!==t[s]){e=t[s];break}return[[e,o[i-1]]]}return" "===o[o.length-1]||o[o.length-1]===a?[[t[i-1],"_"]]:[[t[i-1],o[i-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,i)},this.elementClick=e=>{this.setSelection(this.selectionByIndex(this.selection.start))},this.nativeWheel=e=>{i.getActiveElement(document)===this.element&&e.preventDefault()},this.wheel=e=>{i.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})},i.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:s=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,D=this.text,b=D===this.props.placeholder?"":D,y=D===this.props.placeholder?D:void 0,S=f||this._inputId,C=!this.validityStyles||this.validity.valid,k=u.createElement(i.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:i.classNames(i.uDateInput.wrapper({c:d,size:t,fillMode:s,rounded:a,disabled:w,required:this.required,invalid:!C}),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:D,type:"text",spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoFocus:h,className:i.classNames(i.uDateInput.inputInner({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,"aria-required":this.props.required,"aria-invalid":!C,onWheel:this.wheel,onClick:this.elementClick,onInput:this.elementChange,onPaste:this.handlePaste,onKeyDown:this.elementKeyDown,onChange:i.noop,value:b,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:i.classNames(i.uDateInput.inputSpinner({c:d})),onMouseDown:this.spinnersMouseDown},u.createElement(o.Button,{tabIndex:-1,type:"button",rounded:null,className:i.classNames(i.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:i.classNames(i.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:D,editorValid:C,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={...It.defaultProps,...this.props},{formatPlaceholder:s=e.defaultProps.formatPlaceholder,format:i=e.defaultProps.format,value:a,defaultValue:n}=t;null===this.kendoDate?(this.kendoDate=new st(this.intl.bind(this),s,i),this.kendoDate.setValue(a||n||null)):(this.kendoDate.format=i,this.kendoDate.formatPlaceholder=s),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,s)=>null===e||!(t&&t>e||s&&s<e))(this.value,this.min,this.max)&&wt(this.value,this.props.minTime,this.props.maxTime),t=void 0!==this.props.validationMessage,s=(!this.required||null!==this.value)&&e,i=void 0!==this.props.valid?this.props.valid:s;return{customError:t,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:i,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}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=i.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,s=0;for(let i=0;i<this.currentFormat.length;i++)this.currentFormat[i]===e&&(s=i+1,-1===t&&(t=i));return t<0&&(t=0),{start:t,end:s}}selectionByIndex(e){let t={start:e,end:e};for(let s=e,i=e-1;s<this.currentFormat.length||i>=0;s++,i--){if(s<this.currentFormat.length&&"_"!==this.currentFormat[s]){t=this.selectionBySymbol(this.currentFormat[s]);break}if(i>=0&&"_"!==this.currentFormat[i]){t=this.selectionBySymbol(this.currentFormat[i]);break}}return t}switchDateSegment(e){const{start:t,end:s}=this.selection;if(t<s&&this.currentFormat[t]!==this.currentFormat[s-1])return void this.setSelection(this.selectionByIndex(e>0?t:s-1));const i=this.currentFormat[t];let a=t+e;for(;a>0&&a<this.currentFormat.length&&(this.currentFormat[a]===i||"_"===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!==s)?this.setSelection({start:n+1,end:a+1}):a<n&&(a!==t||n!==s)&&this.setSelection({start:a,end:n})}modifyDateSegmentValue(e,t){if(!this.kendoDate)return;const s=this.value,i=this.currentFormat[this.selection.start],a=this.kendoDate.symbolMap(i),n=((this.props.steps||{})[a]||1)*e;this.kendoDate.modifyPart(i,n),this.triggerChange(t,s)}};Ct.displayName="DateInput",Ct.propTypes={value:s.instanceOf(Date),format:s.oneOfType([s.string,s.shape({skeleton:s.string,pattern:s.string,date:s.oneOf(["short","medium","long","full"]),time:s.oneOf(["short","medium","long","full"]),datetime:s.oneOf(["short","medium","long","full"]),era:s.oneOf(["narrow","short","long"]),year:s.oneOf(["numeric","2-digit"]),month:s.oneOf(["numeric","2-digit","narrow","short","long"]),day:s.oneOf(["numeric","2-digit"]),weekday:s.oneOf(["narrow","short","long"]),hour:s.oneOf(["numeric","2-digit"]),hour12:s.bool,minute:s.oneOf(["numeric","2-digit"]),second:s.oneOf(["numeric","2-digit"]),timeZoneName:s.oneOf(["short","long"])})]),formatPlaceholder:s.oneOfType([s.oneOf(["wide","narrow","short","formatPattern"]),s.shape({year:s.string,month:s.string,day:s.string,hour:s.string,minute:s.string,second:s.string})]),width:s.oneOfType([s.string,s.number]),tabIndex:s.number,title:s.string,steps:s.shape({year:s.number,month:s.number,day:s.number,hour:s.number,minute:s.number,second:s.number}),min:s.instanceOf(Date),max:s.instanceOf(Date),disabled:s.bool,spinners:s.bool,name:s.string,dir:s.string,label:s.string,id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,ariaLabel:s.string,ariaRole:s.string,ariaHasPopup:s.oneOfType([s.bool,s.string]),ariaExpanded:s.oneOfType([s.bool]),onChange:s.func,validationMessage:s.string,required:s.bool,validate:s.bool,valid:s.bool,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"solid","flat","outline"]),autoFocus:s.bool},Ct.defaultProps={format:"d",size:"medium",rounded:"medium",fillMode:"solid",formatPlaceholder:"wide",spinners:!1,disabled:!1,max:a.cloneDate(V),min:a.cloneDate(E),minTime:a.cloneDate(N),maxTime:a.cloneDate(P),validityStyles:!0,validationMessage:"Please enter a valid value!",placeholder:null,ariaHasPopup:"grid",autoFocus:!1};let kt=Ct;const xt=i.createPropsContext(),It=i.withIdHOC(i.withPropsContext(xt,i.withUnstyledHOC(kt)));It.displayName="KendoReactDateInput",n.registerForIntl(kt),n.registerForLocalization(kt);const Mt=o.Button,Ot=u.forwardRef(((e,t)=>{const{_ref:s}=e,a=u.useRef(null);u.useImperativeHandle(t,(()=>a.current)),u.useImperativeHandle(s,(()=>a.current));const n=u.useMemo((()=>i.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)})),Tt=e=>{const{dateInput:t,...s}=e,i=(e=>{const[t,s]=u.useState(!1);return u.useEffect((()=>{e.current&&s(!!e.current.text)})),{editorValue:t}})(t);return u.createElement(l.FloatingLabel,{...s,...i})},Et=e=>{const{footer:t,children:s,windowWidth:i=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:i<=500?{top:0,width:"100%",height:"100%"}:void 0,className:i<=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)),s,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,Nt=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:s,weekNumber:n,focusedDate:o,popupSettings:r}=this.props,{popupClass:l,...h}=r,c=this.show,d=this.value,p=d&&a.getDate(d),m=i.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,onMouseDownOutside:this.handleMouseDownOutside},v={disabled:e,value:p,min:t,max:s,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(Et,{...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:s}=this.props;s&&s.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.togglePopup=()=>{this.setShow(!this.show)},this.handleMouseDownOutside=e=>{var t;null!=(t=this.props.popupSettings)&&t.onMouseDownOutside&&this.props.popupSettings.onMouseDownOutside.call(void 0,e)},this.handleIconClick=()=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:t,keyCode:s}=e;if(s===i.Keys.esc&&this.show)return this.shouldFocusDateInput=!0,void this.setShow(!1);t&&(s===i.Keys.up||s===i.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=s===i.Keys.up,this.setShow(s===i.Keys.down))},i.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(i.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,s=(!this.required||null!==this.value)&&e,i=void 0!==this.props.valid?this.props.valid:s;return{customError:t,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:i,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}componentDidMount(){var e;this.observerResize=i.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:s=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:D,required:b,validityStyles:y,ariaLabelledBy:S,ariaDescribedBy:C,ariaLabel:k,placeholder:x,label:I,popupSettings:M,defaultValue:O,defaultShow:T,value:E,popup:V,weekNumber:N,dateInput:P,calendar:F,toggleButton:R,onChange:L,onBlur:B,onFocus:_,show:H,onOpen:A,pickerWrap:z,adaptive:q,adaptiveTitle:W,valid:K,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:C,ariaLabel:k,max:g,min:m,name:w,onChange:this.handleInputValueChange,required:b,tabIndex:this.show?-1:l,title:h,valid:this.validity.valid,validationMessage:D,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(ie,ye[ie]),ee=u.createElement(i.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:i.classNames("k-input","k-datepicker",{[`k-input-${i.kendoThemeMaps.sizeMap[t]||t}`]:t,[`k-rounded-${i.kendoThemeMaps.roundedMap[s]||s}`]:s,[`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(Tt,{dateInput:this._dateInput,label:I,editorId:c,editorValid:X,editorDisabled:o,children:ee,style:{width:f},...Z}):ee}setShow(e){const{onOpen:t,onClose:s}=this.props;this.show!==e&&(this.setState({show:e}),e&&t&&t.call(void 0,{target:this}),!e&&s&&s.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(const t of e)this.setState({windowWidth:t.target.clientWidth})}};Nt.displayName="DatePicker",Nt.propTypes={className:s.string,defaultShow:s.bool,defaultValue:s.instanceOf(Date),disabled:s.bool,focusedDate:s.instanceOf(Date),format:s.oneOfType([s.string,s.shape({skeleton:s.string,pattern:s.string,date:s.oneOf(["short","medium","long","full"]),time:s.oneOf(["short","medium","long","full"]),datetime:s.oneOf(["short","medium","long","full"]),era:s.oneOf(["narrow","short","long"]),year:s.oneOf(["numeric","2-digit"]),month:s.oneOf(["numeric","2-digit","narrow","short","long"]),day:s.oneOf(["numeric","2-digit"]),weekday:s.oneOf(["narrow","short","long"]),hour:s.oneOf(["numeric","2-digit"]),hour12:s.bool,minute:s.oneOf(["numeric","2-digit"]),second:s.oneOf(["numeric","2-digit"]),timeZoneName:s.oneOf(["short","long"])})]),formatPlaceholder:s.oneOfType([s.oneOf(["wide","narrow","short","formatPattern"]),s.shape({year:s.string,month:s.string,day:s.string,hour:s.string,minute:s.string,second:s.string})]),id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,ariaLabel:s.string,min:s.instanceOf(Date),max:s.instanceOf(Date),name:s.string,popupSettings:s.shape({animate:s.bool,appendTo:s.any,popupClass:s.string}),show:s.bool,tabIndex:s.number,title:s.string,value:s.instanceOf(Date),weekNumber:s.bool,width:s.oneOfType([s.number,s.string]),validationMessage:s.string,required:s.bool,validate:s.bool,valid:s.bool,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"solid","flat","outline"]),adaptive:s.bool,adaptiveTitle:s.string,autoFocus:s.bool},Nt.defaultProps={defaultShow:!1,defaultValue:null,dateInput:It,calendar:Qe,toggleButton:Mt,popup:h.Popup,pickerWrap:Ot,disabled:!1,format:"d",max:V,min:E,popupSettings:{},tabIndex:0,weekNumber:!1,validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1};let Pt=Nt;const Ft=i.createPropsContext(),Rt=i.withIdHOC(i.withPropsContext(Ft,Pt));Rt.displayName="KendoReactDatePicker",n.registerForLocalization(Pt);const Lt=(e,t)=>{const s=a.cloneDate(e);return s.setHours(t),s},Bt=e=>null!==e&&e<12,_t=(e,t,s)=>!t&&!s||e>=t&&e<=s,Ht=(e,t,s)=>!t&&!s||e>=t||e<=s;let At=class{constructor(e){this.intl=e,this.min=null,this.max=null,this.part=null}apply(e,t){const s=e.getHours(),i=Bt(s),a=Bt(t.getHours());if(i&&a||!i&&!a)return e;const[n,o=24]=this.normalizedRange(),r=s+(a?-12:12);return Lt(e,Math.min(Math.max(n,r),o||24))}configure(e){const{min:t=this.min,max:s=this.max,part:i=this.part}=e;this.min=t,this.max=s,this.part=i}data(e){const t=this.part&&this.part.names;if(!t||!this.min)return[];const s=[],[i,a]=this.normalizedRange(),n=this.intl.dateFormatNames(t);return Bt(i)&&s.push({text:n.am,value:Lt(this.min,i)}),(e=>null!==e&&(!e||e>11))(a)&&s.push({text:n.pm,value:Lt(this.min,Math.max(12,a))}),this.min.getHours()!==i?s.reverse():s}isRangeChanged(e,t){return!1}limitRange(e,t,s){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,t){if(!i.canUseDOM)return;const s=t&&t.uTime,a=q("div"),n=q("span"),o=q("ul"),r=q("li"),l=a([n("minute",i.strippedClassNames(i.uTime.title({c:s}))),a([a([o([r("<span>02</span>",i.strippedClassNames(i.uTime.li({c:s})))],i.strippedClassNames(i.uTime.ul({c:s})))],i.strippedClassNames(i.uTime.containerSelector({c:s}),i.uTime.container({c:s,content:!0,scrollable:!0})))],i.strippedClassNames(i.uTime.list({c:s})))],i.strippedClassNames(i.uTime.listWrapper({c:s})),{left:"-10000px",position:"absolute"}),h=`.${i.strippedClassNames(i.uTime.containerSelector({c:s}))}`,c=e&&e.querySelector(h)||document.body,d=c.appendChild(l);this.timeListHeight=d.querySelector(h).offsetHeight,this.itemHeight=d.querySelector("li").offsetHeight,c.removeChild(d),this.didCalculate=!0}};const qt=(e=>t=>t%e)(24),Wt=(e,t)=>qt(24+e-t),Kt=e=>(t,s)=>s&&a.getDate(t).getTime()!==a.getDate(s).getTime()?ut(t,e):t,Ut=Kt(0),Yt=Kt(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:s=this.insertUndividedMax,min:i=this.min,max:a=this.max,part:n,step:o=this.step}=e;this.boundRange=t,this.insertUndividedMax=s,this.toListItem=e=>{const t=ut(T,e);return{text:this.intl.formatDate(t,n.pattern),value:t}},this.min=i,this.max=a,this.step=o}data(e){const[t]=this.range(e),s=((e,t)=>s=>qt(e+s*t))(t,this.step),i=vt(0,this.countFromMin(e)).map((e=>this.toListItem&&this.toListItem(s(e))));return this.addLast(i),e&&this.addMissing(i,e),i}isRangeChanged(e,t){return!(!this.min||!this.max)&&(!a.isEqual(this.min,e)||!a.isEqual(this.max,t))}limitRange(e,t,s){return this.boundRange?[Ut(e,s),Yt(t,s)]:[e,t]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,s=this.isMissing(e)?1:0;return this.countFromMin(e)+s+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 s=this.toListItem(t.getHours());e.splice(this.selectedIndex(t),0,s)}return e}countFromMin(e){const[t,s]=this.range(e);return Math.floor(Wt(s,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 Wt(e.getHours(),this.min.getHours())/this.step}lastHour(e){return this.range(e)[1]}range(e){const[t,s]=this.limitRange(this.min,this.max,e);return[t.getHours(),s.getHours()]}};const jt=(e=>t=>t%e)(60),Zt=(e,t)=>jt(60+e-t),Gt=e=>(t,s)=>s&&t.getHours()!==s.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:s=this.min,max:i=this.max,part:a,step:n=this.step}=e;this.insertUndividedMax=t,this.toListItem=e=>{const t=pt(T,e);return{text:this.intl.formatDate(t,a.pattern),value:t}},this.min=s,this.max=i,this.step=n}data(e){const[t]=this.range(e),s=((e,t)=>s=>jt(e+s*t))(t,this.step),i=vt(0,this.countFromMin(e)).map((e=>this.toListItem&&this.toListItem(s(e))));return this.addLast(i),e&&this.addMissing(i,e),i}isRangeChanged(e,t){return!(null===this.min||null===this.max||a.isEqual(this.min,e)&&a.isEqual(this.max,t))}limitRange(e,t,s){return[Xt(e,s),Jt(t,s)]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,s=this.isMissing(e)?1:0;return this.countFromMin(e)+s+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 s=this.toListItem(t.getMinutes());e.splice(this.selectedIndex(t),0,s)}return e}countFromMin(e){const[t,s]=this.range(e);return Math.floor(Zt(s,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,s]=this.limitRange(this.min,this.max,e);return[t.getMinutes(),s.getMinutes()]}};const es=(e=>t=>t%e)(60),ts=(e,t)=>es(60+e-t),ss=e=>(t,s)=>!s||t.getMinutes()===s.getMinutes()&&t.getHours()===s.getHours()?t:mt(t,e),is=ss(0),as=ss(59);class ns{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:s=this.min,max:i=this.max,part:a,step:n=this.step}=e;this.insertUndividedMax=t,this.toListItem=e=>{const t=mt(T,e);return{text:this.intl.formatDate(t,a.pattern),value:t}},this.min=s,this.max=i,this.step=n}data(e){const[t]=this.range(e),s=((e,t)=>s=>es(e+s*t))(t,this.step),i=vt(0,this.countFromMin(e)).map((e=>this.toListItem&&this.toListItem(s(e))));return this.addLast(i),e&&this.addMissing(i,e),i}isRangeChanged(e,t){return!(null===this.min||null===this.max||a.isEqual(this.min,e)&&a.isEqual(this.max,t))}limitRange(e,t,s){return[is(e,s),as(t,s)]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,s=this.isMissing(e)?1:0;return this.countFromMin(e)+s+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 ts(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 s=this.toListItem(t.getSeconds());e.splice(this.selectedIndex(t),0,s)}return e}countFromMin(e){const[t,s]=this.range(e);return Math.floor(ts(s,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,s]=this.limitRange(this.min,this.max,e);return[t.getSeconds(),s.getSeconds()]}}const os={[i.Keys.end]:(e,t)=>e[e.length-1],[i.Keys.home]:(e,t)=>e[0],[i.Keys.up]:(e,t)=>e[t-1],[i.Keys.down]:(e,t)=>e[t+1]},rs={[it]:At,[at]:$t,[nt]:Qt,[ot]:ns},ls=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),s=this.virtualization.activeIndex(),i=this.virtualization.itemOffset(s),a=Math.abs(Math.ceil(e)-i);if(t===s&&a<2)return i;const n=t>s;return n&&a>=this.bottomThreshold||!n&&a>this.topThreshold?this.virtualization.itemOffset(s+1):i},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:s}=this.props)=>{if(this.service){const[i,a]=this.service.limitRange(e||this.min,t||this.max,s||this.props.value);this.service.configure(this.serviceSettings({min:i,max:a}))}},this.serviceSettings=t=>{const s={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},i=Object.assign({},s,t);return i.boundRange="hour"!==i.part.type||this.props.boundRange||e.defaultProps.boundRange,i},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)),s=this.service.data(this.props.value)[t];this.handleChange(s)}},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=i.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===i.Keys.down||t===i.Keys.up||t===i.Keys.end||t===i.Keys.home)&&e.preventDefault();const s=(os[e.keyCode]||i.noop)(this.service.data(this.props.value),this.service.selectedIndex(this.props.value));s&&this.handleChange(s)},this.handleChange=W((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:s}=this.props;s&&s.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((()=>{const{unstyled:e}=this.props;this._element&&(this.dom.calculateHeights(this._element,e),this.forceUpdate())}))}componentDidUpdate(){if(!this.virtualization||!this.service)return;const e=this.service.selectedIndex(this.props.value);if(this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](e),this.animateToIndex=!0,!this.topOffset&&this._element){const{unstyled:e}=this.props;this.dom.calculateHeights(this._element,e)}}render(){const{part:e,value:t,unstyled:s}=this.props;if(!e.type||!rs[e.type])return;const a=s&&s.uTime;this.calculateHeights(),this.intl=n.provideIntlService(this),this.service=new rs[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:i.classNames(i.uTime.ul({c:a}))},o.map(((e,t)=>u.createElement("li",{key:t,className:i.classNames(i.uTime.li({c:a})),onClick:()=>{this.handleChange(e)}},u.createElement("span",null,e.text))))),u.createElement("div",{className:i.classNames(i.uTime.scrollablePlaceholder({c:a}))}));return u.createElement("div",{className:i.classNames(i.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:i.classNames(i.uTime.containerSelector({c:a}),i.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,unstyled:s}):u.createElement("div",{className:i.classNames(i.uTime.containerSelector({c:a}),i.uTime.container({c:a,content:!0,scrollable:!0}))},h))}};ls.propTypes={id:s.number,max:s.instanceOf(Date),min:s.instanceOf(Date),part:function(e,t,s){const i=e[t];if(!i||!rs[i.type])throw new Error(`\n Invalid prop '${t}' supplied to ${s}.\n Supported part types are hour|minute|second|dayperiod.\n `);return null},step:function(e,t,s){const i=e[t];if(void 0!==i&&i<=0)throw new Error(`\n Invalid prop '${t}' supplied to ${s}.\n ${t} cannot be less than 1.\n `);return null},value:s.instanceOf(Date),smoothScroll:s.bool,show:s.bool},ls.defaultProps={boundRange:!1,max:P,min:T,step:1,smoothScroll:!0};let hs=ls;n.registerForIntl(hs);const cs=new RegExp(`${at}|${nt}|${ot}|${it}|literal`),ds=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 s=this.timeLists[0];!t&&-1===this.state.activeListIndex&&!this.hasActiveButton()&&s&&s.element&&s.focus(e)}))},this.timeFormatReducer=(e,t)=>e+t.pattern,this.timeFormatFilter=(e,t,s)=>{const i=t>=1&&s[t-1];return i&&i&&"literal"===e.type?cs.test(i.type||""):cs.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,s,i)=>e.length||t.props.id!==this.state.activeListIndex?e:[{next:i[s+1]||t,prev:i[s-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 i.Keys.left:return e.preventDefault(),void this.focusList(0);case i.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,s)=>{if(!e||!t||!s)return e;const{candidateValue:i,minValue:a,maxValue:n}=ft(e,t,s);return i<a?F(e,t):i>n?F(e,s):e})(this.snapTime(a.cloneDate(this.props.value||T)),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:s,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=i.classNames(i.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:i.classNames(i.uTime.header({c:m}))},u.createElement("span",{className:i.classNames(i.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:i.classNames(i.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:i.classNames(i.uTime.listContainer({c:m})),onKeyDown:this.handleKeyDown},u.createElement("span",{className:i.classNames(i.uTime.highlight({c:m}))}),this.dateFormatParts.map(((e,t)=>"literal"!==e.type?u.createElement("div",{key:t,className:i.classNames(i.uTime.listWrapper({c:m,focused:t===this.state.activeListIndex})),role:"presentation",tabIndex:-1},u.createElement("span",{className:i.classNames(i.uTime.title({c:m})),onMouseDown:e=>{e.preventDefault()}},this.intl.dateFieldName(e)),u.createElement(hs,{min:this.min,max:this.max,boundRange:this.boundRange,part:e,step:e.type?this.steps[e.type]:1,smoothScroll:s,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:i.classNames(i.uTime.separator({c:m}))},e.pattern)))))}nextTick(e){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout((()=>e()))}hasActiveButton(){const e=i.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)}};ds.propTypes={cancelButton:s.bool,disabled:s.bool,format:s.oneOfType([s.string,s.shape({skeleton:s.string,pattern:s.string,date:s.oneOf(["short","medium","long","full"]),time:s.oneOf(["short","medium","long","full"]),datetime:s.oneOf(["short","medium","long","full"]),era:s.oneOf(["narrow","short","long"]),year:s.oneOf(["numeric","2-digit"]),month:s.oneOf(["numeric","2-digit","narrow","short","long"]),day:s.oneOf(["numeric","2-digit"]),weekday:s.oneOf(["narrow","short","long"]),hour:s.oneOf(["numeric","2-digit"]),hour12:s.bool,minute:s.oneOf(["numeric","2-digit"]),second:s.oneOf(["numeric","2-digit"]),timeZoneName:s.oneOf(["short","long"])})]),max:s.instanceOf(Date),min:s.instanceOf(Date),nowButton:s.bool,steps:s.shape({hour:s.number,minute:s.number,second:s.number}),smoothScroll:s.bool,tabIndex:s.number,value:s.instanceOf(Date),show:s.bool},ds.defaultProps={value:null,disabled:!1,nowButton:!0,cancelButton:!0,format:"hh:mm a",min:N,max:P,steps:{},boundRange:!1};let us=ds;n.registerForIntl(us),n.registerForLocalization(us);const ps=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!==i.Keys.enter||this.hasActiveButton()||this.handleAccept(e)},this.revertToNowButton=e=>{const{keyCode:t,shiftKey:s}=e;!s&&t===i.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:s,shiftKey:a}=e;a&&s===i.Keys.tab?(e.preventDefault(),this._acceptButton&&(null==(t=this._acceptButton.element)||t.focus({preventScroll:!0}))):s===i.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:s}=this.props;s&&s.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:s}=this.props;s&&s.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,s)=>(t.setHours(...e.map((e=>e(t,s)))),t))(ht(this.dateFormatParts)),this.hasActiveButton=this.hasActiveButton.bind(this),this.state={current:this.props.value||T,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:s,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,D=f&&f.uTime,b=n.provideLocalizationService(this),y=b.toLanguageString(de,ye[de]),S=b.toLanguageString(ue,ye[ue]);return u.createElement(u.Fragment,null,u.createElement("div",{ref:e=>{this._element=e},tabIndex:s?void 0:a||0,className:i.classNames(i.uTimePicker.timeSelector({c:w,mobileMode:v,disabled:s}),r),onKeyDown:this.handleKeyDown},u.createElement(us,{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:s,nowButton:p,steps:m,show:g,mobileMode:v,onNowKeyDown:this.handleNowKeyDown,unstyled:f})),this.props.footer&&u.createElement("div",{className:i.classNames(i.uTime.footer({c:D}))},t&&u.createElement(o.Button,{type:"button",ref:e=>{this._cancelButton=e},className:i.classNames(i.uTime.cancel({c:D})),onClick:this.handleReject,title:y,"aria-label":y},y),u.createElement(o.Button,{type:"button",ref:e=>{this._acceptButton=e},className:i.classNames(i.uTime.accept({c:D})),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=i.getActiveElement(document);return this._acceptButton&&e===this._acceptButton.element||this._cancelButton&&e===this._cancelButton.element}};ps.propTypes={cancelButton:s.bool,className:s.string,disabled:s.bool,format:s.oneOfType([s.string,s.shape({skeleton:s.string,pattern:s.string,date:s.oneOf(["short","medium","long","full"]),time:s.oneOf(["short","medium","long","full"]),datetime:s.oneOf(["short","medium","long","full"]),era:s.oneOf(["narrow","short","long"]),year:s.oneOf(["numeric","2-digit"]),month:s.oneOf(["numeric","2-digit","narrow","short","long"]),day:s.oneOf(["numeric","2-digit"]),weekday:s.oneOf(["narrow","short","long"]),hour:s.oneOf(["numeric","2-digit"]),hour12:s.bool,minute:s.oneOf(["numeric","2-digit"]),second:s.oneOf(["numeric","2-digit"]),timeZoneName:s.oneOf(["short","long"])})]),max:s.instanceOf(Date),min:s.instanceOf(Date),nowButton:s.bool,steps:s.shape({hour:s.number,minute:s.number,second:s.number}),smoothScroll:s.bool,tabIndex:s.number,value:s.instanceOf(Date),show:s.bool},ps.defaultProps={value:null,disabled:!1,cancelButton:!0,format:"t",min:N,max:P,boundRange:!1,footer:!0};let ms=ps;n.registerForIntl(ms),n.registerForLocalization(ms);const gs=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:s,disabled:i,format:a,steps:n,unstyled:o}=this.props;return u.createElement(ms,{ref:this.setTimeSelectorRef,mobileMode:this.mobileMode,show:this.show,cancelButton:t,disabled:i,nowButton:s,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:s}=this.props,a=s&&s.uTimePicker,n=i.classNames(e),o={popupClass:i.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(Et,{...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,s=this.state.candidate||this.value;t&&t.call(void 0,{syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:s,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:s}=e;if(s===i.Keys.esc)return this.shouldFocusDateInput=!0,void this.setShow(!1);t&&(s===i.Keys.up||s===i.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=s===i.Keys.up,this.setShow(s===i.Keys.down))},i.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(i.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),s=this.normalizeTime(this.max),i=Dt(e,t,s),a=void 0!==this.props.validationMessage,n=(!this.required||null!==this.value)&&i,o=void 0!==this.props.valid?this.props.valid:n;return{customError:a,rangeOverflow:yt(e,s),rangeUnderflow:bt(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}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=i.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:s=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:D,validityStyles:b,ariaLabelledBy:y,ariaDescribedBy:S,unstyled:C}=this.props,k=C&&C.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:D,steps:f,tabIndex:this.show?-1:l,title:h,valid:this.validity.valid,validationMessage:w,validityStyles:b,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]),T=u.createElement(i.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:i.classNames(i.uTimePicker.wrapper({c:k,size:t,rounded:s,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:i.classNames(i.uTimePicker.inputButton({c:k})),rounded:null,fillMode:a,"aria-label":M}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup())));return this.props.label?u.createElement(Tt,{dateInput:this._dateInput,label:this.props.label,editorId:c,editorValid:x,editorDisabled:this.props.disabled,children:T,style:{width:this.props.width}}):T}normalizeTime(e){return F(T,e)}setShow(e){const{onOpen:t,onClose:s}=this.props;this.show!==e&&(this.setState({show:e}),e&&t&&t.call(void 0,{target:this}),!e&&s&&s.call(void 0,{target:this}))}mergeTime(e){return this.value&&e?F(this.value,e):e}calculateMedia(e){for(const t of e)this.setState({windowWidth:t.target.clientWidth})}};gs.displayName="TimePicker",gs.propTypes={className:s.string,cancelButton:s.bool,nowButton:s.bool,defaultShow:s.bool,defaultValue:s.instanceOf(Date),disabled:s.bool,format:s.oneOfType([s.string,s.shape({skeleton:s.string,pattern:s.string,date:s.oneOf(["short","medium","long","full"]),time:s.oneOf(["short","medium","long","full"]),datetime:s.oneOf(["short","medium","long","full"]),era:s.oneOf(["narrow","short","long"]),year:s.oneOf(["numeric","2-digit"]),month:s.oneOf(["numeric","2-digit","narrow","short","long"]),day:s.oneOf(["numeric","2-digit"]),weekday:s.oneOf(["narrow","short","long"]),hour:s.oneOf(["numeric","2-digit"]),hour12:s.bool,minute:s.oneOf(["numeric","2-digit"]),second:s.oneOf(["numeric","2-digit"]),timeZoneName:s.oneOf(["short","long"])})]),formatPlaceholder:s.oneOfType([s.oneOf(["wide","narrow","short","formatPattern"]),s.shape({year:s.string,month:s.string,day:s.string,hour:s.string,minute:s.string,second:s.string})]),id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,min:s.instanceOf(Date),max:s.instanceOf(Date),name:s.string,popupSettings:s.shape({animate:s.bool,appendTo:s.any,popupClass:s.string}),show:s.bool,steps:s.shape({hour:s.number,minute:s.number,second:s.number}),smoothScroll:s.bool,tabIndex:s.number,title:s.string,value:s.instanceOf(Date),width:s.oneOfType([s.number,s.string]),validationMessage:s.string,required:s.bool,validate:s.bool,valid:s.bool,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"solid","flat","outline"])},gs.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"t",max:P,min:N,popupSettings:{},tabIndex:0,steps:{},validityStyles:!0,dateInput:It,size:"medium",rounded:"medium",fillMode:"solid"};let vs=gs;const fs=i.createPropsContext(),ws=i.withIdHOC(i.withPropsContext(fs,i.withUnstyledHOC(vs)));ws.displayName="KendoReactTimePicker",n.registerForLocalization(vs);const Ds=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,s)=>{const{onWeekSelect:i}=this.props;i&&s&&i.call(void 0,e,t,s)},this.handleDateChange=(e,t=!1)=>{const{onChange:s}=this.props;if(s){const i={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:a.cloneDate(e.value),target:this,isTodayClick:t};s.call(void 0,i)}}}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=i.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})))))}};Ds.defaultProps={showWeekNumbers:!1,views:2,take:2,allowReverse:!0,weekDaysFormat:"short",min:E,max:V};let bs=Ds;const ys=(e=Is.defaultProps.min,t=Is.defaultProps.max,s)=>s instanceof Date&&!Array.isArray(s)&&L(a.getDate(s),e,t)?a.getDate(s):null,Ss=(e=Is.defaultProps.min,t=Is.defaultProps.max,s)=>Array.isArray(s)?s.filter((s=>L(s,e,t))).map((e=>a.getDate(e))):null,Cs=e=>"object"!=typeof e||e instanceof Date||null===e||Array.isArray(e)?I:e,ks=(e,t,s)=>e||t&&t[0]||s&&s.start,xs=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:s,start:i}=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:s}:{start:i||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 s=this.move(e,t);this.setState({navigateDate:s,focusedDate:s})},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:s,start:i}=t;return"end"!==this.activeRange?null!==s&&e>s:null!==i&&e<i},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=Te.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(Te.NextView,this.focusedDate)},this.handleKeyDown=e=>{const{keyCode:t,ctrlKey:s,metaKey:n}=e;if(84===t){const e=R();this.calculateFocusFromValue=!1,this.setState({focusedDate:e,navigateDate:e})}if((s||n)&&(t===i.Keys.left&&this.handlePrevButtonClick(),t===i.Keys.right&&this.handleNextButtonClick()),t===i.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,s)=>{if("single"===this.props.mode)return;const i=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(i,e));this.setState({value:o,focusedDate:e})}"range"===this.props.mode&&(o={start:i,end:n},this.setState({value:o,focusedDate:e}));const{onChange:r}=this.props;if(r){const e={syntheticEvent:s,nativeEvent:s.nativeEvent,value:o,target:this};r.call(void 0,e)}},this.handleDateChange=e=>{const t=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:t,navigateDate:t});this.bus.moveToBottom(this.state.activeView)}let i;switch(this.calculateFocusFromValue=!0,this.props.mode){case"single":default:i=a.cloneDate(e.value);break;case"multiple":if(Array.isArray(this.selectedMultiple)){const t=this.selectedMultiple.slice();let s=-1;t.forEach(((t,i)=>{a.isEqualDate(t,e.value)&&(s=i)})),-1!==s?t.splice(s,1):t.push(a.cloneDate(e.value)),i=t.slice()}else i=this.selectedDate?[a.cloneDate(this.selectedDate),a.cloneDate(e.value)]:[a.cloneDate(e.value)];break;case"range":i=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=i,e.isTodayClick&&this.setState({navigateDate:t}),this.setState({value:i,focusedDate:t}),this.valueDuringOnChange=i;const{onChange:n}=this.props;if(n){const t={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:i,target:this};n.call(void 0,t)}this.valueDuringOnChange=void 0};const s=void 0!==t.value?t.value:t.defaultValue||e.defaultProps.defaultValue,n=ys(this.min,this.max,s),o=Ss(this.min,this.max,s),r=Cs(s),l=ks(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:s,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 We(this.handleViewChange),this.navigation=new Ye(this.bus),this.calculateFocusFromValue=!1,this.lastView=h,this.lastViewsCount=this.props.views||bs.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=ys(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||bs.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=ys(this.min,this.max,this.value),this.selectedMultiple=Ss(this.min,this.max,this.value),this.selectedRange=Cs(this.value);const t=ks(this.selectedDate,this.selectedMultiple,this.selectedRange);this._focusedDate=z(this.calculateFocusFromValue&&null!==t?t:this.state.focusedDate,this.min,this.max);const s=i.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(Te.PrevView),p=!this.canNavigate(Te.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||bs.defaultProps.views));const D=a.cloneDate(this.dates&&this.dates[0]?this.dates[0]:R());return u.createElement("div",{ref:e=>{this._element=e},className:s,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.${D.getTime()}`,activeView:e,currentDate:D,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(Ce,{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(bs,{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)}};xs.displayName="MultiViewCalendar",xs.propTypes={activeRangeEnd:s.oneOf(["start","end"]),allowReverse:s.bool,bottomView:s.oneOf(["month","year","decade","century"]),className:s.string,defaultActiveView:s.oneOf(["month","year","decade","century"]),defaultValue:s.oneOfType([M(s.instanceOf(Date)),s.arrayOf(s.instanceOf(Date)),s.shape({start:M(s.instanceOf(Date)),end:M(s.instanceOf(Date))})]),disabled:s.bool,focusedDate:s.instanceOf(Date),id:s.string,weekDaysFormat:s.oneOf(["narrow","short","abbreviated"]),ariaLabelledBy:s.string,ariaDescribedBy:s.string,max:s.instanceOf(Date),min:s.instanceOf(Date),mode:s.oneOf(["single","multiple","range"]),onBlur:s.func,onChange:s.func,onFocus:s.func,tabIndex:s.number,topView:s.oneOf(["month","year","decade","century"]),value:s.oneOfType([M(s.instanceOf(Date)),s.arrayOf(s.instanceOf(Date)),s.shape({start:M(s.instanceOf(Date).isRequired),end:M(s.instanceOf(Date).isRequired)})]),views:(e,t,s)=>{const i=e[t];return void 0!==i&&i<1?new Error(`Invalid prop '${t}' supplied to'${s}'. The '${t}' property cannot be less than 1'`):null},weekNumber:s.bool,showOtherMonthDays:s.bool,dir:s.string},xs.defaultProps={disabled:!1,min:E,max:V,navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",weekDaysFormat:"short",tabIndex:0,bottomView:"month",views:2,allowReverse:!1,showOtherMonthDays:!1};let Is=xs;const Ms=i.createPropsContext(),Os=i.withIdHOC(i.withPropsContext(Ms,Is));Os.displayName="KendoReactMultiViewCalendar",n.registerForIntl(Is),n.registerForLocalization(Is);const Ts=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(Os,{...t,ref:this.setCalendarRef})},this.renderPopup=()=>{const e={popupClass:i.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(De,ye[De]),onCancel:this.handleCancel,applyText:this.localizationService.toLanguageString(be,ye[be]),onApply:this.handleBlur}};return u.createElement(Et,{...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},s={syntheticEvent:e,nativeEvent:e.nativeEvent};this.handleChange(t,s)},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:s}=e;t===i.Keys.esc?(e.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1)):s&&t===i.Keys.down?(e.preventDefault(),this.shouldFocusCalendar=!0,this.setShow(!0),this.focusCalendarElement()):s&&t===i.Keys.up&&(e.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1))},this.handleChange=(e,t)=>{this.setState({value:e}),this.valueDuringOnChange=e;const{onChange:s}=this.props;if(s){const e={syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:this.value,show:this.show,target:this};s.call(void 0,e)}this.valueDuringOnChange=void 0},i.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(i.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=i.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,s=(this.props.startDateInputSettings||{}).id||this._startInputId,a=(this.props.endDateInputSettings||{}).id||this._endInputId,l=i.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":s+" "+a,"aria-label":n.provideLocalizationService(this).toLanguageString(ae,ye[ae])},u.createElement(i.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=i.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:s}=this.props;this.show!==e&&(this.setState({show:e}),e&&t&&t.call(void 0,{target:this}),!e&&s&&s.call(void 0,{target:this}))}calculateMedia(e){for(const t of e)this.setState({windowWidth:t.target.clientWidth})}};Ts.displayName="DateRangePicker",Ts.propTypes={allowReverse:s.bool,calendarSettings:s.any,className:s.string,defaultShow:s.bool,defaultValue:s.shape({start:M(s.instanceOf(Date).isRequired),end:M(s.instanceOf(Date).isRequired)}),disabled:s.bool,endDateInputSettings:s.shape(kt.propTypes),focusedDate:s.instanceOf(Date),format:s.oneOfType([s.string,s.shape({skeleton:s.string,pattern:s.string,date:s.oneOf(["short","medium","long","full"]),time:s.oneOf(["short","medium","long","full"]),datetime:s.oneOf(["short","medium","long","full"]),era:s.oneOf(["narrow","short","long"]),year:s.oneOf(["numeric","2-digit"]),month:s.oneOf(["numeric","2-digit","narrow","short","long"]),day:s.oneOf(["numeric","2-digit"]),weekday:s.oneOf(["narrow","short","long"]),hour:s.oneOf(["numeric","2-digit"]),hour12:s.bool,minute:s.oneOf(["numeric","2-digit"]),second:s.oneOf(["numeric","2-digit"]),timeZoneName:s.oneOf(["short","long"])})]),id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,max:s.instanceOf(Date),min:s.instanceOf(Date),onBlur:s.func,onChange:s.func,onFocus:s.func,popupSettings:s.any,show:s.bool,startDateInputSettings:s.any,style:s.any,swapButton:s.any,tabIndex:s.number,dir:s.string,value:s.shape({start:M(s.instanceOf(Date).isRequired),end:M(s.instanceOf(Date).isRequired)}),autoFocus:s.bool},Ts.defaultProps={allowReverse:!1,defaultShow:!1,defaultValue:I,disabled:!1,format:"d",max:V,min:E,swapButton:!1,autoFocus:!1};let Es=Ts;const Vs=i.createPropsContext(),Ns=i.withIdHOC(i.withPropsContext(Vs,Es));Ns.displayName="KendoReactDateRangePicker",n.registerForLocalization(Es);const Ps=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,s=t&&t.uDateTimePicker,a=this.localizationService.toLanguageString(fe,ye[fe]),n=this.localizationService.toLanguageString(we,ye[we]);return u.createElement("div",{className:i.classNames(i.uDateTimePicker.timeFooter({c:s}))},e&&u.createElement(o.Button,{type:"button",ref:e=>{this._cancelButton=e},className:i.classNames(i.uTime.cancel({c:s})),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:i.classNames(i.uTime.accept({c:s})),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||T});const t=this.mergeDate(this.props.value,this.props.value||T);if(this.props.onReject){const s={nativeEvent:e.nativeEvent,syntheticEvent:e,target:this,value:t};this.props.onReject.call(void 0,s)}},this.handleAccept=(e,t)=>{if(!this.state.dateValue||!this.state.timeValue||!this.hasDateValue)return;const s=this.mergeDate(this.state.dateValue,t||this.state.timeValue);this.props.onChange.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:s,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:s}=e;if(!this.props.disabled)switch(t){case i.Keys.enter:return void(!this.hasActiveButton()&&this.hasDateValue&&this.handleAccept(e));case i.Keys.left:if(!s)return;return void this.move("left");case i.Keys.right:if(!s)return;return void this.move("right");default:return}},this.handleCancelKeyDown=e=>{const{keyCode:t}=e;t===i.Keys.tab&&this._dateButtonRef&&this._dateButtonRef.element&&!this.hasDateValue&&(e.preventDefault(),this._dateButtonRef.element.focus())},this.handleSetKeyDown=e=>{const{keyCode:t}=e;t===i.Keys.tab&&this._dateButtonRef&&this._dateButtonRef.element&&(e.preventDefault(),this._dateButtonRef.element.focus())},this.handleDateKeyDown=e=>{var t,s,a,n;const{keyCode:o,shiftKey:r}=e;r&&o===i.Keys.tab&&(e.stopPropagation(),this.hasDateValue?null==(n=null==(a=this._acceptButton)?void 0:a.element)||n.focus():null==(s=null==(t=this._cancelButton)?void 0:t.element)||s.focus()),o===i.Keys.enter&&(e.stopPropagation(),this.move("left"))},this.handleTimeKeyDown=e=>{const{keyCode:t}=e;t===i.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||T}}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 s,i;this.shouldFocusPart&&this.focus({preventScroll:!0}),((null==(s=e.value)?void 0:s.getTime())!==(null==(i=this.props.value)?void 0:i.getTime())||this.state.tab!==t.tab&&this.props.value)&&this.setState((t=>({dateValue:e.value&&this.props.value&&a.isEqualDate(e.value,this.props.value)?t.dateValue:this.props.value,timeValue:this.props.value||T}))),this.shouldFocusPart=!1}render(){const{disabled:e,min:t,max:s,weekNumber:a,focusedDate:n,format:r,mobileMode:l,footerActions:h,unstyled:c}=this.props,d=c&&c.uDateTimePicker,p=i.classNames(i.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:s,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:i.classNames(i.uDateTimePicker.buttonGroup({c:d}))},u.createElement(o.ButtonGroup,{width:"100%",unstyled:c},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:i.classNames(i.uDateTimePicker.selector({c:d}))},u.createElement("div",{className:i.classNames(i.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:i.classNames(i.uDateTimePicker.timeWrap({c:d}))},u.createElement("div",{className:i.classNames(i.uDateTimePicker.timeSelector({c:d,mobileMode:l}))},u.createElement(us,{key:1,onNowClick:this.handleNowClick,disabled:e||"time"!==this.state.tab,ref:e=>{this._timePart=e},min:this.minTime||N,max:this.maxTime||P,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=i.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}};Ps.defaultProps={footerActions:!0};let Fs=Ps;n.registerForLocalization(Fs);const Rs=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:s,format:i,calendar:a,cancelButton:n,weekNumber:o,focusedDate:r,unstyled:l}=this.props;return u.createElement(Fs,{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:s,focusedDate:r,format:i,calendar:a,mobileMode:this.mobileMode,footerActions:!this.mobileMode,unstyled:l})},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t=n.provideLocalizationService(this).toLanguageString(fe,ye[fe]),s=n.provideLocalizationService(this).toLanguageString(we,ye[we]),i={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:s,onApply:e=>{var t;return null==(t=this._dateTimeSelector)?void 0:t.handleAccept(e)}}};return u.createElement(Et,{...i},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:s}=e;if(s===i.Keys.esc)return this.shouldFocusDateInput=!0,void this.setShow(!1);t&&(s===i.Keys.up||s===i.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=s===i.Keys.up,this.setShow(s===i.Keys.down))},this.dateInputElement=()=>this.dateInput&&this.dateInput.element||this.element&&this.element.querySelector(".k-dateinput > input.k-input-inner"),i.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(i.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||N,this.props.maxTime||P),t=void 0!==this.props.validationMessage,s=(!this.required||null!==this.value)&&e,i=void 0!==this.props.valid?this.props.valid:s;return{customError:t,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:i,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}get dateInputComp(){return this.props.dateInput||e.defaultProps.dateInput}componentDidMount(){var e;this.observerResize=i.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:s=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:D,width:b,name:y,validationMessage:S,required:C,validityStyles:k,minTime:x,maxTime:I,ariaLabelledBy:M,ariaDescribedBy:O,popup:T=h.Popup,unstyled:E}=this.props,V=E&&E.uDateTimePicker,N=!this.validityStyles||this.validity.valid,P={id:m,ariaLabelledBy:M,ariaDescribedBy:O,format:g,formatPlaceholder:v,disabled:c,title:p,validityStyles:k,validationMessage:S,required:C,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,unstyled:E},F=u.createElement(i.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:i.classNames(i.uDateTimePicker.wrapper({c:V,size:t,fillMode:a,rounded:s,disabled:c,required:this.required,invalid:!N}),D),onKeyDown:this.handleKeyDown,style:{width:b},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,ariaHasPopup:"dialog",readonly:this.mobileMode,autoFocus:l,...P}),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:i.classNames(i.uDateTimePicker.inputButton({c:V})),rounded:null,fillMode:a,"aria-label":n.provideLocalizationService(this).toLanguageString(le,ye[le])}),u.createElement(T,{show:this.show,animate:null!==this.element,anchor:this.element,popupClass:i.classNames(i.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(Tt,{dateInput:this._dateInput,label:this.props.label,editorId:m,editorValid:N,editorDisabled:this.props.disabled,children:F,style:{width:this.props.width}}):F}setShow(e){const{onOpen:t,onClose:s}=this.props;this.show!==e&&(this.setState({show:e}),e&&t&&t.call(void 0,{target:this}),!e&&s&&s.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})}};Rs.displayName="DateTimePicker",Rs.propTypes={className:s.string,defaultShow:s.bool,defaultValue:s.instanceOf(Date),disabled:s.bool,focusedDate:s.instanceOf(Date),format:s.oneOfType([s.string,s.shape({skeleton:s.string,pattern:s.string,date:s.oneOf(["short","medium","long","full"]),time:s.oneOf(["short","medium","long","full"]),datetime:s.oneOf(["short","medium","long","full"]),era:s.oneOf(["narrow","short","long"]),year:s.oneOf(["numeric","2-digit"]),month:s.oneOf(["numeric","2-digit","narrow","short","long"]),day:s.oneOf(["numeric","2-digit"]),weekday:s.oneOf(["narrow","short","long"]),hour:s.oneOf(["numeric","2-digit"]),hour12:s.bool,minute:s.oneOf(["numeric","2-digit"]),second:s.oneOf(["numeric","2-digit"]),timeZoneName:s.oneOf(["short","long"])})]),formatPlaceholder:s.oneOfType([s.oneOf(["wide","narrow","short","formatPattern"]),s.shape({year:s.string,month:s.string,day:s.string,hour:s.string,minute:s.string,second:s.string})]),id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,min:s.instanceOf(Date),max:s.instanceOf(Date),name:s.string,popupSettings:s.shape({animate:s.bool,appendTo:s.any,popupClass:s.string}),show:s.bool,tabIndex:s.number,title:s.string,value:s.instanceOf(Date),weekNumber:s.bool,width:s.oneOfType([s.number,s.string]),validationMessage:s.string,required:s.bool,validate:s.bool,valid:s.bool,cancelButton:s.bool,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"solid","flat","outline"]),autoFocus:s.bool},Rs.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"g",max:V,min:E,popupSettings:{},tabIndex:0,weekNumber:!1,validityStyles:!0,cancelButton:!0,dateInput:It,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1};let Ls=Rs;const Bs=i.createPropsContext(),_s=i.withIdHOC(i.withPropsContext(Bs,i.withUnstyledHOC(Ls)));_s.displayName="KendoReactDateTimePicker",n.registerForLocalization(Ls),e.Action=Te,e.BusViewService=We,e.Calendar=Qe,e.CalendarCell=C,e.CalendarHeaderTitle=j,e.CalendarNavigationItem=Ie,e.CalendarPropsContext=Je,e.CalendarViewEnum=x,e.CalendarWeekCell=k,e.CalendarWithoutContext=Xe,e.CenturyViewService=Ne,e.DOMService=Ke,e.DateInput=It,e.DateInputPropsContext=xt,e.DateInputWithoutContext=kt,e.DatePicker=Rt,e.DatePickerPropsContext=Ft,e.DatePickerWithoutContext=Pt,e.DateRangePicker=Ns,e.DateRangePickerPropsContext=Vs,e.DateRangePickerWithoutContext=Es,e.DateTimePicker=_s,e.DateTimePickerPropsContext=Bs,e.DateTimePickerWithoutContext=Ls,e.DayPeriodService=At,e.DecadeViewService=Re,e.EMPTY_SELECTIONRANGE=I,e.Header=G,e.HorizontalViewList=bs,e.HoursService=$t,e.MAX_DATE=V,e.MAX_TIME=P,e.MIN_DATE=E,e.MIN_TIME=N,e.MinutesService=Qt,e.MonthViewService=_e,e.MultiViewCalendar=Os,e.MultiViewCalendarPropsContext=Ms,e.MultiViewCalendarWithoutContext=Is,e.NavigationService=Ye,e.PickerWrap=Ot,e.ScrollSyncService=$e,e.SecondsService=ns,e.TimeList=hs,e.TimePart=us,e.TimePicker=ws,e.TimePickerPropsContext=fs,e.TimePickerWithoutContext=vs,e.TimeSelector=ms,e.TodayCommand=Ce,e.ToggleButton=Mt,e.ViewList=xe,e.Virtualization=S,e.WeekNamesService=K,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=se,e.toggleCalendar=ie,e.toggleDateTimeSelector=le}));
|