@progress/kendo-react-scheduler 16.3.0-develop.9 → 16.4.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 (92) hide show
  1. package/NOTICE.txt +19 -19
  2. package/Scheduler.d.ts +46 -0
  3. package/Scheduler.js +1 -1
  4. package/Scheduler.mjs +322 -297
  5. package/components/EventOverviewPopover.d.ts +36 -0
  6. package/components/EventOverviewPopover.js +8 -0
  7. package/components/EventOverviewPopover.mjs +133 -0
  8. package/components/MoreEventsPopover.js +1 -1
  9. package/components/MoreEventsPopover.mjs +40 -39
  10. package/components/SchedulerForm.js +1 -1
  11. package/components/SchedulerForm.mjs +7 -6
  12. package/components/SchedulerQuickCreateForm.d.ts +63 -0
  13. package/components/SchedulerQuickCreateForm.js +8 -0
  14. package/components/SchedulerQuickCreateForm.mjs +144 -0
  15. package/components/ShowMoreItemsButton.js +1 -1
  16. package/components/ShowMoreItemsButton.mjs +1 -1
  17. package/dist/cdn/js/kendo-react-scheduler.js +1 -1
  18. package/editors/KeepResetCustomEventsDialog.d.ts +19 -0
  19. package/editors/KeepResetCustomEventsDialog.js +8 -0
  20. package/editors/KeepResetCustomEventsDialog.mjs +34 -0
  21. package/editors/SchedulerFormEditor.d.ts +18 -4
  22. package/editors/SchedulerFormEditor.js +1 -1
  23. package/editors/SchedulerFormEditor.mjs +273 -238
  24. package/editors/SchedulerRecurrenceDialog.js +1 -1
  25. package/editors/SchedulerRecurrenceDialog.mjs +142 -135
  26. package/editors/ZonedSplitDateTime.d.ts +30 -0
  27. package/editors/ZonedSplitDateTime.js +1 -1
  28. package/editors/ZonedSplitDateTime.mjs +58 -47
  29. package/hooks/index.d.ts +4 -0
  30. package/hooks/useCloseOnAnchorScrollOut.d.ts +18 -0
  31. package/hooks/useCloseOnAnchorScrollOut.js +8 -0
  32. package/hooks/useCloseOnAnchorScrollOut.mjs +51 -0
  33. package/hooks/useDeferredClick.d.ts +26 -0
  34. package/hooks/useDeferredClick.js +8 -0
  35. package/hooks/useDeferredClick.mjs +24 -0
  36. package/hooks/useEventOverviewPlacement.d.ts +23 -0
  37. package/hooks/useEventOverviewPlacement.js +8 -0
  38. package/hooks/useEventOverviewPlacement.mjs +14 -0
  39. package/hooks/useQuickCreatePlacement.d.ts +26 -0
  40. package/hooks/useQuickCreatePlacement.js +8 -0
  41. package/hooks/useQuickCreatePlacement.mjs +28 -0
  42. package/hooks/useSlotExpand.d.ts +2 -1
  43. package/hooks/useSlotExpand.js +1 -1
  44. package/hooks/useSlotExpand.mjs +107 -49
  45. package/index.d.mts +3 -1
  46. package/index.d.ts +3 -1
  47. package/index.js +1 -1
  48. package/index.mjs +112 -107
  49. package/items/SchedulerEditItem.js +1 -1
  50. package/items/SchedulerEditItem.mjs +600 -509
  51. package/items/SchedulerItem.d.ts +2 -0
  52. package/items/SchedulerItem.js +1 -1
  53. package/items/SchedulerItem.mjs +137 -130
  54. package/items/SchedulerProportionalViewItem.js +1 -1
  55. package/items/SchedulerProportionalViewItem.mjs +95 -91
  56. package/items/SchedulerViewItem.js +1 -1
  57. package/items/SchedulerViewItem.mjs +168 -157
  58. package/items/hooks/use-drag-item.js +1 -1
  59. package/items/hooks/use-drag-item.mjs +46 -45
  60. package/items/hooks/use-resize-item.d.ts +1 -0
  61. package/items/hooks/use-resize-item.js +1 -1
  62. package/items/hooks/use-resize-item.mjs +84 -78
  63. package/messages/index.d.ts +33 -0
  64. package/messages/index.js +1 -1
  65. package/messages/index.mjs +158 -136
  66. package/package-metadata.js +1 -1
  67. package/package-metadata.mjs +2 -2
  68. package/package.json +13 -13
  69. package/recurrence/RecurrenceEditor.js +1 -1
  70. package/recurrence/RecurrenceEditor.mjs +64 -64
  71. package/recurrence/common.d.ts +10 -0
  72. package/recurrence/common.js +1 -1
  73. package/recurrence/common.mjs +48 -44
  74. package/services/itemsService.d.ts +5 -2
  75. package/services/itemsService.js +1 -1
  76. package/services/itemsService.mjs +36 -36
  77. package/slots/SchedulerEditSlot.d.ts +15 -0
  78. package/slots/SchedulerEditSlot.js +1 -1
  79. package/slots/SchedulerEditSlot.mjs +162 -92
  80. package/slots/SchedulerViewSlot.js +1 -1
  81. package/slots/SchedulerViewSlot.mjs +7 -7
  82. package/utils/index.d.ts +2 -0
  83. package/utils/index.js +1 -1
  84. package/utils/index.mjs +103 -99
  85. package/views/agenda/AgendaView.js +1 -1
  86. package/views/agenda/AgendaView.mjs +32 -30
  87. package/views/common/SchedulerDrag.js +1 -1
  88. package/views/common/SchedulerDrag.mjs +26 -23
  89. package/views/common/SchedulerResize.js +1 -1
  90. package/views/common/SchedulerResize.mjs +29 -26
  91. package/views/day/MultiDayView.js +1 -1
  92. package/views/day/MultiDayView.mjs +160 -152
@@ -12,4 +12,4 @@
12
12
  * Licensed under commercial license. See LICENSE.md in the package root for more information
13
13
  *-------------------------------------------------------------------------------------------
14
14
  */
15
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-date-math"),require("@progress/kendo-react-common"),require("@progress/kendo-data-query"),require("@progress/kendo-react-intl"),require("@progress/kendo-react-buttons"),require("react-dom"),require("@progress/kendo-react-dateinputs"),require("@progress/kendo-react-popup"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-form"),require("@progress/kendo-react-dialogs"),require("@progress/kendo-recurrence"),require("@progress/kendo-react-labels"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-dropdowns"),require("@progress/kendo-react-tooltip")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-date-math","@progress/kendo-react-common","@progress/kendo-data-query","@progress/kendo-react-intl","@progress/kendo-react-buttons","react-dom","@progress/kendo-react-dateinputs","@progress/kendo-react-popup","@progress/kendo-svg-icons","@progress/kendo-react-form","@progress/kendo-react-dialogs","@progress/kendo-recurrence","@progress/kendo-react-labels","@progress/kendo-react-inputs","@progress/kendo-react-dropdowns","@progress/kendo-react-tooltip"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactScheduler={},e.React,e.PropTypes,e.KendoDateMath,e.KendoReactCommon,e.KendoDataQuery,e.KendoReactIntl,e.KendoReactButtons,e.ReactDOM,e.KendoReactDateinputs,e.KendoReactPopup,e.KendoSvgIcons,e.KendoReactForm,e.KendoReactDialogs,e.KendoRecurrence,e.KendoReactLabels,e.KendoReactInputs,e.KendoReactDropdowns,e.KendoReactTooltip)}(this,function(e,t,r,a,n,l,o,s,c,i,u,d,m,p,g,E,v,y,h){"use strict";function f(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var k=f(t),D=f(c);const b=(e,t=0,r=0,a=[])=>{if(e.length<=t)return[a];const n=[];return e[t].data.map(l=>{n.push(...b(e,t+1,r+1,[...a,{...l,field:e[t].field,valueField:e[t].valueField,colorField:e[t].colorField,multiple:e[t].multiple}]))}),n};function C(e,t){const r=[];if(!t||!t.length)return r;if(e&&e.resources&&e.resources.length){const a=e.resources;for(let e=0;e<a.length;e++){const n=t.find(t=>t.name===a[e]);r.push(n)}}return r}const S=(e,t=e.length-1)=>{const r=Math.max(0,t),a=[];e&&e.length||(e=[{}]);const n=(e[r].data||[]).map(t=>({...t,text:t[e[r].textField]}))||[],l=n.length;let o=1;for(let t=0;t<=r;t++)o*=(e[t].data||[]).length||1;for(let e=0;e<o;e++)n[e%l]&&a.push(n[e%l]);return a},w=e=>{if(!e)return{top:0,left:0,width:0,height:0,right:0};return{top:e.offsetTop,left:e.offsetLeft,right:e.offsetParent?e.offsetParent.offsetWidth-(e.offsetLeft+e.offsetWidth):0,width:e.offsetWidth,height:e.offsetHeight}},I=(e,t=!1)=>parseFloat(window.getComputedStyle(e)[t?"paddingLeft":"paddingTop"]||"0")+parseFloat(window.getComputedStyle(e)[t?"paddingRight":"paddingBottom"]||"0"),R=(e,t,r=!1)=>{e&&(void 0!==t.top&&(e.style.top=`${t.top}px`),void 0!==t.left&&(e.style.left=`${t.left}px`),void 0!==t.width&&(e.style.width=`${t.width}px`),void 0!==t.height&&!r&&(e.style.height="number"==typeof t.height?`${t.height}px`:t.height),r&&(e.style.minHeight=void 0!==t.height&&t.height>0?`${t.height}px`:""))},T=e=>e[0],x=e=>e[e.length-1],M=e=>{const t=new Set;return e.forEach(e=>{t.add(e.field)}),t.size===e.length};const N=(e,t,r,a=0)=>{if(a===r)return null;let n=null;const l=document.elementFromPoint(e,t);if(!l)return n;if("true"===l.getAttribute("data-slot"))return l;const o=l.style.pointerEvents;return l.style.pointerEvents="none",n=N(e,t,r,a+1),l.style.pointerEvents=o,n},A=(e,t)=>n.getter(t)(e),_=(e,t,r)=>{if(t)return n.setter(t)(e,r)},L=e=>null!=e;function z(e){return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))}const O=(e,t,r)=>{const a=F(e,t)?A(e,t.id):A(e,t.recurrenceId);return r.find(e=>A(e,t.id)===a)},F=(e,t)=>{const r=A(e,t.id),a=A(e,t.recurrenceId),n=A(e,t.recurrenceRule);return null!=r&&!!n&&null==a},W=(e,t)=>Math.max(e.getTime(),t.getTime()),P=(e,t)=>Math.min(e.getTime(),t.getTime()),H=(e,t,r,a,n=!1)=>n?W(t,a)-P(e,r)<=t.getTime()-e.getTime()+(a.getTime()-r.getTime()):W(t,a)-P(e,r)<t.getTime()-e.getTime()+(a.getTime()-r.getTime()),K={id:"id",start:"start",startTimezone:"startTimezone",originalStart:"originalStart",end:"end",endTimezone:"endTimezone",isAllDay:"isAllDay",title:"title",description:"description",recurrenceRule:"recurrenceRule",recurrenceId:"recurrenceId",recurrenceExceptions:"recurrenceExceptions",readonly:"readonly"},$=(e,t,r)=>(t.getHours()<e.getHours()||t.getHours()===e.getHours()&&t.getMinutes()<=e.getMinutes())&&(e.getHours()<r.getHours()||r.getHours()===e.getHours()&&e.getMinutes()<r.getMinutes()),B=(e,t,r)=>t<r?t<=e&&e<=r:e<=r||t<=e,V=e=>{let t=0;const r=e.slice();return r.sort((e,t)=>e-t).forEach((e,a)=>{r[a]===a&&(t=a+1)}),t},G=(e,t,r=!1)=>{e.forEach(e=>{e.order=null}),t.forEach(e=>e.items.splice(0,e.items.length));const a=[...e].sort((e,t)=>e.start.getTime()-t.start.getTime());t.forEach(e=>{const t=[];a.forEach(a=>{if((r||a.isAllDay===e.isAllDay)&&a.range.index===e.range.index&&(void 0===a.range.isAllDay||void 0===e.range.isAllDay||a.range.isAllDay===e.range.isAllDay)&&a.group.index===e.group.index&&H(a.start,a.end,e.start,e.end)){if(null!==a.order&&void 0!==a.order)t.includes(a.order)||(t.push(a.order),t.sort((e,t)=>e-t));else{const e=V(t);a.order=e,t.push(e),t.sort((e,t)=>e-t)}e.items.push(a)}})})},U=(e,t,r=!1)=>{e.forEach(e=>e.slots.splice(0,e.slots.length)),e.forEach(e=>{t.forEach(t=>{(r||e.isAllDay===t.isAllDay)&&e.range.index===t.range.index&&(void 0===e.range.isAllDay||void 0===t.range.isAllDay||e.range.isAllDay===t.range.isAllDay)&&e.group.index===t.group.index&&H(e.start,e.end,t.start,t.end)&&e.slots.push(t)})})},Z=(...e)=>{},q=(e,t,r=!1,a=!1)=>{const n=e.current;if(!n||!t)return null;const o=t.filter(e=>null!==e.current&&null!==e.current.element),s=l.orderBy(o,[{field:"current.props.group.index",dir:"asc"},{field:"current.props.range.index",dir:"asc"},r?{field:""}:{field:"current.props.isAllDay",dir:"desc"},{field:"current.props.start",dir:"asc"}]),c=s.findIndex(e=>null!==e.current&&!(e.current.props.uid!==n.props.uid||void 0!==e.current.props.occurrenceId&&e.current.props.occurrenceId!==n.props.occurrenceId||e.current.props.group.index!==n.props.group.index||e.current.props.range.index!==n.props.range.index||!r&&e.current.props.isAllDay!==n.props.isAllDay));return s[c+(a?-1:1)]},Y=(e,t)=>(e.order||0)-(t.order||0),j=6e4,X=[{}],Q=new Date(1900,0,1),J=new Date(2099,11,31);a.ZonedDate.fromLocalDate(Q),a.ZonedDate.fromLocalDate(J);var ee=(e=>(e[e.create=0]="create",e[e.update=1]="update",e[e.remove=2]="remove",e))(ee||{});const te=k.createContext({current:null}),re=()=>k.useContext(te);te.displayName="SchedulerElementContext";const ae=k.createContext({}),ne=()=>k.useContext(ae);ae.displayName="SchedulerPropsContext";const le=k.createContext([]),oe=()=>k.useContext(le);le.displayName="SchedulerViewsContext";const se=k.createContext(K),ce=()=>k.useContext(se);se.displayName="SchedulerFieldsContext";const ie=k.createContext({dateFormat:"{0:D}",shortDateFormat:"{0:d}"});ie.displayName="SchedulerDateFormatContext";const ue=k.createContext([{index:0,resources:[]}]),de=()=>k.useContext(ue);ue.displayName="SchedulerGroupsContext";const me=k.createContext({start:new Date,end:new Date,zonedStart:a.ZonedDate.fromLocalDate(new Date),zonedEnd:a.ZonedDate.fromLocalDate(new Date)}),pe=()=>k.useContext(me);me.displayName="SchedulerDateRangeContext";const ge=k.createContext(null),Ee=()=>k.useContext(ge);ge.displayName="SchedulerOrientationContext";const ve=k.createContext([new Date,Z]),ye=()=>k.useContext(ve);ve.displayName="SchedulerDateContext";const he=k.createContext([[],Z]),fe=()=>k.useContext(he);he.displayName="SchedulerDataContext";const ke=k.createContext(["day",Z]),De=()=>k.useContext(ke);ke.displayName="SchedulerActiveViewContext";const be=k.createContext([null,()=>{}]);be.displayName="SchedulerItemSelectionContext";const Ce=({children:e,element:t,props:r,views:a,fields:n,groups:l,dateRange:o,dateFormat:s,orientation:c,date:i,data:u,activeView:d,selection:m})=>k.createElement(te.Provider,{value:t},k.createElement(ae.Provider,{value:r},k.createElement(le.Provider,{value:a},k.createElement(se.Provider,{value:n},k.createElement(ie.Provider,{value:s},k.createElement(ue.Provider,{value:l},k.createElement(me.Provider,{value:o},k.createElement(ge.Provider,{value:c},k.createElement(ve.Provider,{value:i},k.createElement(he.Provider,{value:u},k.createElement(ke.Provider,{value:d},k.createElement(be.Provider,{value:m},e)))))))))))),Se=(e,t,r)=>{const[a,n]=k.useState(t||e),l=k.useCallback((e,t)=>{n(e),r&&r.call(void 0,{...t,value:e})},[r,n]);return[void 0!==t?t:a,l]},we=k.forwardRef((e,t)=>{const{className:r,...a}=e,l=k.useRef(null),o=k.useRef(null);k.useImperativeHandle(o,()=>({element:l.current,props:e})),k.useImperativeHandle(t,()=>o.current);const c=k.useMemo(()=>n.classNames("k-scheduler-toolbar",r),[r]);return k.createElement(s.Toolbar,{id:e.id,ref:e=>{e&&(l.current=e.element)},className:c,...a},e.children)});we.displayName="KendoReactSchedulerHeader";const Ie=k.forwardRef((e,t)=>{const{className:r,...a}=e,l=k.useRef(null);return k.useImperativeHandle(t,()=>({element:l.current,props:e})),k.createElement(s.ToolbarItem,{ref:e=>{e&&(l.current=e.element)},className:n.classNames(r),...a},e.children)});Ie.displayName="KendoReactSchedulerSchedulerNavigation";const Re=k.forwardRef((e,t)=>{const{className:r,...a}=e,l=k.useRef(null);return k.useImperativeHandle(t,()=>({element:l.current,props:e})),k.createElement(s.ToolbarItem,{ref:e=>{e&&(l.current=e.element)},className:n.classNames("k-scheduler-views",r),...a},e.children)});Re.displayName="KendoReactSchedulerViewSelector";const Te=k.forwardRef((e,t)=>{const{className:r,style:a,...l}=e,o=k.useRef(null),c=k.useRef(null);k.useImperativeHandle(o,()=>({element:c.current,props:e})),k.useImperativeHandle(t,()=>o.current);const i=k.useMemo(()=>n.classNames("k-scheduler-footer",e.className),[e.className]);return k.createElement(s.Toolbar,{ref:e=>{e&&(c.current=e.element)},className:i,style:{boxShadow:"none",...a},...l},e.children)});Te.displayName="KendoReactSchedulerFooter";const xe="scheduler.allEvents",Me="scheduler.allDay",Ne="scheduler.today",Ae="scheduler.timelineViewTitle",_e="scheduler.weekViewTitle",Le="scheduler.workWeekViewTitle",ze="scheduler.agendaViewTitle",Oe="scheduler.dayViewTitle",Fe="scheduler.monthViewTitle",We="scheduler.deleteTitle",Pe="scheduler.previousTitle",He="scheduler.nextTitle",Ke="scheduler.showFullDay",$e="scheduler.showWorkDay",Be="scheduler.editOccurrence",Ve="scheduler.editSeries",Ge="scheduler.editRecurringConfirmation",Ue="scheduler.editRecurringDialogTitle",Ze="scheduler.editSave",qe="scheduler.editCancel",Ye="scheduler.editorTitle",je="scheduler.editorEventTitle",Xe="scheduler.editorEventStart",Qe="scheduler.editorEventStartTimeZone",Je="scheduler.editorEventEnd",et="scheduler.editorEventEndTimeZone",tt="scheduler.editorEventAllDay",rt="scheduler.editorEventDescription",at="scheduler.editorEventSeparateTimeZones",nt="scheduler.editorEventTimeZone",lt="scheduler.recurrenceEditorRepeat",ot="scheduler.recurrenceEditorDailyInterval",st="scheduler.recurrenceEditorDailyRepeatEvery",ct="scheduler.recurrenceEditorWeeklyInterval",it="scheduler.recurrenceEditorWeeklyRepeatEvery",ut="scheduler.recurrenceEditorWeeklyRepeatOn",dt="scheduler.recurrenceEditorMonthlyDay",mt="scheduler.recurrenceEditorMonthlyInterval",pt="scheduler.recurrenceEditorMonthlyRepeatEvery",gt="scheduler.recurrenceEditorMonthlyRepeatOn",Et="scheduler.recurrenceEditorYearlyOf",vt="scheduler.recurrenceEditorYearlyRepeatEvery",yt="scheduler.recurrenceEditorYearlyRepeatOn",ht="scheduler.recurrenceEditorYearlyInterval",ft="scheduler.recurrenceEditorFrequenciesDaily",kt="scheduler.recurrenceEditorFrequenciesMonthly",Dt="scheduler.recurrenceEditorFrequenciesNever",bt="scheduler.recurrenceEditorFrequenciesWeekly",Ct="scheduler.recurrenceEditorFrequenciesYearly",St="scheduler.recurrenceEditorOffsetPositionsFirst",wt="scheduler.recurrenceEditorOffsetPositionsSecond",It="scheduler.recurrenceEditorOffsetPositionsThird",Rt="scheduler.recurrenceEditorOffsetPositionsFourth",Tt="scheduler.recurrenceEditorOffsetPositionsLast",xt="scheduler.recurrenceEditorWeekdaysDay",Mt="scheduler.recurrenceEditorWeekdaysWeekday",Nt="scheduler.recurrenceEditorWeekdaysWeekendday",At="scheduler.recurrenceEditorEndAfter",_t="scheduler.recurrenceEditorEndOccurrence",Lt="scheduler.recurrenceEditorEndLabel",zt="scheduler.recurrenceEditorEndNever",Ot="scheduler.recurrenceEditorEndOn",Ft="scheduler.editorDelete",Wt="scheduler.deleteConfirmation",Pt="scheduler.deleteSeriesConfirmation",Ht="scheduler.deleteRecurringConfirmation",Kt="scheduler.deleteOccurrence",$t="scheduler.deleteSeries",Bt="scheduler.deleteDialogTitle",Vt="scheduler.deleteSeriesDialogTitle",Gt="scheduler.deleteRecurringDialogTitle",Ut="scheduler.dateTitle",Zt="scheduler.timeTitle",qt="scheduler.eventTitle",Yt="scheduler.editorValidationRequired",jt="scheduler.editorValidationStart",Xt="scheduler.editorValidationEnd",Qt="scheduler.noEvents",Jt="scheduler.popoverEvents",er="scheduler.moreEvents",tr="scheduler.resetTimezoneDialogTitle",rr="scheduler.resetTimezoneConfirmation",ar="scheduler.resetTimezoneNo",nr="scheduler.resetTimezoneYes",lr="scheduler.recurrenceEditorDialogTitle",or="scheduler.recurrenceEditorRemoveRecurrence",sr="scheduler.removeRecurrenceConfirmation",cr="scheduler.removeRecurrenceNo",ir="scheduler.removeRecurrenceYes",ur="scheduler.recurrenceEditorWeeklyRepeatOnDays",dr="scheduler.editorMakeRecurring",mr="scheduler.editorTimezoneButton",pr="scheduler.editorSetTimezoneTitle",gr="scheduler.editorResetTimezoneTitle",Er="scheduler.editorResetTimezoneAriaLabel",vr="scheduler.editorStartTimeAriaLabel",yr="scheduler.editorEndTimeAriaLabel",hr="scheduler.editorDateConnectorFrom",fr="scheduler.editorDateConnectorTo",kr="scheduler.editorNewEvent",Dr="scheduler.editorEditEvent",br="scheduler.toolbarLabel",Cr={[Yt]:"Field is required.",[jt]:"Start time must be before End time.",[Xt]:"End time must be after Start time.",[xe]:"All events",[Me]:"all day",[Ne]:"Today",[Oe]:"Day",[Fe]:"Month",[_e]:"Week",[Le]:"Work Week",[Ae]:"Timeline",[ze]:"Agenda",[We]:"Delete",[Pe]:"Previous",[He]:"Next",[Ke]:"Show full day",[$e]:"Show business hours",[Be]:"Edit current occurrence",[Ve]:"Edit the series",[Ge]:"Do you want to edit only this event occurrence or the whole series?",[Ue]:"Edit Recurring Item",[Ze]:"Save",[qe]:"Cancel",[Ft]:"Delete",[Ye]:"Event",[je]:"Title",[Xe]:"Start",[Qe]:"Start Time Zone",[Je]:"End",[et]:"End Time Zone",[tt]:"All Day",[rt]:"Description",[at]:"End in different Time Zone",[nt]:"Specify Time Zone",[lt]:"Repeats every",[ot]:"day(s)",[st]:"Repeats every",[ct]:"week(s)",[it]:"Repeats every",[ut]:"On",[dt]:"Day",[mt]:"month(s)",[pt]:"Repeats every",[gt]:"On",[Et]:"of",[vt]:"Repeats every",[yt]:"On",[ht]:"year(s)",[ft]:"Day",[kt]:"Month",[Dt]:"Never",[bt]:"Week",[Ct]:"Year",[St]:"First",[wt]:"Second",[It]:"Third",[Rt]:"Fourth",[Tt]:"Last",[xt]:"Day",[Mt]:"Weekday",[Nt]:"Weekend Day",[At]:"After",[_t]:"occurrence(s)",[Lt]:"Ends",[zt]:"Never",[Ot]:"On",[Wt]:"Are you sure you want to delete this event?",[Pt]:"Are you sure you want to delete this series?",[Ht]:"Do you want to delete only this event occurrence or the whole series?",[Kt]:"Delete current occurrence",[$t]:"Delete the series",[Bt]:"Delete Event",[Vt]:"Delete Series",[Gt]:"Delete Recurring Item",[Ut]:"Date",[Zt]:"Time",[qt]:"Event",[Qt]:"no events",[Jt]:"Events",[er]:"more",[tr]:"Reset time zone",[rr]:"Do you want to reset the time zone?",[ar]:"No",[nr]:"Yes",[lr]:"Recurrence",[or]:"Remove recurrence",[sr]:"Do you want to remove the recurrence?",[cr]:"No",[ir]:"Yes",[ur]:"Repeat on days",[dr]:"Make recurring",[mr]:"Time zone",[pr]:"Set Timezone",[gr]:"Reset Timezone",[Er]:"Reset timezone",[vr]:"Start time",[yr]:"End time",[hr]:"from",[fr]:"to",[kr]:"New event",[Dr]:"Edit event",[br]:"Toolbar"},Sr=k.forwardRef((e,t)=>{var r;const{level:l=0,...c}=e,m=k.useRef(null),p=k.useRef(null);k.useImperativeHandle(t,()=>m.current);const{timezone:g}=ne(),E=a.ZonedDate.fromLocalDate(c.value,g),v=a.getDate(E),[y,h]=k.useState(!1),[f,D]=k.useState(!1),b=o.useInternationalization(),{dateFormat:C,shortDateFormat:S}=k.useContext(ie),w=pe(),[I]=ye(),R=w.end.getTime()-w.start.getTime()>23328e5,T=b.format(C,R?I:w.zonedStart,R?I:w.zonedEnd.addDays(-1)),x=b.format(S,R?I:w.zonedStart,R?I:w.zonedEnd.addDays(-1)),M=k.useCallback(()=>{h(!y)},[y]),N=k.useCallback(()=>{D(!0)},[]),A=k.useCallback(()=>{h(!1),D(!1)},[]),_=k.useCallback(e=>{if(c.onChange){const t=a.ZonedDate.fromUTCDate(z(e.value),g);c.onChange({...e,value:t})}h(!1)},[c,g]);k.useEffect(()=>{y&&f&&p.current&&p.current.focus()},[f,y]);const{onFocus:L,onBlur:O}=n.useAsyncFocusBlur({onFocus:N,onBlur:A});return k.createElement(k.Fragment,null,k.createElement(s.Button,{ref:m,onFocus:L,onBlur:O,fillMode:"flat",className:"k-nav-current k-toolbar-button",icon:"calendar",svgIcon:d.calendarIcon,"aria-live":"polite",tabIndex:-1,onClick:M},l>=2?x:T),k.createElement(u.Popup,{anchor:null==(r=m.current)?void 0:r.element,show:y},k.createElement(i.Calendar,{ref:p,onFocus:L,onBlur:O,onChange:_,value:v})))});Sr.displayName="KendoReactSchedulerNavigationDatePicker";const wr=k.forwardRef((e,t)=>{const r=e,{level:a=0}=r,l=oe(),[c,i]=De(),u=l.find(e=>e.props.name===c),m=o.useLocalization(),p=k.useCallback(e=>{i&&(e.syntheticEvent.preventDefault(),i(e.item.name))},[i]),g=k.useCallback(e=>{i&&i(e)},[i]),E=k.useMemo(()=>l.map(e=>({value:e.props.name,text:"function"==typeof e.props.title?e.props.title(m):e.props.title,tabIndex:-1})),[l,m]);return a>=1&&u?k.createElement(s.DropDownButton,{className:"k-toolbar-menu-button",fillMode:"flat",onItemClick:p,popupSettings:{popupClass:"k-scheduler-toolbar"},textField:"title",items:l.map(e=>({...e.props,selected:e.props.name===c,title:"function"==typeof e.props.title?e.props.title(m):e.props.title})),text:"function"==typeof u.props.title?u.props.title(m):u.props.title,endIcon:k.createElement("span",{className:"k-menu-button-arrow k-button-arrow"},k.createElement(n.SvgIcon,{icon:d.chevronDownIcon}))}):k.createElement(s.SegmentedControl,{className:"k-scheduler-views",role:"group",value:c,onChange:g,items:E})});wr.displayName="KendoReactSchedulerViewSelectorList";const Ir=e=>{const{onChange:t,data:r,validationMessage:a,visited:n,touched:o,modified:s,...c}=e,[i,u]=k.useState(r);k.useEffect(()=>{u(r)},[r]);const d=k.useCallback(e=>{t&&t({value:e.value})},[t]),m=k.useCallback(e=>{const t=e.filter;u(l.filterBy(r||[],t))},[r]);return k.createElement(y.DropDownList,{popupSettings:{width:360},data:i,onChange:d,filterable:!0,onFilterChange:m,...c})},Rr=e=>{const{value:t,data:r,onChange:a,...n}=e,l=k.useCallback(e=>{a&&a.call(void 0,e.currentTarget.dataset.value)},[a]);return k.createElement(s.ButtonGroup,{className:"k-scheduler-recurrence-repeat",width:"100%",...n},r.map(e=>k.createElement(s.Button,{type:"button",key:e.value,selected:e.value===t,onClick:l,"data-value":e.value,togglable:!0},e.text)))},Tr=e=>e.charAt(0).toUpperCase()+e.slice(1),xr=["first","second","third","fourth","last"],Mr=["never","daily","weekly","monthly","yearly"],Nr=[{day:0,offset:0},{day:1,offset:0},{day:2,offset:0},{day:3,offset:0},{day:4,offset:0},{day:5,offset:0},{day:6,offset:0}],Ar=[{day:1,offset:0},{day:2,offset:0},{day:3,offset:0},{day:4,offset:0},{day:5,offset:0}],_r=[{day:0,offset:0},{day:6,offset:0}],Lr=e=>{switch(e){case"day":return Nr;case"weekday":return Ar;case"weekend":return _r}},zr=e=>g.parseRule({recurrenceRule:e})||{},Or=e=>L(e)&&!(e=>(e=>null==e)(e)||e.trim&&0===e.trim().length)(e.freq)?e.freq:"never",Fr=e=>e.dateFormatNames({type:"months",nameType:"wide",standAlone:!0}).map((e,t)=>({text:e,value:t+1})),Wr=e=>{const t=e.firstDay(),r=e.dateFormatNames({type:"days",nameType:"abbreviated"}).map((e,t)=>({text:e,value:t}));return r.slice(t).concat(r.slice(0,t))},Pr=(e,t,r)=>{var a;let n;if(L(t.byWeekDay))switch(t.byWeekDay.length){case 7:n="day";break;case 5:n="weekday";break;case 2:n="weekend";break;case 1:n=t.byWeekDay[0].day;break;default:n=r.getDay()}else n=r.getDay();return null!=(a=e.find(e=>n===e.value))?a:e[0]},Hr=(e,t)=>{const r=e.firstDay(),a=e.dateFormatNames({type:"days",nameType:"wide"}).map((e,t)=>({text:e,value:t})),n=a.slice(r).concat(a.slice(0,r));return[{text:t("WeekdaysDay"),value:"day"},{text:t("WeekdaysWeekday"),value:"weekday"},{text:t("WeekdaysWeekendday"),value:"weekend"}].concat(n)},Kr=(e,t)=>e.find(e=>e.value===(t.bySetPosition?t.bySetPosition[0]:t.byWeekDay&&t.byWeekDay[0]?t.byWeekDay[0].offset:1))||e[0],$r=e=>{const t=[1,2,3,4,-1];return xr.map((r,a)=>({text:e("OffsetPositions"+Tr(r)),value:t[a]}))},Br=e=>L(e.count)?"count":L(e.until)?"until":"never",Vr=e=>L(e.byWeekDay)?"weekday":L(e.byMonthDay)?"monthday":void 0,Gr=(e,t)=>e.find(e=>(t.byMonth?t.byMonth[0]:null)===e.value)||e[0],Ur=(e,t)=>L(e.byMonthDay)&&e.byMonthDay.length>0?e.byMonthDay[0]:t.getDate(),Zr=e=>{const{value:t,data:r,onChange:a,...n}={...qr,...e},l=r=>{const a=Number(r.currentTarget.dataset.key);e.onChange&&e.onChange.call(void 0,t.some(e=>e===a)?t.filter(e=>e!==a):[...t,a])};return k.createElement(s.ButtonGroup,{width:"auto",...n},(e.data||qr.data).map(e=>k.createElement(s.Button,{type:"button",key:e.value,"data-key":e.value,selected:t.some(t=>t===e.value),togglable:!0,onClick:l},Tr(e.text))))},qr={data:[],value:[]},Yr=e=>{const t=o.useInternationalization(),r=o.useLocalization(),{timezone:n}=ne(),[l,s]=k.useState(1),[c,u]=k.useState(a.ZonedDate.fromUTCDate(e.start)),d=k.useCallback((e,t)=>{const a=t?e:"scheduler.recurrenceEditor"+e;return r.toLanguageString(a,Cr[a])},[r]),p=k.useMemo(()=>{var t;return zr(null!=(t=e.value)?t:Xr.value)},[e.value]),h=k.useMemo(()=>(e=>Mr.map(t=>({value:t,text:e("Frequencies"+Tr(t))})))(d),[d]),f=k.useMemo(()=>Or(p),[p]),D=k.useMemo(()=>Hr(t,d),[t,d]),b=k.useMemo(()=>Pr(D,p,e.start),[D,p,e.start]),C=k.useMemo(()=>Fr(t),[t]),S=k.useMemo(()=>Gr(C,p),[C,p]),w=k.useMemo(()=>$r(d),[d]),I=k.useMemo(()=>Kr(w,p),[w,p]),R=k.useMemo(()=>Br(p),[p]),T=k.useMemo(()=>Ur(p,e.start),[p,e.start]),x=k.useMemo(()=>(e=>L(e.until)?a.toLocalDate(e.until):null)(p),[p.until]),M=k.useMemo(()=>Wr(t),[t]),N=k.useMemo(()=>Vr(p),[p.byWeekDay,p.byMonthDay]),A=k.useCallback(r=>{"never"===r.freq?e.onChange({value:null}):(void 0===r.weekStart&&(r.weekStart=t.firstDay()),e.onChange({value:g.serializeRule(r,e.timezone)}))},[e.onChange,e.timezone]),_=k.useCallback(t=>{const r={};r.freq=t,r.interval=1,"weekly"===t&&(r.byWeekDay=[{day:a.ZonedDate.fromLocalDate(e.start,n).getDay(),offset:0}]),("monthly"===t||"yearly"===t)&&(r.byMonthDay=[e.start.getDate()]),"yearly"===t&&(r.byMonth=[e.start.getMonth()+1]),A(r)},[A,e.start,n]),z=k.useCallback(e=>{const t=e.value;A(Object.assign({},p,{interval:t}))},[A,p]),O=k.useCallback(e=>{const t=e.value;A(Object.assign({},p,{count:t})),null!==t&&s(t)},[A,p]),F=k.useCallback(t=>{const r=t.value;if(!r)return;const n=a.ZonedDate.fromLocalDate(r,e.timezone);A(Object.assign({},p,{until:n})),u(n)},[A,p,e.timezone]),W=k.useCallback(e=>{A(Object.assign({},p,{byWeekDay:M.filter(t=>e.some(e=>e===t.value)).map(e=>({offset:0,day:e.value}))}))},[A,p,M]),P=k.useCallback(e=>{const t=Object.assign({},p),r=e.target.value;"string"==typeof r.value?(t.byWeekDay=Lr(r.value),t.bySetPosition=[I.value]):(t.bySetPosition=void 0,t.byWeekDay=[{day:r.value,offset:I.value}]),A(t)},[I.value,A,p]),H=k.useCallback(e=>{A(Object.assign({},p,{byMonthDay:[e.value]}))},[A,p]),K=k.useCallback(e=>{const t=e.value;A(Object.assign({},p,{byMonth:[t.value]}))},[A,p]),$=k.useCallback(e=>{const t=e.value,r=Object.assign({},p);switch(t){case"never":r.until=void 0,r.count=void 0;break;case"count":r.until=void 0,r.count=l;break;case"until":r.until=c,r.count=void 0}A(r)},[A,p,e.timezone]),B=k.useCallback(e=>{const t=Object.assign({},p);"monthday"===e.value?(t.byWeekDay=void 0,t.bySetPosition=void 0,t.byMonthDay=[T]):"weekday"===e.value&&(t.byMonthDay=void 0,"string"==typeof b.value?(t.bySetPosition=[I.value],t.byWeekDay=Lr(b.value)):t.byWeekDay=[{day:b.value,offset:I.value}]),A(t)},[A,p,T,b]),V=k.useCallback(e=>{const t=Object.assign({},p),r=e.value;if(t.byWeekDay)switch(t.byWeekDay.length){case 7:case 5:case 2:t.bySetPosition=[r.value];break;case 1:t.byWeekDay[0].offset=r.value}A(t)},[A,p]);return k.createElement(k.Fragment,null,k.createElement(m.FieldWrapper,null,k.createElement(E.Label,{className:"k-form-label"},r.toLanguageString(lt,Cr[lt])),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(Rr,{value:f,data:h,onChange:_}))),"never"!==f&&k.createElement(m.FieldWrapper,null,k.createElement(E.Label,{editorId:"interval-editor",className:"k-form-label"},d(Tr(f)+"RepeatEvery")),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(v.NumericTextBox,{min:1,step:1,defaultValue:1,value:p.interval,onChange:z,id:"interval-editor",className:"k-recur-interval"})," ",k.createElement(E.Label,{editorId:"interval-editor",className:"k-form-label"},d(Tr(f)+"Interval")))),"weekly"===f&&k.createElement(m.FieldWrapper,null,k.createElement(E.Label,{className:"k-form-label"},d(ut,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(Zr,{data:M,value:(p.byWeekDay||[]).map(({day:e})=>e),onChange:W}))),"monthly"===f&&k.createElement(m.FieldWrapper,null,k.createElement(E.Label,{key:"recurrence-repeat-on-monthly-label",className:"k-form-label"},d(gt,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(v.RadioGroup,{value:N,onChange:B,item:jr,className:"k-reset",data:[{value:"monthday",label:d(dt,!0),children:[k.createElement(k.Fragment,{key:"separator"}," "),k.createElement(v.NumericTextBox,{key:"weekday-day",min:1,max:31,disabled:"monthday"!==N,value:p&&p.byMonthDay&&p.byMonthDay[0],onChange:H,width:"auto"})]},{value:"weekday",label:" ",children:[k.createElement(y.DropDownList,{key:"weekday-offset",textField:"text",dataItemKey:"value",disabled:"weekday"!==N,data:w,value:I,onChange:V,style:{width:"auto"}}),k.createElement(k.Fragment,{key:"separator"}," "),k.createElement(y.DropDownList,{key:"weekday-value",disabled:"weekday"!==N,value:b,data:D,onChange:P,textField:"text",dataItemKey:"value",style:{width:"auto"}})]}]}))),"yearly"===f&&k.createElement(m.FieldWrapper,null,k.createElement(E.Label,null,d(yt,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(v.RadioGroup,{value:N,item:jr,onChange:B,className:"k-reset",data:[{value:"monthday",label:" ",children:[k.createElement(y.DropDownList,{key:"monthday-month",disabled:"monthday"!==N,value:S,data:C,textField:"text",dataItemKey:"value",onChange:K,style:{width:"auto"}}),k.createElement(k.Fragment,{key:"separator"}," "),k.createElement(v.NumericTextBox,{key:"monthday-day",min:1,max:31,disabled:"monthday"!==N,value:T,onChange:H,width:"auto"})]},{value:"weekday",label:" ",children:[k.createElement(y.DropDownList,{key:"yearly-weekday-offset",textField:"text",dataItemKey:"value",disabled:"weekday"!==N,data:w,value:I,onChange:V,style:{width:"auto"}}),k.createElement(k.Fragment,{key:"yearly-separator-1"}," "),k.createElement(y.DropDownList,{key:"yearly-weekday-day",textField:"text",dataItemKey:"value",disabled:"weekday"!==N,value:b,data:D,onChange:P,style:{width:"auto"}}),k.createElement(k.Fragment,{key:"yearly-separator-2"}," "),k.createElement("span",{key:"yearly-weekday-of-label"},d(Et,!0)),k.createElement(k.Fragment,{key:"yearly-separator-3"}," "),k.createElement(y.DropDownList,{key:"yearly-weekday-month",textField:"text",dataItemKey:"value",disabled:"weekday"!==N,value:S,data:C,onChange:K,style:{width:"auto"}})]}]}))),"never"!==f&&k.createElement("div",{className:"k-scheduler-recurrence-end-rule-editor"},k.createElement(m.FieldWrapper,null,k.createElement(E.Label,{className:"k-form-label"},d(Lt,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(v.RadioGroup,{item:jr,value:R,onChange:$,data:[{value:"never",label:d(zt,!0)},{value:"count",label:d(At,!0),children:[k.createElement(k.Fragment,{key:"separator-1"}," "),k.createElement(v.NumericTextBox,{key:"endrule-after-editor",id:"k-endrule-after",className:"k-recur-count",min:1,width:"auto",value:"count"===R?p.count:l,onChange:O,disabled:"count"!==R}),k.createElement(k.Fragment,{key:"separator-2"}," "),k.createElement(E.Label,{key:"endrule-after-label",className:"k-radio-label",editorId:"k-endrule-after"},d(_t,!0))]},{value:"until",label:d(Ot,!0),children:[k.createElement(k.Fragment,{key:"separator"}," "),k.createElement(i.DatePicker,{key:"k-endrule-until-editor",id:"k-endrule-until",disabled:"until"!==R,min:e.start,value:"until"===R?x:a.toLocalDate(c),onChange:F,width:"auto"})]}]})))))},jr=e=>k.createElement("li",{...e},e.children),Xr={value:""};Yr.displayName="KendoReactSchedulerRepeatEditor";const Qr=(e,t)=>{if(e){if(!t)return e;const r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),a.ZonedDate.fromUTCDate(r,t).toLocalDate()}return e},Jr=e=>{const{value:t,onChange:r,isAllDay:n,connector:l,connectorElement:o,dateId:s,timeId:c,fieldError:u,ariaLabel:d,timeAriaLabel:m}=e,{timezone:p}=ne(),g=k.useMemo(()=>t?((e,t)=>{if(e){if(!t)return e;const r=a.toLocalDate(a.ZonedDate.fromLocalDate(e,t).toUTCDate());return r.setUTCFullYear(e.getFullYear()),r}return e})(t,p):null,[t,p]),E=k.useCallback(e=>{if(!e.value||!r)return;const t=new Date(e.value);g&&t.setHours(g.getHours(),g.getMinutes(),g.getSeconds()),r({value:Qr(t,p)})},[r,g,p]),v=k.useCallback(e=>{if(!e.value||!r)return;const t=new Date(g||new Date);t.setHours(e.value.getHours(),e.value.getMinutes(),0,0),r({value:Qr(t,p)})},[r,g,p]),y=!!u;return n?k.createElement(i.DatePicker,{id:s,value:g,onChange:E,valid:!y,ariaLabel:d}):k.createElement(k.Fragment,null,k.createElement(i.DatePicker,{id:s,value:g,onChange:E,valid:!y,ariaLabel:d}),o||l&&k.createElement("span",{className:"k-scheduler-datetime-label"},l),k.createElement(i.TimePicker,{id:c,value:g,onChange:v,valid:!y,ariaLabel:m}))};function ea(e,t,r,n){var l,o,s,c,i,u;if(!e)return"";const d=e=>n.toLanguageString(e,Cr[e]),m=(e,t)=>{const r=t?e:"scheduler.recurrenceEditor"+e;return n.toLanguageString(r,Cr[r])},p=zr(e);if(!p.freq||"never"===p.freq)return"";const g=Wr(r),E=Hr(r,m),v=Pr(E,p,t),y=Fr(r),h=Gr(y,p),f=$r(m),k=Kr(f,p),D=Ur(p,t),b=Vr(p),C=p.interval||1,S=d(lt),w=d(ut).toLowerCase(),I=d(gt).toLowerCase(),R=d(yt).toLowerCase(),T=d(Lt).toLowerCase();let x="";switch(p.freq){case"daily":x=`${S} ${C} ${d(ot)}`;break;case"weekly":{const e=(p.byWeekDay||[]).map(({day:e})=>{var t;return null==(t=g.find(t=>t.value===e))?void 0:t.text}).filter(Boolean).join(", ");x=`${S} ${C} ${d(ct)}`,e&&(x+=` ${w} ${e}`);break}case"monthly":{const e=`${S} ${C} ${d(mt)}`;if("weekday"===b&&null!=(l=p.byWeekDay)&&l.length){const t="string"==typeof v.value?v.text.toLowerCase():v.text;x=`${e} ${I} ${k.text.toLowerCase()} ${t}`}else{const t=null!=(s=null==(o=p.byMonthDay)?void 0:o[0])?s:D;x=`${e} ${I} ${d(dt).toLowerCase()} ${t}`}break}case"yearly":{const e=`${S} ${C} ${d(ht)}`;if("weekday"===b&&null!=(c=p.byWeekDay)&&c.length){const t="string"==typeof v.value?v.text.toLowerCase():v.text;x=`${e} ${R} ${k.text.toLowerCase()} ${t} ${d(Et)} ${h.text}`}else{const t=null!=(u=null==(i=p.byMonthDay)?void 0:i[0])?u:D;x=`${e} ${R} ${h.text} ${t}`}break}}return p.count?x+=` ${T} ${d(At).toLowerCase()} ${p.count} ${d(_t)}`:p.until&&(x+=` ${T} ${d(Ot).toLowerCase()} ${r.formatDate(a.toLocalDate(p.until),"D")}`),x}const ta=e=>{const{value:t,start:r,timezone:l,onSave:c,onCancel:u,onRemoveRecurrence:d,recurrenceSummaryTemplate:h,recurrenceEditor:f}=e,b=o.useInternationalization(),C=o.useLocalization(),S=ce(),w=k.useCallback((e,t)=>{const r=t?e:"scheduler.recurrenceEditor"+e;return C.toLanguageString(r,Cr[r])},[C]),[I,R]=k.useState(()=>{const e=zr(null!=t?t:"");return e.freq?e:{freq:"daily",interval:1}}),[T,x]=k.useState(1),M=k.useRef(!1),[N,A]=k.useState(()=>a.ZonedDate.fromUTCDate(r)),[_]=k.useState(r),L=k.useRef(null),z=k.useMemo(()=>Or(I),[I]),O=k.useMemo(()=>Wr(b),[b]),F=k.useMemo(()=>Hr(b,w),[b,w]),W=k.useMemo(()=>Pr(F,I,_),[F,I,_]),P=k.useMemo(()=>Fr(b),[b]),H=k.useMemo(()=>Gr(P,I),[P,I]),K=k.useMemo(()=>$r(w),[w]),$=k.useMemo(()=>Kr(K,I),[K,I]),B=k.useMemo(()=>Br(I),[I]),V=k.useMemo(()=>Ur(I,_),[I,_]),G=k.useMemo(()=>I.until?a.toLocalDate(I.until):null,[I.until]),U=k.useMemo(()=>Vr(I),[I.byWeekDay,I.byMonthDay]),Z=!!t,q=C.toLanguageString(Ze,Cr[Ze]),Y=C.toLanguageString(qe,Cr[qe]),j=k.useCallback(e=>{R({...e})},[]),X=k.useCallback(e=>{const t={};t.freq=e,t.interval=1,"weekly"===e&&(t.byWeekDay=[{day:a.ZonedDate.fromLocalDate(_,l).getDay(),offset:0}]),("monthly"===e||"yearly"===e)&&(t.byMonthDay=[_.getDate()]),"yearly"===e&&(t.byMonth=[_.getMonth()+1]),j(t)},[_,l,j]),Q=k.useCallback(e=>{var t;j({...I,interval:null!=(t=e.value)?t:1})},[I,j]),J=k.useCallback(e=>{const t=e.value;null!==t?(M.current=!1,j({...I,count:t}),x(t)):M.current=!0},[I,j]),ee=k.useCallback(()=>{M.current&&(M.current=!1,x(1),j({...I,count:1}))},[I,j]),te=k.useCallback(e=>{if(!e.value)return;const t=a.ZonedDate.fromLocalDate(e.value,l);j({...I,until:t}),A(t)},[I,l,j]),re=k.useCallback(e=>{j({...I,byWeekDay:O.filter(t=>e.some(e=>e===t.value)).map(e=>({offset:0,day:e.value}))})},[I,O,j]),ae=k.useCallback(e=>{const t={...I},r=e.target.value;"string"==typeof r.value?(t.byWeekDay=Lr(r.value),t.bySetPosition=[$.value]):(t.bySetPosition=void 0,t.byWeekDay=[{day:r.value,offset:$.value}]),j(t)},[$.value,I,j]),ne=k.useCallback(e=>{var t;j({...I,byMonthDay:[null!=(t=e.value)?t:1]})},[I,j]),le=k.useCallback(e=>{j({...I,byMonth:[e.value.value]})},[I,j]),oe=k.useCallback(e=>{const t=e.value.value,r={...I};switch(t){case"never":r.until=void 0,r.count=void 0;break;case"count":r.until=void 0,r.count=T;break;case"until":r.until=N,r.count=void 0}j(r)},[I,T,N,j]),se=k.useCallback(e=>{const t={...I};"monthday"===e.value?(t.byWeekDay=void 0,t.bySetPosition=void 0,t.byMonthDay=[V]):"weekday"===e.value&&(t.byMonthDay=void 0,"string"==typeof W.value?(t.bySetPosition=[$.value],t.byWeekDay=Lr(W.value)):t.byWeekDay=[{day:W.value,offset:$.value}]),j(t)},[I,V,W,$.value,j]),ie=k.useCallback(e=>{const t={...I},r=e.value;if(t.byWeekDay)switch(t.byWeekDay.length){case 7:case 5:case 2:t.bySetPosition=[r.value];break;case 1:t.byWeekDay[0].offset=r.value}j(t)},[I,j]),ue=k.useCallback(e=>{const t=e.value.value;X(t)},[X]),de=k.useMemo(()=>[{text:w(ft,!0),value:"daily"},{text:w(bt,!0),value:"weekly"},{text:w(kt,!0),value:"monthly"},{text:w(Ct,!0),value:"yearly"}],[w]),me=k.useMemo(()=>[{text:w(zt,!0),value:"never"},{text:w(At,!0),value:"count"},{text:w(Ot,!0),value:"until"}],[w]),pe=k.useMemo(()=>de.find(e=>e.value===z)||de[0],[de,z]),ge=k.useMemo(()=>me.find(e=>e.value===B)||me[0],[me,B]),Ee=k.useMemo(()=>{const e=b.firstDay(),t=b.dateFormatNames({type:"days",nameType:"narrow"}),r=b.dateFormatNames({type:"days",nameType:"wide"}),a=t.map((e,t)=>({narrow:e,wide:r[t],value:t}));return a.slice(e).concat(a.slice(0,e))},[b]),ve=k.useMemo(()=>(I.byWeekDay||[]).map(({day:e})=>e),[I.byWeekDay]),ye=k.useCallback(e=>{const t=ve.includes(e)?ve.filter(t=>t!==e):[...ve,e];re(t)},[ve,re]),he=k.useCallback(()=>{var e;if(f){const t=(null==(e=L.current)?void 0:e.call(L,S.recurrenceRule))||null;c(t)}else"never"!==I.freq&&I.freq?(void 0===I.weekStart&&(I.weekStart=b.firstDay()),c(g.serializeRule(I,l))):c(null)},[f,I,l,b,c]),fe=k.useCallback(()=>{u()},[u]),ke=k.useMemo(()=>{if(!I.freq||"never"===I.freq)return"";return ea(g.serializeRule(I,l),_,b,C)},[I,l,_,b,C]),De=k.useMemo(()=>I.freq&&"never"!==I.freq?g.serializeRule(I,l):null,[I,l]),be=k.useMemo(()=>De?g.parseRule({recurrenceRule:De}):null,[De]),Ce=k.createElement(p.Dialog,{title:w(lr,!0),onClose:fe,width:540},f?k.createElement(m.Form,{initialValues:{[S.recurrenceRule]:t||""},render:e=>(L.current=e.valueGetter,k.createElement(m.FormElement,{horizontal:!0},k.createElement(m.Field,{name:S.recurrenceRule,field:S.recurrenceRule,component:f,start:_})))}):k.createElement(m.Form,{render:()=>{var e;return k.createElement(m.FormElement,{horizontal:!0},k.createElement(m.FieldWrapper,null,k.createElement(E.Label,{editorId:"recurrence-interval",className:"k-form-label"},w(lt,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-scheduler-recurrence-fields"},"never"!==z&&k.createElement(v.NumericTextBox,{id:"recurrence-interval",min:1,step:1,defaultValue:1,value:I.interval,onChange:Q}),k.createElement(y.DropDownList,{data:de,textField:"text",dataItemKey:"value",value:pe,onChange:ue})))),"weekly"===z&&k.createElement(m.FieldWrapper,null,k.createElement(E.Label,{className:"k-form-label"},w(ut,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-scheduler-weekday-picker",role:"group","aria-label":w(ur,!0)},Ee.map(e=>k.createElement(s.Button,{key:e.value,type:"button",themeColor:"primary",fillMode:"flat",rounded:"full",togglable:!0,selected:ve.includes(e.value),"aria-label":e.wide,"aria-pressed":ve.includes(e.value),onClick:()=>ye(e.value)},e.narrow))))),"monthly"===z&&k.createElement(m.FieldWrapper,null,k.createElement(E.Label,{className:"k-form-label"},w(gt,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(v.RadioGroup,{value:U,onChange:se,className:"k-reset",data:[{value:"weekday",label:" ",children:[k.createElement("div",{key:"weekday-fields",className:"k-scheduler-recurrence-fields"},k.createElement(y.DropDownList,{textField:"text",dataItemKey:"value",disabled:"weekday"!==U,data:K,value:$,onChange:ie}),k.createElement(y.DropDownList,{disabled:"weekday"!==U,value:W,data:F,onChange:ae,textField:"text",dataItemKey:"value"}))]},{value:"monthday",label:" ",children:[k.createElement("div",{key:"monthday-fields",className:"k-scheduler-recurrence-fields"},k.createElement(v.NumericTextBox,{min:1,max:31,disabled:"monthday"!==U,value:V,onChange:ne,width:"auto"}))]}]}))),"yearly"===z&&k.createElement(m.FieldWrapper,null,k.createElement(E.Label,{className:"k-form-label"},w(yt,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(v.RadioGroup,{value:U,onChange:se,className:"k-reset",data:[{value:"monthday",label:" ",children:[k.createElement("div",{key:"monthday-fields",className:"k-scheduler-recurrence-fields"},k.createElement(y.DropDownList,{disabled:"monthday"!==U,value:H,data:P,textField:"text",dataItemKey:"value",onChange:le}),k.createElement(v.NumericTextBox,{min:1,max:31,disabled:"monthday"!==U,value:V,onChange:ne,width:"auto"}))]},{value:"weekday",label:" ",children:[k.createElement("div",{key:"weekday-fields",className:"k-scheduler-recurrence-fields"},k.createElement(y.DropDownList,{textField:"text",dataItemKey:"value",disabled:"weekday"!==U,data:K,value:$,onChange:ie}),k.createElement(y.DropDownList,{textField:"text",dataItemKey:"value",disabled:"weekday"!==U,value:W,data:F,onChange:ae}),k.createElement("span",{key:"of-row",className:"k-scheduler-edit-form-row"},k.createElement("span",null,w(Et,!0)),k.createElement(y.DropDownList,{textField:"text",dataItemKey:"value",disabled:"weekday"!==U,value:H,data:P,onChange:le})))]}]}))),"never"!==z&&k.createElement(m.FieldWrapper,null,k.createElement(E.Label,{className:"k-form-label"},w(Lt,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-scheduler-recurrence-fields"},k.createElement(y.DropDownList,{data:me,textField:"text",dataItemKey:"value",value:ge,onChange:oe}),"count"===B&&k.createElement(v.NumericTextBox,{min:1,width:"auto",value:null!=(e=I.count)?e:T,onChange:J,onBlur:ee,format:`0 '${w(_t,!0)}'`}),"until"===B&&k.createElement(i.DatePicker,{min:_,value:null!=G?G:a.toLocalDate(N),onChange:te,width:"auto"})))),"never"!==z&&(h&&De?k.createElement(m.FieldWrapper,null,k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-form-hint"},k.createElement(h,{recurrenceRule:De,text:ke||"",parsedRule:be})))):ke?k.createElement(m.FieldWrapper,null,k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-form-hint"},ke))):null))}}),k.createElement(p.DialogActionsBar,{layout:"end"},Z&&d&&k.createElement(s.Button,{fillMode:"flat",themeColor:"primary",onClick:d},w(or,!0)),k.createElement(s.Button,{onClick:fe},Y),k.createElement(s.Button,{themeColor:"primary",onClick:he},q)));return n.canUseDOM?D.createPortal(Ce,document.body):null};ta.displayName="KendoReactSchedulerRecurrenceDialog";const ra=e=>{const{onConfirm:t,onCancel:r}=e,a=o.useLocalization(),l=a.toLanguageString(or,Cr[or]),c=a.toLanguageString(sr,Cr[sr]),i=a.toLanguageString(cr,Cr[cr]),u=a.toLanguageString(ir,Cr[ir]),d=k.createElement(p.Dialog,{title:l,onClose:r,width:400},k.createElement("p",null,c),k.createElement(p.DialogActionsBar,{layout:"end"},k.createElement(s.Button,{onClick:r},i),k.createElement(s.Button,{themeColor:"primary",onClick:t},u)));return n.canUseDOM?D.createPortal(d,document.body):null};ra.displayName="KendoReactRemoveRecurrenceConfirmDialog";const aa=k.forwardRef((e,t)=>{const r=k.useRef(null),l=k.useRef(null),c=a.timezoneNames(),i=o.useLocalization(),u=o.useInternationalization(),v=ce(),{resources:y,timezone:h}=ne();k.useImperativeHandle(l,()=>{var t;return{element:null!=(t=r.current)&&t.element?r.current.element:r.current,props:e}}),k.useImperativeHandle(t,()=>l.current);const{as:f=sa.as,...D}=e,{onChange:b,valueGetter:C}=e,{titleEditor:S=sa.titleEditor,startEditor:w=sa.startEditor,endEditor:I=sa.endEditor,startTimezoneEditor:R=sa.startTimezoneEditor,endTimezoneEditor:T=sa.endTimezoneEditor,startLabel:x=sa.startLabel,endLabel:M=sa.endLabel,allDayEditor:N=sa.allDayEditor,allDayLabel:A=sa.allDayLabel,recurrenceEditor:_,descriptionEditor:L=sa.descriptionEditor,resourceEditor:z=sa.resourceEditor}=e,O=k.useMemo(()=>C(v.start)||new Date,[C,v.start]),F=C(v.isAllDay)||!1,W=C(v.startTimezone)||h||"",P=C(v.recurrenceRule),H=!(null!=C(v.recurrenceId)),K=k.useMemo(()=>i.toLanguageString(tt,Cr[tt]),[i]),[$,B]=k.useState(!!C(v.startTimezone)),[V,G]=k.useState(!1),[U,Z]=k.useState(!1),[q,Y]=k.useState(!1),j=e.recurrenceButtonTextTemplate,X=e.recurrenceSummaryTemplate,Q=k.useMemo(()=>i.toLanguageString(dr,Cr[dr]),[i]),J=k.useMemo(()=>P&&ea(P,O,u,i)||Q,[P,O,u,i,Q]),ee=k.useMemo(()=>P?ea(P,O,u,i):null,[P,O,u,i]),te=k.useMemo(()=>P?g.parseRule({recurrenceRule:P}):null,[P]),re=k.useRef(W);k.useEffect(()=>{$&&W&&W!==re.current&&b(v.endTimezone,{value:W}),re.current=W},[W,$,b,v.endTimezone]);const ae=k.useCallback(e=>{e.preventDefault(),$?G(!0):B(!0)},[$]),le=k.useCallback(()=>{b(v.startTimezone,{value:null}),b(v.endTimezone,{value:null}),B(!1),G(!1)},[b,v.startTimezone,v.endTimezone]),oe=k.useCallback(()=>{G(!1)},[]),se=k.useCallback(()=>{Z(!0)},[]),ie=k.useCallback(e=>{b(v.recurrenceRule,{value:e}),Z(!1)},[b,v.recurrenceRule]),ue=k.useCallback(()=>{Z(!1)},[]),de=k.useCallback(()=>{Y(!0)},[]),me=k.useCallback(()=>{b(v.recurrenceRule,{value:null}),b(v.recurrenceExceptions,{value:null}),Y(!1),Z(!1)},[b,v.recurrenceRule,v.recurrenceExceptions]),pe=k.useCallback(()=>{Y(!1)},[]),ge=k.useMemo(()=>n.classNames("k-scheduler-edit-form",e.className),[e.className]);return k.createElement(k.Fragment,null,k.createElement(f,{ref:f===sa.as?r:void 0,horizontal:!0,...D,className:ge},k.createElement(k.Fragment,null,k.createElement(m.FieldWrapper,null,k.createElement(E.Label,{className:"k-form-label"},k.createElement(n.SvgIcon,{icon:d.rightDoubleQuotesIcon,size:"xlarge"})),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(m.Field,{id:"k-scheduler-editor-title",name:v.title,field:v.title,component:S,placeholder:i.toLanguageString(je,Cr[je]),"aria-label":i.toLanguageString(je,Cr[je])}))),k.createElement(m.FieldWrapper,null,k.createElement(E.Label,{className:"k-form-label"},k.createElement(n.SvgIcon,{icon:d.clockIcon,size:"xlarge"})),k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-scheduler-datetime-section"},k.createElement("div",{className:"k-scheduler-edit-form-row"},k.createElement(m.Field,{id:"k-is-allday-switch",name:v.isAllDay,component:N,onLabel:"",offLabel:"",ariaLabel:K}),k.createElement(m.Field,{name:v.isAllDay,field:v.isAllDay,editorId:"k-is-allday-switch",component:A},K)),k.createElement("div",{className:"k-scheduler-datetime-grid"},F?k.createElement("div",{className:"k-scheduler-edit-form-row"},k.createElement(m.Field,{name:v.start,component:w,isAllDay:F,fieldError:e.errors[v.start],ariaLabel:i.toLanguageString(Xe,Cr[Xe]),timezone:h}),k.createElement(m.Field,{name:v.end,component:M,editorId:"k-scheduler-editor-end",className:"k-scheduler-datetime-label"},i.toLanguageString(fr,Cr[fr])),k.createElement(m.Field,{name:v.end,component:I,isAllDay:F,dateId:"k-scheduler-editor-end",fieldError:e.errors[v.end],ariaLabel:i.toLanguageString(Je,Cr[Je]),timezone:h})):k.createElement(k.Fragment,null,k.createElement("div",{className:"k-scheduler-edit-form-row"},k.createElement(m.Field,{name:v.start,component:w,isAllDay:F,timeId:"k-scheduler-editor-start-time",connectorElement:k.createElement(m.Field,{name:v.start,component:x,editorId:"k-scheduler-editor-start-time",className:"k-scheduler-datetime-label"},i.toLanguageString(hr,Cr[hr])),fieldError:e.errors[v.start],ariaLabel:i.toLanguageString(Xe,Cr[Xe]),timeAriaLabel:i.toLanguageString(vr,Cr[vr]),timezone:h})),!$&&k.createElement(s.Button,{className:"k-col-span-2",fillMode:"flat",themeColor:"primary",title:i.toLanguageString(pr,Cr[pr]),onClick:ae,svgIcon:d.globeIcon},i.toLanguageString(mr,Cr[mr])),$&&k.createElement(k.Fragment,null,k.createElement(m.Field,{name:v.startTimezone,component:R,data:c,value:W,ariaLabel:i.toLanguageString(Qe,Cr[Qe])}),k.createElement(s.Button,{title:i.toLanguageString(gr,Cr[gr]),"aria-label":i.toLanguageString(Er,Cr[Er]),onClick:ae,svgIcon:d.globeIcon,fillMode:"flat",themeColor:"primary"})),k.createElement("div",{className:"k-scheduler-edit-form-row"},k.createElement(m.Field,{name:v.end,component:I,isAllDay:F,timeId:"k-scheduler-editor-end-time",connectorElement:k.createElement(m.Field,{name:v.end,component:M,editorId:"k-scheduler-editor-end-time",className:"k-scheduler-datetime-label"},i.toLanguageString(fr,Cr[fr])),fieldError:e.errors[v.end],ariaLabel:i.toLanguageString(Je,Cr[Je]),timeAriaLabel:i.toLanguageString(yr,Cr[yr]),timezone:h})),$&&k.createElement(m.Field,{name:v.endTimezone,component:T,data:c,value:C(v.endTimezone)||h||"",ariaLabel:i.toLanguageString(et,Cr[et])}))),H&&k.createElement("div",{className:"k-scheduler-edit-form-row"},k.createElement(s.Button,{className:"k-scheduler-recurrence-button",type:"button",fillMode:"flat",themeColor:"primary",svgIcon:d.arrowRotateCwIcon,onClick:se},j?k.createElement(j,{recurrenceRule:P,text:ee,parsedRule:te}):J))))),k.createElement(m.FieldWrapper,null,k.createElement(E.Label,{className:"k-form-label"},k.createElement(n.SvgIcon,{icon:d.commentIcon,size:"xlarge"})),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(m.Field,{component:L,name:v.description,id:"k-event-description",resizable:"vertical",placeholder:i.toLanguageString(rt,Cr[rt]),"aria-label":i.toLanguageString(rt,Cr[rt])}))),(y||[]).map(e=>k.createElement(m.FieldWrapper,{key:e.field},e.svgIcon&&k.createElement(E.Label,{className:"k-form-label"},k.createElement(n.SvgIcon,{icon:e.svgIcon,size:"xlarge"})),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(m.Field,{name:e.field,component:z,resource:e,multiple:e.multiple,data:e.data,textField:e.textField,valueField:e.valueField,colorField:e.colorField,ariaLabel:e.name||e.field})))))),U&&k.createElement(ta,{value:P,start:O,timezone:h||"",onSave:ie,onCancel:ue,onRemoveRecurrence:de,recurrenceSummaryTemplate:X,recurrenceEditor:_}),q&&k.createElement(ra,{onConfirm:me,onCancel:pe}),V&&k.createElement(p.Dialog,{title:i.toLanguageString(tr,Cr[tr]),onClose:oe},i.toLanguageString(rr,Cr[rr]),k.createElement(p.DialogActionsBar,null,k.createElement(s.Button,{onClick:oe},i.toLanguageString(ar,Cr[ar])),k.createElement(s.Button,{themeColor:"primary",onClick:le},i.toLanguageString(nr,Cr[nr])))))});aa.displayName="KendoReactSchedulerFormEditor";const na=k.forwardRef((e,t)=>k.createElement(m.FormElement,{ref:t,id:e.id,style:e.style,tabIndex:e.tabIndex,className:e.className,horizontal:e.horizontal,children:e.children}));na.displayName="SchedulerFormEditorDefaultElement";const la=e=>{const{value:t,onChange:r,valid:a,visited:n,touched:l,modified:o,name:s,validationMessage:c,...i}=e,u=k.useCallback(e=>{r&&r({value:e.value})},[r]);return k.createElement(v.Switch,{...i,checked:t||!1,onChange:u})};la.displayName="SwitchFieldAdapter";const oa=e=>k.createElement(E.Label,{...e,style:{marginBottom:0,...e.style}});oa.displayName="DefaultLabel";const sa={as:na,titleEditor:v.Input,startEditor:Jr,endEditor:Jr,startTimezoneEditor:Ir,endTimezoneEditor:Ir,startLabel:oa,endLabel:oa,allDayEditor:la,allDayLabel:oa,recurrenceEditor:Yr,descriptionEditor:v.TextArea,resourceEditor:e=>{const t=e.multiple?y.MultiSelect:y.DropDownList,r=k.useCallback(t=>{const r=t.target.props.dataItemKey,a=e.multiple?(t.target.value||[]).map(e=>e[r]):t.target.value[r];e.onChange.call(void 0,{value:a})},[e.multiple,e.onChange]),a=k.useCallback((t,r)=>{const a=k.createElement(k.Fragment,null,e.colorField&&k.createElement("span",{key:1,className:"k-scheduler-mark",style:{backgroundColor:r.dataItem[e.colorField],marginRight:L(r.dataItem[e.valueField])?"8px":"4px"}}," "),k.createElement("span",{key:2},"  ",t.props.children));return k.cloneElement(t,{...t.props},a)},[e.colorField,e.valueField]),n=k.useCallback((t,r)=>{const a=k.createElement(k.Fragment,null,e.colorField&&r&&k.createElement("span",{key:1,className:"k-scheduler-mark",style:{backgroundColor:r[e.colorField],marginRight:r[e.valueField]?"8px":"4px"}}," "),t.props.children);return k.cloneElement(t,{},a)},[e.colorField,e.valueField]),l=Array.isArray(e.value)?e.data.filter(t=>e.value.some(r=>t[e.valueField]===r)):e.data.find(t=>t[e.valueField]===e.value);return k.createElement(t,{value:l,onChange:r,data:e.data,textField:e.textField,dataItemKey:e.valueField,valid:e.valid,validationMessage:e.validationMessage,itemRender:a,valueRender:n,ariaLabel:e.ariaLabel})}},ca=k.forwardRef((e,t)=>{const{onCancel:r,onClose:a,onSubmit:l,onDelete:c,editor:i,dialog:u=ia.dialog,validator:g=ia.validator,...E}=e,v=k.useRef(null);k.useImperativeHandle(v,()=>({props:e})),k.useImperativeHandle(t,()=>v.current);const y=o.useLocalization(),h=ce(),f=!(!e.dataItem||!e.dataItem[h.id]),b=k.useMemo(()=>y.toLanguageString(Yt,Cr[Yt]),[y]),C=k.useMemo(()=>y.toLanguageString(Xt,Cr[Xt]),[y]),S=k.useMemo(()=>y.toLanguageString(Ze,Cr[Ze]),[y]),w=k.useMemo(()=>y.toLanguageString(qe,Cr[qe]),[y]),I=k.useMemo(()=>y.toLanguageString(Ft,Cr[Ft]),[y]),R=k.useMemo(()=>y.toLanguageString(jt,Cr[jt]),[y]),T=k.useMemo(()=>y.toLanguageString(kr,Cr[kr]),[y]),x=k.useMemo(()=>y.toLanguageString(Dr,Cr[Dr]),[y]),M=f?x:T,N=k.useCallback(e=>{r&&r({value:null,syntheticEvent:e,target:v.current})},[r]),A=k.useCallback(({syntheticEvent:e})=>{a&&a({value:null,syntheticEvent:e,target:v.current})},[a]),_=k.useCallback((e,t)=>{l&&l({value:e,syntheticEvent:t,target:v.current})},[l]),L=k.useCallback(t=>{c&&c({value:e.dataItem,syntheticEvent:t,target:v.current})},[c,e.dataItem]),z=k.useCallback((e,t)=>e&&t(h.end)&&e.getTime()>t(h.end).getTime()?R:void 0,[h,R]),O=k.useCallback((e,t)=>e&&t(h.start)&&e.getTime()<t(h.start).getTime()?C:void 0,[h,C]),F=k.useCallback(e=>e?void 0:b,[b]),W=k.useCallback((e,t)=>{const r={};r[h.start]=[F(t(h.start)),z(t(h.start),t)].filter(Boolean).reduce((e,t)=>e||t,""),r[h.end]=[F(t(h.start)),O(t(h.start),t)].filter(Boolean).reduce((e,t)=>e||t,"");const a=g(e,t);return{...r,...a}},[O,h.end,h.start,F,z,g]);return n.canUseDOM?D.createPortal(k.createElement(m.Form,{initialValues:e.dataItem,onSubmit:_,validator:W,render:e=>k.createElement(u,{title:M,width:650,onClose:A},k.createElement(aa,{...e,as:i}),k.createElement(p.DialogActionsBar,{layout:"end"},f&&c&&k.createElement(s.Button,{fillMode:"flat",themeColor:"primary",svgIcon:d.trashIcon,onClick:L},I),k.createElement(s.Button,{onClick:N},w),k.createElement(s.Button,{themeColor:"primary",disabled:!e.allowSubmit,onClick:e.onSubmit},S))),...E}),document&&document.body):null}),ia={dialog:p.Dialog,validator:()=>({})};ca.displayName="KendoReactSchedulerForm";const ua=k.createContext({});ua.displayName="SchedulerViewPropsContext";const da=k.createContext([]),ma=()=>k.useContext(da);da.displayName="SchedulerViewRangesContext";const pa=k.createContext([[],Z]),ga=()=>k.useContext(pa);pa.displayName="SchedulerViewSlotsContext";const Ea=k.createContext([[],Z]),va=()=>k.useContext(Ea);Ea.displayName="SchedulerViewItemsContext";const ya=k.createContext([[],Z]);ya.displayName="SchedulerViewSelectedSlotsContext";const ha=k.createContext([[],Z]),fa=()=>k.useContext(ha);ha.displayName="SchedulerViewSelectedItemsContext";const ka=k.createContext([[],Z]);ka.displayName="SchedulerViewFocusedItemsContext";const Da=k.createContext([[],Z]),ba=()=>k.useContext(Da);Da.displayName="SchedulerViewFocusedSlotsContext";const Ca=({children:e,props:t,ranges:r,slots:a,items:n,selectedSlots:l,selectedItems:o,focusedItems:s,focusedSlots:c})=>k.createElement(ua.Provider,{value:t},k.createElement(da.Provider,{value:r},k.createElement(pa.Provider,{value:a},k.createElement(Ea.Provider,{value:n},k.createElement(ya.Provider,{value:l},k.createElement(ha.Provider,{value:o},k.createElement(ka.Provider,{value:s},k.createElement(Da.Provider,{value:c},e))))))));var Sa=(e=>(e.select="ITEMS_SELECT_SELECT",e.selectNext="ITEMS_SELECT_SELECT_NEXT",e.selectPrev="ITEMS_SELECT_SELECT_PREV",e.reset="ITEMS_SELECT_RESET",e.add="ITEMS_SELECT_ADD",e.remove="ITEMS_SELECT_REMOVE",e))(Sa||{});var wa=(e=>(e.select="SLOTS_SELECT_SELECT",e.reset="SLOTS_SELECT_RESET",e.add="SLOTS_SELECT_ADD",e))(wa||{});const Ia=(e,t)=>{const{element:r}=e;n.useIsomorphicLayoutEffect(()=>{if(!r||!r.current)return;const t=[],a=[],n=[],l=r.current.querySelectorAll(e.selector);l.forEach(r=>{const l=r.getBoundingClientRect().width,o=e.explicitDepth&&void 0!==e.attribute?r.getAttribute(e.attribute):0,s=I(r,!0),c=((e,t=!1)=>parseFloat(window.getComputedStyle(e)[t?"borderLeftWidth":"borderTopWidth"]||"0")+parseFloat(window.getComputedStyle(e)[t?"borderRightWidth":"borderBottomWidth"]||"0"))(r,!0);null!==o&&((!n[o]||c>n[o])&&(n[o]=c),(!a[o]||s>a[o])&&(a[o]=s),(!t[o]||l>t[o])&&(t[o]=l))}),l.forEach(r=>{const l=e.explicitDepth?r.getAttribute(e.attribute):0;null!==l&&(r.style.minWidth=t[l]-a[l]-n[l]+"px")})},t)};var Ra=(e=>(e.up="SLOT_FOCUS_UP",e.down="SLOT_FOCUS_DOWN",e.left="SLOT_FOCUS_LEFT",e.right="SLOT_FOCUS_RIGHT",e))(Ra||{});const Ta=(e,t)=>t.find(t=>null!==t.current&&null!==e.current&&t.current.props.row===e.current.props.row-1&&t.current.props.col===e.current.props.col),xa=(e,t)=>t.find(t=>null!==t.current&&null!==e.current&&t.current.props.row===e.current.props.row&&t.current.props.col===e.current.props.col-1),Ma=(e,t)=>t.find(t=>null!==t.current&&null!==e.current&&t.current.props.row===e.current.props.row&&t.current.props.col===e.current.props.col+1),Na=(e,t)=>t.find(t=>null!==t.current&&null!==e.current&&t.current.props.row===e.current.props.row+1&&t.current.props.col===e.current.props.col);var Aa=(e=>(e.next="ITEMS_FOCUS_NEXT",e.prev="ITEMS_FOCUS_PREV",e))(Aa||{});const _a=k.forwardRef((e,t)=>{const r=k.useRef(null);k.useImperativeHandle(t,()=>r.current);const[a,l]=n.useCollection([]),[o,s]=n.useCollection([]),[c,i]=(e=>[[],(t,r)=>{switch(t.type){case"ITEMS_FOCUS_NEXT":{if(!t.item||!t.item.current||!e)return;const a=q(t.item,e,t.ignoreIsAllDay,!1);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}case"ITEMS_FOCUS_PREV":{if(!t.item||!t.item.current||!e)return;const a=q(t.item,e,t.ignoreIsAllDay,!0);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}}}])(a),[u,d]=(e=>[[],(t,r)=>{switch(t.type){case"SLOT_FOCUS_UP":{if(!t.slot.current||!e)return;const a=Ta(t.slot,e);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}case"SLOT_FOCUS_DOWN":{if(!t.slot||!e)return;const a=Na(t.slot,e);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}case"SLOT_FOCUS_LEFT":{if(!t.slot||!e)return;const a=xa(t.slot,e);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}case"SLOT_FOCUS_RIGHT":{if(!t.slot||!e)return;const a=Ma(t.slot,e);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}}}])(o),[m,p]=(e=>{const[t,r]=k.useState([]),a=k.useCallback((a,n)=>{switch(a.type){case"ITEMS_SELECT_SELECT":if(!a.item)return;r([a.item]);break;case"ITEMS_SELECT_SELECT_NEXT":{if(!a.item||!a.item.current||!e)return;const t=q(a.item,e,a.ignoreIsAllDay,!1);t&&(n.preventDefault(),r([t]));break}case"ITEMS_SELECT_SELECT_PREV":{if(!a.item||!a.item.current||!e)return;const t=q(a.item,e,a.ignoreIsAllDay,!0);t&&(n.preventDefault(),r([t]));break}case"ITEMS_SELECT_RESET":r([]);break;case"ITEMS_SELECT_ADD":if(!a.item)return;t.some(e=>e===a.item)||r([...t,a.item]);break;case"ITEMS_SELECT_REMOVE":if(!a.item)return;r([...t.filter(e=>e!==a.item)])}},[e,t]);return[t,a]})(a),[g,E]=(()=>{const[e,t]=k.useState([]),r=k.useCallback(r=>{switch(r.type){case"SLOTS_SELECT_SELECT":if(!r.slot)return;t([r.slot]);break;case"SLOTS_SELECT_RESET":t([]);break;case"SLOTS_SELECT_ADD":if(!r.slot)return;e.some(e=>e===r.slot)||t([...e,r.slot])}},[e]);return[e,r]})(),v=k.useCallback((e,t)=>{E({type:wa.reset}),p(e,t)},[p,E]),y=k.useCallback((e,t)=>{p({type:Sa.reset},t),E(e)},[p,E]),h=k.useMemo(()=>n.classNames("k-scheduler-layout k-scheduler-layout-flex",e.className),[e.className]);return Ia({element:r,selector:".k-group-cell",attribute:"data-depth-index",explicitDepth:!0}),Ia({element:r,selector:".k-side-cell",attribute:"data-depth-index",explicitDepth:!1}),k.createElement(Ca,{props:e.props,ranges:e.ranges,items:[a,l],slots:[o,s],selectedItems:[m,v],selectedSlots:[g,y],focusedItems:[c,i],focusedSlots:[u,d]},k.createElement("div",{ref:r,style:e.style,className:h,role:e.role||"none"},e.children))});_a.displayName="KendoReactSchedulerBaseView";const La=k.createContext({resource:{},groupIndex:0}),za=e=>{const{nested:t,children:r,rowContentProps:a}=e,n=e.rowContent||Wa,l=e.childRowContent||n,o=C(e.group,e.resources);return k.createElement("div",{className:"k-scheduler-group k-group-horizontal"},t?Oa({resources:o,children:r,nested:t,groupIndex:0,rowContent:n,rowContentProps:a,childRowContent:l}):Fa({resources:o,children:r,rowContentProps:a,childRowContent:l}))},Oa=e=>{const{resources:t,rowContent:r,nested:a,children:n,groupIndex:l,rowContentProps:o,childRowContent:s}=e;if(l===t.length)return Fa({resources:t,children:n,rowContentProps:o,childRowContent:s});const c=S(t,l),i=r;return k.createElement(k.Fragment,null,a?k.createElement("div",{className:"k-scheduler-row"},k.createElement(i,{resources:t,groupIndex:l,...o},c.map((e,t)=>k.createElement("div",{key:t,className:"k-scheduler-cell k-heading-cell"},e.text)))):k.createElement(i,{resources:t,groupIndex:l,...o},c.map((e,t)=>k.createElement("div",{key:t,className:"k-scheduler-cell k-heading-cell"},e.text))),Oa({resources:t,children:n,nested:a,rowContent:r,childRowContent:s,groupIndex:l+1}))},Fa=e=>{const{resources:t,childRowContent:r,children:a,rowContentProps:n}=e,l=S(t,t.length-1),o=r,s=t.length>0;return k.createElement("div",{className:"k-scheduler-row"},k.createElement(o,{resources:t,...n},(l.length?l:X).map((e,t)=>k.createElement("div",{key:t,className:"k-scheduler-cell k-group-cell"},k.createElement(La.Provider,{value:{resource:e,groupIndex:s?t:0}},a)))))};za.displayName="KendoReactSchedulerHorizontalResourceIterator";const Wa=e=>e.children,Pa=e=>k.createElement(k.Fragment,null,k.createElement("div",{className:"k-scheduler-cell k-side-cell","data-range-index":e.rangeIndex}),e.children),Ha=e=>{const{nested:t,wrapGroup:r,children:a,role:n}=e,l=e.cellContent||Za,o=C(e.group,e.resources);return k.createElement("div",{className:"k-scheduler-group",role:n},t?r?k.createElement("div",{className:"k-scheduler-row"},k.createElement("div",{className:"k-sticky-cell"},Ba({resources:o,children:a,cellContent:l,depth:0,groupIndex:0})),k.createElement("div",{className:"k-scheduler-cell k-group-content"},$a({resources:o,children:a,cellContent:l,depth:0,groupIndex:0},!1))):$a({resources:o,children:a,cellContent:l,depth:0,groupIndex:0},!0):r?k.createElement("div",{className:"k-scheduler-row"},k.createElement("div",{className:"k-sticky-cell"},Ka({resources:o})),k.createElement("div",{className:"k-scheduler-cell k-group-content"},a)):Va({resources:o,children:a,cellContent:l,groupIndex:0,role:n}))},Ka=e=>k.createElement("div",{className:"k-scheduler-row"},k.createElement("div",{className:"k-scheduler-row"},e.resources.map((e,t)=>k.createElement("div",{key:t,className:"k-scheduler-cell k-resource-cell k-heading-cell","data-depth-index":t})))),$a=(e,t=!0)=>{const{resources:r,children:a,cellContent:n,groupIndex:l,depth:o}=e,s=r.length>0;if(o===r.length||!s)return k.createElement(La.Provider,{value:{resource:r[o],groupIndex:s?l:0}},a);const c=r[o].data.length;return r[o].data.map((e,s)=>k.createElement("div",{key:s,className:"k-scheduler-row"},t&&k.createElement("div",{className:"k-scheduler-cell k-group-cell k-heading-cell","data-depth-index":o},e[r[o].textField]),k.createElement("div",{className:"k-scheduler-cell k-group-content k-resource-row","data-depth-index":o,"data-resource-index":c*l+s},$a({resources:r,children:a,cellContent:n,groupIndex:c*l+s,depth:o+1},t))))},Ba=e=>{const{resources:t,children:r,cellContent:a,groupIndex:n,depth:l}=e,o=t.length?t[l].data.length:0;return t[l]?t[l].data.map((e,s)=>k.createElement("div",{key:s,className:"k-scheduler-row"},k.createElement("div",{className:"k-scheduler-cell k-resource-cell k-resource-row k-heading-cell","data-depth-index":l,"data-resource-index":o*n+s},e[t[l].textField]),l+1!==t.length&&k.createElement("div",{className:"k-scheduler-cell k-resource-content"},Ba({resources:t,children:r,cellContent:a,groupIndex:o*n+s,depth:l+1})))):null},Va=e=>{const{resources:t,children:r,groupIndex:a,cellContent:n,role:l}=e;return k.createElement("div",{className:"k-scheduler-row",role:l},Ua(t),n,Ga(r,t,a,l))},Ga=(e,t,r,a)=>{const n=t.length>0;return k.createElement("div",{className:"k-scheduler-cell k-group-content",role:a},k.createElement(La.Provider,{value:{resource:t[r],groupIndex:n?r:void 0}},e))},Ua=e=>e.map((e,t)=>k.createElement("div",{key:t,className:"k-scheduler-cell k-group-cell k-heading-cell","data-depth-index":t}));Ha.displayName="KendoReactSchedulerVerticalResourceIterator";const Za=null,qa=e=>{const t=o.useLocalization();return k.createElement(k.Fragment,null,k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-side-cell k-scheduler-times-all-day"},t.toLanguageString(Me,Cr[Me])),e.children)},Ya=k.forwardRef((e,t)=>{const{as:r=ja.as,...a}=e,l=k.useRef(null),s=k.useRef(null),c=o.useInternationalization(),i=k.useMemo(()=>n.classNames("k-scheduler-cell k-heading-cell",e.className),[e.className]);return k.useImperativeHandle(s,()=>({element:l.current&&l.current.element?l.current.element:l.current,props:e})),k.useImperativeHandle(t,()=>s.current),k.createElement(r,{ref:r!==ja.as?void 0:l,...a,className:i},c.formatDate(e.date,e.format?e.format:ja.format))}),ja={as:k.forwardRef(({as:e,format:t,start:r,end:a,...n},l)=>k.createElement("div",{...n,ref:l})),format:"t"};Ya.displayName="KendoReactSchedulerTimeHeaderCell";const Xa=e=>{const{slot:t,children:r}=e;return k.createElement(k.Fragment,null,e.isMaster?k.createElement(Ya,{as:e.timeHeaderCell,date:t.zonedStart,start:t.zonedStart,end:t.zonedEnd,className:n.classNames("k-side-cell",{"k-major-cell":!e.isLast})}):k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-side-cell"}),r)},Qa=k.forwardRef((e,t)=>{const{onFocus:r,onBlur:a,onClick:l,onMouseEnter:o,onMouseLeave:s,onMouseOut:c,onMouseOver:i,onDoubleClick:u,onKeyDown:d,onKeyPress:m,onKeyUp:p}=e,{slot:g,element:E}=((e,t)=>{const{_ref:r}=e,a=k.useRef(null),l=k.useRef(null),[,o]=ga();return k.useImperativeHandle(a,()=>({element:l.current,props:e})),k.useImperativeHandle(t,()=>a.current),k.useImperativeHandle(r,()=>a.current),k.useLayoutEffect(()=>(o({type:n.COLLECTION_ACTION.add,item:a}),()=>{o({type:n.COLLECTION_ACTION.remove,item:a})})),{slot:a,element:l}})(e,t),v=void 0!==e.tabIndex?null===e.tabIndex?void 0:e.tabIndex:e.selected?0:-1,y=k.useMemo(()=>{var t,r;const a=null!=(t=e.isWorkHour)?t:Ja.isWorkHour,l=null!=(r=e.isWorkDay)?r:Ja.isWorkDay;return n.classNames("k-scheduler-cell",e.className,"k-slot-cell",{"k-nonwork-hour":!a||!l,"k-selected":e.selected})},[e.className,e.selected,e.isWorkHour,e.isWorkDay]),h=k.useMemo(()=>({userSelect:"none",...e.style}),[e.style]),f=k.useCallback(e=>{r&&r.call(void 0,{syntheticEvent:e,target:g.current})},[r,g]),D=k.useCallback(e=>{a&&a.call(void 0,{syntheticEvent:e,target:g.current})},[a,g]),b=k.useCallback(e=>{l&&l.call(void 0,{syntheticEvent:e,target:g.current})},[l,g]),C=k.useCallback(e=>{i&&i.call(void 0,{syntheticEvent:e,target:g.current})},[i,g]),S=k.useCallback(e=>{c&&c.call(void 0,{syntheticEvent:e,target:g.current})},[c,g]),w=k.useCallback(e=>{o&&o.call(void 0,{syntheticEvent:e,target:g.current})},[o,g]),I=k.useCallback(e=>{s&&s.call(void 0,{syntheticEvent:e,target:g.current})},[s,g]),R=k.useCallback(e=>{u&&u.call(void 0,{syntheticEvent:e,target:g.current})},[u,g]),T=k.useCallback(e=>{d&&d.call(void 0,{syntheticEvent:e,target:g.current})},[d,g]),x=k.useCallback(e=>{m&&m.call(void 0,{syntheticEvent:e,target:g.current})},[m,g]),M=k.useCallback(e=>{p&&p.call(void 0,{syntheticEvent:e,target:g.current})},[p,g]);return k.createElement("div",{ref:E,id:e.id,style:h,className:y,tabIndex:v,role:e.role,"aria-selected":e.selected||void 0,onFocus:f,onBlur:D,onClick:b,onMouseEnter:w,onMouseLeave:I,onMouseOver:C,onMouseOut:S,onDoubleClick:R,onKeyDown:T,onKeyPress:x,onKeyUp:M,"data-slot":!0,"data-slot-allday":e.isAllDay,"data-slot-start":e.start.getTime(),"data-slot-end":e.end.getTime(),"data-slot-group":e.group.index,"data-slot-range":e.range.index,"data-slot-index":e.index},e.children)}),Ja={isWorkHour:!0,isWorkDay:!0};Qa.displayName="KendoReactSchedulerSlot";const en=k.forwardRef((e,t)=>{var r;const{slot:a,_ref:n,...l}=e,o=a||tn.slot,s=k.useRef(null),c=k.useRef(null);return k.useImperativeHandle(s,()=>({props:e})),k.useImperativeHandle(n,()=>c.current),k.useImperativeHandle(t,()=>s.current),((e,t)=>{const r=k.useRef(void 0),a=re(),n=k.useCallback(()=>{if(!t||!e.current)return;const r=e.current.element,a=e.current.props;if(!r)return;const n=I(r),l=new Map;let o=!1;const s=a.items.filter(e=>e._ref.current);let c,i;if(s.forEach(e=>{var t,r,a,n,s;if(!e._ref.current)return;const{height:c}=w(e._ref.current.element),i=null!=(a=null!=(r=null==(t=e._ref.current)?void 0:t._order)?r:e.order)?a:-1;null!=(n=e._ref.current.element)&&n.style.top&&(o=!0),(null!=(s=l.get(i))?s:0)<c&&l.set(i,c)}),!o||0===l.size)return void(r.style.minHeight="");{const e=Math.max(...Array.from(l.keys()));i=e+1;const t=Math.max(...Array.from(l.values()));c=0;for(let r=0;r<=e;r++)c+=l.has(r)?l.get(r):t}const u="object"==typeof t&&t.offsetTop?t.offsetTop:0;let d=0;"object"==typeof t&&t.offsetBottom&&(d=t.offsetBottom);const m=1*i*2+c-n+u+d;s.length?R(r,{height:m},!0):r&&(r.style.minHeight="")},[t,e]),l=k.useCallback(()=>{void 0!==r.current&&window.cancelAnimationFrame(r.current),r.current=window.requestAnimationFrame(()=>{n()})},[n]);k.useEffect(n,[e,e.current&&e.current.props,t]),k.useEffect(()=>{if(!e.current)return;const t=e.current.props.items.filter(e=>e._ref.current).map(e=>{if(!e._ref.current||!e._ref.current.element||!a.current)return;const t=window.ResizeObserver,r=t&&new t(l);r&&r.observe(e._ref.current.element);const n=new MutationObserver(l);return n.observe(e._ref.current.element,{attributes:!0,attributeFilter:["style"]}),()=>{r&&r.disconnect(),n.disconnect()}});return()=>{t.forEach(e=>e&&e())}},[l,a,e,e.current&&e.current.props])})(c,null!=(r=e.expandable)?r:tn.expandable),k.createElement(o,{...l,_ref:c})}),tn={slot:Qa,expandable:!1};en.displayName="KendoReactSchedulerViewSlot";const rn=k.createContext([null]);rn.displayName="SchedulerEditSlotPropsContext";const an=k.createContext([null]);an.displayName="SchedulerEditSlotFormItemContext";const nn=({props:e,form:t,children:r})=>k.createElement(rn.Provider,{value:e},k.createElement(an.Provider,{value:t},r)),ln=e=>{const t=k.useContext(ae),r=void 0!==e?e:t.editable||!1,a=!0===r||void 0!==r&&!1!==r&&!0===r.edit,n=!0===r||void 0!==r&&!1!==r&&!0===r.resize,l=!0===r||void 0!==r&&!1!==r&&!0===r.remove,o=!0===r||void 0!==r&&!1!==r&&!0===r.drag;return{add:!0===r||void 0!==r&&!1!==r&&!0===r.add,edit:a,drag:o,remove:l,resize:n,select:!0===r||void 0!==r&&!1!==r&&!0===r.select}},on=k.forwardRef((e,t)=>{const{_ref:r,onDataAction:a,viewSlot:l,form:o,formItem:s,onFormItemChange:c,...i}=e,[u,d]=k.useState(e.tabIndex),m=k.useRef(null),p=k.useRef(null);k.useImperativeHandle(p,()=>({props:e})),k.useImperativeHandle(t,()=>p.current),k.useImperativeHandle(r,()=>m.current);const g=ln(e.editable),E=ce(),[v]=ga(),[y]=va(),[h,f]=k.useContext(ya),[,D]=ba(),b=o||sn.form,C=l||sn.viewSlot,[S,w]=Se(null,s,e.onFormItemChange),I=h.some(t=>!(!t.current||t.current.props.start.getTime()!==e.start.getTime()||t.current.props.end.getTime()!==e.end.getTime()||t.current.props.index!==e.index||t.current.props.group.index!==e.group.index||t.current.props.range.index!==e.range.index||t.current.props.isAllDay!==e.isAllDay)),R=k.useCallback(()=>{const t={};if(_(t,E.start,new Date(e.start.getTime())),_(t,E.end,new Date(e.end.getTime())),_(t,E.isAllDay,e.isAllDay),e.group.resources.length)for(let r=0;r<e.group.resources.length;r++){const a=e.group.resources[r];if(M(e.group.resources)){const n=A(e.group.resources[r],a.valueField);_(t,a.field,a.multiple?[n]:n)}else _(t,a.field,a.multiple?[]:void 0)}return t},[E.start,E.end,E.isAllDay,e.start,e.end,e.isAllDay,e.group.resources]),T=k.useCallback(t=>{g.select&&f({type:wa.select,slot:m},t.syntheticEvent),e.onFocus&&e.onFocus.call(void 0,t)},[f,g.select,e.onFocus]),x=k.useCallback(t=>{if(g.add){const e=R();w(e,t)}e.onDoubleClick&&e.onDoubleClick.call(void 0,t)},[R,g.add,e.onDoubleClick,w]),N=k.useCallback(e=>{let t;switch(e.syntheticEvent.keyCode){case n.Keys.left:if(!v)return;e.syntheticEvent.preventDefault(),D({type:Ra.left,slot:m},e.syntheticEvent);break;case n.Keys.right:if(!v)return;e.syntheticEvent.preventDefault(),D({type:Ra.right,slot:m},e.syntheticEvent);break;case n.Keys.up:if(!v)return;e.syntheticEvent.preventDefault(),D({type:Ra.up,slot:m},e.syntheticEvent);break;case n.Keys.down:if(!v)return;e.syntheticEvent.preventDefault(),D({type:Ra.down,slot:m},e.syntheticEvent);break;case n.Keys.enter:{if(!v||!g.add)return;const e=R();w(e);break}case n.Keys.tab:t=(e=>{const t=e.props.items.find(e=>0===e.order)||e.props.items[0];return t&&t._ref.current})(e.target)}t&&(e.syntheticEvent.preventDefault(),t.element&&t.element.focus())},[R,D,g.add,w,v]),L=k.useCallback(e=>{a&&a.call(void 0,{type:ee.create,series:!1,dataItem:e.value},e),w(null,e.syntheticEvent)},[a,w]),z=k.useCallback(e=>{w(null,e.syntheticEvent)},[w]),O=k.useCallback(e=>{w(null,e)},[w]),F=k.useCallback((e,t)=>{w&&w(e,t)},[w]);return k.useEffect(()=>{const t=v.length&&v[0].current===m.current;d(void 0!==e.tabIndex?null===e.tabIndex?void 0:e.tabIndex:0===h.length&&t&&0===y.length?0:void 0)},[y,e.tabIndex,h.length,v]),k.createElement(nn,{props:e,form:[S,F]},k.createElement(C,{...i,_ref:m,selected:I,tabIndex:u,onFocus:T,onDoubleClick:x,onKeyDown:N}),S&&k.createElement(b,{dataItem:S,onSubmit:L,onClose:O,onCancel:z}))}),sn={viewSlot:en,form:ca};on.displayName="KendoReactSchedulerEditSlot";const cn=k.forwardRef((e,t)=>{const{isRemove:r,onClose:a,onSeriesClick:l,onOccurrenceClick:c}=e,i=k.useRef(null);k.useImperativeHandle(i,()=>({props:e})),k.useImperativeHandle(t,()=>i.current);const u=o.useLocalization(),d=e=>u.toLanguageString(e,Cr[e]),m=d(Be),g=d(Ve),E=d(Ge),v=d(Ue),y=d(Kt),h=d($t),f=d(Gt),b=d(Ht),C=r?f:v,S=r?b:E,w=r?y:m,I=r?h:g,R=k.useCallback(({syntheticEvent:e})=>{a&&a.call(void 0,{syntheticEvent:e,value:null,target:i.current})},[a]),T=k.useCallback(e=>{l&&l.call(void 0,{syntheticEvent:e,value:null,target:i.current})},[l]),x=k.useCallback(e=>{c&&c.call(void 0,{syntheticEvent:e,value:null,target:i.current})},[c]);return n.canUseDOM?D.createPortal(k.createElement(p.Dialog,{title:C,onClose:R},S,k.createElement(p.DialogActionsBar,null,k.createElement(s.Button,{onClick:x},w),k.createElement(s.Button,{onClick:T},I))),document&&document.body):null});cn.displayName="KendoReactSchedulerSchedulerOccurrenceDialog";const un=k.forwardRef((e,t)=>{const{onClose:r,onCancel:a,onConfirm:l,isSeries:c}=e,i=k.useRef(null);k.useImperativeHandle(i,()=>({props:e})),k.useImperativeHandle(t,()=>i.current);const u=o.useLocalization(),d=u.toLanguageString(qe,Cr[qe]),m=u.toLanguageString(Ft,Cr[Ft]),g=c?u.toLanguageString(Pt,Cr[Pt]):u.toLanguageString(Wt,Cr[Wt]),E=c?u.toLanguageString(Vt,Cr[Vt]):u.toLanguageString(Bt,Cr[Bt]),v=k.useCallback(({syntheticEvent:e})=>{if(!r)return;const t={syntheticEvent:e,value:null,target:i.current};r.call(void 0,t)},[r]),y=k.useCallback(e=>{a&&a.call(void 0,{syntheticEvent:e,value:null})},[a]),h=k.useCallback(e=>{l&&l.call(void 0,{syntheticEvent:e,value:null})},[l]);return n.canUseDOM?D.createPortal(k.createElement(p.Dialog,{title:E,onClose:v},g,k.createElement(p.DialogActionsBar,null,k.createElement(s.Button,{onClick:y},d),k.createElement(s.Button,{onClick:h},m))),document&&document.body):null});un.displayName="KendoReactSchedulerRemoveDialog";const dn=k.forwardRef((e,t)=>{const{onFocus:r,onBlur:a,onMouseDown:l,onClick:s,onMouseUp:c,onMouseOut:i,onMouseOver:u,onMouseEnter:d,onMouseLeave:m,onDoubleClick:p,onKeyUp:g,onKeyDown:E,onKeyPress:v,onPress:y,onDrag:h,onRelease:f,onResizePress:D,onResizeEndDrag:b,onResizeRelease:C,onResizeStartDrag:S}=e,{item:w,element:I}=((e,t)=>{const{_ref:r,itemRef:a,_maxSiblingsPerSlot:l,_siblings:o,_order:s}=e,c=k.useRef(null),i=k.useRef(null),[,u]=va();return k.useImperativeHandle(c,()=>({element:i.current,props:e,get _maxSiblingsPerSlot(){return null==l?void 0:l.current},set _maxSiblingsPerSlot(e){var t;null!=e&&void 0!==l&&void 0!==l.current&&(l.current=e,null==(t=null==o?void 0:o.current)||t.forEach(t=>{var r;!t||t._maxSiblingsPerSlot===e||e<(null!=(r=t._maxSiblingsPerSlot)?r:0)||(t._maxSiblingsPerSlot=e)}))},get _order(){return null==s?void 0:s.current},set _order(e){void 0!==e&&void 0!==s&&void 0!==s.current&&(s.current=e)}})),k.useImperativeHandle(t,()=>c.current),k.useImperativeHandle(r,()=>c.current),k.useImperativeHandle(a,()=>c.current),n.useIsomorphicLayoutEffect(()=>(u({type:n.COLLECTION_ACTION.add,item:c}),()=>{u({type:n.COLLECTION_ACTION.remove,item:c})})),{item:c,element:i}})(e,t),R=k.useRef(null),T=k.useRef(null),x=k.useRef(null),M=k.useRef(null),N=ln(e.editable),A=e.readonly?{resize:!1,select:N.select}:N,_=o.useInternationalization(),L=o.useLocalization().toLanguageString(Me,Cr[Me]),z=e.group.resources.find(e=>!(!e.colorField||""===e[e.colorField]||void 0===e[e.colorField])),O=z&&z.colorField&&z[z.colorField],F=void 0!==e.tabIndex?null===e.tabIndex?void 0:e.tabIndex:e.selected?0:-1,W=k.useMemo(()=>n.classNames({"k-event":!e.resizeHint,"k-selected":e.selected&&A.select,"k-readonly":!e.resizeHint&&!!e.readonly,"k-event-drag-hint":e.dragHint,"k-scheduler-marquee":e.resizeHint,"k-marquee":e.resizeHint,"k-first":e.resizeHint&&!e.tail,"k-last":e.resizeHint&&!e.head},e.className),[e.resizeHint,e.selected,e.readonly,e.dragHint,e.tail,e.head,e.className,A.select]),P=k.useMemo(()=>`${e.title}, ${function(e,t,r,a,n="all day"){const l={skeleton:"yMMMMEEEEdhm"},o={skeleton:"yMMMMEEEEd"},s=t.getFullYear()===r.getFullYear()&&t.getMonth()===r.getMonth()&&t.getDate()===r.getDate();if(a){const a=0===r.getHours()&&0===r.getMinutes()&&0===r.getSeconds()&&r.getTime()-t.getTime()===864e5;return s||a?`${e.formatDate(t,o)} (${n})`:`${e.formatDate(t,o)} to ${e.formatDate(r,o)} (${n})`}return s?`${e.formatDate(t,l)}–${e.formatDate(r,"t")}`:`${e.formatDate(t,l)}-${e.formatDate(r,l)}`}(_,e.zonedStart,e.zonedEnd,e.isAllDay,L)}`,[_,e.isAllDay,e.title,e.zonedEnd,e.zonedStart,L]),H=k.useMemo(()=>{var t;return{cursor:"pointer",userSelect:"none",borderColor:e.resizeHint?void 0:O,backgroundColor:e.resizeHint?void 0:O,touchAction:"none",...e.style,containerType:e.resizeHint?void 0:"auto"===(null==(t=e.style)?void 0:t.height)?"normal":"size"}},[O,e.style,e.resizeHint]),K=k.useCallback(e=>{r&&r.call(void 0,{syntheticEvent:e,target:w.current})},[r,w]),$=k.useCallback(e=>{a&&a.call(void 0,{syntheticEvent:e,target:w.current})},[a,w]),B=k.useCallback(e=>{l&&l.call(void 0,{syntheticEvent:e,target:w.current})},[l,w]),V=k.useCallback(e=>{s&&s.call(void 0,{syntheticEvent:e,target:w.current})},[s,w]),G=k.useCallback(e=>{c&&c.call(void 0,{syntheticEvent:e,target:w.current})},[c,w]),U=k.useCallback(e=>{u&&u.call(void 0,{syntheticEvent:e,target:w.current})},[u,w]),Z=k.useCallback(e=>{i&&i.call(void 0,{syntheticEvent:e,target:w.current})},[i,w]),q=k.useCallback(e=>{d&&d.call(void 0,{syntheticEvent:e,target:w.current})},[d,w]),Y=k.useCallback(e=>{m&&m.call(void 0,{syntheticEvent:e,target:w.current})},[m,w]),j=k.useCallback(t=>{!p||e.readonly||p.call(void 0,{syntheticEvent:t,target:w.current})},[p,w,e.readonly]),X=k.useCallback(e=>{E&&E.call(void 0,{syntheticEvent:e,target:w.current})},[E,w]),Q=k.useCallback(e=>{v&&v.call(void 0,{syntheticEvent:e,target:w.current})},[v,w]),J=k.useCallback(e=>{g&&g.call(void 0,{syntheticEvent:e,target:w.current})},[g,w]),ee=k.useCallback(t=>{!y||e.readonly||y.call(void 0,{dragEvent:t,target:w.current})},[y,w,e.readonly]),te=k.useCallback(t=>{!h||e.readonly||h.call(void 0,{dragEvent:t,target:w.current})},[h,w,e.readonly]),re=k.useCallback(t=>{!f||e.readonly||f.call(void 0,{dragEvent:t,target:w.current})},[f,w,e.readonly]),ae=k.useCallback(t=>{!D||e.readonly||D.call(void 0,{dragEvent:t,target:w.current})},[D,w,e.readonly]),ne=k.useCallback(e=>{S&&S.call(void 0,{dragEvent:e,target:w.current})},[S,w]),le=k.useCallback(e=>{b&&b.call(void 0,{dragEvent:e,target:w.current})},[b,w]),oe=k.useCallback(e=>{C&&C.call(void 0,{dragEvent:e,target:w.current})},[C,w]);return n.useDraggable(I,{onPress:ee,onDrag:te,onRelease:re}),n.useDraggable(R,{onPress:ae,onDrag:le,onRelease:oe}),n.useDraggable(T,{onPress:ae,onDrag:ne,onRelease:oe}),n.useDraggable(x,{onPress:ae,onDrag:ne,onRelease:oe}),n.useDraggable(M,{onPress:ae,onDrag:le,onRelease:oe}),k.createElement("div",{ref:I,id:e.id,style:H,tabIndex:F,className:W,role:"button","aria-label":P,onFocus:K,onBlur:$,onMouseUp:G,onMouseDown:B,onClick:V,onMouseOver:U,onMouseOut:Z,onMouseEnter:q,onMouseLeave:Y,onDoubleClick:j,onKeyDown:X,onKeyPress:Q,onKeyUp:J,"data-group-index":e.group.index,"data-range-index":e.range.index},e.children,A.resize&&e.vertical&&k.createElement(k.Fragment,null,k.createElement("span",{className:"k-resize-handle k-resize-n",ref:x}),k.createElement("span",{className:"k-resize-handle k-resize-s",ref:M})),A.resize&&!e.vertical&&k.createElement(k.Fragment,null,k.createElement("span",{className:"k-resize-handle k-resize-w",ref:T}),k.createElement("span",{className:"k-resize-handle k-resize-e",ref:R})),e.resizeHint&&k.createElement(k.Fragment,null,k.createElement("div",{className:"k-marquee-color",style:{borderColor:O,backgroundColor:O}}),k.createElement("div",{className:"k-marquee-text"},!e.tail&&k.createElement("div",{className:"k-label-top"},_.formatDate(e.zonedStart,e.format)),!e.head&&k.createElement("div",{className:"k-label-bottom"},_.formatDate(e.zonedEnd,e.format)))))});dn.displayName="KendoReactSchedulerItem";const mn=k.forwardRef((e,t)=>{const r=k.useMemo(()=>n.classNames("k-event-template",e.className),[e.className]);return k.createElement("div",{ref:t,...e,className:r})}),pn=(e,t)=>{const{element:r}=e;k.useEffect(()=>{if(!r||!e.syncHeight)return;const t=[[]];Array.from(r.querySelectorAll(e.selector)).filter(t=>!t.classList.contains((e=>e.slice(1,e.length))(e.applyTo))).forEach(r=>{const a=r.clientHeight,n=r.getAttribute(e.horizontalAttribute),l=r.getAttribute(e.verticalAttribute);null===n||null===l||(t[n]||(t[n]=[]),(!t[n][l]||a>t[n][l])&&(t[n][l]=a-1))}),Array.from(r.querySelectorAll(e.applyTo)).forEach(r=>{const a=r.getAttribute(e.horizontalAttribute),n=r.getAttribute(e.verticalAttribute);if(null===a||null===n)return;const l=I(r),o=Math.round(t[a][n]-l);R(r,{height:o},!0)})},t)},gn=k.forwardRef((e,t)=>{const{item:r,_ref:a,itemRef:l,...s}=e,c=k.useRef(void 0),i=k.useRef(void 0),u=k.useRef(null),m=k.useRef(null),p=k.useRef(null),g=ln(e.editable);k.useImperativeHandle(m,()=>({props:e,element:u.current&&u.current.element})),k.useImperativeHandle(t,()=>m.current),k.useImperativeHandle(a,()=>u.current),k.useImperativeHandle(l,()=>u.current);const E=r||En.item,v=o.useInternationalization(),[y]=va(),[h]=ga(),f=re(),[D,b]=k.useState(!0),[C,S]=k.useState(!1),I=k.useRef(e.order),x=k.useRef(0),M=n.useDir(f),N=k.useMemo(()=>{var t,r;return e.isAllDay?null!=(t=e.title)?t:"":`(${v.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd)}): ${null!=(r=e.title)?r:""}`},[v,e.isAllDay,e.title,e.zonedEnd,e.zonedStart]);let A;e.isRecurring&&!e.isException?A="recurring":!e.isRecurring&&e.isException&&(A="non-recurring");const _=k.useMemo(()=>v.format("{0:t} – {1:t}",e.zonedStart,e.zonedEnd),[v,e.zonedStart,e.zonedEnd]),L=(e,t)=>{let r=1;return e.forEach(e=>{const a=t.filter(t=>z(e.current.props,t.props));a.length>r&&(r=a.length)}),r},z=(t,r)=>H(t.start,t.end,r.start,r.end)&&t.group.index===r.group.index&&t.range.index===r.range.index&&(void 0===t.range.isAllDay||void 0===r.range.isAllDay||t.range.isAllDay===r.range.isAllDay)&&(e.ignoreIsAllDay||t.isAllDay===r.isAllDay),O=()=>{var t,r,a,n,l;const o=(h||[]).filter(t=>t.current&&z(t.current.props,e)),s=u.current&&u.current.element,c=T(o);if(0===o.length)return void b(!1);if(!c.current||!s)return;const i=w(c.current.element),d=[],m=[],p=[];(y||[]).forEach(e=>{e.current&&(e.current.props.dragHint?m.push(e.current):e.current.props.resizeHint?p.push(e.current):d.push(e.current))});const E=e.dragHint||e.resizeHint?((e,t,r,a=!1)=>{let n;return r.forEach(r=>{const l=[];t.sort((e,t)=>e.props.start.getTime()-t.props.start.getTime()).forEach(t=>{if((a||t.props.isAllDay===r.current.props.isAllDay)&&t.props.range.index===r.current.props.range.index&&t.props.group.index===r.current.props.group.index&&H(t.props.start,t.props.end,r.current.props.start,r.current.props.end)){const r=V(l);t===e&&void 0===n&&(n=r),l.splice(r,0,r)}})}),n})(u.current,e.dragHint?m:p,o,e.ignoreIsAllDay):null!=(t=e.order)?t:0;if(e.vertical||e.dragHint||e.resizeHint||null===e.order||void 0===e.order)I.current=E;else{const t=(e.ignoreIsAllDay?d:d.filter(e=>e.props.isAllDay)).filter(t=>t.props.group.index===e.group.index),a=null==(r=e.style)?void 0:r.height,n="number"==typeof a?a:parseFloat(a),l=null!=a&&Number.isNaN(n),o=!!e.ignoreIsAllDay,s=!!o||!l;I.current=((e,t,r,a=!1)=>{var n;const l=t.filter(e=>null!==e.props.order&&void 0!==e.props.order).map(e=>{let t=e.props.start,r=e.props.end;if(e.props.isAllDay||a){t=new Date(t.getFullYear(),t.getMonth(),t.getDate());const e=new Date(r.getFullYear(),r.getMonth(),r.getDate());r=e.getTime()<=t.getTime()?new Date(t.getFullYear(),t.getMonth(),t.getDate()+1):e}return{order:e.props.order,start:t,end:r}}),o=Array.from(new Set(l.map(e=>e.order))).sort((e,t)=>e-t),s=new Map;for(const e of l)s.has(e.order)||s.set(e.order,[]),s.get(e.order).push({start:e.start,end:e.end});const c=[],i=new Map;for(const e of o){const t=s.get(e);let a=-1,n=0;i.forEach((a,l)=>{if(l>=e)return;const o=s.get(l);o&&t.some(e=>o.some(t=>H(t.start,t.end,e.start,e.end,r)))&&a+1>n&&(n=a+1)});for(let e=n;e<c.length;e++)if(t.every(t=>c[e].every(e=>!H(e.start,e.end,t.start,t.end,r)))){a=e;break}-1===a&&(a=c.length,c.push([])),c[a].push(...t),i.set(e,a)}return null!=(n=i.get(e))?n:e})(e.order,t,s,o)}let v=e.dragHint||e.resizeHint?L(o,e.dragHint?m:p):L(o,d);const f=((e,t)=>e.map(e=>t.filter(t=>z(e.current.props,t.props))))(o,d);let k=0;const D=!e.vertical&&null!==I.current;if(f.forEach(e=>{let t=0;e.forEach(e=>{if(!D){const r=w(e.element);null!==e.props.order&&void 0!==e.props.order&&e.props.order<I.current&&(t=r.top+r.height-i.top-1*I.current+1)}}),t>k&&(k=t)}),D){const t=null==(a=e.style)?void 0:a.height,r="number"==typeof t?t:parseFloat(t);if(null==t)k=26*I.current;else if(Number.isNaN(r)){const t=(e.ignoreIsAllDay?d:d.filter(e=>e.props.isAllDay)).filter(t=>t.props.group.index===e.group.index&&t.element!==s&&(!e.ignoreIsAllDay||!c.current||H(t.props.start,t.props.end,c.current.props.start,c.current.props.end))),r=new Map;t.forEach(e=>{var t,a;const n=e._order;if(null==n||n>=I.current)return;const l=(null==(t=e.element)?void 0:t.offsetHeight)||25;r.set(n,Math.max(null!=(a=r.get(n))?a:0,l))}),k=Array.from(r.values()).reduce((e,t)=>e+t+1,0)}else k=I.current*(r+1)}if(0===o.length)return void b(!1);const C=g.add?20:0;i.width=e.vertical?i.width/v-1-C/v:i.width*o.length-1,e.vertical?i.height=i.height*o.length-1:(e.resizeHint||e.dragHint)&&v<=1||(i.height=null!=(l=null==(n=e.style)?void 0:n.height)?l:25),i.left=e.vertical?i.left+I.current*i.width+1*I.current:i.left;const M=!e.vertical&&e.slotHeaderOffset||0;i.top=e.vertical?i.top:i.top+k+1*I.current+M,x.current=v,R(s,i),S(!0),b(!0)},F=k.useCallback(e=>{const t=e&&e[0],r=p.current;void 0!==c.current&&window.cancelAnimationFrame(c.current),r&&t&&(r.width!==t.contentRect.width||r.height!==t.contentRect.height)&&(c.current=window.requestAnimationFrame(()=>{O()})),p.current={width:t.contentRect.width,height:t.contentRect.height}},[O]);k.useEffect(()=>(O(),void 0!==i.current&&window.cancelAnimationFrame(i.current),i.current=window.requestAnimationFrame(()=>{i.current=window.requestAnimationFrame(()=>{i.current=void 0,O()})}),()=>{void 0!==i.current&&(window.cancelAnimationFrame(i.current),i.current=void 0)}));const W=u.current&&u.current.element?u.current.element.closest(".k-scheduler-layout"):null;return pn({element:W,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),k.useEffect(()=>{if(!f.current)return;const e=window.ResizeObserver,t=e&&new e(F);return t&&t.observe(f.current),()=>{t&&t.disconnect()}},[F,f]),k.createElement(E,{...s,_ref:u,_maxSiblingsPerSlot:x,_order:I,itemRef:u,style:{visibility:C?void 0:"hidden",display:D?void 0:"none",...e.style}},!e.resizeHint&&k.createElement(k.Fragment,null,e.tail&&!e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"rtl"===M?"chevron-right":"chevron-left",icon:"rtl"===M?d.chevronRightIcon:d.chevronLeftIcon})),k.createElement("div",{title:N},e.tail&&e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"chevron-up",icon:d.chevronUpIcon})),k.createElement(mn,{className:"k-event-title"},e.title),k.createElement(mn,{className:"k-event-time"},"recurring"===A&&k.createElement("span",{className:"k-event-recurrence-icon"},k.createElement(n.IconWrap,{name:"arrow-rotate-cw",icon:d.arrowRotateCwIcon})),"non-recurring"===A&&k.createElement("span",{className:"k-event-recurrence-icon"},k.createElement(n.IconWrap,{name:"arrows-no-repeat",icon:d.arrowsNoRepeatIcon})),_),e.head&&e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"chevron-down",icon:d.chevronDownIcon}))),A&&k.createElement("span",{className:"k-event-recurrence-icon"},k.createElement(n.IconWrap,{name:"recurring"===A?"arrow-rotate-cw":"arrows-no-repeat",icon:"recurring"===A?d.arrowRotateCwIcon:d.arrowsNoRepeatIcon})),e.head&&!e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"rtl"===M?"chevron-left":"chevron-right",icon:"rtl"===M?d.chevronLeftIcon:d.chevronRightIcon}))))}),En={item:dn};gn.displayName="KendoReactSchedulerViewItem";const vn=(e,{dateRange:t,fields:r,timezone:a})=>{const l=n.getter(r.recurrenceId||"recurrenceId"),o=n.getter(r.recurrenceRule||"recurrenceRule"),s=new Set(e.filter(e=>null!=l(e)&&!!o(e)).map(l));return e.map(yn(r)).reduce(hn(t,a,r,s),[]).filter(e=>!F(e.dataItem,r))},yn=e=>t=>{const r=n.getter(e.start||"start")(t),a=n.getter(e.originalStart||"originalStart")(t),l=n.getter(e.recurrenceId||"recurrenceId")(t),o=n.getter(e.recurrenceRule||"recurrenceRule")(t),s=null!=l&&!!o&&null==a,c=n.clone(t);return s&&_(c,e.originalStart||"originalStart",r),{uid:n.getter(e.id||"id")(t),start:r,startTimezone:n.getter(e.startTimezone||"startTimezone")(t),originalStart:s?r:a,end:n.getter(e.end||"end")(t),endTimezone:n.getter(e.endTimezone||"endTimezone")(t),isAllDay:n.getter(e.isAllDay||"isAllDay")(t),title:n.getter(e.title||"title")(t),description:n.getter(e.description||"description")(t),occurrenceId:n.getter("occurrenceId")(t),recurrenceRule:o,recurrenceExceptions:n.getter(e.recurrenceExceptions||"recurrenceExceptions")(t),recurrenceId:l,readonly:n.getter(e.readonly||"readonly")(t),dataItem:c}},hn=(e,t,r,a)=>(n,l)=>[...n,...!l.recurrenceRule||null!==l.recurrenceId&&void 0!==l.recurrenceId||!F(l.dataItem,r)||a.has(l.uid)?[l]:[...fn(l,{dateRange:e,timezone:t,fields:r})]],fn=(e,{dateRange:t,timezone:r,fields:l})=>{const o=e.recurrenceRule,s=g.parseRule({recurrenceRule:o});if(!s)return[];s.start||(s.start=a.ZonedDate.fromLocalDate(e.start,r)),s.end||(s.end=a.ZonedDate.fromLocalDate(e.end,r));const c=e.recurrenceExceptions;c&&(s.exceptionDates=c.map(e=>a.ZonedDate.fromLocalDate(e,r)));const i=s.end.getTime()-s.start.getTime(),u=a.ZonedDate.fromLocalDate(new Date(t.zonedStart.toLocalDate().getTime()-i),r),d=t.zonedEnd,m=g.expand(s,{rangeStart:u,rangeEnd:d});if(!m.events.length)return[];const p=s.until,E=p&&s.bySetPosition?m.events.filter(e=>e.start.getTime()<=p.getTime()):m.events;return E.length?E.map((t,r)=>{const a=n.clone(e),o=n.clone(e.dataItem);return a.recurrenceId=a.uid,_(o,l.recurrenceId,e.uid),a.originalStart=t.start.toLocalDate(),_(o,l.originalStart,t.start.toLocalDate()),a.start=t.start.toLocalDate(),_(o,l.start,t.start.toLocalDate()),a.end=t.end.toLocalDate(),_(o,l.end,t.end.toLocalDate()),a.occurrenceId=String(r),_(o,"occurrenceId",String(r)),a.dataItem=o,a}):[]},kn=(e,{timezone:t},{groups:r,ranges:n})=>{const o=[];return l.orderBy(e,[{field:"start",dir:"asc"},{field:"end",dir:"desc"},{field:"isAllDay",dir:"desc"},{field:"title",dir:"asc"},{field:"uid",dir:"asc"}]).forEach(e=>{r.forEach(r=>{const l=!!r.isDefault,s=l?Dn(e,r):r;(l||Cn(e,s))&&n.forEach(r=>{var n;if(Sn(e,r)){const l=k.createRef(),c=k.createRef(),i=r.end<e.end,u=e.start<r.start,d=a.ZonedDate.fromLocalDate(e.start,t),m=a.ZonedDate.fromLocalDate(e.end,t),p={...e,_ref:c,itemRef:l,head:i,tail:u,order:null,zonedStart:d,zonedEnd:m,group:s,range:r,slots:[],isRecurring:!!e.recurrenceRule,isException:!e.recurrenceRule&&null!==e.recurrenceId&&void 0!==e.recurrenceId,isAllDay:!!e.isAllDay,readonly:null!=(n=e.readonly)?n:void 0};o.push(p)}})})}),o},Dn=(e,t)=>({index:0,resources:t.resources.filter(t=>bn(e,t))}),bn=(e,t)=>t.multiple?(e.dataItem[t.field]||[]).some(e=>t[t.valueField]===e):e.dataItem[t.field]===t[t.valueField],Cn=(e,t)=>!t.resources.some(t=>t.multiple?!(e.dataItem[t.field]||[]).some(e=>t[t.valueField]===e):e.dataItem[t.field]!==t[t.valueField]),Sn=(e,t)=>H(t.start,t.end,e.start,e.end)&&(void 0===t.isAllDay||!!e.isAllDay==!!t.isAllDay),wn=e=>{const t=ma(),{timezone:r}=ne(),a=de(),n=ce(),l=pe(),[o]=ga(),s=e.viewItem||In.viewItem,c=k.useMemo(()=>vn([e.dataItem],{dateRange:l,fields:n,timezone:r}),[e.dataItem,l,n,r]),i=k.useMemo(()=>kn(c,{timezone:r},{groups:a,ranges:t}),[c,r,a,t]),u=(o||[]).map(e=>e.current.props);return U(i,u),k.createElement(k.Fragment,null,i.map((t,r)=>k.createElement(s,{key:r,...t,item:e.item,dragHint:!0,vertical:e.vertical,ignoreIsAllDay:e.ignoreIsAllDay})))},In={viewItem:gn,item:dn};wn.displayName="KendoReactSchedulerDrag";const Rn=e=>{const t=ma(),{timezone:r}=ne(),a=de(),n=ce(),l=pe(),[o]=ga(),s=e.viewItem||Tn.viewItem,c=k.useMemo(()=>vn([e.dataItem],{dateRange:l,fields:n,timezone:r}),[e.dataItem,l.start.getTime(),l.end.getTime(),n,r]),i=k.useMemo(()=>kn(c,{timezone:r},{groups:a,ranges:t}),[c,r,a,t]),u=(o||[]).map(e=>e.current.props);return U(i,u),k.createElement(k.Fragment,null,i.map((t,r)=>{var a;return k.createElement(s,{key:r,...t,format:e.format,item:null!=(a=e.item)?a:Tn.item,resizeHint:!0,vertical:e.vertical,ignoreIsAllDay:e.ignoreIsAllDay})}))},Tn={viewItem:gn,item:dn};Rn.displayName="KendoReactSchedulerResize";const xn=k.createContext([null]);xn.displayName="SchedulerEditItemPropsContext";const Mn=k.createContext([null,n.noop,n.noop]);Mn.displayName="SchedulerEditItemFormItemContext";const Nn=k.createContext([null,n.noop,n.noop]);Nn.displayName="SchedulerEditItemDragItemContext";const An=k.createContext([null,n.noop,n.noop]);An.displayName="SchedulerEditItemResizeItemContext";const _n=k.createContext([null,n.noop,n.noop]);_n.displayName="SchedulerEditItemRemoveItemContext";const Ln=k.createContext([!1,n.noop,n.noop]);Ln.displayName="SchedulerEditItemShowRemoveDialogContext";const zn=k.createContext([!1,n.noop,n.noop]);zn.displayName="SchedulerEditItemShowOccurrenceDialogContext";const On=({props:e,form:t,drag:r,resize:a,remove:n,showRemoveDialog:l,showOccurrenceDialog:o,children:s})=>k.createElement(xn.Provider,{value:e},k.createElement(Mn.Provider,{value:t},k.createElement(Nn.Provider,{value:r},k.createElement(An.Provider,{value:a},k.createElement(_n.Provider,{value:n},k.createElement(Ln.Provider,{value:l},k.createElement(zn.Provider,{value:o},s)))))));var Fn=(e=>(e.set="FORM_ITEM_SET",e.setMaster="FORM_ITEM_SET_MASTER",e.reset="FORM_ITEM_RESET",e.complete="FORM_ITEM_COMPLETE",e))(Fn||{});var Wn=(e=>(e.set="SHOW_OCCURRENCE_DIALOG_SET",e.open="SHOW_OCCURRENCE_DIALOG_OPEN",e.close="SHOW_OCCURRENCE_DIALOG_CLOSE",e.reset="SHOW_OCCURRENCE_DIALOG_RESET",e.toggle="SHOW_OCCURRENCE_DIALOG_TOGGLE",e))(Wn||{});var Pn=(e=>(e.set="REMOVE_ITEM_SET",e.reset="REMOVE_ITEM_RESET",e.complete="REMOVE_ITEM_COMPLETE",e))(Pn||{});var Hn=(e=>(e.set="SHOW_REMOVE_DIALOG_SET",e.open="SHOW_REMOVE_DIALOG_OPEN",e.close="SHOW_REMOVE_DIALOG_CLOSE",e.reset="SHOW_REMOVE_DIALOG_RESET",e.toggle="SHOW_REMOVE_DIALOG_TOGGLE",e))(Hn||{});var Kn=(e=>(e.set="DRAG_ITEM_SET",e.start="DRAG_ITEM_START",e.drag="DRAG_ITEM_DRAG",e.complete="DRAG_ITEM_COMPLETE",e.completeOccurrence="DRAG_ITEM_COMPLETE_OCCURRENCE",e.completeSeries="DRAG_ITEM_COMPLETE_SERIES",e.reset="DRAG_ITEM_RESET",e.dragSelected="DRAG_ITEM_DRAG_SELECTED",e))(Kn||{});var $n=(e=>(e.set="RESIZE_ITEM_SET",e.start="RESIZE_ITEM_START",e.startDrag="RESIZE_ITEM_START_DRAG",e.startDragSelected="RESIZE_ITEM_START_DRAG_SELECTED",e.endDrag="RESIZE_ITEM_END_DRAG",e.endDragSelected="RESIZE_ITEM_END_DRAG_SELECTED",e.complete="RESIZE_ITEM_COMPLETE",e.completeOccurrence="RESIZE_ITEM_COMPLETE_OCCURRENCE",e.completeSeries="RESIZE_ITEM_COMPLETE_SERIES",e.reset="RESIZE_ITEM_RESET",e))($n||{});var Bn=(e=>(e.reset="SERIES_RESET",e.set="SERIES_SET",e.toggle="SERIES_TOGGLE",e))(Bn||{});const Vn=(e,t,r)=>{const[a,n]=Se(e,t,r);return[a,n,e=>{const t=((e,t)=>{switch(t.type){case"SERIES_RESET":return null;case"SERIES_SET":return t.payload;case"SERIES_TOGGLE":return!e;default:return e}})(a,e);n(t)}]},Gn=e=>!0===e||"object"==typeof e&&null!==e&&!0===e.drag,Un=k.forwardRef((e,t)=>{const{_ref:r,itemRef:a,onDataAction:l,ignoreIsAllDay:o,viewItem:s,series:c,onSeriesChange:i,form:u,formItem:d,onFormItemChange:m,drag:p,dragItem:g,onDragItemChange:E,resize:v,resizeItem:y,onResizeItemChange:h,removeDialog:f,removeItem:D,onRemoveItemChange:b,occurrenceDialog:C,showOccurrenceDialog:S,onShowOccurrenceDialogChange:w,showRemoveDialog:I,onShowRemoveDialogChange:R,onFocus:T,onFocusAction:x,onMouseDown:M,onMouseDownAction:L,onMouseUp:z,onMouseUpAction:F,onClick:W,onClickAction:P,onDoubleClick:H,onDoubleClickAction:K,onRemoveClick:$,onRemoveClickAction:B,onPress:V,onPressAction:G,onDrag:U,onDragAction:Z,onRelease:q,onReleaseAction:Y,onResizePress:j,onResizePressAction:X,onResizeStartDrag:Q,onResizeStartDragAction:J,onResizeEndDrag:te,onResizeEndDragAction:re,onResizeRelease:ae,onResizeReleaseAction:ne,onOccurrenceClick:le,onOccurrenceClickAction:oe,onSeriesClick:se,onSeriesClickAction:ie,onKeyDown:ue,onKeyDownAction:me,onKeyUp:pe,onKeyUpAction:ge,onRemoveConfirm:Ee,onRemoveConfirmAction:ve,onFormSubmit:ye,onFormSubmitAction:he,onCancel:ke,onCancelAction:De}={...Zn,...e},[Ce,we]=k.useState(e.tabIndex),Ie=k.useRef(null),Re=k.useRef(null),Te=n.useId();k.useImperativeHandle(Ie,()=>({props:e,element:Re.current&&Re.current.element})),k.useImperativeHandle(t,()=>Ie.current),k.useImperativeHandle(r,()=>Re.current),k.useImperativeHandle(a,()=>Re.current);const xe=s||Zn.viewItem,Me=p||Zn.drag,Ne=v||Zn.resize,Ae=u||Zn.form,_e=C||Zn.occurrenceDialog,Le=f||Zn.removeDialog,ze=ln(e.editable),[Oe,Fe]=fa(),[We,,Pe]=Vn(null,c,i),[He,Ke,$e]=((e,t)=>{const[r,a]=Se(...t),l=ce(),[o]=fe();return[r,a,(t,s)=>{let c;switch(t.type){case"FORM_ITEM_SET":c=t.payload;break;case"FORM_ITEM_RESET":c=null;break;case"FORM_ITEM_SET_MASTER":c=n.clone(O(t.payload,l,o));break;case"FORM_ITEM_COMPLETE":e.onDataAction&&r&&(e.onDataAction.call(void 0,{type:ee.update,series:e.series,dataItem:t.payload}),c=null);break;default:c=r}a(c,s)}]})({series:We,onDataAction:l},[null,d,m]),[Be,Ve,Ge]=((e,t)=>{const r=k.useRef(0),a=k.useRef(0),l=k.useRef(0),o=k.useRef(null),[s,c]=Se(...t),[i]=fa(),u=ce(),d=de();return[s,c,t=>{switch(t.type){case"DRAG_ITEM_SET":c(t.payload);break;case"DRAG_ITEM_RESET":c(null);break;case"DRAG_ITEM_DRAG_SELECTED":{if(Math.abs(a.current-t.payload.x)<10&&Math.abs(l.current-t.payload.y)<10)return;const r=N(t.payload.x,t.payload.y,7);if(!r||r===o.current)return;const s=n.clone(e.dataItem),d=r.getAttribute("data-slot-start"),m="true"===r.getAttribute("data-slot-allday");if(!e.ignoreIsAllDay&&m!==e.isAllDay)return;const p=new Date(A(s,u.start)),g=Number(d)-p.getTime(),E=i.map(e=>{if(!e.current)return null;const t=n.clone(e.current.props.dataItem),r=new Date(e.current.props.start.getTime()+g),a=new Date(e.current.props.end.getTime()+g);return _(t,u.start,r),_(t,u.end,a),t}).filter(Boolean);o.current=r,c([...E]);break}case"DRAG_ITEM_START":{const o=t.payload.x,s=t.payload.y;a.current=o,l.current=s;const c=N(o,s,7);if(!c)return;const i=n.clone(e.dataItem),d=c.getAttribute("data-slot-start"),m=A(i,u.start);if(null===d)return;r.current=Number(d)-new Date(m).getTime();break}case"DRAG_ITEM_DRAG":{if(Math.abs(a.current-t.payload.x)<10&&Math.abs(l.current-t.payload.y)<10)return;const s=N(t.payload.x,t.payload.y,7);if(!s||s===o.current)return;const i=n.clone(e.dataItem),m=s.getAttribute("data-slot-start"),p=s.getAttribute("data-slot-group"),g="true"===s.getAttribute("data-slot-allday");if(!e.ignoreIsAllDay&&g!==e.isAllDay)return;const E=new Date(A(i,u.start)),v=new Date(A(i,u.end)).getTime()-E.getTime(),y=new Date(Number(m)-Number(r.current)),h=new Date(Number(m)-Number(r.current)+v),f=d.find(e=>e.index===Number(p));_(i,u.start,y),_(i,u.end,h),f&&d.length>1&&f.resources.forEach(e=>{e.multiple||_(i,e.field,e[e.valueField])}),o.current=s,i&&c(i);break}case"DRAG_ITEM_COMPLETE":c(null),e.onDataAction&&s&&e.onDataAction.call(void 0,{type:ee.update,series:!1,dataItem:s});break;case"DRAG_ITEM_COMPLETE_OCCURRENCE":{const t=Array.isArray(s)?s.slice():n.clone(s);c(null),e.onDataAction&&t&&e.onDataAction.call(void 0,{type:ee.update,series:!1,dataItem:t});break}case"DRAG_ITEM_COMPLETE_SERIES":{let t;if(Array.isArray(s))t=s.map(e=>{const t=n.clone(e);return _(t,u.start,A(e,u.start)),_(t,u.end,A(e,u.end)),t});else{const e=n.clone(s);_(e,u.start,A(s,u.start)),_(e,u.end,A(s,u.end)),t=e}c(null),e.onDataAction&&t&&e.onDataAction.call(void 0,{type:ee.update,series:!0,dataItem:t});break}default:c(s)}}]})({dataItem:e.dataItem,ignoreIsAllDay:e.ignoreIsAllDay,isAllDay:e.isAllDay,onDataAction:l},[null,g,E]),[Ue,Ze,qe]=((e,t)=>{const r=k.useRef(null),[a,l]=Se(...t),[o]=fa(),s=ce();return[a,l,(t,c)=>{let i=a;switch(t.type){case"RESIZE_ITEM_SET":i=t.payload;break;case"RESIZE_ITEM_RESET":default:i=null;break;case"RESIZE_ITEM_START":{if(c.stopPropagation(),!i)return;const a=t.payload.x,l=t.payload.y,o=N(a,l,7);if(!o||o===r.current)return;const u=o.getAttribute("data-slot-start"),d=new Date(Number(u)),m=n.clone(e.dataItem);if(d>=A(m,s.end))return;_(m,s.start,d),r.current=o,i=m;break}case"RESIZE_ITEM_START_DRAG_SELECTED":{c.stopPropagation();const a=t.payload.x,l=t.payload.y,u=n.clone(e.dataItem),d=N(a,l,7);if(!d||d===r.current)return;const m=d.getAttribute("data-slot-start"),p=new Date(A(u,s.start)),g=new Date(Number(m)).getTime()-p.getTime();let E=!1;const v=o.map(e=>{if(!e.current)return null;const t=n.clone(e.current.props.dataItem),r=new Date(e.current.props.start.getTime()+g);if(!(r>=A(t,s.end)))return _(t,s.start,r),t;E=!0}).filter(Boolean);E||(i=[...v]);break}case"RESIZE_ITEM_START_DRAG":{const a=t.payload.x,l=t.payload.y,o=N(a,l,7);if(!o||o===r.current)return;const c=o.getAttribute("data-slot-start"),u=new Date(Number(c)),d=n.clone(e.dataItem);if(u>=d.end)return;_(d,s.start,u),r.current=o,i=d;break}case"RESIZE_ITEM_END_DRAG":{const a=t.payload.x,l=t.payload.y,o=N(a,l,7);if(!o||o===r.current)return;const c=o.getAttribute("data-slot-end"),u=new Date(Number(c)),d=n.clone(e.dataItem);if(u<=d.start)return;_(d,s.end,u),r.current=o,i=d;break}case"RESIZE_ITEM_END_DRAG_SELECTED":{c.stopPropagation();const a=t.payload.x,l=t.payload.y,u=n.clone(e.dataItem),d=N(a,l,7);if(!d||d===r.current)return;const m=d.getAttribute("data-slot-start"),p=new Date(A(u,s.end)),g=new Date(Number(m)).getTime()-p.getTime();let E;const v=o.map(e=>{if(!e.current)return null;const t=n.clone(e.current.props.dataItem),r=new Date(e.current.props.end.getTime()+g);if(!(r<=A(t,s.start)))return _(t,s.end,r),t;E=!0}).filter(Boolean);E||(i=[...v]);break}case"RESIZE_ITEM_COMPLETE":case"RESIZE_ITEM_COMPLETE_OCCURRENCE":i=null,e.onDataAction&&a&&e.onDataAction.call(void 0,{type:ee.update,series:!1,dataItem:a});break;case"RESIZE_ITEM_COMPLETE_SERIES":{let t;if(i=null,Array.isArray(a))t=a.map(e=>{const t=n.clone(e);return _(t,s.start,A(e,s.start)),_(t,s.end,A(e,s.end)),t});else{const e=n.clone(a);_(e,s.start,A(a,s.start)),_(e,s.end,A(a,s.end)),t=e}e.onDataAction&&t&&e.onDataAction.call(void 0,{type:ee.update,series:!0,dataItem:t});break}}l(i)}]})({dataItem:e.dataItem,onDataAction:l},[null,y,h]),[Ye,je,Xe]=((e,t)=>{const[r,a]=Se(...t);return[r,a,t=>{let n;switch(t.type){case"REMOVE_ITEM_SET":n=t.payload;break;case"REMOVE_ITEM_RESET":n=null;break;case"REMOVE_ITEM_COMPLETE":e.onDataAction&&r&&e.onDataAction.call(void 0,{type:ee.remove,series:e.series,dataItem:r}),n=null;break;default:n=r}a(n)}]})({series:We,onDataAction:l},[null,D,b]),[Qe,Je,et]=((e,t,r)=>{const[a,n]=Se(e,t,r);return[a,n,e=>{const t=((e,t)=>{switch(t.type){case"SHOW_REMOVE_DIALOG_RESET":case"SHOW_REMOVE_DIALOG_CLOSE":return!1;case"SHOW_REMOVE_DIALOG_SET":return t.payload;case"SHOW_REMOVE_DIALOG_OPEN":return!0;case"SHOW_REMOVE_DIALOG_TOGGLE":return!e;default:return e}})(a,e);n(t)}]})(!1,I,R),[tt,rt,at]=((e,t,r)=>{const[a,n]=Se(e,t,r);return[a,n,e=>{const t=((e,t)=>{switch(t.type){case"SHOW_OCCURRENCE_DIALOG_RESET":case"SHOW_OCCURRENCE_DIALOG_CLOSE":return!1;case"SHOW_OCCURRENCE_DIALOG_SET":return t.payload;case"SHOW_OCCURRENCE_DIALOG_OPEN":return!0;case"SHOW_OCCURRENCE_DIALOG_TOGGLE":return!e;default:return e}})(a,e);n(t)}]})(!1,S,w),[nt]=va(),[,lt]=k.useContext(ka),[,ot]=ba(),st=!!(Re.current&&Oe&&Oe.some(e=>e.current===Re.current)),ct=k.useMemo(()=>({selected:st,series:We,formItem:He,dragItem:Be,resizeItem:Ue,removeItem:Ye,showRemoveDialog:Qe,showOccurrenceDialog:tt}),[Be,He,Ye,Ue,st,We,tt,Qe]),it=k.useMemo(()=>({[Bn.set]:Pe,[Bn.toggle]:Pe,[Bn.reset]:Pe,[Sa.select]:Fe,[Sa.add]:Fe,[Sa.remove]:Fe,[Sa.reset]:Fe,[Sa.selectNext]:Fe,[Sa.selectPrev]:Fe,[Fn.set]:$e,[Fn.setMaster]:$e,[Fn.reset]:$e,[Fn.complete]:$e,[Pn.set]:Xe,[Pn.reset]:Xe,[Pn.complete]:Xe,[Wn.close]:at,[Wn.open]:at,[Wn.set]:at,[Wn.toggle]:at,[Wn.reset]:at,[Hn.close]:et,[Hn.open]:et,[Hn.set]:et,[Hn.toggle]:et,[Hn.reset]:et,[Kn.start]:Ge,[Kn.drag]:Ge,[Kn.complete]:Ge,[Kn.completeOccurrence]:Ge,[Kn.completeSeries]:Ge,[Kn.set]:Ge,[Kn.reset]:Ge,[Kn.dragSelected]:Ge,[$n.start]:qe,[$n.startDrag]:qe,[$n.startDragSelected]:qe,[$n.endDrag]:qe,[$n.endDragSelected]:qe,[$n.complete]:qe,[$n.completeOccurrence]:qe,[$n.completeSeries]:qe,[$n.set]:qe,[$n.reset]:qe,[Aa.next]:lt,[Aa.prev]:lt,[Ra.left]:ot,[Ra.right]:ot,[Ra.up]:ot,[Ra.down]:ot,null:()=>{}}),[Ge,$e,Fe,Xe,qe,Pe,at,et,lt,ot]),ut=k.useCallback(t=>{if(x){const r=x(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t)):it[r.type]({...r,item:Re}))}T&&T.call(void 0,t)},[it,T,x,e,ct]),dt=k.useCallback(t=>{if(L){const r=L(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t)):it[r.type]({...r,item:Re}))}M&&M.call(void 0,t)},[it,M,L,e,ct]),mt=k.useCallback(t=>{if(F){const r=F(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t)):it[r.type]({...r,item:Re}))}z&&z.call(void 0,t)},[it,z,F,e,ct]),[,pt]=k.useContext(be),gt=k.useCallback(t=>{if(P){pt(Re.current);const r=P(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t)):it[r.type]({...r,item:Re}))}W&&W.call(void 0,t)},[it,W,P,e,ct]),Et=k.useCallback(t=>{if(K){const r=K(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t)):it[r.type]({...r,item:Re}))}H&&H.call(void 0,t)},[K,H,e,it,ct]),vt=k.useCallback(t=>{if(B){const r=B(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t)):it[r.type]({...r,item:Re}))}$&&$.call(void 0,t)},[B,$,e,it,ct]),yt=k.useCallback(t=>{if(G){const r=G(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t)):it[r.type]({...r,item:Re},t))}V&&V.call(void 0,t)},[G,V,e,it,ct]),ht=k.useCallback(t=>{if(Z){const r=Z(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t.dragEvent.originalEvent)):it[r.type]({...r,item:Re},t.dragEvent.originalEvent))}U&&U.call(void 0,t)},[Z,U,e,it,ct]),ft=k.useCallback(t=>{if(Y){const r=Y(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t.dragEvent.originalEvent)):it[r.type]({...r,item:Re},t.dragEvent.originalEvent))}q&&q.call(void 0,t)},[Y,q,e,it,ct]),kt=k.useCallback(t=>{if(X){const r=X(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t.dragEvent.originalEvent)):it[r.type]({...r,item:Re},t.dragEvent.originalEvent))}j&&j.call(void 0,t)},[X,j,e,ct,it]),Dt=k.useCallback(t=>{if(J){const r=J(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t.dragEvent.originalEvent)):it[r.type]({...r,item:Re},t.dragEvent.originalEvent))}Q&&Q.call(void 0,t)},[Q,J,e,it,ct]),bt=k.useCallback(t=>{if(re){const r=re(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t.dragEvent.originalEvent)):it[r.type]({...r,item:Re},t.dragEvent.originalEvent))}te&&te.call(void 0,t)},[te,re,e,it,ct]),Ct=k.useCallback(t=>{if(ne){const r=ne(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t.dragEvent.originalEvent)):it[r.type]({...r,item:Re},t.dragEvent.originalEvent))}ae&&ae.call(void 0,t)},[ne,ae,e,it,ct]),St=k.useCallback(t=>{if(he){const r=he(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t)):it[r.type]({...r,item:Re},t))}ye&&ye.call(void 0,t)},[he,ye,e,ct,it]),wt=k.useCallback(t=>{if(De){const r=De(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t)):it[r.type]({...r,item:Re},t))}ke&&ke.call(void 0,t)},[De,ke,e,ct,it]),It=k.useCallback(t=>{if(oe){const r=oe(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t)):it[r.type]({...r,item:Re},t))}le&&le.call(void 0,t)},[oe,le,e,ct,it]),Rt=k.useCallback(t=>{if(ie){const r=ie(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t)):it[r.type]({...r,item:Re},t))}se&&se.call(void 0,t)},[ie,se,e,ct,it]),Tt=k.useCallback(t=>{if(me){const r=me(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t.syntheticEvent)):it[r.type]({...r,item:Re},t.syntheticEvent))}ue&&ue.call(void 0,t)},[me,ue,e,ct,it]),xt=k.useCallback(t=>{if(ge){const r=ge(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t.syntheticEvent)):it[r.type]({...r,item:Re},t.syntheticEvent))}pe&&pe.call(void 0,t)},[ge,pe,e,ct,it]),Mt=k.useCallback(e=>{Xe({type:Pn.set,payload:e.value||He}),et({type:Hn.open})},[Xe,et,He]),Nt=k.useCallback(t=>{if(ve){const r=ve(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t.syntheticEvent)):it[r.type]({...r,item:Re},t.syntheticEvent))}Ee&&Ee.call(void 0,t)},[ve,Ee,e,ct,it]),At=k.useCallback(e=>{He?(Xe({type:Pn.reset}),et({type:Hn.close})):wt(e)},[He,Xe,et,wt]);return k.useEffect(()=>{const t=nt.length&&nt[0].current===Re.current;we(void 0!==e.tabIndex?null===e.tabIndex?void 0:e.tabIndex:0===Oe.length&&t?0:void 0)},[nt,e.tabIndex,Oe.length]),k.createElement(On,{props:e,form:[He,Ke,$e],drag:[Be,Ve,Ge],resize:[Ue,Ze,qe],remove:[Ye,je,Xe],showRemoveDialog:[Qe,Je,et],showOccurrenceDialog:[tt,rt,at]},k.createElement(xe,{...e,_ref:Re,itemRef:Re,selected:st,tabIndex:Ce,id:Te,onKeyDown:Tt,onKeyUp:xt,onFocus:ut,onMouseUp:mt,onMouseDown:dt,onClick:gt,onDoubleClick:Et,onRemoveClick:vt,onPress:yt,onDrag:ht,onRelease:ft,onResizePress:kt,onResizeEndDrag:bt,onResizeStartDrag:Dt,onResizeRelease:Ct}),Be&&ze.drag&&(Array.isArray(Be)?Be.map((t,r)=>k.createElement(Me,{key:r,ignoreIsAllDay:o,dataItem:t,vertical:e.vertical,viewItem:xe,item:e.item})):k.createElement(Me,{ignoreIsAllDay:o,dataItem:Be,vertical:e.vertical,viewItem:xe,item:e.item})),Ue&&ze.resize&&(Array.isArray(Ue)?Ue.map((t,r)=>k.createElement(Ne,{key:r,format:e.format,ignoreIsAllDay:o,dataItem:t,viewItem:e.viewItem,item:e.item,vertical:e.vertical})):k.createElement(Ne,{format:e.format,ignoreIsAllDay:o,dataItem:Ue,viewItem:e.viewItem,item:e.item,vertical:e.vertical})),He&&!tt&&ze.edit&&k.createElement(Ae,{dataItem:He,onSubmit:St,onClose:wt,onCancel:wt,onDelete:ze.remove?Mt:void 0}),tt&&k.createElement(_e,{dataItem:He||Be||Ue||Ye,isRemove:null!==Ye,onClose:wt,onOccurrenceClick:It,onSeriesClick:Rt}),Qe&&Ye&&ze.remove&&k.createElement(Le,{dataItem:Ye,isSeries:!0===We,onClose:At,onCancel:At,onConfirm:Nt}))}),Zn={viewItem:gn,drag:wn,resize:Rn,form:ca,occurrenceDialog:cn,removeDialog:un,onClickAction:(e,t,r)=>[{type:e.syntheticEvent.metaKey||e.syntheticEvent.ctrlKey?!r.selected||r.dragItem||r.resizeItem?Sa.add:Sa.remove:Sa.select}],onDoubleClickAction:(e,t)=>t.editable?[{type:Fn.set,payload:t.dataItem},t.isRecurring&&{type:Wn.open}].filter(Boolean):[],onRemoveClickAction:(e,t)=>t.editable?[{type:Pn.set,payload:t.dataItem},t.isRecurring?{type:Wn.open}:{type:Hn.open}]:[],onPressAction:(e,t)=>Gn(t.editable)?{type:Kn.start,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onDragAction:(e,t)=>Gn(t.editable)?{type:e.dragEvent.originalEvent.metaKey||e.dragEvent.originalEvent.ctrlKey?Kn.dragSelected:Kn.drag,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onReleaseAction:(e,t,r)=>Gn(t.editable)&&r.dragItem?t.isRecurring&&!t.isException&&null===r.series?{type:Wn.open}:{type:t.isRecurring?r.series?Kn.completeSeries:Kn.completeOccurrence:Kn.complete,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizePressAction:(e,t)=>t.editable?{type:$n.start,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizeStartDragAction:(e,t)=>t.editable?{type:e.dragEvent.originalEvent.metaKey||e.dragEvent.originalEvent.ctrlKey?$n.startDragSelected:$n.startDrag,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizeEndDragAction:(e,t)=>t.editable?{type:e.dragEvent.originalEvent.metaKey||e.dragEvent.originalEvent.ctrlKey?$n.endDragSelected:$n.endDrag,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizeReleaseAction:(e,t,r)=>t.editable&&r.resizeItem?t.isRecurring&&!t.isException&&null===r.series?{type:Wn.open}:{type:t.isRecurring?r.series?$n.completeSeries:$n.completeOccurrence:$n.complete,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onOccurrenceClickAction:(e,t,r)=>r.dragItem?[{type:Kn.completeOccurrence},{type:Wn.close}]:r.resizeItem?[{type:$n.completeOccurrence},{type:Wn.close}]:r.formItem?[{type:Bn.set,payload:!1},{type:Fn.set,payload:t.dataItem},{type:Wn.close}]:r.removeItem?[{type:Bn.set,payload:!1},{type:Pn.set,payload:t.dataItem},{type:Hn.open},{type:Wn.close}]:[],onSeriesClickAction:(e,t,r)=>r.dragItem?[{type:Kn.completeSeries},{type:Wn.close}]:r.resizeItem?[{type:$n.completeSeries},{type:Wn.close}]:r.formItem?[{type:Bn.set,payload:!0},{type:Fn.setMaster,payload:t.dataItem},{type:Wn.close}]:r.removeItem?[{type:Bn.set,payload:!0},{type:Pn.set,payload:t.dataItem},{type:Hn.open},{type:Wn.close}]:[],onKeyDownAction:(e,t)=>{switch(e.syntheticEvent.keyCode){case n.Keys.enter:return t.editable&&!t.readonly?[{type:Fn.set,payload:t.dataItem},t.isRecurring&&{type:Wn.open}]:[];case n.Keys.tab:return[{type:e.syntheticEvent.shiftKey?Aa.prev:Aa.next,ignoreIsAllDay:t.ignoreIsAllDay},{type:e.syntheticEvent.shiftKey?Sa.selectPrev:Sa.selectNext,ignoreIsAllDay:t.ignoreIsAllDay}];case n.Keys.up:return[!(!t.slots.length||!t.slots[0]._ref.current)&&{type:Ra.up,slot:t.slots[0]._ref}];case n.Keys.right:return[!(!t.slots.length||!t.slots[0]._ref.current)&&{type:Ra.right,slot:t.slots[0]._ref}];case n.Keys.down:return[!(!t.slots.length||!t.slots[t.slots.length-1]._ref.current)&&{type:Ra.down,slot:t.slots[t.slots.length-1]._ref}];case n.Keys.left:return[!(!t.slots.length||!t.slots[0]._ref.current)&&{type:Ra.left,slot:t.slots[0]._ref}];default:return}},onFormSubmitAction:e=>[{type:Fn.complete,payload:e.value}],onRemoveConfirmAction:()=>[{type:Pn.complete},{type:Fn.reset},{type:Hn.close},{type:Wn.close}],onCancelAction:()=>[{type:Bn.reset},{type:Pn.reset},{type:Fn.reset},{type:Kn.reset},{type:$n.reset},{type:Hn.reset},{type:Wn.reset}]};Un.displayName="KendoReactSchedulerEditItem";const qn=e=>{const[t,r]=k.useState(!1),l=re(),o=ne(),s=k.useRef(void 0),c=k.useRef(null),i=k.useRef(null),u=e.updateInterval||Yn.updateInterval,[,d]=k.useState(!1),m=n.useDir(i,!0===o.rtl?"rtl":void 0),[p]=ga(),g=k.useCallback(()=>{if(!p)return;const t=p.filter(t=>t.current&&(void 0===e.groupIndex||null===e.groupIndex||t.current.props.group.index===e.groupIndex)&&(e.vertical?H(new Date,new Date,t.current.props.start,t.current.props.end,!0):$(new Date,t.current.props.start,t.current.props.end))&&!t.current.props.isAllDay);if(t&&t.length&&c.current&&i.current){const n=T(t);if(!n.current)return;const l=e.vertical?(e=>{let t=0;return e.forEach(e=>{if(e.current){const r=w(e.current.element);t+=r.height}}),t})(t):(e=>{let t=0;return e.forEach(e=>{if(e.current){const r=w(e.current.element);t+=r.width}}),t})(t),o=w(n.current.element),s=w(c.current),u=(e.vertical?o.width:o.height)/(n.current.props.end.getTime()-n.current.props.start.getTime()),d=(Date.now()-((e,t)=>{const r=a.cloneDate(e);return r.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),r})(new Date,n.current.props.start).getTime())*u,p="rtl"===m,g=e.vertical?o.top:o.top+d-s.height/2,E=p?"right":"left",v=e.vertical?o[E]+d-s.width/2:o[E];e.vertical?c.current.style[E]=`${v}px`:c.current.style.top=`${g}px`,i.current.style[E]=`${v}px`,i.current.style.top=`${g}px`,i.current.style[e.vertical?"height":"width"]=l-1+"px",r(!0)}else c.current&&(c.current.style.top="",c.current.style.left="",c.current.style.right=""),i.current&&(i.current.style.top="",i.current.style.left="",i.current.style.right=""),r(!1)},[p,e.groupIndex,e.vertical,m]),E=k.useCallback(()=>{g(),d(e=>!e)},[g]);k.useEffect(()=>{if(!l.current||!window)return;clearInterval(s.current),s.current=window.setInterval(E,u);const e=window.ResizeObserver,t=e&&new e(E);return t&&t.observe(l.current),()=>{clearInterval(s.current),t&&t.disconnect()}},[g,E,l,u]),k.useEffect(g);const v=k.createElement("div",{ref:c,className:n.classNames("k-current-time",{"k-current-time-arrow-right":!e.vertical&&"rtl"!==m,"k-current-time-arrow-left":!e.vertical&&"rtl"===m,"k-current-time-arrow-down":e.vertical}),style:{transform:e.vertical?"rtl"===m?"translateX(50%)":"translateX(-50%)":"translateY(-50%)",visibility:t?void 0:"hidden"}});return k.createElement(k.Fragment,null,e.attachArrow&&e.attachArrow.current?D.createPortal(v,e.attachArrow.current):v,k.createElement("div",{className:"k-current-time",ref:i,style:{transform:e.vertical?"translateX(-50%)":"translateY(-50%)",[e.vertical?"width":"height"]:"1px",visibility:t?void 0:"hidden"}}))},Yn={updateInterval:6e4},jn=(e,t)=>{const[r,a]=((e,t)=>{const[r,a]=k.useState(t);return void 0!==e?[e,n.noop]:[r,a]})(e,t),l=k.useCallback(()=>{a(!r)},[r,a]);return[r,l]},Xn=k.forwardRef((e,t)=>{var r;const{as:a=Qn.as,...l}=e,s=k.useRef(null),c=k.useRef(null),i=o.useInternationalization(),u=k.useMemo(()=>n.classNames("k-scheduler-cell k-heading-cell",e.className),[e.className]);k.useImperativeHandle(c,()=>({element:s.current&&s.current.element?s.current.element:s.current,props:e})),k.useImperativeHandle(t,()=>c.current);const d=null!=(r=e.format)?r:Qn.format,m="object"==typeof d&&"skeleton"in d&&"string"==typeof d.skeleton&&d.skeleton.includes("E")&&d.skeleton.includes("d");return k.createElement(a,{ref:a!==Qn.as?void 0:s,...l,className:u},m?k.createElement(k.Fragment,null,k.createElement("span",{className:"k-scheduler-date-day"},i.formatDate(e.date,"EEE")),k.createElement("span",{className:"k-link k-nav-day","aria-label":i.formatDate(e.date,{skeleton:"Ed"})},i.formatDate(e.date,{skeleton:"d"}))," "):k.createElement("span",{className:"k-link k-nav-day"},i.formatDate(e.date,d)))}),Qn={as:k.forwardRef(({as:e,format:t,start:r,end:a,...n},l)=>k.createElement("div",{...n,ref:l})),format:"d"};Xn.displayName="KendoReactSchedulerDateHeaderCell";const Jn=(e,{step:t,timezone:r})=>{const n=[],l=a.ZonedDate.fromLocalDate(e.start,r),o=a.ZonedDate.fromLocalDate(e.end,r);for(let e=l.clone(),r=0;e.getTime()<o.getTime();r++,e=e.addTime(t)){const a=e.clone(),l=a.clone().addTime(t),o=new Date(a.getTime()),s={index:r,end:new Date(l.getTime()),start:o,zonedStart:a,zonedEnd:l};n.push(s)}return n},el=(e,{step:t},{groups:r,ranges:n})=>{const l=[];return r.forEach(e=>{n.forEach(r=>{const n=r.zonedStart,o=r.zonedEnd,s=o.timezoneOffset-n.timezoneOffset;for(let c=n.clone(),i=0,u=s<0?s*j*-1:0;c.getTime()<o.getTime();){const n=k.createRef(),o=c.clone(),s=c.addTime(t),d=(s.timezoneOffset-o.timezoneOffset)*j,m=t<=Math.abs(d);u&&m&&(u-=t,c=c.addTime(-t));const p=new Date(o.getTime()),g={_ref:n,index:i,end:new Date(s.getTime()),start:p,zonedStart:o,zonedEnd:s,range:r,group:e,items:[],isAllDay:a.MS_PER_DAY<=t};l.push(g),c=c.addTime(t),i++}})}),l},tl=k.createElement("div",{className:"k-scheduler-cell k-side-cell"}),rl=e=>{var t,r,l,s,c,i,u,d,m,p,g,E;const{group:v,timezone:y,resources:h}=ne(),f=o.useInternationalization(),D=e.editItem||Un,b=e.editSlot||on,[C]=jn(e.showWorkHours,null!=(t=e.defaultShowWorkHours)?t:al.defaultShowWorkHours),S=null!=(r=e.numberOfDays)?r:al.numberOfDays,w=null!=(l=e.slotDivisions)?l:al.slotDivisions,I=null!=(s=e.slotDuration)?s:al.slotDuration,R=null!=(c=e.workWeekStart)?c:al.workWeekStart,M=null!=(i=e.workWeekEnd)?i:al.workWeekEnd,N=!1!==e.currentTimeMarker&&al.currentTimeMarker,A=f.parseDate(null!=(d=null!=(u=e.workDayStart)?u:e.isWorkDayStart)?d:al.isWorkDayStart),_=f.parseDate(null!=(p=null!=(m=e.workDayEnd)?m:e.isWorkDayEnd)?p:al.isWorkDayEnd),L=f.parseDate(null!=(g=e.startTime)?g:al.startTime),z=f.parseDate(null!=(E=e.endTime)?E:al.endTime),[O]=fe(),F=de(),W=Ee(),P=ce(),K=pe(),V=k.useMemo(()=>C?A:L,[C,A,L]),Z=k.useMemo(()=>C?_:z,[C,_,z]),q=k.useMemo(()=>Jn(K,{step:a.MS_PER_DAY*S,timezone:y}).map(e=>({...e,isAllDay:!0})),[K.start.getTime(),K.end.getTime(),S]),Y=k.useMemo(()=>Jn(K,{step:a.MS_PER_DAY,timezone:y}).map(e=>({...e,isAllDay:!1})),[K.start.getTime(),K.end.getTime(),y]),X=k.useMemo(()=>el(0,{step:a.MS_PER_DAY},{groups:F,ranges:q}),[K.start.getTime(),K.end.getTime(),y,q,F]),Q=k.useMemo(()=>el(0,{step:I*j/w},{groups:F,ranges:Y}).filter(e=>Z.getTime()===V.getTime()||$(e.zonedStart,V,Z)),[K.start.getTime(),K.end.getTime(),I,w,V.getTime(),Z.getTime(),F,Y]),J=k.useMemo(()=>vn(O,{dateRange:K,fields:P,timezone:y}),[O,K.start.getTime(),K.end.getTime(),P,y]),ee=k.useMemo(()=>J.filter(e=>e.isAllDay),[J]),te=k.useMemo(()=>J.filter(e=>!e.isAllDay),[J]),re=k.useMemo(()=>kn(ee,{timezone:y},{groups:F,ranges:q}),[J,y,F,q]),ae=k.useMemo(()=>kn(te,{timezone:y},{groups:F,ranges:Y}).filter(e=>V.getTime()===Z.getTime()||$(e.zonedStart,V,Z)||$(e.zonedEnd,V,Z)||$(new Date(e.zonedEnd.getTime()-(e.zonedEnd.getTime()-e.zonedStart.getTime())/2),V,Z)),[J,y,F,Y,V.getTime(),Z.getTime()]);k.useMemo(()=>U(re,X,!1),[re,X]),k.useMemo(()=>G(re,X,!1),[re,X]),k.useMemo(()=>U(ae,Q,!1),[ae,Q]),k.useMemo(()=>G(ae,Q,!1),[ae,Q]);const le=k.createElement(La.Consumer,null,({groupIndex:t})=>k.createElement("div",{className:"k-scheduler-row",key:t},Y.map((t,r)=>k.createElement(Xn,{as:e.dateHeaderCell,key:r,date:a.ZonedDate.fromLocalDate(new Date(t.zonedEnd.getTime()-(t.zonedEnd.getTime()-t.zonedStart.getTime())/2),y),start:t.start,end:t.end,format:{skeleton:"MEd"}})))),oe=k.createElement(La.Consumer,null,({groupIndex:t})=>k.createElement("div",{key:t,className:"k-scheduler-row"},q.map((r,a)=>X.filter(e=>e.group.index===t&&e.range.index===a).map((r,a,n)=>k.createElement(b,{...r,onDataAction:e.onDataAction,form:e.form,slot:e.slot,viewSlot:e.viewSlot,key:`${r.start.getTime()}:${r.group.index}`,row:0,col:"horizontal"===W?n.length*(t||0)+a:a,isWorkDay:0<=r.zonedStart.getDay()+(S-R)&&(r.zonedStart.getDay()+(S-R))%S<=M+(S-R),expandable:{offsetBottom:25}}))))),se=k.useMemo(()=>n.classNames("week"===e.name?"k-scheduler-weekview":"k-scheduler-dayview",e.className),[e.name,e.className]),ie=k.useCallback((t,r,a)=>Y.map((n,l)=>Q.filter(e=>e.index===t.index&&e.range.index===l&&e.group.index===a).map(t=>k.createElement(b,{key:`${t.start.getTime()}:${t.group.index}`,...t,onDataAction:e.onDataAction,slot:e.slot,viewSlot:e.viewSlot,form:e.form,row:r+1,col:Y.length*(a||0)+l,isWorkHour:$(t.zonedStart,A,_),isWorkDay:B(t.zonedEnd.getDay(),R,M),editable:e.editable}))),[Y,b,e.editable,e.form,e.onDataAction,e.slot,e.viewSlot,Q,_,A,M,R]),ue=k.useCallback((t,r,a)=>X.filter(e=>e.group.index===r&&e.range.index===a).map((a,n)=>k.createElement(b,{slot:e.slot,viewSlot:e.viewSlot,form:e.form,...a,onDataAction:e.onDataAction,key:`${a.start.getTime()}:${a.group.index}`,className:"k-scheduler-alldays-slot",row:t*(r||0)+1*(r||0),col:n,expandable:{offsetBottom:25}})),[b,X,e.form,e.onDataAction,e.slot,e.viewSlot]),me=k.useCallback((t,r,a,n)=>Y.map((l,o)=>Q.filter(e=>e.index===t.index&&e.group.index===a&&e.range.index===o).map(t=>k.createElement(b,{slot:e.slot,viewSlot:e.viewSlot,form:e.form,onDataAction:e.onDataAction,...t,key:`${t.start.getTime()}:${t.group.index}`,row:r.length*(a||0)+n+1*(a||0)+1,col:o,editable:e.editable,isWorkHour:$(t.zonedStart,A,_),isWorkDay:0<=t.zonedStart.getDay()+(S-R)&&(t.zonedStart.getDay()+(S-R))%S<=M+(S-R)}))),[b,S,e.editable,e.form,e.onDataAction,e.slot,e.viewSlot,Y,Q,_,A,M,R]);return k.createElement(_a,{id:e.id,props:e,style:e.style,className:se,ranges:[...q,...Y],slots:[...X,...Q]},k.createElement("div",{className:"k-scheduler-head"},"horizontal"===W?k.createElement(k.Fragment,null,k.createElement(za,{nested:!0,group:v,resources:h,rowContent:Pa,childRowContent:Pa},le),k.createElement(za,{group:v,resources:h,rowContent:qa,childRowContent:qa},oe),re.map(t=>k.createElement(D,{key:t.isRecurring?`${t.uid}:${t.group.index}:${t.range.index}:${t.originalStart}`:`${t.uid}:${t.group.index}:${t.range.index}`,...t,form:e.form,onDataAction:e.onDataAction,item:e.item,viewItem:e.viewItem,editable:e.editable,vertical:!1}))):k.createElement(Ha,{group:v,resources:h,cellContent:tl},le)),k.createElement("div",{className:"k-scheduler-body"},"horizontal"===W?k.createElement(k.Fragment,null,Q.filter(e=>0===e.group.index&&0===e.range.index).map((t,r)=>k.createElement(k.Fragment,{key:t.index},k.createElement(za,{nested:!1,group:v,resources:h,rowContent:Xa,rowContentProps:{timeHeaderCell:e.timeHeaderCell,isMaster:r%w===0,isLast:(r+1)%w===0,slot:t}},k.createElement(La.Consumer,null,({groupIndex:e})=>k.createElement("div",{className:n.classNames("k-scheduler-row",{"k-middle-row":(r+1)%w!==0})},ie(t,r,e)))))),!1!==N&&H(T(Y).start,x(Y).end,new Date,new Date,!0)&&k.createElement(qn,null)):k.createElement(k.Fragment,null,k.createElement(Ha,{nested:!0,group:v,resources:h},k.createElement(La.Consumer,null,({groupIndex:t})=>k.createElement(k.Fragment,{key:t},k.createElement("div",{className:"k-scheduler-row"},k.createElement(qa,{groupIndex:t},q.map((e,r)=>{const a=Q.filter(e=>e.group.index===t&&0===e.range.index).length;return ue(a,t,r)}))),Q.filter(e=>e.group.index===t&&0===e.range.index).map((r,a,n)=>k.createElement("div",{className:"k-scheduler-row",key:r.index},k.createElement(Xa,{slot:r,isMaster:a%w===0,isLast:(a+1)%w===0,timeHeaderCell:e.timeHeaderCell},me(r,n,t,a)))),!1!==N&&H(T(Y).start,x(Y).end,new Date,new Date,!0)&&k.createElement(qn,{groupIndex:t})))),re.map(t=>k.createElement(D,{key:t.isRecurring?`${t.uid}:${t.group.index}:${t.range.index}:${t.originalStart}`:`${t.uid}:${t.group.index}:${t.range.index}`,...t,onDataAction:e.onDataAction,viewItem:e.viewItem,item:e.item,form:e.form,editable:e.editable,vertical:!1}))),ae.map(t=>k.createElement(D,{key:t.isRecurring?`${t.uid}:${t.group.index}:${t.range.index}:${t.originalStart}`:`${t.uid}:${t.group.index}:${t.range.index}`,...t,format:"t",onDataAction:e.onDataAction,viewItem:e.viewItem,item:e.item,form:e.form,editable:e.editable,vertical:!0}))))},al={name:"multi-day",title:"Multi Day",currentTimeMarker:!0,dateRange:({date:e,numberOfDays:t=1,timezone:r})=>{const n=a.ZonedDate.fromLocalDate(e,r),l=a.getDate(n),o=a.addDays(l,t),s=a.ZonedDate.fromUTCDate(z(l),r),c=a.ZonedDate.fromUTCDate(z(o),r);return{start:new Date(s.getTime()),end:new Date(c.getTime()),zonedStart:s,zonedEnd:c}},selectedDateFormat:"{0:M}",selectedShortDateFormat:"{0:m}",numberOfDays:1,startTime:"00:00",endTime:"23:59",isWorkDayStart:"08:00",isWorkDayEnd:"17:00",workWeekStart:a.Day.Monday,workWeekEnd:a.Day.Friday,slotDivisions:2,slotDuration:60,showCurrentTime:!0,defaultShowWorkHours:!0};rl.propTypes={currentTimeMarker:r.bool,name:r.string,numberOfDays:r.number,startTime:r.string,endTime:r.string,workDayStart:r.string,workDayEnd:r.string,workWeekStart:r.number,workWeekEnd:r.any,slotDivisions:r.number,slotDuration:r.number,showWorkHours:r.bool,selectedDateFormat:r.string,selectedShortDateFormat:r.string},rl.displayName="KendoReactSchedulerMultiDayView";const nl=e=>k.createElement(rl,{...e}),ll={...al,name:"day",title:e=>e.toLanguageString(Oe,Cr[Oe]),numberOfDays:1,slotDuration:60,slotDivisions:2,selectedDateFormat:"{0:M}",selectedShortDateFormat:"{0:m}"};nl.displayName="KendoReactSchedulerDayView";const ol=Object.freeze({name:"@progress/kendo-react-scheduler",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:1607496606,version:"16.3.0-develop.9",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui"}),sl=k.forwardRef((e,t)=>{const{_ref:r,onRemoveClick:a}=e,l=k.useRef(null),s=k.useRef(null);k.useImperativeHandle(l,()=>({props:e,element:s.current})),k.useImperativeHandle(t,()=>l.current),k.useImperativeHandle(r,()=>l.current);const c=ln(e.editable),i=e.readonly?{remove:!1}:c,u=o.useLocalization().toLanguageString(We,Cr[We]),m=e.group.resources.find(e=>!(!e.colorField||void 0===e[e.colorField])),p=m&&m.colorField&&m[m.colorField],g=k.useCallback(e=>{a&&a.call(void 0,{syntheticEvent:e,target:l.current})},[a,l]),E=k.useMemo(()=>n.classNames("k-task",e.className),[e.className]);return k.createElement("div",{id:e.id,ref:s,style:e.style,className:E,tabIndex:e.tabIndex||void 0},p&&k.createElement("span",{className:"k-scheduler-mark",style:{color:p,backgroundColor:p}}),e.isRecurring&&k.createElement(n.IconWrap,{name:"arrow-rotate-cw",icon:d.arrowRotateCwIcon}),e.isException&&k.createElement(n.IconWrap,{name:"arrows-no-repeat",icon:d.arrowsNoRepeatIcon}),k.createElement("span",{className:"k-scheduler-task-text"},e.title),i.remove&&k.createElement("a",{className:"k-link k-event-delete",title:u,"aria-label":u,onClick:g},k.createElement(n.IconWrap,{name:"x",icon:d.xIcon})))});sl.displayName="KendoReactSchedulerTask";const cl=k.forwardRef((e,t)=>{const{task:r,_ref:a,...n}=e,l=k.useRef(null),o=k.useRef(null);k.useImperativeHandle(o,()=>({props:e,element:l.current&&l.current.element})),k.useImperativeHandle(a,()=>l.current),k.useImperativeHandle(t,()=>o.current);const s=r||il.task;return k.createElement(s,{...n,_ref:l})}),il={task:sl};cl.displayName="KendoReactSchedulerViewTask";const ul=k.createContext([null]),dl=k.createContext([!1]),ml=k.createContext([!1]),pl=e=>k.createElement(ul.Provider,{value:e.remove},k.createElement(dl.Provider,{value:e.showRemoveDialog},k.createElement(ml.Provider,{value:e.showOccurrenceDialog},e.children))),gl=k.forwardRef((e,t)=>{const{_ref:r,onDataAction:a,viewTask:n,removeDialog:l,removeItem:o,onRemoveItemChange:s,occurrenceDialog:c,showOccurrenceDialog:i,onShowOccurrenceDialogChange:u,showRemoveDialog:d,onShowRemoveDialogChange:m,...p}=e,g=k.useRef(null);k.useImperativeHandle(g,()=>({props:e,element:g.current&&g.current.element})),k.useImperativeHandle(r,()=>g.current),k.useImperativeHandle(t,()=>g.current);const E=n||El.viewTask,v=c||El.occurrenceDialog,y=l||El.removeDialog,h=ln(e.editable),f=ce(),[D,b]=fe(),[C,S]=k.useState(null),[w,I]=Se(null,o,s),[R,T]=Se(!1,d,m),[x,M]=Se(!1,i,u),N=k.useCallback(t=>{h.remove&&(I(e.dataItem,t),e.isRecurring?M(!0,t):T(!0,t))},[I,e.dataItem,e.isRecurring,M,T]),A=k.useCallback(e=>{S(null),I(null,e),T(!1,e),M(!1,e)},[S,I,T,M]),_=k.useCallback(e=>{a&&w&&a.call(void 0,{type:ee.remove,series:C,dataItem:w}),I(null,e),T(!1,e)},[w,b,T]),L=k.useCallback((e,t)=>{I&&I(e,t)},[I]),z=k.useCallback((e,t)=>{T&&T(e,t)},[T]),F=k.useCallback((e,t)=>{M&&M(e,t)},[M]),W=k.useCallback(t=>{w&&(S(!1),I(e.dataItem,t),T(!0,t)),M(!1,t)},[S,e.dataItem,w,I,T]),P=k.useCallback(e=>{if(w){S(!0);const t=O(w,f,D);I(t,e),T(!0,e)}M(!1,e)},[f,w,S,I,T,M]);return k.createElement(pl,{remove:[w,L],showRemoveDialog:[R,z],showOccurrenceDialog:[x,F]},k.createElement(E,{_ref:g,...p,onRemoveClick:N}),x&&k.createElement(v,{dataItem:w,isRemove:null!==w,onClose:A,onOccurrenceClick:W,onSeriesClick:P}),R&&k.createElement(y,{dataItem:w,onClose:A,onCancel:A,onConfirm:_}))}),El={viewTask:cl,occurrenceDialog:cn,removeDialog:un};gl.displayName="KendoReactSchedulerEditTask";const vl=e=>{const{group:t,timezone:r,resources:l}=ne(),s=e.editTask||gl,c=e.editSlot||on,i=k.useRef(null),u=n.useDir(i),m=o.useInternationalization(),p=o.useLocalization(),[g]=fe(),E=de(),v=ce(),y=pe(),h=k.useMemo(()=>Jn(y,{step:a.MS_PER_DAY,timezone:r}),[y.start.getTime(),y.end.getTime(),r]),f=k.useMemo(()=>el(0,{step:a.MS_PER_DAY},{groups:E,ranges:h}),[y.start.getTime(),y.end.getTime(),r,E,h]),D=k.useMemo(()=>vn(g,{dateRange:y,fields:v,timezone:r}),[g,y.start.getTime(),y.end.getTime(),v,r]),b=k.useMemo(()=>kn(D,{timezone:r},{groups:E,ranges:h}),[D,r,E,h]),C=k.useMemo(()=>n.classNames("k-scheduler-agendaview",e.className),[e.className]);return Ia({element:i,selector:".k-scheduler-datecolumn",explicitDepth:!1}),Ia({element:i,selector:".k-scheduler-timecolumn",explicitDepth:!1}),k.useMemo(()=>U(b,f,!0),[b,f]),k.useMemo(()=>G(b,f,!0),[b,f]),k.createElement(_a,{ref:i,id:e.id,style:e.style,className:C,props:e,slots:b,ranges:h,role:"grid"},k.createElement("div",{className:"k-scheduler-head",role:"rowgroup"},k.createElement(Ha,{resources:l,group:t,role:"presentation"},k.createElement(La.Consumer,null,({groupIndex:e})=>k.createElement("div",{className:"k-scheduler-row",role:"row",key:e},k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-group-cell k-scheduler-datecolumn",role:"columnheader"},p.toLanguageString(Ut,Cr[Ut])),k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-scheduler-timecolumn",role:"columnheader"},p.toLanguageString(Zt,Cr[Zt])),k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-scheduler-eventcolumn",role:"columnheader"},p.toLanguageString(qt,Cr[qt])))))),k.createElement("div",{className:"k-scheduler-body",role:"rowgroup"},k.createElement(Ha,{resources:l,group:t,nested:!0,role:"presentation"},k.createElement(La.Consumer,null,({groupIndex:t})=>f.filter(e=>e.group.index===(t||0)).map((r,a,l)=>k.createElement("div",{className:"k-scheduler-row k-scheduler-content",role:"row",key:`${t}:${a}`},k.createElement(c,{...r,editable:e.editable,row:l.length*(t||0)+a,col:0,slot:e.slot,viewSlot:e.viewSlot,className:"k-scheduler-datecolumn k-group-cell",role:"rowheader"},k.createElement("div",null,k.createElement("strong",{className:"k-scheduler-agendaday"},m.formatDate(r.zonedStart,"dd")),k.createElement("em",{className:"k-scheduler-agendaweek"},m.formatDate(r.zonedStart,"EEEE")),k.createElement("span",{className:"k-scheduler-agendadate"},m.formatDate(r.zonedStart,"y")))),k.createElement("div",{className:"k-scheduler-cell k-group-content",role:"gridcell"},r.items.length?r.items.map((t,r)=>k.createElement("div",{className:"k-scheduler-row",key:r},k.createElement("div",{className:"k-scheduler-cell k-scheduler-timecolumn"},k.createElement("div",null,t.tail&&k.createElement(n.IconWrap,{name:"rtl"===u?"chevron-right":"chevron-left",icon:"rtl"===u?d.chevronRightIcon:d.chevronLeftIcon}),t.isAllDay?p.toLanguageString(Me,Cr[Me]):yl(m,t),t.head&&k.createElement(n.IconWrap,{name:"rtl"===u?"chevron-left":"chevron-right",icon:"rtl"===u?d.chevronLeftIcon:d.chevronRightIcon}))),k.createElement("div",{className:"k-scheduler-cell"},k.createElement(s,{key:`${a}:${r}`,...t,onDataAction:e.onDataAction,task:e.task,viewTask:e.viewTask,editable:e.editable})))):k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-group-cell"},p.toLanguageString(Qt,Cr[Qt])))))))))},yl=(e,t)=>{let r="{0:t}-{1:t}";return t.head?r="{0:t}":t.tail&&(r="{1:t}"),e.format(r,t.zonedStart,t.zonedEnd)},hl={name:"agenda",title:e=>e.toLanguageString(ze,Cr[ze]),dateRange:({intl:e,date:t,numberOfDays:r=1,timezone:n})=>{const l=a.ZonedDate.fromLocalDate(t,n),o=(e=>a.getDate(e))(7===r?a.firstDayInWeek(l,e.firstDay()):l),s=((e,t)=>a.getDate(a.addDays(e,t||1)))(o,r),c=a.ZonedDate.fromUTCDate(z(o),n),i=a.ZonedDate.fromUTCDate(z(s),n);return{start:new Date(c.getTime()),end:new Date(i.getTime()),zonedStart:c,zonedEnd:i}},selectedDateFormat:"{0:M} - {1:M}",selectedShortDateFormat:"{0:m} - {1:m}",slotDuration:1440,slotDivision:1,numberOfDays:7},fl={title:r.any};vl.propTypes=fl,vl.displayName="KendoReactSchedulerAgendaView";const kl=k.forwardRef((e,t)=>{const r=k.useRef(null),a=k.useRef(null),n=o.useLocalization();k.useImperativeHandle(r,()=>({element:a.current&&a.current.element,...e})),k.useImperativeHandle(t,()=>r.current);const l=k.useCallback(t=>{!e.onClick||!r.current||e.onClick.call(void 0,{target:r.current,syntheticEvent:t})},[r,e.slot,e.onClick]),c=k.useCallback(e=>{e.stopPropagation()},[]),i=k.useCallback(e=>{e.stopPropagation()},[]),u=n.toLanguageString(er,Cr[er]),d=void 0!==e.hiddenCount?`${String(e.hiddenCount)} ${u}`:u;return k.createElement(s.Button,{ref:a,tabIndex:-1,size:"xs",fillMode:"flat",themeColor:"primary",className:"k-more-events",onClick:l,onDoubleClick:i,onFocus:c,"aria-label":d},d)});kl.displayName="KendoReactSchedulerShowMoreItemsButton";const Dl={skeleton:"MMM"},bl={skeleton:"dd"},Cl=e=>{const{show:t,anchor:r,slot:a,itemsPerSlot:l,onDayClick:s,onItemDoubleClick:c,onClose:i}=e,u=o.useInternationalization(),d=o.useLocalization(),m=k.useMemo(()=>a?a.items.filter((e,t)=>t>=l):[],[a,l]),p=k.useCallback(e=>{a&&s&&s(a)},[a,s]);k.useEffect(()=>{if(!t)return;const e=e=>{const t=e.target,a=document.querySelector(".k-scheduler-popover");a&&!a.contains(t)&&r&&!r.contains(t)&&(null==i||i())};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[t,r,i]);const g=k.useCallback(e=>{"Escape"===e.key&&(null==i||i())},[i]);if(!a)return null;const E=new Date(a.zonedEnd.getTime()-(a.zonedEnd.getTime()-a.zonedStart.getTime())/2),v=u.formatDate(E,Dl),y=u.formatDate(E,bl),f=d.toLanguageString(Qt,Cr[Qt]),D=d.toLanguageString(Jt,Cr[Jt]),b=k.createElement(k.Fragment,null,k.createElement("div",{className:"k-month"},v),k.createElement("div",{className:"k-link k-day",onClick:p},y));return k.createElement(h.Popover,{anchor:r,show:t,popoverClass:"k-scheduler-popover",position:"right",collision:{horizontal:"flip",vertical:"flip"},callout:!0,title:b,style:{width:220},onKeyDown:g,animate:{openDuration:1,closeDuration:1}},m.length>0?k.createElement("div",{className:"k-popover-events",role:"list","aria-label":D},m.map((e,t)=>{var r,a;const l=null==(a=null==(r=e.group)?void 0:r.resources)?void 0:a.find(e=>!(!e.colorField||""===e[e.colorField]||void 0===e[e.colorField])),o=(null==l?void 0:l.colorField)&&l[l.colorField],s=o?{backgroundColor:o,borderColor:o}:void 0;return k.createElement("div",{key:e.uid||t,className:n.classNames("k-popover-event k-event",{"k-readonly":!!e.readonly}),role:"listitem",style:s,onDoubleClick:c?t=>c(e,t):void 0},k.createElement("div",{className:"k-event-title"},e.title||""),k.createElement("span",{className:"k-event-time"},u.formatDate(e.zonedStart,"t")))})):k.createElement("span",{className:"k-no-data"},f))};Cl.displayName="KendoReactSchedulerMoreEventsPopover";const Sl={skeleton:"dd"},wl={item:null,phase:"form",series:!1,removeItem:null};function Il(e,t){switch(t.type){case"open":return{item:t.item,phase:t.isRecurring?"occurrence":"form",series:!1,removeItem:null};case"editOccurrence":return{...e,phase:"form",series:!1};case"editSeries":return{...e,item:t.item,phase:"form",series:!0};case"requestRemove":return{...e,removeItem:t.item};case"cancelRemove":return{...e,removeItem:null};case"reset":return wl;default:return e}}const Rl=e=>{const{group:t,timezone:r,resources:l}=ne(),{onDataAction:s}=e,c=e.editItem||Un,i=e.editSlot||on,[u]=fe(),[d,m]=ye(),[,p]=De(),g=oe(),E=de(),v=Ee(),y=pe(),h=o.useInternationalization(),f=ce(),D=k.useRef(null),b=e.itemsPerSlot||Tl.itemsPerSlot,w=k.useMemo(()=>Jn(y,{step:7*a.MS_PER_DAY,timezone:r}),[y.start.getTime(),y.end.getTime(),r]),I=k.useMemo(()=>el(0,{step:a.MS_PER_DAY},{groups:E,ranges:w}),[y.start.getTime(),y.end.getTime(),E,w]),R=k.useMemo(()=>vn(u,{dateRange:y,fields:f,timezone:r}),[u,y.start.getTime(),y.end.getTime(),f,r]),T=k.useMemo(()=>kn(R,{timezone:r},{groups:E,ranges:w}),[R,r,E,w]),[x,M]=k.useState({show:!1,anchor:null,slot:null}),[N,A]=k.useReducer(Il,wl),_=ln(e.editable),L=e.form||ca,z=k.useCallback(e=>{M({show:!0,anchor:e.target.element,slot:e.target.slot||null})},[]),F=k.useCallback(()=>{M({show:!1,anchor:null,slot:null})},[]),W=k.useCallback(e=>{const t=g.find(e=>"day"===e.props.name);!p||!t||!t.props.name||(p(t.props.name),m(e.start),M({show:!1,anchor:null,slot:null}))},[p,m,g]),P=k.useCallback(e=>{!_.edit||e.readonly||(M({show:!1,anchor:null,slot:null}),A({type:"open",item:e.dataItem,isRecurring:!!e.isRecurring}))},[_.edit]),H=k.useCallback(e=>{e.value&&s&&s({type:ee.update,series:N.series,dataItem:e.value}),A({type:"reset"})},[s,N.series]),K=k.useCallback(()=>{A({type:"reset"})},[]),$=k.useCallback(()=>{A({type:"editOccurrence"})},[]),B=k.useCallback(()=>{if(!N.item)return;const e=O(N.item,f,u);A({type:"editSeries",item:e?n.clone(e):N.item})},[N.item,f,u]),V=k.useCallback(e=>{const t=e.value||N.item;t&&A({type:"requestRemove",item:t})},[N.item]),Z=k.useCallback(()=>{N.removeItem&&s&&s({type:ee.remove,series:N.series,dataItem:N.removeItem}),A({type:"reset"})},[s,N.series,N.removeItem]),q=k.useCallback(()=>{A({type:"cancelRemove"})},[]);k.useMemo(()=>U(T,I,!0),[T,I]),k.useMemo(()=>G(T,I,!0),[T,I]);const j=k.useMemo(()=>C(t,l),[t,l]),X=k.useMemo(()=>S(j,j.length-1),[j]),Q=j.length>0,J=k.createElement(La.Consumer,null,({groupIndex:t})=>k.createElement("div",{className:"k-scheduler-row",key:t},I.filter(e=>e.group.index===t&&0===e.range.index).map((t,n)=>k.createElement(Xn,{as:e.dateHeaderCell,key:n,"data-dayslot-index":n,date:a.ZonedDate.fromLocalDate(new Date(t.zonedEnd.getTime()-(t.zonedEnd.getTime()-t.zonedStart.getTime())/2),r),start:t.start,end:t.end,format:{skeleton:"EEEE"}})))),te=k.createElement(La.Consumer,null,({groupIndex:t})=>w.map((r,a)=>k.createElement("div",{className:"k-scheduler-row",key:a},I.filter(e=>e.group.index===t&&e.range.index===a).map((r,l,o)=>k.createElement(i,{slot:e.slot,viewSlot:e.viewSlot,key:l,form:e.form,...r,expandable:{offsetTop:35,offsetBottom:26},onDataAction:e.onDataAction,col:"horizontal"===v?o.length*(t||0)+l:l,row:"horizontal"===v?a:w.length*(t||0)+a,editable:e.editable,className:n.classNames({"k-other-month":r.zonedStart.getMonth()!==d.getMonth()})},k.createElement("span",{className:"k-link k-nav-day"},h.formatDate(r.zonedStart,Sl)),b<r.items.length&&k.createElement(kl,{slot:r,hiddenCount:r.items.length-b,onClick:z}))))));return k.createElement(_a,{props:e,slots:I,ranges:w,className:n.classNames("k-scheduler-monthview",e.className)},k.createElement("div",{className:"k-scheduler-head"},"horizontal"===v?k.createElement(za,{nested:!0,resources:l,group:t},J):k.createElement(Ha,{resources:l,group:t},J)),k.createElement("div",{className:"k-scheduler-body",ref:D},"horizontal"===v&&Q?w.map((t,r)=>k.createElement("div",{className:"k-scheduler-group k-group-horizontal",key:r},k.createElement("div",{className:"k-scheduler-row"},X.map((t,a)=>k.createElement("div",{key:a,className:"k-scheduler-cell k-group-cell"},k.createElement(La.Provider,{value:{resource:t,groupIndex:a}},k.createElement("div",{className:"k-scheduler-row"},I.filter(e=>e.group.index===a&&e.range.index===r).map((t,l,o)=>k.createElement(i,{slot:e.slot,viewSlot:e.viewSlot,key:l,form:e.form,...t,expandable:{offsetTop:35,offsetBottom:26},onDataAction:e.onDataAction,col:o.length*a+l,row:r,editable:e.editable,className:n.classNames({"k-other-month":t.zonedStart.getMonth()!==d.getMonth()})},k.createElement("span",{className:"k-link k-nav-day"},h.formatDate(t.zonedStart,Sl)),b<t.items.length&&k.createElement(kl,{slot:t,hiddenCount:t.items.length-b,onClick:z})))))))))):"horizontal"===v?k.createElement(za,{resources:l,group:t},te):k.createElement(Ha,{nested:!0,resources:l,group:t},te),T.filter(e=>null===e.order||e.order<b).sort(Y).map(t=>k.createElement(c,{item:e.item,viewItem:e.viewItem,form:e.form,key:t.isRecurring?`${t.uid}:${t.group.index}:${t.range.index}:${t.originalStart}`:`${t.uid}:${t.group.index}:${t.range.index}`,...t,onDataAction:e.onDataAction,slotHeaderOffset:35,vertical:!1,editable:e.editable,ignoreIsAllDay:!0}))),k.createElement(Cl,{show:x.show,anchor:x.anchor,slot:x.slot,items:T,itemsPerSlot:b,onDayClick:W,onItemDoubleClick:P,onClose:F}),N.item&&"form"===N.phase&&_.edit&&k.createElement(L,{dataItem:N.item,onSubmit:H,onCancel:K,onClose:K,onDelete:_.remove?V:void 0}),N.item&&"occurrence"===N.phase&&k.createElement(cn,{dataItem:N.item,onClose:K,onOccurrenceClick:$,onSeriesClick:B}),N.removeItem&&_.remove&&k.createElement(un,{dataItem:N.removeItem,isSeries:N.series,onClose:q,onCancel:q,onConfirm:Z}))},Tl={name:"month",dateRange:({intl:e,date:t,timezone:r})=>{const n=a.firstDayInWeek(a.firstDayOfMonth(a.getDate(t)),e.firstDay()),l=a.addDays(a.firstDayInWeek(a.lastDayOfMonth(a.getDate(t)),e.firstDay()),7),o=a.ZonedDate.fromUTCDate(z(n),r),s=a.ZonedDate.fromUTCDate(z(l),r);return{start:new Date(o.getTime()),end:new Date(s.getTime()),zonedStart:o,zonedEnd:s}},slotDuration:1440,slotDivision:1,itemsPerSlot:2,numberOfDays:31,title:e=>e.toLanguageString(Fe,Cr[Fe]),selectedDateFormat:"{0:Y}",selectedShortDateFormat:"{0:y}"},xl={itemsPerSlot:r.number};Rl.propTypes=xl,Rl.displayName="KendoReactSchedulerMonthView";const Ml=e=>k.createElement(rl,{...e,step:7,numberOfDays:7}),Nl={name:"week",slotDuration:60,slotDivisions:2,numberOfDays:7,dateRange:({intl:e,date:t,timezone:r})=>{const n=a.ZonedDate.fromLocalDate(t,r),l=(e=>a.getDate(e))(a.firstDayInWeek(n,e.firstDay())),o=((e,t)=>a.getDate(a.addDays(e,t)))(l,7),s=a.ZonedDate.fromUTCDate(z(l),r),c=a.ZonedDate.fromUTCDate(z(o),r);return{start:new Date(s.getTime()),end:new Date(c.getTime()),zonedStart:s,zonedEnd:c}},title:e=>e.toLanguageString(_e,Cr[_e]),selectedDateFormat:"{0:M} - {1:M}",selectedShortDateFormat:"{0:m} - {1:m}"};Ml.displayName="KendoReactSchedulerWeekView";const Al=e=>{const t=pe(),r=Math.round((t.end.getTime()-t.start.getTime())/a.MS_PER_DAY);return k.createElement(rl,{...e,step:7,numberOfDays:r})},_l={name:"work-week",slotDuration:60,slotDivisions:2,numberOfDays:7,dateRange:({intl:e,date:t,timezone:r,...n})=>{const l=a.ZonedDate.fromLocalDate(t,r),o=void 0!==n.workWeekStart?n.workWeekStart:a.Day.Monday,s=void 0!==n.workWeekEnd?n.workWeekEnd:a.Day.Friday,c=s<o?7+s-o+1:s-o+1,i=a.getDate(((e,t=a.Day.Sunday)=>{let r=e.clone();for(;r.getDay()!==t;)r=r.addDays(-1);return r})(l,o)),u=a.addDays(i,c),d=a.ZonedDate.fromUTCDate(z(i),r),m=a.ZonedDate.fromUTCDate(z(u),r);return{start:new Date(d.getTime()),end:new Date(m.getTime()),zonedStart:d,zonedEnd:m}},title:e=>e.toLanguageString(Le,Cr[Le]),workWeekStart:a.Day.Monday,workWeekEnd:a.Day.Friday,selectedDateFormat:"{0:M} - {1:M}",selectedShortDateFormat:"{0:m} - {1:m}"};Al.displayName="KendoReactSchedulerWorkWeekView";const Ll=k.createElement("div",{className:"k-scheduler-cell k-side-cell"}),zl=e=>k.createElement(k.Fragment,null,k.createElement("div",{className:"k-sticky-cell"},Ll),e.children),Ol=e=>{const t=o.useLocalization();return k.createElement(k.Fragment,null,k.createElement("div",{className:"k-sticky-cell"},k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-side-cell k-scheduler-times-all-day","data-range-index":0},t.toLanguageString(xe,Cr[xe]))),e.children)},Fl=e=>{var t;const{group:r,timezone:l,resources:s}=ne(),c=k.useRef(null),i=k.useRef(null),u=e.editItem||Un,d=e.editSlot||on,m=k.useRef(null),[p]=fe(),g=Ee(),E=de(),v=pe(),y=ce(),h=o.useInternationalization(),[f]=jn(e.showWorkHours,null!=(t=e.defaultShowWorkHours)?t:Wl.defaultShowWorkHours),D=e.slotDivisions||Wl.slotDivisions,b=e.slotDuration||Wl.slotDuration,C=e.workWeekStart||Wl.workWeekStart,S=e.workWeekEnd||Wl.workWeekEnd,w=h.parseDate(e.workDayStart||e.isWorkDayStart||Wl.isWorkDayStart),I=h.parseDate(e.workDayEnd||e.isWorkDayEnd||Wl.isWorkDayEnd),R=h.parseDate(e.startTime||Wl.startTime),M=h.parseDate(e.endTime||Wl.endTime),N=k.useMemo(()=>f?w:R,[f,w,R]),A=k.useMemo(()=>f?I:M,[f,I,M]),_=k.useMemo(()=>Jn(v,{step:a.MS_PER_DAY,timezone:l}),[v.start.getTime(),v.end.getTime(),l]),L=k.useMemo(()=>el(0,{step:b/D*a.MS_PER_MINUTE},{groups:E,ranges:_}).filter(e=>$(e.zonedStart,N,A)||N.getTime()===A.getTime()),[E,_,v.start.getTime(),v.end.getTime(),l,b,D,N.getTime(),A.getTime()]),O=k.useMemo(()=>vn(p,{dateRange:v,fields:y,timezone:l}),[p,v.start.getTime(),v.end.getTime(),y,l]),F=k.useMemo(()=>kn(O,{timezone:l},{groups:E,ranges:_}).filter(e=>N.getTime()===A.getTime()||$(e.zonedStart,N,A)||$(e.zonedEnd,N,A)||$(new Date(e.zonedEnd.getTime()-(e.zonedEnd.getTime()-e.zonedStart.getTime())/2),N,A)),[O,l,E,_,N.getTime(),A.getTime()]);k.useMemo(()=>U(F,L,!0),[F,L]),k.useMemo(()=>G(F,L,!0),[F,L]);const W=("horizontal"===g?L.length:L.length/E.length)*((e.columnWidth||Wl.columnWidth)+1),P=k.createElement(La.Consumer,null,()=>k.createElement(k.Fragment,null,k.createElement("div",{className:"k-scheduler-row"},_.map((t,r)=>k.createElement(Xn,{as:e.dateHeaderCell,key:r,date:t.zonedStart,start:t.start,end:t.end,format:"m"}))),k.createElement("div",{className:"k-scheduler-row",ref:c},_.map((t,r)=>L.filter(e=>0===e.group.index&&e.range.index===r).map(t=>t.zonedStart.getMinutes()%b===0?k.createElement(Ya,{key:t.index,as:e.timeHeaderCell,format:"t",date:t.zonedStart,start:t.zonedStart,end:t.zonedEnd}):null))))),K=k.createElement(La.Consumer,null,({groupIndex:t})=>k.createElement("div",{className:"k-scheduler-row"},_.map((r,n)=>L.filter(e=>e.group.index===t&&e.range.index===n).map((r,o,s)=>{const c=a.ZonedDate.fromUTCDate(z(r.zonedStart),l),i=B(c.getDay(),C,S);return k.createElement(d,{key:`${r.start.getTime()}:${r.group.index}`,slot:e.slot,viewSlot:e.viewSlot,...r,form:e.form,onDataAction:e.onDataAction,isWorkHour:$(r.zonedStart,w,I),isWorkDay:i,col:"horizontal"===g?n*s.length+o+s.length*_.length*(t||0):n*s.length+o,row:"horizontal"===g?0:t||0,expandable:{offsetBottom:25},editable:e.editable})})))),V=k.useMemo(()=>n.classNames("k-scheduler-timelineview",e.className),[e.className]);Ia({element:m,selector:".k-resource-cell",attribute:"data-depth-index",explicitDepth:!0});const Z=m.current?m.current.closest(".k-scheduler-layout"):null;return pn({element:Z,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:F&&!F.length}),k.createElement(_a,{ref:m,id:e.id,style:{...e.style},className:V,props:e,slots:L,ranges:_},k.createElement("div",{className:"k-scheduler-head",style:{width:W}},"horizontal"===g?k.createElement(za,{nested:!0,group:r,resources:s,rowContent:zl},P):k.createElement(Ha,{wrapGroup:!0,group:r,resources:s},P)),k.createElement("div",{className:"k-scheduler-body",style:{width:W},ref:i},"horizontal"===g?k.createElement(za,{group:r,resources:s,rowContent:Ol},K,k.createElement(La.Consumer,null,({groupIndex:t})=>e.currentTimeMarker&&H(T(_).start,x(_).end,new Date,new Date,!0)&&k.createElement(qn,{groupIndex:t,attachArrow:c,vertical:!0}))):k.createElement(Ha,{nested:!0,wrapGroup:!0,group:r,resources:s},K),"vertical"===g&&e.currentTimeMarker&&H(T(_).start,x(_).end,new Date,new Date,!0)&&k.createElement(qn,{attachArrow:c,vertical:!0}),F.sort(Y).map((t,r)=>k.createElement(u,{key:t.isRecurring?`${t.uid}:${t.group.index}:${t.range.index}:${t.originalStart}`:`${t.uid}:${t.group.index}:${t.range.index}`,...t,format:"t",form:e.form,onDataAction:e.onDataAction,item:e.item,viewItem:e.viewItem,editable:e.editable,ignoreIsAllDay:!0,vertical:!1,isLast:r===F.length-1}))))},Wl={name:"multi-day-timeline",title:"Multi Day Timeline",currentTimeMarker:!0,dateRange:({date:e,numberOfDays:t=1,timezone:r})=>{const n=a.ZonedDate.fromLocalDate(e,r),l=a.getDate(n),o=a.addDays(l,t),s=a.ZonedDate.fromUTCDate(z(l),r),c=a.ZonedDate.fromUTCDate(z(o),r);return{start:new Date(s.getTime()),end:new Date(c.getTime()),zonedStart:s,zonedEnd:c}},selectedDateFormat:"{0:M}",selectedShortDateFormat:"{0:m}",numberOfDays:1,startTime:"00:00",endTime:"00:00",isWorkDayStart:"8:00",isWorkDayEnd:"17:00",workWeekStart:a.Day.Monday,workWeekEnd:a.Day.Friday,slotDivisions:2,slotDuration:60,defaultShowWorkHours:!0,columnWidth:100},Pl=e=>k.createElement(Fl,{...e}),Hl={...Wl,name:"timeline",title:e=>e.toLanguageString(Ae,Cr[Ae]),slotDuration:60,slotDivisions:2,numberOfDays:1,selectedDateFormat:"{0:M}",selectedShortDateFormat:"{0:m}"};Pl.displayName="KendoReactSchedulerTimelineView";const Kl=new Map;Kl.set(vl,hl),Kl.set(nl,ll),Kl.set(Rl,Tl),Kl.set(Ml,Nl),Kl.set(Al,_l),Kl.set(Pl,Hl);const $l=k.forwardRef((e,t)=>{var r,l,i,u;const m=!n.validatePackage(ol,{component:"Scheduler"}),p=n.getLicenseMessage(ol),{timezone:g,onDataChange:E}=e,v=k.useRef(null),y=k.useRef(null);k.useImperativeHandle(y,()=>({props:e,element:v.current})),k.useImperativeHandle(t,()=>y.current),n.useWebMcpRegister("scheduler",y,e,e.webMcp);const h=n.useRtl(v),f=o.useInternationalization(),D=o.useLocalization(),{fields:S}=k.useMemo(()=>(e=>({fields:{...K,...e}}))(e.modelFields),[e.modelFields]),[w,I]=Se(e.defaultDate||Bl.defaultDate,e.date,e.onDateChange),R=k.Children.toArray(e.children||[]).map(e=>{var t;return k.isValidElement(e)?k.cloneElement(e,{...Kl.get(e.type),...null!=(t=e.props)?t:{}}):e}),T=k.cloneElement(k.createElement(nl,null),Kl.get(nl)),[x,M]=Se(e.defaultView||R[0]&&R[0].props.name||"day",e.view,e.onViewChange),N=R.find(e=>e.props.name===x)||R[0]||T,L=N.props,[z,F]=Se(null==(r=L.defaultShowWorkHours)||r,L.showWorkHours),W=(null!=(l=e.data)?l:Bl.data)||Bl.data,P=((e,t)=>{const r=C(e,t),a=b(r);return 1===a.length&&0===a[0].length?[{index:0,isDefault:!0,resources:(t||[]).reduce((e,t)=>[...e,...t.data.map(e=>({...e,field:t.field,valueField:t.valueField,colorField:t.colorField,multiple:t.multiple}))],[])}]:a.map((e,t)=>({index:t,resources:e}))})(e.group,e.resources),H=e.group&&e.group.orientation?e.group.orientation:"horizontal",$=N.props.selectedDateFormat||"{0:D}",B=N.props.selectedShortDateFormat||"{0:d}",V=N.props.slotDuration,G=void 0!==N.props.dateRange?"function"==typeof N.props.dateRange?N.props.dateRange.call(void 0,{intl:f,date:w,timezone:g,numberOfDays:N.props.numberOfDays,workWeekStart:N.props.workWeekStart||f.firstDay(),workWeekEnd:N.props.workWeekEnd||(f.firstDay()+N.props.numberOfDays)%6}):N.props.dateRange:{start:Bl.defaultDate,end:Bl.defaultDate},U=k.useCallback(({created:e=[],updated:t=[],deleted:r=[]})=>{if(E){const a={created:e,updated:t,deleted:r};E.call(void 0,a)}},[E]),Z=k.useCallback(e=>{const t=[e.dataItem];U({created:t})},[U]),q=k.useCallback(e=>{const t=[],r=[];if(e.series)if(Array.isArray(e.dataItem)){const t=e.dataItem[0];if(null!==A(t,S.recurrenceId)&&void 0!==A(t,S.recurrenceId)){const e=n.clone(O(t,S,W)),a=new Date(A(t,S.originalStart)).getTime(),l=new Date(A(t,S.start)).getTime(),o=new Date(A(t,S.end)).getTime(),s=l-a,c=o-l,i=new Date(A(e,S.start)).getTime();_(e,S.start,new Date(i+s)),_(e,S.end,new Date(i+s+c));const u=A(e,S.recurrenceExceptions)||[];if(u.length>0&&0!==s){const t=u.map(e=>new Date(new Date(e).getTime()+s));_(e,S.recurrenceExceptions,t)}r.push(e)}else e.dataItem.forEach(e=>{const t=n.clone(O(e,S,W)),a=n.clone(e);_(a,S.originalStart,A(t,S.originalStart)),_(a,S.recurrenceId,A(t,S.recurrenceId));const l=A(t,S.recurrenceExceptions)||[],o=new Date(A(t,S.start)).getTime(),s=new Date(A(a,S.start)).getTime()-o;if(l.length>0&&0!==s){const e=l.map(e=>new Date(new Date(e).getTime()+s));_(a,S.recurrenceExceptions,e)}else _(a,S.recurrenceExceptions,l);r.push(a)})}else if(null!==A(e.dataItem,S.recurrenceId)&&void 0!==A(e.dataItem,S.recurrenceId)){const t=n.clone(O(e.dataItem,S,W)),a=new Date(A(e.dataItem,S.originalStart)).getTime(),l=new Date(A(e.dataItem,S.start)).getTime(),o=new Date(A(e.dataItem,S.end)).getTime(),s=l-a,c=o-l,i=new Date(A(t,S.start)).getTime();_(t,S.start,new Date(i+s)),_(t,S.end,new Date(i+s+c));const u=A(t,S.recurrenceExceptions)||[];if(u.length>0&&0!==s){const e=u.map(e=>new Date(new Date(e).getTime()+s));_(t,S.recurrenceExceptions,e)}r.push(t)}else{const t=n.clone(e.dataItem);if(A(t,S.recurrenceRule)){const r=n.clone(O(e.dataItem,S,W));_(t,S.originalStart,A(r,S.originalStart)),_(t,S.recurrenceId,A(r,S.recurrenceId));const a=A(r,S.recurrenceExceptions)||[],l=new Date(A(r,S.start)).getTime(),o=new Date(A(t,S.start)).getTime()-l;if(a.length>0&&0!==o){const e=a.map(e=>new Date(new Date(e).getTime()+o));_(t,S.recurrenceExceptions,e)}else _(t,S.recurrenceExceptions,a)}else _(t,S.recurrenceExceptions,null);r.push(t)}else if(Array.isArray(e.dataItem))e.dataItem.forEach(e=>{const a=null!==A(e,S.recurrenceRule)&&void 0!==A(e,S.recurrenceRule);if(null!==A(e,S.recurrenceId)&&void 0!==A(e,S.recurrenceId)&&a){const a=n.clone(O(e,S,W)),l=A(e,S.originalStart),o=A(a,S.recurrenceExceptions)||[];_(a,S.recurrenceExceptions,[...o,l]),_(e,S.recurrenceRule,null),r.push(a),t.push(e)}else r.push(e)});else{const a=null!==A(e.dataItem,S.recurrenceRule)&&void 0!==A(e.dataItem,S.recurrenceRule);if(null!==A(e.dataItem,S.recurrenceId)&&void 0!==A(e.dataItem,S.recurrenceId)&&a){const a=n.clone(O(e.dataItem,S,W)),l=A(e.dataItem,S.originalStart),o=A(a,S.recurrenceExceptions)||[];_(a,S.recurrenceExceptions,[...o,l]),_(e.dataItem,S.recurrenceRule,null),r.push(a),t.push(e.dataItem)}else r.push(e.dataItem)}U({updated:r,created:t})},[U,S,W]),Y=k.useCallback(e=>{const t=[],r=[];if(e.series){const t=n.clone(O(e.dataItem,S,W)),a=n.clone(e.dataItem);_(a,S.originalStart,A(t,S.originalStart)),_(a,S.recurrenceId,A(t,S.recurrenceId)),_(a,S.recurrenceRule,A(t,S.recurrenceRule)),_(a,S.recurrenceExceptions,A(t,S.recurrenceExceptions)),r.push(a)}else if(null===A(e.dataItem,S.recurrenceRule)||void 0===A(e.dataItem,S.recurrenceRule))r.push(e.dataItem);else{const r=n.clone(O(e.dataItem,S,W)),a=A(e.dataItem,S.originalStart),l=A(r,S.recurrenceExceptions)||[];_(r,S.recurrenceExceptions,[...l,a]),_(e.dataItem,S.recurrenceRule,null),t.push(r)}U({updated:t,deleted:r})},[U,S,W]),j=k.useCallback(e=>{switch(e.type){case ee.create:Z(e);break;case ee.update:q(e);break;case ee.remove:Y(e)}},[Z,Y,q]),X=k.useCallback((e,t)=>{M(e,{...t,target:y.current})},[M,y]),Q=k.useCallback((e,t)=>{I(e,{...t,target:y.current})},[I,y]),J=k.useCallback(e=>{e.value&&I(e.value,{...e,target:y.current,nativeEvent:e.nativeEvent})},[I,y]),te=k.useCallback(e=>{var t,r;e.preventDefault();const n=null!=(r=null!=(t=N.props.step)?t:N.props.numberOfDays)?r:1,l=n>27?a.addMonths(w,Math.round(n/27)):a.addDays(w,n);I(l,e)},[w,I,N.props.numberOfDays,N.props.step]),re=k.useCallback(e=>{var t,r;e.preventDefault();const n=null!=(r=null!=(t=N.props.step)?t:N.props.numberOfDays)?r:1,l=n>27?a.addMonths(w,-Math.round(n/27)):a.addDays(w,-n);I(l,e)},[w,I,N.props.numberOfDays,N.props.step]),ae=k.useCallback(e=>{e.preventDefault();const t=a.ZonedDate.fromLocalDate(new Date,g);I(new Date(t.getTime()),e)},[I,g]),ne=k.useCallback(()=>{F(!z)},[F,z]),le=k.useCallback(()=>{v.current&&(v.current.style.boxShadow="0 0.5px 0.5px 0.5px rgba(0, 0, 0, .12)")},[v]),oe=k.useCallback(()=>{v.current&&(v.current.style.boxShadow="")},[v]),se=k.useMemo(()=>{var t;return{...e.style,height:null!=(t=e.height)?t:Bl.height}},[e.height,e.style]),ce=k.useMemo(()=>n.classNames({"k-rtl":void 0!==e.rtl?e.rtl:"rtl"===h},"k-scheduler",e.className),[e.className,e.rtl,h]),ie=D.toLanguageString(Ne,Cr[Ne]),ue=D.toLanguageString(Pe,Cr[Pe]),de=D.toLanguageString(He,Cr[He]),me=D.toLanguageString(kr,Cr[kr]),pe=D.toLanguageString(br,Cr[br]),ge=k.useRef(null),Ee=(e=>{const[t,r]=k.useState(0),a=k.useRef(0),n=k.useRef(!1);return k.useEffect(()=>{const t=e.current;if(!t||"undefined"==typeof ResizeObserver)return;const l={childList:!0,subtree:!0,characterData:!0},o=()=>{if(!n.current&&0!==t.offsetWidth){for(n.current=!0,i.disconnect();a.current>0;)if(a.current--,c.flushSync(()=>r(a.current)),t.scrollWidth>t.offsetWidth){a.current++,c.flushSync(()=>r(a.current));break}for(;t.scrollWidth>t.offsetWidth&&a.current<3;)a.current++,c.flushSync(()=>r(a.current));i.observe(t,l),n.current=!1}},s=new ResizeObserver(o);s.observe(t);const i=new MutationObserver(o);return i.observe(t,l),()=>{s.disconnect(),i.disconnect()}},[e]),t})(ge),ve=N.props.header||e.header||Bl.header,ye=N.props.footer||e.footer||Bl.footer,he=N.props.form||e.form||ca,[fe,ke]=k.useState(null),[De,be]=k.useState(null),we=k.useCallback(e=>{e.preventDefault();const t=new Date,r=V||30,a=60*r*1e3,n=t.getMinutes(),l=Math.ceil(n/r)*r;let o=new Date(t);o.setHours(t.getHours()+Math.floor(l/60),l%60,0,0);const s=(e,t)=>W.some(r=>{const a=A(r,S.start),n=A(r,S.end);return!(!a||!n)&&(a.getTime()<t.getTime()&&n.getTime()>e.getTime())});let c=new Date(o.getTime()+a);for(let e=0;e<48&&s(o,c);e++)o=new Date(o.getTime()+a),c=new Date(o.getTime()+a);const i={};_(i,S.start,o),_(i,S.end,c),_(i,S.isAllDay,!1),_(i,S.title,""),_(i,S.description,""),be(i)},[W,S,V]),Ie=k.useCallback(e=>{e.value&&U({created:[e.value]}),be(null)},[U]),Re=k.useCallback(e=>{be(null)},[]),Te=k.useCallback(e=>{be(null)},[]),xe="object"==typeof e.editable?e.editable.add:!!e.editable;return k.createElement(Ce,{element:v,props:e,views:R,fields:S,groups:P,dateRange:G,orientation:H,dateFormat:{dateFormat:$,shortDateFormat:B},date:[w,Q],activeView:[x,X],selection:[fe,ke],data:[W,j]},k.createElement("div",{ref:v,id:e.id,style:se,className:ce,tabIndex:null!=(i=e.tabIndex)?i:Bl.tabIndex,dir:h,role:e.role||"application","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-activedescendant":fe&&fe.props.id||void 0,onFocus:le,onBlur:oe},k.createElement(ve,{ref:e=>{var t;ge.current=null!=(t=null==e?void 0:e.element)?t:null},ariaLabel:pe,style:{flexWrap:Ee<3?"nowrap":"wrap"}},xe&&k.createElement(s.Button,{className:"k-toolbar-button",themeColor:"primary",svgIcon:d.plusIcon,"aria-label":me,tabIndex:-1,onClick:we},Ee<2&&me),Ee<2&&k.createElement(s.Button,{className:"k-toolbar-button",fillMode:"flat",tabIndex:-1,onClick:ae},ie),Ee<3&&k.createElement(s.ButtonGroup,{className:"k-button-group-flat k-toolbar-button-group"},k.createElement(s.Button,{fillMode:"flat",tabIndex:-1,svgIcon:"rtl"===h?d.chevronRightIcon:d.chevronLeftIcon,"aria-label":ue,title:ue,onClick:re}),k.createElement(s.Button,{fillMode:"flat",tabIndex:-1,svgIcon:"rtl"===h?d.chevronLeftIcon:d.chevronRightIcon,"aria-label":de,title:de,onClick:te})),k.createElement(Sr,{value:w,onChange:J,level:Ee}),k.createElement(s.ToolbarSpacer,null),1===Ee&&k.createElement("span",{className:"k-separator"}),k.createElement(wr,{level:Ee})),N&&k.createElement(N.type,{editable:null!=(u=e.editable)?u:Bl.editable,key:N.props.name,item:e.item,viewItem:e.viewItem,editItem:e.editItem,task:e.task,viewTask:e.viewTask,editTask:e.viewTask,slot:e.slot,viewSlot:e.viewSlot,editSlot:e.editSlot,form:e.form,onDataAction:j,showWorkHours:z,...N.props}),(N.props.footer||e.footer||"agenda"!==x&&"month"!==x)&&k.createElement(ye,{ariaLabel:pe},"agenda"!==x&&"month"!==x&&V&&V<1440&&k.createElement(s.Button,{className:"k-toolbar-button k-scheduler-fullday",tabIndex:-1,onClick:ne,svgIcon:d.clockIcon},D.toLanguageString(z?Ke:$e,Cr[z?Ke:$e]))),m&&k.createElement(n.WatermarkOverlay,{message:p}),De&&k.createElement(he,{dataItem:De,onSubmit:Ie,onCancel:Re,onClose:Te})))}),Bl={data:[],height:600,tabIndex:-1,editable:!1,defaultDate:new Date,header:we,footer:Te,navigation:Ie,viewSelector:Re};$l.propTypes={data:r.array,editable:r.oneOfType([r.bool,r.shape({add:r.bool,drag:r.bool,edit:r.bool,remove:r.bool,resize:r.bool})]),view:r.string,defaultView:r.string,date:r.any,defaultDate:r.any,rtl:r.bool,height:r.oneOfType([r.number,r.string]),children:r.any,timezone:r.string,group:r.any,resources:r.any,modelFields:r.shape({id:r.string,start:r.string,startTimezone:r.string,end:r.string,endTimezone:r.string,isAllDay:r.string,title:r.string,description:r.string,recurrenceRule:r.string,recurrenceId:r.string,recurrenceException:r.string})},$l.displayName="KendoReactScheduler";const Vl=k.forwardRef((e,t)=>{const{item:r,_ref:a,itemRef:l,...s}=e,c=k.useRef(void 0),i=k.useRef(null),u=k.useRef(null),m=k.useRef(null);k.useImperativeHandle(u,()=>({props:e,element:i.current&&i.current.element})),k.useImperativeHandle(t,()=>u.current),k.useImperativeHandle(a,()=>i.current),k.useImperativeHandle(l,()=>i.current);const p=r||Gl.item,g=o.useInternationalization(),[E]=va(),[v]=ga(),y=re(),[h,f]=k.useState(!0),[D,b]=k.useState(!1),C=k.useRef(0),S=k.useRef(null),I=k.useRef([]),M=n.useDir(y),N=k.useMemo(()=>{var t,r;return e.isAllDay?null!=(t=e.title)?t:"":`(${g.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd)}): ${null!=(r=e.title)?r:""}`},[g,e.isAllDay,e.title,e.zonedEnd,e.zonedStart]);let A;e.isRecurring&&!e.isException?A="recurring":!e.isRecurring&&e.isException&&(A="non-recurring");const _=k.useMemo(()=>g.format("{0:t} – {1:t}",e.zonedStart,e.zonedEnd),[g,e.zonedStart,e.zonedEnd]),L=()=>{var t,r,a,n,l;const o=v.filter(t=>t.current&&((t,r)=>t.group.index===r.group.index&&t.range.index===r.range.index&&(void 0===t.range.isAllDay||void 0===r.range.isAllDay||t.range.isAllDay===r.range.isAllDay)&&(e.ignoreIsAllDay||t.isAllDay===r.isAllDay))(t.current.props,e)).sort((e,t)=>e.current.props.start.getTime()-t.current.props.start.getTime()),s=o.filter(t=>H(t.current.props.start,t.current.props.end,e.start,e.end)),c=i.current&&i.current.element;if(!c||!s.length)return;const u=T(o),d=x(o),m=T(s),p=x(s);if(!(m.current&&i.current&&p.current&&u.current&&d.current))return;if(!H(m.current.props.start,p.current.props.end,e.start,e.end))return void f(!1);const g=[],y=[],h=[],k=w(m.current.element),D=(e.vertical?k.height:k.width)/(m.current.props.end.getTime()-m.current.props.start.getTime()),M=(e.vertical?12:8)/D,N=(Math.min(e.start.getTime(),p.current.props.end.getTime()-M)-m.current.props.start.getTime())*D,A=Math.floor(Math.min(e.end.getTime(),p.current.props.end.getTime())-Math.max(e.start.getTime(),m.current.props.start.getTime()))*D;(E||[]).forEach(e=>{e.current&&(e.current.props.dragHint?y.push(e.current):e.current.props.resizeHint?h.push(e.current):g.push(e.current))}),I.current=((t,r,a)=>{const[n,l]=r,o=new Date(Math.min(l.props.end.getTime()-a,Math.max(e.start.getTime(),n.props.start.getTime()))),s=new Date(Math.max(o.getTime()+a,Math.min(e.end.getTime(),l.props.end.getTime())));return t.filter(t=>{const r=Math.max(Math.min(l.props.end.getTime()-a,t.props.start.getTime()),n.props.start.getTime()),c=Math.min(Math.max(r+a,t.props.end.getTime()),l.props.end.getTime());return t.props.id!==e.id&&t.props.group.index===e.group.index&&t.props.range.index===e.range.index&&(e.ignoreIsAllDay||t.props.isAllDay===e.isAllDay)&&H(new Date(r),new Date(c),o,s)&&H(n.props.start,l.props.end,t.props.start,t.props.end)})})(g,[u.current,d.current],M),S.current=e.resizeHint||e.dragHint?0:((e,t)=>{const r=new Set;return t.forEach(e=>{void 0!==e._order&&null!==e._order&&r.add(e._order)}),V(Array.from(r))})(i.current,I.current);let _=1;e.resizeHint||e.dragHint||(_=((e,t)=>{var r;let a=null!=(r=e._order)?r:0;return t.forEach(e=>{void 0!==e._order&&null!==e._order&&a<e._order&&(a=e._order)}),a+1})(i.current,I.current));let L=0;const z=k;I.current.forEach(e=>{let t=0;void 0!==e._order&&null!==e._order&&e._order<S.current&&(t=w(e.element).top+w(e.element).height-z.top-1*S.current+1),t>L&&(L=t)});z.width=e.vertical?z.width/_-1-20/_:A-1,e.vertical?z.height=A-1:(e.resizeHint||e.dragHint)&&_<=1||(z.height=null!=(r=null==(t=e.style)?void 0:t.height)?r:12),z.left=e.vertical?z.left+(null!=(a=S.current)?a:0)+1*(null!=(n=S.current)?n:0)*z.width:z.left+(N<0?0:N),z.top=e.vertical?z.top+(N<0?0:N):z.top+L+1*(null!=(l=S.current)?l:0),C.current=_,R(c,z),b(!0),f(!0)},z=k.useCallback(e=>{const t=e&&e[0],r=m.current;void 0!==c.current&&window.cancelAnimationFrame(c.current),r&&t&&(r.width!==t.contentRect.width||r.height!==t.contentRect.height)&&(c.current=window.requestAnimationFrame(()=>{L()})),m.current={width:t.contentRect.width,height:t.contentRect.height}},[L]);k.useEffect(L);const O=i.current&&i.current.element?i.current.element.closest(".k-scheduler-layout"):null;return pn({element:O,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),k.useEffect(()=>{if(!y.current)return;const e=window.ResizeObserver,t=e&&new e(z);return t&&t.observe(y.current),()=>{t&&t.disconnect()}},[z,y]),k.createElement(p,{...s,_ref:i,_order:S,_maxSiblingsPerSlot:C,_siblings:I,itemRef:i,style:{visibility:D?void 0:"hidden",display:h?void 0:"none",...e.style}},!e.resizeHint&&k.createElement(k.Fragment,null,e.tail&&!e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"rtl"===M?"chevron-right":"chevron-left",icon:"rtl"===M?d.chevronRightIcon:d.chevronLeftIcon})),k.createElement("div",{title:N},e.tail&&e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"chevron-up",icon:d.chevronUpIcon})),k.createElement(mn,{className:"k-event-title"},e.title),k.createElement(mn,{className:"k-event-time"},"recurring"===A&&k.createElement("span",{className:"k-event-recurrence-icon"},k.createElement(n.IconWrap,{name:"arrow-rotate-cw",icon:d.arrowRotateCwIcon})),"non-recurring"===A&&k.createElement("span",{className:"k-event-recurrence-icon"},k.createElement(n.IconWrap,{name:"arrows-no-repeat",icon:d.arrowsNoRepeatIcon})),_),e.head&&e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"chevron-down",icon:d.chevronDownIcon}))),A&&k.createElement("span",{className:"k-event-recurrence-icon"},k.createElement(n.IconWrap,{name:"recurring"===A?"arrow-rotate-cw":"arrows-no-repeat",icon:"recurring"===A?d.arrowRotateCwIcon:d.arrowsNoRepeatIcon})),e.head&&!e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"rtl"===M?"chevron-left":"chevron-right",icon:"rtl"===M?d.chevronLeftIcon:d.chevronRightIcon}))))}),Gl={item:dn};Vl.displayName="KendoReactSchedulerProportionalViewItem",e.AgendaView=vl,e.DATA_ACTION=ee,e.DRAG_ITEM_ACTION=Kn,e.DateHeaderCell=Xn,e.DayView=nl,e.ITEMS_FOCUS_ACTION=Aa,e.ITEMS_SELECT_ACTION=Sa,e.MonthView=Rl,e.REMOVE_ITEM_ACTION=Pn,e.RESIZE_ITEM_ACTION=$n,e.RemoveRecurrenceConfirmDialog=ra,e.SERIES_ACTION=Bn,e.SHOW_OCCURRENCE_DIALOG_ACTION=Wn,e.SHOW_REMOVE_DIALOG_ACTION=Hn,e.SLOTS_FOCUS_ACTION=Ra,e.SLOTS_SELECT_ACTION=wa,e.Scheduler=$l,e.SchedulerActiveViewContext=ke,e.SchedulerDataContext=he,e.SchedulerDateContext=ve,e.SchedulerDateRangeContext=me,e.SchedulerDrag=wn,e.SchedulerEditItem=Un,e.SchedulerEditItemDragItemContext=Nn,e.SchedulerEditItemFormItemContext=Mn,e.SchedulerEditItemPropsContext=xn,e.SchedulerEditItemRemoveItemContext=_n,e.SchedulerEditItemResizeItemContext=An,e.SchedulerEditItemShowOccurrenceDialogContext=zn,e.SchedulerEditItemShowRemoveDialogContext=Ln,e.SchedulerEditSlot=on,e.SchedulerEditSlotFormItemContext=an,e.SchedulerEditSlotPropsContext=rn,e.SchedulerEditTask=gl,e.SchedulerFieldsContext=se,e.SchedulerFooter=Te,e.SchedulerForm=ca,e.SchedulerFormEditor=aa,e.SchedulerGroupsContext=ue,e.SchedulerHeader=we,e.SchedulerItem=dn,e.SchedulerItemContent=mn,e.SchedulerOccurrenceDialog=cn,e.SchedulerOrientationContext=ge,e.SchedulerProportionalViewItem=Vl,e.SchedulerPropsContext=ae,e.SchedulerRecurrenceDialog=ta,e.SchedulerRemoveDialog=un,e.SchedulerResize=Rn,e.SchedulerSlot=Qa,e.SchedulerTask=sl,e.SchedulerViewItem=gn,e.SchedulerViewSlot=en,e.SchedulerViewTask=cl,e.SchedulerViewsContext=le,e.TimeHeaderCell=Ya,e.TimelineView=Pl,e.WeekView=Ml,e.WorkWeekView=Al,e.agendaViewDefaultProps=hl,e.dateHeaderCellDefaultProps=Qn,e.dayViewDefaultProps=ll,e.monthViewDefaultProps=Tl,e.schedulerDefaultProps=Bl,e.schedulerDragDefaultProps=In,e.schedulerEditItemDefaultProps=Zn,e.schedulerEditSlotDefaultProps=sn,e.schedulerEditTaskDefaultProps=El,e.schedulerFormDefaultProps=ia,e.schedulerFormEditorDefaultProps=sa,e.schedulerProportionalViewItemDefaultProps=Gl,e.schedulerResizeDefaultProps=Tn,e.schedulerSlotDefaultProps=Ja,e.schedulerViewItemDefaultProps=En,e.schedulerViewSlotDefaultProps=tn,e.schedulerViewTaskDefaultProps=il,e.timeHeaderCellDefaultProps=ja,e.timeLineViewDefaultProps=Hl,e.useSchedulerActiveViewContext=De,e.useSchedulerDataContext=fe,e.useSchedulerDateContext=ye,e.useSchedulerDateRangeContext=pe,e.useSchedulerEditItemDragItemContext=()=>k.useContext(Nn),e.useSchedulerEditItemFormItemContext=()=>k.useContext(Mn),e.useSchedulerEditItemPropsContext=()=>k.useContext(xn),e.useSchedulerEditItemRemoveItemContext=()=>k.useContext(_n),e.useSchedulerEditItemResizeItemContext=()=>k.useContext(An),e.useSchedulerEditItemShowOccurrenceDialogContext=()=>k.useContext(zn),e.useSchedulerEditItemShowRemoveDialogContext=()=>k.useContext(Ln),e.useSchedulerEditSlotFormItemContext=()=>k.useContext(an),e.useSchedulerEditSlotPropsContext=()=>k.useContext(rn),e.useSchedulerFieldsContext=ce,e.useSchedulerGroupsContext=de,e.useSchedulerOrientationContext=Ee,e.useSchedulerPropsContext=ne,e.useSchedulerViewsContext=oe,e.weekViewDefaultProps=Nl,e.workWeekDefaultProps=_l});
15
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-date-math"),require("@progress/kendo-react-common"),require("@progress/kendo-data-query"),require("@progress/kendo-react-intl"),require("@progress/kendo-react-buttons"),require("react-dom"),require("@progress/kendo-react-dateinputs"),require("@progress/kendo-react-popup"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-form"),require("@progress/kendo-react-dialogs"),require("@progress/kendo-recurrence"),require("@progress/kendo-react-labels"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-dropdowns"),require("@progress/kendo-react-tooltip")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-date-math","@progress/kendo-react-common","@progress/kendo-data-query","@progress/kendo-react-intl","@progress/kendo-react-buttons","react-dom","@progress/kendo-react-dateinputs","@progress/kendo-react-popup","@progress/kendo-svg-icons","@progress/kendo-react-form","@progress/kendo-react-dialogs","@progress/kendo-recurrence","@progress/kendo-react-labels","@progress/kendo-react-inputs","@progress/kendo-react-dropdowns","@progress/kendo-react-tooltip"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactScheduler={},e.React,e.PropTypes,e.KendoDateMath,e.KendoReactCommon,e.KendoDataQuery,e.KendoReactIntl,e.KendoReactButtons,e.ReactDOM,e.KendoReactDateinputs,e.KendoReactPopup,e.KendoSvgIcons,e.KendoReactForm,e.KendoReactDialogs,e.KendoRecurrence,e.KendoReactLabels,e.KendoReactInputs,e.KendoReactDropdowns,e.KendoReactTooltip)}(this,function(e,t,r,a,n,l,o,s,c,i,u,d,m,p,g,v,E,h,y){"use strict";function f(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var k=f(t),D=f(c);const C=(e,t=0,r=0,a=[])=>{if(e.length<=t)return[a];const n=[];return e[t].data.map(l=>{n.push(...C(e,t+1,r+1,[...a,{...l,field:e[t].field,valueField:e[t].valueField,colorField:e[t].colorField,multiple:e[t].multiple}]))}),n};function b(e,t){const r=[];if(!t||!t.length)return r;if(e&&e.resources&&e.resources.length){const a=e.resources;for(let e=0;e<a.length;e++){const n=t.find(t=>t.name===a[e]);r.push(n)}}return r}const S=(e,t=e.length-1)=>{const r=Math.max(0,t),a=[];e&&e.length||(e=[{}]);const n=(e[r].data||[]).map(t=>({...t,text:t[e[r].textField]}))||[],l=n.length;let o=1;for(let t=0;t<=r;t++)o*=(e[t].data||[]).length||1;for(let e=0;e<o;e++)n[e%l]&&a.push(n[e%l]);return a},w=e=>{if(!e)return{top:0,left:0,width:0,height:0,right:0};return{top:e.offsetTop,left:e.offsetLeft,right:e.offsetParent?e.offsetParent.offsetWidth-(e.offsetLeft+e.offsetWidth):0,width:e.offsetWidth,height:e.offsetHeight}},I=(e,t=!1)=>parseFloat(window.getComputedStyle(e)[t?"paddingLeft":"paddingTop"]||"0")+parseFloat(window.getComputedStyle(e)[t?"paddingRight":"paddingBottom"]||"0"),R=(e,t,r=!1)=>{e&&(void 0!==t.top&&(e.style.top=`${t.top}px`),void 0!==t.left&&(e.style.left=`${t.left}px`),void 0!==t.width&&(e.style.width=`${t.width}px`),void 0!==t.height&&!r&&(e.style.height="number"==typeof t.height?`${t.height}px`:t.height),r&&(e.style.minHeight=void 0!==t.height&&t.height>0?`${t.height}px`:""))},T=e=>e[0],x=e=>e[e.length-1],A=(e,t,r)=>{const n=a.ZonedDate.fromLocalDate(e,r),l=a.ZonedDate.fromLocalDate(t,r),o=a.getDate(n).getTime(),s=a.getDate(l).getTime(),c=0===l.getHours()&&0===l.getMinutes()&&0===l.getSeconds()&&0===l.getMilliseconds()?s-1:s;return o!==a.getDate(new Date(c)).getTime()},M=e=>{const t=new Set;return e.forEach(e=>{t.add(e.field)}),t.size===e.length};const N=(e,t,r,a=0)=>{if(a===r)return null;let n=null;const l=document.elementFromPoint(e,t);if(!l)return n;if("true"===l.getAttribute("data-slot"))return l;const o=l.style.pointerEvents;return l.style.pointerEvents="none",n=N(e,t,r,a+1),l.style.pointerEvents=o,n},L=(e,t)=>n.getter(t)(e),z=(e,t,r)=>{if(t)return n.setter(t)(e,r)},_=e=>null!=e;function F(e){return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))}const O=(e,t,r)=>{const a=W(e,t)?L(e,t.id):L(e,t.recurrenceId);return r.find(e=>L(e,t.id)===a)},W=(e,t)=>{const r=L(e,t.id),a=L(e,t.recurrenceId),n=L(e,t.recurrenceRule);return null!=r&&!!n&&null==a},P=(e,t)=>Math.max(e.getTime(),t.getTime()),H=(e,t)=>Math.min(e.getTime(),t.getTime()),$=(e,t,r,a,n=!1)=>n?P(t,a)-H(e,r)<=t.getTime()-e.getTime()+(a.getTime()-r.getTime()):P(t,a)-H(e,r)<t.getTime()-e.getTime()+(a.getTime()-r.getTime()),K={id:"id",start:"start",startTimezone:"startTimezone",originalStart:"originalStart",end:"end",endTimezone:"endTimezone",isAllDay:"isAllDay",title:"title",description:"description",recurrenceRule:"recurrenceRule",recurrenceId:"recurrenceId",recurrenceExceptions:"recurrenceExceptions",readonly:"readonly"},B=(e,t,r)=>(t.getHours()<e.getHours()||t.getHours()===e.getHours()&&t.getMinutes()<=e.getMinutes())&&(e.getHours()<r.getHours()||r.getHours()===e.getHours()&&e.getMinutes()<r.getMinutes()),V=(e,t,r)=>t<r?t<=e&&e<=r:e<=r||t<=e,G=e=>{let t=0;const r=e.slice();return r.sort((e,t)=>e-t).forEach((e,a)=>{r[a]===a&&(t=a+1)}),t},U=(e,t,r=!1)=>{e.forEach(e=>{e.order=null}),t.forEach(e=>e.items.splice(0,e.items.length));const a=[...e].sort((e,t)=>e.start.getTime()-t.start.getTime());t.forEach(e=>{const t=[];a.forEach(a=>{if((r||a.isAllDay===e.isAllDay)&&a.range.index===e.range.index&&(void 0===a.range.isAllDay||void 0===e.range.isAllDay||a.range.isAllDay===e.range.isAllDay)&&a.group.index===e.group.index&&$(a.start,a.end,e.start,e.end)){if(null!==a.order&&void 0!==a.order)t.includes(a.order)||(t.push(a.order),t.sort((e,t)=>e-t));else{const e=G(t);a.order=e,t.push(e),t.sort((e,t)=>e-t)}e.items.push(a)}})})},q=(e,t,r=!1)=>{e.forEach(e=>e.slots.splice(0,e.slots.length)),e.forEach(e=>{t.forEach(t=>{(r||e.isAllDay===t.isAllDay)&&e.range.index===t.range.index&&(void 0===e.range.isAllDay||void 0===t.range.isAllDay||e.range.isAllDay===t.range.isAllDay)&&e.group.index===t.group.index&&$(e.start,e.end,t.start,t.end)&&e.slots.push(t)})})},Z=(...e)=>{},Y=(e,t,r=!1,a=!1)=>{const n=e.current;if(!n||!t)return null;const o=t.filter(e=>null!==e.current&&null!==e.current.element),s=l.orderBy(o,[{field:"current.props.group.index",dir:"asc"},{field:"current.props.range.index",dir:"asc"},r?{field:""}:{field:"current.props.isAllDay",dir:"desc"},{field:"current.props.start",dir:"asc"}]),c=s.findIndex(e=>null!==e.current&&!(e.current.props.uid!==n.props.uid||void 0!==e.current.props.occurrenceId&&e.current.props.occurrenceId!==n.props.occurrenceId||e.current.props.group.index!==n.props.group.index||e.current.props.range.index!==n.props.range.index||!r&&e.current.props.isAllDay!==n.props.isAllDay));return s[c+(a?-1:1)]},j=(e,t)=>(e.order||0)-(t.order||0),X=6e4,Q=[{}],J=new Date(1900,0,1),ee=new Date(2099,11,31);a.ZonedDate.fromLocalDate(J),a.ZonedDate.fromLocalDate(ee);var te=(e=>(e[e.create=0]="create",e[e.update=1]="update",e[e.remove=2]="remove",e))(te||{});const re=k.createContext({current:null}),ae=()=>k.useContext(re);re.displayName="SchedulerElementContext";const ne=k.createContext({}),le=()=>k.useContext(ne);ne.displayName="SchedulerPropsContext";const oe=k.createContext([]),se=()=>k.useContext(oe);oe.displayName="SchedulerViewsContext";const ce=k.createContext(K),ie=()=>k.useContext(ce);ce.displayName="SchedulerFieldsContext";const ue=k.createContext({dateFormat:"{0:D}",shortDateFormat:"{0:d}"});ue.displayName="SchedulerDateFormatContext";const de=k.createContext([{index:0,resources:[]}]),me=()=>k.useContext(de);de.displayName="SchedulerGroupsContext";const pe=k.createContext({start:new Date,end:new Date,zonedStart:a.ZonedDate.fromLocalDate(new Date),zonedEnd:a.ZonedDate.fromLocalDate(new Date)}),ge=()=>k.useContext(pe);pe.displayName="SchedulerDateRangeContext";const ve=k.createContext(null),Ee=()=>k.useContext(ve);ve.displayName="SchedulerOrientationContext";const he=k.createContext([new Date,Z]),ye=()=>k.useContext(he);he.displayName="SchedulerDateContext";const fe=k.createContext([[],Z]),ke=()=>k.useContext(fe);fe.displayName="SchedulerDataContext";const De=k.createContext(["day",Z]),Ce=()=>k.useContext(De);De.displayName="SchedulerActiveViewContext";const be=k.createContext([null,()=>{}]);be.displayName="SchedulerItemSelectionContext";const Se=({children:e,element:t,props:r,views:a,fields:n,groups:l,dateRange:o,dateFormat:s,orientation:c,date:i,data:u,activeView:d,selection:m})=>k.createElement(re.Provider,{value:t},k.createElement(ne.Provider,{value:r},k.createElement(oe.Provider,{value:a},k.createElement(ce.Provider,{value:n},k.createElement(ue.Provider,{value:s},k.createElement(de.Provider,{value:l},k.createElement(pe.Provider,{value:o},k.createElement(ve.Provider,{value:c},k.createElement(he.Provider,{value:i},k.createElement(fe.Provider,{value:u},k.createElement(De.Provider,{value:d},k.createElement(be.Provider,{value:m},e)))))))))))),we=(e,t,r)=>{const[a,n]=k.useState(t||e),l=k.useCallback((e,t)=>{n(e),r&&r.call(void 0,{...t,value:e})},[r,n]);return[void 0!==t?t:a,l]},Ie=k.forwardRef((e,t)=>{const{className:r,...a}=e,l=k.useRef(null),o=k.useRef(null);k.useImperativeHandle(o,()=>({element:l.current,props:e})),k.useImperativeHandle(t,()=>o.current);const c=k.useMemo(()=>n.classNames("k-scheduler-toolbar",r),[r]);return k.createElement(s.Toolbar,{id:e.id,ref:e=>{e&&(l.current=e.element)},className:c,...a},e.children)});Ie.displayName="KendoReactSchedulerHeader";const Re=k.forwardRef((e,t)=>{const{className:r,...a}=e,l=k.useRef(null);return k.useImperativeHandle(t,()=>({element:l.current,props:e})),k.createElement(s.ToolbarItem,{ref:e=>{e&&(l.current=e.element)},className:n.classNames(r),...a},e.children)});Re.displayName="KendoReactSchedulerSchedulerNavigation";const Te=k.forwardRef((e,t)=>{const{className:r,...a}=e,l=k.useRef(null);return k.useImperativeHandle(t,()=>({element:l.current,props:e})),k.createElement(s.ToolbarItem,{ref:e=>{e&&(l.current=e.element)},className:n.classNames("k-scheduler-views",r),...a},e.children)});Te.displayName="KendoReactSchedulerViewSelector";const xe=k.forwardRef((e,t)=>{const{className:r,style:a,...l}=e,o=k.useRef(null),c=k.useRef(null);k.useImperativeHandle(o,()=>({element:c.current,props:e})),k.useImperativeHandle(t,()=>o.current);const i=k.useMemo(()=>n.classNames("k-scheduler-footer",e.className),[e.className]);return k.createElement(s.Toolbar,{ref:e=>{e&&(c.current=e.element)},className:i,style:{boxShadow:"none",...a},...l},e.children)});xe.displayName="KendoReactSchedulerFooter";const Ae="scheduler.allEvents",Me="scheduler.allDay",Ne="scheduler.today",Le="scheduler.timelineViewTitle",ze="scheduler.weekViewTitle",_e="scheduler.workWeekViewTitle",Fe="scheduler.agendaViewTitle",Oe="scheduler.dayViewTitle",We="scheduler.monthViewTitle",Pe="scheduler.deleteTitle",He="scheduler.previousTitle",$e="scheduler.nextTitle",Ke="scheduler.showFullDay",Be="scheduler.showWorkDay",Ve="scheduler.editOccurrence",Ge="scheduler.editSeries",Ue="scheduler.editRecurringConfirmation",qe="scheduler.editRecurringDialogTitle",Ze="scheduler.editSave",Ye="scheduler.editCancel",je="scheduler.editorTitle",Xe="scheduler.editorEventTitle",Qe="scheduler.editorEventStart",Je="scheduler.editorEventStartTimeZone",et="scheduler.editorEventEnd",tt="scheduler.editorEventEndTimeZone",rt="scheduler.editorEventAllDay",at="scheduler.editorEventDescription",nt="scheduler.editorEventSeparateTimeZones",lt="scheduler.editorEventTimeZone",ot="scheduler.recurrenceEditorRepeat",st="scheduler.recurrenceEditorDailyInterval",ct="scheduler.recurrenceEditorDailyRepeatEvery",it="scheduler.recurrenceEditorWeeklyInterval",ut="scheduler.recurrenceEditorWeeklyRepeatEvery",dt="scheduler.recurrenceEditorWeeklyRepeatOn",mt="scheduler.recurrenceEditorMonthlyDay",pt="scheduler.recurrenceEditorMonthlyInterval",gt="scheduler.recurrenceEditorMonthlyRepeatEvery",vt="scheduler.recurrenceEditorMonthlyRepeatOn",Et="scheduler.recurrenceEditorYearlyOf",ht="scheduler.recurrenceEditorYearlyRepeatEvery",yt="scheduler.recurrenceEditorYearlyRepeatOn",ft="scheduler.recurrenceEditorYearlyInterval",kt="scheduler.recurrenceEditorFrequenciesDaily",Dt="scheduler.recurrenceEditorFrequenciesMonthly",Ct="scheduler.recurrenceEditorFrequenciesNever",bt="scheduler.recurrenceEditorFrequenciesWeekly",St="scheduler.recurrenceEditorFrequenciesYearly",wt="scheduler.recurrenceEditorOffsetPositionsFirst",It="scheduler.recurrenceEditorOffsetPositionsSecond",Rt="scheduler.recurrenceEditorOffsetPositionsThird",Tt="scheduler.recurrenceEditorOffsetPositionsFourth",xt="scheduler.recurrenceEditorOffsetPositionsLast",At="scheduler.recurrenceEditorWeekdaysDay",Mt="scheduler.recurrenceEditorWeekdaysWeekday",Nt="scheduler.recurrenceEditorWeekdaysWeekendday",Lt="scheduler.recurrenceEditorEndAfter",zt="scheduler.recurrenceEditorEndOccurrence",_t="scheduler.recurrenceEditorEndLabel",Ft="scheduler.recurrenceEditorEndNever",Ot="scheduler.recurrenceEditorEndOn",Wt="scheduler.editorDelete",Pt="scheduler.deleteConfirmation",Ht="scheduler.deleteSeriesConfirmation",$t="scheduler.deleteRecurringConfirmation",Kt="scheduler.deleteOccurrence",Bt="scheduler.deleteSeries",Vt="scheduler.deleteDialogTitle",Gt="scheduler.deleteSeriesDialogTitle",Ut="scheduler.deleteRecurringDialogTitle",qt="scheduler.dateTitle",Zt="scheduler.timeTitle",Yt="scheduler.eventTitle",jt="scheduler.editorValidationRequired",Xt="scheduler.editorValidationStart",Qt="scheduler.editorValidationEnd",Jt="scheduler.noEvents",er="scheduler.popoverEvents",tr="scheduler.moreEvents",rr="scheduler.resetTimezoneDialogTitle",ar="scheduler.resetTimezoneConfirmation",nr="scheduler.resetTimezoneNo",lr="scheduler.resetTimezoneYes",or="scheduler.recurrenceEditorDialogTitle",sr="scheduler.recurrenceEditorRemoveRecurrence",cr="scheduler.removeRecurrenceConfirmation",ir="scheduler.removeRecurrenceNo",ur="scheduler.removeRecurrenceYes",dr="scheduler.recurrenceCustomEventsDialogTitle",mr="scheduler.recurrenceCustomEventsConfirmation",pr="scheduler.recurrenceCustomEventsKeep",gr="scheduler.recurrenceCustomEventsReset",vr="scheduler.recurrenceCustomEventsCancel",Er="scheduler.recurrenceEditorWeeklyRepeatOnDays",hr="scheduler.editorMakeRecurring",yr="scheduler.editorEditRecurrence",fr="scheduler.editorTimezoneButton",kr="scheduler.editorSetTimezoneTitle",Dr="scheduler.editorResetTimezoneTitle",Cr="scheduler.editorResetTimezoneAriaLabel",br="scheduler.editorStartTimeAriaLabel",Sr="scheduler.editorEndTimeAriaLabel",wr="scheduler.editorDateConnectorFrom",Ir="scheduler.editorDateConnectorTo",Rr="scheduler.editorNewEvent",Tr="scheduler.editorEditEvent",xr="scheduler.toolbarLabel",Ar="scheduler.quickCreateSave",Mr="scheduler.quickCreateMoreOptions",Nr="scheduler.quickCreateCancel",Lr="scheduler.overviewPopoverEdit",zr="scheduler.overviewPopoverDelete",_r={[jt]:"Field is required.",[Xt]:"Start time must be before End time.",[Qt]:"End time must be after Start time.",[Ae]:"All events",[Me]:"all day",[Ne]:"Today",[Oe]:"Day",[We]:"Month",[ze]:"Week",[_e]:"Work Week",[Le]:"Timeline",[Fe]:"Agenda",[Pe]:"Delete",[He]:"Previous",[$e]:"Next",[Ke]:"Show full day",[Be]:"Show business hours",[Ve]:"Edit current occurrence",[Ge]:"Edit the series",[Ue]:"Do you want to edit only this event occurrence or the whole series?",[qe]:"Edit Recurring Item",[Ze]:"Save",[Ye]:"Cancel",[Wt]:"Delete",[je]:"Event",[Xe]:"Title",[Qe]:"Start",[Je]:"Start Time Zone",[et]:"End",[tt]:"End Time Zone",[rt]:"All Day",[at]:"Description",[nt]:"End in different Time Zone",[lt]:"Specify Time Zone",[ot]:"Repeats every",[st]:"day(s)",[ct]:"Repeats every",[it]:"week(s)",[ut]:"Repeats every",[dt]:"On",[mt]:"Day",[pt]:"month(s)",[gt]:"Repeats every",[vt]:"On",[Et]:"of",[ht]:"Repeats every",[yt]:"On",[ft]:"year(s)",[kt]:"Day",[Dt]:"Month",[Ct]:"Never",[bt]:"Week",[St]:"Year",[wt]:"First",[It]:"Second",[Rt]:"Third",[Tt]:"Fourth",[xt]:"Last",[At]:"Day",[Mt]:"Weekday",[Nt]:"Weekend Day",[Lt]:"After",[zt]:"occurrence(s)",[_t]:"Ends",[Ft]:"Never",[Ot]:"On",[Pt]:"Are you sure you want to delete this event?",[Ht]:"Are you sure you want to delete this series?",[$t]:"Do you want to delete only this event occurrence or the whole series?",[Kt]:"Delete current occurrence",[Bt]:"Delete the series",[Vt]:"Delete Event",[Gt]:"Delete Series",[Ut]:"Delete Recurring Item",[qt]:"Date",[Zt]:"Time",[Yt]:"Event",[Jt]:"no events",[er]:"Events",[tr]:"more",[rr]:"Reset time zone",[ar]:"Do you want to reset the time zone?",[nr]:"No",[lr]:"Yes",[or]:"Recurrence",[sr]:"Remove recurrence",[cr]:"Do you want to remove the recurrence?",[ir]:"No",[ur]:"Yes",[dr]:"Keep or reset custom events?",[mr]:"Some events in this series have been edited separately. Choose whether to keep those custom events, or reset them to match the updated series?",[pr]:"Keep custom events",[gr]:"Reset custom events",[vr]:"Cancel",[Er]:"Repeat on days",[hr]:"Make recurring",[yr]:"Edit recurrence",[fr]:"Time zone",[kr]:"Set Timezone",[Dr]:"Reset Timezone",[Cr]:"Reset timezone",[br]:"Start time",[Sr]:"End time",[wr]:"from",[Ir]:"to",[Rr]:"New event",[Tr]:"Edit event",[xr]:"Toolbar",[Ar]:"Save",[Mr]:"More options",[Nr]:"Cancel",[Lr]:"Edit",[zr]:"Delete"},Fr=k.forwardRef((e,t)=>{var r;const{level:l=0,...c}=e,m=k.useRef(null),p=k.useRef(null);k.useImperativeHandle(t,()=>m.current);const{timezone:g}=le(),v=a.ZonedDate.fromLocalDate(c.value,g),E=a.getDate(v),[h,y]=k.useState(!1),[f,D]=k.useState(!1),C=o.useInternationalization(),{dateFormat:b,shortDateFormat:S}=k.useContext(ue),w=ge(),[I]=ye(),R=w.end.getTime()-w.start.getTime()>23328e5,T=C.format(b,R?I:w.zonedStart,R?I:w.zonedEnd.addDays(-1)),x=C.format(S,R?I:w.zonedStart,R?I:w.zonedEnd.addDays(-1)),A=k.useCallback(()=>{y(!h)},[h]),M=k.useCallback(()=>{D(!0)},[]),N=k.useCallback(()=>{y(!1),D(!1)},[]),L=k.useCallback(e=>{if(c.onChange){const t=a.ZonedDate.fromUTCDate(F(e.value),g);c.onChange({...e,value:t})}y(!1)},[c,g]);k.useEffect(()=>{h&&f&&p.current&&p.current.focus()},[f,h]);const{onFocus:z,onBlur:_}=n.useAsyncFocusBlur({onFocus:M,onBlur:N});return k.createElement(k.Fragment,null,k.createElement(s.Button,{ref:m,onFocus:z,onBlur:_,fillMode:"flat",className:"k-nav-current k-toolbar-button",icon:"calendar",svgIcon:d.calendarIcon,"aria-live":"polite",tabIndex:-1,onClick:A},l>=2?x:T),k.createElement(u.Popup,{anchor:null==(r=m.current)?void 0:r.element,show:h},k.createElement(i.Calendar,{ref:p,onFocus:z,onBlur:_,onChange:L,value:E})))});Fr.displayName="KendoReactSchedulerNavigationDatePicker";const Or=k.forwardRef((e,t)=>{const r=e,{level:a=0}=r,l=se(),[c,i]=Ce(),u=l.find(e=>e.props.name===c),m=o.useLocalization(),p=k.useCallback(e=>{i&&(e.syntheticEvent.preventDefault(),i(e.item.name))},[i]),g=k.useCallback(e=>{i&&i(e)},[i]),v=k.useMemo(()=>l.map(e=>({value:e.props.name,text:"function"==typeof e.props.title?e.props.title(m):e.props.title,tabIndex:-1})),[l,m]);return a>=1&&u?k.createElement(s.DropDownButton,{className:"k-toolbar-menu-button",fillMode:"flat",onItemClick:p,popupSettings:{popupClass:"k-scheduler-toolbar"},textField:"title",items:l.map(e=>({...e.props,selected:e.props.name===c,title:"function"==typeof e.props.title?e.props.title(m):e.props.title})),text:"function"==typeof u.props.title?u.props.title(m):u.props.title,endIcon:k.createElement("span",{className:"k-menu-button-arrow k-button-arrow"},k.createElement(n.SvgIcon,{icon:d.chevronDownIcon}))}):k.createElement(s.SegmentedControl,{className:"k-scheduler-views",role:"group",value:c,onChange:g,items:v})});Or.displayName="KendoReactSchedulerViewSelectorList";const Wr=e=>{const{onChange:t,data:r,validationMessage:a,visited:n,touched:o,modified:s,...c}=e,[i,u]=k.useState(r);k.useEffect(()=>{u(r)},[r]);const d=k.useCallback(e=>{t&&t({value:e.value})},[t]),m=k.useCallback(e=>{const t=e.filter;u(l.filterBy(r||[],t))},[r]);return k.createElement(h.DropDownList,{popupSettings:{width:360},data:i,onChange:d,filterable:!0,onFilterChange:m,...c})},Pr=e=>{const{value:t,data:r,onChange:a,...n}=e,l=k.useCallback(e=>{a&&a.call(void 0,e.currentTarget.dataset.value)},[a]);return k.createElement(s.ButtonGroup,{className:"k-scheduler-recurrence-repeat",width:"100%",...n},r.map(e=>k.createElement(s.Button,{type:"button",key:e.value,selected:e.value===t,onClick:l,"data-value":e.value,togglable:!0},e.text)))},Hr=e=>e.charAt(0).toUpperCase()+e.slice(1),$r=["first","second","third","fourth","last"],Kr=["never","daily","weekly","monthly","yearly"],Br=[{day:0,offset:0},{day:1,offset:0},{day:2,offset:0},{day:3,offset:0},{day:4,offset:0},{day:5,offset:0},{day:6,offset:0}],Vr=[{day:1,offset:0},{day:2,offset:0},{day:3,offset:0},{day:4,offset:0},{day:5,offset:0}],Gr=[{day:0,offset:0},{day:6,offset:0}],Ur=e=>{switch(e){case"day":return Br;case"weekday":return Vr;case"weekend":return Gr}},qr=e=>g.parseRule({recurrenceRule:e})||{},Zr=e=>_(e)&&!(e=>(e=>null==e)(e)||e.trim&&0===e.trim().length)(e.freq)?e.freq:"never",Yr=e=>e.dateFormatNames({type:"months",nameType:"wide",standAlone:!0}).map((e,t)=>({text:e,value:t+1})),jr=e=>{const t=e.firstDay(),r=e.dateFormatNames({type:"days",nameType:"abbreviated"}).map((e,t)=>({text:e,value:t}));return r.slice(t).concat(r.slice(0,t))},Xr=(e,t,r)=>{var a;let n;if(_(t.byWeekDay))switch(t.byWeekDay.length){case 7:n="day";break;case 5:n="weekday";break;case 2:n="weekend";break;case 1:n=t.byWeekDay[0].day;break;default:n=r.getDay()}else n=r.getDay();return null!=(a=e.find(e=>n===e.value))?a:e[0]},Qr=(e,t)=>{const r=e.firstDay(),a=e.dateFormatNames({type:"days",nameType:"wide"}).map((e,t)=>({text:e,value:t})),n=a.slice(r).concat(a.slice(0,r));return[{text:t("WeekdaysDay"),value:"day"},{text:t("WeekdaysWeekday"),value:"weekday"},{text:t("WeekdaysWeekendday"),value:"weekend"}].concat(n)},Jr=(e,t)=>e.find(e=>e.value===(t.bySetPosition?t.bySetPosition[0]:t.byWeekDay&&t.byWeekDay[0]?t.byWeekDay[0].offset:1))||e[0],ea=e=>{const t=[1,2,3,4,-1];return $r.map((r,a)=>({text:e("OffsetPositions"+Hr(r)),value:t[a]}))},ta=e=>_(e.count)?"count":_(e.until)?"until":"never",ra=e=>_(e.byWeekDay)?"weekday":_(e.byMonthDay)?"monthday":void 0,aa=(e,t)=>e.find(e=>(t.byMonth?t.byMonth[0]:null)===e.value)||e[0],na=(e,t)=>_(e.byMonthDay)&&e.byMonthDay.length>0?e.byMonthDay[0]:t.getDate(),la=(e,t)=>a.ZonedDate.fromUTCDate(new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),23,59,59)),t),oa=e=>{const{value:t,data:r,onChange:a,...n}={...sa,...e},l=r=>{const a=Number(r.currentTarget.dataset.key);e.onChange&&e.onChange.call(void 0,t.some(e=>e===a)?t.filter(e=>e!==a):[...t,a])};return k.createElement(s.ButtonGroup,{width:"auto",...n},(e.data||sa.data).map(e=>k.createElement(s.Button,{type:"button",key:e.value,"data-key":e.value,selected:t.some(t=>t===e.value),togglable:!0,onClick:l},Hr(e.text))))},sa={data:[],value:[]},ca=e=>{const t=o.useInternationalization(),r=o.useLocalization(),{timezone:n}=le(),[l,s]=k.useState(1),[c,u]=k.useState(la(e.start,e.timezone)),d=k.useCallback((e,t)=>{const a=t?e:"scheduler.recurrenceEditor"+e;return r.toLanguageString(a,_r[a])},[r]),p=k.useMemo(()=>{var t;return qr(null!=(t=e.value)?t:ua.value)},[e.value]),y=k.useMemo(()=>(e=>Kr.map(t=>({value:t,text:e("Frequencies"+Hr(t))})))(d),[d]),f=k.useMemo(()=>Zr(p),[p]),D=k.useMemo(()=>Qr(t,d),[t,d]),C=k.useMemo(()=>Xr(D,p,e.start),[D,p,e.start]),b=k.useMemo(()=>Yr(t),[t]),S=k.useMemo(()=>aa(b,p),[b,p]),w=k.useMemo(()=>ea(d),[d]),I=k.useMemo(()=>Jr(w,p),[w,p]),R=k.useMemo(()=>ta(p),[p]),T=k.useMemo(()=>na(p,e.start),[p,e.start]),x=k.useMemo(()=>(e=>_(e.until)?a.toLocalDate(e.until):null)(p),[p.until]),A=k.useMemo(()=>jr(t),[t]),M=k.useMemo(()=>ra(p),[p.byWeekDay,p.byMonthDay]),N=k.useCallback(r=>{"never"===r.freq?e.onChange({value:null}):(void 0===r.weekStart&&(r.weekStart=t.firstDay()),e.onChange({value:g.serializeRule(r,e.timezone)}))},[e.onChange,e.timezone]),L=k.useCallback(t=>{const r={};r.freq=t,r.interval=1,"weekly"===t&&(r.byWeekDay=[{day:a.ZonedDate.fromLocalDate(e.start,n).getDay(),offset:0}]),("monthly"===t||"yearly"===t)&&(r.byMonthDay=[e.start.getDate()]),"yearly"===t&&(r.byMonth=[e.start.getMonth()+1]),N(r)},[N,e.start,n]),z=k.useCallback(e=>{const t=e.value;N(Object.assign({},p,{interval:t}))},[N,p]),F=k.useCallback(e=>{const t=e.value;N(Object.assign({},p,{count:t})),null!==t&&s(t)},[N,p]),O=k.useCallback(t=>{const r=t.value;if(!r)return;const a=la(r,e.timezone);N(Object.assign({},p,{until:a})),u(a)},[N,p,e.timezone]),W=k.useCallback(e=>{N(Object.assign({},p,{byWeekDay:A.filter(t=>e.some(e=>e===t.value)).map(e=>({offset:0,day:e.value}))}))},[N,p,A]),P=k.useCallback(e=>{const t=Object.assign({},p),r=e.target.value;"string"==typeof r.value?(t.byWeekDay=Ur(r.value),t.bySetPosition=[I.value]):(t.bySetPosition=void 0,t.byWeekDay=[{day:r.value,offset:I.value}]),N(t)},[I.value,N,p]),H=k.useCallback(e=>{N(Object.assign({},p,{byMonthDay:[e.value]}))},[N,p]),$=k.useCallback(e=>{const t=e.value;N(Object.assign({},p,{byMonth:[t.value]}))},[N,p]),K=k.useCallback(e=>{const t=e.value,r=Object.assign({},p);switch(t){case"never":r.until=void 0,r.count=void 0;break;case"count":r.until=void 0,r.count=l;break;case"until":r.until=c,r.count=void 0}N(r)},[N,p,e.timezone]),B=k.useCallback(e=>{const t=Object.assign({},p);"monthday"===e.value?(t.byWeekDay=void 0,t.bySetPosition=void 0,t.byMonthDay=[T]):"weekday"===e.value&&(t.byMonthDay=void 0,"string"==typeof C.value?(t.bySetPosition=[I.value],t.byWeekDay=Ur(C.value)):t.byWeekDay=[{day:C.value,offset:I.value}]),N(t)},[N,p,T,C]),V=k.useCallback(e=>{const t=Object.assign({},p),r=e.value;if(t.byWeekDay)switch(t.byWeekDay.length){case 7:case 5:case 2:t.bySetPosition=[r.value];break;case 1:t.byWeekDay[0].offset=r.value}N(t)},[N,p]);return k.createElement(k.Fragment,null,k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},r.toLanguageString(ot,_r[ot])),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(Pr,{value:f,data:y,onChange:L}))),"never"!==f&&k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{editorId:"interval-editor",className:"k-form-label"},d(Hr(f)+"RepeatEvery")),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(E.NumericTextBox,{min:1,step:1,defaultValue:1,value:p.interval,onChange:z,id:"interval-editor",className:"k-recur-interval"})," ",k.createElement(v.Label,{editorId:"interval-editor",className:"k-form-label"},d(Hr(f)+"Interval")))),"weekly"===f&&k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},d(dt,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(oa,{data:A,value:(p.byWeekDay||[]).map(({day:e})=>e),onChange:W}))),"monthly"===f&&k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{key:"recurrence-repeat-on-monthly-label",className:"k-form-label"},d(vt,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(E.RadioGroup,{value:M,onChange:B,item:ia,className:"k-reset",data:[{value:"monthday",label:d(mt,!0),children:[k.createElement(k.Fragment,{key:"separator"}," "),k.createElement(E.NumericTextBox,{key:"weekday-day",min:1,max:31,disabled:"monthday"!==M,value:p&&p.byMonthDay&&p.byMonthDay[0],onChange:H,width:"auto"})]},{value:"weekday",label:" ",children:[k.createElement(h.DropDownList,{key:"weekday-offset",textField:"text",dataItemKey:"value",disabled:"weekday"!==M,data:w,value:I,onChange:V,style:{width:"auto"}}),k.createElement(k.Fragment,{key:"separator"}," "),k.createElement(h.DropDownList,{key:"weekday-value",disabled:"weekday"!==M,value:C,data:D,onChange:P,textField:"text",dataItemKey:"value",style:{width:"auto"}})]}]}))),"yearly"===f&&k.createElement(m.FieldWrapper,null,k.createElement(v.Label,null,d(yt,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(E.RadioGroup,{value:M,item:ia,onChange:B,className:"k-reset",data:[{value:"monthday",label:" ",children:[k.createElement(h.DropDownList,{key:"monthday-month",disabled:"monthday"!==M,value:S,data:b,textField:"text",dataItemKey:"value",onChange:$,style:{width:"auto"}}),k.createElement(k.Fragment,{key:"separator"}," "),k.createElement(E.NumericTextBox,{key:"monthday-day",min:1,max:31,disabled:"monthday"!==M,value:T,onChange:H,width:"auto"})]},{value:"weekday",label:" ",children:[k.createElement(h.DropDownList,{key:"yearly-weekday-offset",textField:"text",dataItemKey:"value",disabled:"weekday"!==M,data:w,value:I,onChange:V,style:{width:"auto"}}),k.createElement(k.Fragment,{key:"yearly-separator-1"}," "),k.createElement(h.DropDownList,{key:"yearly-weekday-day",textField:"text",dataItemKey:"value",disabled:"weekday"!==M,value:C,data:D,onChange:P,style:{width:"auto"}}),k.createElement(k.Fragment,{key:"yearly-separator-2"}," "),k.createElement("span",{key:"yearly-weekday-of-label"},d(Et,!0)),k.createElement(k.Fragment,{key:"yearly-separator-3"}," "),k.createElement(h.DropDownList,{key:"yearly-weekday-month",textField:"text",dataItemKey:"value",disabled:"weekday"!==M,value:S,data:b,onChange:$,style:{width:"auto"}})]}]}))),"never"!==f&&k.createElement("div",{className:"k-scheduler-recurrence-end-rule-editor"},k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},d(_t,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(E.RadioGroup,{item:ia,value:R,onChange:K,data:[{value:"never",label:d(Ft,!0)},{value:"count",label:d(Lt,!0),children:[k.createElement(k.Fragment,{key:"separator-1"}," "),k.createElement(E.NumericTextBox,{key:"endrule-after-editor",id:"k-endrule-after",className:"k-recur-count",min:1,width:"auto",value:"count"===R?p.count:l,onChange:F,disabled:"count"!==R}),k.createElement(k.Fragment,{key:"separator-2"}," "),k.createElement(v.Label,{key:"endrule-after-label",className:"k-radio-label",editorId:"k-endrule-after"},d(zt,!0))]},{value:"until",label:d(Ot,!0),children:[k.createElement(k.Fragment,{key:"separator"}," "),k.createElement(i.DatePicker,{key:"k-endrule-until-editor",id:"k-endrule-until",disabled:"until"!==R,min:e.start,value:"until"===R?x:a.toLocalDate(c),onChange:O,width:"auto"})]}]})))))},ia=e=>k.createElement("li",{...e},e.children),ua={value:""};ca.displayName="KendoReactSchedulerRepeatEditor";const da=(e,t)=>{if(e){if(!t)return e;const r=a.toLocalDate(a.ZonedDate.fromLocalDate(e,t).toUTCDate());return r.setUTCFullYear(e.getFullYear()),r}return e},ma=(e,t)=>{if(e){if(!t)return e;const r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),a.ZonedDate.fromUTCDate(r,t).toLocalDate()}return e},pa={minute:15},ga=(e,t)=>!(!e||(null==t?void 0:t.getFullYear())!==e.getFullYear()||t.getMonth()!==e.getMonth()||t.getDate()!==e.getDate()),va=e=>{const{value:t,onChange:r,isAllDay:a,connector:n,connectorElement:l,dateId:o,timeId:s,fieldError:c,ariaLabel:u,timeAriaLabel:d,min:m,max:p,steps:g=pa}=e,{timezone:v}=le(),E=k.useMemo(()=>t?da(t,v):null,[t,v]),h=k.useMemo(()=>m?da(m,v):void 0,[m,v]),y=k.useMemo(()=>p?da(p,v):void 0,[p,v]),f=ga(E,h)?h:void 0,D=ga(E,y)?y:void 0,C=k.useCallback(e=>{if(!e.value||!r)return;const t=new Date(e.value);E&&t.setHours(E.getHours(),E.getMinutes(),E.getSeconds()),r({value:ma(t,v)})},[r,E,v]),b=k.useCallback(e=>{if(!e.value||!r)return;const t=new Date(E||new Date);t.setHours(e.value.getHours(),e.value.getMinutes(),0,0),r({value:ma(t,v)})},[r,E,v]),S=!!c;return a?k.createElement(i.DatePicker,{id:o,value:E,onChange:C,valid:!S,ariaLabel:u,min:h,max:y}):k.createElement(k.Fragment,null,k.createElement(i.DatePicker,{id:o,value:E,onChange:C,valid:!S,ariaLabel:u,min:h,max:y}),l||n&&k.createElement("span",{className:"k-scheduler-datetime-label"},n),k.createElement(i.TimePicker,{id:s,value:E,onChange:b,valid:!S,ariaLabel:d,min:f,max:D,steps:g}))};function Ea(e,t,r,n){var l,o,s,c,i,u;if(!e)return"";const d=e=>n.toLanguageString(e,_r[e]),m=(e,t)=>{const r=t?e:"scheduler.recurrenceEditor"+e;return n.toLanguageString(r,_r[r])},p=qr(e);if(!p.freq||"never"===p.freq)return"";const g=jr(r),v=Qr(r,m),E=Xr(v,p,t),h=Yr(r),y=aa(h,p),f=ea(m),k=Jr(f,p),D=na(p,t),C=ra(p),b=p.interval||1,S=d(ot),w=d(dt).toLowerCase(),I=d(vt).toLowerCase(),R=d(yt).toLowerCase(),T=d(_t).toLowerCase();let x="";switch(p.freq){case"daily":x=`${S} ${b} ${d(st)}`;break;case"weekly":{const e=(p.byWeekDay||[]).map(({day:e})=>{var t;return null==(t=g.find(t=>t.value===e))?void 0:t.text}).filter(Boolean).join(", ");x=`${S} ${b} ${d(it)}`,e&&(x+=` ${w} ${e}`);break}case"monthly":{const e=`${S} ${b} ${d(pt)}`;if("weekday"===C&&null!=(l=p.byWeekDay)&&l.length){const t="string"==typeof E.value?E.text.toLowerCase():E.text;x=`${e} ${I} ${k.text.toLowerCase()} ${t}`}else{const t=null!=(s=null==(o=p.byMonthDay)?void 0:o[0])?s:D;x=`${e} ${I} ${d(mt).toLowerCase()} ${t}`}break}case"yearly":{const e=`${S} ${b} ${d(ft)}`;if("weekday"===C&&null!=(c=p.byWeekDay)&&c.length){const t="string"==typeof E.value?E.text.toLowerCase():E.text;x=`${e} ${R} ${k.text.toLowerCase()} ${t} ${d(Et)} ${y.text}`}else{const t=null!=(u=null==(i=p.byMonthDay)?void 0:i[0])?u:D;x=`${e} ${R} ${y.text} ${t}`}break}}return p.count?x+=` ${T} ${d(Lt).toLowerCase()} ${p.count} ${d(zt)}`:p.until&&(x+=` ${T} ${d(Ot).toLowerCase()} ${r.formatDate(a.toLocalDate(p.until),"D")}`),x}const ha=e=>{const{value:t,start:r,timezone:l,onSave:c,onCancel:u,onRemoveRecurrence:d,recurrenceSummaryTemplate:y,recurrenceEditor:f}=e,C=o.useInternationalization(),b=o.useLocalization(),S=ie(),w=k.useCallback((e,t)=>{const r=t?e:"scheduler.recurrenceEditor"+e;return b.toLanguageString(r,_r[r])},[b]),[I,R]=k.useState(()=>{const e=qr(null!=t?t:"");return e.freq?e:{freq:"daily",interval:1}}),[T,x]=k.useState(1),A=k.useRef(!1),[M,N]=k.useState(()=>la(r,l)),[L]=k.useState(r),z=k.useRef(null),_=k.useMemo(()=>Zr(I),[I]),F=k.useMemo(()=>jr(C),[C]),O=k.useMemo(()=>Qr(C,w),[C,w]),W=k.useMemo(()=>Xr(O,I,L),[O,I,L]),P=k.useMemo(()=>Yr(C),[C]),H=k.useMemo(()=>aa(P,I),[P,I]),$=k.useMemo(()=>ea(w),[w]),K=k.useMemo(()=>Jr($,I),[$,I]),B=k.useMemo(()=>ta(I),[I]),V=k.useMemo(()=>na(I,L),[I,L]),G=k.useMemo(()=>I.until?a.toLocalDate(I.until):null,[I.until]),U=k.useMemo(()=>ra(I),[I.byWeekDay,I.byMonthDay]),q=!!t,Z=b.toLanguageString(Ze,_r[Ze]),Y=b.toLanguageString(Ye,_r[Ye]),j=k.useCallback(e=>{R({...e})},[]),X=k.useCallback(e=>{const t={};t.freq=e,t.interval=1,"weekly"===e&&(t.byWeekDay=[{day:a.ZonedDate.fromLocalDate(L,l).getDay(),offset:0}]),("monthly"===e||"yearly"===e)&&(t.byMonthDay=[L.getDate()]),"yearly"===e&&(t.byMonth=[L.getMonth()+1]),j(t)},[L,l,j]),Q=k.useCallback(e=>{var t;j({...I,interval:null!=(t=e.value)?t:1})},[I,j]),J=k.useCallback(e=>{const t=e.value;null!==t?(A.current=!1,j({...I,count:t}),x(t)):A.current=!0},[I,j]),ee=k.useCallback(()=>{A.current&&(A.current=!1,x(1),j({...I,count:1}))},[I,j]),te=k.useCallback(e=>{if(!e.value)return;const t=la(e.value,l);j({...I,until:t}),N(t)},[I,l,j]),re=k.useCallback(e=>{j({...I,byWeekDay:F.filter(t=>e.some(e=>e===t.value)).map(e=>({offset:0,day:e.value}))})},[I,F,j]),ae=k.useCallback(e=>{const t={...I},r=e.target.value;"string"==typeof r.value?(t.byWeekDay=Ur(r.value),t.bySetPosition=[K.value]):(t.bySetPosition=void 0,t.byWeekDay=[{day:r.value,offset:K.value}]),j(t)},[K.value,I,j]),ne=k.useCallback(e=>{var t;j({...I,byMonthDay:[null!=(t=e.value)?t:1]})},[I,j]),le=k.useCallback(e=>{j({...I,byMonth:[e.value.value]})},[I,j]),oe=k.useCallback(e=>{const t=e.value.value,r={...I};switch(t){case"never":r.until=void 0,r.count=void 0;break;case"count":r.until=void 0,r.count=T;break;case"until":r.until=M,r.count=void 0}j(r)},[I,T,M,j]),se=k.useCallback(e=>{const t={...I};"monthday"===e.value?(t.byWeekDay=void 0,t.bySetPosition=void 0,t.byMonthDay=[V]):"weekday"===e.value&&(t.byMonthDay=void 0,"string"==typeof W.value?(t.bySetPosition=[K.value],t.byWeekDay=Ur(W.value)):t.byWeekDay=[{day:W.value,offset:K.value}]),j(t)},[I,V,W,K.value,j]),ce=k.useCallback(e=>{const t={...I},r=e.value;if(t.byWeekDay)switch(t.byWeekDay.length){case 7:case 5:case 2:t.bySetPosition=[r.value];break;case 1:t.byWeekDay[0].offset=r.value}j(t)},[I,j]),ue=k.useCallback(e=>{const t=e.value.value;X(t)},[X]),de=k.useMemo(()=>[{text:w(kt,!0),value:"daily"},{text:w(bt,!0),value:"weekly"},{text:w(Dt,!0),value:"monthly"},{text:w(St,!0),value:"yearly"}],[w]),me=k.useMemo(()=>[{text:w(Ft,!0),value:"never"},{text:w(Lt,!0),value:"count"},{text:w(Ot,!0),value:"until"}],[w]),pe=k.useMemo(()=>de.find(e=>e.value===_)||de[0],[de,_]),ge=k.useMemo(()=>me.find(e=>e.value===B)||me[0],[me,B]),ve=k.useMemo(()=>{const e=C.firstDay(),t=C.dateFormatNames({type:"days",nameType:"narrow"}),r=C.dateFormatNames({type:"days",nameType:"wide"}),a=t.map((e,t)=>({narrow:e,wide:r[t],value:t}));return a.slice(e).concat(a.slice(0,e))},[C]),Ee=k.useMemo(()=>(I.byWeekDay||[]).map(({day:e})=>e),[I.byWeekDay]),he=k.useCallback(e=>{const t=Ee.includes(e)?Ee.filter(t=>t!==e):[...Ee,e];re(t)},[Ee,re]),ye=k.useCallback(()=>{var e;if(f){const t=(null==(e=z.current)?void 0:e.call(z,S.recurrenceRule))||null;c(t)}else"never"!==I.freq&&I.freq?(void 0===I.weekStart&&(I.weekStart=C.firstDay()),c(g.serializeRule(I,l))):c(null)},[f,I,l,C,c]),fe=k.useCallback(()=>{u()},[u]),ke=k.useMemo(()=>{if(!I.freq||"never"===I.freq)return"";return Ea(g.serializeRule(I,l),L,C,b)},[I,l,L,C,b]),De=k.useMemo(()=>I.freq&&"never"!==I.freq?g.serializeRule(I,l):null,[I,l]),Ce=k.useMemo(()=>De?g.parseRule({recurrenceRule:De}):null,[De]),be=k.createElement(p.Dialog,{title:w(or,!0),onClose:fe,width:540},f?k.createElement(m.Form,{initialValues:{[S.recurrenceRule]:t||""},render:e=>(z.current=e.valueGetter,k.createElement(m.FormElement,{horizontal:!0},k.createElement(m.Field,{name:S.recurrenceRule,field:S.recurrenceRule,component:f,start:L})))}):k.createElement(m.Form,{render:()=>{var e;return k.createElement(m.FormElement,{horizontal:!0},k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{editorId:"recurrence-interval",className:"k-form-label"},w(ot,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-scheduler-recurrence-fields"},"never"!==_&&k.createElement(E.NumericTextBox,{id:"recurrence-interval",min:1,step:1,defaultValue:1,value:I.interval,onChange:Q}),k.createElement(h.DropDownList,{data:de,textField:"text",dataItemKey:"value",value:pe,onChange:ue})))),"weekly"===_&&k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},w(dt,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-scheduler-weekday-picker",role:"group","aria-label":w(Er,!0)},ve.map(e=>k.createElement(s.Button,{key:e.value,type:"button",themeColor:"primary",fillMode:"flat",rounded:"full",togglable:!0,selected:Ee.includes(e.value),"aria-label":e.wide,"aria-pressed":Ee.includes(e.value),onClick:()=>he(e.value)},e.narrow))))),"monthly"===_&&k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},w(vt,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(E.RadioGroup,{value:U,onChange:se,className:"k-reset",data:[{value:"weekday",label:" ",children:[k.createElement("div",{key:"weekday-fields",className:"k-scheduler-recurrence-fields"},k.createElement(h.DropDownList,{textField:"text",dataItemKey:"value",disabled:"weekday"!==U,data:$,value:K,onChange:ce}),k.createElement(h.DropDownList,{disabled:"weekday"!==U,value:W,data:O,onChange:ae,textField:"text",dataItemKey:"value"}))]},{value:"monthday",label:" ",children:[k.createElement("div",{key:"monthday-fields",className:"k-scheduler-recurrence-fields"},k.createElement(E.NumericTextBox,{min:1,max:31,disabled:"monthday"!==U,value:V,onChange:ne,width:"auto"}))]}]}))),"yearly"===_&&k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},w(yt,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(E.RadioGroup,{value:U,onChange:se,className:"k-reset",data:[{value:"monthday",label:" ",children:[k.createElement("div",{key:"monthday-fields",className:"k-scheduler-recurrence-fields"},k.createElement(h.DropDownList,{disabled:"monthday"!==U,value:H,data:P,textField:"text",dataItemKey:"value",onChange:le}),k.createElement(E.NumericTextBox,{min:1,max:31,disabled:"monthday"!==U,value:V,onChange:ne,width:"auto"}))]},{value:"weekday",label:" ",children:[k.createElement("div",{key:"weekday-fields",className:"k-scheduler-recurrence-fields"},k.createElement(h.DropDownList,{textField:"text",dataItemKey:"value",disabled:"weekday"!==U,data:$,value:K,onChange:ce}),k.createElement(h.DropDownList,{textField:"text",dataItemKey:"value",disabled:"weekday"!==U,value:W,data:O,onChange:ae}),k.createElement("span",{key:"of-row",className:"k-scheduler-edit-form-row"},k.createElement("span",null,w(Et,!0)),k.createElement(h.DropDownList,{textField:"text",dataItemKey:"value",disabled:"weekday"!==U,value:H,data:P,onChange:le})))]}]}))),"never"!==_&&k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},w(_t,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-scheduler-recurrence-fields"},k.createElement(h.DropDownList,{data:me,textField:"text",dataItemKey:"value",value:ge,onChange:oe}),"count"===B&&k.createElement(E.NumericTextBox,{min:1,width:"auto",value:null!=(e=I.count)?e:T,onChange:J,onBlur:ee,format:`0 '${w(zt,!0)}'`}),"until"===B&&k.createElement(i.DatePicker,{min:L,value:null!=G?G:a.toLocalDate(M),onChange:te,width:"auto"})))),"never"!==_&&(y&&De?k.createElement(m.FieldWrapper,null,k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-form-hint k-scheduler-recurrence-summary",title:ke||void 0},k.createElement(y,{recurrenceRule:De,text:ke||"",parsedRule:Ce})))):ke?k.createElement(m.FieldWrapper,null,k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-form-hint k-scheduler-recurrence-summary",title:ke},ke))):null))}}),k.createElement(p.DialogActionsBar,{layout:"end"},q&&d&&k.createElement(s.Button,{fillMode:"flat",themeColor:"primary",onClick:d},w(sr,!0)),k.createElement(s.Button,{onClick:fe},Y),k.createElement(s.Button,{themeColor:"primary",onClick:ye},Z)));return n.canUseDOM?D.createPortal(be,document.body):null};ha.displayName="KendoReactSchedulerRecurrenceDialog";const ya=e=>{const{onConfirm:t,onCancel:r}=e,a=o.useLocalization(),l=a.toLanguageString(sr,_r[sr]),c=a.toLanguageString(cr,_r[cr]),i=a.toLanguageString(ir,_r[ir]),u=a.toLanguageString(ur,_r[ur]),d=k.createElement(p.Dialog,{title:l,onClose:r,width:400},k.createElement("p",null,c),k.createElement(p.DialogActionsBar,{layout:"end"},k.createElement(s.Button,{onClick:r},i),k.createElement(s.Button,{themeColor:"primary",onClick:t},u)));return n.canUseDOM?D.createPortal(d,document.body):null};ya.displayName="KendoReactRemoveRecurrenceConfirmDialog";const fa=k.forwardRef((e,t)=>{const r=k.useRef(null),l=k.useRef(null),c=a.timezoneNames(),i=o.useLocalization(),u=o.useInternationalization(),E=ie(),{resources:h,timezone:y}=le();k.useImperativeHandle(l,()=>{var t;return{element:null!=(t=r.current)&&t.element?r.current.element:r.current,props:e}}),k.useImperativeHandle(t,()=>l.current);const{as:f=Sa.as,...D}=e,{onChange:C,valueGetter:b}=e,{titleEditor:S=Sa.titleEditor,startEditor:w=Sa.startEditor,endEditor:I=Sa.endEditor,startTimezoneEditor:R=Sa.startTimezoneEditor,endTimezoneEditor:T=Sa.endTimezoneEditor,startLabel:x=Sa.startLabel,endLabel:A=Sa.endLabel,allDayEditor:M=Sa.allDayEditor,allDayLabel:N=Sa.allDayLabel,recurrenceEditor:L,descriptionEditor:z=Sa.descriptionEditor,resourceEditor:_=Sa.resourceEditor}=e,F=k.useMemo(()=>b(E.start)||new Date,[b,E.start]),O=b(E.start)||null,W=b(E.isAllDay)||!1,P=b(E.startTimezone)||y||"",H=b(E.recurrenceRule),$=!(null!=b(E.recurrenceId)),K=k.useMemo(()=>i.toLanguageString(rt,_r[rt]),[i]),[B,V]=k.useState(!!b(E.startTimezone)),[G,U]=k.useState(!1),[q,Z]=k.useState(!1),[Y,j]=k.useState(!1),X=e.recurrenceSummaryTemplate,Q=k.useMemo(()=>i.toLanguageString(hr,_r[hr]),[i]),J=k.useMemo(()=>i.toLanguageString(yr,_r[yr]),[i]),ee=H?J:Q,te=k.useMemo(()=>H?Ea(H,F,u,i):null,[H,F,u,i]),re=k.useId(),ae=k.useMemo(()=>H?g.parseRule({recurrenceRule:H}):null,[H]),ne=k.useRef(P);k.useEffect(()=>{B&&P&&P!==ne.current&&C(E.endTimezone,{value:P}),ne.current=P},[P,B,C,E.endTimezone]);const oe=k.useCallback(e=>{e.preventDefault(),B?U(!0):V(!0)},[B]),se=k.useCallback(()=>{C(E.startTimezone,{value:null}),C(E.endTimezone,{value:null}),V(!1),U(!1)},[C,E.startTimezone,E.endTimezone]),ce=k.useCallback(()=>{U(!1)},[]),ue=k.useCallback(()=>{Z(!0)},[]),de=k.useCallback(e=>{C(E.recurrenceRule,{value:e}),Z(!1)},[C,E.recurrenceRule]),me=k.useCallback(()=>{Z(!1)},[]),pe=k.useCallback(()=>{j(!0)},[]),ge=k.useCallback(()=>{C(E.recurrenceRule,{value:null}),C(E.recurrenceExceptions,{value:null}),j(!1),Z(!1)},[C,E.recurrenceRule,E.recurrenceExceptions]),ve=k.useCallback(()=>{j(!1)},[]),Ee=k.useCallback((e,t)=>{const r=b(E.start),a=b(E.end);if(t(e),e.value&&r&&a){const t=a.getTime()-r.getTime();C(E.end,{value:new Date(e.value.getTime()+t)})}},[b,C,E.start,E.end]),he=k.useMemo(()=>n.classNames("k-scheduler-edit-form",e.className),[e.className]);return k.createElement(k.Fragment,null,k.createElement(f,{ref:f===Sa.as?r:void 0,horizontal:!0,...D,className:he},k.createElement(k.Fragment,null,k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},k.createElement(n.SvgIcon,{icon:d.rightDoubleQuotesIcon,size:"xlarge"})),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(m.Field,{id:"k-scheduler-editor-title",name:E.title,field:E.title,component:S,placeholder:i.toLanguageString(Xe,_r[Xe]),"aria-label":i.toLanguageString(Xe,_r[Xe])}))),k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},k.createElement(n.SvgIcon,{icon:d.clockIcon,size:"xlarge"})),k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-scheduler-datetime-section"},k.createElement("div",{className:"k-scheduler-edit-form-row"},k.createElement(m.Field,{id:"k-is-allday-switch",name:E.isAllDay,component:M,onLabel:"",offLabel:"",ariaLabel:K}),k.createElement(m.Field,{name:E.isAllDay,field:E.isAllDay,editorId:"k-is-allday-switch",component:N},K)),k.createElement("div",{className:"k-scheduler-datetime-grid"},W?k.createElement("div",{className:"k-scheduler-edit-form-row"},k.createElement(m.Field,{name:E.start,component:ka,baseEditor:w,onStartChange:Ee,isAllDay:W,fieldError:e.errors[E.start],ariaLabel:i.toLanguageString(Qe,_r[Qe]),timezone:y}),k.createElement(m.Field,{name:E.end,component:A,editorId:"k-scheduler-editor-end",className:"k-scheduler-datetime-label"},i.toLanguageString(Ir,_r[Ir])),k.createElement(m.Field,{name:E.end,component:I,isAllDay:W,dateId:"k-scheduler-editor-end",min:O,fieldError:e.errors[E.end],ariaLabel:i.toLanguageString(et,_r[et]),timezone:y})):k.createElement(k.Fragment,null,k.createElement("div",{className:"k-scheduler-edit-form-row"},k.createElement(m.Field,{name:E.start,component:ka,baseEditor:w,onStartChange:Ee,isAllDay:W,timeId:"k-scheduler-editor-start-time",connectorElement:k.createElement(m.Field,{name:E.start,component:x,editorId:"k-scheduler-editor-start-time",className:"k-scheduler-datetime-label"},i.toLanguageString(wr,_r[wr])),fieldError:e.errors[E.start],ariaLabel:i.toLanguageString(Qe,_r[Qe]),timeAriaLabel:i.toLanguageString(br,_r[br]),timezone:y})),!B&&k.createElement(s.Button,{className:"k-col-span-2",fillMode:"flat",themeColor:"primary",title:i.toLanguageString(kr,_r[kr]),onClick:oe,svgIcon:d.globeIcon},i.toLanguageString(fr,_r[fr])),B&&k.createElement(k.Fragment,null,k.createElement(m.Field,{name:E.startTimezone,component:R,data:c,value:P,ariaLabel:i.toLanguageString(Je,_r[Je])}),k.createElement(s.Button,{title:i.toLanguageString(Dr,_r[Dr]),"aria-label":i.toLanguageString(Cr,_r[Cr]),onClick:oe,svgIcon:d.globeIcon,fillMode:"flat",themeColor:"primary"})),k.createElement("div",{className:"k-scheduler-edit-form-row"},k.createElement(m.Field,{name:E.end,component:I,isAllDay:W,min:O,timeId:"k-scheduler-editor-end-time",connectorElement:k.createElement(m.Field,{name:E.end,component:A,editorId:"k-scheduler-editor-end-time",className:"k-scheduler-datetime-label"},i.toLanguageString(Ir,_r[Ir])),fieldError:e.errors[E.end],ariaLabel:i.toLanguageString(et,_r[et]),timeAriaLabel:i.toLanguageString(Sr,_r[Sr]),timezone:y})),B&&k.createElement(m.Field,{name:E.endTimezone,component:T,data:c,value:b(E.endTimezone)||y||"",ariaLabel:i.toLanguageString(tt,_r[tt])}))),$&&k.createElement("div",{className:"k-scheduler-edit-form-row"},k.createElement(s.Button,{className:"k-scheduler-recurrence-button",type:"button",fillMode:"flat",themeColor:"primary",svgIcon:d.arrowRotateCwIcon,onClick:ue,"aria-describedby":H?re:void 0},ee),H&&te&&k.createElement("div",{id:re,className:"k-scheduler-recurrence-summary k-form-hint",title:te},X&&ae?k.createElement(X,{recurrenceRule:H,text:te,parsedRule:ae}):te))))),k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},k.createElement(n.SvgIcon,{icon:d.commentIcon,size:"xlarge"})),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(m.Field,{component:z,name:E.description,id:"k-event-description",resizable:"vertical",placeholder:i.toLanguageString(at,_r[at]),"aria-label":i.toLanguageString(at,_r[at])}))),(h||[]).map(e=>k.createElement(m.FieldWrapper,{key:e.field},e.svgIcon&&k.createElement(v.Label,{className:"k-form-label"},k.createElement(n.SvgIcon,{icon:e.svgIcon,size:"xlarge"})),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(m.Field,{name:e.field,component:_,resource:e,multiple:e.multiple,data:e.data,textField:e.textField,valueField:e.valueField,colorField:e.colorField,ariaLabel:e.name||e.field})))))),q&&k.createElement(ha,{value:H,start:F,timezone:y||"",onSave:de,onCancel:me,onRemoveRecurrence:pe,recurrenceSummaryTemplate:X,recurrenceEditor:L}),Y&&k.createElement(ya,{onConfirm:ge,onCancel:ve}),G&&k.createElement(p.Dialog,{title:i.toLanguageString(rr,_r[rr]),onClose:ce},i.toLanguageString(ar,_r[ar]),k.createElement(p.DialogActionsBar,null,k.createElement(s.Button,{onClick:ce},i.toLanguageString(nr,_r[nr])),k.createElement(s.Button,{themeColor:"primary",onClick:se},i.toLanguageString(lr,_r[lr])))))});fa.displayName="KendoReactSchedulerFormEditor";const ka=e=>{const{baseEditor:t,onStartChange:r,onChange:a,...n}=e,l=k.useCallback(e=>r(e,a),[r,a]);return k.createElement(t,{...n,onChange:l})};ka.displayName="SchedulerDurationPreservingEditor";const Da=k.forwardRef((e,t)=>k.createElement(m.FormElement,{ref:t,id:e.id,style:e.style,tabIndex:e.tabIndex,className:e.className,horizontal:e.horizontal,children:e.children}));Da.displayName="SchedulerFormEditorDefaultElement";const Ca=e=>{const{value:t,onChange:r,valid:a,visited:n,touched:l,modified:o,name:s,validationMessage:c,...i}=e,u=k.useCallback(e=>{r&&r({value:e.value})},[r]);return k.createElement(E.Switch,{...i,checked:t||!1,onChange:u})};Ca.displayName="SwitchFieldAdapter";const ba=e=>k.createElement(v.Label,{...e,style:{marginBottom:0,...e.style}});ba.displayName="DefaultLabel";const Sa={as:Da,titleEditor:E.Input,startEditor:va,endEditor:va,startTimezoneEditor:Wr,endTimezoneEditor:Wr,startLabel:ba,endLabel:ba,allDayEditor:Ca,allDayLabel:ba,recurrenceEditor:ca,descriptionEditor:E.TextArea,resourceEditor:e=>{const t=e.multiple?h.MultiSelect:h.DropDownList,r=k.useCallback(t=>{const r=t.target.props.dataItemKey,a=e.multiple?(t.target.value||[]).map(e=>e[r]):t.target.value[r];e.onChange.call(void 0,{value:a})},[e.multiple,e.onChange]),a=k.useCallback((t,r)=>{const a=k.createElement(k.Fragment,null,e.colorField&&k.createElement("span",{key:1,className:"k-scheduler-mark",style:{backgroundColor:r.dataItem[e.colorField],marginRight:_(r.dataItem[e.valueField])?"8px":"4px"}}," "),k.createElement("span",{key:2},"  ",t.props.children));return k.cloneElement(t,{...t.props},a)},[e.colorField,e.valueField]),n=k.useCallback((t,r)=>{const a=k.createElement(k.Fragment,null,e.colorField&&r&&k.createElement("span",{key:1,className:"k-scheduler-mark",style:{backgroundColor:r[e.colorField],marginRight:r[e.valueField]?"8px":"4px"}}," "),t.props.children);return k.cloneElement(t,{},a)},[e.colorField,e.valueField]),l=Array.isArray(e.value)?e.data.filter(t=>e.value.some(r=>t[e.valueField]===r)):e.data.find(t=>t[e.valueField]===e.value);return k.createElement(t,{value:l,onChange:r,data:e.data,textField:e.textField,dataItemKey:e.valueField,valid:e.valid,validationMessage:e.validationMessage,itemRender:a,valueRender:n,ariaLabel:e.ariaLabel})}},wa=k.forwardRef((e,t)=>{const{onCancel:r,onClose:a,onSubmit:l,onDelete:c,editor:i,dialog:u=Ia.dialog,validator:g=Ia.validator,...v}=e,E=k.useRef(null);k.useImperativeHandle(E,()=>({props:e})),k.useImperativeHandle(t,()=>E.current);const h=o.useLocalization(),y=ie(),f=!(!e.dataItem||!e.dataItem[y.id]),C=k.useMemo(()=>h.toLanguageString(jt,_r[jt]),[h]),b=k.useMemo(()=>h.toLanguageString(Qt,_r[Qt]),[h]),S=k.useMemo(()=>h.toLanguageString(Ze,_r[Ze]),[h]),w=k.useMemo(()=>h.toLanguageString(Ye,_r[Ye]),[h]),I=k.useMemo(()=>h.toLanguageString(Wt,_r[Wt]),[h]),R=k.useMemo(()=>h.toLanguageString(Xt,_r[Xt]),[h]),T=k.useMemo(()=>h.toLanguageString(Rr,_r[Rr]),[h]),x=k.useMemo(()=>h.toLanguageString(Tr,_r[Tr]),[h]),A=f?x:T,M=k.useCallback(e=>{r&&r({value:null,syntheticEvent:e,target:E.current})},[r]),N=k.useCallback(({syntheticEvent:e})=>{a&&a({value:null,syntheticEvent:e,target:E.current})},[a]),L=k.useCallback((e,t)=>{l&&l({value:e,syntheticEvent:t,target:E.current})},[l]),z=k.useCallback(t=>{c&&c({value:e.dataItem,syntheticEvent:t,target:E.current})},[c,e.dataItem]),_=k.useCallback((e,t)=>e&&t(y.end)&&e.getTime()>t(y.end).getTime()?R:void 0,[y,R]),F=k.useCallback((e,t)=>e&&t(y.start)&&e.getTime()<t(y.start).getTime()?b:void 0,[y,b]),O=k.useCallback(e=>e?void 0:C,[C]),W=k.useCallback((e,t)=>{const r={};r[y.start]=[O(t(y.start)),_(t(y.start),t)].filter(Boolean).reduce((e,t)=>e||t,""),r[y.end]=[O(t(y.start)),F(t(y.start),t)].filter(Boolean).reduce((e,t)=>e||t,"");const a=g(e,t);return{...r,...a}},[F,y.end,y.start,O,_,g]);return n.canUseDOM?D.createPortal(k.createElement(m.Form,{ignoreModified:!0,initialValues:e.dataItem,onSubmit:L,validator:W,render:e=>k.createElement(u,{title:A,width:650,onClose:N},k.createElement(fa,{...e,as:i}),k.createElement(p.DialogActionsBar,{layout:"end"},f&&c&&k.createElement(s.Button,{fillMode:"flat",themeColor:"primary",svgIcon:d.trashIcon,onClick:z},I),k.createElement(s.Button,{onClick:M},w),k.createElement(s.Button,{themeColor:"primary",disabled:!e.allowSubmit,onClick:e.onSubmit},S))),...v}),document&&document.body):null}),Ia={dialog:p.Dialog,validator:()=>({})};wa.displayName="KendoReactSchedulerForm";const Ra=k.createContext({});Ra.displayName="SchedulerViewPropsContext";const Ta=k.createContext([]),xa=()=>k.useContext(Ta);Ta.displayName="SchedulerViewRangesContext";const Aa=k.createContext([[],Z]),Ma=()=>k.useContext(Aa);Aa.displayName="SchedulerViewSlotsContext";const Na=k.createContext([[],Z]),La=()=>k.useContext(Na);Na.displayName="SchedulerViewItemsContext";const za=k.createContext([[],Z]);za.displayName="SchedulerViewSelectedSlotsContext";const _a=k.createContext([[],Z]),Fa=()=>k.useContext(_a);_a.displayName="SchedulerViewSelectedItemsContext";const Oa=k.createContext([[],Z]);Oa.displayName="SchedulerViewFocusedItemsContext";const Wa=k.createContext([[],Z]),Pa=()=>k.useContext(Wa);Wa.displayName="SchedulerViewFocusedSlotsContext";const Ha=({children:e,props:t,ranges:r,slots:a,items:n,selectedSlots:l,selectedItems:o,focusedItems:s,focusedSlots:c})=>k.createElement(Ra.Provider,{value:t},k.createElement(Ta.Provider,{value:r},k.createElement(Aa.Provider,{value:a},k.createElement(Na.Provider,{value:n},k.createElement(za.Provider,{value:l},k.createElement(_a.Provider,{value:o},k.createElement(Oa.Provider,{value:s},k.createElement(Wa.Provider,{value:c},e))))))));var $a=(e=>(e.select="ITEMS_SELECT_SELECT",e.selectNext="ITEMS_SELECT_SELECT_NEXT",e.selectPrev="ITEMS_SELECT_SELECT_PREV",e.reset="ITEMS_SELECT_RESET",e.add="ITEMS_SELECT_ADD",e.remove="ITEMS_SELECT_REMOVE",e))($a||{});var Ka=(e=>(e.select="SLOTS_SELECT_SELECT",e.reset="SLOTS_SELECT_RESET",e.add="SLOTS_SELECT_ADD",e))(Ka||{});const Ba=(e,t)=>{const{element:r}=e;n.useIsomorphicLayoutEffect(()=>{if(!r||!r.current)return;const t=[],a=[],n=[],l=r.current.querySelectorAll(e.selector);l.forEach(r=>{const l=r.getBoundingClientRect().width,o=e.explicitDepth&&void 0!==e.attribute?r.getAttribute(e.attribute):0,s=I(r,!0),c=((e,t=!1)=>parseFloat(window.getComputedStyle(e)[t?"borderLeftWidth":"borderTopWidth"]||"0")+parseFloat(window.getComputedStyle(e)[t?"borderRightWidth":"borderBottomWidth"]||"0"))(r,!0);null!==o&&((!n[o]||c>n[o])&&(n[o]=c),(!a[o]||s>a[o])&&(a[o]=s),(!t[o]||l>t[o])&&(t[o]=l))}),l.forEach(r=>{const l=e.explicitDepth?r.getAttribute(e.attribute):0;null!==l&&(r.style.minWidth=t[l]-a[l]-n[l]+"px")})},t)};var Va=(e=>(e.up="SLOT_FOCUS_UP",e.down="SLOT_FOCUS_DOWN",e.left="SLOT_FOCUS_LEFT",e.right="SLOT_FOCUS_RIGHT",e))(Va||{});const Ga=(e,t)=>t.find(t=>null!==t.current&&null!==e.current&&t.current.props.row===e.current.props.row-1&&t.current.props.col===e.current.props.col),Ua=(e,t)=>t.find(t=>null!==t.current&&null!==e.current&&t.current.props.row===e.current.props.row&&t.current.props.col===e.current.props.col-1),qa=(e,t)=>t.find(t=>null!==t.current&&null!==e.current&&t.current.props.row===e.current.props.row&&t.current.props.col===e.current.props.col+1),Za=(e,t)=>t.find(t=>null!==t.current&&null!==e.current&&t.current.props.row===e.current.props.row+1&&t.current.props.col===e.current.props.col);var Ya=(e=>(e.next="ITEMS_FOCUS_NEXT",e.prev="ITEMS_FOCUS_PREV",e))(Ya||{});const ja=k.forwardRef((e,t)=>{const r=k.useRef(null);k.useImperativeHandle(t,()=>r.current);const[a,l]=n.useCollection([]),[o,s]=n.useCollection([]),[c,i]=(e=>[[],(t,r)=>{switch(t.type){case"ITEMS_FOCUS_NEXT":{if(!t.item||!t.item.current||!e)return;const a=Y(t.item,e,t.ignoreIsAllDay,!1);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}case"ITEMS_FOCUS_PREV":{if(!t.item||!t.item.current||!e)return;const a=Y(t.item,e,t.ignoreIsAllDay,!0);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}}}])(a),[u,d]=(e=>[[],(t,r)=>{switch(t.type){case"SLOT_FOCUS_UP":{if(!t.slot.current||!e)return;const a=Ga(t.slot,e);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}case"SLOT_FOCUS_DOWN":{if(!t.slot||!e)return;const a=Za(t.slot,e);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}case"SLOT_FOCUS_LEFT":{if(!t.slot||!e)return;const a=Ua(t.slot,e);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}case"SLOT_FOCUS_RIGHT":{if(!t.slot||!e)return;const a=qa(t.slot,e);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}}}])(o),[m,p]=(e=>{const[t,r]=k.useState([]),a=k.useCallback((a,n)=>{switch(a.type){case"ITEMS_SELECT_SELECT":if(!a.item)return;r([a.item]);break;case"ITEMS_SELECT_SELECT_NEXT":{if(!a.item||!a.item.current||!e)return;const t=Y(a.item,e,a.ignoreIsAllDay,!1);t&&(n.preventDefault(),r([t]));break}case"ITEMS_SELECT_SELECT_PREV":{if(!a.item||!a.item.current||!e)return;const t=Y(a.item,e,a.ignoreIsAllDay,!0);t&&(n.preventDefault(),r([t]));break}case"ITEMS_SELECT_RESET":r([]);break;case"ITEMS_SELECT_ADD":if(!a.item)return;t.some(e=>e===a.item)||r([...t,a.item]);break;case"ITEMS_SELECT_REMOVE":if(!a.item)return;r([...t.filter(e=>e!==a.item)])}},[e,t]);return[t,a]})(a),[g,v]=(()=>{const[e,t]=k.useState([]),r=k.useCallback(r=>{switch(r.type){case"SLOTS_SELECT_SELECT":if(!r.slot)return;t([r.slot]);break;case"SLOTS_SELECT_RESET":t([]);break;case"SLOTS_SELECT_ADD":if(!r.slot)return;e.some(e=>e===r.slot)||t([...e,r.slot])}},[e]);return[e,r]})(),E=k.useCallback((e,t)=>{v({type:Ka.reset}),p(e,t)},[p,v]),h=k.useCallback((e,t)=>{p({type:$a.reset},t),v(e)},[p,v]),y=k.useMemo(()=>n.classNames("k-scheduler-layout k-scheduler-layout-flex",e.className),[e.className]);return Ba({element:r,selector:".k-group-cell",attribute:"data-depth-index",explicitDepth:!0}),Ba({element:r,selector:".k-side-cell",attribute:"data-depth-index",explicitDepth:!1}),k.createElement(Ha,{props:e.props,ranges:e.ranges,items:[a,l],slots:[o,s],selectedItems:[m,E],selectedSlots:[g,h],focusedItems:[c,i],focusedSlots:[u,d]},k.createElement("div",{ref:r,style:e.style,className:y,role:e.role||"none"},e.children))});ja.displayName="KendoReactSchedulerBaseView";const Xa=k.createContext({resource:{},groupIndex:0}),Qa=e=>{const{nested:t,children:r,rowContentProps:a}=e,n=e.rowContent||tn,l=e.childRowContent||n,o=b(e.group,e.resources);return k.createElement("div",{className:"k-scheduler-group k-group-horizontal"},t?Ja({resources:o,children:r,nested:t,groupIndex:0,rowContent:n,rowContentProps:a,childRowContent:l}):en({resources:o,children:r,rowContentProps:a,childRowContent:l}))},Ja=e=>{const{resources:t,rowContent:r,nested:a,children:n,groupIndex:l,rowContentProps:o,childRowContent:s}=e;if(l===t.length)return en({resources:t,children:n,rowContentProps:o,childRowContent:s});const c=S(t,l),i=r;return k.createElement(k.Fragment,null,a?k.createElement("div",{className:"k-scheduler-row"},k.createElement(i,{resources:t,groupIndex:l,...o},c.map((e,t)=>k.createElement("div",{key:t,className:"k-scheduler-cell k-heading-cell"},e.text)))):k.createElement(i,{resources:t,groupIndex:l,...o},c.map((e,t)=>k.createElement("div",{key:t,className:"k-scheduler-cell k-heading-cell"},e.text))),Ja({resources:t,children:n,nested:a,rowContent:r,childRowContent:s,groupIndex:l+1}))},en=e=>{const{resources:t,childRowContent:r,children:a,rowContentProps:n}=e,l=S(t,t.length-1),o=r,s=t.length>0;return k.createElement("div",{className:"k-scheduler-row"},k.createElement(o,{resources:t,...n},(l.length?l:Q).map((e,t)=>k.createElement("div",{key:t,className:"k-scheduler-cell k-group-cell"},k.createElement(Xa.Provider,{value:{resource:e,groupIndex:s?t:0}},a)))))};Qa.displayName="KendoReactSchedulerHorizontalResourceIterator";const tn=e=>e.children,rn=e=>k.createElement(k.Fragment,null,k.createElement("div",{className:"k-scheduler-cell k-side-cell","data-range-index":e.rangeIndex}),e.children),an=e=>{const{nested:t,wrapGroup:r,children:a,role:n}=e,l=e.cellContent||dn,o=b(e.group,e.resources);return k.createElement("div",{className:"k-scheduler-group",role:n},t?r?k.createElement("div",{className:"k-scheduler-row"},k.createElement("div",{className:"k-sticky-cell"},on({resources:o,children:a,cellContent:l,depth:0,groupIndex:0})),k.createElement("div",{className:"k-scheduler-cell k-group-content"},ln({resources:o,children:a,cellContent:l,depth:0,groupIndex:0},!1))):ln({resources:o,children:a,cellContent:l,depth:0,groupIndex:0},!0):r?k.createElement("div",{className:"k-scheduler-row"},k.createElement("div",{className:"k-sticky-cell"},nn({resources:o})),k.createElement("div",{className:"k-scheduler-cell k-group-content"},a)):sn({resources:o,children:a,cellContent:l,groupIndex:0,role:n}))},nn=e=>k.createElement("div",{className:"k-scheduler-row"},k.createElement("div",{className:"k-scheduler-row"},e.resources.map((e,t)=>k.createElement("div",{key:t,className:"k-scheduler-cell k-resource-cell k-heading-cell","data-depth-index":t})))),ln=(e,t=!0)=>{const{resources:r,children:a,cellContent:n,groupIndex:l,depth:o}=e,s=r.length>0;if(o===r.length||!s)return k.createElement(Xa.Provider,{value:{resource:r[o],groupIndex:s?l:0}},a);const c=r[o].data.length;return r[o].data.map((e,s)=>k.createElement("div",{key:s,className:"k-scheduler-row"},t&&k.createElement("div",{className:"k-scheduler-cell k-group-cell k-heading-cell","data-depth-index":o},e[r[o].textField]),k.createElement("div",{className:"k-scheduler-cell k-group-content k-resource-row","data-depth-index":o,"data-resource-index":c*l+s},ln({resources:r,children:a,cellContent:n,groupIndex:c*l+s,depth:o+1},t))))},on=e=>{const{resources:t,children:r,cellContent:a,groupIndex:n,depth:l}=e,o=t.length?t[l].data.length:0;return t[l]?t[l].data.map((e,s)=>k.createElement("div",{key:s,className:"k-scheduler-row"},k.createElement("div",{className:"k-scheduler-cell k-resource-cell k-resource-row k-heading-cell","data-depth-index":l,"data-resource-index":o*n+s},e[t[l].textField]),l+1!==t.length&&k.createElement("div",{className:"k-scheduler-cell k-resource-content"},on({resources:t,children:r,cellContent:a,groupIndex:o*n+s,depth:l+1})))):null},sn=e=>{const{resources:t,children:r,groupIndex:a,cellContent:n,role:l}=e;return k.createElement("div",{className:"k-scheduler-row",role:l},un(t),n,cn(r,t,a,l))},cn=(e,t,r,a)=>{const n=t.length>0;return k.createElement("div",{className:"k-scheduler-cell k-group-content",role:a},k.createElement(Xa.Provider,{value:{resource:t[r],groupIndex:n?r:void 0}},e))},un=e=>e.map((e,t)=>k.createElement("div",{key:t,className:"k-scheduler-cell k-group-cell k-heading-cell","data-depth-index":t}));an.displayName="KendoReactSchedulerVerticalResourceIterator";const dn=null,mn=e=>{const t=o.useLocalization();return k.createElement(k.Fragment,null,k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-side-cell k-scheduler-times-all-day"},t.toLanguageString(Me,_r[Me])),e.children)},pn=k.forwardRef((e,t)=>{const{as:r=gn.as,...a}=e,l=k.useRef(null),s=k.useRef(null),c=o.useInternationalization(),i=k.useMemo(()=>n.classNames("k-scheduler-cell k-heading-cell",e.className),[e.className]);return k.useImperativeHandle(s,()=>({element:l.current&&l.current.element?l.current.element:l.current,props:e})),k.useImperativeHandle(t,()=>s.current),k.createElement(r,{ref:r!==gn.as?void 0:l,...a,className:i},c.formatDate(e.date,e.format?e.format:gn.format))}),gn={as:k.forwardRef(({as:e,format:t,start:r,end:a,...n},l)=>k.createElement("div",{...n,ref:l})),format:"t"};pn.displayName="KendoReactSchedulerTimeHeaderCell";const vn=e=>{const{slot:t,children:r}=e;return k.createElement(k.Fragment,null,e.isMaster?k.createElement(pn,{as:e.timeHeaderCell,date:t.zonedStart,start:t.zonedStart,end:t.zonedEnd,className:n.classNames("k-side-cell",{"k-major-cell":!e.isLast})}):k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-side-cell"}),r)},En=k.forwardRef((e,t)=>{const{onFocus:r,onBlur:a,onClick:l,onMouseEnter:o,onMouseLeave:s,onMouseOut:c,onMouseOver:i,onDoubleClick:u,onKeyDown:d,onKeyPress:m,onKeyUp:p}=e,{slot:g,element:v}=((e,t)=>{const{_ref:r}=e,a=k.useRef(null),l=k.useRef(null),[,o]=Ma();return k.useImperativeHandle(a,()=>({element:l.current,props:e})),k.useImperativeHandle(t,()=>a.current),k.useImperativeHandle(r,()=>a.current),k.useLayoutEffect(()=>(o({type:n.COLLECTION_ACTION.add,item:a}),()=>{o({type:n.COLLECTION_ACTION.remove,item:a})})),{slot:a,element:l}})(e,t),E=void 0!==e.tabIndex?null===e.tabIndex?void 0:e.tabIndex:e.selected?0:-1,h=k.useMemo(()=>{var t,r;const a=null!=(t=e.isWorkHour)?t:hn.isWorkHour,l=null!=(r=e.isWorkDay)?r:hn.isWorkDay;return n.classNames("k-scheduler-cell",e.className,"k-slot-cell",{"k-nonwork-hour":!a||!l,"k-selected":e.selected})},[e.className,e.selected,e.isWorkHour,e.isWorkDay]),y=k.useMemo(()=>({userSelect:"none",...e.style}),[e.style]),f=k.useCallback(e=>{r&&r.call(void 0,{syntheticEvent:e,target:g.current})},[r,g]),D=k.useCallback(e=>{a&&a.call(void 0,{syntheticEvent:e,target:g.current})},[a,g]),C=k.useCallback(e=>{l&&l.call(void 0,{syntheticEvent:e,target:g.current})},[l,g]),b=k.useCallback(e=>{i&&i.call(void 0,{syntheticEvent:e,target:g.current})},[i,g]),S=k.useCallback(e=>{c&&c.call(void 0,{syntheticEvent:e,target:g.current})},[c,g]),w=k.useCallback(e=>{o&&o.call(void 0,{syntheticEvent:e,target:g.current})},[o,g]),I=k.useCallback(e=>{s&&s.call(void 0,{syntheticEvent:e,target:g.current})},[s,g]),R=k.useCallback(e=>{u&&u.call(void 0,{syntheticEvent:e,target:g.current})},[u,g]),T=k.useCallback(e=>{d&&d.call(void 0,{syntheticEvent:e,target:g.current})},[d,g]),x=k.useCallback(e=>{m&&m.call(void 0,{syntheticEvent:e,target:g.current})},[m,g]),A=k.useCallback(e=>{p&&p.call(void 0,{syntheticEvent:e,target:g.current})},[p,g]);return k.createElement("div",{ref:v,id:e.id,style:y,className:h,tabIndex:E,role:e.role,"aria-selected":e.selected||void 0,onFocus:f,onBlur:D,onClick:C,onMouseEnter:w,onMouseLeave:I,onMouseOver:b,onMouseOut:S,onDoubleClick:R,onKeyDown:T,onKeyPress:x,onKeyUp:A,"data-slot":!0,"data-slot-allday":e.isAllDay,"data-slot-start":e.start.getTime(),"data-slot-end":e.end.getTime(),"data-slot-group":e.group.index,"data-slot-range":e.range.index,"data-slot-index":e.index},e.children)}),hn={isWorkHour:!0,isWorkDay:!0};En.displayName="KendoReactSchedulerSlot";const yn=e=>{const t=new Map;Array.from(e.querySelectorAll(".k-resource-row")).filter(e=>!e.classList.contains("k-resource-cell")).forEach(e=>{var r;const a=e.getAttribute("data-depth-index"),n=e.getAttribute("data-resource-index");if(null===a||null===n)return;const l=`${a}:${n}`;t.set(l,Math.max(null!=(r=t.get(l))?r:0,e.clientHeight-1))});const r=[];Array.from(e.querySelectorAll(".k-resource-cell")).forEach(e=>{const a=e.getAttribute("data-depth-index"),n=e.getAttribute("data-resource-index");if(null===a||null===n)return;const l=t.get(`${a}:${n}`);if(void 0===l)return;const o=Math.round(l-I(e));r.push({cell:e,height:o,minHeight:o>0?`${o}px`:""})}),r.forEach(({cell:e,height:t,minHeight:r})=>{e.style.minHeight!==r&&R(e,{height:t},!0)})},fn=new Set;let kn;const Dn=e=>{fn.add(e),void 0===kn&&(kn=window.requestAnimationFrame(()=>{kn=void 0;const e=Array.from(fn);fn.clear();const t=new Set;e.map(e=>{try{return e()}catch{return}}).forEach(e=>{if(!e)return;const{element:r,minHeight:a}=e,n=a&&a>0?`${a}px`:"";if(r.style.minHeight!==n){R(r,{height:null!=a?a:0},!0);const e=r.closest(".k-scheduler-layout");e&&t.add(e)}}),t.forEach(yn)}))},Cn=(e,t,r,a)=>{const n=ae(),l=!!t,o="object"==typeof t&&t.offsetTop?t.offsetTop:0,s="object"==typeof t&&t.offsetBottom?t.offsetBottom:0,c=null!=a?a:e.current&&e.current.props.items,i=c?JSON.stringify(c.map(e=>{var t,r;return[e.uid,e.isRecurring&&null!=(r=null==(t=e.originalStart)?void 0:t.getTime())?r:null]})):"",u=r?`${r.padding}|${r.paddingTop}|${r.paddingBottom}`:"",d=k.useCallback(()=>{if(!l||!e.current)return;const t=e.current.element,r=e.current.props;if(!t)return;const a=I(t),n=new Map;let c=!1;const i=r.items.filter(e=>e._ref.current);let u;if(i.forEach(e=>{var t,r,a,l,o;if(!e._ref.current)return;const{height:s}=w(e._ref.current.element),i=null!=(a=null!=(r=null==(t=e._ref.current)?void 0:t._order)?r:e.order)?a:-1;null!=(l=e._ref.current.element)&&l.style.top&&(c=!0),(null!=(o=n.get(i))?o:0)<s&&n.set(i,s)}),!c||0===n.size)return{element:t,minHeight:null};const d=Math.max(...Array.from(n.keys())),m=d+1,p=Math.max(...Array.from(n.values()));u=0;for(let e=0;e<=d;e++)u+=n.has(e)?n.get(e):p;const g=1*m*2+u-a+o+s;return{element:t,minHeight:i.length?g:null}},[l,s,o,e]),m=k.useCallback(()=>{Dn(d)},[d]);k.useEffect(()=>{var t;if(!l){const r=e.current;if(null!=r&&r.element){const e=null==(t=r.props.style)?void 0:t.minHeight;r.element.style.minHeight="number"==typeof e?`${e}px`:null!=e?e:""}return}return Dn(d),()=>(e=>{fn.delete(e),0===fn.size&&void 0!==kn&&(window.cancelAnimationFrame(kn),kn=void 0)})(d)},[d,l,e,i,u]),k.useEffect(()=>{if(!l||!e.current)return;const t=e.current.props.items.filter(e=>e._ref.current).map(e=>{if(!e._ref.current||!e._ref.current.element||!n.current)return;const t=window.ResizeObserver,r=t&&new t(m);r&&r.observe(e._ref.current.element);const a=new MutationObserver(m);return a.observe(e._ref.current.element,{attributes:!0,attributeFilter:["style"]}),()=>{r&&r.disconnect(),a.disconnect()}});return()=>{t.forEach(e=>e&&e())}},[l,m,n,e,i])},bn=k.forwardRef((e,t)=>{var r;const{slot:a,_ref:n,...l}=e,o=a||Sn.slot,s=k.useRef(null),c=k.useRef(null);return k.useImperativeHandle(s,()=>({props:e})),k.useImperativeHandle(n,()=>c.current),k.useImperativeHandle(t,()=>s.current),Cn(c,null!=(r=e.expandable)?r:Sn.expandable,e.style,e.items),k.createElement(o,{...l,_ref:c})}),Sn={slot:En,expandable:!1};bn.displayName="KendoReactSchedulerViewSlot";const wn=k.createContext([null]);wn.displayName="SchedulerEditSlotPropsContext";const In=k.createContext([null]);In.displayName="SchedulerEditSlotFormItemContext";const Rn=({props:e,form:t,children:r})=>k.createElement(wn.Provider,{value:e},k.createElement(In.Provider,{value:t},r)),Tn={position:"top",collision:{horizontal:"fit",vertical:"flip"}},xn={position:"right",collision:{horizontal:"flip",vertical:"fit"}},An=/(auto|scroll|overlay)/,Mn=(e,t,r)=>{k.useEffect(()=>{if(!e||!t||!r)return;const a=(e=>{const t=[];let r=e.parentElement;for(;r;){const{overflow:e,overflowX:a,overflowY:n}=getComputedStyle(r);if(An.test(`${e}${a}${n}`)&&t.push(r),r.classList.contains("k-scheduler"))break;r=r.parentElement}return t})(t);if(0===a.length)return;const n=()=>{const e=t.getBoundingClientRect();return a.some(r=>{const a=((e,t)=>{const r=e.getBoundingClientRect(),a={top:r.top,left:r.left,right:r.right,bottom:r.bottom},n=e.querySelector(".k-scheduler-head");n&&!n.contains(t)&&(a.top=Math.max(a.top,n.getBoundingClientRect().bottom));const l=e.querySelector(".k-sticky-cell");if(l&&!t.closest(".k-sticky-cell")){const e=l.getBoundingClientRect();e.left-r.left<=r.right-e.right?a.left=Math.max(a.left,e.right):a.right=Math.min(a.right,e.left)}return a})(r,t);return e.bottom<=a.top||e.top>=a.bottom||e.right<=a.left||e.left>=a.right})},l=()=>{n()&&r()};return a.forEach(e=>e.addEventListener("scroll",l,{passive:!0})),()=>{a.forEach(e=>e.removeEventListener("scroll",l))}},[e,t,r])},Nn={skeleton:"MMMMd"},Ln=e=>{const{value:t,onChange:r,onKeyDown:a,valid:n,placeholder:l,ariaLabel:o}=e;return k.createElement(E.TextBox,{"aria-label":o,placeholder:l,autoComplete:"off",value:null!=t?t:"",onChange:r,onKeyDown:a,valid:n})},zn=e=>{const{show:t,anchor:r,dataItem:l,validator:c,onSubmit:i,onMoreOptions:u,onCancel:p}=e,g=o.useInternationalization(),E=o.useLocalization(),h=ie(),{timezone:f}=le(),D=(()=>{const[e]=Ce(),t=ge(),r=me(),n=Ee();return k.useMemo(()=>"timeline"===e?xn:Math.max(1,Math.round((t.end.getTime()-t.start.getTime())/a.MS_PER_DAY))*("horizontal"===n?Math.max(1,r.length):1)<=1?Tn:xn,[e,t,r,n])})(),C=k.useRef(null),b=k.useCallback(()=>{null==p||p({value:null,syntheticEvent:void 0})},[p]);Mn(t,r,b),k.useEffect(()=>{if(!t)return;const e=e=>{var t,r;const a=e.target,n=null==(r=null==(t=C.current)?void 0:t.element)?void 0:r.closest(".k-popover");n&&n.contains(a)||null==p||p({value:null,syntheticEvent:void 0})};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[t,r,p]);const S=L(l,h.start),w=L(l,h.end),I=!!L(l,h.isAllDay),R=E.toLanguageString(Me,_r[Me]);let T="";if(S&&w){const e=a.ZonedDate.fromLocalDate(S,f),t=a.ZonedDate.fromLocalDate(w,f);T=I?`${g.formatDate(e,Nn)}, ${R}`:`${g.formatDate(e,Nn)}, ${g.formatDate(e,"t")} - ${g.formatDate(t,"t")}`}const x=E.toLanguageString(Rr,_r[Rr]),A=E.toLanguageString(Xe,_r[Xe]),M=E.toLanguageString(Ar,_r[Ar]),N=E.toLanguageString(Mr,_r[Mr]),_=E.toLanguageString(Nr,_r[Nr]),F=k.useCallback((e,t)=>{i({value:e,syntheticEvent:t})},[i]),O=k.useCallback(e=>t=>{if(!u)return;const r={...l};z(r,h.title,e.valueGetter(h.title)),u({value:r,syntheticEvent:t})},[u,l,h.title]),W=k.useCallback(e=>{p&&p({value:null,syntheticEvent:e})},[p]),P=k.useCallback(()=>{null==p||p({value:null,syntheticEvent:void 0})},[p]);return k.createElement(m.Form,{key:S?S.getTime():void 0,initialValues:l,validator:c,ignoreModified:!0,onSubmit:F,render:e=>k.createElement(y.Popover,{anchor:r,show:t,position:D.position,collision:D.collision,callout:!1,title:x,style:{width:360},onKeyDown:P,animate:{openDuration:1,closeDuration:1}},k.createElement(m.FormElement,{ref:C,horizontal:!0,className:"k-scheduler-edit-form"},k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},k.createElement(n.SvgIcon,{icon:d.rightDoubleQuotesIcon,size:"xlarge"})),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(m.Field,{name:h.title,component:Ln,ariaLabel:A,placeholder:x,onKeyDown:t=>{"Enter"===t.key&&(t.preventDefault(),e.onSubmit(t))}}))),k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},k.createElement(n.SvgIcon,{icon:d.clockIcon,size:"xlarge"})),k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-scheduler-edit-form-row k-color-subtle"},T)))),k.createElement(y.PopoverActionsBar,null,k.createElement(s.Button,{type:"button",fillMode:"flat",themeColor:"primary",onClick:O(e)},N),k.createElement("span",{className:"k-spacer"}),k.createElement(s.Button,{type:"button",onClick:W},_),k.createElement(s.Button,{type:"button",themeColor:"primary",disabled:!e.allowSubmit,onClick:e.onSubmit},M)))})};zn.displayName="KendoReactSchedulerQuickCreateForm";const _n=e=>{const t=k.useContext(ne),r=void 0!==e?e:t.editable||!1,a=!0===r||void 0!==r&&!1!==r&&!0===r.edit,n=!0===r||void 0!==r&&!1!==r&&!0===r.resize,l=!0===r||void 0!==r&&!1!==r&&!0===r.remove,o=!0===r||void 0!==r&&!1!==r&&!0===r.drag;return{add:!0===r||void 0!==r&&!1!==r&&!0===r.add,edit:a,drag:o,remove:l,resize:n,select:!0===r||void 0!==r&&!1!==r&&!0===r.select}},Fn=(e=200)=>{const t=k.useRef(null),r=k.useCallback(()=>{null!==t.current&&(clearTimeout(t.current),t.current=null)},[]),a=k.useCallback(a=>{r(),t.current=setTimeout(()=>{t.current=null,a()},e)},[r,e]);return k.useEffect(()=>r,[r]),{schedule:a,cancel:r}},On=k.forwardRef((e,t)=>{const{_ref:r,onDataAction:a,viewSlot:l,form:o,formItem:s,onFormItemChange:c,quickCreateFormItem:i,onQuickCreateFormItemChange:u,...d}=e,[m,p]=k.useState(e.tabIndex),g=k.useRef(null),v=k.useRef(null);k.useImperativeHandle(v,()=>({props:e})),k.useImperativeHandle(t,()=>v.current),k.useImperativeHandle(r,()=>g.current);const E=_n(e.editable),h=ie(),[y]=Ma(),[f]=La(),[D,C]=k.useContext(za),[,b]=Pa(),S=o||Wn.form,w=l||Wn.viewSlot,[I,R]=we(null,s,e.onFormItemChange),T=le(),[x]=Ce(),A="agenda"!==x&&!1!==T.quickCreate,N=e.quickCreateForm||T.quickCreateForm||zn,[_,F]=we(null,i,u),O=k.useRef(null),W=Fn(),P=D.some(t=>!(!t.current||t.current.props.start.getTime()!==e.start.getTime()||t.current.props.end.getTime()!==e.end.getTime()||t.current.props.index!==e.index||t.current.props.group.index!==e.group.index||t.current.props.range.index!==e.range.index||t.current.props.isAllDay!==e.isAllDay)),H=k.useCallback(()=>{const t={};if(z(t,h.start,new Date(e.start.getTime())),z(t,h.end,new Date(e.end.getTime())),z(t,h.isAllDay,e.isAllDay),e.group.resources.length)for(let r=0;r<e.group.resources.length;r++){const a=e.group.resources[r];if(M(e.group.resources)){const n=L(e.group.resources[r],a.valueField);z(t,a.field,a.multiple?[n]:n)}else z(t,a.field,a.multiple?[]:void 0)}return t},[h.start,h.end,h.isAllDay,e.start,e.end,e.isAllDay,e.group.resources]),$=k.useCallback(t=>{E.select&&C({type:Ka.select,slot:g},t.syntheticEvent),e.onFocus&&e.onFocus.call(void 0,t)},[C,E.select,e.onFocus]),K=k.useCallback(t=>{if(E.add&&A){const e=t.target?t.target.element:null;W.schedule(()=>{O.current=e,F(H())})}e.onClick&&e.onClick.call(void 0,t)},[H,E.add,A,e.onClick,W,F]),B=k.useCallback(t=>{if(W.cancel(),F(null),E.add){const e=H();R(e,t)}e.onDoubleClick&&e.onDoubleClick.call(void 0,t)},[H,E.add,e.onDoubleClick,R,W,F]),V=k.useCallback(e=>{let t;switch(e.syntheticEvent.keyCode){case n.Keys.left:if(!y)return;e.syntheticEvent.preventDefault(),b({type:Va.left,slot:g},e.syntheticEvent);break;case n.Keys.right:if(!y)return;e.syntheticEvent.preventDefault(),b({type:Va.right,slot:g},e.syntheticEvent);break;case n.Keys.up:if(!y)return;e.syntheticEvent.preventDefault(),b({type:Va.up,slot:g},e.syntheticEvent);break;case n.Keys.down:if(!y)return;e.syntheticEvent.preventDefault(),b({type:Va.down,slot:g},e.syntheticEvent);break;case n.Keys.enter:{if(!y||!E.add)return;const t=H();A?(O.current=e.target?e.target.element:null,F(t)):R(t);break}case n.Keys.tab:t=(e=>{const t=e.props.items.find(e=>0===e.order)||e.props.items[0];return t&&t._ref.current})(e.target)}t&&(e.syntheticEvent.preventDefault(),t.element&&t.element.focus())},[H,b,E.add,A,R,y,F]),G=k.useCallback(e=>{a&&a.call(void 0,{type:te.create,series:!1,dataItem:e.value},e),R(null,e.syntheticEvent)},[a,R]),U=k.useCallback(e=>{R(null,e.syntheticEvent)},[R]),q=k.useCallback(e=>{R(null,e)},[R]),Z=k.useCallback((e,t)=>{R&&R(e,t)},[R]),Y=k.useCallback(()=>{O.current&&O.current.focus({preventScroll:!0})},[]),j=k.useCallback(e=>{a&&a.call(void 0,{type:te.create,series:!1,dataItem:e.value},e.syntheticEvent),F(null),Y()},[a,Y,F]),X=k.useCallback(e=>{R(e.value),F(null)},[R,F]),Q=k.useCallback(()=>{F(null),Y()},[Y,F]);return k.useEffect(()=>{const t=y.length&&y[0].current===g.current;p(void 0!==e.tabIndex?null===e.tabIndex?void 0:e.tabIndex:0===D.length&&t&&0===f.length?0:void 0)},[f,e.tabIndex,D.length,y]),k.createElement(Rn,{props:e,form:[I,Z]},k.createElement(w,{...d,_ref:g,selected:P,tabIndex:m,onFocus:$,onClick:K,onDoubleClick:B,onKeyDown:V}),I&&k.createElement(S,{dataItem:I,onSubmit:G,onClose:q,onCancel:U}),_&&k.createElement(N,{show:!0,anchor:O.current,dataItem:_,onSubmit:j,onMoreOptions:X,onCancel:Q}))}),Wn={viewSlot:bn,form:wa};On.displayName="KendoReactSchedulerEditSlot";const Pn=k.forwardRef((e,t)=>{const{isRemove:r,onClose:a,onSeriesClick:l,onOccurrenceClick:c}=e,i=k.useRef(null);k.useImperativeHandle(i,()=>({props:e})),k.useImperativeHandle(t,()=>i.current);const u=o.useLocalization(),d=e=>u.toLanguageString(e,_r[e]),m=d(Ve),g=d(Ge),v=d(Ue),E=d(qe),h=d(Kt),y=d(Bt),f=d(Ut),C=d($t),b=r?f:E,S=r?C:v,w=r?h:m,I=r?y:g,R=k.useCallback(({syntheticEvent:e})=>{a&&a.call(void 0,{syntheticEvent:e,value:null,target:i.current})},[a]),T=k.useCallback(e=>{l&&l.call(void 0,{syntheticEvent:e,value:null,target:i.current})},[l]),x=k.useCallback(e=>{c&&c.call(void 0,{syntheticEvent:e,value:null,target:i.current})},[c]);return n.canUseDOM?D.createPortal(k.createElement(p.Dialog,{title:b,onClose:R},S,k.createElement(p.DialogActionsBar,null,k.createElement(s.Button,{onClick:x},w),k.createElement(s.Button,{onClick:T},I))),document&&document.body):null});Pn.displayName="KendoReactSchedulerSchedulerOccurrenceDialog";const Hn=k.forwardRef((e,t)=>{const{onClose:r,onCancel:a,onConfirm:l,isSeries:c}=e,i=k.useRef(null);k.useImperativeHandle(i,()=>({props:e})),k.useImperativeHandle(t,()=>i.current);const u=o.useLocalization(),d=u.toLanguageString(Ye,_r[Ye]),m=u.toLanguageString(Wt,_r[Wt]),g=c?u.toLanguageString(Ht,_r[Ht]):u.toLanguageString(Pt,_r[Pt]),v=c?u.toLanguageString(Gt,_r[Gt]):u.toLanguageString(Vt,_r[Vt]),E=k.useCallback(({syntheticEvent:e})=>{if(!r)return;const t={syntheticEvent:e,value:null,target:i.current};r.call(void 0,t)},[r]),h=k.useCallback(e=>{a&&a.call(void 0,{syntheticEvent:e,value:null})},[a]),y=k.useCallback(e=>{l&&l.call(void 0,{syntheticEvent:e,value:null})},[l]);return n.canUseDOM?D.createPortal(k.createElement(p.Dialog,{title:v,onClose:E},g,k.createElement(p.DialogActionsBar,null,k.createElement(s.Button,{onClick:h},d),k.createElement(s.Button,{onClick:y},m))),document&&document.body):null});Hn.displayName="KendoReactSchedulerRemoveDialog";const $n=k.forwardRef((e,t)=>{const{onFocus:r,onBlur:a,onMouseDown:l,onClick:s,onMouseUp:c,onMouseOut:i,onMouseOver:u,onMouseEnter:d,onMouseLeave:m,onDoubleClick:p,onKeyUp:g,onKeyDown:v,onKeyPress:E,onPress:h,onDrag:y,onRelease:f,onResizePress:D,onResizeEndDrag:C,onResizeRelease:b,onResizeStartDrag:S}=e,{item:w,element:I}=((e,t)=>{const{_ref:r,itemRef:a,_maxSiblingsPerSlot:l,_siblings:o,_order:s}=e,c=k.useRef(null),i=k.useRef(null),[,u]=La();return k.useImperativeHandle(c,()=>({element:i.current,props:e,get _maxSiblingsPerSlot(){return null==l?void 0:l.current},set _maxSiblingsPerSlot(e){var t;null!=e&&void 0!==l&&void 0!==l.current&&(l.current=e,null==(t=null==o?void 0:o.current)||t.forEach(t=>{var r;!t||t._maxSiblingsPerSlot===e||e<(null!=(r=t._maxSiblingsPerSlot)?r:0)||(t._maxSiblingsPerSlot=e)}))},get _order(){return null==s?void 0:s.current},set _order(e){void 0!==e&&void 0!==s&&void 0!==s.current&&(s.current=e)}})),k.useImperativeHandle(t,()=>c.current),k.useImperativeHandle(r,()=>c.current),k.useImperativeHandle(a,()=>c.current),n.useIsomorphicLayoutEffect(()=>(u({type:n.COLLECTION_ACTION.add,item:c}),()=>{u({type:n.COLLECTION_ACTION.remove,item:c})})),{item:c,element:i}})(e,t),R=k.useRef(null),T=k.useRef(null),x=k.useRef(null),A=k.useRef(null),M=_n(e.editable),N=e.readonly?{resize:!1,select:M.select}:M,L=o.useInternationalization(),z=o.useLocalization().toLanguageString(Me,_r[Me]),_=e.group.resources.find(e=>!(!e.colorField||""===e[e.colorField]||void 0===e[e.colorField])),F=_&&_.colorField&&_[_.colorField],O=void 0!==e.tabIndex?null===e.tabIndex?void 0:e.tabIndex:e.selected?0:-1,W=k.useMemo(()=>{var t;return n.classNames({"k-event":!e.resizeHint,"k-event-all-day":!(e.resizeHint||!0!==(null==(t=e.range)?void 0:t.isAllDay)||e.isAllDay||e.head&&e.tail),"k-selected":e.selected&&N.select||e.dragHint,"k-readonly":!e.resizeHint&&!!e.readonly,"k-event-drag-hint":e.dragSource,"k-scheduler-marquee":e.resizeHint,"k-marquee":e.resizeHint,"k-first":e.resizeHint&&!e.tail,"k-last":e.resizeHint&&!e.head},e.className)},[e.resizeHint,e.selected,e.readonly,e.dragHint,e.dragSource,e.tail,e.head,e.isAllDay,e.className,e.range,N.select]),P=k.useMemo(()=>`${e.title}, ${function(e,t,r,a,n="all day"){const l={skeleton:"yMMMMEEEEdhm"},o={skeleton:"yMMMMEEEEd"},s=t.getFullYear()===r.getFullYear()&&t.getMonth()===r.getMonth()&&t.getDate()===r.getDate();if(a){const a=0===r.getHours()&&0===r.getMinutes()&&0===r.getSeconds()&&r.getTime()-t.getTime()===864e5;return s||a?`${e.formatDate(t,o)} (${n})`:`${e.formatDate(t,o)} to ${e.formatDate(r,o)} (${n})`}return s?`${e.formatDate(t,l)}–${e.formatDate(r,"t")}`:`${e.formatDate(t,l)}-${e.formatDate(r,l)}`}(L,e.zonedStart,e.zonedEnd,e.isAllDay,z)}`,[L,e.isAllDay,e.title,e.zonedEnd,e.zonedStart,z]),H=k.useMemo(()=>{var t;return{cursor:"pointer",userSelect:"none",...F?e.resizeHint?{"--kendo-marquee-color":F}:{"--kendo-scheduler-event-color":F}:void 0,touchAction:"none",...e.style,containerType:e.resizeHint?void 0:"auto"===(null==(t=e.style)?void 0:t.height)?"normal":"size"}},[F,e.style,e.resizeHint]),$=k.useCallback(e=>{r&&r.call(void 0,{syntheticEvent:e,target:w.current})},[r,w]),K=k.useCallback(e=>{a&&a.call(void 0,{syntheticEvent:e,target:w.current})},[a,w]),B=k.useCallback(e=>{l&&l.call(void 0,{syntheticEvent:e,target:w.current})},[l,w]),V=k.useCallback(e=>{s&&s.call(void 0,{syntheticEvent:e,target:w.current})},[s,w]),G=k.useCallback(e=>{c&&c.call(void 0,{syntheticEvent:e,target:w.current})},[c,w]),U=k.useCallback(e=>{u&&u.call(void 0,{syntheticEvent:e,target:w.current})},[u,w]),q=k.useCallback(e=>{i&&i.call(void 0,{syntheticEvent:e,target:w.current})},[i,w]),Z=k.useCallback(e=>{d&&d.call(void 0,{syntheticEvent:e,target:w.current})},[d,w]),Y=k.useCallback(e=>{m&&m.call(void 0,{syntheticEvent:e,target:w.current})},[m,w]),j=k.useCallback(t=>{!p||e.readonly||p.call(void 0,{syntheticEvent:t,target:w.current})},[p,w,e.readonly]),X=k.useCallback(e=>{v&&v.call(void 0,{syntheticEvent:e,target:w.current})},[v,w]),Q=k.useCallback(e=>{E&&E.call(void 0,{syntheticEvent:e,target:w.current})},[E,w]),J=k.useCallback(e=>{g&&g.call(void 0,{syntheticEvent:e,target:w.current})},[g,w]),ee=k.useCallback(t=>{!h||e.readonly||h.call(void 0,{dragEvent:t,target:w.current})},[h,w,e.readonly]),te=k.useCallback(t=>{!y||e.readonly||y.call(void 0,{dragEvent:t,target:w.current})},[y,w,e.readonly]),re=k.useCallback(t=>{!f||e.readonly||f.call(void 0,{dragEvent:t,target:w.current})},[f,w,e.readonly]),ae=k.useCallback(t=>{!D||e.readonly||D.call(void 0,{dragEvent:t,target:w.current})},[D,w,e.readonly]),ne=k.useCallback(e=>{S&&S.call(void 0,{dragEvent:e,target:w.current})},[S,w]),le=k.useCallback(e=>{C&&C.call(void 0,{dragEvent:e,target:w.current})},[C,w]),oe=k.useCallback(e=>{b&&b.call(void 0,{dragEvent:e,target:w.current})},[b,w]);return n.useDraggable(I,{onPress:ee,onDrag:te,onRelease:re}),n.useDraggable(R,{onPress:ae,onDrag:le,onRelease:oe}),n.useDraggable(T,{onPress:ae,onDrag:ne,onRelease:oe}),n.useDraggable(x,{onPress:ae,onDrag:ne,onRelease:oe}),n.useDraggable(A,{onPress:ae,onDrag:le,onRelease:oe}),k.createElement("div",{ref:I,id:e.id,style:H,tabIndex:O,className:W,role:"button","aria-label":P,onFocus:$,onBlur:K,onMouseUp:G,onMouseDown:B,onClick:V,onMouseOver:U,onMouseOut:q,onMouseEnter:Z,onMouseLeave:Y,onDoubleClick:j,onKeyDown:X,onKeyPress:Q,onKeyUp:J,"data-group-index":e.group.index,"data-range-index":e.range.index},e.children,N.resize&&!e.dragHint&&e.vertical&&k.createElement(k.Fragment,null,k.createElement("span",{className:"k-resize-handle k-resize-n",ref:x}),k.createElement("span",{className:"k-resize-handle k-resize-s",ref:A})),N.resize&&!e.dragHint&&!e.vertical&&k.createElement(k.Fragment,null,k.createElement("span",{className:"k-resize-handle k-resize-w",ref:T}),k.createElement("span",{className:"k-resize-handle k-resize-e",ref:R})),e.resizeHint&&k.createElement(k.Fragment,null,k.createElement("div",{className:"k-marquee-color"}),k.createElement("div",{className:"k-marquee-text"},!e.tail&&k.createElement("div",{className:"k-label-top"},L.formatDate(e.zonedStart,e.format)),!e.head&&k.createElement("div",{className:"k-label-bottom"},L.formatDate(e.zonedEnd,e.format)))))});$n.displayName="KendoReactSchedulerItem";const Kn=k.forwardRef((e,t)=>{const r=k.useMemo(()=>n.classNames("k-event-template",e.className),[e.className]);return k.createElement("div",{ref:t,...e,className:r})}),Bn=(e,t)=>{const{element:r}=e;k.useEffect(()=>{if(!r||!e.syncHeight)return;const t=[[]];Array.from(r.querySelectorAll(e.selector)).filter(t=>!t.classList.contains((e=>e.slice(1,e.length))(e.applyTo))).forEach(r=>{const a=r.clientHeight,n=r.getAttribute(e.horizontalAttribute),l=r.getAttribute(e.verticalAttribute);null===n||null===l||(t[n]||(t[n]=[]),(!t[n][l]||a>t[n][l])&&(t[n][l]=a-1))}),Array.from(r.querySelectorAll(e.applyTo)).forEach(r=>{const a=r.getAttribute(e.horizontalAttribute),n=r.getAttribute(e.verticalAttribute);if(null===a||null===n)return;const l=I(r),o=Math.round(t[a][n]-l);R(r,{height:o},!0)})},t)},Vn=k.forwardRef((e,t)=>{var r;const{item:a,_ref:l,itemRef:s,...c}=e,i=k.useRef(void 0),u=k.useRef(void 0),m=k.useRef(null),p=k.useRef(null),g=k.useRef(null),v=_n(e.editable);k.useImperativeHandle(p,()=>({props:e,element:m.current&&m.current.element})),k.useImperativeHandle(t,()=>p.current),k.useImperativeHandle(l,()=>m.current),k.useImperativeHandle(s,()=>m.current);const E=a||Gn.item,h=o.useInternationalization(),[y]=La(),[f]=Ma(),D=ae(),[C,b]=k.useState(!0),[S,I]=k.useState(!1),x=k.useRef(e.order),A=k.useRef(0),M=k.useRef(!1),N=n.useDir(D),L=k.useMemo(()=>{var t,r;return e.isAllDay?null!=(t=e.title)?t:"":`(${h.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd)}): ${null!=(r=e.title)?r:""}`},[h,e.isAllDay,e.title,e.zonedEnd,e.zonedStart]);let z;e.isRecurring&&!e.isException?z="recurring":!e.isRecurring&&e.isException&&(z="non-recurring");const _=k.useMemo(()=>h.format("{0:t} – {1:t}",e.zonedStart,e.zonedEnd),[h,e.zonedStart,e.zonedEnd]),F=!0===(null==(r=e.range)?void 0:r.isAllDay),O=(e,t)=>{let r=1;return e.forEach(e=>{const a=t.filter(t=>W(e.current.props,t.props));a.length>r&&(r=a.length)}),r},W=(t,r)=>$(t.start,t.end,r.start,r.end)&&t.group.index===r.group.index&&t.range.index===r.range.index&&(void 0===t.range.isAllDay||void 0===r.range.isAllDay||t.range.isAllDay===r.range.isAllDay)&&(e.ignoreIsAllDay||t.isAllDay===r.isAllDay),P=()=>{var t,r,a,n,l,o,s,c;const i=(f||[]).filter(t=>t.current&&W(t.current.props,e)).sort((e,t)=>e.current.props.start.getTime()-t.current.props.start.getTime()),u=m.current&&m.current.element,d=T(i);if(0===i.length)return void b(!1);if(!d.current||!u)return;const p=w(d.current.element),g=[],E=[],h=[];(y||[]).forEach(e=>{e.current&&(e.current.props.dragHint?E.push(e.current):e.current.props.resizeHint?h.push(e.current):g.push(e.current))});const k=e.dragHint||e.resizeHint?((e,t,r,a=!1)=>{let n;return r.forEach(r=>{const l=[];t.sort((e,t)=>e.props.start.getTime()-t.props.start.getTime()).forEach(t=>{if((a||t.props.isAllDay===r.current.props.isAllDay)&&t.props.range.index===r.current.props.range.index&&t.props.group.index===r.current.props.group.index&&$(t.props.start,t.props.end,r.current.props.start,r.current.props.end)){const r=G(l);t===e&&void 0===n&&(n=r),l.splice(r,0,r)}})}),n})(m.current,e.dragHint?E:h,i,e.ignoreIsAllDay):null!=(t=e.order)?t:0;if(e.vertical||e.dragHint||e.resizeHint||null===e.order||void 0===e.order)x.current=k;else{const t=(!0===(null==(r=e.range)?void 0:r.isAllDay)?g.filter(e=>{var t;return!0===(null==(t=e.props.range)?void 0:t.isAllDay)}):e.ignoreIsAllDay?g:g.filter(e=>e.props.isAllDay)).filter(t=>t.props.group.index===e.group.index),l=null==(a=e.style)?void 0:a.height,o="number"==typeof l?l:parseFloat(l),s=null!=l&&Number.isNaN(o),c=!0===(null==(n=e.range)?void 0:n.isAllDay),i=!!e.ignoreIsAllDay&&!c,u=c,d=!!i||!s;x.current=((e,t,r,a=!1,n=!1)=>{var l;const o=t.filter(e=>null!==e.props.order&&void 0!==e.props.order).map(e=>{let t=e.props.start,r=e.props.end;if(e.props.isAllDay||a){t=new Date(t.getFullYear(),t.getMonth(),t.getDate());const e=new Date(r.getFullYear(),r.getMonth(),r.getDate());r=e.getTime()<=t.getTime()?new Date(t.getFullYear(),t.getMonth(),t.getDate()+1):e}else if(n){const e=new Date(t.getFullYear(),t.getMonth(),t.getDate()),a=new Date(r.getFullYear(),r.getMonth(),r.getDate()),n=a.getTime()<r.getTime()?new Date(a.getFullYear(),a.getMonth(),a.getDate()+1):a;t=e,r=n.getTime()<=e.getTime()?new Date(e.getFullYear(),e.getMonth(),e.getDate()+1):n}return{order:e.props.order,start:t,end:r}}),s=Array.from(new Set(o.map(e=>e.order))).sort((e,t)=>e-t),c=new Map;for(const e of o)c.has(e.order)||c.set(e.order,[]),c.get(e.order).push({start:e.start,end:e.end});const i=[],u=new Map;for(const e of s){const t=c.get(e);let a=-1,n=0;u.forEach((a,l)=>{if(l>=e)return;const o=c.get(l);o&&t.some(e=>o.some(t=>$(t.start,t.end,e.start,e.end,r)))&&a+1>n&&(n=a+1)});for(let e=n;e<i.length;e++)if(t.every(t=>i[e].every(e=>!$(e.start,e.end,t.start,t.end,r)))){a=e;break}-1===a&&(a=i.length,i.push([])),i[a].push(...t),u.set(e,a)}return null!=(l=u.get(e))?l:e})(e.order,t,d,i,u)}let D=e.dragHint||e.resizeHint?O(i,e.dragHint?E:h):O(i,g);const C=((e,t)=>e.map(e=>t.filter(t=>W(e.current.props,t.props))))(i,g);let S=0;const N=!e.vertical&&null!==x.current;if(C.forEach(e=>{let t=0;e.forEach(e=>{if(!N){const r=w(e.element);null!==e.props.order&&void 0!==e.props.order&&e.props.order<x.current&&(t=r.top+r.height-p.top-1*x.current+1)}}),t>S&&(S=t)}),N){const t=null==(l=e.style)?void 0:l.height,r="number"==typeof t?t:parseFloat(t);if(null==t)S=26*x.current;else if(Number.isNaN(r)){const t=!0===(null==(o=e.range)?void 0:o.isAllDay),r=!!e.ignoreIsAllDay&&!t,a=(t?g.filter(e=>{var t;return!0===(null==(t=e.props.range)?void 0:t.isAllDay)}):e.ignoreIsAllDay?g:g.filter(e=>e.props.isAllDay)).filter(t=>t.props.group.index===e.group.index&&t.element!==u&&(!r||!d.current||$(t.props.start,t.props.end,d.current.props.start,d.current.props.end))),n=new Map;a.forEach(e=>{var t,r;const a=e._order;if(null==a||a>=x.current)return;const l=(null==(t=e.element)?void 0:t.offsetHeight)||25;n.set(a,Math.max(null!=(r=n.get(a))?r:0,l))}),S=Array.from(n.values()).reduce((e,t)=>e+t+1,0)}else S=x.current*(r+1)}if(0===i.length)return void b(!1);const L=v.add?20:0;p.width=e.vertical?p.width/D-1-L/D:p.width*i.length-1,e.vertical?p.height=p.height*i.length-1:(e.resizeHint||e.dragHint)&&D<=1||(p.height=null!=(c=null==(s=e.style)?void 0:s.height)?c:25),p.left=e.vertical?p.left+x.current*p.width+1*x.current:p.left;const z=!e.vertical&&e.slotHeaderOffset||0;p.top=e.vertical?p.top:p.top+S+1*x.current+z,A.current=D,R(u,p),(M.current||e.dragHint||e.resizeHint)&&I(!0),b(!0)},H=k.useCallback(e=>{const t=e&&e[0],r=g.current;void 0!==i.current&&window.cancelAnimationFrame(i.current),r&&t&&(r.width!==t.contentRect.width||r.height!==t.contentRect.height)&&(i.current=window.requestAnimationFrame(()=>{P()})),g.current={width:t.contentRect.width,height:t.contentRect.height}},[P]);k.useEffect(()=>(P(),void 0!==u.current&&window.cancelAnimationFrame(u.current),u.current=window.requestAnimationFrame(()=>{u.current=window.requestAnimationFrame(()=>{u.current=void 0,P(),M.current=!0,I(!0)})}),()=>{void 0!==u.current&&(window.cancelAnimationFrame(u.current),u.current=void 0)}));const K=m.current&&m.current.element?m.current.element.closest(".k-scheduler-layout"):null;return Bn({element:K,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),k.useEffect(()=>{if(!D.current)return;const e=window.ResizeObserver,t=e&&new e(H);return t&&t.observe(D.current),()=>{t&&t.disconnect()}},[H,D]),k.createElement(E,{...c,_ref:m,_maxSiblingsPerSlot:A,_order:x,itemRef:m,style:{visibility:S?void 0:"hidden",display:C?void 0:"none",...e.style}},!e.resizeHint&&k.createElement(k.Fragment,null,e.tail&&!e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"rtl"===N?"chevron-right":"chevron-left",icon:"rtl"===N?d.chevronRightIcon:d.chevronLeftIcon})),k.createElement("div",{title:L},e.tail&&e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"chevron-up",icon:d.chevronUpIcon})),F&&!e.isAllDay&&!e.tail&&k.createElement("span",{className:"k-event-all-day-time"},h.formatDate(e.zonedStart,"t")),k.createElement(Kn,{className:"k-event-title"},e.title),F&&!e.isAllDay&&!e.head&&k.createElement("span",{className:"k-event-all-day-time"},h.formatDate(e.zonedEnd,"t")),!F&&k.createElement(Kn,{className:"k-event-time"},"recurring"===z&&k.createElement("span",{className:"k-event-recurrence-icon"},k.createElement(n.IconWrap,{name:"arrow-rotate-cw",icon:d.arrowRotateCwIcon})),"non-recurring"===z&&k.createElement("span",{className:"k-event-recurrence-icon"},k.createElement(n.IconWrap,{name:"arrows-no-repeat",icon:d.arrowsNoRepeatIcon})),_),e.head&&e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"chevron-down",icon:d.chevronDownIcon}))),z&&k.createElement("span",{className:"k-event-recurrence-icon"},k.createElement(n.IconWrap,{name:"recurring"===z?"arrow-rotate-cw":"arrows-no-repeat",icon:"recurring"===z?d.arrowRotateCwIcon:d.arrowsNoRepeatIcon})),e.head&&!e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"rtl"===N?"chevron-left":"chevron-right",icon:"rtl"===N?d.chevronLeftIcon:d.chevronRightIcon}))))}),Gn={item:$n};Vn.displayName="KendoReactSchedulerViewItem";const Un=(e,{dateRange:t,fields:r,timezone:a})=>{const l=n.getter(r.recurrenceId||"recurrenceId"),o=n.getter(r.recurrenceRule||"recurrenceRule"),s=new Set(e.filter(e=>null!=l(e)&&!!o(e)).map(l));return e.map(qn(r)).reduce(Zn(t,a,r,s),[]).filter(e=>!W(e.dataItem,r))},qn=e=>t=>{const r=n.getter(e.start||"start")(t),a=n.getter(e.originalStart||"originalStart")(t),l=n.getter(e.recurrenceId||"recurrenceId")(t),o=n.getter(e.recurrenceRule||"recurrenceRule")(t),s=null!=l&&!!o&&null==a,c=n.clone(t);return s&&z(c,e.originalStart||"originalStart",r),{uid:n.getter(e.id||"id")(t),start:r,startTimezone:n.getter(e.startTimezone||"startTimezone")(t),originalStart:s?r:a,end:n.getter(e.end||"end")(t),endTimezone:n.getter(e.endTimezone||"endTimezone")(t),isAllDay:n.getter(e.isAllDay||"isAllDay")(t),title:n.getter(e.title||"title")(t),description:n.getter(e.description||"description")(t),occurrenceId:n.getter("occurrenceId")(t),recurrenceRule:o,recurrenceExceptions:n.getter(e.recurrenceExceptions||"recurrenceExceptions")(t),recurrenceId:l,readonly:n.getter(e.readonly||"readonly")(t),dataItem:c}},Zn=(e,t,r,a)=>(n,l)=>[...n,...!l.recurrenceRule||null!==l.recurrenceId&&void 0!==l.recurrenceId||!W(l.dataItem,r)||a.has(l.uid)?[l]:[...Yn(l,{dateRange:e,timezone:t,fields:r})]],Yn=(e,{dateRange:t,timezone:r,fields:l})=>{const o=e.recurrenceRule,s=g.parseRule({recurrenceRule:o});if(!s)return[];s.start||(s.start=a.ZonedDate.fromLocalDate(e.start,r)),s.end||(s.end=a.ZonedDate.fromLocalDate(e.end,r));const c=e.recurrenceExceptions;c&&(s.exceptionDates=c.map(e=>a.ZonedDate.fromLocalDate(e,r)));const i=s.end.getTime()-s.start.getTime(),u=a.ZonedDate.fromLocalDate(new Date(t.zonedStart.toLocalDate().getTime()-i),r),d=t.zonedEnd,m=g.expand(s,{rangeStart:u,rangeEnd:d});if(!m.events.length)return[];const p=s.until,v=p&&s.bySetPosition?m.events.filter(e=>e.start.getTime()<=p.getTime()):m.events;return v.length?v.map((t,r)=>{const a=n.clone(e),o=n.clone(e.dataItem);return a.recurrenceId=a.uid,z(o,l.recurrenceId,e.uid),a.originalStart=t.start.toLocalDate(),z(o,l.originalStart,t.start.toLocalDate()),a.start=t.start.toLocalDate(),z(o,l.start,t.start.toLocalDate()),a.end=t.end.toLocalDate(),z(o,l.end,t.end.toLocalDate()),a.occurrenceId=String(r),z(o,"occurrenceId",String(r)),a.dataItem=o,a}):[]},jn=(e,{timezone:t,ignoreIsAllDay:r},{groups:n,ranges:o})=>{const s=[];return l.orderBy(e,[{field:"start",dir:"asc"},{field:"end",dir:"desc"},{field:"isAllDay",dir:"desc"},{field:"title",dir:"asc"},{field:"uid",dir:"asc"}]).forEach(e=>{n.forEach(n=>{const l=!!n.isDefault,c=l?Xn(e,n):n;(l||Jn(e,c))&&o.forEach(n=>{var l;if(el(e,n,t,r)){const r=k.createRef(),o=k.createRef(),i=n.end<e.end,u=e.start<n.start,d=a.ZonedDate.fromLocalDate(e.start,t),m=a.ZonedDate.fromLocalDate(e.end,t),p={...e,_ref:o,itemRef:r,head:i,tail:u,order:null,zonedStart:d,zonedEnd:m,group:c,range:n,slots:[],isRecurring:!!e.recurrenceRule,isException:!e.recurrenceRule&&null!==e.recurrenceId&&void 0!==e.recurrenceId,isAllDay:!!e.isAllDay,readonly:null!=(l=e.readonly)?l:void 0};s.push(p)}})})}),s},Xn=(e,t)=>({index:0,resources:t.resources.filter(t=>Qn(e,t))}),Qn=(e,t)=>t.multiple?(e.dataItem[t.field]||[]).some(e=>t[t.valueField]===e):e.dataItem[t.field]===t[t.valueField],Jn=(e,t)=>!t.resources.some(t=>t.multiple?!(e.dataItem[t.field]||[]).some(e=>t[t.valueField]===e):e.dataItem[t.field]!==t[t.valueField]),el=(e,t,r,a)=>!!$(t.start,t.end,e.start,e.end)&&(!(void 0!==t.isAllDay&&!a&&!!e.isAllDay!=!!t.isAllDay)||!(!t.isAllDay||e.isAllDay)&&A(e.start,e.end,r)),tl=e=>{const t=xa(),{timezone:r}=le(),a=me(),n=ie(),l=ge(),[o]=Ma(),s=e.viewItem||rl.viewItem,c=k.useMemo(()=>Un([e.dataItem],{dateRange:l,fields:n,timezone:r}),[e.dataItem,l,n,r]),i=k.useMemo(()=>{const r=!0===e.ignoreIsAllDay;return t.filter(e=>void 0===e.isAllDay||e.isAllDay===r)},[t,e.ignoreIsAllDay]),u=k.useMemo(()=>jn(c,{timezone:r,ignoreIsAllDay:e.ignoreIsAllDay},{groups:a,ranges:i}),[c,r,a,i,e.ignoreIsAllDay]),d=(o||[]).map(e=>e.current.props);return q(u,d,e.ignoreIsAllDay),k.createElement(k.Fragment,null,u.map((t,r)=>k.createElement(s,{key:r,...t,item:e.item,dragHint:!0,vertical:e.vertical,ignoreIsAllDay:e.ignoreIsAllDay})))},rl={viewItem:Vn,item:$n};tl.displayName="KendoReactSchedulerDrag";const al=e=>{const t=xa(),{timezone:r}=le(),a=me(),n=ie(),l=ge(),[o]=Ma(),s=e.viewItem||nl.viewItem,c=k.useMemo(()=>Un([e.dataItem],{dateRange:l,fields:n,timezone:r}),[e.dataItem,l.start.getTime(),l.end.getTime(),n,r]),i=k.useMemo(()=>{const r=!0===e.ignoreIsAllDay;return t.filter(e=>void 0===e.isAllDay||e.isAllDay===r)},[t,e.ignoreIsAllDay]),u=k.useMemo(()=>jn(c,{timezone:r,ignoreIsAllDay:e.ignoreIsAllDay},{groups:a,ranges:i}),[c,r,a,i,e.ignoreIsAllDay]),d=(o||[]).map(e=>e.current.props);return q(u,d,e.ignoreIsAllDay),k.createElement(k.Fragment,null,u.map((t,r)=>{var a;return k.createElement(s,{key:r,...t,format:e.format,item:null!=(a=e.item)?a:nl.item,resizeHint:!0,vertical:e.vertical,ignoreIsAllDay:e.ignoreIsAllDay})}))},nl={viewItem:Vn,item:$n};al.displayName="KendoReactSchedulerResize";const ll=k.createContext([null]);ll.displayName="SchedulerEditItemPropsContext";const ol=k.createContext([null,n.noop,n.noop]);ol.displayName="SchedulerEditItemFormItemContext";const sl=k.createContext([null,n.noop,n.noop]);sl.displayName="SchedulerEditItemDragItemContext";const cl=k.createContext([null,n.noop,n.noop]);cl.displayName="SchedulerEditItemResizeItemContext";const il=k.createContext([null,n.noop,n.noop]);il.displayName="SchedulerEditItemRemoveItemContext";const ul=k.createContext([!1,n.noop,n.noop]);ul.displayName="SchedulerEditItemShowRemoveDialogContext";const dl=k.createContext([!1,n.noop,n.noop]);dl.displayName="SchedulerEditItemShowOccurrenceDialogContext";const ml=({props:e,form:t,drag:r,resize:a,remove:n,showRemoveDialog:l,showOccurrenceDialog:o,children:s})=>k.createElement(ll.Provider,{value:e},k.createElement(ol.Provider,{value:t},k.createElement(sl.Provider,{value:r},k.createElement(cl.Provider,{value:a},k.createElement(il.Provider,{value:n},k.createElement(ul.Provider,{value:l},k.createElement(dl.Provider,{value:o},s)))))));var pl=(e=>(e.set="FORM_ITEM_SET",e.setMaster="FORM_ITEM_SET_MASTER",e.reset="FORM_ITEM_RESET",e.complete="FORM_ITEM_COMPLETE",e))(pl||{});var gl=(e=>(e.set="SHOW_OCCURRENCE_DIALOG_SET",e.open="SHOW_OCCURRENCE_DIALOG_OPEN",e.close="SHOW_OCCURRENCE_DIALOG_CLOSE",e.reset="SHOW_OCCURRENCE_DIALOG_RESET",e.toggle="SHOW_OCCURRENCE_DIALOG_TOGGLE",e))(gl||{});var vl=(e=>(e.set="REMOVE_ITEM_SET",e.reset="REMOVE_ITEM_RESET",e.complete="REMOVE_ITEM_COMPLETE",e))(vl||{});var El=(e=>(e.set="SHOW_REMOVE_DIALOG_SET",e.open="SHOW_REMOVE_DIALOG_OPEN",e.close="SHOW_REMOVE_DIALOG_CLOSE",e.reset="SHOW_REMOVE_DIALOG_RESET",e.toggle="SHOW_REMOVE_DIALOG_TOGGLE",e))(El||{});var hl=(e=>(e.set="DRAG_ITEM_SET",e.start="DRAG_ITEM_START",e.drag="DRAG_ITEM_DRAG",e.complete="DRAG_ITEM_COMPLETE",e.completeOccurrence="DRAG_ITEM_COMPLETE_OCCURRENCE",e.completeSeries="DRAG_ITEM_COMPLETE_SERIES",e.reset="DRAG_ITEM_RESET",e.dragSelected="DRAG_ITEM_DRAG_SELECTED",e))(hl||{});var yl=(e=>(e.set="RESIZE_ITEM_SET",e.start="RESIZE_ITEM_START",e.startDrag="RESIZE_ITEM_START_DRAG",e.startDragSelected="RESIZE_ITEM_START_DRAG_SELECTED",e.endDrag="RESIZE_ITEM_END_DRAG",e.endDragSelected="RESIZE_ITEM_END_DRAG_SELECTED",e.complete="RESIZE_ITEM_COMPLETE",e.completeOccurrence="RESIZE_ITEM_COMPLETE_OCCURRENCE",e.completeSeries="RESIZE_ITEM_COMPLETE_SERIES",e.reset="RESIZE_ITEM_RESET",e))(yl||{});var fl=(e=>(e.reset="SERIES_RESET",e.set="SERIES_SET",e.toggle="SERIES_TOGGLE",e))(fl||{});const kl=(e,t,r)=>{const[a,n]=we(e,t,r);return[a,n,e=>{const t=((e,t)=>{switch(t.type){case"SERIES_RESET":return null;case"SERIES_SET":return t.payload;case"SERIES_TOGGLE":return!e;default:return e}})(a,e);n(t)}]},Dl={position:"right",collision:{horizontal:"fit",vertical:"fit"}},Cl={skeleton:"MMMMd"},bl="t",Sl=e=>{const{show:t,anchor:r,dataItem:l,fields:c,position:i,collision:u,isRecurring:p,canEdit:g,canRemove:E,onEdit:h,onEditOccurrence:f,onEditSeries:D,onDelete:C,onDeleteOccurrence:b,onDeleteSeries:S,onClose:w}=e,I=o.useInternationalization(),R=o.useLocalization(),{timezone:T}=le(),x=k.useRef(null);k.useEffect(()=>{if(!t)return;const e=e=>{const t=e.target,a=x.current&&x.current.element&&x.current.element.closest(".k-popover"),n=!!a&&a.contains(t),l=!!r&&r.contains(t);!n&&!l&&w()};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[t,r,w]),Mn(t,r,w),k.useEffect(()=>{if(t&&(g||E)&&x.current&&x.current.element){const e=x.current.element.closest(".k-popover"),t=e&&(e.querySelector(".k-popover-actions .k-button-primary")||e.querySelector(".k-popover-actions .k-button"));t&&t.focus()}},[t,g,E]);const A=k.useCallback(()=>{w()},[w]),M=R.toLanguageString(Lr,_r[Lr]),N=R.toLanguageString(zr,_r[zr]),z=L(l,c.title)||R.toLanguageString(Yt,_r[Yt]),_=L(l,c.start),F=L(l,c.end),O=!!L(l,c.isAllDay),W=L(l,c.description),P=R.toLanguageString(Me,_r[Me]),H=k.useMemo(()=>{if(!_||!F)return"";const e=a.ZonedDate.fromLocalDate(_,T),t=a.ZonedDate.fromLocalDate(F,T),r=0===t.getHours()&&0===t.getMinutes()&&0===t.getSeconds()&&0===t.getMilliseconds()?t.addDays(-1):t,n=e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate();return O?n?`${I.formatDate(e,Cl)}, ${P}`:`${I.formatDate(e,Cl)} - ${I.formatDate(r,Cl)}, ${P}`:n?`${I.formatDate(e,Cl)}, ${I.formatDate(e,bl)} - ${I.formatDate(t,bl)}`:`${I.formatDate(e,Cl)}, ${I.formatDate(e,bl)} - ${I.formatDate(t,Cl)}, ${I.formatDate(t,bl)}`},[I,_,F,O,P,T]),$=k.useMemo(()=>[{text:R.toLanguageString(Ve,_r[Ve]),scope:"occurrence"},{text:R.toLanguageString(Ge,_r[Ge]),scope:"series"}],[R]),K=k.useMemo(()=>[{text:R.toLanguageString(Kt,_r[Kt]),scope:"occurrence"},{text:R.toLanguageString(Bt,_r[Bt]),scope:"series"}],[R]),B=k.useCallback(e=>{"series"===e.item.scope?D():f()},[f,D]),V=k.useCallback(e=>{"series"===e.item.scope?S():b()},[b,S]),G=g||E;return k.createElement(y.Popover,{anchor:r,show:t,position:i,collision:u,callout:!1,title:z,style:{width:360},onKeyDown:A,autoFocus:!1,animate:{openDuration:1,closeDuration:1}},k.createElement(m.FormElement,{ref:x,horizontal:!0,className:"k-scheduler-edit-form"},k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},k.createElement(n.SvgIcon,{icon:d.clockIcon,size:"xlarge"})),k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-scheduler-edit-form-row k-color-subtle"},H))),W&&k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},k.createElement(n.SvgIcon,{icon:d.commentIcon,size:"xlarge"})),k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-scheduler-edit-form-row"},W)))),G&&k.createElement(y.PopoverActionsBar,{alignment:"end"},E&&(p?k.createElement(s.DropDownButton,{text:N,items:K,textField:"text",onItemClick:V}):k.createElement(s.Button,{type:"button",onClick:C},N)),g&&(p?k.createElement(s.DropDownButton,{text:M,themeColor:"primary",items:$,textField:"text",onItemClick:B}):k.createElement(s.Button,{type:"button",themeColor:"primary",onClick:h},M))))};Sl.displayName="KendoReactSchedulerEventOverviewPopover";const wl=e=>{const{onKeep:t,onReset:r,onCancel:a}=e,l=o.useLocalization(),c=l.toLanguageString(dr,_r[dr]),i=l.toLanguageString(mr,_r[mr]),u=l.toLanguageString(pr,_r[pr]),d=l.toLanguageString(gr,_r[gr]),m=l.toLanguageString(vr,_r[vr]),g=k.createElement(p.Dialog,{title:c,onClose:a,width:510},k.createElement("p",null,i),k.createElement(p.DialogActionsBar,{layout:"start"},k.createElement(s.Button,{fillMode:"flat",onClick:a},m),k.createElement("span",{className:"k-spacer"}),k.createElement(s.Button,{onClick:r},d),k.createElement(s.Button,{themeColor:"primary",onClick:t},u)));return n.canUseDOM?D.createPortal(g,document.body):null};wl.displayName="KendoReactKeepResetCustomEventsDialog";const Il=e=>!0===e||"object"==typeof e&&null!==e&&!0===e.drag,Rl=k.forwardRef((e,t)=>{var r;const{_ref:a,itemRef:l,onDataAction:o,ignoreIsAllDay:s,viewItem:c,series:i,onSeriesChange:u,form:d,formItem:m,onFormItemChange:p,drag:g,dragItem:v,onDragItemChange:E,resize:h,resizeItem:y,onResizeItemChange:f,removeDialog:D,removeItem:C,onRemoveItemChange:b,occurrenceDialog:S,showOccurrenceDialog:w,onShowOccurrenceDialogChange:I,showRemoveDialog:R,onShowRemoveDialogChange:T,onFocus:x,onFocusAction:A,onMouseDown:M,onMouseDownAction:_,onMouseUp:F,onMouseUpAction:W,onClick:P,onClickAction:H,onDoubleClick:$,onDoubleClickAction:K,onRemoveClick:B,onRemoveClickAction:V,onPress:G,onPressAction:U,onDrag:q,onDragAction:Z,onRelease:Y,onReleaseAction:j,onResizePress:X,onResizePressAction:Q,onResizeStartDrag:J,onResizeStartDragAction:ee,onResizeEndDrag:re,onResizeEndDragAction:ae,onResizeRelease:ne,onResizeReleaseAction:oe,onOccurrenceClick:se,onOccurrenceClickAction:ce,onSeriesClick:ue,onSeriesClickAction:de,onKeyDown:pe,onKeyDownAction:ge,onKeyUp:ve,onKeyUpAction:Ee,onRemoveConfirm:he,onRemoveConfirmAction:ye,onFormSubmit:fe,onFormSubmitAction:De,onCancel:Ce,onCancelAction:Se}={...Tl,...e},[Ie,Re]=k.useState(e.tabIndex),Te=k.useRef(null),xe=k.useRef(null),Ae=n.useId();k.useImperativeHandle(Te,()=>({props:e,element:xe.current&&xe.current.element})),k.useImperativeHandle(t,()=>Te.current),k.useImperativeHandle(a,()=>xe.current),k.useImperativeHandle(l,()=>xe.current);const Me=c||Tl.viewItem,Ne=g||Tl.drag,Le=h||Tl.resize,ze=d||Tl.form,_e=S||Tl.occurrenceDialog,Fe=D||Tl.removeDialog,Oe=_n(e.editable),We=ie(),Pe=le(),[He]=ke(),$e=!1!==Pe.eventOverview,Ke=Dl,[Be,Ve]=k.useState(null),Ge=k.useRef(null),Ue=Fn(),[qe,Ze]=Fa(),[Ye,je]=k.useState(null),Xe=k.useRef(null),Qe=k.useCallback(e=>{const t=Array.isArray(e)?e[0]:e;if(!t)return!1;const r=L(t,We.recurrenceId),a=null!=r?r:L(t,We.id),n=He.find(e=>L(e,We.id)===a),l=n&&L(n,We.recurrenceExceptions);return Array.isArray(l)&&l.length>0},[We,He]),Je=k.useCallback((e,t)=>{e&&e.series&&(e.type===te.update||e.type===te.remove)&&Qe(e.dataItem)?je({action:e,event:t,fromForm:null!==Xe.current}):o&&o(e,t)},[o,Qe]),[et,,tt]=kl(null,i,u),[rt,at,nt]=((e,t)=>{const[r,a]=we(...t),l=ie(),[o]=ke();return[r,a,(t,s)=>{let c;switch(t.type){case"FORM_ITEM_SET":c=t.payload;break;case"FORM_ITEM_RESET":c=null;break;case"FORM_ITEM_SET_MASTER":c=n.clone(O(t.payload,l,o));break;case"FORM_ITEM_COMPLETE":e.onDataAction&&r&&(e.onDataAction.call(void 0,{type:te.update,series:e.series,dataItem:t.payload}),c=null);break;default:c=r}a(c,s)}]})({series:et,onDataAction:Je},[null,m,p]),[lt,ot,st]=((e,t)=>{const r=k.useRef(0),a=k.useRef(0),l=k.useRef(0),o=k.useRef(null),s=k.useRef(!1),[c,i]=we(...t),[u]=Fa(),d=ie(),m=me();return[c,i,t=>{switch(t.type){case"DRAG_ITEM_SET":i(t.payload);break;case"DRAG_ITEM_RESET":i(null);break;case"DRAG_ITEM_DRAG_SELECTED":{if(Math.abs(a.current-t.payload.x)<10&&Math.abs(l.current-t.payload.y)<10)return;const c=N(t.payload.x,t.payload.y,7);if(!c||c===o.current)return;const m=n.clone(e.dataItem),p=c.getAttribute("data-slot-start"),g="true"===c.getAttribute("data-slot-allday");if(!e.ignoreIsAllDay&&g!==e.isAllDay||s.current&&!g)return;const v=new Date(L(m,d.start)),E=Number(p)-Number(r.current)-v.getTime(),h=u.map(e=>{if(!e.current)return null;const t=n.clone(e.current.props.dataItem),r=new Date(e.current.props.start.getTime()+E),a=new Date(e.current.props.end.getTime()+E);return z(t,d.start,r),z(t,d.end,a),t}).filter(Boolean);o.current=c,i([...h]);break}case"DRAG_ITEM_START":{const o=t.payload.x,c=t.payload.y;a.current=o,l.current=c;const i=N(o,c,7);if(!i)return;s.current="true"===i.getAttribute("data-slot-allday");const u=n.clone(e.dataItem),m=i.getAttribute("data-slot-start"),p=L(u,d.start);if(null===m)return;r.current=Number(m)-new Date(p).getTime();break}case"DRAG_ITEM_DRAG":{if(Math.abs(a.current-t.payload.x)<10&&Math.abs(l.current-t.payload.y)<10)return;const c=N(t.payload.x,t.payload.y,7);if(!c||c===o.current)return;const u=n.clone(e.dataItem),p=c.getAttribute("data-slot-start"),g=c.getAttribute("data-slot-group"),v="true"===c.getAttribute("data-slot-allday");if(!e.ignoreIsAllDay&&v!==e.isAllDay||s.current&&!v)return;const E=new Date(L(u,d.start)),h=new Date(L(u,d.end)).getTime()-E.getTime(),y=new Date(Number(p)-Number(r.current)),f=new Date(Number(p)-Number(r.current)+h),k=m.find(e=>e.index===Number(g));z(u,d.start,y),z(u,d.end,f),k&&m.length>1&&k.resources.forEach(e=>{e.multiple||z(u,e.field,e[e.valueField])}),o.current=c,u&&i(u);break}case"DRAG_ITEM_COMPLETE":i(null),e.onDataAction&&c&&e.onDataAction.call(void 0,{type:te.update,series:!1,dataItem:c});break;case"DRAG_ITEM_COMPLETE_OCCURRENCE":{const t=Array.isArray(c)?c.slice():n.clone(c);i(null),e.onDataAction&&t&&e.onDataAction.call(void 0,{type:te.update,series:!1,dataItem:t});break}case"DRAG_ITEM_COMPLETE_SERIES":{let t;if(Array.isArray(c))t=c.map(e=>{const t=n.clone(e);return z(t,d.start,L(e,d.start)),z(t,d.end,L(e,d.end)),t});else{const e=n.clone(c);z(e,d.start,L(c,d.start)),z(e,d.end,L(c,d.end)),t=e}i(null),e.onDataAction&&t&&e.onDataAction.call(void 0,{type:te.update,series:!0,dataItem:t});break}default:i(c)}}]})({dataItem:e.dataItem,ignoreIsAllDay:e.ignoreIsAllDay,isAllDay:e.isAllDay,onDataAction:Je},[null,v,E]),[ct,it,ut]=((e,t)=>{const r=k.useRef(null),[a,l]=we(...t),[o]=Fa(),s=ie(),c=t=>void 0===e.rangeIsAllDay||"true"===t.getAttribute("data-slot-allday")===e.rangeIsAllDay;return[a,l,(t,i)=>{let u=a;switch(t.type){case"RESIZE_ITEM_SET":u=t.payload;break;case"RESIZE_ITEM_RESET":default:u=null;break;case"RESIZE_ITEM_START":{if(i.stopPropagation(),!u)return;const a=t.payload.x,l=t.payload.y,o=N(a,l,7);if(!o||o===r.current||!c(o))return;const d=o.getAttribute("data-slot-start"),m=new Date(Number(d)),p=n.clone(e.dataItem);if(m>=L(p,s.end)){r.current=null,u=null;break}z(p,s.start,m),r.current=o,u=p;break}case"RESIZE_ITEM_START_DRAG_SELECTED":{i.stopPropagation();const a=t.payload.x,l=t.payload.y,d=n.clone(e.dataItem),m=N(a,l,7);if(!m||m===r.current||!c(m))return;const p=m.getAttribute("data-slot-start"),g=new Date(L(d,s.start)),v=new Date(Number(p)).getTime()-g.getTime();let E=!1;const h=o.map(e=>{if(!e.current)return null;const t=n.clone(e.current.props.dataItem),r=new Date(e.current.props.start.getTime()+v);if(!(r>=L(t,s.end)))return z(t,s.start,r),t;E=!0}).filter(Boolean);E?(r.current=null,u=null):u=[...h];break}case"RESIZE_ITEM_START_DRAG":{const a=t.payload.x,l=t.payload.y,o=N(a,l,7);if(!o||o===r.current||!c(o))return;const i=o.getAttribute("data-slot-start"),d=new Date(Number(i)),m=n.clone(e.dataItem);if(d>=m.end){r.current=null,u=null;break}z(m,s.start,d),r.current=o,u=m;break}case"RESIZE_ITEM_END_DRAG":{const a=t.payload.x,l=t.payload.y,o=N(a,l,7);if(!o||o===r.current||!c(o))return;const i=o.getAttribute("data-slot-end"),d=new Date(Number(i)),m=n.clone(e.dataItem);if(d<=m.start){r.current=null,u=null;break}z(m,s.end,d),r.current=o,u=m;break}case"RESIZE_ITEM_END_DRAG_SELECTED":{i.stopPropagation();const a=t.payload.x,l=t.payload.y,d=n.clone(e.dataItem),m=N(a,l,7);if(!m||m===r.current||!c(m))return;const p=m.getAttribute("data-slot-start"),g=new Date(L(d,s.end)),v=new Date(Number(p)).getTime()-g.getTime();let E;const h=o.map(e=>{if(!e.current)return null;const t=n.clone(e.current.props.dataItem),r=new Date(e.current.props.end.getTime()+v);if(!(r<=L(t,s.start)))return z(t,s.end,r),t;E=!0}).filter(Boolean);E?(r.current=null,u=null):u=[...h];break}case"RESIZE_ITEM_COMPLETE":case"RESIZE_ITEM_COMPLETE_OCCURRENCE":u=null,e.onDataAction&&a&&e.onDataAction.call(void 0,{type:te.update,series:!1,dataItem:a});break;case"RESIZE_ITEM_COMPLETE_SERIES":{let t;if(u=null,Array.isArray(a))t=a.map(e=>{const t=n.clone(e);return z(t,s.start,L(e,s.start)),z(t,s.end,L(e,s.end)),t});else{const e=n.clone(a);z(e,s.start,L(a,s.start)),z(e,s.end,L(a,s.end)),t=e}e.onDataAction&&t&&e.onDataAction.call(void 0,{type:te.update,series:!0,dataItem:t});break}}l(u)}]})({dataItem:e.dataItem,rangeIsAllDay:null==(r=e.range)?void 0:r.isAllDay,onDataAction:Je},[null,y,f]),[dt,mt,pt]=((e,t)=>{const[r,a]=we(...t);return[r,a,t=>{let n;switch(t.type){case"REMOVE_ITEM_SET":n=t.payload;break;case"REMOVE_ITEM_RESET":n=null;break;case"REMOVE_ITEM_COMPLETE":e.onDataAction&&r&&e.onDataAction.call(void 0,{type:te.remove,series:e.series,dataItem:r}),n=null;break;default:n=r}a(n)}]})({series:et,onDataAction:Je},[null,C,b]);Xe.current=rt;const[gt,vt,Et]=((e,t,r)=>{const[a,n]=we(e,t,r);return[a,n,e=>{const t=((e,t)=>{switch(t.type){case"SHOW_REMOVE_DIALOG_RESET":case"SHOW_REMOVE_DIALOG_CLOSE":return!1;case"SHOW_REMOVE_DIALOG_SET":return t.payload;case"SHOW_REMOVE_DIALOG_OPEN":return!0;case"SHOW_REMOVE_DIALOG_TOGGLE":return!e;default:return e}})(a,e);n(t)}]})(!1,R,T),[ht,yt,ft]=((e,t,r)=>{const[a,n]=we(e,t,r);return[a,n,e=>{const t=((e,t)=>{switch(t.type){case"SHOW_OCCURRENCE_DIALOG_RESET":case"SHOW_OCCURRENCE_DIALOG_CLOSE":return!1;case"SHOW_OCCURRENCE_DIALOG_SET":return t.payload;case"SHOW_OCCURRENCE_DIALOG_OPEN":return!0;case"SHOW_OCCURRENCE_DIALOG_TOGGLE":return!e;default:return e}})(a,e);n(t)}]})(!1,w,I),[kt]=La(),[,Dt]=k.useContext(Oa),[,Ct]=Pa(),bt=!!(xe.current&&qe&&qe.some(e=>e.current===xe.current)),St=k.useMemo(()=>({selected:bt,series:et,formItem:rt,dragItem:lt,resizeItem:ct,removeItem:dt,showRemoveDialog:gt,showOccurrenceDialog:ht}),[lt,rt,dt,ct,bt,et,ht,gt]),wt=k.useMemo(()=>({[fl.set]:tt,[fl.toggle]:tt,[fl.reset]:tt,[$a.select]:Ze,[$a.add]:Ze,[$a.remove]:Ze,[$a.reset]:Ze,[$a.selectNext]:Ze,[$a.selectPrev]:Ze,[pl.set]:nt,[pl.setMaster]:nt,[pl.reset]:nt,[pl.complete]:nt,[vl.set]:pt,[vl.reset]:pt,[vl.complete]:pt,[gl.close]:ft,[gl.open]:ft,[gl.set]:ft,[gl.toggle]:ft,[gl.reset]:ft,[El.close]:Et,[El.open]:Et,[El.set]:Et,[El.toggle]:Et,[El.reset]:Et,[hl.start]:st,[hl.drag]:st,[hl.complete]:st,[hl.completeOccurrence]:st,[hl.completeSeries]:st,[hl.set]:st,[hl.reset]:st,[hl.dragSelected]:st,[yl.start]:ut,[yl.startDrag]:ut,[yl.startDragSelected]:ut,[yl.endDrag]:ut,[yl.endDragSelected]:ut,[yl.complete]:ut,[yl.completeOccurrence]:ut,[yl.completeSeries]:ut,[yl.set]:ut,[yl.reset]:ut,[Ya.next]:Dt,[Ya.prev]:Dt,[Va.left]:Ct,[Va.right]:Ct,[Va.up]:Ct,[Va.down]:Ct,null:()=>{}}),[st,nt,Ze,pt,ut,tt,ft,Et,Dt,Ct]),It=k.useCallback(t=>{if(A){const r=A(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t)):wt[r.type]({...r,item:xe}))}x&&x.call(void 0,t)},[wt,x,A,e,St]),Rt=k.useCallback(t=>{if(_){const r=_(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t)):wt[r.type]({...r,item:xe}))}M&&M.call(void 0,t)},[wt,M,_,e,St]),Tt=k.useCallback(t=>{if(W){const r=W(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t)):wt[r.type]({...r,item:xe}))}F&&F.call(void 0,t)},[wt,F,W,e,St]),[,xt]=k.useContext(be),At=k.useCallback(t=>{if(H){xt(xe.current);const r=H(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t)):wt[r.type]({...r,item:xe}))}P&&P.call(void 0,t),$e&&Ue.schedule(()=>{Ge.current=xe.current&&xe.current.element,Ve(e.dataItem)})},[wt,P,H,e,St,$e,Ue]),Mt=k.useCallback(t=>{if(Ue.cancel(),Ve(null),K){const r=K(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t)):wt[r.type]({...r,item:xe}))}$&&$.call(void 0,t)},[K,$,e,wt,St,Ue]),Nt=k.useCallback(t=>{if(V){const r=V(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t)):wt[r.type]({...r,item:xe}))}B&&B.call(void 0,t)},[V,B,e,wt,St]),Lt=k.useCallback(t=>{if(U){const r=U(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t)):wt[r.type]({...r,item:xe},t))}G&&G.call(void 0,t)},[U,G,e,wt,St]),zt=k.useCallback(t=>{if(Z){const r=Z(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t.dragEvent.originalEvent)):wt[r.type]({...r,item:xe},t.dragEvent.originalEvent))}q&&q.call(void 0,t)},[Z,q,e,wt,St]),_t=k.useCallback(t=>{if(j){const r=j(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t.dragEvent.originalEvent)):wt[r.type]({...r,item:xe},t.dragEvent.originalEvent))}Y&&Y.call(void 0,t)},[j,Y,e,wt,St]),Ft=k.useCallback(t=>{if(Q){const r=Q(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t.dragEvent.originalEvent)):wt[r.type]({...r,item:xe},t.dragEvent.originalEvent))}X&&X.call(void 0,t)},[Q,X,e,St,wt]),Ot=k.useCallback(t=>{if(ee){const r=ee(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t.dragEvent.originalEvent)):wt[r.type]({...r,item:xe},t.dragEvent.originalEvent))}J&&J.call(void 0,t)},[J,ee,e,wt,St]),Wt=k.useCallback(t=>{if(ae){const r=ae(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t.dragEvent.originalEvent)):wt[r.type]({...r,item:xe},t.dragEvent.originalEvent))}re&&re.call(void 0,t)},[re,ae,e,wt,St]),Pt=k.useCallback(t=>{if(oe){const r=oe(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t.dragEvent.originalEvent)):wt[r.type]({...r,item:xe},t.dragEvent.originalEvent))}ne&&ne.call(void 0,t)},[oe,ne,e,wt,St]),Ht=k.useCallback(t=>{if(De){const r=De(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t)):wt[r.type]({...r,item:xe},t))}fe&&fe.call(void 0,t)},[De,fe,e,St,wt]),$t=k.useCallback(t=>{if(Se){const r=Se(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t)):wt[r.type]({...r,item:xe},t))}Ce&&Ce.call(void 0,t)},[Se,Ce,e,St,wt]),Kt=k.useCallback(t=>{if(ce){const r=ce(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t)):wt[r.type]({...r,item:xe},t))}se&&se.call(void 0,t)},[ce,se,e,St,wt]),Bt=k.useCallback(t=>{if(de){const r=de(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t)):wt[r.type]({...r,item:xe},t))}ue&&ue.call(void 0,t)},[de,ue,e,St,wt]),Vt=k.useCallback(t=>{if($e&&t.syntheticEvent.keyCode===n.Keys.enter)return t.syntheticEvent.preventDefault(),Ge.current=xe.current&&xe.current.element,Ve(e.dataItem),void(pe&&pe.call(void 0,t));if(ge){const r=ge(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t.syntheticEvent)):wt[r.type]({...r,item:xe},t.syntheticEvent))}pe&&pe.call(void 0,t)},[ge,pe,e,St,wt,$e]),Gt=k.useCallback(t=>{if(Ee){const r=Ee(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t.syntheticEvent)):wt[r.type]({...r,item:xe},t.syntheticEvent))}ve&&ve.call(void 0,t)},[Ee,ve,e,St,wt]),Ut=k.useCallback(e=>{pt({type:vl.set,payload:e.value||rt}),Et({type:El.open})},[pt,Et,rt]),qt=k.useCallback(t=>{if(ye){const r=ye(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t.syntheticEvent)):wt[r.type]({...r,item:xe},t.syntheticEvent))}he&&he.call(void 0,t)},[ye,he,e,St,wt]),Zt=k.useCallback(e=>{rt?(pt({type:vl.reset}),Et({type:El.close})):$t(e)},[rt,pt,Et,$t]),Yt=k.useCallback(()=>{Ve(null),Ge.current&&Ge.current.focus({preventScroll:!0})},[]),jt=k.useCallback(()=>{Ye&&o&&o(Ye.action,Ye.event),je(null)},[Ye,o]),Xt=k.useCallback(()=>{Ye&&o&&o({...Ye.action,resetExceptions:!0},Ye.event),je(null)},[Ye,o]),Qt=k.useCallback(()=>{const e=Ye;je(null),e&&e.fromForm&&!Array.isArray(e.action.dataItem)&&nt({type:pl.set,payload:e.action.dataItem})},[Ye,nt]),Jt=k.useCallback(()=>{Ve(null),nt({type:pl.set,payload:e.dataItem})},[nt,e.dataItem]),er=k.useCallback(()=>{Ve(null),tt({type:fl.set,payload:!1}),nt({type:pl.set,payload:e.dataItem})},[tt,nt,e.dataItem]),tr=k.useCallback(()=>{Ve(null),tt({type:fl.set,payload:!0}),nt({type:pl.setMaster,payload:e.dataItem})},[tt,nt,e.dataItem]),rr=k.useCallback(()=>{Ve(null),pt({type:vl.set,payload:e.dataItem}),Et({type:El.open})},[pt,Et,e.dataItem]),ar=k.useCallback(()=>{Ve(null),tt({type:fl.set,payload:!1}),pt({type:vl.set,payload:e.dataItem}),Et({type:El.open})},[tt,pt,Et,e.dataItem]),nr=k.useCallback(()=>{Ve(null),tt({type:fl.set,payload:!0}),pt({type:vl.set,payload:e.dataItem}),Et({type:El.open})},[tt,pt,Et,e.dataItem]);return k.useEffect(()=>{const t=kt.length&&kt[0].current===xe.current;Re(void 0!==e.tabIndex?null===e.tabIndex?void 0:e.tabIndex:0===qe.length&&t?0:void 0)},[kt,e.tabIndex,qe.length]),k.createElement(ml,{props:e,form:[rt,at,nt],drag:[lt,ot,st],resize:[ct,it,ut],remove:[dt,mt,pt],showRemoveDialog:[gt,vt,Et],showOccurrenceDialog:[ht,yt,ft]},k.createElement(Me,{...e,_ref:xe,itemRef:xe,selected:bt,dragSource:!!lt&&Oe.drag,tabIndex:Ie,id:Ae,onKeyDown:Vt,onKeyUp:Gt,onFocus:It,onMouseUp:Tt,onMouseDown:Rt,onClick:At,onDoubleClick:Mt,onRemoveClick:Nt,onPress:Lt,onDrag:zt,onRelease:_t,onResizePress:Ft,onResizeEndDrag:Wt,onResizeStartDrag:Ot,onResizeRelease:Pt}),lt&&Oe.drag&&(Array.isArray(lt)?lt.map((t,r)=>k.createElement(Ne,{key:r,ignoreIsAllDay:s,dataItem:t,vertical:e.vertical,viewItem:Me,item:e.item})):k.createElement(Ne,{ignoreIsAllDay:s,dataItem:lt,vertical:e.vertical,viewItem:Me,item:e.item})),ct&&Oe.resize&&(Array.isArray(ct)?ct.map((t,r)=>k.createElement(Le,{key:r,format:e.format,ignoreIsAllDay:s,dataItem:t,viewItem:e.viewItem,item:e.item,vertical:e.vertical})):k.createElement(Le,{format:e.format,ignoreIsAllDay:s,dataItem:ct,viewItem:e.viewItem,item:e.item,vertical:e.vertical})),rt&&!ht&&Oe.edit&&k.createElement(ze,{dataItem:rt,onSubmit:Ht,onClose:$t,onCancel:$t,onDelete:Oe.remove?Ut:void 0}),ht&&k.createElement(_e,{dataItem:rt||lt||ct||dt,isRemove:null!==dt,onClose:$t,onOccurrenceClick:Kt,onSeriesClick:Bt}),Ye&&k.createElement(wl,{onKeep:jt,onReset:Xt,onCancel:Qt}),gt&&dt&&Oe.remove&&k.createElement(Fe,{dataItem:dt,isSeries:!0===et,onClose:Zt,onCancel:Zt,onConfirm:qt}),Be&&k.createElement(Sl,{show:!0,anchor:Ge.current,dataItem:Be,fields:We,position:Ke.position,collision:Ke.collision,isRecurring:!!e.isRecurring,canEdit:Oe.edit&&!e.readonly,canRemove:Oe.remove&&!e.readonly,onEdit:Jt,onEditOccurrence:er,onEditSeries:tr,onDelete:rr,onDeleteOccurrence:ar,onDeleteSeries:nr,onClose:Yt}))}),Tl={viewItem:Vn,drag:tl,resize:al,form:wa,occurrenceDialog:Pn,removeDialog:Hn,onClickAction:(e,t,r)=>[{type:e.syntheticEvent.metaKey||e.syntheticEvent.ctrlKey?!r.selected||r.dragItem||r.resizeItem?$a.add:$a.remove:$a.select}],onDoubleClickAction:(e,t)=>t.editable?[{type:pl.set,payload:t.dataItem},t.isRecurring&&{type:gl.open}].filter(Boolean):[],onRemoveClickAction:(e,t)=>t.editable?[{type:vl.set,payload:t.dataItem},t.isRecurring?{type:gl.open}:{type:El.open}]:[],onPressAction:(e,t)=>Il(t.editable)?{type:hl.start,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onDragAction:(e,t)=>Il(t.editable)?{type:e.dragEvent.originalEvent.metaKey||e.dragEvent.originalEvent.ctrlKey?hl.dragSelected:hl.drag,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onReleaseAction:(e,t,r)=>Il(t.editable)&&r.dragItem?t.isRecurring&&!t.isException&&null===r.series?{type:gl.open}:{type:t.isRecurring?r.series?hl.completeSeries:hl.completeOccurrence:hl.complete,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizePressAction:(e,t)=>t.editable?{type:yl.start,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizeStartDragAction:(e,t)=>t.editable?{type:e.dragEvent.originalEvent.metaKey||e.dragEvent.originalEvent.ctrlKey?yl.startDragSelected:yl.startDrag,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizeEndDragAction:(e,t)=>t.editable?{type:e.dragEvent.originalEvent.metaKey||e.dragEvent.originalEvent.ctrlKey?yl.endDragSelected:yl.endDrag,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizeReleaseAction:(e,t,r)=>t.editable&&r.resizeItem?t.isRecurring&&!t.isException&&null===r.series?{type:gl.open}:{type:t.isRecurring?r.series?yl.completeSeries:yl.completeOccurrence:yl.complete,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onOccurrenceClickAction:(e,t,r)=>r.dragItem?[{type:hl.completeOccurrence},{type:gl.close}]:r.resizeItem?[{type:yl.completeOccurrence},{type:gl.close}]:r.formItem?[{type:fl.set,payload:!1},{type:pl.set,payload:t.dataItem},{type:gl.close}]:r.removeItem?[{type:fl.set,payload:!1},{type:vl.set,payload:t.dataItem},{type:El.open},{type:gl.close}]:[],onSeriesClickAction:(e,t,r)=>r.dragItem?[{type:hl.completeSeries},{type:gl.close}]:r.resizeItem?[{type:yl.completeSeries},{type:gl.close}]:r.formItem?[{type:fl.set,payload:!0},{type:pl.setMaster,payload:t.dataItem},{type:gl.close}]:r.removeItem?[{type:fl.set,payload:!0},{type:vl.set,payload:t.dataItem},{type:El.open},{type:gl.close}]:[],onKeyDownAction:(e,t)=>{switch(e.syntheticEvent.keyCode){case n.Keys.enter:return t.editable&&!t.readonly?[{type:pl.set,payload:t.dataItem},t.isRecurring&&{type:gl.open}]:[];case n.Keys.tab:return[{type:e.syntheticEvent.shiftKey?Ya.prev:Ya.next,ignoreIsAllDay:t.ignoreIsAllDay},{type:e.syntheticEvent.shiftKey?$a.selectPrev:$a.selectNext,ignoreIsAllDay:t.ignoreIsAllDay}];case n.Keys.up:return[!(!t.slots.length||!t.slots[0]._ref.current)&&{type:Va.up,slot:t.slots[0]._ref}];case n.Keys.right:return[!(!t.slots.length||!t.slots[0]._ref.current)&&{type:Va.right,slot:t.slots[0]._ref}];case n.Keys.down:return[!(!t.slots.length||!t.slots[t.slots.length-1]._ref.current)&&{type:Va.down,slot:t.slots[t.slots.length-1]._ref}];case n.Keys.left:return[!(!t.slots.length||!t.slots[0]._ref.current)&&{type:Va.left,slot:t.slots[0]._ref}];default:return}},onFormSubmitAction:e=>[{type:pl.complete,payload:e.value}],onRemoveConfirmAction:()=>[{type:vl.complete},{type:pl.reset},{type:El.close},{type:gl.close}],onCancelAction:()=>[{type:fl.reset},{type:vl.reset},{type:pl.reset},{type:hl.reset},{type:yl.reset},{type:El.reset},{type:gl.reset}]};Rl.displayName="KendoReactSchedulerEditItem";const xl=e=>{const[t,r]=k.useState(!1),l=ae(),o=le(),s=k.useRef(void 0),c=k.useRef(null),i=k.useRef(null),u=e.updateInterval||Al.updateInterval,[,d]=k.useState(!1),m=n.useDir(i,!0===o.rtl?"rtl":void 0),[p]=Ma(),g=k.useCallback(()=>{if(!p)return;const t=p.filter(t=>t.current&&(void 0===e.groupIndex||null===e.groupIndex||t.current.props.group.index===e.groupIndex)&&(e.vertical?$(new Date,new Date,t.current.props.start,t.current.props.end,!0):B(new Date,t.current.props.start,t.current.props.end))&&!t.current.props.isAllDay);if(t&&t.length&&c.current&&i.current){const n=T(t);if(!n.current)return;const l=e.vertical?(e=>{let t=0;return e.forEach(e=>{if(e.current){const r=w(e.current.element);t+=r.height}}),t})(t):(e=>{let t=0;return e.forEach(e=>{if(e.current){const r=w(e.current.element);t+=r.width}}),t})(t),o=w(n.current.element),s=w(c.current),u=(e.vertical?o.width:o.height)/(n.current.props.end.getTime()-n.current.props.start.getTime()),d=(Date.now()-((e,t)=>{const r=a.cloneDate(e);return r.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),r})(new Date,n.current.props.start).getTime())*u,p="rtl"===m,g=e.vertical?o.top:o.top+d-s.height/2,v=p?"right":"left",E=e.vertical?o[v]+d-s.width/2:o[v];e.vertical?c.current.style[v]=`${E}px`:c.current.style.top=`${g}px`,i.current.style[v]=`${E}px`,i.current.style.top=`${g}px`,i.current.style[e.vertical?"height":"width"]=l-1+"px",r(!0)}else c.current&&(c.current.style.top="",c.current.style.left="",c.current.style.right=""),i.current&&(i.current.style.top="",i.current.style.left="",i.current.style.right=""),r(!1)},[p,e.groupIndex,e.vertical,m]),v=k.useCallback(()=>{g(),d(e=>!e)},[g]);k.useEffect(()=>{if(!l.current||!window)return;clearInterval(s.current),s.current=window.setInterval(v,u);const e=window.ResizeObserver,t=e&&new e(v);return t&&t.observe(l.current),()=>{clearInterval(s.current),t&&t.disconnect()}},[g,v,l,u]),k.useEffect(g);const E=k.createElement("div",{ref:c,className:n.classNames("k-current-time",{"k-current-time-arrow-right":!e.vertical&&"rtl"!==m,"k-current-time-arrow-left":!e.vertical&&"rtl"===m,"k-current-time-arrow-down":e.vertical}),style:{transform:e.vertical?"rtl"===m?"translateX(50%)":"translateX(-50%)":"translateY(-50%)",visibility:t?void 0:"hidden"}});return k.createElement(k.Fragment,null,e.attachArrow&&e.attachArrow.current?D.createPortal(E,e.attachArrow.current):E,k.createElement("div",{className:"k-current-time",ref:i,style:{transform:e.vertical?"translateX(-50%)":"translateY(-50%)",[e.vertical?"width":"height"]:"1px",visibility:t?void 0:"hidden"}}))},Al={updateInterval:6e4},Ml=(e,t)=>{const[r,a]=((e,t)=>{const[r,a]=k.useState(t);return void 0!==e?[e,n.noop]:[r,a]})(e,t),l=k.useCallback(()=>{a(!r)},[r,a]);return[r,l]},Nl=k.forwardRef((e,t)=>{var r;const{as:a=Ll.as,...l}=e,s=k.useRef(null),c=k.useRef(null),i=o.useInternationalization(),u=k.useMemo(()=>n.classNames("k-scheduler-cell k-heading-cell",e.className),[e.className]);k.useImperativeHandle(c,()=>({element:s.current&&s.current.element?s.current.element:s.current,props:e})),k.useImperativeHandle(t,()=>c.current);const d=null!=(r=e.format)?r:Ll.format,m="object"==typeof d&&"skeleton"in d&&"string"==typeof d.skeleton&&d.skeleton.includes("E")&&d.skeleton.includes("d");return k.createElement(a,{ref:a!==Ll.as?void 0:s,...l,className:u},m?k.createElement(k.Fragment,null,k.createElement("span",{className:"k-scheduler-date-day"},i.formatDate(e.date,"EEE")),k.createElement("span",{className:"k-link k-nav-day","aria-label":i.formatDate(e.date,{skeleton:"Ed"})},i.formatDate(e.date,{skeleton:"d"}))," "):k.createElement("span",{className:"k-link k-nav-day"},i.formatDate(e.date,d)))}),Ll={as:k.forwardRef(({as:e,format:t,start:r,end:a,...n},l)=>k.createElement("div",{...n,ref:l})),format:"d"};Nl.displayName="KendoReactSchedulerDateHeaderCell";const zl=(e,{step:t,timezone:r})=>{const n=[],l=a.ZonedDate.fromLocalDate(e.start,r),o=a.ZonedDate.fromLocalDate(e.end,r);for(let e=l.clone(),r=0;e.getTime()<o.getTime();r++,e=e.addTime(t)){const a=e.clone(),l=a.clone().addTime(t),o=new Date(a.getTime()),s={index:r,end:new Date(l.getTime()),start:o,zonedStart:a,zonedEnd:l};n.push(s)}return n},_l=(e,{step:t},{groups:r,ranges:n})=>{const l=[];return r.forEach(e=>{n.forEach(r=>{const n=r.zonedStart,o=r.zonedEnd,s=o.timezoneOffset-n.timezoneOffset;for(let c=n.clone(),i=0,u=s<0?s*X*-1:0;c.getTime()<o.getTime();){const n=k.createRef(),o=c.clone(),s=c.addTime(t),d=(s.timezoneOffset-o.timezoneOffset)*X,m=t<=Math.abs(d);u&&m&&(u-=t,c=c.addTime(-t));const p=new Date(o.getTime()),g={_ref:n,index:i,end:new Date(s.getTime()),start:p,zonedStart:o,zonedEnd:s,range:r,group:e,items:[],isAllDay:a.MS_PER_DAY<=t};l.push(g),c=c.addTime(t),i++}})}),l},Fl=k.createElement("div",{className:"k-scheduler-cell k-side-cell"}),Ol=e=>{var t,r,l,s,c,i,u,d,m,p,g,v;const{group:E,timezone:h,resources:y}=le(),f=o.useInternationalization(),D=e.editItem||Rl,C=e.editSlot||On,[b]=Ml(e.showWorkHours,null!=(t=e.defaultShowWorkHours)?t:Wl.defaultShowWorkHours),S=null!=(r=e.numberOfDays)?r:Wl.numberOfDays,w=null!=(l=e.slotDivisions)?l:Wl.slotDivisions,I=null!=(s=e.slotDuration)?s:Wl.slotDuration,R=null!=(c=e.workWeekStart)?c:Wl.workWeekStart,M=null!=(i=e.workWeekEnd)?i:Wl.workWeekEnd,N=!1!==e.currentTimeMarker&&Wl.currentTimeMarker,L=f.parseDate(null!=(d=null!=(u=e.workDayStart)?u:e.isWorkDayStart)?d:Wl.isWorkDayStart),z=f.parseDate(null!=(p=null!=(m=e.workDayEnd)?m:e.isWorkDayEnd)?p:Wl.isWorkDayEnd),_=f.parseDate(null!=(g=e.startTime)?g:Wl.startTime),F=f.parseDate(null!=(v=e.endTime)?v:Wl.endTime),[O]=ke(),W=me(),P=Ee(),H=ie(),K=ge(),G=k.useMemo(()=>b?L:_,[b,L,_]),Z=k.useMemo(()=>b?z:F,[b,z,F]),Y=k.useMemo(()=>zl(K,{step:a.MS_PER_DAY*S,timezone:h}).map(e=>({...e,isAllDay:!0})),[K.start.getTime(),K.end.getTime(),S]),j=k.useMemo(()=>zl(K,{step:a.MS_PER_DAY,timezone:h}).map(e=>({...e,isAllDay:!1})),[K.start.getTime(),K.end.getTime(),h]),Q=k.useMemo(()=>_l(0,{step:a.MS_PER_DAY},{groups:W,ranges:Y}),[K.start.getTime(),K.end.getTime(),h,Y,W]),J=k.useMemo(()=>_l(0,{step:I*X/w},{groups:W,ranges:j}).filter(e=>Z.getTime()===G.getTime()||B(e.zonedStart,G,Z)),[K.start.getTime(),K.end.getTime(),I,w,G.getTime(),Z.getTime(),W,j]),ee=k.useMemo(()=>Un(O,{dateRange:K,fields:H,timezone:h}),[O,K.start.getTime(),K.end.getTime(),H,h]),te=k.useMemo(()=>ee.filter(e=>e.isAllDay||A(e.start,e.end,h)),[ee,h]),re=k.useMemo(()=>ee.filter(e=>!e.isAllDay&&!A(e.start,e.end,h)),[ee,h]),ae=k.useMemo(()=>jn(te,{timezone:h},{groups:W,ranges:Y}),[ee,h,W,Y]),ne=k.useMemo(()=>jn(re,{timezone:h},{groups:W,ranges:j}).filter(e=>{if(G.getTime()===Z.getTime())return!0;const t=e.range.zonedStart.getTime(),r=e.range.zonedEnd.getTime(),a=(Math.max(e.zonedStart.getTime(),t)-t)/X,n=(Math.min(e.zonedEnd.getTime(),r)-t)/X,l=60*G.getHours()+G.getMinutes();return a<60*Z.getHours()+Z.getMinutes()&&n>l}),[ee,h,W,j,G.getTime(),Z.getTime()]);k.useMemo(()=>q(ae,Q,!0),[ae,Q]),k.useMemo(()=>U(ae,Q,!0),[ae,Q]),k.useMemo(()=>q(ne,J,!1),[ne,J]),k.useMemo(()=>U(ne,J,!1),[ne,J]);const oe=k.createElement(Xa.Consumer,null,({groupIndex:t})=>k.createElement("div",{className:"k-scheduler-row",key:t},j.map((t,r)=>k.createElement(Nl,{as:e.dateHeaderCell,key:r,date:a.ZonedDate.fromLocalDate(new Date(t.zonedEnd.getTime()-(t.zonedEnd.getTime()-t.zonedStart.getTime())/2),h),start:t.start,end:t.end,format:{skeleton:"MEd"}})))),se=k.createElement(Xa.Consumer,null,({groupIndex:t})=>k.createElement("div",{key:t,className:"k-scheduler-row"},Y.map((r,a)=>Q.filter(e=>e.group.index===t&&e.range.index===a).map((r,a,n)=>k.createElement(C,{...r,onDataAction:e.onDataAction,form:e.form,slot:e.slot,viewSlot:e.viewSlot,key:`${r.start.getTime()}:${r.group.index}`,row:0,col:"horizontal"===P?n.length*(t||0)+a:a,isWorkDay:0<=r.zonedStart.getDay()+(S-R)&&(r.zonedStart.getDay()+(S-R))%S<=M+(S-R),expandable:{offsetBottom:25}}))))),ce=k.useMemo(()=>n.classNames("week"===e.name?"k-scheduler-weekview":"k-scheduler-dayview",e.className),[e.name,e.className]),ue=k.useCallback((t,r,a)=>j.map((n,l)=>J.filter(e=>e.index===t.index&&e.range.index===l&&e.group.index===a).map(t=>k.createElement(C,{key:`${t.start.getTime()}:${t.group.index}`,...t,onDataAction:e.onDataAction,slot:e.slot,viewSlot:e.viewSlot,form:e.form,row:r+1,col:j.length*(a||0)+l,isWorkHour:B(t.zonedStart,L,z),isWorkDay:V(t.zonedEnd.getDay(),R,M),editable:e.editable}))),[j,C,e.editable,e.form,e.onDataAction,e.slot,e.viewSlot,J,z,L,M,R]),de=k.useCallback((t,r,a)=>Q.filter(e=>e.group.index===r&&e.range.index===a).map((a,n)=>k.createElement(C,{slot:e.slot,viewSlot:e.viewSlot,form:e.form,...a,onDataAction:e.onDataAction,key:`${a.start.getTime()}:${a.group.index}`,className:"k-scheduler-alldays-slot",row:t*(r||0)+1*(r||0),col:n,expandable:{offsetBottom:25}})),[C,Q,e.form,e.onDataAction,e.slot,e.viewSlot]),pe=k.useCallback((t,r,a,n)=>j.map((l,o)=>J.filter(e=>e.index===t.index&&e.group.index===a&&e.range.index===o).map(t=>k.createElement(C,{slot:e.slot,viewSlot:e.viewSlot,form:e.form,onDataAction:e.onDataAction,...t,key:`${t.start.getTime()}:${t.group.index}`,row:r.length*(a||0)+n+1*(a||0)+1,col:o,editable:e.editable,isWorkHour:B(t.zonedStart,L,z),isWorkDay:0<=t.zonedStart.getDay()+(S-R)&&(t.zonedStart.getDay()+(S-R))%S<=M+(S-R)}))),[C,S,e.editable,e.form,e.onDataAction,e.slot,e.viewSlot,j,J,z,L,M,R]);return k.createElement(ja,{id:e.id,props:e,style:e.style,className:ce,ranges:[...Y,...j],slots:[...Q,...J]},k.createElement("div",{className:"k-scheduler-head"},"horizontal"===P?k.createElement(k.Fragment,null,k.createElement(Qa,{nested:!0,group:E,resources:y,rowContent:rn,childRowContent:rn},oe),k.createElement(Qa,{group:E,resources:y,rowContent:mn,childRowContent:mn},se),ae.map(t=>k.createElement(D,{key:t.isRecurring?`${t.uid}:${t.group.index}:${t.range.index}:${t.originalStart}`:`${t.uid}:${t.group.index}:${t.range.index}`,...t,form:e.form,onDataAction:e.onDataAction,item:e.item,viewItem:e.viewItem,editable:e.editable,vertical:!1,ignoreIsAllDay:!0}))):k.createElement(an,{group:E,resources:y,cellContent:Fl},oe)),k.createElement("div",{className:"k-scheduler-body"},"horizontal"===P?k.createElement(k.Fragment,null,J.filter(e=>0===e.group.index&&0===e.range.index).map((t,r)=>k.createElement(k.Fragment,{key:t.index},k.createElement(Qa,{nested:!1,group:E,resources:y,rowContent:vn,rowContentProps:{timeHeaderCell:e.timeHeaderCell,isMaster:r%w===0,isLast:(r+1)%w===0,slot:t}},k.createElement(Xa.Consumer,null,({groupIndex:e})=>k.createElement("div",{className:n.classNames("k-scheduler-row",{"k-middle-row":(r+1)%w!==0})},ue(t,r,e)))))),!1!==N&&$(T(j).start,x(j).end,new Date,new Date,!0)&&k.createElement(xl,null)):k.createElement(k.Fragment,null,k.createElement(an,{nested:!0,group:E,resources:y},k.createElement(Xa.Consumer,null,({groupIndex:t})=>k.createElement(k.Fragment,{key:t},k.createElement("div",{className:"k-scheduler-row"},k.createElement(mn,{groupIndex:t},Y.map((e,r)=>{const a=J.filter(e=>e.group.index===t&&0===e.range.index).length;return de(a,t,r)}))),J.filter(e=>e.group.index===t&&0===e.range.index).map((r,a,n)=>k.createElement("div",{className:"k-scheduler-row",key:r.index},k.createElement(vn,{slot:r,isMaster:a%w===0,isLast:(a+1)%w===0,timeHeaderCell:e.timeHeaderCell},pe(r,n,t,a)))),!1!==N&&$(T(j).start,x(j).end,new Date,new Date,!0)&&k.createElement(xl,{groupIndex:t})))),ae.map(t=>k.createElement(D,{key:t.isRecurring?`${t.uid}:${t.group.index}:${t.range.index}:${t.originalStart}`:`${t.uid}:${t.group.index}:${t.range.index}`,...t,onDataAction:e.onDataAction,viewItem:e.viewItem,item:e.item,form:e.form,editable:e.editable,vertical:!1,ignoreIsAllDay:!0}))),ne.map(t=>k.createElement(D,{key:t.isRecurring?`${t.uid}:${t.group.index}:${t.range.index}:${t.originalStart}`:`${t.uid}:${t.group.index}:${t.range.index}`,...t,format:"t",onDataAction:e.onDataAction,viewItem:e.viewItem,item:e.item,form:e.form,editable:e.editable,vertical:!0}))))},Wl={name:"multi-day",title:"Multi Day",currentTimeMarker:!0,dateRange:({date:e,numberOfDays:t=1,timezone:r})=>{const n=a.ZonedDate.fromLocalDate(e,r),l=a.getDate(n),o=a.addDays(l,t),s=a.ZonedDate.fromUTCDate(F(l),r),c=a.ZonedDate.fromUTCDate(F(o),r);return{start:new Date(s.getTime()),end:new Date(c.getTime()),zonedStart:s,zonedEnd:c}},selectedDateFormat:"{0:M}",selectedShortDateFormat:"{0:m}",numberOfDays:1,startTime:"00:00",endTime:"23:59",isWorkDayStart:"08:00",isWorkDayEnd:"17:00",workWeekStart:a.Day.Monday,workWeekEnd:a.Day.Friday,slotDivisions:2,slotDuration:60,showCurrentTime:!0,defaultShowWorkHours:!0};Ol.propTypes={currentTimeMarker:r.bool,name:r.string,numberOfDays:r.number,startTime:r.string,endTime:r.string,workDayStart:r.string,workDayEnd:r.string,workWeekStart:r.number,workWeekEnd:r.any,slotDivisions:r.number,slotDuration:r.number,showWorkHours:r.bool,selectedDateFormat:r.string,selectedShortDateFormat:r.string},Ol.displayName="KendoReactSchedulerMultiDayView";const Pl=e=>k.createElement(Ol,{...e}),Hl={...Wl,name:"day",title:e=>e.toLanguageString(Oe,_r[Oe]),numberOfDays:1,slotDuration:60,slotDivisions:2,selectedDateFormat:"{0:M}",selectedShortDateFormat:"{0:m}"};Pl.displayName="KendoReactSchedulerDayView";const $l=Object.freeze({name:"@progress/kendo-react-scheduler",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:1607496606,version:"16.4.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui"}),Kl=k.forwardRef((e,t)=>{const{_ref:r,onRemoveClick:a}=e,l=k.useRef(null),s=k.useRef(null);k.useImperativeHandle(l,()=>({props:e,element:s.current})),k.useImperativeHandle(t,()=>l.current),k.useImperativeHandle(r,()=>l.current);const c=_n(e.editable),i=e.readonly?{remove:!1}:c,u=o.useLocalization().toLanguageString(Pe,_r[Pe]),m=e.group.resources.find(e=>!(!e.colorField||void 0===e[e.colorField])),p=m&&m.colorField&&m[m.colorField],g=k.useCallback(e=>{a&&a.call(void 0,{syntheticEvent:e,target:l.current})},[a,l]),v=k.useMemo(()=>n.classNames("k-task",e.className),[e.className]);return k.createElement("div",{id:e.id,ref:s,style:e.style,className:v,tabIndex:e.tabIndex||void 0},p&&k.createElement("span",{className:"k-scheduler-mark",style:{color:p,backgroundColor:p}}),e.isRecurring&&k.createElement(n.IconWrap,{name:"arrow-rotate-cw",icon:d.arrowRotateCwIcon}),e.isException&&k.createElement(n.IconWrap,{name:"arrows-no-repeat",icon:d.arrowsNoRepeatIcon}),k.createElement("span",{className:"k-scheduler-task-text"},e.title),i.remove&&k.createElement("a",{className:"k-link k-event-delete",title:u,"aria-label":u,onClick:g},k.createElement(n.IconWrap,{name:"x",icon:d.xIcon})))});Kl.displayName="KendoReactSchedulerTask";const Bl=k.forwardRef((e,t)=>{const{task:r,_ref:a,...n}=e,l=k.useRef(null),o=k.useRef(null);k.useImperativeHandle(o,()=>({props:e,element:l.current&&l.current.element})),k.useImperativeHandle(a,()=>l.current),k.useImperativeHandle(t,()=>o.current);const s=r||Vl.task;return k.createElement(s,{...n,_ref:l})}),Vl={task:Kl};Bl.displayName="KendoReactSchedulerViewTask";const Gl=k.createContext([null]),Ul=k.createContext([!1]),ql=k.createContext([!1]),Zl=e=>k.createElement(Gl.Provider,{value:e.remove},k.createElement(Ul.Provider,{value:e.showRemoveDialog},k.createElement(ql.Provider,{value:e.showOccurrenceDialog},e.children))),Yl=k.forwardRef((e,t)=>{const{_ref:r,onDataAction:a,viewTask:n,removeDialog:l,removeItem:o,onRemoveItemChange:s,occurrenceDialog:c,showOccurrenceDialog:i,onShowOccurrenceDialogChange:u,showRemoveDialog:d,onShowRemoveDialogChange:m,...p}=e,g=k.useRef(null);k.useImperativeHandle(g,()=>({props:e,element:g.current&&g.current.element})),k.useImperativeHandle(r,()=>g.current),k.useImperativeHandle(t,()=>g.current);const v=n||jl.viewTask,E=c||jl.occurrenceDialog,h=l||jl.removeDialog,y=_n(e.editable),f=ie(),[D,C]=ke(),[b,S]=k.useState(null),[w,I]=we(null,o,s),[R,T]=we(!1,d,m),[x,A]=we(!1,i,u),M=k.useCallback(t=>{y.remove&&(I(e.dataItem,t),e.isRecurring?A(!0,t):T(!0,t))},[I,e.dataItem,e.isRecurring,A,T]),N=k.useCallback(e=>{S(null),I(null,e),T(!1,e),A(!1,e)},[S,I,T,A]),L=k.useCallback(e=>{a&&w&&a.call(void 0,{type:te.remove,series:b,dataItem:w}),I(null,e),T(!1,e)},[w,C,T]),z=k.useCallback((e,t)=>{I&&I(e,t)},[I]),_=k.useCallback((e,t)=>{T&&T(e,t)},[T]),F=k.useCallback((e,t)=>{A&&A(e,t)},[A]),W=k.useCallback(t=>{w&&(S(!1),I(e.dataItem,t),T(!0,t)),A(!1,t)},[S,e.dataItem,w,I,T]),P=k.useCallback(e=>{if(w){S(!0);const t=O(w,f,D);I(t,e),T(!0,e)}A(!1,e)},[f,w,S,I,T,A]);return k.createElement(Zl,{remove:[w,z],showRemoveDialog:[R,_],showOccurrenceDialog:[x,F]},k.createElement(v,{_ref:g,...p,onRemoveClick:M}),x&&k.createElement(E,{dataItem:w,isRemove:null!==w,onClose:N,onOccurrenceClick:W,onSeriesClick:P}),R&&k.createElement(h,{dataItem:w,onClose:N,onCancel:N,onConfirm:L}))}),jl={viewTask:Bl,occurrenceDialog:Pn,removeDialog:Hn};Yl.displayName="KendoReactSchedulerEditTask";const Xl=e=>{const{group:t,timezone:r,resources:l}=le(),s=e.editTask||Yl,c=e.editSlot||On,i=k.useRef(null),u=n.useDir(i),m=o.useInternationalization(),p=o.useLocalization(),[g]=ke(),v=me(),E=ie(),h=ge(),y=k.useMemo(()=>zl(h,{step:a.MS_PER_DAY,timezone:r}),[h.start.getTime(),h.end.getTime(),r]),f=k.useMemo(()=>_l(0,{step:a.MS_PER_DAY},{groups:v,ranges:y}),[h.start.getTime(),h.end.getTime(),r,v,y]),D=k.useMemo(()=>Un(g,{dateRange:h,fields:E,timezone:r}),[g,h.start.getTime(),h.end.getTime(),E,r]),C=k.useMemo(()=>jn(D,{timezone:r},{groups:v,ranges:y}),[D,r,v,y]),b=k.useMemo(()=>n.classNames("k-scheduler-agendaview",e.className),[e.className]);return Ba({element:i,selector:".k-scheduler-datecolumn",explicitDepth:!1}),Ba({element:i,selector:".k-scheduler-timecolumn",explicitDepth:!1}),k.useMemo(()=>q(C,f,!0),[C,f]),k.useMemo(()=>U(C,f,!0),[C,f]),k.createElement(ja,{ref:i,id:e.id,style:e.style,className:b,props:e,slots:C,ranges:y,role:"grid"},k.createElement("div",{className:"k-scheduler-head",role:"rowgroup"},k.createElement(an,{resources:l,group:t,role:"presentation"},k.createElement(Xa.Consumer,null,({groupIndex:e})=>k.createElement("div",{className:"k-scheduler-row",role:"row",key:e},k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-group-cell k-scheduler-datecolumn",role:"columnheader"},p.toLanguageString(qt,_r[qt])),k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-scheduler-timecolumn",role:"columnheader"},p.toLanguageString(Zt,_r[Zt])),k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-scheduler-eventcolumn",role:"columnheader"},p.toLanguageString(Yt,_r[Yt])))))),k.createElement("div",{className:"k-scheduler-body",role:"rowgroup"},k.createElement(an,{resources:l,group:t,nested:!0,role:"presentation"},k.createElement(Xa.Consumer,null,({groupIndex:t})=>f.filter(e=>e.group.index===(t||0)).map((r,a,l)=>k.createElement("div",{className:"k-scheduler-row k-scheduler-content",role:"row",key:`${t}:${a}`},k.createElement(c,{...r,editable:e.editable,row:l.length*(t||0)+a,col:0,slot:e.slot,viewSlot:e.viewSlot,className:"k-scheduler-datecolumn k-group-cell",role:"rowheader"},k.createElement("div",null,k.createElement("strong",{className:"k-scheduler-agendaday"},m.formatDate(r.zonedStart,"dd")),k.createElement("em",{className:"k-scheduler-agendaweek"},m.formatDate(r.zonedStart,"EEEE")),k.createElement("span",{className:"k-scheduler-agendadate"},m.formatDate(r.zonedStart,"y")))),k.createElement("div",{className:"k-scheduler-cell k-group-content",role:"gridcell"},r.items.length?r.items.map((t,r)=>k.createElement("div",{className:"k-scheduler-row",key:r},k.createElement("div",{className:"k-scheduler-cell k-scheduler-timecolumn"},k.createElement("div",null,t.tail&&k.createElement(n.IconWrap,{name:"rtl"===u?"chevron-right":"chevron-left",icon:"rtl"===u?d.chevronRightIcon:d.chevronLeftIcon}),t.isAllDay?p.toLanguageString(Me,_r[Me]):Ql(m,t),t.head&&k.createElement(n.IconWrap,{name:"rtl"===u?"chevron-left":"chevron-right",icon:"rtl"===u?d.chevronLeftIcon:d.chevronRightIcon}))),k.createElement("div",{className:"k-scheduler-cell"},k.createElement(s,{key:`${a}:${r}`,...t,onDataAction:e.onDataAction,task:e.task,viewTask:e.viewTask,editable:e.editable})))):k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-group-cell"},p.toLanguageString(Jt,_r[Jt])))))))))},Ql=(e,t)=>{if(t.head&&t.tail)return e.format("{0:t}-{1:t}",t.range.zonedStart,t.range.zonedEnd);let r="{0:t}-{1:t}";return t.head?r="{0:t}":t.tail&&(r="{1:t}"),e.format(r,t.zonedStart,t.zonedEnd)},Jl={name:"agenda",title:e=>e.toLanguageString(Fe,_r[Fe]),dateRange:({intl:e,date:t,numberOfDays:r=1,timezone:n})=>{const l=a.ZonedDate.fromLocalDate(t,n),o=(e=>a.getDate(e))(7===r?a.firstDayInWeek(l,e.firstDay()):l),s=((e,t)=>a.getDate(a.addDays(e,t||1)))(o,r),c=a.ZonedDate.fromUTCDate(F(o),n),i=a.ZonedDate.fromUTCDate(F(s),n);return{start:new Date(c.getTime()),end:new Date(i.getTime()),zonedStart:c,zonedEnd:i}},selectedDateFormat:"{0:M} - {1:M}",selectedShortDateFormat:"{0:m} - {1:m}",slotDuration:1440,slotDivision:1,numberOfDays:7},eo={title:r.any};Xl.propTypes=eo,Xl.displayName="KendoReactSchedulerAgendaView";const to=k.forwardRef((e,t)=>{const r=k.useRef(null),a=k.useRef(null),n=o.useLocalization();k.useImperativeHandle(r,()=>({element:a.current&&a.current.element,...e})),k.useImperativeHandle(t,()=>r.current);const l=k.useCallback(t=>{t.stopPropagation(),e.onClick&&r.current&&e.onClick.call(void 0,{target:r.current,syntheticEvent:t})},[r,e.slot,e.onClick]),c=k.useCallback(e=>{e.stopPropagation()},[]),i=k.useCallback(e=>{e.stopPropagation()},[]),u=n.toLanguageString(tr,_r[tr]),d=void 0!==e.hiddenCount?`${String(e.hiddenCount)} ${u}`:u;return k.createElement(s.Button,{ref:a,tabIndex:-1,size:"xs",fillMode:"flat",themeColor:"primary",className:"k-more-events",onClick:l,onDoubleClick:i,onFocus:c,"aria-label":d},d)});to.displayName="KendoReactSchedulerShowMoreItemsButton";const ro={skeleton:"MMM"},ao={skeleton:"dd"},no=e=>{const{show:t,anchor:r,slot:a,itemsPerSlot:l,onDayClick:s,onItemDoubleClick:c,onClose:i}=e,u=o.useInternationalization(),d=o.useLocalization(),m=k.useMemo(()=>a?a.items.filter((e,t)=>t>=l):[],[a,l]),p=k.useCallback(e=>{a&&s&&s(a)},[a,s]);Mn(t,r,i),k.useEffect(()=>{if(!t)return;const e=e=>{const t=e.target,a=document.querySelector(".k-scheduler-popover");a&&!a.contains(t)&&r&&!r.contains(t)&&(null==i||i())};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[t,r,i]);const g=k.useCallback(e=>{"Escape"===e.key&&(null==i||i())},[i]);if(!a)return null;const v=new Date(a.zonedEnd.getTime()-(a.zonedEnd.getTime()-a.zonedStart.getTime())/2),E=u.formatDate(v,ro),h=u.formatDate(v,ao),f=d.toLanguageString(Jt,_r[Jt]),D=d.toLanguageString(er,_r[er]),C=d.toLanguageString(Me,_r[Me]),b=k.createElement(k.Fragment,null,k.createElement("div",{className:"k-month"},E),k.createElement("div",{className:"k-link k-day",onClick:p},h));return k.createElement(y.Popover,{anchor:r,show:t,popoverClass:"k-scheduler-popover",position:"right",collision:{horizontal:"flip",vertical:"fit"},callout:!1,title:b,style:{width:220},onKeyDown:g,animate:{openDuration:1,closeDuration:1}},m.length>0?k.createElement("div",{className:"k-popover-events",role:"list","aria-label":D},m.map((e,t)=>{var r,a;const l=null==(a=null==(r=e.group)?void 0:r.resources)?void 0:a.find(e=>!(!e.colorField||""===e[e.colorField]||void 0===e[e.colorField])),o=(null==l?void 0:l.colorField)&&l[l.colorField],s=o?{"--kendo-scheduler-event-color":o}:void 0;return k.createElement("div",{key:e.uid||t,className:n.classNames("k-popover-event k-event",{"k-readonly":!!e.readonly}),role:"listitem",style:s,onDoubleClick:c?t=>c(e,t):void 0},k.createElement("div",{className:"k-event-title"},e.title||""),k.createElement("span",{className:"k-event-time"},e.isAllDay?C:u.formatDate(e.zonedStart,"t")))})):k.createElement("span",{className:"k-no-data"},f))};no.displayName="KendoReactSchedulerMoreEventsPopover";const lo={skeleton:"dd"},oo={item:null,phase:"form",series:!1,removeItem:null};function so(e,t){switch(t.type){case"open":return{item:t.item,phase:t.isRecurring?"occurrence":"form",series:!1,removeItem:null};case"editOccurrence":return{...e,phase:"form",series:!1};case"editSeries":return{...e,item:t.item,phase:"form",series:!0};case"requestRemove":return{...e,removeItem:t.item};case"cancelRemove":return{...e,removeItem:null};case"reset":return oo;default:return e}}const co=e=>{const{group:t,timezone:r,resources:l}=le(),{onDataAction:s}=e,c=e.editItem||Rl,i=e.editSlot||On,[u]=ke(),[d,m]=ye(),[,p]=Ce(),g=se(),v=me(),E=Ee(),h=ge(),y=o.useInternationalization(),f=ie(),D=k.useRef(null),C=e.itemsPerSlot||io.itemsPerSlot,w=k.useMemo(()=>zl(h,{step:7*a.MS_PER_DAY,timezone:r}),[h.start.getTime(),h.end.getTime(),r]),I=k.useMemo(()=>_l(0,{step:a.MS_PER_DAY},{groups:v,ranges:w}),[h.start.getTime(),h.end.getTime(),v,w]),R=k.useMemo(()=>Un(u,{dateRange:h,fields:f,timezone:r}),[u,h.start.getTime(),h.end.getTime(),f,r]),T=k.useMemo(()=>jn(R,{timezone:r},{groups:v,ranges:w}),[R,r,v,w]),[x,A]=k.useState({show:!1,anchor:null,slot:null}),[M,N]=k.useReducer(so,oo),L=_n(e.editable),z=e.form||wa,_=k.useCallback(e=>{A({show:!0,anchor:e.target.element,slot:e.target.slot||null})},[]),F=k.useCallback(()=>{A({show:!1,anchor:null,slot:null})},[]),W=k.useCallback(e=>{const t=g.find(e=>"day"===e.props.name);!p||!t||!t.props.name||(p(t.props.name),m(e.start),A({show:!1,anchor:null,slot:null}))},[p,m,g]),P=k.useCallback(e=>{!L.edit||e.readonly||(A({show:!1,anchor:null,slot:null}),N({type:"open",item:e.dataItem,isRecurring:!!e.isRecurring}))},[L.edit]),H=k.useCallback(e=>{e.value&&s&&s({type:te.update,series:M.series,dataItem:e.value}),N({type:"reset"})},[s,M.series]),$=k.useCallback(()=>{N({type:"reset"})},[]),K=k.useCallback(()=>{N({type:"editOccurrence"})},[]),B=k.useCallback(()=>{if(!M.item)return;const e=O(M.item,f,u);N({type:"editSeries",item:e?n.clone(e):M.item})},[M.item,f,u]),V=k.useCallback(e=>{const t=e.value||M.item;t&&N({type:"requestRemove",item:t})},[M.item]),G=k.useCallback(()=>{M.removeItem&&s&&s({type:te.remove,series:M.series,dataItem:M.removeItem}),N({type:"reset"})},[s,M.series,M.removeItem]),Z=k.useCallback(()=>{N({type:"cancelRemove"})},[]);k.useMemo(()=>q(T,I,!0),[T,I]),k.useMemo(()=>U(T,I,!0),[T,I]);const Y=k.useMemo(()=>b(t,l),[t,l]),X=k.useMemo(()=>S(Y,Y.length-1),[Y]),Q=Y.length>0,J=k.createElement(Xa.Consumer,null,({groupIndex:t})=>k.createElement("div",{className:"k-scheduler-row",key:t},I.filter(e=>e.group.index===t&&0===e.range.index).map((t,n)=>k.createElement(Nl,{as:e.dateHeaderCell,key:n,"data-dayslot-index":n,date:a.ZonedDate.fromLocalDate(new Date(t.zonedEnd.getTime()-(t.zonedEnd.getTime()-t.zonedStart.getTime())/2),r),start:t.start,end:t.end,format:{skeleton:"EEEE"}})))),ee=k.createElement(Xa.Consumer,null,({groupIndex:t})=>w.map((r,a)=>k.createElement("div",{className:"k-scheduler-row",key:a},I.filter(e=>e.group.index===t&&e.range.index===a).map((r,l,o)=>k.createElement(i,{slot:e.slot,viewSlot:e.viewSlot,key:l,form:e.form,...r,expandable:{offsetTop:35,offsetBottom:26},onDataAction:e.onDataAction,col:"horizontal"===E?o.length*(t||0)+l:l,row:"horizontal"===E?a:w.length*(t||0)+a,editable:e.editable,className:n.classNames({"k-other-month":r.zonedStart.getMonth()!==d.getMonth()})},k.createElement("span",{className:"k-link k-nav-day"},y.formatDate(r.zonedStart,lo)),C<r.items.length&&k.createElement(to,{slot:r,hiddenCount:r.items.length-C,onClick:_}))))));return k.createElement(ja,{props:e,slots:I,ranges:w,className:n.classNames("k-scheduler-monthview",e.className)},k.createElement("div",{className:"k-scheduler-head"},"horizontal"===E?k.createElement(Qa,{nested:!0,resources:l,group:t},J):k.createElement(an,{resources:l,group:t},J)),k.createElement("div",{className:"k-scheduler-body",ref:D},"horizontal"===E&&Q?w.map((t,r)=>k.createElement("div",{className:"k-scheduler-group k-group-horizontal",key:r},k.createElement("div",{className:"k-scheduler-row"},X.map((t,a)=>k.createElement("div",{key:a,className:"k-scheduler-cell k-group-cell"},k.createElement(Xa.Provider,{value:{resource:t,groupIndex:a}},k.createElement("div",{className:"k-scheduler-row"},I.filter(e=>e.group.index===a&&e.range.index===r).map((t,l,o)=>k.createElement(i,{slot:e.slot,viewSlot:e.viewSlot,key:l,form:e.form,...t,expandable:{offsetTop:35,offsetBottom:26},onDataAction:e.onDataAction,col:o.length*a+l,row:r,editable:e.editable,className:n.classNames({"k-other-month":t.zonedStart.getMonth()!==d.getMonth()})},k.createElement("span",{className:"k-link k-nav-day"},y.formatDate(t.zonedStart,lo)),C<t.items.length&&k.createElement(to,{slot:t,hiddenCount:t.items.length-C,onClick:_})))))))))):"horizontal"===E?k.createElement(Qa,{resources:l,group:t},ee):k.createElement(an,{nested:!0,resources:l,group:t},ee),T.filter(e=>null===e.order||e.order<C).sort(j).map(t=>k.createElement(c,{item:e.item,viewItem:e.viewItem,form:e.form,key:t.isRecurring?`${t.uid}:${t.group.index}:${t.range.index}:${t.originalStart}`:`${t.uid}:${t.group.index}:${t.range.index}`,...t,onDataAction:e.onDataAction,slotHeaderOffset:35,vertical:!1,editable:e.editable,ignoreIsAllDay:!0}))),k.createElement(no,{show:x.show,anchor:x.anchor,slot:x.slot,items:T,itemsPerSlot:C,onDayClick:W,onItemDoubleClick:P,onClose:F}),M.item&&"form"===M.phase&&L.edit&&k.createElement(z,{dataItem:M.item,onSubmit:H,onCancel:$,onClose:$,onDelete:L.remove?V:void 0}),M.item&&"occurrence"===M.phase&&k.createElement(Pn,{dataItem:M.item,onClose:$,onOccurrenceClick:K,onSeriesClick:B}),M.removeItem&&L.remove&&k.createElement(Hn,{dataItem:M.removeItem,isSeries:M.series,onClose:Z,onCancel:Z,onConfirm:G}))},io={name:"month",dateRange:({intl:e,date:t,timezone:r})=>{const n=a.firstDayInWeek(a.firstDayOfMonth(a.getDate(t)),e.firstDay()),l=a.addDays(a.firstDayInWeek(a.lastDayOfMonth(a.getDate(t)),e.firstDay()),7),o=a.ZonedDate.fromUTCDate(F(n),r),s=a.ZonedDate.fromUTCDate(F(l),r);return{start:new Date(o.getTime()),end:new Date(s.getTime()),zonedStart:o,zonedEnd:s}},slotDuration:1440,slotDivision:1,itemsPerSlot:2,numberOfDays:31,title:e=>e.toLanguageString(We,_r[We]),selectedDateFormat:"{0:Y}",selectedShortDateFormat:"{0:y}"},uo={itemsPerSlot:r.number};co.propTypes=uo,co.displayName="KendoReactSchedulerMonthView";const mo=e=>k.createElement(Ol,{...e,step:7,numberOfDays:7}),po={name:"week",slotDuration:60,slotDivisions:2,numberOfDays:7,dateRange:({intl:e,date:t,timezone:r})=>{const n=a.ZonedDate.fromLocalDate(t,r),l=(e=>a.getDate(e))(a.firstDayInWeek(n,e.firstDay())),o=((e,t)=>a.getDate(a.addDays(e,t)))(l,7),s=a.ZonedDate.fromUTCDate(F(l),r),c=a.ZonedDate.fromUTCDate(F(o),r);return{start:new Date(s.getTime()),end:new Date(c.getTime()),zonedStart:s,zonedEnd:c}},title:e=>e.toLanguageString(ze,_r[ze]),selectedDateFormat:"{0:M} - {1:M}",selectedShortDateFormat:"{0:m} - {1:m}"};mo.displayName="KendoReactSchedulerWeekView";const go=e=>{const t=ge(),r=Math.round((t.end.getTime()-t.start.getTime())/a.MS_PER_DAY);return k.createElement(Ol,{...e,step:7,numberOfDays:r})},vo={name:"work-week",slotDuration:60,slotDivisions:2,numberOfDays:7,dateRange:({intl:e,date:t,timezone:r,...n})=>{const l=a.ZonedDate.fromLocalDate(t,r),o=void 0!==n.workWeekStart?n.workWeekStart:a.Day.Monday,s=void 0!==n.workWeekEnd?n.workWeekEnd:a.Day.Friday,c=s<o?7+s-o+1:s-o+1,i=a.getDate(((e,t=a.Day.Sunday)=>{let r=e.clone();for(;r.getDay()!==t;)r=r.addDays(-1);return r})(l,o)),u=a.addDays(i,c),d=a.ZonedDate.fromUTCDate(F(i),r),m=a.ZonedDate.fromUTCDate(F(u),r);return{start:new Date(d.getTime()),end:new Date(m.getTime()),zonedStart:d,zonedEnd:m}},title:e=>e.toLanguageString(_e,_r[_e]),workWeekStart:a.Day.Monday,workWeekEnd:a.Day.Friday,selectedDateFormat:"{0:M} - {1:M}",selectedShortDateFormat:"{0:m} - {1:m}"};go.displayName="KendoReactSchedulerWorkWeekView";const Eo=k.createElement("div",{className:"k-scheduler-cell k-side-cell"}),ho=e=>k.createElement(k.Fragment,null,k.createElement("div",{className:"k-sticky-cell"},Eo),e.children),yo=e=>{const t=o.useLocalization();return k.createElement(k.Fragment,null,k.createElement("div",{className:"k-sticky-cell"},k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-side-cell k-scheduler-times-all-day","data-range-index":0},t.toLanguageString(Ae,_r[Ae]))),e.children)},fo=e=>{var t;const{group:r,timezone:l,resources:s}=le(),c=k.useRef(null),i=k.useRef(null),u=e.editItem||Rl,d=e.editSlot||On,m=k.useRef(null),[p]=ke(),g=Ee(),v=me(),E=ge(),h=ie(),y=o.useInternationalization(),[f]=Ml(e.showWorkHours,null!=(t=e.defaultShowWorkHours)?t:ko.defaultShowWorkHours),D=e.slotDivisions||ko.slotDivisions,C=e.slotDuration||ko.slotDuration,b=e.workWeekStart||ko.workWeekStart,S=e.workWeekEnd||ko.workWeekEnd,w=y.parseDate(e.workDayStart||e.isWorkDayStart||ko.isWorkDayStart),I=y.parseDate(e.workDayEnd||e.isWorkDayEnd||ko.isWorkDayEnd),R=y.parseDate(e.startTime||ko.startTime),A=y.parseDate(e.endTime||ko.endTime),M=k.useMemo(()=>f?w:R,[f,w,R]),N=k.useMemo(()=>f?I:A,[f,I,A]),L=k.useMemo(()=>zl(E,{step:a.MS_PER_DAY,timezone:l}),[E.start.getTime(),E.end.getTime(),l]),z=k.useMemo(()=>_l(0,{step:C/D*a.MS_PER_MINUTE},{groups:v,ranges:L}).filter(e=>B(e.zonedStart,M,N)||M.getTime()===N.getTime()),[v,L,E.start.getTime(),E.end.getTime(),l,C,D,M.getTime(),N.getTime()]),_=k.useMemo(()=>Un(p,{dateRange:E,fields:h,timezone:l}),[p,E.start.getTime(),E.end.getTime(),h,l]),O=k.useMemo(()=>jn(_,{timezone:l},{groups:v,ranges:L}).filter(e=>M.getTime()===N.getTime()||B(e.zonedStart,M,N)||B(e.zonedEnd,M,N)||B(new Date(e.zonedEnd.getTime()-(e.zonedEnd.getTime()-e.zonedStart.getTime())/2),M,N)),[_,l,v,L,M.getTime(),N.getTime()]);k.useMemo(()=>q(O,z,!0),[O,z]),k.useMemo(()=>U(O,z,!0),[O,z]);const W=("horizontal"===g?z.length:z.length/v.length)*((e.columnWidth||ko.columnWidth)+1),P=k.createElement(Xa.Consumer,null,()=>k.createElement(k.Fragment,null,k.createElement("div",{className:"k-scheduler-row"},L.map((t,r)=>k.createElement(Nl,{as:e.dateHeaderCell,key:r,date:t.zonedStart,start:t.start,end:t.end,format:"m"}))),k.createElement("div",{className:"k-scheduler-row",ref:c},L.map((t,r)=>z.filter(e=>0===e.group.index&&e.range.index===r).map(t=>t.zonedStart.getMinutes()%C===0?k.createElement(pn,{key:t.index,as:e.timeHeaderCell,format:"t",date:t.zonedStart,start:t.zonedStart,end:t.zonedEnd}):null))))),H=k.createElement(Xa.Consumer,null,({groupIndex:t})=>k.createElement("div",{className:"k-scheduler-row"},L.map((r,n)=>z.filter(e=>e.group.index===t&&e.range.index===n).map((r,o,s)=>{const c=a.ZonedDate.fromUTCDate(F(r.zonedStart),l),i=V(c.getDay(),b,S);return k.createElement(d,{key:`${r.start.getTime()}:${r.group.index}`,slot:e.slot,viewSlot:e.viewSlot,...r,form:e.form,onDataAction:e.onDataAction,isWorkHour:B(r.zonedStart,w,I),isWorkDay:i,col:"horizontal"===g?n*s.length+o+s.length*L.length*(t||0):n*s.length+o,row:"horizontal"===g?0:t||0,expandable:{offsetBottom:25},editable:e.editable})})))),K=k.useMemo(()=>n.classNames("k-scheduler-timelineview",e.className),[e.className]);Ba({element:m,selector:".k-resource-cell",attribute:"data-depth-index",explicitDepth:!0});const G=m.current?m.current.closest(".k-scheduler-layout"):null;return Bn({element:G,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:O&&!O.length}),k.createElement(ja,{ref:m,id:e.id,style:{...e.style},className:K,props:e,slots:z,ranges:L},k.createElement("div",{className:"k-scheduler-head",style:{width:W}},"horizontal"===g?k.createElement(Qa,{nested:!0,group:r,resources:s,rowContent:ho},P):k.createElement(an,{wrapGroup:!0,group:r,resources:s},P)),k.createElement("div",{className:"k-scheduler-body",style:{width:W},ref:i},"horizontal"===g?k.createElement(Qa,{group:r,resources:s,rowContent:yo},H,k.createElement(Xa.Consumer,null,({groupIndex:t})=>e.currentTimeMarker&&$(T(L).start,x(L).end,new Date,new Date,!0)&&k.createElement(xl,{groupIndex:t,attachArrow:c,vertical:!0}))):k.createElement(an,{nested:!0,wrapGroup:!0,group:r,resources:s},H),"vertical"===g&&e.currentTimeMarker&&$(T(L).start,x(L).end,new Date,new Date,!0)&&k.createElement(xl,{attachArrow:c,vertical:!0}),O.sort(j).map((t,r)=>k.createElement(u,{key:t.isRecurring?`${t.uid}:${t.group.index}:${t.range.index}:${t.originalStart}`:`${t.uid}:${t.group.index}:${t.range.index}`,...t,format:"t",form:e.form,onDataAction:e.onDataAction,item:e.item,viewItem:e.viewItem,editable:e.editable,ignoreIsAllDay:!0,vertical:!1,isLast:r===O.length-1}))))},ko={name:"multi-day-timeline",title:"Multi Day Timeline",currentTimeMarker:!0,dateRange:({date:e,numberOfDays:t=1,timezone:r})=>{const n=a.ZonedDate.fromLocalDate(e,r),l=a.getDate(n),o=a.addDays(l,t),s=a.ZonedDate.fromUTCDate(F(l),r),c=a.ZonedDate.fromUTCDate(F(o),r);return{start:new Date(s.getTime()),end:new Date(c.getTime()),zonedStart:s,zonedEnd:c}},selectedDateFormat:"{0:M}",selectedShortDateFormat:"{0:m}",numberOfDays:1,startTime:"00:00",endTime:"00:00",isWorkDayStart:"8:00",isWorkDayEnd:"17:00",workWeekStart:a.Day.Monday,workWeekEnd:a.Day.Friday,slotDivisions:2,slotDuration:60,defaultShowWorkHours:!0,columnWidth:100},Do=e=>k.createElement(fo,{...e}),Co={...ko,name:"timeline",title:e=>e.toLanguageString(Le,_r[Le]),slotDuration:60,slotDivisions:2,numberOfDays:1,selectedDateFormat:"{0:M}",selectedShortDateFormat:"{0:m}"};Do.displayName="KendoReactSchedulerTimelineView";const bo=(e,t,r)=>e.filter(e=>{const a=L(e,t.recurrenceId);return null!=a&&a===r&&!L(e,t.recurrenceRule)}),So=(e,t)=>{const r=n.clone(e);return z(r,t.recurrenceId,null),z(r,t.recurrenceRule,null),z(r,t.originalStart,null),r},wo=new Map;wo.set(Xl,Jl),wo.set(Pl,Hl),wo.set(co,io),wo.set(mo,po),wo.set(go,vo),wo.set(Do,Co);const Io=k.forwardRef((e,t)=>{var r,l,i,u;const m=!n.validatePackage($l,{component:"Scheduler"}),p=n.getLicenseMessage($l),{timezone:g,onDataChange:v}=e,E=k.useRef(null),h=k.useRef(null);k.useImperativeHandle(h,()=>({props:e,element:E.current})),k.useImperativeHandle(t,()=>h.current),n.useWebMcpRegister("scheduler",h,e,e.webMcp);const y=n.useRtl(E),f=o.useInternationalization(),D=o.useLocalization(),{fields:S}=k.useMemo(()=>(e=>({fields:{...K,...e}}))(e.modelFields),[e.modelFields]),[w,I]=we(e.defaultDate||Ro.defaultDate,e.date,e.onDateChange),R=k.Children.toArray(e.children||[]).map(e=>{var t;return k.isValidElement(e)?k.cloneElement(e,{...wo.get(e.type),...null!=(t=e.props)?t:{}}):e}),T=k.cloneElement(k.createElement(Pl,null),wo.get(Pl)),[x,A]=we(e.defaultView||R[0]&&R[0].props.name||"day",e.view,e.onViewChange),M=R.find(e=>e.props.name===x)||R[0]||T,N=M.props,[_,F]=we(null==(r=N.defaultShowWorkHours)||r,N.showWorkHours),W=(null!=(l=e.data)?l:Ro.data)||Ro.data,P=((e,t)=>{const r=b(e,t),a=C(r);return 1===a.length&&0===a[0].length?[{index:0,isDefault:!0,resources:(t||[]).reduce((e,t)=>[...e,...t.data.map(e=>({...e,field:t.field,valueField:t.valueField,colorField:t.colorField,multiple:t.multiple}))],[])}]:a.map((e,t)=>({index:t,resources:e}))})(e.group,e.resources),H=e.group&&e.group.orientation?e.group.orientation:"horizontal",$=M.props.selectedDateFormat||"{0:D}",B=M.props.selectedShortDateFormat||"{0:d}",V=M.props.slotDuration,G=void 0!==M.props.dateRange?"function"==typeof M.props.dateRange?M.props.dateRange.call(void 0,{intl:f,date:w,timezone:g,numberOfDays:M.props.numberOfDays,workWeekStart:M.props.workWeekStart||f.firstDay(),workWeekEnd:M.props.workWeekEnd||(f.firstDay()+M.props.numberOfDays)%6}):M.props.dateRange:{start:Ro.defaultDate,end:Ro.defaultDate},U=k.useCallback(({created:e=[],updated:t=[],deleted:r=[]})=>{if(v){const a={created:e,updated:t,deleted:r};v.call(void 0,a)}},[v]),q=k.useCallback(e=>{const t=[e.dataItem];U({created:t})},[U]),Z=k.useCallback(e=>{const t=[],r=[],a=[];if(e.series)if(Array.isArray(e.dataItem)){const t=e.dataItem[0];if(null!==L(t,S.recurrenceId)&&void 0!==L(t,S.recurrenceId)){const e=n.clone(O(t,S,W)),a=new Date(L(t,S.originalStart)).getTime(),l=new Date(L(t,S.start)).getTime(),o=new Date(L(t,S.end)).getTime(),s=l-a,c=o-l,i=new Date(L(e,S.start)).getTime();z(e,S.start,new Date(i+s)),z(e,S.end,new Date(i+s+c));const u=L(e,S.recurrenceExceptions)||[];if(u.length>0&&0!==s){const t=u.map(e=>new Date(new Date(e).getTime()+s));z(e,S.recurrenceExceptions,t)}r.push(e)}else e.dataItem.forEach(e=>{const t=n.clone(O(e,S,W)),a=n.clone(e);z(a,S.originalStart,L(t,S.originalStart)),z(a,S.recurrenceId,L(t,S.recurrenceId));const l=L(t,S.recurrenceExceptions)||[],o=new Date(L(t,S.start)).getTime(),s=new Date(L(a,S.start)).getTime()-o;if(l.length>0&&0!==s){const e=l.map(e=>new Date(new Date(e).getTime()+s));z(a,S.recurrenceExceptions,e)}else z(a,S.recurrenceExceptions,l);r.push(a)})}else if(null!==L(e.dataItem,S.recurrenceId)&&void 0!==L(e.dataItem,S.recurrenceId)){const t=n.clone(O(e.dataItem,S,W)),a=new Date(L(e.dataItem,S.originalStart)).getTime(),l=new Date(L(e.dataItem,S.start)).getTime(),o=new Date(L(e.dataItem,S.end)).getTime(),s=l-a,c=o-l,i=new Date(L(t,S.start)).getTime();z(t,S.start,new Date(i+s)),z(t,S.end,new Date(i+s+c));const u=L(t,S.recurrenceExceptions)||[];if(u.length>0&&0!==s){const e=u.map(e=>new Date(new Date(e).getTime()+s));z(t,S.recurrenceExceptions,e)}r.push(t)}else{const t=n.clone(e.dataItem);if(L(t,S.recurrenceRule)){const r=n.clone(O(e.dataItem,S,W));z(t,S.originalStart,L(r,S.originalStart)),z(t,S.recurrenceId,L(r,S.recurrenceId));const a=L(r,S.recurrenceExceptions)||[],l=new Date(L(r,S.start)).getTime(),o=new Date(L(t,S.start)).getTime()-l;if(a.length>0&&0!==o){const e=a.map(e=>new Date(new Date(e).getTime()+o));z(t,S.recurrenceExceptions,e)}else z(t,S.recurrenceExceptions,a)}else if(z(t,S.recurrenceExceptions,null),!e.resetExceptions){const e=L(t,S.id);bo(W,S,e).forEach(e=>{r.push(So(e,S))})}r.push(t)}else if(Array.isArray(e.dataItem))e.dataItem.forEach(e=>{const a=null!==L(e,S.recurrenceRule)&&void 0!==L(e,S.recurrenceRule);if(null!==L(e,S.recurrenceId)&&void 0!==L(e,S.recurrenceId)&&a){const a=n.clone(O(e,S,W)),l=L(e,S.originalStart),o=L(a,S.recurrenceExceptions)||[];z(a,S.recurrenceExceptions,[...o,l]),z(e,S.recurrenceRule,null),r.push(a),t.push(e)}else r.push(e)});else{const a=null!==L(e.dataItem,S.recurrenceRule)&&void 0!==L(e.dataItem,S.recurrenceRule);if(null!==L(e.dataItem,S.recurrenceId)&&void 0!==L(e.dataItem,S.recurrenceId)&&a){const a=n.clone(O(e.dataItem,S,W)),l=L(e.dataItem,S.originalStart),o=L(a,S.recurrenceExceptions)||[];z(a,S.recurrenceExceptions,[...o,l]),z(e.dataItem,S.recurrenceRule,null),r.push(a),t.push(e.dataItem)}else r.push(e.dataItem)}if(e.series&&e.resetExceptions){const t=Array.isArray(e.dataItem)?e.dataItem[0]:e.dataItem,l=t&&L(t,S.recurrenceId),o=null!=l?l:t&&L(t,S.id);null!=o&&(W.forEach(e=>{const t=L(e,S.recurrenceId),r=L(e,S.recurrenceRule);t===o&&!r&&a.push(n.clone(e))}),r.forEach(e=>{L(e,S.id)===o&&z(e,S.recurrenceExceptions,null)}))}U({updated:r,created:t,deleted:a})},[U,S,W]),Y=k.useCallback(e=>{const t=[],r=[];if(e.series){const a=n.clone(O(e.dataItem,S,W)),l=n.clone(e.dataItem);z(l,S.originalStart,L(a,S.originalStart)),z(l,S.recurrenceId,L(a,S.recurrenceId)),z(l,S.recurrenceRule,L(a,S.recurrenceRule)),z(l,S.recurrenceExceptions,L(a,S.recurrenceExceptions)),r.push(l);const o=L(a,S.id),s=bo(W,S,o);e.resetExceptions?s.forEach(e=>r.push(n.clone(e))):s.forEach(e=>t.push(So(e,S)))}else if(null===L(e.dataItem,S.recurrenceRule)||void 0===L(e.dataItem,S.recurrenceRule))r.push(e.dataItem);else{const r=n.clone(O(e.dataItem,S,W)),a=L(e.dataItem,S.originalStart),l=L(r,S.recurrenceExceptions)||[];z(r,S.recurrenceExceptions,[...l,a]),z(e.dataItem,S.recurrenceRule,null),t.push(r)}U({updated:t,deleted:r})},[U,S,W]),j=k.useCallback(e=>{switch(e.type){case te.create:q(e);break;case te.update:Z(e);break;case te.remove:Y(e)}},[q,Y,Z]),X=k.useCallback((e,t)=>{A(e,{...t,target:h.current})},[A,h]),Q=k.useCallback((e,t)=>{I(e,{...t,target:h.current})},[I,h]),J=k.useCallback(e=>{e.value&&I(e.value,{...e,target:h.current,nativeEvent:e.nativeEvent})},[I,h]),ee=k.useCallback(e=>{var t,r;e.preventDefault();const n=null!=(r=null!=(t=M.props.step)?t:M.props.numberOfDays)?r:1,l=n>27?a.addMonths(w,Math.round(n/27)):a.addDays(w,n);I(l,e)},[w,I,M.props.numberOfDays,M.props.step]),re=k.useCallback(e=>{var t,r;e.preventDefault();const n=null!=(r=null!=(t=M.props.step)?t:M.props.numberOfDays)?r:1,l=n>27?a.addMonths(w,-Math.round(n/27)):a.addDays(w,-n);I(l,e)},[w,I,M.props.numberOfDays,M.props.step]),ae=k.useCallback(e=>{e.preventDefault();const t=a.ZonedDate.fromLocalDate(new Date,g);I(new Date(t.getTime()),e)},[I,g]),ne=k.useCallback(()=>{F(!_)},[F,_]),le=k.useCallback(()=>{E.current&&(E.current.style.boxShadow="0 0.5px 0.5px 0.5px rgba(0, 0, 0, .12)")},[E]),oe=k.useCallback(()=>{E.current&&(E.current.style.boxShadow="")},[E]),se=k.useMemo(()=>{var t;return{...e.style,height:null!=(t=e.height)?t:Ro.height}},[e.height,e.style]),ce=k.useMemo(()=>n.classNames({"k-rtl":void 0!==e.rtl?e.rtl:"rtl"===y},"k-scheduler",e.className),[e.className,e.rtl,y]),ie=D.toLanguageString(Ne,_r[Ne]),ue=D.toLanguageString(He,_r[He]),de=D.toLanguageString($e,_r[$e]),me=D.toLanguageString(Rr,_r[Rr]),pe=D.toLanguageString(xr,_r[xr]),ge=k.useRef(null),ve=(e=>{const[t,r]=k.useState(0),a=k.useRef(0),n=k.useRef(!1);return k.useEffect(()=>{const t=e.current;if(!t||"undefined"==typeof ResizeObserver)return;const l={childList:!0,subtree:!0,characterData:!0},o=()=>{if(!n.current&&0!==t.offsetWidth){for(n.current=!0,i.disconnect();a.current>0;)if(a.current--,c.flushSync(()=>r(a.current)),t.scrollWidth>t.offsetWidth){a.current++,c.flushSync(()=>r(a.current));break}for(;t.scrollWidth>t.offsetWidth&&a.current<3;)a.current++,c.flushSync(()=>r(a.current));i.observe(t,l),n.current=!1}},s=new ResizeObserver(o);s.observe(t);const i=new MutationObserver(o);return i.observe(t,l),()=>{s.disconnect(),i.disconnect()}},[e]),t})(ge),Ee=M.props.header||e.header||Ro.header,he=M.props.footer||e.footer||Ro.footer,ye=M.props.form||e.form||wa,[fe,ke]=k.useState(null),[De,Ce]=k.useState(null),be=k.useCallback(e=>{e.preventDefault();const t=new Date,r=V||30,a=60*r*1e3,n=t.getMinutes(),l=Math.ceil(n/r)*r;let o=new Date(t);o.setHours(t.getHours()+Math.floor(l/60),l%60,0,0);const s=(e,t)=>W.some(r=>{const a=L(r,S.start),n=L(r,S.end);return!(!a||!n)&&(a.getTime()<t.getTime()&&n.getTime()>e.getTime())});let c=new Date(o.getTime()+a);for(let e=0;e<48&&s(o,c);e++)o=new Date(o.getTime()+a),c=new Date(o.getTime()+a);const i={};z(i,S.start,o),z(i,S.end,c),z(i,S.isAllDay,!1),z(i,S.title,""),z(i,S.description,""),Ce(i)},[W,S,V]),Ie=k.useCallback(e=>{e.value&&U({created:[e.value]}),Ce(null)},[U]),Re=k.useCallback(e=>{Ce(null)},[]),Te=k.useCallback(e=>{Ce(null)},[]),xe="object"==typeof e.editable?e.editable.add:!!e.editable;return k.createElement(Se,{element:E,props:e,views:R,fields:S,groups:P,dateRange:G,orientation:H,dateFormat:{dateFormat:$,shortDateFormat:B},date:[w,Q],activeView:[x,X],selection:[fe,ke],data:[W,j]},k.createElement("div",{ref:E,id:e.id,style:se,className:ce,tabIndex:null!=(i=e.tabIndex)?i:Ro.tabIndex,dir:y,role:e.role||"application","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-activedescendant":fe&&fe.props.id||void 0,onFocus:le,onBlur:oe},k.createElement(Ee,{ref:e=>{var t;ge.current=null!=(t=null==e?void 0:e.element)?t:null},ariaLabel:pe,style:{flexWrap:ve<3?"nowrap":"wrap"}},xe&&k.createElement(s.Button,{className:"k-toolbar-button",themeColor:"primary",svgIcon:d.plusIcon,"aria-label":me,tabIndex:-1,onClick:be},ve<2&&me),ve<2&&k.createElement(s.Button,{className:"k-toolbar-button",fillMode:"flat",tabIndex:-1,onClick:ae},ie),ve<3&&k.createElement(s.ButtonGroup,{className:"k-button-group-flat k-toolbar-button-group"},k.createElement(s.Button,{fillMode:"flat",tabIndex:-1,svgIcon:"rtl"===y?d.chevronRightIcon:d.chevronLeftIcon,"aria-label":ue,title:ue,onClick:re}),k.createElement(s.Button,{fillMode:"flat",tabIndex:-1,svgIcon:"rtl"===y?d.chevronLeftIcon:d.chevronRightIcon,"aria-label":de,title:de,onClick:ee})),k.createElement(Fr,{value:w,onChange:J,level:ve}),k.createElement(s.ToolbarSpacer,null),1===ve&&k.createElement("span",{className:"k-separator"}),k.createElement(Or,{level:ve})),M&&k.createElement(M.type,{editable:null!=(u=e.editable)?u:Ro.editable,key:M.props.name,item:e.item,viewItem:e.viewItem,editItem:e.editItem,task:e.task,viewTask:e.viewTask,editTask:e.viewTask,slot:e.slot,viewSlot:e.viewSlot,editSlot:e.editSlot,form:e.form,onDataAction:j,showWorkHours:_,...M.props}),(M.props.footer||e.footer||"agenda"!==x&&"month"!==x)&&k.createElement(he,{ariaLabel:pe},"agenda"!==x&&"month"!==x&&V&&V<1440&&k.createElement(s.Button,{className:"k-toolbar-button k-scheduler-fullday",tabIndex:-1,onClick:ne,svgIcon:d.clockIcon},D.toLanguageString(_?Ke:Be,_r[_?Ke:Be]))),m&&k.createElement(n.WatermarkOverlay,{message:p}),De&&k.createElement(ye,{dataItem:De,onSubmit:Ie,onCancel:Re,onClose:Te})))}),Ro={data:[],height:600,tabIndex:-1,editable:!1,quickCreate:!0,eventOverview:!0,defaultDate:new Date,header:Ie,footer:xe,navigation:Re,viewSelector:Te};Io.propTypes={data:r.array,editable:r.oneOfType([r.bool,r.shape({add:r.bool,drag:r.bool,edit:r.bool,remove:r.bool,resize:r.bool})]),quickCreate:r.bool,eventOverview:r.bool,view:r.string,defaultView:r.string,date:r.any,defaultDate:r.any,rtl:r.bool,height:r.oneOfType([r.number,r.string]),children:r.any,timezone:r.string,group:r.any,resources:r.any,modelFields:r.shape({id:r.string,start:r.string,startTimezone:r.string,end:r.string,endTimezone:r.string,isAllDay:r.string,title:r.string,description:r.string,recurrenceRule:r.string,recurrenceId:r.string,recurrenceException:r.string})},Io.displayName="KendoReactScheduler";const To=k.forwardRef((e,t)=>{var r;const{item:a,_ref:l,itemRef:s,...c}=e,i=k.useRef(void 0),u=k.useRef(null),m=k.useRef(null),p=k.useRef(null);k.useImperativeHandle(m,()=>({props:e,element:u.current&&u.current.element})),k.useImperativeHandle(t,()=>m.current),k.useImperativeHandle(l,()=>u.current),k.useImperativeHandle(s,()=>u.current);const g=a||xo.item,v=o.useInternationalization(),[E]=La(),[h]=Ma(),y=ae(),[f,D]=k.useState(!0),[C,b]=k.useState(!1),S=k.useRef(0),I=k.useRef(null),A=k.useRef([]),M=n.useDir(y),N=k.useMemo(()=>{var t,r;return e.isAllDay?null!=(t=e.title)?t:"":`(${v.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd)}): ${null!=(r=e.title)?r:""}`},[v,e.isAllDay,e.title,e.zonedEnd,e.zonedStart]);let L;e.isRecurring&&!e.isException?L="recurring":!e.isRecurring&&e.isException&&(L="non-recurring");const z=k.useMemo(()=>v.format("{0:t} – {1:t}",e.zonedStart,e.zonedEnd),[v,e.zonedStart,e.zonedEnd]),_=!0===(null==(r=e.range)?void 0:r.isAllDay),F=()=>{var t,r,a,n,l;const o=h.filter(t=>t.current&&((t,r)=>t.group.index===r.group.index&&t.range.index===r.range.index&&(void 0===t.range.isAllDay||void 0===r.range.isAllDay||t.range.isAllDay===r.range.isAllDay)&&(e.ignoreIsAllDay||t.isAllDay===r.isAllDay))(t.current.props,e)).sort((e,t)=>e.current.props.start.getTime()-t.current.props.start.getTime()),s=o.filter(t=>$(t.current.props.start,t.current.props.end,e.start,e.end)),c=u.current&&u.current.element;if(!c||!s.length)return;const i=T(o),d=x(o),m=T(s),p=x(s);if(!(m.current&&u.current&&p.current&&i.current&&d.current))return;if(!$(m.current.props.start,p.current.props.end,e.start,e.end))return void D(!1);const g=[],v=[],y=[],f=w(m.current.element),k=(e.vertical?f.height:f.width)/(m.current.props.end.getTime()-m.current.props.start.getTime()),C=(e.vertical?12:8)/k,M=(Math.min(e.start.getTime(),p.current.props.end.getTime()-C)-m.current.props.start.getTime())*k,N=Math.floor(Math.min(e.end.getTime(),p.current.props.end.getTime())-Math.max(e.start.getTime(),m.current.props.start.getTime()))*k;(E||[]).forEach(e=>{e.current&&(e.current.props.dragHint?v.push(e.current):e.current.props.resizeHint?y.push(e.current):g.push(e.current))}),A.current=((t,r,a)=>{const[n,l]=r,o=new Date(Math.min(l.props.end.getTime()-a,Math.max(e.start.getTime(),n.props.start.getTime()))),s=new Date(Math.max(o.getTime()+a,Math.min(e.end.getTime(),l.props.end.getTime())));return t.filter(t=>{const r=Math.max(Math.min(l.props.end.getTime()-a,t.props.start.getTime()),n.props.start.getTime()),c=Math.min(Math.max(r+a,t.props.end.getTime()),l.props.end.getTime());return t.props.id!==e.id&&t.props.group.index===e.group.index&&t.props.range.index===e.range.index&&(void 0===t.props.range.isAllDay||void 0===e.range.isAllDay||t.props.range.isAllDay===e.range.isAllDay)&&(e.ignoreIsAllDay||t.props.isAllDay===e.isAllDay)&&$(new Date(r),new Date(c),o,s)&&$(n.props.start,l.props.end,t.props.start,t.props.end)})})(g,[i.current,d.current],C),I.current=e.resizeHint||e.dragHint?0:((e,t)=>{const r=new Set;return t.forEach(e=>{void 0!==e._order&&null!==e._order&&r.add(e._order)}),G(Array.from(r))})(u.current,A.current);let L=1;e.resizeHint||e.dragHint||(L=((e,t)=>{var r;let a=null!=(r=e._order)?r:0;return t.forEach(e=>{void 0!==e._order&&null!==e._order&&a<e._order&&(a=e._order)}),a+1})(u.current,A.current));let z=0;const _=f;A.current.forEach(e=>{let t=0;void 0!==e._order&&null!==e._order&&e._order<I.current&&(t=w(e.element).top+w(e.element).height-_.top-1*I.current+1),t>z&&(z=t)});_.width=e.vertical?_.width/L-1-20/L:N-1,e.vertical?_.height=N-1:(e.resizeHint||e.dragHint)&&L<=1||(_.height=null!=(r=null==(t=e.style)?void 0:t.height)?r:12),_.left=e.vertical?_.left+(null!=(a=I.current)?a:0)+1*(null!=(n=I.current)?n:0)*_.width:_.left+(M<0?0:M),_.top=e.vertical?_.top+(M<0?0:M):_.top+z+1*(null!=(l=I.current)?l:0),S.current=L,R(c,_),b(!0),D(!0)},O=k.useCallback(e=>{const t=e&&e[0],r=p.current;void 0!==i.current&&window.cancelAnimationFrame(i.current),r&&t&&(r.width!==t.contentRect.width||r.height!==t.contentRect.height)&&(i.current=window.requestAnimationFrame(()=>{F()})),p.current={width:t.contentRect.width,height:t.contentRect.height}},[F]);k.useEffect(F);const W=u.current&&u.current.element?u.current.element.closest(".k-scheduler-layout"):null;return Bn({element:W,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),k.useEffect(()=>{if(!y.current)return;const e=window.ResizeObserver,t=e&&new e(O);return t&&t.observe(y.current),()=>{t&&t.disconnect()}},[O,y]),k.createElement(g,{...c,_ref:u,_order:I,_maxSiblingsPerSlot:S,_siblings:A,itemRef:u,style:{visibility:C?void 0:"hidden",display:f?void 0:"none",...e.style}},!e.resizeHint&&k.createElement(k.Fragment,null,e.tail&&!e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"rtl"===M?"chevron-right":"chevron-left",icon:"rtl"===M?d.chevronRightIcon:d.chevronLeftIcon})),k.createElement("div",{title:N},e.tail&&e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"chevron-up",icon:d.chevronUpIcon})),_&&!e.isAllDay&&!e.tail&&k.createElement("span",{className:"k-event-all-day-time"},v.formatDate(e.zonedStart,"t")),k.createElement(Kn,{className:"k-event-title"},e.title),_&&!e.isAllDay&&!e.head&&k.createElement("span",{className:"k-event-all-day-time"},v.formatDate(e.zonedEnd,"t")),!_&&k.createElement(Kn,{className:"k-event-time"},"recurring"===L&&k.createElement("span",{className:"k-event-recurrence-icon"},k.createElement(n.IconWrap,{name:"arrow-rotate-cw",icon:d.arrowRotateCwIcon})),"non-recurring"===L&&k.createElement("span",{className:"k-event-recurrence-icon"},k.createElement(n.IconWrap,{name:"arrows-no-repeat",icon:d.arrowsNoRepeatIcon})),z),e.head&&e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"chevron-down",icon:d.chevronDownIcon}))),L&&k.createElement("span",{className:"k-event-recurrence-icon"},k.createElement(n.IconWrap,{name:"recurring"===L?"arrow-rotate-cw":"arrows-no-repeat",icon:"recurring"===L?d.arrowRotateCwIcon:d.arrowsNoRepeatIcon})),e.head&&!e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"rtl"===M?"chevron-left":"chevron-right",icon:"rtl"===M?d.chevronLeftIcon:d.chevronRightIcon}))))}),xo={item:$n};To.displayName="KendoReactSchedulerProportionalViewItem",e.AgendaView=Xl,e.DATA_ACTION=te,e.DRAG_ITEM_ACTION=hl,e.DateHeaderCell=Nl,e.DayView=Pl,e.ITEMS_FOCUS_ACTION=Ya,e.ITEMS_SELECT_ACTION=$a,e.KeepResetCustomEventsDialog=wl,e.MonthView=co,e.REMOVE_ITEM_ACTION=vl,e.RESIZE_ITEM_ACTION=yl,e.RemoveRecurrenceConfirmDialog=ya,e.SERIES_ACTION=fl,e.SHOW_OCCURRENCE_DIALOG_ACTION=gl,e.SHOW_REMOVE_DIALOG_ACTION=El,e.SLOTS_FOCUS_ACTION=Va,e.SLOTS_SELECT_ACTION=Ka,e.Scheduler=Io,e.SchedulerActiveViewContext=De,e.SchedulerDataContext=fe,e.SchedulerDateContext=he,e.SchedulerDateRangeContext=pe,e.SchedulerDrag=tl,e.SchedulerEditItem=Rl,e.SchedulerEditItemDragItemContext=sl,e.SchedulerEditItemFormItemContext=ol,e.SchedulerEditItemPropsContext=ll,e.SchedulerEditItemRemoveItemContext=il,e.SchedulerEditItemResizeItemContext=cl,e.SchedulerEditItemShowOccurrenceDialogContext=dl,e.SchedulerEditItemShowRemoveDialogContext=ul,e.SchedulerEditSlot=On,e.SchedulerEditSlotFormItemContext=In,e.SchedulerEditSlotPropsContext=wn,e.SchedulerEditTask=Yl,e.SchedulerFieldsContext=ce,e.SchedulerFooter=xe,e.SchedulerForm=wa,e.SchedulerFormEditor=fa,e.SchedulerGroupsContext=de,e.SchedulerHeader=Ie,e.SchedulerItem=$n,e.SchedulerItemContent=Kn,e.SchedulerOccurrenceDialog=Pn,e.SchedulerOrientationContext=ve,e.SchedulerProportionalViewItem=To,e.SchedulerPropsContext=ne,e.SchedulerQuickCreateForm=zn,e.SchedulerRecurrenceDialog=ha,e.SchedulerRemoveDialog=Hn,e.SchedulerResize=al,e.SchedulerSlot=En,e.SchedulerTask=Kl,e.SchedulerViewItem=Vn,e.SchedulerViewSlot=bn,e.SchedulerViewTask=Bl,e.SchedulerViewsContext=oe,e.TimeHeaderCell=pn,e.TimelineView=Do,e.WeekView=mo,e.WorkWeekView=go,e.agendaViewDefaultProps=Jl,e.dateHeaderCellDefaultProps=Ll,e.dayViewDefaultProps=Hl,e.monthViewDefaultProps=io,e.schedulerDefaultProps=Ro,e.schedulerDragDefaultProps=rl,e.schedulerEditItemDefaultProps=Tl,e.schedulerEditSlotDefaultProps=Wn,e.schedulerEditTaskDefaultProps=jl,e.schedulerFormDefaultProps=Ia,e.schedulerFormEditorDefaultProps=Sa,e.schedulerProportionalViewItemDefaultProps=xo,e.schedulerQuickCreateFormDefaultProps={},e.schedulerResizeDefaultProps=nl,e.schedulerSlotDefaultProps=hn,e.schedulerViewItemDefaultProps=Gn,e.schedulerViewSlotDefaultProps=Sn,e.schedulerViewTaskDefaultProps=Vl,e.timeHeaderCellDefaultProps=gn,e.timeLineViewDefaultProps=Co,e.useSchedulerActiveViewContext=Ce,e.useSchedulerDataContext=ke,e.useSchedulerDateContext=ye,e.useSchedulerDateRangeContext=ge,e.useSchedulerEditItemDragItemContext=()=>k.useContext(sl),e.useSchedulerEditItemFormItemContext=()=>k.useContext(ol),e.useSchedulerEditItemPropsContext=()=>k.useContext(ll),e.useSchedulerEditItemRemoveItemContext=()=>k.useContext(il),e.useSchedulerEditItemResizeItemContext=()=>k.useContext(cl),e.useSchedulerEditItemShowOccurrenceDialogContext=()=>k.useContext(dl),e.useSchedulerEditItemShowRemoveDialogContext=()=>k.useContext(ul),e.useSchedulerEditSlotFormItemContext=()=>k.useContext(In),e.useSchedulerEditSlotPropsContext=()=>k.useContext(wn),e.useSchedulerFieldsContext=ie,e.useSchedulerGroupsContext=me,e.useSchedulerOrientationContext=Ee,e.useSchedulerPropsContext=le,e.useSchedulerViewsContext=se,e.weekViewDefaultProps=po,e.workWeekDefaultProps=vo});