@progress/kendo-react-dateinputs 7.2.4-develop.3 → 7.3.0-develop.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. package/calendar/components/Calendar.js +12 -0
  2. package/calendar/components/Calendar.mjs +328 -0
  3. package/calendar/components/CalendarCell.js +8 -0
  4. package/calendar/components/CalendarCell.mjs +101 -0
  5. package/calendar/components/CalendarHeaderTitle.js +8 -0
  6. package/calendar/components/CalendarHeaderTitle.mjs +23 -0
  7. package/calendar/components/CalendarNavigationItem.js +8 -0
  8. package/calendar/components/CalendarNavigationItem.mjs +29 -0
  9. package/calendar/components/CalendarWeekCell.js +8 -0
  10. package/calendar/components/CalendarWeekCell.mjs +23 -0
  11. package/calendar/components/Header.js +8 -0
  12. package/calendar/components/Header.mjs +78 -0
  13. package/calendar/components/HorizontalViewList.js +8 -0
  14. package/calendar/components/HorizontalViewList.mjs +120 -0
  15. package/calendar/components/MultiViewCalendar.js +8 -0
  16. package/calendar/components/MultiViewCalendar.mjs +428 -0
  17. package/calendar/components/Navigation.js +8 -0
  18. package/calendar/components/Navigation.mjs +117 -0
  19. package/calendar/components/TodayCommand.js +8 -0
  20. package/calendar/components/TodayCommand.mjs +74 -0
  21. package/calendar/components/View.js +8 -0
  22. package/calendar/components/View.mjs +153 -0
  23. package/calendar/components/ViewList.js +8 -0
  24. package/calendar/components/ViewList.mjs +228 -0
  25. package/calendar/models/CalendarViewEnum.js +8 -0
  26. package/calendar/models/CalendarViewEnum.mjs +12 -0
  27. package/calendar/models/NavigationAction.js +8 -0
  28. package/calendar/models/NavigationAction.mjs +12 -0
  29. package/calendar/models/SelectionRange.js +8 -0
  30. package/calendar/models/SelectionRange.mjs +12 -0
  31. package/calendar/services/BusViewService.js +8 -0
  32. package/calendar/services/BusViewService.mjs +58 -0
  33. package/calendar/services/CenturyViewService.js +8 -0
  34. package/calendar/services/CenturyViewService.mjs +126 -0
  35. package/calendar/services/DOMService.js +14 -0
  36. package/calendar/services/DOMService.mjs +124 -0
  37. package/calendar/services/DecadeViewService.js +8 -0
  38. package/calendar/services/DecadeViewService.mjs +126 -0
  39. package/calendar/services/MonthViewService.js +8 -0
  40. package/calendar/services/MonthViewService.mjs +139 -0
  41. package/calendar/services/NavigationService.js +8 -0
  42. package/calendar/services/NavigationService.mjs +36 -0
  43. package/calendar/services/ScrollSyncService.js +8 -0
  44. package/calendar/services/ScrollSyncService.mjs +50 -0
  45. package/calendar/services/WeekNamesService.js +8 -0
  46. package/calendar/services/WeekNamesService.mjs +24 -0
  47. package/calendar/services/YearViewService.js +8 -0
  48. package/calendar/services/YearViewService.mjs +135 -0
  49. package/common/AdaptiveMode.js +8 -0
  50. package/common/AdaptiveMode.mjs +73 -0
  51. package/common/PickerWrap.js +8 -0
  52. package/common/PickerWrap.mjs +32 -0
  53. package/common/constants.js +8 -0
  54. package/common/constants.mjs +12 -0
  55. package/dateinput/DateInput.js +8 -0
  56. package/dateinput/DateInput.mjs +503 -0
  57. package/dateinput/models/kendo-date.js +8 -0
  58. package/dateinput/models/kendo-date.mjs +233 -0
  59. package/dateinput/models/mask.js +8 -0
  60. package/dateinput/models/mask.mjs +16 -0
  61. package/dateinput/utils.js +8 -0
  62. package/dateinput/utils.mjs +38 -0
  63. package/datepicker/DatePicker.js +8 -0
  64. package/datepicker/DatePicker.mjs +462 -0
  65. package/datepicker/ToggleButton.js +8 -0
  66. package/datepicker/ToggleButton.mjs +13 -0
  67. package/daterangepicker/DateRangePicker.js +8 -0
  68. package/daterangepicker/DateRangePicker.mjs +426 -0
  69. package/datetimepicker/DateTimePicker.js +8 -0
  70. package/datetimepicker/DateTimePicker.mjs +475 -0
  71. package/datetimepicker/DateTimeSelector.js +8 -0
  72. package/datetimepicker/DateTimeSelector.mjs +275 -0
  73. package/dist/cdn/js/kendo-react-dateinputs.js +8 -21
  74. package/hooks/usePickerFloatingLabel.js +8 -0
  75. package/hooks/usePickerFloatingLabel.mjs +31 -0
  76. package/index.d.mts +4528 -5
  77. package/index.d.ts +4528 -39
  78. package/index.js +8 -21
  79. package/index.mjs +114 -6540
  80. package/messages/index.js +8 -0
  81. package/messages/index.mjs +59 -0
  82. package/package-metadata.js +8 -0
  83. package/package-metadata.mjs +19 -0
  84. package/package.json +7 -7
  85. package/timepicker/TimeList.js +14 -0
  86. package/timepicker/TimeList.mjs +230 -0
  87. package/timepicker/TimePart.js +8 -0
  88. package/timepicker/TimePart.mjs +267 -0
  89. package/timepicker/TimePicker.js +8 -0
  90. package/timepicker/TimePicker.mjs +479 -0
  91. package/timepicker/TimeSelector.js +8 -0
  92. package/timepicker/TimeSelector.mjs +250 -0
  93. package/timepicker/models/TimePart.js +8 -0
  94. package/timepicker/models/TimePart.mjs +18 -0
  95. package/timepicker/services/DOMService.js +8 -0
  96. package/timepicker/services/DOMService.mjs +34 -0
  97. package/timepicker/services/DayPeriodService.js +8 -0
  98. package/timepicker/services/DayPeriodService.mjs +89 -0
  99. package/timepicker/services/HoursService.js +8 -0
  100. package/timepicker/services/HoursService.mjs +92 -0
  101. package/timepicker/services/MinutesService.js +8 -0
  102. package/timepicker/services/MinutesService.mjs +91 -0
  103. package/timepicker/services/SecondsService.js +8 -0
  104. package/timepicker/services/SecondsService.mjs +91 -0
  105. package/timepicker/utils.js +8 -0
  106. package/timepicker/utils.mjs +91 -0
  107. package/utils.js +8 -0
  108. package/utils.mjs +111 -0
  109. package/virtualization/Virtualization.js +8 -0
  110. package/virtualization/Virtualization.mjs +204 -0
  111. package/virtualization/services/RowHeightService.js +8 -0
  112. package/virtualization/services/RowHeightService.mjs +50 -0
  113. package/virtualization/services/ScrollerService.js +8 -0
  114. package/virtualization/services/ScrollerService.mjs +52 -0
  115. package/PopupSettings.d.ts +0 -18
  116. package/calendar/components/Calendar.d.ts +0 -191
  117. package/calendar/components/CalendarCell.d.ts +0 -39
  118. package/calendar/components/CalendarHeaderTitle.d.ts +0 -32
  119. package/calendar/components/CalendarNavigationItem.d.ts +0 -31
  120. package/calendar/components/CalendarWeekCell.d.ts +0 -29
  121. package/calendar/components/Header.d.ts +0 -58
  122. package/calendar/components/HorizontalViewList.d.ts +0 -71
  123. package/calendar/components/MultiViewCalendar.d.ts +0 -212
  124. package/calendar/components/Navigation.d.ts +0 -80
  125. package/calendar/components/TodayCommand.d.ts +0 -35
  126. package/calendar/components/View.d.ts +0 -89
  127. package/calendar/components/ViewList.d.ts +0 -115
  128. package/calendar/models/ActiveView.d.ts +0 -8
  129. package/calendar/models/CalendarSettings.d.ts +0 -106
  130. package/calendar/models/CalendarViewEnum.d.ts +0 -13
  131. package/calendar/models/CellContext.d.ts +0 -23
  132. package/calendar/models/MultiViewCalendarMode.d.ts +0 -13
  133. package/calendar/models/MultiViewCalendarSettings.d.ts +0 -115
  134. package/calendar/models/NavigationAction.d.ts +0 -19
  135. package/calendar/models/SelectionRange.d.ts +0 -21
  136. package/calendar/models/SelectionRangeEnd.d.ts +0 -8
  137. package/calendar/models/ViewService.d.ts +0 -29
  138. package/calendar/models/index.d.ts +0 -15
  139. package/calendar/services/BusViewService.d.ts +0 -25
  140. package/calendar/services/CenturyViewService.d.ts +0 -29
  141. package/calendar/services/DOMService.d.ts +0 -33
  142. package/calendar/services/DecadeViewService.d.ts +0 -31
  143. package/calendar/services/MonthViewService.d.ts +0 -37
  144. package/calendar/services/NavigationService.d.ts +0 -18
  145. package/calendar/services/ScrollSyncService.d.ts +0 -25
  146. package/calendar/services/WeekNamesService.d.ts +0 -13
  147. package/calendar/services/YearViewService.d.ts +0 -35
  148. package/calendar/services/index.d.ts +0 -14
  149. package/common/AdaptiveMode.d.ts +0 -25
  150. package/common/PickerWrap.d.ts +0 -22
  151. package/common/constants.d.ts +0 -8
  152. package/dateinput/DateInput.d.ts +0 -355
  153. package/dateinput/models/DateInputSettings.d.ts +0 -103
  154. package/dateinput/models/format-placeholder.d.ts +0 -43
  155. package/dateinput/models/incremental-steps.d.ts +0 -15
  156. package/dateinput/models/index.d.ts +0 -11
  157. package/dateinput/models/kendo-date.d.ts +0 -57
  158. package/dateinput/models/mask.d.ts +0 -11
  159. package/dateinput/models/selection.d.ts +0 -11
  160. package/dateinput/utils.d.ts +0 -34
  161. package/datepicker/DatePicker.d.ts +0 -358
  162. package/datepicker/ToggleButton.d.ts +0 -14
  163. package/datepicker/models/DatePickerSettings.d.ts +0 -141
  164. package/datepicker/models/index.d.ts +0 -6
  165. package/daterangepicker/DateRangePicker.d.ts +0 -354
  166. package/daterangepicker/models/DateRangePickerCalendarSettings.d.ts +0 -10
  167. package/daterangepicker/models/DateRangePickerDateInputSettings.d.ts +0 -10
  168. package/daterangepicker/models/DateRangePickerPopupSettings.d.ts +0 -10
  169. package/daterangepicker/models/DateRangePickerSettings.d.ts +0 -126
  170. package/daterangepicker/models/index.d.ts +0 -9
  171. package/datetimepicker/DateTimePicker.d.ts +0 -342
  172. package/datetimepicker/DateTimeSelector.d.ts +0 -106
  173. package/datetimepicker/models/DateTimePickerSettings.d.ts +0 -144
  174. package/datetimepicker/models/index.d.ts +0 -6
  175. package/hooks/usePickerFloatingLabel.d.ts +0 -24
  176. package/messages/index.d.ts +0 -124
  177. package/package-metadata.d.ts +0 -9
  178. package/timepicker/TimeList.d.ts +0 -91
  179. package/timepicker/TimePart.d.ts +0 -141
  180. package/timepicker/TimePicker.d.ts +0 -355
  181. package/timepicker/TimeSelector.d.ts +0 -144
  182. package/timepicker/models/IncrementalSteps.d.ts +0 -12
  183. package/timepicker/models/ListItem.d.ts +0 -11
  184. package/timepicker/models/ListService.d.ts +0 -19
  185. package/timepicker/models/ListServiceSettings.d.ts +0 -16
  186. package/timepicker/models/TimePart.d.ts +0 -14
  187. package/timepicker/models/TimePickerSettings.d.ts +0 -133
  188. package/timepicker/models/index.d.ts +0 -11
  189. package/timepicker/services/DOMService.d.ts +0 -14
  190. package/timepicker/services/DayPeriodService.d.ts +0 -51
  191. package/timepicker/services/HoursService.d.ts +0 -37
  192. package/timepicker/services/MinutesService.d.ts +0 -36
  193. package/timepicker/services/SecondsService.d.ts +0 -36
  194. package/timepicker/services/index.d.ts +0 -10
  195. package/timepicker/utils.d.ts +0 -60
  196. package/utils.d.ts +0 -100
  197. package/virtualization/Virtualization.d.ts +0 -120
  198. package/virtualization/services/RowHeightService.d.ts +0 -22
  199. package/virtualization/services/ScrollerService.d.ts +0 -53
  200. package/virtualization/services/index.d.ts +0 -7
