UNPKG

@progress/kendo-react-scheduler

Version:

React Scheduler brings the functionality of Outlook's Calendar to a single UI component. KendoReact Scheduler package

15 lines 146 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2026 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ /** * @license *------------------------------------------------------------------------------------------- * Copyright © 2026 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ !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("@progress/kendo-react-dateinputs"),require("@progress/kendo-react-popup"),require("@progress/kendo-svg-icons"),require("react-dom"),require("@progress/kendo-react-form"),require("@progress/kendo-react-dialogs"),require("@progress/kendo-react-labels"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-dropdowns"),require("@progress/kendo-recurrence")):"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","@progress/kendo-react-dateinputs","@progress/kendo-react-popup","@progress/kendo-svg-icons","react-dom","@progress/kendo-react-form","@progress/kendo-react-dialogs","@progress/kendo-react-labels","@progress/kendo-react-inputs","@progress/kendo-react-dropdowns","@progress/kendo-recurrence"],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.KendoReactDateinputs,e.KendoReactPopup,e.KendoSvgIcons,e.ReactDOM,e.KendoReactForm,e.KendoReactDialogs,e.KendoReactLabels,e.KendoReactInputs,e.KendoReactDropdowns,e.KendoRecurrence)}(this,function(e,t,r,a,n,l,o,s,c,i,d,u,m,p,g,E,h,v){"use strict";function y(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 f=y(t),D=y(u);const k=(e,t=0,r=0,a=[])=>{if(e.length<=t)return[a];const n=[];return e[t].data.map(l=>{n.push(...k(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 S(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 C=(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},b=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"),w=(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],R=e=>e[e.length-1],x=e=>{const t=new Set;return e.forEach(e=>{t.add(e.field)}),t.size===e.length};const A=(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=A(e,t,r,a+1),l.style.pointerEvents=o,n},_=(e,t)=>n.getter(t)(e),M=(e,t,r)=>{if(t)return n.setter(t)(e,r)},N=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 L=(e,t,r)=>{const a=O(e,t)?_(e,t.id):_(e,t.recurrenceId);return r.find(e=>_(e,t.id)===a)},O=(e,t)=>{const r=_(e,t.id),a=_(e,t.recurrenceId),n=_(e,t.recurrenceRule);return!(!r||!n||null!=a)},F=(e,t)=>Math.max(e.getTime(),t.getTime()),P=(e,t)=>Math.min(e.getTime(),t.getTime()),W=(e,t,r,a,n=!1)=>n?F(t,a)-P(e,r)<=t.getTime()-e.getTime()+(a.getTime()-r.getTime()):F(t,a)-P(e,r)<t.getTime()-e.getTime()+(a.getTime()-r.getTime()),H={id:"id",start:"start",startTimezone:"startTimezone",originalStart:"originalStart",end:"end",endTimezone:"endTimezone",isAllDay:"isAllDay",title:"title",description:"description",recurrenceRule:"recurrenceRule",recurrenceId:"recurrenceId",recurrenceExceptions:"recurrenceExceptions"},K=(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},B=(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&&W(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)}})})},$=(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&&W(e.start,e.end,t.start,t.end)&&e.slots.push(t)})})},U=(...e)=>{},Z=(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)]},q=(e,t)=>(e.order||0)-(t.order||0),Y=6e4,j=[{}],X=new Date(1900,0,1),Q=new Date(2099,11,31);a.ZonedDate.fromLocalDate(X),a.ZonedDate.fromLocalDate(Q);var J=(e=>(e[e.create=0]="create",e[e.update=1]="update",e[e.remove=2]="remove",e))(J||{});const ee=f.createContext({current:null}),te=()=>f.useContext(ee);ee.displayName="SchedulerElementContext";const re=f.createContext({}),ae=()=>f.useContext(re);re.displayName="SchedulerPropsContext";const ne=f.createContext([]),le=()=>f.useContext(ne);ne.displayName="SchedulerViewsContext";const oe=f.createContext(H),se=()=>f.useContext(oe);oe.displayName="SchedulerFieldsContext";const ce=f.createContext({dateFormat:"{0:D}",shortDateFormat:"{0:d}"});ce.displayName="SchedulerDateFormatContext";const ie=f.createContext([{index:0,resources:[]}]),de=()=>f.useContext(ie);ie.displayName="SchedulerGroupsContext";const ue=f.createContext({start:new Date,end:new Date,zonedStart:a.ZonedDate.fromLocalDate(new Date),zonedEnd:a.ZonedDate.fromLocalDate(new Date)}),me=()=>f.useContext(ue);ue.displayName="SchedulerDateRangeContext";const pe=f.createContext(null),ge=()=>f.useContext(pe);pe.displayName="SchedulerOrientationContext";const Ee=f.createContext([new Date,U]),he=()=>f.useContext(Ee);Ee.displayName="SchedulerDateContext";const ve=f.createContext([[],U]),ye=()=>f.useContext(ve);ve.displayName="SchedulerDataContext";const fe=f.createContext(["day",U]),De=()=>f.useContext(fe);fe.displayName="SchedulerActiveViewContext";const ke=f.createContext([null,()=>{}]);ke.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:d,activeView:u,selection:m})=>f.createElement(ee.Provider,{value:t},f.createElement(re.Provider,{value:r},f.createElement(ne.Provider,{value:a},f.createElement(oe.Provider,{value:n},f.createElement(ce.Provider,{value:s},f.createElement(ie.Provider,{value:l},f.createElement(ue.Provider,{value:o},f.createElement(pe.Provider,{value:c},f.createElement(Ee.Provider,{value:i},f.createElement(ve.Provider,{value:d},f.createElement(fe.Provider,{value:u},f.createElement(ke.Provider,{value:m},e)))))))))))),Ce=(e,t,r)=>{const[a,n]=f.useState(t||e),l=f.useCallback((e,t)=>{n(e),r&&r.call(void 0,{...t,value:e})},[r,n]);return[void 0!==t?t:a,l]},be=f.forwardRef((e,t)=>{const{className:r,...a}=e,l=f.useRef(null),o=f.useRef(null);f.useImperativeHandle(o,()=>({element:l.current,props:e})),f.useImperativeHandle(t,()=>o.current);const c=f.useMemo(()=>n.classNames("k-scheduler-toolbar",r),[r]);return f.createElement(s.Toolbar,{id:e.id,ref:e=>{e&&(l.current=e.element)},className:c,...a},e.children)});be.displayName="KendoReactSchedulerHeader";const Ie=f.forwardRef((e,t)=>{const{className:r,...a}=e,l=f.useRef(null);return f.useImperativeHandle(t,()=>({element:l.current,props:e})),f.createElement(s.ToolbarItem,{ref:e=>{e&&(l.current=e.element)},className:n.classNames(r),...a},e.children)});Ie.displayName="KendoReactSchedulerSchedulerNavigation";const we=f.forwardRef((e,t)=>{const{className:r,...a}=e,l=f.useRef(null);return f.useImperativeHandle(t,()=>({element:l.current,props:e})),f.createElement(s.ToolbarItem,{ref:e=>{e&&(l.current=e.element)},className:n.classNames("k-scheduler-views",r),...a},e.children)});we.displayName="KendoReactSchedulerViewSelector";const Te=f.forwardRef((e,t)=>{const{className:r,style:a,...l}=e,o=f.useRef(null),c=f.useRef(null);f.useImperativeHandle(o,()=>({element:c.current,props:e})),f.useImperativeHandle(t,()=>o.current);const i=f.useMemo(()=>n.classNames("k-scheduler-footer",e.className),[e.className]);return f.createElement(s.Toolbar,{ref:e=>{e&&(c.current=e.element)},className:i,style:{boxShadow:"none",...a},...l},e.children)});Te.displayName="KendoReactSchedulerFooter";const Re="scheduler.allEvents",xe="scheduler.allDay",Ae="scheduler.today",_e="scheduler.timelineViewTitle",Me="scheduler.weekViewTitle",Ne="scheduler.workWeekViewTitle",ze="scheduler.agendaViewTitle",Le="scheduler.dayViewTitle",Oe="scheduler.monthViewTitle",Fe="scheduler.deleteTitle",Pe="scheduler.previousTitle",We="scheduler.nextTitle",He="scheduler.showFullDay",Ke="scheduler.showWorkDay",Ve="scheduler.editOccurrence",Ge="scheduler.editSeries",Be="scheduler.editRecurringConfirmation",$e="scheduler.editRecurringDialogTitle",Ue="scheduler.editSave",Ze="scheduler.editCancel",qe="scheduler.editorTitle",Ye="scheduler.editorEventTitle",je="scheduler.editorEventStart",Xe="scheduler.editorEventStartTimeZone",Qe="scheduler.editorEventEnd",Je="scheduler.editorEventEndTimeZone",et="scheduler.editorEventAllDay",tt="scheduler.editorEventDescription",rt="scheduler.editorEventSeparateTimeZones",at="scheduler.editorEventTimeZone",nt="scheduler.recurrenceEditorRepeat",lt="scheduler.recurrenceEditorDailyInterval",ot="scheduler.recurrenceEditorDailyRepeatEvery",st="scheduler.recurrenceEditorWeeklyInterval",ct="scheduler.recurrenceEditorWeeklyRepeatEvery",it="scheduler.recurrenceEditorWeeklyRepeatOn",dt="scheduler.recurrenceEditorMonthlyDay",ut="scheduler.recurrenceEditorMonthlyInterval",mt="scheduler.recurrenceEditorMonthlyRepeatEvery",pt="scheduler.recurrenceEditorMonthlyRepeatOn",gt="scheduler.recurrenceEditorYearlyOf",Et="scheduler.recurrenceEditorYearlyRepeatEvery",ht="scheduler.recurrenceEditorYearlyRepeatOn",vt="scheduler.recurrenceEditorYearlyInterval",yt="scheduler.recurrenceEditorFrequenciesDaily",ft="scheduler.recurrenceEditorFrequenciesMonthly",Dt="scheduler.recurrenceEditorFrequenciesNever",kt="scheduler.recurrenceEditorFrequenciesWeekly",St="scheduler.recurrenceEditorFrequenciesYearly",Ct="scheduler.recurrenceEditorOffsetPositionsFirst",bt="scheduler.recurrenceEditorOffsetPositionsSecond",It="scheduler.recurrenceEditorOffsetPositionsThird",wt="scheduler.recurrenceEditorOffsetPositionsFourth",Tt="scheduler.recurrenceEditorOffsetPositionsLast",Rt="scheduler.recurrenceEditorWeekdaysDay",xt="scheduler.recurrenceEditorWeekdaysWeekday",At="scheduler.recurrenceEditorWeekdaysWeekendday",_t="scheduler.recurrenceEditorEndAfter",Mt="scheduler.recurrenceEditorEndOccurrence",Nt="scheduler.recurrenceEditorEndLabel",zt="scheduler.recurrenceEditorEndNever",Lt="scheduler.recurrenceEditorEndOn",Ot="scheduler.editorDelete",Ft="scheduler.deleteConfirmation",Pt="scheduler.deleteRecurringConfirmation",Wt="scheduler.deleteOccurrence",Ht="scheduler.deleteSeries",Kt="scheduler.deleteDialogTitle",Vt="scheduler.deleteRecurringDialogTitle",Gt="scheduler.dateTitle",Bt="scheduler.timeTitle",$t="scheduler.eventTitle",Ut="scheduler.editorValidationRequired",Zt="scheduler.editorValidationStart",qt="scheduler.editorValidationEnd",Yt="scheduler.noEvents",jt="scheduler.moreEvents",Xt={[Ut]:"Field is required.",[Zt]:"Start time must be before End time.",[qt]:"End time must be after Start time.",[Re]:"All events",[xe]:"all day",[Ae]:"Today",[Le]:"Day",[Oe]:"Month",[Me]:"Week",[Ne]:"Work Week",[_e]:"Timeline",[ze]:"Agenda",[Fe]:"Delete",[Pe]:"Previous",[We]:"Next",[He]:"Show full day",[Ke]:"Show business hours",[Ve]:"Edit current occurrence",[Ge]:"Edit the series",[Be]:"Do you want to edit only this event occurrence or the whole series?",[$e]:"Edit Recurring Item",[Ue]:"Save",[Ze]:"Cancel",[Ot]:"Delete",[qe]:"Event",[Ye]:"Title",[je]:"Start",[Xe]:"Start Time Zone",[Qe]:"End",[Je]:"End Time Zone",[et]:"All Day Event",[tt]:"Description",[rt]:"End in different Time Zone",[at]:"Specify Time Zone",[nt]:"Repeat",[lt]:"day(s)",[ot]:"Repeat every",[st]:"week(s)",[ct]:"Repeat every",[it]:"Repeat on",[dt]:"Day",[ut]:"month(s)",[mt]:"Repeat every",[pt]:"Repeat on",[gt]:"of",[Et]:"Repeat every",[ht]:"Repeat on",[vt]:"year(s)",[yt]:"Daily",[ft]:"Monthly",[Dt]:"Never",[kt]:"Weekly",[St]:"Yearly",[Ct]:"First",[bt]:"Second",[It]:"Third",[wt]:"Fourth",[Tt]:"Last",[Rt]:"Day",[xt]:"Weekday",[At]:"Weekend Day",[_t]:"After",[Mt]:"occurrence(s)",[Nt]:"End",[zt]:"Never",[Lt]:"On",[Ft]:"Are you sure you want to delete this event?",[Pt]:"Do you want to delete only this event occurrence or the whole series?",[Wt]:"Delete current occurrence",[Ht]:"Delete the series",[Kt]:"Delete Event",[Vt]:"Delete Recurring Item",[Gt]:"Date",[Bt]:"Time",[$t]:"Event",[Yt]:"no events",[jt]:"More events"},Qt=f.forwardRef((e,t)=>{var r;const l=f.useRef(null),u=f.useRef(null);f.useImperativeHandle(t,()=>l.current);const{timezone:m}=ae(),p=a.ZonedDate.fromLocalDate(e.value,m),g=a.getDate(p),E=te(),h=n.useWindow(E),[v,y]=f.useState("desktop"),[D,k]=f.useState(!1),[S,C]=f.useState(!1),b=o.useInternationalization(),{dateFormat:I,shortDateFormat:w}=f.useContext(ce),T=me(),[R]=he(),x=T.end.getTime()-T.start.getTime()>27*a.MS_PER_DAY,A=b.format(I,x?R:T.zonedStart,x?R:T.zonedEnd.addDays(-1)),_=b.format(w,x?R:T.zonedStart,x?R:T.zonedEnd.addDays(-1)),M=f.useCallback(()=>{k(!D)},[D]),N=f.useCallback(()=>{C(!0)},[]),L=f.useCallback(()=>{k(!1),C(!1)},[]),O=f.useCallback(t=>{if(e.onChange){const r=a.ZonedDate.fromUTCDate(z(t.value),m);e.onChange.call(void 0,{...t,value:r})}k(!1)},[e.onChange,m]),F=f.useCallback(()=>{h().matchMedia&&y(h().matchMedia("(min-width: 1024px)").matches?"desktop":"mobile")},[h]);f.useEffect(()=>{F();const e=h().ResizeObserver,t=e&&new e(F);return t&&t.observe(E.current),()=>{e&&t.disconnect()}},[F,E,h]),f.useEffect(()=>{D&&S&&u.current&&u.current.focus()},[S,D]);const{onFocus:P,onBlur:W}=n.useAsyncFocusBlur({onFocus:N,onBlur:L});return f.createElement(f.Fragment,null,f.createElement(s.Button,{ref:l,onFocus:P,onBlur:W,fillMode:"flat",className:"k-nav-current",icon:"calendar",svgIcon:d.calendarIcon,"aria-live":"polite",tabIndex:-1,onClick:M},"desktop"===v?A:_),f.createElement(i.Popup,{anchor:null==(r=l.current)?void 0:r.element,show:D},f.createElement(c.Calendar,{ref:u,onFocus:P,onBlur:W,onChange:O,value:g})))});Qt.displayName="KendoReactSchedulerNavigationDatePicker";const Jt=f.forwardRef(()=>{const e=f.useRef(null),[t,r]=f.useState("desktop"),a=le(),l=n.useWindow(e),[c,i]=De(),u=a.find(e=>e.props.name===c),m=o.useLocalization(),p=f.useCallback(e=>{i&&(e.syntheticEvent.preventDefault(),i(e.item.name))},[i]),g=f.useCallback(e=>{i&&i(e)},[i]),E=f.useMemo(()=>a.map(e=>({value:e.props.name,text:"function"==typeof e.props.title?e.props.title(m):e.props.title,tabIndex:-1})),[a,m]),h=()=>{l().matchMedia&&r(l().matchMedia("(min-width: 1024px)").matches?"desktop":"mobile")};return f.useEffect(()=>{h();const t=l().ResizeObserver,r=t&&new t(h);return r&&r.observe(e.current),()=>{r&&r.disconnect()}},[]),f.createElement(f.Fragment,null,u&&"mobile"===t&&f.createElement("div",{className:"k-scheduler-tools",ref:e},f.createElement(s.DropDownButton,{className:"k-views-dropdown",onItemClick:p,popupSettings:{popupClass:"k-scheduler-toolbar"},textField:"title",items:a.map(e=>({...e.props,selected:e.props.name===c,title:"function"==typeof e.props.title?e.props.title(m):e.props.title})),text:f.createElement(f.Fragment,null,"function"==typeof u.props.title?u.props.title(m):u.props.title,f.createElement(n.IconWrap,{name:"chevron-down",icon:d.chevronDownIcon}))})),"desktop"===t&&f.createElement(s.SegmentedControl,{ref:t=>{t&&(e.current=t.element)},className:"k-scheduler-views",role:"group",value:c,onChange:g,items:E}))});Jt.displayName="KendoReactSchedulerViewSelectorList";const er=f.forwardRef((e,t)=>{const{className:r,...a}=e,l=f.useRef(null);return f.useImperativeHandle(t,()=>({element:l.current,props:e})),f.createElement(s.ToolbarItem,{ref:e=>{e&&(l.current=e.element)},className:n.classNames("k-scheduler-navigation",r),...a},e.children)}),tr=f.createContext({});tr.displayName="SchedulerViewPropsContext";const rr=f.createContext([]),ar=()=>f.useContext(rr);rr.displayName="SchedulerViewRangesContext";const nr=f.createContext([[],U]),lr=()=>f.useContext(nr);nr.displayName="SchedulerViewSlotsContext";const or=f.createContext([[],U]),sr=()=>f.useContext(or);or.displayName="SchedulerViewItemsContext";const cr=f.createContext([[],U]);cr.displayName="SchedulerViewSelectedSlotsContext";const ir=f.createContext([[],U]),dr=()=>f.useContext(ir);ir.displayName="SchedulerViewSelectedItemsContext";const ur=f.createContext([[],U]);ur.displayName="SchedulerViewFocusedItemsContext";const mr=f.createContext([[],U]),pr=()=>f.useContext(mr);mr.displayName="SchedulerViewFocusedSlotsContext";const gr=({children:e,props:t,ranges:r,slots:a,items:n,selectedSlots:l,selectedItems:o,focusedItems:s,focusedSlots:c})=>f.createElement(tr.Provider,{value:t},f.createElement(rr.Provider,{value:r},f.createElement(nr.Provider,{value:a},f.createElement(or.Provider,{value:n},f.createElement(cr.Provider,{value:l},f.createElement(ir.Provider,{value:o},f.createElement(ur.Provider,{value:s},f.createElement(mr.Provider,{value:c},e))))))));var Er=(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))(Er||{});var hr=(e=>(e.select="SLOTS_SELECT_SELECT",e.reset="SLOTS_SELECT_RESET",e.add="SLOTS_SELECT_ADD",e))(hr||{});const vr=(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 yr=(e=>(e.up="SLOT_FOCUS_UP",e.down="SLOT_FOCUS_DOWN",e.left="SLOT_FOCUS_LEFT",e.right="SLOT_FOCUS_RIGHT",e))(yr||{});const fr=(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),Dr=(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),kr=(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),Sr=(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 Cr=(e=>(e.next="ITEMS_FOCUS_NEXT",e.prev="ITEMS_FOCUS_PREV",e))(Cr||{});const br=f.forwardRef((e,t)=>{const r=f.useRef(null);f.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=Z(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=Z(t.item,e,t.ignoreIsAllDay,!0);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}}}])(a),[d,u]=(e=>[[],(t,r)=>{switch(t.type){case"SLOT_FOCUS_UP":{if(!t.slot.current||!e)return;const a=fr(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=Sr(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=Dr(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=kr(t.slot,e);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}}}])(o),[m,p]=(e=>{const[t,r]=f.useState([]),a=f.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=Z(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=Z(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]=f.useState([]),r=f.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]})(),h=f.useCallback((e,t)=>{E({type:hr.reset}),p(e,t)},[p,E]),v=f.useCallback((e,t)=>{p({type:Er.reset},t),E(e)},[p,E]),y=f.useMemo(()=>n.classNames("k-scheduler-layout k-scheduler-layout-flex",e.className),[e.className]);return vr({element:r,selector:".k-group-cell",attribute:"data-depth-index",explicitDepth:!0}),vr({element:r,selector:".k-side-cell",attribute:"data-depth-index",explicitDepth:!1}),f.createElement(gr,{props:e.props,ranges:e.ranges,items:[a,l],slots:[o,s],selectedItems:[m,h],selectedSlots:[g,v],focusedItems:[c,i],focusedSlots:[d,u]},f.createElement("div",{ref:r,style:e.style,className:y,role:"presentation"},e.children))});br.displayName="KendoReactSchedulerBaseView";const Ir=f.createContext({resource:{},groupIndex:0}),wr=e=>{const{nested:t,children:r,rowContentProps:a}=e,n=e.rowContent||xr,l=e.childRowContent||n,o=S(e.group,e.resources);return f.createElement("div",{className:"k-scheduler-group k-group-horizontal"},t?Tr({resources:o,children:r,nested:t,groupIndex:0,rowContent:n,rowContentProps:a,childRowContent:l}):Rr({resources:o,children:r,rowContentProps:a,childRowContent:l}))},Tr=e=>{const{resources:t,rowContent:r,nested:a,children:n,groupIndex:l,rowContentProps:o,childRowContent:s}=e;if(l===t.length)return Rr({resources:t,children:n,rowContentProps:o,childRowContent:s});const c=C(t,l),i=r;return f.createElement(f.Fragment,null,a?f.createElement("div",{className:"k-scheduler-row"},f.createElement(i,{resources:t,groupIndex:l,...o},c.map((e,t)=>f.createElement("div",{key:t,className:"k-scheduler-cell k-heading-cell"},e.text)))):f.createElement(i,{resources:t,groupIndex:l,...o},c.map((e,t)=>f.createElement("div",{key:t,className:"k-scheduler-cell k-heading-cell"},e.text))),Tr({resources:t,children:n,nested:a,rowContent:r,childRowContent:s,groupIndex:l+1}))},Rr=e=>{const{resources:t,childRowContent:r,children:a,rowContentProps:n}=e,l=C(t,t.length-1),o=r,s=t.length>0;return f.createElement("div",{className:"k-scheduler-row"},f.createElement(o,{resources:t,...n},(l.length?l:j).map((e,t)=>f.createElement("div",{key:t,className:"k-scheduler-cell k-group-cell"},f.createElement(Ir.Provider,{value:{resource:e,groupIndex:s?t:0}},a)))))};wr.displayName="KendoReactSchedulerHorizontalResourceIterator";const xr=e=>e.children,Ar=e=>f.createElement(f.Fragment,null,f.createElement("div",{className:"k-scheduler-cell k-side-cell","data-range-index":e.rangeIndex}),e.children),_r=e=>{const{nested:t,wrapGroup:r,children:a}=e,n=e.cellContent||Pr,l=S(e.group,e.resources);return f.createElement("div",{className:"k-scheduler-group"},t?r?f.createElement("div",{className:"k-scheduler-row"},f.createElement("div",{className:"k-sticky-cell"},zr({resources:l,children:a,cellContent:n,depth:0,groupIndex:0})),f.createElement("div",{className:"k-scheduler-cell k-group-content"},Nr({resources:l,children:a,cellContent:n,depth:0,groupIndex:0},!1))):Nr({resources:l,children:a,cellContent:n,depth:0,groupIndex:0},!0):r?f.createElement("div",{className:"k-scheduler-row"},f.createElement("div",{className:"k-sticky-cell"},Mr({resources:l})),f.createElement("div",{className:"k-scheduler-cell k-group-content"},a)):Lr({resources:l,children:a,cellContent:n,groupIndex:0}))},Mr=e=>f.createElement("div",{className:"k-scheduler-row"},f.createElement("div",{className:"k-scheduler-row"},e.resources.map((e,t)=>f.createElement("div",{key:t,className:"k-scheduler-cell k-resource-cell k-heading-cell","data-depth-index":t})))),Nr=(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 f.createElement(Ir.Provider,{value:{resource:r[o],groupIndex:s?l:0}},a);const c=r[o].data.length;return r[o].data.map((e,s)=>f.createElement("div",{key:s,className:"k-scheduler-row"},t&&f.createElement("div",{className:"k-scheduler-cell k-group-cell k-heading-cell","data-depth-index":o},e[r[o].textField]),f.createElement("div",{className:"k-scheduler-cell k-group-content k-resource-row","data-depth-index":o,"data-resource-index":c*l+s},Nr({resources:r,children:a,cellContent:n,groupIndex:c*l+s,depth:o+1},t))))},zr=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)=>f.createElement("div",{key:s,className:"k-scheduler-row"},f.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&&f.createElement("div",{className:"k-scheduler-cell k-resource-content"},zr({resources:t,children:r,cellContent:a,groupIndex:o*n+s,depth:l+1})))):null},Lr=e=>{const{resources:t,children:r,groupIndex:a,cellContent:n}=e;return f.createElement("div",{className:"k-scheduler-row"},Fr(t),n,Or(r,t,a))},Or=(e,t,r)=>{const a=t.length>0;return f.createElement("div",{className:"k-scheduler-cell k-group-content"},f.createElement(Ir.Provider,{value:{resource:t[r],groupIndex:a?r:void 0}},e))},Fr=e=>e.map((e,t)=>f.createElement("div",{key:t,className:"k-scheduler-cell k-group-cell k-heading-cell","data-depth-index":t}));_r.displayName="KendoReactSchedulerVerticalResourceIterator";const Pr=null,Wr=e=>{const t=o.useLocalization();return f.createElement(f.Fragment,null,f.createElement("div",{className:"k-scheduler-cell k-heading-cell k-side-cell k-scheduler-times-all-day"},t.toLanguageString(xe,Xt[xe])),e.children)},Hr=f.forwardRef((e,t)=>{const{as:r=Kr.as,...a}=e,l=f.useRef(null),s=f.useRef(null),c=o.useInternationalization(),i=f.useMemo(()=>n.classNames("k-scheduler-cell k-heading-cell",e.className),[e.className]);return f.useImperativeHandle(s,()=>({element:l.current&&l.current.element?l.current.element:l.current,props:e})),f.useImperativeHandle(t,()=>s.current),f.createElement(r,{ref:r!==Kr.as?void 0:l,...a,className:i},c.formatDate(e.date,e.format?e.format:Kr.format))}),Kr={as:f.forwardRef(({as:e,format:t,start:r,end:a,...n},l)=>f.createElement("div",{...n,ref:l})),format:"t"};Hr.displayName="KendoReactSchedulerTimeHeaderCell";const Vr=e=>{const{slot:t,children:r}=e;return f.createElement(f.Fragment,null,e.isMaster?f.createElement(Hr,{as:e.timeHeaderCell,date:t.zonedStart,start:t.zonedStart,end:t.zonedEnd,className:n.classNames("k-side-cell",{"k-major-cell":!e.isLast})}):f.createElement("div",{className:"k-scheduler-cell k-heading-cell k-side-cell"}),r)},Gr=e=>{const{onChange:t,data:r,validationMessage:a,visited:n,touched:o,modified:s,...c}=e,[i,d]=f.useState(r),u=f.useCallback(e=>t(e),[t]),m=f.useCallback(e=>{const t=l.filterBy(r||[],e.filter);d(t)},[]);return f.createElement(h.ComboBox,{style:{width:"100%"},data:i,filterable:!0,onFilterChange:m,onChange:u,...c})},Br=e=>{const{value:t,data:r,onChange:a,...n}=e,l=f.useCallback(e=>{a&&a.call(void 0,e.currentTarget.dataset.value)},[a]);return f.createElement(s.ButtonGroup,{className:"k-scheduler-recurrence-repeat",width:"100%",...n},r.map(e=>f.createElement(s.Button,{type:"button",key:e.value,selected:e.value===t,onClick:l,"data-value":e.value,togglable:!0},e.text)))},$r=e=>e.charAt(0).toUpperCase()+e.slice(1),Ur=["first","second","third","fourth","last"],Zr=["never","daily","weekly","monthly","yearly"],qr=[{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}],Yr=[{day:1,offset:0},{day:2,offset:0},{day:3,offset:0},{day:4,offset:0},{day:5,offset:0}],jr=[{day:0,offset:0},{day:6,offset:0}],Xr=e=>{switch(e){case"day":return qr;case"weekday":return Yr;case"weekend":return jr}},Qr=e=>{const{value:t,data:r,onChange:a,...n}={...Jr,...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 f.createElement(s.ButtonGroup,{width:"auto",...n},(e.data||Jr.data).map(e=>f.createElement(s.Button,{type:"button",key:e.value,"data-key":e.value,selected:t.some(t=>t===e.value),togglable:!0,onClick:l},$r(e.text))))},Jr={data:[],value:[]},ea=e=>{const t=o.useInternationalization(),r=o.useLocalization(),{timezone:n}=ae(),[l,s]=f.useState(1),[i,d]=f.useState(a.ZonedDate.fromUTCDate(e.start)),u=f.useCallback((e,t)=>{const a=t?e:"scheduler.recurrenceEditor"+e;return r.toLanguageString(a,Xt[a])},[r]),p=f.useMemo(()=>{var t;return(e=>v.parseRule({recurrenceRule:e})||{})(null!=(t=e.value)?t:ra.value)},[e.value]),y=f.useMemo(()=>(e=>Zr.map(t=>({value:t,text:e("Frequencies"+$r(t))})))(u),[u]),D=f.useMemo(()=>(e=>N(e)&&!(e=>(e=>null==e)(e)||e.trim&&0===e.trim().length)(e.freq)?e.freq:"never")(p),[p]),k=f.useMemo(()=>((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)})(t,u),[t,u]),S=f.useMemo(()=>((e,t,r)=>{var a;let n;if(N(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]})(k,p,e.start),[k,p,e.start]),C=f.useMemo(()=>(e=>e.dateFormatNames({type:"months",nameType:"wide",standAlone:!0}).map((e,t)=>({text:e,value:t+1})))(t),[t]),b=f.useMemo(()=>((e,t)=>e.find(e=>(t.byMonth?t.byMonth[0]:null)===e.value)||e[0])(C,p),[C,p]),I=f.useMemo(()=>(e=>{const t=[1,2,3,4,-1];return Ur.map((r,a)=>({text:e("OffsetPositions"+$r(r)),value:t[a]}))})(u),[u]),w=f.useMemo(()=>((e,t)=>e.find(e=>e.value===(t.bySetPosition?t.bySetPosition[0]:t.byWeekDay&&t.byWeekDay[0]?t.byWeekDay[0].offset:1))||e[0])(I,p),[I,p]),T=f.useMemo(()=>(e=>N(e.count)?"count":N(e.until)?"until":"never")(p),[p]),R=f.useMemo(()=>((e,t)=>N(e.byMonthDay)&&e.byMonthDay.length>0?e.byMonthDay[0]:t.getDate())(p,e.start),[p,e.start]),x=f.useMemo(()=>(e=>N(e.until)?a.toLocalDate(e.until):null)(p),[p.until]),A=f.useMemo(()=>(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))})(t),[t]),_=f.useMemo(()=>(e=>N(e.byWeekDay)?"weekday":N(e.byMonthDay)?"monthday":void 0)(p),[p.byWeekDay,p.byMonthDay]),M=f.useCallback(r=>{"never"===r.freq?e.onChange({value:null}):(void 0===r.weekStart&&(r.weekStart=t.firstDay()),e.onChange({value:v.serializeRule(r,e.timezone)}))},[e.onChange,e.timezone]),z=f.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]),M(r)},[M,e.start,n]),L=f.useCallback(e=>{const t=e.value;M(Object.assign({},p,{interval:t}))},[M,p]),O=f.useCallback(e=>{const t=e.value;M(Object.assign({},p,{count:t})),null!==t&&s(t)},[M,p]),F=f.useCallback(t=>{const r=t.value;if(!r)return;const n=a.ZonedDate.fromLocalDate(r,e.timezone);M(Object.assign({},p,{until:n})),d(n)},[M,p,e.timezone]),P=f.useCallback(e=>{M(Object.assign({},p,{byWeekDay:A.filter(t=>e.some(e=>e===t.value)).map(e=>({offset:0,day:e.value}))}))},[M,p,A]),W=f.useCallback(e=>{const t=Object.assign({},p),r=e.target.value;"string"==typeof r.value?(t.byWeekDay=Xr(r.value),t.bySetPosition=[w.value]):(t.bySetPosition=void 0,t.byWeekDay=[{day:r.value,offset:w.value}]),M(t)},[w.value,M,p]),H=f.useCallback(e=>{M(Object.assign({},p,{byMonthDay:[e.value]}))},[M,p]),K=f.useCallback(e=>{const t=e.value;M(Object.assign({},p,{byMonth:[t.value]}))},[M,p]),V=f.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=i,r.count=void 0}M(r)},[M,p,e.timezone]),G=f.useCallback(e=>{const t=Object.assign({},p);"monthday"===e.value?(t.byWeekDay=void 0,t.bySetPosition=void 0,t.byMonthDay=[R]):"weekday"===e.value&&(t.byMonthDay=void 0,"string"==typeof S.value?(t.bySetPosition=[w.value],t.byWeekDay=Xr(S.value)):t.byWeekDay=[{day:S.value,offset:w.value}]),M(t)},[M,p,R,S]),B=f.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}M(t)},[M,p]);return f.createElement(f.Fragment,null,f.createElement(m.FieldWrapper,null,f.createElement(g.Label,{className:"k-form-label"},r.toLanguageString(nt,Xt[nt])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(Br,{value:D,data:y,onChange:z}))),"never"!==D&&f.createElement(m.FieldWrapper,null,f.createElement(g.Label,{editorId:"interval-editor",className:"k-form-label"},u($r(D)+"RepeatEvery")),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(E.NumericTextBox,{min:1,step:1,defaultValue:1,value:p.interval,onChange:L,id:"interval-editor",className:"k-recur-interval"})," ",f.createElement(g.Label,{editorId:"interval-editor",className:"k-form-label"},u($r(D)+"Interval")))),"weekly"===D&&f.createElement(m.FieldWrapper,null,f.createElement(g.Label,{className:"k-form-label"},u(it,!0)),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(Qr,{data:A,value:(p.byWeekDay||[]).map(({day:e})=>e),onChange:P}))),"monthly"===D&&f.createElement(m.FieldWrapper,null,f.createElement(g.Label,{key:"recurrence-repeat-on-monthly-label",className:"k-form-label"},u(pt,!0)),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(E.RadioGroup,{value:_,onChange:G,item:ta,className:"k-reset",data:[{value:"monthday",label:u(dt,!0),children:[f.createElement(f.Fragment,{key:"separator"}," "),f.createElement(E.NumericTextBox,{key:"weekday-day",min:1,max:31,disabled:"monthday"!==_,value:p&&p.byMonthDay&&p.byMonthDay[0],onChange:H,width:"auto"})]},{value:"weekday",label:" ",children:[f.createElement(h.DropDownList,{key:"weekday-offset",textField:"text",dataItemKey:"value",disabled:"weekday"!==_,data:I,value:w,onChange:B,style:{width:"auto"}}),f.createElement(f.Fragment,{key:"separator"}," "),f.createElement(h.DropDownList,{key:"weekday-value",disabled:"weekday"!==_,value:S,data:k,onChange:W,textField:"text",dataItemKey:"value",style:{width:"auto"}})]}]}))),"yearly"===D&&f.createElement(m.FieldWrapper,null,f.createElement(g.Label,null,u(ht,!0)),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(E.RadioGroup,{value:_,item:ta,onChange:G,className:"k-reset",data:[{value:"monthday",label:" ",children:[f.createElement(h.DropDownList,{key:"monthday-month",disabled:"monthday"!==_,value:b,data:C,textField:"text",dataItemKey:"value",onChange:K,style:{width:"auto"}}),f.createElement(f.Fragment,{key:"separator"}," "),f.createElement(E.NumericTextBox,{key:"monthday-day",min:1,max:31,disabled:"monthday"!==_,value:R,onChange:H,width:"auto"})]},{value:"weekday",label:" ",children:[f.createElement(h.DropDownList,{key:"yearly-weekday-offset",textField:"text",dataItemKey:"value",disabled:"weekday"!==_,data:I,value:w,onChange:B,style:{width:"auto"}}),f.createElement(f.Fragment,{key:"yearly-separator-1"}," "),f.createElement(h.DropDownList,{key:"yearly-weekday-day",textField:"text",dataItemKey:"value",disabled:"weekday"!==_,value:S,data:k,onChange:W,style:{width:"auto"}}),f.createElement(f.Fragment,{key:"yearly-separator-2"}," "),f.createElement("span",{key:"yearly-weekday-of-label"},u(gt,!0)),f.createElement(f.Fragment,{key:"yearly-separator-3"}," "),f.createElement(h.DropDownList,{key:"yearly-weekday-month",textField:"text",dataItemKey:"value",disabled:"weekday"!==_,value:b,data:C,onChange:K,style:{width:"auto"}})]}]}))),"never"!==D&&f.createElement("div",{className:"k-scheduler-recurrence-end-rule-editor"},f.createElement(m.FieldWrapper,null,f.createElement(g.Label,{className:"k-form-label"},u(Nt,!0)),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(E.RadioGroup,{item:ta,value:T,onChange:V,data:[{value:"never",label:u(zt,!0)},{value:"count",label:u(_t,!0),children:[f.createElement(f.Fragment,{key:"separator-1"}," "),f.createElement(E.NumericTextBox,{key:"endrule-after-editor",id:"k-endrule-after",className:"k-recur-count",min:1,width:"auto",value:"count"===T?p.count:l,onChange:O,disabled:"count"!==T}),f.createElement(f.Fragment,{key:"separator-2"}," "),f.createElement(g.Label,{key:"endrule-after-label",className:"k-radio-label",editorId:"k-endrule-after"},u(Mt,!0))]},{value:"until",label:u(Lt,!0),children:[f.createElement(f.Fragment,{key:"separator"}," "),f.createElement(c.DatePicker,{key:"k-endrule-until-editor",id:"k-endrule-until",disabled:"until"!==T,min:e.start,value:"until"===T?x:a.toLocalDate(i),onChange:F,width:"auto"})]}]})))))},ta=e=>f.createElement("li",{...e},e.children),ra={value:""};ea.displayName="KendoReactSchedulerRepeatEditor";const aa=e=>{const{as:t=oa.as,value:r,onChange:a,...n}=e,{timezone:l}=ae(),o=f.useMemo(()=>na(r,l),[r,l]);return f.createElement(t,{...n,value:o,onChange:e=>{a&&a({value:la(e.target.value,l)})}})},na=(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},la=(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},oa={as:c.DateTimePicker},sa=f.forwardRef((e,t)=>{const r=f.useRef(null),l=f.useRef(null),s=a.timezoneNames(),i=o.useLocalization(),d=se(),{resources:u,timezone:p}=ae();f.useImperativeHandle(l,()=>{var t;return{element:null!=(t=r.current)&&t.element?r.current.element:r.current,props:e}}),f.useImperativeHandle(t,()=>l.current);const{as:E=ca.as,...h}=e,{titleLabel:v=ca.titleLabel,titleError:y=ca.titleError,titleEditor:D=ca.titleEditor,startLabel:k=ca.startLabel,startError:S=ca.startError,startEditor:C=ca.startEditor,startTimezoneLabel:b=ca.startTimezoneLabel,startTimezoneError:I=ca.startTimezoneError,startTimezoneEditor:w=ca.startTimezoneEditor,startTimezoneCheckedLabel:T=ca.startTimezoneCheckedLabel,startTimezoneCheckedEditor:R=ca.startTimezoneCheckedEditor,endLabel:x=ca.endLabel,endError:A=ca.endError,endEditor:_=ca.endEditor,endTimezoneLabel:M=ca.endTimezoneLabel,endTimezoneError:N=ca.endTimezoneError,endTimezoneEditor:z=ca.endTimezoneEditor,endTimezoneCheckedLabel:L=ca.endTimezoneCheckedLabel,endTimezoneCheckedEditor:O=ca.endTimezoneCheckedEditor,allDayLabel:F=ca.allDayLabel,allDayEditor:P=ca.allDayEditor,recurrenceEditor:W=ca.recurrenceEditor,descriptionLabel:H=ca.descriptionLabel,descriptionEditor:K=ca.descriptionEditor,descriptionError:V=ca.descriptionError,resourceLabel:G=ca.resourceLabel,resourceEditor:B=ca.resourceEditor}=e,$=e.valueGetter(d.start)||new Date,U=e.valueGetter(d.startTimezone)||p||"",Z=e.valueGetter(d.endTimezone)||p||"",q=f.useMemo(()=>i.toLanguageString(Ut,Xt[Ut]),[i]),[Y,j]=f.useState(!!e.valueGetter(d.startTimezone)),[X,Q]=f.useState(!!e.valueGetter(d.endTimezone)),J=f.useCallback(t=>{t.value||(e.onChange(d.startTimezone,{value:null}),e.onChange(d.endTimezone,{value:null}),Q(t.value)),j(t.value)},[e.onChange,d.startTimezone,d.endTimezone]),ee=f.useCallback(t=>{t.value||e.onChange(d.endTimezone,{value:null}),Q(t.value)},[e.onChange]),te=f.useCallback(e=>e?void 0:q,[q]),re=f.useCallback((e,t)=>Y?te(t(d.startTimezone)):void 0,[te,Y,d.startTimezone]),ne=f.useCallback((e,t)=>Y&&X?te(t(d.endTimezone))||te(t(d.startTimezone)):void 0,[te,Y,X,d.startTimezone,d.endTimezone]),le=f.useMemo(()=>n.classNames("k-scheduler-edit-form",e.className),[e.className]);return f.createElement(E,{ref:E===ca.as?r:void 0,...h,className:le},f.createElement(f.Fragment,null,f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.title,component:v,editorId:"k-scheduler-editor-title",className:"k-form-label"},i.toLanguageString(Ye,Xt[Ye])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{id:"k-scheduler-editor-title",name:d.title,field:d.title,component:D}),e.errors[d.title]&&f.createElement(m.Field,{name:d.title,component:y},e.errors[d.title]))),f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.start,component:k,editorId:"k-scheduler-editor-start",className:"k-form-label"},i.toLanguageString(je,Xt[je])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{id:"k-scheduler-editor-start",name:d.start,width:"auto",component:C,as:e.valueGetter(d.isAllDay)?c.DatePicker:c.DateTimePicker,timezone:p}),e.errors[d.start]&&f.createElement(m.Field,{name:d.start,component:S},e.errors[d.start]))),f.createElement(m.FieldWrapper,null,f.createElement(T,{className:"k-form-label"}),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(R,{id:"k-scheduler-editor-set-start-timezone",onChange:J,value:Y}),f.createElement(T,{className:"k-checkbox-label",editorId:"k-scheduler-editor-set-start-timezone"},i.toLanguageString(at,Xt[at])))),Y&&f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.start,component:b,className:"k-form-label"},i.toLanguageString(Xe,Xt[Xe])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{component:w,value:U,validator:re,data:s,name:d.startTimezone}),e.errors[d.startTimezone]&&f.createElement(m.Field,{name:d.startTimezone,component:I},e.errors[d.startTimezone]))),f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.end,component:x,editorId:"k-scheduler-editor-end",className:"k-form-label"},i.toLanguageString(Qe,Xt[Qe])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{id:"k-scheduler-editor-end",name:d.end,width:"auto",component:_,as:e.valueGetter(d.isAllDay)?c.DatePicker:c.DateTimePicker,timezone:p}),e.errors[d.end]&&f.createElement(m.Field,{name:d.end,component:A},e.errors[d.end]))),Y&&f.createElement(m.FieldWrapper,null,f.createElement("div",{className:"k-form-field-wrap"},f.createElement(O,{id:"k-scheduler-editor-set-end-timezone",onChange:ee,value:X})),f.createElement(L,{editorId:"k-scheduler-editor-set-end-timezone",className:"k-form-label"},i.toLanguageString(rt,Xt[rt]))),X&&f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.endTimezone,component:M,className:"k-form-label"},i.toLanguageString(Je,Xt[Je])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{value:Z,data:s,validator:ne,component:z,name:d.endTimezone}),e.errors[d.endTimezone]&&f.createElement(m.Field,{name:d.endTimezone,component:N},e.errors[d.endTimezone]))),f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.isAllDay,component:g.Label,className:"k-form-label"}),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{id:"k-is-allday-checkbox",name:d.isAllDay,component:P}),f.createElement(m.Field,{name:d.isAllDay,field:d.isAllDay,editorId:"k-is-allday-checkbox",className:"k-checkbox-label",component:F},i.toLanguageString(et,Xt[et])))),f.createElement("div",{className:"k-recurrence-editor"},f.createElement(m.Field,{component:W,field:d.recurrenceRule,name:d.recurrenceRule,start:$})),f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.description,component:H,className:"k-form-label"},i.toLanguageString(tt,Xt[tt])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{component:K,name:d.description,rows:1,id:"k-event-description"}),e.errors[d.description]&&f.createElement(m.Field,{name:d.description,component:V},e.errors[d.description]))),(u||[]).map(e=>f.createElement(m.FieldWrapper,{key:e.field},f.createElement(m.Field,{name:e.field,component:G,className:"k-form-label"}),f.createElement(g.Label,{className:"k-form-label"},e.name),f.createElement(m.Field,{name:e.field,component:B,resource:e,multiple:e.multiple,data:e.data,textField:e.textField,valueField:e.valueField,colorField:e.colorField})))))}),ca={as:f.forwardRef((e,t)=>f.createElement(m.FormElement,{ref:t,id:e.id,style:e.style,tabIndex:e.tabIndex,className:e.className,horizontal:e.horizontal,children:e.children})),titleLabel:g.Label,titleError:g.Error,titleEditor:E.Input,startLabel:g.Label,startError:g.Error,startEditor:aa,startTimezoneLabel:g.Label,startTimezoneError:g.Error,startTimezoneEditor:Gr,startTimezoneCheckedLabel:g.Label,startTimezoneCheckedEditor:E.Checkbox,endLabel:g.Label,endError:g.Error,endEditor:aa,endTimezoneLabel:g.Label,endTimezoneError:g.Error,endTimezoneEditor:Gr,endTimezoneCheckedLabel:g.Label,endTimezoneCheckedEditor:E.Checkbox,allDayLabel:g.Label,allDayEditor:E.Checkbox,recurrenceEditor:ea,descriptionLabel:g.Label,descriptionEditor:E.TextArea,descriptionError:g.Error,resourceLabel:g.Label,resourceEditor:e=>{const t=e.multiple?h.MultiSelect:h.DropDownList,r=f.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=f.useCallback((t,r)=>{const a=f.createElement(f.Fragment,null,e.colorField&&f.createElement("span",{key:1,className:"k-scheduler-mark",style:{backgroundColor:r.dataItem[e.colorField],marginRight:N(r.dataItem[e.valueField])?"8px":"4px"}}," "),f.createElement("span",{key:2},"  ",t.props.children));return f.cloneElement(t,{...t.props},a)},[e.colorField,e.valueField]),n=f.useCallback((t,r)=>{const a=f.createElement(f.Fragment,null,e.colorField&&r&&f.createElement("span",{key:1,className:"k-scheduler-mark",style:{backgroundColor:r[e.colorField],marginRight:r[e.valueField]?"8px":"4px"}}," "),t.props.children);return f.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 f.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})}};sa.displayName="KendoReactSchedulerFormEditor";const ia=f.forwardRef((e,t)=>{const{onCancel:r,onClose:a,onSubmit:l,editor:c,dialog:i=da.dialog,validator:u=da.validator,...g}=e,E=f.useRef(null);f.useImperativeHandle(E,()=>({props:e})),f.useImperativeHandle(t,()=>E.current);const h