package/index.js CHANGED
@@ -1,21 +1,8 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the package root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Us=require("react"),n=require("prop-types"),d=require("@progress/kendo-react-common"),r=require("@progress/kendo-date-math"),k=require("@progress/kendo-react-intl"),N=require("@progress/kendo-react-buttons"),J=require("@progress/kendo-svg-icons"),ss=require("@progress/kendo-react-labels"),Qe=require("@progress/kendo-react-popup"),ce=require("@progress/kendo-react-layout");function Ys(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>s[t]})}}return e.default=s,Object.freeze(e)}const l=Ys(Us),Se={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"},$s=(s,e,t)=>[...s.slice(0,e+1),...s.slice(e+1).map(i=>i+t)];class js{constructor(e=0,t,i){this.total=e,this.rowHeight=t,this.detailRowHeight=i,this.offsets=[],this.heights=[];let a=0;for(let o=0;o<e;o++)this.offsets.push(a),a+=t,this.heights.push(t)}height(e){return this.heights[e]}expandDetail(e){this.height(e)===this.rowHeight&&this.updateRowHeight(e,this.detailRowHeight)}collapseDetail(e){this.height(e)>this.rowHeight&&this.updateRowHeight(e,this.detailRowHeight*-1)}index(e){for(let t=0;t<this.offsets.length;t++){if(e===this.offsets[t])return t;if(e<this.offsets[t])return t-1}return this.total-1}offset(e){return this.offsets[e]}totalHeight(){return this.heights.reduce((e,t)=>e+t,0)}updateRowHeight(e,t){this.heights[e]+=t,this.offsets=$s(this.offsets,e,t)}}const Ae=s=>Math.max(s,0);class at{constructor(e){this.offset=e}}class ot{constructor(e){this.skip=e}}class Zs{constructor(e,t){this.onScrollAction=e,this.onPageAction=t,this.direction="vertical",this.firstLoaded=0,this.lastLoaded=0,this.lastScrollTop=0,this.take=0,this.total=0,this.rowHeightService=null,this.bottomOffset=0,this.topOffset=0}create(e,t,i,a,o=0,h=0,u="vertical"){this.rowHeightService=e,this.firstLoaded=t,this.lastLoaded=t+i,this.take=i,this.total=a,this.lastScrollTop=0,this.topOffset=o,this.bottomOffset=h,this.direction=u;const c=this.rowsForHeight(o),p=Ae(t-c);this.onScrollAction(new at(this.rowOffset(p))),this.onPageAction(new ot(p))}onScroll({scrollLeft:e,scrollTop:t,offsetHeight:i,offsetWidth:a}){const o=this.direction==="vertical"?t:e,h=this.direction==="vertical"?i:a;if(this.lastScrollTop===o||!this.rowHeightService)return;const u=this.lastScrollTop>=o;this.lastScrollTop=o;const c=this.rowHeightService.index(Ae(o-this.topOffset)),p=this.rowHeightService.index(Ae(o+h-this.bottomOffset));if(!u&&p>=this.lastLoaded&&this.lastLoaded<this.total&&(this.firstLoaded=c,this.onScrollAction(new at(this.rowOffset(c))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),this.onPageAction(new ot(this.firstLoaded))),u&&c<=this.firstLoaded){const m=Math.floor(this.take*.3);this.firstLoaded=Ae(c-m),this.onScrollAction(new at(this.rowOffset(this.firstLoaded))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),this.onPageAction(new ot(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 Gs=(s,e,t)=>Math.min(Math.abs(e-s),t),Xs=17,Js=10,Qs={[1]:s=>e=>e+s,[0]:s=>e=>e-s},ei={[1]:s=>e=>Math.min(e,s),[0]:s=>e=>Math.max(e,s)},ti={[1]:s=>e=>e<s,[0]:s=>e=>e>s},He=class extends l.Component{constructor(s){super(s),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=this.direction==="vertical"?"scrollTop":"scrollLeft";if(!this.scrollContainer)return;const i=this.scrollContainer[t];this.restrictScroll&&t==="scrollTop"&&(!Number.isInteger(i)||!Number.isInteger(e))&&Math.abs(i-e)<Js||(this.scrollContainer[t]=e)},this.scrollToIndex=e=>{this.animationInProgress=!1,this.rowHeightService&&this.scrollTo(this.rowHeightService.offset(e))},this.animateToIndex=e=>{if(!this.rowHeightService||!window)return;window.cancelAnimationFrame(this.cancelAnimation);const t=this.rowHeightService.offset(e),i=this.getContainerScrollDirection(t);let{start:a,end:o}=this.scrollRange(t,i);if(a===o)return;const h=this.scrollStep(a,o),u=Qs[i](h),c=ei[i](o),p=ti[i](u(o)),m=f=>{this.animationInProgress=!0;const v=u(f);this.scrollTo(c(v)),p(v)?this.cancelAnimation=window.requestAnimationFrame(()=>{m(v)}):this.animationInProgress=!1};this.cancelAnimation=window.requestAnimationFrame(()=>{m(a)})},this.scrollToBottom=()=>{this.rowHeightService&&this.scrollTo(this.rowHeightService.totalHeight()+this.props.bottomOffset)},this.scrollStep=(e,t)=>{const i=this.props.scrollDuration||He.defaultProps.scrollDuration;return Math.abs(t-e)/(i/Xs)},this.scrollRange=(e,t)=>{const i=this.containerScrollPosition;if(parseInt(`${e}`,10)===parseInt(`${i}`,10))return{start:e,end:e};const a=this.containerMaxScroll(),o=t===0?1:-1,h=Gs(i,e,this.props.maxScrollDifference||0),u=Math.min(e,a);return{start:Math.min(Math.max(u+o*h,0),a),end:u}},this.containerMaxScroll=()=>this.containerScrollSize-this.containerOffsetSize,this.getContainerScrollDirection=e=>e<this.containerScrollPosition?0:1,this.initServices=(e=this.props)=>{const t=this.direction==="vertical"?e.itemHeight:e.itemWidth;t!==void 0&&(this.rowHeightService=new js(e.total,t,0),this.scrollerService.create(this.rowHeightService,e.skip,e.take,e.total,e.topOffset,this.scrollOffsetSize,this.direction))},this.getContainerProperty=e=>this.scrollContainer?this.scrollContainer[e]:0,this.handleScroll=e=>{if(!this.scrollContainer||!this.rowHeightService)return;const t=e.target;this.scrollerService.onScroll({scrollLeft:t.scrollLeft,scrollTop:t.scrollTop,offsetHeight:t.offsetHeight,offsetWidth:t.offsetWidth});const i=this.rowHeightService.index(this.containerScrollPosition-this.props.topOffset),{onScrollAction:a}=this.props,o={index:i,target:t,scrollAction:this.scrollAction,pageAction:this.pageAction,animationInProgress:this.animationInProgress};this.props.onScroll&&this.props.onScroll.call(void 0,e),a&&a.call(void 0,o),this.scrollAction=void 0,this.pageAction=void 0},this.handleScrollAction=e=>{this.scrollAction=e},this.handlePageAction=e=>{this.pageAction=e},this.scrollerService=new Zs(this.handleScrollAction,this.handlePageAction),this.restrictScroll=Number.parseFloat(l.version)>17}get element(){return this.scrollContainer}get containerOffsetSize(){return this.getContainerProperty(this.direction==="vertical"?"offsetHeight":"offsetWidth")}get containerScrollSize(){return this.getContainerProperty(this.direction==="vertical"?"scrollHeight":"scrollWidth")}get containerScrollPosition(){return this.getContainerProperty(this.direction==="vertical"?"scrollTop":"scrollLeft")}get direction(){return this.props.direction!==void 0?this.props.direction:He.defaultProps.direction}get scrollOffsetSize(){return this.props.scrollOffsetSize!==void 0?this.props.scrollOffsetSize:He.defaultProps.scrollOffsetSize}activeIndex(){return this.itemIndex(Math.ceil(this.containerScrollPosition))}itemIndex(s){return this.rowHeightService?this.rowHeightService.index(s):0}itemOffset(s){return this.rowHeightService?this.rowHeightService.offset(s):0}isIndexVisible(s){if(!this.rowHeightService)return!1;const e=this.containerScrollPosition,t=e+this.containerOffsetSize,i=this.rowHeightService.offset(s),a=i+this.rowHeightService.height(s);return i>=e&&a<=t}isListScrolled(s){return this.rowHeightService?this.containerScrollPosition!==this.rowHeightService.offset(s):!1}componentDidMount(){const{onMount:s}=this.props;s&&s.call(void 0,this)}render(){(this.lastTotal!==this.props.total||this.lastDirection!==this.direction||this.lastTake!==this.props.take)&&(this.initServices(),this.lastTotal=this.props.total,this.lastDirection=this.direction,this.lastTake=this.props.take);const s=`${(this.rowHeightService?this.rowHeightService.totalHeight():0)+this.props.bottomOffset}`,e=this.direction==="vertical"?{height:`${s}px`}:{width:`${s}px`},t=d.classNames("k-content k-scrollable",{"k-scrollable-horizontal":this.direction==="horizontal"},this.props.className),i=d.classNames("k-scrollable-placeholder",{"k-scrollable-horizontal-placeholder":this.direction==="horizontal"});return l.createElement("div",{ref:a=>{this.scrollContainer=a},onScroll:this.handleScroll,className:t,tabIndex:this.props.tabIndex,role:this.props.role},this.props.children,l.createElement("div",{style:e,className:i}))}};let Ce=He;Ce.propTypes={bottomOffset:n.number.isRequired,className:n.string,direction:n.oneOf(["horizontal","vertical"]),forceScroll:n.bool,itemHeight:n.number,itemWidth:n.number,maxScrollDifference:n.number,onScroll:n.func,onScrollAction:n.func,scrollDuration:n.number,scrollOffsetSize:n.number,skip:n.number.isRequired,tabIndex:n.number,take:n.number.isRequired,topOffset:n.number.isRequired,total:n.number.isRequired,role:n.string};Ce.defaultProps={direction:"vertical",forceScroll:!1,scrollOffsetSize:0,maxScrollDifference:100,scrollDuration:100};const si=(s,e)=>{const t=Object.getOwnPropertyNames(s),i=Object.getOwnPropertyNames(e);if(t.length!==i.length)return!1;for(let a=0;a<t.length;a++){const o=t[a];if(s[o]!==e[o])return!1}return!0};class is extends l.Component{constructor(){super(...arguments),this.handleClick=e=>{const{onClick:t,value:i}=this.props;t&&t.call(void 0,i,e)},this.handleMouseEnter=()=>{const{onMouseEnter:e,value:t}=this.props;e&&e.call(void 0,t)},this.handleMouseLeave=()=>{const{onMouseLeave:e,value:t}=this.props;e&&e.call(void 0,t)}}shouldComponentUpdate(e){const{value:t,...i}=this.props,{value:a,...o}=e;return!((!(t&&a)||t.getTime()===a.getTime())&&si(i,o))}render(){const{className:e,formattedValue:t,isWeekend:i,isFocused:a,isInRange:o,isSelected:h,isRangeStart:u,isRangeMid:c,isRangeEnd:p,isRangeSplitStart:m,isRangeSplitEnd:f,isToday:v,isDisabled:g,view:C,value:I,...T}=this.props,D=this.props.activeRangeEnd==="end"&&p,E=this.props.activeRangeEnd==="start"&&u,w=d.classNames("k-calendar-td",{"k-range-end":p,"k-range-mid":c,"k-range-split-end":f,"k-range-split-start":m,"k-range-start":u,"k-active":E||D,"k-state-pending-focus":a,"k-selected":h||u||p,"k-today":v,"k-weekend":i,"k-disabled":g},e);return l.createElement("td",{...T,className:w,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},l.createElement("span",{className:"k-link"},this.props.children))}}class ns extends l.Component{render(){const{className:e,firstDate:t,...i}=this.props;return l.createElement("td",{className:d.classNames("k-calendar-td",e),...i},this.props.children)}}var b=(s=>(s[s.Left=0]="Left",s[s.Right=1]="Right",s[s.Up=2]="Up",s[s.Down=3]="Down",s[s.PrevView=4]="PrevView",s[s.NextView=5]="NextView",s[s.FirstInView=6]="FirstInView",s[s.LastInView=7]="LastInView",s[s.LowerView=8]="LowerView",s[s.UpperView=9]="UpperView",s))(b||{}),S=(s=>(s[s.month=0]="month",s[s.year=1]="year",s[s.decade=2]="decade",s[s.century=3]="century",s))(S||{});const B={start:null,end:null};function ee(s){const e=(i,a,o,...h)=>a[o]===null?null:(i?s.isRequired:s)(a,o,...h),t=e.bind(null,!1);return t.isRequired=e.bind(null,!0),t}const Ye=(s,e,t)=>e===void 0||t===void 0||e<=s&&s<=t?s:s<e?e:t,F=new Date(1980,0,1),te=new Date(1900,0,1),se=new Date(2099,11,31),de=new Date(1980,0,1),oe=new Date(1980,0,1,23,59,59),q=(s,e)=>{const t=r.cloneDate(s);return t.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),t},L=()=>r.getDate(new Date),_=(s,e,t)=>!s||!(e&&e>s||t&&t<s),as=(s,e,t)=>s===null||!(e&&r.getDate(e)>r.getDate(s)||t&&r.getDate(t)<r.getDate(s)),et=(s,e)=>{const{start:t,end:i}=e||B;return!t||!i?!1:t<s&&s<i},Z=(s,e,t=1)=>{const i=[];for(let a=s;a<e;a=a+t)i.push(a);return i},os=(s,e,t)=>e.getTime()<=s.getTime()&&s.getTime()<=t.getTime(),rs=(s,e)=>s.slice(e).concat(s.slice(0,e)),K=(s,e,t)=>s&&(e&&s<e?r.cloneDate(e):t&&s>t?r.cloneDate(t):s),W=s=>(e,t="",i={})=>{const a=document.createElement(s);return a.className=t,Object.keys(i).map(o=>a.style[o]=i[o]),typeof e=="string"?a.innerHTML=e||"":(e||[]).forEach(o=>o&&a.appendChild(o)),a};function ii(s,e,t={}){let i,a;t.maxWait;let o,h,u;const c=window;let p=!1,m=!1;const f=!e&&e!==0&&typeof c.requestAnimationFrame=="function";if(typeof s!="function")throw new TypeError("Expected a function");e=+e||0;function v(x){const O=i,G=a;return i=a=void 0,o=s.apply(G,O),o}function g(x,O){return f?(c.cancelAnimationFrame(h),c.requestAnimationFrame(x)):setTimeout(x,O)}function C(x){if(f)return c.cancelAnimationFrame(x);clearTimeout(x)}function I(x){return h=g(E,e),p?v():o}function T(x){const O=x-u;return e-O}function D(x){const O=x-u;return u===void 0||O>=e||O<0||m}function E(){const x=Date.now();if(D(x))return w();h=g(E,T(x))}function w(x){return h=void 0,i?v():(i=a=void 0,o)}function A(){h!==void 0&&C(h),i=u=a=h=void 0}function V(){return h===void 0?o:w()}function P(){return h!==void 0}function H(...x){const O=Date.now(),G=D(O);return i=x,a=this,u=O,G&&h===void 0?I():(h===void 0&&(h=g(E,e)),o)}return H.cancel=A,H.flush=V,H.pending=P,H}const ni=[[]],rt=4,ai=3,oi={[b.Left]:s=>r.addDecades(s,-1),[b.Up]:s=>r.addDecades(s,-5),[b.Right]:s=>r.addDecades(s,1),[b.Down]:s=>r.addDecades(s,5),[b.PrevView]:s=>r.addCenturies(s,-1),[b.NextView]:s=>r.addCenturies(s,1),[b.FirstInView]:s=>r.firstDecadeOfCentury(s),[b.LastInView]:s=>r.lastDecadeOfCentury(s)};class ls{addToDate(e,t){return r.addCenturies(e,t)}datesList(e,t){return Z(0,t).map(i=>r.addCenturies(e,i))}data(e){const{cellUID:t,focusedDate:i,isActiveView:a,max:o,min:h,selectedDate:u,selectionRange:c=B,viewDate:p}=e;if(!p)return ni;const m=Z(0,rt),f=r.firstDecadeOfCentury(p),v=r.lastDecadeOfCentury(p),g=L();return Z(0,ai).map(C=>{const I=r.addDecades(f,C*rt);return m.map(T=>{const D=this.normalize(r.addDecades(I,T),h,o),E=this.isEqual(D,c.start),w=this.isEqual(D,c.end),V=!E&&!w&&et(D,c),P=a&&(Array.isArray(u)?this.isSelectedFromArray(D,u,h,o):_(u,h,o)&&this.isEqual(D,u));return os(D,f,v)?{formattedValue:this.value(D),id:`${t}${D.getTime()}`,isFocused:this.isEqual(D,i),isSelected:P,isWeekend:!1,isInRange:_(D,h,o),isRangeStart:E,isRangeMid:V,isRangeEnd:w,isRangeSplitEnd:V&&this.isEqual(D,v),isRangeSplitStart:V&&this.isEqual(D,f),isToday:this.isEqual(D,g),title:this.cellTitle(D),value:D}:null})})}isSelectedFromArray(e,t,i,a){let o=!1;return t.forEach(h=>{_(e,i,a)&&this.isEqual(e,h)&&(o=!0)}),o}isEqual(e,t){return!e||!t?!1:r.firstYearOfDecade(e).getFullYear()===r.firstYearOfDecade(t).getFullYear()}isInArray(e,t){if(!t.length)return!1;const i=e.getFullYear();return t[0].getFullYear()<=i&&i<=t[t.length-1].getFullYear()+99}isInRange(e,t,i){const a=r.firstYearOfDecade(e).getFullYear(),o=!t||r.firstYearOfDecade(t).getFullYear()<=a,h=!i||a<=r.firstYearOfDecade(i).getFullYear();return o&&h}isInSameView(e,t){return r.durationInCenturies(e,t)===0}isRangeStart(e){return e.getFullYear()%1e3===0}move(e,t){const i=oi[t];return i?i(e):e}cellTitle(e){return r.firstYearOfDecade(e).getFullYear().toString()}navigationTitle(e){return e?r.firstDecadeOfCentury(e).getFullYear().toString():""}title(e){return e?`${r.firstDecadeOfCentury(e).getFullYear()} - ${r.lastDecadeOfCentury(e).getFullYear()}`:""}rowLength(e){return rt}skip(e,t){return r.durationInCenturies(t,e)}total(e,t){return r.durationInCenturies(e,t)+1}value(e){return e?r.firstYearOfDecade(e).getFullYear().toString():""}viewDate(e,t,i=1){return r.durationInCenturies(e,t)<i?r.addCenturies(e,-1):e}normalize(e,t,i){return e<t&&this.isEqual(e,t)?r.cloneDate(t):e>i&&this.isEqual(e,i)?r.cloneDate(i):e}}const ri=[[]],lt=4,li=3,hi={[b.Left]:s=>r.addYears(s,-1),[b.Up]:s=>r.addYears(s,-5),[b.Right]:s=>r.addYears(s,1),[b.Down]:s=>r.addYears(s,5),[b.PrevView]:s=>r.addDecades(s,-1),[b.NextView]:s=>r.addDecades(s,1),[b.FirstInView]:s=>r.firstYearOfDecade(s),[b.LastInView]:s=>r.lastYearOfDecade(s)};class hs{addToDate(e,t){return r.addDecades(e,t)}datesList(e,t){return Z(0,t).map(i=>r.addDecades(e,i))}data(e){const{cellUID:t,focusedDate:i,isActiveView:a,max:o,min:h,selectedDate:u,selectionRange:c=B,viewDate:p}=e;if(!p)return ri;const m=Z(0,lt),f=r.firstYearOfDecade(p),v=r.lastYearOfDecade(p),g=L();return Z(0,li).map(C=>{const I=r.addYears(f,C*lt);return m.map(T=>{const D=this.normalize(r.addYears(I,T),h,o),E=this.isEqual(D,c.start),w=this.isEqual(D,c.end),V=!E&&!w&&et(D,c),P=a&&(Array.isArray(u)?this.isSelectedFromArray(D,u,h,o):_(u,h,o)&&this.isEqual(D,u));return os(D,f,v)?{formattedValue:this.value(D),id:`${t}${D.getTime()}`,isFocused:this.isEqual(D,i),isSelected:P,isWeekend:!1,isInRange:_(D,h,o),isRangeStart:E,isRangeMid:V,isRangeEnd:w,isRangeSplitEnd:V&&this.isEqual(D,v),isRangeSplitStart:V&&this.isEqual(D,f),isToday:this.isEqual(D,g),title:this.cellTitle(D),value:D}:null})})}isSelectedFromArray(e,t,i,a){let o=!1;return t.forEach(h=>{_(e,i,a)&&this.isEqual(e,h)&&(o=!0)}),o}isEqual(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()}isInArray(e,t){if(!t.length)return!1;const i=e.getFullYear();return t[0].getFullYear()<=i&&i<=t[t.length-1].getFullYear()+9}isInRange(e,t,i){const a=e.getFullYear(),o=!t||t.getFullYear()<=a,h=!i||a<=i.getFullYear();return o&&h}isRangeStart(e){return e.getFullYear()%100===0}isInSameView(e,t){return r.durationInDecades(e,t)===0}move(e,t){const i=hi[t];return i?i(e):e}cellTitle(e){return e.getFullYear().toString()}navigationTitle(e){return e?r.firstYearOfDecade(e).getFullYear().toString():""}title(e){return e?`${r.firstYearOfDecade(e).getFullYear()} - ${r.lastYearOfDecade(e).getFullYear()}`:""}rowLength(e){return lt}skip(e,t){return r.durationInDecades(t,e)}total(e,t){return r.durationInDecades(e,t)+1}value(e){return e?e.getFullYear().toString():""}viewDate(e,t,i=1){return r.durationInDecades(e,t)<i?r.addDecades(e,-1):e}normalize(e,t,i){return e<t&&this.isEqual(e,t)?r.cloneDate(t):e>i&&this.isEqual(e,i)?r.cloneDate(i):e}}const ci=[[]],ht=7,ui=6,di=6,pi=0,mi={[b.Left]:s=>r.addDays(s,-1),[b.Up]:s=>r.addWeeks(s,-1),[b.Right]:s=>r.addDays(s,1),[b.Down]:s=>r.addWeeks(s,1),[b.PrevView]:s=>r.addMonths(s,-1),[b.NextView]:s=>r.addMonths(s,1),[b.FirstInView]:s=>r.firstDayOfMonth(s),[b.LastInView]:s=>r.lastDayOfMonth(s)};class cs{constructor(e){this.intl=e}addToDate(e,t){return r.addMonths(e,t)}datesList(e,t){return Z(0,t).map(i=>r.addMonths(e,i))}data(e){const{cellUID:t,focusedDate:i,isActiveView:a,max:o,min:h,selectedDate:u,selectionRange:c=B,viewDate:p}=e;if(!p)return ci;const m=r.firstDayOfMonth(p),f=r.lastDayOfMonth(p),v=-1,g=r.dayOfWeek(m,this.intl.firstDay(),v),C=Z(0,ht),I=L();return Z(0,ui).map(T=>{const D=r.addDays(g,T*ht);return C.map(E=>{const w=this.normalize(r.addDays(D,E),h,o);if(w<m||w>f)return null;const V=this.isEqual(w,c.start),P=this.isEqual(w,c.end),x=!V&&!P&&et(w,c),O=a&&(Array.isArray(u)?this.isSelectedFromArray(w,u,h,o):_(u,h,o)&&this.isEqual(w,u));return{formattedValue:this.value(w),id:`${t}${w.getTime()}`,isFocused:this.isEqual(w,i),isSelected:O,isInRange:_(w,h,o),isWeekend:this.isWeekend(w),isRangeStart:V,isRangeMid:x,isRangeEnd:P,isRangeSplitStart:x&&this.isEqual(w,m),isRangeSplitEnd:x&&this.isEqual(w,f),isToday:this.isEqual(w,I),title:this.cellTitle(w),value:w}})})}isEqual(e,t){return!e||!t?!1:r.getDate(e).getTime()===r.getDate(t).getTime()}isSelectedFromArray(e,t,i,a){let o=!1;return t.forEach(h=>{_(e,i,a)&&this.isEqual(e,h)&&(o=!0)}),o}isInArray(e,t){return!!t.length&&r.firstDayOfMonth(t[0])<=e&&e<=r.lastDayOfMonth(t[t.length-1])}isInRange(e,t,i){const a=r.getDate(e),o=!t||r.getDate(t)<=a,h=!i||a<=r.getDate(i);return o&&h}isInSameView(e,t){return r.durationInMonths(e,t)===0}isRangeStart(e){return!e.getMonth()}move(e,t){const i=mi[t];return i?i(e):e}cellTitle(e){return this.intl.formatDate(e,"D")}navigationTitle(e){return e?this.isRangeStart(e)?e.getFullYear().toString():this.abbrMonthNames()[e.getMonth()]:""}title(e){return`${this.wideMonthNames()[e.getMonth()]} ${e.getFullYear()}`}rowLength(e){return ht+(e?1:0)}skip(e,t){return r.durationInMonths(t,e)}total(e,t){return r.durationInMonths(e,t)+1}value(e){return e?e.getDate().toString():""}viewDate(e,t,i=1){return r.durationInMonths(e,t)<i?r.addMonths(e,-1):e}isWeekend(e){const t=e.getDay();return t===di||t===pi}abbrMonthNames(){return this.intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(e,t,i){return e<t&&this.isEqual(e,t)?r.getDate(t):e>i&&this.isEqual(e,i)?r.getDate(i):e}wideMonthNames(){return this.intl.dateFormatNames({nameType:"wide",type:"months",standAlone:!0})}}const fi=[[]],ct=4,gi=3,vi=s=>s>4?-5:s<2?-2:-7,wi=s=>s<7?5:s<10?7:2,Di={[b.Left]:s=>r.addMonths(s,-1),[b.Up]:s=>r.addMonths(s,vi(s.getMonth())),[b.Right]:s=>r.addMonths(s,1),[b.Down]:s=>r.addMonths(s,wi(s.getMonth())),[b.PrevView]:s=>r.addYears(s,-1),[b.NextView]:s=>r.addYears(s,1),[b.FirstInView]:s=>r.firstMonthOfYear(s),[b.LastInView]:s=>r.lastMonthOfYear(s)};class us{constructor(e){this._intl=e}addToDate(e,t){return r.addYears(e,t)}datesList(e,t){return Z(0,t).map(i=>r.addYears(e,i))}data(e){const{cellUID:t,focusedDate:i,isActiveView:a,max:o,min:h,selectedDate:u,selectionRange:c=B,viewDate:p}=e;if(!p)return fi;const m=this.abbrMonthNames(),f=r.firstMonthOfYear(p),v=r.lastMonthOfYear(p),g=f.getFullYear(),C=Z(0,ct),I=L();return Z(0,gi).map(T=>{const D=r.addMonths(f,T*ct);return C.map(E=>{const w=this.normalize(r.addMonths(D,E),h,o);if(g<w.getFullYear())return null;const V=this.isEqual(w,c.start),P=this.isEqual(w,c.end),x=!V&&!P&&et(w,c),O=a&&(Array.isArray(u)?this.isSelectedFromArray(w,u,h,o):_(u,h,o)&&this.isEqual(w,u));return{formattedValue:m[w.getMonth()],id:`${t}${w.getTime()}`,isFocused:this.isEqual(w,i),isSelected:O,isInRange:_(w,h,o),isWeekend:!1,isRangeStart:V,isRangeMid:x,isRangeEnd:P,isRangeSplitEnd:x&&this.isEqual(w,v),isRangeSplitStart:x&&this.isEqual(w,f),isToday:this.isEqual(w,I),title:this.cellTitle(w),value:w}})})}isSelectedFromArray(e,t,i,a){let o=!1;return t.forEach(h=>{_(e,i,a)&&this.isEqual(e,h)&&(o=!0)}),o}isEqual(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}isInArray(e,t){if(!t.length)return!1;const i=e.getFullYear();return t[0].getFullYear()<=i&&i<=t[t.length-1].getFullYear()}isInRange(e,t,i){const a=r.createDate(e.getFullYear(),e.getMonth(),1),o=!t||r.createDate(t.getFullYear(),t.getMonth(),1)<=a,h=!i||a<=r.createDate(i.getFullYear(),i.getMonth(),1);return o&&h}isInSameView(e,t){return r.durationInYears(e,t)===0}isRangeStart(e){return e.getFullYear()%10===0}move(e,t){const i=Di[t];return i?i(e):e}cellTitle(e){return`${e.getFullYear()} ${this.value(e)}`}navigationTitle(e){return this.title(e)}title(e){return e?e.getFullYear().toString():""}rowLength(e){return ct}skip(e,t){return r.durationInYears(t,e)}total(e,t){return r.durationInYears(e,t)+1}value(e){return e?this.abbrMonthNames()[e.getMonth()]:""}viewDate(e,t,i=1){return r.durationInYears(e,t)<i?r.addYears(e,-1):e}abbrMonthNames(){return this._intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(e,t,i){return e<t&&this.isEqual(e,t)?r.cloneDate(t):e>i&&this.isEqual(e,i)?r.cloneDate(i):e}}const bi={[S.month]:cs,[S.year]:us,[S.decade]:hs,[S.century]:ls},yi=(s,e)=>{const t=S[S[s+e]];return t!==void 0?t:s};class Et{constructor(e){this.bottom=S.month,this.top=S.century,this.onViewChanged=e}configure(e,t){this.bottom=e,this.top=t}service(e,t){return new bi[`${e}`](t)}moveDown(e,t){this.move(e,-1,t)}moveUp(e,t){this.move(e,1,t)}moveToBottom(e){e!==this.bottom&&this.onViewChanged({view:this.bottom})}canMoveDown(e){return this.bottom<e}canMoveUp(e){return e<this.top}clamp(e){return e<this.bottom?this.bottom:e>this.top?this.top:e}move(e,t,i){const a=this.clamp(yi(e,t));a!==e&&this.onViewChanged({view:a},i)}}let ds=class{constructor(){this.calendarHeight=0,this.headerHeight=0,this.monthViewHeight=0,this.yearViewHeight=0,this.decadeViewHeight=0,this.centuryViewHeight=0,this.navigationItemHeight=0,this.scrollableContentHeight=0,this.scrollableYearContentHeight=0,this.calendarWidth=0,this.monthViewWidth=0,this.yearViewWidth=0,this.decadeViewWidth=0,this.centuryViewWidth=0,this.scrollableContentWidth=0,this.didCalculate=!1,this.hostContainer=null}ensureHeights(){this.calendarHeight===void 0&&this.calculateHeights()}calculateHeights(e){if(!d.canUseDOM)return;const t=W("div"),i=W("ul"),a=W("li"),o=W("td"),h=W("th"),u=W("tr"),c=W("tbody"),p=W("thead"),m=W("table"),f=()=>t(`
6
- <span class="k-button k-button-md k-button-rectangle k-button-solid k-button-solid-base k-button-flat k-calendar-title">
7
- <span className="k-button-text">March 2017</span>
8
- </span>
9
- <span class="k-spacer"></span>
10
- <span class="k-calendar-nav k-hstack"><button class="k-calendar-nav-today">TODAY</button></span>
11
- `,"k-calendar-header k-hstack"),v=()=>m([p([u([h("MO","k-calendar-th")],"k-calendar-tr")],"k-calendar-thead")],"k-calendar-table k-calendar-weekdays"),g=(y,R)=>new Array(y).fill("1").map(R),C=(y,R=1)=>m([c([u([o("1","k-calendar-td k-alt")])].concat(g(y,()=>u(g(R,fe=>o(`<span class="k-link">${fe}</span>`,"k-calendar-td")),"k-calendar-tr"))),"k-calendar-tbody")],"k-calendar-table"),I=y=>t(y,"k-content k-scrollable"),T=(y,R,fe)=>t(fe?[f(),v(),I([y,y])]:[f(),I([y,y])],R,{left:"-10000px",position:"absolute"}),D=(()=>{let y;return()=>d.canUseDOM?(y||(y=t([I([i([a("<span>FEB</span>")])])],"k-calendar-navigation",{left:"0px",position:"absolute"})),y):null})(),E=({cells:y,rows:R},fe,Ks)=>{let nt;return()=>d.canUseDOM?(nt||(nt=T(C(R,y),fe,Ks)),nt):null},w=y=>y.querySelector(".k-scrollable"),A=y=>{const R=w(y);return R.className=`${R.className} k-scrollable-horizontal`,y},V=E({cells:7,rows:6},"k-calendar-view k-calendar-monthview k-vstack",!0),P=E({cells:5,rows:3},"k-calendar-view k-calendar-yearview",!1),H=E({cells:5,rows:2},"k-calendar-view k-calendar-decadeview",!1),x=()=>A(V()),O=()=>A(P()),G=()=>A(H()),U=y=>parseFloat(window.getComputedStyle(y).height)||y.offsetHeight,le=y=>{const R=window.getComputedStyle(y);return parseFloat(R.width)+parseFloat(R.paddingLeft)+parseFloat(R.paddingRight)||y.offsetWidth},me=y=>y.querySelector("tbody");this.didCalculate=!0,e&&(this.hostContainer=e),this.batch(V(),y=>{const R=me(y);this.calendarHeight=U(y),this.monthViewHeight=U(R),this.headerHeight=U(R.children[0]),this.scrollableContentHeight=U(w(y))}),this.batch(x(),y=>{const R=me(y);this.calendarWidth=le(y),this.monthViewWidth=le(R),this.scrollableContentWidth=le(w(y))}),this.batch(P(),y=>{this.yearViewHeight=U(me(y)),this.scrollableYearContentHeight=U(w(y))}),this.batch(O(),y=>{this.yearViewWidth=le(me(y))}),this.batch(H(),y=>{this.decadeViewHeight=U(me(y)),this.centuryViewHeight=this.decadeViewHeight}),this.batch(G(),y=>{this.decadeViewWidth=le(me(y)),this.centuryViewWidth=this.decadeViewWidth}),this.batch(D(),y=>{this.navigationItemHeight=U(y.querySelector("li"))})}viewHeight(e){return this.viewDimension(e,"height")}viewWidth(e){return this.viewDimension(e,"width")}viewDimension(e,t){const i=t==="height"?"ViewHeight":"ViewWidth";switch(e){case S.month:return this[`month${i}`];case S.year:return this[`year${i}`];case S.decade:return this[`decade${i}`];case S.century:return this[`century${i}`];default:return 1}}batch(e,t){const i=this.hostContainer||document.body,a=i.appendChild(e);t(a),i.removeChild(a)}};const ki={33:b.PrevView,34:b.NextView,35:b.LastInView,36:b.FirstInView,37:b.Left,38:b.Up,39:b.Right,40:b.Down,"meta+38":b.UpperView,"meta+40":b.LowerView};class Vt{constructor(e){this.bus=e}action(e){const t=`${e.ctrlKey||e.metaKey?"meta+":""}${e.keyCode}`;return ki[t]}move(e,t,i,a,o){return a?t===b.UpperView&&this.bus.canMoveUp(i)?(this.bus.moveUp(i,o),e):t===b.LowerView&&this.bus.canMoveDown(i)?(this.bus.moveDown(i,o),e):a.move(e,t):e}}const Si=s=>e=>Math.floor(e/s),Ci=s=>e=>e*s;class ps{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=Si(t),this.powerByMagnitude=Ci(t)}sync(e,t,i){if(!(!e||!t)){if(this.navigator=e,this.view=t,i.target===this.navigator.element){if(this.monthScrolled){this.monthScrolled=!1;return}this.navScrolled=!0,this.scrollSiblingOf(this.navigator.element)}if(i.target===this.view.element){if(this.navScrolled){this.navScrolled=!1;return}this.monthScrolled=!0,this.scrollSiblingOf(this.view.element)}}}scrollSiblingOf(e){const t=this.siblingComponent(e),i=this.calculateScroll(t,e.scrollTop);t.scrollTo(i)}siblingComponent(e){return this.navigator.element===e?this.view:this.navigator}calculateScroll(e,t){const i=e===this.navigator?this.divideByMagnitude:this.powerByMagnitude;return i?i(t):0}}class ms{constructor(e){this.intl=e}getWeekNames(e=!1){const t=rs(this.intl.dateFormatNames({nameType:"short",type:"days"}),this.intl.firstDay());return e?[""].concat(t):t}}const qt=s=>l.createElement("td",{key:s,className:"k-calendar-td"}," "),fs=class extends l.Component{constructor(){super(...arguments),this.intl=null,this.weekService=null,this.buildWeekNumber=(s,e)=>{if(!this.firstDate(s))return qt(`week-cell-${e}`);const i=this.firstDate(s),a=this.getWeekNumber(i),o=`kendo-react-calendar-week-cell-${a}`,h={className:"k-alt",value:a,firstDate:i};return this.props.weekCell?l.createElement(this.props.weekCell,{...h,key:o},a):l.createElement(ns,{...h,key:o},a)},this.buildRow=s=>s.map((e,t)=>{if(!e)return qt(t);const i={"aria-selected":e.isSelected},a=`kendo-react-calendar-cell-${e.value.getTime()}`,o={...i,...e,isDisabled:!e.isInRange,view:this.props.activeView,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave};return this.props.cell?l.createElement(this.props.cell,{...o,key:a},e.formattedValue):l.createElement(is,{...o,key:a},e.formattedValue)}),this.firstDate=s=>{const e=this.firstWeekDateContext(s);return e?e.value:null},this.firstWeekDateContext=s=>{if(!this.weekNumber)return null;let e=0,t=s[e];for(;!t&&e<s.length;)t=s[++e];return t},this.handleClick=(s,e)=>{const{onChange:t}=this.props;if(t&&e){const i={value:r.cloneDate(s),target:this,nativeEvent:e&&e.nativeEvent,syntheticEvent:e};t.call(void 0,i)}},this.handleMouseEnter=s=>{const{onCellEnter:e}=this.props;e&&e.call(void 0,r.cloneDate(s))},this.handleMouseLeave=s=>{const{onCellLeave:e}=this.props;e&&e.call(void 0,r.cloneDate(s))}}get min(){return this.props.min}get max(){return this.props.max}get isHorizontal(){return this.props.direction==="horizontal"}get isMonthView(){return this.props.activeView===S.month}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===S.month)}get selectedDate(){return this.props.selectedDate!==void 0?this.props.selectedDate:fs.defaultProps.selectedDate}render(){this.intl=k.provideIntlService(this),this.weekService=new ms(this.intl);const s=this.weekService.getWeekNames(this.weekNumber),e=this.props.service.rowLength(this.weekNumber),t=this.props.service.title(this.props.viewDate),i=L(),a=q(this.props.viewDate,i),o=this.props.service.data({cellUID:this.props.cellUID,min:this.min,max:this.max,focusedDate:this.props.focusedDate,isActiveView:!this.props.bus.canMoveDown(this.props.activeView),selectedDate:this.selectedDate,selectionRange:this.props.selectionRange,viewDate:a});return l.createElement(l.Fragment,null,this.isMonthView&&this.isHorizontal&&l.createElement("thead",{role:"rowgroup",className:"k-calendar-thead"},l.createElement("tr",{role:"row",className:"k-calendar-tr"},s.map((h,u)=>l.createElement("th",{key:u,className:"k-calendar-th"},h)))),l.createElement("tbody",{role:"rowgroup",className:"k-calendar-tbody"},!this.isHorizontal&&l.createElement("tr",{role:"presentation",className:"k-calendar-tr"},l.createElement("th",{scope:"col",colSpan:e,className:"k-calendar-caption"},t)),o.map((h,u)=>l.createElement("tr",{role:"row",className:"k-calendar-tr",key:u},this.weekNumber&&this.buildWeekNumber(h,u),this.buildRow(h)))))}getWeekNumber(s){return!this.weekNumber||!this.intl?null:r.weekInYear(s,this.intl.firstDay())}};let Fe=fs;Fe.propTypes={activeRangeEnd:n.oneOf(["start","end",null]),activeView:n.number.isRequired,cellUID:n.string.isRequired,direction:n.oneOf(["horizontal","vertical"]),focusedDate:n.instanceOf(Date).isRequired,max:n.instanceOf(Date).isRequired,min:n.instanceOf(Date).isRequired,onChange:n.func,selectedDate:n.oneOfType([n.instanceOf(Date),n.arrayOf(n.instanceOf(Date))]),showWeekNumbers:n.bool,viewDate:n.instanceOf(Date).isRequired};Fe.defaultProps={direction:"vertical",selectedDate:L(),showWeekNumbers:!1};k.registerForIntl(Fe);class gs extends l.PureComponent{render(){const{view:e,...t}=this.props;return l.createElement(N.Button,{type:"button",fillMode:"flat",...t},this.props.children)}}const ze=class extends l.Component{constructor(){super(...arguments),this.getTitle=()=>{if(!this.props.currentDate)return"";const s=this.rangeLength-1,e=this.props.service.title(this.props.currentDate),t=this.props.service.addToDate(this.props.currentDate,s);return s<1||!this.props.service.isInRange(t,this.min,this.max)?e:`${e} - ${this.props.service.title(t)}`},this.handleTitleClick=s=>{this.canMoveUp&&this.props.bus.moveUp(this.props.activeView,s)}}get min(){return this.props.min!==void 0?this.props.min:ze.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:ze.defaultProps.max}get rangeLength(){return this.props.rangeLength!==void 0?this.props.rangeLength:ze.defaultProps.rangeLength}get canMoveUp(){return this.props.bus.canMoveUp(this.props.activeView)}render(){const s=this.getTitle(),e=d.classNames("k-calendar-title"),t={children:s,value:s,view:this.props.activeView,className:e,onClick:this.handleTitleClick,disabled:!this.canMoveUp},i=this.props.headerTitle?l.createElement(this.props.headerTitle,{...t},s):l.createElement(gs,{...t},s);return l.createElement("div",{className:d.classNames("k-calendar-header",{"k-vstack":this.props.verticalView,"k-hstack":!this.props.verticalView})},i,l.createElement("span",{className:"k-spacer"}),l.createElement("span",{className:"k-calendar-nav k-hstack"},this.props.commands))}};let xe=ze;xe.propTypes={activeView:n.number.isRequired,currentDate:n.instanceOf(Date).isRequired,max:n.instanceOf(Date).isRequired,min:n.instanceOf(Date).isRequired,rangeLength:n.number};xe.defaultProps={rangeLength:1,min:te,max:se};k.registerForLocalization(xe);const gt="multiviewcalendar.prevView",vt="multiviewcalendar.nextView",we="dateinput.increment",De="dateinput.decrement",$e="calendar.today",je="datepicker.toggleCalendar",be="daterangepicker.swapStartEnd",Ze="daterangepicker.start",Ge="daterangepicker.end",Xe="daterangepicker.separator",ye="datetimepicker.toggleDateTimeSelector",wt="timepicker.now",Dt="timepicker.selectNow",Je="timepicker.cancel",Ne="timepicker.set",bt="timepicker.toggleTimeSelector",qe="timepicker.toggleClock",yt="datetimepicker.date",kt="datetimepicker.time",Re="datetimepicker.cancel",_e="datetimepicker.set",St="daterangepicker.cancel",Ct="daterangepicker.set",M={[$e]:"TODAY",[wt]:"NOW",[Ne]:"Set",[Je]:"Cancel",[yt]:"Date",[kt]:"Time",[Re]:"Cancel",[_e]:"Set",[St]:"Cancel",[Ct]:"Set",[Ze]:"Start",[Ge]:"End",[Xe]:" ",[Dt]:"Select Now",[bt]:"Toggle TimeSelector",[qe]:"Toggle Clock",[we]:"Increase value",[De]:"Decrease value",[je]:"Toggle calendar",[gt]:"Navigate to previous view",[vt]:"Navigate to next view",[be]:"Swap start and end values",[ye]:"Toggle date-time selector"},xt=class extends l.Component{constructor(){super(...arguments),this.localization=null,this.handleClick=s=>{if(this.todayIsInRange&&this.props.onClick){const e={syntheticEvent:s,nativeEvent:s.nativeEvent,value:K(L(),this.min,this.max),target:this,isTodayClick:!0};this.props.onClick.call(void 0,e)}}}get min(){return this.props.min!==void 0?this.props.min:xt.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:xt.defaultProps.max}get todayIsInRange(){return _(L(),r.getDate(this.min),r.getDate(this.max))}render(){this.localization=k.provideLocalizationService(this);const s=this.localization.toLanguageString($e,M[$e]),e=d.classNames("k-calendar-nav-today",{"k-disabled":this.props.disabled});return l.createElement(N.Button,{className:e,onClick:this.handleClick,tabIndex:this.props.tabIndex,fillMode:"flat"},s)}};let Ie=xt;Ie.propTypes={max:n.instanceOf(Date).isRequired,min:n.instanceOf(Date).isRequired,onClick:n.func,disabled:n.bool};Ie.defaultProps={min:te,max:se};k.registerForLocalization(Ie);const xi=5,vs=class extends l.Component{constructor(s){super(s),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.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 t=K(this.props.focusedDate,this.props.min,this.props.max),i=this.props.service.skip(t,this.props.min);this.virtualization.scrollToIndex(i)}},this.buildMonthView=(e,t)=>l.createElement("table",{key:"calendar-view-list-weekdays",className:"k-calendar-table k-calendar-weekdays",role:"grid",tabIndex:this.props.tabIndex},l.createElement("colgroup",null,e.map((i,a)=>l.createElement("col",{key:a}))),l.createElement("thead",{className:"k-calendar-thead"},l.createElement("tr",{className:"k-calendar-tr"},t.map((i,a)=>l.createElement("th",{key:a,className:"k-calendar-th"},i))))),this.buildDates=(e,t)=>{const i=this.props.cellUID;return l.createElement("table",{className:"k-calendar-table",ref:a=>this.table=a,role:"grid",tabIndex:this.props.tabIndex,"aria-activedescendant":i+this.props.focusedDate.getTime()},l.createElement("colgroup",null,e.map((a,o)=>l.createElement("col",{key:o}))),t.map(a=>l.createElement(Fe,{ref:o=>{this.calendarView||(this.calendarView=o)},key:a.getTime(),activeView:this.props.activeView,viewDate:a,min:this.props.min,max:this.props.max,cellUID:i,focusedDate:this.props.focusedDate,cell:this.props.cell,selectedDate:this.props.value,showWeekNumbers:this.weekNumber,onChange:this.handleDateChange,bus:this.props.bus,service:this.props.service,weekCell:this.props.weekCell})))},this.calculateHeights=()=>{if(!this.props.dom)return;const e=this.props.activeView===S.month?this.props.dom.scrollableContentHeight:this.props.dom.scrollableYearContentHeight;this.bottomOffset=e-this.props.dom.viewHeight(this.props.activeView),this.viewOffset=-1*this.props.dom.headerHeight,this.viewHeight=this.props.dom.viewHeight(this.props.activeView)||1},this.getTake=(e,t)=>Math.min(t-e,this.take),this.handleScrollAction=({index:e,scrollAction:t,pageAction:i})=>{const a=i?i.skip:this.state.skip;if((this.state.index!==e||this.state.skip!==a)&&this.setState({index:e,skip:a}),this.table&&t){const o=`translateY(${t.offset}px)`;this.table.style.transform=o}},this.handleTodayClick=e=>{this.shouldScroll=!0,this.handleDateChange.call(void 0,e,!0)},this.handleDateChange=(e,t=!1)=>{const{onChange:i}=this.props;if(i){const a={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:r.cloneDate(e.value),target:this,isTodayClick:t};i.call(void 0,a)}},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(){this.intl=k.provideIntlService(this);const s=rs(this.intl.dateFormatNames({nameType:"short",type:"days"}),this.intl.firstDay());return this.weekNumber?[""].concat(s):s}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===S.month)}get take(){return this.props.take!==void 0?this.props.take:vs.defaultProps.take}get animate(){return!!(this.props.smoothScroll&&this.animateToIndex)}get todayIsInRange(){return _(L(),r.getDate(this.props.min),r.getDate(this.props.max))}componentDidUpdate(s,e){this.shouldScroll=!1,this.indexToScroll!==void 0&&this.virtualization&&this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](this.indexToScroll),this.isActive&&this.focusActiveDate(),this.lastView=this.props.activeView,this.indexToScroll=void 0}render(){this.calculateHeights();const s=this.lastView!==this.props.activeView,e=K(this.props.focusedDate,this.props.min,this.props.max),t=s?this.props.service.skip(e,this.props.min):this.state.skip,i=this.props.service.total(this.props.min,this.props.max),a=this.getTake(t,i),o=this.props.service.addToDate(this.props.min,t),h=this.props.service.addToDate(this.props.min,this.state.index),u=new Array(this.props.service.rowLength(this.weekNumber)).fill(""),c=this.props.activeView!==this.lastView;this.animateToIndex=!c,(c||!r.isEqualDate(this.lastFocus,e)||this.shouldScroll||!this.props.shouldScroll||this.props.shouldScroll())&&(this.indexToScroll=this.props.service.skip(e,this.props.min)),this.lastFocus=e;const p=d.classNames("k-calendar-view k-vstack",{"k-calendar-monthview":this.props.activeView===S.month,"k-calendar-yearview":this.props.activeView===S.year,"k-calendar-decadeview":this.props.activeView===S.decade,"k-calendar-centuryview":this.props.activeView===S.century}),m=this.buildDates(u,this.props.service.datesList(o,a)),f=l.createElement(l.Fragment,null,l.createElement(xe,{key:"calendar-view-list-header",currentDate:h,min:this.props.min,max:this.props.max,activeView:this.props.activeView,bus:this.props.bus,service:this.props.service,headerTitle:this.props.headerTitle,commands:l.createElement(l.Fragment,null,l.createElement(Ie,{min:this.props.min,max:this.props.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange,tabIndex:this.props.tabIndex}))}),this.props.activeView===S.month&&this.buildMonthView(u,this.weekNames),l.createElement(Ce,{key:"calendar-view-list-content",skip:t,take:this.take,total:i,itemHeight:this.viewHeight,topOffset:this.viewOffset,bottomOffset:this.bottomOffset,scrollOffsetSize:this.viewOffset,maxScrollDifference:this.viewHeight,onScroll:this.props.onScroll,onScrollAction:this.handleScrollAction,onMount:this.handleVirtualizationMount,children:m,tabIndex:this.props.tabIndex}));return l.createElement("div",{ref:v=>{this._element=v},className:p},this.props.dom.didCalculate?f:null)}};let Le=vs;Le.propTypes={activeView:n.number.isRequired,bottomOffset:n.number,cellUID:n.string.isRequired,focusedDate:n.instanceOf(Date).isRequired,max:n.instanceOf(Date).isRequired,min:n.instanceOf(Date).isRequired,onChange:n.func,showWeekNumbers:n.bool,smoothScroll:n.bool,take:n.number,value:n.instanceOf(Date),viewHeight:n.number,viewOffset:n.number,tabIndex:n.number};Le.defaultProps={take:xi,showWeekNumbers:!1,smoothScroll:!0};k.registerForIntl(Le);class ws extends l.Component{constructor(){super(...arguments),this.handleClick=e=>{const{onClick:t,value:i}=this.props;t&&t.call(void 0,i,e)}}render(){const{isRangeStart:e,value:t,text:i,...a}=this.props;return l.createElement("li",{...a,onClick:this.handleClick},l.createElement("span",{className:d.classNames({"k-calendar-navigation-marker":e})},this.props.children))}}const Ii=30,Ds=class extends l.Component{constructor(s){super(s),this.virtualization=null,this.list=null,this.itemHeight=0,this.topOffset=0,this.maxViewHeight=0,this.bottomOffset=0,this.handleVirtualizationMount=i=>{if(this.virtualization=i,this.virtualization&&this.list){this.list.style.transform=`translateY(${this.topOffset}px)`;const a=K(this.props.focusedDate,this.props.min,this.props.max),o=this.props.service.skip(a,this.props.min);this.virtualization.scrollToIndex(o)}},this.buildNavigationItem=i=>{const a=this.props.service.navigationTitle(i),o=this.props.service.isRangeStart(i),h=`kendo-react-calendar-nav-item-${i.getTime()}`,u={text:a,value:i,isRangeStart:o,view:this.props.activeView,onClick:this.handleDateChange};return this.props.navigationItem?l.createElement(this.props.navigationItem,{...u,key:h},a):l.createElement(ws,{...u,key:h},a)},this.calculateHeights=()=>{const i=this.props.dom.calendarHeight;this.itemHeight=this.props.dom.navigationItemHeight||1,this.maxViewHeight=this.props.dom.monthViewHeight,this.topOffset=(i-this.itemHeight)/2,this.bottomOffset=i-this.itemHeight},this.handleDateChange=(i,a)=>{const{onChange:o}=this.props;if(o&&a){const h={value:r.cloneDate(i),target:this,nativeEvent:a&&a.nativeEvent,syntheticEvent:a};o.call(void 0,h)}},this.handleScrollAction=({scrollAction:i,pageAction:a})=>{const o=a?a.skip:this.state.skip;if(this.state.skip!==o&&this.setState({skip:o}),this.list&&i){const h=`translateY(${i.offset}px)`;this.list.style.transform=h}},this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate;const e=this.props.service.skip(this.props.focusedDate,this.props.min),t=this.props.service.total(this.props.min,this.props.max);this.state={skip:e-this.getTake(e,t)>0?e:0}}get take(){return this.props.take!==void 0?this.props.take:Ds.defaultProps.take}componentDidUpdate(s,e){this.indexToScroll!==void 0&&this.virtualization&&this.virtualization.scrollToIndex(this.indexToScroll),this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate,this.indexToScroll=void 0}render(){this.calculateHeights();const s=this.lastView!==this.props.activeView,e=K(this.props.focusedDate,this.props.min,this.props.max),t=s?this.props.service.skip(e,this.props.min):this.state.skip,i=this.props.service.total(this.props.min,this.props.max),a=this.getTake(t,i),o=this.props.service.addToDate(this.props.min,t),h=this.props.service.datesList(o,a);(this.props.activeView!==this.lastView||!r.isEqual(e,this.lastFocus))&&(this.indexToScroll=this.props.service.skip(e,this.props.min));const u=l.createElement(Ce,{skip:t,take:this.take,total:i,itemHeight:this.itemHeight,topOffset:this.topOffset,bottomOffset:this.bottomOffset,onScroll:this.props.onScroll,maxScrollDifference:this.maxViewHeight,onScrollAction:this.handleScrollAction,onMount:this.handleVirtualizationMount,tabIndex:this.props.tabIndex},l.createElement("ul",{ref:c=>{this.list=c},className:"k-reset"},h.map(c=>this.buildNavigationItem(c))));return l.createElement("div",{className:"k-calendar-navigation"},l.createElement("span",{className:"k-calendar-navigation-highlight"}),this.props.dom.didCalculate?u:null)}getTake(s,e){return Math.min(e-s,this.take)}};let Ot=Ds;Ot.propTypes={activeView:n.number.isRequired,focusedDate:n.instanceOf(Date).isRequired,max:n.instanceOf(Date).isRequired,min:n.instanceOf(Date).isRequired,onChange:n.func,take:n.number,tabIndex:n.number};Ot.defaultProps={take:Ii};const ut=s=>s?s.virtualization:null,Wt=(s=ne.defaultProps.min,e=ne.defaultProps.max,t,i)=>i!==void 0?i!==null&&_(r.getDate(i),s,e)?i:null:t!==null&&_(r.getDate(t),s,e)?t:null,ie=class extends l.Component{constructor(s){super(s),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=t=>{this.scrollSyncService&&this.scrollSyncService.sync(ut(this.Navigation),ut(this.calendarViewList),t)},this.handleNavigationChange=t=>{if(this.props.disabled)return;this.didNavigationChange=!0;const i=r.cloneDate(t.value);this.setState({focusedDate:i})},this.handleViewChange=({view:t})=>{this.scrollSyncService&&this.scrollSyncService.configure(t),this.setState({activeView:t})},this.handleDateChange=t=>{const i=r.cloneDate(t.value),a=r.cloneDate(t.value),o=this.bus.canMoveDown(this.state.activeView);if(this.props.disabled)return;if(o)if(t.isTodayClick)this.bus.moveToBottom(this.state.activeView);else{this.bus.moveDown(this.state.activeView,t.syntheticEvent),this.setState({focusedDate:a});return}this.setState({value:i,focusedDate:a}),this.valueDuringOnChange=i;const{onChange:h}=this.props;if(h){const u={syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:i,target:this};h.call(void 0,u)}this.valueDuringOnChange=void 0},this.handleFocus=t=>{if(this.isActive=!0,!this.calendarViewList)return;this.calendarViewList.focusActiveDate();const{onFocus:i}=this.props;i&&i.call(void 0,t)},this.handleBlur=t=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:i}=this.props;i&&i.call(void 0,t)},this.handleKeyDown=t=>{const{keyCode:a,ctrlKey:o,metaKey:h}=t;if(!(!this.focusedDate||!this.service)){if(a===84&&this.setState({focusedDate:L()}),(o||h)&&(a===d.Keys.left||a===d.Keys.right)){if(this.props.disabled)return;this.didNavigationChange=!0,this.focusedDate.getDate()===31&&this.focusedDate.setDate(30);const u=a===d.Keys.left?this.focusedDate.getMonth()-1:this.focusedDate.getMonth()+1,c=new Date(this.focusedDate.setMonth(u)),p=r.cloneDate(c);this.setState({focusedDate:p})}if(a===d.Keys.enter){if(this.value!==null&&r.isEqualDate(this.focusedDate,this.value)){const c=K(this.focusedDate,this.min,this.max);ut(this.calendarViewList).scrollToIndex(this.service.skip(c,this.min))}const u={syntheticEvent:t,nativeEvent:t.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(u)}else{const u=K(this.navigation.move(this.focusedDate,this.navigation.action(t),this.state.activeView,this.service,t),this.min,this.max);if(r.isEqualDate(this.focusedDate,u))return;this.setState({focusedDate:u})}t.preventDefault()}},this.handleMouseDown=t=>{t.preventDefault()},this.handleClick=t=>{this._element&&this._element.focus({preventScroll:!0})},d.validatePackage(Se);const e=Wt(this.min,this.max,this.props.defaultValue||ie.defaultProps.defaultValue,this.props.value);this.state={value:e,activeView:Ye(S[s.defaultActiveView],this.bottomView,this.topView),focusedDate:K(s.focusedDate||e||L(),this.min,this.max)},this.dom=new ds,this.bus=new Et(this.handleViewChange),this.navigation=new Vt(this.bus),this.oldValue=e}get cellUID(){return this.props.id+"-cell-uid"}get id(){return this.props.id+"-id"}get element(){return this._element}get value(){return this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value}get min(){return r.getDate(this.props.min!==void 0?this.props.min:ie.defaultProps.min)}get max(){return r.getDate(this.props.max!==void 0?this.props.max:ie.defaultProps.max)}get bottomView(){return S[this.props.bottomView!==void 0?this.props.bottomView:ie.defaultProps.bottomView]}get topView(){return S[this.props.topView!==void 0?this.props.topView:ie.defaultProps.topView]}componentDidMount(){Promise.resolve().then(()=>{d.setScrollbarWidth(),this._element&&(this.dom.calculateHeights(this._element),this.scrollSyncService=new ps(this.dom),this.scrollSyncService.configure(this.state.activeView),this.forceUpdate())})}componentDidUpdate(s,e){d.setScrollbarWidth(),e.activeView!==this.state.activeView&&this.scrollSyncService&&this.scrollSyncService.configure(this.state.activeView),this.calendarViewList&&(this.isActive?this.calendarViewList.focusActiveDate:this.calendarViewList.blurActiveDate)(),this.didNavigationChange=!1,this.isActive&&(this.oldValue=this.value)}render(){this.props._ref&&this.props._ref(this);const s=this.value!==null&&this.oldValue!==null?!r.isEqualDate(this.value,this.oldValue):this.value!==this.oldValue,e=Ye(this.state.activeView,S[this.props.bottomView!==void 0?this.props.bottomView:ie.defaultProps.bottomView],S[this.props.topView!==void 0?this.props.topView:ie.defaultProps.topView]),t=Wt(this.min,this.max,this.value,this.value),i=t?r.getDate(t):null;this.focusedDate=r.getDate(K(s&&t!==null?t:this.state.focusedDate,this.min,this.max)),this.intl=k.provideIntlService(this),this.bus.configure(this.bottomView,this.topView),this.service=this.bus.service(e,this.intl);const{smoothScroll:a=Number.parseFloat(l.version)<18}=this.props,o=d.classNames("k-widget k-calendar k-calendar-infinite",{"k-disabled":this.props.disabled,"k-week-number":this.props.weekNumber,"k-calendar-lg":this.props.mobileMode},this.props.className),h=[this.props.navigation&&l.createElement(Ot,{key:0,ref:u=>{this.Navigation=u},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}),l.createElement(Le,{key:1,ref:u=>{this.calendarViewList=u},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:a,showWeekNumbers:this.props.weekNumber,onChange:this.handleDateChange,value:i,cellUID:this.cellUID,headerTitle:this.props.headerTitle,tabIndex:this.props.tabIndex})];return l.createElement("div",{ref:u=>{this._element=u},className:o,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},h)}};let ne=ie;ne.displayName="Calendar";ne.propTypes={className:n.string,defaultActiveView:n.oneOf(["month","year","decade","century"]),defaultValue:n.instanceOf(Date),disabled:n.bool,focusedDate:n.instanceOf(Date),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,max:n.instanceOf(Date),min:n.instanceOf(Date),navigation:n.bool,smoothScroll:n.bool,onBlur:n.func,onChange:n.func,onFocus:n.func,tabIndex:n.number,value:n.instanceOf(Date),weekNumber:n.bool,topView:(s,e,t)=>{const i=s[e],a=s.bottomView;return i&&a&&S[i]<S[a]?new Error(`Invalid prop + ${e} suplied to ${t}.
12
- ${e} can not be smaller than bottomView.
13
- `):null},bottomView:(s,e,t)=>{const i=s[e],a=s.topView;return i&&a&&S[i]>S[a]?new Error(`Invalid prop + ${e} suplied to ${t}.
14
- ${e} can not be bigger than topView.
15
- `):null}};ne.defaultProps={disabled:!1,min:te,max:se,navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",bottomView:"month"};const bs=d.createPropsContext(),tt=d.withIdHOC(d.withPropsContext(bs,ne));tt.displayName="KendoReactCalendar";k.registerForIntl(ne);class Mi{constructor(){this.symbols="",this.partMap=[]}}const Ti="d",Ei="wide",Vi=(s,e,t,i)=>{const a=s[i+s.length-t.length],o=s.substring(0,i+s.length-t.length),h=t.substring(0,i),u=[];if(o===h&&i>0)return u.push([e[i-1],h[i-1]]),u;if(o.indexOf(h)===0&&(h.length===0||e[h.length-1]!==e[h.length])){let c="";h.length===1&&u.push([e[0],h[0]]);for(let p=h.length;p<o.length;p++)e[p]!==c&&e[p]!=="_"&&(c=e[p],u.push([c,""]));return u}if(h.indexOf(o)===0||e[i-1]==="_"){let c=e[0];for(let p=Math.max(0,o.length-1);p<e.length;p++)if(e[p]!=="_"){c=e[p];break}return[[c,h[i-1]]]}return h[h.length-1]===" "||h[h.length-1]===a?[[e[i-1],"_"]]:[[e[i-1],h[i-1]]]},Oi=(s,e)=>(s[e.pattern[0]]=e.type,s),Pi=(s,e,t)=>s===null||!(e&&e>s||t&&t<s),Ni=["k-widget","k-dateinput"];class Ri{constructor(e,t,i){this.year=!0,this.month=!0,this.date=!0,this.hours=!0,this.minutes=!0,this.seconds=!0,this.milliseconds=!0,this.leadingZero=null,this.typedMonthPart="",this.knownParts="adHhmMsEy",this.symbols={E:"E",H:"H",M:"M",a:"a",d:"d",h:"h",m:"m",s:"s",y:"y"},this._value=r.getDate(new Date),this.intlProvider=e,this.formatPlaceholder=t,this.format=i,this.monthNames=this.allFormatedMonths()}get intl(){return this.intlProvider()}get value(){return this._value}setValue(e){e?r.isEqual(e,this._value)||(this._value=r.cloneDate(e),this.modifyExisting(!0)):(this._value=r.getDate(new Date),this.modifyExisting(!1))}hasValue(){const e=(t,i)=>t||i.type!=="literal"&&i.type!=="dayperiod"&&this.getExisting(i.pattern[0]);return this.intl.splitDateFormat(this.format).reduce(e,!1)}getDateObject(){for(let e=0;e<this.knownParts.length;e++)if(!this.getExisting(this.knownParts[e]))return null;return r.cloneDate(this.value)}getTextAndFormat(){return this.merge(this.intl.formatDate(this.value,this.format),this.dateFormatString(this.value,this.format))}modifyExisting(e){const t=this.dateFormatString(this.value,this.format).symbols;for(let i=0;i<t.length;i++)this.setExisting(t[i],e)}getExisting(e){switch(e){case"y":return this.year;case"M":case"L":return this.month;case"d":return this.date;case"E":return this.date&&this.month&&this.year;case"h":case"H":return this.hours;case"m":return this.minutes;case"s":return this.seconds;default:return!0}}setExisting(e,t){switch(e){case"y":this.year=t,t===!1&&this._value.setFullYear(2e3);break;case"M":this.month=t,t===!1&&this._value.setMonth(0);break;case"d":this.date=t;break;case"h":case"H":this.hours=t;break;case"m":this.minutes=t;break;case"s":this.seconds=t;break;default:return}}modifyPart(e,t){let i=r.cloneDate(this.value);switch(e){case"y":i.setFullYear(i.getFullYear()+t);break;case"M":i=r.addMonths(this.value,t);break;case"d":case"E":i.setDate(i.getDate()+t);break;case"h":case"H":i.setHours(i.getHours()+t);break;case"m":i.setMinutes(i.getMinutes()+t);break;case"s":i.setSeconds(i.getSeconds()+t);break;case"a":i.setHours(i.getHours()+12*t);break}this.setExisting(e,!0),this._value=i}parsePart(e,t){if(this.resetLeadingZero(),!t)return this.setExisting(e,!1),{value:null};const i=this.intl.formatDate(this.value,this.format),a=this.dateFormatString(this.value,this.format),o=a.symbols;let h=!1,u="",c="",p="";for(let v=0;v<i.length;v++)o[v]===e?(c+=this.getExisting(e)?i[v]:"0",h=!0):h?p+=i[v]:u+=i[v];let m=null;const f=this.matchMonth(t);for(;c.length>0&&c.charAt(0)==="0";)c=c.slice(1);c.length>=4&&(c="");for(let v=0;v<2;v++){let g=c+t,C=parseInt(g,10);if(m=this.intl.parseDate(u+g+p,this.format),!m&&!isNaN(C)&&!isNaN(parseInt(t,10))){if(e==="M"&&!f){const I=C-1;I>-1&&I<12&&(m=r.cloneDate(this.value),m.setMonth(I),m.getMonth()!==I&&(m=r.lastDayOfMonth(r.addMonths(m,-1))))}e==="y"&&(m=r.createDate(parseInt(g,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&&m.getDate()!==this.value.getDate()&&(m=r.lastDayOfMonth(r.addMonths(m,-1))))}if(m)return this._value=m,this.setExisting(e,!0),{value:this.value};c=""}return f&&(m=this.intl.parseDate(u+f+p,this.format),m)?(this._value=m,this.setExisting(e,!0),{value:this.value}):(t==="0"&&(this.leadingZero=this.isAbbrMonth(a.partMap,e)?null:{[e]:!0},this.setExisting(e,!1)),{value:null})}symbolMap(e){return this.intl.splitDateFormat(this.format).reduce(Oi,{})[e]}resetLeadingZero(){const e=this.leadingZero!==null;return this.leadingZero=null,e}isAbbrMonth(e,t){const i=this.partPattern(e,t);return i.type==="month"&&i.names}partPattern(e,t){return e.filter(i=>i.pattern.indexOf(t)!==-1)[0]}matchMonth(e){if(this.typedMonthPart+=e.toLowerCase(),this.monthNames.length===0)return"";for(;this.typedMonthPart.length>0;){for(let i=0;i<this.monthNames.length;i++)if(this.monthNames[i].toLowerCase().indexOf(this.typedMonthPart)===0)return this.monthNames[i];const t=parseInt(this.typedMonthPart,10);if(t>=1&&t<=12&&t.toString()===this.typedMonthPart)return this.monthNames[t-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(e[t].type==="month"&&e[t].names)return this.intl.dateFormatNames(e[t].names);return[]}dateFormatString(e,t){const i=this.intl.splitDateFormat(t),a=[],o=[];for(let u=0;u<i.length;u++){let c=this.intl.formatDate(e,{pattern:i[u].pattern}).length;for(;c>0;)a.push(this.symbols[i[u].pattern[0]]||"_"),o.push(i[u]),c--}const h=new Mi;return h.symbols=a.join(""),h.partMap=o,h}merge(e,t){let i="",a="",o=t.symbols;for(let h=o.length-1;h>=0;h--)if(this.knownParts.indexOf(o[h])===-1||this.getExisting(o[h]))i=e[h]+i,a=o[h]+a;else{const u=o[h];for(;h>=0&&u===o[h];)h--;for(h++,this.leadingZero&&this.leadingZero[u]?i="0"+i:i=this.dateFieldName(t.partMap[h])+i;a.length<i.length;)a=o[h]+a}return{text:i,format:a}}dateFieldName(e){const t=this.formatPlaceholder||"wide";return t[e.type]?t[e.type]:t==="formatPattern"?e.pattern:this.intl.dateFieldName(Object.assign(e,{nameType:t}))}}const j={dayperiod:"dayperiod",hour:"hour",millisecond:"millisecond",minute:"minute",second:"second"},Pt=s=>(e,t)=>{const i=r.cloneDate(e);return i[s](t),i},ys=[{type:j.hour,getter:s=>s.getHours()},{type:j.minute,getter:s=>s.getMinutes()},{type:j.second,getter:s=>s.getSeconds()},{type:j.millisecond,getter:s=>s.getMilliseconds()}],_i=s=>(e,t)=>s(e),Fi=s=>(e,t)=>s(t),Li=s=>s.reduce((e,t)=>(e[t.type]=t.type,e),{}),Bi=s=>e=>s[e.type]?Fi(e.getter):_i(e.getter),Ai=s=>e=>s.map(Bi(Li(e))),Hi=(s,e,t,i)=>a=>{const o=s(a),h=s(t);return i==="hour"?o-(o-h)%e:a.getTime()<=t.getTime()&&o!==0&&o<=h?Math.ceil(o/e)*e:o-o%e},zi=s=>(e,t)=>s.map(i=>{const a=Math.floor(e[i.type]);return a?Hi(i.getter,a,t,i.type):i.getter}),qi=Ai(ys),Kt=zi(ys),Wi=s=>(e,t)=>(e.setHours(...s.map(i=>i(e,t))),e),Ut=s=>e=>{const t=r.cloneDate(e);return t.setHours(...s.map(i=>i(t))),t},We=Pt("setHours"),Ke=Pt("setMinutes"),Ue=Pt("setSeconds"),ue=()=>new Date,Nt=(s,e,t=1)=>{const i=[];for(let a=s;a<e;a=a+t)i.push(a);return i},Rt=(s,e,t)=>({candidateValue:q(F,s),maxValue:r.addDays(q(F,t),e.getHours()<t.getHours()?0:1),minValue:q(F,e)}),Ki=(s,e,t)=>{if(!s||!e||!t)return s;const{candidateValue:i,minValue:a,maxValue:o}=Rt(s,e,t);return i<a?q(s,e):i>o?q(s,t):s},_t=(s,e,t)=>{if(!s||!e||!t)return!0;const{candidateValue:i,minValue:a,maxValue:o}=Rt(s,e,t);return a<=i&&i<=o},Ui=(s,e,t)=>{if(s===null)return!0;const{candidateValue:i,minValue:a,maxValue:o}=Rt(s,e,t);return a<=i&&i<=o},Yi=(s,e)=>{if(s===null||e===null)return!1;const t=q(F,s),i=q(F,e);return t.getTime()<i.getHours()},$i=(s,e)=>{if(s===null||e===null)return!1;const t=q(F,s);return q(F,e).getTime()<t.getHours()},ji="Please enter a valid value!",Y=class extends l.Component{constructor(s){super(s),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||Y.defaultProps.validationMessage)},this.updateOnPaste=e=>{if(!this.element||!this.kendoDate)return;const t=k.provideIntlService(this).parseDate(this.element.value,this.props.format)||this.value,i=this.value;this.kendoDate.setValue(t),this.triggerChange(e,i)},this.spinnersMouseDown=e=>{e.preventDefault();const t=d.getActiveElement(document);this.element&&t!==this.element&&this.element.focus({preventScroll:!0})},this.handlePaste=()=>{this.paste=!0},this.elementChange=e=>{if(!this.element||!this.kendoDate)return;if(this.paste){this.updateOnPaste(e),this.paste=!1;return}const{text:t,format:i}=this.kendoDate.getTextAndFormat();this.currentFormat=i;const a=this.value,o=Vi(t,this.currentFormat,this.element.value,this.selection.start),h=o.length===1&&o[0][1]==="_";if(!h)for(let u=0;u<o.length;u++)this.kendoDate.parsePart(o[u][0],o[u][1]);o.length&&o[0][0]!=="_"&&this.setSelection(this.selectionBySymbol(o[0][0])),h&&this.switchDateSegment(1),this.triggerChange(e,a)},this.elementClick=e=>{this.setSelection(this.selectionByIndex(this.selection.start))},this.nativeWheel=e=>{d.getActiveElement(document)===this.element&&e.preventDefault()},this.wheel=e=>{d.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})},d.validatePackage(Se),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(s,e){this._lastSelectedSymbol&&e.focused===this.state.focused?this.setSelection(this.selectionBySymbol(this._lastSelectedSymbol)):this.props.placeholder!==void 0&&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:s=Y.defaultProps.size,fillMode:e=Y.defaultProps.fillMode,rounded:t=Y.defaultProps.rounded}=this.props;this.props._ref&&(this.props._ref.current=this);const i=k.provideLocalizationService(this),a={...Y.defaultProps,...this.props},{name:o,label:h,id:u}=a,c=this.text,p=c===this.props.placeholder?"":c,m=c===this.props.placeholder?c:void 0,f=u||this._inputId,v=!this.validityStyles||this.validity.valid;let g=[...Ni];this.props.className&&g.push(this.props.className);const C=l.createElement(d.AsyncFocusBlur,{onFocus:this.elementOnFocus,onBlur:this.elementOnBlur},({onFocus:I,onBlur:T})=>l.createElement("span",{ref:D=>{this._wrapper=D},style:h?void 0:{width:this.props.width},dir:this.props.dir,className:d.classNames("k-dateinput","k-input",{[`k-input-${d.kendoThemeMaps.sizeMap[s]||s}`]:s,[`k-input-${e}`]:e,[`k-rounded-${d.kendoThemeMaps.roundedMap[t]||t}`]:t,"k-invalid":!v,"k-required":this.required,"k-disabled":this.props.disabled},this.props.className),onFocus:I,onBlur:T},l.createElement("input",{role:this.props.ariaRole||"textbox",readOnly:this.props.readonly,tabIndex:this.props.tabIndex,disabled:this.props.disabled,title:this.props.title!==void 0?this.props.title:c,type:"text",spellCheck:!1,autoComplete:"off",autoCorrect:"off",className:"k-input-inner",id:f,"aria-label":this.props.ariaLabel,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,"aria-haspopup":this.props.ariaHasPopup,"aria-disabled":this.props.disabled,"aria-expanded":this.props.ariaExpanded,"aria-controls":this.props.ariaControls,onWheel:this.wheel,onClick:this.elementClick,onInput:this.elementChange,onPaste:this.handlePaste,onKeyDown:this.elementKeyDown,onChange:d.noop,value:p,placeholder:m,name:o,ref:D=>this._element=D}),this.props.children,this.props.spinners&&l.createElement("span",{className:"k-input-spinner k-spin-button",onMouseDown:this.spinnersMouseDown},l.createElement(N.Button,{tabIndex:-1,type:"button",rounded:null,className:"k-spinner-increase",icon:"caret-alt-up",svgIcon:J.caretAltUpIcon,"aria-label":i.toLanguageString(we,M[we]),title:i.toLanguageString(we,M[we]),onClick:this.increasePart}),l.createElement(N.Button,{tabIndex:-1,type:"button",rounded:null,className:"k-spinner-decrease",icon:"caret-alt-down",svgIcon:J.caretAltDownIcon,"aria-label":i.toLanguageString(De,M[De]),title:i.toLanguageString(De,M[De]),onClick:this.decreasePart}))));return h?l.createElement(ss.FloatingLabel,{label:h,editorId:f,editorValue:c,editorValid:v,editorDisabled:this.props.disabled,children:C,style:{width:this.props.width}}):C}get value(){return this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.kendoDate&&this.kendoDate.getDateObject()}get name(){return this.props.name}get min(){return this.props.min!==void 0?this.props.min:Y.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:Y.defaultProps.max}get text(){const s={...ae.defaultProps,...this.props},{formatPlaceholder:e=Y.defaultProps.formatPlaceholder,format:t=Y.defaultProps.format,value:i,defaultValue:a}=s;this.kendoDate===null?(this.kendoDate=new Ri(this.intl.bind(this),e,t),this.kendoDate.setValue(i||a||null)):(this.kendoDate.format=t,this.kendoDate.formatPlaceholder=e),i!==void 0&&this.value!==i&&this.kendoDate.setValue(i);const{text:o,format:h}=this.kendoDate.getTextAndFormat();return this.currentFormat=h,s.placeholder!==null&&s.placeholder!==void 0&&!this.state.focused&&!this.kendoDate.hasValue()?s.placeholder:o}get validity(){const s=Pi(this.value,this.min,this.max)&&_t(this.value,this.props.minTime,this.props.maxTime),e=this.props.validationMessage!==void 0,t=(!this.required||this.value!==null)&&s,i=this.props.valid!==void 0?this.props.valid:t;return{customError:e,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:i,valueMissing:this.value===null}}get element(){return this._element}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:Y.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:Y.defaultProps.required}get wrapper(){return this._wrapper}intl(){return k.provideIntlService(this)}get selection(){let s={start:0,end:0};return this.element!==null&&this.element.selectionStart!==void 0&&(s={start:this.element.selectionStart,end:this.element.selectionEnd}),s}setSelection(s){this._lastSelectedSymbol=this.currentFormat[s.start],window.requestAnimationFrame(()=>{const e=d.getActiveElement(document);this.element&&e===this.element&&!this.props.disableSelection&&this.element.setSelectionRange(s.start,s.end)})}triggerChange(s,e){this.valueDuringOnChange=this.value,this.forceUpdate(),this.props.onChange&&!r.isEqual(e,this.value)&&this.props.onChange.call(void 0,{syntheticEvent:s,nativeEvent:s.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0}selectionBySymbol(s){let e=-1,t=0;for(let i=0;i<this.currentFormat.length;i++)this.currentFormat[i]===s&&(t=i+1,e===-1&&(e=i));return e<0&&(e=0),{start:e,end:t}}selectionByIndex(s){let e={start:s,end:s};for(let t=s,i=s-1;t<this.currentFormat.length||i>=0;t++,i--){if(t<this.currentFormat.length&&this.currentFormat[t]!=="_"){e=this.selectionBySymbol(this.currentFormat[t]);break}if(i>=0&&this.currentFormat[i]!=="_"){e=this.selectionBySymbol(this.currentFormat[i]);break}}return e}switchDateSegment(s){const{start:e,end:t}=this.selection;if(e<t&&this.currentFormat[e]!==this.currentFormat[t-1]){this.setSelection(this.selectionByIndex(s>0?e:t-1));return}const i=this.currentFormat[e];let a=e+s;for(;a>0&&a<this.currentFormat.length&&!(this.currentFormat[a]!==i&&this.currentFormat[a]!=="_");)a+=s;if(this.currentFormat[a]==="_")return;let o=a;for(;o>=0&&o<this.currentFormat.length&&this.currentFormat[o]===this.currentFormat[a];)o+=s;a>o&&(o+1!==e||a+1!==t)?this.setSelection({start:o+1,end:a+1}):a<o&&(a!==e||o!==t)&&this.setSelection({start:a,end:o})}modifyDateSegmentValue(s,e){if(!this.kendoDate)return;const t=this.value,i=this.currentFormat[this.selection.start],a=this.kendoDate.symbolMap(i),o=((this.props.steps||{})[a]||1)*s;this.kendoDate.modifyPart(i,o),this.triggerChange(e,t)}};let re=Y;re.displayName="DateInput";re.propTypes={value:n.instanceOf(Date),format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),formatPlaceholder:n.oneOfType([n.oneOf(["wide","narrow","short","formatPattern"]),n.shape({year:n.string,month:n.string,day:n.string,hour:n.string,minute:n.string,second:n.string})]),width:n.oneOfType([n.string,n.number]),tabIndex:n.number,title:n.string,steps:n.shape({year:n.number,month:n.number,day:n.number,hour:n.number,minute:n.number,second:n.number}),min:n.instanceOf(Date),max:n.instanceOf(Date),disabled:n.bool,spinners:n.bool,name:n.string,dir:n.string,label:n.string,id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,ariaLabel:n.string,ariaRole:n.string,ariaHasPopup:n.oneOfType([n.bool,n.string]),ariaExpanded:n.oneOfType([n.bool]),onChange:n.func,validationMessage:n.string,required:n.bool,validate:n.bool,valid:n.bool,size:n.oneOf([null,"small","medium","large"]),rounded:n.oneOf([null,"small","medium","large","full"]),fillMode:n.oneOf([null,"solid","flat","outline"])};re.defaultProps={format:Ti,size:"medium",rounded:"medium",fillMode:"solid",formatPlaceholder:Ei,spinners:!1,disabled:!1,max:r.cloneDate(se),min:r.cloneDate(te),minTime:r.cloneDate(de),maxTime:r.cloneDate(oe),required:!1,validityStyles:!0,validationMessage:ji,placeholder:null,ariaHasPopup:"grid"};const ks=d.createPropsContext(),ae=d.withIdHOC(d.withPropsContext(ks,re));ae.displayName="KendoReactDateInput";k.registerForIntl(re);k.registerForLocalization(re);const Ss=N.Button,Cs=l.forwardRef((s,e)=>{const{_ref:t}=s,i=l.useRef(null);l.useImperativeHandle(e,()=>i.current),l.useImperativeHandle(t,()=>i.current);const a=l.useMemo(()=>d.classNames(s.className,"k-picker-wrap"),[s.className]);return l.createElement("span",{ref:i,id:s.id,style:s.style,className:a,tabIndex:s.tabIndex},s.children)}),Zi=s=>{const[e,t]=l.useState(!1),i=()=>{s.current&&t(!!s.current.text)};return l.useEffect(i),{editorValue:e}},Ft=s=>{const e=Zi(s.dateInput);return l.createElement(ss.FloatingLabel,{...s,...e})},Yt=500,st=s=>{const{footer:e,children:t,windowWidth:i=0,navigatable:a,navigatableElements:o,expand:h,animation:u,onClose:c,adaptiveTitle:p,mobileFilter:m}=s,f={navigatable:a||!1,navigatableElements:o||[],expand:h,animation:u!==!1,onClose:c,animationStyles:i<=Yt?{top:0,width:"100%",height:"100%"}:void 0,className:i<=Yt?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"};return l.createElement(ce.ActionSheet,{...f},l.createElement(ce.ActionSheetHeader,{className:"k-text-center"},l.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},l.createElement("div",{className:"k-actionsheet-title"},l.createElement("div",null,p)),l.createElement("div",{className:"k-actionsheet-actions"},l.createElement(N.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",icon:"x",svgIcon:J.xIcon,onClick:c}))),m&&l.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},m)),t,e&&l.createElement(ce.ActionSheetFooter,{className:"k-actions k-actions-stretched"},l.createElement(N.Button,{size:"large",tabIndex:0,"aria-label":e.cancelText,"aria-disabled":"false",type:"button",onClick:e.onCancel},e.cancelText),l.createElement(N.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":e.applyText,"aria-disabled":"false",type:"button",onClick:e.onApply},e.applyText)))},it=768,z=class extends l.Component{constructor(s){super(s),this._element=null,this._dateInput=l.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)=>e.value!==void 0?e.value:t.value,this.nextShow=(e,t)=>e.show!==void 0?e.show:t.show,this.renderPopup=()=>{const{disabled:e,min:t,max:i,weekNumber:a,focusedDate:o}=this.props,{popupClass:h,...u}=this.props.popupSettings,c=this.show,p=this.value,m=p&&r.getDate(p),f=d.classNames("k-calendar-container k-group k-reset",h),v={popupClass:"k-datepicker-popup",show:c,anchor:this._element,className:f,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...u},g={disabled:e,value:m,min:t,max:i,weekNumber:a,focusedDate:o,className:this.mobileMode?"k-calendar-lg":"",navigation:!this.mobileMode,onChange:this.handleCalendarValueChange};return this.mobileMode?l.createElement(this.calendarComp,{_ref:this.setCalendarRef,...g}):l.createElement(this.popupComp,{...v},l.createElement(this.calendarComp,{_ref:this.setCalendarRef,...g}))},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:e};return l.createElement(st,{...t},l.createElement(ce.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderPopup()))},this.handleInputValueChange=e=>{this.handleValueChange(e.value,e)},this.handleCalendarValueChange=e=>{const t=this.mergeTime(e.value);this.handleValueChange(t,e)},this.handleValueChange=(e,t)=>{this.setState({value:r.cloneDate(e||void 0)}),this.valueDuringOnChange=e,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:i}=this.props;i&&i.call(void 0,{syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:this.value,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.handleIconClick=()=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:t,keyCode:i}=e;if(i===d.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}t&&(i===d.Keys.up||i===d.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=i===d.Keys.up,this.setShow(i===d.Keys.down))},d.validatePackage(Se),this.state={value:this.props.defaultValue||z.defaultProps.defaultValue,show:this.props.defaultShow||z.defaultProps.defaultShow,focused:!1}}get _popupId(){return this.props.id+"-popup-id"}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=it&&this.props.adaptive)}get dateInput(){return this._dateInput.current}get calendar(){return this._calendar}get value(){const s=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return s!==null?r.cloneDate(s):null}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get name(){return this.props.name}get min(){return this.props.min!==void 0?this.props.min:z.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:z.defaultProps.max}get dateInputComp(){return this.props.dateInput||z.defaultProps.dateInput}get toggleButtonComp(){return this.props.toggleButton||z.defaultProps.toggleButton}get calendarComp(){return this.props.calendar||z.defaultProps.calendar}get popupComp(){return this.props.popup||z.defaultProps.popup}get pickerWrapComp(){return this.props.pickerWrap||z.defaultProps.pickerWrap}get validity(){const s=as(this.value,this.min,this.max),e=this.props.validationMessage!==void 0,t=(!this.required||this.value!==null)&&s,i=this.props.valid!==void 0?this.props.valid:t;return{customError:e,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:i,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:z.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:z.defaultProps.required}componentDidMount(){var s;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(s=this.document)!=null&&s.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 s;clearTimeout(this.nextTickId),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:s=z.defaultProps.size,rounded:e=z.defaultProps.rounded,fillMode:t=z.defaultProps.fillMode,disabled:i,tabIndex:a,title:o,id:h,format:u,formatPlaceholder:c,min:p,max:m,className:f,width:v,name:g,validationMessage:C,required:I,validityStyles:T,ariaLabelledBy:D,ariaDescribedBy:E,ariaLabel:w}=this.props,A=this.show,V=this.value,P=!this.validityStyles||this.validity.valid,H={disabled:i,format:u,formatPlaceholder:c,id:h,ariaLabelledBy:D,ariaDescribedBy:E,ariaLabel:w,max:m,min:p,name:g,onChange:this.handleInputValueChange,required:I,tabIndex:A?-1:a,title:o,valid:this.validity.valid,validationMessage:C,validityStyles:T,value:V,label:void 0,placeholder:this.state.focused?null:this.props.placeholder,ariaExpanded:this.show,size:null,fillMode:null,rounded:null},x=k.provideLocalizationService(this).toLanguageString(je,M[je]),O=l.createElement(d.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},({onFocus:G,onBlur:U})=>l.createElement(l.Fragment,null,l.createElement("span",{ref:le=>{this._element=le},className:d.classNames("k-input","k-datepicker",{[`k-input-${d.kendoThemeMaps.sizeMap[s]||s}`]:s,[`k-rounded-${d.kendoThemeMaps.roundedMap[e]||e}`]:e,[`k-input-${t}`]:t,["k-invalid"]:!P,["k-required"]:this.required,["k-disabled"]:this.props.disabled},f),onKeyDown:this.handleKeyDown,style:{width:v},onFocus:G,onBlur:U,onClick:this.mobileMode?this.handleIconClick:void 0},l.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",readonly:this.mobileMode,ariaExpanded:this.show,ariaControls:this._popupId,...H}),l.createElement(this.toggleButtonComp,{type:"button",icon:"calendar",svgIcon:J.calendarIcon,title:x,className:"k-input-button",rounded:null,onClick:this.mobileMode?void 0:this.handleIconClick,"aria-label":x,onMouseDown:this.handleIconMouseDown}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup()));return this.props.label?l.createElement(Ft,{dateInput:this._dateInput,label:this.props.label,editorId:h,editorValid:P,editorDisabled:this.props.disabled,children:O,style:{width:this.props.width}}):O}setShow(s){const{onOpen:e,onClose:t}=this.props;this.show!==s&&(this.setState({show:s}),s&&e&&e.call(void 0,{target:this}),!s&&t&&t.call(void 0,{target:this}))}mergeTime(s){return this.value&&s?q(s,this.value):s}nextTick(s){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>s())}calculateMedia(s){for(let e of s)this.setState({windowWidth:e.target.clientWidth})}};let Me=z;Me.displayName="DatePicker";Me.propTypes={className:n.string,defaultShow:n.bool,defaultValue:n.instanceOf(Date),disabled:n.bool,focusedDate:n.instanceOf(Date),format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),formatPlaceholder:n.oneOfType([n.oneOf(["wide","narrow","short","formatPattern"]),n.shape({year:n.string,month:n.string,day:n.string,hour:n.string,minute:n.string,second:n.string})]),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,ariaLabel:n.string,min:n.instanceOf(Date),max:n.instanceOf(Date),name:n.string,popupSettings:n.shape({animate:n.bool,appendTo:n.any,popupClass:n.string}),show:n.bool,tabIndex:n.number,title:n.string,value:n.instanceOf(Date),weekNumber:n.bool,width:n.oneOfType([n.number,n.string]),validationMessage:n.string,required:n.bool,validate:n.bool,valid:n.bool,size:n.oneOf([null,"small","medium","large"]),rounded:n.oneOf([null,"small","medium","large","full"]),fillMode:n.oneOf([null,"solid","flat","outline"]),adaptive:n.bool,adaptiveTitle:n.string};Me.defaultProps={defaultShow:!1,defaultValue:null,dateInput:ae,calendar:tt,toggleButton:Ss,popup:Qe.Popup,pickerWrap:Cs,disabled:!1,format:"d",max:se,min:te,popupSettings:{},tabIndex:0,weekNumber:!1,required:!1,validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid"};const xs=d.createPropsContext(),Is=d.withIdHOC(d.withPropsContext(xs,Me));Is.displayName="KendoReactDatePicker";k.registerForLocalization(Me);const dt=(s,e)=>{const t=r.cloneDate(s);return t.setHours(e),t},pt=s=>s!==null&&s<12,Gi=s=>s!==null&&(!s||s>11),Xi=(s,e,t)=>!e&&!t||s>=e&&s<=t,Ji=(s,e,t)=>!e&&!t||s>=e||s<=t;class Ms{constructor(e){this.intl=e,this.min=null,this.max=null,this.part=null}apply(e,t){const i=e.getHours(),a=pt(i),o=pt(t.getHours());if(a&&o||!a&&!o)return e;const[h,u=24]=this.normalizedRange(),c=i+(o?-12:12);return dt(e,Math.min(Math.max(h,c),u||24))}configure(e){const{min:t=this.min,max:i=this.max,part:a=this.part}=e;this.min=t,this.max=i,this.part=a}data(e){const t=this.part&&this.part.names;if(!t||!this.min)return[];const i=[],[a,o]=this.normalizedRange(),h=this.intl.dateFormatNames(t);return pt(a)&&i.push({text:h.am,value:dt(this.min,a)}),Gi(o)&&i.push({text:h.pm,value:dt(this.min,Math.max(12,o))}),this.min.getHours()!==a?i.reverse():i}isRangeChanged(e,t){return!1}limitRange(e,t,i){return[e,t]}total(){const[e,t]=this.normalizedRange();return!e&&!t?2: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:t===0?1:0}valueInList(e){return!this.min||!this.max?!1:(this.min.getHours()!==this.normalizedRange()[0]?Ji:Xi)(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)]}}class Qi{constructor(){this.itemHeight=0,this.timeListHeight=0,this.didCalculate=!1}ensureHeights(){this.timeListHeight===void 0&&this.calculateHeights()}calculateHeights(e){if(!d.canUseDOM)return;const t=W("div"),i=W("span"),a=W("ul"),o=W("li"),h=()=>o("<span>02</span>","k-item"),u=()=>a([h()],"k-reset"),c=()=>t([u()],"k-content k-scrollable k-time-container"),m=(()=>t([i("minute","k-title"),t([c()],"k-time-list")],"k-time-list-wrapper",{left:"-10000px",position:"absolute"}))(),v=e&&e.querySelector(".k-time-container")||document.body,g=v.appendChild(m);this.timeListHeight=g.querySelector(".k-scrollable").offsetHeight,this.itemHeight=g.querySelector("li").offsetHeight,v.removeChild(g),this.didCalculate=!0}}const Lt=24,en=s=>e=>e%s,Ts=en(Lt),tn=(s,e)=>t=>Ts(s+t*e),$t=(s,e)=>Ts(Lt+s-e),Es=s=>(e,t)=>!t||r.getDate(e).getTime()===r.getDate(t).getTime()?e:We(e,s),sn=Es(0),nn=Es(Lt-1);class Vs{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 We(e,t.getHours())}configure(e){const{boundRange:t=this.boundRange,insertUndividedMax:i=this.insertUndividedMax,min:a=this.min,max:o=this.max,part:h,step:u=this.step}=e;this.boundRange=t,this.insertUndividedMax=i,this.toListItem=c=>{const p=We(F,c);return{text:this.intl.formatDate(p,h.pattern),value:p}},this.min=a,this.max=o,this.step=u}data(e){const[t]=this.range(e),i=tn(t,this.step),a=h=>this.toListItem&&this.toListItem(i(h)),o=Nt(0,this.countFromMin(e)).map(a);return this.addLast(o),e&&this.addMissing(o,e),o}isRangeChanged(e,t){return!this.min||!this.max?!1:!r.isEqual(this.min,e)||!r.isEqual(this.max,t)}limitRange(e,t,i){return this.boundRange?[sn(e,i),nn(t,i)]:[e,t]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,i=this.isMissing(e)?1:0;return this.countFromMin(e)+i+t}selectedIndex(e){return Math.ceil(this.divideByStep(e))}valueInList(e){return e?this.insertUndividedMax&&this.lastHour(e)===e.getHours()||!this.isMissing(e):!0}addLast(e,t){return this.insertUndividedMax&&this.isLastMissing(t)&&this.toListItem&&e.push(this.toListItem(this.lastHour(t))),e}addMissing(e,t){if(this.valueInList(t))return e;if(this.toListItem){const i=this.toListItem(t.getHours());e.splice(this.selectedIndex(t),0,i)}return e}countFromMin(e){const[t,i]=this.range(e);return Math.floor($t(i,t)/this.step)+1}isMissing(e){return e?this.selectedIndex(e)!==this.divideByStep(e):!1}isLastMissing(e){return this.max!==null&&this.isMissing(We(this.max,this.lastHour(e)))}divideByStep(e){return $t(e.getHours(),this.min.getHours())/this.step}lastHour(e){return this.range(e)[1]}range(e){const[t,i]=this.limitRange(this.min,this.max,e);return[t.getHours(),i.getHours()]}}const Bt=60,an=s=>e=>e%s,Os=an(Bt),on=(s,e)=>t=>Os(s+t*e),jt=(s,e)=>Os(Bt+s-e),Ps=s=>(e,t)=>!t||e.getHours()===t.getHours()?e:Ke(e,s),rn=Ps(0),ln=Ps(Bt-1);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 Ke(e,t.getMinutes())}configure(e){const{insertUndividedMax:t=this.insertUndividedMax,min:i=this.min,max:a=this.max,part:o,step:h=this.step}=e;this.insertUndividedMax=t,this.toListItem=u=>{const c=Ke(F,u);return{text:this.intl.formatDate(c,o.pattern),value:c}},this.min=i,this.max=a,this.step=h}data(e){const[t]=this.range(e),i=on(t,this.step),a=h=>this.toListItem&&this.toListItem(i(h)),o=Nt(0,this.countFromMin(e)).map(a);return this.addLast(o),e&&this.addMissing(o,e),o}isRangeChanged(e,t){return this.min!==null&&this.max!==null&&(!r.isEqual(this.min,e)||!r.isEqual(this.max,t))}limitRange(e,t,i){return[rn(e,i),ln(t,i)]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,i=this.isMissing(e)?1:0;return this.countFromMin(e)+i+t}selectedIndex(e){return Math.ceil(this.divideByStep(e))}valueInList(e){return e?this.insertUndividedMax&&this.lastMinute(e)===e.getMinutes()||!this.isMissing(e):!0}addLast(e,t){return this.insertUndividedMax&&this.isLastMissing(t)&&this.toListItem&&e.push(this.toListItem(this.lastMinute(t))),e}addMissing(e,t){if(this.valueInList(t))return e;if(this.toListItem){const i=this.toListItem(t.getMinutes());e.splice(this.selectedIndex(t),0,i)}return e}countFromMin(e){const[t,i]=this.range(e);return Math.floor(jt(i,t)/this.step)+1}isMissing(e){return e?this.selectedIndex(e)!==this.divideByStep(e):!1}isLastMissing(e){return this.max!==null&&this.isMissing(Ke(this.max,this.lastMinute(e)))}divideByStep(e){return jt(e.getMinutes(),this.min.getMinutes())/this.step}lastMinute(e){return this.range(e)[1]}range(e){const[t,i]=this.limitRange(this.min,this.max,e);return[t.getMinutes(),i.getMinutes()]}}const At=60,hn=s=>e=>e%s,Rs=hn(At),cn=(s,e)=>t=>Rs(s+t*e),Zt=(s,e)=>Rs(At+s-e),_s=s=>(e,t)=>!t||e.getMinutes()===t.getMinutes()&&e.getHours()===t.getHours()?e:Ue(e,s),un=_s(0),dn=_s(At-1);class Fs{constructor(e){this.intl=e,this.toListItem=null,this.min=null,this.max=null,this.step=0,this.insertUndividedMax=!1}apply(e,t){return Ue(e,t.getSeconds())}configure(e){const{insertUndividedMax:t=this.insertUndividedMax,min:i=this.min,max:a=this.max,part:o,step:h=this.step}=e;this.insertUndividedMax=t,this.toListItem=u=>{const c=Ue(F,u);return{text:this.intl.formatDate(c,o.pattern),value:c}},this.min=i,this.max=a,this.step=h}data(e){const[t]=this.range(e),i=cn(t,this.step),a=h=>this.toListItem&&this.toListItem(i(h)),o=Nt(0,this.countFromMin(e)).map(a);return this.addLast(o),e&&this.addMissing(o,e),o}isRangeChanged(e,t){return this.min!==null&&this.max!==null&&(!r.isEqual(this.min,e)||!r.isEqual(this.max,t))}limitRange(e,t,i){return[un(e,i),dn(t,i)]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,i=this.isMissing(e)?1:0;return this.countFromMin(e)+i+t}selectedIndex(e){return Math.ceil(this.divideByStep(e))}valueInList(e){return e?this.insertUndividedMax&&this.lastSecond(e)===e.getSeconds()||!this.isMissing(e):!0}divideByStep(e){return Zt(e.getSeconds(),this.min.getSeconds())/this.step}addLast(e,t){return this.insertUndividedMax&&this.isLastMissing(t)&&this.toListItem&&e.push(this.toListItem(this.lastSecond(t))),e}addMissing(e,t){if(this.valueInList(t))return e;if(this.toListItem){const i=this.toListItem(t.getSeconds());e.splice(this.selectedIndex(t),0,i)}return e}countFromMin(e){const[t,i]=this.range(e);return Math.floor(Zt(i,t)/this.step)+1}isMissing(e){return e?this.selectedIndex(e)!==this.divideByStep(e):!1}isLastMissing(e){return this.max!==null&&this.isMissing(Ue(this.max,this.lastSecond(e)))}lastSecond(e){return this.range(e)[1]}range(e){const[t,i]=this.limitRange(this.min,this.max,e);return[t.getSeconds(),i.getSeconds()]}}const pn=2,Gt=.05,mn=100,fn=0,Xt=9,gn={[d.Keys.end]:(s,e)=>s[s.length-1],[d.Keys.home]:(s,e)=>s[0],[d.Keys.up]:(s,e)=>s[e-1],[d.Keys.down]:(s,e)=>s[e+1]},It={[j.dayperiod]:Ms,[j.hour]:Vs,[j.minute]:Ns,[j.second]:Fs},ge=class extends l.Component{constructor(s){super(s),this.intl=null,this._element=null,this.service=null,this.virtualization=null,this.topOffset=0,this.bottomOffset=0,this.itemHeight=0,this.listHeight=0,this.topThreshold=0,this.bottomThreshold=0,this.animateToIndex=!1,this.focus=e=>{Promise.resolve().then(()=>{this.element&&this.element.focus(e)})},this.itemOffset=e=>{if(!this.virtualization||!this.service)return-1;const t=this.service.selectedIndex(this.props.value),i=this.virtualization.activeIndex(),a=this.virtualization.itemOffset(i),o=Math.abs(Math.ceil(e)-a);if(t===i&&o<pn)return a;const h=t>i;return h&&o>=this.bottomThreshold||!h&&o>this.topThreshold?this.virtualization.itemOffset(i+1):a},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+=Xt,this.bottomOffset+=Xt*2),this.topThreshold=this.itemHeight*Gt,this.bottomThreshold=this.itemHeight*(1-Gt))},this.configureServices=({min:e,max:t,value:i}=this.props)=>{if(this.service){const[a,o]=this.service.limitRange(e||this.min,t||this.max,i||this.props.value);this.service.configure(this.serviceSettings({min:a,max:o}))}},this.serviceSettings=e=>{const t={boundRange:this.props.boundRange||ge.defaultProps.boundRange,insertUndividedMax:!1,min:r.cloneDate(this.min),max:r.cloneDate(this.max),part:this.props.part,step:this.step},i=Object.assign({},t,e);return i.boundRange=i.part.type!=="hour"||this.props.boundRange||ge.defaultProps.boundRange,i},this.handleScrollAction=({target:e,animationInProgress:t})=>{if(!(!this.virtualization||!this.service)&&e&&!t){this.animateToIndex=!1;const i=this.virtualization.itemIndex(this.itemOffset(e.scrollTop)),a=this.service.data(this.props.value)[i];this.handleChange(a)}},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=d.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===d.Keys.down||t===d.Keys.up||t===d.Keys.end||t===d.Keys.home)&&e.preventDefault();const a=(gn[e.keyCode]||d.noop)(this.service.data(this.props.value),this.service.selectedIndex(this.props.value));a&&this.handleChange(a)},this.handleChange=ii(e=>{if(!this.service)return;const t=this.service.apply(this.props.value,e.value);if(this.props.value.getTime()===t.getTime())return;const{onChange:i}=this.props;i&&i.call(void 0,t)},mn),this.dom=new Qi}get element(){return this._element}get animate(){return!!(this.props.smoothScroll&&this.animateToIndex)}get min(){return this.props.min||ge.defaultProps.min}get max(){return this.props.max||ge.defaultProps.max}get step(){return this.props.step!==void 0&&this.props.step!==0?Math.floor(this.props.step):ge.defaultProps.step}componentDidMount(){Promise.resolve().then(()=>{this._element&&(this.dom.calculateHeights(this._element),this.forceUpdate())})}componentDidUpdate(){if(!this.virtualization||!this.service)return;const s=this.service.selectedIndex(this.props.value);this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](s),this.animateToIndex=!0}render(){if(!this.props.part.type||!It[this.props.part.type])return;this.calculateHeights(),this.intl=k.provideIntlService(this),this.service=new It[this.props.part.type](this.intl),this.configureServices();const s=this.service.data(this.props.value),e="translateY("+this.topOffset+"px)",t=this.service.total(this.props.value),i=l.createElement("ul",{style:{transform:e,msTransform:e},className:"k-reset"},s.map((a,o)=>l.createElement("li",{key:o,className:"k-item",onClick:()=>{this.handleChange(a)}},l.createElement("span",null,a.text))));return l.createElement("div",{className:"k-time-list",id:String(this.props.id||""),tabIndex:this.props.disabled?-1:0,ref:a=>{this._element=a},onKeyDown:this.handleKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseOver:this.handleMouseOver},this.dom.didCalculate?l.createElement(Ce,{bottomOffset:this.bottomOffset,children:i,className:"k-time-container",itemHeight:this.itemHeight,maxScrollDifference:this.listHeight,onScrollAction:this.handleScrollAction,ref:a=>{this.virtualization=a},role:"presentation",skip:fn,tabIndex:-1,take:t,topOffset:this.topOffset,total:t}):l.createElement("div",{className:"k-time-container"},i))}};let Be=ge;Be.propTypes={id:n.number,max:n.instanceOf(Date),min:n.instanceOf(Date),part:function(s,e,t){const i=s[e];if(!i||!It[i.type])throw new Error(`
16
- Invalid prop '${e}' supplied to ${t}.
17
- Supported part types are hour|minute|second|dayperiod.
18
- `);return null},step:function(s,e,t){const i=s[e];if(i!==void 0&&i<=0)throw new Error(`
19
- Invalid prop '${e}' supplied to ${t}.
20
- ${e} cannot be less than 1.
21
- `);return null},value:n.instanceOf(Date),smoothScroll:n.bool,show:n.bool};Be.defaultProps={boundRange:!1,max:oe,min:F,step:1,smoothScroll:!0};k.registerForIntl(Be);const mt=new RegExp(`${j.hour}|${j.minute}|${j.second}|${j.dayperiod}|literal`),he=class extends l.Component{constructor(s){super(s),this._element=null,this._nowButton=null,this.dateFormatParts=[],this.timeLists=[],this.focus=(e,t)=>{Promise.resolve().then(()=>{t&&this._nowButton&&this._nowButton.element&&this._nowButton.element.focus();const i=this.timeLists[0];!t&&this.state.activeListIndex===-1&&!this.hasActiveButton()&&i&&i.element&&i.focus(e)})},this.timeFormatReducer=(e,t)=>e+t.pattern,this.timeFormatFilter=(e,t,i)=>{const a=t>=1&&i[t-1];return a&&a&&e.type==="literal"?mt.test(a.type||""):mt.test(e.type||"")},this.focusList=e=>{this.timeLists.length&&this.timeLists.reduce(this.listReducer,[]).map(t=>e===1?t.next:t.prev).map(t=>t&&t.element&&t.element.focus({preventScroll:!0}))},this.listReducer=(e,t,i,a)=>e.length||t.props.id!==this.state.activeListIndex?e:[{next:a[i+1]||t,prev:a[i-1]||t}],this.showNowButton=()=>!this.hasSteps()&&this.props.nowButton&&_t(ue(),this.min,this.max),this.handleKeyDown=e=>{const{keyCode:t}=e;switch(t){case d.Keys.left:e.preventDefault(),this.focusList(0);return;case d.Keys.right:e.preventDefault(),this.focusList(1);return;default:return}},this.handleListBlur=()=>{this.nextTick(()=>{this.setState({activeListIndex:-1})})},this.handleListFocus=e=>{clearTimeout(this.nextTickId),this.setState({activeListIndex:e})},this.handleChange=e=>{const{onChange:t}=this.props;t&&t.call(void 0,e)},this.snapTime=Ut(Kt(this.props.steps,this.props.min||he.defaultProps.min)),this.state={activeListIndex:-1},this.hasActiveButton=this.hasActiveButton.bind(this)}get element(){return this._element}get value(){return Ki(this.snapTime(r.cloneDate(this.props.value||F)),this.min,this.max)}get intl(){return k.provideIntlService(this)}get min(){return this.snapTime(this.props.min||he.defaultProps.min)}get max(){return this.snapTime(this.props.max||he.defaultProps.max)}get steps(){return this.props.steps||he.defaultProps.steps}get boundRange(){return this.props.boundRange!==void 0?this.props.boundRange:he.defaultProps.boundRange}componentWillUnmount(){clearTimeout(this.nextTickId)}componentDidMount(){const{onMount:s}=this.props;s&&s.call(void 0,this.value)}render(){const{format:s,smoothScroll:e,onNowClick:t,className:i,disabled:a,mobileMode:o,show:h,onNowKeyDown:u}=this.props;this.snapTime=Ut(Kt(this.steps,this.min)),this.dateFormatParts=this.intl.splitDateFormat(s||he.defaultProps.format).filter(this.timeFormatFilter);const c=d.classNames({"k-disabled":a,"k-time-part":o},i);this.timeLists=[];const p=k.provideLocalizationService(this),m=p.toLanguageString(Dt,M[Dt]);return l.createElement("div",{className:c},l.createElement("div",{className:"k-time-header"},l.createElement("span",{className:"k-title"},this.intl.formatDate(this.value,this.dateFormatParts.reduce(this.timeFormatReducer,""))),this.showNowButton()&&l.createElement(N.Button,{type:"button",ref:f=>{this._nowButton=f},className:"k-time-now",fillMode:"flat",themeColor:"primary",title:m,onKeyDown:u,"aria-label":m,onClick:t,tabIndex:a?-1:0},p.toLanguageString(wt,M[wt]))),l.createElement("div",{className:"k-time-list-container",onKeyDown:this.handleKeyDown},l.createElement("span",{className:"k-time-highlight"}),this.dateFormatParts.map((f,v)=>f.type!=="literal"?l.createElement("div",{key:v,className:d.classNames("k-time-list-wrapper",{"k-focus":v===this.state.activeListIndex}),role:"presentation",tabIndex:-1},l.createElement("span",{className:"k-title",onMouseDown:g=>{g.preventDefault()}},this.intl.dateFieldName(f)),l.createElement(Be,{min:this.min,max:this.max,boundRange:this.boundRange,part:f,step:f.type?this.steps[f.type]:1,smoothScroll:e,ref:g=>{g&&this.timeLists.push(g)},id:v,onFocus:()=>{this.handleListFocus(v)},onBlur:this.handleListBlur,onChange:this.handleChange,value:this.value,disabled:a,show:h,mobileMode:o})):l.createElement("div",{key:v,className:"k-time-separator"},f.pattern))))}nextTick(s){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>s())}hasActiveButton(){const s=d.getActiveElement(document);return this._nowButton&&s===this._nowButton.element}hasSteps(){const s=Object.keys(this.steps);return s.length!==s.reduce((e,t)=>e+this.steps[t],0)}};let pe=he;pe.propTypes={cancelButton:n.bool,disabled:n.bool,format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),max:n.instanceOf(Date),min:n.instanceOf(Date),nowButton:n.bool,steps:n.shape({hour:n.number,minute:n.number,second:n.number}),smoothScroll:n.bool,tabIndex:n.number,value:n.instanceOf(Date),show:n.bool};pe.defaultProps={value:null,disabled:!1,nowButton:!0,cancelButton:!0,format:"hh:mm a",min:de,max:oe,steps:{},boundRange:!1};k.registerForIntl(pe);k.registerForLocalization(pe);const Mt=class extends l.Component{constructor(s){super(s),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;switch(t){case d.Keys.enter:this.hasActiveButton()||this.handleAccept(e);return;default:return}},this.revertToNowButton=e=>{const{keyCode:t,shiftKey:i}=e;!i&&t===d.Keys.tab&&(e.preventDefault(),this.props.nowButton!==!1?this.timePart&&this.timePart.focus({preventScroll:!0},!0):this.timePart&&this.timePart.focus({preventScroll:!0}))},this.handleNowKeyDown=e=>{var a;const{keyCode:t,shiftKey:i}=e;i&&t===d.Keys.tab?(e.preventDefault(),this._acceptButton&&((a=this._acceptButton.element)==null||a.focus({preventScroll:!0}))):t===d.Keys.enter&&(e.stopPropagation(),this.handleNowClick(e))},this.handleAccept=e=>{const t=this.mergeValue(r.cloneDate(this.value||ue()),this.timePart?this.timePart.value:this.current);this.setState({value:t}),this.valueDuringOnChange=t;const{onChange:i}=this.props;i&&i.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleReject=e=>{this.setState({current:this.value});const{onReject:t}=this.props;t&&t.call(void 0,e)},this.handleNowClick=e=>{const t=this.mergeValue(r.cloneDate(this.value||ue()),ue());this.setState({current:t,value:t}),this.valueDuringOnChange=t;const{onChange:i}=this.props;i&&i.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleChange=e=>{this.setState({current:e});const{handleTimeChange:t}=this.props;t&&t.call(void 0,{time:e})},this.dateFormatParts=this.intl.splitDateFormat(this.props.format||Mt.defaultProps.format),this.mergeValue=Wi(qi(this.dateFormatParts)),this.hasActiveButton=this.hasActiveButton.bind(this),this.state={current:this.props.value||F,value:this.props.value||Mt.defaultProps.value}}get element(){return this._element}get value(){const s=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return s!==null?r.cloneDate(s):null}get intl(){return k.provideIntlService(this)}get current(){return this.state.current!==null?r.cloneDate(this.state.current):null}componentWillUnmount(){clearTimeout(this.nextTickId)}render(){const{format:s,cancelButton:e,disabled:t,tabIndex:i,className:a,smoothScroll:o,min:h,max:u,boundRange:c,nowButton:p,steps:m,show:f,mobileMode:v}=this.props,g=k.provideLocalizationService(this),C=g.toLanguageString(Je,M[Je]),I=g.toLanguageString(Ne,M[Ne]);return l.createElement("div",{ref:T=>{this._element=T},tabIndex:t?void 0:i||0,className:d.classNames("k-timeselector",a,{"k-disabled":t}),onKeyDown:this.handleKeyDown},l.createElement(pe,{ref:T=>{this.timePart=T},value:this.current,onChange:this.handleChange,onNowClick:this.handleNowClick,format:s,smoothScroll:o,min:h,max:u,boundRange:c,disabled:t,nowButton:p,steps:m,show:f,mobileMode:v,onNowKeyDown:this.handleNowKeyDown}),this.props.footer&&l.createElement("div",{className:"k-time-footer k-actions k-actions-stretched"},e&&l.createElement(N.Button,{type:"button",ref:T=>{this._cancelButton=T},className:"k-time-cancel",onClick:this.handleReject,title:C,"aria-label":C},C),l.createElement(N.Button,{type:"button",ref:T=>{this._acceptButton=T},className:"k-time-accept",themeColor:"primary",onClick:this.handleAccept,onKeyDown:this.revertToNowButton,title:I,"aria-label":I},I)))}nextTick(s){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>s())}hasActiveButton(){if(!this._acceptButton||!this._acceptButton.element)return!1;const s=d.getActiveElement(document);return this._acceptButton&&s===this._acceptButton.element||this._cancelButton&&s===this._cancelButton.element}};let Te=Mt;Te.propTypes={cancelButton:n.bool,className:n.string,disabled:n.bool,format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),max:n.instanceOf(Date),min:n.instanceOf(Date),nowButton:n.bool,steps:n.shape({hour:n.number,minute:n.number,second:n.number}),smoothScroll:n.bool,tabIndex:n.number,value:n.instanceOf(Date),show:n.bool};Te.defaultProps={value:null,disabled:!1,cancelButton:!0,format:"t",min:de,max:oe,boundRange:!1,footer:!0};k.registerForIntl(Te);k.registerForLocalization(Te);const $=class extends l.Component{constructor(s){super(s),this._element=null,this._dateInput=l.createRef(),this._timeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.renderTimeSelector=()=>{const{smoothScroll:e,cancelButton:t,nowButton:i,disabled:a,format:o,steps:h}=this.props;return l.createElement(Te,{ref:this.setTimeSelectorRef,className:this.mobileMode?"k-reset k-timeselector-lg":"",mobileMode:this.mobileMode,show:this.show,cancelButton:t,disabled:a,nowButton:i,format:o,min:this.min,max:this.max,steps:h,smoothScroll:e,value:this.value,footer:!this.mobileMode,handleTimeChange:this.mobileMode&&this.handleTimeChange,onChange:this.handleValueChange,onReject:this.handleValueReject})},this.renderPopup=()=>{const{popupClass:e,...t}=this.popupSettings,i=d.classNames("k-group k-reset",e),a={popupClass:"k-timepicker-popup",show:this.show,animate:this.element!==null,anchor:this.element,className:i,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...t};return this.props.popup?l.createElement(this.props.popup,{...a},this.renderTimeSelector()):l.createElement(Qe.Popup,{...a},this.renderTimeSelector())},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:e,footer:{cancelText:this.localizationService.toLanguageString(qe,M[Je]),onCancel:this.handleValueReject,applyText:this.localizationService.toLanguageString(Ne,M[Ne]),onApply:i=>this.handleValueChange(i)}};return l.createElement(st,{...t},l.createElement(ce.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderTimeSelector()))},this.setTimeSelectorRef=e=>{this._timeSelector=e},this.nextValue=(e,t)=>e.value!==void 0?e.value:t.value,this.nextShow=(e,t)=>e.show!==void 0?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:r.cloneDate(e.value||this.state.candidate)}),this.valueDuringOnChange=e.value,this.showDuringOnChange=!1,this.shouldFocusDateInput=!0;const{onChange:t}=this.props,i=this.value||this.state.candidate;t&&t.call(void 0,{syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:i,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.handleValueReject=e=>{this.setShow(!1)},this.handleIconClick=e=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:t,keyCode:i}=e;if(i===d.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}t&&(i===d.Keys.up||i===d.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=i===d.Keys.up,this.setShow(i===d.Keys.down))},d.validatePackage(Se),this.state={value:this.props.defaultValue||$.defaultProps.defaultValue,show:this.props.defaultShow||$.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(d.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 s=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return s!==null?r.cloneDate(s):null}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get name(){return this.props.name}get validity(){const s=this.value&&this.normalizeTime(this.value),e=this.normalizeTime(this.min),t=this.normalizeTime(this.max),i=Ui(s,e,t),a=this.props.validationMessage!==void 0,o=(!this.required||this.value!==null)&&i,h=this.props.valid!==void 0?this.props.valid:o;return{customError:a,rangeOverflow:$i(s,t),rangeUnderflow:Yi(s,e),valid:h,valueMissing:this.value===null}}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=it&&this.props.adaptive)}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:$.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:$.defaultProps.required}get popupSettings(){return this.props.popupSettings||$.defaultProps.popupSettings}get min(){return this.props.min!==void 0?this.props.min:$.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:$.defaultProps.max}get dateInputComp(){return this.props.dateInput||$.defaultProps.dateInput}get localizationService(){return k.provideLocalizationService(this)}componentDidMount(){var s;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(s=this.document)!=null&&s.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 s;(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:s=$.defaultProps.size,rounded:e=$.defaultProps.rounded,fillMode:t=$.defaultProps.fillMode,disabled:i,tabIndex:a,title:o,id:h,className:u,format:c,formatPlaceholder:p,width:m,name:f,steps:v,validationMessage:g,required:C,validityStyles:I,ariaLabelledBy:T,ariaDescribedBy:D}=this.props,E=!this.validityStyles||this.validity.valid,w={disabled:i,format:c,formatPlaceholder:p,id:h,ariaLabelledBy:T,ariaDescribedBy:D,max:this.normalizeTime(this.max),min:this.normalizeTime(this.min),name:f,onChange:this.handleInputValueChange,required:C,steps:v,tabIndex:this.show?-1:a,title:o,valid:this.validity.valid,validationMessage:g,validityStyles:I,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},A=this.localizationService.toLanguageString(qe,M[qe]),V=this.localizationService.toLanguageString(bt,M[bt]),P=l.createElement(d.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},({onFocus:H,onBlur:x})=>l.createElement(l.Fragment,null,l.createElement("div",{id:this.props.id,ref:O=>{this._element=O},className:d.classNames("k-input","k-timepicker",{[`k-input-${d.kendoThemeMaps.sizeMap[s]||s}`]:s,[`k-rounded-${d.kendoThemeMaps.roundedMap[e]||e}`]:e,[`k-input-${t}`]:t,["k-invalid"]:!E,["k-required"]:this.required,["k-disabled"]:this.props.disabled},u),onKeyDown:this.handleKeyDown,style:{width:m},onFocus:H,onBlur:x,onClick:this.mobileMode?this.handleIconClick:void 0},l.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,...w}),l.createElement(N.Button,{tabIndex:-1,type:"button",icon:"clock",svgIcon:J.clockIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleIconClick,title:V,className:"k-input-button",rounded:null,"aria-label":A}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup()));return this.props.label?l.createElement(Ft,{dateInput:this._dateInput,label:this.props.label,editorId:h,editorValid:E,editorDisabled:this.props.disabled,children:P,style:{width:this.props.width}}):P}normalizeTime(s){return q(F,s)}setShow(s){const{onOpen:e,onClose:t}=this.props;this.show!==s&&(this.setState({show:s}),s&&e&&e.call(void 0,{target:this}),!s&&t&&t.call(void 0,{target:this}))}mergeTime(s){return this.value&&s?q(this.value,s):s}calculateMedia(s){for(let e of s)this.setState({windowWidth:e.target.clientWidth})}};let Ee=$;Ee.displayName="TimePicker";Ee.propTypes={className:n.string,cancelButton:n.bool,nowButton:n.bool,defaultShow:n.bool,defaultValue:n.instanceOf(Date),disabled:n.bool,format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),formatPlaceholder:n.oneOfType([n.oneOf(["wide","narrow","short","formatPattern"]),n.shape({year:n.string,month:n.string,day:n.string,hour:n.string,minute:n.string,second:n.string})]),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,min:n.instanceOf(Date),max:n.instanceOf(Date),name:n.string,popupSettings:n.shape({animate:n.bool,appendTo:n.any,popupClass:n.string}),show:n.bool,steps:n.shape({hour:n.number,minute:n.number,second:n.number}),smoothScroll:n.bool,tabIndex:n.number,title:n.string,value:n.instanceOf(Date),width:n.oneOfType([n.number,n.string]),validationMessage:n.string,required:n.bool,validate:n.bool,valid:n.bool,size:n.oneOf([null,"small","medium","large"]),rounded:n.oneOf([null,"small","medium","large","full"]),fillMode:n.oneOf([null,"solid","flat","outline"])};Ee.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"t",max:oe,min:de,popupSettings:{},tabIndex:0,steps:{},required:!1,validityStyles:!0,dateInput:ae,size:"medium",rounded:"medium",fillMode:"solid"};const Ls=d.createPropsContext(),Bs=d.withIdHOC(d.withPropsContext(Ls,Ee));Bs.displayName="KendoReactTimePicker";k.registerForLocalization(Ee);const Jt=2,Tt=class extends l.Component{constructor(s){super(s),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(e.start===null||e.end===null)return e;const t=e.end<e.start;return{start:t?e.end:e.start,end:t?e.start:e.end}},this.handleDateChange=(e,t=!1)=>{const{onChange:i}=this.props;if(i){const a={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:r.cloneDate(e.value),target:this,isTodayClick:t};i.call(void 0,a)}}}get element(){return this._element}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===S.month)}get min(){return this.props.min!==void 0?this.props.min:Tt.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:Tt.defaultProps.max}componentDidUpdate(){this.isActive&&this.focusActiveDate()}render(){const s=this.props.allowReverse?this.rotateSelectionRange(this.props.selectionRange):this.props.selectionRange,e=d.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===S.month,"k-calendar-yearview":this.props.activeView===S.year,"k-calendar-decadeview":this.props.activeView===S.decade,"k-calendar-centuryview":this.props.activeView===S.century});return l.createElement("div",{ref:t=>{this._element=t},className:e},this.props.dates.map(t=>l.createElement("table",{className:"k-calendar-table k-content",key:t.getTime(),role:"grid"},l.createElement(Fe,{bus:this.props.bus,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:s,selectedDate:this.props.value,showWeekNumbers:this.weekNumber,onChange:this.handleDateChange,onCellEnter:this.props.onCellEnter,cell:this.props.cell,weekCell:this.props.weekCell}))))}};let ke=Tt;ke.defaultProps={showWeekNumbers:!1,views:Jt,take:Jt,allowReverse:!0,min:te,max:se};const ft=(s=Q.defaultProps.min,e=Q.defaultProps.max,t)=>t instanceof Date&&!Array.isArray(t)&&_(r.getDate(t),s,e)?r.getDate(t):null,Qt=(s=Q.defaultProps.min,e=Q.defaultProps.max,t)=>Array.isArray(t)?t.filter(i=>_(i,s,e)).map(i=>r.getDate(i)):null,es=s=>typeof s=="object"&&!(s instanceof Date)&&s!==null&&!Array.isArray(s)?s:B,ts=(s,e,t)=>s||e&&e[0]||t&&t.start,vn=(s,e)=>s.start===null&&e===null?"start":s.end===null?"end":"start",ve=class extends l.Component{constructor(s){super(s),this.dates=[],this.selectedDate=null,this.selectedMultiple=null,this.selectedRange=B,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=c=>({start:c,end:null}),this.rangeWithFocused=(c,p)=>({start:c.start,end:c.end===null&&c.start!==null&&this.isActive?p:c.end}),this.generateRange=(c,p)=>{const{end:m,start:f}=p,v=p.start!==null&&c.getTime()<=p.start.getTime();return!this.props.allowReverse&&v?{start:c,end:this.selectedRange.start}:this.activeRange!=="end"?{start:c,end:m}:{start:f||this.selectedDate,end:c}},this.canNavigate=c=>{if(!this.service)return!1;const p=this.service.move(this.focusedDate,c);return this.min<=p&&p<=this.max||this.service.isInSameView(p,this.min)||this.service.isInSameView(p,this.max)},this.navigate=(c,p)=>{this.calculateFocusFromValue=!1;const m=this.move(c,p);this.setState({navigateDate:m,focusedDate:m})},this.move=(c,p)=>this.clampDate(this.service.move(p,c)),this.clampDate=c=>K(c,this.min,this.max),this.shouldAutoCorrect=(c,p)=>{const{end:m,start:f}=p;return this.activeRange!=="end"?m!==null&&c>m:f!==null&&c<f},this.handleCellEnter=c=>{this.props.mode==="range"&&(this.calculateFocusFromValue=!1,this.setState({focusedDate:c}))},this.handleMouseDown=c=>{c.preventDefault()},this.handleClick=c=>{this._element&&this._element.focus({preventScroll:!0})},this.handleFocus=c=>{if(this.isActive=!0,!this.calendarViewList)return;this.calendarViewList.focusActiveDate();const{onFocus:p}=this.props;p&&p.call(void 0,c)},this.handleBlur=c=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:p}=this.props;p&&p.call(void 0,c)},this.handleTodayClick=c=>{this.todayIsInRange&&this.handleDateChange(c)},this.handlePrevButtonClick=()=>{const c=b.PrevView;if(this.state.activeView>0&&this.focusedDate.getFullYear()>this.dates[0].getFullYear())this.navigate(c,this.move(c,this.focusedDate));else{const p=this.isInMonth(this.focusedDate,this.dates[1])?this.move(c,this.focusedDate):this.focusedDate;this.navigate(c,p)}},this.handleNextButtonClick=()=>{this.navigate(b.NextView,this.focusedDate)},this.handleKeyDown=c=>{const{keyCode:m,ctrlKey:f,metaKey:v}=c;if(m===84){const g=L();this.calculateFocusFromValue=!1,this.setState({focusedDate:g,navigateDate:g})}if((f||v)&&(m===d.Keys.left&&this.handlePrevButtonClick(),m===d.Keys.right&&this.handleNextButtonClick()),m===d.Keys.enter){const g={syntheticEvent:c,nativeEvent:c.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(g)}else{const g=K(this.navigation.move(this.focusedDate,this.navigation.action(c),this.state.activeView,this.service,c),this.min,this.max);if(r.isEqualDate(this.focusedDate,g))return;this.dates&&this.service&&!this.service.isInArray(g,this.dates)&&this.setState({navigateDate:g}),this.calculateFocusFromValue=!1,this.setState({focusedDate:g})}c.preventDefault()},this.handleViewChange=({view:c})=>{this.calculateFocusFromValue=!1,this.setState(p=>({activeView:c,navigateDate:p.focusedDate}))},this.handleDateChange=c=>{const p=r.cloneDate(c.value),m=this.bus.canMoveDown(this.state.activeView);if(this.props.disabled)return;if(m)if(c.isTodayClick)this.bus.moveToBottom(this.state.activeView);else{this.bus.moveDown(this.state.activeView,c.syntheticEvent),this.setState({focusedDate:p,navigateDate:p});return}this.calculateFocusFromValue=!0;let f;switch(this.props.mode){case"single":f=r.cloneDate(c.value);break;case"multiple":if(Array.isArray(this.selectedMultiple)){const g=this.selectedMultiple.slice();let C=-1;g.forEach((I,T)=>{r.isEqualDate(I,c.value)&&(C=T)}),C!==-1?g.splice(C,1):g.push(r.cloneDate(c.value)),f=g.slice()}else this.selectedDate?f=[r.cloneDate(this.selectedDate),r.cloneDate(c.value)]:f=[r.cloneDate(c.value)];break;case"range":{f=this.selectedRange.start!==null&&this.selectedRange.end!==null&&this.activeRange==="start"?this.clampRange(c.value):this.generateRange(c.value,this.selectedRange),this.activeRangeEnd=this.activeRange!=="end"?"end":"start";break}default:f=r.cloneDate(c.value);break}this.valueDuringOnChange=f,c.isTodayClick&&this.setState({navigateDate:p}),this.setState({value:f,focusedDate:p}),this.valueDuringOnChange=f;const{onChange:v}=this.props;if(v){const g={syntheticEvent:c.syntheticEvent,nativeEvent:c.nativeEvent,value:f,target:this};v.call(void 0,g)}this.valueDuringOnChange=void 0};const e=s.value!==void 0?s.value:s.defaultValue||ve.defaultProps.defaultValue,t=ft(this.min,this.max,e),i=Qt(this.min,this.max,e),a=es(e),o=ts(t,i,a),h=Ye(S[s.defaultActiveView],this.bottomView,this.topView),u=K(s.focusedDate||o||L(),this.min,this.max);this.state={value:e,activeView:h,focusedDate:u,navigateDate:u},this.activeRangeEnd=vn(a,t),this.bus=new Et(this.handleViewChange),this.navigation=new Vt(this.bus),this.calculateFocusFromValue=!1,this.lastView=h,this.lastViewsCount=this.props.views||ke.defaultProps.views}get wrapperID(){return this.props.id+"-wrapper-id"}get isRtl(){return this.props.dir==="rtl"}get element(){return this._element}get value(){return this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value}get focusedDate(){return r.cloneDate(this._focusedDate)}get min(){return r.getDate(this.props.min!==void 0?this.props.min:ve.defaultProps.min)}get max(){return r.getDate(this.props.max!==void 0?this.props.max:ve.defaultProps.max)}get bottomView(){return S[this.props.bottomView!==void 0?this.props.bottomView:ve.defaultProps.bottomView]}get topView(){return S[this.props.topView!==void 0?this.props.topView:ve.defaultProps.topView]}get activeRange(){return this.props.activeRangeEnd!==void 0?this.props.activeRangeEnd:this.activeRangeEnd}get todayIsInRange(){return _(L(),r.getDate(this.min),r.getDate(this.max))}componentDidMount(){this.calculateFocusFromValue=!0}componentDidUpdate(){this.calendarViewList&&(this.isActive?this.calendarViewList.focusActiveDate:this.calendarViewList.blurActiveDate)();const s=ft(this.min,this.max,this.value);this.calculateFocusFromValue=!!(this.selectedDate&&s&&this.selectedDate.getTime()&&s.getTime()),this.lastView=this.state.activeView,this.lastViewsCount=this.props.views||ke.defaultProps.views}render(){this.props._ref&&this.props._ref(this),this.intl=k.provideIntlService(this),this.localization=k.provideLocalizationService(this),this.bus.configure(this.bottomView,this.topView);const s=Ye(this.state.activeView,this.bottomView,this.topView);this.service=this.bus.service(s,this.intl),this.selectedDate=ft(this.min,this.max,this.value),this.selectedMultiple=Qt(this.min,this.max,this.value),this.selectedRange=es(this.value);const e=ts(this.selectedDate,this.selectedMultiple,this.selectedRange);this._focusedDate=K(this.calculateFocusFromValue&&e!==null?e:this.state.focusedDate,this.min,this.max);const t=d.classNames("k-widget k-calendar k-calendar-range",{"k-disabled":this.props.disabled},this.props.className),i=this.rangeWithFocused(this.selectedRange,this.focusedDate),a=this.localization.toLanguageString(gt,M[gt]),o=this.localization.toLanguageString(vt,M[vt]),h=!this.canNavigate(b.PrevView),u=!this.canNavigate(b.NextView),c={"aria-disabled":h},p={"aria-disabled":u},m=this.lastView!==s,f=this.dates&&this.isInMonth(this.state.navigateDate,this.dates[0]),v=this.lastViewsCount!==this.props.views;(!f||m||v)&&(this.dates=this.service.datesList(this.state.navigateDate,this.props.views||ke.defaultProps.views));const g=r.cloneDate(this.dates&&this.dates[0]?this.dates[0]:L());return l.createElement("div",{ref:C=>{this._element=C},className:t,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},l.createElement(xe,{key:`.kendo.calendar.header.${g.getTime()}`,activeView:s,currentDate:g,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:l.createElement(l.Fragment,null,l.createElement(N.Button,{type:"button",className:"k-calendar-nav-prev",icon:this.isRtl?"chevron-right":"chevron-left",svgIcon:this.isRtl?J.chevronRightIcon:J.chevronLeftIcon,fillMode:"flat",title:a,disabled:h,onClick:this.handlePrevButtonClick,...c}),l.createElement(Ie,{min:this.min,max:this.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange}),l.createElement(N.Button,{type:"button",className:"k-calendar-nav-next",icon:this.isRtl?"chevron-left":"chevron-right",svgIcon:this.isRtl?J.chevronLeftIcon:J.chevronRightIcon,fillMode:"flat",title:o,disabled:u,onClick:this.handleNextButtonClick,...p}))}),l.createElement(ke,{ref:C=>{this.calendarViewList=C},dates:this.dates,activeView:s,focusedDate:this.focusedDate,min:this.min,max:this.max,bus:this.bus,service:this.service,selectionRange:i,value:this.selectedMultiple||this.selectedDate,cellUID:this.cellUID,views:this.props.views,onChange:this.handleDateChange,showWeekNumbers:this.props.weekNumber,onCellEnter:this.handleCellEnter,cell:this.props.cell,weekCell:this.props.weekCell,headerTitle:this.props.headerTitle,verticalView:this.props.mobileMode}))}isInMonth(s,e){return!!e&&r.firstDayOfMonth(e)<=s&&s<=r.lastDayOfMonth(e)}};let Q=ve;Q.displayName="MultiViewCalendar";Q.propTypes={activeRangeEnd:n.oneOf(["start","end"]),allowReverse:n.bool,bottomView:n.oneOf(["month","year","decade","century"]),className:n.string,defaultActiveView:n.oneOf(["month","year","decade","century"]),defaultValue:n.oneOfType([ee(n.instanceOf(Date)),n.arrayOf(n.instanceOf(Date)),n.shape({start:ee(n.instanceOf(Date)),end:ee(n.instanceOf(Date))})]),disabled:n.bool,focusedDate:n.instanceOf(Date),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,max:n.instanceOf(Date),min:n.instanceOf(Date),mode:n.oneOf(["single","multiple","range"]),onBlur:n.func,onChange:n.func,onFocus:n.func,tabIndex:n.number,topView:n.oneOf(["month","year","decade","century"]),value:n.oneOfType([ee(n.instanceOf(Date)),n.arrayOf(n.instanceOf(Date)),n.shape({start:ee(n.instanceOf(Date).isRequired),end:ee(n.instanceOf(Date).isRequired)})]),views:(s,e,t)=>{const i=s[e];return i!==void 0&&i<1?new Error(`Invalid prop '${e}' supplied to'${t}'. The '${e}' property cannot be less than 1'`):null},weekNumber:n.bool,dir:n.string};Q.defaultProps={disabled:!1,min:te,max:se,navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",tabIndex:0,bottomView:"month",views:2,allowReverse:!1};const As=d.createPropsContext(),Ht=d.withIdHOC(d.withPropsContext(As,Q));Ht.displayName="KendoReactMultiViewCalendar";k.registerForIntl(Q);k.registerForLocalization(Q);const Pe=class extends l.Component{constructor(s){super(s),this._element=null,this._calendar=null,this._startDateInput=l.createRef(),this._endDateInput=l.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)=>(e.value!==void 0?e.value:t.value)||B,this.calculateShow=(e,t)=>e.show!==void 0?e.show:t.show,this.renderCalendar=()=>{const e=this.value||B,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?l.createElement(this.props.calendar,{...t}):l.createElement(Ht,{...t,ref:this.setCalendarRef})},this.renderPopup=()=>{const e={popupClass:"k-daterangepicker-popup",animate:this._element!==null,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?l.createElement(this.props.popup,{...e},this.renderCalendar()):l.createElement(Qe.Popup,{...e},this.renderCalendar())},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t={expand:this.show,onClose:i=>this.handleCancel(i),adaptiveTitle:this.props.adaptiveTitle,windowWidth:e,footer:{cancelText:this.localizationService.toLanguageString(St,M[St]),onCancel:this.handleCancel,applyText:this.localizationService.toLanguageString(Ct,M[Ct]),onApply:this.handleBlur}};return l.createElement(st,{...t},l.createElement(ce.ActionSheetContent,{className:"!k-overflow-hidden"},l.createElement("div",{className:"k-scrollable-wrap"},this.renderCalendar())))},this.handleReverseClick=e=>{const t={start:this.value.end,end:this.value.start},i={syntheticEvent:e,nativeEvent:e.nativeEvent};this.handleChange(t,i)},this.handleReverseMouseDown=e=>{e.preventDefault()},this.handleFocus=e=>{clearTimeout(this.nextTickId),this.shouldFocusDateInput||this.mobileMode&&this.setState({currentValue:this.value});const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleClick=()=>{this.shouldFocusDateInput||this.setShow(!0)},this.handleBlur=e=>{this.nextTick(()=>{this.setShow(!1)});const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.handleCancel=e=>{this.nextTick(()=>{this.setShow(!1),this.setState({currentValue:B})});const{onCancel:t}=this.props;t&&t.call(void 0,e)},this.handleEndChange=e=>{const t={start:this.value.start,end:r.cloneDate(e.value||void 0)};this.handleChange(t,e)},this.handleStartChange=e=>{const t={start:r.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||B;const t=Array.isArray(e.value)?e.value[0]:e.value;return{start:this.value.end!==null?t:this.value.start,end:this.value.start!==null?t:this.value.end}},this.handleCalendarChange=e=>{const t=this.extractRangeFromValue(e);this.handleChange(t,e)},this.handleKeyDown=e=>{const{keyCode:t,altKey:i}=e;t===d.Keys.esc?(e.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1)):i&&t===d.Keys.down?(e.preventDefault(),this.shouldFocusCalendar=!0,this.setShow(!0),this.focusCalendarElement()):i&&t===d.Keys.up&&(e.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1))},this.handleChange=(e,t)=>{this.setState({value:e}),this.valueDuringOnChange=e;const{onChange:i}=this.props;if(i){const a={syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:this.value,show:this.show,target:this};i.call(void 0,a)}this.valueDuringOnChange=void 0},d.validatePackage(Se),this.state={show:this.props.show||this.props.defaultShow||Pe.defaultProps.defaultShow,value:this.props.value||this.props.defaultValue||Pe.defaultProps.defaultValue,currentValue:B},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(this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value)||B}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get min(){return this.props.min!==void 0?this.props.min:Pe.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:Pe.defaultProps.max}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get localizationService(){return k.provideLocalizationService(this)}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=it&&this.props.adaptive)}componentDidMount(){var s;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(s=this.document)!=null&&s.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 s;clearTimeout(this.nextTickId),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.disconnect()}render(){const s=this.value||B,e=this.mobileMode&&this.show?this.state.currentValue:s,t=(this.props.startDateInputSettings||{}).id||this._startInputId,i=(this.props.endDateInputSettings||{}).id||this._endInputId,a=d.classNames("k-daterangepicker",{"k-disabled":this.props.disabled},this.props.className),o=this.localizationService.toLanguageString(Ze,M[Ze]),h=this.localizationService.toLanguageString(Ge,M[Ge]),u=this.localizationService.toLanguageString(Xe,M[Xe]),c={disableSelection:this.mobileMode&&!0,label:o,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,...this.props.startDateInputSettings,value:e.start,onChange:this.handleStartChange},p={disableSelection:this.mobileMode&&!0,label:h,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,...this.props.endDateInputSettings,value:e.end,onChange:this.handleEndChange},m=l.createElement(N.Button,{type:"button",className:"k-select",fillMode:"flat",title:k.provideLocalizationService(this).toLanguageString(be,M[be]),onMouseDown:this.handleReverseMouseDown,onClick:this.handleReverseClick,"aria-controls":t+" "+i,"aria-label":k.provideLocalizationService(this).toLanguageString(be,M[be])},l.createElement(d.IconWrap,{style:{transform:"rotate(90deg)"},name:"arrows-swap",icon:J.arrowsSwapIcon}));return l.createElement(l.Fragment,null,l.createElement("span",{ref:f=>{this._element=f},className:a,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?l.createElement(this.props.startDateInput,{...c}):l.createElement(ae,{...c,ref:this._startDateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode}),(this.props.allowReverse||this.props.calendarSettings&&this.props.calendarSettings.allowReverse)&&this.props.swapButton?m:u,this.props.endDateInput?l.createElement(this.props.endDateInput,{...p}):l.createElement(ae,{...p,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 s=d.getActiveElement(document);(this.value.start===null||this.value.end!==null)&&s!==this.endDateInput.element?this.startDateInput.element.focus({preventScroll:!0}):s!==this.startDateInput.element&&this.endDateInput.element.focus({preventScroll:!0})}nextTick(s){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>s())}setShow(s){const{onOpen:e,onClose:t}=this.props;this.show!==s&&(this.setState({show:s}),s&&e&&e.call(void 0,{target:this}),!s&&t&&t.call(void 0,{target:this}))}calculateMedia(s){for(let e of s)this.setState({windowWidth:e.target.clientWidth})}};let Ve=Pe;Ve.displayName="DateRangePicker";Ve.propTypes={allowReverse:n.bool,calendarSettings:n.any,className:n.string,defaultShow:n.bool,defaultValue:n.shape({start:ee(n.instanceOf(Date).isRequired),end:ee(n.instanceOf(Date).isRequired)}),disabled:n.bool,endDateInputSettings:n.shape(re.propTypes),focusedDate:n.instanceOf(Date),format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,max:n.instanceOf(Date),min:n.instanceOf(Date),onBlur:n.func,onChange:n.func,onFocus:n.func,popupSettings:n.any,show:n.bool,startDateInputSettings:n.any,style:n.any,swapButton:n.any,tabIndex:n.number,dir:n.string,value:n.shape({start:ee(n.instanceOf(Date).isRequired),end:ee(n.instanceOf(Date).isRequired)})};Ve.defaultProps={allowReverse:!1,defaultShow:!1,defaultValue:B,disabled:!1,format:"d",max:se,min:te,swapButton:!1};const Hs=d.createPropsContext(),zs=d.withIdHOC(d.withPropsContext(Hs,Ve));zs.displayName="KendoReactDateRangePicker";k.registerForLocalization(Ve);class zt extends l.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=t=>{Promise.resolve().then(()=>{this.state.tab==="time"&&this._timePart&&this._timePart.focus(t);const i=this.calendarElement();this.state.tab==="date"&&i&&i.focus(t)})},this.calendarElement=()=>this._calendar&&this._calendar.element||this._calendarWrap&&this._calendarWrap.querySelector(".k-widget.k-calendar"),this.move=t=>{if(t==="right"&&this.state.tab==="time"||t==="left"&&this.state.tab==="date")return;const i=t==="left"?"date":"time";this.shouldFocusPart=!0,this.setState({tab:i})},this.dateTimeFooter=()=>{const{cancelButton:t}=this.props,i=this.localizationService.toLanguageString(Re,M[Re]),a=this.localizationService.toLanguageString(_e,M[_e]);return l.createElement("div",{className:"k-datetime-footer k-actions k-actions-stretched"},t&&l.createElement(N.Button,{type:"button",ref:o=>{this._cancelButton=o},className:"k-time-cancel",onClick:this.handleReject,onKeyDown:this.handleCancelKeyDown,title:i,"aria-label":i},i),l.createElement(N.Button,{type:"button",themeColor:"primary",ref:o=>{this._acceptButton=o},className:"k-time-accept",disabled:!this.hasDateValue,onClick:this.handleAccept,onKeyDown:this.handleSetKeyDown,title:a,"aria-label":a},a))},this.handleReject=t=>{this.setState({dateValue:this.props.value,timeValue:this.props.value||F});const i=this.mergeDate(this.props.value,this.props.value||F);if(this.props.onReject){const a={nativeEvent:t.nativeEvent,syntheticEvent:t,target:this,value:i};this.props.onReject.call(void 0,a)}},this.handleAccept=(t,i)=>{if(!this.state.dateValue||!this.state.timeValue||!this.hasDateValue)return;const a=this.mergeDate(this.state.dateValue,i||this.state.timeValue);this.props.onChange.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:a,target:this})},this.handleNowClick=t=>{this.setState({timeValue:ue()}),this.handleAccept(t,ue())},this.handleCalendarValueChange=t=>{t.syntheticEvent.stopPropagation(),this.setState({dateValue:t.value,tab:"time"}),this.shouldFocusPart=!0},this.handleTimeListContainerChange=t=>{this.setState({timeValue:t})},this.handleDateClick=t=>{t.stopPropagation(),this.move("left")},this.handleTimeClick=t=>{t.stopPropagation(),this.move("right")},this.handleKeyDown=t=>{const{keyCode:i,altKey:a}=t;if(!this.props.disabled)switch(i){case d.Keys.enter:!this.hasActiveButton()&&this.hasDateValue&&this.handleAccept(t);return;case d.Keys.left:if(!a)return;this.move("left");return;case d.Keys.right:if(!a)return;this.move("right");return;default:return}},this.handleCancelKeyDown=t=>{const{keyCode:i}=t;i===d.Keys.tab&&this._dateButtonRef&&this._dateButtonRef.element&&!this.hasDateValue&&(t.preventDefault(),this._dateButtonRef.element.focus())},this.handleSetKeyDown=t=>{const{keyCode:i}=t;i===d.Keys.tab&&this._dateButtonRef&&this._dateButtonRef.element&&(t.preventDefault(),this._dateButtonRef.element.focus())},this.handleDateKeyDown=t=>{var o,h,u,c;const{keyCode:i,shiftKey:a}=t;a&&i===d.Keys.tab&&(t.stopPropagation(),this.hasDateValue?(c=(u=this._acceptButton)==null?void 0:u.element)==null||c.focus():(h=(o=this._cancelButton)==null?void 0:o.element)==null||h.focus()),i===d.Keys.enter&&(t.stopPropagation(),this.move("left"))},this.handleTimeKeyDown=t=>{const{keyCode:i}=t;i===d.Keys.enter&&(t.stopPropagation(),this.move("right"))},this.handleTimePartMount=t=>{this.setState({timeValue:t})},this.state={tab:"date",dateValue:this.props.value,timeValue:this.props.value||F}}get calendar(){return this._calendar}get timePart(){return this._timePart}get hasDateValue(){return this.state.dateValue!==null}get localizationService(){return k.provideLocalizationService(this)}componentDidUpdate(e,t){var i,a;this.shouldFocusPart&&this.focus({preventScroll:!0}),(((i=e.value)==null?void 0:i.getTime())!==((a=this.props.value)==null?void 0:a.getTime())||this.state.tab!==t.tab&&this.props.value)&&this.setState({dateValue:e.value&&this.props.value&&r.isEqualDate(e.value,this.props.value)?this.state.dateValue:this.props.value,timeValue:this.props.value||F}),this.shouldFocusPart=!1}render(){const{disabled:e,min:t,max:i,weekNumber:a,focusedDate:o,format:h,mobileMode:u,footerActions:c}=this.props,p=d.classNames({"k-date-tab":this.state.tab==="date","k-time-tab":this.state.tab==="time","k-disabled":e},"k-datetime-wrap"),m=this.localizationService.toLanguageString(yt,M[yt]),f=this.localizationService.toLanguageString(kt,M[kt]),v={min:t,max:i,weekNumber:a,focusedDate:o,disabled:e||this.state.tab!=="date",value:this.state.dateValue,onChange:this.handleCalendarValueChange,navigation:!1,tabIndex:e||this.state.tab!=="date"?-1:void 0,mobileMode:u};return l.createElement("div",{onKeyDown:this.handleKeyDown,className:p,tabIndex:-1},l.createElement("div",{className:"k-datetime-buttongroup"},l.createElement(N.ButtonGroup,{width:"100%"},l.createElement(N.Button,{ref:g=>this._dateButtonRef=g,type:"button",selected:this.state.tab==="date",togglable:!0,onClick:this.handleDateClick,onKeyDown:this.handleDateKeyDown},m),l.createElement(N.Button,{type:"button",selected:this.state.tab==="time",togglable:!0,onClick:this.handleTimeClick,onKeyDown:this.handleTimeKeyDown},f))),l.createElement("div",{className:"k-datetime-selector"},l.createElement("div",{className:"k-datetime-calendar-wrap",ref:g=>this._calendarWrap=g},this.props.calendar?l.createElement(this.props.calendar,{key:this.state.tab,...v}):l.createElement(tt,{key:this.state.tab,ref:g=>{this._calendar=g},...v})),l.createElement("div",{className:"k-datetime-time-wrap"},l.createElement("div",{className:u?"k-reset k-timeselector-lg k-timeselector":""},l.createElement(pe,{key:1,onNowClick:this.handleNowClick,disabled:e||this.state.tab!=="time",ref:g=>{this._timePart=g},min:this.minTime||de,max:this.maxTime||oe,steps:this.props.steps,value:this.state.timeValue,format:h,onChange:this.handleTimeListContainerChange,onMount:this.handleTimePartMount,mobileMode:u})))),c&&this.dateTimeFooter())}get minTime(){return this.props.minTime!==void 0?this.props.minTime:this.normalizeRange(this.props.min,this.state.dateValue)}get maxTime(){return this.props.maxTime!==void 0?this.props.maxTime:this.normalizeRange(this.props.max,this.state.dateValue)}normalizeRange(e,t){return r.isEqualDate(e,t||L())?e:null}hasActiveButton(){if(!this._acceptButton)return!1;const e=d.getActiveElement(document);return this._acceptButton&&e===this._acceptButton.element||this._cancelButton&&e===this._cancelButton.element}mergeTime(e,t){return e&&t?q(t,e):t}mergeDate(e,t){return e?q(e||L(),t):t}}zt.defaultProps={footerActions:!0};k.registerForLocalization(zt);const X=class extends l.Component{constructor(s){super(s),this._element=null,this._dateInput=l.createRef(),this._dateTimeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{const e=this.dateInputElement();e&&e.focus()},this.renderPicker=()=>{const{disabled:e,minTime:t,maxTime:i,format:a,calendar:o,cancelButton:h,weekNumber:u,focusedDate:c}=this.props;return l.createElement(zt,{ref:p=>{this._dateTimeSelector=p},cancelButton:h,steps:this.props.steps,value:this.value,onChange:this.handleValueChange,onReject:this.handleReject,disabled:e,weekNumber:u,min:this.min,max:this.max,minTime:t,maxTime:i,focusedDate:c,format:a,calendar:o,mobileMode:this.mobileMode,footerActions:!this.mobileMode})},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t=k.provideLocalizationService(this).toLanguageString(Re,M[Re]),i=k.provideLocalizationService(this).toLanguageString(_e,M[_e]),a={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:e,footer:{cancelText:t,onCancel:o=>{var h;return(h=this._dateTimeSelector)==null?void 0:h.handleReject(o)},applyText:i,onApply:o=>{var h;return(h=this._dateTimeSelector)==null?void 0:h.handleAccept(o)}}};return l.createElement(st,{...a},l.createElement(ce.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderPicker()))},this.handleReject=()=>{this.shouldFocusDateInput=!0,this.setShow(!1)},this.handleValueChange=e=>{this.setState({value:r.cloneDate(e.value||void 0)}),this.valueDuringOnChange=e.value,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:t}=this.props;t&&t.call(void 0,{syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:this.value,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.handleDateIconClick=()=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:t,keyCode:i}=e;if(i===d.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}t&&(i===d.Keys.up||i===d.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=i===d.Keys.up,this.setShow(i===d.Keys.down))},this.dateInputElement=()=>this.dateInput&&this.dateInput.element||this.element&&this.element.querySelector(".k-dateinput > input.k-input-inner"),d.validatePackage(Se),this.state={value:this.props.defaultValue||X.defaultProps.defaultValue,show:this.props.defaultShow||X.defaultProps.defaultShow,focused:!1}}get _popupId(){return this.props.id+"-popup-id"}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get dateInput(){return this._dateInput.current}get value(){const s=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return s!==null?r.cloneDate(s):null}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get name(){return this.props.name}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=it&&this.props.adaptive)}get min(){return this.props.min!==void 0?this.props.min:X.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:X.defaultProps.max}get validity(){const s=as(this.value,this.min,this.max)&&_t(this.value,this.props.minTime||de,this.props.maxTime||oe),e=this.props.validationMessage!==void 0,t=(!this.required||this.value!==null)&&s,i=this.props.valid!==void 0?this.props.valid:t;return{customError:e,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:i,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:X.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:X.defaultProps.required}get dateInputComp(){return this.props.dateInput||X.defaultProps.dateInput}componentDidMount(){var s;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){const s=this.dateInputElement();this._dateTimeSelector&&this.show&&!this.prevShow&&this._dateTimeSelector.focus({preventScroll:!0}),s&&!this.show&&this.shouldFocusDateInput&&s.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var s;clearTimeout(this.nextTickId),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:s=X.defaultProps.size,rounded:e=X.defaultProps.rounded,fillMode:t=X.defaultProps.fillMode,disabled:i,tabIndex:a,title:o,id:h,format:u,formatPlaceholder:c,min:p,max:m,className:f,width:v,name:g,validationMessage:C,required:I,validityStyles:T,minTime:D,maxTime:E,ariaLabelledBy:w,ariaDescribedBy:A,popup:V=Qe.Popup}=this.props,P=!this.validityStyles||this.validity.valid,H={id:h,ariaLabelledBy:w,ariaDescribedBy:A,format:u,formatPlaceholder:c,disabled:i,title:o,validityStyles:T,validationMessage:C,required:I,min:p,max:m,minTime:D,maxTime:E,name:g,tabIndex:this.show?-1:a,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},x=l.createElement(d.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.handleBlur,onSyncFocus:this.props.onFocus,onSyncBlur:this.props.onBlur},({onFocus:O,onBlur:G})=>l.createElement(l.Fragment,null,l.createElement("div",{ref:U=>{this._element=U},className:d.classNames("k-input","k-datetimepicker",{[`k-input-${d.kendoThemeMaps.sizeMap[s]||s}`]:s,[`k-rounded-${d.kendoThemeMaps.roundedMap[e]||e}`]:e,[`k-input-${t}`]:t,"k-invalid":!P,"k-required":this.required,"k-disabled":this.props.disabled},f),onKeyDown:this.handleKeyDown,style:{width:v},onFocus:this.mobileMode?void 0:O,onBlur:G,onClick:this.mobileMode?this.handleDateIconClick:void 0},l.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode,...H}),l.createElement(N.Button,{tabIndex:-1,type:"button",icon:"calendar",svgIcon:J.calendarIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleDateIconClick,title:k.provideLocalizationService(this).toLanguageString(ye,M[ye]),className:"k-input-button",rounded:null,"aria-label":k.provideLocalizationService(this).toLanguageString(ye,M[ye])}),l.createElement(V,{show:this.show,animate:this.element!==null,anchor:this.element,popupClass:"k-datetime-container k-reset",id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"}},!this.mobileMode&&this.renderPicker())),this.mobileMode&&this.renderAdaptivePopup()));return this.props.label?l.createElement(Ft,{dateInput:this._dateInput,label:this.props.label,editorId:h,editorValid:P,editorDisabled:this.props.disabled,children:x,style:{width:this.props.width}}):x}setShow(s){const{onOpen:e,onClose:t}=this.props;this.show!==s&&(this.setState({show:s}),s&&e&&e.call(void 0,{target:this}),!s&&t&&t.call(void 0,{target:this}))}nextTick(s){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>s())}calculateMedia(s){for(const e of s)this.setState({windowWidth:e.target.clientWidth})}};let Oe=X;Oe.displayName="DateTimePicker";Oe.propTypes={className:n.string,defaultShow:n.bool,defaultValue:n.instanceOf(Date),disabled:n.bool,focusedDate:n.instanceOf(Date),format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),formatPlaceholder:n.oneOfType([n.oneOf(["wide","narrow","short","formatPattern"]),n.shape({year:n.string,month:n.string,day:n.string,hour:n.string,minute:n.string,second:n.string})]),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,min:n.instanceOf(Date),max:n.instanceOf(Date),name:n.string,popupSettings:n.shape({animate:n.bool,appendTo:n.any,popupClass:n.string}),show:n.bool,tabIndex:n.number,title:n.string,value:n.instanceOf(Date),weekNumber:n.bool,width:n.oneOfType([n.number,n.string]),validationMessage:n.string,required:n.bool,validate:n.bool,valid:n.bool,cancelButton:n.bool,size:n.oneOf([null,"small","medium","large"]),rounded:n.oneOf([null,"small","medium","large","full"]),fillMode:n.oneOf([null,"solid","flat","outline"])};Oe.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"g",max:se,min:te,popupSettings:{},tabIndex:0,weekNumber:!1,required:!1,validityStyles:!0,cancelButton:!0,dateInput:ae,size:"medium",rounded:"medium",fillMode:"solid"};const qs=d.createPropsContext(),Ws=d.withIdHOC(d.withPropsContext(qs,Oe));Ws.displayName="KendoReactDateTimePicker";k.registerForLocalization(Oe);exports.Action=b;exports.BusViewService=Et;exports.Calendar=tt;exports.CalendarCell=is;exports.CalendarHeaderTitle=gs;exports.CalendarNavigationItem=ws;exports.CalendarPropsContext=bs;exports.CalendarViewEnum=S;exports.CalendarWeekCell=ns;exports.CalendarWithoutContext=ne;exports.CenturyViewService=ls;exports.DOMService=ds;exports.DateInput=ae;exports.DateInputPropsContext=ks;exports.DateInputWithoutContext=re;exports.DatePicker=Is;exports.DatePickerPropsContext=xs;exports.DatePickerWithoutContext=Me;exports.DateRangePicker=zs;exports.DateRangePickerPropsContext=Hs;exports.DateRangePickerWithoutContext=Ve;exports.DateTimePicker=Ws;exports.DateTimePickerPropsContext=qs;exports.DateTimePickerWithoutContext=Oe;exports.DayPeriodService=Ms;exports.DecadeViewService=hs;exports.EMPTY_SELECTIONRANGE=B;exports.Header=xe;exports.HorizontalViewList=ke;exports.HoursService=Vs;exports.MAX_DATE=se;exports.MAX_TIME=oe;exports.MIN_DATE=te;exports.MIN_TIME=de;exports.MinutesService=Ns;exports.MonthViewService=cs;exports.MultiViewCalendar=Ht;exports.MultiViewCalendarPropsContext=As;exports.MultiViewCalendarWithoutContext=Q;exports.NavigationService=Vt;exports.PickerWrap=Cs;exports.ScrollSyncService=ps;exports.SecondsService=Fs;exports.TimeList=Be;exports.TimePart=pe;exports.TimePicker=Bs;exports.TimePickerPropsContext=Ls;exports.TimePickerWithoutContext=Ee;exports.TimeSelector=Te;exports.TodayCommand=Ie;exports.ToggleButton=Ss;exports.ViewList=Le;exports.Virtualization=Ce;exports.WeekNamesService=ms;exports.YearViewService=us;exports.dateInputsMessages=M;exports.decreaseValue=De;exports.end=Ge;exports.getNow=ue;exports.getToday=L;exports.increaseValue=we;exports.separator=Xe;exports.start=Ze;exports.swapStartEnd=be;exports.today=$e;exports.toggleCalendar=je;exports.toggleDateTimeSelector=ye;
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./calendar/components/Calendar.js"),i=require("./dateinput/DateInput.js"),a=require("./datepicker/DatePicker.js"),n=require("./timepicker/TimePicker.js"),o=require("./calendar/components/MultiViewCalendar.js"),c=require("./daterangepicker/DateRangePicker.js"),u=require("./calendar/components/CalendarCell.js"),l=require("./calendar/components/CalendarWeekCell.js"),C=require("./calendar/components/CalendarHeaderTitle.js"),d=require("./calendar/components/CalendarNavigationItem.js"),S=require("./calendar/models/NavigationAction.js"),P=require("./calendar/models/CalendarViewEnum.js"),T=require("./calendar/models/SelectionRange.js"),s=require("./datetimepicker/DateTimePicker.js"),v=require("./datepicker/ToggleButton.js"),D=require("./common/PickerWrap.js"),m=require("./calendar/components/Header.js"),q=require("./timepicker/TimeList.js"),V=require("./timepicker/TimePart.js"),g=require("./calendar/components/TodayCommand.js"),e=require("./messages/index.js"),k=require("./calendar/components/ViewList.js"),w=require("./virtualization/Virtualization.js"),M=require("./calendar/components/HorizontalViewList.js"),p=require("./timepicker/TimeSelector.js"),t=require("./utils.js"),x=require("./timepicker/utils.js"),W=require("./timepicker/services/DayPeriodService.js"),E=require("./timepicker/services/HoursService.js"),I=require("./timepicker/services/MinutesService.js"),N=require("./timepicker/services/SecondsService.js"),y=require("./calendar/services/BusViewService.js"),h=require("./calendar/services/CenturyViewService.js"),A=require("./calendar/services/DecadeViewService.js"),H=require("./calendar/services/DOMService.js"),L=require("./calendar/services/MonthViewService.js"),R=require("./calendar/services/NavigationService.js"),_=require("./calendar/services/ScrollSyncService.js"),z=require("./calendar/services/WeekNamesService.js"),B=require("./calendar/services/YearViewService.js");exports.Calendar=r.Calendar;exports.CalendarPropsContext=r.CalendarPropsContext;exports.CalendarWithoutContext=r.CalendarWithoutContext;exports.DateInput=i.DateInput;exports.DateInputPropsContext=i.DateInputPropsContext;exports.DateInputWithoutContext=i.DateInputWithoutContext;exports.DatePicker=a.DatePicker;exports.DatePickerPropsContext=a.DatePickerPropsContext;exports.DatePickerWithoutContext=a.DatePickerWithoutContext;exports.TimePicker=n.TimePicker;exports.TimePickerPropsContext=n.TimePickerPropsContext;exports.TimePickerWithoutContext=n.TimePickerWithoutContext;exports.MultiViewCalendar=o.MultiViewCalendar;exports.MultiViewCalendarPropsContext=o.MultiViewCalendarPropsContext;exports.MultiViewCalendarWithoutContext=o.MultiViewCalendarWithoutContext;exports.DateRangePicker=c.DateRangePicker;exports.DateRangePickerPropsContext=c.DateRangePickerPropsContext;exports.DateRangePickerWithoutContext=c.DateRangePickerWithoutContext;exports.CalendarCell=u.CalendarCell;exports.CalendarWeekCell=l.CalendarWeekCell;exports.CalendarHeaderTitle=C.CalendarHeaderTitle;exports.CalendarNavigationItem=d.CalendarNavigationItem;exports.Action=S.Action;exports.CalendarViewEnum=P.CalendarViewEnum;exports.EMPTY_SELECTIONRANGE=T.EMPTY_SELECTIONRANGE;exports.DateTimePicker=s.DateTimePicker;exports.DateTimePickerPropsContext=s.DateTimePickerPropsContext;exports.DateTimePickerWithoutContext=s.DateTimePickerWithoutContext;exports.ToggleButton=v.ToggleButton;exports.PickerWrap=D.PickerWrap;exports.Header=m.Header;exports.TimeList=q.TimeList;exports.TimePart=V.TimePart;exports.TodayCommand=g.TodayCommand;exports.dateInputsMessages=e.messages;exports.decreaseValue=e.decreaseValue;exports.end=e.end;exports.increaseValue=e.increaseValue;exports.separator=e.separator;exports.start=e.start;exports.swapStartEnd=e.swapStartEnd;exports.today=e.today;exports.toggleCalendar=e.toggleCalendar;exports.toggleDateTimeSelector=e.toggleDateTimeSelector;exports.ViewList=k.ViewList;exports.Virtualization=w.Virtualization;exports.HorizontalViewList=M.HorizontalViewList;exports.TimeSelector=p.TimeSelector;exports.MAX_DATE=t.MAX_DATE;exports.MAX_TIME=t.MAX_TIME;exports.MIN_DATE=t.MIN_DATE;exports.MIN_TIME=t.MIN_TIME;exports.getToday=t.getToday;exports.getNow=x.getNow;exports.DayPeriodService=W.DayPeriodService;exports.HoursService=E.HoursService;exports.MinutesService=I.MinutesService;exports.SecondsService=N.SecondsService;exports.BusViewService=y.BusViewService;exports.CenturyViewService=h.CenturyViewService;exports.DecadeViewService=A.DecadeViewService;exports.DOMService=H.DOMService;exports.MonthViewService=L.MonthViewService;exports.NavigationService=R.NavigationService;exports.ScrollSyncService=_.ScrollSyncService;exports.WeekNamesService=z.WeekNamesService;exports.YearViewService=B.YearViewService;